text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
then `1` to `1234`. (To keep it practicable I'll only consider deterministic machines where, given the same input stream and requests, it will always give the same output.) One necessary constraint is that the output contain at least as much entropy as the input. However, the constraint I'm most interested in is that t...
[ 0.15996164083480835, -0.01058660726994276, 0.11843154579401016, -0.08650404214859009, -0.16790007054805756, 0.05710463970899582, 0.10070028156042099, -0.47341424226760864, -0.5373662710189819, -0.55465167760849, -0.1763557642698288, 0.41504546999931335, -0.2920597195625305, 0.0791675671935...
conversion while satisfying the first constraint but does very badly on the second. How about: ``` $(form).submit( function() { var parentUID = ""; $('.cat_grid').each(function() { cat_parent = $(this).parent(); if (cat_parent.attr('class')=="on") { parentUID += $(this).attr('id')+";"; } }); ...
[ 0.0808214545249939, -0.22718697786331177, 0.2293647825717926, -0.1744256168603897, -0.009648344479501247, 0.3663828670978546, 0.5624036192893982, -0.8034736514091492, 0.2590857446193695, -0.9675241708755493, -0.23744669556617737, 0.7519087195396423, -0.3812463879585266, 0.29463446140289307...
This function should be returning 36 but it returns 0. If I run through the logic line by line in interactive mode I get 36. Code ``` from math import * line = ((2, 5), (4, -1)) point = (6, 11) def cross(line, point): #reference: http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=geometry1 ab = ac = [...
[ 0.09223714470863342, -0.05371793732047081, 0.6070057153701782, 0.03535360097885132, -0.12389947474002838, 0.15663796663284302, 0.5314423441886902, -0.6197063326835632, -0.11796450614929199, -0.2140905261039734, -0.09654474258422852, 0.3132164478302002, -0.34647685289382935, -0.064031966030...
* ac[1] print step1 step2 = ab[1] * ac[0] print step2 step3 = step1 - step2 print step3 return float(value) cross(line, point) ``` Output ``` [2, -6] # ab [4, 6] #ac 24 #step 1 (Should be 12) 24 #step 2 (Should be -24) 0 #step 3 (Should be 36) ``` According to the interac...
[ -0.11098194867372513, -0.070795439183712, 0.49443453550338745, 0.011918351985514164, 0.025682680308818817, 0.15138135850429535, 0.18752151727676392, -1.0229287147521973, -0.1267097145318985, -0.22360335290431976, -0.1380022019147873, 0.153601735830307, -0.4542672634124756, -0.2826277017593...
= ab[0] * ac[1] >>> step1 12 >>> step2 = ab[1] * ac[0] >>> step2 -24 >>> step3 = step1 - step2 >>> step3 36 ``` (It would be great if someone can give this a good title) You have ab and ac pointing to the same reference. Change this: ``` ab = ac = [None, None] ``` to this: ``` ab = [None, None] ac = [None, None] ...
[ 0.13612620532512665, 0.3077234625816345, 0.35877206921577454, 0.033962804824113846, 0.01740128919482231, 0.1584189534187317, 0.2228669971227646, -0.5654318928718567, -0.4320322871208191, -0.44984912872314453, -0.10908175259828568, 0.24412214756011963, -0.4516482651233673, 0.055371798574924...
I was wondering if you guys could help me. Here are my .h: ``` Class Doctor { const string name; public: Doctor(); Doctor(string name); Doctor & Doctor::operator=(const Doctor &doc); } ``` and my main: ``` int main(){ Doctor d1 = Doctor("peter"); Doctor d2 = Doctor(); d2 = d...
[ -0.305939644575119, 0.12264200299978256, 0.13694773614406586, 0.023597924038767815, 0.2626921832561493, 0.15038825571537018, 0.15495838224887848, -0.0859290361404419, -0.015427665784955025, -0.6489232778549194, -0.11541589349508286, 0.6447377800941467, -0.4764975905418396, 0.26806372404098...
which is a Doctor like a Pacient has a Doctor. But I want to be able to change my Doctor. Like i am seeing doctor A but I want to see Doctor B. That would be done using a setDoctor function in my other class (Pacient). If it was me doing the code I would say something like this: ``` class Patient{ Doctor &d; }; `...
[ -0.02898588217794895, 0.19054916501045227, 0.058127209544181824, -0.07192825525999069, -0.10952987521886826, 0.2554662823677063, -0.06647354364395142, -0.09864286333322525, -0.06178881227970123, -0.7424749732017517, 0.2099151611328125, 0.31699493527412415, -0.4599054455757141, 0.2133172005...
impossible to do because with a setDoctor() in the Patient class I would either make a copy or alter the varable itself. The first doesn't make any difference and the second is impossible due to the const. Am I right? You are almost there. Few noteworthy points: * The name should not be `const` qualified. A `const` ca...
[ 0.010688206180930138, -0.04922676458954811, 0.2201697826385498, -0.16241848468780518, 0.3032660484313965, -0.022802133113145828, 0.41990986466407776, -0.2724490463733673, -0.00900281872600317, -0.5625950694084167, -0.08754216134548187, 0.633150577545166, -0.1918526440858841, 0.264288365840...
contains other classes that already properly support assignment (as in this case with a simple string member), the implicit, compiler-generated operator=() will work just fine." Here, in your case, the only member `string` has a proper `op=`. So explicitly defining is redundant. * Meeh's solution is almost there. The o...
[ 0.1546579897403717, 0.13331550359725952, 0.17567716538906097, 0.13638538122177124, -0.10150968283414841, -0.30228760838508606, 0.3227589428424835, -0.8096461296081543, -0.2204706370830536, -0.31929951906204224, -0.27939075231552124, 0.73770672082901, -0.4678216576576233, -0.183438464999198...
sample should be something like this: ``` class Doctor { string name; public: Doctor& operator=(Doctor const& o) { if (&o != this) name = o.name; return *this; } // ... }; ```
[ 0.16704609990119934, -0.08616029471158981, 0.10255775600671768, -0.044527411460876465, 0.26558345556259155, -0.032668985426425934, 0.07700448483228683, -0.24714532494544983, 0.19581784307956696, -0.2523921728134155, -0.16220353543758392, 0.4565199017524719, -0.5455545783042908, 0.311242192...
I'm trying to calculate the conditional median of a chart that looks like this: ``` A | B ------- x | 1 x | 1 x | 3 x | y | 4 z | 5 ``` I'm using MS Excel 2007. I am aware of the AVERAGEIF() statement, but there is no equivalent for Median. The main trick is that there are rows with no data - such as ...
[ -0.11004997044801712, 0.13878199458122253, 0.2853817641735077, -0.32418233156204224, -0.4604658782482147, 0.207130566239357, 0.20223310589790344, -0.12219615280628204, -0.2060016542673111, -0.6520140767097473, 0.29039064049720764, 0.6355499029159546, -0.3286689519882202, -0.107710383832454...
the formula format (maybe because it's 2007?) ``` =MEDIAN(IF((A:A="x")*(A:A<>"")), B:B) ``` Excel gives an error saying there is something wrong with my formula(something to do with the \* in the condition) I had also tried the following, but it counts blank cells as 0's in the calculations: ``` =MEDIAN(IF(A:A = "x...
[ -0.0030069968197494745, 0.22346706688404083, 0.16589920222759247, -0.16531489789485931, -0.26187893748283386, -0.07779773324728012, 0.11109938472509384, -0.2658758759498596, 0.03237415477633476, -0.4098778963088989, 0.09783540666103363, 0.7150436043739319, 0.0503007136285305, -0.1187503337...
is non-blank. Anything that matches both conditions gets calculated as part of the median. Given the following data set: ``` A | B ------ x | x | x | 2 x | 3 x | 4 x | 5 ``` The above formula returns 3.5, which is what I believe you wanted.
[ 0.26896700263023376, -0.02967260032892227, 0.2942843735218048, -0.2822670042514801, 0.08454294502735138, 0.1019032821059227, 0.12452705204486847, -0.4317365288734436, 0.277463436126709, -0.2612570822238922, 0.09371446073055267, 0.6814122200012207, -0.0649828240275383, 0.03068031556904316, ...
I need to build a reporting interface to an application I'm working on which requires administrators to visualise huge quantities of collected data over time. Think something similar to Google Analytics etc. Most of the data that needs to be visualised sits in a basic table which contains a datetime, 'action' varchar...
[ 0.25681862235069275, 0.1261039823293686, 0.7902228236198425, -0.04696742817759514, -0.2379634827375412, 0.12097200751304626, 0.2259741723537445, -0.12974469363689423, -0.23112715780735016, -0.5572973489761353, 0.1308620572090149, 0.18886373937129974, 0.0993526354432106, -0.1077867299318313...
Two tiers -- raw data, and summarized data. For raw data, indexes will likely be of no help. You are doing aggregations, in most cases that necessitates a full table scan. If it doesn't, reorganize so it does, it'll be faster. 2) Figure out your aggregates, automatically generate them, and run the reports off the aggr...
[ -0.03714718669652939, -0.12915214896202087, 0.27851903438568115, 0.5087411999702454, -0.13697317242622375, -0.0217907652258873, -0.11777570843696594, -0.32569247484207153, -0.3083042800426483, -0.6508769989013672, -0.087212473154068, 0.35540661215782166, -0.06453578174114227, 0.05563242360...
or feature-heavy, depending on your point of view -- databases give you something called "partitioning" to do this in a more sane way). 5) Read up on "data warehousing" <http://en.wikipedia.org/wiki/Data_warehouse>
[ 0.4827759563922882, -0.22165200114250183, 0.05604080483317375, 0.18997512757778168, -0.014570302329957485, -0.061859842389822006, -0.3856361210346222, -0.03657758608460426, -0.3646150231361389, -0.4906812608242035, -0.24370290338993073, 0.4046023488044739, 0.10396117717027664, 0.0391024537...
I'm trying to allow two different processes to communicate by using memory mapping the same file. However, I'm having some problems with this. I have a feeling this has to do with the way I'm using the open() call and passing my file descriptor to mmap. Here is my code, can you see anything wrong with it? Object 1's...
[ 0.22168906033039093, 0.09448147565126419, 0.6004397869110107, -0.21249428391456604, 0.2934187054634094, 0.10814975202083588, 0.35550281405448914, -0.43147850036621094, -0.30337098240852356, -0.7262883186340332, -0.21386687457561493, 0.7052858471870422, -0.4717128872871399, -0.1193936616182...
21 int sharedFileName = fileno(temp); ... 31 sharedArea = (MyStruct*)mmap(0, fileSize, 32 PROT_READ | PROT_WRITE | PROT_EXEC, MAP_SHARED, sharedFileName, 0); ``` I use the "w" file mode since Object 1 will only ever be made once and I want it to reset any previously existing data. Object 2's Code:...
[ -0.04749034717679024, -0.22445008158683777, 0.48016950488090515, -0.20303918421268463, -0.022728048264980316, 0.4188198149204254, 0.553595781326294, -0.6424179673194885, -0.35219624638557434, -0.5528934597969055, -0.15353268384933472, 0.28772005438804626, -0.2449878454208374, 0.01388025563...
PROT_READ | PROT_WRITE | PROT_EXEC, MAP_SHARED, theFile, 0); ``` A few issues: 1. Avoid mixing high-level I/O (fopen(), fseek()) and some low-level operation like mmap(). Although you can get the low-level file descriptor using fileno(), that is like taking the longest route to get to the same place. Also, just using...
[ 0.07621423900127411, -0.14251093566417694, 0.10617882758378983, -0.15402567386627197, 0.10341831296682358, -0.11408741027116776, 0.25610098242759705, -0.2789284288883209, -0.07666035741567612, -0.7599776387214661, -0.28579699993133545, 0.8345103859901428, -0.5739189982414246, -0.1423980742...
you are going to use it as random-access (direct indexing) data. fprintf() is for stream output, you usually use it for sequential access. In fact, although possible, it is unusual to see fprintf() and fseek() in the same descriptor (this is not even portable, but due to the previous item, I'm not considering portabili...
[ 0.07360528409481049, -0.3407585918903351, 0.23983857035636902, 0.09684106707572937, 0.28414252400398254, -0.39479732513427734, 0.07029354572296143, -0.15789228677749634, -0.14521080255508423, -0.6296675205230713, -0.1765584945678711, 0.58747398853302, -0.38027670979499817, 0.00043443735921...
open the file with the correct flags? This is supposed to be "implementation-detail" for the C library. If you want to memory-map a file with read and write permissions, you should use the low-level `open(theSharedFileName, O_RDWR)` to open the file. 4. **Do not** use `PROT_WRITE` and `PROT_EXEC` together. It is not po...
[ 0.2964799702167511, 0.27119651436805725, 0.2698766887187958, -0.10437248647212982, -0.054949890822172165, -0.5675308704376221, 0.27226439118385315, -0.01415275502949953, -0.2829464077949524, -0.6848458051681519, -0.5179608464241028, 0.5633717179298401, -0.30387187004089355, 0.0049384115263...
I am trying to map network drive, but get error 1219 on Windows XP: ``` net use z: \\serverA\tests password /user:serverA\alex ``` I have tried ``` net use * /del /yes ``` But it has no effect, and the ``` net use ``` shows empty list. \\serverA\tests is a valid path, as I can open it in Explorer. What can ...
[ 0.13262246549129486, 0.09905225783586502, 0.4676879048347473, -0.05048547312617302, 0.02255496010184288, -0.3356156349182129, 0.5002228021621704, 0.1944420039653778, -0.17693287134170532, -1.000450849533081, -0.140500009059906, 0.4761822819709778, -0.2644804120063782, 0.4275483787059784, ...
buggy preview handler/shell extension. If you can't find the handle, you can always try using the IP address of ServerA to create a new connection with different credentials, e.g. ``` net use z: \\10.1.2.3\tests password /user:serverA\alex ``` --- Yes, sorry - use *Find Handle or DLL* with \\ServerA to find the pr...
[ -0.02289368025958538, -0.0929466038942337, -0.008774141781032085, 0.11839135736227036, -0.005871977657079697, -0.2850748896598816, 0.39493614435195923, 0.4110782742500305, -0.10143467038869858, -0.8891662359237671, 0.00006998564640525728, 0.43742144107818604, -0.6549876928329468, 0.4078001...
What does it mean for two binary trees to be isomorphic? I've been looking online and I can't seem to find a clear explanation. As far as I understand, two trees are isomorphic if they have the same shape. So I'm guessing two identical trees which can contain different values in the nodes. Isomorphic comes from the Gr...
[ 0.292190819978714, 0.021618254482746124, -0.13901761174201965, 0.13412539660930634, -0.1568552702665329, 0.2411005198955536, 0.1659386307001114, 0.19637180864810944, -0.16174274682998657, -0.5702031850814819, -0.07586074620485306, 0.028452252969145775, -0.2635771632194519, 0.26359421014785...
node and one right node; see below for example). Mathematicians have their own language which only *sometimes* bears a passing relationship to English :-) It's not just binary trees. In mathematics, two structures are isomorphic if their properties are preserved regardless of their expression (you can have a function ...
[ -0.10873924195766449, 0.1596338450908661, -0.3028630316257477, 0.35238927602767944, -0.03624533489346504, 0.08180268108844757, 0.010913046076893806, 0.16197806596755981, -0.17473135888576508, -0.7243273854255676, -0.45492812991142273, -0.1640947163105011, -0.16157908737659454, 0.2765237390...
two would be isomorphic: ``` 2 1 / \ \ 1 3 2 \ 3 ``` A sorted linked list (or sorted array, for that matter) is also isomorphic to those since, in that case, no information would be lost in the transformations between the two. If the binary tree was used in a manner wher...
[ -0.21334409713745117, -0.1947922706604004, -0.02357724867761135, -0.22723883390426636, -0.1600998193025589, -0.030326105654239655, -0.23155012726783752, -0.15353228151798248, -0.25521570444107056, -0.7204130291938782, -0.47613760828971863, 0.1861206591129303, -0.8066948652267456, 0.0239793...
of container), then the information would just be the contents in any order, and all the following would be isomorphic (that second last one's just a bag, the last is a list): ``` 2 1 2 3 +---+ +---+ +---+ / \ \ / \
[ -0.023473748937249184, 0.11173377186059952, 0.5078526735305786, 0.08882185071706772, 0.17855341732501984, -0.11441462486982346, -0.3531765937805176, -0.0383860245347023, -0.1392519325017929, -0.5920556783676147, -0.1526688039302826, 0.17393484711647034, -0.4527025520801544, 0.4076515734195...
+-------+ | 3 |->| 1 |->| 2 | 1 3 2 1 2 | 1,3,2 | +---+ +---+ +---+ \ / \ +-------+ 3 3
[ -0.2830575704574585, 0.371012806892395, 0.48186326026916504, -0.37255558371543884, -0.18274348974227905, 0.3870323598384857, 0.2773893177509308, -0.7039651870727539, 0.2592741549015045, -0.29633593559265137, -0.4563051760196686, 0.3321150243282318, -0.3441236615180969, 0.05297363921999931,...
1 ``` Of course, an unsorted tree may be considered to be a bit of a waste depending on your needs, but that's not relevant to this particular discussion.
[ 0.3781813681125641, 0.22650274634361267, -0.20692025125026703, 0.3111288547515869, 0.04262533783912659, -0.2757268249988556, 0.0317140556871891, 0.1718946397304535, -0.10753048211336136, -0.6019335389137268, -0.2961043119430542, 0.21571506559848785, -0.2887837886810303, -0.0611070133745670...
I have drawn an line graph (as an unclosed path) with 10 (x,y) points by using CGContextBeginPath, CGContextAddLineToPoint and CGContextMoveToPoint . I would like to be able to retrieve the vertical coordinate (y) of the path where the user have given input of the horizontal coordinate (x) by touching the screen, so I...
[ 0.3806585371494293, -0.03666383773088455, 0.7574024200439453, 0.23091478645801544, -0.09849689900875092, 0.35846632719039917, -0.14922067523002625, -0.0064795841462910175, -0.39583784341812134, -0.6227884292602539, 0.3142504096031189, 0.07921265810728073, -0.22222226858139038, 0.2173385471...
Many years ago, just as I was getting started with programming, I ran into some programming games in the style of CRobots (I don't think it actually was CRobots, but a clone of sorts) which were pretty cool to play around with. Recently I've gotten a feeling of "programming is work, not play", which I would rather get...
[ 0.40988484025001526, 0.2743721902370453, -0.005870268680155277, 0.23752401769161224, -0.2277487814426422, 0.031239479780197144, -0.03822175785899162, 0.38261833786964417, -0.22771134972572327, -0.6061617732048035, 0.28971239924430847, 0.6098817586898804, -0.13807204365730286, 0.25367966294...
tie the competition to a single language. The ones I found after a late night of googling seem to be tied to a single language, and even the ones that are based on Java (like Robocode) seem to have problems trying to use Jython or other JVM-based languages (that in theory should work). Are there any games of this type...
[ 0.016151150688529015, -0.3066351115703583, 0.2930943965911865, 0.18764722347259521, -0.08552389591932297, -0.08084175735712051, 0.09396004676818848, 0.0010628377785906196, -0.0696803405880928, -0.6327638030052185, 0.05632603541016579, 0.4565957188606262, -0.19933085143566132, -0.1590768694...
server that controls the battle. This means you can implement a robot in any language you want, as long as it can support sockets (for IWOR) or stdin/stdout (for RTB).
[ -0.17637497186660767, -0.25535163283348083, 0.3015432059764862, 0.1303337812423706, -0.36255428194999695, 0.16583551466464996, 0.09036500751972198, 0.11037789285182953, -0.09638950973749161, -0.6250728964805603, -0.17087328433990479, 0.39203131198883057, -0.2720436155796051, 0.124186620116...
I've got xampp installed on my laptop runing XP, and it's been running without any problems for ages. I've just tried installing cakephp, and have altered the database config and enabled mod\_rewrite. But now I get the following on the welcome page: > Your tmp directory is writable. > > > The FileEngine is being u...
[ 0.26915106177330017, 0.07218630611896515, 0.4606367349624634, -0.10118798166513443, -0.33280864357948303, -0.1470460742712021, 0.36349210143089294, 0.3079570233821869, -0.3892739415168762, -1.1079893112182617, -0.10429130494594574, 0.34394508600234985, -0.37138497829437256, 0.0933011695742...
problem and have any idea how to resolve it? \*edit Advice on configuring datalogging in cake would be a great help too First, edit `~/app/config/core.php` and raise debug to 2, this will give you more detailed error reporting. Second, triple check your `~/app/config/database.php` and be 110% sure there is no typo i...
[ 0.023856475949287415, 0.0054746465757489204, 0.14724846184253693, 0.23525388538837433, -0.07474225014448166, -0.04768909141421318, 0.4761952757835388, 0.033950917422771454, -0.3125830590724945, -0.8645638823509216, -0.10974892973899841, 0.578857421875, -0.11481621861457825, -0.206041157245...
I have a sentence, for example > John Doe moved to New York last year. Now I split the sentence into the single words and I get: > array('John', 'Doe', 'moved', 'to', 'New', 'York', 'last', 'year') That's quite easy. But then I want to combine the single words to get all the composed terms. It doesn't if the compos...
[ 0.27691835165023804, -0.03077910840511322, 0.7282716631889343, -0.11090292781591415, 0.1918802112340927, 0.6796076893806458, 0.28458884358406067, -0.044128160923719406, -0.7079174518585205, -0.7890310287475586, -0.0066837891936302185, -0.3183192014694214, -0.09899424016475677, 0.3179690837...
limit of k parts. In the example above, the limit is 3. So a term can contain 3 words at most. The problem: How could I code the composition in PHP? It would be great if I had a function which gets a sentence as the input and gives an array with all terms as the output. I hope you can help me. Thanks in advance! If y...
[ -0.0767548531293869, 0.036336954683065414, 0.2756720185279846, 0.10731598734855652, -0.4569016098976135, 0.30349940061569214, 0.5536677837371826, -0.37220630049705505, -0.13190583884716034, -0.25058338046073914, 0.18418774008750916, 0.17920337617397308, -0.1652568280696869, 0.0222238656133...
phrases. ``` function getPhrases($array, $maxTerms = 3) { for($i=0; $i < $maxTerms; $i++) { //Until we've generated terms of all lengths for($j = 0; $j < (sizeof($array) - $i); $j++) { //Until we've iterated as far through the array as we should go $termArray[] = array(array_slice($array, $j,...
[ 0.3703489601612091, -0.09728863090276718, 0.5971904993057251, -0.1516939103603363, -0.18158306181430817, -0.16141393780708313, 0.6822312474250793, -0.48868241906166077, 0.0760345607995987, -0.2752755880355835, -0.3831695318222046, 0.5156134366989136, -0.3188653886318207, 0.4416677951812744...
"This is a pretty long example sentence"); print_r(getPhrases($newarray)); ```
[ 0.10484347492456436, -0.009281757287681103, 0.3883180022239685, -0.4126668870449066, 0.3598341643810272, -0.27824971079826355, 0.6167665719985962, -0.05189582705497742, -0.12289891391992569, -0.26838910579681396, -0.575971782207489, 0.5079947710037231, -0.45512083172798157, 0.1317420303821...
The German website nandoo.net offers the possibility to shorten a news article. If you change the percentage value with a slider, the text changes and some sentences are left out. You can see that in action here: > <http://www.nandoo.net/read/article/299925/> The news article is on the left side and tags are marked....
[ 0.4983100891113281, -0.2340315878391266, 0.10368616133928299, 0.03595802187919617, -0.29331666231155396, 0.004157573916018009, 0.24727025628089905, 0.12664520740509033, -0.24338383972644806, -0.14350305497646332, 0.13360676169395447, -0.022504499182105064, 0.026824718341231346, -0.00217124...
nouns in a sentence. Then the sentences with fewest number of tags/nouns are left out. Could that be true? Or do you have another idea? I hope you can help me. Thanks in advance! Usually you want to keep the sentences that have words that are more unique to that article. That is, the more "generic" the sentence is, ...
[ 0.06298457086086273, 0.022337671369314194, -0.2837706208229065, 0.19493618607521057, -0.35256239771842957, 0.050569213926792145, 0.6683083772659302, 0.18800796568393707, -0.25550562143325806, -0.5393949747085571, -0.14350628852844238, 0.3353350758552551, -0.20424644649028778, -0.0388422682...
I have a user control that displays a list of categories. In that user control I have a Label control that I would like to write to from the code behind file. This is my Label I have tried this code: ``` Label lblCount = (Label)this.Page.FindControl("Label1"); lblCount.text = "some text"; ``` How can I get access t...
[ 0.07899317890405655, 0.1950892210006714, 0.3719682991504669, -0.27229610085487366, -0.16638422012329102, -0.07025494426488876, 0.23185057938098907, -0.33093568682670593, -0.2265191674232483, -0.8228910565376282, 0.16902412474155426, 0.4570271074771881, -0.44303542375564575, 0.2332904636859...
method like this in the code behind. ``` protected string GetAmount() { return "some text"; } ``` The GetAmount() method will be called for every row in the page. You can pass parameters from the datasoure using Eval("ColumnName") if you need them.
[ -0.11563798785209656, -0.08257479220628738, 0.5618849396705627, -0.08728974312543869, 0.1843166947364807, 0.057950638234615326, 0.18584395945072174, -0.24143190681934357, -0.07904979586601257, -0.5148633122444153, -0.24096174538135529, 0.7559937238693237, -0.5430119633674622, -0.1926901936...
I have an application that creates database tables on the fly. I'd like to create an interface to CRUD this data. But because the tables are created as the application runs, I can’t create the Linq to SQL classes by dragging them onto the designer. However, I do know in my code what the tables I want to edit are. Can ...
[ 0.6276991963386536, -0.033095583319664, 0.293425053358078, 0.23845995962619781, -0.036518920212984085, -0.26945576071739197, -0.15279521048069, 0.17915423214435577, -0.46160006523132324, -0.5526673197746277, 0.10255394876003265, 0.525743305683136, -0.4143391251564026, 0.0038537727668881416...
discovering the LINQ-to-SQL or Entities Framework data model at run time* There is an MVC version coming but that will have similar limitations. There may be some way you can create a workaround for your situation since you do have tables at some point but I'm unsure without more information.
[ 0.2666245400905609, -0.08462463319301605, 0.5308842658996582, 0.5332898497581482, 0.0699460580945015, -0.2818290591239929, 0.20090413093566895, 0.24018599092960358, -0.22794190049171448, -0.6413662433624268, 0.2935349643230438, 0.28681066632270813, -0.12471316754817963, -0.1446515023708343...
This is more of an hardware question than a software one but still...: I would like to have a server at home to play/experiment with it. The usages would be to host my own repositories (bzr, svn, etc), have a small webserver to host a wiki/trac for my personal programming projects and a ftp to host files. So I'm consi...
[ 0.8902226686477661, 0.1324085146188736, 0.04122629016637802, 0.30353182554244995, 0.3547452688217163, 0.015486665070056915, -0.08581319451332092, 0.11213697493076324, -0.27959489822387695, -0.4819183945655823, 0.2532999515533447, 0.2688385844230652, 0.09263397008180618, 0.35536789894104004...
that are x86 to boot! These won't be any speed demon computers, but if you just want to use it for light home usage such as repository and ftp serving, you should be fine. [Here](http://www.mini-box.com/Alix-3D-Board-3-LAN-1-MINI-PCI-1_3?sc=8&category=19) is a computer that runs on about 5 watts... You could run 12 on...
[ 0.6553708910942078, -0.20196600258350372, 0.26762855052948, 0.1627236008644104, 0.055554818361997604, -0.2116319239139557, 0.00393397081643343, 0.22800585627555847, -0.24464242160320282, -0.54693603515625, 0.004724275786429644, 0.5010070204734802, -0.20980896055698395, 0.22802330553531647,...
I am building a WPF application and I want its background to be filled with **particles** with random: * Opacity/z-order * Size * Velocity * "*Fuzziness*" (blur effect) * Directions (or path) I've found [a really good example](http://www.flashden.net/item/background-animation-blurry-light-cells/21980) of what I'd lik...
[ 0.20174096524715424, -0.22528478503227234, 0.749483048915863, 0.23442566394805908, -0.20693156123161316, -0.3485954999923706, 0.11237913370132446, -0.023936649784445763, -0.33573421835899353, -0.8616231679916382, 0.05170515924692154, 0.17705455422401428, 0.023248355835676193, -0.2390217036...
that defines a Particle with all its properties ``` public class Particle { public Point3D Position { get; set; } public Point3D Velocity { get; set; } public double Size { get; set; } public Ellipse Ellipse { get; set; } public BlurEffect Blur { get; set; } public Brush Brush { get; set; } }...
[ -0.18900321424007416, -0.4018581807613373, 1.049151062965393, 0.040365394204854965, -0.5400053858757019, 0.12645140290260315, 0.037243954837322235, -0.35358184576034546, -0.16581767797470093, -0.7102911472320557, 0.14037522673606873, 0.08434144407510757, -0.2843552231788635, 0.333563596010...
<Grid.Background> <RadialGradientBrush Center="0.54326,0.45465" RadiusX="0.602049" RadiusY="1.02049" GradientOrigin="0.4326,0.45465"> <GradientStop Color="#57ffe6" Offset="0"/> <GradientStop Color="#008ee7" Offset="0.718518495559692"/> <GradientStop Color="#2c...
[ -0.5562305450439453, -0.6198058128356934, 0.6448042988777161, -0.07966823130846024, -0.19916677474975586, 0.3576185405254364, -0.033106107264757156, -0.4013824164867401, -0.2670977711677551, -0.7636425495147705, 0.3414516746997833, 0.40320682525634766, -0.19788457453250885, -0.118717812001...
x:Name="ParticleHost" /> </Grid> </Window> ``` ***Code "Window1.xaml.cs"***: where everything happens ``` public partial class Window1 : Window { // ... some var/init code... private void Window_Loaded(object sender, RoutedEventArgs e) { timer.Interval = TimeSpan.FromMilliseconds(10); ...
[ 0.1086956039071083, -0.42045706510543823, 0.6651538014411926, -0.1525178998708725, 0.21166357398033142, 0.10566862672567368, 0.30010083317756653, -0.03175054118037224, -0.2846473157405853, -0.7116212844848633, -0.37108296155929565, 0.39484021067619324, -0.40055957436561584, 0.3040025830268...
private void UpdateParticules() { // clear dead particles list deadList.Clear(); // update existing particles foreach (Particle p in this.particles) { // kill a particle when its too high or on the sides if (p.Position.Y < -p.Size ||
[ 0.11142753809690475, -0.21159298717975616, 0.18890102207660675, -0.08216691017150879, 0.3586580157279968, 0.12084382772445679, 0.37457841634750366, -0.13290905952453613, -0.24421866238117218, -0.43516504764556885, -0.16732817888259888, 0.33802205324172974, -0.5681674480438232, 0.2374196946...
p.Position.X < -p.Size || p.Position.X > Width + p.Size) { deadList.Add(p); } else { // update position
[ -0.29498061537742615, -0.3863030672073364, 0.43945595622062683, -0.45065638422966003, 0.25810664892196655, 0.35328903794288635, -0.2354411631822586, -0.29872041940689087, -0.39489737153053284, -0.38155946135520935, -0.24955154955387115, 0.4020995795726776, -0.1923288106918335, -0.063803203...
p.Position.X += p.Velocity.X * elapsed; p.Position.Y += p.Velocity.Y * elapsed; p.Position.Z += p.Velocity.Z * elapsed; TranslateTransform t = (p.Ellipse.RenderTransform as TranslateTransform); t.X = p.Position.X;
[ -0.4720197319984436, -0.34776556491851807, 1.363823652267456, -0.026898233219981194, -0.1165061891078949, 0.7281189560890198, 0.0004768642829731107, -0.15688125789165497, 0.06247933208942413, -0.391204833984375, -0.5144751667976379, 0.23744550347328186, -0.003773708827793598, -0.1143886670...
t.Y = p.Position.Y; // update brush/blur p.Ellipse.Fill = p.Brush; p.Ellipse.Effect = p.Blur; } } // create new particles (up to 10 or 25)
[ -0.06633344292640686, -0.3329506516456604, 0.7500215768814087, 0.09687013924121857, -0.31775468587875366, 0.5873940587043762, 0.19684554636478424, -0.6385459303855896, -0.3173704743385315, -0.5696904063224792, -0.06931092590093613, 0.08371834456920624, -0.31169819831848145, -0.018348276615...
for (int i = 0; i < 10 && this.particles.Count < 25; i++) { // attempt to recycle ellipses if they are in the deadlist if (deadList.Count - 1 >= i) { SpawnParticle(deadList[i].Ellipse);
[ -0.21739770472049713, -0.2859976291656494, 0.565915048122406, -0.04289316013455391, 0.20823389291763306, 0.2061951756477356, 0.24483154714107513, -0.24175772070884705, -0.11974187940359116, -0.38982486724853516, -0.24462829530239105, 0.16986814141273499, -0.39062580466270447, 0.00211974326...
deadList[i].Ellipse = null; } else { SpawnParticle(null); } } // Remove dead particles
[ 0.20787592232227325, -0.2842816710472107, 0.20185361802577972, -0.019553566351532936, 0.0321248397231102, 0.14363963901996613, 0.3293098211288452, -0.05763817951083183, -0.31968608498573303, -0.3322290778160095, -0.01479498203843832, 0.13797064125537872, -0.4959230422973633, 0.325116544961...
foreach (Particle p in deadList) { if (p.Ellipse != null) ParticleHost.Children.Remove(p.Ellipse); this.particles.Remove(p); } } private void SpawnParticle(Ellipse e) { // Randomization double x = RandomWithVariance(Width / 2, Width / 2); doub...
[ -0.032956015318632126, -0.47901996970176697, 0.3771839737892151, -0.040111660957336426, 0.1993952989578247, 0.39364302158355713, 0.02107050269842148, -0.17145892977714539, -0.30290794372558594, -0.48715001344680786, 0.06211181357502937, 0.09180566668510437, -0.4006892740726471, 0.226044997...
Height; double z = 10 * (random.NextDouble() * 100); double speed = RandomWithVariance(20, 15); double size = RandomWithVariance(75, 50); Particle p = new Particle(); p.Position = new Point3D(x, y, z); p.Size = size; // Blur var blur = new BlurEffect();
[ -0.01921728067100048, -0.4697738289833069, 0.9108068943023682, -0.12028732895851135, -0.34922438859939575, 0.35104915499687195, 0.003911970183253288, -0.4522903859615326, -0.4510994255542755, -0.7942624092102051, -0.08030161261558533, 0.2377994954586029, -0.16165785491466522, 0.48101183772...
blur.RenderingBias = RenderingBias.Performance; blur.Radius = RandomWithVariance(10, 15); p.Blur = blur; // Brush (for opacity) var brush = (Brush)Brushes.White.Clone(); brush.Opacity = RandomWithVariance(0.5, 0.5); p.Brush = brush; TranslateTransform t; ...
[ -0.03189593181014061, -0.39813876152038574, 0.7960119247436523, -0.09473664313554764, -0.2124997079372406, 0.3057872951030731, 0.3860599100589752, -0.7115421891212463, -0.032777875661849976, -0.414228230714798, 0.0020869174040853977, 0.6231496334075928, -0.47771957516670227, 0.126530826091...
e.Fill = null; e.Width = e.Height = size; p.Ellipse = e; t = e.RenderTransform as TranslateTransform; } else { p.Ellipse = new Ellipse();
[ -0.5576155781745911, -0.1689857542514801, 1.1569651365280151, -0.1789463311433792, -0.01660342700779438, 0.30984002351760864, 0.13871008157730103, -0.14474250376224518, -0.037258099764585495, -0.5833675265312195, -0.6760420203208923, 0.3486730754375458, -0.07501900941133499, 0.120797283947...
p.Ellipse.Width = p.Ellipse.Height = size; this.ParticleHost.Children.Add(p.Ellipse); t = new TranslateTransform(); p.Ellipse.RenderTransform = t; p.Ellipse.RenderTransformOrigin = new Point(0.5, 0.5); } t.X = p.Position.X; t.Y = p.Position.Y;
[ -0.6477746367454529, -0.19444188475608826, 1.3153156042099, -0.04273513704538345, -0.17320369184017181, 0.547031819820404, -0.073353111743927, 0.01822499744594097, -0.3801717460155487, -0.5052456855773926, -0.5545239448547363, 0.029525872319936752, 0.0041972678154706955, 0.1338446140289306...
// Speed double velocityMultiplier = (random.NextDouble() + 0.25) * speed; double vX = (1.0 - (random.NextDouble() * 2.0)) * velocityMultiplier; // Only going from the bottom of the screen to the top (for now) double vY = -Math.Abs((1.0 - (random.NextDouble() * 2.0)) * velocityMultiplier...
[ -0.16948102414608002, -0.4504743218421936, 0.8838924765586853, 0.033197809010744095, -0.007488367613404989, 0.33067119121551514, 0.06167230382561684, -0.19561481475830078, -0.2559676170349121, -0.809532642364502, -0.22562167048454285, 0.3126804232597351, -0.025845037773251534, 0.1320464909...
} private double RandomWithVariance(double midvalue, double variance) { double min = Math.Max(midvalue - (variance / 2), 0); double max = midvalue + (variance / 2); double value = min + ((max - min) * random.NextDouble()); return value; } } ``` Thanks a lot! Erich Mirabal ...
[ 0.18897323310375214, -0.27916330099105835, 0.13305094838142395, 0.24758827686309814, -0.09697495400905609, 0.164606511592865, 0.2526301145553589, -0.04727346450090408, -0.13756628334522247, -0.2424594759941101, 0.35322099924087524, 0.44540342688560486, -0.1628560870885849, 0.24020637571811...
newbie I did not manage to do a Box/Gaussian blur... Anyway, I found a way that use no CPU at all. Instead of moving Ellipse, I'm moving their Image. I generate an in-memory PNG with **RenderTargetBitmap** and **PngBitmapEncoder** classes and move theses *already-blurred-and-transparent* Images! Thanks a lot to ev...
[ 0.0944819301366806, -0.12691454589366913, 0.7570744156837463, 0.505125105381012, 0.2338496297597885, -0.12610365450382233, -0.24969395995140076, 0.15449079871177673, -0.3333485722541809, -0.7622398138046265, -0.10984823852777481, 0.4056549370288849, -0.054736215621232986, 0.013874431140720...
What does - 'Knowing a language' really mean? I'm sure it's more than knowing just the syntax. Is it * knowing all/most of the available libraries * knowing how the features of the language are implemented How did you learn the language you are proficient in? "Knowing" a programming language is very similar to "k...
[ 0.485850989818573, 0.20181748270988464, 0.010051481425762177, 0.3094564974308014, -0.02077683061361313, 0.06202274560928345, 0.7766394019126892, 0.381428986787796, -0.2297629863023758, -0.4602387249469757, 0.1911419928073883, 0.7304446697235107, 0.2791112959384918, -0.42768317461013794, ...
where to go to find the technical details on more obscure parts of a framework. For languages/platforms that don't have a "framework" per se, it is having that knowledge of the major libraries commonly accepted by the community. For writing in that language, it means spending ~90%+ time on the design of what you're wr...
[ 0.43210530281066895, 0.34466829895973206, -0.09482418745756149, 0.4752683937549591, 0.21763555705547333, -0.3515740931034088, 0.595218300819397, 0.19341334700584412, -0.23116078972816467, -0.8205295205116272, -0.08497536927461624, 0.4445755183696747, 0.3881736993789673, -0.3830209672451019...
<http://weblogs.java.net/blog/kgh/archive/2004/10/multithreaded_t.html> argues that multithreaded GUI frameworks are a failed dream. What about non-GUI frameworks? Does this rule of thumb extend to all event-driven frameworks? Here is a quote from the article that caught my attention: > > The problem of input event p...
[ -0.23919783532619476, -0.12644396722316742, 0.0513031892478466, 0.16543206572532654, -0.2526448667049408, -0.09188350290060043, 0.1320822834968567, 0.10652874410152435, -0.25249576568603516, -0.6175938248634338, -0.028052859008312225, 0.6702197194099426, -0.3364357054233551, 0.004780174698...
GUI abstractions, that call into lower level GUI abstractions, that call into the ugly guts of the toolkit, and thence into the OS. In contrast, input events start of at the OS layer and are progressively dispatched "up" the abstraction layers, until they arrive in my application code. > > > > > > Now, since we are u...
[ 0.26473528146743774, 0.0289178304374218, 0.1982695311307907, 0.3105098307132721, 0.1371011883020401, -0.017173871397972107, -0.07936881482601166, -0.13028790056705475, -0.15786544978618622, -0.5330719947814941, -0.07906026393175125, 0.9180893301963806, -0.37440210580825806, 0.0566114336252...
would have to say no, with a caveat. Event driven frameworks that revolve around shared state, such as a UI, *should* be single threaded. Event driven frameworks that revolve around notifications, such mechanical monitoring(e.g. letting you know when the pressure in a pipe is too high), could be single threaded, but mi...
[ 0.31912991404533386, -0.22974476218223572, -0.0055281794629991055, 0.22760041058063507, -0.10340830683708191, -0.08294839411973953, 0.38126909732818604, 0.006450466811656952, -0.2037559151649475, -0.8656234741210938, -0.15752646327018738, 0.28280696272850037, -0.28445491194725037, 0.026597...
problem was that with a multi-threaded UI framework, it wasn't just *me* that had to deal with the threading, but anyone that used the UI. The core was certainly thread safe, but then anyone that wrote a control had to make *that* thread safe as well. Nevermind that when making multiple changes to the UI, you had to no...
[ -0.02597757801413536, -0.2181217521429062, 0.17117251455783844, 0.4052281081676483, -0.28272873163223267, 0.04571785032749176, 0.3624112606048584, 0.1165962740778923, -0.3290363848209381, -0.44533342123031616, 0.060201503336429596, 0.3502866327762604, -0.13220493495464325, -0.2666894197463...
cases. Single threading is actually the appropriate model here. On the other hand, in a model where there isn't(or isn't much) shared state, a multi threaded model makes eminent sense. There's no reason for one event(the reactor is on fire) to be delayed for the 30 seconds it takes for your query(Bob the operator just...
[ 0.012983778491616249, -0.05139357969164848, 0.10950369387865067, 0.11902271956205368, 0.015236553736031055, -0.21134145557880402, 0.20513953268527985, 0.09444701671600342, -0.4967713952064514, -0.45099347829818726, -0.37758007645606995, 0.18792960047721863, -0.301129549741745, 0.2671214044...
I have a `std::vector` with `n` elements. Now I need to pass a pointer to a vector that has the last `n-1` elements to a function. For example, my `vector<int> foo` contains `(5,2,6,87,251)`. A function takes `vector<int>*` and I want to pass it a pointer to `(2,6,87,251)`. Can I just (safely) take the iterator `++fo...
[ 0.03987288847565651, 0.15879030525684357, 0.254973828792572, -0.1708388328552246, 0.08544629067182541, 0.08055184781551361, 0.09597143530845642, -0.35700249671936035, -0.12133318185806274, -0.569039523601532, -0.07232373207807541, 0.45892849564552307, -0.5200080275535583, 0.202516451478004...
So in that case, is copying the `n-1` elements from `foo` into a new vector and calling `find` with a pointer to that the only option? Very inefficient! It's like Shlemiel the painter, especially since i have to query many subsets: the last `n-1`, then `n-2`, etc. elements and see if they are in the `unordered_set`. > ...
[ 0.17227980494499207, 0.14665056765079498, -0.09110890328884125, 0.0038112979382276535, -0.21717441082000732, -0.1015077531337738, 0.2563139796257019, -0.10269114375114441, -0.1949038952589035, -0.656679093837738, -0.20005068182945251, 0.4207000136375427, -0.6658756136894226, 0.198328629136...
to another vector with the same contents will not work. This is not very useful for lookups, to say the least. Using `unordered_set<std::vector<int> >` would be better, because then you could perform lookups by value. I think that would also require a custom hash function object because `hash` does not to my knowledg...
[ -0.04402527958154678, -0.2640155255794525, -0.0442715547978878, 0.2403888702392578, -0.13622093200683594, -0.10935627669095993, -0.25034427642822266, 0.08621317148208618, -0.3073980510234833, -0.7730210423469543, -0.10002397000789642, 0.4067317247390747, -0.5651628971099854, 0.327659606933...
In ASP.NET MVC (default routing),I'd like to use a URL like this to return a View with a form to edit a customer: ``` /Customers/Edit/5 ``` I need to make use of `CustomerId=5`, but I don't want to permit a customer to change it.Right now I make the id hidden using: ``` <%= Html.Hidden("CustomerId") %> ``` This a...
[ 0.23483748733997345, -0.12247547507286072, 0.28461313247680664, -0.31537845730781555, -0.022377049550414085, -0.08912808448076248, 0.0952611193060875, 0.08170139044523239, -0.22875766456127167, -0.5945102572441101, 0.10306206345558167, 0.500713050365448, -0.4035339951515198, 0.107565954327...
MVC book](https://rads.stackoverflow.com/amzn/click/com/1430210079). The idea is that you create a hash of any hidden form field you want to tamper proof: ``` <%= Html.Hidden("CustomerId") %> <%= Html.Hidden("CustomerIdHash") %> ``` When the form is submitted, Steven's code then computes another hash of CustomerId a...
[ -0.18990154564380646, 0.1053381860256195, 0.8906668424606323, -0.05434989929199219, 0.03905988484621048, -0.19948601722717285, 0.20843683183193207, -0.4327501356601715, -0.16581493616104126, -0.10914723575115204, 0.07396844774484634, 0.6763262748718262, -0.0072555760852992535, -0.047647051...
Is there a good, concise guide to the various behaviors of the controls that inherit from System.Windows.Controls.Panel? Or just a WPF layout guide in general? In particular, I'm interested in how the panels handle child objects that have width or height set to "Auto" and Horizontal or Vertical Alignment set to "Stret...
[ 0.18808647990226746, -0.2659481167793274, -0.0534919872879982, 0.30731767416000366, 0.15374863147735596, 0.07568832486867905, -0.307592511177063, -0.10954084247350693, -0.6629752516746521, -0.6097366213798523, 0.1524858921766281, 0.39473631978034973, 0.07066738605499268, -0.058573093265295...
With LinqToXml I would like to read out the album list for a given artist from an xml file like ``` <?xml version="1.0" encoding="utf-8" ?> <artists> <artist name="Beatles"> <albums> <album title="Please Please Me" year="1963"/> <album title="With the Beatles" year="1963"/> ... </albums> ...
[ 0.0433754101395607, 0.30620139837265015, 0.5870283246040344, 0.0024766905698925257, -0.07103763520717621, -0.11039503663778305, -0.49115219712257385, -0.28124889731407166, -0.4822489619255066, -0.4216717779636383, -0.19834934175014496, 0.34625983238220215, -0.21564768254756927, 0.205608651...
where xartist.Attribute("name").Value.Equals(id) select new MusicArtist { Albums = from xalbum in xartist.Descendants("album") select new MusicAlbum
[ -0.14602935314178467, 0.07477019727230072, 0.5024827122688293, -0.057518813759088516, 0.36923620104789734, 0.07144695520401001, -0.38942521810531616, -0.28100794553756714, -0.207896426320076, -0.23007118701934814, 0.011848918162286282, 0.7221679091453552, -0.05706452578306198, 0.4285039603...
{ Title = xalbum.Attribute("title").Value, Year =
[ 0.1320601850748062, 0.2700558304786682, 0.3220863938331604, 0.18914204835891724, 0.18376046419143677, -0.2698496878147125, 0.1817910075187683, 0.13178367912769318, -0.13561944663524628, 0.0034655584022402763, -0.3850845396518707, 0.258889764547348, 0.3802349865436554, 0.7663488388061523, ...
int.Parse(xalbum.Attribute("year").Value) } }; var artist = artists.SingleOrDefault(); if (artist != null) return artist.Albums; else return null; ``` --- Update: My current 'best' attempt: See the accepted answer. It should be something like: ``` var result = from a...
[ 0.12157931178808212, 0.023323632776737213, 0.4672832787036896, -0.1930844783782959, 0.19206954538822174, 0.17012354731559753, 0.2912442684173584, -0.43395233154296875, -0.4123019278049469, -0.4814509153366089, -0.21433031558990479, 0.6579834222793579, -0.06794527173042297, -0.0077703353017...
let albums = artist.Element("albums") from album in albums.Elements("album") select new MusicAlbum { Title = album.Attribute("title").Value, Year = (int) album.Attribute("year")
[ 0.003358334768563509, 0.16349948942661285, 0.17550237476825714, -0.1741640865802765, 0.37265971302986145, -0.15354779362678528, -0.12246506661176682, -0.5268000364303589, -0.4321717917919159, -0.1876709908246994, -0.2053755819797516, 0.509682297706604, 0.22742746770381927, 0.27457737922668...
}; ``` Note in particular the use of `Element`/`Elements` instead of `Descendents`
[ -0.03954806551337242, 0.12281197309494019, -0.15283720195293427, -0.2728131413459778, 0.2908981144428253, -0.16593243181705475, 0.14903560280799866, 0.37532830238342285, 0.15586869418621063, -0.2804599702358246, -0.551224410533905, 0.186514750123024, -0.21289287507534027, 0.269635409116745...
I want to sort a hash which actually has a hash as a value. For instance: ``` my %hash1=( field1=>"", field2=>"", count=>0, ); my %hash2; $hash2{"asd"}={%hash1}; ``` and I inserted lots of hashes to `%hash2` with different count values of `%hash2`. How can I sort the `%hash1` according to a count value of ...
[ -0.2487799972295761, 0.12812809646129608, 0.30572783946990967, -0.25804030895233154, -0.06586059182882309, 0.10922088474035263, 0.14905112981796265, -0.1317720264196396, -0.1309759020805359, -0.5489941239356995, -0.08415058255195618, 0.3904399871826172, -0.23198945820331573, 0.109190344810...
Scala seems to have a .NET implementation too. I was wondering if it's a complete implementation with no loose ends or just a showcase thing. It's important, because the app we are about to develop should have Windows GUI besides the main implementation on web. Having a language where the core code can be ported betwe...
[ 0.4409796893596649, -0.1851058155298233, -0.037025172263383865, 0.10472625494003296, 0.14079301059246063, 0.14395271241664886, 0.046590521931648254, 0.28312674164772034, -0.3777565062046051, -0.5692130327224731, 0.09372977912425995, 0.3358171582221985, -0.20560261607170105, -0.083076409995...
hasn't been a check-in which meaningfully touched the .NET side in a long time. **Update Jan 15 2010:** A recent message to one of the scala lists. From: Lukas Rytz On Fri, Jan 15, 2010 at 03:18, Naftoli Gugenheim wrote: > Not sure if this is what you're looking for but I think H2 can be run on > > .NET, accord...
[ 0.3578193783760071, 0.13356681168079376, -0.14386941492557526, 0.13756664097309113, -0.09235773980617523, -0.40127718448638916, 0.5415454506874084, 0.10618820041418076, -0.35623934864997864, -0.7689557671546936, -0.2726227045059204, 0.12995296716690063, -0.5892069339752197, -0.069668933749...
ORM etc. there are a few. You can use Lift Mapper even in a > > non-Lift application (just include the webkit and util jars IIRC). > > What is the status of Scala on .NET? We're working on bootstrapping the compiler and we're fixing MSIL-Backend-Bugs along the way. EPFL will provide a compiler running on .NET ...
[ 0.26254141330718994, -0.06943395733833313, 0.6485151052474976, -0.0028390493243932724, -0.186454638838768, 0.08858653903007507, -0.008667430840432644, -0.24115216732025146, -0.5759527683258057, -0.47640475630760193, 0.14173133671283722, 0.22295863926410675, -0.27215203642845154, -0.0888516...
scala-library.jar to .NET). Lukas
[ -0.2824524939060211, -0.3210955858230591, 0.5636721849441528, -0.16162163019180298, 0.2933558225631714, 0.43593037128448486, 0.4210033118724823, -0.19637764990329742, -0.6130701303482056, -0.8765964508056641, -0.39486661553382874, -0.04724131524562836, -0.015701700001955032, 0.114178247749...
I have a data that looks like this: ``` AAA 0.3 1.00 foo chr1,100 AAC 0.1 2.00 bar chr2,33 AAT 3.3 2.11 chr3,45 AAG 1.3 3.11 qux chr1,88 ACA 2.3 1.33 chr8,13 ACT 2.3 7.00 bux chr5,122 ``` Note that the lines above are tab separated. Moreover, it sometime may contain 5 fields or 4 fields. What I want to do ...
[ 0.22055406868457794, 0.3996305465698242, 0.5638716220855713, -0.04149041697382927, -0.0037385420873761177, 0.2236773818731308, 0.29763588309288025, -0.19079554080963135, -0.1734059602022171, -0.38937658071517944, 0.1777011901140213, 0.4023439884185791, -0.18685734272003174, 0.0788441076874...
<fstream> #include <sstream> using namespace std; int main ( int arg_count, char *arg_vec[] ) { string line; ifstream myfile (arg_vec[1]); if (myfile.is_open()) { while (getline(myfile,line) ) { stringstream ss(line); string Tag; double Val1;
[ 0.0006200075731612742, -0.6536431908607483, 0.7524573802947998, -0.6132265329360962, 0.10809477418661118, 0.12173514068126678, 0.5371523499488831, -0.23130397498607635, 0.08869412541389465, -0.5329861640930176, -0.41881826519966125, 0.5293819904327393, -0.5650724768638611, -0.0281663369387...
double Val2; double Field4; double Field5; ss >> Tag >> Val1 >> Val2 >> Field4 >> Field5; cout << Field4 << endl; //cout << Tag << "," << Val1 << "," << Val2 << "," << Field4 <<
[ -0.09466724842786789, -0.46700021624565125, 0.150605708360672, -0.4710116982460022, 0.06432757526636124, 0.25666430592536926, 0.02141636237502098, -0.36374229192733765, -0.025449363514780998, -0.3344387710094452, -0.6378005146980286, 0.4937397837638855, -0.2996053695678711, -0.469213128089...
"," << Field5 << endl; } myfile.close(); } else { cout << "Unable to open file"; } return 0; } ``` Another C++ only version that just uses the fact that istream must set the failbit if operator>> fails to parse. ``` while(getline(ss, line)) { stringstream sl(line); sl >> tag >> v...
[ -0.25648102164268494, -0.23402078449726105, 0.872136652469635, -0.3614773154258728, 0.31431514024734497, 0.06452637165784836, 0.47351858019828796, -0.4219905138015747, -0.195159912109375, -0.34542450308799744, -0.4798484444618225, 0.5431724786758423, -0.3165556788444519, -0.073782637715339...
sl.clear(); sl.seekg(ios::beg); sl >> tag >> v1 >> v2 >> v4; // do it again with 4 v3 = "EMPTY"; // just a default value } cout << "tag: " << tag <<std::endl << "v1: " << v1 << std::endl << "v2: " << v2 << std::endl <<
[ -0.3325069546699524, -0.6469786763191223, 0.9121062755584717, -0.39659401774406433, -0.10123564302921295, 0.08580818772315979, 0.2897225618362427, -0.5650135278701782, -0.17521077394485474, -0.36781349778175354, -0.278337687253952, 0.5451973676681519, -0.5365662574768066, -0.41831675171852...
"v3: " << v3 << std::endl << "v4: " << v4 << std::endl << std::endl; } ```
[ -0.03276324272155762, 0.17641471326351166, 0.6703792214393616, -0.33605408668518066, -0.03456617891788483, -0.07152924686670303, 0.2995688319206238, -0.38968315720558167, -0.11768259853124619, -0.26683178544044495, -0.5389599800109863, 0.6630182266235352, -0.3798387348651886, 0.29756486415...
I have a MySQL database, it is getting larger and larger and I want to move the whole database to another mount point, where I have enough storage. I want my current data to be transferred, and that new data get saved to the new position. software stack: MySQL 5 running on FreeBSD 6 Of course other answers are valid. ...
[ 0.2703145146369934, 0.1791469007730484, 0.648293137550354, -0.03488412871956825, 0.27970874309539795, -0.24427494406700134, 0.23397675156593323, -0.22299429774284363, -0.42520761489868164, -0.7436439990997314, -0.3409770727157593, 0.7920941114425659, -0.2812567949295044, 0.3927421867847442...
I want a Python program to import a list of words from a text file and print out the content of the text file as two lists. The data in the text file is on this form: ``` A Alfa B Betta C Charlie ``` I want a Python program to print out one list with A,B,C and one with Alfa, Betta, Charlie. This is what I've writt...
[ 0.34336981177330017, 0.3541228175163269, 0.23387554287910461, -0.38593918085098267, -0.3937673270702362, 0.4107249975204468, 0.23855629563331604, -0.3979743421077728, -0.23796062171459198, -0.45525142550468445, -0.18474237620830536, 0.5273635983467102, -0.6473026871681213, -0.3290079236030...
to print out the whole word? You want something like this: ``` english2german = open("english2german.txt") englist = [] gerlist = [] for line in english2german: (e, g) = line.split() englist.append(e) gerlist.append(g) ``` The problem with your code before is that `englist[i:]` is actually a *slice* of ...
[ -0.04442169889807701, -0.1792065054178238, 0.2027081996202469, -0.15809756517410278, -0.5216518640518188, -0.022803787142038345, 0.40564873814582825, -0.21067573130130768, -0.21272897720336914, -0.4725159704685211, -0.5362403392791748, 0.32649484276771545, -0.6935061812400818, -0.229765385...
*I am asking this purely to determine the worthwhile-ness of implementing the class in Question ...* Do you know of a Java utility class that takes an un-synchronized instance, uses reflection to investigate that instance, and returns the input instance "wrapped" within synchronized calls ? ( ie: A factory which crea...
[ 0.6407033205032349, -0.021525343880057335, -0.2899576425552368, 0.13368801772594452, -0.3384372293949127, 0.08489380031824112, 0.28127747774124146, -0.25052717328071594, -0.38014206290245056, -0.3687206208705902, 0.11474181711673737, 0.30684328079223633, -0.6375852227210999, -0.02386126294...
public static <T> T makeSynchronized(Class<T> ifCls, T object) { return ifCls.cast(Proxy.newProxyInstance( object.getClass().getClassLoader(), new Class<?>[] {ifCls}, new Handler<T>(object))); } private static class Handler<T> implements InvocationHandler...
[ 0.11613890528678894, -0.6584610342979431, 0.2650327682495117, -0.025126319378614426, 0.09208334237337112, 0.06969727575778961, 0.22713977098464966, -0.16030585765838623, 0.12010428309440613, -0.5257071256637573, -0.5289753675460815, 0.5567426681518555, -0.47902506589889526, 0.1744438260793...