text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
To configure the pools it is recommended to have one .conf file per ; pool in the following directory: include=/etc/php5/fpm/pool.d/*.conf ``` **ii**. *nginx.conf* In all honesty this configuration is a smattering of a few websites I've visited, but I can tell you that before this 502 Bad Gateway business, the serve...
[ 0.25695139169692993, 0.06268177181482315, 0.30874159932136536, 0.04319896176457405, 0.2110663503408432, -0.31423285603523254, 0.36777371168136597, 0.09077030420303345, -0.44940024614334106, -0.6131259202957153, 0.08985115587711334, 0.5675714015960693, -0.3253888785839081, 0.300992429256439...
worker_connections 64; # multi_accept on; } http { ## # Basic Settings ## sendfile on; tcp_nopush off; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; # server_tokens off; # server_names_hash_bucket_size 64; # server_name_in_redirect off; include ...
[ -0.23807749152183533, 0.033333439379930496, 0.48622679710388184, -0.14476421475410461, 0.13749900460243225, 0.30206799507141113, 0.3298981189727783, -0.11799609661102295, -0.5190190076828003, -0.9412866234779358, -0.19444945454597473, 0.17446909844875336, -0.36204251646995544, 0.3926326036...
error_log /var/log/nginx/error.log; ## # Gzip Settings ## gzip on; gzip_disable "msie6"; # gzip_vary on; # gzip_proxied any; # gzip_comp_level 6; # gzip_buffers 16 8k; # gzip_http_version 1.1; # gzip_types text/plain text/css application/json application/x-javascript text/...
[ -0.24875734746456146, 0.020800309255719185, 0.6648350358009338, -0.17066676914691925, 0.020482603460550308, 0.014515127055346966, 0.380592942237854, -0.06612661480903625, -0.4329891502857208, -0.846793532371521, -0.6874196529388428, 0.7036207318305969, -0.6093264222145081, 0.01662020012736...
{ listen 80; server_name ec2-xx-xx-xx-xx.compute-x.amazonaws.com; location ~ ^(.+\.php)(.*)$ { root /home/wayvac/public; fastcgi_pass unix:/var/run/php5-fpm.pid; #fastcgi_pass 127.0.0.1:9000; #Un-comment this and comment "fastcgi_pass unix:/var/run/...
[ 0.17365729808807373, 0.00917892437428236, 0.5656698942184448, -0.1971655786037445, 0.3079161047935486, -0.13911519944667816, 0.6032395362854004, -0.19927342236042023, -0.1558164656162262, -0.7644173502922058, -0.29637300968170166, 0.7165004014968872, -0.20362631976604462, 0.159619510173797...
fastcgi_index index.php; set $document_root2 $document_root; if ($document_root2 ~ "^(.*\\\\).*?[\\\\|\/]\.\.\/(.*)$") { set $document_root2 $1$2; } if ($document_root2 ~ "^(.*\\\\).*?[\\\\|\/]\.\.\/(.*)$") { set $document_root2 $1$2; } if ($document_root2 ~ "^(.*\\\\).*...
[ -0.7442019581794739, -0.5175511240959167, 0.6774915456771851, 0.1784418374300003, 0.28903886675834656, -0.07988566905260086, 0.03686255216598511, -0.0790514275431633, -0.10214419662952423, -0.47926101088523865, -0.47475504875183105, 0.5976547002792358, -0.27052757143974304, -0.156906262040...
if ($document_root2 ~ "^(.*\\\\).*?[\\\\|\/]\.\.\/(.*)$") { set $document_root2 $1$2; } fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param SCRIPT_FILENAME $document_root2$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANS...
[ -0.3068259060382843, -0.23733553290367126, 0.6304082274436951, -0.017111320048570633, -0.12351597100496292, 0.037071555852890015, -0.08840584009885788, -0.38167834281921387, -0.2904721796512604, -0.4372755289077759, -0.5274109244346619, 0.36816754937171936, -0.4048347771167755, -0.06578024...
fastcgi_param DOCUMENT_ROOT $document_root2; } access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; location / { root /home/wayvac/public; index index.html index.htm index.php; }
[ -0.12437182664871216, -0.2738202214241028, 0.3318052589893341, 0.15669536590576172, 0.435751348733902, 0.4473409950733185, 0.39795973896980286, -0.08912938088178635, -0.3418998122215271, -0.4798167049884796, -0.47534114122390747, 0.4276673495769501, -0.15567466616630554, 0.1896927207708358...
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ { # Some basic cache-control for static files to be sent to the browser expires max; add_header Pragma public; add_header Cache-Control "public, must-revalidate, proxy-revalidate"; } #include drop.conf; ...
[ 0.11209652572870255, -0.18844711780548096, 0.4885377585887909, 0.01651262491941452, 0.5770808458328247, 0.008407007902860641, 0.3074139356613159, 0.24372649192810059, -0.10046285390853882, -0.5051862597465515, -0.5668852925300598, -0.12968851625919342, -0.2248091995716095, 0.25247329473495...
php.conf; } } ``` If anyone finds this page by encountering the same problem I had, I found the answer [here](http://www.howtoforge.com/installing-nginx-with-php5-and-php-fpm-and-mysql-support-lemp-on-ubuntu-12.04-lts). For those of you who can't be bothered to click and work it out for themselves... ;) **The Co...
[ -0.09484133124351501, 0.01754775084555149, 0.557711660861969, -0.14191016554832458, 0.08303117007017136, -0.11188643425703049, 0.3848436176776886, 0.060998257249593735, -0.13983073830604553, -0.7533704042434692, -0.4113210439682007, 0.7925153970718384, -0.5699614882469177, -0.0992544293403...
'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on ; a specific port; ; 'port' - to listen on a TCP socket to all addresses on a ;
[ -0.05279306694865227, -0.11414960026741028, 0.2708997428417206, 0.13939806818962097, -0.1471405029296875, 0.09013227373361588, 0.18897745013237, -0.10638197511434555, 0.011556783691048622, -0.6920735239982605, -0.4574737250804901, 0.5489889979362488, -0.24859634041786194, 0.387236952781677...
specific port; ; '/path/to/unix/socket' - to listen on a unix socket. ; Note: This value is mandatory. listen = /var/run/php5-fpm.sock ``` and replace the fastcgi\_pass variable in your vhost with the location you just noted. So this sample symfony2 configuration (taken from [here](http://wiki.nginx.org/Symfony)):...
[ 0.10931809991598129, 0.03322814777493477, 0.7096580266952515, -0.10478173196315765, -0.2605454623699188, 0.22778154909610748, 0.35993146896362305, -0.54625403881073, -0.46951621770858765, -0.6340648531913757, -0.307151198387146, 0.5945457816123962, -0.3547396659851074, -0.04176279902458191...
off; } ``` becomes this: ``` # pass the PHP scripts to FastCGI server at /var/run/php5-fpm.sock location ~ ^/(app|app_dev)\.php(/|$) { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fas...
[ -0.08161506056785583, -0.11544545739889145, 0.6685165762901306, 0.09967692196369171, -0.1304769515991211, 0.08080790936946869, 0.30258068442344666, -0.19632413983345032, -0.4459458291530609, -0.5772498250007629, -0.3092327415943146, 0.48037031292915344, -0.3290356397628784, 0.0298981182277...
you could change the `listen = /var/run/php5-fpm.sock` to `listen = 127.0.0.1:9000` in `/etc/php5/fpm/pool.d/www.conf` then restart php5-fpm (which would save you from having to change your vhosts), but you have to assume they changed php5-fpm to run through a socket rather than listening on port 9000 for a reason. **...
[ 0.3344559073448181, -0.015573176555335522, 0.2553606331348419, 0.14109976589679718, 0.1979244500398636, -0.11192414164543152, 0.6940115094184875, -0.16944994032382965, -0.49000921845436096, -0.4689498245716095, -0.12868796288967133, 0.8860896229743958, -0.06288247555494308, 0.1803705096244...
I tested each statement on its own and it works, but when I use || it ignores the !driver.getText().toString().equals("")part of the statement. Any ideas? ``` if((!driver.getText().toString().equals(""))|| (canDrive>=0) ) ``` The `||` operator means *or* - so if either condition is true, the test succeeds. If you ...
[ 0.35629698634147644, 0.24267686903476715, -0.004864938091486692, -0.18682757019996643, 0.04073607921600342, 0.049504850059747696, 0.5232157111167908, -0.42954331636428833, 0.09609179943799973, -0.23042620718479156, 0.07137367874383926, 0.7733622789382935, -0.3060769736766815, -0.1340119689...
Look at the following two ways to create a new object of class Y: (1) ``` X x; Y y(x);//explicit conversion ``` (2) ``` X x; Y y = x;//implicit conversion ``` The first way uses **explicit conversion** and another uses **implicit conversion**.But,I don't very understand how they work.What is their difference?Cou...
[ 0.10991601645946503, 0.11246485263109207, -0.051174890249967575, -0.03673042729496956, -0.4380827248096466, 0.18154765665531158, 0.11291010677814484, -0.2446039468050003, 0.16322408616542816, -0.7931253910064697, -0.2526516020298004, 0.7690876126289368, -0.25411394238471985, 0.202779099345...
argument is converted by means of an implicit conversion to the destination type and then the copy constructor is called to initialize the variable. In real life, the compiler will remove the copy and convert in place of the destination variable, but the compiler must check that there is an *implicit conversion* from `...
[ -0.3914484977722168, 0.32539770007133484, 0.2597786486148834, -0.11701393127441406, -0.14764994382858276, 0.36826473474502563, 0.2579546272754669, -0.03294885903596878, 0.4564310312271118, -0.45919591188430786, -0.38626837730407715, 0.7066212296485901, -0.1397918462753296, 0.11487980931997...
I want to split some Strings in java on the colon character. The format of the strings are: `Account:Password`. I want to separate the tokens: `Account` and `Password`. What's the best way to do this? See Ernest Friedman-Hill's answer first. ``` String namepass[] = strLine.split(":"); String name = namepass[0]; St...
[ 0.29594725370407104, 0.08477063477039337, -0.043328333646059036, -0.18135297298431396, -0.08575925976037979, 0.09527499228715897, 0.12305453419685364, -0.4041801393032074, -0.10931838303804398, -0.5016508102416992, 0.15091025829315186, 0.39742550253868103, -0.18043911457061768, 0.039163902...
Is there a way to offset the 'each' iteration when using the Jade template engine? for example, when passing in the object named list: ``` ul each item in list li #{item} ``` Will output ``` <ul> <li> Item 1 </li> <li> item 2 </li> <li> item 3..... ... </ul> ``` But I want the first item to be...
[ -0.12464987486600876, -0.18596558272838593, 0.16287681460380554, 0.0677623450756073, -0.4528837203979492, 0.5090759992599487, -0.29910439252853394, -0.3620411157608032, -0.16523320972919464, -0.6505025029182434, -0.025139987468719482, 0.619364857673645, -0.21509099006652832, -0.26214972138...
the 'each' statement in Jade so that I can render the first item separately and then render each following item starting at the 2nd index? ``` each item, i in list li= item if i === 1 | : First item in list! ```
[ -0.3051959276199341, 0.1387830376625061, 0.33005964756011963, -0.19148780405521393, -0.3719901144504547, 0.5563945770263672, 0.01363566517829895, -0.4380679130554199, -0.1172139048576355, -0.49578356742858887, -0.33598753809928894, 0.42834365367889404, -0.1349523812532425, -0.0188492387533...
I have code that looks something like this in javascript: ``` forloop { //async call, returns an array to its callback } ``` After ALL of those async calls are done, I want to calculate the min over all of the arrays. How can I wait for all of them? My only idea right now is to have an array of booleans called...
[ 0.1554226279258728, 0.042095787823200226, 0.15829624235630035, -0.09658341854810715, -0.011887593194842339, 0.12383592128753662, 0.23728394508361816, -0.28345876932144165, -0.08401909470558167, -0.5682992339134216, 0.03881935775279999, 0.6851757764816284, -0.1555553823709488, -0.0942243188...
other done are set from each callback, thus the last callback to complete will call the continuing method. Thanks in advance. You haven't been very specific with your code, so I'll make up a scenario. Let's say you have 10 ajax calls and you want to accumulate the results from those 10 ajax calls and then when they ha...
[ 0.01818433217704296, -0.08733047544956207, 0.39711833000183105, 0.01713823899626732, -0.027709534391760826, 0.07630704343318939, 0.40654256939888, -0.37001731991767883, -0.20087109506130219, -0.49733009934425354, -0.03961750864982605, 0.870807945728302, 0.08207700401544571, -0.298286169767...
10; i++) { doAjax(whatever, function(response) { // success handler from the ajax call // save response returnedData.push(response); // see if we're done with the last ajax call --ajaxCallsRemaining; if (ajaxCallsRemaining <= 0) { // all data is here now
[ -0.1432536095380783, -0.24229377508163452, 0.6409572958946228, -0.3376127779483795, 0.07295986264944077, 0.06597231328487396, 0.4346114695072174, -0.17100034654140472, 0.0703858956694603, -0.4703013598918915, -0.3324369490146637, 0.6736020445823669, -0.07161686569452286, -0.246021628379821...
// look through the returnedData and do whatever processing // you want on it right here } }); } ``` Note: error handling is important here (not shown because it's specific to how you're making your ajax calls). You will want to think about how you're going to handle the case when one ajax ca...
[ -0.02473616786301136, -0.034661777317523956, 0.1607714146375656, 0.11987440288066864, -0.05943586677312851, -0.44585302472114563, 0.2661404013633728, 0.5490907430648804, -0.1430130898952484, -0.7355851531028748, -0.23471753299236298, 0.5780937671661377, 0.08825787901878357, -0.143431127071...
Promises** Adding to my answer in 2014. These days, promises are often used to solve this type of problem since jQuery's `$.ajax()` already returns a promise and `$.when()` will let you know when a group of promises are all resolved and will collect the return results for you: ``` var promises = []; for (var i = 0; i...
[ 0.13284514844417572, -0.023053685203194618, 0.38834434747695923, 0.06582219153642654, -0.09970962256193161, 0.17857658863067627, 0.43755170702934265, -0.31474095582962036, -0.0541292168200016, -0.5141563415527344, -0.08356332778930664, 0.7847306132316589, 0.054547347128391266, -0.043627373...
if you have an environment with native promises built-in (modern browser or node.js or using babeljs transpile or using a promise polyfill), then you can use ES6-specified promises. See [this table](http://caniuse.com/#feat=promises) for browser support. Promises are supported in pretty much all current browsers, excep...
[ 0.2834010124206543, -0.08333273231983185, -0.07672356069087982, -0.11071942746639252, 0.19539467990398407, 0.03172294795513153, 0.7289268374443054, -0.18720713257789612, -0.006862334907054901, -0.5766275525093079, -0.3064175844192505, 0.6950541734695435, -0.12418565154075623, -0.1842343956...
you need to make a non-promise async operation into one that returns a promise, you can "promisify" it like this: ``` function doAjax(...) { return new Promise(function(resolve, reject) { someAsyncOperation(..., function(err, result) { if (err) return reject(err); resolve(result); ...
[ 0.32846492528915405, -0.20096248388290405, 0.048541679978370667, -0.19281290471553802, 0.5180033445358276, -0.14787988364696503, 0.48615363240242004, -0.47243258357048035, 0.14562030136585236, -0.36423611640930176, -0.38590389490127563, 0.7793179750442505, -0.15796206891536713, 0.028479652...
promises.push(doAjax(...)); } Promise.all(promises).then(function() { // returned data is in arguments[0], arguments[1], ... arguments[n] // you can process it here }, function(err) { // error occurred }); ``` --- **Bluebird Promises** If you use a more feature rich library such as the [Bluebird promise...
[ 0.25447598099708557, -0.30867329239845276, 0.16874174773693085, -0.17205214500427246, 0.2643967866897583, -0.015092861838638783, 0.4448980987071991, -0.0929458737373352, 0.13322554528713226, -0.7460411190986633, -0.08938158303499222, 0.7824726700782776, -0.28014421463012695, -0.35152593255...
I'm trying to load country names and their cities from an XML file in silver-light. I want the cities to be loaded to a ListPicker according to the selected country. This is a part of my XML file: ``` <Times> <country name="USA"> <city name="Aaronsburg -- PA"> <state>PA</state> <l...
[ 0.30330580472946167, 0.13444125652313232, 0.6614168882369995, 0.3882318437099457, 0.12114863842725754, 0.04270946606993675, 0.28046587109565735, 0.2283419370651245, -0.3290676176548004, -0.8507251739501953, -0.06226911395788193, -0.27116239070892334, -0.20068933069705963, 0.478162229061126...
<daylight>1</daylight> </city> <city name="Abbeville -- AL"> <state>AL</state> <latitude>316077</latitude> <longitude>-853051</longitude> <timezone>-600</timezone> <daylight>1</daylight> </city>
[ 0.2477336823940277, 0.3348366320133209, 0.3384545147418976, -0.05984938144683838, -0.10761638730764389, 0.16115108132362366, 0.3521776795387268, -0.15794824063777924, -0.25642499327659607, -0.8107113838195801, -0.25670552253723145, 0.16119615733623505, -0.8981267809867859, 0.33962467312812...
<city name="Abbeville -- GA"> <state>GA</state> <latitude>319710</latitude> <longitude>-833016</longitude> <timezone>-500</timezone> <daylight>1</daylight> </city> <city name="Abbot -- ME">
[ -0.015328395180404186, 0.6019778251647949, 0.025173939764499664, 0.10384289920330048, -0.0012974755372852087, 0.35587355494499207, 0.874931275844574, 0.11293972283601761, -0.4701416492462158, -0.5504780411720276, -0.30150869488716125, 0.35792645812034607, -0.5920838117599487, 0.46704450249...
<state>ME</state> <latitude>453219</latitude> <longitude>-695342</longitude> <timezone>-500</timezone> <daylight>1</daylight> </city> ........ ........ ``` and this the code I wrote: ``` private void LoadButton_Click(object sender, RoutedEventArgs e) { ...
[ 0.4846852719783783, -0.00023142059217207134, 0.6264441013336182, 0.08785039931535721, 0.3373010754585266, 0.30246803164482117, 0.4237167537212372, -0.38370487093925476, -0.26698824763298035, -0.5564732551574707, -0.43177908658981323, 0.22568614780902863, -0.36428776383399963, 0.39035460352...
if (definition.Attribute(XName.Get("name")).Value == CountryListPicker.SelectedItem.ToString()) { var cities = definition.Document.Descendants(XName.Get("city")); foreach (var city in cities) { CityListPicker.Items.Add(city.Attribute(XName.Get("name")).Value....
[ 0.09124157577753067, -0.43515828251838684, 0.4861871898174286, 0.1923215538263321, 0.1634829342365265, 0.18631389737129211, 0.07410603016614914, -0.36007627844810486, -0.3683825731277466, -0.7175618410110474, -0.6747068166732788, 0.07309926301240921, -0.12878088653087616, 0.469861626625061...
} } } ``` cities are loaded after a long time, or not loaded! is something wrong with my code? You haven't been very specific with your code, so I'll make up a scenario. Let's say you have 10 ajax calls and you want to accumulate the results from those 10 ajax calls and then when they have all completed you want ...
[ 0.21714305877685547, 0.013958814553916454, 0.35929539799690247, 0.1811482161283493, -0.10836154967546463, -0.151242196559906, 0.4574674367904663, -0.17473487555980682, -0.2950585186481476, -0.7472261190414429, 0.01457175798714161, 0.6606743335723877, -0.2164689302444458, -0.204666495323181...
i = 0; i < 10; i++) { doAjax(whatever, function(response) { // success handler from the ajax call // save response returnedData.push(response); // see if we're done with the last ajax call --ajaxCallsRemaining; if (ajaxCallsRemaining <= 0) { // all data ...
[ -0.10716583579778671, -0.24636676907539368, 0.6487909555435181, -0.29810285568237305, 0.05449806526303291, -0.025909701362252235, 0.4945836365222931, -0.22997301816940308, 0.06955956667661667, -0.3474937975406647, -0.2800445854663849, 0.6116651892662048, 0.03186338394880295, -0.08097364753...
// look through the returnedData and do whatever processing // you want on it right here } }); } ``` Note: error handling is important here (not shown because it's specific to how you're making your ajax calls). You will want to think about how you're going to handle the case when one ajax ca...
[ -0.06750545650720596, -0.020366059616208076, 0.051860686391592026, 0.04786297306418419, -0.0028655880596488714, -0.3725317120552063, 0.2041943520307541, 0.29781484603881836, -0.0536762997508049, -0.7482251524925232, -0.2178308665752411, 0.7461205124855042, -0.10158868134021759, -0.28209176...
out after a long time. --- **jQuery Promises** Adding to my answer in 2014. These days, promises are often used to solve this type of problem since jQuery's `$.ajax()` already returns a promise and `$.when()` will let you know when a group of promises are all resolved and will collect the return results for you: ``...
[ 0.007867268286645412, -0.09867814183235168, 0.5256170034408569, -0.17418983578681946, -0.02762678824365139, -0.00837827380746603, 0.28610825538635254, -0.2997322380542755, -0.08938534557819366, -0.47075018286705017, -0.18252810835838318, 0.6274828910827637, -0.06184021010994911, -0.0017778...
Promises** [As specified in kba's answer](https://stackoverflow.com/a/33813793/576767): if you have an environment with native promises built-in (modern browser or node.js or using babeljs transpile or using a promise polyfill), then you can use ES6-specified promises. See [this table](http://caniuse.com/#feat=promise...
[ 0.24132928252220154, -0.0353865846991539, 0.030619483441114426, -0.039124201983213425, 0.22908170521259308, 0.034421686083078384, 0.7364944219589233, -0.23705601692199707, -0.03536594286561012, -0.5842430591583252, -0.3076073229312897, 0.7341607809066772, -0.1236814334988594, -0.2039604038...
// error occurred }); ``` --- If you need to make a non-promise async operation into one that returns a promise, you can "promisify" it like this: ``` function doAjax(...) { return new Promise(function(resolve, reject) { someAsyncOperation(..., function(err, result) { if (err) return reject(...
[ 0.26802492141723633, -0.20654137432575226, 0.03154769912362099, -0.24313679337501526, 0.5285875797271729, -0.11478261649608612, 0.5483590960502625, -0.46891874074935913, 0.17526327073574066, -0.2296573668718338, -0.4180232584476471, 0.7758306264877319, -0.1887870877981186, 0.05300826579332...
i++) { promises.push(doAjax(...)); } Promise.all(promises).then(function() { // returned data is in arguments[0], arguments[1], ... arguments[n] // you can process it here }, function(err) { // error occurred }); ``` --- **Bluebird Promises** If you use a more feature rich library such as the [Blueb...
[ 0.2009112685918808, -0.32297757267951965, 0.3023444414138794, -0.22174526751041412, 0.2314790040254593, -0.012201370671391487, 0.40929630398750305, -0.2793519198894501, 0.18401935696601868, -0.6893932819366455, -0.20131373405456543, 0.7351620197296143, -0.2514055669307709, -0.3354181945323...
I want to make a 2d, 3 by 3 ,array like this: ``` double *array; void setArray(double x, double y, double z){ array = {{x,0,0}, {0,y,0}, {0,0,z}}; } ``` I read some posts suggested something like this: ``` double **array = new double*[3]; void setArray(double x, double y, double z){ ...
[ 0.5228025317192078, 0.0692780390381813, 0.3746148347854614, -0.27932068705558777, -0.33171209692955017, 0.16889846324920654, 0.29533612728118896, -0.6419550180435181, -0.239566370844841, -0.6037185788154602, -0.08918077498674393, 0.3614977300167084, -0.5924422144889832, 0.00233806273899972...
array directly using values {{x,0,0},{0,y,0},{0,0,z}}? Thanks in advance. If you want to use lists like `{{x,0,0},{0,y,0},{0,0,z}}`, you should use arrays with hard-coded size: ``` double *array; // no good double array[3][3]; // OK ``` Fill them with copying: ``` void setArray(double x, double y, double z){ d...
[ 0.42871806025505066, 0.12972396612167358, 0.41131162643432617, -0.014545601792633533, -0.22498145699501038, 0.11080445349216461, 0.296060174703598, -0.5318089127540588, -0.26064664125442505, -0.3768927752971649, -0.05700482428073883, 0.5709422826766968, -0.41360756754875183, -0.28235656023...
So the title is a little confusing, I think, but here's the issue: I have one model for my entire page called FD.page. I have an attribute of that model called filters, thus FD.page.get("filters") returns an object with multiple attributes itself, date, location, etc. I would like to be able to set values to the attr...
[ 0.10303567349910736, -0.2573242485523224, 0.5249384641647339, 0.28130099177360535, -0.10820437967777252, -0.27750471234321594, -0.005522045772522688, 0.020993998274207115, -0.11250180751085281, -0.7494284510612488, -0.06791453063488007, 0.2169908881187439, -0.24110791087150574, 0.097942404...
someone who is looking to only get a feel of Spring MVC, which addresses concerns specific to the web layer of the application, this could be more information than required. Probably that is why you got the feeling that the tutorial is complex. To answer your questions, Spring is easy to learn because the whole framew...
[ 0.33330217003822327, -0.31782498955726624, -0.18946267664432526, 0.4170987606048584, -0.19227765500545502, -0.01899278350174427, 0.20775580406188965, -0.22848725318908691, -0.346756249666214, -0.23440483212471008, -0.007132124621421099, 0.4811786413192749, 0.020760487765073776, -0.39413318...
to achieve the wiring. The tutorial you have referred to tries to explain things in a little bit more detail than experienced programmers would typically do in a real application, probably because the authors wanted the readers to get enough insight into how Spring works so that concepts are understood well. In most a...
[ 0.6210291385650635, -0.17275042831897736, -0.3738335072994232, 0.24125710129737854, 0.0645236000418663, -0.07020121812820435, 0.5863856673240662, -0.21309584379196167, -0.2201671153306961, -0.051879119127988815, -0.4675479233264923, 0.18993373215198517, 0.20490004122257233, -0.317490428686...
has to implement a Spring component to achieve something. For example, let us take the example of the data access layer. Different teams like using different approaches to accessing databases. Some like raw JDBC, others like third-party ORMs like iBatis or Hibernate while some others like JPA. Spring distributions cont...
[ -0.10945513844490051, -0.25227275490760803, -0.23917022347450256, 0.414070188999176, -0.4328579604625702, -0.2431834638118744, -0.09551013261079788, -0.10109949111938477, -0.49924737215042114, -0.2464161217212677, 0.01195345539599657, 0.3855418860912323, -0.02319028228521347, -0.1278452575...
of these products, allowing teams to simply choose which product they want to use and configure it in their Spring application. Recent Spring releases have mostly done away with extensive XML based configuration files, which being external to the Java code did make Spring application a bit cumbersome to understand. Ma...
[ -0.017353590577840805, -0.1664958894252777, 0.09623713046312332, 0.16320379078388214, -0.16908712685108185, -0.31275424361228943, 0.06482815742492676, -0.16946722567081451, -0.27099376916885376, -0.3183642625808716, -0.04585997387766838, 0.20066788792610168, -0.08806023001670837, -0.106226...
is available at <http://www.vaannila.com/spring/spring-mvc-tutorial-1.html>. This tutorial uses XML based configuration for Spring beans instead of annotations but the concepts remain the same.
[ 0.07670184969902039, -0.23026436567306519, 0.11228884756565094, 0.04573354870080948, -0.07551717013120651, 0.17658165097236633, 0.17376597225666046, 0.017610399052500725, -0.3462700843811035, -0.05071192607283592, -0.47166556119918823, 0.026021607220172882, -0.00802546739578247, -0.1129597...
Hopefully this post goes better.. So I am stuck on this feature of this program that will return the whole word where a certain keyword is specified. ie - If I tell it to look for the word "I=" in the string "blah blah blah blah I=1mV blah blah etc?", that it returns the whole word where it is found, so in this case,...
[ 0.22300665080547333, 0.21860913932323456, 0.5014828443527222, -0.039835523813962936, -0.19255976378917694, -0.09184687584638596, 0.4759830832481384, -0.007035502698272467, -0.13378779590129852, -0.7760518789291382, -0.18156284093856812, 0.443972110748291, -0.3195582330226898, 0.24891294538...
values, ', '1mV is used'] ``` If I try regex solutions, I run into the problem where the number could possibly be more then 1 digit, and so this bottom piece of code only works if the number is 1 digit. If I=10mV was that value, it would only return one, but if i have [/0-9] in twice, the code no longer works with on...
[ -0.34310054779052734, 0.26909613609313965, 0.6514737606048584, -0.11096394807100296, 0.19069255888462067, 0.256887286901474, 0.5010983943939209, -0.44797658920288086, -0.16725285351276398, -0.5307892560958862, -0.14959202706813812, 0.6155259013175964, -0.16016757488250732, 0.08902784436941...
(In this case, I want to retrieve I=1mV) and cut out the rest of the string? A better way would be to split the text into words first: ``` >>> text = "One of the values, I=1mV is used" >>> words = text.split() >>> words ['One', 'of', 'the', 'values,', 'I=1mV', 'is', 'used'] ``` And then filter the words to find the ...
[ -0.014710929244756699, 0.09722520411014557, 0.1473740190267563, -0.1014452800154686, -0.10702382773160934, 0.12140574306249619, 0.5386990308761597, -0.4038766026496887, -0.07746676355600357, -0.7773524522781372, -0.40472567081451416, 0.45515158772468567, -0.17176568508148193, 0.05389267951...
up a bit is to just look for the first match, rather then checking every word. We can use a generator expression for that: ``` >>> next(w for w in words if 'I=' in w) 'I=1mV' ``` Of course you could adapt the `if` condition to fit your needs better, you could for example use [`str.startswith()`](http://docs.python.o...
[ 0.5854803919792175, -0.22292135655879974, 0.5388180017471313, 0.01808306761085987, -0.13448232412338257, 0.11415243148803711, 0.34972697496414185, -0.5938930511474609, -0.10906879603862762, -0.5584354996681213, -0.217979297041893, 0.4815269112586975, -0.09176482260227203, -0.00481037981808...
I am working on a Web Application that includes long listings of names. The client originally wanted to have the names split up into `div`s by letter so it is easy to jump to a particular name on the list. Now, looking at the list, the client pointed out several letters that have only one or two names associated with ...
[ 0.7207984924316406, 0.32697656750679016, 0.22489894926548004, -0.08751507103443146, 0.10459771007299423, -0.16453589498996735, 0.03450673446059227, 0.11339976638555527, -0.24225910007953644, -0.7791953086853027, 0.3995285630226135, 0.37090757489204407, -0.136056587100029, 0.400603443384170...
return a sorted list, then keep a variable containing the current character. I run through the list of names, incrementing the character and printing the opening and closing `div` and `ul` tags as I get to each letter. I know how to adapt this code to combine some letters, however, the one thing I'm not sure about how ...
[ 0.21089468896389008, 0.2688022553920746, 0.47708043456077576, -0.30402740836143494, -0.043865930289030075, 0.6427374482154846, 0.08835206925868988, -0.30974331498146057, -0.0028390486259013414, -0.6058638691902161, -0.027278535068035126, 0.25574150681495667, -0.03519529849290848, 0.2603396...
23 names I know how to end up with a group `A-C` and then have `D` by itself. What I'm looking for is an *efficient* way to realize that `A` should be by itself and then `B-D` should be together. I am not really sure where to start looking at this. If it makes any difference, this code will be used in a Kohana Frame...
[ 0.2158738672733307, 0.19112499058246613, -0.03852693364024162, 0.0814175084233284, -0.38779741525650024, 0.3534756898880005, 0.24375256896018982, -0.3953112065792084, -0.3747919797897339, -0.6277787089347839, -0.14763644337654114, 0.10818532854318619, -0.21790722012519836, 0.10829698294401...
and letter E has 32 items. I want to leave A alone because it will be better to combine B+C+D. The simple way to combine them is A+B, C+D+E - which is not what I want. In other words, I need the best fit that comes closest to the minimum per group. If a letter contains more than 10 names, or whatever reasonable limit ...
[ 0.04675941914319992, 0.15654020011425018, -0.042716868221759796, 0.05164153128862381, -0.15985268354415894, 0.5853762626647949, 0.3201541602611542, -0.5696049332618713, -0.27837222814559937, -0.6571455597877502, -0.12042342126369476, 0.001876991125755012, -0.30244681239128113, 0.0827468335...
more than 10. That's not a universal solution, but it's how I'd solve it.
[ -0.01170676201581955, 0.03864526376128197, 0.24699804186820984, 0.1468942016363144, 0.21826529502868652, 0.23422040045261383, -0.06218474730849266, 0.1957099586725235, -0.4371813237667084, -0.3406493067741394, 0.18238762021064758, 0.24646587669849396, -0.06870906054973602, -0.1137013956904...
I would like to have a method along the lines of ``` setData:(SomeClassName *)data inPosition:(NSInteger)position ``` and in the implementation, check for nil as position. The idea is that if the position is provided, I will use it, and if not, I will allocate it automatically. The problem is I can't pass either NU...
[ -0.06179293990135193, -0.11041131615638733, -0.17553994059562683, -0.06263578683137894, -0.07007861882448196, -0.0790078416466713, 0.23005183041095734, -0.19339300692081451, 0.023465247824788094, -0.6434655785560608, -0.07318133115768433, 0.2835470139980316, -0.2607157230377197, 0.23624682...
But the problem is that 'data' is a core data created attribute, not a regular ivar, so when I actually want to set the value I would have to remember to send all the KVO messages. For example, inside setData:withPosition, I can't call the standard setData: - it would overwrite any work I did with the position. Would ...
[ 0.2362108677625656, -0.24614448845386505, 0.22141139209270477, 0.2423635870218277, -0.514677882194519, -0.1315702199935913, 0.439008504152298, -0.12906809151172638, -0.2137056589126587, -0.32734695076942444, -0.12465748190879822, 0.541641891002655, -0.2142496556043625, -0.09947645664215088...
is named `setFoo:`. Even if you override `setFoo:`, KVO will wrap your implementation with the correct KVO notification calls for the property. This is very likely the most magical thing in Cocoa. (I used to be certain it was the most magical thing, but I'm starting to wonder about block variable scoping, and especiall...
[ 0.3482747972011566, 0.0910913273692131, 0.469046026468277, -0.031446076929569244, 0.030299801379442215, -0.2542174160480499, 0.25042009353637695, -0.20973441004753113, 0.0030530565418303013, -0.5131304860115051, -0.49031156301498413, 0.38431811332702637, -0.18377012014389038, -0.0614744909...
`setData:` uses to set the property. You should not override the primitive accessors. --- @Justin appears to have deleted his answer. The typical solution here would be to declare `setData:` and `setData:inPosition:` (btw, as a reader, I have no idea what "inPosition" means. I hope that it makes sense in context). `s...
[ 0.014812826178967953, 0.0017421761294826865, 0.12536436319351196, -0.11526711285114288, -0.15545155107975006, -0.26732125878334045, 0.3149401843547821, -0.11739437282085419, -0.13364297151565552, -0.2659001052379608, -0.5869172215461731, 0.3913559317588806, -0.3618892729282379, -0.26024651...
I have a folder under document\_root in Apache server. When I type in <http://www.example.com/help>, it does not redirect to <http://www.example.com/help/>, but goes to <http://www.exmaple.com//help/>. Note that there are **two slashes** after the domain name. I couldn't find any mod-rewrite rule set up for this kind...
[ 0.08886238187551498, 0.11138410121202469, 0.3268161714076996, 0.005267670843750238, -0.2522006630897522, -0.045715898275375366, 0.6315937638282776, 0.09414540976285934, -0.3975483477115631, -0.6824730634689331, -0.08311548829078674, 0.317886620759964, -0.28631868958473206, 0.30078768730163...
When going through the underscore.js library, i came across ``` for (var i = 0, l = obj.length; i < l; i++) { if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return; } // Establish the object that gets returned to break out of a loop iteration. breaker = {}; ``` why is `return` used at the e...
[ 0.01028879638761282, -0.16932658851146698, 0.23158156871795654, -0.18435969948768616, 0.08787384629249573, 0.1571405678987503, 0.7465997934341431, -0.3028613030910492, 0.029965806752443314, -0.12567725777626038, -0.34306442737579346, 0.391050785779953, -0.35123440623283386, 0.1939052343368...
if `obj` (or a chained [[prototype]]) has the property `prop` (with *any* value, including `undefined`). In this case note the values of `i` are over the range `[0, length)`. The result here is "for each *assigned* index in an array". `iterator` evaluates to a function and is invoked with `call()` so the context (`thi...
[ -0.23960018157958984, -0.07940836995840073, 0.13559922575950623, -0.1449931561946869, 0.005856622476130724, -0.04020881652832031, 0.289358913898468, -0.6756842136383057, -0.15154677629470825, -0.2811044156551361, -0.35297825932502747, 0.37700414657592773, -0.3654089570045471, 0.09779629856...
that iterates over a *sparse array*, passes some additional arguments and allows "early termination". Happy coding.
[ 0.1939971148967743, 0.00010495600872673094, -0.2602245807647705, -0.1338277906179428, 0.16437511146068573, -0.2535240650177002, 0.10526391863822937, -0.1791205257177353, -0.08163303136825562, -0.349199116230011, -0.5258205533027649, 0.36865103244781494, -0.37962663173675537, -0.38175436854...
Is there a way to get the size at runtime ? I need to display the usercontrol in a dialog and need to size the window accordingly Since there are multiple usercontrols, looking for make it generic if possible !! You can use [**SizeToContent**](http://msdn.microsoft.com/en-us/library/system.windows.window.sizetoconten...
[ -0.15652237832546234, -0.07182642817497253, 0.6059029698371887, -0.1552657037973404, -0.15507139265537262, -0.014715849421918392, 0.008412842638790607, -0.20734241604804993, -0.5288603901863098, -0.44524651765823364, -0.006522707175463438, 0.40209370851516724, -0.20341606438159943, 0.15346...
fit the preferred size of your window contents.
[ 0.17379504442214966, 0.2015523910522461, -0.0483749620616436, -0.03000091016292572, -0.13106289505958557, -0.0029289801605045795, -0.003126100404188037, 0.3664826452732086, -0.05697361007332802, -0.6623608469963074, 0.08784444630146027, 0.18095749616622925, -0.07041406631469727, 0.00298495...
I am trying to create a simple Javascript text editor that only makes paragraph breaks to entered paragraphs inside textarea input. while saving textarea input value in database they strip out the paragraph breaks and I also don't want to use all other present text editors because I only need the paragraph breaking (br...
[ -0.022991972044110298, 0.25873279571533203, 0.2146214097738266, -0.27861201763153076, -0.12558506429195404, -0.09577257931232452, 0.5820041298866272, -0.2889273762702942, -0.021400518715381622, -0.618131160736084, -0.22315050661563873, 0.7347661852836609, -0.3962027430534363, 0.08052057027...
// If the user has pressed enter if (key == 13) { alert('enter'); return false; } else { return true; } } </script> ```
[ -0.02373451553285122, -0.013746854849159718, 0.21121925115585327, -0.6513950228691101, 0.4189072549343109, -0.01381375826895237, 0.5224577188491821, -0.16430754959583282, 0.052679624408483505, -0.5222887992858887, -0.6093199849128723, 0.7748401165008545, -0.06952021270990372, -0.1062482595...
I want to change the button content depending on the previous content click. For example, if its `Add` then it should change to `Save`, and if it is `Save` then it should change back to `Add`. I know how to change the content of a button. but how can one *read* the content to make a change? Store the value of last cl...
[ 0.3463802933692932, -0.21190467476844788, 0.6471399664878845, -0.15567277371883392, 0.15394635498523712, 0.14291055500507355, 0.3146340548992157, -0.16334126889705658, -0.3725602328777313, -0.965468168258667, -0.16160131990909576, 0.5229126214981079, -0.48724228143692017, 0.318693250417709...
if(mybutton.Content.ToString() == "Add") { \\ Lines for add mybutton.Content = "Save"; } else { \\ Lines for Save mybutton.Content = "Add"; } } ```
[ 0.16118058562278748, -0.10043419152498245, 0.6798632144927979, -0.3986188769340515, 0.306334912776947, 0.3410422205924988, 0.1065625548362732, -0.16136959195137024, 0.014343724586069584, -0.728139340877533, -0.4308314919471741, 0.40709179639816284, -0.43217945098876953, 0.02904034592211246...
I created a python .py with some sort methods. I'm using numpy so that I can use real arrays. My question is when I go to submit this file to my teacher, is there a dll or something i can include so that he will be able to run the program or will he have to install numpy himself? Is the .py file the only file I should ...
[ 0.3561570942401886, 0.06185419112443924, 0.02164675109088421, 0.22636546194553375, -0.100034698843956, 0.041171856224536896, -0.05580736696720123, 0.1813308149576187, -0.5137826800346375, -0.46075063943862915, -0.16288794577121735, 0.333064466714859, -0.16985417902469635, -0.24962218105793...
To get the command line arguments in x86\_64 on Mac OS X, I can do the following: ``` _main: sub rsp, 8 ; 16 bit stack alignment mov rax, 0 mov rdi, format mov rsi, [rsp + 32] call _printf ``` Where format is "%s". rsi gets set to argv[0]. So, from this, I drew out what (I think) the stac...
[ -0.23582248389720917, 0.2971004247665405, 0.6550360918045044, -0.4456344246864319, 0.005422224290668964, 0.1421649008989334, 0.24391783773899078, -0.3735688030719757, -0.26163238286972046, -0.4885008633136749, -0.31650248169898987, 0.6156220436096191, -0.44018349051475525, -0.0653651356697...
after alignment return address <- rsp at beginning (aligned rsp + 8) [something] <- rsp + 16 argc <- rsp + 24 argv[0] <- rsp + 32 argv[1] <- rsp + 40 ... ... bottom of stack ``` And so on. Sorry if that's hard to read. I'm wondering what [something] is. After a few tests, I f...
[ 0.0019128870917484164, 0.06665923446416855, 0.6056965589523315, -0.46749168634414673, -0.11867405474185944, 0.08475054800510406, 0.20527352392673492, -0.4104187488555908, -0.13166385889053345, -0.456979900598526, -0.05742141604423523, 0.5078122615814209, -0.25346919894218445, 0.21337692439...
is some (seemingly) random number. Also, could you tell me if the rest of my stack drawing is correct? You have it close. `argv` is an array *pointer*, not where the array is. In `C` it is written `char **argv`, so you have to do two levels of dereferencing to get to the strings. ``` top of stack <- ...
[ -0.04361991584300995, 0.1846623420715332, 0.4867212474346161, -0.3308250904083252, -0.07053232192993164, 0.024204596877098083, 0.029244663193821907, -0.2800133228302002, -0.39047032594680786, -0.20901504158973694, -0.00772195914760232, 0.3425332009792328, -0.4216856360435486, 0.17238259315...
+ 24 argv <- rsp + 32 envp <- rsp + 40 (in most Unix-compatible systems, the environment ... ... string array, char **envp) bottom of stack ... somewhere else: argv[0] <- argv+0: address of first parameter (program path or name) argv[1] <- argv+8: address of ...
[ -0.26617464423179626, 0.06711611896753311, 0.5960235595703125, -0.4639417827129364, -0.27403905987739563, 0.295896053314209, 0.15779680013656616, -0.4138461947441101, -0.24567188322544098, -0.3001112639904022, -0.1673872321844101, 0.5136308670043945, -0.5509200096130371, -0.022048534825444...
parameter (first command line argument) argv[2] <- argv+16: address of third parameter (second command line argument) ... argv[argc] <- argv+argc*8: NULL ```
[ -0.35780707001686096, 0.17834605276584625, 0.379180908203125, -0.2973337173461914, -0.20763814449310303, 0.40926387906074524, 0.04173746332526207, -0.5881597995758057, -0.048300668597221375, -0.22452691197395325, -0.018437115475535393, 0.717889130115509, -0.4238746464252472, 0.035857282578...
I have a simple problem but I don't know how to solve it because I have never used functors in C++. I want to do something like that (it is just an example) : ``` class MyClass { void applyFunction(myFunction); /* WRONG SYNTAX */ double *_x; unsigned int *_size; }; void MyClass::applyFunction(myFunction...
[ -0.022498242557048798, 0.13828638195991516, 0.42340153455734253, -0.3633422255516052, 0.22697436809539795, -0.18895795941352844, 0.3773520886898041, -0.34866321086883545, 0.09147705137729645, -0.6384297013282776, -0.22097744047641754, 0.6307907104492188, -0.6606781482696533, 0.006703544873...
std::vector _v; }; void OtherClass::myFunction1(double x, double lim) { _v.clear(); if (x > lim) _v.push_back(x); } void OtherClass::myFunction2(double x, double lim) { _v.clear(); if (x < lim) _v.push_back(x); } int main() { MyClass myClass; OtherClass otherClass; myClass...
[ -0.23698790371418, -0.13427583873271942, 0.6590515375137329, -0.530694305896759, 0.2677766978740692, 0.25717881321907043, 0.2352542281150818, -0.1955670565366745, -0.25332650542259216, -0.4536415934562683, -0.46096718311309814, 0.5238986611366272, -0.4544682502746582, 0.030609067529439926,...
use functors/std::functions ? Thank you very much ! I'll take you at your word that you want to use functors for this. Just for grins, I'll also assume you want to do this the "right" way, not just find a syntax that will let it compile (and probably run, perhaps doing what you wanted). In this case, the standard lib...
[ 0.24563510715961456, 0.03636618331074715, 0.03562122583389282, 0.2965089976787567, -0.23004119098186493, -0.21399372816085815, -0.03440937399864197, -0.022654090076684952, -0.2941259443759918, -0.6388702988624573, -0.18017078936100006, 0.8583555221557617, -0.49074339866638184, -0.527088165...
and use `std::remove_copy_if`). Using this, your code becomes something like this: ``` template <class T> class less_than { T limit; public: less_than(T lim) : limit(lim) {} bool operator()(T const &val) { return val < limit; } }; std::copy_if(source.begin(), source.end(), std...
[ 0.3490433096885681, -0.030718794092535973, 0.3821304142475128, -0.42962419986724854, 0.2530342936515808, -0.20539875328540802, -0.11880799382925034, -0.42496925592422485, -0.11707251518964767, -0.4627765715122223, -0.2589742839336395, 0.8999758958816528, -0.5206479430198669, -0.00721877673...
source.end(), std::inserter(target), [](int v) { return v < 10;}); ``` The lambda is basically just a way of getting the compiler to generate an anonymous functor class for you, so there's not much real difference between the two, but the lambda obviously saves quite a bit of typing. If y...
[ 0.342708021402359, -0.04373050853610039, 0.09304909408092499, -0.17204177379608154, -0.06582147628068924, -0.14399196207523346, 0.04981451481580734, -0.3826502859592438, -0.028341980651021004, -0.21343709528446198, 0.17307589948177338, 0.8775554299354553, -0.5075876116752625, -0.0701814293...
T limit; public: bool operator()(T const &val) { return val > limit; } }; std::remove_copy_if(src.begin(), src.end(), std::back_inserter(dst), greater_than(10)); ``` Alternatively, you could write your own `copy_if` pretty easily -- it was...
[ 0.11308027803897858, 0.04237772896885872, 0.49451911449432373, -0.34261929988861084, 0.40425437688827515, -0.2125135064125061, 0.19722877442836761, -0.27018606662750244, -0.0824136808514595, -0.1592033952474594, -0.3627993166446686, 0.7276483774185181, -0.44175538420677185, 0.3352365791797...
out of C++98/03 mostly by oversight, not because it needs anything the language doesn't provide, or anything like that (though as I recall, getting all the border conditions exactly right can be a little tricky). For what it's worth, I should also note that the standard library does have `std::less` and `std::greater`...
[ -0.03494827821850777, 0.22782346606254578, 0.32532864809036255, -0.20603197813034058, -0.15576057136058807, -0.4190722107887268, 0.1499084234237671, -0.30350416898727417, -0.17719246447086334, -0.48541104793548584, -0.10817436128854752, 0.6983790993690491, -0.6003963947296143, 0.0566382333...
src.end(), std::ostream_iterator<int>(std::cout, "\n"), std::bind1st(std::less<int>(), 10)); ```
[ -0.41678690910339355, 0.09501150995492935, 0.834264874458313, -0.4339769184589386, 0.23248112201690674, 0.15618811547756195, 0.22261305153369904, -0.1470707505941391, -0.09883357584476471, -0.5499712824821472, -0.41051456332206726, 0.5382318496704102, -0.2910265326499939, 0.133995130658149...
Doing a mysqli query and COUNTing the results, is there a preferred comparison operator & string enquoting to use? For example ``` $query = mysqli_query($connect, "SELECT COUNT(`user_id`) FROM `users` WHERE `user_color` = '{$color}'"); $result = mysqli_fetch_assoc($query); if ($result['COUNT(`user_id`)'] != 0){ -- t...
[ -0.12494487315416336, 0.004421036224812269, 0.18511557579040527, 0.12462857365608215, -0.26037439703941345, 0.10688554495573044, 0.09670498967170715, -0.39744308590888977, 0.05770557001233101, -0.5382938385009766, -0.08557763695716858, 0.5525777339935303, -0.2539736032485962, -0.2006927579...
I may not understand what the return statement does(I thought it just returned a variable and allowed me to exit the loop). I'm trying to get a better understanding of recursions but this never seems to exit. ``` import java.util.Arrays; import java.util.List; public class main { public static void main(String[]...
[ 0.056856296956539154, 0.09662014991044998, 0.4147702157497406, -0.4065578281879425, 0.06676929444074631, 0.3818661570549011, 0.11365000158548355, 0.1169966459274292, -0.6901696920394897, -0.45197537541389465, -0.32360008358955383, 0.531950831413269, -0.31302908062934875, 0.465742290019989,...
"Prunes", "Pears", "cherries", "Peaches", "Apples"}; System.out.println(list_to_start.size()); counter(list_to_start.size(), list_to_start, name_of_list_to_start); } private static void counter(int length, List<Integer> list_to_start, String[] name_of_list_to_start) { // TODO Aut...
[ 0.15457764267921448, -0.16437658667564392, 0.12197771668434143, -0.46422064304351807, 0.003000914119184017, 0.4175202250480652, 0.22350476682186127, -0.3580678403377533, -0.18491433560848236, -0.28751274943351746, -0.2655009627342224, 0.4788803458213806, -0.40500354766845703, 0.54031622409...
= 0; i>=list_to_start.size(); i++) { System.out.println(name_of_list_to_start[i] + " = " + list_to_start.get(i)); } return; } Integer x_lenght = (Integer) list_to_start.get(length-1); for (int i = 0; i<=5; i++) {
[ -0.2838183641433716, -0.2918427288532257, 0.7129551768302917, -0.45603740215301514, 0.15477460622787476, 0.003818793687969446, 0.21297384798526764, -0.3875409662723541, -0.3260895311832428, -0.4157015085220337, -0.5564048290252686, 0.46887877583503723, -0.36173006892204285, 0.2329117059707...
//System.out.println(i); if (length != 0 ) { list_to_start.set((length-1), i); counter((length-1), list_to_start, name_of_list_to_start); list_to_start.set((length-1), 0); } } } } ``` Basically what I'm trying to do is,
[ 0.13177698850631714, -0.19276456534862518, 0.4272204339504242, -0.4432234764099121, 0.21192798018455505, -0.13998854160308838, 0.11883188039064407, -0.31281498074531555, -0.23762984573841095, -0.5312325954437256, -0.3017239570617676, 0.5476804375648499, -0.4094012975692749, 0.2945027053356...
using a recursion, figure out all the combinations of 0-5 for 10 different fruits(this is just for me to learn, not homework..not a student). Any idea what I'm doing wrong? Why is this program not stopping with the return statement? update: in case anyone ever has the same problem, here's the working version of the a...
[ -0.01998146064579487, 0.24168317019939423, 0.08213328570127487, -0.34963658452033997, 0.07332456111907959, 0.2365640550851822, 0.41023072600364685, -0.28595003485679626, -0.5318239331245422, -0.4045295715332031, -0.20519335567951202, 0.4787190854549408, -0.37844711542129517, 0.178630560636...
0, 0, 0, 0, 0, 0, 0}); String[] name_of_list_to_start = new String[] {"grapes", "Strawberries", "Raspberries", "Blackberries", "Pineapples", "Oranges", "Prunes", "Pears", "cherries", "Peaches", "Apples"}; System.out.println(list_to_start.size()); counter(list_to_start.size(), list_to_sta...
[ -0.037552610039711, -0.014608468860387802, 0.3862910568714142, -0.31227678060531616, 0.18602553009986877, 0.38568243384361267, 0.2674725353717804, -0.3644846975803375, -0.24101905524730682, -0.2317877858877182, -0.43123358488082886, 0.47381240129470825, -0.43574634194374084, 0.446345508098...
//System.out.println("List is empty now"); for (int i = 0; i<list_to_start.size(); i++) { //(name_of_list_to_start[i] + " = " + list_to_start.get(i)); int k = i +2; int y = k -1;
[ -0.18740959465503693, -0.3481481969356537, 0.567095160484314, -0.4946904480457306, 0.25904449820518494, 0.039892032742500305, 0.23668979108333588, -0.29886394739151, -0.28906771540641785, -0.4513680636882782, -0.555895209312439, 0.37330275774002075, -0.3539902865886688, 0.34407010674476624...
} //System.out.println("********"); return; } Integer x_lenght = (Integer) list_to_start.get(length-1); for (int i = 0; i<=5; i++) { //System.out.println(i); if (length != 0 ) {
[ -0.09971457719802856, -0.2922079265117645, 0.5268805623054504, -0.4435208737850189, 0.09693723917007446, 0.19277071952819824, 0.23318535089492798, -0.3789679706096649, -0.2650057375431061, -0.42952537536621094, -0.36949920654296875, 0.5790954828262329, -0.355339914560318, 0.194391012191772...
list_to_start.set((length-1), i); counter((length-1), list_to_start, name_of_list_to_start); list_to_start.set((length-1), 0); } } } } ``` Both are same, php takes care of string and number. Internally functionality of php interpreter: If you compare a number wi...
[ -0.09900014102458954, -0.09069498628377914, 0.3787202537059784, -0.08283684402704239, -0.26835671067237854, 0.07490525394678116, 0.010591362603008747, -0.5668498873710632, -0.1853737235069275, -0.58351069688797, 0.026156064122915268, 0.46443477272987366, -0.25065308809280396, -0.0264009330...
each string is converted to a number and the comparison performed numerically.
[ -0.05164102464914322, 0.09498333185911179, 0.1092645525932312, 0.07246118783950806, 0.012828578241169453, 0.4331345856189728, -0.02939748950302601, -0.3715178072452545, 0.14845728874206543, -0.3291143476963043, -0.28438523411750793, 0.06000824645161629, -0.06772957742214203, 0.192678377032...
I have an inelegant solution for what I need, but am looking for an elegant solution to replace it. The following code doesn't compile, but represents what I would like to do: ``` interface IWebService { } abstract class BaseClient<T> { } class SpecializedClient : BaseClient<IWebService> { } class ClientHelper<T> ...
[ -0.2873997688293457, -0.060314591974020004, 0.2819206714630127, -0.12234649807214737, -0.13827139139175415, 0.012728717178106308, -0.07720265537500381, -0.00708148954436183, -0.15566964447498322, -0.8603518605232239, 0.2944864332675934, 0.3637676537036896, -0.4741573631763458, 0.2539113163...
F, G> ``` All the way down to the base class that takes a single type. Is this simply the cost of having a complex inheritance tree of generic classes or is there a simpler way to do this while retaining type restrictions on the templated types? Your "inelegant" solution is the right one if the public interface of Ba...
[ -0.0035274478141218424, -0.21289247274398804, 0.17736342549324036, 0.14256055653095245, 0.004926928784698248, -0.04194142296910286, -0.03645367547869682, -0.3506409227848053, -0.0252775140106678, -0.5474943518638611, -0.1959882527589798, 0.7766565680503845, -0.5450560450553894, -0.06558696...
`ClientHelper` (again, assuming that `BaseClient<U>` is exposed via the interface of ClientHelper). On the other hand, let's assume it actually is as your example puts it: ``` abstract class BaseClient<T> { //Nothing about T here } ``` In that case, you can do: ``` interface IBaseClient { //Nothing about T h...
[ -0.07884283363819122, 0.05203330144286156, 0.2707211673259735, -0.23517654836177826, -0.1735570877790451, -0.23237170279026031, -0.09021346271038055, 0.2290719449520111, -0.2941562533378601, -0.6826316118240356, 0.054058440029621124, 0.6279006004333496, -0.41592079401016235, 0.215120613574...
I have a basic iPad app created using MonoTouch. I have a single view controller. In code I am adding a button like this: ``` _button = UIButton.FromType(UIButtonType.RoundedRect); _button.Frame = new Rectangle((int)location.X - 50, (int)location.Y - 50, 100, 100); _button.SetTitle("A", UI...
[ 0.17496387660503387, -0.05091197416186333, 0.8038493990898132, -0.2796329855918884, -0.08279311656951904, 0.3176020383834839, 0.2985921800136566, -0.39404046535491943, -0.16754841804504395, -0.8551298975944519, 0.24059930443763733, 0.610630989074707, -0.5768465399742126, 0.0588941164314746...
rotated. For example if the orientation is currently LandscapeLeft (hardware button on the left side) then when I add the above button the letter A on the button is laying on its right side as if the button is rotated 90 degrees to the right. How do I add a button in code so that it will always be oriented correctly?...
[ 0.3136950135231018, -0.18701185286045074, 0.9029945731163025, -0.1988941729068756, 0.002895892132073641, 0.2360379993915558, -0.29615193605422974, -0.03613482788205147, -0.6904275417327881, -0.6415349841117859, 0.3011370003223419, 0.6418434381484985, -0.22007721662521362, 0.214588448405265...