text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
</td> </tr> "; } ``` The issue i have is that it will pull all the records except for the first one. Every other record shows, there are only 5 records currently. I am missing something silly I know it. I looked through questions and could not find the answer. Thanks It could be because you...
[ 0.36421602964401245, 0.03519866243004799, 0.5034135580062866, -0.030927512794733047, 0.07218161225318909, -0.024155866354703903, 0.18757712841033936, -0.17444978654384613, -0.6880152225494385, -0.26045289635658264, 0.1648377627134323, 0.7149180173873901, -0.3998563587665558, 0.382817357778...
{ ``` You only need to declare `mysql_fetch_array` once, which is inside the `while` parameter. This should be your code: ``` $result = mysql_query("SELECT * FROM `plant_info` ORDER BY id LIMIT 0, 30"); while ($row = mysql_fetch_array($result)) { echo " <tr> <t...
[ 0.09880571812391281, -0.06927140802145004, 0.5129486918449402, -0.3350771367549896, 0.34894198179244995, 0.07041559368371964, 0.17486725747585297, -0.37771838903427124, -0.34112438559532166, -0.11372996121644974, -0.006702222861349583, 0.5099840760231018, -0.26831358671188354, 0.0145122492...
<p><img src=\"$row[Image_Name]\" style=\"width:120px;height:auto;\"></p> </td> <td align=\"center\" bgcolor=\"#90c084\">
[ 0.0035117033403366804, -0.062119703739881516, 0.6872158646583557, -0.15484492480754852, -0.1897471845149994, 0.1880490630865097, -0.20767639577388763, -0.43093761801719666, -0.22740603983402252, -0.5802425146102905, -0.023950761184096336, 0.35190317034721375, -0.26603662967681885, 0.006393...
<p>$row[Latin_Name]</p> </td> <td align=\"center\" bgcolor=\"#90c084\">
[ -0.1766691654920578, 0.13692454993724823, 0.37828588485717773, -0.08646642416715622, 0.07591146230697632, 0.27083712816238403, -0.19425028562545776, -0.3332536518573761, -0.13922381401062012, -0.361368864774704, -0.11154000461101532, 0.2525421977043152, -0.21590426564216614, 0.057219211012...
<p>$row[Common_Name]</p> </td> <td align=\"center\" bgcolor=\"#90c084\"> <p>$row[Category]</p>
[ -0.2480393350124359, 0.05888844653964043, 0.30458319187164307, -0.12809385359287262, -0.04362230747938156, 0.13332787156105042, -0.26961755752563477, -0.31517770886421204, -0.2961912155151367, -0.34526580572128296, -0.24023395776748657, 0.41025498509407043, -0.37809988856315613, 0.19137138...
</td> <td align=\"center\" bgcolor=\"#90c084\"> <p>$row[Type]</p>
[ 0.015382437966763973, 0.033426433801651, 0.36037132143974304, -0.07740683853626251, 0.09946998208761215, 0.2614904046058655, -0.11656072735786438, -0.389530748128891, -0.15876299142837524, -0.44091129302978516, -0.05934862792491913, 0.33949050307273865, -0.27566662430763245, 0.107876516878...
</td> <td align=\"center\" bgcolor=\"#90c084\"> <p>$row[Flower]</p>
[ -0.010025836527347565, -0.1363813728094101, 0.3175131678581238, -0.15490083396434784, -0.0029418091289699078, 0.4104902744293213, -0.08730001747608185, -0.305966317653656, -0.07535230368375778, -0.4043419361114502, -0.018898693844676018, 0.04108006879687309, -0.3856147825717926, 0.07012278...
</td> <td align=\"center\" bgcolor=\"#90c084\"> <p>$row[Comments]</p> </td>
[ 0.13313953578472137, -0.003968005068600178, 0.2725846469402313, 0.005655981134623289, 0.0403873547911644, 0.14434342086315155, -0.1384415626525879, -0.3512873947620392, -0.15174728631973267, -0.4736359417438507, -0.08333810418844223, 0.3749665319919586, -0.23725083470344543, 0.048378214240...
</td> <td align=\"center\" bgcolor=\"#90c084\"> <p><a href=\"editplant.php?get=$row[id]\">Edit</a></p>
[ 0.06094483286142349, -0.02117609977722168, 0.5353337526321411, -0.031149182468652725, -0.07380335032939911, 0.20403090119361877, -0.04065058007836342, -0.4626813232898712, -0.21504846215248108, -0.4163551926612854, -0.16023507714271545, 0.41544997692108154, -0.15167056024074554, -0.0676473...
<p><a href =\"print_sign_div.php?get=$row[id]\">Print</a></p> </td> </tr> "; } ```
[ 0.14306454360485077, 0.17299166321754456, 0.5649893879890442, -0.2543426752090454, 0.07222582399845123, 0.15486378967761993, -0.051901329308748245, -0.5549172163009644, -0.14146345853805542, -0.3069462478160858, -0.40638062357902527, 0.5330005884170532, -0.2674041986465454, 0.0048487721942...
I have this page where a user can upload documents (multiple documents, size limit 10MB each). It is a two step process. Step 1 has the input form. Step 2 is the preview page with a submit button. How should I handle the scenario where the user closes the browser while on the preview page, without submitting the form...
[ 0.1959601491689682, 0.051017969846725464, 0.6155742406845093, 0.007888485677540302, -0.1996728926897049, -0.10531874001026154, 0.09704162925481796, -0.2561664581298828, -0.13749028742313385, -0.8021081686019897, -0.12702274322509766, 0.351561576128006, -0.12373766303062439, 0.1414092928171...
the files to their final location only on submission of the form. In any case, it would be better to implement a garbage collector. The garbage collector can empty the temporary folder every night. But when using a garbage collector, if you have a way to identify files that were not submitted (for example, if a row is...
[ 0.07859300076961517, -0.12074816226959229, 0.712527871131897, 0.19375857710838318, 0.030169161036610603, -0.2117282599210739, -0.06445139646530151, -0.48882392048835754, -0.4841326177120209, -0.7337123155593872, -0.4147273600101471, 0.30882346630096436, -0.21631096303462982, 0.299521088600...
pay attention that it uses flash, which on the one hand is very good for uploading large files, but on the other hand it will prevent your application from supporting Apple machines such as iPad.
[ 0.019372085109353065, 0.19041377305984497, 0.002837333595380187, 0.23202475905418396, 0.10352493077516556, -0.4423351287841797, 0.3678167760372162, 0.34762004017829895, -0.22013157606124878, -0.33246153593063354, -0.19895018637180328, 0.4346747398376465, -0.19130007922649384, -0.2798406481...
I want to be able to sort [comment] by ascending or descending. I've tried performing the aggregation again in the "order by" clause, but that didn't work. I also tried sorting outside of the sub query which let me use the alias [comment], but that only sorted between rows 0 and 10. This query is a smaller version of ...
[ 0.1876821368932724, -0.0069265360943973064, 0.2468108832836151, -0.11690952628850937, -0.14813794195652008, 0.2949364185333252, 0.12248612940311432, -0.23355646431446075, -0.31409192085266113, -0.5494966506958008, 0.08124420791864395, 0.12899434566497803, -0.5054430961608887, 0.24953068792...
WHERE "order" = "order"."id" GROUP BY "order"), 0) AS [comment], Row_number() OVER (ORDER BY "order"."id" DESC) AS [rownum] FROM [order]
[ -0.0979166254401207, 0.15058018267154694, 0.07238456606864929, -0.06754142045974731, 0.01865527406334877, 0.1780463457107544, 0.15122324228286743, -0.555190920829773, -0.22334644198417664, -0.41482406854629517, -0.4909974932670593, 0.6342126727104187, -0.34516042470932007, 0.24253396689891...
WHERE ISNULL((SELECT COUNT("order") FROM order_comment WHERE "order" = "order"."id" GROUP BY "order"), 0) > 0) AS [filter] WHERE [rownum] BETWEEN 0 AND
[ -0.08549565821886063, -0.6197925806045532, 0.46638479828834534, -0.4675769805908203, 0.20767612755298615, 0.22615326941013336, -0.07140354812145233, -0.4956091642379761, -0.17204344272613525, -0.5977514386177063, -0.019661322236061096, 0.48169106245040894, -0.4233773350715637, -0.229918822...
10 ``` So easy in MySql! ``` SELECT Ifnull((SELECT COUNT(`order`) FROM order_comment WHERE `order` = `order`.`id` GROUP BY `order`), 0) AS `comment` FROM `order` HAVING `comment` > 0 ORDER BY `comment` DESC LIMIT 0, 10 ``` Following latest edit suspect you wan...
[ -0.2372218519449234, 0.2348090559244156, 0.7426469326019287, -0.31120067834854126, 0.07844123244285583, -0.09876280277967453, -0.21207764744758606, -0.16400574147701263, -0.09606995433568954, -0.5038021206855774, -0.5553750395774841, 0.5718005299568176, -0.4433254301548004, -0.325028032064...
order_comment GROUP BY [order] ), occ AS ( SELECT o.*, order_count AS comment, ROW_NUMBER() OVER (ORDER BY order_count DESC) AS [rownum] FROM [order] o INNER JOIN oc ON oc.[order] = o.id ) SELECT * FROM occ WHERE [rownum] BETWEEN 0 AND 10 ORDER BY [rownum] ``` The `INNER JOIN` will already exclude ...
[ -0.2741713225841522, 0.2745264768600464, 0.43544724583625793, -0.32218149304389954, 0.20371191203594208, 0.4336158335208893, -0.11859314143657684, -0.32481321692466736, -0.340075820684433, -0.3916636109352112, -0.593165934085846, 0.49025923013687134, -0.22074110805988312, 0.245097160339355...
I am relatively new to website design and specifically working in ASP.NET, i am using CSS to style my site, but when i use ASP.NET Controls like GridView, Navigation controls, etc ... they are messed up by the style sheets, and you can't see that until you run the website, because the controls are translated to HTML an...
[ 0.7303544282913208, 0.11284102499485016, 0.020298248156905174, 0.08266360312700272, -0.14964419603347778, -0.012847873382270336, 0.09547437727451324, 0.16706643998622894, -0.24819348752498627, -1.0077229738235474, 0.16273625195026398, 0.36247292160987854, -0.0262534711509943, -0.0157647784...
<http://www.asp.net/web-forms/videos/how-do-i/how-do-i-use-skins-with-css-for-a-flexible-and-maintainable-aspnet-web-site> After getting my skins and CSS classes created for the different pieces of my ASP.NET controls I'll then run my app in a browser with good developer tools, Google Chrome has a stellar set of dev t...
[ 0.8723006844520569, -0.01438035536557436, 0.2556469142436981, 0.0009634789894334972, -0.3796929121017456, 0.28400474786758423, 0.30413612723350525, -0.10153353214263916, -0.1771371215581894, -0.8876394033432007, 0.2749984860420227, 0.6302912831306458, 0.17851141095161438, -0.22722086310386...
Consider the problem of getting an object as argument and printing its type: ``` #include <iostream> class A { }; class B : public A { }; class C : public A { }; class D : public C, public B { }; using namespace std; template<class T> void print_type(T* info) { if(dynamic_cast<D*>(info)) cout << "D" <<...
[ -0.14404752850532532, -0.2793017327785492, 0.2845745384693146, -0.27513033151626587, 0.026997003704309464, 0.4357338547706604, -0.07463467121124268, -0.2951188385486603, -0.08734043687582016, -0.5278154611587524, -0.47759830951690674, 0.6515868902206421, -0.550455629825592, -0.172960817813...
cout << "A" << endl; } int main(int argc, char** argv) { D d; print_type(&d); return 0; } ``` It gives me the following error: "*Ambiguous conversion from derived class 'D' to base class*." But I fail to see where's the ambiguity: if the object declared in main (d) is of type D, why can't be it direct...
[ -0.17489202320575714, -0.005082287359982729, 0.058505039662122726, -0.45370328426361084, -0.05532829090952873, -0.024987641721963882, 0.4527069330215454, -0.0964716449379921, 0.07916191965341568, -0.40789899230003357, -0.16001252830028534, 0.44998589158058167, -0.5755887031555176, 0.352276...
`<T extends A>`; in this case it would be useful. How can I make a similar thing in C++ with templates? --- I have modified the code this way: ``` #include <iostream> #include <vector> class A { }; class B : virtual public A { }; class C : virtual public A { }; class D : public C, public B { }; using namespace std...
[ 0.20900990068912506, -0.33047381043434143, 0.5482175946235657, -0.2654302716255188, 0.2610115706920624, 0.03867792710661888, 0.01047510839998722, -0.34884268045425415, -0.15607714653015137, -0.6366379261016846, -0.3370303213596344, 0.8220754265785217, -0.7011069655418396, -0.03821685165166...
cout << "B" << endl; else if(dynamic_cast<A*> (info)) cout << "A" << endl; } int main(int argc, char** argv) { string str; print_type(&str); return 0; } ``` But I still get the error: *`'std::basic_string<char>' is not polymorphic`* > Consider the problem of getting an object as argument and ...
[ -0.13615548610687256, 0.03899679705500603, 0.4233027696609497, -0.5506546497344971, 0.20191539824008942, 0.24185092747211456, 0.3159761428833008, -0.36872586607933044, 0.002639472484588623, -0.5326811075210571, -0.4362320601940155, 0.5053942203521729, -0.688368558883667, 0.0182442162185907...
= 3; std::string test("test"); print_type(d); print_type(a); print_type(test); return 0; } ```
[ 0.3946816623210907, 0.14160384237766266, -0.04540131613612175, -0.5200618505477905, -0.03056485392153263, 0.06446009129285812, 0.4884852468967438, -0.43788978457450867, 0.3205186724662781, -0.280208021402359, -0.45182928442955017, 0.46890997886657715, -0.5177656412124634, 0.183551833033561...
I am using the Grails security plugin on a project. I am using the annotations on controller actions to restrict access to certain classes of users such as 'ROLE\_ADMIN' or 'ROLE\_USER'. (using this as the basis for what I am doing: <http://grails-plugins.github.com/grails-spring-security-core/docs/manual/guide/5%20Co...
[ 0.0562322735786438, 0.014018049463629723, 0.33397242426872253, -0.23497451841831207, 0.08606181293725967, -0.05500412732362747, 0.14468123018741608, -0.3819701373577118, -0.3212156295776367, -0.28923672437667847, -0.19036109745502472, 0.4919033646583557, -0.2882656753063202, 0.086634263396...
to do this? You can also use Grails controller interceptor if you want to apply same logic to multiple actions ``` class SomeController { def beforeInterceptor = [action: this.&checkUser ] def springSecurityService def checkUser() { User user = User.get(params) User logged = User.get(springSecurityS...
[ 0.04955090954899788, -0.4367593228816986, 0.5478007793426514, 0.14165736734867096, -0.0484233982861042, -0.006733914837241173, 0.6141643524169922, -0.6062528491020203, -0.2343151569366455, -0.2946421802043915, -0.08906877785921097, 0.5894051790237427, -0.44309940934181213, 0.06209962815046...
accessDenied= { render(view: "accessDenied") } } ```
[ -0.5547491908073425, 0.03466511145234108, 0.14468339085578918, -0.046104252338409424, 0.18638835847377777, 0.06995723396539688, 0.3681434392929077, 0.2076806277036667, 0.0783042386174202, -0.8303812146186829, -0.37527626752853394, 0.7182093262672424, 0.0693439394235611, 0.29727113246917725...
I am trying to build multiple timers for my web page, so far I have, ``` $('.timer').each(function() { var timer = setInterval(function() { var time = $(this).text().split(':'); var minutes = parseInt(time[0], 10); var seconds = parseInt(time[1], 10); // TIMER RUN OUT if (!minutes && !seconds) { ...
[ 0.38029977679252625, -0.06312946230173111, 0.6439428925514221, -0.31222325563430786, 0.21646299958229065, 0.2816266417503357, 0.41328874230384827, -0.059673260897397995, -0.124280646443367, -0.6344705820083618, -0.16984552145004272, 0.5275233387947083, -0.293878436088562, 0.345711708068847...
} // MINUS MINUTES if (seconds < 0 && minutes != 0) { minutes -= 1; seconds = 59; // ADD ZERO IF SECONDS LESS THAN 10 } else { if (seconds < 10) { seconds = '0' + seconds; } }
[ 0.3249080181121826, -0.12435083091259003, 0.3948821723461151, -0.25643834471702576, 0.3475145697593689, 0.23349831998348236, 0.24204210937023163, -0.04019419476389885, -0.23668886721134186, -0.27731427550315857, -0.1496461182832718, 0.11054650694131851, -0.020469704642891884, 0.35265472531...
// ADD ZERO IF MINUTES LESS THAN 10 if (minutes < 10) { minutes = '0' + minutes; } }, 1000); }); ``` This doesn't work though! Where am I going wrong! Thanks First, inside your `setInterval` callback, `this` no longer refers to the `.timer` element. Try changing that to `self` and add `var self = th...
[ 0.14976884424686432, -0.23534581065177917, 0.30750739574432373, -0.25628232955932617, 0.32897061109542847, -0.04061981290578842, 0.4192013740539551, -0.0760793536901474, -0.13055245578289032, -0.4930795431137085, 0.13335685431957245, 0.5982933044433594, -0.12230675667524338, 0.273977339267...
[SOLVED] Somehow, I managed to not have "write" permissions to the .git directory. So was trying to write the commit and getting bounced. I've been using Eclipse for a few months, but had been just running git from the CLI. I decided that was inefficient and that I wanted to use eGit, so I started following this tuto...
[ -0.25841718912124634, 0.024695513769984245, 0.49703940749168396, -0.008374773897230625, -0.07479885220527649, -0.0040375906974077225, -0.0772588774561882, -0.15125125646591187, -0.42088472843170166, -0.5938994884490967, 0.12084299325942993, 0.24570854008197784, -0.2520042955875397, 0.10505...
a problem' -- an internal error occured. When I click details, it say "An internal error occurred Exception caught during execution of commit command" ...I don't even know where to start on this one. I googled the error and didn't get anything useful. Anyone know how to fix this, or at least how to start debugging?...
[ -0.1220085546374321, 0.21061618626117706, 0.19781489670276642, 0.032702039927244186, -0.09469817578792572, -0.05508531630039215, 0.5498227477073669, 0.12766994535923004, -0.4774438142776489, -0.4293822646141052, -0.16045232117176056, 0.5803734064102173, -0.5374048948287964, 0.1436973065137...
try a git commit -m "a message" in a shell, in order to get past that initial first commit with a GUI. --- As the [OP rogueleaderr](https://stackoverflow.com/users/998687/rogueleaderr) mentions, the error view and the exact stack trace behind the exception was enough: > **Somehow, I managed to not have "write" permi...
[ 0.03600713610649109, 0.008271251805126667, -0.0033014612272381783, -0.14304372668266296, -0.011669944040477276, -0.2669437825679779, 0.4845050573348999, 0.024722928181290627, -0.3670501410961151, -0.5982969403266907, -0.07475476711988449, 0.4867563545703888, -0.39208662509918213, -0.101449...
I am pretty much a newbie at cryptography but I am trying to encrypt some data and save it in a file in iOS 3 because I do not want the user to just go in and edit the file. What is the proper way to securely (relatively) encrypt the data in iOS 3? Most of the documentations I found online were for iOS 5. Any help wou...
[ 0.33786648511886597, 0.3002224862575531, 0.2505914270877838, -0.02843722701072693, 0.12383481115102768, -0.1544584333896637, 0.6950843334197998, 0.05919884890317917, -0.2617858946323395, -0.502494752407074, -0.05919386073946953, 0.54082190990448, -0.38978198170661926, -0.17657002806663513,...
If the Exception is a NPE one (NullPointerException), like shown in [bug 329611](https://bugs.eclipse.org/bugs/show_bug.cgi?id=329611), then you can try a git commit -m "a message" in a shell, in order to get past that initial first commit with a GUI. --- As the [OP rogueleaderr](https://stackoverflow.com/users/99868...
[ -0.07526486366987228, -0.028359299525618553, 0.16231930255889893, -0.07617361098527908, 0.0002645850763656199, -0.2035338282585144, 0.47395774722099304, -0.08948244899511337, -0.5488305687904358, -0.5814911723136902, -0.10507220029830933, 0.5978556275367737, -0.3235836923122406, -0.0293768...
So basically, I have no clue about PHP, but somehow, I managed to get this script working. (The script checks if a livestream is online [on www.own3d.tv], if it's online, it displays the name of the streamer and the viewers. If it's offline, it displays nothing.) I inserted it into my Wordpress siderbar. But the thi...
[ 0.582267165184021, -0.005830226466059685, 0.6911428570747375, 0.13760784268379211, -0.3935660421848297, -0.2674424946308136, 0.2525287866592407, 0.460686594247818, -0.10793332010507584, -0.6168370842933655, 0.3528763949871063, 0.21930105984210968, -0.024024205282330513, 0.21606597304344177...
let it load the other stuff on the sidebar first? Thanks in advance for your replies. Regards ``` <html> <body> <p style="width:300px; height:250px; padding:1px; border:5px solid #66a"> <?php function pageTime() { static $_pt; if($_pt == 0) $_pt = microtime(true); else return (string)(round(microtime(t...
[ 0.5463316440582275, -0.20007015764713287, 0.9349683523178101, -0.22192047536373138, 0.12381397187709808, 0.005159433465451002, 0.3081868588924408, -0.8931976556777954, -0.2252594232559204, -0.3290558159351349, -0.4283371567726135, 0.5884630680084229, -0.3993958532810211, 0.0043014572001993...
== 'true'){ echo 'Guardsman Bob - Viewers: '; echo ($resultviewers[0]); echo ' - <a href="http://www.own3d.tv/live/34046/">Watch now!</a> <br>'; } else { echo ''; } //The Rain Man $xml = simplexml_load_file("http://api.own3d.tv/liveCheck.php?live_id=38853"); $resultlive = $xml->xpath("/own3dReply/liveEvent/isLive"); $...
[ 0.5480350852012634, 0.4757816195487976, 0.572547972202301, -0.3890385627746582, -0.2665751576423645, 0.33083540201187134, 1.2197728157043457, -1.1175521612167358, -0.2502666711807251, -0.2227347195148468, -0.044994331896305084, 0.5851812958717346, -0.6112075448036194, 0.2776108682155609, ...
($resultlive[0] == 'true'){ echo 'Xpecial - Viewers: '; echo ($resultviewers[0]); echo ' - <a href="http://www.own3d.tv/live/10953/">Watch now!</a> <br>'; } else { echo ''; } //Chaox $xml = simplexml_load_file("http://api.own3d.tv/liveCheck.php?live_id=33356"); $resultlive = $xml->xpath("/own3dReply/liveEvent/isLive")...
[ 0.5401220321655273, 0.056221652776002884, 0.5953412055969238, -0.6146694421768188, -0.1754966378211975, 0.16969910264015198, 0.6260718107223511, -1.1781829595565796, -0.22602802515029907, -0.22437800467014313, -0.32226499915122986, 0.35594409704208374, -0.4554475247859955, 0.20466643571853...
- Viewers: '; echo ($resultviewers[0]); echo ' - <a href="http://www.own3d.tv/live/112350/">Watch now!</a> <br>'; } else { echo ''; } //Dedrayon $xml = simplexml_load_file("http://api.own3d.tv/liveCheck.php?live_id=265558"); $resultlive = $xml->xpath("/own3dReply/liveEvent/isLive"); $resultviewers = $xml->xpath("/own3...
[ 0.3253668248653412, 0.06709866225719452, 0.5834363102912903, -0.2626383602619171, -0.206509068608284, 0.28902673721313477, 0.4497266709804535, -0.982970654964447, -0.20782244205474854, -0.20003162324428558, -0.16282880306243896, 0.4926062226295471, -0.36052581667900085, 0.2918211817741394,...
type mismatch. You just don't want a design that makes it possible to make those kinds of mistakes (because then those mistakes *will* be made, eventually, and there *will* be bugs that need to be fixed, wasting future time). Typically, what you really want is: ``` void Module::trigger_event(shared_ptr<Event> const& ...
[ 0.09658094495534897, -0.25686076283454895, -0.04698434844613075, 0.2311282753944397, 0.02419702149927616, -0.2610483169555664, -0.06883949786424637, -0.3190968334674835, -0.16948536038398743, -0.5079651474952698, -0.042468324303627014, 0.7558879852294922, -0.5073693990707397, -0.2542065083...
: public Dispatcher { public: SpecificDispatcher(function<void (shared_ptr<SpecificEvent>)> handler) handler_(handler) {} virtual void dispatch(shared_ptr<Event> event) { auto specificEvent(static_ptr_cast<SpecificEvent>(event)); handler_(specificEvent); } }; ``` (with th...
[ 0.03951709717512131, -0.46989166736602783, -0.041371867060661316, 0.21621449291706085, -0.19668175280094147, 0.0529240220785141, -0.07171141356229782, -0.163809135556221, -0.19005680084228516, -0.3708103597164154, -0.2751536965370178, 0.599452555179596, -0.4967714846134186, 0.0792086347937...
that the handlers do not need to reinterpret the data themselves (error prone). Do the work that can be automated inside your library, so it won't be done wrong outside. Okay, now what do you return with your method? Return an object, not a function. If they don't need to call it explicitly, you have saved another pot...
[ 0.3331358730792999, -0.16424241662025452, 0.03472031652927399, 0.2501096725463867, 0.12590719759464264, 0.09287790209054947, 0.14942361414432526, -0.1368200033903122, -0.13172069191932678, -0.27022218704223633, -0.053924206644296646, 0.7484214305877686, -0.3356059789657593, 0.0600854307413...
function-scope, state, and program. These correspond to the four types of things they can store that object you return in: anonymous(let it fall on the floor - it can be used inside the expression but is never assigned to a named object), an automatic scope object, an object that is a member of a State class (in the St...
[ -0.05413316935300827, -0.43272411823272705, 0.24123357236385345, 0.11877447366714478, 0.09295395761728287, -0.08500657975673676, 0.3285684883594513, -0.13926173746585846, -0.20405712723731995, -0.27293193340301514, -0.2646971344947815, 0.708432674407959, -0.2446618676185608, 0.164297163486...
the face of exceptions. --- EDIT: I kinda left a bunch of the pieces unstated, pointing out you would connect the dots "in the obvious way". But I thought I'd fill in more pieces (as I have an OS build and install going and my bugs are down to one last one right now, which is waiting for the install...) The point wa...
[ 0.10999663919210434, 0.09888418763875961, 0.26232123374938965, -0.015568908303976059, 0.1641302853822708, -0.4070234000682831, 0.1776217818260193, -0.1838637888431549, -0.4511987864971161, -0.3253833055496216, -0.14353640377521515, 0.5479461550712585, -0.47414305806159973, -0.1585527807474...
appropriate dispatcher into the dictionary. There are several ways to get the ID from the type here. The "obvious" way is to just create a temporary and call it's "ID" member - but that has object creation overhead. Another way is to turn it into a "virtual static", and just get the static (which is all the virtual met...
[ -0.019695820286870003, -0.32326003909111023, 0.3305767774581909, 0.221679225564003, -0.16898702085018158, -0.027113230898976326, -0.0017785135423764586, -0.004949054215103388, 0.030567534267902374, -0.7230517268180847, 0.12362725287675858, 0.7347626090049744, -0.28862375020980835, 0.059336...
as well to return the same thing. So... ``` template <typename EventType> struct EventTrait { // typedef your IDType from whatever - looks like you want std::string static IDType eventID() { /* default impl */ } }; template <> struct EventTrait<StartEvent> { // same as above static IDType eventID...
[ -0.022189807146787643, -0.30529728531837463, 0.3716547191143036, -0.23174673318862915, 0.09741636365652084, -0.05480965971946716, 0.05694884434342384, -0.5854551196098328, -0.1594686210155487, -0.6008394956588745, -0.184193953871727, 0.6685601472854614, -0.23275244235992432, -0.19643715023...
how to fit the pieces together and some of the options you have. Some of this illustrates boilerplate code that may get recoded with each event. That is the type of thing you will likely want to automate as well. There are plenty of advanced techniques to metaprogram such generation, from working with another build ste...
[ 0.2745168209075928, -0.021306021139025688, -0.2269456684589386, 0.39533430337905884, 0.23969827592372894, 0.12874557077884674, 0.2638089060783386, -0.3075667917728424, -0.3717597424983978, -0.6274783611297607, 0.11805149167776108, 0.792463481426239, -0.4931495487689972, -0.1999080032110214...
I have a site which has been running for some time now that uses a great deal of user input to build the site. Naturally there are dozens of forms on the site. When building the site, I often used hidden form fields to pass data back to the server so that I know which record to update. an example might be: `<input ty...
[ 1.0333894491195679, 0.21564128994941711, 0.19166690111160278, -0.24897202849388123, -0.06955356150865555, -0.13007017970085144, -0.07848351448774338, -0.3900439441204071, -0.11057861894369125, -0.5896962285041809, 0.06817420572042465, 0.4682929217815399, 0.13286113739013672, 0.404050558805...
to 15.02). I recently found out that you can change the attributes and values via something as simple as firebug. So...I open firebug and change the id value to "155" and the price value to "0.00" and then submit the form. Viola! I view product number 155 on the site and it now says that it's $0.00. This concerns me. ...
[ 0.5883688926696777, 0.10872525721788406, 0.9079344272613525, -0.11270681023597717, -0.134008526802063, 0.1172904372215271, -0.18358169496059418, -0.3177328109741211, -0.24756164848804474, -0.2683013379573822, 0.2260531187057495, 0.6851403713226318, 0.2089274525642395, 0.24725385010242462, ...
way), then how would I make it so that if a user changes these values, the data on the server side is not executed (or something similar to solve the issue)? I've thought about encrypting the id and then decrypting it on the other side, but that still doesn't protect me from someone changing it and just happening to g...
[ 0.7168721556663513, 0.06397844105958939, 0.20292018353939056, 0.4182579815387726, 0.30660030245780945, -0.07878536731004715, 0.21969294548034668, -0.21846061944961548, -0.17693853378295898, -0.47601717710494995, 0.515714168548584, 0.5100989937782288, -0.2868950664997101, 0.2675651609897613...
the return for a bit and focus on that `boost::any` mixed with that `std::string`. That's really a bad idea for an event system, because it allows a potential runtime type mismatch. You just don't want a design that makes it possible to make those kinds of mistakes (because then those mistakes *will* be made, eventuall...
[ 0.0560930110514164, -0.20484954118728638, 0.1991100162267685, 0.02480161190032959, 0.16329191625118256, -0.08440488576889038, 0.09161657840013504, -0.34064823389053345, 0.0014895438216626644, -0.33939823508262634, -0.21668963134288788, 0.8882344961166382, -0.3764825761318207, -0.0772067606...
// dispatch to something that has the signature // void (shared_ptr<SpecificEvent>) } ``` To do something like the dispatcher, you usually have ``` map<IDType, shared_ptr<Dispatcher>> dispatchDictionary_; ``` with ``` template <typename SpecificEvent> class SpecificDispatcher : public Dispatcher { public: ...
[ 0.2333647608757019, -0.5298975706100464, -0.03615272045135498, 0.1560569852590561, -0.14149750769138336, 0.07878964394330978, -0.16395972669124603, -0.3381413221359253, -0.22144338488578796, -0.4863634705543518, -0.14738981425762177, 0.6548995971679688, -0.330890417098999, 0.03773569688200...
the map). The point is to associate the ID with the EventType inside the class, to ensure it is always the same association, and to dispatch in a way that the handlers do not need to reinterpret the data themselves (error prone). Do the work that can be automated inside your library, so it won't be done wrong outside. ...
[ 0.19646567106246948, -0.5075200796127319, -0.04201122000813484, 0.4316939115524292, 0.01680167391896248, -0.1633918583393097, 0.04827200248837471, -0.08233287185430527, -0.0004953360767103732, -0.7675980925559998, -0.0426783412694931, 0.5562237501144409, -0.27233827114105225, -0.1055957227...
to remember to call delete, or unlock, or ... Similarly, with "unregister\_event" (or whatever you call it). There are four lifetimes people must be concerned with in a program: expression, function-scope, state, and program. These correspond to the four types of things they can store that object you return in: anonym...
[ 0.2660618722438812, -0.0511506013572216, 0.16479383409023285, 0.22061103582382202, 0.6288349628448486, 0.0601983442902565, 0.573896050453186, -0.10116618871688843, -0.22020184993743896, -0.3930576741695404, -0.24220284819602966, 0.5646631121635437, 0.1156620904803276, 0.12864068150520325, ...
sitting around until exit. All lifetime management should be managed with RAII. It's kind of the point of destructors and is how resource cleanup is supposed to be managed in the face of exceptions. --- EDIT: I kinda left a bunch of the pieces unstated, pointing out you would connect the dots "in the obvious way". B...
[ 0.253545880317688, -0.08618425577878952, 0.3051333427429199, -0.0387839749455452, 0.3710467517375946, -0.3711133599281311, 0.41111695766448975, -0.11999278515577316, -0.2554178833961487, -0.4562980830669403, -0.12362448871135712, 0.708422064781189, -0.24055148661136627, 0.14595480263233185...
cout << "Module started: " << event->someInfo() << endl; }); ``` so the set\_event needs to have the kind of signature to take this, and it should insert the appropriate dispatcher into the dictionary. There are several ways to get the ID from the type here. The "obvious" way is to just create a temporary and call it...
[ 0.062049031257629395, -0.14833872020244598, 0.43676477670669556, -0.20631781220436096, -0.006545561365783215, -0.11747971177101135, -0.0019279472762718797, 0.22415988147258759, -0.11103903502225876, -0.5956027507781982, -0.13496080040931702, 0.5460079908370972, -0.3258114159107208, 0.25455...
them into traits - same thing, but slightly better encapsulation, and the ability to modify "already closed classes" as well. Then the virtual method just calls the traits class as well to return the same thing. So... ``` template <typename EventType> struct EventTrait { // typedef your IDType from whatever - loo...
[ 0.022790122777223587, -0.34841328859329224, 0.39246219396591187, -0.106793612241745, -0.010032306425273418, 0.1237531453371048, -0.1308179497718811, -0.3903047442436218, -0.07706150412559509, -0.7642404437065125, -0.07699491828680038, 0.6816849708557129, -0.21307340264320374, -0.0789980068...
auto id(EventTrait<EventType>::eventID()); dispatchDictionary_.insert(make_pair(id, make_shared<SpecificDispatcher<EventType>>(handler))); return EventRegistration(bind(& Module::unset_event, this, id)); } ``` That should illustrate a little better how to fit the pieces together and some of the opt...
[ 0.07742667198181152, -0.2371572107076645, -0.037599727511405945, -0.07109392434358597, -0.012206049636006355, -0.004357249941676855, 0.1890566349029541, -0.5297226905822754, -0.1022767424583435, -0.512880802154541, -0.1367633044719696, 0.9379973411560059, -0.5458144545555115, -0.2601113915...
earlier points, the more you can automate, the less bugs you will have.
[ 0.23128238320350647, 0.1722794771194458, -0.09093887358903885, 0.2963903248310089, 0.3301955461502075, -0.13566863536834717, 0.26548153162002563, 0.10545995086431503, -0.27881404757499695, -0.6788327097892761, -0.19725671410560608, 0.27612391114234924, -0.08361649513244629, -0.082790635526...
I have a very simple task I am trying to do in Groovy but cannot seem to get it to work. I am just trying to loop through a map object in groovy and print out the key and value but this code does not work. ``` // A simple map def map = [ iPhone : 'iWebOS', Android: '2.3.3', Nokia : 'Symbian', ...
[ -0.06669294089078903, -0.048985645174980164, 0.4572370946407318, 0.13471099734306335, 0.16289904713630676, 0.016465023159980774, 0.4600341320037842, 0.056142453104257584, -0.29137858748435974, -0.9721561670303345, 0.08547521382570267, 0.6113405227661133, -0.3829767405986786, -0.08092814683...
println s + ": " + map[s] } ``` I am trying to get the output to look like this: ``` iPhone: iWebOS Android: 2.3.3 Nokia: Symbian Windows: WM8 ``` Could someone please elaborate on how to do this?? Quite simple with a closure: ``` def map = [ 'iPhone':'iWebOS', 'Android':'2.3.3', ...
[ -0.42581310868263245, -0.07157131284475327, 0.5826327204704285, -0.18467597663402557, -0.028818052262067795, 0.1856011301279068, 0.2423878312110901, 0.011287502013146877, -0.3597869277000427, -0.9189052581787109, -0.3389229476451874, 0.5863339304924011, -0.47498151659965515, -0.19849421083...
I am having a problem getting this code to work. Basically I Go from one list activity to another and pass the text from a list item through the intent of the activity to the new list view, then retrieve that text in the new list activity and then preform a http request based on value of that list item. **Log Cat** ...
[ -0.14681637287139893, -0.10308951139450073, 0.6109420657157898, -0.2640458047389984, 0.08317425847053528, 0.25677675008773804, 0.833429753780365, -0.674869954586029, -0.30157598853111267, -0.6263763904571533, -0.30369117856025696, 0.6184026002883911, -0.514786958694458, -0.2097010612487793...
17:47:32.370: E/AndroidRuntime(30135): at java.lang.reflect.Method.invokeNative(Native Method) 04-05 17:47:32.370: E/AndroidRuntime(30135): at java.lang.reflect.Method.invoke(Method.java:507) 04-05 17:47:32.370: E/AndroidRuntime(30135): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907) ...
[ 0.17669056355953217, -0.06171680614352226, 1.0547232627868652, -0.29160118103027344, -0.29172876477241516, 0.3403543531894684, 0.8256543874740601, -0.7659471035003662, -0.22483891248703003, -0.5557397603988647, -0.5320513844490051, 0.8339465260505676, -0.5936260223388672, 0.027771074324846...
= (ListView) findViewById(android.R.id.list); ArrayList<NameValuePair> nvp = new ArrayList<NameValuePair>(); nvp.add(new BasicNameValuePair("request", "categories")); ArrayList<JSONObject> jsondefs = Request.fetchData(this, nvp); String[] defs = new String[jsondefs.size()]; ...
[ 0.08604465425014496, -0.5267428755760193, 0.8382698893547058, -0.4933188259601593, 0.041612159460783005, 0.334987610578537, 0.5580196976661682, -0.9445719718933105, -0.31650224328041077, -0.6320574879646301, -0.46491485834121704, 0.5921131372451782, -0.39592668414115906, 0.0445174239575862...
} catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } uFoodAdapter adapter = new uFoodAdapter(this, R.layout.definition_list, defs);
[ 0.1052543893456459, -0.40020954608917236, 0.393167108297348, -0.15707653760910034, 0.32447269558906555, 0.057080239057540894, 0.0861797034740448, -0.41196388006210327, -0.022928083315491676, -0.487848699092865, -0.2759142518043518, 0.607232928276062, -0.566296398639679, 0.08956801891326904...
listView1.setAdapter(adapter); ListView lv = getListView(); lv.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { TextView tv = (TextView) view;
[ 0.21584336459636688, -0.5318848490715027, 1.1070951223373413, -0.4891999363899231, -0.04097834601998329, 0.345276415348053, 0.6406686902046204, -0.5178889036178589, -0.09272932261228561, -0.5130776166915894, -0.371273398399353, 0.8001996874809265, -0.3761756420135498, 0.12311212718486786, ...
String p = tv.getText().toString(); Intent i = new Intent(getApplicationContext(), Results.class); i.putExtra("category", p); startActivity(i); } });
[ 0.22447174787521362, -0.5462990999221802, 0.8219993114471436, -0.34664618968963623, 0.14769196510314941, 0.1754160225391388, 0.325865775346756, -0.42145684361457825, -0.1301957666873932, -0.20658409595489502, -0.7083098888397217, 0.6628226637840271, -0.4334598183631897, 0.14570070803165436...
btn_bk.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { Intent i = new Intent(getApplicationContext(), UFoodAppActivity.class); startActivity(i); } });
[ -0.010844800621271133, -0.1476311981678009, 0.9594306349754333, -0.39034926891326904, 0.20846153795719147, 0.2657495439052582, 0.6487902998924255, -0.44285011291503906, -0.18186938762664795, -0.5826520919799805, -0.2644190192222595, 0.5901861786842346, -0.11396612226963043, 0.0883767530322...
} } **ListActivity 2** package com.thickcrustdesigns.ufood; import java.util.ArrayList; import org.apache.http.NameValuePair; import org.apache.http.message.BasicNameValuePair; import org.json.JSONException; import org.json.JSONObject; import android.app.ListActivity; import android.os.B...
[ 0.585121750831604, 0.07926276326179504, 0.47442734241485596, -0.3115188479423523, -0.13044312596321106, 0.3485845923423767, 0.209222674369812, -0.4812747538089752, -0.24533390998840332, -0.3894079625606537, -0.35300010442733765, 0.5362445116043091, -0.5848710536956787, 0.12068887799978256,...
return "For One"; } }, Lamb, LightBites { public String toString() { return "Light Bites"; } },
[ 0.30272284150123596, -0.18808726966381073, 0.24663127958774567, -0.42748770117759705, -0.05464012548327446, 0.4523874819278717, 0.189986452460289, -0.1738872081041336, -0.019156455993652344, -0.697020947933197, -0.01814647577702999, 0.7940497398376465, -0.7886492609977722, 0.25666856765747...
Pasta, Pork, Vegetarian } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.definition_main); listView1 = (ListView) findViewById(android.R.id.list); Bundle data = getIntent().getExtras(); ...
[ 0.48420003056526184, -0.47244328260421753, 0.45354339480400085, -0.09940678626298904, -0.02758696861565113, 0.31569361686706543, 0.2809891402721405, -0.394984632730484, -0.3292910158634186, -0.4165883958339691, -0.504127025604248, 0.5176599621772766, -0.5368984341621399, 0.3482443988323211...
switch (cat) { case Chicken: value = "Chicken"; break; case Beef: value = "Beef"; break; case Chinese: value = "Chinese";
[ 0.028578227385878563, -0.2338031679391861, -0.32172438502311707, -0.22628964483737946, 0.5182749629020691, 0.054198626428842545, 0.018575387075543404, -0.11961878091096878, -0.16564735770225525, -0.3097641170024872, -0.6103710532188416, 0.40494993329048157, -0.4955129027366638, 0.054669700...
break; case Cocktails: value = "Cocktails"; break; case Curry: value = "Curry"; break; case Deserts: value
[ -0.24034728109836578, 0.1751106232404709, -0.02129523456096649, 0.060141097754240036, 0.16272220015525818, 0.06984423100948334, 0.1770654171705246, -0.012939590029418468, -0.019503267481923103, -0.19252274930477142, -0.6580766439437866, 0.22861705720424652, -0.35296016931533813, 0.45179572...
= "Deserts"; break; case Fish: value = "Fish"; break; case ForOne: value = "ForOne"; break; case Lamb:
[ 0.12975114583969116, 0.25126877427101135, -0.44230538606643677, -0.3547177314758301, 0.15832176804542542, 0.5422922372817993, 0.46458712220191956, -0.39432576298713684, -0.0632871761918068, -0.3440987169742584, -0.43859997391700745, 0.23231779038906097, -0.2408461570739746, 0.2643411159515...
value = "Lamb"; break; case LightBites: value = "LightBites"; break; case Pasta: value = "Pasta"; break; case Pork:
[ 0.09143663197755814, 0.33812227845191956, -0.1859571784734726, -0.4716506600379944, 0.1271236687898636, 0.6151066422462463, -0.062072545289993286, -0.2722637951374054, -0.2286335527896881, -0.37996119260787964, -0.4046197533607483, 0.42354273796081543, -0.23760083317756653, -0.073091037571...
value = "Pork"; break; case Vegetarian: value = "Vegetarian"; } ArrayList<NameValuePair> nvp = new ArrayList<NameValuePair>(); nvp.add(new BasicNameValuePair("request", "category")); nvp.add(new BasicNameValuePair("cat", value)); ArrayList<JSON...
[ -0.14640039205551147, -0.3526706099510193, 0.2177651971578598, -0.5052226781845093, 0.13982892036437988, 0.37177523970603943, 0.42725297808647156, -0.7146235108375549, -0.3152075409889221, -0.4698446989059448, -0.6196695566177368, 0.39105871319770813, -0.42698433995246887, 0.10278149694204...
String[] defs = new String[jsondefs.size()]; for (int i = 0; i < jsondefs.size(); i++) { try { defs[i] = jsondefs.get(i).getString("Name"); } catch (JSONException e) { // TODO Auto-generated catch block
[ 0.09691397100687027, -0.6501307487487793, 0.2552957534790039, -0.3904675841331482, 0.21344119310379028, 0.07935260236263275, 0.4391651451587677, -0.6076443195343018, -0.15278597176074982, -0.23740725219249725, -0.3013029098510742, 0.5883311629295349, -0.5509569048881531, -0.047635711729526...
e.printStackTrace(); } } uFoodAdapter adapter = new uFoodAdapter(this, R.layout.definition_list, defs); listView1.setAdapter(adapter); } } ``` **Request** ``` package com.thickcrustdesigns.ufood; import java.io.BufferedReader; import java.io.I...
[ 0.06136036291718483, 0.0919489786028862, 0.7695176601409912, 0.011677907779812813, -0.2323962152004242, 0.20294475555419922, 0.12106805294752121, -0.5627419352531433, -0.2575642466545105, -0.6894055604934692, -0.37208443880081177, 0.6239268779754639, -0.4478898048400879, 0.0320620760321617...
android.content.Context; import android.util.Log; import android.widget.Toast; public class Request { @SuppressWarnings("null") public static ArrayList<JSONObject> fetchData(Context context, ArrayList<NameValuePair> nvp) { ArrayList<JSONObject> listItems = new ArrayList<JSONObject>(); ...
[ 0.03332560136914253, -0.20039992034435272, 0.47280269861221313, -0.39528048038482666, -0.0869050920009613, 0.30461767315864563, 0.5458115339279175, -0.5217949748039246, -0.1178058534860611, -0.6916770339012146, -0.4771695137023926, 0.7265971899032593, -0.6859290599822998, -0.03107538260519...
"http://co350-11d.projects02.glos.ac.uk/php/database.php"); httppost.setEntity(new UrlEncodedFormEntity(nvp)); HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); is = entity.getContent(); } catch (Exception e) { ...
[ -0.19159460067749023, -0.4343545436859131, 0.388828843832016, -0.030178489163517952, 0.15793561935424805, 0.07246892154216766, 0.4494825601577759, -0.38646960258483887, -0.42805352807044983, -0.3501204550266266, -0.5384505391120911, 0.504223644733429, -0.41738253831863403, 0.12232690304517...
connection" + e.toString()); } // convert response to string String result = ""; try { BufferedReader reader = new BufferedReader(new InputStreamReader( is, "iso-8859-1"), 8); InputStream stream = null;
[ -0.49481555819511414, -0.5486101508140564, 0.7936844229698181, -0.22348234057426453, 0.176335409283638, 0.35968920588493347, 0.2669801414012909, -0.16146665811538696, -0.1942954808473587, -0.47905418276786804, -0.5520091652870178, 0.44470611214637756, -0.5970754623413086, 0.530915677547454...
StringBuilder sb = null; while ((result = reader.readLine()) != null) { sb.append(result + "\n"); } stream.close(); result = sb.toString(); } catch (Exception e) {
[ -0.032069865614175797, -0.36309346556663513, 0.5132782459259033, -0.4007841944694519, -0.0671333596110344, 0.12657642364501953, 0.5430456399917603, -0.5048551559448242, -0.023472804576158524, -0.1632167249917984, -0.3752976953983307, 0.18214012682437897, -0.7141882181167603, 0.156965568661...
Log.e("log_tag", "Error converting result " + e.toString()); } try { JSONArray jArray = new JSONArray(result); for (int i = 0; i < jArray.length(); i++) { JSONObject jo = jArray.getJSONObject(i);
[ -0.16821834444999695, -0.5152765512466431, 0.5738087892532349, -0.4888736605644226, -0.030873266980051994, 0.37656864523887634, 0.526216447353363, -0.430087149143219, -0.3443501591682434, -0.5027989149093628, -0.12743498384952545, 0.5621987581253052, -0.4527652859687805, 0.0855471342802047...
listItems.add(jo); } } catch (Exception e) { Toast.makeText(context.getApplicationContext(), "None Found!", Toast.LENGTH_LONG).show(); } return listItems; } } package com.thickcrustdesigns.ufood; import java.util.ArrayList; import org.apach...
[ 0.40450319647789, 0.050962429493665695, 0.6169774532318115, -0.36845460534095764, -0.30962228775024414, 0.00997087825089693, 0.5856794118881226, -0.7506518959999084, -0.28739041090011597, -0.4890618920326233, -0.603943407535553, 0.5474030375480652, -0.5119803547859192, -0.02603483758866787...
ListView listView1; enum Category { Chicken, Beef, Chinese, Cocktails, Curry, Deserts, Fish, ForOne { public String toString() { return "For One"; } }, Lamb, LightBites { public
[ 0.6024885773658752, -0.08689884096384048, 0.12220305949449539, -0.3500508964061737, -0.09131588786840439, 0.5506492257118225, 0.05955848842859268, -0.027290262281894684, -0.2682558000087738, -0.4371362626552582, -0.2023417204618454, 0.3512396812438965, -0.44969484210014343, 0.1697614639997...
String toString() { return "Light Bites"; } }, Pasta, Pork, Vegetarian } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setContentView(R.layout.definition_main); listView1 = (ListView...
[ 0.6591041088104248, -0.4115150272846222, 0.40382280945777893, -0.22417470812797546, 0.21898792684078217, 0.31678587198257446, 0.46855226159095764, -0.2417670637369156, 0.027796240523457527, -0.7579275965690613, -0.426085889339447, 0.6837443113327026, -0.6081476807594299, 0.1911593228578567...
Bundle data = getIntent().getExtras(); String category = data.getString("category"); Category cat = Category.valueOf(category); String value = null; switch (cat) { case Chicken: value = "Chicken"; break; case Beef:
[ 0.22600442171096802, -0.5876505970954895, 0.11271265149116516, -0.08729451149702072, 0.02804172970354557, 0.16008609533309937, 0.12544472515583038, -0.39628779888153076, -0.4428195059299469, -0.05056135728955269, -0.4272462725639343, 0.3774696886539459, -0.5044983625411987, 0.2272583544254...
value = "Beef"; break; case Chinese: value = "Chinese"; break; case Cocktails: value = "Cocktails"; break; case Curry:
[ -0.07386709004640579, 0.2848532199859619, -0.11177338659763336, -0.141739159822464, -0.025602716952562332, 0.3380417823791504, -0.13287582993507385, 0.20122480392456055, -0.19658446311950684, -0.14367221295833588, -0.5429377555847168, 0.22448277473449707, -0.22970442473888397, 0.0511312559...
value = "Curry"; break; case Deserts: value = "Deserts"; break; case Fish: value = "Fish"; break;
[ -0.08827812969684601, 0.10491827130317688, -0.07715612649917603, -0.10666922479867935, 0.2969052493572235, 0.21841385960578918, 0.069441057741642, -0.12732964754104614, 0.0405665822327137, -0.33568277955055237, -0.6542416214942932, 0.08917621523141861, -0.30275097489356995, 0.5065239071846...
case ForOne: value = "ForOne"; break; case Lamb: value = "Lamb"; break; case LightBites: value = "LightBites"; break;
[ -0.0686885192990303, 0.019109295681118965, -0.2822009325027466, -0.7889850735664368, 0.31893718242645264, 0.5593799948692322, 0.46760988235473633, -0.7174291610717773, -0.07993508875370026, -0.3779773414134979, -0.5717771649360657, 0.5751805901527405, -0.415719211101532, -0.134120643138885...
case Pasta: value = "Pasta"; break; case Pork: value = "Pork"; break; case Vegetarian: value = "Vegetarian"; }
[ 0.23631644248962402, 0.06360646337270737, -0.37476712465286255, -0.16715551912784576, 0.37096962332725525, 0.3795187771320343, -0.09370067715644836, -0.052295856177806854, -0.2641746997833252, -0.24301724135875702, -0.5054726004600525, 0.5759356617927551, -0.3424922823905945, -0.0166443027...
ArrayList<NameValuePair> nvp = new ArrayList<NameValuePair>(); nvp.add(new BasicNameValuePair("request", "category")); nvp.add(new BasicNameValuePair("cat", value)); ArrayList<JSONObject> jsondefs = Request.fetchData(this, nvp); String[] defs = new String[jsondefs.size()]; f...
[ -0.10000704228878021, -0.5764424800872803, 0.5861402153968811, -0.4731350839138031, 0.06433291733264923, 0.26714321970939636, 0.4381100833415985, -0.7937803864479065, -0.44666168093681335, -0.3674831688404083, -0.44300806522369385, 0.5043684244155884, -0.4297872483730316, 0.009790690615773...
defs[i] = jsondefs.get(i).getString("Name"); } catch (JSONException e) { // TODO Auto-generated catch block e.printStackTrace(); } } uFoodAdapter adapter = new uFoodAdapter(this, R.layout.definition_list,
[ 0.09357839822769165, -0.3364946246147156, 0.5472080707550049, -0.1568501889705658, 0.32852795720100403, 0.06744273006916046, 0.23429572582244873, -0.5750000476837158, -0.29747554659843445, -0.5448622107505798, -0.27725502848625183, 0.617595911026001, -0.4499218761920929, 0.0835465043783187...
defs); listView1.setAdapter(adapter); } } ``` I am providing some code with this as I think it will make things clearer. Basically you need to keep an pool of process objects around. Be considerate that each of these processes has a input, output and error stream you need to manage in some way. In my exa...
[ 0.38672441244125366, -0.024430332705378532, 0.25402891635894775, 0.006315614562481642, -0.2524626851081848, -0.1583990454673767, 0.22778432071208954, -0.23199264705181122, -0.19110126793384552, -0.6311747431755066, 0.10492990165948868, 0.6910536289215088, -0.28673335909843445, -0.104977890...
don't care what PHP says then leave it as is or redirect to a file. I am using the [Apache Commons Pool](http://commons.apache.org/pool/) library for the ObjectPool. No need to reinvent one. You'll have a pool of 20 processes that run your PHP program. This alone will not get you what you need. You might want to pro...
[ 0.46356305480003357, -0.03740987554192543, 0.3030284345149994, 0.02641582489013672, -0.09773280471563339, -0.05316668748855591, 0.13434118032455444, -0.13043007254600525, -0.32405972480773926, -0.6526553630828857, 0.16073749959468842, 0.49790433049201965, -0.37898293137550354, 0.1539205908...
your php processes and they will just sit there. You'll probably want to keep a log of all the pid's of the PHP processes you spawn, and then clean them up if you re-run your Java program. ``` public class StackOverflow_10037379 { private static Logger sLogger = Logger.getLogger(StackOverflow_10037379.class.getNa...
[ 0.0796344056725502, 0.061809465289115906, 0.5233919620513916, -0.05839800089597702, 0.073078453540802, 0.18747445940971375, 0.2732139527797699, -0.375068724155426, -0.27839526534080505, -0.7343077659606934, -0.14268793165683746, 0.5101824402809143, -0.6182366609573364, 0.1592857837677002, ...
} @Override public Process makeObject() throws Exception { ProcessBuilder builder = new ProcessBuilder(); builder.redirectError(Redirect.INHERIT); // I am being lazy, but really the InputStream is where // you can get any output of the PHP Process. This s...
[ 0.25162404775619507, -0.09969502687454224, 0.21813669800758362, -0.37090247869491577, 0.12008600682020187, 0.04363267868757248, 0.7118893265724182, -0.545693039894104, -0.028863679617643356, -0.4910587966442108, 0.057036034762859344, 0.37974777817726135, -0.28126275539398193, 0.41427367925...
// will make it output to the current processes console. builder.redirectOutput(Redirect.INHERIT); builder.redirectInput(Redirect.PIPE); builder.command(mProcessToRun); return builder.start(); } @Override public boolean validateObject(Process proc...
[ 0.12669558823108673, -0.27856898307800293, 0.3912957012653351, -0.23230350017547607, 0.27365586161613464, 0.13308866322040558, 0.5093987584114075, -0.7977141737937927, -0.1279912292957306, -0.49874016642570496, -0.11353544890880585, 0.5100651383399963, -0.29163527488708496, 0.5410072803497...