Posts

Showing posts from May, 2011

How can typescript generate single one javascript file without reference typescript file code -

can typescript generate single 1 javascript file without reference typescript file code? here 2 typescript source files. class source1{...}; class source 2{...}; here 2 typescript files. ///reference path=’source1’ class reference1{...}; ///reference path=’source2’ class reference2{...}; i generate reference1 , reference2 single 1 js file. in js file, there source1 , source2 code. how can single javascript file without souce1 , soucre2 code? thanks. looks me need split compilation 2 phases, 1 generate soruce1 , soruce2, , 1 generate reference1 , reference2. best way generate .d.ts first batch of files reference in second compilation. to generate sources.d.ts: tsc --declaration --out soruces.js soruce1.ts source2.ts now files should like: ///reference path=’sources.d.ts’ class reference1{...}; ///reference path=’source.s.ts’ class reference2{...}; the second compilation be: tsc --out references.js reference1.ts reference2.ts

javascript - Trigger after every 3rd time -

this question has answer here: javascript run function inside loop every x iterations 5 answers i want trigger event after every 3rd time. for (i = 0; < 5000; i++) { // when == 3, == 6, == 9 etc. if () { trigger(); } } i can't figure out how represent in code, brain stuck. unless write: if == 3 if == 6 etc. but write millions of these since unlimited. you could... increment i 3, not 1 use modulo check so for (i = 0; < 5000; i=i+3) { ... } or for (i = 0; < 5000; i++) { // when == 3, == 6, == 9 etc. if (i % 3 == 0) { trigger(); } }

regex - How to match the exact number of digits with regular expression in Javascript -

in javascript, have done following: var matched = searched.match(/\d{7}/) it works great if searched 1234567 or xyz1234567 . both return 1234567 , good. 123 , xyz123 return null, expected. but 1 condition fails when searched 12345678 or xyz12345678 . both return null because exact 7 digit match. both return 2345678 instead. /\d{7}$/ not work either. can please advise? thank you (?:\d|^) : begins non-digit (?:\d|$) : ends non-digit var matched = searched.match(/(?:\d|^)(\d{7})(?:\d|$)/); if (matched) { matched = matched[1]; }

html - hide specific divs after clicking on other div using jQuery -

i quite new in jquery. i have html code below generated on fly , added page: <div class="outstandingcallback"> <span>a</span> <span>b</span> </div> <div class="outstandingcallback"> <span>c</span> <span>d</span> </div> ...... i need hide 1 of them when click on other one. used following jquery not sure how can hide div element. $('.outstandingcallback').bind('click', function () { var selectdcallitemid = $(".callitemid", this).html(); var myhtmlcode = $('#callbacks').html(); $('' + myhtmlcode + '').find('div').each(function () { var thiscallid = $(".callitemid", this).html(); if (thiscallid == selectdcallitemid ) { alert("test"); $('' + myhtmlcode + &#

iphone - Convert number to phone format using regular expression -

Image
my problem have text field number , must convert number phone format 1 (xxx) xxx-xxxx . have tried regular expression code: wholetext = [wholetext stringbyreplacingoccurrencesofstring:@"(\\d{1,3})(\\d{0,3})(\\d{0,4})" withstring:@"($1) $2-$3" options:nsregularexpressionsearch range:nsmakerange(0, wholetext.length)]; nslog(@"wholetext = %@", wholetext); if gradually enter text in text field, nslog output this: wholetext = (1) - wholetext = (12) - wholetext = (123) - wholetext = (123) 4- wholetext = (123) 45- wholetext = (123) 456- wholetext = (123) 456-7 so problem do not need brackets , hyphens if there no number before it , i.e. closing bracket should appear after enter 4th number , hyphen should appear after enter 7th number. use utility uitextfield subclass allows

java - printing only filled data from JTable with logo -

my program hava jtable 100 blank rows. let user fills 10 rows. want print filled rows logo on top. how ? here code used: if(e.getsource() == print){ try { table.print(jtable.printmode.fit_width, head, null); } catch (java.awt.print.printerexception e1) { system.err.format("cannot print %s%n", e1.getmessage()); } } it prints 100 rows. i want print filled rows( let first 10 rows filled) you can filter empty rows before printing: table.setautocreaterowsorter(true); rowfilter filter = new rowfilter() { public void include(entry entry) { // here add loop checks if // of values in entry not-null // return true if yes, false otherwise (that empty) } }; ((defaultrowsorter) table.getrowsorter()).setrowfilter(filter); table.print(....);

math - How to get the true Euclidean remainder? -

i have 2 unsigned long s a , q , find number n between 0 , q-1 such n + divisible q (without overflow). in other words, i'm trying find (portable) way of computing (-a)%q lies between 0 , q-1. (the sign of expression implementation-defined in c89.) what's way this? what you're looking mathematically equivalent (q - a) mod q, in turn equivalent (q - (a mod q)) mod q. think should therefore able compute follows: unsigned long result = (q - (a % q)) % q;

How to create view db2/iseries with not default permissions? -

everytime create new view have change permissions all, , it's quite painfully lot of times same thing. i ask if possible change default options in database create view in order permissions set public. thanks it sounds using sql naming. use system naming instead, grant public authority according qcrtaut system value. see birgitta hauser's article . system naming has added advantage of using job's library list resolve unqualified object references. not hard-coding schema names, allowing system find them according library list, enabling code work in different environments (ex. development, testing, training, production) without modifying code, running different library list. therefore can install code production same code tested.

javascript - Google maps setCenter using marker is not working properly as its is showing the market at left-top instead of center -

google maps setcenter using marker not working showing market @ left-top instead of center. following code have used : <body id="viewmapscreen"> <div id="map" style="width: 600px; height: 349px;"></div> <script type="text/javascript"> var address = 'pune, maharastra, india'; var map = new google.maps.map(document.getelementbyid('map'), { maptypeid: google.maps.maptypeid.roadmap, zoom: 8 }); var geocoder = new google.maps.geocoder(); geocoder.geocode({ 'address': address }, function(results, status) { if(status == google.maps.geocoderstatus.ok) { new google.maps.marker({ position: results[0].geometry.location, map: map }); map.setcenter(results[0].geometry.location); } }); </script> </body> change width , height of div, works fine. <div id=&

c# - How to Compare Two dataTable and Update non matched rows in a DataTable which gives the resultDataTable? -

masterdata id     name 1     central 2    east 3    east central 4    east coastal 5    north 6    north west 7    south 8    south central 9    west data received id     name     value 1     central    125.65 5     north     553.21 i want result followes id     name            value 1     central             125.65 2     east                0.0 3     east central             0.0 4     east coastal         0.0 5     north         553.21 6     north west        0.0 7     south         0.0 8     south central        0.0 9     west         0.0 please note datatable how can result let datatable declared following: var dt1 = new datatable(); dt1.columns.add(new datacolumn("id", typeof(int))); dt1.columns.add(new datacolumn("name", typeof(string))); var dt2 = new datatable(); dt2.columns.add(new datac

How to Detect Invalid Pattern Lock Entry in Android -

this question has answer here: android listener wrong lock-pattern 1 answer i want develop android app perform action when user enter invalid pattern lock or pin code while unlocking mobile. don't know it. body can guide me? create deviceadminreceiver set handle action_password_failed events, receiver handle in onpasswordfailed() . can read more device admin apis at: http://developer.android.com/guide/topics/admin/device-admin.html

objective c - Working with circle radials. Subtraction and addition -

i'm working magnetic headings , struggling little bit math around it. let's have heading of 270 degrees, , turn clockwise 110 degrees. want new heading, 020 degrees, output , not 380 degrees. best way this: if (x > 360) { x = x - 360; } or can use calculations m_pi make more correct? thanks replies! an angle of x degree equal angle x satisfies x = x [360] that's modular arithmetic note x can less -360 or greater 720, in case, adding or subtracting 360 won't give result you're expecting. if want pure calculation method adding or subtracting, can use piece of code: if (x >= 360){ while( x >= 360) x -= 360; } }else if (x < 0){ while( x < 0) x += 360; } } or, more easily, in objective-c, operator gives value of x satisfying equation below , being in interval of [0;360[ ,is % operator. can use way: x = x % 360 although, angles may not int types. operator won't work because takes int argument

django - How to deal with "SubfieldBase has been deprecated. Use Field.from_db_value instead." -

on upgrade django 1.9, warning removedindjango110warning: subfieldbase has been deprecated. use field.from_db_value instead. i see problem arises. have custom field definitions, , in them have __metaclass__ = models.subfieldbase . example, class durationfield(models.floatfield): __metaclass__ = models.subfieldbase def __init__(self, *args, **kwargs): ... if __metaclass__ statement deprecated, supposed replace exactly? do take out , add from_db_value method in example here: https://docs.djangoproject.com/en/1.9/howto/custom-model-fields/#converting-values-to-python-objects ? and how from_db_value , to_python different? both seem convert database data python objects? yes, should remove __metaclass__ line , add from_db_value() , to_python() : class durationfield(models.floatfield): def __init__(self, *args, **kwargs): ... def from_db_value(self, value, expression, connection, context): ... def to_python(self,

c# - Why Do Bytes Carryover? -

i have been playing byte arrays (dealing grayscale images). byte can have values 0-255. modifying bytes, , came across situation value assigning byte outside bounds of byte. doing unexpected things images playing with. i wrote test , learned byte carries over. example: private static int setbyte(int y) { return y; } ..... byte x = (byte) setbyte(-4); console.writeline(x); //output 252 there carryover! happens when go other way around well. byte x = (byte) setbyte(259); console.writeline(x); //output 3 i have expected set 255 in first situation , 0 in second. purpose of carry over? due fact i'm casting integer assignment? when useful in real-world? byte x = (byte) setbyte(259); console.writeline(x); //output 3 the cast of result of setbyte applying modulo 256 integer input, dropping bits outside range of byte. 259 % 256 = 3 why : implementers choose consider 8 least significant bits, ignoring rest.

swift2 - How do I make my navigation bar transparent in swift? -

Image
i want make navigation controller this. main view should continue top. but when trying implement result: how can handle problem. want implement in first image. can help? thanks i use in apps make navigationbar transparent (if navigationbar in uinavigationcontroller): self.navigationcontroller?.navigationbar.setbackgroundimage(uiimage(), forbarmetrics: .default) self.navigationcontroller?.navigationbar.shadowimage = uiimage() self.navigationcontroller?.navigationbar.translucent = true now can still add buttons , title navigationbar. edit: swift 3 (thanks drbreakalot) self.navigationcontroller?.navigationbar.setbackgroundimage(‌​uiimage(), for: .default) self.navigationcontroller?.navigationbar.shadowimage = uiimage() self.navigationcontroller?.navigationbar.istranslucent = true

node.js - Return value is undefined (should be string) -

i started develop stuff nodejs , got frustrating error. i have function compile .jade .html function compilejadefile(jadefile){ var pathtofile = "./index.jade"; fs.exists(pathtofile, function(exists){ if(exists){ fs.readfile(pathtofile, function(err, data){ var html = jade.compile(data)(); return html; }); } }); } everything works fine want serve compiled html. did this: res.write(compilejadefile("index.jade")); (don't bother unused parameter of compilejadefile , used in original. shortened example) now if log result of compilejadefile("index.jade") console says "undefined" :( i searched google found nothing solves problem. can of me? i'm used code in c# or c++ maybe i'm missing or special javascript? your code synchronous, code using asynchronous. problem when call compilejadefile

sql server - SQL Delete duplicate rows with lowest number -

i can't find appropriate way delete duplicate keys in sql table lowest number. if there duplicate rows same number, need delete 1 of them. for example key number description 11111 5 desc1 11111 4 desc2 22222 2 desc1 22222 2 desc2 33333 3 desc1 33333 5 desc2 here need deleted second row number 4 smaller number 5, 1 of third or fourth row, , fifth row have smaller number 3 last row 5. query remove duplicate in sql-server: ;with c ( select *, row_number() over(partition [key] order number desc) n youtable ) delete c n > 1

asp.net mvc - How to translate query paramters using Attribute Routing in MVC website? -

i have horsecontroller index method like: [get("index", translationkey = "horseindex")] [allowanonymous] public actionresult index(int? page, horsetypes? type, horsegenders? gender, horsebreeds? breed, horsejumps? jump, horsedressages? dressage, string maxage, string pricefrom, string priceto, country? country, bool? haspicture, bool? hasvideo) { ... } and translate route like: provider.addtranslations() .forkey("horseindex", new dictionary<string, string> { { "da", "heste-til-salg" }, { "en", "horses-for-sale" } }) the issue now, url danish user is: http://localhost:12623/heste-til-salg?page=1&haspicture=false&hasvideo=false my question how translate query parameters too? i not able find in documentation . i don't think can. querystring in mvc routes treated generic dumping ground dat

android - how to add item for vertical to gridiview -

if add item gridview automatically added horizontal, how add item vertically gridview top bottom column in android. gridview, in cases uses listadapter. don't add items gridview, rather, add them adapter. listadapters not designed give grid based layout. , so, it's not possible. don't think gridview supports adding items @ random indexes. at-least, docs don't mention this.

android gdx sound performance issue -

i'm building scrolling shooter libgdx. in windows, runs fine, on android noticeable jitter , framerate drops 61 fps avg without sound 48-56 fps avg sound. plays lot of small sound effects concurrently there lot of bullets fire , enemies hit @ once. sound routine: import com.badlogic.gdx.gdx; import com.badlogic.gdx.audio.sound; public class soundfx { static final int bgdie = 1, bghit = 2, bglaser = 3, bgspawn = 4, pdie = 5, phit = 6, plaser = 7, pspawn = 8, pause = 9; sound s_bgdie, s_bghit, s_bglaser, s_bgspawn, s_pdie, s_phit, s_plaser, s_pspawn, s_pause; public void load() { s_bgdie = gdx.audio.newsound(gdx.files.internal("data/sfx/badguydie.mp3")); s_bghit = gdx.audio.newsound(gdx.files.internal("data/sfx/badguygothit.mp3")); s_bglaser = gdx.audio.newsound(gdx.files.internal("data/sfx/badguylaser.mp3")); s_bgspawn = gdx.audio.newsound(gdx.files.internal("data/sfx/badguyspawn.mp3"));

python - Numpy syntax for mean -

while using python / numpy came across following syntax: np.mean(predicted == docs_test.target) where arguments of type numpy.ndarray what meaning of == here? thanks, jaideep assuming predicted , docs_test.target 2 arrays of same size, computes fraction of elements 2 arrays in exact agreement. for example, in [1]: import numpy np in [2]: = np.array([1, 2, 3, 4, 5, 6, 7]) in [3]: b = np.array([1, 3, 7, 4, 5, 0, -10]) in [4]: np.mean(a == b) out[4]: 0.42857142857142855 this telling in ~43% of cases (3 out of 7), a , b in agreement.

WiX Burn 3.7 MsiNTSuitePersonal showing wrong value for Windows 7 Home Basic -

i using burn prerequisites installed. 1 of prerequisites requires me check if current os home basic edition of windows 7. tried checking msintsuitepersonal follows. <exepackage id="someid" cache="no" compressed="no" permachine="yes" permanent="yes" vital="yes" installcommand="/q" sourcefile="redist\some.exe" displayname="display something" installcondition="(msintsuitepersonal = 1)"/> following log wix burn setup. [093c:02e0][2013-04-01t17:14:21]i052: condition '(msintsuitepersonal = 1)' evaluates false. the above condition wix 3.7 burn. gives me result false on windows 7 home basic, while using same thing in msi works perfectly. see following log. property(s): msisystemrebootpending = 1 property(s): versionmsi = 5.00 property(s): versionnt =

jqgrid - In Jquery is there any Character Validation ? like for numbers we use in editrules: {number:true}? -

i have jquery function, need allow alphabets in category field. know have write function , use custom , custom_func:charvalidation. there in editrules, checks alphabet , make true... can use pattern attribute http://www.w3.org/tr/html5/forms.html#the-pattern-attribute <input name="category" type="text" pattern="[a-za-z]+">

javascript - Why is the div not updated, after the .css() method is called? -

Image
when finish dragging div, put previous location, stored in data-x, data-y. jquery not modify $(".current") in "up" method : the data-x,data-y correctly stored, the values stored showing correctly ox,oy, but final values ones mousemove, though "up" method called after mousemove. the code : $(window).on('mouseup', function(){ if (dragdown){ var ox = $(".current").attr("data-x"); var oy = $(".current").attr("data-y"); console.log("oxy: "+ox+", "+oy); //<--- works fine $(".current").css({"top":oy, "left":ox}); //<--- not work console.log("up: "+$(".current").css("top")+", "+$(".current").css("left")); } dragdown = false; }); $(".draggable").on('mousemove', function(e){ //<--- .draggable if (drag

java - How to Trigger from one rest web service to another? -

i have written rest web service fire panel , pubic address system. if there possibility fire in particular location has send message public address system. have trigger fire panel service public address system service. how can this? if can write class executes call rest web service , returns result, of course can incorporate class application, rest style service like regular call rest web service , in body of service must create instance of client call second web service.

android - java.lang.NullPointerException when resume activity in viewpager -

i resume activity have stored in share preferences in viewpager. have stored activity details in onsavestate , retrieve activity getpreferences in onresume. somehow, returns error key in null value in onsavestate. how save preferences in viewpager ? here code public class fullscreenimageactivity extends appcompatactivity { viewpager viewpager; imageview favbtn; private sharedpreference sharedpreference; activity context = this; private fragment contentfragment; @targetapi(build.version_codes.gingerbread) public void oncreate(bundle savedinstancestate) { this.requestwindowfeature(window.feature_no_title); super.oncreate(savedinstancestate); setcontentview(r.layout.activity_fullscreen_image); //tbs fragmentmanager fragmentmanager = getsupportfragmentmanager(); if (build.version.sdk_int > 9) { strictmode.threadpolicy policy = new strictmode.threadpolicy.builder().permitall().build(); strictmode.setthreadpolicy(policy); } if (save

android - What is the max array length that can be assigned AutoCompleteTextview? -

i trying assign array length more 100000 autocompletetextview. when run suggestions not showing up, if reduce number of items, suggestions showed. wondering whether there limit array can assigned autocompletetextview. can 1 on this. thank you.

How to create switch button customize in Android -

i'm studing android programming using switch button. but can't implement switch button o,i simbols(you can see android setting screen). i tried implement using these properites (android:thumb, android:track) but can't implement simbol(o, i). do have idea how it? tried find answer haven't been successful. thank you. you can use following attributes in activity_main.xml: <switch android:id="@+id/switch1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparenttop="true" android:layout_centerhorizontal="true" android:checked="true" android:texton="i" android:textoff="o" /> hope you..

string - A Java method to return one and then the other of two repeatedly -

the method want define return string of "black" or "white". going use in board game main method. first time returns "black". second time returns "black". third time returns "white", , fourth time returns "white". then, returns "black", "white", "black", "white", , on, repeatedly. how may implement this? i going define node class of string, create 2 nodes next , prev field pointing each other, , return this._next._getdatum(); not think work, , makes code complicated. do have suggestions accomplishing this? in order return different thing each time, method needs keep state. in java, state kept using instance variables or class variables. not knowing design, here short implementation flip-flops between "black" , "white" : public class flipflop { boolean iswhite; public string getcurrent() { iswhite = !iswhite; return iswh

How to create Apache Solr index files in file system of Amazon? -

i deployed spring based web application on amazon beanstalk. using lucence search in application creates indexes data. index files stored in local system,now facing issue create index. nay 1 suggest me how can create index file in amazon server. thanks & regards vijay

java - App crashes on AVD and on physical phone -

i have been working on creating android app month now. every time have tried run app crashes. having hard time reading logcat , understanding saying me. so, created new project , copied code developers.android.com , tried running it, , same thing happened. figured virtual device, looked stuff on , found said should have sd card storage configured. did well. still have same problem, , can't run app! have developer option turned on within phone unknown sources option. have 2 activities (mainactivity , main2activity) there no code in mainactivity.java file, , there nothing in .xml file associated them. trying navigation feature , happening. here output logcat when debug app in virtual device. if run app rather debug it, have lot more errors can't post because goes on max character count: 02-02 20:58:53.710 15712-15712/? e/memtrack: couldn't load memtrack module (no such file or directory) 02-02 20:58:53.710 15712-15712/? e/android.os.debug: failed load memtrack modul

sql - Arrange duplicates and number the records in a sequence - MySQL -

my mysql table has below records, id name account ----------------------------------------- 1 abc pqr 2 def pqr 3 abc pqr 4 xyz abc 5 def pqr 6 def abc i looking output id name account duplicate sr no. ----------------------------------------- 1 abc pqr 1 2 def pqr 1 3 abc pqr 2 4 xyz abc 1 5 def pqr 2 6 def abc 1 here mean each duplicate should have sr number or number duplicates. name : abc , account : pqr when repeated in table, there increment in duplicate sr no 1 2 mysql doesn't yet support window function other rdbms . behaviour similar row_number() gives rank number every record in group. in mysql, can simulated using user variables . select id, name, account, duplicatesr_no ( select id, name, account, @sum := if(@nme = name

reactjs - How to persist certain redux store properties to disk? -

in redux app have settings should persisted disk when change (as json file) , loaded app (to fill initial state of store). i guess app settings state, belong in store. have actions modify settings, either settings/change payload {name:'settingname', value: 'settingvalue'} or fine grained settings/units payload 'metric' or 'imperial' . now need intercepts state changes/action submissions , persist them disk serialized json. settings reducer should or better kind of middleware can perform async in background? how in code? you may use localstorage api krs said. care because allows string values, may need stringify objects before storing them: var config = { foo: 'foo', bar: 'bar' } // store: localstorage.setitem('config', json.stringify(config)); // json.parse(localstorage.getitem('config'));

can I create Collections in Flickr using Flickr API -

can create collections using flickr api (i using c# flickernet, can use rest calls, if supported). not getting method that. thanks. you can use flickr.photosets.create make new photoset. photosets similar collections, , perhaps differences won't important requirements.

swing - make half jframe transparent using java -

i creating jframe form using netbeans .is possible make transparent half portion of jframe , remaining half portion same . if use opacity property applies on full portion of jframe how possible make portion of jframe transparent using java swing. you try using non transparent panel half of frame don't want transparent , rest use setopacity();

How to pass string to batch file through c# and how batch file will accept string argument? -

my scenario in c# project user pass path "c:\homedir\mydir" batch file batch file should accept path , create directory @ specified path. i don't know how pass string batch file through c# , how batch file accept string , process it. create process , pass argument(s) through startinfo.arguments property. process proc = new process(); proc.startinfo.filename = //path bat file proc.startinfo.arguments = string.format("{0}", @"c:\homedir\mydir"); //set rest of process settings proc.start(); that load bat file , pass whichever arguments you've added. bat file can access arguments using %1 first argument, %2 second 1 etc...

ios - How to set the UIView become firs tResponder? -

i learning uiresponder now. wrote test code. in code want let uiview become first responder, failed. test steps are: create uiview in storyboard. created class extends uiview view, , override methods canbecomefirstresponder: , becomefirstresponder return yes . in method of view controller's viewdidappear: method, test it: - (void) viewdidappear:(bool)animated { [self.viewd becomefirstresponder]; nslog(@"%d ", [self.viewd isfirstresponder]); } the result of isfirstresponder no . i have no idea why. can me? thanks. becomefirstresponder notifies receiver become first responder in window. yes if receiver accepts first-responder status or no if refuses status. default implementation returns yes, accepting first responder status. a responder object becomes first responder if current responder can resign first-responder status (canresignfirstresponder) , new responder can become first responder. in case view refuses status t

c# - Is this how we create a structural object hierarchy (object model) like Excel VBA? -

i want learn how create object hierarchy (like of excel vba). have written code , want ask if right way go. also, want know if creating type of object structure have significant effect on performance. access objects e.g. way : hotel hotel = new hotel(); int x = hotel.rooms[1].count; // example int y = hotel.rooms.room.count; // example class hotel { private int i; public hotel() { = 10; // prossessing give value of i. lets 10 } public _rooms rooms { { return new _rooms(i); } } } class _rooms { private int _i; public _rooms(int i) { this._i = i; } public _room this[int i] { { return new _room(_i); } } public _room room // _room property { { return new _room(this._i); } } } class _room { private int _i; public _room(int i) {

What name do i use to connect to a server socket in java -

i writing telnet program in java using server socket , socket classes. current code client program. user types in server name , port connect on. static socket getsocket() { while(true) { system.out.println("what server want connect on port?"); string info = sc.nextline(); string host = info.split(" ")[0]; int port = integer.parseint(info.split(" ")[1]); try { inetaddress ip = inetaddress.getbyname(host); return new socket(ip, port); } catch (unknownhostexception e) { system.err.println("the host unknown."); } catch (ioexception e) { system.err.println("network error."); } } } i tried connecting on localhost, , worked. tried connecting friend on remote computer using ip address network name , did not work giving exception. name use connect remote server.

How do I install XAMPP to another directory on Windows 10? -

Image
i'm having hardest time installing xampp on c:\development\xampp on windows 10 . c drive clean possible i'm moving many dev tools development folder can achieve this. error towards end of xampp installation problem running post-install step. suggests install microsoft visual c++ 2008 redistributable, have 2012 version installed. xampp installed on c:\ no problems. how install xampp above directory or directory other c:\? edit: i have tried installing xampp portable , receive following error i'm no longer on windows can't re-test, recall, easiest way managed use portable version of xampp. make sure run shell setup script recognizes it's location properly. you can apache friends or portableapps.com

multithreading - Better approach for having two or more threads listening on same port -

dears, i'm working on network server application. plan have 1 thread each server's core handling clients connections in order better use of server's resources , faster responses, avoid blocking, etc. from know, there 2 ways of doing it: 1) parent process opens listening socket , each thread monitors (epoll, kqueue, etc.) new connections , accept() them; 2) each thread opens own listener socket on same port , address (possible so_reuseport , so_reuseaddr), monitor new connections , accept() them. i'm not sure how works behind scenes, suppose doing #2 delegate kernel networking section task of distributing client connections on threads. correct? is there significant difference between 2 approaches? there can go wrong in way of doing whereas doesn't happens in other? better results (less resources usage, less latency, etc.) doing in specific way instead of another? i think way see difference between 2 approaches comparison generating huge amount of

python - Save in Two Models with post_save -

i have problem : exists 3 models in app: class cliente(models.model): #fields here ... class imovel(models.model): #more fields and.. dono = models.foreignkey(cliente) class captacao(models.model): #here, have fields of others models (cliente , imovel) i want populate models "cliente" , "imovel" through of model "captacao"... know there post_save this, not know how this, save fields in each respective model. thanks, if dont have cliente yet, can create him, using imovel data: def save_in_other_models(sender, instance, created, **kwargs): cliente = cliente.objects.create( name=instance.name, ident=instance.ident, ) imovel.objects.create( dono=cliente ) models.signals.post_save.connect(save_in_other_models, sender=captacao) ---------------- ** ---------------- ** ---------------- ** ---------------- ** ---------------- ** ---------------- ** --------- if have cliente instan

angularjs - Angular Infinite scroll + mcustomScrollbar for table body -

i trying implement angular js infinite scroll fixed header , fixed column. , in mean time adding mcustomscrollbar scroll features. i can able add scroll functionality outside table i.e if add scroll div working. need table body. please find below link fiddler, let me know doing wrong. ''http://jsfiddle.net/jayasant1907/e8nwodx8/

Java code throws exception after adding Selenium-java-2.31.0 library in Maven -

Image
i working on netbeans. added library selenium-java-2.31.0. shows exception. added libraries on library dependent. i follow link add library in netbeans. my code :- import org.jsoup.jsoup; import org.jsoup.nodes.document; import org.jsoup.nodes.element; import org.jsoup.select.elements; import java.io.ioexception; import java.net.uri; import java.net.urisyntaxexception; import java.util.iterator; import org.openqa.selenium.by; import org.openqa.selenium.webdriver; import org.openqa.selenium.firefox.firefoxdriver; public static void main(string[] args) throws ioexception, urisyntaxexception { string url1 = "http://www.jabong.com/giordano-p6868-black-analog-watch-183702.html"; document doc1 = jsoup.connect(url1).get(); webdriver driver = new firefoxdriver(); driver.get(url1); elements tag_list = doc1.getallelements(); for( element tag1 : tag_list ) { point point=driver.findelement(by.id(tag1.id())).

nlp - what are the methods to estimate probabilities of production rules? -

i know n-gram useful finding probability of words,i want know, how estimate probabilities of production rules? how many methods or rules calculate probabilities of production rules? i not find blog or on topic.now studying on probabilistic context free grammar & cky parsing algorithm. as understand question, asking how estimate parameters of pcfg model data. in short, it's easy make empirical production-rule probability estimates when have ground-truth parses in training data. if want estimate probability s -> np vp , count(s -> np vp) / count(s -> *) , * possible subtree. you can find more formal statement in lots of places on web (search "pcfg estimation" or "pcfg learning"). here's nice 1 michael collins' lecture notes: http://www.cs.columbia.edu/~mcollins/courses/nlp2011/notes/pcfgs.pdf#page=9

c - Why does mingw-gcc allow getch() to be used unconditionally? -

i started porting ton of c programs windows environment, previous linux development pc. noticed bit off mingw 's windows gcc implementation. in windows, found lovely function called getch . it's easy, it's immediate... , it's non-standard. i'd focus of "non-standard" part of it. specifically, want know why mingw-gcc allows me use it, without using standard libraries. assume have program prints "hello, world!", nl , cr, , waits key , return: #include <stdio.h> int main(void) { char str[14] = "hello, world!"; //13 characters , terminator printf("%s\n\r", str); scanf("%c"); return 0; } now, let's change bit of program use getch : #include <stdio.h> int main(void) { char str[14] = "hello, world!"; //again, 13 characters , terminator printf("%s\n\r", str); getch(); //see? uses getch. return 0; } the interesting part is, isn't getch

javascript - How to enable and disable Required Validation group for fields and Expressions fields when a div is shown -

i have credit card transaction area in form hide , show based on user's selection in radio button group. credit card piece required validations , required expressions in validation group. wondering if enabling , disabling validation group in j query. in advance guys' help! i have class indicates whether field should validated or not, when field should validated hidden, remove class. add again when displayed. a more elegant solution disable validation of hidden fields: $('myform').submit(function() { $('myform').find('validate:visible').foreach( ... ); });

datagrid - Open source alternatives to telerik grid for asp.net mvc? -

i work shop doesn't have budget pay controls. there open source alternative telerik grid mvc? rich datagrids pages. there's mvccontrib.grid might take at. and if looking pure client side grid, there gazillions of them jqgrid , fuelux datagrid , ...

c# - Redirect to a form on button click in Grid View -

i have build gridview on webpage, having 2 buttonfields columns: accept , reject. when click on reject button, want show popup form input fields , store data database. i'm stuck @ showing popup on clicking reject button field. possible?v put code in .aspx file <asp:templatefield headertext="edit" itemstyle-width="150px"> <itemtemplate> <asp:linkbutton id="btnedit" runat="server" commandname="edit" text="edit" causesvalidation="false"/> </itemtemplate> </asp:templatefield> put code in .cs file if (e.commandname.equals("edit")) { string querystring="val"; page.clientscript.registerstartupscript(gettype(), "", "window.open('page.aspx?qs=" + querystring + "','