text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I've just become a proud owner of a MediaTemple virtual-dedicated server. My question is: How can I forward a port to redirect it to a directory? For example, I would like to redirect port `6783` (e.g., `http://www.imagreedybastard.com:6783`) to the directory `/usr/directories/admin/`
This depends on your web server. F... | [
-0.13302898406982422,
0.2575097978115082,
0.8004738688468933,
-0.015537219122052193,
-0.1070365235209465,
-0.19633711874485016,
0.3630285859107971,
-0.10986438393592834,
-0.2564300000667572,
-0.8413585424423218,
-0.06147026643157005,
0.6452053189277649,
0.06755871325731277,
0.6006060242652... | |
Some of our projects are still on cvs. We currently use tar to backup the repository nightly.
Here's the question:
best practice for backing up a cvs repository?
Context: We're combining a several servers across the country onto one central server. The combined repsitory size is 14gb. (yes this is high, most likely ... | [
0.5129650235176086,
-0.11934555321931839,
0.0983189269900322,
0.24160116910934448,
0.014429752714931965,
0.08388880640268326,
0.2535507380962372,
-0.07233481854200363,
-0.3694983422756195,
-0.21712630987167358,
-0.042340945452451706,
0.8411965370178223,
0.16643935441970825,
0.0107343262061... | |
backup, nightly incremental backups? What open source tools solve this problem well? (e.g. Amanda, Bacula).
thanks,
bill
You can use rsync to create backup copy of your repo on another machine if you don't need history of backups. rsync works in incremental mode, so bandwidth will be consumed only for sending changed... | [
0.43641191720962524,
-0.09369440376758575,
0.4233587384223938,
0.33306753635406494,
-0.3575400114059448,
0.08206519484519958,
0.20079581439495087,
0.04188020899891853,
-0.7226938009262085,
-0.42890727519989014,
0.02843080647289753,
0.9897226095199585,
-0.051131706684827805,
-0.022330103442... | |
as I know, ZFS from Solaris also has snapshots feature.
You don't need snapshots if and only if you run backup procedure deeply at night when noone touches your repo and your VCS daemon is stopped during backup :-) | [
0.3414130210876465,
-0.249507337808609,
0.639923632144928,
0.27935612201690674,
0.10701629519462585,
-0.2627992331981659,
0.18670664727687836,
-0.04725990071892738,
-0.4745514392852783,
-0.7337961792945862,
-0.3285766839981079,
0.792148768901825,
-0.10792659223079681,
-0.11659505218267441,... | |
So far I've built a simple form for a user using the `form_for` method to wrap around my user model.
But if I'm going to create a form now which doesn't doesn't map directly to any particular model, should I still be using `form_for`?
You probably just want [`form_tag`](http://api.rubyonrails.com/classes/ActionView/He... | [
0.5880865454673767,
-0.39620062708854675,
0.2572097182273865,
-0.18186886608600616,
-0.01729579269886017,
0.07021083682775497,
0.5143944621086121,
-0.24657081067562103,
-0.3593948185443878,
-0.370245099067688,
0.1299935132265091,
0.48274314403533936,
-0.2352859228849411,
-0.092079728841781... | |
In the very common scenario where you have a textbox, and some kind of validation rule which constraints the valid entries on that textbox. How should a failing validation affect the content of the textbox especially in the case when there originally was a valid value entered before the invalid.
Example: Imagine a for... | [
0.23660944402217865,
0.03864356502890587,
0.25788283348083496,
0.3079828917980194,
0.1623992621898651,
-0.13629044592380524,
0.3814278542995453,
-0.23991212248802185,
-0.41669633984565735,
-0.46587836742401123,
-0.049371086061000824,
0.3331707715988159,
-0.19877438247203827,
0.177659749984... | |
there should be a way back to the 40 as an easy way to a valid state, but I'm not sure when and how to revert it: On focus lost? Only on a special key/ button press?
What do you think?
Edit: I absolutely agree with the first two answers: changing the input automatically is a bad idea. Yet I would like to keep the 'la... | [
0.3019353747367859,
0.16875162720680237,
0.3556393086910248,
0.013177511282265186,
0.012636491097509861,
0.12157484889030457,
0.2477218210697174,
-0.14687664806842804,
-0.23779994249343872,
-0.2847362458705902,
-0.22302263975143433,
0.8996189832687378,
-0.026540027931332588,
-0.17372380197... | |
the user is invalid, flag it as such - but don't change the value.
The reasoning behind you is simple - consistency.
Consider, for example, a pair of fields used for entry of a date range where "valid" means that the start date is before the end date.
Now, the user wants to enter a completely new range.
If your sys... | [
0.13107198476791382,
0.3163643181324005,
0.1650061160326004,
0.10537558794021606,
0.007430606987327337,
-0.2685520648956299,
0.383388876914978,
0.03836164250969887,
-0.40106627345085144,
-0.41671839356422424,
-0.33565953373908997,
0.41605815291404724,
-0.092636339366436,
0.5710723996162415... | |
input - when the start date is entered, freely flag it as invalid, *but leave the value in place*. Then, when the final date is entered, both fields now validate.
This is also motivation for displaying validation dynamically (as values are changed), but for not limiting the users movement between fields. | [
-0.13198643922805786,
0.1663835346698761,
0.34474340081214905,
0.06672798097133636,
-0.0032516566570848227,
-0.22124548256397247,
0.23477225005626678,
-0.014724476262927055,
-0.12970054149627686,
-0.2853296995162964,
-0.44160687923431396,
-0.0054549966007471085,
-0.036521025002002716,
0.10... | |
Everytime UIView's drawRect is called, the content drawn by previous drawRect (using Core Graphics) is cleared out. How can I make it so that the paths rendered from previous drawRect calls stay until I explicitly clear it?
You basically need to clip the 'dirty' part of your rect where changes have been made, and only ... | [
0.5846385359764099,
-0.08214951306581497,
0.8608807921409607,
0.11238767206668854,
0.060466218739748,
-0.360012948513031,
0.23634134232997894,
-0.28030630946159363,
0.05176510289311409,
-0.8397319912910461,
-0.18086929619312286,
0.6454905271530151,
-0.4211917221546173,
0.1279001235961914,
... | |
Is the Northwind Starter Kit from Codeplex a good starting point to learn more about how to best architect an ASP.NET application?
Is there something similar for the AdventureWorks database examples?
[update] **[Bitbucket stopped hosting Mercurial](https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket).... | [
0.22058619558811188,
-0.3035401403903961,
0.5078413486480713,
0.04025397449731827,
-0.21895626187324524,
-0.1789955198764801,
0.017344241961836815,
0.17410357296466827,
-0.26869145035743713,
-0.38742613792419434,
0.058565378189086914,
0.5256637334823608,
0.03973570093512535,
0.018989270552... | |
I'm writing a web form for my Ruby on Rails app. The form has a text field, some checkboxes, a set of radio buttons and two text boxes.
What are the pluses and minuses of using GET over POST and vice versa. I always thought you should use GET for retrieving the form and POST for submitting, but I've just learnt you c... | [
0.704336941242218,
0.08140864968299866,
0.45659321546554565,
0.07363447546958923,
-0.15802797675132751,
-0.04609781876206398,
0.37853220105171204,
-0.16281649470329285,
0.146725133061409,
-0.7396238446235657,
-0.05187529698014259,
0.4013347327709198,
-0.010161441750824451,
0.06925500184297... | |
As you note both can be used to retrieve and send data, but there are some distinctions:
1. As GET is sent with the URL you are limited in size to the maximum length of the query string. This varies from browser to browser, but is usually at least around 2000 characters (on modern browsers). This usually makes it inap... | [
0.11898277699947357,
-0.3306236267089844,
0.6033584475517273,
0.020074544474482536,
-0.3667859137058258,
-0.15621736645698547,
0.21687810122966766,
-0.09246507287025452,
-0.3233664035797119,
-0.5730571746826172,
-0.37422847747802734,
0.3594321608543396,
-0.0051826960407197475,
-0.230479329... | |
to bookmark a specific page, assuming your page will work with some state variables stored.
4. POST is usually more appropriate for sending data, as it is suits the nature of a request, mostly because of the limitations of the above. | [
0.4196837842464447,
-0.17358602583408356,
0.44747409224510193,
0.2005084753036499,
-0.2676384747028351,
-0.32603830099105835,
-0.011164137162268162,
-0.13072790205478668,
-0.10181336849927902,
-0.5705864429473877,
-0.254926472902298,
0.15555688738822937,
-0.15067434310913086,
-0.0842793658... | |
I have an array in this format:
```
Array
(
[0] => Array
(
[28th February, 2009] => 'bla'
)
[1] => Array
(
[19th March, 2009] => 'bla'
)
[2] => Array
( | [
-0.021253956481814384,
0.11420469731092453,
0.6021347641944885,
-0.3946351706981659,
-0.3199769854545593,
0.1960902214050293,
0.23978978395462036,
-0.23018532991409302,
-0.1678568720817566,
-0.5325961112976074,
0.06376943737268448,
0.40235430002212524,
-0.21240770816802979,
0.2154802978038... | |
[5th April, 2009] => 'bla'
)
[3] => Array
(
[19th April, 2009] => 'bla'
)
[4] => Array
(
[2nd May, 2009] => 'bla'
)
)
```
I want to | [
0.6136484146118164,
-0.16063763201236725,
0.4382397532463074,
-0.3657377064228058,
0.20284748077392578,
0.18309421837329865,
0.5961570143699646,
-0.061697155237197876,
-0.17452853918075562,
-0.02228275127708912,
-0.17239713668823242,
0.3801475763320923,
-0.3737945556640625,
-0.138298124074... | |
sort them out in the ascending order of the dates (based on the month, day, and year). What's the best way to do that?
Originally the emails are being fetched in the MySQL date format, so its possible for me to get the array in this state:
```
Array
[
['2008-02-28']='some text',
['2008-03-06']='some text'
]
... | [
-0.07903610169887543,
0.024627113714814186,
0.5683384537696838,
-0.02506170980632305,
-0.063411645591259,
0.2727701663970947,
-0.006990964990109205,
-0.10296768695116043,
-0.5533137321472168,
-0.49635493755340576,
0.14279139041900635,
0.07450257241725922,
-0.06059734895825386,
0.1331985145... | |
be doing 3 loops with this per user.
Thanks.
Edit: I could also do this:
```
$array[$index]=array('human'=>'28 Feb, 2009',
'db'=>'20080228',
'description'=>'Some text here');
```
But using this, would there be any way to sort the array based on the 'db' element alone?
Edit 2:... | [
0.42702239751815796,
0.10673750191926956,
0.2667073905467987,
-0.06586296856403351,
-0.12107247859239578,
-0.04278777167201042,
0.651157796382904,
-0.43900468945503235,
-0.13767069578170776,
-0.34702780842781067,
-0.12490169703960419,
0.3438989222049713,
-0.6907618045806885,
-0.08980702608... | |
need to remove the hyphens, `ksort` will do an alphanumeric comparison on the string keys, and the `yyyy-mm-dd` format works perfectly well as the lexical order is the same as the actual date order.
**EDIT** I see you've now corrected your question to show that you've actually got an array of arrays, and that the sort... | [
0.11701087653636932,
0.2344336360692978,
0.44603782892227173,
-0.1031755730509758,
-0.07340021431446075,
0.297955185174942,
0.230436310172081,
-0.20998577773571014,
-0.2266693264245987,
-0.5287310481071472,
-0.4997345805168152,
0.553091287612915,
-0.32902368903160095,
0.008776243776082993,... | |
global $array;
return strcmp($array[$a]['db'], $array[$b]['db']);
}
uksort($array, 'cmp');
``` | [
-0.45889049768447876,
-0.02515419013798237,
0.5866580009460449,
-0.22487647831439972,
0.02052951231598854,
0.19921065866947174,
0.23936688899993896,
0.06562250852584839,
-0.27697157859802246,
-0.35360187292099,
-0.5196492671966553,
0.20759271085262299,
-0.3644978106021881,
0.24130640923976... | |
a task at my hand requires me to move an ASP application from one server to another. For this, I need two command line tool like stuff to know the following info.
1. Get the list of com objects used in this asp project.
2. Get the list of registered com objects in my existing server.
Any Idea ?
A quick search for "Cr... | [
0.3038334250450134,
-0.1741122156381607,
0.28364232182502747,
0.04511444643139839,
-0.2638065814971924,
-0.04316161945462227,
0.1560373604297638,
-0.029388263821601868,
-0.5088791847229004,
-1.057200312614441,
0.07940983027219772,
0.47154369950294495,
-0.030696388334035873,
0.1257614195346... | |
then you should also look for "ActiveXObject".
I expect you could extract this info with commandline tools like grep etc, but unless you are doing this over and over again on different setups then it would almost certainly be quicker to do in VS.NET or something like [Agent Ransack](http://www.mythicsoft.com/agentrans... | [
0.2614871561527252,
-0.35660257935523987,
0.039186783134937286,
0.3498164713382721,
0.07438887655735016,
-0.18081970512866974,
0.2902844250202179,
0.23063449561595917,
-0.406910240650177,
-0.8339344263076782,
-0.08385831862688065,
0.5043317675590515,
-0.2665294408798218,
-0.190062329173088... | |
<https://developer.mozilla.org/en/JavaScript_shells> lists quite a few shells. What is there to choose between them.
I always use the command line tool in firebug to test snippets, there is an option "larger command line" for multiline code, so be sure to enable it. CTRL+SHIFT+L is the shortcut for opening the command ... | [
0.293613463640213,
0.00022143276873975992,
0.12153095006942749,
-0.1603870689868927,
0.13190974295139313,
0.10400260239839554,
-0.17475394904613495,
0.21644963324069977,
-0.18627683818340302,
-0.6388993859291077,
0.11814641952514648,
0.8096322417259216,
-0.10649318248033524,
-0.36793014407... | |
I am trying to return Xml value from SQL Server 2005 using For Xml. Is there any limit in the size of xml returned from SQL Server?
I will be using ExecuteXmlReader to get the value in my C# code.
Also, is there any limit on the data that can hold in an XmlReader?
Any thoughts...
There is no *practical* limit, but ... | [
0.09774302691221237,
0.21712343394756317,
0.3367770314216614,
-0.10976209491491318,
-0.12415649741888046,
-0.02618597447872162,
0.28499436378479004,
-0.002496871864423156,
-0.2667619585990906,
-0.5138840675354004,
0.23276831209659576,
0.5238894820213318,
-0.05303661897778511,
0.20106187462... | |
limit, that you need to worry about. | [
0.32539692521095276,
-0.133629709482193,
0.33436349034309387,
0.2534886598587036,
0.2298053801059723,
-0.30455783009529114,
-0.0950879156589508,
-0.13622578978538513,
-0.35192859172821045,
-0.40314772725105286,
0.37291935086250305,
0.7764684557914734,
-0.2108582705259323,
-0.09885497391223... | |
I am generating editable data grids from tables using dynamic data, however, i am unable to set the width of the tables/grids.
Can someone please point me to an article/ or suggest how i can do this?
Thanks in advance.
Regards.
Kulu.
Styles are applied to the pages generated by DynamicData with CSS. By Default the ... | [
0.5951359272003174,
-0.1611258089542389,
0.5396225452423096,
-0.04856251925230026,
-0.3738138675689697,
-0.019615648314356804,
0.1090080738067627,
0.1576804518699646,
-0.31705552339553833,
-0.911791980266571,
0.0840056911110878,
0.4566921591758728,
-0.16499948501586914,
0.07971977442502975... | |
you are looking for). If you would like to change the width for just one entity/page you should probably make a Custom Page for that entity.
Steps
1. Create a new Folder within the ~/DynamicData/CustomPages directory with the same name as the EntitySet/Collection of your entity (ex: ~/DynamicData/CustomPages/Employee... | [
0.6258426904678345,
-0.41461408138275146,
0.5854744911193848,
0.10381441563367844,
-0.18440799415111542,
-0.14564338326454163,
0.09044568985700607,
-0.32027605175971985,
-0.4213591516017914,
-0.849130392074585,
0.009428830817341805,
0.5690083503723145,
0.007375727407634258,
0.0267947148531... | |
I want to search div id in an html doc with certain pattern.
I want to match this pattern in regex:
```
foo_([[:digit:]]{1.8})
```
using xpath. What is the xpath equivalent for the above pattern?
I'm stuck with `//div[@id="foo_` and then what? If someone could continue a legal expression for it.
**EDIT**
Sorry, ... | [
0.1126556545495987,
0.19890575110912323,
0.28274667263031006,
-0.19486136734485626,
-0.22665658593177795,
-0.16100101172924042,
0.6333733797073364,
-0.32817891240119934,
-0.00916915200650692,
-0.46637162566185,
0.020371317863464355,
0.6227311491966248,
-0.3201961815357208,
0.25592198967933... | |
0 and substring-after(@id, "post_message_") <= 99999999]`' (Nokogiri::XML::XPath::SyntaxError)
How about this (updated):
XPath 1.0:
```
"//div[substring-before(@id, '_') = 'foo'
and substring-after(@id, '_') >= 0
and substring-after(@id, '_') <= 99999999]"
```
Edit #2: The OP made a change to the qu... | [
-0.2479398101568222,
0.22247330844402313,
0.6161293983459473,
-0.31378477811813354,
-0.22396820783615112,
0.021551191806793213,
0.2132507562637329,
-0.34324491024017334,
0.15636922419071198,
-0.5293635129928589,
-0.24687881767749786,
0.7085979580879211,
-0.3994811177253723,
-0.186468660831... | |
the numerical expression (XPath 1.0 style) to perform better than the regex test, though this would only become noticeable when processing large data sets.
---
Original version of the answer:
```
"//div[substring-before(@id, '_') = 'foo'
and number(substring-after(@id, '_')) = substring-after(@id, '_')
... | [
-0.13664966821670532,
0.2732665538787842,
0.1523183286190033,
-0.0962953269481659,
-0.2692164480686188,
0.3205268085002899,
0.2926848828792572,
-0.37188011407852173,
0.1740192472934723,
-0.32124102115631104,
-0.025274138897657394,
0.7292258143424988,
-0.056338630616664886,
0.05236449465155... | |
I also removed the encoding of the angle brackets, since this is an XML requirement, not an XPath requirement. | [
0.5141369104385376,
0.17378690838813782,
0.3660860061645508,
-0.11694921553134918,
-0.1336890310049057,
-0.054352063685655594,
-0.27810364961624146,
-0.4054447412490845,
0.20592907071113586,
-0.3762350380420685,
0.09198489040136337,
0.4216982424259186,
-0.041761886328458786,
0.107024013996... | |
I have a sketch pad made in Flash AS3 like this one here: <http://henryjones.us/articles/using-the-as3-jpeg-encoder>
I want to send the jpg to the server and some data from a html form field with php. Is there a way to force the Flash movie to deliver the image file when one presses the submit button?
it's a little tr... | [
0.3486981987953186,
0.023705311119556427,
0.30733439326286316,
0.050378479063510895,
-0.21210776269435883,
0.1863933503627777,
0.051740895956754684,
-0.1841721534729004,
-0.2876831591129303,
-0.6042564511299133,
0.0847000926733017,
0.5032901167869568,
-0.08339088410139084,
-0.1203159838914... | |
done:
>
>
> bytes = 'Content-Disposition:
> form-data; name="' + $fieldName + '";
> filename="';
>
>
> It does the most formatting of headers
> so the server could understand it as a
> file upload.
>
>
> By the way, if you have a BitmapData
> you might need to encode it to JPEG or
> PNG first.
And I usuall... | [
0.3153349459171295,
-0.37426918745040894,
0.4212786555290222,
0.009698070585727692,
-0.3066406548023224,
-0.301582008600235,
0.21442332863807678,
-0.29457759857177734,
-0.11591549217700958,
-0.5373521447181702,
-0.13581494987010956,
0.4713599681854248,
-0.3565616011619568,
-0.0140372896566... | |
var jpgEncoder:JPGEncoder = new JPGEncoder(85);
var jpgStream:ByteArray = jpgEncoder.encode(bmpData);
var loader:URLLoader = new URLLoader();
configureListeners(loader);
var header:URLRequestHeader = new URLRequestHeader("Content-type", "application/octet-stream");
var request:URLRequest = new... | [
-0.21175804734230042,
-0.08127127587795258,
0.8776882290840149,
-0.08591804653406143,
-0.2221568375825882,
0.24399226903915405,
0.3014185130596161,
-0.42416176199913025,
-0.3119565546512604,
-0.38988083600997925,
-0.39210453629493713,
0.41626134514808655,
-0.35129669308662415,
0.3389378488... | |
the request's data property, which we are already using to pass the byteArray. | [
0.1606927365064621,
-0.09405001252889633,
0.6630968451499939,
0.217565655708313,
0.11914487928152084,
-0.12175479531288147,
-0.039573751389980316,
-0.11262285709381104,
-0.0015894415555521846,
-0.4317752420902252,
0.07932867854833603,
0.46674081683158875,
0.09810414165258408,
0.28721851110... | |
how do i access the procedure parameters inside the same procedure using a query
for example: see this procedure
```
procedure game(left in tab.left%type,right in tab.right%type,...)
is
--some local variables
begin
merge into tgt_table
using subquery --(here is what i need to use the parameters)
on some ... | [
-0.18159236013889313,
-0.3669363856315613,
0.3558729588985443,
0.07947303354740143,
0.07438726723194122,
-0.14402234554290771,
-0.04120473191142082,
-0.2700350284576416,
-0.25496360659599304,
-0.7862237691879272,
0.06865380704402924,
0.5370267629623413,
-0.3231808543205261,
0.2378446161746... | |
either updates or inserts into the table based on the condition given.
Help me please. Thanks in advance
You would need to use dynamic SQL if your parameters define the table to use - something like:
```
procedure game(left in tab.left%type,right in tab.right%type,...)
is
--some local variables
l_sql l... | [
0.002754769753664732,
-0.36676111817359924,
0.44616565108299255,
0.03052491880953312,
0.2157047837972641,
-0.11199908703565598,
0.06872914731502533,
0.08399917930364609,
-0.20136450231075287,
-0.5984365344047546,
-0.12448165565729141,
0.6238702535629272,
-0.5270736813545227,
0.093988232314... | |
some condition'
|| ' when matched then'
|| ' update ' || right
|| ' when not matched then'
|| ' insert the table';
execute immediate l_sql;
end game;
```
However, you have a lot more work left to do, since the condition, update | [
-0.04175211861729622,
0.02055245451629162,
0.26701509952545166,
-0.072911337018013,
0.28631603717803955,
-0.4499126076698303,
0.32841259241104126,
0.07043858617544174,
0.1695222407579422,
-0.6130775213241577,
-0.3747316300868988,
0.5859407782554626,
-0.4864875078201294,
0.1560700535774231,... | |
and insert clauses all need to change according to the tables being used. I'm not convinced this procure will be particularly useful in fact. | [
0.39465847611427307,
0.25264352560043335,
0.09171130508184433,
0.1788036972284317,
0.3653899133205414,
0.271793007850647,
0.04455966502428055,
0.006237047258764505,
-0.013325138948857784,
-0.4633490741252899,
0.09137450158596039,
0.6265167593955994,
-0.1424061805009842,
0.01522458996623754... | |
I'm trying to convert an Image object to a byte array then back to an Image (so that I can store the image in a blob object in an Apache Derby Database).
I can convert an Image to a byte array (code below) but I cann't convert the bytes back to an image. As a further complication I'm using J2ME, so I can't use javax.i... | [
0.32783040404319763,
-0.2634134888648987,
0.6652140021324158,
-0.15209831297397614,
-0.27662086486816406,
0.35684069991111755,
0.5368643403053284,
-0.5217313766479492,
0.0653734803199768,
-0.8841913342475891,
-0.22587069869041443,
0.9249792098999023,
-0.700207531452179,
0.12397265434265137... | |
this.mediaTracker = new MediaTracker(this);
this.mediaTracker.addImage(image, 0);
this.image = image;
}
private BufferedImage convert()
{
/*
* Have to wait for image to load.
*/
try
{
this.mediaTracker.waitForID(0);
}catch(InterruptedException e)
{
}
System.out.pr... | [
-0.2500547766685486,
-0.43796008825302124,
0.8907850980758667,
-0.18876075744628906,
-0.06657350063323975,
0.23924042284488678,
0.25082939863204956,
-0.3285733163356781,
-0.2805494964122772,
-0.797083854675293,
-0.21438917517662048,
0.6525444388389587,
-0.46872639656066895,
0.1390027254819... | |
0, 0, null);
return bimage;
}
private static byte[] convertIntToByteArray(int integer)
{
byte[] bytes = new byte[4];
bytes[0] =(byte)( integer >> 24 );
bytes[1] =(byte)( (integer << 8) >> 24 );
bytes[2] =(byte)( (integer << 16) >> 24 );
bytes[3] =(byte)( (integer << 24) >> 24 );
return byte... | [
-0.04750002175569534,
-0.30747225880622864,
0.3794446587562561,
-0.1646563857793808,
-0.19320142269134521,
0.4083832800388336,
0.4223533570766449,
-0.6454018950462341,
-0.12276937812566757,
-0.4145592451095581,
-0.4745624363422394,
0.6187522411346436,
-0.4970327317714691,
0.198350429534912... | |
bytes = new byte[integers.length*4];
for (int index = 0; index < integers.length; index++)
{
byte[] integerBytes = convertIntToByteArray(integers[index]);
bytes[index*4] = integerBytes[0];
bytes[1 + (index*4)] = integerBytes[1];
bytes[2 + (index*4)] = integerBytes[2];
... | [
-0.14914344251155853,
-0.15788492560386658,
0.46696099638938904,
-0.09900029748678207,
-0.0530778206884861,
0.4836319088935852,
0.22950834035873413,
-0.5461521744728088,
-0.28907930850982666,
-0.40905043482780457,
-0.30087772011756897,
0.7462244629859924,
-0.20506100356578827,
0.3145145475... | |
ArrayList integers = new ArrayList();
for (int index = 0; index < bytes.length; index += 4)
{
byte[] fourBytes = new byte[4];
fourBytes[0] = bytes[index];
fourBytes[1] = bytes[index+1];
fourBytes[2] = bytes[index+2];
fourBytes[3] = bytes[index+3];
int integer = co... | [
0.07993676513433456,
-0.18940924108028412,
0.4738641083240509,
-0.2755562365055084,
-0.1906840205192566,
0.41744741797447205,
0.008656756021082401,
-0.6554860472679138,
-0.6188995838165283,
-0.3783576190471649,
-0.22239620983600616,
0.5648385286331177,
-0.424187034368515,
0.123882956802845... | |
int[] ints = new int[bytes.length/4];
for (int index = 0; index < integers.size() ; index++)
{
ints[index] = ((Integer)integers.get(index)).intValue();
}
return ints;
}
public static byte[] convertToBytes(Image image)
{
System.out.println("A");
ImageConverter converter = new ImageConver... | [
-0.14170637726783752,
-0.28820914030075073,
0.8294857144355774,
-0.3995775282382965,
-0.1817181259393692,
0.5303772687911987,
-0.025369061157107353,
-0.47919389605522156,
-0.4667222201824188,
-0.4734422266483307,
-0.24756833910942078,
0.6710095405578613,
-0.5780260562896729,
0.245203837752... | |
if(pixelGrabber.grabPixels())
{
Object pixels = pixelGrabber.getPixels();
if (pixels instanceof byte[])
{
return (byte[])pixels;
}
return convertIntArrayToByteArray((int[])pixels); | [
-0.30703479051589966,
-0.40324831008911133,
0.4816912114620209,
-0.13898511230945587,
-0.00695782620459795,
0.2142685055732727,
0.04306619241833687,
-0.267356812953949,
0.03378584608435631,
-0.6027353405952454,
-0.3144420087337494,
0.6017290353775024,
-0.4467417597770691,
0.136937662959098... | |
}
}catch(InterruptedException e)
{
}
return null;
}
}
```
To recreate the image you can use the method createRGBImage in the Image class (<http://java.sun.com/javame/reference/apis/jsr118/>), but be aware that you're using 4 bytes for each pixel in the image. A image with 200 x 200 pixels of width wi... | [
0.3052269518375397,
-0.2412310540676117,
0.423320472240448,
-0.05936553329229355,
0.04695358872413635,
0.11012112349271774,
0.14897170662879944,
-0.12562496960163116,
-0.30823174118995667,
-0.8726612329483032,
0.1699102222919464,
0.4666869640350342,
-0.11049669981002808,
0.1573260724544525... | |
the resolution of the image on the server (where you have the code and the raw power to do that), encode it as JPEG and then send it to the client. The method Image.createImage(...) can create an image in any encoded format supported by the J2ME engine that is running the application. I believe that JPEG will always be... | [
0.3492162227630615,
-0.09712103754281998,
0.5628374218940735,
0.31951531767845154,
-0.18668155372142792,
-0.1133158951997757,
-0.25607624650001526,
-0.012281574308872223,
-0.23406749963760376,
-0.8850187063217163,
-0.1850672960281372,
0.5311742424964905,
-0.17320077121257782,
0.10605095326... | |
I realize that I may be being a bit lazy, but does anyone know of a Visual Studio macro, where I can select some text inside of the Visual Studio IDE, click a button, and have it wrap the selected text with tags? It would generate something like:
```
<strong>My Selected Text</strong>
```
I would even be up for creat... | [
0.17563794553279877,
0.042919814586639404,
0.4100155234336853,
-0.3740634024143219,
-0.04777008295059204,
-0.25198569893836975,
0.1740858256816864,
-0.16232004761695862,
-0.11343098431825638,
-0.798316240310669,
-0.13698261976242065,
0.7084202766418457,
-0.45879343152046204,
-0.39566665887... | |
the macros IDE, click Tools->Macros->Macros IDE...
* Next, we will add a module for your custom macros. Right click on "MyMacros" in the Project Explorer, click Add->Add Module..., type in an appropriate name then click "Add".
* Now paste the function inside the module, making copies for any other tags you want
* Save ... | [
0.24165673553943634,
-0.2568235695362091,
0.5970262289047241,
-0.029522597789764404,
0.2262362390756607,
0.15117810666561127,
-0.06279096752405167,
-0.07262925803661346,
-0.3407818675041199,
-0.8271917700767517,
-0.040388353168964386,
0.8835110664367676,
-0.5322311520576477,
-0.24497611820... | |
the macros created before and drag them over to the toolbar
* Right click the buttons to change settings (such as displaying an icon instead of text) | [
0.1803865134716034,
0.027113527059555054,
0.45677903294563293,
-0.19303542375564575,
0.4436804950237274,
0.0631093829870224,
-0.006328419782221317,
0.0719137191772461,
-0.2514892816543579,
-0.8133818507194519,
-0.2144705355167389,
0.9044093489646912,
-0.2991921305656433,
-0.266276627779006... | |
When you perform `ls` in a bash shell, sometimes there are colours to indicate different resource types, and you can enable/control this with the `--color` argument.
But neither the man page nor Google is providing an answer to the question:
**What do these colours indicate by default, and how do I display what the c... | [
0.4129285514354706,
0.04443341866135597,
0.011155710555613041,
-0.08983831852674484,
-0.13871048390865326,
0.04957801103591919,
0.4218185245990753,
-0.04172128438949585,
-0.4481990337371826,
-0.7068939208984375,
-0.013860424049198627,
0.7465142607688904,
0.06036160886287689,
-0.08336646109... | |
preview this code it'll show what I mean...
```
<ul style="list-style:none; background:black; margin:0;padding:0.5em; width:10em">
<li style="color:blue">directory</li>
<li style="color:aqua">symbolic link</li>
<li style="color:#A00000;">*.tar files</li>
<li style="color:white">...</li>
</ul>
```
Thanks.
The... | [
-0.04477718099951744,
-0.17551358044147491,
0.20427243411540985,
-0.1261671930551529,
-0.04544771835207939,
0.21711760759353638,
0.44845131039619446,
-0.20164470374584198,
0.1428290754556656,
-0.9218215942382812,
-0.07728598266839981,
0.3488864004611969,
-0.3651832342147827,
-0.02169553749... | |
done
}
``` | [
0.3046245574951172,
0.4646056294441223,
0.009305276907980442,
-0.04936361312866211,
0.4478186070919037,
-0.3153231739997864,
0.3749057948589325,
0.22710904479026794,
0.020152807235717773,
-0.6204003691673279,
-0.21159717440605164,
0.336918443441391,
0.06835886090993881,
-0.0635812282562255... | |
I'm quite new on php and am trying to learn it.
My question is rather simple but I've been a bit lost while googling for it.
I just want to create an object to manage the database connection. I already did the object and now the problem I'm facing is:
How do i keep it instanced to a session? (So that i don't need to... | [
0.2509896457195282,
0.3667999505996704,
0.3769247531890869,
0.08741362392902374,
-0.2877006530761719,
-0.15462462604045868,
0.5241921544075012,
0.021754391491413116,
-0.16527104377746582,
-0.721278190612793,
0.4409885108470917,
0.5645157694816589,
-0.27105215191841125,
0.5446293950080872,
... | |
you define a [\_\_destruct()](http://uk.php.net/__destruct) method on your object, it'll get called when the object is about to be destroyed. You can use this to close your database connection.
You can also use [\_\_sleep() and \_\_wakeup()](http://uk.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.sleep... | [
0.2938918471336365,
0.03872290253639221,
0.4064848721027374,
0.04169099032878876,
0.33825886249542236,
-0.25517508387565613,
0.3273717164993286,
-0.032472215592861176,
-0.3504440188407898,
-0.6760784983634949,
-0.4114604890346527,
0.6018924713134766,
-0.4253040552139282,
0.3985784351825714... | |
There's been some debate going on in [this question](https://stackoverflow.com/questions/596162/can-you-remove-elements-from-a-stdlist-while-iterating-through-it/596180#596180) about whether the following code is legal C++:
```
std::list<item*>::iterator i = items.begin();
while (i != items.end())
{
bool isActive ... | [
-0.08520204573869705,
0.006053522229194641,
0.40716931223869324,
-0.286590576171875,
0.19234023988246918,
-0.20097379386425018,
0.34947553277015686,
-0.5927715301513672,
-0.4123063385486603,
-0.32567569613456726,
-0.3014376163482666,
0.46719178557395935,
-0.48215988278388977,
0.26336565613... | |
happens before `i++` is evaluated, then incrementing `i` like that is technically undefined behavior, even if it appears to work with a particular compiler. One side of the debate says that all function arguments are fully evaluated before the function is called. The other side says, "the only guarantees are that i++ w... | [
0.2833435833454132,
0.10752153396606445,
0.42772597074508667,
-0.4090244770050049,
-0.12114771455526352,
-0.4684000015258789,
0.5912442207336426,
-0.36330458521842957,
0.025466127321124077,
-0.3966258466243744,
-0.3197871744632721,
0.6781240105628967,
-0.12690779566764832,
-0.0412095934152... | |
value computation and side effect
> associated with any argument
> expression, or with the postfix
> expression designating the called
> function, is sequenced before
> execution of every expression or
> statement in the body of the called
> function. (Note: Value computations
> and side effects associated with... | [
0.12808674573898315,
0.3540242314338684,
0.34861642122268677,
-0.40474313497543335,
0.027859142050147057,
-0.23214785754680634,
0.3940446674823761,
-0.4319900870323181,
0.04419765621423721,
-0.16493846476078033,
-0.15641914308071136,
0.5449013113975525,
-0.5341290235519409,
0.2335843890905... | |
a scalar object is
> unsequenced relative to either another
> side effect on the same scalar object
> or a value computation using the value
> of the same scalar object, the
> behavior is undefined. | [
-0.38779211044311523,
-0.09394317865371704,
0.5440273880958557,
0.11909908801317215,
-0.4086587429046631,
0.01527845486998558,
-0.053907401859760284,
-0.22784188389778137,
-0.142784982919693,
-0.5953826904296875,
-0.1427852064371109,
0.12948687374591827,
-0.4236791431903839,
0.289249479770... | |
I read in an earlier [answer](https://stackoverflow.com/questions/576988/python-specific-antipatterns/577731#577731) that exception handling is cheap in Python so we shouldn't do pre-conditional checking.
I have not heard of this before, but I'm relatively new to Python. Exception handling means a dynamic call and a s... | [
-0.08915208280086517,
0.1264115273952484,
-0.48996859788894653,
-0.09007853269577026,
-0.14315073192119598,
-0.25235798954963684,
0.5002056956291199,
-0.16340050101280212,
0.00220808619633317,
-0.17829984426498413,
-0.1338595151901245,
0.6699156165122986,
-0.3325819969177246,
-0.4075599908... | |
is in various scenarios pre-conditional checking (specific to dictionary keys in this case) and using only exceptions. Code is provided as well if you want to adapt it to test other conditionals.
The conclusions he came to:
> From these results, I think it is fair
> to quickly determine a number of
> conclusions:
... | [
0.14581337571144104,
0.052566856145858765,
-0.13784880936145782,
0.05013011395931244,
0.1142110675573349,
-0.00988189596682787,
0.42812275886535645,
-0.5021650195121765,
0.10202981531620026,
-0.46825888752937317,
-0.13051094114780426,
0.5543774962425232,
-0.160090371966362,
-0.380724370479... | |
better off not
> putting one have the except
> 3. If it is likely that the element does exist, then there is a very
> slight advantage to using a try/except
> block instead of using has\_key,
> however, the advantage is very slight. | [
0.32583555579185486,
-0.2008199244737625,
0.04379668086767197,
-0.0632118433713913,
0.049751486629247665,
-0.4935154318809509,
0.5536801218986511,
-0.36221009492874146,
0.2855551540851593,
-0.7020721435546875,
-0.17415305972099304,
0.4803757965564728,
-0.40126001834869385,
-0.1811896413564... | |
I'm developing a ruby on rails app and I want to be able to excecute a method on every AR object before each save.
I thought I'd create a layer-super-type like this:
```
MyObject << DomainObject << ActiveRecord::Base
```
and put in DomainObject a callback (before\_save) with my special method (which basically strip... | [
0.10556089878082275,
0.08253876864910126,
0.18930821120738983,
-0.23582231998443604,
-0.1651988923549652,
-0.14106103777885437,
0.4739641845226288,
-0.01508683618158102,
-0.14083509147167206,
-0.5523263216018677,
0.03362887352705002,
0.5376574397087097,
-0.65228670835495,
0.078701749444007... | |
lib folder.
This doesnt work, it tells me that my\_method is undefined.
Any ideas?
Try using an abstract class for your domain object.
```
class DomainObject < ActiveRecord::Base
self.abstract_class = true
# your stuff goes here
end
```
With an abstract class, you are creating a model which cannot have objects... | [
-0.07965392619371414,
-0.172077476978302,
0.3212882876396179,
-0.2475317269563675,
-0.16081267595291138,
-0.3813723027706146,
0.15227478742599487,
-0.2183268815279007,
-0.32490238547325134,
-0.6400827169418335,
-0.0024963291361927986,
0.39436620473861694,
-0.7095580101013184,
0.09494274854... | |
your models and controllers.
so placing the file in the lib folder, it will not be run when Rails starts and won't monkey patch ActiveRecord::Base. You could place the file in `config/initializers`, but I think there are better alternatives. | [
0.15985490381717682,
-0.19656910002231598,
0.17418348789215088,
0.27159684896469116,
0.1165444552898407,
-0.30100685358047485,
0.21262510120868683,
0.07920290529727936,
-0.005653614178299904,
-0.8906970620155334,
-0.02375142276287079,
0.6129468083381653,
-0.3391263782978058,
-0.14626763761... | |
There’s not standard way to check if a MySQL user exists and based on that drop it. Are there any workarounds for this?
Edit: I need a straight way to run this without throwing up an error
e.g.
```
DROP USER test@localhost; :
```
Since MySQL 5.7 you can do a `DROP USER IF EXISTS test`
More info: <http://dev... | [
0.7222684025764465,
-0.12379060685634613,
0.12897197902202606,
0.25437697768211365,
-0.021220937371253967,
-0.3272368311882019,
0.3153733015060425,
0.09001079201698303,
-0.12280717492103577,
-0.36631152033805847,
0.03208911791443825,
0.5858076214790344,
-0.3030833899974823,
-0.279996663331... | |
To draw a "selection rectangle" from the mouse down , mouse move then remove it on mouse up i currently do the following:
My board is a canvas,
On mouse down i create a new UIcontainer i set his borders.
I update his width and height related the the mouse move position,
on mouse up i remove this child UIcontainer.
Do... | [
0.34111055731773376,
-0.33196723461151123,
0.6949363350868225,
0.009705097414553165,
-0.06088413670659065,
0.14133523404598236,
-0.25685447454452515,
-0.52683025598526,
-0.28936636447906494,
-0.74025559425354,
0.10322399437427521,
0.08513502031564713,
-0.26801037788391113,
0.02284237928688... | |
In VB.NET, I am trying to talk to a webservice (that can't be changed) to create and update customer data.
The CreateCustomer service expects an object of type ConsumerPerson and the ChangeCustomer service expects an object of type ChangeData.
The properties of these two object are exactly the same, so I thought it wo... | [
0.3888964354991913,
-0.2164524346590042,
0.6006484627723694,
-0.04613115265965462,
-0.2073291838169098,
-0.02277708798646927,
-0.09311351180076599,
-0.034572456032037735,
-0.05443013831973076,
-0.7750847339630127,
0.07452061027288437,
0.6409095525741577,
-0.41921383142471313,
0.33537569642... | |
your best approach. Here is a short code snippet. I picked a simple property named "Name" of type string. It should be easy to modify with the actual properties on your class.
```
Public Interface ICustomerData
ReadOnly Property Name As String
End Interface
Public Class ConsumerPerson
Implements ICustomerData
... | [
0.0016927270917221904,
-0.01569942943751812,
0.2962484061717987,
0.05825843662023544,
0.0130537748336792,
-0.07775739580392838,
-0.08011074364185333,
-0.11922637373209,
-0.0015772928018122911,
-0.9195791482925415,
0.1128690242767334,
0.7593463063240051,
-0.11646810173988342,
0.444308072328... | |
return _name
End Get
End Property
End Class
``` | [
-0.13044710457324982,
0.12041011452674866,
0.16336576640605927,
-0.04696038365364075,
0.08410770446062088,
-0.6351708769798279,
0.20135585963726044,
0.038102876394987106,
0.3824506402015686,
-0.20729565620422363,
-0.35343414545059204,
0.44484102725982666,
0.008387740701436996,
0.5901603102... | |
I am making this in a proactive attempt to head off any potential problems which could arise from this. The situation is that we are developing an ASP.NET application for a client which will handle the online ordering from their customers. This application is going to be using the same database that their current WinFo... | [
0.669697642326355,
-0.26307132840156555,
0.46064111590385437,
-0.009425208903849125,
0.07999846339225769,
0.328799307346344,
-0.13609424233436584,
0.07463747262954712,
-0.2138044387102127,
-0.6192317008972168,
0.11686279624700546,
0.3639475107192993,
-0.13856975734233856,
-0.04784023016691... | |
and forth, etc.)
The plan is to host both applications on the same box at the client location. What I am looking for are potential problems or setup tips which would prevent possible conflict between the two apps (web.config conflicts, etc.) Is there a problem with having both hosted on the same location, how should I... | [
0.47640326619148254,
-0.1006237119436264,
0.36620116233825684,
0.24436111748218536,
0.04928063601255417,
-0.2607424557209015,
0.3155498504638672,
-0.3613074719905853,
-0.0983053594827652,
-0.9592742919921875,
-0.016695661470294,
0.9185194373130798,
-0.5000784397125244,
0.039135776460170746... | |
proper subdirectory for the default application for that website(DNN).
Option 2: (DotNetNuke in root, other site in subdirectory) There will be many issues with web.config inheritance if the new application is not built with DotNetNuke, but you can get around these by blocking inheritance of the root web.config. Bas... | [
0.11683232337236404,
-0.38490453362464905,
0.6247878074645996,
0.18107031285762787,
-0.17181074619293213,
-0.10486462712287903,
0.3611771762371063,
-0.30524328351020813,
-0.30211132764816284,
-0.9839595556259155,
-0.2147018164396286,
0.3423052132129669,
-0.3523055613040924,
0.4396052956581... | |
In JavaScript, `xmlHttpRequest.responseXML()` returns a `DOM Document` object. The `DOM Document` object is created from an XML-structured HTTP response body.
At what point during the life of an `xmlHttpRequest` object is the XML string parsed into the `DOM Document`?
I can imagine it may occur in one of two places.
... | [
-0.2283860146999359,
-0.20545510947704315,
0.48950496315956116,
-0.332415372133255,
-0.5072198510169983,
-0.051142770797014236,
0.05536961182951927,
-0.3737636208534241,
-0.141396164894104,
-0.4978426694869995,
-0.681496798992157,
0.6909216642379761,
-0.3019151985645294,
-0.191862925887107... | |
parsed into a DOM as you otherwise can't do much with the requested data.
Both options have some merit, although I'm inclined to say that the XML string is parsed only when `responseXML` is called.
At what point does parsing of the XML string occur?
Reaons for asking: I need to measure browser-based XML deserialisat... | [
-0.12245430797338486,
-0.21930615603923798,
0.24503153562545776,
0.09984520822763443,
-0.18077333271503448,
-0.08758941292762756,
0.0885562151670456,
-0.3487491011619568,
0.07204741984605789,
-0.5926905870437622,
-0.06243836507201195,
0.48963651061058044,
-0.273445725440979,
-0.18735277652... | |
I have an ASP.NET MVC application which is pretty simple so far, but I want to add a driving directions page to the clients location. I see plenty of examples using the traditional code behind model but none with ASP.NET MVC. The application uses master pages and content pages.
I'm pretty new to ASP.NET MVC, so bear ... | [
0.5157033801078796,
0.22983577847480774,
0.5131091475486755,
0.05990424007177353,
-0.2605339586734772,
-0.2235446721315384,
0.21111589670181274,
-0.10493991523981094,
-0.0684501975774765,
-0.5946515202522278,
0.23864655196666718,
0.6254767775535583,
-0.15622980892658234,
-0.245019674301147... | |
ASP.NET MVC won't really affect your Google Maps code. Write the Google maps code in one of your view content pages just as you would in a standard ASP.NET application, or even just a plain HTML + JavaScript application. The only difference is that you will want to dynamically add JavaScript variables or parameters so ... | [
0.21387150883674622,
-0.28730571269989014,
0.5138342976570129,
0.33394211530685425,
-0.23862634599208832,
-0.3089008927345276,
0.3454020023345947,
-0.2991940677165985,
-0.2342458963394165,
-0.7039408683776855,
0.014240721240639687,
0.46509456634521484,
-0.41992732882499695,
-0.076624117791... | |
perform the logic and hand the results to the view in the ViewData. | [
0.16604237258434296,
-0.001571953995153308,
0.2952030301094055,
0.20481809973716736,
0.09642738848924637,
-0.021197153255343437,
-0.27774637937545776,
-0.22287139296531677,
0.3481948971748352,
-0.3419325649738312,
-0.5593955516815186,
0.7028709053993225,
0.14947813749313354,
-0.09632363170... | |
I have been trying to convert a php page to mysqli, and have encoutnered some problems. Given the code below, and the way which I have ordered things to work, I would like to know what the better way is using mysqli methods.
Is there an mysqli alternative to mysql\_num\_rows or is a different method of calculating th... | [
0.027753472328186035,
0.11798911541700363,
0.3136134743690491,
0.03185158595442772,
-0.23883897066116333,
0.23208652436733246,
0.1411454975605011,
-0.37824708223342896,
-0.20087215304374695,
-0.5913553833961487,
0.3527528941631317,
0.643118143081665,
-0.4467661678791046,
0.0481536015868186... | |
replacement function, so what would be the correct approach?
I apologize for these questions, but I have not been able to determine the answers myself so far.
```
<?php
$con = mysqli_connect("localhost", "user", "", "ebay");
if (!$con) {
echo "Can't connect to MySQL Server. Errorcode: %s\n". mysqli_connect_error(... | [
0.11223036050796509,
-0.1609104573726654,
0.5518059134483337,
-0.19253824651241302,
-0.07233556360006332,
0.1575743854045868,
0.4784448742866516,
-0.4438968300819397,
-0.12220395356416702,
-0.41000276803970337,
-0.42257609963417053,
0.8455058336257935,
-0.4336663782596588,
0.36122944951057... | |
= "test";
$countQuery = "SELECT ARTICLE_NO FROM ? WHERE upper(ARTICLE_NAME) LIKE '% ? %'";
if ($numRecords = $con->prepare($countQuery)) {
$numRecords->bind_param("ss", $table, $brand);
$numRecords->execute();
$data = $con->query($countQuery) or die(print_r($con->error));
$rowcount = mysql_num_rows($dat... | [
-0.050203874707221985,
0.016540445387363434,
0.601840078830719,
-0.31664353609085083,
-0.23653055727481842,
0.27530789375305176,
0.4790820777416229,
-0.8177884817123413,
-0.17883096635341644,
-0.46957775950431824,
-0.46087875962257385,
0.305936723947525,
-0.32525140047073364,
-0.0188803691... | |
global $con;
$recordsQuery = "SELECT ARTICLE_NO, USERNAME, ACCESSSTARTS, ARTICLE_NAME, date_format(str_to_date(ACCESSSTARTS, '%d/%m/%Y %k:%i:%s'), '%d %m %Y' ) AS shortDate FROM ? WHERE upper(ARTICLE_NAME) LIKE '%?%' ORDER BY str_to_date(ACCESSSTARTS, '%d/%m/%Y %k:%i:%s')" . $max;
if ($getRecords = $con->prepar... | [
-0.6619463562965393,
-0.05901261046528816,
0.9855688214302063,
-0.18940438330173492,
0.2826603949069977,
0.09025602787733078,
0.15471437573432922,
0.028539156541228294,
-0.3921469748020172,
-0.43456488847732544,
-0.4686354696750641,
0.5010319352149963,
-0.29590916633605957,
0.2311421483755... | |
$rows = array();
while($row = mysql_fetch_assoc($result)) {
$rows[] = $row;
}
return $rows;
}
}
}
```
I've rewritten your code sample with the correct property / function calls to fix the two issues that you mention | [
0.24019964039325714,
0.228678360581398,
0.3008761405944824,
-0.23034240305423737,
0.2577050030231476,
0.038444243371486664,
0.4134376347064972,
-0.5051360130310059,
-0.14087948203086853,
-0.6167340278625488,
-0.06410690397024155,
0.5611425042152405,
-0.40768328309059143,
0.0771123692393302... | |
in the question:
```
<?php
$con = mysqli::connect("localhost", "user", "", "ebay");
if (!$con) {
echo "Can't connect to MySQL Server. Errorcode: %s\n". mysqli_connect_error();
exit;
}
$con->query("SET NAMES 'utf8'");
$cmd = "word";
//normally retrieved from GET
if($cmd=="deleterec") {
$deleteQuery = "D... | [
-0.15595586597919464,
-0.1353432536125183,
0.6366918683052063,
-0.07012656331062317,
0.02444787509739399,
0.11657855659723282,
0.21587710082530975,
-0.6330501437187195,
-0.1819506585597992,
-0.1469867080450058,
-0.7645084261894226,
0.6223310828208923,
-0.2303386777639389,
0.216209515929222... | |
$brand);
$numRecords->execute();
$data = $con->query($countQuery) or die(print_r($con->error));
// Here is the property that you can reference to determine the affected rows from the previous query. -- gabriel
$rowcount = $data->num_rows;
$rows = getRowsByArticleSearch($query, $table, $max);
$... | [
0.1436198353767395,
0.038364481180906296,
0.8659526109695435,
-0.2921958267688751,
-0.21988311409950256,
0.27765414118766785,
0.5003461837768555,
-0.6065322160720825,
0.06234072893857956,
-0.533284068107605,
-0.17022721469402313,
0.5623574256896973,
-0.3366786241531372,
0.22474923729896545... | |
//global $con; Globals are BAD!! Please don't use.
$con = mysqli::connet("localhost", "user", "", "ebay");
$recordsQuery = "SELECT ARTICLE_NO, USERNAME, ACCESSSTARTS, ARTICLE_NAME, date_format(str_to_date(ACCESSSTARTS, '%d/%m/%Y %k:%i:%s'), '%d %m %Y' ) AS shortDate FROM ? WHERE upper(ARTICLE_NAME) LIKE '%?%' ... | [
-0.5499579310417175,
-0.06088197976350784,
0.8369114995002747,
-0.2670023441314697,
0.33588337898254395,
0.050759997218847275,
0.24330630898475647,
0.13959577679634094,
-0.2861620783805847,
-0.5185512900352478,
-0.3660314679145813,
0.6501100063323975,
-0.32124602794647217,
0.26715788245201... | |
$result = $con->query($recordsQuery);
$rows = array();
// Notice the adjusted function call to retrieve the associate array for each record within the result set. -- gabriel
while($row = $result->fetch_assoc()) { | [
-0.08919729292392731,
0.002816424472257495,
0.5392312407493591,
-0.2630757987499237,
0.009724525734782219,
0.31228721141815186,
0.32084181904792786,
-0.5978426337242126,
-0.28141120076179504,
-0.10271583497524261,
-0.03644117712974548,
0.5761560797691345,
-0.5728784799575806,
0.01285758707... | |
$rows[] = $row;
}
return $rows;
}
}
}
```
However, I would like to add that dusoft was correct in the assessment that MySQLi is buggy and is known to create issues. It is for this reason that we had to switch from MySQLi to PDO (which is native | [
-0.108243428170681,
-0.07288696616888046,
0.2589670419692993,
-0.19965773820877075,
0.0822836384177208,
-0.26533010601997375,
0.07346304506063461,
0.2016988843679428,
-0.07683948427438736,
-0.8237260580062866,
-0.17122958600521088,
0.6349417567253113,
-0.6779507994651794,
0.012890646234154... | |
to PHP as of at least 5.1) and we haven't had any problems since. I would strongly recommend that you look at PDO or perhaps one of the Pear libraries to actually provide your database connection interface. | [
0.1525719165802002,
-0.06603007018566132,
0.3920550048351288,
0.07709391415119171,
-0.2843276262283325,
-0.2918495833873749,
0.21249142289161682,
0.37993383407592773,
-0.34955692291259766,
-0.6108098030090332,
0.33386948704719543,
0.4031582474708557,
0.008469467051327229,
0.064271792769432... | |
Actually I don't care too much about Mac OS X development. I want to do only iPod Touch and iPhone development. But anyways, I started learning Cocoa and Objective-C. But it seems like there are many differences between Cocoa and Cocoa Touch, so I am wondering if I am actually wasting my time. Should I just jump direct... | [
0.19951190054416656,
0.3741668164730072,
-0.10470990091562271,
0.01262829639017582,
0.06590262055397034,
0.24571408331394196,
0.1773463487625122,
0.3543436527252197,
-0.3384344279766083,
-0.44508349895477295,
0.27289506793022156,
0.9242371320724487,
-0.2579519748687744,
-0.3685279786586761... | |
confused. I finally decided to take up iPhone programming, and picked up [Beginning iPhone Development: Exploring the iPhone SDK](https://rads.stackoverflow.com/amzn/click/com/1430216263), worked through that book over a few weeks, and I understand things much, much better now. Really, all it takes is a good explanatio... | [
0.06997939199209213,
0.5013869404792786,
0.0031129661947488785,
0.02900010161101818,
0.13933461904525757,
0.2032061517238617,
0.38558000326156616,
0.24443508684635162,
-0.4277764856815338,
-0.4953564703464508,
0.08250975608825684,
0.7502163052558899,
0.05959223955869675,
-0.277572572231292... | |
highly, highly recommend that book if you're really interested in iPhone development. It was worth every penny. | [
-0.10390166938304901,
0.3279068171977997,
-0.16558967530727386,
0.4532698690891266,
0.053075142204761505,
0.2259807288646698,
0.2787966728210449,
0.7092862725257874,
0.1631513386964798,
-0.016058646142482758,
0.2897455096244812,
0.513222336769104,
0.46778449416160583,
-0.37048253417015076,... | |
I am loading a bunch of images for a GUI which will pick attributes for my clients product.
Is it best to pre-load all the images at the start (which I'm guessing would take some time) and then have the GUI have full functionality or is it better to load images on the fly.
Essentially i am working on a picture/poster... | [
0.7749500870704651,
-0.046929556876420975,
0.46315261721611023,
0.04372171312570572,
-0.2214241474866867,
0.05049819126725197,
-0.18150833249092102,
-0.13851864635944366,
-0.2259034514427185,
-0.8230757713317871,
0.3151291608810425,
0.727045476436615,
-0.14331863820552826,
-0.0431857891380... | |
would be helpful as to the best case scenario for this.
And if I will be pre-loading all the images how do I put one of those loading bars on the screen like you see in Flash or a loading gif like i've seen in Ajax?
Thanks
Mike
Why not do both?
You can load images lazily, but also hook `$(document).ready()` to pre... | [
0.49492669105529785,
-0.25728070735931396,
0.29474785923957825,
0.03541572764515877,
-0.09501564502716064,
-0.24255847930908203,
-0.06485174596309662,
0.1456516981124878,
-0.48005738854408264,
-0.7657671570777893,
-0.1774071753025055,
0.8459122776985168,
-0.212665393948555,
0.0434473939239... | |
Let's assume I'm creating a simple class to work similar to a C-style struct, to just hold data elements. I'm trying to figure out how to search a list of objects for objects with an attribute equaling a certain value. Below is a trivial example to illustrate what I'm trying to do.
For instance:
```
class Data:
p... | [
0.06857563555240631,
-0.10300946980714798,
0.12150970846414566,
-0.08496225625276566,
-0.11019239574670792,
0.0433066301047802,
-0.021729817613959312,
-0.43326035141944885,
-0.27587342262268066,
-0.7075926065444946,
0.09548908472061157,
0.41287973523139954,
-0.31059059500694275,
0.25190845... | |
an element with n == 5?
I've been Googling and searching the Python docs, and I think I might be able to do this with a list comprehension, but I'm not sure. I might add that I'm having to use Python 2.4.3 by the way, so any new gee-whiz 2.6 or 3.x features aren't available to me.
You can get a list of *all* matching ... | [
0.2522236406803131,
0.03328520432114601,
0.3195509910583496,
-0.17533206939697266,
-0.10054793953895569,
-0.035421766340732574,
0.249627947807312,
-0.3895096480846405,
-0.3011375069618225,
-0.3351958692073822,
0.13937894999980927,
0.7060304284095764,
-0.5677515864372253,
-0.161045238375663... | |
(relatively) efficiently, you can do
```
def contains(list, filter):
for x in list:
if filter(x):
return True
return False
if contains(myList, lambda x: x.n == 3) # True if any element has .n==3
# do stuff
``` | [
0.22669701278209686,
-0.14599503576755524,
0.08532638847827911,
-0.04982168227434158,
0.15541189908981323,
-0.3196137249469757,
0.12780846655368805,
-0.37114423513412476,
-0.21939228475093842,
-0.5731135010719299,
-0.3283017873764038,
0.45937806367874146,
-0.46466898918151855,
-0.108429059... | |
Does asynchronous call always create a new thread?
Example:
If JavaScript is single threaded then how can it do an async postback? Is it actually blocking until it gets a callback? If so, is this really an async call?
This is an interesting question.
Asynchronous programming is a paradigm of programming that is pri... | [
0.1204623207449913,
-0.25868040323257446,
-0.09632755070924759,
0.17052744328975677,
-0.39101162552833557,
-0.18380622565746307,
0.14541687071323395,
-0.05942950025200844,
-0.39002740383148193,
-0.38681745529174805,
-0.27786993980407715,
0.16827820241451263,
-0.5707696080207825,
0.13408550... | |
calls).
```
<script>
function performRequest() {
xmlhttp.open("GET", "someurl", true);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
alert(xmlhttp.responseText);
}
}
xmlhttp.send(sometext);
}
</script>
<span onclick="performRequest()">perform request</span>
```
(This ... | [
0.11554697155952454,
-0.39320868253707886,
0.5303927063941956,
-0.18658272922039032,
0.05110800266265869,
-0.19807210564613342,
0.4398602247238159,
-0.33149272203445435,
-0.30005383491516113,
-0.4560732841491699,
-0.5173611640930176,
0.5711026787757874,
-0.4287358820438385,
-0.062316652387... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.