Posts

Showing posts from April, 2011

java - Threads & networking issue -

given following code: client c1 = new client(); c1.connect("127.0.0.1",1300); connect function: public void connect(string servername, int port) { try { socket socket = new socket(servername,port); connection = new connectionproxy(socket); connection.start(); } catch(ioexception e) { e.printstacktrace(); } } ( connectionproxy class extends thread ) : public class connectionproxy extends thread { private socket socket; private inputstream is; private outputstream os; private stringconsumer client; public connectionproxy(socket socket) { this.socket = socket; try { = socket.getinputstream(); os = socket.getoutputstream(); } catch(ioexception e) { e.printstacktrace(); } } public void run () { datainputstream dis = new datainputstream(is); dataoutputstream dos = new dataoutputstream(os); while (socket != null) { try { string

asp.net - error StartIndex cannot be less than zero -

hi guys new regex world think have code on have work can make modification code doing have find ticket number list of string got error length cannot less 0 add check when add check on got error startindex can not less 0 writing code details my aspx.cs page: using system.windows.forms; using system.data; namespace aqcconsolidator1 { public partial class form1 : form { private void btngetdata_click(object sender, eventargs e) { list<string> list = new list<string>(); list<string> list1 = new list<string>(); string history = @"rp/dca1s219c/dca1s219c sl/su 7feb13/2215z 8txsak 36 fa pax 125-7239038457/etba/07feb13/dca1s211e/49881134 /s4-5/p3 37 fa pax 125-7239038458/etba/07feb13/dca1s211e/49881134 /s4-5/p1 38

html - How to take nth-child in css? -

how select :nth-child() elements in html except last element. is valid= td:nth-child:not(last-child){ //some css// } i using text-overflow:ellipsis property hide overflow table in <td> elements. it got successful using even , odd children of <td> . want ellipsis effects in td blocks except last child of table. i've given try- .table-condensed tbody tr td:nth-child:not(last-child) { white-space: nowrap; text-overflow: ellipsis; width: 150px; display: block; overflow: hidden; } but that's not trick obviously. suggestions? little bit long-winded, should trick: tr:not(:last-child) > td, tr:last-child > td:not(:last-child) { // styles } here's fiddle

django - data's are not saving in database -

i using following code in views.py def when(request): log.debug("test....") reportform = reportform() if request.method == 'post': if reportform.is_valid(): log.debug("test:%s",reportform) reportform = reportform.save() return render_to_response('incident/when.html',{'newreport_menu': true, 'form': reportform },context_instance=requestcontext(request)) my template is {{ form.manual_date_time }} <p id=ir-nextbutn><a href="{% url incident.views.media %}"> <form action="/member/media/" method="post"> {% csrf_token %} {% include "buttons/next.html" %} </form> models.py class report(models.model): user = models.foreignkey(user, null=false) incident_number = models.charfield('incident number', max_length=100) device_id = models.charfield('device id', max_length=100

VerySleepy Profiling c++ code -

while profiling code find going slow, have 3functions taking forever apparently, thats sleepy says. these functions are: zwdelayexecution 20.460813 20.460813 19.987685 19.987685 msgwaitformultipleobjects 20.460813 20.460813 19.987685 19.987685 waitforsingleobject 20.361805 20.361805 19.890967 19.890967 can tell me these functions are? why taking long, , how fix them. thanks probably functions used make thread 'sleeping' in win32 api. might used thread synchronization check these thing. they taking cpu time because designed that. the waitforsingleobject function can wait following objects: change notification console input event memory resource notification mutex process semaphore thread waitable timer so other possible thing can used console user input waiting. zwdelayexecution internal function of windows. can seen used realize sleep function. here call stack sleep function can see own eyes: 0 ntdll.dll

java - Exception while iterating in JSP -

i have class product has field list<productcategorydetail> , productcategorydetail has field of category type , category has field list<subcategory> . product | |----- list<productcategorydetail> | |----category | |---------list<subcategory> my objective iterate on list of productcategorydetail object product . i using following code in jsp: <c:foreach items="${product.productcategorydetails}" var="productcategorydetails" varstatus="status"> <tr id="category_row"> <td> <form:label path="productcategorydetails[${status.index}].category">category</form:label> </td> <td> <form:select cssstyle="width:134px" path="productcategorydetails[${status.index}].category.id" cssclass="category&qu

Passing Parameter & Headers with Apache HttpDelete for Rest Web Service Android -

i have end point of http delete method. want pass headers, more content-type=application/x-www-form-urlencoded . there parameters based on @ server side decided record should deleted. and server implementation not accessible me. i using apache http client . method http delete follow : private string dodelete(string url, map<string,string> params, map<string,string> headermap){ httpclient httpclient = new defaulthttpclient(httpparams); httpdelete httpdelete = new httpdelete(httprequestwrapper.geturl()); if(headermap != null){ for(string headername : headermap.keyset()){ httpdelete.addheader(headername, headermap.get(headername)); } } if(params != null){ for(string paramname : params.keyset()){ httpparams.setparameter(paramname, params.get(paramname)); } httpdelete.setparams(httpparams); } httpresponse httpresponse = httpclient.execute(httpdelete); httpentity

c# - Orchard Deployment problems 404 error -

i love orchard, .net deveoper looking use cms, followed orchard cms book great good... problem thought lets see if can deploy on vps... presented big problems lots of errors. so went basics downloaded fresh copy of orchard...and ran first time set , tried deploy that... using visual studio 2012 right clicked published chose publish file system ftp across server... copied app data folder in binary mode changed settings.txt point prod database. tried open website , 404 error.. when in app logs see.. 2013-05-02 11:40:52,439 [15] orchard.filesystems.appdata.appdatafolder - not delete recipe execution folder c:\websites\orchardtestdeploy\src\orchard.web\app_data\recipequeue\25fc7ed3855649e68c0435a7dcf412b3 under "app_data" folder 2013-05-02 11:44:45,702 [6] orchard.environment.defaultorchardhost - tenant not started: default autofac.core.dependencyresolutionexception: none of constructors found 'orchard.environment.autofacutil.dynamicproxy2.cons

ruby on rails - Implicitly trust SSL certificates in iOS app for private API -

i'm working on ios app rails backend, running on vps (via own domain). my question is: insecure use self-signed ssl certificate on server , ignore warnings nsurlconnection while communicating it, considering private api accessible via my ios app? the safe way go in scenario is: sign , manually add certificate local certificate database of every system work from, don't need authentication know it's yours. can done automatically checking box "ignore warning certificate" first time connect each system, prevent seen again on system unless certificate changes. this way won't see warning again, unless it's else's self certificate you're looking at. ignoring warning default means if else signs own certificate , presents you, go along without noticing. not idea.

javascript - Legend in Highcharts should not pick up colours specified in series data -

my code follows : var options = { chart: { type: 'column', events: { click: $scope.gotopath(link) } }, title: { text: "" }, xaxis: { categories: ['you', 'average', 'top quartile'], labels: { style: { fontsize: '14px', color: 'grey' } } }, yaxis: { title: { text: '' } }, plotoptions: { column: { colorbypoint: true, datalabels: { enabled: true, color: '#000000', style: { fontweight: 'bold' }, formatter: $scope.getbarvalues() } } }, series: [{ showinlegend: true, name: 'planning sites', data: metric1["chart_numbers"], colors: ['#3399cc', '#cccc33', '#686868'] }, { showinlegend: true, name: 'build out , implementation', data: metric2[&qu

regex - EXtracting sub-string in Perl? -

i have string in variable: $mystr = "some text %parts/dir1/dir2/myfile.abc more text"; now %parts literally present in string, not variable or hash. want extract sub-string %parts/dir1/dir2/myfile.abc it. created following reg expression. beginner in perl. please let me know if have done wrong. my $local_file = substr ($mystr, index($mystr, '%parts'), index($mystr, /.*%parts ?/)); i tried this: my $local_file = substr ($mystr, index($mystr, '%parts'), index($mystr, /.*%parts' '?/)); but both give nothing if print $local_file . might wrong here? thank you. update: referred following sites using method: http://perlmeme.org/howtos/perlfunc/substr.html see example 1c how take substring of given string until first appearance of specified character? the index function returns first index of occurrence of substring in string, else -1 . has nothing regular expressions. regular expressions applied string bind operator =~ .

linux - generating 64 bit code on 32bit debian system -

could please describe how have installed gcc-multilib , g++-multilib on 32bit debian machine generate 64 bit code? i installed gcc-4.7.2 on 32bit debian system(and installed binutils-2.23). when try compile simple hello world program -m64 flag # gcc -m64 hello.c i getting following error message: "hello.c:1:0: sorry, unimplemented: 64-bit mode not compiled in" . please tell me steps generate 64bit code on 32bit debian system. you need re-install gcc option in configure .

AngularJS factory http returns empty -

i'm trying angularjs first time. i'm getting json data http-get request using factory, object returned empty, before ajax-request done. factory: mydemo.factory('photosfactory', function($http) { var photos = []; var factory = {}; factory.getphotos = function() { $http({ url: 'content/test_data.json', method: 'get' }).success(function(data, status, headers, config) { photos = data; return photos; }); }; return factory; }); controller: controllers.appctrl = function($scope, $location, $http, photosfactory) { $scope.photos = []; init(); function init() { $scope.photos = photosfactory.getphotos(); } }; this i've come with. when controller set $scope.photos, value empty if returns photos array before populated ajax response. you should modify code return promise , use value in controller pls see dummy modified code

java - Selenium WebDriver getCssValue() is not returning anything for background-repeat-x -

i'm attempting verify background image present , property set repeat x. getting image with driver.findelement(by.xpath("//body").getcssvalue("background-image"); returns can parse i'm there. however, when try repeat-x property, no output: driver.findelement(by.xpath("//body").getcssvalue("background-repeat-x"); the css, seen in element viewer in chrome, looks this: background: #213a6a url('/images/background.png') repeat-x top; background-image: url(http://mysite/images/background.png); background-position-x: 50%; background-position-y: 0%; background-size: initial; background-repeat-x: repeat; background-repeat-y: no-repeat; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(33, 58, 106); any help, gratefully received. thanks. can test value of 'background-repeat' property 'repeat no-repeat' ?

mapreduce - Mongodb - combine data from two collections -

i know has been covered quite lot on here, however, i'm new mongodb , struggling applying answers i've found situation. in short, have 2 collections 'total_by_country_and_isrc' output mapreduce function , 'asset_report' contains asset_id not present in 'total_by_country_and_isrc' collection or original raw data collection mapreduced from. an example of data in 'total_by_country_and_isrc' is: { "_id" : { "custom_id" : 4748532, "isrc" : "gbcej0100080", "country" : "ae" }, "value" : 0 } and example of data in 'asset_report' is: { "_id" : objectid("51824ef016f3edbb14ef5eae"), "asset id" : "a836656134476364", "asset type" : "web", "metadata origination" : "unknown", "custom id" : "4748532", "isrc" :

JavaFX code editor with content highlighter for Java Code -

i want write text editor in javafx acts similar eclipse/netbeans ide highlight java code. can suggest how can achieved or has done previously. thanks. there's no pure javafx libraries code highlighting / editing far know, if want implement in javafx you're going translating similar swing (or other) project, or you're on own. however, can use such javascript library , wrap in webview if want achieve - jewelsea (who swings here) has done , explained rather nicely here .

java - Is it possible to have multiple xmlRootElements? -

i need have vo represent following xml <rowset> <row> <order_num>5101330188</order_num> <line_num_seq>55</line_num_seq> <prod_num_req>9bx134-505</prod_num_req> </row> </rowset> how can define 2 xmlrootelements representing rowset , row? vo this: import javax.xml.bind.annotation.xmlattribute; import javax.xml.bind.annotation.xmlelement; import javax.xml.bind.annotation.xmlrootelement; @xmlrootelement(name = "rowset") public class testvo { string order_num; string line_num_seq; string prod_num_req; @xmlelement public string getline_num_seq() { return line_num_seq; } public void setline_num_seq(string line_num_seq) { line_num_seq = line_num_seq; } @xmlelement public string getorder_num() { return order_num; } public void setorder_num(string order_num) { order_num = order_num; } @xmlelement public string get

How to filter 2D array in Flex and perform computation based on Filtering -

i have array follows: asia india calcutta 100 200 asia india chennai 200 400 asia india mumbai 100 300 asia pak xxxxxx 100 300 asia pak ssssss 200 100 americas canada ottawa 200 200 americas canada toronto 120 200 americas mexico sonoro 110 500 i need filter above dataset calculating sum of each region use of specific filter such region name given.(eg. asia) output filter asia must give me : india 400 900 pak 300 400 how possible in flex array 2d.

emacs - How can I debug emacs23 fonts loading? -

i want use same 9x15 fixed fonts have in xterm in emacs reason can't load them when running emacs on linux through windows x server. query x server shows path of available fonts: # xset q|grep "program files"|tr ":" "\n" c:/program files/hummingbird/connectivity/14.00/exceed/font/misc,c c:/program files/hummingbird/connectivity/14.00/exceed/font/100dpi,c c:/program files/hummingbird/connectivity/14.00/exceed/font/75dpi,c c:/program files/hummingbird/connectivity/14.00/exceed/font/misc_utf8,c c:/program files/hummingbird/connectivity/14.00/exceed/font/100dpi_utf8,c c:/program files/hummingbird/connectivity/14.00/exceed/font/75dpi_utf8,c c:/program files/hummingbird/connectivity/14.00/exceed/font/andrew,c c:/program files/hummingbird/connectivity/14.00/exceed/font/pc,c c:/program files/hummingbird/connectivity/14.00/exceed/font/hp,c c:/program files/hummingbird/connectivity/14.00/exceed/font/dec100,c c:/program files/hummingbird/connectivity/14.00/

3d - Figuring out if data is linearly separable -

so i've been given bunch of 3d data points of 2 types , b in list format , question trying solve asking me @ data points , determine if think linearly separable or not(just looking @ points). however don't know how go telling if they're linearly separable looking @ points. there hints or tricks or sort of method can use determine answer? the number of data points pretty small. there's 25 points in group , 40 in group b. suppose there linear page separate data. suppose page written as: z = mx + ny + o for fining page, should find m, n , o in such way z>0 data in , z<0 data in b. solved constraint programming techniques.

asp.net mvc - Jquerymobile autodividers using jquery ajax -

i using listview in jquerymobile. have ul tag , inserting list of li through ajax. want implement auto-divider in listview. how can that. my code (html) <ul id="guestlistview_guests" class="ul_guestlist" data-role="listview" data-theme="d"> </ul> i have tried it. did not work $('#guestlistview_guests').attr("data-autodividers", true); $('#guestlistview_guests').listview('refresh'); you can specify data-autodividers = "true" statically in html code itself. if list empty not make difference. later after dynamically adding list items, .listview('refresh') or .listview('refresh',true)

php - mysqli_fetch_array expects parameter 1 to be mysqli_result, null -

this question has answer here: mysqli_fetch_array()/mysqli_fetch_assoc()/mysqli_fetch_row() expects parameter 1 resource or mysqli_result, boolean given 33 answers hey working on code create list of students depending on entry on html form. receiving following error: warning: mysqli_query() expects parameter 1 mysqli, string given in ..... on line 15. i have made lot of changes , rearrangements can't seem work. hints of absolutely amazing!! the code is: <?php require_once 'connect.php'; mysql_select_db("db_ll20g11"); if ($_post ['criterion'] == 'c'){ $status = 'current'; echo 'current students list<br/>'; } else{ $status ='left'; echo' left students list <br/>'; } $listings = "select * student status ='".$status.

c# - Using Custom IHttpActionInvoker in WebAPI for Exception Handling -

i'm trying add custom ihttpactioninvoker webapi application in order prevent need lots of repeated exception handling code in action methods. there doesn't seem out there how other this article . after writing ihttpactioninvoker per article added code: globalconfiguration.configuration.services.remove(typeof(ihttpactioninvoker), globalconfiguration.configuration.services.getactioninvoker()); globalconfiguration.configuration.services.add(typeof(ihttpactioninvoker), new myapicontrolleractioninvoker()); into method within global.asax file. when executing call api following exception raised @ remove() method: the service type ihttpactioninvoker not supported i guess have 2 questions. considering there doesn't seen awful lot out there writing custom ihttpactioninvoker classes considered approach solve exception handling in webapi applications? does know why such exception when executing remove() method , how best fix particular issue? i suffered

Connecting a PDF file to a DataBase -

i've been told possible create pdf forms save input data on database. example create form , send work group, compile , data in form automatically saved database. possible? have pointers tutorials on how that? googled bit couldn't find useful info. thanks

java - in the mouse click method when i call the method get X() and get Y() it return -8 regardless the position -

public void mouseclicked(mouseevent e) { system.out.println("mouse click working"); system.out.println(getx()); system.out.println(gety()); } you're calling getx() , gety() on containing class, not on mouseevent . e.g. need e.getx();

asp.net mvc 4 - IIS Express re-compiling on almost every call after load of NuGet package -

my web application has been working fine. recently, began trying add twitter bootstrap project using nuget (it doesn't appear nuget issue because same thing happens if add tb manually). after doing so, noticed app misbehaving ... items displaying page server-side cache missing. as dug this, realized app being re-loaded on every call. placed break point in bundleconfig , sure enough ... every call, i'm hitting break point. if uninstall package, things start working fine again. furthermore, doesn't seem twitter bootstrap. seems if install new packages system, starts happening ... if i'm pushing iis express on sort of memory boundary? i've tried verify of normal iisexpress issues re-compiling ... things being written bin, etc. don't see activity on front (and i'm not explicitly writing there). i'm not writing web.config in code or either. last bit of information -- if publish non-working app qa server, works fine. qa server full-blown i

timer - getting "java.lang.RuntimeException" when sending latitude and longitude to remote mysql database within service in android" -

i've created android application there 2 buttons start stop. when start button clicked on every 1 seconds current latitude , longitude values send usl post insert remote mysl database. within start button wrote service myservice sending latitude , longitude. within onstartcommand(..) method of myservice have wrote timer sending latitude , longitude @ 1 second. but i'm getting following exception java.lang.runtimeexception: can't create handler inside thread has not called looper.prepare() can please tell me solution this my code given below iloadpage.java import android.app.activity; import android.content.intent; import android.os.bundle; import android.view.view; import android.widget.button; public class iloadpage extends activity { button start,stop; boolean flag=true; double latin,longin,longitude,latitude; activity activity; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate

Possible class function in C# -

i have class created: public class character { public string name, owner; public int str, con, dex, int, wis, cha, ac, speed, maxhp, currhp, ap, sv, surges; } as can see, it's simple class @ moment. question is, there way create class inside when call function can have math equation returned? example: character c = new character(); c.name = "goofy"; c.owner = "me"; c.str = 15; messagebox.show(c.str.mod); the output window "7" (mod is: math.floor(str / 2);) i have been trying search both , google time , have yet figure out. may searching wrong phrases or might not possible. thanks only way can think extension methods class program { static void main(string[] args) { character c = new character(); c.name = "goofy"; c.owner = "me"; c.str = 15; console.writeline(c.str.mod()); console.read(); } } public class character { public string na

coding style - PHP "use" declarations repeated or with a comma? -

i curious know, when declaring use statements php @ start of class, why "use" keyword repeated in each line though possible put coma @ end off line next declaration, following: namespace behat\mink; use behat\mink\driver\driverinterface, behat\mink\selector\selectorshandler, behat\mink\element\documentelement; unlike this: namespace symfony\bundle\frameworkbundle\controller; use symfony\component\httpfoundation\response; use symfony\component\httpfoundation\redirectresponse; use symfony\component\dependencyinjection\containeraware; use symfony\component\httpkernel\exception\notfoundhttpexception; use symfony\component\form\formtypeinterface; use symfony\component\form\form; use symfony\component\form\formbuilder; use symfony\bundle\doctrinebundle\registry; use symfony\component\httpfoundation\request; it ease copy/paste ? mimic import statements of java ? or don't care... :) it's convenience allow multiple statements on same line. here&#

How to stop VBA function showing formula result in Arguments Dialog in MS Excel -

when add udf ms-excel using vba, function gets evaluated twice when inserting: 1) arguments given function in function arguments dialog: hence result shown in function arguments dialog formula result 2) after clicking ok in function arguments dialog: hence result shown in respective cell. i referred stop vba evaluate calling target function twice made function not evaluated ever. can please know way of stopping double evaluation of udf function? thanks if problem of double evaluation speed considerations (the udf takes long time calculate) suggest following. adding parameter called docalculate udf put false in cell a1 in worksheet point udf docalculate parameter cell a1 add line of code exit function if docalculate false this way udf not calculate function dialog. activate udf changing a1 true

c# - Unconstrained Melody error -

i installed nuget package jon skeet's unconstrained melody project, when attempt use it, error when compile: type parameter 't' inherits conflicting constraints 'unconstrainedmelody.ienumconstraint' , 'system.valuetype' function definition: public void setenum<t>() t : struct, ienumconstraint {} am missing something? should not use nuget package? i wrong, appears while library uses ienumconstraint internally, , gets work postbuild steps described in article, not provide magic consume ienumconstraint directly own methods. the getvalues<t> method described in post 1 of several methods provided unconstrainedmelody.enums class. there other objects , methods available well. if wanted constrain own generic methods enums, follow same steps jon used build library, on own library. there this example in comments of how postsharp.

php - TCPDF landscape custom page size issue -

when try generate landscape page custom size tcpdf, page not fit asked @ all. try : require('tcpdf.php'); $pdf = new tcpdf('l', 'mm', array(210,97), true, 'utf-8', false); $pdf->setprintheader(false); $pdf->setprintfooter(false); $pdf->setfont('helvetica', '', 10); $pdf->addpage('l', array(210,97)); $pdf->text(0, 72, 'test'); $pdf->text(0, 73, 'test'); $pdf->output('test.pdf', 'i'); tcpdf add new page, shouldn't. it's same images. page doesn't seem 210mm large. is me or tcpdf bug ? how solve ? thank ! nils

javascript - Launch fancyBox from button click -

im stuck little problem fancybox v2. i want launch fancybox on button click. once clicked, load images list (from src attribute of ). i have created jsfiddle show trying do: http://jsfiddle.net/fpfzg/ jquery(document).ready(function($) { $('button').on('click', function() { $.fancybox(); }); }); can see how possible? i had same question , found following simpler method: html <button class="fancybox" value="open fancybox">open fancybox</button> <div class="hidden" id="fancybox-popup-form"> (your fancybox content goes in here) </div> jquery $('.fancybox').click(function () { $.fancybox([ { href : '#fancybox-popup-form' } ]); }); css .hidden { display: none; } further reading fancybox docs (click "api methods" tab, read on first method, called "open").

mysql - Selecting a COUNT of values, grouped by that same column, distinct on another -

here's sample schema: | type_id | university_id | --------------------------- | 1 | u01 | | 2 | u01 | | 2 | u01 | | 3 | u02 | | 4 | u02 | and want count of amount of records have same university_id , university_id itself, , must not include duplicates of type_id , result same data given above: | university_id | count(university_id) | ---------------------------------------- | u01 | 2 | | u02 | 2 | right i'm trying following, give me count(u01) of 3 instead of 2 select university_id, count(university_id) table group university_id is possible want, , if how? you should count type_id uniquely not university_id select university_id, count(distinct type_id) totalcount tablename group university_id sqlfiddle demo

Is there a way to itereate through all frames in windbg? -

is there way iterate through frames in windbg? (or run dv each stack frame) example: ~*e !mk -cc iterate through threads , call !mk -cc what want basically: for each thread: switch thread: ~0s for each frame in thread: .frame 00 dv just wondering if there way automate this? able generate script do: ~0s .frame 00 dv .frame 01 dv .frame 02 ... but multistep process, , want automate all. you can use ~e command execute command per-thread. can use !for_each_frame execute command each call frame. example: ~*e .echo thread frames , locals:; !for_each_frame dv the .echo command included mark 1 thread ends , next begins.

apache - Eclipse Map and Reduce Plugin & Hadoop Tutorial -

i'm brand new hadoop , i'm following yahoo tutorial ( http://developer.yahoo.com/hadoop/tutorial/ ). i'm trying configure eclipse , map , reduce plugin connect virtual machine. 1 of settings need configure hadoop.job.ugi . not appear under advanced settings tab of plugin. without settings, seems plugin useless because cannot connect vm. suggestions? have googled question various times no avail. also, know of more hadoop tutorials? yahoo ones seems 1 available starts beginner perspective. trying use cloudera starting point, struggled find documentation beginner. maybe missed something, website not organized in opinion. with respect question tutorial.. have seen question being asked before , had few answers here: https://stackoverflow.com/questions/2627389/how-to-learn-using-hadoop https://stackoverflow.com/questions/735791/hadoop-examples?rq=1 i haven't used yahoo plugin respect question on yahoo plugin issue, let else answer add if startin

html - URL with domain substitution in javascript -

we have website, www.domain.com, want publish in other languages fr.domain.com, jp.domain.com, etc. each language subdomain separately managed site, not true multi-lingual system. want able have common chunk of code on top can link between same page on different language domains. specifically, i'd have link of language links along top this:     french | japanese now, suppose user on english site on page www.domain.com/a/b/c.html i language links on top automatically written as <a href='http://fr.domain.com/a/b/c.html'>french</a>| <a href='http://jp.domain.com/a/b/c.html'>japanes</a>| ...etc... this easy using server-side techniques need can done purely html and/or javascript (i.e., little chunk of html and/or javascript can inserted via richtext editor of content management system). thanks suggestions! get current location document.location.href inject correct language function makelink(lang) { return docu

ios - Preprocessor Directives to separate targets in xcode -

Image
i have 2 targets on project 1 production , 1 stage different configurations. want in code able say #if target == production nslog(@"production"); #elif target == stage nslog(@"stage"); #endif can please tell me how can that? thank you, ~sonic555gr you can define preprocessor macros each target, this... and can this: #ifdef production //some code #elif stage //some other code #else //more code^^ #endif but carefull if need in debug- and/or in release-build, have declare there.

.net - How to transfer data from one form to another in winforms c#? -

i want create @ 5-6 forms in windows application insert data. each form contain at-least 15-20 controls. forms belongs different table. same. i have created stored "next"named button on each form, such when click on next button information filled on button store where , in way after storing information on last button submit button dragged, on clicking on submit button data got saved data base. please tell me how can store data inserted on previous forms , call on click event of submit button. for having controls on same page , have used these codes insertion. private void submit_addbtn_click(object sender, eventargs e) { try { //personal data insert personal per = new personal(); per.name = nametxt.text; per.fathername = f_nametxt.text; per.mothername = m_nametxt.text; per.gotra = gotra_txt.text; per.panth = panthcb

emacs - A function that can toggle between term-char-mode and term-line-mode submodes? -

in term.el, can change 1 submode another. but, there way toggle between them 1 function(and 1 key-binding)? question: there way mark text keyboard in term-char-mode? first, 1 should ask single question in single posting. second, there no toggle function in term.el can add 1 yourself: (defun term-toggle-mode () (interactive) (if (term-in-line-mode) (term-char-mode) (term-line-mode))) (define-key term-mode-map "\c-c\c-t" 'term-toggle-mode) you can see other term keymaps using c-h term.*map ret , add define-key forms them too. third, use cua library select text keyboard.

zend framework2 - ZF2 mobile subdomain route -

i have website (in zf2) on localhost, , need have 2 url's (that get) localhost/site m.localhost/site (mobile) but, when try url mobile subdomain (m.localhost/site) in module.config.php doesn't works. make that return array( 'router' => array( 'routes' => array( 'mobile' => array( 'type' => 'hostname', 'options' => array( 'route' => m.localhost', 'defaults' => array( 'controller' => 'mobile\controller\index', 'action' => 'index', ), ), ),... i read examples http://briangallagher.ie/2013/01/29/hostname-subdomain-routing-and-urls-using-zf2/ how route multi subdomain zend router hostname but doesn't works me. help? thanks!!!! pd: sorry english

functional programming - Why OCaml's threading is considered as `not enough`? -

it seems many people saying ocaml not have capacity concurrency , not web server applications. i learning ocaml's manual . seems ocaml provide concurrency now. can know why ocaml's concurrency/threading considered bad? can develop server application in ocaml? problems may meet? see concurrency vs. parallelism — what's difference? . ocaml's threads offer concurrency, can have next function start before previous 1 finished. ocaml not offer parallelism, when second function starts, first 1 has put on hold. 2 threads cannot run simultaneously, multiple cpu-bound computations in process block each other, , can't max out cpu cores in 1 process. that's people's beef ocaml's threading. mean can't use ocaml server? no. it's have take account in server design, it's not showstopper. heck, node.js straight-up single-threaded, yet main purpose creating servers.

asp.net - Unable to get IE10 to match Chrome and Firefox display -

i have asp.net 4.0 application i'm trying balance 3 browsers. content lines should firefox , chrome, when displaying in ie10 text elements become substantially larger , no longer flow within layout correctly. oddly enough, ie8 displays correctly, ie10 in compatibility mode, using <meta http-equiv="x-ua-compatible" content="ie=emulateie8"/> or <meta http-equiv="x-ua-compatible" content="ie8"/> has no effect (using first element in head.) there's hotfix asp.net 4.0 adds user agent ie10 (without ie10 displayed in basic mode), seems have been replaced windows update seems have been applied (the hotfix installation blocked result.) issue described here, asp.net website looks different on ie10 . at point i'm not sure else causing issue. here's picture of difference, chrome appearance above ie10 give comparison: http://i.imgur.com/qrds3ws.png both browsers in zoom 100% mode, ie10 making larger. here code

c# - DataGridView Button Click Returns Wrong Index -

simple problem. have datagridview set using datatable , add 2 columns after datatable buttons. when click button has index 6, gives me index 1 first button. datatable cartresults = cart.runcartquery(sb.tostring()); dgcart.datasource = cartresults; // add button datagridview @ specified position datagridviewbuttoncolumn btnedit = new datagridviewbuttoncolumn(); btnedit.name = "btnedit"; btnedit.text = "edit"; btnedit.headertext = "edit quantity"; btnedit.usecolumntextforbuttonvalue = true; dgcart.columns.insert((int)buttons.edit, btnedit); datagridviewbuttoncolumn btndelete = new datagridviewbuttoncolumn(); btndelete.name = "btndelete"; btndelete.text = "delete"; btndelete.headertext = "delete"; btndelete.usecolumntextforbuttonvalue = true; //dgcart.columns.insert((int)buttons.delete, btndelete);

internet explorer - ajax function for jsonp parsing is not working in IE -

i have done following code josnp parsing works fine on mozilla , on google chrome $.ajax({ cache: false, url: printerurl }).done(function(data, textstatus, jqxhr){ // code } and used following library jquery <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> now problem above library not supportd ie , if add lower version of library http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js then ajax function not working please me out issue please ... , in advance...

javascript - Can WGS84 results be converted to NAD83 in form? -

i have html5 form uses geolocator script populate text boxes lat/long & elevation tablet gps. data return using wgs84 datum database used store form data requires nad83 datum. is there script convert default wgs84 data nad83 prior populating fields or data have post-processed? <fieldset> <div> latitude: <input type="text" id="lat" name="lat" ></div> <div>longitude: <input type="text" id="long" name="long" value=""></div> <div><label><input type="text" id="acc" name="long" value="" data-mini="true"></label> <button onclick="getlocationconstant()" value="get location" data-mini="true"></button> </div> <script> function getlocationconstant() { if(navigator.geolocation) { navigator.geolocation.getcurrentposition(ongeosucces

Importing big Excel file to Mathematica -

i trying import big xlsx file mathematica 9 , error import::nojmem: there insufficient java heap space operation. try increasing java virtual machine heap size. increasing heap size isn't helping. i tried save file csv output long list of values. how can import file correctly or how can convert list matrix form? thanks.

ruby on rails - Rack: /var/app/current: No such file or directory on Elastic beanstalk -

im trying clone repository onto rails root on aws elastic beanstalk instance but im experiencing following error rb. %x(git clone #{a["clone_url"]} #{rails.root.join('repos',a["owner"]["login"],a["name"])}) /var/app/support/logs/passenger.log 2013/05/02 16:26:08 [error] 1741#0: *4 "/var/app/current/public/index.html" not found (2: no such file or directory), client: 127.0.0.1, server: _, request: "head / http/1.1", host: "0.0.0.0" (github) request phase initiated. (github) callback phase initiated. rack: /var/app/current: no such file or directory - git clone https://github.com/henghonglee/behaviortree.git /var/app/current/repos/henghonglee/behaviortree i have installed git on ec2 instance , managed perform clone independantly(not using rails app). should have done in '/var/app/ondeck' instead? you didn't provide when cloning executed. safe, test if folder exists. should