text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
safe eventhough reading the double isn't atomic. As the boxed double is immutable, a specific boxed value will never change.
---
Or what about a generic version:
```
public sealed class ThreadSafe<T> where T : struct {
private volatile object _value;
public ThreadSafe() {
Value = default(T);
}
public ... | [
0.2870163321495056,
-0.6061684489250183,
0.20167049765586853,
0.0007762967143207788,
0.2997452914714813,
-0.45608237385749817,
0.4686402678489685,
-0.16691628098487854,
-0.0070893531665205956,
-0.374073326587677,
-0.5350905656814575,
0.8710039258003235,
-0.3702022433280945,
-0.095609903335... | |
}
}
}
``` | [
0.033695679157972336,
0.4034728407859802,
0.1949702352285385,
-0.15257494151592255,
0.4299153685569763,
-0.20141436159610748,
0.07711705565452576,
0.4467844069004059,
0.3091506361961365,
-0.5090379118919373,
-0.3048633635044098,
0.5600791573524475,
-0.33611243963241577,
0.3141762912273407,... | |
Is it possible to create (prefferably with WiX) windows installer dialog with "hyperlink", which would open another dialog window?
Something like "View detailed report" in [this screenshot](http://sqlserver-qa.net/SQL2008InstallError.jpg). My google skills aren't helping with this.
The answer to my question ("Why is ... | [
-0.046451251953840256,
-0.11480605602264404,
0.16417348384857178,
0.18174324929714203,
-0.09957559406757355,
-0.14047043025493622,
0.4365602433681488,
0.20905965566635132,
-0.33886709809303284,
-0.4319039285182953,
0.022908903658390045,
0.4209209382534027,
-0.09399794787168503,
0.000201529... | |
simpler to define raw strings with the semantics that a backslash has no special meaning whatsoever. Both lexer and IDE would benefit from this simplification.
The current situation also is a [wart](http://www.retrologic.com/jargon/W/wart.html): In case I want a quote in a raw string, I cannot use this anyway. I only ... | [
0.6073279976844788,
-0.027831856161355972,
0.1721295714378357,
-0.07137325406074524,
-0.26254668831825256,
-0.18916834890842438,
0.49144136905670166,
0.02256866544485092,
-0.30999311804771423,
-0.29879283905029297,
-0.175913006067276,
0.5350131392478943,
-0.23029449582099915,
0.22734028100... | |
Can someone visually explain what's going on here please.
```
var stack = [];
function countDown(int) {
stack.push(int);
if (int === 1) {
return 1;
}
return countDown(int - 1);
}
function multiplyEach() {
// Remove the last value of the stack
// and assign it to the variable int
i... | [
0.2156982272863388,
-0.13327841460704803,
0.7676498293876648,
-0.40278950333595276,
0.28105756640434265,
0.19081981480121613,
0.043280601501464844,
-0.37594980001449585,
-0.5831218361854553,
-0.12535440921783447,
-0.33912229537963867,
0.5789650678634644,
-0.41483622789382935,
0.24575312435... | |
return int;
}
// Recursive case
else {
stack[x - 1] = int * stack[x - 1];
return multiplyEach();
}
}
```
// Call the function
```
countDown(7);
```
// And then print out the value returned by multiplyEach()
```
console.log(multiplyEach());
```
I sorta understand that's it's cre... | [
-0.1770966500043869,
-0.028388941660523415,
0.550436794757843,
-0.48786109685897827,
0.1067824587225914,
0.15425746142864227,
0.13902020454406738,
-0.5595988631248474,
-0.3886986970901489,
-0.3975006937980652,
-0.32127779722213745,
0.8784934878349304,
-0.4400544762611389,
0.038830343633890... | |
`1`, so `stack = [n, n-1, n-2, ..., 3, 2, 1]`. The return value of `countDown` is never used and so the `return` statement can be ignored. The only thing that matters is that it fills the `stack` array as explained.
Second, `multiplyEach` repeatedly takes the last element of the stack, removes it, and multiplies it wi... | [
-0.3246994912624359,
0.20550018548965454,
0.49917861819267273,
-0.4283077120780945,
0.08143187314271927,
0.3427528738975525,
0.41885244846343994,
-0.5774312615394592,
-0.6024064421653748,
-0.029183104634284973,
-0.4650060832500458,
0.4374982416629791,
-0.31557580828666687,
0.24726431071758... | |
the algorithm calculates the factorial of the number `n` given to `countDown`. | [
-0.1889788806438446,
-0.05147858336567879,
0.2429610639810562,
-0.26160934567451477,
0.31956565380096436,
0.5548755526542664,
0.07342556864023209,
-0.34673213958740234,
-0.20678496360778809,
-0.20677907764911652,
-0.15532639622688293,
0.4851340651512146,
-0.35948437452316284,
0.08121801167... | |
I have 3 objects in a cell. They are UILable with text (at left), another UILable with text (at right) and a UIButton (at right most). Like:
> [[label1\_***\_*\_\_\_**][label2][button]]
Now how to rearrange these objects after rotating if i want just label1 to stretch and label2 with the button should stay with thei... | [
-0.12570834159851074,
0.018793119117617607,
0.831778347492218,
-0.12393723428249359,
-0.22997097671031952,
0.2097611129283905,
0.3099655508995056,
-0.511094868183136,
-0.078624427318573,
-0.846084713935852,
-0.09205876290798187,
0.11776591837406158,
-0.16960233449935913,
0.1100581362843513... | |
my left label i did:
```
label1.autoresizingMask = UIViewAutoresizingFlexibleWidth;
```
But after rotating from portrait to landscape I get no changes and it looks like:
> [[label1\_***\_*\_\_*\_***][label2][button]***\_*\_\_*\_*\_\_*\_*\_\_\_\_**]
Is there any other UIView with property like UIBarButtonSystemIte... | [
-0.011513794772326946,
-0.21883319318294525,
0.903289794921875,
-0.0017494820058345795,
-0.21090810000896454,
0.12464235723018646,
0.06200277805328369,
-0.3172827661037445,
0.02235131524503231,
-0.9922279715538025,
0.06115378066897392,
0.6439794301986694,
0.03360239043831825,
-0.0978774577... | |
My project is in struts1.2. Is there any to implement Token interceptor (struts2) in struts1.2?
I know it can be implemented by using
1. `saveToken(HttpServletRequest req)`
2. `isTokenValid(HttpServletRequest req)`
3. `resetToken(HttpServletRequest req)`
But I don't want to add above in each and every action.
I know ... | [
0.26550406217575073,
0.03883310779929161,
0.4884462058544159,
-0.0011341497302055359,
-0.3046889901161194,
0.30053362250328064,
0.4994157552719116,
-0.8606816530227661,
0.007328570354729891,
-0.24155193567276,
0.23956915736198425,
0.35673490166664124,
-0.29575133323669434,
-0.3371270895004... | |
called "token" and possibly mapped to /token with appropriate actions with wild cards to capture what ever you throw at it... which forwards to the struts1 actions. **PS**: You asked how it could be done... this is far from pretty and I wouldn't do this. [cost: complicates mapping logic ]
3) Convert everything to stru... | [
0.05342899262905121,
-0.4068162143230438,
0.07785671949386597,
0.06533683836460114,
-0.4109272062778473,
0.14889754354953766,
0.4597148597240448,
-0.5333410501480103,
-0.06608494371175766,
-0.501173198223114,
0.1059798076748848,
0.4401523172855377,
-0.4696653187274933,
-0.4048210680484772,... | |
I have some intriguing questions related to Custom Options of Product:-
1. Is there any difference between Options & Custom Options? This is because I have found two different properties for each Product details, in almost all product-related modules:
* `options`
* `custom_options`However there is only one class fo... | [
0.4313729405403137,
-0.3752938210964203,
0.20840050280094147,
0.11113398522138596,
-0.2255353182554245,
0.12214543670415878,
-0.2221408188343048,
0.03120552934706211,
-0.4658328592777252,
-0.5809370279312134,
0.02294308878481388,
0.7741089463233948,
0.010436397977173328,
-0.068780913949012... | |
Item, and not all its details (like Custom Option Price & Price Type).
So I created an object of this class `Mage_Catalog_Model_Product_Option_Value`, considering only the `drop_down` Custom Option Type. I've provided my code below, but it is still in vain and not fetching the desired results. How can I rectify this c... | [
0.11416230350732803,
-0.24397754669189453,
0.6341404318809509,
-0.11336357891559601,
-0.012776178307831287,
0.5487654209136963,
-0.10565567016601562,
-0.6404675841331482,
-0.41650229692459106,
-0.24378006160259247,
-0.3885158896446228,
0.5273207426071167,
-0.20610064268112183,
0.1780927032... | |
// Value ID is stored in this field "option_value"
$objModel = Mage::getModel('catalog/product_option_value')->load($_eachOption['option_value']);
// This should provide all the details of this particular Option Value as chosen by the Customer when ordering this Product, but unfortunately it do... | [
0.15642300248146057,
-0.28993263840675354,
0.5290298461914062,
-0.16310235857963562,
0.2998542785644531,
0.3171272277832031,
-0.15750335156917572,
-0.16335104405879974,
-0.2623389661312103,
-0.38298845291137695,
-0.3137383759021759,
0.6553411483764648,
-0.026142684742808342,
-0.15879103541... | |
* This gives the output as, without any details on Price and Price Type:-
* Array
* {
* [option_type_id] => 13014
* [option_id] => 4921
* | [
0.3650607168674469,
-0.3054935336112976,
0.41572898626327515,
-0.0030711637809872627,
0.2702482044696808,
0.5508053302764893,
-0.1907322257757187,
-0.36747631430625916,
0.07664017379283905,
-0.33772411942481995,
-0.13339431583881378,
0.7493196725845337,
0.25989601016044617,
0.2054350078105... | |
[sku] => XBPS22
* [sort_order] => 0
* }
*/
unset($objModel);
}
}
}
echo "</pre>";
```
After doing some checking, I found that the price related to each Option Values are stored in `catalog_product_option_type_price` database table, and the price rela... | [
0.32978004217147827,
-0.0741518884897232,
0.3088670074939728,
-0.23270291090011597,
0.2740410268306732,
0.4756864607334137,
-0.261166512966156,
-0.44097620248794556,
-0.13271845877170563,
-0.2815859019756317,
-0.22410160303115845,
0.4726733863353729,
-0.10443294793367386,
0.266254156827926... | |
Options are stored in `catalog_product_option_price` database table. So there must be some way as to how Magento fetches the corresponding Custom Option Value prices.
In this code, I load the product by id, get the option collection, which in my tests only contains the custom options for a product, not attributes or ot... | [
0.3089858293533325,
-0.4082871377468109,
0.347263902425766,
0.03175441548228264,
0.463275671005249,
0.24859097599983215,
-0.17206129431724548,
-0.26632702350616455,
-0.22339209914207458,
-0.7017726898193359,
-0.2521829307079315,
0.8461841344833374,
-0.0021654486190527678,
-0.19840021431446... | |
{
Mage::log('Name: ' . $option->getDefaultTitle());
Mage::log(' Type: ' . $option->getType());
Mage::log(' Class: ' . get_class($option));
Mage::log(' Price/Type: ' . ($option->getPrice() ? $option->getPrice() : '0.00') . ' / ' . $option->getType());
if ($option->getType() === 'drop_down')... | [
-0.005366838537156582,
-0.22932052612304688,
0.8643326759338379,
-0.17510901391506195,
0.21196947991847992,
0.237755686044693,
0.02513379417359829,
-0.6007658839225769,
-0.15524545311927795,
-0.2814503610134125,
-0.8709267377853394,
1.0311485528945923,
-0.15878036618232727,
-0.078701563179... | |
Mage::log(' ' . $value->getTitle() . ' / ' . $value->getPrice() . ' / ' . $value->getPriceType());
}
}
}
?>
```
Example Log Output:
```
2014-02-18T20:15:25+00:00 DEBUG (7): Name: Turtle Color
2014-02-18T20:15:25+00:00 DEBUG (7): Type: drop_down
2014-02-18T20:15:25+00:00 DEBUG (7): Class: M... | [
-0.06618352234363556,
-0.14655084908008575,
0.5200368762016296,
-0.10477785766124725,
0.21326033771038055,
0.29685088992118835,
-0.021598266437649727,
-0.41205698251724243,
-0.20993271470069885,
-0.15608517825603485,
-0.4598560035228729,
1.2773878574371338,
-0.028542224317789078,
0.0116516... | |
White / 0.0000 / fixed
2014-02-18T20:15:25+00:00 DEBUG (7): Blue / 0.0000 / fixed
```
Example available data for `$option Mage::log($option->toArray())`:
note: price and price\_type are only available on the option values for drop\_down type options.
```
2014-02-18T20:19:44+00:00 DEBUG (7): Array
(
[opt... | [
0.1483834832906723,
-0.2250537872314453,
0.40857934951782227,
-0.3936273157596588,
0.19565612077713013,
0.34540292620658875,
-0.22211717069149017,
-0.2607721984386444,
-0.21919968724250793,
-0.445914626121521,
-0.34139037132263184,
0.6663579344749451,
-0.522477924823761,
0.1563036888837814... | |
[sort_order] => 90
[description] =>
[default_title] => Turtle Name
[store_title] =>
[title] => Turtle Name
[default_price] => 0.0000
[default_price_type] => fixed
[store_price] =>
[store_price_type] =>
[price] => 0.0000
[price_type] => fixed
)
```
Example available data for `$v... | [
0.08394749462604523,
0.06553364545106888,
0.6018527746200562,
0.04518250375986099,
0.09135787934064865,
0.0707702562212944,
-0.16503256559371948,
-0.761372983455658,
-0.11608754098415375,
-0.3891184628009796,
-0.4162055552005768,
1.0916508436203003,
-0.019733022898435593,
0.143406495451927... | |
[0] => Array
(
[option_type_id] => 1149
[option_id] => 229
[sku] => | [
0.11122386157512665,
-0.3303785026073456,
0.10606883466243744,
-0.16365556418895721,
0.10093795508146286,
0.3749803304672241,
-0.03627584129571915,
-0.3328131139278412,
-0.0857648178935051,
-0.4249518811702728,
-0.05789223313331604,
0.19446125626564026,
-0.23366355895996094,
0.008918105624... | |
[sort_order] => 10
[default_price] => 0.0000
[default_price_type] => fixed
[store_price] => 0.0000
[store_price_type] => fixed | [
-0.04508178308606148,
-0.3158667981624603,
0.4362565875053406,
-0.06442631781101227,
0.10633058845996857,
0.6466836333274841,
-0.41083991527557373,
-0.1280403435230255,
-0.1819346398115158,
-0.32665205001831055,
-0.5926547050476074,
0.7097827792167664,
-0.17842838168144226,
0.0305033829063... | |
[price] => 0.0000
[price_type] => fixed
[default_title] => 31"
[store_title] => 31" | [
0.02618384175002575,
-0.27914416790008545,
0.507651150226593,
-0.10001678019762039,
0.277378648519516,
0.3201659619808197,
-0.12328924238681793,
-0.2172543704509735,
0.0366700254380703,
-0.15065453946590424,
-0.522811770439148,
1.1036144495010376,
-0.18206016719341278,
0.014939059503376484... | |
[title] => 31"
)
[1] => Array
(
[option_type_id] => 1150
[option_id] => 229 | [
0.04952577129006386,
-0.24232032895088196,
0.43628379702568054,
0.053059499710798264,
0.3811663091182709,
0.10980947315692902,
-0.0016130522126331925,
-0.5040069222450256,
-0.18443307280540466,
-0.3127346634864807,
-0.2550159692764282,
0.5447074174880981,
-0.2104940116405487,
0.06120260804... | |
[sku] =>
[sort_order] => 20
[default_price] => 0.0000
[default_price_type] => fixed | [
-0.031026894226670265,
-0.60605788230896,
0.34748464822769165,
0.1720021665096283,
-0.004762082360684872,
0.5592527389526367,
-0.6220610737800598,
-0.05138169229030609,
-0.16343346238136292,
0.007411861792206764,
-0.5855076909065247,
0.6330493092536926,
0.012463224120438099,
0.018638923764... | |
[store_price] => 0.0000
[store_price_type] => fixed
[price] => 0.0000
[price_type] => fixed
[default_title] => 31.5" | [
0.24223175644874573,
-0.13174837827682495,
0.5689593553543091,
0.10127878189086914,
0.48311328887939453,
0.4477309584617615,
-0.2642005980014801,
-0.15275995433330536,
-0.07869191467761993,
0.05509475991129875,
-0.5077758431434631,
1.021729588508606,
0.0774368867278099,
0.04599547386169433... | |
[store_title] => 31.5"
[title] => 31.5"
)
)
)
``` | [
0.21223804354667664,
0.4886249601840973,
0.6227466464042664,
-0.17720946669578552,
0.499558687210083,
-0.11050012707710266,
0.28443387150764465,
-0.32090675830841064,
0.017829792574048042,
-0.28285983204841614,
-0.6534092426300049,
0.7576447129249573,
-0.2536482512950897,
0.364649444818496... | |
Has anyone heard of the ability to grab a java.awt.Robot from an external JVM? Or even how to serve one?
I'd really like to be able to run some Automated GUI tests on an application that is already running. Could I set up an RMI Gateway on the application and execute Robot commands/tests by proxy? Or is there already... | [
0.27167361974716187,
0.05653849616646767,
0.04434923827648163,
0.17714503407478333,
0.09522178769111633,
-0.06982360035181046,
0.19932855665683746,
-0.07531148940324783,
-0.19197775423526764,
-0.5064983367919922,
0.021164286881685257,
0.33058425784111023,
-0.1116214245557785,
0.01130307931... | |
Application B - on the same host, while A is still running - Mouse / Keyboard commands using a java.awt.Robot instance taken from Application A.
I guess it's almost driving rather than testing the application - a bit like speeding up certain sections from a dashboard (like logging in, creating a new file etc)
Edit :... | [
0.2147112786769867,
0.06461034715175629,
0.26532721519470215,
-0.11861995607614517,
-0.2988590896129608,
-0.21150842308998108,
0.2748982906341553,
-0.12795178592205048,
-0.04156777635216713,
-0.5201312899589539,
0.058037325739860535,
0.49248188734054565,
-0.202581524848938,
0.0844087824225... | |
it can be nice to use [Robotium remote control](http://code.google.com/p/robotium/wiki/RemoteControl).
In the meanwhile, depending on what you really want, a small socket client / server program pair sending clicks and mouse moves is not so hard to implement. | [
0.31579887866973877,
-0.2007622867822647,
0.18117457628250122,
0.3963012099266052,
-0.1569283902645111,
-0.08637239038944244,
0.10189513862133026,
0.1218985989689827,
-0.2572088837623596,
-0.6187165379524231,
-0.060483139008283615,
0.5673016309738159,
-0.16180184483528137,
0.22065621614456... | |
Using Selenium IDE, I am trying to locate a link within a table row. The table rows are dynamically generated. Each row has some cell with text content and a cell with possibly two or more links.
What I'd like to do is to create an automated test that clicks a specific link within a specific row as referenced by a spe... | [
0.299165815114975,
0.11237967759370804,
0.46467125415802,
-0.05447305366396904,
-0.16798141598701477,
0.04678792506456375,
-0.06901074945926666,
-0.11036793887615204,
0.09151352196931839,
-0.9810441732406616,
0.08993168920278549,
0.08785774558782578,
-0.3918120861053467,
0.2768706083297729... | |
<a href="www.foo.com/delete/id=123456">Delete</a>
</td>
</tr>
<tr>
<td>
Buenos Dias!
</td>
<td>
Type Greeting
</td>
<td>
<a href="www.foo.com/view/id=789101">View</a>
<a href="www.foo.com/delete/id=789101">Delete</a>
</td>
</tr>
</table>
</body>
</html>
```
The scenario is, on... | [
-0.03829500451683998,
0.12215528637170792,
0.6050724983215332,
-0.06871657818555832,
-0.2925436496734619,
0.07202187925577164,
0.024102574214339256,
-0.1418241411447525,
-0.2515539526939392,
-0.45144814252853394,
-0.23961211740970612,
0.46869781613349915,
-0.3850676715373993,
0.03418965265... | |
good way to locate the "View" link by referencing the text "Buenos Dias!"?
I am able to locate the cell which contains the text:
```
//td[text()="Buenos Dias!"]
```
But I want to use it somehow as a reference for locating its respective "View" link from the table. I tried out sibling formats (following, precedin... | [
0.31317228078842163,
0.47500503063201904,
0.796658992767334,
0.046112969517707825,
-0.058954719454050064,
-0.4105243980884552,
0.24208444356918335,
-0.031982410699129105,
-0.09611203521490097,
-0.6341948509216309,
0.0407816581428051,
0.8548324704170227,
-0.28506362438201904,
-0.24077428877... | |
Mac OS X Lion 10.7.3
**Use**:
```
(//td[normalize-space() ="Buenos Dias!"])[1]/following-sibling::td[2]/a[. = 'View']
``` | [
0.0887320339679718,
0.1518685668706894,
0.5052787065505981,
-0.2761533558368683,
-0.20938672125339508,
-0.09325189888477325,
0.2753291428089142,
0.0018974218983203173,
-0.23864062130451202,
-0.08740519732236862,
-0.21456876397132874,
0.8109853267669678,
-0.668786883354187,
-0.2968786954879... | |
After making a gzip deflate request in PHP, I receive the deflated string in offset chunks, which looks like the following
Example shortened greatly to show format:
```
00001B4E
¾”kŒj…Øæ’ìÑ«F1ìÊ`+ƒQì¹UÜjùJƒZ\µy¡ÓUžGr‡J&=KLËÙÍ~=ÍkR
0000102F
ñÞœÞôΑüo[¾”+’Ñ8#à»0±R-4VÕ’n›êˆÍ.MCŽ…ÏÖr¿3M—èßñ°r¡\+
00000000
```
I'm unable... | [
-0.09801559895277023,
0.4627217650413513,
0.6113929152488708,
-0.0369158573448658,
-0.4986458718776703,
0.13795317709445953,
0.3390982151031494,
-0.0675804540514946,
0.03268696740269661,
-0.4186277687549591,
-0.22645030915737152,
0.513167142868042,
-0.2764151096343994,
0.06558538228273392,... | |
an easier way.
The proper method to deflate a chunked response is roughly as follows:
```
initialise string to hold result
for each chunk {
check that the stated chunk length equals the string length of the chunk
append the chunk data to the result variable
}
```
Here's a handy PHP function to do that for you (*... | [
0.1843087077140808,
-0.11327912658452988,
0.3660617768764496,
-0.1829686015844345,
-0.3281475603580475,
0.12858620285987854,
0.17314252257347107,
-0.3528776466846466,
-0.2037515789270401,
-0.20547911524772644,
-0.17906983196735382,
0.6671755313873291,
-0.3547174334526062,
-0.16858491301536... | |
data
while (($part = array_shift($parts)) !== NULL) {
if ($chunkLen) {
// Add the data to the string
// Don't forget, the data might contain a literal CRLF
$thisChunk .= $part."\r\n";
if (strlen($thisChunk) == $chunkLen) {
// Chunk is complete
$result .= $thisChunk;
... | [
-0.1624845713376999,
-0.13743136823177338,
0.4285654127597809,
-0.10045014321804047,
0.011718787252902985,
-0.10514632612466812,
0.23344722390174866,
-0.055366672575473785,
-0.25002747774124146,
0.06610642373561859,
-0.5750904679298401,
0.43664348125457764,
-0.16507691144943237,
0.17293807... | |
'';
} else if (strlen($thisChunk) == $chunkLen + 2) {
// Chunk is complete, remove trailing CRLF
$result .= substr($thisChunk, 0, -2);
$chunkLen = 0;
$thisChunk = '';
} else if (strlen($thisChunk) > $chunkLen) {
// Data is malformed
return FALSE;
} | [
0.03435678407549858,
0.10868404805660248,
0.3992260992527008,
-0.2358996421098709,
-0.012643175199627876,
-0.14837250113487244,
0.6190534234046936,
-0.1295575648546219,
-0.17410814762115479,
-0.054110895842313766,
-0.5175251364707947,
0.481717586517334,
-0.09696400165557861,
0.384586274623... | |
} else {
// If we are not in a chunk, get length of the new one
if ($part === '') continue;
if (!$chunkLen = hexdec($part)) break;
}
}
// Return the decoded data of FALSE if it is incomplete
return ($chunkLen) ? FALSE : $result;
}
``` | [
0.31150028109550476,
-0.06554027646780014,
0.2701980471611023,
-0.06276244670152664,
0.27112913131713867,
-0.04474082216620445,
0.5240045785903931,
-0.2332111895084381,
-0.3575071394443512,
-0.15122871100902557,
-0.49846455454826355,
0.5671370029449463,
-0.05792807787656784,
0.273160606622... | |
I got a problem I could not solve.. We got a messages table in our my SQL database with some fields like text, senderid, recipientid, date, ...
A new feature is to group these messages like Facebook in one. Let's say:
1. user A is sending user B a message
2. user B is replying to A
3. User A is sending user C a Messa... | [
0.1784403771162033,
0.135347381234169,
0.459418922662735,
-0.1955670267343521,
-0.3257654905319214,
0.2245498150587082,
0.24258454144001007,
-0.1919439435005188,
-0.41423654556274414,
-0.38036641478538513,
0.1258116066455841,
0.24703766405582428,
-0.5428433418273926,
0.02556278370320797,
... | |
(3) and A not to D (4).
A simple `group by (senderid)` or `group by (recipientid)` is not enough..
How's that possible?
The proper method to deflate a chunked response is roughly as follows:
```
initialise string to hold result
for each chunk {
check that the stated chunk length equals the string length of the chu... | [
-0.03311064839363098,
-0.07269036024808884,
0.2728787362575531,
-0.18947486579418182,
-0.5057783126831055,
0.14845779538154602,
0.07593688368797302,
-0.4427267909049988,
-0.1291186511516571,
-0.22537729144096375,
-0.27698519825935364,
0.6180036067962646,
-0.4667747914791107,
-0.11159899830... | |
vars track the current chunk
$chunkLen = 0;
$thisChunk = '';
// Loop the data
while (($part = array_shift($parts)) !== NULL) {
if ($chunkLen) {
// Add the data to the string
// Don't forget, the data might contain a literal CRLF
$thisChunk .= $part."\r\n";
if (strlen($thisChunk) == ... | [
-0.0732543021440506,
-0.25543150305747986,
0.5573517084121704,
-0.22101931273937225,
0.1149217039346695,
0.034535568207502365,
0.3782179057598114,
-0.0913342610001564,
-0.24368897080421448,
-0.05099010095000267,
-0.3927467167377472,
0.6454436779022217,
-0.268403023481369,
0.090034574270248... | |
$chunkLen = 0;
$thisChunk = '';
} else if (strlen($thisChunk) == $chunkLen + 2) {
// Chunk is complete, remove trailing CRLF
$result .= substr($thisChunk, 0, -2);
$chunkLen = 0;
$thisChunk = '';
} else if (strlen($thisChunk) > $chunkLen) {
// Data is | [
-0.2798748314380646,
-0.052003394812345505,
0.6407589912414551,
-0.19514474272727966,
-0.00841601099818945,
-0.24248091876506805,
0.26412233710289,
-0.09237698465585709,
-0.22462159395217896,
-0.06277904659509659,
-0.49912357330322266,
0.44962283968925476,
-0.020452138036489487,
0.13973377... | |
malformed
return FALSE;
}
} else {
// If we are not in a chunk, get length of the new one
if ($part === '') continue;
if (!$chunkLen = hexdec($part)) break;
}
}
// Return the decoded data of FALSE if it is incomplete
return ($chunkLen) ? FALSE : $result;
}
``` | [
0.7305497527122498,
0.04649217426776886,
0.18296872079372406,
-0.057966746389865875,
0.11642035096883774,
0.2539476156234741,
0.8089584112167358,
-0.10471834987401962,
-0.30822306871414185,
-0.36140742897987366,
0.09041224420070648,
0.43422931432724,
-0.23158815503120422,
0.612351059913635... | |
I'm trying to index a drupal site with something around 1.5 million nodes. Mostly simple nodes, about 100k nodes are larger in size (pdf-documents processed with tika).
I've tried indexing several times now and it always fails in the same way: SOLR crashes/hangs with high load and mem usage after several days of index... | [
-0.08342346549034119,
0.05665783956646919,
0.3919004201889038,
-0.08124721050262451,
-0.15062153339385986,
0.05413415655493736,
0.22040246427059174,
-0.030373474583029747,
-0.37043675780296326,
-0.7918385863304138,
-0.08113394677639008,
0.2195025384426117,
-0.2108520269393921,
0.1365853101... | |
is using way more memory than the heap size (currently at 8000M) (a lot of swapping)
Load is around 3.0 (for the small and big box)
Solr is not responding for indexing. Searching is slow but possible. Admin interface is responsive
Restarting SOLR fixes the problem for a little while but it always comes back.
When que... | [
-0.19032157957553864,
-0.03366655856370926,
1.0422632694244385,
-0.19440028071403503,
-0.022180961444973946,
-0.0387551486492157,
0.32567107677459717,
0.10959158092737198,
-0.6479228138923645,
-0.804812490940094,
0.03450503200292587,
0.4297102391719818,
0.018481355160474777,
0.063971005380... | |
errors but this doesn't provide me with any logs.
I'm using the standard SOLR configuration for drupal 6. I've used different mergefactors but this doesn't seem to do anything to help the problem.
Anyone with ideas? If you need more information I'll try to respond as quick as possible!
This is in my log at the momen... | [
-0.2534131705760956,
0.04584645852446556,
0.23593352735042572,
-0.08809255063533783,
-0.0859924927353859,
0.2463161051273346,
0.31215253472328186,
0.061706867069005966,
-0.3559326231479645,
-0.8304361701011658,
-0.07403086125850677,
0.21255531907081604,
-0.4334309995174408,
0.1130616813898... | |
org.apache.lucene.index.IndexWriter.merge(IndexWriter.java:3940)
at org.apache.lucene.index.ConcurrentMergeScheduler.doMerge(ConcurrentMergeScheduler.java:388)
at org.apache.lucene.index.ConcurrentMergeScheduler$MergeThread.run(ConcurrentMergeScheduler.java:456)
2012-04-03 14:26:25.409:INFO::Shutdown hook complete
K... | [
-0.029922064393758774,
-0.024023931473493576,
0.6475926637649536,
0.190529465675354,
-0.07188360393047333,
-0.12814326584339142,
0.6062586307525635,
-0.0967770516872406,
-0.41569721698760986,
-0.7348337173461914,
-0.2514517605304718,
0.2025759220123291,
-0.15463709831237793,
0.260833680629... | |
the properties of the *assembly* in which the type resides into the type identity. Display name, [AssemblyVersion], Culture, PublicKeyToken and (indirectly) ProcessorArchitecture. You want to compare `Type.AssemblyQualifiedName` instead.
The diagnostic for failure like this is that the source code that contains the in... | [
0.2750266194343567,
0.13094684481620789,
0.08226563036441803,
-0.0142696313560009,
-0.2727538049221039,
0.04551999270915985,
0.3789568841457367,
-0.02153085544705391,
-0.3227151930332184,
-0.6782352924346924,
0.12113223224878311,
0.40811586380004883,
-0.45949071645736694,
0.327399134635925... | |
.NET 4, a type can be identical if it has the same GUID. The underlying core for the Embed Interop Types feature. But that only applies to [ComImport] types, I doubt that's the case here. | [
0.4565250277519226,
0.08602745831012726,
0.1731768697500229,
-0.1442369520664215,
-0.3676151633262634,
-0.3532359302043915,
0.013994979672133923,
0.13295531272888184,
0.021479858085513115,
-0.6422845721244812,
0.08555404096841812,
0.6677587628364563,
-0.7166709303855896,
-0.028668647632002... | |
We are going to be developing a large enterprise desktop application very soon and i have been spending some time researching the WPF + PRISM + MVVM approach, i have got a good grasp on most of the concepts and am loving the modularity it provides.
Where i am having problems is with how to architect the services layer... | [
0.35028764605522156,
0.16514968872070312,
0.5939659476280212,
-0.2224269062280655,
0.05686585605144501,
-0.22678323090076447,
0.2562004327774048,
-0.25549495220184326,
-0.3645612597465515,
-0.7930158972740173,
-0.20797143876552582,
0.4429257810115814,
-0.2029966562986374,
0.281760722398757... | |
from within my view-models, however im having a hard time working out how this should hang together, mainly due to my entites being part of the WCF service.
For example
**Module1**
Contains WCF Service + Concrete Application Service(ISearchService) + WCF Service generated entities(model)
**Module1.Infastructure** - ... | [
-0.07469595223665237,
0.011742274276912212,
0.4950698912143707,
-0.2956245243549347,
0.026834314689040184,
-0.028052054345607758,
0.31977197527885437,
-0.4047192633152008,
-0.011859705671668053,
-0.721533477306366,
-0.17373481392860413,
0.5974094271659851,
-0.15857389569282532,
0.242871701... | |
and then expecting any other modules to be able to use it means they need to reference the module itself not just the modules infastructure, unless i pull out the services into another assembly.
Should i be exposing my entites that are auto generated from my EF model in this way?
Does anyone have a better solution ?
... | [
0.48957937955856323,
0.04368266463279724,
0.7281426787376404,
-0.09642082452774048,
-0.27175167202949524,
-0.2943819463253021,
0.3354780673980713,
-0.5781721472740173,
-0.38169053196907043,
-0.630215048789978,
-0.14929164946079254,
0.5082427859306335,
0.03261326998472214,
0.146198526024818... | |
project that contains the auto generated classes from WCF RIA services web project. I can reference this project **in both WPF and Silverlight.**
* Application.RIAServices.Web : Webproject containing the DomainServices and database generation code by using the DbContext. this is the WCF RIA link project for Application... | [
0.2933126389980316,
0.037543728947639465,
0.2832522690296173,
-0.022927088662981987,
-0.2837701737880707,
-0.21811756491661072,
0.08319182693958282,
-0.0836787223815918,
-0.15818409621715546,
-0.8101022839546204,
0.04856472462415695,
0.2852134108543396,
-0.23503538966178894,
0.458396911621... | |
Application.Modules.ModuleD : General modules providing functionality. All of my modules (that use WCF RIA Services) have a reference to the Application.Infrastructure and Application.RIAServices projects.
* Application.Shell : Startup project. having the bootstrapper and registering all relevant modules.
Reading Rach... | [
0.6744149923324585,
0.111724853515625,
0.31061431765556335,
-0.128906711935997,
-0.05969660356640816,
-0.20575453341007233,
0.4080771505832672,
-0.3739628195762634,
-0.3394700288772583,
-0.7474164366722107,
-0.3053700923919678,
0.4476073384284973,
0.18919479846954346,
0.10441666841506958,
... | |
Looking forward to hearing your opinion and the outcome of the question/issue
**Edit:**
Application.Domain also has a separate structure aswell.
I have my Models. Only container pure properties that need to be mapped to the database. Then I have my Metadata folder. Now for this to work I need to have the same namesp... | [
0.3712729811668396,
0.1864086091518402,
0.6124851107597351,
0.3227415084838867,
0.03081660531461239,
-0.1578216403722763,
-0.09680286049842834,
-0.17425966262817383,
-0.10184676200151443,
-0.673519492149353,
0.25614702701568604,
0.4504151940345764,
0.03819765895605087,
0.5671670436859131,
... | |
EF/WCF RIA code generator.
One of those attribute is the `CustomValidation` it use a static class and a method paramater and validates the entity on the server. Or if you create the file with a .shared.cs extension it gets generated to the Application.RIAServices project.
**Possibility**
To try to answer your questi... | [
0.41843247413635254,
-0.1766342967748642,
0.5838263630867004,
0.07092072069644928,
-0.015705564990639687,
-0.30241185426712036,
-0.17453458905220032,
-0.3046049475669861,
-0.2266157567501068,
-0.7884321808815002,
-0.035497378557920456,
0.4664943218231201,
-0.26934829354286194,
0.1555735766... | |
reference this project and thus not creating dependecies between modules. | [
0.49656394124031067,
0.0848098173737526,
0.15161952376365662,
0.0653507187962532,
0.08017271012067795,
-0.41988205909729004,
0.12336787581443787,
-0.13243290781974792,
-0.07203435152769089,
-0.45607292652130127,
-0.2060832679271698,
0.4161738455295563,
-0.07740975171327591,
-0.193364128470... | |
Is there a way to retrieve IMSI on the Windows Phone 7 platform?
Regards,
Yusuf
It is possible, but it requires you to use native access, which is not officially supported and will not get your app approved in the Marketplace. I know that with the Dell Venue Pro I managed to access that data [through AT commands](http... | [
0.20711703598499298,
-0.13165263831615448,
0.35557785630226135,
0.1185787096619606,
0.07135551422834396,
0.01903533563017845,
0.15268850326538086,
-0.062337540090084076,
-0.36722972989082336,
-0.6397692561149597,
-0.08833074569702148,
0.881632387638092,
-0.3784608542919159,
-0.206109687685... | |
How can I download android sdk package behind a server proxy?


you can see the proxy setting from IE if you are using windows for linux it is different | [
0.1729925125837326,
-0.09350641816854477,
0.35692623257637024,
0.07428981363773346,
-0.06300528347492218,
-0.12858796119689941,
0.35328251123428345,
-0.16186855733394623,
-0.27984094619750977,
-0.9580010175704956,
-0.1462405025959015,
0.5539955496788025,
-0.22051748633384705,
-0.0141073940... | |
I received a ConcurrentNodificationException when I implemented a rich:tree with dynamic loading of the nodes.
I'm using JSF1.2, Tomcat 6.0, RichFaces 3.3.3, and Java 6u31.
in JSF page I have this rich tree component
```
<rich:tree id="treeAreas" value="#{areaArmazenamento.treeAreas}"
var="node"
adviseNodeOp... | [
-0.1590687781572342,
-0.02858435921370983,
0.565942645072937,
-0.08876524120569229,
0.22044061124324799,
-0.04214156046509743,
0.3646206259727478,
-0.2330838143825531,
-0.05683140456676483,
-0.6997741460800171,
0.07344183325767517,
0.7699965834617615,
-0.1070689931511879,
-0.07560386508703... | |
is loaded, when a click in a node the substructure of this node is loaded.
On load the first level is validated the user's permissions, and this validation use the iterator of list that stores the tree nodes, this validation remove nodes that the user access is denied. some like this:
```
List<AreaArmazenamento> area... | [
0.1151353120803833,
-0.48183682560920715,
0.8930536508560181,
0.11860044300556183,
0.3387244641780853,
-0.14965948462486267,
0.19493429362773895,
-0.6027511358261108,
-0.5803984999656677,
-0.4085119366645813,
-0.4382445812225342,
0.26651936769485474,
-0.4088175594806671,
0.3674134910106659... | |
if(!havePermission)
{
it.remove();
}
}
}
```
When I click on any node, I select the sub nodes of database and add the substructure in selected node, this working but sometimes on select node is throwed a ConcurrentNodificationException on Hashtable which is in TreeDataModule of Ric... | [
0.04559265449643135,
0.017739998176693916,
0.42768189311027527,
-0.0569998137652874,
-0.013402805663645267,
-0.19132883846759796,
0.39335647225379944,
-0.0799482986330986,
-0.4426664412021637,
-0.5861374139785767,
-0.18938764929771423,
0.09843680262565613,
-0.43794679641723633,
0.320433706... | |
be causing this error? and why?
I Found the problem...
```
while(it.hasNext())
{
area = it.next();
boolean havePermission = ControllerPermission.havePermission(null, area, Permissions.VIEW, false);
if(!havePermission)
{
it.remove(); //problem here
}
}
```
I was removing items from t... | [
0.10130435228347778,
-0.25436705350875854,
0.5021561980247498,
-0.23300190269947052,
0.16704189777374268,
-0.1588011085987091,
0.3240043818950653,
-0.20578539371490479,
-0.3986700773239136,
-0.5460381507873535,
-0.439743310213089,
0.31228169798851013,
-0.5049439668655396,
0.643310368061065... | |
I'm trying to bind values in a GET request to a POJO.
The values are parameters in a HTTP GET request. I'm using JSONP to pass the parameters however it looks like JSONP pushes the JSON object up onto the Request line so its not really a JSON object which is being sent but instead just name value pairs on the URL.
I... | [
0.18967579305171967,
-0.3841263949871063,
0.156161367893219,
0.1028495579957962,
-0.011201294139027596,
-0.26624587178230286,
0.2377835512161255,
0.10630190372467041,
-0.40487346053123474,
-0.5401664972305298,
-0.06088691204786301,
0.38415250182151794,
-0.3359138071537018,
-0.0143042681738... | |
the request body however it doesnt exist because it is a GET request. Is there any other way to bind the values in the request without having to manually include a @QueryParam entry for each ?
Thanks
I was able resolve this by using [@com.sun.jersey.api.core.InjectParam](http://jersey.java.net/nonav/apidocs/1.12/jerse... | [
-0.2708573639392853,
-0.0599522665143013,
0.6195288300514221,
-0.005249342415481806,
-0.2546294927597046,
-0.004099758341908455,
0.20499803125858307,
-0.3064829111099243,
-0.03776168078184128,
-0.6684178113937378,
-0.11236891895532608,
0.5624679923057556,
-0.1058163046836853,
-0.1961741745... | |
This post will be heavy on images.
I have created a custom ArrayAdapter and using it on a Listview. Am I missing something here on the Adapter?
```
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
ArrayHolder holder = null;
if(row == n... | [
0.042595796287059784,
-0.16029447317123413,
0.6696823835372925,
-0.31156718730926514,
-0.18520455062389374,
0.031978048384189606,
0.47672757506370544,
-0.27850019931793213,
-0.07017049938440323,
-0.6406320929527283,
-0.15089061856269836,
0.5205516219139099,
-0.3304597735404968,
0.385255366... | |
holder = new ArrayHolder();
holder.txtTitle = (TextView)row.findViewById(R.id.txtTitle);
row.setTag(holder);
}
else
{
if(position % 2 == 0){row.setBackgroundColor(Color.DKGRAY);}
else{row.setBackgroundColor(Color.BLACK);}
Typeface font1 =Typeface.createFromAsset(c... | [
-0.03229724243283272,
-0.07187961041927338,
0.9983660578727722,
-0.4343339800834656,
-0.032144755125045776,
0.36168724298477173,
0.13919281959533691,
-0.7619240880012512,
-0.16796205937862396,
-0.45798370242118835,
-0.41307538747787476,
0.5101519823074341,
-0.302376389503479,
0.27932891249... | |
}
String array = data.get(position);
holder.txtTitle.setText(array);
return row;
}
```
When I first launch the application, the following screen is displayed:
(Screens are form an actual device and not an emulator)
[After app is initialized](http://dl.dropbox.com/u/3418039/tmp/img1.png)
Now if I clos... | [
0.10983986407518387,
-0.1483193188905716,
0.8393986821174622,
-0.22843587398529053,
0.2643592357635498,
0.11015629768371582,
0.1502121388912201,
-0.03726554661989212,
-0.2842309772968292,
-0.7629109025001526,
-0.12325570732355118,
0.6392356157302856,
-0.4537212550640106,
-0.006321894936263... | |
handling correctly the creation of new views.
The text appears as white, this tells us that the else block is skipped (so the convertView parameter was null, or that there are no views to recycle (which is fair, since you see many more views when the softkeyboard disappears)
The row gets colored correctly after a scr... | [
-0.13663850724697113,
-0.11151011288166046,
0.16448542475700378,
0.13553808629512787,
-0.13984952867031097,
0.2389066070318222,
0.20935025811195374,
-0.27464577555656433,
-0.4287751019001007,
-0.540424108505249,
0.1991191804409027,
0.7268253564834595,
-0.27767568826675415,
-0.2217828333377... | |
always put the correct color even if the view is new and not recycled.
Give it a try and tell me if it works
```
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
ArrayHolder holder = null;
if(row == null)
{
LayoutInflater inflater = ((Activity)cont... | [
0.3054337203502655,
-0.4438817799091339,
0.6401163339614868,
-0.3349752724170685,
0.3400997519493103,
0.19930396974086761,
0.30276215076446533,
-0.5269168019294739,
-0.11691805720329285,
-0.5918059349060059,
-0.44639265537261963,
0.6996241211891174,
-0.20015127956867218,
-0.123130708932876... | |
Typeface font1 = Typeface.createFromAsset(context.getAssets(), "fonts/kingrich.ttf");
((TextView)row.findViewById(R.id.txtTitle)).setTypeface(font1);
((TextView)row.findViewById(R.id.txtTitle)).setTextColor(Color.rgb(153, 255, 102));
holder = (ArrayHolder)row.getTag();
String array = data.get(position);
h... | [
0.22987058758735657,
-0.0430033802986145,
0.918036162853241,
-0.43151986598968506,
-0.20909588038921356,
0.3767032027244568,
0.24310705065727234,
-0.6383308172225952,
-0.05769350007176399,
-0.7158147096633911,
-0.45461738109588623,
0.5517467856407166,
-0.553329586982727,
0.1438977569341659... | |
for an li tag i am adding a div with multiple div dynamically like below.
```
var divStr = "";
divStr = divStr + "<div id='divTaskDetail"+id+"'>";
divStr = divStr + "<div id='div1"+id+"'>.......</div>";
divStr = divStr + "<div id='div2"+id+"'>.......</div>";
divStr = divStr + "<div id='div3"+id+"'>.....<input cla... | [
-0.24188350141048431,
-0.3382963538169861,
0.8170220255851746,
-0.4554760456085205,
-0.08689192682504654,
0.025258313864469528,
0.35144397616386414,
-0.778614342212677,
0.07085578143596649,
-0.6705347299575806,
-0.3838164210319519,
0.630261242389679,
-0.66180419921875,
-0.17388832569122314... | |
{
var CheckDivObj = $("#liTask"+id+"").children();
var childNode = CheckDivObj.prevObject[0];
var childTaskNode = childNode.childNodes[1];
var childSubTaskNode = childTaskNode.children[3];
if(childSubTaskNode != null)
{
$(""+childSubTaskNode.id+"").deta... | [
0.07234340906143188,
0.14378730952739716,
0.33659854531288147,
-0.13655121624469757,
0.5058982968330383,
0.22150839865207672,
0.5046096444129944,
-0.3436190187931061,
0.06214454025030136,
-0.5203205347061157,
-0.341849684715271,
0.49071425199508667,
-0.05198372155427933,
0.3609052300453186... | |
the `div3` in `childSubTaskNode` but i want to remove it and rebind in the same position. Is this posible.....
if so a sample code for detaching and rebinding at same position will be helpfull
Thanks in advance
You should be able to do this using the method outlined here - <http://www.ejeliot.com/samples/equal-height-... | [
-0.16659840941429138,
0.11346215009689331,
0.5444434285163879,
-0.00976856704801321,
-0.20860393345355988,
0.11289969831705093,
0.20376363396644592,
-0.2985876500606537,
-0.1855677366256714,
-0.5414298176765442,
-0.06570341438055038,
0.24240486323833466,
-0.19669821858406067,
0.19532857835... | |
<div>
<p>Content 1</p>
</div>
<div class="col2">
<p>Content 2</p>
<p>Content 2</p>
<p>Content 2</p>
<p>Content 2</p>
</div>
</div>
```
You can adjust this | [
0.07153285294771194,
-0.33810102939605713,
0.583474338054657,
0.13287772238254547,
-0.3736560344696045,
-0.28251883387565613,
-0.16053643822669983,
-0.09758447855710983,
-0.08986920118331909,
-0.6599534749984741,
-0.3117232322692871,
0.1957882195711136,
-0.5321367979049683,
-0.069588258862... | |
example to fit the window easily enough. I hope this helps.
Live Example - <http://jsfiddle.net/spacebeers/s8uLG/3/> | [
0.7056073546409607,
0.1458328515291214,
0.12542608380317688,
0.056537795811891556,
-0.15227995812892914,
-0.12490241229534149,
0.2647440731525421,
0.13933280110359192,
-0.38060760498046875,
-0.8343010544776917,
-0.18239162862300873,
0.29735037684440613,
-0.3034593164920807,
-0.041596401482... | |
I know how to connect the datasource of a TableView in a Sotryboard, but not in a xib. I connect the datasource of my table with the viewController, and when I run it I get a SIGABRT. Is it enough? Do I have to write some code for the xib?
In .h file of your class adopt TableView protocols like this.
```
@interface E... | [
0.17295069992542267,
0.18166957795619965,
0.6132470965385437,
0.19730082154273987,
-0.04624676704406738,
-0.2753506898880005,
0.2365192472934723,
-0.3440103530883789,
-0.1389467716217041,
-1.0093778371810913,
0.11359897255897522,
0.6331046223640442,
-0.17001758515834808,
0.0725997388362884... | |
//datasource method.
return 5;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
//delegate method.
}
```
In .xib you do like this. Right Click on `UITableView` Controller and connect datasource and delegate to File's Owner.
![enter image descr... | [
-0.005008679814636707,
-0.29861167073249817,
0.5932684540748596,
0.1385885775089264,
-0.0059295883402228355,
-0.21415778994560242,
0.010858731344342232,
-0.24226534366607666,
-0.43515825271606445,
-0.9405738711357117,
-0.21282480657100677,
0.4160396456718445,
-0.3473453223705292,
0.2582378... | |
I have a website where I cache a lot of info. I am seeing conflicting information around storing stuff in the asp.net cache.
For example lets say I have this data structure:
```
Dictionary<string, List<Car>> mydictionary;
```
I could store the whole thing with a string key as "MyDictionary" and then drill down onc... | [
0.1951400190591812,
0.3078341484069824,
0.31220370531082153,
0.04748188331723213,
0.05128774046897888,
0.08598434180021286,
0.3700217306613922,
0.008959107100963593,
-0.03613486513495445,
-0.8332636952400208,
-0.0722750723361969,
0.3463577330112457,
0.03674918785691261,
0.33526596426963806... | |
item in my dictionary separately in the cache (given the cache is a dictionary anyway).
```
Dictionary<string, List<Car>> mydictionary;
foreach (var item in mydictionary.Keys)
{
HttpContext.Cache.Add(item, mydictionary[item], null, Cache.NoAbsoluteExpiration, new TimeSpan(10, 0, 0), CacheItemPriority.Normal,... | [
0.04369889944791794,
0.26174622774124146,
0.1491212099790573,
0.026238692924380302,
-0.03093164600431919,
0.4310013949871063,
0.5408379435539246,
-0.2624396085739136,
-0.011591293849050999,
-0.8291853070259094,
-0.2196037620306015,
0.360266774892807,
0.2012930065393448,
0.17526954412460327... | |
do with perf. Instead, it has to do with allowing the system to perform proper memory management.
There is a lot of logic in the ASP.NET cache to figure out what to do when it runs into memory pressure. In the end, it needs to kick out some items, and it needs to do this in the least disruptive way possible. Which ite... | [
0.21137909591197968,
-0.2515309154987335,
0.13754113018512726,
0.16530349850654602,
-0.14827387034893036,
-0.16864150762557983,
0.33904024958610535,
-0.28295284509658813,
-0.27376046776771545,
-0.4828967750072479,
-0.15136675536632538,
0.2585690915584564,
-0.42424362897872925,
0.1208075582... | |
out.
But going back to the question, if you store your entire dictionary as a single item, you are only leaving two options to the ASP.NET memory manager: keep the entire thing alive, or kill the whole thing. i.e. you completely lose the benefit of having your 'hot' items stay in the cache, while your rarely accessed ... | [
0.34613707661628723,
0.08012655377388,
-0.15041039884090424,
0.3744294345378876,
0.10854402929544449,
-0.05801478400826454,
0.3274434506893158,
-0.12661787867546082,
-0.33532246947288513,
-0.27459853887557983,
-0.19064319133758545,
0.35705703496932983,
-0.2862951159477234,
0.30160787701606... | |
new wheel will not work as well since it won't coordinate with the rest of the system. | [
0.17711646854877472,
-0.056920554488897324,
0.7209511995315552,
0.3784756064414978,
0.007279462181031704,
-0.024911517277359962,
0.16245399415493011,
-0.4036840796470642,
-0.2779172658920288,
-0.756606936454773,
0.16941724717617035,
0.4636797606945038,
0.05222706124186516,
0.20988686382770... | |
I am new to database schema design and I want to learn more about how a well-designed database scheme is implemented in the real world?
Is there any places to find those schemes? Or is there any book focused on explanation over examples.
[**DatabaseAnswers.org**](https://web.archive.org/web/20160308080311/http://www.d... | [
0.38610100746154785,
0.2500069737434387,
0.15365035831928253,
0.1276608109474182,
-0.04211854189634323,
-0.09672682732343674,
0.2758011519908905,
-0.23586465418338776,
-0.3133396506309509,
-0.6211957931518555,
0.2761150002479553,
0.38070148229599,
-0.09820172190666199,
0.18451066315174103,... | |
have on the way the database works and the quality of the data and its output.
Finally I would advise building some small databases (E.G. contact management, Task list etc). Start by specifying some basic requirements and create some tables and queries. You WILL make some mistakes which is the best way of learning. | [
0.5323920845985413,
0.1685847043991089,
0.09212623536586761,
0.4698318839073181,
0.33986836671829224,
-0.3667477071285248,
-0.0763668417930603,
0.07173541188240051,
-0.02605285868048668,
-0.8376222848892212,
0.04953240230679512,
0.6775158643722534,
0.2579177916049957,
-0.11579859256744385,... | |
I have a code block that checks certain elements before allowing a form to submit, the loop loops through OK.
I would anticipate, or at least had hoped that the first time it finds a problem, an alert is shown and then execution stops. What is actually happening is that alerts show multiple times, right down to the la... | [
0.4894769489765167,
0.08169835805892944,
0.3333700895309448,
-0.1667923927307129,
-0.11733440309762955,
-0.09406894445419312,
0.46762144565582275,
-0.4503379762172699,
0.03419823944568634,
-0.5336459875106812,
-0.04212087392807007,
0.45347723364830017,
-0.3933049738407135,
0.32261931896209... | |
if($(this).find('.thisBinName').val()==''){
alert('You have entered a quantity but no Bin, please correct and try again!');
return false;
}else if($(this).find('.unitQty').val()==''){
alert('You have entered a Bin but no quantity, please correct and try again!... | [
-0.039736632257699966,
-0.4910188913345337,
0.13870373368263245,
-0.1880379468202591,
0.45499831438064575,
-0.07124904543161392,
0.4302394390106201,
-0.20666565001010895,
0.009344085119664669,
-0.5425848960876465,
-0.7661585211753845,
0.8429612517356873,
-0.30199843645095825,
0.16696719825... | |
return false;
}else if($(this).find('.unitQty').val()==0){
alert('Can\'t move zero units into a bay, please correct and try again!');
return false;
}else if($(this).find('.unitQty').val()<0){
alert('Can\'t deliver in minus units | [
0.19249266386032104,
-0.3650476634502411,
0.34239041805267334,
-0.4057009220123291,
0.5089874863624573,
0.27438071370124817,
0.3153083324432373,
-0.2827387750148773,
-0.22201427817344666,
-0.6815958023071289,
-0.525538444519043,
0.8246273994445801,
-0.298871248960495,
0.20556747913360596,
... | |
into a bay, please correct and try again!');
return false;
}
}
});
if($('#supDocNo').val()==''){
alert('Can\'t leave Supplier Reference blank, please correct and try again!');
return false;
}
return true;
});
```
make your function take an event argu... | [
0.19189810752868652,
-0.14208872616291046,
0.43870532512664795,
-0.5957528352737427,
0.2113109976053238,
0.28387120366096497,
0.2260185182094574,
-0.33297476172447205,
0.10597781836986542,
-0.599185049533844,
-0.4331689774990082,
0.8455632925033569,
-0.2976062297821045,
0.297934889793396,
... | |
if($(this).find('.thisBinName').val()!='' || $(this).find('.unitQty').val()!=''){
if($(this).find('.thisBinName').val()==''){
alert('You have entered a quantity but no Bin, please correct and try again!');
event.preventDefault();
return false;
}else if($(this).find('.... | [
-0.08993828296661377,
-0.4439198970794678,
0.08408116549253464,
-0.213307186961174,
0.3968278765678406,
-0.016090791672468185,
0.5775777101516724,
-0.25152522325515747,
-0.07420507073402405,
-0.5477852821350098,
-0.7167591452598572,
0.8602365255355835,
-0.14475524425506592,
0.3047373294830... | |
event.preventDefault();
return false;
}else if($(this).find('.unitQty').val()==0){
alert('Can\'t move zero units into a bay, please correct and try again!');
event.preventDefault();
return false;
}else if($(this).find('.unitQty').val()<0){
aler... | [
-0.025810353457927704,
-0.4845309853553772,
0.26180195808410645,
-0.4189530611038208,
0.4523273706436157,
0.21961237490177155,
0.4184722602367401,
-0.1977442055940628,
-0.15598779916763306,
-0.6565302014350891,
-0.44879722595214844,
0.7984179854393005,
-0.30521759390830994,
0.2368331849575... | |
into a bay, please correct and try again!');
event.preventDefault();
return false;
}
}
});
if($('#supDocNo').val()==''){
alert('Can\'t leave Supplier Reference blank, please correct and try again!');
event.preventDefault();
return false;
}
return true;
});
``` | [
0.1936427801847458,
-0.019300982356071472,
0.5891574025154114,
-0.7418314218521118,
0.622602105140686,
0.20133240520954132,
0.4257226586341858,
-0.27528002858161926,
0.14149105548858643,
-0.6860606074333191,
-0.6722353100776672,
0.9299553632736206,
-0.36965474486351013,
0.40790408849716187... | |
I have a class which has a property of generic type as given below. Type T can be any number (short, int, float ...)
```
public class EqualFilter <T> : Filter {
private T _value;
public override T Value {
get {
return _value;
}
set { | [
0.2141212522983551,
-0.5425235033035278,
0.32581791281700134,
-0.12624281644821167,
-0.24247168004512787,
-0.04172607883810997,
0.1896446794271469,
-0.47383543848991394,
0.2152078002691269,
-0.6137188673019409,
-0.10676112771034241,
0.5261809825897217,
-0.5731346607208252,
0.12908954918384... | |
if (!EqualityComparer<T>.Default.Equals(_value, value)) {
_value = value;
RaiseFilteringChanged();
}
}
}
.....
}
```
Now I have a client class which has a "String" that needs to be passed to the above setter. Now at the time of setting the value in the | [
-0.15973405539989471,
0.09857111424207687,
0.562666118144989,
-0.4031273424625397,
-0.016652273014187813,
-0.22099386155605316,
0.30476588010787964,
-0.371303528547287,
0.05722201615571976,
-0.5868940949440002,
-0.023384854197502136,
0.6960764527320862,
-0.35714179277420044,
0.212630257010... | |
above setter, the type T is already determined at runtime and I can get hold of that type as Type T in my client. Is it possible to convert the string to the appropriate type ,as identified by the EqualFilter, in client program? Something like this that is not working
```
Type T = filter.getFilterType();
filter.Value ... | [
-0.0357971265912056,
-0.29241400957107544,
0.5825363397598267,
-0.27048051357269287,
-0.09820948541164398,
-0.14958029985427856,
0.20983412861824036,
-0.4421359896659851,
-0.0058603109791874886,
-0.8677572011947632,
-0.09902256727218628,
0.6122257113456726,
-0.7764484882354736,
-0.10141808... | |
better way.
It sounds like you're doing something similar to data binding. If all you're interested in is working with strings, you might consider constraining the generic type to `IConvertible` and calling the `Convert.ChangeType` method from a special setter method like so:
```
public class EqualFilter<T> : Filter w... | [
0.221726655960083,
-0.4620659649372101,
0.6372835040092468,
-0.12789352238178253,
-0.09999581426382065,
-0.08995082974433899,
0.1254613846540451,
-0.5415358543395996,
-0.06511806696653366,
-0.9187224507331848,
-0.0509059764444828,
0.7448402643203735,
-0.6521266102790833,
-0.081015177071094... | |
can operate upon. Besides the integral and floating point types, this also permits use of the types `string`, `decimal` and `DateTime`. Just be aware that `string` types may not always be exact when working with the `double` type as there can be round-off and floating point representation errors. Also there may be othe... | [
0.11233731359243393,
-0.18849419057369232,
0.39865824580192566,
-0.11394593119621277,
0.03149480000138283,
0.008594037033617496,
0.058414436876773834,
-0.46672338247299194,
-0.0465882234275341,
-0.4919564723968506,
-0.21786706149578094,
0.7589459419250488,
-0.3203326463699341,
0.0895816907... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.