text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
is in the implementation.
Java uses the notion of type erasure to implement generics. In short the underlying compiled classes are not actually generic. They compile down to Object and casts. In effect Java generics are a compile time artifact and can easily be subverted at runtime.
C# on the other hand, by virtue ... | [
0.014315907843410969,
0.04364904388785362,
0.15012520551681519,
-0.049242615699768066,
-0.5392012596130371,
-0.2996356189250946,
0.38276198506355286,
-0.07391355186700821,
-0.39021748304367065,
-0.32843297719955444,
-0.08342219144105911,
0.3340086042881012,
-0.5592880845069885,
0.257445812... | |
depth breakdown I encourage you to read | [
0.08106643706560135,
-0.17630302906036377,
-0.02296348288655281,
0.24923725426197052,
-0.0035455457400530577,
-0.5344088077545166,
0.1903383582830429,
0.6022130250930786,
0.16307871043682098,
-0.5831873416900635,
-0.23128023743629456,
0.4447314739227295,
0.11920494586229324,
-0.31451177597... | |
What is the main difference between `StringBuffer` and `StringBuilder`?
Is there any performance issues when deciding on any one of these?
[`StringBuffer`](http://docs.oracle.com/javase/8/docs/api/java/lang/StringBuffer.html) is synchronized, [`StringBuilder`](http://docs.oracle.com/javase/8/docs/api/java/lang/StringBu... | [
0.21332521736621857,
-0.33183199167251587,
0.028161734342575073,
0.15294773876667023,
-0.08626121282577515,
-0.060146771371364594,
-0.023245014250278473,
-0.2390102744102478,
-0.6334928870201111,
-0.12353669852018356,
-0.12772776186466217,
0.6422970294952393,
-0.5117190480232239,
0.1697071... | |
I have noticed in phpMyAdmin you can click 'optimise' on tables, and it runs:
```
OPTIMIZE TABLE table_name
```
What does this actually do?
Should I have some cron job running daily that runs OPTIMIZE TABLE on my tables?
Thank you
From [InformIT](http://www.informit.com/articles/article.aspx?p=29406&seqNum=3)
> A... | [
-0.11629664897918701,
0.22869938611984253,
0.4872722923755646,
-0.16649536788463593,
0.01641691103577614,
-0.025040635839104652,
0.10704237222671509,
-0.12314367294311523,
-0.22457224130630493,
-0.6955346465110779,
-0.12241274863481522,
0.7343670129776001,
-0.33343228697776794,
-0.23596903... | |
job might be a good idea, but do it during low/no load as it locks the tables. | [
0.39338070154190063,
0.03603535518050194,
0.23496310412883759,
-0.041209541261196136,
0.3067743182182312,
-0.3159525394439697,
-0.03747604042291641,
-0.2213384509086609,
-0.3780319094657898,
-0.2641988694667816,
0.14360155165195465,
0.6549232006072998,
0.13735046982765198,
-0.4200700521469... | |
I am creating a mock database for import export tests (of the algorithm reading and writing complex data structures to our database, not just to test IO operations), and am trying to decide whether to use a DataSet to store the mock tables (by table name) in the faux-database, or Dictionary()
In terms of retrieving a ... | [
0.08921440690755844,
0.34163570404052734,
0.018333757296204567,
0.2489534467458725,
-0.23304684460163116,
0.2980915606021881,
0.3611445128917694,
-0.2524438500404358,
-0.04297374188899994,
-0.5734399557113647,
0.04709149897098541,
0.40000495314598083,
-0.15534266829490662,
0.02784775383770... | |
is often around 150 elements. And since you generally have a lot fewer tables than 150, I'd be happy with a linear list for performance.
(which doesn't at all mean "don't use `Dictionary<T>`; it just means that *performance* might not be the main reason for this particular use-case; the unique key enforcement and the ... | [
-0.004035411402583122,
0.10481204837560654,
0.1342572718858719,
0.029453841969370842,
-0.14827793836593628,
0.07126962393522263,
0.19248579442501068,
-0.4651546776294708,
-0.18156258761882782,
-0.5184762477874756,
-0.20317333936691284,
-0.00004476766480365768,
0.07489292323589325,
-0.11150... | |
If you have large data, then obviously you need to plan for that and code accordingly.
Other differences between a `Dictionary<,>` and something like a `List<>` is things like uniqueness: a `Dictionary<,>` won't let you have duplicated keys (although a `Lookup<,>` in .NET 3.5 will). | [
-0.026323584839701653,
0.06762442737817764,
-0.16335394978523254,
0.37185031175613403,
0.20386549830436707,
-0.3827018439769745,
0.1735243797302246,
0.033654384315013885,
-0.5073336958885193,
-0.589353621006012,
-0.142175555229187,
0.3684505522251129,
-0.12262659519910812,
0.20690001547336... | |
What kind of practical issues are there concerning sending tons of e-mail from a server? Will the likelihood of that e-mail being received be just the same as if it had been sent from g-mail or a personal e-mail account if I for example just blindly call the mail() function in PHP tens of thousands of times a day?
*(... | [
0.7280958294868469,
-0.005562698934227228,
0.14896146953105927,
0.40850526094436646,
-0.17453640699386597,
-0.4069754183292389,
0.6322194337844849,
0.1619999259710312,
-0.5398138761520386,
-0.5789965391159058,
0.24196948111057281,
0.16855381429195404,
-0.24679383635520935,
0.17525389790534... | |
you send out 500 emails to yahoo for example. if enough people mark your message as spam, soon, ANY email you send to yahoo will be marked as spam, or [BULK]. Many isp's routinely tar-pit or outright reject email from servers on lists such as RBL (the real-time black hole list). If your mail IP gets put on one of these... | [
0.3658161461353302,
0.030651384964585304,
0.39111438393592834,
0.03270510211586952,
-0.19836468994617462,
-0.27101582288742065,
0.6021966338157654,
0.17693819105625153,
-0.510201096534729,
-0.3499395549297333,
-0.07119293510913849,
0.2554791569709778,
-0.35469862818717957,
0.32623958587646... | |
there are heuristics used to determine if the same message is being sent to many users on the same domain. This also increases the chance your mail will be marked as spam.
This is why clean emails from some addresses always go into the spam box. Their company may have not been careful enough when sending what could be... | [
0.5318180918693542,
0.04606783390045166,
0.1385178118944168,
-0.006684496067464352,
-0.09945031255483627,
-0.47242072224617004,
0.7026940584182739,
-0.11011593043804169,
-0.40948161482810974,
-0.1701110452413559,
-0.31817933917045593,
0.3396715521812439,
-0.36143895983695984,
0.22717866301... | |
What is the use of anonymous classes in Java? Can we say that usage of anonymous class is one of the advantages of Java?
By an "anonymous class", I take it you mean [anonymous inner class](http://docs.oracle.com/javase/tutorial/java/javaOO/innerclasses.html).
An anonymous inner class can come useful when making an ins... | [
0.23142243921756744,
-0.40403854846954346,
-0.00973325315862894,
-0.17265324294567108,
-0.17396517097949982,
-0.0872536450624466,
0.21891658008098602,
-0.2855726480484009,
-0.30445486307144165,
-0.5303177833557129,
-0.0031350632198154926,
0.6945810317993164,
-0.57246333360672,
-0.214155271... | |
}
});
```
Using this method makes coding a little bit quicker, as I don't need to make an extra class that implements `ActionListener` -- I can just instantiate an anonymous inner class without actually making a separate class.
I only use this technique for "quick and dirty" tasks where making an entire class feels ... | [
0.36416420340538025,
-0.39990174770355225,
-0.12440761178731918,
-0.0627017691731453,
0.09772182255983353,
-0.1176762804389,
0.3261103630065918,
-0.1587628573179245,
-0.06280578672885895,
-0.5338518619537354,
0.014114988036453724,
0.7047404050827026,
-0.36842307448387146,
-0.07892885059118... | |
I am programming an iPhone app, and I need to force it to exit due to certain user actions. After cleaning up memory the app allocated, what's the appropriate method to call to terminate the application?
Have you tried `exit(0)`?
Alternatively, `[[NSThread mainThread] exit]`, although I have not tried that it seems li... | [
-0.1588883101940155,
0.14302963018417358,
0.22725099325180054,
-0.20916612446308136,
0.4156867563724518,
-0.046877939254045486,
0.4212759733200073,
0.13119377195835114,
-0.05717284977436066,
-0.14644089341163635,
-0.2708366811275482,
0.32943135499954224,
-0.3645792007446289,
0.071425579488... | |
I would like to know how I can refer to a list item object if I had for example the following html list
```
<div id="subdiv_2">
<div id="subdiv_3">
<ul>
<li><a href="">Item1</a></li>
<li><a href="">Item2</a></li>
<li><a href="">Item3</a></li>
</ul>
</div>
</div>
```
How is it poss... | [
-0.1720835119485855,
-0.03591104969382286,
0.47856810688972473,
0.051304664462804794,
-0.37339308857917786,
0.33209124207496643,
0.2160933017730713,
-0.4694417417049408,
-0.18688452243804932,
-0.687442421913147,
-0.02832941524684429,
0.01810213178396225,
-0.3406803607940674,
0.235659807920... | |
by
```
document.getElementById('subdiv_3').addEventListener('click', function();, false);
```
My goal is ultimately to assign a function to each list object, for the number of list objects with unique parameters based upon the list object number eg:
```
for(i=0;i<list.length;i++){
"document.getElementById(list... | [
0.028408413752913475,
0.004966519773006439,
0.6363376379013062,
-0.22550609707832336,
0.15874259173870087,
0.1840088814496994,
0.24284778535366058,
-0.5791295170783997,
-0.1602456122636795,
-0.5558488368988037,
-0.49820369482040405,
0.5966892838478088,
-0.5218068361282349,
0.10923185944557... | |
problems. (All the functions will appear to use the same value of i.) Check out my answer to this question to deal with that problem: [How to Add Event Handler with Arguments to an Array of Elements in Javascript?](https://stackoverflow.com/questions/315712/how-to-add-event-handler-with-arguments-to-an-array-of-element... | [
-0.2419130802154541,
-0.03911171853542328,
0.053400687873363495,
-0.00006787076563341543,
0.021458884701132774,
0.08987219631671906,
-0.04302390664815903,
-0.29815536737442017,
-0.35838717222213745,
-0.35203269124031067,
-0.12893061339855194,
0.7613143920898438,
-0.4424343407154083,
-0.229... | |
I'm learning about DDD, and have come across the statement that "value-objects" should be immutable. I understand that this means that the objects state should not change after it has been created. This is kind of a new way of thinking for me, but it makes sense in many cases.
Ok, so I start creating immutable value-o... | [
0.2868838608264923,
0.281394362449646,
0.10061659663915634,
0.02228122018277645,
-0.10583055019378662,
-0.1353088915348053,
0.26723310351371765,
0.14723339676856995,
-0.2501092851161957,
-0.7092028856277466,
-0.02282121405005455,
0.5938826203346252,
-0.24988152086734772,
0.6852542161941528... | |
contain 8 different numeric values. If I create a constructor having 8 numeric parameters I feel that it will not be very easy to use, or rather - it will be easy to make a mistake when passing in the numbers. This can't be good design.
*So the questions is:* Are there any other ways of making my immutable object bett... | [
0.40645188093185425,
0.3965592682361603,
0.004003746900707483,
0.16336023807525635,
-0.23230406641960144,
0.11672208458185196,
0.13339239358901978,
-0.10989775508642197,
-0.33993253111839294,
-0.38025158643722534,
0.2695796489715576,
0.35795336961746216,
-0.26216545701026917,
0.20139040052... | |
do you think?](https://stackoverflow.com/questions/263585/immutable-object-pattern-in-c-what-do-you-think)
Would be interested in hearing other suggestions or comments though.
Use a builder:
```
public class Entity
{
public class Builder
{
private int _field1;
private int _field2;
private int _fi... | [
0.45063164830207825,
0.06220588833093643,
0.2459142506122589,
-0.3036581575870514,
0.20431114733219147,
0.01598351076245308,
0.2870563864707947,
-0.5777444839477539,
-0.09609833359718323,
-0.5725635290145874,
-0.2609165906906128,
0.7476955652236938,
-0.2945501208305359,
0.27243608236312866... | |
Entity(_field1, _field2, _field3); }
}
private int _field1;
private int _field2;
private int _field3;
private Entity(int field1, int field2, int field3)
{
// Set the fields.
}
public int Field1 { get { return _field1; } }
public int Field2 { get { return _field2; } }
public int Fi... | [
0.12315475940704346,
-0.12587599456310272,
0.19116756319999695,
-0.07973309606313705,
0.21439304947853088,
0.21246656775474548,
0.09398531168699265,
-0.37425801157951355,
-0.027274440973997116,
-0.5437109470367432,
-0.23257537186145782,
0.7317019701004028,
-0.27329397201538086,
0.469162464... | |
.WithField1(123)
.WithField2(456)
.WithField3(789)
.Build()
```
If some of the parameters are optional you won't need to call the WithXXX method and they can have default values. | [
0.229791522026062,
0.1662413328886032,
0.043778546154499054,
-0.6172226071357727,
0.12827156484127045,
-0.08040963858366013,
0.33243441581726074,
-0.3610747158527374,
0.0049106664955616,
-0.29090696573257446,
-0.14571741223335266,
0.7373309135437012,
-0.49816378951072693,
-0.19202263653278... | |
I am doing some TTF work for MOSA (the correlating body between all the C# operating systems). Me and Colin Burn are currently working on getting some TTF code working (less me these days :) - he made a lot of progress).
In any case, the TTF spec allows for an arbitrary amount of control points between the 'handles' a... | [
0.7236719727516174,
0.5237531065940857,
0.09460041671991348,
0.017698543146252632,
-0.14951030910015106,
-0.11118775606155396,
0.10376233607530594,
0.014896786771714687,
-0.5695066452026367,
-0.6289234757423401,
0.04350178316235542,
0.6574970483779907,
0.10986915230751038,
-0.2886095643043... | |
on Wikipedia but it wasn't really that much help - they show it happening, but don't give any math. Something 'program' ready would help (my Calculus isn't what it should be) - some pseudocode or something.
Thanks guys.
I did some digging and found some [algorithms](http://www.cs.technion.ac.il/~cs234326/projects/font... | [
0.4734337627887726,
0.2705843448638916,
-0.03280934691429138,
0.28275105357170105,
-0.26076239347457886,
-0.029318535700440407,
0.2297249734401703,
0.34415245056152344,
-0.11368238180875778,
-0.6779654622077942,
0.053888291120529175,
0.3226896822452545,
0.08586813509464264,
-0.261662453413... | |
After returning to an old Rails project I found none of the destroy/delete links worked and clicking cancel on the confirmation popup would still submit the link.
Example of my code is:
```
<%= link_to 'Delete', admin_user_path(@user), :confirm => 'Are you sure?', :method => :delete %>
```
This problem occurs if you... | [
0.0339958481490612,
0.07881836593151093,
0.1387479305267334,
-0.12297151237726212,
0.11313662678003311,
-0.2964463233947754,
0.6028024554252625,
-0.18006600439548492,
-0.04262241721153259,
-0.6413798928260803,
0.10302408039569855,
0.6313621401786804,
-0.3922298848628998,
-0.091982156038284... | |
I’ve got several Perl modules installed on my hosting machine in `~/perl`, how do I add them to Perl module path? Setting `PERL5LIB` or `unshift`ing the paths to `@INC` surely works, but the environment variable does not help when running as a CGI script and the `@INC` way is not very portable. Is there a better way? T... | [
0.4351274371147156,
-0.1259954571723938,
0.5423704385757446,
0.07089412957429886,
-0.415587842464447,
-0.25682276487350464,
0.09579154849052429,
-0.05769902840256691,
-0.40500015020370483,
-0.3470374345779419,
-0.0015468138735741377,
0.5144069194793701,
-0.3498958349227905,
0.1575726866722... | |
from mod\_env.
@INC is portable. The paths you put in there may not be the same on every machine, but you shouldn't have a problem the with variable itself.
Have you read the FAQ entries in [perlfaq8](http://faq.perl.org/perlfaq8.html):
* [How do I add the directory my program lives in to the module/library search ... | [
0.279326468706131,
-0.2165846973657608,
0.46112537384033203,
-0.07526981085538864,
-0.1837032288312912,
-0.2094111144542694,
0.13463078439235687,
-0.47220322489738464,
-0.37679076194763184,
-0.6108102798461914,
-0.09950797259807587,
0.7736355066299438,
-0.4076601564884186,
-0.0473914593458... | |
What I want is system which is logging methods called by users and their returning values if they have. For example a user logs in and he/she is surfing on my web app. then naturally he/she clicks on somethings and so he/she fires up some event method whatever then my log system must log this method name and time stamp... | [
0.6378626823425293,
0.15420585870742798,
0.142419695854187,
0.11022746562957764,
0.03452211990952492,
-0.09577028453350067,
0.15113280713558197,
-0.10818023979663849,
-0.3721899390220642,
-0.5709524154663086,
0.1576688438653946,
0.3513675630092621,
-0.12088235467672348,
0.114323690533638,
... | |
a more automatic way of doing this, you might want to look into [PostSharp](http://www.sharpcrafters.com) so that you could just decorate the appropriate methods with an attribute - but that's certainly more complex, and probably only worth it if you have a lot of events to log. | [
0.5530306696891785,
-0.25019246339797974,
0.31279414892196655,
0.4560094475746155,
-0.43787881731987,
-0.2744929790496826,
0.27947333455085754,
-0.19305507838726044,
-0.333027184009552,
-0.43531668186187744,
0.19188959896564484,
0.6203034520149231,
0.5230549573898315,
-0.21830511093139648,... | |
Can anyone recommend a good application that could be used to convert VB.NET projects to C#, without having to do too much manual work?
We've used Reflector to do small libraries manually, but some of the larger projects will be too slow and complex to do this manually.
You can use Lutz Roeders Reflector (<http://www.... | [
0.4690299928188324,
0.11847181618213654,
0.18256358802318573,
0.06013486534357071,
-0.13197611272335052,
-0.14077728986740112,
0.1256248652935028,
-0.18114370107650757,
-0.23369885981082916,
-0.7260727286338806,
0.008141100406646729,
0.4244150221347809,
-0.20541128516197205,
0.002305526286... | |
SICP - "Structure and Interpretation of Computer Programs"
Explanation for the same would be nice
Can some one explain about **Metalinguistic Abstraction**
SICP really drove home the point that it is possible to look at code and data as the same thing.
I understood this before when thinking about universal Turing ma... | [
0.30337807536125183,
-0.014997721649706364,
-0.037989336997270584,
0.21381224691867828,
-0.4231415390968323,
-0.18986956775188446,
-0.12080097943544388,
0.013188933953642845,
-0.2086881548166275,
-0.5844933390617371,
-0.13535818457603455,
0.33218690752983093,
-0.4039766788482666,
-0.281209... | |
for lists in general, namely S-expressions.
Once you have the "equivalence" of code and data, suddenly a lot of things become easy. For example, you can write programs that have different evaluation methods (lazy, nondeterministic, *etc*). Previously, I might have thought that this would require an extension to the pr... | [
0.4750306308269501,
-0.020110227167606354,
0.08600360155105591,
0.2787981927394867,
-0.26477909088134766,
-0.09958451241254807,
0.21265006065368652,
-0.19117619097232819,
-0.6421607732772827,
-0.9209745526313782,
-0.11765196919441223,
0.48677513003349304,
-0.5855628252029419,
-0.3147579431... | |
mentioned more: types. Type checking at *compilation* time is an amazing thing. The SICP implementation of object-oriented programming did not have this benefit. | [
0.17721262574195862,
-0.12037607282400131,
-0.20762592554092407,
0.2889893651008606,
-0.48846301436424255,
-0.3676506280899048,
0.11415988206863403,
0.2756447196006775,
-0.21236006915569305,
-0.4066849648952484,
0.23339815437793732,
0.5909146070480347,
-0.25385239720344543,
-0.050660356879... | |
I started to use silverlight/flex and immediately bumped into the asynchronous service calling. I'm used to solving the data access problems in an OO-way with one server fetch mechanism or another.
I have the following trivial code example:
```
public double ComputeOrderTotal(Order order)
{
double total = 0;
... | [
0.22778546810150146,
-0.16866549849510193,
0.36877262592315674,
-0.2745056450366974,
-0.08552780002355576,
0.21618016064167023,
0.030102595686912537,
-0.22202222049236298,
-0.2102178931236267,
-0.5057969689369202,
-0.05156259983778,
0.8514255881309509,
-0.28554487228393555,
0.2127256840467... | |
understand correctly, this code is impossible in Flex/Silverlight. The lazy loading forces you to work with callbacks. IMO the simple expample above will be a BIG mess.
Can anyone give me a structured way to implement the above ?
Edit:
* **The problem is the same for Flex/Silverlight, pseudo code would
do fine**
* *... | [
0.30889520049095154,
-0.10175025463104248,
0.3559599816799164,
0.17687751352787018,
-0.14438869059085846,
-0.37214893102645874,
0.3017479181289673,
-0.023872315883636475,
-0.3607311248779297,
-0.7225541472434998,
0.12654943764209747,
0.8636146783828735,
-0.34403568506240845,
-0.18538193404... | |
is already loaded and no asynchronous fetch is needed**
C# 5
async / await construct will almost exactly what I want..
[watch presentation by anders hejlsberg](http://player.microsoftpdc.com/Session/1b127a7d-300e-4385-af8e-ac747fee677a) | [
0.019605092704296112,
-0.019217198714613914,
0.5078462958335876,
0.2062647044658661,
0.308655709028244,
-0.3155130445957184,
0.3016059994697571,
-0.20663471519947052,
-0.21233971416950226,
-0.4484403431415558,
-0.25903454422950745,
0.6300107836723328,
-0.033724527806043625,
-0.048460993915... | |
In Silverlight (and I guess WPF) why are the properties x:name x:fieldmodifier x:uid the only ones with the prefix x.
I understand the x prefix is used to refer to the XML namespace but there are a number of other properties that do not use a prefix such as width. Identifying a control is such a common task it seems ... | [
0.2710804343223572,
-0.03767568618059158,
0.3876403272151947,
0.2037024348974228,
-0.4416551887989044,
-0.6318432092666626,
-0.2368936985731125,
-0.40391817688941956,
-0.20534372329711914,
-0.29575857520103455,
-0.1712702065706253,
0.21795041859149933,
-0.468187153339386,
0.111919969320297... | |
use xaml to define workflows in WF. I think these is the reason to have the “pure” Xaml namespace’s differentiated from presentation namespaces. | [
0.4222989082336426,
0.33962804079055786,
0.032360538840293884,
-0.1085742935538292,
-0.22124646604061127,
-0.4715675413608551,
-0.09603193402290344,
-0.005994398146867752,
-0.14942267537117004,
-0.56158447265625,
-0.20518667995929718,
0.4227893650531769,
-0.2673342227935791,
0.010528575628... | |
I've got a Core Data application that has an Event class, which has a start date and a finish date. It's trivial to bind these to a pair of NSDatePicker widgets, but I wanted to make it work with the NSRangeDateMode available in Leopard.
The NSDatePicker has a pair of methods that deal with timeInterval, but I don't s... | [
-0.17582714557647705,
-0.44210392236709595,
0.29927417635917664,
-0.07531773298978806,
0.10607712715864182,
-0.09259656816720963,
0.14539693295955658,
-0.33360734581947327,
-0.23364585638046265,
-0.619794487953186,
0.03497348725795746,
0.12518860399723053,
0.07604338973760605,
0.1504759341... | |
underlying object is changed, but does not set the underlying object when the NSDatePicker's timeInterval is changed.
Sadly, no. The timeInterval property of the date picker is not even properly key-value observable. Basically, you're stuck either setting up an action method or using the delegate validation method to r... | [
0.1623130589723587,
-0.4813952147960663,
0.3955010771751404,
0.2848440706729889,
0.04615448787808418,
-0.06859671324491501,
0.36502745747566223,
0.046288710087537766,
-0.6311994194984436,
-0.5233070254325867,
0.07033780962228775,
0.19117207825183868,
-0.19220523536205292,
0.137920439243316... | |
will be fully baked. | [
0.24860361218452454,
0.35006141662597656,
0.14742198586463928,
-0.15655702352523804,
0.2854437828063965,
0.08538424968719482,
0.2780740559101105,
0.6756889820098877,
0.10037221014499664,
-1.1888201236724854,
-0.218576580286026,
0.2795478403568268,
0.5811967849731445,
-0.08774978667497635,
... | |
I have two unix partitions under debian which I would like to merge (disk space problems :/). What would be the easiest way to do it? I think it would be best to tar or copy files from one partition to the other, delete one and resize the other. I will use parted to resize but how should I copy the files? There are lin... | [
0.2857964336872101,
-0.028324197977781296,
0.009966670535504818,
-0.035751648247241974,
-0.013703134842216969,
-0.34720346331596375,
0.05854785442352295,
0.1868600696325302,
-0.11899709701538086,
-0.6270483136177063,
-0.05726061016321182,
0.7710813879966736,
-0.4601766765117645,
0.33565688... | |
/partition1 && tar xf - )
```
Another way is to use cpio, but I never remember the correct syntax. | [
0.0286560021340847,
0.3926539421081543,
0.10251805931329727,
-0.13235586881637573,
0.1638946235179901,
-0.2525237500667572,
0.010538263246417046,
0.4445662498474121,
-0.15289822220802307,
-0.5762771964073181,
0.005723513197153807,
0.3196372389793396,
-0.4473974406719208,
0.0880195796489715... | |
I have two arrays in PHP. The first array ($author\_array) is comprised of user\_ids in a particular order, like so: (8, 1, 6)
The second array ($user\_results) is comprised of an array of objects like so:
```
Array
(
[0] => stdClass Object
(
[ID] => 1
[user_login] => user1
... | [
-0.1150834858417511,
0.16447272896766663,
0.5619669556617737,
-0.07487880438566208,
-0.1510612815618515,
0.15493468940258026,
0.027585234493017197,
-0.2962575852870941,
0.12744992971420288,
-0.724075198173523,
0.23548533022403717,
0.1942349374294281,
-0.06594499945640564,
0.029764946550130... | |
(
[ID] => 6
[user_login] => user6
)
[2] => stdClass Object
(
[ID] => 8
[user_login] => user8
)
)
```
I'd like to "sort" the second array so it's in this order, which | [
-0.08165208995342255,
0.14043740928173065,
0.33556950092315674,
-0.322265625,
0.04723770543932915,
-0.05800260975956917,
0.16113296151161194,
-0.32801589369773865,
-0.2185457944869995,
-0.7597572207450867,
-0.067841537296772,
0.33278197050094604,
-0.3128567636013031,
-0.04267198592424393,
... | |
matches the order of the values in the first array of (8, 1, 6). So it'd look like this:
```
Array
(
[0] => stdClass Object
(
[ID] => 8
[user_login] => user8
)
[1] => stdClass Object
(
[ID] => 1 | [
-0.1992933750152588,
-0.04289878532290459,
0.5347765684127808,
-0.29423418641090393,
0.07279681414365768,
0.15025588870048523,
0.060783471912145615,
-0.46534764766693115,
-0.3257426619529724,
-0.6341263055801392,
0.018158702179789543,
0.42500320076942444,
-0.3440885543823242,
0.03539621829... | |
[user_login] => user1
)
[2] => stdClass Object
(
[ID] => 6
[user_login] => user6
)
)
```
I'm weak on data structures. How could I do this? :-)
Thanks in advance for your help!
-Bob
Use [usort](http://php.net/uksort) and provide a custom comparison function which u... | [
0.14020267128944397,
0.2995487451553345,
0.4964074492454529,
-0.09978063404560089,
-0.03895826265215874,
0.060512542724609375,
0.5715674161911011,
-0.2800467014312744,
-0.2499392032623291,
-0.4787680506706238,
-0.1870742291212082,
0.33098530769348145,
-0.19477733969688416,
0.20079088211059... | |
key in your "ordering" array to determine the sort order, e.g. something like:
```
function cmp($a, $b)
{
global $author_array;
$pos1=array_search ($a->ID, $author_array);
$pos2=array_search ($b->ID, $author_array);
if ($pos1==$pos2)
return 0;
else
return ($pos1 < $pos2 ? -1 : 1);
}
us... | [
-0.44294214248657227,
-0.08898969739675522,
0.6032960414886475,
-0.26388680934906006,
0.1664905995130539,
0.28344470262527466,
-0.05338619649410248,
-0.12332694977521896,
-0.6568556427955627,
-0.5716795325279236,
-0.5676923394203186,
0.28199324011802673,
-0.5297259092330933,
0.071242675185... | |
I would like to get Binding object from web.config or app.config.
So, this code works:
```
wcfTestClient = new TestServiceClient("my_endpoint", Url + "/TestService.svc");
```
but I would like to do the following:
```
Binding binding = DoSomething();
wcfTestClient = new TestServiceClient(binding, Url + "/TestServic... | [
0.20364901423454285,
0.2572993040084839,
0.6674233078956604,
-0.012915191240608692,
-0.16775214672088623,
-0.25565940141677856,
0.11937644332647324,
-0.5603660941123962,
0.010684667155146599,
-0.8570670485496521,
0.0010169495362788439,
0.5417250990867615,
-0.38374418020248413,
0.2058142870... | |
WSHttpBinding loaded from config
> b.Security.Message.IssuerBinding = new WSHttpBinding("Issuer");
>
> ``` | [
-0.039207518100738525,
-0.15260516107082367,
0.44377297163009644,
-0.3997601270675659,
-0.07955077290534973,
-0.23065373301506042,
0.3571648597717285,
-0.5737296342849731,
-0.24636100232601166,
-0.39384597539901733,
-0.3996717631816864,
0.41631999611854553,
-0.5834444165229797,
0.119244784... | |
We need to get data out of an older accounting system. We have received a dll that gives us access to the data we need. It includes a type library that we have imported.
If we run our test application from the same directory as the accounting system, everything works fine. If we try to run our application from a diffe... | [
0.31238940358161926,
0.3174733817577362,
0.3098926544189453,
0.062491439282894135,
0.1218804121017456,
-0.18890728056430817,
0.19446483254432678,
-0.2681264877319336,
-0.1842973679304123,
-0.4640584886074066,
-0.0654972642660141,
0.6289272904396057,
-0.5141874551773071,
-0.1582435220479965... | |
of RTS requires:
> Runtime DLL 'OOLSM', at least Version 3.1
Can anybody provide some helpful information on this?
Are we supposed to have some kind of cobol runtime in our directory? Or in the path? Or registered in the registry?
Thanks,
-Vegar
**Updates:**
Setting the system %path% to include the path to ... | [
0.20154023170471191,
0.27050089836120605,
0.6644598841667175,
-0.0460972897708416,
0.04684010148048401,
-0.2762305736541748,
0.3474003076553345,
-0.029557477682828903,
-0.1582566201686859,
-0.6080595850944519,
-0.02991306595504284,
0.9660954475402832,
-0.292660117149353,
-0.310740858316421... | |
Are there any practices regarding using codenames of products in Visual Studio projects and solutions? In that typically, namespaces, assembly names, binary outputs, et al need to be renamed once a product name is chosen: is there any way to deal with this?
This will partly depend on the type of product. If it's a clie... | [
0.7265514731407166,
0.3835456073284149,
-0.34343257546424866,
-0.06696179509162903,
-0.18806184828281403,
-0.028512198477983475,
0.07238539308309555,
0.053072426468133926,
-0.5244704484939575,
-0.24122083187103271,
-0.2961774170398712,
0.15363478660583496,
-0.24922850728034973,
0.322648853... | |
- you don't want to have to rename the code each time you start a new version! | [
0.5654798746109009,
0.4018302261829376,
-0.10779618471860886,
0.16656464338302612,
-0.1627126783132553,
-0.23842360079288483,
0.6514950394630432,
0.15652340650558472,
-0.12131856381893158,
-0.10091067850589752,
-0.3378126621246338,
0.07977744191884995,
-0.004091870505362749,
0.569946110248... | |
On a website I'm working we have an onsite login and a private login, the problem I'm having is that Firefox doesn't seem to be able to differentiate between these login forms.
Does anybody know how I can make clear that these are different logins?
I already tried giving the form fields different names and ids, ex: o... | [
0.5080491304397583,
0.2733050584793091,
0.2195262312889099,
-0.018264930695295334,
0.07066222280263901,
-0.29377028346061707,
0.37194883823394775,
-0.13365598022937775,
-0.26579368114471436,
-0.6866785883903503,
-0.007013896480202675,
0.49396374821662903,
-0.540185272693634,
0.065134890377... | |
<input type="hidden" value="en" name="redirect"/>
<label for="onsite_username">Username<abbr title="Required ">*</abbr></label>
<input type="text" class="input-text" maxlength="255" value="" name="onsite_username" id="onsite_username"/>
<label for="onsite_password">Password<abbr title="Required ... | [
-0.37976452708244324,
-0.047972552478313446,
0.43361958861351013,
0.018404632806777954,
-0.02220851555466652,
-0.04924454912543297,
0.16189983487129211,
-0.654717743396759,
-0.16567933559417725,
-0.3747119903564453,
-0.3890954256057739,
0.6872288584709167,
0.0650835782289505,
-0.0864611640... | |
<input type="text" class="input-text" value="" name="username" id="username"/>
</div><div>
<label for="password">Password</label>
<input type="password" class="input-password" value="" name="password" id="password"/>
</div>
<input type="submit" value="Aanmelden" class="input-submit"/>
</fiel... | [
-0.4988870620727539,
0.392086386680603,
0.539149820804596,
-0.3077557682991028,
0.08379213511943817,
-0.11360707879066467,
0.32450157403945923,
-0.6302869319915771,
-0.09532705694437027,
-0.5596506595611572,
-0.44179415702819824,
0.6075157523155212,
-0.1996852308511734,
0.04539304226636886... | |
to which the form data has been submitted.
Thus Firefox does not distinguish between the two loginfields on my page. | [
0.22414465248584747,
0.18994516134262085,
0.5793410539627075,
-0.23815862834453583,
0.07419931143522263,
-0.3358420133590698,
0.08256658911705017,
-0.2580096125602722,
-0.03149403631687164,
-0.4529872238636017,
-0.3528409004211426,
0.33754605054855347,
-0.11731686443090439,
-0.060677208006... | |
I want to embed a link to a controller action in my page so I can use it from javascript. Something like
```
var pollAction = '/Mycontroller/CheckStatus'
```
Now I am happy to hardcode it, but it would be really nice if there were a method I could use to create the URL. The AjaxHelper/HtmlExtensions contain methods ... | [
0.17784200608730316,
-0.01323199924081564,
0.3751014769077301,
0.19488394260406494,
-0.4099917709827423,
-0.2746048867702484,
-0.007160443812608719,
0.1360049545764923,
-0.2246422916650772,
-0.772329568862915,
0.24978007376194,
0.21728089451789856,
-0.3430054783821106,
0.0978749543428421,
... | |
the framework to do this? Or must I roll my own?
Have you tried something along these lines?
```
var pollAction = '<%=Url.Action("CheckStatus", "MyController") %>';
``` | [
0.44251471757888794,
0.18000929057598114,
0.4681142270565033,
0.07102338969707489,
0.07645444571971893,
-0.029818197712302208,
-0.031309496611356735,
-0.32145437598228455,
0.011406554840505123,
-0.3016420602798462,
0.15349777042865753,
0.5703158378601074,
-0.41775059700012207,
-0.211211338... | |
What is the best way to store instances of a class to file/database?
We have a base class called Command and loads of derived classes.
Users create instances of these classes by adding commands to a graphical designer
where they can configure them. (Set the properties).
We then need a way to store these "commands" to... | [
0.33423784375190735,
-0.24934369325637817,
-0.09084530919790268,
0.28028422594070435,
-0.05288905277848244,
0.06442399322986603,
0.11376256495714188,
-0.3730827867984772,
-0.12122882902622223,
-0.7406060099601746,
0.21185831725597382,
0.5092390179634094,
-0.43417060375213623,
0.20149339735... | |
new DaliRequestCommand(1, false, 254);
command[i++] = new DaliRequestCommand(2, false, 254);
command[i++] = new DaliRequestCommand(3, false, 254);
command[i++] = new WaitInSecondsCommand(2);
command[i++] = new DaliRequestCommand(1, false, 0);
command[i++] = new DaliRequestCommand(2, fal... | [
0.0465073324739933,
-0.2960071563720703,
0.8344345092773438,
-0.28031858801841736,
-0.49080315232276917,
0.17379413545131683,
0.2981081008911133,
-0.6887142658233643,
-0.10362758487462997,
-0.4999353885650635,
-0.00894957035779953,
0.8946585655212402,
-0.48944932222366333,
0.21984176337718... | |
better alternatives, like I said db4o seems nice but the license doesn't fit the project.
Update 2:
Thank you for the replies. I'll probably go with the serialization solution now,
but I'll look into the other options as well. F.Y.I. data is stored in a SQL Compact database.
serialization does the trick! Serializatio... | [
0.3706074655056,
-0.17511378228664398,
0.30754268169403076,
0.3986607491970062,
-0.2249809056520462,
-0.25742435455322266,
0.17209342122077942,
0.05996038764715195,
-0.4181181490421295,
-0.8279240131378174,
-0.015694933012127876,
0.5446026921272278,
-0.2869461178779602,
0.18719106912612915... | |
support for serialization. Once you serialized an object, you are free to store this data to a file or database. Likewise, a stream of bytes representing a serialized object can be deserialized into an object which will have the same state as the original one.
Btw: Once you have a serialized stream of bytes, you can a... | [
0.3284521698951721,
-0.25726547837257385,
-0.07610291987657547,
0.43034180998802185,
-0.14928364753723145,
-0.06139252707362175,
0.16493414342403412,
0.14234031736850739,
-0.2573855519294739,
-0.37411797046661377,
-0.4678662121295929,
0.4575118124485016,
-0.21841950714588165,
-0.0863142982... | |
I'm aware that in Vim I can often repeat a command by simply adding a number in front of it. For example, one can delete 5 lines by:
```
5dd
```
It's also often possible to specify a range of lines to apply a command to, for example
```
:10,20s:hello:goodbye:gc
```
How can I perform a 'vertical edit'? I'd like to... | [
0.12945538759231567,
-0.1954946219921112,
0.6309219598770142,
-0.1913958340883255,
-0.11419221013784409,
0.489997923374176,
0.23199255764484406,
-0.061541445553302765,
-0.39180833101272583,
-0.6906225085258484,
-0.3033091425895691,
0.3438974916934967,
-0.09178633987903595,
0.12984032928943... | |
record with:
`q a i , ESC j h q`
use with:
`@ a`
Explanation: `q a` starts recording a macro to register `a`, `q` ends recording. There are registers `a` to `z` available for this. | [
0.1497116982936859,
0.315305233001709,
-0.053185056895017624,
-0.0498240627348423,
0.27833786606788635,
-0.041741471737623215,
0.07509858161211014,
-0.07140170782804489,
-0.11631803959608078,
-0.2900010645389557,
-0.15576379001140594,
0.44368329644203186,
-0.32579171657562256,
0.1666449755... | |
(All of the following is to be written in Java)
I have to build an application that will take as input XML documents that are, potentially, very large. The document is encrypted -- not with XMLsec, but with my client's preexisting encryption algorithm -- will be processed in three phases:
First, the stream will be de... | [
0.11759208887815475,
0.03569687902927399,
0.1584339588880539,
0.04523657634854317,
0.008299147710204124,
-0.26636987924575806,
0.19645103812217712,
-0.03650306537747383,
-0.06999915093183517,
-0.5797863006591797,
-0.3456870913505554,
0.3951380252838135,
-0.23560519516468048,
-0.04132034629... | |
of the file, but might occur at any point in the XML.
Lastly, another extension class (same deal) will subdivide the input XML into 1..n subset documents. It is possible that these will in some part overlap the portion of the document dealt with by the second operation, ie: I believe I will need to rewind whatever mec... | [
0.21069945394992828,
0.035379666835069656,
0.3307930529117584,
0.1404254287481308,
-0.05743718519806862,
-0.28755301237106323,
0.04677162319421768,
-0.14439262449741364,
-0.31053006649017334,
-0.5377759337425232,
-0.3919830322265625,
0.479364812374115,
-0.21551841497421265,
0.1547544300556... | |
not sure if it's possible to parse XML in the way I'm describing; by walking over as much of the document is required to gather the second step's information, and then by rewinding the document and passing over it again to split it into jobs, ideally releasing all of the parts of the document that are no longer in use ... | [
0.4011671543121338,
0.12066236138343811,
0.03863098844885826,
0.10024033486843109,
0.08750022202730179,
-0.03303609788417816,
0.15832355618476868,
-0.17807188630104065,
-0.29799264669418335,
-0.5130160450935364,
-0.016478531062602997,
0.13904060423374176,
-0.050578922033309937,
-0.33100777... | |
Please if you have used NHibernate and Entity Frameworks, please contrast your experiences.
Stax is the right way. I would recommend looking at [Woodstox](http://woodstox.codehaus.org/) | [
0.28746309876441956,
-0.08275440335273743,
-0.2700963318347931,
0.1001083254814148,
-0.16061054170131683,
-0.1997966319322586,
0.2013024538755417,
-0.22326084971427917,
-0.21387620270252228,
-0.49269238114356995,
0.16090160608291626,
0.2801112234592438,
-0.2491026520729065,
-0.142313033342... | |
I have a ASP.NET project, in which I have a method with 10 local variables. This method calls about 10 other methods. 3 of the called methods need all the variables. Is it considered good practice to turn all those variables into global members, and then they don't have to passed as parameters?
create a structure inste... | [
-0.10439175367355347,
-0.11169605702161789,
0.32700496912002563,
-0.017138177528977394,
0.049665115773677826,
-0.019299229606986046,
0.20206187665462494,
-0.23056665062904358,
-0.14735475182533264,
-0.7095611095428467,
0.011221650056540966,
0.3898782730102539,
-0.27183422446250916,
0.21741... | |
public datetime date1;
}
``` | [
0.1416989415884018,
-0.2271115779876709,
0.2695263922214508,
-0.12168397009372711,
0.5176326632499695,
-0.24994032084941864,
0.0014139297418296337,
0.5883656740188599,
-0.043505746871232986,
-0.6150063276290894,
-0.42226505279541016,
0.6044886112213135,
-0.569564938545227,
0.37518477439880... | |
On my machine (XP, 64) the ASP.net worker process (w3wp.exe) always launches with 5.5GB of Virtual Memory reserved. This happens regardless of the web application it's hosting (it can be anything, even an empty web page in aspx).
This big old chunk of virtual memory is reserved at the moment the process starts, so th... | [
0.08779983222484589,
0.010079954750835896,
0.3761249780654907,
-0.02357637882232666,
0.051911916583776474,
-0.02528776228427887,
0.3840654790401459,
0.11062723398208618,
-0.3717929422855377,
-0.9646856784820557,
-0.12768206000328064,
0.3657352030277252,
0.20270220935344696,
0.4202719032764... | |
4 big chunks of 1GB each and a several smaller ones (1/4GB each).
So I guess I need to figure out who's calling VirtualAlloc and reserving all this memory. How do I do that?
Attaching a debugger to the process prior to the memory allocation is tricky, because w3wp.exe is a process launched by svchost.exe (that is, II... | [
0.3045409023761749,
0.02861909382045269,
0.3175569772720337,
0.12669050693511963,
-0.054886940866708755,
-0.09785695374011993,
0.5829505920410156,
0.04087124764919281,
-0.40982306003570557,
-0.6165102124214172,
-0.10426492244005203,
0.4831886887550354,
-0.04306064918637276,
0.5594922900199... | |
the calling process).
I can attach windbg it to the process after the fact (which is how I found the memory regions in question), but I'm not sure it's possible at that point to determine who allocated what.
David Wang [answers this to a similar question](http://blogs.msdn.com/david.wang/archive/2006/02/14/More-on-Vir... | [
-0.18543578684329987,
-0.04404477775096893,
0.2551709711551666,
0.09318822622299194,
0.021636897698044777,
-0.21786268055438995,
0.26168036460876465,
-0.09345506876707077,
-0.2891106903553009,
-0.3942257761955261,
-0.35927528142929077,
0.5479271411895752,
-0.1196744292974472,
0.05463790893... | |
hello world ASPX
> page. You can use Microsoft Debugging
> Tools and "sx e ld
> system.windows.forms" to identify what
> is actually pulling it in at runtime.
> Or you can ildasm to find the
> dependency.
> * mscorlib - make sure it is GAC'd and NGen'd properly. | [
-0.1511409431695938,
-0.36754369735717773,
0.7059125900268555,
0.006562315858900547,
-0.06268871575593948,
-0.23836344480514526,
0.36242908239364624,
0.328163206577301,
-0.4075675308704376,
-0.6518852114677429,
-0.1300971806049347,
0.5382342338562012,
-0.34659337997436523,
0.18766203522682... | |
Is it possible to make FlexBuilder show all compile errors in all files? FlexBuilder does not show errors in Action Script files, that are not referenced. Also very often I fix a problem just to see new problems pop up after compiling the whole project although these errors existed long before.
IntelliJ is showing all... | [
0.0950397178530693,
-0.1866496056318283,
0.09156309813261032,
0.24987652897834778,
-0.0983109176158905,
-0.23882699012756348,
0.37464359402656555,
-0.0005622681928798556,
-0.22429612278938293,
-0.7812395095825195,
0.11307629942893982,
0.806108832359314,
-0.4045117497444153,
-0.418759971857... | |
you tell it to compile, and like you said, whatever is not referenced in the code you compile, will not be compiled, and thus, checked by the compiler.
So if you want to have the compiler check some part of your code, you need to tell it to compile it. I'm not sure how your projects are set up, but I'm assuming that y... | [
1.2213749885559082,
0.10202298313379288,
-0.2928192913532257,
0.2821671962738037,
-0.01808851957321167,
-0.2474754899740219,
0.28564777970314026,
0.3683953881263733,
0.06103513762354851,
-0.4694698750972748,
0.049899227917194366,
0.4698607921600342,
-0.4209270477294922,
0.11582997441291809... | |
code, compiling which would then check for errors everywhere (maybe you have this already, in which case the solution is simply to compile this regularly)
* set up a job/target for compiling the AsDoc documentation for all of your code -- you could then run this regularly and at the same time you'd be keeping your API ... | [
0.8124909996986389,
0.11652924120426178,
-0.10557281225919724,
0.2150121033191681,
-0.1254110187292099,
-0.031649671494960785,
0.35440176725387573,
0.03671678528189659,
-0.13491828739643097,
-0.5389137864112854,
-0.038238368928432465,
0.5456454753875732,
-0.12884098291397095,
-0.1510726511... | |
Is there a quick and nice way using linq?
How about:
```
var most = list.GroupBy(i=>i).OrderByDescending(grp=>grp.Count())
.Select(grp=>grp.Key).First();
```
or in query syntax:
```
var most = (from i in list
group i by i into grp
orderby grp.Count() descending
select grp.K... | [
-0.3224949240684509,
-0.28100821375846863,
0.5551910400390625,
-0.1572033315896988,
0.27129846811294556,
-0.030505646020174026,
-0.18629878759384155,
-0.3583115339279175,
-0.3617560565471649,
-0.5353664755821228,
-0.29969578981399536,
0.7160236835479736,
-0.2799387276172638,
-0.13061663508... | |
use:
```
var most = list.MostCommon();
``` | [
-0.2145894318819046,
-0.065203957259655,
0.060840681195259094,
-0.31755530834198,
0.05137862265110016,
-0.23964855074882507,
0.033267609775066376,
-0.043326038867235184,
-0.35112428665161133,
-0.5155969858169556,
-0.3410795331001282,
0.7498475909233093,
-0.45043709874153137,
0.060156237334... | |
Good morning, afternoon, evening or night (depending on your timezone).
This is just a general question about XML commenting within C#. I have never been very big into commenting my programs, I've always been more of a verbose variable/property/method namer and letting the code speak for itself. I do write comments if... | [
0.6844841837882996,
0.35292214155197144,
0.2594762444496155,
-0.36666470766067505,
-0.7126770615577698,
-0.1266561597585678,
0.11390747874975204,
0.4355708658695221,
-0.1728055328130722,
-0.7703619003295898,
-0.02474972791969776,
0.5414730310440063,
0.053327351808547974,
-0.022186439484357... | |
and generate some nice, helpful documentation for those who have to dig into my code when I'm no longer here.
My question is about standards and conventions. Is there a guide to "good" XML commenting? Should you comment EVERY variable and property? EVERY method? I'm just basically looking for tips on how to write good... | [
0.882411777973175,
0.5703141093254089,
-0.2520580291748047,
0.27658355236053467,
-0.050960224121809006,
-0.3826499283313751,
0.2964484393596649,
0.19487041234970093,
-0.19174154102802277,
-0.4514826834201813,
-0.03826038911938667,
0.44883406162261963,
0.14832566678524017,
-0.07377666234970... | |
XML comments. It also will provide you with Intellisense, and not just end-user help documentation. In the past, we also have included it on privately scoped declarations, but do not feel it is 100% required, as long as the methods are short and on-point.
Don't forget that there are tools to make you XML commenting ta... | [
0.22528718411922455,
0.07402431964874268,
0.5648704767227173,
0.0631876289844513,
-0.5011982917785645,
-0.13902057707309723,
0.13554351031780243,
-0.131381556391716,
-0.11133479326963425,
-0.613054096698761,
-0.30436599254608154,
0.3587495982646942,
-0.40131857991218567,
-0.265955358743667... | |
is very stable and very improved. Have been using it for about a month now, over 1.7.0.0) | [
0.20953015983104706,
0.05272432416677475,
0.5934906005859375,
-0.10403982549905777,
0.17008168995380402,
-0.25781139731407166,
0.5454256534576416,
-0.04200218245387077,
0.21333855390548706,
-0.5553990602493286,
-0.017524681985378265,
0.5616597533226013,
-0.010918257758021355,
-0.1082791239... | |
I know this is odd. but I can't figure other ways to do what I need.
I have a controller: report and a view: report.
Also I have a view that acts as a dashboard where I can see several zones (partials).
I need to add this report view to my dashboard but don't know how.
This report view utilizes complex logic from contr... | [
0.009978470392525196,
0.010951405391097069,
0.46507948637008667,
0.36630934476852417,
-0.08929362893104553,
0.14520947635173798,
0.10444588959217072,
-0.17146612703800201,
-0.03050205670297146,
-0.8175454139709473,
0.3349967300891876,
0.5140167474746704,
-0.20666086673736572,
0.13257205486... | |
logic from controller
As a general rule, controllers should be simple. Really simple. The rule of thumb is "thin controller, fat model" (Rails Envy made some entertaining but useful [screencasts on the subject](http://www.railsenvy.com/2008/6/3/mvc-videos))
What would happen if you created a new model (quite possibly... | [
-0.07031048834323883,
-0.5685657262802124,
0.16425785422325134,
0.390171080827713,
-0.07312339544296265,
-0.0449947752058506,
0.07758229970932007,
-0.1643816977739334,
-0.17791348695755005,
-0.39488935470581055,
0.09169668704271317,
0.6746667623519897,
-0.23951026797294617,
0.2149328887462... | |
I need a way to compute the nth root of a long integer in Python.
I tried `pow(m, 1.0/n)`, but it doesn't work:
> OverflowError: long int too large to convert to float
Any ideas?
By long integer I mean REALLY long integers like:
> 11968003966030964356885611480383408833172346450467339251
> 19609314414104568346308... | [
-0.6582159399986267,
0.19655285775661469,
0.3611273765563965,
0.18229439854621887,
-0.018749544396996498,
0.43408507108688354,
0.11308345198631287,
-0.6390608549118042,
-0.6726389527320862,
-0.36570802330970764,
0.3831765353679657,
0.37102797627449036,
-0.06427241116762161,
0.4526213705539... | |
is to replace the len(str(x)) with the bitwise length and using a bit shift. Based on my tests, I estimate a 5% speedup from the first and a 25% speedup from the second. If the ints are big enough, this might matter (and the speedups may vary). Don't trust my code without testing it carefully. I did some basic testing ... | [
0.22732478380203247,
-0.3284319341182709,
0.14291097223758698,
-0.17336209118366241,
0.12744131684303284,
0.16380594670772552,
0.21424701809883118,
-0.21494394540786743,
-0.3151260316371918,
-0.7682313323020935,
0.0909956619143486,
0.7488839030265808,
-0.2317914217710495,
-0.01091151405125... | |
"""Finds the integer component of the n'th root of x,
an integer such that y ** n <= x < (y + 1) ** n.
"""
high = 1
while high ** n < x:
high *= 2
low = high/2
while low < high:
mid = (low + high) // 2
if low < mid and mid**n < x: | [
-0.34560972452163696,
-0.03895273059606552,
0.22984348237514496,
-0.10359412431716919,
-0.022434404119849205,
0.23033522069454193,
0.1373666375875473,
-0.22166815400123596,
0.20173756778240204,
-0.15880486369132996,
-0.30082473158836365,
0.3691120445728302,
0.005785192362964153,
0.13185165... | |
low = mid
elif high > mid and mid**n > x:
high = mid
else:
return mid
return mid + 1
def find_invpowAlt(x,n):
"""Finds the integer component of the n'th root of x,
an integer such that y ** n <= x < (y + 1) | [
-0.5009923577308655,
-0.29206255078315735,
0.30392640829086304,
-0.3778911828994751,
0.059186842292547226,
0.31863993406295776,
0.2129075676202774,
-0.1536232829093933,
0.36468783020973206,
-0.3028222620487213,
-0.16820169985294342,
0.4299001693725586,
0.05191444605588913,
0.13403847813606... | |
** n.
"""
low = 10 ** (len(str(x)) / n)
high = low * 10
while low < high:
mid = (low + high) // 2
if low < mid and mid**n < x:
low = mid
elif high > mid and mid**n > x: | [
-0.12628884613513947,
-0.3135903477668762,
0.2966032922267914,
-0.25249165296554565,
-0.14299240708351135,
0.42220816016197205,
0.10394179821014404,
-0.030423322692513466,
-0.11945247650146484,
-0.3381488621234894,
-0.5955679416656494,
0.5697813034057617,
0.08916426450014114,
-0.0705662220... | |
high = mid
else:
return mid
return mid + 1
x = 237734537465873465
n = 5
tests = 10000
print "Norm", Timer('find_invpow(x,n)', 'from __main__ import find_invpow, x,n').timeit(number=tests)
print "Alt", Timer('find_invpowAlt(x,n)', 'from __main__ import find_invpowAlt, x,n').timeit(number=tests)... | [
-0.31827783584594727,
-0.11984509974718094,
0.5923271179199219,
-0.14035336673259735,
0.13817521929740906,
0.16788648068904877,
0.34758245944976807,
-0.3073158264160156,
0.14173290133476257,
-0.6000807285308838,
-0.1359298974275589,
0.6905418634414673,
0.051285430788993835,
0.3795878887176... | |
How to wait in a bash script for several subprocesses spawned from that script to finish, and then return exit code `!=0` when any of the subprocesses ends with code `!=0`?
Simple script:
```
#!/bin/bash
for i in `seq 0 9`; do
doCalculations $i &
done
wait
```
The above script will wait for all 10 spawned subproc... | [
0.197144016623497,
-0.0032987010199576616,
0.34151557087898254,
-0.04251628369092941,
0.20304061472415924,
0.09604354202747345,
0.07218429446220398,
-0.4317474961280823,
-0.26302850246429443,
-0.43787577748298645,
-0.08906038105487823,
0.5994316935539246,
-0.10165967792272568,
-0.194938853... | |
the subprocesses, wait for them in order and sum exit statuses?
[`wait`](https://www.gnu.org/software/bash/manual/html_node/Job-Control-Builtins.html#index-wait) also (optionally) takes the `PID` of the process to wait for, and with `$!` you get the `PID` of the last command launched in the background.
Modify the loop ... | [
0.025031914934515953,
-0.12060253322124481,
0.4774990975856781,
-0.12355406582355499,
0.07265134155750275,
0.23354405164718628,
0.02643989399075508,
-0.2858368158340454,
-0.45280224084854126,
-0.42164236307144165,
-0.34715911746025085,
0.43541860580444336,
-0.37549856305122375,
0.191135242... | |
In python do you generally use [PEP 8 -- Style Guide for Python Code](http://www.python.org/dev/peps/pep-0008/) as your coding standards/guidelines? Are there any other formalized standards that you prefer?
> "In python do you generally use PEP 8 -- Style Guide for Python Code as your coding standards/guidelines? Are t... | [
0.5390838980674744,
0.37188559770584106,
-0.19208543002605438,
-0.014871351420879364,
-0.338664174079895,
-0.3218163549900055,
0.3498510420322418,
-0.03085380420088768,
-0.16682487726211548,
-0.279587984085083,
-0.28665870428085327,
0.5928189158439636,
-0.4263699948787689,
-0.6100912094116... | |
I know that I can make a setter that checks to see if a value is NULL and do something. Example:
```
<TextBlock>
<TextBlock.Style>
<Style>
<Style.Triggers>
<DataTrigger Binding="{Binding SomeField}" Value="{x:Null}">
<Setter Property="TextBlock.Text" Value="It's NULL Baby!" />
</D... | [
0.4424881935119629,
0.17324049770832062,
0.14188578724861145,
-0.02380768209695816,
-0.0608653649687767,
-0.3081684410572052,
0.2816702425479889,
-0.48907649517059326,
0.017227038741111755,
-0.5521368980407715,
0.056771211326122284,
0.2933822572231293,
-0.40703830122947693,
0.1669751256704... | |
Thanks for your answers... I knew I could do a value converter (which means I would have to go in code, and that would not be pure XAML as I hoped for). However, that does answer the question that effectively "no" you can't do it in pure XAML. The answer selected, however, shows probably the best way to *create* that k... | [
0.4653424024581909,
0.2259201854467392,
-0.2810102105140686,
0.4874774217605591,
-0.21526916325092316,
-0.20904789865016937,
0.5382353663444519,
0.07655216008424759,
-0.1608765572309494,
-0.40897122025489807,
0.22731482982635498,
0.5770730376243591,
0.16782909631729126,
-0.1933991014957428... | |
comparisons other than equality.
[This blog post](http://blogs.msdn.com/mikehillberg/archive/2008/09/30/ComparableDataTrigger.aspx) describes how to do comparisons such as LT, GT, etc in a DataTrigger.
This limitation of the DataTrigger can be worked around to some extent by using a Converter to massage the data into... | [
0.1529843509197235,
-0.05440615490078926,
0.06927335262298584,
0.36894118785858154,
-0.2727114260196686,
0.3270435929298401,
0.3905917704105377,
-0.6136602163314819,
0.0918610617518425,
-0.5265673995018005,
0.2299697995185852,
0.5984367728233337,
-0.3548356294631958,
-0.036138441413640976,... | |
I have a Perl script that sets up variables near the top for directories and files that it will use. It also requires a few variables to be set as command-line arguments.
Example:
```
use Getopt::Long;
my ($mount_point, $sub_dir, $database_name, $database_schema);
# Populate variables from the command line:
GetOption... | [
0.09779167920351028,
0.21332944929599762,
0.576863706111908,
0.06948207318782806,
-0.04324955493211746,
-0.025281192734837532,
-0.00836147740483284,
-0.13474957644939423,
-0.13085895776748657,
-0.24940170347690582,
-0.2233825922012329,
0.33680060505867004,
-0.2176988124847412,
-0.116587482... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.