text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
below), it's [up on github](https://github.com/chrisbu/dartwatch-JsonObject) (also taking Seth's comments re the constructor):
[ 0.10429847240447998, -0.07913901656866074, 0.3555137515068054, -0.033378854393959045, 0.10605047643184662, -0.1981865018606186, 0.04509275406599045, 0.14792603254318237, -0.5615836977958679, -0.2596508264541626, -0.007804446388036013, 0.034857869148254395, 0.014854783192276955, -0.24600367...
I'm using jQuery to add a form element. It appears on the page fine, with the correct value, but when I submit the form, the data doesn't show up on the PHP backend. I looked at Firebug's POST data and I don't see it in there either. The javascript I'm using to add the form element is: ``` $("#projectArray").append("<...
[ 0.4669356942176819, 0.16199162602424622, 0.44622305035591125, -0.07113321870565414, -0.4904136657714844, -0.0858021154999733, 0.20174984633922577, -0.1608659029006958, 0.08232078701257706, -0.6163617968559265, 0.210299551486969, 0.143973246216774, -0.3224104344844818, -0.13827110826969147,...
cut a lot of it out, as it is a pretty large form. If anyone wants the complete code, I can paste it. ``` <form action="/learningexperiences/add" id="LearningexperienceAddForm" method="post" accept-charset="utf-8"> <div style="display:none;"><input type="hidden" name="_method" value="POST"/></div> <div class="...
[ 0.1698242723941803, -0.12815967202186584, -0.2154901772737503, 0.0179157592356205, -0.4590149521827698, 0.3715120851993561, 0.030759001150727272, -0.4641449451446533, -0.06834383308887482, -0.5740912556648254, -0.295401930809021, 0.3547684848308563, -0.05745402351021767, -0.039232734590768...
the form element (#LearningexperienceAddForm). I don't know why, but it started working at that point. I changed my append tag to append to the form element (#LearningexperienceAddForm). I don't know why, but it started working at that point.
[ 0.34042203426361084, -0.0591266043484211, 0.4317941963672638, 0.14114220440387726, -0.45791947841644287, -0.2878268361091614, 0.40137332677841187, 0.14850230515003204, 0.14949563145637512, -0.3514518141746521, -0.32040804624557495, 0.35452204942703247, -0.19714227318763733, -0.289166122674...
I have a shell pipeline for generating 10 characters password at random: ``` cat /dev/urandom | base64 | head -c 10 ``` My question is `cat /dev/urandom | base64` is an infinite output stream which will not exit by itself. But why does appending `head -c 10` make the whole pipeline exit? I assume `cat`, `base64` and...
[ -0.23807011544704437, 0.08460688591003418, 0.4166898727416992, -0.059138234704732895, 0.06089301034808159, 0.21431653201580048, 0.27118250727653503, -0.14324608445167542, -0.08865487575531006, -0.5332404971122742, -0.2037048637866974, 0.37954631447792053, -0.3392913043498993, 0.12196420878...
turn.
[ -0.07238256931304932, 0.4413837194442749, 0.14427265524864197, 0.04642053321003914, -0.17630356550216675, -0.08065695315599442, -0.2074643224477768, 0.1515420824289322, -0.1784660965204239, -0.7765231728553772, -0.1633678376674652, 0.3242946267127991, 0.08367134630680084, 0.491562396287918...
Consider the following piece of code: ``` int i, k, m; k = 12; m = 34; for (i = 0; i < 2; i++) ((i & 1) ? k : m) = 99 - i; printf("k: %ld m: %ld\n\n", k, m); ``` In this silly example, the conditional operator expression is a shortcut for: ``` if (i & 1) k = 99 - i; else m = 99 - i; ``` My compiler does not com...
[ 0.34821274876594543, 0.2743350863456726, 0.06945396959781647, -0.013113364577293396, 0.13676989078521729, -0.3039574921131134, 0.6046597957611084, 0.11916737258434296, -0.21267955005168915, -0.3506861627101898, -0.25818517804145813, 0.4207121729850769, -0.2551223635673523, -0.0468883216381...
like it used before. Footnote 110 in the C11 standard: > A conditional expression does not yield an lvalue. And 6.5.16 paragraph 2: > An assignment operator shall have a modifiable lvalue as its left operand. So no, that code does not conform to the C standard. In C++11, it *is* valid: > If the second and third o...
[ 0.03662215173244476, 0.0004875540325883776, 0.4287400543689728, -0.1264691948890686, 0.014782682992517948, -0.1914360672235489, 0.3253723382949829, -0.17774951457977295, -0.10259437561035156, -0.24644729495048523, -0.27583473920822144, 0.5932753682136536, -0.41840389370918274, -0.148375615...
"C mode", rather than a proper C compiler; MSVC?
[ 0.11451474577188492, -0.20956361293792725, 0.17903877794742584, -0.08508943021297455, -0.052672404795885086, -0.24510452151298523, 0.1652972251176834, 0.18204066157341003, -0.12328755855560303, -0.02812652289867401, -0.6275153160095215, 0.625314474105835, -0.5765408277511597, -0.0989438518...
I'm using console.log(variable) and firebug to examine javascript code. Occasionally, I get [object][object] as the value. Is there anyway of getting more information than just [object][object]? **EDIT:** [object Object] is not clickable **EDIT2:** I was able to log the information using `console.log("My EPIC Objec...
[ 0.0776575580239296, 0.02362232282757759, 0.35426563024520874, 0.18445047736167908, 0.08503347635269165, -0.055060893297195435, 0.4545021653175354, -0.08718738704919815, -0.2875687777996063, -0.47185203433036804, 0.0015024145832285285, 0.6301525235176086, 0.028439922258257866, -0.0551832169...
I am using `ASP.NET 2.0`. I am building a table with an `ImageButton` in each cell. If the user clicks on a `dropdown`, I do a postback and rebuild the table with a new set of ImageButtons. When the user clicks on an ImageButton, I show the `PostBackURL` property in a Javascript confirm box, and it is correct. How...
[ 0.39096295833587646, 0.19840392470359802, 0.5387682318687439, -0.2935514748096466, -0.19551287591457367, -0.004543988034129143, 0.21602629125118256, -0.12835419178009033, -0.34310436248779297, -0.8544927835464478, -0.15090562403202057, 0.27277764678001404, -0.3433926999568939, 0.1406715363...
on the ImageButton click is not actually being used? How about using the `enabled` selector? ``` <script>$("input:enabled").val("this is it");</script> ``` Here is a link to the docs <http://api.jquery.com/enabled-selector/>
[ 0.35329532623291016, -0.33086949586868286, 0.5822361707687378, -0.3267495930194855, 0.0038008291739970446, -0.08316223323345184, -0.03378969430923462, 0.11071453988552094, -0.2440340220928192, -0.62281334400177, -0.25968286395072937, 0.8315891027450562, -0.33446982502937317, -0.28195181488...
I am confused as android guide says two different things about the same thing. It says the benefit of using developer account is that you don't have to upload an APK for static response testing. On another note, it says, the static response testing only applies to app uploaded (not necesserly published). SOOO Whats ...
[ 0.2578542232513428, 0.06813197582960129, 0.41359204053878784, 0.08793795853853226, -0.22008664906024933, 0.04184464365243912, 0.2150023877620697, 0.05200695991516113, -0.20848429203033447, -0.4075935184955597, -0.027220727875828743, 0.7819371819496155, -0.3860619366168976, -0.1409189701080...
Background: I'm allocating my own machine contexts and stacks with the `getcontext(3)` / `makecontext(3)` / `setcontext(3)` (`ucontext.h`; SUSv2, POSIX.1-2001) family of functions. When I use gdb (version 6.1.1) to examine a stack while the thread is in one of these contexts I've allocated, it seems like gdb doesn't k...
[ 0.01965266652405262, 0.006726801861077547, 0.22829018533229828, -0.11067655682563782, 0.1394353210926056, 0.26485246419906616, 0.02361329458653927, 0.14973850548267365, -0.5201258063316345, -0.3251500725746155, 0.13081905245780945, 0.3384927213191986, -0.39547768235206604, -0.0124164670705...
0x28a3dc40 in ?? () #6 0x00000000 in ?? () #7 0x00000000 in ?? () … #65 0x00000000 in ?? () … ``` (Yes, this is built on top of [Russ Cox' libtask library](http://swtch.com/libtask/).) This context's execution begins at the `taskstart` function, but it seems like GDB can't figure out that it should stop trying to ...
[ -0.1470087766647339, 0.13082361221313477, 0.5215712189674377, -0.15967416763305664, 0.00740911765024066, -0.1510922759771347, 0.32550209760665894, -0.26254698634147644, -0.2790614664554596, -0.4884941279888153, -0.13447900116443634, 0.49691760540008545, -0.43895477056503296, 0.044979590922...
one way gdb 6.1.1 detects the end of the stack is by checking that the stored frame pointer is NULL; I fixed the problem for my use case by modifying the x86 and amd64 `makecontext(2)` function to reset ebp or rbp to zero when initializing the new context. (In this case, I do not care about other architectures.) This p...
[ -0.030634110793471336, -0.065741628408432, 0.4335114359855652, -0.4796156883239746, 0.08451799303293228, -0.4271247982978821, 0.637336790561676, -0.100155770778656, -0.2330685257911682, -0.2897177040576935, -0.0750732347369194, 0.4751870334148407, -0.741773247718811, 0.38485395908355713, ...
frame pointer, I believe. With DWARF2 things are much more complicated since the "frame pointer" is implicitly determined by the stack pointer combined with the insruction pointer and DWARF2 frame offset information for the current instruction, but essentially the effect is the same. Not sure which FreeBSD uses these d...
[ 0.1175030991435051, 0.13742470741271973, 0.3580457866191864, -0.17859914898872375, -0.0695277526974678, -0.15514454245567322, 0.40487802028656006, -0.132816880941391, -0.2378738671541214, -0.5481435060501099, 0.010737605392932892, 0.6293839812278748, -0.13323913514614105, -0.18357598781585...
I'm adopting a large mish-mash of Javascript / jQuery code. I'd like to move it to Backbone.js but as an intermediary, I'm trying to namespace it so that it is sligthtly more modular. I am wondering if there is a standard for namespaces for Javascript. I was going to do something like this: ``` var arc={ name:"Spoc...
[ 0.289985328912735, -0.17918860912322998, 0.42622533440589905, -0.21639466285705566, -0.6358350515365601, 0.1300821602344513, 0.19955888390541077, 0.037296783179044724, -0.48046424984931946, -0.782924234867096, -0.1882631629705429, 0.19381298124790192, -0.2817636728286743, 0.034287706017494...
identifiers. CAPSLOCKS is used for ["constants"](https://stackoverflow.com/questions/130396/are-there-constants-in-javascript). ProperCase is used for [object constructors](http://javascript.crockford.com/code.html#names) (indicating they should always be invoked using `new`).
[ 0.1326722353696823, 0.2621527314186096, 0.38595715165138245, 0.1146041676402092, -0.14850595593452454, 0.03656184673309326, 0.0021581666078418493, -0.36845722794532776, -0.34303018450737, -0.20076748728752136, -0.2810654044151306, 0.4657147228717804, -0.27288827300071716, 0.065933771431446...
I want to interrupt a thread after a fixed amount of time. Someone else asked the same question, and the top-voted answer (<https://stackoverflow.com/a/2275596/1310503>) gave the solution below, which I have slightly shortened. ``` import java.util.Arrays; import java.util.concurrent.*; public class Test { publi...
[ 0.3407727777957916, -0.040139708667993546, 0.28657424449920654, -0.12284418195486069, 0.19693292677402496, 0.11516443639993668, 0.5538622736930847, -0.16589470207691193, -0.17803962528705597, -0.5753682851791382, -0.32946690917015076, 0.2491011619567871, -0.4427804946899414, 0.366366356611...
try { System.out.println("Started.."); Thread.sleep(4000); // Just to demo a long running task of 4 seconds. System.out.println("Finished!"); } catch (InterruptedException e) { System.out.println("Terminated!"); } return null; } } ``` They ad...
[ 0.2234695702791214, -0.32849740982055664, 0.37218886613845825, -0.17364832758903503, 0.5167694687843323, 0.0684240385890007, 0.5153553485870361, -0.06555963307619095, -0.4448251724243164, -0.720400869846344, -0.23198087513446808, 0.6685781478881836, -0.16687719523906708, 0.3454494476318359...
is not required. It is just used for SSCCE/demonstration purposes. Just do your long running task right there in place of sleep(). But if you replace `Thread.sleep(4000);` with `for (int i = 0; i < 5E8; i++) {}` then it doesn't compile, because the empty loop doesn't throw an InterruptedException. And for the thread t...
[ 0.19728899002075195, -0.3219572901725769, 0.24960866570472717, 0.07794371247291565, 0.47243714332580566, -0.21170447766780853, 0.31607404351234436, 0.035335469990968704, -0.4798770546913147, -0.5514591336250305, -0.14720489084720612, 0.6043745875358582, -0.20678144693374634, 0.003871865570...
either use other interruptable action (Thread.sleep, InputStream.read, [read for more info](http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Thread.html#interrupt%28%29)) or manually check thread interruption status in your cycle condition using Thread.isInterrupted.
[ 0.3058878481388092, -0.2365580052137375, 0.19238421320915222, 0.03895682469010353, 0.4051781892776489, 0.05268411710858345, 0.24480603635311127, 0.3746163845062256, -0.4127424359321594, -0.45678219199180603, 0.01299620047211647, 0.8035027384757996, -0.3312954902648926, 0.11453866958618164,...
Is there a way using JQuery that i can detect when a div starts going offscreen , and change its CSS so that its position changes to fixed and is stuck to the bottom of the window ? I think what you are looking for is Sticky Elements in JQuery with waypoints if I'm correct. Take a look at this page: [JQuery Waypoints](...
[ 0.12276913225650787, -0.13267526030540466, 0.24951700866222382, 0.262053906917572, -0.02322303131222725, 0.000059010591940023005, 0.012581187300384045, 0.5675854086875916, -0.41436952352523804, -0.5277806520462036, 0.20810580253601074, 0.054088324308395386, -0.06188429147005081, -0.0646373...
There a dictionary object that gets loaded with the following key values: 119 189a 189b 189c 197 201a 201b In most situations, life is good and all the individual key values are needed/unique. But in certain situations, the keys with letters behind them (ie...189a, 189b, 189c) all mean the same thing (ie...189). So I ...
[ 0.3929165005683899, 0.13623720407485962, 0.3722122311592102, 0.11758159846067429, 0.09854267537593842, -0.0434579998254776, 0.4025498330593109, -0.10157041996717453, 0.022637957707047462, -0.49455395340919495, 0.12459959834814072, 0.7357034683227539, -0.06259074807167053, -0.09918194264173...
must not contain an `el-api.jar` or `juel-api.jar`. Make sure to exclude those dependencies.
[ 0.5418304800987244, 0.6869422197341919, -0.07828360050916672, 0.011917699128389359, 0.1565517783164978, -0.35328614711761475, 0.17149768769741058, 0.06729426980018616, 0.28968575596809387, -0.35370272397994995, -0.33018070459365845, 0.4969571828842163, -0.17213031649589539, 0.2363314926624...
I am wondering how to approach this problem. We have a profile table in our database that will be populated by a process that reads an uploaded excel document and then dumps the columns and the data in their rows into the user's profile (the only thing common between all such excel spreadsheets is an email address)....
[ 0.283856064081192, 0.23787547647953033, 0.31690075993537903, 0.1492272913455963, -0.10047466307878494, 0.11914781481027603, -0.20599845051765442, -0.11796529591083527, -0.008965813554823399, -0.938787043094635, 0.17903709411621094, 0.3283102810382843, -0.25390365719795227, 0.02415542490780...
pk| | name | | ..... | ---------- ---------------- | preference | ---------------- | user_id fk | <-- reference user.id | header | | value | ---------------- ``` csv\_row=`1,churk,height,11,weight,500lb,width,22,...` OR csv\_row=`1,churk,height=11,wieght=500lb,width=22......` this will yield 1 r...
[ -0.25891661643981934, 0.2956799268722534, 0.6053736209869385, -0.06566640734672546, -0.18357887864112854, 0.798434853553772, -0.25658848881721497, -0.3011535108089447, -0.1993805170059204, -0.34195080399513245, -0.3915499448776245, -0.2921197712421417, -0.023311207070946693, 0.252695292234...
On linux, I am loading a file into a database using psql and the input redirection operator. I would like to delete the file in order to free up some disk space. Will that interfere with the load? ``` psql mydatabase < myfile.sql & rm myfile.sql ``` The file won't actually be deleted from the disk until `psql` has fi...
[ 0.11966618150472641, 0.19896285235881805, 0.4024757146835327, -0.1826445758342743, 0.13691596686840057, -0.2587302625179291, -0.13803215324878693, 0.38576769828796387, -0.16374598443508148, -0.6677453517913818, -0.2800857126712799, 0.7187342643737793, -0.615588903427124, 0.1644777208566665...
I'm trying to use the new ASP.NET Web API to do the following: A GET to `/api/business/{id}` gets the business's directory information. A PUT to the same URL updates the information, etc. That part works fine. The problem I'm having comes when I want to add what would formerly have been an action, to view reviews of t...
[ 0.344129741191864, -0.014459795318543911, 0.3088078200817108, -0.0602944940328598, -0.2231849730014801, 0.16844913363456726, 0.1786198914051056, -0.21601217985153198, -0.2428443878889084, -0.6032208204269409, -0.02748352661728859, 0.6845780611038208, -0.1378520280122757, 0.1328785866498947...
change the action name and accepted HTTP method of the second function. I would expect there's some way to do this with classes in the new system, but I can't figure out what it is and I'm not seeing anything about the issue in the documentation. Using areas does *not* work, as best I can tell: I need the `/business/{...
[ 0.13340188562870026, -0.5307649374008179, 0.2687981426715851, 0.07081300020217896, -0.1385338455438614, 0.06114504486322403, 0.2872663736343384, -0.16684354841709137, -0.6129488348960876, -0.8698002099990845, -0.08394874632358551, 0.26030391454696655, -0.5833433270454407, -0.04942836984992...
= RouteParameter.Optional } ); ``` Controller methods: ``` [HttpGet] [ActionName("DirectoryInfo")] public void GetDirectoryInfo(int id) [HttpPut] [ActionName("DirectoryInfo")] public void PutDirectoryInfp(int id) [HttpGet] public void Review(int id) [HttpPost] [ActionName("Review")] public void PostReview(int id)...
[ 0.1232655867934227, -0.3370113968849182, 0.507408857345581, 0.20274624228477478, -0.24309559166431427, 0.2655940353870392, -0.03298689424991608, -0.4408630430698395, -0.1907339096069336, -0.7872681617736816, -0.06452076882123947, 0.6382908821105957, -0.5032325983047485, -0.0102650960907340...
I'm trying to use <https://github.com/mikeal/request>. What is wrong with my code? Error message is under code. In my program, I'm using my real App and Rest ID's ``` var request = require('request'); request.post( { url: 'https://api.parse.com/1/classes/GameScore', headers: { "X-Parse-Application-Id": "11111", ...
[ 0.025337718427181244, 0.23332935571670532, 0.5654708743095398, -0.099482960999012, 0.3456847369670868, 0.05427250638604164, 0.3424551784992218, -0.20799314975738525, -0.03483946621417999, -0.7014701962471008, -0.3134743273258209, 0.6730397343635559, -0.3464204668998718, 0.08198977261781693...
console.log(body); } } ); ``` Error message: ``` node.js:134 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: Argument error, options.body. at Request.init (/mnt/ws/users/$mn/mnort9/165767/node_modules/request/main.js:264:13) at new Request (/mnt/ws/users/$mn/mnort9/165767/node_m...
[ -0.1987210214138031, 0.17892496287822723, 0.5755225419998169, -0.0075138770043849945, -0.09952884167432785, 0.16369502246379852, 0.25641506910324097, -0.4725209176540375, -0.2530032992362976, -0.5886931419372559, -0.416570246219635, 0.433037668466568, -0.2642449140548706, 0.112513169646263...
I want to upload and resize pictures with different extensions. The php crops the biggest possible square from the center of the original pic, then saves it in 360\*360 pixels. The code works fine with jpeg files, but with gif, bmp and png I get a corrupted file with 33 Byte size. Here's most of the code: ``` $fi...
[ 0.4239925444126129, -0.047171588987112045, 0.7515385746955872, -0.05651233345270157, -0.23877356946468353, 0.32585474848747253, 0.2445511370897293, -0.5816795229911804, -0.18226829171180725, -0.6706132888793945, 0.12118352204561234, 0.41773155331611633, -0.4271448254585266, 0.1152725964784...
header ('Content-Type: image/gif'); $image = imagecreatefromgif($upload); } elseif ($type == 2) { header ('Content-Type: image/jpeg'); $image = imagecreatefromjpeg($upload); } elseif ($type == 3) { header ('Content-Type: image/png'); $image = imagecreatefr...
[ 0.0579817034304142, -0.18399125337600708, 0.5224938988685608, -0.12108632922172546, -0.15041393041610718, 0.03610376641154289, -0.05277272313833237, -0.31692448258399963, -0.16705042123794556, -0.6179831624031067, -0.6726206541061401, 0.5510789752006531, -0.631578266620636, -0.186653450131...
header ('Content-Type: image/x-ms-bmp'); $image = imagecreatefromwbmp($upload); } $image_p = imagecreatetruecolor(360, 360); //this code below should preserve transparency but I couldn't try it out for now... if($type==1 or $type==3) { imagecolortransparent($image_p, imagecolorall...
[ 0.27431172132492065, -0.25689324736595154, 0.8014856576919556, -0.024531608447432518, -0.11142818629741669, -0.058440759778022766, 0.04506751522421837, -0.2031804770231247, -0.08519601076841354, -0.39386722445487976, 0.10823116451501846, 0.5515037178993225, -0.4768838584423065, 0.100035466...
cropping $x=0; $y=0; if ($width > $height) { $x= ($width - $height)/2; $width = $height; } else { $y = ($height - $width)/2; $height = $width; } imagecopyresampled ($image_p, $image, 0, 0, $x, $y, 360, 360, $width, $height); if ($type == 1)
[ 0.03628598526120186, -0.3539750874042511, 0.9524402022361755, -0.07148249447345734, -0.1056148037314415, 0.27133908867836, -0.03178035095334053, -0.15981103479862213, -0.3912545144557953, -0.4154641330242157, -0.16005854308605194, 0.7299252152442932, -0.3349606394767761, -0.205898538231849...
imagegif ($image_p, $upload, 80); elseif ($type == 2) imagejpeg ($image_p, $upload, 80); elseif ($type == 3) imagepng ($image_p, $upload, 80); else imagewbmp ($image_p, $upload, 80); } ``` So, only jpeg files are processed correctly, gif, png and bmp files aren't. I'm out of ideas....
[ 0.1564735323190689, -0.04667834937572479, 0.7334962487220764, 0.04137371480464935, -0.2904489040374756, 0.019668031483888626, 0.3229307532310486, -0.3214009702205658, -0.05452748388051987, -0.6600448489189148, -0.11789096146821976, 0.5772215723991394, -0.5271816849708557, -0.19961585104465...
something like this: ``` GD Support => enabled GD Version => bundled (2.0.34 compatible) GIF Read Support => enabled GIF Create Support => enabled PNG Support => enabled libPNG Version => 1.2.10 ```
[ 0.11762861162424088, -0.21447011828422546, 0.5396578311920166, -0.03998288884758949, -0.16129601001739502, -0.2559204697608948, 0.1407419890165329, -0.2509172558784485, -0.16011856496334076, -0.7195913791656494, -0.4321250319480896, 0.530363917350769, -0.2893482744693756, -0.31018209457397...
Edit: Seems like Facebook finally fixed this bug! --- Could you help me understand why this is happening: This is a public event with a picture: <https://www.facebook.com/events/282054218538223> But when I try to access <http://graph.facebook.com/282054218538223/picture>, all I get is a default picture. --- Here ...
[ 0.20657116174697876, -0.2050723433494568, 0.18982402980327606, 0.1947466880083084, -0.3753061294555664, -0.10935712605714798, 0.3536193072795868, 0.05486128479242325, -0.8040523529052734, -0.4415634870529175, 0.30343538522720337, 0.35849490761756897, -0.37206172943115234, 0.109371505677700...
first example. This call returns urls to the event profile image in 3 different sizes. It works for both examples in Robin's question, just change the event id. Try it in [Graph Explorer](https://developers.facebook.com/tools/explorer) with Robin's example: ``` https://graph.facebook.com/fql?q=SELECT pic,pic_big,pic...
[ -0.03224869444966316, -0.1804308295249939, 0.26664987206459045, 0.17503072321414948, -0.07065872102975845, -0.03333932161331177, 0.14195585250854492, -0.053214527666568756, -0.702912449836731, -0.7068341970443726, 0.026386529207229614, 0.582709550857544, -0.19975347816944122, -0.0470922812...
I have been working with databases recently and before that I was developing standalone components that do not use databases. With all the DB work I have a few questions that sprang up. Why is a database query faster than a programming language data retrieval from a file. To elaborate my question further - Assume I h...
[ 0.20709802210330963, 0.2760401964187622, 0.06412149220705032, 0.21755704283714294, -0.0860627144575119, 0.20692095160484314, -0.21749040484428406, -0.1636977195739746, -0.2430577576160431, -0.7132294774055481, 0.20403078198432922, 0.1902112364768982, -0.28199896216392517, 0.248999774456024...
data in the table. At the end of the day this table is going to be stored somewhere on the disk. When I write a query Select Name,ID from Employee where DOB="12/12/1985", the DBMS picks up the data from the file, processes it, filters it and gives me a result which is a subset of the 1 million rows of data. Now, assum...
[ 0.07638633996248245, 0.14404162764549255, 0.6557419300079346, 0.023887043818831444, 0.1598832905292511, 0.030349088832736015, -0.12090104818344116, -0.253824383020401, -0.3150641620159149, -0.6610845923423767, -0.08272667229175568, 0.226471945643425, -0.2120078206062317, 0.3540366291999817...
or C# or Java and do the same task of finding the Name and ID where DOB="12/12/1985", I will read the file record by record and check for each row of data if the DOB="12/12/1985", if it matches then I store present the row to the user. This way of doing it by a program is too slow when compared to the speed at which a...
[ 0.21471050381660461, 0.43011489510536194, 0.4443238079547882, -0.0925934910774231, 0.07909142225980759, -0.3509121835231781, 0.12965545058250427, -0.24030238389968872, 0.0011857756180688739, -0.5489533543586731, 0.030857009813189507, 0.6253713369369507, -0.18060162663459778, 0.233021721243...
makes it faster to retrieve data than through a programming language? If this question is inappropriate on this forum, please delete but do provide me some pointers where I may find an answer. I use SQL Server if that is of any help. There are lots of techniques to speed up various kinds of access. As @Oded says, ind...
[ 0.2558082640171051, 0.012387239374220371, 0.2681826055049896, 0.4669843316078186, 0.09646574407815933, -0.29657691717147827, 0.05380474030971527, 0.2624568045139313, -0.2988588511943817, -0.6223363280296326, 0.05231865495443344, 0.34856414794921875, -0.018652409315109253, 0.385231345891952...
take up space and time, though -- it's not free!) On the other hand, if such an index has *not* been set up, and the database has not been stored in date order, then a query by date will need to go through the entire database, just like your flat-file program. Of course, you can write your own programs to maintain an...
[ 0.27836987376213074, 0.009530727751553059, 0.14466330409049988, 0.5342151522636414, 0.34907400608062744, -0.2717369496822357, -0.06468038260936737, 0.006245849654078484, -0.3902111351490021, -0.6618898510932922, -0.053233399987220764, 0.23910017311573029, -0.12032269686460495, 0.2507706880...
that turns out to use more resources than it is worth. Eventually, managing all the features you've added to your file manager may become a complex task; you may want to store this kind of configuration in its own file, rather than hard-coding it into your program. At the minimum, you'll need features to make sure tha...
[ 0.3991454839706421, 0.07158216089010239, 0.10649088770151138, 0.32986360788345337, 0.4988526999950409, -0.1514986902475357, 0.11401799321174622, 0.024948565289378166, -0.2737957835197449, -0.849086582660675, 0.08943861722946167, 0.7349390983581543, -0.16306455433368683, 0.15400297939777374...
I'd like to go down the route of porting a WPF/Silverlight component to Windows 8. For a bit of context, the component is a [real-time WPF Chart](http://www.scichart.com), which uses a mixture of WPF/XAML and bitmap rendering to achieve high performance. I'd like the component to be Metro compatible, e.g. used in met...
[ 0.10064351558685303, -0.5496389269828796, 0.41701239347457886, 0.4116761386394501, 0.05293266102671623, -0.056292902678251266, -0.10548654198646545, 0.06087082624435425, -0.2899240553379059, -0.7210752964019775, -0.18135829269886017, 0.6576912999153137, -0.31751540303230286, 0.111200049519...
to Windows8 would be far easier if I could stick to C#/XAML, however will I be able to create a fully featured Metro component using this method? Your comments/suggestions appreciated. **Edit:** If you're voting to close this thread, please post a comment why. Its a valid question, has +6 votes, four answers and ...
[ 0.09963478893041611, -0.4553275406360626, 0.6122803092002869, 0.20102083683013916, -0.2230532169342041, 0.3269735872745514, 0.16983069479465485, 0.3980149030685425, -0.5468538999557495, -0.35301530361175537, 0.03944183886051178, 0.386507123708725, -0.2771385908126831, 0.045795854181051254,...
.NET. C++ will give you faster startup times. IIRC, .NET 4.5 has auto NGENing abilities (not sure how it related to metro apps), so this may help mitigate typical slow startup times of .NET applications. C++ will give you lower general memory usage as it does not use a garbage collector. This becomes increasingly mor...
[ -0.019045287743210793, -0.20701952278614044, 0.4937683641910553, 0.2954762876033783, -0.17702782154083252, -0.07266862690448761, 0.29432010650634766, 0.20745064318180084, -0.2581184208393097, -0.7270137667655945, -0.21486631035804749, 0.6819053888320923, -0.47236567735671997, -0.1091689690...
in interacting with the XAML/WinRT platform (technically faster interacting with WinRT objects via C++ but the hit is really small), but of course your user code will generally be faster with C++ than .NET. C++ is generally more difficult to reverse engineer, even when compared with obfuscated .NET code. Though sly t...
[ 0.15570320188999176, -0.21310117840766907, 0.3215118646621704, 0.20026157796382904, -0.4651080071926117, -0.2256792187690735, 0.41329723596572876, 0.07407743483781815, -0.15359091758728027, -0.8289527297019958, -0.0326538011431694, 0.5945956707000732, -0.42183178663253784, -0.0629960149526...
but correctly created C++ projects this can be mitigated substantially. Pure .NET projects can support "Any CPU", which means your application can run on all supported WinRT platforms. C++ projects you will simply have to recompile to support ARM, x86/64. If you .NET application depends on a custom C++ component, you ...
[ 0.5461254119873047, 0.2363497018814087, 0.13866300880908966, 0.2661922574043274, -0.1211143359541893, -0.08154641091823578, 0.22101187705993652, -0.2233889251947403, 0.1841220110654831, -0.531350314617157, -0.01692277379333973, 0.7861914038658142, -0.241596519947052, -0.11511349678039551, ...
most C# devs should be able to find their way around. My suggestion to C++ devs is to stick with C++ and get all the benefits of C++.
[ 0.3276018798351288, -0.015909889712929726, 0.06360962241888046, 0.22733750939369202, -0.2180672138929367, -0.46750253438949585, 0.026452625170350075, 0.22285710275173187, -0.18417863547801971, -0.43122872710227966, -0.13055554032325745, 0.8537606596946716, -0.30293765664100647, -0.21460273...
I'm working on a numerical analysis project and I want to draw graphics and parabolas on the form. Simply I want to draw a parabola like `x² - 2x - 1`. So, how can I do that? Example code: ``` g = this.CreateGraphics(); p = new Pen(Brushes.WhiteSmoke,1); s = new SolidBrush(Color.Blue); g.DrawString("x", this.Font, s...
[ 0.15672607719898224, -0.25648629665374756, 0.7710574865341187, -0.07738126814365387, -0.06004723906517029, 0.6580876111984253, 0.29538795351982117, -0.6527249813079834, -0.24520306289196014, -0.7035409808158875, 0.09937869012355804, 0.4121435880661011, -0.39507657289505005, 0.3047669529914...
p = new Pen(Brushes.Gray, 1); g.DrawLine(p, x, y, x1, y1); g.Dispose(); } ``` I recommend that you use the System.Windows.Forms.DataVisualization.Charting library. Its documentation is here: <http://msdn.microsoft.com/en-us/library/dd489065.aspx> Something that confused me the first time I tried to use this ...
[ 0.664790153503418, -0.1312539279460907, 0.6247861981391907, 0.025504538789391518, 0.12458105385303497, 0.24672377109527588, -0.5713388323783875, -0.2516299784183502, -0.30206233263015747, -0.9024114608764648, 0.4932859241962433, 0.39010900259017944, -0.108180470764637, 0.3780011236667633, ...
and sends you a bitmap of it. There is another version that is designed to generate charts *in an interactive client application*. You want the second, obviously. It is very easy to accidentally end up reading the documentation for the server side one, which can be confusing, so be careful. Note also that this chart c...
[ 0.14789991080760956, -0.4514026343822479, 0.2977551817893982, 0.4322936534881592, -0.16529728472232819, -0.3177805542945862, 0.024404745548963547, 0.27712032198905945, -0.2380126416683197, -0.7727785706520081, 0.18206843733787537, 0.4955400824546814, -0.3130655586719513, -0.048986408859491...
I am attempting to loop through an array of numbers, match them to the checkbox they they are associated with, and checkmark that box. My checkbox is set up like: ``` <input type="checkbox" runat="server" id="someID" name="somename" value="1234" /> ``` My code when the page loads currently looks like: ``` foreach ...
[ 0.25908637046813965, 0.14984102547168732, 0.5750752687454224, -0.05450820177793503, 0.20286880433559418, 0.07209794968366623, -0.04503195732831955, -0.18097324669361115, -0.18086932599544525, -0.5871574282646179, 0.09795963764190674, 0.23328204452991486, -0.3759995102882385, -0.08042950183...
apply the attribute `checked="checked"`. I'm assuming I have to find the ID of the control I am using, then use that ID to add a new attribute. Or is there a way I can add the attribute using the `c` variable? I'm not dead set on this setup, so if you know a better way, I'm all ears. Thanks for any help and suggestion...
[ 0.37791648507118225, 0.4144439101219177, 0.5927753448486328, -0.26406529545783997, 0.37154343724250793, -0.010163635015487671, 0.006811650935560465, -0.1896601766347885, 0.09480646252632141, -0.613436758518219, 0.11207086592912674, 0.7576912641525269, -0.3229905366897583, 0.057422712445259...
chkCtrl in Panel1.Controls.OfType<CheckBox>()) { if (chkCtrl.Attributes["value"].ToString() == interest.ToString()) { chkCtrl.Checked = true; } } } ``` You would be best served putting the CheckBox controls into a `Panel` or a `PlaceHolder`, because then you wo...
[ -0.22196736931800842, -0.0584135539829731, 0.580207884311676, -0.007986502721905708, 0.1313260793685913, -0.0573553666472435, -0.26238253712654114, -0.5293194651603699, -0.07939959317445755, -0.5130694508552551, -0.2779318690299988, 0.5181771516799927, -0.2867198884487152, -0.2137309610843...
<asp:CheckBox ID="CheckBox1" runat="server" Text="Testing" value="1234" /> ... </asp:Panel> ``` By putting the controls into a container, you can just loop through the child controls of that element: ``` foreach (string interest in interests_Var) { foreach (var chkCtrl in Panel1.Controls.OfType<CheckBox>()) ...
[ 0.2454000860452652, -0.049278322607278824, 0.5248740911483765, -0.053813181817531586, 0.5592166185379028, 0.07102923095226288, -0.221213236451149, -0.6583406329154968, -0.22310630977153778, -0.34603992104530334, -0.07561992108821869, 0.5490203499794006, -0.13901497423648834, -0.16209027171...
I have the following line: ``` RewriteRule ^page.php?var1=([0-9]+)&var2=(.*)&var3=(.*)$ index.php?module=page&var1=$1 ``` When I visit the directory with this url: page.php?var1=24&var2=346adf&var3=asdf It doesnt do the regexp. Anyone having a clue? Basically your rule is incorrect. Reason: You can only match REQUE...
[ 0.12203441560268402, 0.3709298074245453, 0.8624292016029358, -0.1549796611070633, 0.08311855047941208, -0.0072066341526806355, 0.369495153427124, -0.5263228416442871, -0.03991606459021568, -0.47262105345726013, 0.24554254114627838, 0.5555691719055176, -0.27020013332366943, 0.28614622354507...
I have two EditTexts in XML. In one EditText, the user can put a number as minutes and in another EditText, a number as seconds. After clicking the finish button, the seconds EditText should start to countdown and update its text every second. Additionally, how can I keep it updating until it gets to zero minutes and...
[ 0.34514373540878296, -0.0334041453897953, 0.7439934015274048, -0.09074664860963821, -0.0950363278388977, 0.35282784700393677, 0.0829867348074913, -0.23473961651325226, 0.10714689642190933, -0.7441406846046448, 0.13321927189826965, 0.2833302617073059, 0.031756769865751266, 0.245383962988853...
// logic to set the EditText could go here > } > > public void onFinish() { > mTextField.setText("done!"); > } > > }.start(); > > ```
[ 0.13146133720874786, -0.15951544046401978, 0.46115559339523315, -0.18777228891849518, 0.09797953814268112, -0.3022955358028412, 0.4746784269809723, -0.35138243436813354, -0.18370716273784637, -0.6448763012886047, -0.5652737617492676, 0.7651100754737854, -0.45884010195732117, 0.053232338279...
I have a minimum age custom validator which is straight forward enough: **The constraint(Minage.php)** ``` namespace MyCompany\VisitBundle\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; /** * @Annotation */ class Minage extends Constraint { public $message = 'The user must be {{ a...
[ 0.020588530227541924, -0.049755845218896866, 0.41941994428634644, -0.1621398627758026, 0.24781563878059387, 0.4343961179256439, 0.5404651761054993, -0.22523151338100433, -0.1816493272781372, -0.6562244892120361, -0.17482705414295197, -0.043778110295534134, -0.0387749969959259, 0.4604583978...
if(strtotime($value->format("Y-m-d")) > $minAge) { $this->setMessage($constraint->message, array('{{ age }}' => $constraint->age)); return false; } return true; } } ``` **In my entity (stripping parts
[ -0.186497300863266, -0.18129856884479523, 0.19557081162929535, -0.13217204809188843, 0.3414844870567322, 0.31113606691360474, 0.27362996339797974, -0.36277925968170166, 0.10446123033761978, -0.39870139956474304, -0.41916897892951965, 0.18961551785469055, 0.1275978684425354, 0.5637063980102...
which aren't important)** ``` use MyCompany\VisitBundle\Component\Validator\Constraints as MyCompanyAssert; /** * @ORM\Column(name="birth_date", type="datetime") * @MyCompanyAssert\Minage(age="18") */ private $birth_date; ``` **And in twig:** ``` {{ form_errors(form.birth_date) }} {{ form_widget(form.birth_date...
[ 0.06397303938865662, 0.3308800458908081, 0.5640100240707397, -0.13257305324077606, 0.2537877559661865, -0.1385331004858017, 0.5248841643333435, 0.07893330603837967, -0.04055539518594742, -0.5780707001686096, -0.2451373189687729, 0.4522917866706848, -0.08930730819702148, 0.25616690516471863...
Here is the query: ``` string query = @"INSERT INTO session (PK_Id, user_id, login_time, machine_ip, machine_fingerprint) VALUES (UUID(), @UId, @LogInTime, @MIp, @MFingerPrint); "; ``` Now I need this last inserted id back, which is a UUID generated by MySQL. As far as I...
[ -0.18517769873142242, 0.026024572551250458, 0.48754608631134033, -0.13538767397403717, 0.006010599434375763, -0.10974253714084625, 0.10327152907848358, -0.11628701537847519, -0.19511570036411285, -0.4948694109916687, 0.03622119873762131, 0.44773802161216736, -0.27675968408584595, 0.5029993...
function first to a variable and then return that value. But how to go about that in C#? Something like this, but not exactly: ``` string query = @"INSERT INTO session (PK_Id, user_id, login_time, machine_ip, machine_fingerprint) VALUES (@UUID = SELECT UUID(), @UId, @LogInTime, @MIp, @MF...
[ -0.1418994963169098, -0.18098531663417816, 0.49115777015686035, -0.12782838940620422, 0.23614951968193054, -0.3558593988418579, 0.08986972272396088, -0.09544754773378372, 0.022590598091483116, -0.41864311695098877, -0.12597933411598206, 0.6809634566307068, -0.3801877200603485, 0.2385273724...
//how to do this here? ``` Here is more of my code: ``` string query = @"INSERT INTO session (PK_Id, user_id, login_time, machine_ip, machine_fingerprint) VALUES (@UUID = SELECT UUID(), @UId, @LogInTime, @MIp, @MFingerPrint); "; try { if (_conn.State != ConnectionState.Open) ...
[ -0.021103575825691223, -0.05699747055768967, 0.5346680283546448, -0.11888347566127777, 0.4285604953765869, -0.10939199477434158, 0.23108592629432678, -0.15994688868522644, -0.2851089835166931, -0.899033784866333, -0.06382191926240921, 0.547653317451477, -0.11202356219291687, 0.541969716548...
cmd.Parameters.AddWithValue("@MIp", GetMachineIP()); cmd.Parameters.AddWithValue("@MFingerPrint", GetHardwareFingerPrint()); var s= Convert.ToString(cmd.ExecuteScalar()); //this returns an empty string :( //I need to get it to any .NET data type, string, or Guid or byte[] or anything. ``` But I need thi...
[ 0.022910529747605324, -0.18979065120220184, 0.7416117787361145, -0.31207752227783203, 0.17106373608112335, 0.04432523623108864, 0.2653563618659973, -0.36989545822143555, -0.287040114402771, -0.9088869094848633, -0.15538015961647034, 0.5494253635406494, -0.37104231119155884, 0.0872454419732...
ConnectionState.Open) _conn.Open(); MySqlCommand cmd = new MySqlCommand(query, _conn); cmd.Parameters.AddWithValue("@UId", Utility.usr.Id); cmd.Parameters.AddWithValue("@SessionId", s); cmd.Parameters.AddWithValue("@LogOutTime", DateTime.Now); cmd.ExecuteScalar(); ``` Here `@"SessionId"` i...
[ -0.0072671095840632915, -0.07574913650751114, 0.6674258708953857, 0.030861325562000275, -0.00437322910875082, 0.03711816668510437, 0.13675451278686523, 0.0035002785734832287, -0.4648304581642151, -0.7279781103134155, 0.056896843016147614, 0.4471474289894104, -0.33688777685165405, 0.7277625...
to char datatype in the database :)* ). **Edit:** The problem here is we have already added plenty of UUIDs generated by MySQL into the table, so I'm a bit apprehensive about changing MySQL UUID to .NET Guid. If that's the only workaround, I'll consider that. Just that this is the first time we needed the inserted UUI...
[ 0.16455477476119995, -0.02652454562485218, 0.3396364152431488, -0.01448814570903778, -0.2375653237104416, -0.06939353048801422, 0.11760830134153366, 0.2664293944835663, -0.18233314156532288, -0.6628724932670593, 0.2545410096645355, 0.6928679347038269, -0.28078439831733704, 0.25913006067276...
but I fear I am too late :) ``` string query = @"INSERT INTO session (PK_Id, user_id, login_time, machine_ip, machine_fingerprint) VALUES (UUID(), @UId, @LogInTime, @MIp, @MFingerPrint); SELECT PK_Id FROM session WHERE login_time=@LogInTime AND machine_fingerprint=@MFing...
[ -0.15308012068271637, 0.10362730175256729, 0.6066744327545166, 0.03773985430598259, 0.35862866044044495, -0.22293426096439362, 0.34945932030677795, -0.387553334236145, 0.11251664161682129, -0.8038830161094666, -0.32651814818382263, 0.5607033371925354, -0.15677379071712494, 0.25486683845520...
"; try { if (_conn.State != ConnectionState.Open) _conn.Open(); MySqlCommand cmd = new MySqlCommand(query, _conn); cmd.Parameters.AddWithValue("@UId", Utility.usr.Id); cmd.Parameters.AddWithValue("@LogInTime", DateTime.Now); cmd.Parameters.AddWithValue("@MIp", GetMachineIP()); cmd.Param...
[ 0.03772501274943352, -0.28434088826179504, 0.7421697974205017, -0.1457269787788391, 0.649939775466919, 0.024319669231772423, 0.6267397403717041, -0.4189903438091278, -0.2895336151123047, -0.7320972681045532, -0.3911593556404114, 0.6222673058509827, -0.24103239178657532, 0.10695543140172958...
would work ``` Now you can query in update like this: ``` string query = @"UPDATE session SET logout_time = @LogOutTime WHERE user_id = @UId AND PK_Id = @SessionId"; try { if (_conn.State != ConnectionState.Open) _conn.Open(); MySqlCommand cmd = new MySqlCommand(query, _conn...
[ -0.019555890932679176, -0.43482139706611633, 0.6471239924430847, -0.1145375519990921, 0.16020572185516357, 0.07078191637992859, 0.43587222695350647, -0.20490998029708862, -0.2202671319246292, -0.9478650093078613, -0.15115652978420258, 0.7104849219322205, -0.3087093234062195, 0.352310329675...
to byte array before querying. This is important, in `WHERE` clause, be it `UPDATE` or `SELECT` statements in query. I would ask you to move to binary field in MySQL table from varbinary. **Edit:** If your table would grow dramatically large then inserting and selecting is a bad idea since `SELECT` query is an additio...
[ 0.11129572242498398, -0.18034549057483673, -0.024788375943899155, 0.022884594276547432, -0.307053804397583, -0.03353900462388992, -0.037095218896865845, -0.0202775988727808, -0.3163801431655884, -0.46979638934135437, 0.12912511825561523, 0.5742555856704712, -0.25286009907722473, 0.25554940...
for this.. **Edit2**: See this [answer](https://stackoverflow.com/a/10681245/661933) for getting binary value to .NET datatype. Sometimes casting do not work depending on MySQL .NET connector version..
[ 0.42438259720802307, 0.04921186342835426, 0.02165563590824604, 0.19231177866458893, 0.05750386789441109, 0.0648430734872818, 0.03977683559060097, -0.38754385709762573, -0.08789429068565369, -0.4937645494937897, 0.10933113843202591, 0.31101372838020325, -0.14277350902557373, 0.1491392403841...
Sometimes I m getting unicode errors like below in my django site when user submit form data. "'ascii' codec can't encode character u'\u2014' in position 109: ordinal not in range(128)" How can i reproduce the unicode error in my system Many Thanks. Submit the form causing the errors with unicode characters (e.g.`é`...
[ 0.33214953541755676, 0.5846818089485168, 0.12130982428789139, -0.12837786972522736, -0.28182369470596313, -0.15141510963439941, 0.5009738802909851, 0.11699919402599335, -0.1777559220790863, -0.7081958651542664, -0.02730870060622692, 0.5559130311012268, -0.1523979753255844, 0.13872261345386...
be able to help you further. Good luck!
[ 0.39083611965179443, 0.24961824715137482, 0.3371226191520691, 0.21432757377624512, 0.2062060534954071, -0.4531674385070801, 0.7534884810447693, 0.9616373181343079, 0.14355850219726562, -0.6809366941452026, -0.06928005814552307, 0.08385573327541351, 0.695280909538269, 0.3142494559288025, ...
I have an image and want to read the pixel values in a particular region. I assumed that the rectangle which is the 1st argument of the `LockBits()` method was there to allow for sub-sections to be specified. When debugging though, I noticed that the value of `BitmapData.Stride` was 3 x the width of the original bitma...
[ 0.2051723450422287, -0.20218710601329803, 0.45607516169548035, -0.05842167139053345, -0.5389800667762756, 0.03056042268872261, -0.04435926303267479, -0.631506085395813, -0.02834215760231018, -0.7284194231033325, 0.07313530892133713, 0.3687880039215088, -0.37994468212127686, -0.037043780088...
the same, the stride of the original bitmap. And you have to use that value when indexing the scan lines in the bitmap, regardless of the size of the rectangle.
[ 0.28737857937812805, -0.5899245142936707, 0.4200492799282074, 0.25049349665641785, -0.20840799808502197, -0.01303249504417181, -0.16546429693698883, -0.2619529664516449, -0.3828093707561493, -0.4546164572238922, -0.0089790690690279, 0.28838610649108887, -0.09071800112724304, -0.16577588021...
I am printing a large series of figures as .png files. Each figure is a plot of a column from a data matrix, and I take the .png files and string them together into an animation. My problem is that the first few hundred images print quickly, but the amount of time to create each new figure increases rapidly, from ~0.2...
[ 0.2898782789707184, -0.12165436148643494, 0.787696897983551, 0.007600679993629456, -0.00533148692920804, 0.4890449345111847, -0.14183162152767181, -0.0175652913749218, -0.4011232852935791, -0.8229413628578186, 0.16819795966148376, 0.349962443113327, 0.062378570437431335, -0.222073420882225...
R2009b 64-bit. My code looks something like: ``` n = 1000; matrix = rand(n); f = figure('Visible','off'); % create the figure for i_ =1:n plot(1:n,matrix(:,i_)); ylim([0 1]); set(f,'PaperUnits','inches','PaperPosition',[0 0 6 4]); png_name = [ 'img/timestep_' sprintf('%05d',i_) ]; print('-dpn...
[ -0.20967936515808105, -0.1969345062971115, 0.7652662396430969, -0.3134469985961914, 0.06622744351625443, 0.5733093619346619, 0.19670701026916504, -0.7878158688545227, -0.2191983461380005, -0.6195219159126282, -0.17498907446861267, 0.3851069211959839, -0.0616106316447258, -0.105366110801696...
to create an animation, why are you generating png files? Use [GETFRAME](http://www.mathworks.com/help/techdoc/ref/getframe.html) and make a [MOVIE](http://www.mathworks.com/help/techdoc/ref/movie.html) directly in MATLAB.
[ 0.3006267249584198, -0.2167961597442627, 0.1697281152009964, 0.3334924578666687, -0.1729445606470108, 0.18351954221725464, -0.24088449776172638, -0.053617924451828, -0.3462371528148651, -0.48268264532089233, -0.30322322249412537, 0.3096177577972412, -0.08544246107339859, -0.109355099499225...
I have the following code ``` <select id="practice_id" name="practice" column="practice" style="width: 200px"> <option value="">Default</option> <option value="1">Test 1</option> <option value="2">Test 2</option> <option value="3">Test 3</option> ............... </select> ``` What I need to do, is to change the...
[ 0.3666512370109558, 0.057016946375370026, 0.4872666895389557, -0.330687940120697, 0.03208832070231438, 0.22281840443611145, 0.24011853337287903, -0.7051210999488831, 0.009201956912875175, -0.6900683641433716, 0.0660996362566948, 0.6835464835166931, -0.13245181739330292, 0.1297978162765503,...
var val = $(this).val(); alert(val); $('option[value=' + val + ']', this).val('changed'); }); })(jQuery); ``` <http://jsfiddle.net/PeeHaa/6yre7/>
[ 0.2799910604953766, -0.507357656955719, 0.6065528988838196, -0.6050865054130554, 0.36141103506088257, 0.10364235937595367, 0.5049313902854919, -0.245132178068161, -0.26433926820755005, -0.35795605182647705, -0.5703527331352234, 0.993372917175293, -0.5199267864227295, 0.011712211184203625, ...
With method signatures like: ``` public interface TestInterface { void SampleMethodOut(out int? nullableInt); void SampleMethod(int? nullableInt); } ``` I'm using `typeof(TestInterface).GetMethods()[1].GetParameters()[0].ParameterType` to get the type, and then checking `IsGenericType` and `Nullable.GetUnder...
[ 0.22979341447353363, 0.0571029931306839, 0.3230568468570709, -0.07597330212593079, -0.11736834794282913, -0.005053474567830563, 0.4627762734889984, -0.7657148241996765, 0.050510223954916, -0.4828267991542816, 0.12999080121517181, 0.38396987318992615, -0.45067834854125977, 0.077214904129505...
We're developing an JavaScript application that will be hosted on our customer's server. We don't have access to the customer's server, and more-so it would be frowned-upon to send regular updates to the application. In order to provide regular maintenance, it's been proposed that the application that sits on the custo...
[ 0.591485321521759, 0.3408089876174927, 0.46058639883995056, 0.003587351879104972, 0.213828906416893, -0.08575638383626938, 0.06728143990039825, -0.1603371948003769, 0.00443771667778492, -0.4797346293926239, -0.15740181505680084, 0.4639555513858795, -0.22108078002929688, -0.0120775680989027...
the core HTML (based largely on the [HTML Boilerplate](http://html5boilerplate.com/)), including appending tags for meta, style sheets, HTML, etc. Once the HTML page is flushed out, it would pull in the content the learner is seeking. **Update Due to Comment** The application needs to reside on the customers's server ...
[ 0.11922723054885864, 0.0006442799931392074, 0.5056647658348083, 0.23288027942180634, -0.05400672182440758, -0.13668501377105713, 0.29594355821609497, 0.006031418219208717, 0.019342461600899696, -0.4934477210044861, -0.30314546823501587, 0.2746266722679138, -0.12889374792575836, -0.05166332...
that is a common issue for similar applications. Is there a better way to retain the ability to provide updates to the application without going through the customer? Doh, ignore my previous answer. You use `Type.IsByRef`, and call `Type.GetElementType()` if so: ``` var type = method.GetParameters()[0].ParameterType...
[ 0.28235554695129395, 0.10650672763586044, 0.7852138876914978, -0.17485103011131287, 0.15736280381679535, 0.06381173431873322, 0.44984549283981323, -0.4318660497665405, 0.019811375066637993, -0.4952218234539032, -0.0003760465478990227, 0.715978741645813, -0.3738471269607544, 0.2226780652999...
I will like to speed the process of traversing a tree. Here is an example of a node: ``` class Node { public List<Node> Children { get; set; } public int SompeProperty { get; set; } public String SomeOtherProperty { get; set; } } ``` the way I traverse the try is like: ``` st...
[ -0.0632445365190506, -0.14151380956172943, 0.4086046516895294, 0.13956347107887268, 0.3923972249031067, 0.13527972996234894, 0.39565959572792053, 0.1033734381198883, -0.35619932413101196, -0.9029744863510132, -0.01164559368044138, 0.05967473238706589, -0.0719655305147171, 0.133504256606102...
== null) return; foreach (var child in ParentNode.Children) { TraverseTree(child); } } ``` the `ParentNode.Children` method takes about 1 millisecond because a Node represents a file or a directory. I just used this example of a node to illustrate be...
[ -0.1710790991783142, -0.03236456587910652, 0.33505484461784363, -0.046904053539037704, 0.5560507774353027, 0.16816343367099762, 0.375029057264328, 0.034121073782444, -0.04022638127207756, -0.8678670525550842, -0.12185521423816681, 0.18837115168571472, 0.12121719866991043, 0.477775752544403...
point. so if you think about it if the first node has 4 children and each of those children has 10000000 descendants we could increase the speed of this traversal if we where to traverse each of those 4 children in a separeate thread taking advantage of parallel programming. if that would have been the scenario then ...
[ 0.2584247291088104, -0.00022927462123334408, 0.037164706736803055, 0.44738155603408813, 0.07027123868465424, 0.43817099928855896, 0.3395787477493286, -0.20427776873111725, -0.48996594548225403, -0.7338991165161133, 0.13918162882328033, 0.06778572499752045, -0.03166155144572258, 0.369065463...
the traversal of each on a separate thread. 2) Do something like: ``` static void TraverseTree(Node ParentNode) { if (ParentNode.Children == null) return; foreach (var child in ParentNode.Children) { ThreadPool.QueueUserWorkItem(new WaitCallback((x) => ...
[ -0.06099238991737366, -0.3565792143344879, 0.4685683250427246, -0.1358964890241623, 0.6406423449516296, 0.2504456639289856, 0.3939162790775299, -0.005193280056118965, -0.49822816252708435, -0.5610454678535461, -0.06573062390089035, 0.2181621640920639, -0.38477542996406555, 0.63627713918685...
TraverseTree(child); }), null); } } ``` this often gives me strange results but it is significantly faster. --- Results ------- Using task improved the speed of the
[ -0.25354376435279846, 0.0017898391233757138, 0.39663469791412354, -0.09125444293022156, 0.08993521332740784, 0.1950773447751999, 0.6523594856262207, -0.3030828833580017, -0.27902495861053467, -0.9302622675895691, 0.07497797906398773, 0.526095449924469, -0.17373299598693848, 0.1574258506298...
algorithm by about 40% here are the results: scanning my whole C:\ drive took about **5.81** seconds with the following algorithm: ``` //directoryPath = "C:\" var now = DateTime.Now; Task<List<ScanItem>> t1 = new Task<List<ScanItem>>(() => { return GetAllFilesInDirectory(dire...
[ 0.08468247205018997, -0.49789494276046753, 0.875220000743866, -0.24894364178180695, 0.3473625183105469, 0.14447332918643951, 0.30949825048446655, -0.555647611618042, -0.2972877323627472, -0.5302248597145081, 0.056061580777168274, 0.8479687571525574, -0.08126483857631683, -0.074920348823070...
var done = DateTime.Now-now; // done = 5.81 average ``` scanning my whole C:\ drive took about **3.01** seconds with the following algorithm: ``` //directoryPath = "C:\" var now = DateTime.Now; // get all directories in my c: drive it should only contain directories var directori...
[ 0.05477279797196388, -0.0007997326902113855, 0.7168961763381958, -0.31920725107192993, 0.3654519021511078, 0.2660285532474518, 0.27884870767593384, -0.11267716437578201, -0.3607524037361145, -0.5867795944213867, -0.32877251505851746, 0.8092924952507019, -0.22345981001853943, 0.044262055307...
Task<List<ScanItem>>[] myTasks = new Task<List<ScanItem>>[directories.Length]; // create a task fore each directory in the c:\ drive for (int k = 0; k < myTasks.Length; k++) { var currentDir = directories[k]; myTasks[k] = new Task<List<ScanItem>>(() => {
[ -0.3578573167324066, -0.45585739612579346, 0.5684711337089539, -0.2979061007499695, 0.30992501974105835, 0.4407944083213806, 0.11747139692306519, -0.30525970458984375, -0.4164358079433441, -0.4638075530529022, -0.25782573223114014, 0.41615214943885803, -0.36347365379333496, 0.2452093064785...
return GetAllFilesInDirectory(currentDir); }); } // start all the tasks for (int k = 0; k < myTasks.Length; k++) myTasks[k].Start(); Task.WaitAll(myTasks); // wait
[ -0.054501987993717194, -0.44516563415527344, 0.6452146172523499, -0.3241030275821686, 0.31728386878967285, 0.3012188971042633, 0.5297184586524963, -0.35669460892677307, -0.2877846360206604, -0.34111979603767395, -0.36902230978012085, 0.5321162939071655, -0.2643093466758728, 0.2002193182706...