text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
WHOAMI (interactive prefix) non-nil means prompt for user
name and email (stored in `add-log-full-name' and `add-log-mailing-address').
Second arg FILE-NAME is file name of the change log.
If nil, use the value of `change-log-default-name'.
Third arg OTHER-WINDOW non-nil means visit in other window.
Fourth arg NEW-E... | [
0.016718711704015732,
-0.15480752289295197,
0.7082404494285583,
-0.005830120760947466,
-0.1353381723165512,
0.17060349881649017,
0.22366388142108917,
-0.30060875415802,
-0.27741578221321106,
-0.36737295985221863,
-0.293092280626297,
0.3688039183616638,
-0.14264123141765594,
0.0119093451648... | |
The first blank line indicates the end of these
notices.
Today's date is calculated according to `add-log-time-zone-rule' if
non-nil, otherwise in local time."
```
so the magic code is going to look something like
```
(apply 'make-magic-change-log-entry changed-files-list)
```
and `make-magic-change-log-entry` sim... | [
0.2785804867744446,
-0.0024096285924315453,
1.1073578596115112,
-0.11534061282873154,
0.302661657333374,
-0.30712980031967163,
0.23717904090881348,
-0.1449316293001175,
-0.31531161069869995,
-0.6154583692550659,
-0.23469556868076324,
0.032398782670497894,
0.1531020849943161,
0.402950942516... | |
When should I use messages versus C-style functions?
Objective-c makes that distinction for you. Messages *must* be sent to objects, but functions can be used at any time.
**[messages](http://en.wikipedia.org/wiki/Objective-C#Messages)**:
Objective-C messages can only be sent to objects, and the messaging system is *... | [
0.06700033694505692,
0.27537721395492554,
0.13157212734222412,
-0.2434353530406952,
-0.27694204449653625,
-0.19901010394096375,
0.14505618810653687,
-0.17012350261211395,
-0.01445741392672062,
-0.4089279770851135,
-0.3259267807006836,
0.6404026746749878,
-0.6489679217338562,
-0.23548246920... | |
objects are simply passed around as pointers, so you can still pass them to functions as arguments. The usual cautions and rules about passing pointers to functions should, of course, be respected.
Example:
```
// a regular C-style function
void someFunction(ANObject * argument)
{
// do something here...
}
```
... | [
0.13732637465000153,
0.01647339016199112,
0.1747168004512787,
0.009860065765678883,
-0.17556224763393402,
-0.12523716688156128,
0.3377748429775238,
0.11332690715789795,
-0.1857115775346756,
-0.3423948585987091,
-0.37240058183670044,
0.45392194390296936,
-0.17703305184841156,
-0.05465701967... | |
a task that does not belong to a class; something that should stand alone. Good examples would be mathematical functions such as:
```
double degrees = ConvertRadiansToDegrees(radians);
``` | [
0.23180285096168518,
-0.037154633551836014,
-0.24493665993213654,
0.15203571319580078,
-0.09870629012584686,
-0.0397380106151104,
0.20537270605564117,
-0.39730218052864075,
-0.08132779598236084,
-0.3470471501350403,
-0.29763197898864746,
0.32726725935935974,
-0.10658644884824753,
0.2922508... | |
I'm curious what your solution is for high performance XML parsing on the iPhone is, given its limited amount of CPU power. I have reviewed the XML Performance App that Apple provides as a demonstration, and it seems that for the data feed (300 iTunes songs) that they're parsing.. libxml2 always seem to come as the for... | [
-0.04581516608595848,
0.20494478940963745,
0.33160853385925293,
0.27079594135284424,
-0.036754291504621506,
0.05974475294351578,
0.23637287318706512,
0.008277193643152714,
-0.3168654441833496,
-0.5623674392700195,
0.022736135870218277,
0.8315677642822266,
0.06479927897453308,
-0.2638007998... | |
found for larger chunks of data (like the apple example you reference) libxml2 tends to be faster. For smaller chunks of data, the difference is negligible. One advantage i like about NSXMLParser is that it is an Objective-C based implementation of an XML Parser where libxml2 is C based. | [
-0.2460482120513916,
0.06071992963552475,
0.46692365407943726,
0.04090814292430878,
-0.41523128747940063,
-0.3636651635169983,
0.1036938726902008,
0.030826980248093605,
-0.14113397896289825,
-0.8675411939620972,
-0.003368454985320568,
0.5427369475364685,
-0.32837218046188354,
-0.1887382119... | |
My boss for some reason wants to try to implement A/B Testing (or Split Testing) in JavaScript. Anyone know of any good JavaScript packages/libraries/solutions to implement A/B Testing?
Here's this: <http://ejohn.org/blog/genetic-ab-testing-with-javascript/>
Are you trying to test the marketability of your site or the... | [
1.1811120510101318,
0.08381976187229156,
-0.5466307997703552,
0.1948927491903305,
-0.09117128700017929,
0.06988479197025299,
0.14731790125370026,
0.27214375138282776,
-0.02956181764602661,
-0.4347342252731323,
0.5359794497489929,
0.3183183968067169,
-0.1668870896100998,
-0.0259343497455120... | |
also consider using cookies to ensure returning visitors get the same treatment.
I don't know of a code quality a/b framework for JS but the idea would be similar. Define what constitutes higher quality (lower milliseconds of execution time?), run the variations of the code and see which comes out ahead. Tools like JM... | [
0.3755839765071869,
-0.19446596503257751,
-0.02660318650305271,
0.3104146122932434,
-0.13044165074825287,
-0.32547906041145325,
0.4119199216365814,
0.0569831058382988,
-0.1281384527683258,
-0.731698215007782,
-0.054148510098457336,
0.8348507881164551,
0.07815862447023392,
-0.29458922147750... | |
I am trying to learn to write OpenGL apps for the iPhone. How can I port the following code to work with OpenGL-ES? I know that I must store the vertices in an array and then call glDrawArrays(), but is there an optimal way to do this? My thought is to create a very large array and simply keep a counter of how many spa... | [
0.22410722076892853,
0.07502604275941849,
0.7530924081802368,
-0.1405397653579712,
0.009871048852801323,
0.08957654237747192,
0.4026680886745453,
-0.14563821256160736,
-0.1315375119447708,
-0.7141099572181702,
-0.07930848747491837,
0.7213844060897827,
-0.5692748427391052,
0.067398518323898... | |
x = 50.0f*sin(angle);
y = 50.0f*cos(angle);
// Specify the point and move the Z value up a little
glVertex3f(x, y, z);
z += 0.5f;
}
// Done drawing points
glEnd();
```
Here's this: <http://ejohn.org/blog/genetic-ab-testing-with-javascript/>
Are you trying to test the marketability of your sit... | [
0.8757390379905701,
-0.13896121084690094,
0.1599922776222229,
-0.03647397831082344,
-0.11618629842996597,
0.03699712082743645,
0.13660702109336853,
-0.5604395270347595,
0.21739128232002258,
-0.5160836577415466,
0.27869081497192383,
0.3931933343410492,
-0.18424378335475922,
0.07224896550178... | |
visitor clicks something, also record which random layout they were presented with) via whatever analytics engine you use. You could also consider using cookies to ensure returning visitors get the same treatment.
I don't know of a code quality a/b framework for JS but the idea would be similar. Define what constitute... | [
0.0905502513051033,
-0.35746997594833374,
0.43206533789634705,
0.2386687844991684,
-0.1521037071943283,
-0.27821600437164307,
0.2719680368900299,
0.31087958812713623,
-0.36645546555519104,
-0.798980712890625,
0.05810036137700081,
0.5370543003082275,
-0.003771755378693342,
0.039076898247003... | |
I am trying to use YFrog's API. I think I am using it correctly to try and send a HTTP POST request that is of content type XML. However, as the response body, I am always getting a 404 error for some reason. [Here](https://i.stack.imgur.com/Sv4th.png) is their API.
Here is my attempt of PHP code to upload.
```
$dat... | [
0.40828919410705566,
0.09713476896286011,
0.7350091934204102,
-0.0691756159067154,
-0.19663409888744354,
0.03915996477007866,
0.5889660716056824,
-0.3223040997982025,
-0.09210304915904999,
-0.8804365992546082,
-0.421190083026886,
0.7036139369010925,
-0.30953288078308105,
-0.041024070233106... | |
location can not be passed to it? What does it mean?
I think that the problem is basically that ImagesHack does not return a binary file when you give the URL posted above. For me, it returns an HTML document.
I think you should try passing a binary file as the "media" parameter. The photo that your trying to get is l... | [
0.1873496174812317,
0.0683094933629036,
0.9007353186607361,
0.23375990986824036,
-0.0030304277315735817,
-0.11624326556921005,
0.3287658989429474,
0.01343630813062191,
-0.1960439532995224,
-0.6057199239730835,
-0.2341163009405136,
0.2859467566013336,
-0.2013855278491974,
0.2636352479457855... | |
I'm looking at collating mine and a few friends photos on our own stock photo site.. To save me some time I was wondering if anyone knew of a good stock photo app built in ASP.NET??
I have googled and not come up with much.. Looking for the ability for people to be able to buy from the site and the images watermarked ... | [
0.6402305364608765,
-0.08797482401132584,
0.23018689453601837,
0.256758451461792,
0.10923898220062256,
-0.16532881557941437,
-0.004409835673868656,
0.2228829711675644,
-0.2625482976436615,
-0.6707136034965515,
0.5802403092384338,
0.3934309780597687,
-0.06578375399112701,
0.1118820309638977... | |
[This answer](https://stackoverflow.com/questions/172905/using-linux-how-to-specify-which-ethernet-interface-data-is-transmitted-on) contains some relevant info.
You'll need to change the ping program. You can use a socket-per-interface approach and somehow inform the program when to fail over. Or you will have to clo... | [
0.252508282661438,
-0.06333868205547333,
0.6524705290794373,
0.2900038957595825,
0.0886610820889473,
-0.3057266175746918,
-0.1483626514673233,
-0.0804949626326561,
-0.14054839313030243,
-0.7264387011528015,
-0.04376893863081932,
0.5528464913368225,
-0.27534618973731995,
0.02987958677113056... | |
I have a method to replace every character except those I specify. For example,
```
ReplaceNot("test. stop; or, not", ".;/\\".ToCharArray(), '*');
```
would return
```
"****.*****;***,****".
```
Now, this is not an instance of premature optimization. I call this method quite a few times during a network opera... | [
0.09920287877321243,
0.09243069589138031,
0.13189813494682312,
-0.164708212018013,
0.2750399708747864,
-0.043669503182172775,
0.24146564304828644,
0.09097255021333694,
-0.12628678977489471,
-0.6050960421562195,
-0.21603481471538544,
0.7256771326065063,
-0.5340518951416016,
0.21112026274204... | |
int index = 0;
int old = -1;
StringBuilder sb = new StringBuilder(original.Length);
while ((index = original.IndexOfAny(pattern, index)) > -1)
{
sb.Append(new string(replacement, index - old - 1));
sb.Append(original[index]);
old = index++; | [
-0.1448913961648941,
-0.22883136570453644,
0.7709004878997803,
-0.47759729623794556,
0.008624641224741936,
0.44057589769363403,
0.4954047203063965,
-0.935551106929779,
-0.2569938898086548,
-0.4947488009929657,
-0.46530210971832275,
0.13697321712970734,
-0.6913162469863892,
0.31023821234703... | |
}
if (original.Length - old > 1)
{
sb.Append(new string(replacement, original.Length - (old + 1)));
}
return sb.ToString();
}
```
Final #'s. I also added a test case for a 3K character string, ran at 100K times instead of 1M to see how well each of these scales. The o... | [
-0.09349720925092697,
-0.23782935738563538,
0.48216331005096436,
-0.3156415522098541,
-0.13324283063411713,
0.11976875364780426,
0.8078898191452026,
-0.5702052712440491,
-0.012576151639223099,
-0.2656334340572357,
-0.16509529948234558,
0.3859742283821106,
-0.3438423275947571,
-0.0903968438... | |
'scaled better' than the others, but it is no help since it is very slow to begin with:
```
User Short * 1M Long * 100K Scale
John 319 2125 6.66
Luke 360 | [
-0.30111363530158997,
0.22022028267383575,
0.2906806468963623,
-0.04243270680308342,
-0.12124146521091461,
0.19296738505363464,
0.6263984441757202,
-0.25183698534965515,
-0.4937894642353058,
-0.6414821147918701,
-0.03315296769142151,
-0.0776909664273262,
0.3000423312187195,
0.2080209702253... | |
2659 7.39
Guffa 409 2827 6.91
Mine 447 3372 7.54
DirkGently 1094 | [
0.16363567113876343,
0.5029472708702087,
-0.3086237609386444,
-0.48174095153808594,
-0.06717542558908463,
0.5968193411827087,
0.7677792906761169,
-0.24826580286026,
-0.10460550338029861,
-0.029191402718424797,
-0.20835211873054504,
0.6769695281982422,
0.10571055114269257,
0.460249900817871... | |
9134 8.35
Michael 1591 12785 8.04
Peter 21106 94386 4.47
```
Update: I made the creation of the regular expression for Peter's version a static variable, and set it | [
-0.12800566852092743,
0.25377577543258667,
0.38319215178489685,
-0.20253825187683105,
0.18718305230140686,
0.1520272046327591,
0.482475221157074,
-0.23345217108726501,
-0.18501867353916168,
0.033624399453401566,
-0.5282345414161682,
0.46690869331359863,
-0.5562778115272522,
-0.169481590390... | |
to RegexOptions.Compiled to be fair:
```
User Short * 1M Long * 100K Scale
Peter 8997 74715 8.30
```
Pastebin link to my testing code, please correct me if it is wrong:
[<http://pastebin.com/f64f260ee>](http://pastebin.com/f64f260ee)
Alright, on a ~60KB string, th... | [
0.1845296174287796,
-0.024994486942887306,
0.280566930770874,
0.0019105616956949234,
0.050286371260881424,
0.08101491630077362,
0.8404847383499146,
-0.3989845812320709,
-0.07176250964403152,
-0.47146037220954895,
0.028440609574317932,
0.6369784474372864,
-0.27811187505722046,
-0.1440028548... | |
replacement)
{
int index = 0;
StringBuilder sb = new StringBuilder(new string(replacement, original.Length));
while ((index = original.IndexOfAny(pattern, index)) > -1)
{
sb[index] = original[index++];
}
return sb.ToString();
}
```
The trick is to initialize a new string with all re... | [
-0.001176826423034072,
-0.2862631380558014,
0.5109652280807495,
-0.35894331336021423,
0.04538359120488167,
0.22467799484729767,
0.3918200135231018,
-0.8952716588973999,
-0.18334344029426575,
-0.4568704664707184,
-0.49760109186172485,
0.290261834859848,
-0.6033929586410522,
0.17567612230777... | |
We are having problem with the server migration. We have one application that are having
so much transactions It working fine on the one database server. But when transfer same database to another server. We are facing the following error.
> `Server: Msg 3998, Level 16, State 1, Line 1`
>
> `Uncommittable transacti... | [
0.13716138899326324,
0.3264436423778534,
0.436550498008728,
0.06306134909391403,
0.20497849583625793,
-0.16129635274410248,
0.006454112473875284,
0.045580122619867325,
-0.6327484250068665,
-0.7154197692871094,
-0.07370167225599289,
0.506411075592041,
-0.28349074721336365,
0.517793238162994... | |
a problem where the record is acceptable in one database but not theother. Suggest you look at the differnces between the two database structures (yes I know they are supposed to be the same, but clearly they are not). Suspect you will either find a collation difference, a data type differnce, or a data length differnc... | [
0.12149409204721451,
-0.08140365779399872,
-0.03144896775484085,
0.4832311272621155,
-0.17813901603221893,
-0.1503429412841797,
0.013141714967787266,
-0.24363267421722412,
-0.25035831332206726,
-0.7426912784576416,
0.1928214132785797,
0.6175091862678528,
-0.11353163421154022,
0.21740829944... | |
I want to create a bunch of forms that all have the same properties and initialize the properties in the forms constructor by assigning the constructor's parameters.
I tried creating a class that inherits from form and then having all of my forms inherit from that class, but I think since I couldn't call InitializeCom... | [
0.29419270157814026,
0.036218345165252686,
0.2460622936487198,
-0.09006061404943466,
0.013927572406828403,
-0.2333822250366211,
0.019975855946540833,
-0.42081937193870544,
0.008470481261610985,
-0.3980672359466553,
-0.12395963072776794,
0.39495962858200073,
-0.25732389092445374,
0.28905403... | |
constructor. You didn't take that out, did you?)
However, the road you're going down isn't one that will play nicely with the designer, as you aren't going to be able to get it to instantiate your form at design time with those parameters (you'll have to provide a parameterless constructor for it to work). You'll also... | [
0.43355584144592285,
0.008745981380343437,
0.15247909724712372,
0.3659887909889221,
-0.13778778910636902,
-0.033426687121391296,
0.2767708897590637,
-0.2433517426252365,
-0.11184409260749817,
-0.7416715025901794,
0.18346814811229706,
0.5920259952545166,
-0.20745410025119781,
0.107509009540... | |
with parameters. For Forms, you'll have yourself a headache. | [
0.8327778577804565,
0.11366096138954163,
0.2204340547323227,
0.2027662992477417,
0.1057870164513588,
-0.2914874851703644,
0.18668287992477417,
-0.4822624921798706,
-0.013540539890527725,
-0.24240310490131378,
0.049950599670410156,
0.7365718483924866,
-0.2869906723499298,
-0.053311020135879... | |
I am doing a project where I want a person to enter the name of any artist/band into a text box where it will seach my mysql database for the event information and display the results/content on another page. The code below is within my index.php where it should get the information from search.php (below also). I've lo... | [
0.6494046449661255,
0.08367141336202621,
0.117740698158741,
-0.2650383710861206,
-0.11002688109874725,
-0.285106360912323,
0.35851848125457764,
-0.02981608361005783,
-0.017039230093359947,
-0.6363159418106079,
0.10284754633903503,
0.42970502376556396,
0.040290623903274536,
0.14100009202957... | |
<p><input type="submit" name="Submit" value="Search" /></p>
</form>
```
(search.php)
```
<?php
//Get the search variable from URL
$var=@&_GET['q'];
$trimmed=trim($var); //trim whitespace from the stored variable
//rows to return
$limit=10;
//check for an empty string and display a message.
if($trimmed=="")
{... | [
-0.046431731432676315,
-0.14168784022331238,
0.4394370913505554,
-0.18366408348083496,
0.06435063481330872,
0.28584805130958557,
0.1968044638633728,
-0.4704882800579071,
-0.23572896420955658,
-0.3439105153083801,
-0.277098685503006,
0.29300034046173096,
-0.31183281540870667,
0.110040605068... | |
google search as an alternative
if ($numrows==0)
{
echo"<h3>Results</h3>";
echo"<p>Sorry, your search: "" .$trimmed . "" returned zero results</p>";
//google
echo"<p><a href=\"http://www.google.com/search?q=".$trimmed . "\" target=\"_blank\" title=\"Look up ".$trimmed ." on Google\">
... | [
-0.23857493698596954,
-0.11900071054697037,
0.3362722098827362,
-0.25831669569015503,
-0.1508648842573166,
0.2767737805843353,
0.5856746435165405,
-0.5071405172348022,
-0.17701277136802673,
-0.34989845752716064,
-0.09922576695680618,
0.29074808955192566,
-0.5207788944244385,
0.245324432849... | |
""</p>";
//begin to show results set
echo "Results";
$count = 1 + $s;
//able to display the results returned
while ($row=mysql_fetch_array($result)) {
$title = $row["artist_name"];
echo"$count.) $title";
$count++;
}
$currPage = (($s/$limit) + 1;
echo"<br />";
//links to other results
if ($s>=1){
//... | [
-0.1272660344839096,
0.015166997909545898,
0.8990781307220459,
-0.36411184072494507,
-0.11285185068845749,
0.09789982438087463,
0.6163995862007141,
-0.7263455390930176,
-0.3799315094947815,
-0.3568999767303467,
-0.5275201797485352,
0.25250306725502014,
-0.5557392239570618,
0.06997279077768... | |
+($limit);
if($a > $numrows){$a = $numrows;}
$b = $s + 1;
echo "<p>Showing results $b to $a of $numrows</p>";
?>
```
You are missing a $ symbol. I think
```
$var=@&_GET['q'];
```
should probably be
```
$var=@$_GET['q'];
```
unless you really want a reference, in which case it should be this: (the error suppress... | [
-0.11587247252464294,
0.05347355827689171,
0.4071545898914337,
-0.5158932209014893,
0.33151179552078247,
-0.05179087072610855,
0.5983481407165527,
-0.5773610472679138,
-0.3015757203102112,
-0.15179459750652313,
-0.41744181513786316,
0.529375433921814,
-0.3571588099002838,
-0.00703661609441... | |
a name.</p>";
exit;
}
``` | [
-0.14670494198799133,
0.22193655371665955,
0.1203426867723465,
-0.17483772337436676,
0.16131503880023956,
-0.05729501694440842,
0.1730944663286209,
0.07997149229049683,
0.07991789281368256,
-0.4401678740978241,
-0.7138921022415161,
0.27861326932907104,
-0.4460987150669098,
0.37611666321754... | |
Something I'm curious about.. What would be "most efficient" to cache the generation of, say, an RSS feed? Or an API response (like the response to `/api/films/info/a12345`).
For example, should I cache the entire feed, and try and return that, as psuedo code:
```
id = GET_PARAMS['id']
cached = memcache.get("feed_%s"... | [
0.39839112758636475,
-0.06436064839363098,
0.44729405641555786,
0.17924517393112183,
0.06103205308318138,
0.010913921520113945,
0.1642165333032608,
-0.5594452023506165,
-0.19171999394893646,
-0.35805970430374146,
-0.18798047304153442,
0.38943377137184143,
-0.49241191148757935,
0.0280025471... | |
feed = generate_feed(cached_query_result)
return feed
else:
query_result = query.execute()
memcache.put("feed_%s" % id, query_result)
feed = generate_feed(query_result)
```
(Or, some other way I'm missing?)
As for my experience, You should use multiple levels of cache. Implement *both* of Your solutio... | [
0.4380883276462555,
-0.265198290348053,
0.3240519165992737,
-0.13908612728118896,
-0.11550188064575195,
-0.17406046390533447,
0.25025102496147156,
-0.3578047454357147,
0.06475729495286942,
-0.7260222434997559,
-0.013718719594180584,
0.4734399914741516,
-0.634466290473938,
0.103449068963527... | |
of hash() ;) ).
I would avoid `query.hash()`. It's better to use something like posts-title-body-%id. Try deleting a video when it's stored in cache as `query.hash()`. It can hang there for months as a zombie-video.
By the way:
```
id = GET_PARMS['id']
query = query("SELECT title, body FROM posts WHERE id=%%", id)
... | [
0.4151322841644287,
0.16845102608203888,
0.4168607294559479,
0.12522201240062714,
0.018522340804338455,
-0.46420973539352417,
0.39085373282432556,
0.08565346896648407,
-0.3895496129989624,
-0.5238988399505615,
-0.05529547110199928,
0.408138632774353,
-0.13053666055202484,
0.706385850906372... | |
People say it takes amortized O(1) to put into a hash table. Therefore, putting n elements must be O(n). That's not true for large n, however, since as an answerer said, "All you need to satisfy expected amortized O(1) is to expand the table and rehash everything with a new random hash function any time there is a coll... | [
-0.06768856197595596,
-0.1447773575782776,
-0.1852485090494156,
-0.06737349927425385,
0.17722336947917938,
0.14316529035568237,
0.14551910758018494,
-0.29796740412712097,
-0.4230155944824219,
-0.4608617424964905,
-0.13831385970115662,
0.25631165504455566,
-0.49446746706962585,
-0.003156624... | |
takes O(k) to resolve, where k is the current size of the hashtable, then you'd have this recurrence relation:
```
T(n) = T(n/2) + n/2 + n/2
```
(that is, you take the time to insert n/2 elements, then you have a collision, taking n/2 to resolve, then you do the remaining n/2 inserts without a collision). This still... | [
-0.3799779713153839,
0.15682023763656616,
0.1305576115846634,
-0.19162102043628693,
0.06706121563911438,
0.03745301067829132,
0.30742043256759644,
-0.5148255825042725,
-0.2514593005180359,
-0.43808719515800476,
-0.26485294103622437,
0.4192819893360138,
-0.37321117520332336,
0.1516293436288... | |
your rehash size calculation is before you can determine the expected order. | [
0.12883368134498596,
0.15536916255950928,
-0.012520232237875462,
0.03171687200665474,
-0.03679230809211731,
-0.07882309705018997,
0.21456049382686615,
-0.38615718483924866,
-0.11196083575487137,
-0.5419095158576965,
-0.032720185816287994,
0.23143064975738525,
0.1662006378173828,
0.15665467... | |
I am running the following script on a cronjob...
```
cd /etc/parselog/
php run_all.php >/dev/null
```
and am getting the following errors:
```
[05-May-2009 20:30:12] PHP Warning: PHP Startup: Unable to load dynamic library './pdo.so' - ./pdo.so: cannot open shared object file: No such file or directory in Unknown... | [
-0.19705094397068024,
0.4426049292087555,
0.3562675714492798,
-0.21357908844947815,
-0.22145016491413116,
0.05733758583664894,
0.999342679977417,
0.3675820827484131,
-0.27382808923721313,
-0.6288282871246338,
-0.21614830195903778,
0.8525460958480835,
-0.4826108515262604,
0.2505604326725006... | |
Unknown on line 0
[05-May-2009 20:30:12] PHP Warning: PHP Startup: Unable to load dynamic library './mysqli.so' - ./mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
[05-May-2009 20:30:12] PHP Warning: PHP Startup: Unable to load dynamic library './odbc.so' - ./odbc.so: cannot ... | [
-0.39011120796203613,
0.2732897400856018,
0.2964995205402374,
-0.1263660490512848,
0.17278547585010529,
0.17595653235912323,
0.6502464413642883,
0.30067765712738037,
-0.3417438864707947,
-0.4242347180843353,
-0.1322421431541443,
0.6270084977149963,
-0.5382199287414551,
0.5562630891799927,
... | |
dynamic library './pdo_mysql.so' - ./pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
[05-May-2009 20:30:12] PHP Warning: PHP Startup: Unable to load dynamic library './pdo_odbc.so' - ./pdo_odbc.so: cannot open shared object file: No such file or directory in Unknown on line... | [
-0.6310741901397705,
-0.23043754696846008,
0.43580949306488037,
0.1175210103392601,
-0.3336571753025055,
-0.004888053983449936,
0.8309705257415771,
0.21848028898239136,
-0.6610661745071411,
-0.3182165324687958,
-0.2245568186044693,
0.832379937171936,
-0.7312412261962891,
0.3520516157150268... | |
the command line, logged in- it works perfectly without error.
This is my $PATH string at the prompt:
```
$PATH = /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
```
Any ideas or suggestions? I am certain when running the cronjob, it does no... | [
0.11452949792146683,
0.27383747696876526,
0.627974808216095,
0.0008212201064452529,
0.13999928534030914,
-0.1533740758895874,
0.15266956388950348,
-0.13199254870414734,
-0.024270832538604736,
-0.7994040250778198,
-0.12729883193969727,
0.7655236721038818,
-0.24831053614616394,
-0.1590982079... | |
I'm using this in conjunction with the tablesorter plug-in, my goal is to have a blank class attribute in any column that is not being sorted, i.e. when I click one column the class attributes in the others are removed.
I have a table with a whole bunch of headers, basically what I want to be able to do is when I clic... | [
0.10813654214143753,
-0.03651643916964531,
0.25798866152763367,
0.05186467990279198,
0.03801005333662033,
-0.04743177071213722,
-0.24214768409729004,
0.1999817192554474,
-0.4480501413345337,
-0.7810404300689697,
0.03916333615779877,
0.23918890953063965,
-0.504446804523468,
0.24257622659206... | |
the content of the header, I do this because we're using XHTML Strict and rel can't be defined in the table header tag itself. My code is as follows:
```
$(function() {
$("a[rel='Header']").click(function () {
$("a[rel='Header']").each(function() {
if($(this).attr("class")=="sort-up"){$(this... | [
-0.06425386667251587,
-0.01026658620685339,
0.7966240644454956,
-0.24964232742786407,
0.027645982801914215,
-0.1466270536184311,
0.1452692300081253,
-0.3513132333755493,
-0.08227118104696274,
-0.4236145615577698,
-0.2642555236816406,
0.5994440913200378,
-0.483305960893631,
0.16621510684490... | |
});
});
```
What I'm assuming it should be doing is as soon as a header is clicked, cycle through each header, if it contains the class attribute "sort-up", remove it; if it contains the class attribute "sort-down", remove it. Then, for the currently clicked header, add the class attribute "sort-up" and toggle ... | [
-0.06107926368713379,
-0.15209920704364777,
0.4178403615951538,
-0.388142853975296,
0.18663102388381958,
-0.09051918983459473,
0.05805220454931259,
0.1166784018278122,
-0.26015934348106384,
-0.5827704668045044,
-0.18139182031154633,
0.5675173401832581,
-0.6483285427093506,
0.06928506493568... | |
on another header in a different column, the attribute doesn't get removed. It will, however, remove the "sort-up" class (^).
Here is a list of my header in XHTML:
```
<thead>
<tr>
<th><a rel = "Header" href="#" class="">Title</a></th>
<th><a rel = "Header" href="#" class... | [
0.2939034402370453,
0.03669063374400139,
0.4678087830543518,
0.15037062764167786,
-0.14789529144763947,
-0.14541015028953552,
0.034931622445583344,
-0.15694059431552887,
0.09956952929496765,
-0.6640788316726685,
-0.3417196571826935,
0.3682166337966919,
0.14045609533786774,
0.36568990349769... | |
class="{sorter: 'usLongDate'}"><a rel = "Header" href="#" class="">Date</a></th>
<th class="{sorter: false}">Start/End</th>
<th><a rel = "Header" href="#" class="">Seats Available</a></th>
<th><a rel = "Header" href="#" class="">Enrolled</a></th>
<th><a re... | [
-0.16081884503364563,
-0.4814769923686981,
0.2729828357696533,
0.3426980674266815,
0.025896277278661728,
0.2671138644218445,
-0.29383745789527893,
-0.285733699798584,
-0.10874360054731369,
-0.6636084318161011,
-0.33006030321121216,
0.35081663727760315,
0.18079788982868195,
0.09039253741502... | |
<th class="{sorter: false}">Workshop Actions</th>
</tr>
</thead>
```
UPDATED with changes recommended by waxwing, stupid mistake, it works, I wasn't paying attention to the syntax of the hasClass. Thanks.
```
$(function() {
$("a[rel='Header']").click(function () {
$("a[rel='Header'... | [
-0.008858971297740936,
-0.027868065983057022,
0.5801791548728943,
-0.22065024077892303,
0.24212203919887543,
-0.02067582868039608,
0.44137462973594666,
-0.47903624176979065,
-0.3595401644706726,
-0.6787763237953186,
-0.25737667083740234,
0.7155824899673462,
-0.28791046142578125,
-0.0069597... | |
if($(this).hasClass("")){$(this).addClass("sort-up");}
if ($(this).hasClass("sort-up")) {
$(this).removeClass("sort-up").addClass("sort-down");
} else {
$(this).removeClass("sort-down").addClass("sort-up");
} | [
-0.3795423209667206,
-0.20353826880455017,
0.29988986253738403,
-0.2874521315097809,
0.29784396290779114,
0.06883101165294647,
0.11772952973842621,
-0.378175288438797,
-0.33372756838798523,
-0.5879741907119751,
-0.6405822038650513,
0.5108447670936584,
-0.5294926762580872,
-0.00816505216062... | |
if($(this).attr("title") == "Sort column in ascending order"){
$(this).attr({title : "Sort column in descending order"});}
else {$(this).attr({title : "Sort column in ascending order"});}
});
});
```
Yep, you're fundamentally misunderstanding private. Privacy is class-spe... | [
0.2176409214735031,
0.21885932981967926,
0.038002464920282364,
0.43167644739151,
0.42073118686676025,
-0.5403344631195068,
0.27851131558418274,
0.04481746628880501,
0.07190685719251633,
-0.008886526338756084,
-0.11640973389148712,
0.646807849407196,
-0.1537756323814392,
0.26373884081840515... | |
I'd like to change the value of the `onclick` attribute on an anchor. I want to set it to a new string that contains JavaScript. (That string is provided to the client-side JavaScript code by the server, and it can contains whatever you can put in the `onclick` attribute in HTML.) Here are a few things I tried:
* Usin... | [
0.281002014875412,
-0.11509940773248672,
0.44283434748649597,
-0.187590092420578,
0.036807309836149216,
-0.08179361373186111,
0.2758520245552063,
-0.3391280472278595,
-0.05067434906959534,
-0.7352579236030579,
-0.050857529044151306,
0.7140980362892151,
-0.5463973879814148,
-0.1155639141798... | |
passed to `eval()`.
Anyone has a suggestion on to set the onclick attribute to to make this work for Firefox and IE 6/7/8? Also see below the code I used to test this.
```
<html>
<head>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></scrip... | [
0.06593380123376846,
0.0610617995262146,
0.5862541198730469,
-0.3027784526348114,
-0.015358137898147106,
-0.1017213836312294,
0.3136838674545288,
-0.48060348629951477,
-0.09676287323236465,
-0.49086055159568787,
-0.3547634482383728,
0.4025425612926483,
-0.4303758442401886,
-0.2625253796577... | |
"alert('B'); return false;";
// Set with JQuery: doesn't work
$("a").attr("onclick", js);
// Set with setAttribute(): at least works with Firefox
//document.getElementById("anchor").setAttribute("onclick", js);
}); | [
0.17973457276821136,
-0.12271307408809662,
0.6260547041893005,
-0.36949825286865234,
0.5046234130859375,
-0.23090972006320953,
0.5922013521194458,
-0.4471508860588074,
0.05125493183732033,
-0.28130629658699036,
-0.7499984502792358,
0.797672688961029,
-0.6053860783576965,
-0.314103424549102... | |
</script>
</head>
<body>
<a href="http://www.google.com/" id="anchor" onclick="alert('A'); return false;">Click</a>
</body>
</html>
```
You shouldn't be using `onClick` any more if you are using jQuery. jQuery provides its own methods of attaching and binding events. See [`.click()`](http://api.jqu... | [
0.07445495575666428,
-0.06992971152067184,
0.7633343935012817,
-0.18358755111694336,
0.11896625906229019,
-0.146218940615654,
0.1578519195318222,
-0.3748123347759247,
-0.1338820904493332,
-0.3733098804950714,
-0.5952136516571045,
0.5461658239364624,
-0.5033664703369141,
-0.0675585344433784... | |
function - and keep your "javascript from a string" as well.
The best thing to do would be to remove the `onclick=""` from the `<a>` element in the HTML code and switch to using the [**Unobtrusive**](http://en.wikipedia.org/wiki/Unobtrusive_JavaScript) method of binding an event to click.
You also said:
> Using `onc... | [
-0.10583329200744629,
-0.2644674479961395,
0.6280794739723206,
-0.082615926861763,
-0.24624638259410858,
-0.1780819296836853,
0.3096030056476593,
-0.5200735330581665,
-0.07106760144233704,
-0.4255046546459198,
-0.2507120668888092,
0.8210891485214233,
-0.4917750060558319,
-0.055429637432098... | |
F) -- see [documentation on `Function()` constructors](https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Function) | [
-0.1551310271024704,
-0.15255184471607208,
0.4066416323184967,
0.006667140405625105,
0.07506375014781952,
0.08905892074108124,
-0.01861632615327835,
-0.15589679777622223,
-0.42723122239112854,
-0.14586102962493896,
-0.4277259409427643,
0.7095814347267151,
-0.6279082298278809,
-0.0629802867... | |
When I use Request.Form("myInput") and the input field "myInput" is blank, I get a server error.
How do I handle this?
Is there a way to check if "myInput" has not been filled?
Reading from the `Request.Form` collection doesn't cause an exception neither if the value is an emptry string (which happens if the input fi... | [
-0.05193623900413513,
-0.128160297870636,
0.30397164821624756,
0.12458139657974243,
-0.13594397902488708,
-0.07889359444379807,
0.41413387656211853,
-0.026339255273342133,
-0.31138625741004944,
-0.6386434435844421,
0.09364016354084015,
0.4606839716434479,
-0.0726262778043747,
0.43969750404... | |
doesn't exist, you get a null reference (`Nothing` in VB) when reading from the collection, so to check for that you compare the reference to `null` (use `is Nothing` in VB).
To check for both conditions you can use the `String.IsNullOrEmpty` method. | [
0.31959742307662964,
-0.13598483800888062,
0.16729769110679626,
-0.06759513169527054,
0.12695001065731049,
-0.315197616815567,
0.2898280918598175,
0.1186070665717125,
-0.31209030747413635,
-0.36458784341812134,
-0.2604910433292389,
0.13918837904930115,
-0.3309096693992615,
0.54775494337081... | |
Is it possible to select all controls that inherit a particular abstract class with linq.
I would guess that you're calling `ToolTip.SetTooltip` from an event handler and that handler sometimes fires before the label has been created. You should probably guard this with a check for the label being `null` and then make ... | [
0.12863598763942719,
-0.16040951013565063,
-0.1549350917339325,
0.3004911243915558,
0.09957952052354813,
-0.4441603422164917,
-0.09765859693288803,
-0.2508894205093384,
-0.31568557024002075,
-0.1452726125717163,
-0.07969173789024353,
0.6715933680534363,
-0.24272052943706512,
-0.06634980440... | |
A) Why, when using templates with *CreateUserWizard* control, does including *Textbox* with *ID=Email* depend on whether *CreateUserWizard.RequireEmail* property is set to true, but *TextBox* with *ID=Question* is required only if underlying membership provider requires password question?
In other words, why wouldn’t ... | [
0.43560048937797546,
-0.06536635756492615,
0.08535992354154587,
0.05987677723169327,
0.22687610983848572,
-0.41844624280929565,
0.3483583629131317,
-0.6039031147956848,
-0.09213052690029144,
-0.5226942300796509,
-0.25630977749824524,
0.5999919176101685,
-0.17608779668807983,
-0.10653291642... | |
underlying data store, and not to decide what data users must provide?!
thanx
**EDIT:**
A)
> It comes down to the fact that the membership provider has an obvious mapping: RequiresQuestionAndAnswer, which you can set and have this enforced, but you can't specify that the user must supply an email address.
So Requi... | [
0.26949217915534973,
-0.09366524964570999,
0.4294951856136322,
0.18913549184799194,
0.1283615082502365,
-0.2957088053226471,
-0.05414612591266632,
-0.3091062903404236,
-0.3108372986316681,
-0.6562650203704834,
-0.015334781259298325,
0.4763679504394531,
-0.16430725157260895,
0.0339879244565... | |
data storage has?
* But still, what if data storage doesn’t have a column for storing email addresses, but CreateUser() specifies email address as one of its parameters? How does membership provider handle that?
It is an interesting point that email is part of the expected data fields.
Let me clarify... if you set Re... | [
0.6122948527336121,
0.0860101655125618,
0.4565218985080719,
0.1938852071762085,
0.19141261279582977,
-0.36904770135879517,
0.21582801640033722,
-0.42220377922058105,
-0.23904064297676086,
-0.45396891236305237,
0.1565370410680771,
0.5784093737602234,
-0.11881601810455322,
0.2164433598518371... | |
set in the database. But no other user would be able to omit the email address after that because that would cause two users to have null emails... So functionally it may as well be the same as required email addresses, but it is not technically the same.
The wizard controls provide a default UI for collecting members... | [
0.41495397686958313,
-0.25038403272628784,
0.4540542662143707,
0.4060699939727783,
0.0165219996124506,
-0.5742020606994629,
0.28237950801849365,
-0.17800763249397278,
-0.29519397020339966,
-0.5856111645698547,
-0.04367385804653168,
0.5138912200927734,
-0.22116106748580933,
0.13048563897609... | |
wizard steps with your own templates and handle the wizard's events to provide your own validations and additional logic as appropriate.
As for understanding the Membership system itself...
The Membership system in asp.net is a compromise between strict OO design and convenience. There are a few assumptions in the b... | [
0.10976196080446243,
-0.16579002141952515,
0.2025245875120163,
0.3129878044128418,
-0.11077489703893661,
-0.5905494093894958,
0.416385680437088,
-0.28712180256843567,
-0.1868458092212677,
-0.4504312574863434,
-0.03320375829935074,
0.41469335556030273,
0.019830208271741867,
-0.2334510684013... | |
to expose some functionality related to email addresses in a simple and intuitive way (such as getting a user by their email address instead of user name and prohibiting multiple accounts with the same email address). If the base class didn't make that assumption, then every time you wanted to do stuff with emails in y... | [
0.6126308441162109,
0.12948237359523773,
-0.1704712212085724,
0.08589926362037659,
0.08594585210084915,
-0.553672194480896,
0.5103088021278381,
-0.009077693335711956,
-0.41471192240715027,
-0.48810896277427673,
-0.14004042744636536,
0.3068893253803253,
-0.32997360825538635,
-0.022865761071... | |
and properties from the base class if they don't use them.
You see this more with role providers... for example the Windows Token Role provider has a lot of members that throw NotImplmentedException (the Token role provider is a read-only provider for AD, so all of the property set accessors throw exceptions). | [
0.04497065022587776,
-0.11443662643432617,
-0.1539190411567688,
0.15914806723594666,
-0.2761843800544739,
-0.3264397382736206,
0.22676901519298553,
-0.23576156795024872,
-0.2956547737121582,
-0.45347294211387634,
-0.21250197291374207,
0.4824276566505432,
-0.24333199858665466,
0.17765836417... | |
My designer noticed that in the source for a drupal site, all the .css files were getting appended a ?1 that he was concerned would break things. Why is it doing this?
```
<link type="text/css" rel="stylesheet" media="all" href="/modules/modules/node/node.css?l" />
<link type="text/css" rel="stylesheet" media="all" hr... | [
0.20959027111530304,
0.15825025737285614,
0.3699679672718048,
-0.0426303930580616,
0.04462743178009987,
0.0046087936498224735,
0.0429370291531086,
-0.23441822826862335,
-0.4170859754085541,
-0.6720742583274841,
-0.321898490190506,
0.30061349272727966,
-0.46613991260528564,
0.13229937851428... | |
as the
// URL changed.
$query_string = '?'. substr(variable_get('css_js_query_string', '0'), 0, 1);
```
I guess that answers that. I'm going to assume since the drupal guys are doing this that browsers are cool with query strings in css link tags, even though my designer was paranoid over it.
Hopefully this helps so... | [
0.3141546845436096,
0.0991712212562561,
0.626812219619751,
0.0595613531768322,
-0.32860928773880005,
-0.11479897052049637,
0.366239458322525,
0.33602216839790344,
-0.48864296078681946,
-0.5362447500228882,
0.0608208142220974,
0.42272093892097473,
-0.15596042573451996,
0.5599439144134521,
... | |
I know it's not optimal, but I have to work with it, a page making calls to the applet.
My problem is, when I do so, I recieve a rather cryptic error message:
*"uncaught exception: Error calling method on NPObject!*
*[plugin exception: java.lang.reflect.InvocationTargetException]."*
Can anyone decode this? Even mul... | [
-0.20477494597434998,
0.2477443963289261,
0.24467384815216064,
-0.12265623360872269,
-0.15827715396881104,
-0.21606209874153137,
0.5436468720436096,
-0.04818697273731232,
0.00973946787416935,
-0.7769488096237183,
-0.45586392283439636,
0.6480444669723511,
-0.5868125557899475,
-0.06025611236... | |
this, it doesn't do anything except throw that error.
If I ask the person working on the applet (it's not my portion) is it possible for them to add constructive error throwing or am I not even at the point of connecting to the applet yet?
[InvocationTargetException](http://java.sun.com/j2se/1.5.0/docs/api/java/lang/r... | [
0.16166937351226807,
0.2517523765563965,
0.1284325122833252,
-0.17679594457149506,
-0.21043315529823303,
-0.2427210658788681,
0.4811844229698181,
-0.24734562635421753,
-0.24263490736484528,
-0.5103980302810669,
0.26620393991470337,
0.5068777203559875,
-0.13954710960388184,
-0.0247229132801... | |
method.)
You can get the original exception by catching the InvocationTargetException and then calling its `getTargetException()` or `getCause()` method (they both do exactly the same thing). | [
0.06480169296264648,
-0.2999607026576996,
0.13717356324195862,
0.1282201111316681,
0.04688062518835068,
-0.3277286887168884,
0.37115946412086487,
-0.1933908462524414,
-0.12513792514801025,
-0.24350693821907043,
-0.23209397494792938,
0.5411962270736694,
-0.49664992094039917,
-0.002152507659... | |
Suppose that I have the model Foo in GAE and this query:
query = Foo.all().order('-**key**')
I want to get the n-th record. What is the most efficient way to achieve that?
Will the solution break if the ordering property is not unique, such as the one below:
query = Foo.all().order('-**color**')
edit: n > 1000
e... | [
-0.06665100902318954,
0.19535890221595764,
0.45715880393981934,
0.04530305787920952,
0.0393000952899456,
0.014506847597658634,
-0.18227283656597137,
-0.16968458890914917,
-0.2426823377609253,
-0.6987287402153015,
-0.0539398230612278,
0.47389155626296997,
-0.47936999797821045,
0.31404924392... | |
of that page.
There is no efficient way to do this - in any DBMS. In every case, you have to at least read sequentially through the index records until you find the nth one, then look up the corresponding data record. This is more or less what fetch(count, offset) does in GAE, with the additional limitation of 1000 rec... | [
0.22378891706466675,
-0.11766961961984634,
0.5049201250076294,
0.08149465173482895,
-0.10968905687332153,
-0.07792486250400543,
-0.011977966874837875,
-0.36074817180633545,
-0.07451587170362473,
-0.4856816530227661,
-0.10053036361932755,
0.2710212469100952,
-0.015223240479826927,
0.4421526... | |
can add the field's value as the lower bound of an inequality query, and skip records until you match or exceed the last one you saw.
If you want to provide 'friendly' page offsets to users, what you can do is to use memcache to store an association between a start offset and a bookmark (order\_property, key) tuple. W... | [
0.1646086871623993,
0.016181139275431633,
0.15248318016529083,
0.2684783339500427,
0.17385442554950714,
-0.07353730499744415,
-0.13821977376937866,
-0.3148781359195709,
-0.17155884206295013,
-0.666571855545044,
-0.07452215999364853,
0.5238509774208069,
-0.2868712842464447,
-0.0535843409597... | |
if the offset is high enough. | [
0.2651301324367523,
-0.051291532814502716,
0.6596399545669556,
-0.006903990171849728,
0.27310511469841003,
-0.09253192692995071,
-0.546908438205719,
-0.03664284572005272,
0.2534411549568176,
-0.49753087759017944,
-0.32415592670440674,
0.6184239983558655,
0.40400463342666626,
-0.45984905958... | |
I am trying to use JAXB's introspection to marshall and unmashall some existing domain objects marked up with JAXB annotations. Most things work as expected, but I am having quite a bit of trouble getting a fairly simple class to serialize. This class is used as an @XmlElement on a number of beans and looks something l... | [
0.4882175922393799,
0.19756297767162323,
0.2979796528816223,
0.19818155467510223,
0.026436029002070427,
0.030083440244197845,
0.1939074993133545,
-0.2616664469242096,
0.11210785806179047,
-0.628571093082428,
0.09509328007698059,
0.47451287508010864,
-0.3538426458835602,
0.22232244908809662... | |
startInclusive = endInclusive = true;
}
public boolean contains(E value){...}
public E getEnd() {
return end;
}
public void setEnd(E end) {
this.end = end;
}
public boolean isEndInclusive() {
return endInclusive;
}
public void setEndInclusive(... | [
-0.06360045075416565,
-0.06221303343772888,
0.39474374055862427,
-0.19044362008571625,
0.35222822427749634,
-0.24841368198394775,
0.2068011313676834,
-0.4727056622505188,
0.20404934883117676,
-0.44115734100341797,
-0.5805587768554688,
0.7735399603843689,
-0.49132707715034485,
0.05301013216... | |
this.endInclusive = endInclusive;
}
public E getStart() {
return start;
}
public void setStart(E start) {
this.start = start;
}
public boolean isStartInclusive() {
return startInclusive;
}
public void setStartInclusive(boolean startInclusive) { | [
-0.4311310350894928,
-0.15056635439395905,
0.20749306678771973,
-0.232321098446846,
0.13825686275959015,
0.011090564541518688,
0.24715730547904968,
-0.058801282197237015,
0.023167617619037628,
-0.48526570200920105,
-0.7600608468055725,
0.4911063015460968,
-0.48998403549194336,
0.0560226887... | |
this.startInclusive = startInclusive;
}
}
```
I have tried to do the following, with no success, JAXB is still angry with the interface Comparable.
```
public class DoubleRange extends Range<Double> {}
```
Using both Range and DoubleRange as return types for the bean getter's yields an exception like:
```
ja... | [
0.03677799552679062,
0.1071566790342331,
0.23994316160678864,
-0.07064332067966461,
-0.15715137124061584,
-0.2468588501214981,
0.25223544239997864,
-0.2702674865722656,
-0.002548702759668231,
-0.7960790991783142,
0.19623877108097076,
0.4691354036331177,
-0.5985310077667236,
0.0775145813822... | |
example.util.Range
at example.util.DoubleRange
at public example.util.DoubleRange example.domain.SomeBean.getRange()
at example.domain.SomeBean
```
I realize that in most cases List<T> and Map<T, U> only work because the JAXB specification has special provisions for those types when they are e... | [
0.5234556198120117,
-0.05105598643422127,
0.14820869266986847,
-0.2937738597393036,
-0.1909961849451065,
-0.08735253661870956,
0.2532866299152374,
0.00966581515967846,
-0.1349709928035736,
-0.5212321877479553,
-0.14566873013973236,
0.45816874504089355,
-0.5721986889839172,
0.19800856709480... | |
of elements and has JAXB annotations
and handles them as you wish (in my example I convert everything to String)
```
@YourJAXBAnnotationsGoHere
public class MyAdapter{
@XmlElement // or @XmlAttribute if you wish
private String content;
public MyAdapter(Object input){
if(input instanceof String){
cont... | [
0.055767450481653214,
-0.1450144350528717,
0.7670319676399231,
-0.20654025673866272,
0.1000756025314331,
-0.018185315653681755,
0.25670042634010315,
-0.5530713200569153,
0.09985723346471786,
-0.7947734594345093,
-0.3789050579071045,
0.5398406386375427,
-0.3912852108478546,
0.19347941875457... | |
}
}
}
// I would suggest to use a Map<Class<?>,IMyObjToStringConverter> ...
// to avoid nasty if-else-instanceof things
```
2) use this class instead of E in your to-be-marshalled class
**NOTES**
* Of course this would **not** work for complex (nested) data structures.
* You have to think how to unmarshall this ... | [
-0.044482484459877014,
-0.07410430908203125,
0.028368361294269562,
0.13125932216644287,
0.21889030933380127,
-0.09983882308006287,
0.19192850589752197,
0.043325044214725494,
-0.22816060483455658,
-0.7237443923950195,
-0.17640121281147003,
0.4386981725692749,
-0.1344577521085739,
0.18822592... | |
I'm trying to write an application that can wait on multiple resource pools at once. Each resource pool is controlled by a `Semaphor`. Can I use `WaitHandle.WaitAll()` where I pass in the entire list of semaphors? Is there a potential deadlock issue with this implementation?
My current implementation:
```
namespace X... | [
0.3335164785385132,
-0.11618532240390778,
0.39695996046066284,
-0.08362571895122528,
0.3633967339992523,
0.18455569446086884,
0.0029667846392840147,
-0.3090643286705017,
-0.3468879163265228,
-0.8681082725524902,
0.0802585631608963,
0.4509313106536865,
-0.349555641412735,
0.2589379251003265... | |
int maxConcurrentConsumers)
{
this.resourcePools.Add(resourceName, new Semaphore(maxConcurrentConsumers, maxConcurrentConsumers));
}
public void RequestResource(string resourceName)
{
this.resourcePools[resourceName].WaitOne();
}
public void Requ... | [
0.17115819454193115,
-0.4529474675655365,
0.44866788387298584,
-0.0967245027422905,
0.3193178176879883,
0.24110890924930573,
0.36009278893470764,
-0.39577585458755493,
-0.13055774569511414,
-0.6109187602996826,
-0.5331482887268066,
0.5826491713523865,
-0.16962526738643646,
0.31011891365051... | |
Semaphore[] resources = resourceNames.Select(s => this.resourcePools[s]).ToArray();
WaitHandle.WaitAll(resources);
}
public void ReleaseResource(string resourceName)
{
this.resourcePools[resourceName].Release(1);
}
}
}
```
Sure, you can use it, but it'll on... | [
0.4781672954559326,
-0.16196312010288239,
0.5947779417037964,
-0.28831905126571655,
0.22643901407718658,
-0.27134209871292114,
0.3294343948364258,
-0.1829996109008789,
-0.1423395574092865,
-0.5969556570053101,
-0.5267080068588257,
0.34137171506881714,
-0.6540453433990479,
0.100877992808818... | |
indeed be starvation issues. For example, if you have two resources, A and B, and three threads:
1. Continually take resource A, work with it for one second, then release it and loop
2. Continually take resource B, work with it for one second, then release it and loop
3. Wait for both A and B to be available
You can ... | [
0.8254505395889282,
-0.22877606749534607,
0.4098834991455078,
0.026676826179027557,
0.07833563536405563,
0.3350362777709961,
0.35123932361602783,
-0.02997986599802971,
-0.26586419343948364,
-0.6252593398094177,
0.17350906133651733,
0.3924351930618286,
-0.279279887676239,
0.3086952865123749... | |
these locks will be available most of the time it may be safe (but might also be a ticking time bomb just waiting for your application to be under real load...)
Given your sample code, another option would be to create a global ordering over the semaphores - say, an ordering by name - and always make sure to acquire t... | [
0.5176141262054443,
0.0989544466137886,
0.5937767028808594,
0.2132074236869812,
0.25804603099823,
0.03556990996003151,
0.09070699661970139,
-0.29290032386779785,
-0.6519782543182373,
-0.362578421831131,
-0.1846163123846054,
0.31536367535591125,
-0.6014241576194763,
0.16538235545158386,
-... | |
release all locks 'after' the lock you just released before acquiring any more (this is a rule of thumb that should give you deadlock safety. it may be possible to relax this further with detailed analysis). The recommended way is to just release in reverse order of acquisition where possible, in which case you can par... | [
0.08010738343000412,
-0.21580207347869873,
0.2787778079509735,
0.21899138391017914,
0.34941452741622925,
-0.4883744716644287,
0.4076882600784302,
-0.3008318841457367,
-0.44335055351257324,
-0.2372555136680603,
-0.7862540483474731,
0.46762359142303467,
-0.10914843529462814,
0.17288620769977... | |
everything follows these rules, deadlock should not be possible, as cycles of waiters cannot form.
The downside of this approach is it may delay other threads by holding a lock while waiting for another. This won't last forever; in the above example of three threads we may have this scenario for example:
1. At start,... | [
0.47636738419532776,
-0.16175419092178345,
0.6140844821929932,
-0.2406441867351532,
0.10033419728279114,
-0.1615198701620102,
0.46210166811943054,
-0.5132531523704529,
-0.6195492148399353,
-0.06171201169490814,
-0.13090941309928894,
0.18336960673332214,
-0.5171397924423218,
0.2112364172935... | |
locks A, makes progress.
As you can see, there was some downtime in which Thread 1 was blocked on A even though there was no real work to be done. However, by doing this we have greatly improved the chances for Thread 3 to make progress at all.
Whether this is a good trade-off will depend on your application - if you... | [
0.32626599073410034,
-0.03507711738348007,
0.23232300579547882,
0.08503666520118713,
0.04492553696036339,
0.01754419133067131,
0.6131665706634521,
-0.3399464190006256,
-0.6298251152038574,
-0.29489314556121826,
-0.05771145597100258,
0.18507802486419678,
-0.45384910702705383,
0.062441870570... | |
Consider the following hibernate configuration:
```
<class name="Person">
<id name="id" column="personId">
<generator class="native"/>
</id>
<set name="addresses" table="PersonAddress">
<key column="personId"/>
<many-to-many column="addressId"
class="Address"/>
</set>
</class>
<class name="Address... | [
-0.310059130191803,
-0.10081425309181213,
0.2982753813266754,
-0.12870241701602936,
-0.20570771396160126,
-0.22587379813194275,
0.2522219717502594,
-0.4884544909000397,
0.2384307086467743,
-0.7658289670944214,
-0.15270955860614777,
0.5616624355316162,
-0.04796949774026871,
-0.2188510000705... | |
this PersonAddress table that doesn't get audited because we don't technically have a POJO for it...so we can't check for some "instanceof". Is there any way in the hibernate configuration that we can tell it to Intercept this PersonAddress table? Maybe we need to handle one of the other actions from the Interceptor (l... | [
-0.16675640642642975,
-0.18892227113246918,
0.4797111749649048,
0.18415075540542603,
-0.5944147109985352,
-0.11009644716978073,
0.38401687145233154,
-0.16277055442333221,
0.1345173716545105,
-0.6295062303543091,
0.20909276604652405,
0.7329212427139282,
-0.2719643712043762,
-0.0531934015452... | |
Person and Address.
That seems kind of like extra work and I really want to avoid extra work.
Can somebody suggest a better solution?
Thanks!
I achieved the result I was after by using a different method. Instead of using a DataGridTemplateColumn, I used a DataGridCheckBoxColumn and set a custom ElementStyle based o... | [
0.08822162449359894,
-0.4192982316017151,
0.5391213893890381,
0.09543529897928238,
-0.027850721031427383,
0.09710721671581268,
0.08278495818376541,
-0.3968067765235901,
-0.07231999933719635,
-0.755078136920929,
0.01491776667535305,
0.5434121489524841,
-0.21420155465602875,
-0.2065058201551... | |
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="IsEnabled" Value="false"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<BulletDecorator SnapsToDevicePixels="true" Background="Transparent">
... | [
-0.0020813802257180214,
-0.4919146001338959,
0.16232702136039734,
0.28869858384132385,
-0.04257911071181297,
0.12667040526866913,
0.010139092803001404,
-0.626237154006958,
-0.17884910106658936,
-0.6329187154769897,
0.01519777812063694,
0.5080739259719849,
-0.25553733110427856,
-0.171628385... | |
Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5">
<Image x:Name="checkImage" Source="..\..\images\check.png" Height="16" Width="16"></Image>
</Canvas>
</BulletDecorator.Bullet> | [
-0.18461543321609497,
-0.14782463014125824,
0.5077148675918579,
-0.1483422815799713,
-0.2748624086380005,
0.5439764261245728,
-0.09172091633081436,
-0.5602650046348572,
-0.4199115037918091,
-0.3523443043231964,
0.08070496469736099,
0.49398428201675415,
0.04559224843978882,
-0.0655914321541... | |
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" RecognizesAccessKey="True"/>
</BulletDecorator>
... | [
0.06078996881842613,
-0.29021817445755005,
0.42948979139328003,
0.1375667005777359,
0.0209883451461792,
0.019770529121160507,
0.26220181584358215,
-0.6544709801673889,
0.030375810340046883,
-0.46731096506118774,
-0.18556760251522064,
0.660918653011322,
-0.17131467163562775,
-0.073388993740... | |
<Setter Property="Padding" Value="4,0,0,0"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> | [
0.0013660989934578538,
-0.5152583718299866,
0.4111231863498688,
0.13377143442630768,
0.22434042394161224,
-0.01432440709322691,
0.0215217974036932,
-0.6164520382881165,
-0.14303065836429596,
-0.5931739807128906,
-0.04151717200875282,
0.6314070224761963,
-0.415314257144928,
0.13816888630390... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.