text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
//do custom stuff base.CreateUser(); } ``` You've cleanly abstracted the implementation particulars. One can change without affecting the other. And any future changes can do the same by overriding your provider.
[ 0.6852292418479919, 0.014449836686253548, 0.14414387941360474, -0.19168950617313385, 0.17491066455841064, -0.23079556226730347, 0.2597671151161194, -0.06286850571632385, -0.011395049281418324, -0.6767409443855286, -0.17868907749652863, 0.7008155584335327, -0.3658815026283264, 0.15408234298...
What is the most minimal example of deploying a war to multiple tomcat servers using maven that can be written? I've tried the following URLs and asked the mailing list, but not coming up with anything that was short and would simply work. * <http://www.nabble.com/Deploying-to-Multiple-Servers-at-Once-td21592419.html...
[ 0.27679163217544556, 0.12073548883199692, -0.2839773893356323, -0.1347641795873642, -0.1286228746175766, 0.4337880611419678, 0.2599621117115021, -0.2913596034049988, -0.19750601053237915, -0.774071991443634, -0.0790647566318512, 0.5032643675804138, -0.4959522485733032, -0.15981444716453552...
<artifactId>cargo-maven2-plugin</artifactId> </plugin> </plugins> ... </build> <profiles> <profile> <id>env-foo1</id> <!-- Activated when -Denv=foo1 is given as parameter. --> <activation> <property> <name>env</name>
[ -0.24246275424957275, -0.2158171534538269, 0.376503586769104, -0.14630624651908875, -0.16252902150154114, 0.27326539158821106, -0.03481420874595642, -0.19159315526485443, -0.45017534494400024, -0.7261006236076355, -0.20651420950889587, 0.4922715127468109, -0.5196252465248108, 0.02500366047...
<value>foo1</value> </property> </activation> <properties> <deploy.env>xxx</deploy.env> <tomcat.manager>http://foo1/manager</tomcat.manager> <tomcat.manager.username>foo</tomcat.manager.username> <tomcat.manager.password>bar</tomcat.manager.pas...
[ -0.17839907109737396, 0.22339093685150146, 0.5003108978271484, -0.5564438700675964, -0.07578467577695847, 0.4830906391143799, 0.13273924589157104, -0.3365577459335327, -0.6099449396133423, -0.06492487341165543, -0.4833056330680847, 0.5980416536331177, -0.5204123258590698, 0.059135962277650...
<id>env-foo2</id> <!-- Activated when -Denv=foo2 is given as parameter. --> <activation> <property> <name>env</name> <value>foo2</value> </property> </activation>
[ -0.31351250410079956, 0.038218773901462555, 0.4655599892139435, -0.44244280457496643, -0.4105781018733978, 0.017836090177297592, -0.08271624147891998, -0.42600539326667786, -0.2493685781955719, -0.3707464933395386, -0.3123311698436737, 0.6047189831733704, -0.4318940341472626, -0.3032247424...
<properties> <deploy.env>dev</deploy.env> <tomcat.manager>http://foo2/manager</tomcat.manager> <tomcat.manager.username>foo</tomcat.manager.username> <tomcat.manager.password>bar</tomcat.manager.password> </properties> </profile> ... </profiles> ``` ...
[ 0.0951358899474144, 0.07285696268081665, 0.5776007771492004, -0.3256651759147644, 0.08707360178232193, 0.16270075738430023, 0.47101444005966187, -0.5396801233291626, -0.4738839268684387, -0.5258020162582397, -0.20193299651145935, 0.8792660236358643, -0.3039303719997406, -0.0865089148283004...
of the [Hudson](http://hudson-ci.org/) Continuous Integration server. I gave a short explanation about this feature [here](https://stackoverflow.com/questions/424295/experience-with-hudson-building-matrix-project/424343#424343). Basically, you just define a "normal" Maven2 job in Hudson, and with the Matrix feature, y...
[ 0.023001739755272865, 0.11906265467405319, 0.306240975856781, -0.4483148455619812, 0.572654128074646, 0.33425793051719666, 0.22179974615573883, -0.4803478419780731, -0.12166696786880493, -0.35461050271987915, 0.1329219490289688, 0.8698031902313232, -0.434679239988327, -0.2390008121728897, ...
on... This way, Hudson will deploy your application in every environments... I hope my solution will help you to reach your goals...
[ 0.40788963437080383, 0.2526513636112213, 0.07282940298318863, -0.008289402350783348, 0.5292053818702698, 0.19002975523471832, 0.33560168743133545, 0.24280455708503723, 0.2161417454481125, -0.7158181667327881, 0.12295252829790115, 0.5469699501991272, -0.06639409065246582, 0.0579156391322612...
From what I understand, `#define x y` and `const int x = y;` should work identically under the Visual Studio compiler, but `const int x = y;` is the preferred method. The C code I have looks something like this: ``` static const int x = 100000; void SomeFunction(...) { volatile static int y = x; ... } ``` ...
[ 0.40355923771858215, 0.2252350151538849, -0.05327315255999565, -0.24083109200000763, 0.00814814493060112, -0.2468680888414383, 0.35805797576904297, -0.027371307834982872, -0.07892611622810364, -0.5160213112831116, -0.1808805614709854, 0.8506861329078674, -0.28553149104118347, 0.12417808920...
the command line, and I'm not using any compiler flags, so I'm not sure if I need to set a flag in order for the compiler to optimize out the const - or if I stumbled onto some kind of special case. Compiling the program as a C++ program also works, but I would rather avoid that, if possible. I don't know the C standa...
[ 0.32107049226760864, 0.003530243644490838, 0.014868991449475288, 0.0824088454246521, -0.08878215402364731, -0.2597349286079407, 0.36943474411964417, 0.1105554848909378, -0.2028394639492035, -0.17842982709407806, -0.0594482421875, 0.8023886680603027, -0.49679040908813477, -0.121594414114952...
that are const-qualified. I believe this is because during compilation, the compiler must compute the value to initialise so that it can statically push this value onto the stack without any computation required at runtime. Even const-qualified variables can change (by removing the const-qualifier and changing the val...
[ -0.09195519238710403, 0.07966404408216476, 0.14543640613555908, -0.2011556774377823, 0.2352990359067917, -0.3507528007030487, 0.03524506464600563, -0.24614055454730988, 0.06740179657936096, -0.19213858246803284, -0.4476311504840851, 0.6883379220962524, -0.36252182722091675, 0.0099121630191...
Does anything like this exist? What I am looking for is a control that is going to be client-side, with the Edit, Cancel row capabilities of a GridView. I wish to use it to collect the data from the user and then save on the server after the user is done entering data. EDITED: Thanks for all the recommendations. ...
[ 0.4265102446079254, -0.15410608053207397, 0.1935359686613083, 0.5715397596359253, 0.08483219891786575, -0.2515937089920044, -0.05558880418539047, 0.09785470366477966, -0.12522415816783905, -0.5940559506416321, 0.2915786802768707, 0.25470858812332153, -0.24893049895763397, 0.000716867565643...
web forms. Do these frameworks play well with old flavour of ASP.net? Yes. [jqGrid](http://www.trirand.com/blog/) works well. Try [the demos](http://trirand.com/jqgrid/jqgrid.html). We use it with ASP.NET MVC. **Update:** In your updated question, you asked about using frameworks such as jQuery with WebForms. Can you ...
[ 0.7746027112007141, -0.09517616778612137, 0.1594725251197815, 0.242142915725708, -0.28935036063194275, -0.33901283144950867, 0.11771298199892044, -0.21949955821037292, -0.2989724576473236, -1.1010291576385498, 0.09248077124357224, 0.6488831043243408, -0.12448698282241821, -0.20038199424743...
all to make them work. On the other hand, you're limited to what the generated code can do. Yes, you can write JavaScript manually, even in WebForms, but you have to work around some of the things the framework does, like changing IDs on controls. Yes, you can write event handlers in C#, but this requires the use of po...
[ 0.5623607039451599, -0.21675138175487518, 0.17171610891819, 0.09433135390281677, -0.26528817415237427, -0.2693682014942169, 0.05131932720541954, -0.08225663751363754, -0.31604743003845215, -0.5982580184936523, -0.2963334918022156, 0.5666729807853699, -0.31695106625556946, -0.25453484058380...
still very common to use the two together because jQuery makes it very easy to do things which are otherwise not directly supported within ASP.NET MVC, like making controls on a page interact with each other. Yes, this means you have to write JavaScript, but as long as you're OK with that, you get the huge advantage th...
[ 0.18652309477329254, -0.22259654104709625, 0.1110820397734642, 0.16493181884288788, -0.3429766595363617, -0.36579430103302, -0.27698883414268494, 0.05845693498849869, -0.25875723361968994, -0.6492551565170288, 0.21423132717609406, 0.6252308487892151, -0.2764374911785126, 0.0358951427042484...
designed for jQuery. The reason is that the code you will write will fit more naturally within the idioms of WebForms. If you just want to learn jQuery, well, that's a really good idea, because the framework is interesting, useful, and well-designed, but I'm not sure that a great control is the best place to start. A ...
[ 0.4969014525413513, -0.27553442120552063, 0.18150895833969116, 0.4211726188659668, -0.14696557819843292, -0.1572425812482834, -0.0068363165482878685, 0.08247638493776321, -0.19619223475456238, -0.7831493020057678, 0.0763334333896637, 0.46082502603530884, -0.41369593143463135, -0.1937102377...
Is there a well-supported, common behavior that I can expect if I do something like this in HTML: ``` <form method="get" action="/somePage.html?param1=foo&param2=foo"> <input name="param2"></input> <input name="param3"></input> </form> ``` Seems like this sort of thing is inherently ridiculous, but I've seen it ...
[ 0.08997849375009537, -0.08859486877918243, 0.24827319383621216, 0.008850164711475372, -0.24147668480873108, -0.16166754066944122, 0.5934386253356934, -0.315430223941803, -0.5569915175437927, -0.39901474118232727, -0.24760781228542328, 0.24480271339416504, -0.40373730659484863, -0.301648437...
the querystring parameters from the action attribute before constructing the form argument values. So in your example, the request to the server on submit will look like: `/somePage.html?param2=value&param3=value` So no, when the method is "GET", as in your example, there's no reason to do this.
[ -0.03384552523493767, -0.21505804359912872, 0.4573761820793152, 0.17268748581409454, -0.32497915625572205, -0.044522106647491455, 0.47139087319374084, -0.32072654366493225, -0.1932753175497055, -0.35256603360176086, -0.339741051197052, 0.43157535791397095, -0.20625628530979156, -0.05780776...
I have tool that creates variables for a simulation. The current workflow involves hand copying those variables into the simulation input file. The input file is a standard flat file, i.e. not binary or XML. I would like to automate the addition of the variables to the flat input file. The variables copy over existin...
[ 0.5188895463943481, 0.01707461290061474, 0.3886292278766632, 0.15051007270812988, 0.06424631923437119, 0.29563775658607483, 0.06770513951778412, 0.011131989769637585, -0.1280384361743927, -0.8819786906242371, 0.3603411614894867, 0.4580942988395691, 0.19192786514759064, 0.1653292030096054, ...
you're stuck using flat, then you're stuck using the old fashioned way of updating them: read from original, write to temp file, either write the original row or change the data and then write that. To add data, write it to the temp file at the appropriate point; to delete data, simply don't copy it from the original f...
[ 0.4277196526527405, -0.09617678076028824, 0.3905029296875, 0.09182919561862946, 0.050813544541597366, 0.19077517092227936, 0.01115395501255989, 0.13273806869983673, -0.3321448862552643, -0.8091558814048767, -0.20312677323818207, 0.6074830293655396, -0.21545682847499847, 0.273398756980896, ...
I have a library method that occasionally hangs on a network connection, and there's no timeout mechanism. What's the easiest way to add my own? Basically, I'm trying to keep my code from getting indefinitely stuck. timeout.rb has some problems where basically it doesn't always work quite right, and I wouldn't recomme...
[ 0.6299906969070435, 0.17353293299674988, 0.3074415922164917, -0.04843299463391304, -0.02047431841492653, -0.05658366158604622, 0.740070104598999, -0.14079147577285767, -0.32240110635757446, -0.5510910749435425, -0.04242875799536705, 0.3521658182144165, -0.4425041973590851, 0.29685705900192...
interpreter used by most Ruby applications in production, implements Ruby threads as green threads. > * It is a well-known limitations of the green threads (running on top of a single native thread) that when a green thread performs a blocking system call to the underlying operating systems, none of green threads in th...
[ -0.05840688198804855, -0.00015851613716222346, -0.11834252625703812, -0.0686773955821991, 0.2600329518318176, -0.005097946617752314, 0.5240063071250916, 0.051062993705272675, -0.22117698192596436, -0.40023893117904663, -0.5517197847366333, 0.4348289966583252, -0.6779694557189941, -0.024037...
> Design a function f such that: > > > f(f(x)) == 1/x > > > Where x is a 32 bit float Or how about > Given a function f, find a function g > such that > > > f(x) == g(g(x)) --- ### See Also > [Interview question: f(f(n)) == -n](https://stackoverflow.com/questions/731832/interview-question-ffn-n) For the firs...
[ -0.23748540878295898, -0.0353829562664032, 0.051571011543273926, 0.20447537302970886, -0.18410344421863556, 0.14573746919631958, 0.07585979998111725, -0.47047534584999084, 0.29915904998779297, -0.6476269960403442, -0.20981718599796295, 0.5425966382026672, -0.30263131856918335, -0.223926454...
that x ≠ f(x) ≠ f(f(x)), which I believe was more in the spirit of the original question, but I don't think is possible in the general case * a method that involves g(g(x)) invoking f exactly once
[ 0.13367986679077148, 0.03262295946478844, -0.1144748404622078, -0.06171166151762009, -0.23692815005779266, -0.14541538059711456, 0.3597791790962219, -0.16564925014972687, -0.05197763070464134, 0.03576584905385971, -0.07180938869714737, 0.33966848254203796, -0.4070493280887604, 0.0403486266...
i have an application that records a date/time when the space bar is pressed unfortunately, the window doesn't always have focus, for various reasons. eg virus checker popup, itunes update, windows update, etc so what i though would be a cool idea is to use a joystick button, then regardless of which window has focus,...
[ 0.43539687991142273, 0.05211103335022926, 0.20436862111091614, 0.2584560811519623, -0.13108663260936737, -0.0657658725976944, -0.11612319201231003, 0.23965445160865784, -0.2475387305021286, -0.5905037522315979, 0.20072458684444427, 0.6416327953338623, 0.059910278767347336, 0.03585105389356...
is slow and the screen doesn't refresh often, having the joystick button pressed is going to make no difference anyway. That doesn't really suit my need, so i am looking at running a thread that will poll the joystick every so often My questions are 1. is a background thread the best solution 2. how often should i p...
[ 0.18840958178043365, -0.17641755938529968, 0.42799049615859985, 0.5010973215103149, -0.16863904893398285, 0.21920910477638245, 0.0341067798435688, -0.05090266466140747, -0.284556120634079, -0.6342744827270508, 0.4692361056804657, 0.5827649831771851, 0.14343221485614777, -0.3406488299369812...
would be to create a Timer object on your form, and tie the joystick check to the Tick event. I've also found that running simple stuff like this every 100ms (10 times a second) has a negligible effect on CPU usage.
[ 0.4874971807003021, -0.11440666764974594, 0.14992640912532806, 0.18394553661346436, 0.11450089514255524, -0.0856151282787323, 0.2442832738161087, 0.0476067028939724, -0.1508166790008545, -0.4295383095741272, 0.43121346831321716, 0.44765496253967285, 0.028909029439091682, -0.264278084039688...
I'm interested to know how I could improve the performance of SQL Server when using sequential GUID when using Access 2007 as a front end to SQL Server 2008 (please note it's the only context I'm interested in). I have made some tests (and gotten some fairly surprising results, in particular from SQL Server when using...
[ 0.019874349236488342, 0.30016472935676575, 0.1256016194820404, 0.11591825634241104, -0.1764145791530609, 0.16666242480278015, 0.03822113573551178, 0.11447301506996155, -0.28253763914108276, -0.4216056764125824, 0.5054043531417847, 0.7905621528625488, -0.051437873393297195, 0.32709756493568...
both with a Identity and a sequential GUID as the PK. * I tried it in *SQL Server 2008 Standard* (no special tweaking just default install) as and an Access 2007 database as the back-end. All tables linked back to the front-end. Some of the results (more, with raw data available on [my blog entry about the test](http:...
[ -0.32744359970092773, -0.110875204205513, 0.4405863583087921, 0.03188851848244667, -0.08278463780879974, 0.12825973331928253, 0.13834676146507263, -0.29651498794555664, -0.3086547255516052, -0.48103567957878113, 0.3194866180419922, 0.8579854369163513, 0.06582776457071304, -0.10053959488868...
blog](http://blog.nkadesign.com/2009/access-vs-sql-server-some-stats-part-1/). Thanks to all for your replies, they helped me a lot. My question is whether your test setup represents the reality of your application or not. In short, are you testing the right thing? Is your app going to be appending large numbers o...
[ 0.5654242634773254, 0.09669419378042221, 0.1913059800863266, 0.30244484543800354, -0.42761656641960144, -0.4064694344997406, 0.057896312326192856, 0.1368948519229889, -0.36087217926979065, -0.4418591260910034, 0.4239208698272705, 0.3393706977367401, -0.060539502650499344, -0.12322168797254...
is going to be sent to the SQL Server as a single insert for every single row (every similar to the recordset-based approach in your test code). If you move the same process entirely server-side, it can be done as a batch operation. Also, you should test again using ADO instead of DAO. It may optimize the operation co...
[ 0.23226970434188843, 0.016774002462625504, -0.013990171253681183, 0.23904013633728027, 0.11921589076519012, -0.10509012639522552, -0.07277444750070572, 0.051537781953811646, -0.3548814058303833, -0.48429545760154724, -0.10564234852790833, 0.17746122181415558, -0.0768914595246315, 0.0902308...
to non-GUID-specific topics that may help you optimize your process for maximum efficiency.
[ 0.6562284827232361, -0.10149829834699631, -0.09974880516529083, 0.5450151562690735, -0.11413857340812683, -0.12455804646015167, -0.022938478738069534, 0.46403002738952637, -0.14878544211387634, -0.46481209993362427, -0.23883263766765594, 0.5568673014640808, 0.17766012251377106, -0.02899910...
I'm using PHP and libtidy to attempt to screen scrape what might possibly be the most horrendous and malformed use of HTML tables in history. The site closes few table, tr, td, font, or bold tags and consistently nests many different layers of tables within tables. Example snippet: ``` <center> <table border="1" bord...
[ 0.13732272386550903, 0.285976767539978, 0.3079783618450165, -0.16887614130973816, -0.28566810488700867, 0.23880741000175476, 0.6478822827339172, -0.32290127873420715, -0.31290677189826965, -0.9326156973838806, -0.032842718064785004, -0.09351379424333572, -0.30362051725387573, 0.22333240509...
size="2">44&nbsp;<td> <font size="2">Kemplin, A<tr> <td> <font size="2">77&nbsp;<td> <font size="2">Weiner, B<tr> <td> <font size="2">95&nbsp;<td> <font size="2"> Zytkoskie, D</table> <td valign="top"> <center> <table border="0" cellspacing="0"> <tr> <td> <font size="2">5&nbsp;<td> <font size="2">Mack, A<tr> <td> <font...
[ -0.08324228227138519, 0.4393886625766754, 0.14310070872306824, -0.01575354114174843, -0.1473272740840912, 0.4697433114051819, 0.681206226348877, -0.34492290019989014, -0.4349726140499115, -0.41007593274116516, -0.3885011672973633, 0.12754318118095398, -0.10933661460876465, 0.26777336001396...
nowrap> <font size="2">None<td> <font size="2"> <center> <td> <font size="2"> <center> </table> <td valign="top"> <center> <table border="1" cellspacing="0" width="100%"> <td> <b><font size="2">Player<td> <b><font size="2">Period<td> <b><font size="2">Time<td> <b><font size="2">Assist 1<td> <b><font size="2">Assist 2<t...
[ -0.43073561787605286, 0.10723003000020981, 0.7743539214134216, -0.065559983253479, -0.17484596371650696, 0.05073996260762215, 0.4090536832809448, -0.6149349808692932, -0.39275145530700684, -0.29026490449905396, -0.43270987272262573, -0.025607045739889145, -0.020824262872338295, 0.157679587...
size="2">Name<td> <font size="2"><b>Shots<td> <font size="2"><b>Goals<tr> <td> <font size="2">Baird,&nbsp;T<td> <font size="2">20<td> <font size="2">1<tr> <td> <font size="2"><b>Open Net<td> <td> <font size="2"> 0</table> <td> <center> <table border="1" cellspacing="0" width="100%"> <td> <b><font size="2">Name<td> <fon...
[ -0.10581613332033157, 0.49765726923942566, 0.2727389931678772, -0.0905773937702179, -0.1565437614917755, -0.042999397963285446, 0.6789857149124146, -0.6878623366355896, -0.39216381311416626, -0.7110491394996643, 0.13725173473358154, 0.11273413896560669, 0.04147161543369293, -0.057269725948...
libtidy. It's now formatted beautifully and very easily traversed. Seems like it just needed a little massaging before sending it in to the parser. There's a few tricks you can use to clean up highly-predictable structures like tables. Before running HTML tidy, you can use Regex or something to search for `<tr>`'s and ...
[ -0.09761087596416473, 0.004893509671092033, 0.640702486038208, 0.06846155971288681, -0.3143247961997986, -0.09621027857065201, 0.1987554281949997, 0.062342628836631775, -0.3203403651714325, -1.0222519636154175, 0.028758950531482697, 0.1545470952987671, -0.42716261744499207, -0.093951024115...
is things like unclosed `<div>`'s and `<p>`'s, which can be much harder to match up with their corresponding (or lacking) closers.
[ -0.16841952502727509, 0.08539688587188721, -0.09464156627655029, 0.0848756730556488, 0.014663871377706528, -0.15996955335140228, 0.05040808394551277, -0.012326590716838837, 0.04196210205554962, -0.5741670727729797, -0.4898918569087982, 0.03936939686536789, -0.07171091437339783, -0.08612766...
Hey guys, I'm trying to get my head around LINQ and FP, so forgive me if this is naive. I'm trying to do some string parsing using LINQ and mapping onto a function, so I need to split my string up into smaller strings. I want to split the array up into smaller lists of two. Can I use a reduce (.Aggregate()) to do this...
[ 0.32718995213508606, 0.0728401318192482, -0.12091509252786636, -0.11622195690870285, -0.12564769387245178, -0.04681773856282234, 0.09578868746757507, -0.07676214724779129, -0.2319956123828888, -0.6118476986885071, 0.19337202608585358, 0.5643147230148315, -0.6240782141685486, -0.29666009545...
reduce the list without applying the take to every single element, instead of every second one. Concrete example. > given (1, 2, 3, 4, 5, 6) > > > I want ((1, 2), (3,4), (5, 6)) To clarify: > given "abcdef" > > > I want "ab", "cd", "ef" Cheers for your help guys. ``` Enumerable.Range(0, myString.Length) ...
[ 0.1031583771109581, -0.17170946300029755, 0.4836536943912506, -0.27767667174339294, -0.1061607375741005, 0.1186702772974968, 0.21456681191921234, -0.6040359139442444, -0.20813001692295074, -0.649073600769043, -0.14827115833759308, 0.665789008140564, -0.5228570699691772, -0.1245823651552200...
Index = i, Element = e }) .GroupBy(x => x.Index / 2, x => x.Element); ```
[ -0.41556107997894287, 0.004267041105777025, 0.31950584053993225, -0.27462777495384216, 0.06030689924955368, -0.11075536906719208, 0.18465469777584076, -0.3007049262523651, 0.17960762977600098, -0.44874444603919983, -0.4345574676990509, 0.3213072419166565, -0.7105578780174255, 0.30576595664...
I need to automate [FileMon.exe](http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx) to startup with filters, save out the log it generates, and then exit. My solution has been to write an assist application that will do all of this. Which has worked on starting up with specified filters and killing the pro...
[ 0.038645680993795395, 0.14915317296981812, 0.11465290188789368, 0.2651037573814392, -0.08626092225313187, -0.16800737380981445, 0.5133830904960632, -0.08696828782558441, -0.2360536754131317, -0.7898113131523132, -0.030513189733028412, 0.6696085333824158, -0.4121447801589966, 0.009166116826...
help guys... I'm actually going to write and invoke a perl script using Win32::GuiTest.
[ 0.09869521111249924, -0.009338394738733768, 0.2835008502006531, 0.3179083466529846, -0.06040436029434204, -0.3198607563972473, 0.3940574526786804, 0.1694084256887436, 0.1596408188343048, -0.6345351934432983, 0.08570441603660583, 0.8520459532737732, -0.10629609227180481, -0.3912062644958496...
Ok I have been working on this gallery for some time and I keep getting little tidbits. It is now time to finish it off. I have a datalist which binds to an array of \*.aspx image urls that contain a thumbnail id that is sent through the url. I now need to implement an onclick event, that when a user clicks on a photo,...
[ 0.6244765520095825, -0.09146611392498016, 0.8066146969795227, -0.06386205554008484, 0.05044176056981087, -0.21881072223186493, 0.16337823867797852, -0.1162787526845932, -0.5184534788131714, -0.44865161180496216, 0.16150623559951782, 0.5384030342102051, -0.04766404256224632, 0.2725253403186...
onclick to the imag src but it didn't work. It is difficult because it is not an actual image control, they exist inside a datalist. I also need to know how to extract the thumbnail url when getting clicked so that I can grab the id and redirect to the actual picture. Help please! ``` <asp:DataList ID="dlImages" runat...
[ 0.011097077280282974, -0.25464245676994324, 0.9601612091064453, 0.20003704726696014, -0.07171354442834854, 0.019528839737176895, 0.19207896292209625, -0.33082616329193115, -0.20929837226867676, -0.5464972257614136, 0.014007427729666233, 0.5716188549995422, -0.3605608344078064, 0.1539746224...
tag? ``` <ItemTemplate> <a href="<%# ResolveUrl(String.Format("~/UserPages/Photo/GetPhoto.aspx?id={0}", Container.DataItem)) %>"><img src="<%# ResolveUrl(String.Format("~/UserPages/Photo/GetThumbnail.aspx?id={0}", Container.DataItem)) %>" /></a> </ItemTemplate> ``` This assumes your `DataItem` contains only the ...
[ 0.09155895560979843, -0.013963001780211926, 0.5886744856834412, -0.052026621997356415, 0.17111411690711975, -0.0066650668159127235, -0.010312092490494251, -0.7479552030563354, 0.009631055407226086, -0.3600400686264038, -0.28890103101730347, 0.7111825346946716, -0.463421106338501, -0.253755...
I am using XNA and I want to save files to Vista's "Saved Games" folder. I can get similar special folders like My Documents with `Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)` but I cannot find an equivalent for the Saved Games folder. How do I get to this folder? <http://msdn.microsoft.com/en-us/...
[ 0.35626864433288574, 0.1983829289674759, 0.3943859338760376, 0.04086395353078842, 0.4062976837158203, -0.32353419065475464, 0.061282843351364136, 0.03809897601604462, -0.031861402094364166, -0.8712463974952698, 0.032833728939294815, 0.6958373188972473, -0.00488935736939311, 0.4797694087028...
of the user who is currently > logged in, in the SavedGames folder. A > subfolder is created for each game > according to the titleName passed to > the OpenContainer method. When no > PlayerIndex is specified, content is > saved in the AllPlayers folder. When a > PlayerIndex is specified, the content > is saved...
[ -0.0757523700594902, -0.12562623620033264, 0.7081766724586487, -0.013108610175549984, 0.2310868203639984, -0.21139389276504517, 0.03465333208441734, -0.038249194622039795, -0.20399577915668488, -0.6190223097801208, -0.48594236373901367, 0.6038011312484741, -0.21146398782730103, 0.366560637...
I'm doing some local development using Django and Satchmo. When I upload product images locally via the admin, the path to the image shows up as an absolute path, complete with drive letter, rather than the proper relative path. Stranger still, Satchmo saves both the original image and the thumbnails it generates in b...
[ 0.2766469717025757, 0.10335652530193329, 0.7729958891868591, -0.39397189021110535, -0.013846239075064659, 0.18649356067180634, 0.3167267441749573, -0.12187596410512924, -0.1764359474182129, -0.8480480313301086, -0.17144691944122314, 0.8791310787200928, -0.15234729647636414, 0.0056163719855...
the word 'media' anywhere in it, so I'm sure there are no setting overrides. If it helps, I'm on Windows, but I'm using all the proper unix notation for my paths. <http://msdn.microsoft.com/en-us/library/bb200105.aspx#ID2EWD> Looks like you'll need to use Microsoft.Xna.Framework.Storage and the StorageLocation class ...
[ 0.2423868179321289, 0.05295201763510704, 0.7496996521949768, 0.24852882325649261, 0.38232871890068054, -0.4647351801395416, 0.02510085515677929, 0.11402574181556702, -0.2583470642566681, -1.10822331905365, -0.13246507942676544, 0.6664103269577026, -0.08488316088914871, 0.4384270906448364, ...
A > subfolder is created for each game > according to the titleName passed to > the OpenContainer method. When no > PlayerIndex is specified, content is > saved in the AllPlayers folder. When a > PlayerIndex is specified, the content > is saved in the Player1, Player2, > Player3, or Player4 folder, depending > ...
[ -0.3424280881881714, -0.3379063308238983, 0.720043957233429, 0.04948929324746132, -0.038765501230955124, -0.16061025857925415, -0.03410226106643677, -0.22408455610275269, -0.05031535029411316, -0.6282739639282227, -0.4067029654979706, 0.37594282627105713, -0.3320657014846802, 0.37922078371...
I am trying to compress TCP packets each one of about 4 KB in size. The packets can contain any byte (from 0 to 255). All of the benchmarks on compression algorithms that I found were based on larger files. I did not find anything that compares the compression ratio of different algorithms on small files, which is what...
[ 0.14886896312236786, 0.11414355784654617, 0.41189146041870117, -0.1215101107954979, -0.03219088539481163, 0.3579753041267395, 0.2001131922006607, -0.40525275468826294, -0.1728784739971161, -0.8155307173728943, -0.19776667654514313, 0.48017963767051697, -0.34812334179878235, -0.140032693743...
that is the quickest, since you probably care about doing this in real time. Generally for smaller blocks of data, the algorithms compress about the same (give or take a few bytes) mostly because the algorithms need to transmit the dictionary or Huffman trees in addition to the payload. I highly recommend Deflate (use...
[ 0.19338315725326538, 0.0916202962398529, 0.44540488719940186, 0.07741732150316238, -0.03178563341498375, -0.09471599012613297, 0.032322678714990616, -0.14201249182224274, 0.056207701563835144, -0.687923789024353, -0.3485639989376068, 0.5967718362808228, -0.375284880399704, -0.2159395068883...
the decompressed size, there's a STORE mode which only adds 5 bytes for every block of data (max block is 64k bytes). Aside from the STORE mode, Deflate supports two different types of Huffman tables (or dictionaries): dynamic and fixed. A dynamic table means the Huffman tree is transmitted as part of the compressed da...
[ -0.15487731993198395, -0.2096421718597412, 0.5158891677856445, 0.2426193654537201, -0.29046812653541565, 0.2437276840209961, 0.2821107804775238, -0.3322223126888275, -0.22565513849258423, -0.2560192048549652, -0.3894064426422119, 0.42470890283584595, -0.5230439305305481, -0.217225268483161...
I've written both Java and Javascript versions based directly off of zlib and they perform rather well. The other compression algorithms mentioned have their merits. I prefer Deflate because of its runtime performance on both the compression step and particularly in decompression step. A point of clarification: Zip i...
[ 0.12697339057922363, 0.1698121875524521, 0.18989917635917664, 0.02501213178038597, -0.5373937487602234, -0.21657425165176392, -0.050466593354940414, -0.025950565934181213, 0.09757845848798752, -0.7494568228721619, 0.12005531042814255, 0.4445767402648926, -0.40943628549575806, 0.08559770882...
I want to make my own malloc/free so I can make a precise copying allocator. Any gurus have any tips and suggestions? I have a few questions for now: 1. Should I just malloc large chunks of memory, and then distribute from that so I don't have to call the system calls? 2. How are copying collectors usually done? I w...
[ 0.6759158372879028, -0.005986603908240795, -0.20615039765834808, 0.5566975474357605, -0.07493655383586884, -0.1133771613240242, -0.19304564595222473, -0.016445957124233246, -0.22175826132297516, -0.5327237248420715, 0.1732858419418335, 0.5376659631729126, -0.10463739186525345, 0.1947424709...
but I notice that you include C++ here -- are you aware that you can write your own implementation of `new` and `delete` in C++? That might be useful as a way to do it easily. In any case, the characteristics you want are going to depend pretty heavily on your workload, that is, on the pattern of usage over time. If y...
[ 0.3532274663448334, 0.168905571103096, -0.20347623527050018, 0.26096829771995544, 0.040093179792165756, -0.0743933618068695, -0.13430459797382355, -0.09659789502620697, -0.5638599991798401, -0.40855902433395386, -0.13458871841430664, 0.6427473425865173, -0.22053688764572144, -0.09717949479...
together, but C isn't that smart. The basic implementation of malloc simply allocates a header that contains the data length, an "in use flag", and the malloced memory. Malloc then constructs a new header at the end of its space, allocates the memory, and returns a pointer. When you free, it just resets the in use fla...
[ 0.16878974437713623, -0.09792661666870117, 0.12076102197170258, 0.14981377124786377, -0.013344721868634224, -0.11826548725366592, -0.17247538268566132, -0.19945059716701508, -0.25055187940597534, -0.579017698764801, -0.27205708622932434, 0.30859217047691345, -0.38781026005744934, -0.044875...
do a more complicated gc, but remember that takes time; you don't want a free to take up a lot of time. There's a [nice paper](http://developers.sun.com/solaris/articles/multiproc/multiproc.html) on Solaris malloc implementations you might find interesting. Here's another [on building an alternative malloc](http://www...
[ 0.3809398412704468, -0.31595468521118164, 0.1551019549369812, 0.31622907519340515, -0.24829566478729248, -0.2532643675804138, -0.39027929306030273, -0.1333007961511612, -0.5023672580718994, -0.6535778641700745, -0.24114350974559784, 0.5090672969818115, -0.32775381207466125, -0.044846653938...
is an extension of the "copying" GC you mention. Basically, you allocate new stuff in one part of your memory pool, call it g0. When you reach a high water mark on that, you look through the allocated blocks and copy the ones that are still in use to another section of memory, call it g1, Then you can just clear the g0...
[ 0.12387599050998688, -0.06797787547111511, 0.23840436339378357, 0.28255945444107056, -0.02755739912390709, 0.09345950186252594, -0.2811734676361084, 0.0632447823882103, -0.5332735180854797, -0.4305408298969269, -0.19484105706214905, -0.11275918036699295, -0.23195351660251617, 0.37419217824...
as g0 and vice versa and continue. The trick is that in C especially, the handles you hand out to malloc'ed memory are straight raw pointers; you can't really move things around without some heap big medicine. ### Second update In comments, @unknown asks "Wouldn't moving stuff around just be a memcpy()". And indeed ...
[ 0.1295676976442337, -0.06026242673397064, 0.5748465657234192, 0.201642245054245, 0.09196740388870239, -0.1194450855255127, -0.1534833014011383, -0.05302341654896736, -0.503157377243042, -0.4824005961418152, -0.13671554625034332, 0.3594196140766144, -0.0858851745724678, -0.06971033662557602...
succeded */ if((myMemoryHdl = newMalloc(SIZE)) == NULL) exit(-1); ``` In your implementation of malloc, you create the memory and return a pointer to the buffer. ``` unsigned char * nextUnusued = &lotsOfMemory[0]; int partitionSize = (int)(LOTS/2); int hwm = (int) (partition/2); /* So g0 will be the bottom half ...
[ -0.3177763819694519, -0.5047089457511902, 0.8155105710029602, -0.2414834350347519, 0.4400123357772827, 0.14240673184394836, 0.07977598905563354, -0.32911527156829834, -0.2855583131313324, -0.6285141110420227, -0.46140772104263306, 0.2945147156715393, -0.27536463737487793, 0.241331920027732...
newHeader(nextUnused); /* includes some pointers for chaining * and a field with values USED or FREE, * set to USED */ nextUnused += HEADERLEN ; /* this could be niftier */
[ 0.02641150914132595, -0.4424910247325897, 0.5068738460540771, -0.08667152374982834, 0.34489038586616516, -0.17479771375656128, 0.2826499938964844, -0.28446489572525024, -0.17753836512565613, -0.5981102585792542, -0.18196916580200195, 0.5286279320716858, -0.3430899381637573, 0.0937612578272...
rtn = nextUnused ; nextUnused += size ; } ``` Some of the things are freed ``` newFree(void * aHandle){ *(aHandle-offset) = FREE ; /* set the flag in the header, * using an offset. */ } ``` So now you do all the stuff and you get to your high water mark. ``` for( /* ...
[ 0.20562797784805298, -0.10545948147773743, 0.5160697102546692, -0.16981756687164307, 0.34846264123916626, -0.23696865141391754, 0.37665852904319763, -0.46629798412323, -0.39685744047164917, -0.48424646258354187, -0.16037604212760925, 0.6946764588356018, -0.034598205238580704, 0.01410840358...
if( /* block header is still marked USED */ ) { memcpy(/* block into other partition */); } /* clear the partition */ bzero(g0, partitionSize); ``` Now, go back to the original handle you saved in myMemHdl. What does it point to? (Answer, you just set it to 0x00 with bzero(3).) That's where the magic c...
[ 0.14138981699943542, -0.09273188561201096, 0.5701282620429993, -0.027889389544725418, 0.14764246344566345, -0.2865470051765442, 0.3124837279319763, -0.29359737038612366, -0.23308970034122467, -0.588080883026123, -0.21969963610172272, 0.5300348997116089, -0.022481294348835945, 0.02619954384...
can fix that.
[ 0.4012698233127594, 0.13810694217681885, 0.11942490190267563, 0.39509618282318115, 0.3655528724193573, 0.10462326556444168, 0.002734969137236476, 0.05305406451225281, -0.007574224378913641, -0.44312363862991333, -0.20884986221790314, 0.1690201759338379, 0.04864218458533287, -0.079538717865...
I really should be able to get this, but I'm just to the point where I think it'd be easier to ask. In the C# function: ``` public static T GetValue<T>(String value) where T:new() { //Magic happens here } ``` What's a good implementation for the magic? The idea behind this is that I have xml to parse and the des...
[ 0.4010705351829529, 0.05342398211359978, 0.3373827338218689, 0.204231858253479, -0.22646638751029968, -0.2099044919013977, 0.2963707447052002, -0.07295054197311401, -0.02730441279709339, -0.6198703646659851, -0.01993715949356556, 0.544783353805542, -0.16338779032230377, 0.10004162788391113...
<ItemType>PIANO</ItemType> <Name>A Yamaha piano</Name> <properties> <allowUpdates>false</allowUpdates> <allowCopy>true</allowCopy> </properties> </item> <item> <ItemType>PIANO_BENCH</ItemType> <Name>A black piano bench</Name> <properties...
[ -0.1670980453491211, 0.25562942028045654, 0.06860514730215073, 0.22511644661426544, -0.057361096143722534, 0.48084717988967896, -0.2073524445295334, -0.6591425538063049, -0.38577744364738464, -0.4364733397960663, -0.14892113208770752, 0.19844773411750793, -0.18439742922782898, 0.5454075932...
<allowUpdates>true</allowUpdates> <allowCopy>false</allowCopy> <url>www.yamaha.com</url> </properties> </item> <item> <ItemType>DESK_LAMP</ItemType> <Name>A Verilux desk lamp</Name> <properties> <allowUpdates>true</allowUpdates> <al...
[ 0.3317981958389282, -0.08620603382587433, 0.7961312532424927, 0.3209332823753357, -0.18212059140205383, 0.09507114440202713, -0.2507419288158417, -0.6735188961029053, -0.0841159075498581, -0.45610693097114563, 0.022302359342575073, 0.28175362944602966, -0.08792370557785034, 0.0427343919873...
<quantity>2</quantity> </properties> </item> </Items> ``` I would suggest instead of trying to parse XML yourself, you try to create classes that would deserialize from the XML into the classes. I would **strongly** recommend following bendewey's answer. But if you cannot do this, there is hope. You can u...
[ 0.3983917236328125, -0.23986685276031494, 0.21197302639484406, -0.06692378222942352, -0.25735539197921753, 0.03867195174098015, 0.17891918122768402, -0.48374077677726746, -0.138766348361969, -0.6396620273590088, -0.2079957127571106, 0.5697426199913025, -0.3553308844566345, 0.20462726056575...
Suppose I have a sequence of numbers: {n, n+1, n+2, ... n + m} Without storing the numbers ahead of time I want to create a function f(), which given the sequence {1,2,3,...m} will spit out the original set in a random (or at least pseudo random) order. For example assume my sequence is {10, 11, 12, 13, 14, 15, 16, 1...
[ 0.029954956844449043, 0.12859396636486053, 0.18770717084407806, -0.4395172894001007, -0.01847279816865921, 0.6750049591064453, 0.20027895271778107, -0.44973376393318176, -0.15751633048057556, -0.4382520318031311, -0.40952467918395996, 0.626288652420044, -0.24537770450115204, 0.188931703567...
11 f(8) could yield 12 ``` At one point in the past a co-worker showed me a mathematical algorithm that was able to do this, but I have since forgotten almost everything about it other than it existed. I remember that you had to have the sequence in advance, and generate some constants from the sequence which were...
[ 0.3417513370513916, 0.3940187990665436, 0.07320199906826019, -0.16070929169654846, 0.08435602486133575, 0.15209749341011047, -0.07209374010562897, -0.24899910390377045, -0.4254577159881592, -0.2415323406457901, -0.12211322784423828, 0.5443333387374878, -0.474850594997406, -0.04126021265983...
ahead of time. --- **Edit:** To clarify a little more I don't want to store the original sequence, or the shuffled sequence. I want to generate a function f() from the original sequence. What is frustrating is that I have seen this, I just cannot remember enough about it to find it again with google. The Fisher-Ya...
[ -0.015580368228256702, -0.03033941239118576, 0.23498663306236267, -0.13311339914798737, 0.13291864097118378, 0.27007272839546204, -0.16500619053840637, -0.35476893186569214, -0.378181517124176, -0.7442179322242737, -0.008149455301463604, 0.528040885925293, -0.34588369727134705, 0.256641507...
generates a permutation (no repeats on `0<=i<m`). It works better if `k` is larger than `m`. For example, m=20, let k=137 (Python code, `%` means modulo): ``` >>> [(137*i) % 20 for i in range(20)] [0, 17, 14, 11, 8, 5, 2, 19, 16, 13, 10, 7, 4, 1, 18, 15, 12, 9, 6, 3] ``` This is a very simple PRNG, no guarantees ...
[ -0.15031467378139496, -0.06637915223836899, 0.3549455404281616, -0.38461601734161377, 0.0003085202188231051, 0.38699957728385925, 0.42265596985816956, -0.6322746872901917, -0.12647807598114014, -0.07850424945354462, 0.002689199987798929, 0.1366424262523651, -0.1801234930753708, 0.419145643...
If i want to extend a class like AVAudioPlayer, whats the best way to also add another method to AVAudioPlayerDelegate? Should I make a category for it, do I extend it? If I extend it do I then also have to make sure to overwrite the actual delegate getter/setter? How would I extend the protocol? The following gives...
[ 0.0511615090072155, -0.02167094312608242, 0.6482557654380798, -0.116462342441082, 0.2471909373998642, -0.19722098112106323, 0.13331402838230133, -0.5552868247032166, 0.03615564480423927, -0.6652112007141113, 0.006466537248343229, 0.7722790241241455, -0.568353533744812, 0.1660699099302292, ...
can either call `respondsToSelector`: ``` if ([object respondsToSelector:@selector(foo)]) [(id)object foo]; ``` Or define stub methods as a category on `NSObject`: ``` @interface NSObject (NewProtocol) - (void)foo; @end @implementation NSObject (NewProtocol) - (void)foo { } @end ```
[ -0.1319688856601715, -0.1423773616552353, 0.2521493434906006, -0.16632194817066193, -0.340567946434021, 0.21634472906589508, -0.017014717683196068, -0.27561265230178833, -0.019796451553702354, -0.4902847111225128, -0.10041111707687378, 0.47591158747673035, -0.41617849469184875, 0.025657990...
All HTTP responses require the client to initiate them, even those made using AJAX. But GMail's chat feature is able to receive messages from other users, even when I'm just sitting in my comfy computer chair watching but not interacting with the browser. How did they do it? That tech is known as "comet", but also as "...
[ 0.26694685220718384, -0.1002466157078743, 0.2314012050628662, 0.2835526466369629, -0.09895997494459152, -0.008876694366335869, 0.10194599628448486, 0.27848294377326965, -0.3162476122379303, -0.4289858341217041, -0.10738273710012436, 0.18568269908428192, -0.2098330408334732, -0.448278039693...
talks about comet.
[ 0.10150949656963348, 0.20266669988632202, 0.1387132853269577, 0.3817858099937439, -0.10670057684183121, -0.47266221046447754, -0.12144602835178375, 0.4798392057418823, -0.39043137431144714, -0.1512603759765625, -0.19769525527954102, 0.025255393236875534, -0.2009204626083374, 0.158136650919...
I have a database table that uses Sql Server 2005's uniqueidentifier column. I know how to create GUIDs in C#... ``` string newid = System.Guid.NewGuid().ToString(); ``` However, the application that is inserting into this database is running Java. Is there a way to generate Sql-Server-compatible GUIDs using Java ...
[ 0.06215551495552063, 0.36526116728782654, 0.4253712296485901, -0.14584602415561676, -0.13914424180984497, -0.17252767086029053, 0.25238582491874695, -0.13864979147911072, -0.047940533608198166, -0.7414838075637817, 0.16535480320453644, 0.5962035059928894, -0.27668026089668274, 0.1418369710...
I have a problem. I try to display a `UITable` that could have 2000-20000 records (typicall numbers.) I have a [SQLite](http://en.wikipedia.org/wiki/SQLite) database similar to the Apple contacts application. I do all the tricks I know to get a smoth scroll, but I have a problem. I load the data in 50 recods blocks....
[ 0.29971417784690857, 0.26245367527008057, 0.47057077288627625, 0.1448410153388977, 0.13689592480659485, 0.12168505787849426, 0.3846001625061035, -0.1620057076215744, -0.25397980213165283, -0.720911979675293, 0.262256920337677, 0.5212907195091248, -0.25828462839126587, 0.23673361539840698, ...
a performance boost but wonder if I could keep my object oriented aproach and improve the actual code. This is the code I think have the performance problem: ``` -(NSArray *) loadAndFill: (NSString *)sql theClass: (Class)cls { [self openDb]; NSMutableArray *list = [NSMutableArray array]; ...
[ -0.2936558425426483, -0.28369390964508057, 0.35392674803733826, -0.13553635776042938, -0.275778204202652, -0.18171344697475433, 0.4644676744937897, -0.31829649209976196, -0.12954285740852356, -0.5047886371612549, -0.05531426519155502, 0.7757450938224792, -0.1593930572271347, -0.02308013662...
FMResultSet *rs = [self load:sql]; while ([rs next]) { ds = [[myClass alloc] init]; NSDictionary *props = [ds properties]; NSString *fieldType = nil; id fieldValue; for (NSString *fieldName in [props allKeys]) {
[ -0.4434199333190918, -0.32380759716033936, 0.8184860348701477, -0.36909759044647217, 0.18235795199871063, 0.11014396697282791, 0.5640428066253662, -0.7285805940628052, -0.22694547474384308, -0.2869933247566223, -0.4899291694164276, 0.8070608377456665, -0.11536789685487747, 0.16654337942600...
fieldType = [props objectForKey: fieldName]; fieldValue = [self ValueForField:rs Name:fieldName Type:fieldType]; [ds setValue:fieldValue forKey:fieldName]; } [list addObject :ds]; [ds release]; }
[ -0.31493157148361206, -0.40023109316825867, 0.3836197853088379, -0.3531807065010071, -0.3094266653060913, 0.11959950625896454, 0.3848895728588104, -0.5543321967124939, -0.10300233960151672, -0.3583330512046814, -0.562819242477417, 0.5736300945281982, -0.1575755923986435, 0.1094409450888633...
[rs close]; [pool drain]; return list; } ``` And I think the main culprit is: ``` -(id) ValueForField: (FMResultSet *)rs Name:(NSString *)fieldName Type:(NSString *)fieldType { id fieldValue = nil; if ([fieldType isEqualToString:@"i"] || // int [fieldType is...
[ -0.3836583197116852, -0.009331193752586842, 0.5356002449989319, -0.32429206371307373, 0.17338433861732483, -0.038838163018226624, 0.2643144428730011, -0.6685501933097839, -0.3153943717479706, -0.25612112879753113, -0.14510312676429749, 0.755742073059082, -0.21927127242088318, 0.37862810492...
[fieldType isEqualToString:@"s"] || // short [fieldType isEqualToString:@"S"] || // unsigned short [fieldType isEqualToString:@"f"] || // float [fieldType isEqualToString:@"d"] ) // double {
[ 0.2221386432647705, -0.11712167412042618, -0.009176629595458508, -0.20302091538906097, -0.10133357346057892, 0.0638427585363388, 0.308963418006897, -0.5100425481796265, 0.04946921765804291, -0.1358337551355362, -0.25675857067108154, 0.5619270205497742, -0.4712508022785187, -0.4126517176628...
fieldValue = [NSNumber numberWithInt: [rs longForColumn:fieldName]]; } else if ([fieldType isEqualToString:@"B"]) // bool or _Bool { fieldValue = [NSNumber numberWithBool: [rs boolForColumn:fieldName]]; } else if ([fieldType isEqualToString:@"l"] || // long ...
[ -0.3989541828632355, -0.2918865382671356, 0.3987411856651306, -0.5024504661560059, 0.1920398473739624, -0.0669831782579422, 0.13163912296295166, -0.30796557664871216, -0.10152419656515121, -0.22890618443489075, -0.38503941893577576, 0.9443199038505554, -0.14734116196632385, -0.248544082045...
[fieldType isEqualToString:@"q"] || // long long [fieldType isEqualToString:@"Q"] ) // unsigned long long { fieldValue = [NSNumber numberWithLong: [rs longForColumn:fieldName]]; } else if ([fieldType isEqualToString:@"c"] || // char
[ -0.2653483748435974, -0.2990650236606598, 0.3191545903682709, -0.4326687455177307, 0.2515357732772827, -0.017522895708680153, 0.2890929877758026, -0.4710034728050232, -0.06087817624211311, -0.008088733069598675, -0.2868172526359558, 0.66678386926651, -0.11124800890684128, -0.01082592736929...
[fieldType isEqualToString:@"C"] ) // unsigned char { fieldValue = [rs stringForColumn:fieldName]; //Is really a boolean? if ([fieldValue isEqualToString:@"0"] || [fieldValue isEqualToString:@"1"]) { fieldValue = [NSNumber numberWithInt: [fieldValue intValue]...
[ -0.06863127648830414, -0.2688313126564026, 0.3271839916706085, -0.40609827637672424, -0.03603431209921837, -0.17397066950798035, 0.47453582286834717, -0.33921584486961365, -0.05984504893422127, 0.03948930278420448, -0.2641178369522095, 0.6574689149856567, -0.12287503480911255, -0.068096682...
} } else if ([fieldType hasPrefix:@"@"] ) // Object { NSString *className = [fieldType substringWithRange:NSMakeRange(2, [fieldType length]-3)]; if ([className isEqualToString:@"NSString"]) { fieldValue = [rs stringForColumn:fieldName]; }
[ -0.2491600215435028, -0.3630460202693939, 0.5649598240852356, -0.3200419545173645, 0.17457127571105957, -0.0425843708217144, 0.31577298045158386, -0.5514745712280273, -0.3804168403148651, -0.39815273880958557, -0.3427198529243469, 0.6924259662628174, -0.055034007877111435, 0.00674853287637...
else if ([className isEqualToString:@"NSDate"]) { NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss"]; NSString *theDate = [rs stringForColumn:fieldName]; if (theDate) {
[ 0.15383802354335785, -0.6010304689407349, 0.7220631241798401, -0.19150179624557495, 0.006731556262820959, -0.0019513617735356092, 0.21588531136512756, -0.7506657838821411, -0.25780224800109863, -0.22933277487754822, -0.31732702255249023, 0.3949422836303711, -0.06388447433710098, 0.01331095...
fieldValue = [dateFormatter dateFromString: theDate]; } else { fieldValue = nil; }
[ -0.16943246126174927, -0.5648697018623352, 0.15277844667434692, -0.43447577953338623, 0.32561928033828735, 0.04758147895336151, 0.20418912172317505, -0.15192098915576935, -0.007964225485920906, -0.2908363938331604, -0.09239226579666138, 0.5853847861289978, -0.015149311162531376, 0.34120643...
[dateFormatter release]; } else if ([className isEqualToString:@"NSInteger"]) { fieldValue = [NSNumber numberWithInt: [rs intForColumn :fieldName]]; } else if ([className isEqualToString:@"NSDecimalNumber"]) {
[ -0.23809148371219635, -0.540568470954895, 0.555358350276947, -0.29197582602500916, 0.21982833743095398, 0.04744008928537369, 0.3036504089832306, -0.4349161386489868, -0.17112022638320923, -0.384652704000473, -0.17677079141139984, 0.6196976900100708, 0.01458740234375, 0.25536689162254333, ...
fieldValue = [rs stringForColumn :fieldName]; if (fieldValue) { fieldValue = [NSDecimalNumber decimalNumberWithString:[rs stringForColumn :fieldName]]; } } else if ([className isEqualToString:@"NSNumber"]) {
[ -0.4606417417526245, -0.3030564785003662, 0.3990628123283386, -0.49829381704330444, 0.13458815217018127, 0.04562430456280708, 0.16046859323978424, -0.42239609360694885, -0.19008992612361908, -0.1991869956254959, -0.2693478465080261, 0.8089051246643066, -0.020221276208758354, -0.06300232559...
fieldValue = [NSNumber numberWithDouble: [rs doubleForColumn:fieldName]]; } else { //Is a relationship one-to-one? if (![fieldType hasPrefix:@"NS"]) {
[ -0.13185091316699982, -0.31026333570480347, 0.40379202365875244, -0.37299832701683044, 0.08545626699924469, -0.08120686560869217, 0.2501584589481354, -0.27680253982543945, -0.13648244738578796, -0.25963181257247925, -0.13242770731449127, 0.724409818649292, -0.20948655903339386, -0.08146855...
id rel = class_createInstance(NSClassFromString(className), sizeof(unsigned)); Class theClass = [rel class]; if ([rel isKindOfClass:[DbObject class]]) { fieldValue = [rel init];
[ -0.12646661698818207, -0.47296208143234253, 0.3296594023704529, -0.24007725715637207, -0.010000227950513363, 0.2334977239370346, 0.5907464027404785, -0.8714826107025146, 0.0570988692343235, -0.39454561471939087, -0.2670319378376007, 0.7797669768333435, -0.2782990634441376, 0.07765998691320...
//Load the record... NSInteger Id = [rs intForColumn:[theClass relationName]]; if (Id>0) {
[ 0.029003944247961044, -0.1335367113351822, 0.2103622853755951, -0.22972574830055237, 0.2543833553791046, -0.07057411223649979, 0.2702452540397644, -0.40298324823379517, -0.34311288595199585, -0.11231664568185806, -0.1312437802553177, 0.4758548140525818, -0.30298134684562683, 0.241388782858...
[fieldValue release]; Db *db = [Db currentDb]; fieldValue = [db loadById: theClass theId:Id]; }
[ -0.20958586037158966, -0.3878955841064453, 0.12986990809440613, -0.33693671226501465, 0.12961053848266602, -0.15370376408100128, 0.2871759533882141, -0.321023553609848, 0.1697053462266922, -0.0756673514842987, -0.3590959310531616, 0.7110157012939453, -0.3761388957500458, 0.3232997357845306...
} } else { NSString *error = [NSString stringWithFormat:@"Err Can't get value for field %@ of type %@", fieldName, fieldType]; NSLog(error);
[ -0.34864258766174316, -0.07020582258701324, 0.316756933927536, -0.5658689737319946, 0.20312511920928955, 0.18472820520401, 0.7672955393791199, -0.29677721858024597, 0.15539875626564026, -0.31279993057250977, -0.10089993476867676, 0.8674675226211548, -0.20084168016910553, 0.1066559925675392...
NSException *e = [NSException exceptionWithName:@"DBError" reason:error
[ -0.3627094626426697, 0.09531896561384201, -0.15789255499839783, -0.03067677840590477, -0.04767218604683876, 0.11831003427505493, 0.5277747511863708, -0.055096738040447235, -0.09738289564847946, -0.5224488973617554, -0.005318861920386553, 0.6186597347259521, -0.20991268754005432, 0.29698082...
userInfo:nil]; @throw e; } } } return fieldValue; } ``` The "f" above is a type suffix. This
[ -0.34865662455558777, -0.0941220223903656, 0.30926334857940674, -0.3722246289253235, 0.05476705729961395, -0.11827341467142105, 0.23721659183502197, -0.031249361112713814, 0.014788470230996609, -0.5616567134857178, -0.27041149139404297, 0.6904894113540649, -0.17056550085544586, 0.182469874...