text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
be so for future searchers:
The babel module, which deals with all sorts of locale stuff, has a function for doing more or less what you want. Currently it's only in their trunk though, not in the latest public release (version 0.9.4). Once the functionality lands in a release, you could do something like:
```
from da... | [
0.7416158318519592,
-0.38097357749938965,
0.6356202960014343,
0.09061796963214874,
0.27101022005081177,
-0.29582345485687256,
0.1390659213066101,
-0.12285459041595459,
-0.3209543824195862,
-0.470943808555603,
-0.16750012338161469,
0.13030381500720978,
-0.11901696026325226,
-0.0260722469538... | |
do "n minutes" etc. correctly pluralized.
For what it's worth, the babel module also contains functions for formatting dates and times according to locale, Which might be useful when the time delta is large. | [
0.3530937731266022,
-0.1671530157327652,
0.15771886706352234,
-0.005101355258375406,
0.14594674110412598,
-0.024120423942804337,
-0.005043362732976675,
-0.2816806435585022,
-0.4490121304988861,
-0.23312515020370483,
0.02580171450972557,
-0.19053903222084045,
0.09699688851833344,
0.20913921... | |
What is the simplest way of testing if an object implements a given interface in C#? (Answer to this question
[in Java](https://stackoverflow.com/questions/766106/test-if-object-implements-interface))
```
if (object is IBlah)
```
or
```
IBlah myTest = originalObject as IBlah
if (myTest != null)
``` | [
0.045173920691013336,
0.36006319522857666,
-0.08189498633146286,
0.0726192370057106,
-0.03220728039741516,
-0.05316362902522087,
0.4582575559616089,
-0.5746567845344543,
0.02908109687268734,
-0.5323251485824585,
-0.14512789249420166,
0.21911922097206116,
-0.46808090806007385,
0.04691063612... | |
When overriding the equals() function of java.lang.Object, the javadocs suggest that,
> it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.
The hashCod... | [
-0.08434410393238068,
0.30712002515792847,
0.12389649450778961,
-0.04058321192860603,
-0.016530299559235573,
-0.21244199573993683,
0.08677332103252411,
-0.32304278016090393,
-0.21983332931995392,
-0.41735151410102844,
-0.180669903755188,
0.5129535794258118,
-0.40215620398521423,
0.13367471... | |
class People{
public String name;
public int age;
public int hashCode(){
// How to get a unique integer based on name and age?
}
}
/*******************************/
public class App{
public static void main( String args[] ){
People mike = new People();
People melissa = new People();
... | [
-0.16008713841438293,
0.09368409216403961,
0.21411316096782684,
-0.26086774468421936,
0.36764317750930786,
0.7146737575531006,
0.19021877646446228,
0.140117347240448,
-0.6785999536514282,
-0.7062937021255493,
-0.528383195400238,
0.32212507724761963,
-0.33744919300079346,
0.4779678285121918... | |
melissa.age = 24;
System.out.println( mike.hasCode() ); // output?
System.out.println( melissa.hashCode(); // output?
}
}
```
It doesn't say the hashcode for an object has to be completely unique, only that the hashcode for two equal objects returns the same hashcode. It's entirely legal to have two ... | [
0.2861533463001251,
0.14352121949195862,
0.04970106855034828,
-0.3300429880619049,
0.048612698912620544,
0.12810732424259186,
0.4519965350627899,
-0.076828733086586,
-0.46750661730766296,
-0.6565873026847839,
-0.06673270463943481,
0.032079361379146576,
-0.19396942853927612,
0.6174737215042... | |
built-in generators for equals and hashCode that generally do a pretty good job at coming up with "good enough" code for most objects (and probably better than some hand-crafted overly-clever hash functions).
For example, here's a hashCode function that Idea generates for your People class:
```
public int hashCode() ... | [
0.2965909540653229,
-0.003998029511421919,
-0.043516844511032104,
0.08270489424467087,
0.4536965787410736,
-0.03814421594142914,
0.030948853120207787,
-0.21407882869243622,
-0.2575277090072632,
-0.687836766242981,
-0.1319512575864792,
0.22337502241134644,
-0.14176014065742493,
0.2766595482... | |
Or should you always create some other lock object?
Yes, cast it to an IDictionary and lock on `.SyncRoot`:
```
Generic.Dictionary<int, int> dic = new Generic.Dictionary<int, int>();
lock (((IDictionary)dic).SyncRoot)
{
// code
}
```
Thanks to this [source](http://en.csharp-online.net/CSharp_Generics_Recipes%E2... | [
0.15961678326129913,
-0.15733714401721954,
0.32288825511932373,
0.1152511015534401,
0.10825981199741364,
-0.20042116940021515,
0.2998155951499939,
0.04783238098025322,
-0.32304370403289795,
-0.5893007516860962,
-0.06826896965503693,
0.3460308909416199,
-0.5924217104911804,
0.34282848238945... | |
I've got an ssl certificate for what I think is my domain and I want to apply it to two separate applications in that domain that run under ASP classic in IIS on Windows 2000.
I have the following stupid questions:
1. Are certificates issued for URLs or domains? Or subdomains?
2. Can I use the same cert for multiple ... | [
0.604328453540802,
0.5106295943260193,
0.5055129528045654,
0.1806597113609314,
-0.06511107087135315,
-0.5278456807136536,
0.18397323787212372,
0.12387849390506744,
-0.33162611722946167,
-0.4138822555541992,
0.09372499585151672,
0.1484009325504303,
-0.23776374757289886,
0.29270440340042114,... | |
the domain used to access your site.
2) Certs are usually install per host (or virtual host). If you had cert for the domain wwwapps.domain.tld you could have one app at /calendar, and one app at /contacts.
3) Yes, depending on the format and where it is, this can be easy or hard. If you have a crt file and you are r... | [
0.5142697691917419,
-0.019977690652012825,
0.7850108742713928,
0.27341553568840027,
0.03208407759666443,
-0.36457663774490356,
-0.01506838109344244,
0.004681931342929602,
-0.3061363101005554,
-0.8180739879608154,
-0.030331924557685852,
0.42236438393592834,
-0.15405739843845367,
0.293908029... | |
MMC, add the certificate snapin and see any/all installed certificates on the local machine, or your profile. | [
0.5122972130775452,
0.13795502483844757,
0.6039950251579285,
0.3078210651874542,
0.19759148359298706,
-0.4064564108848572,
-0.2147485464811325,
0.318999707698822,
-0.2832756042480469,
-0.4532427489757538,
-0.38685163855552673,
0.6121956706047058,
-0.06070706620812416,
0.19540266692638397,
... | |
Is there a way I can write text to a file from a certain point in the file?
For example, I open a file of 10 lines of text but I want to write a line of text to the 5th line.
I guess one way is to get the lines of text in the file back as an array using the readalllines method, and then add a line at a certain index ... | [
0.3240965008735657,
-0.038206811994314194,
0.311924546957016,
0.15452753007411957,
-0.1034456118941307,
0.06594829261302948,
0.29708558320999146,
-0.2739987373352051,
-0.4104928970336914,
-0.5960872769355774,
-0.015353289432823658,
0.16070489585399628,
-0.07482124119997025,
0.2593667209148... | |
always allow me to add a value at any index, right? (I'm sure one of my books said other wise).
Also, is there a better way of going about this?
Thanks
Oh, sigh. Look up the "master file update" algorithm.
here's pseudocode:
```
open master file for reading.
count := 0
while not EOF do
read line from master fil... | [
0.24399647116661072,
-0.14880143105983734,
0.7122628688812256,
0.008716964162886143,
-0.05654054880142212,
-0.15906234085559845,
0.11853592842817307,
0.03573853150010109,
-0.4942116439342499,
-0.6690772771835327,
0.08323906362056732,
0.6892158389091492,
-0.19496868550777435,
0.092454284429... | |
fi
od
rename output file to replace input file
``` | [
0.02765553630888462,
0.06486092507839203,
0.4811374843120575,
-0.2607511878013611,
0.23757465183734894,
-0.07362451404333115,
-0.05474572628736496,
0.031776394695043564,
0.2899031341075897,
-0.7038723230361938,
-0.3491700291633606,
0.359825074672699,
-0.3056129813194275,
0.3740649819374084... | |
This one's new to me.
I downloaded and installed the VB.Net version 3.5 updates, and got some complaints about my printer drivers, which I ignored. My system auto-rebooted without asking, and then came up with am "Active Desktop Recovery" background screen (everything still works normally). So when I tried to "restore... | [
0.20349377393722534,
0.22786769270896912,
0.7047474980354309,
-0.12764711678028107,
0.016810651868581772,
-0.28052642941474915,
0.4687204658985138,
0.24300535023212433,
-0.5717348456382751,
-0.6820380687713623,
0.15973471105098724,
0.9802074432373047,
-0.318204790353775,
0.0503350831568241... | |
or even a workaround??
The idea is to validate that the entity signing into the web site is actually a person and not a program. The *thing* is called a [CAPTCHA](http://en.wikipedia.org/wiki/Captcha), which stands for "Completely Automated Public Turing test to tell Computers and Humans Apart." | [
0.5997567176818848,
-0.09890274703502655,
-0.16511599719524384,
0.31821396946907043,
0.14755120873451233,
-0.38595303893089294,
0.3508012592792511,
0.13349205255508423,
0.06491900235414505,
-0.17586037516593933,
-0.4497571885585785,
0.2337237149477005,
-0.18427564203739166,
0.1794450432062... | |
Does using Multiple .NET Languages (Delphi, VB.NET, C#) into the same application (but in differents class library of course) can **down peformances** compared to a **full C# application** for example ?
I'm not an expert on the CLR, but I would guess that you will have very similar performance. All the languages compil... | [
0.24079222977161407,
0.11584034562110901,
-0.000496098306030035,
0.21302706003189087,
-0.22182819247245789,
-0.07632232457399368,
0.165602445602417,
-0.13018006086349487,
-0.2207859456539154,
-0.7506604194641113,
0.09815866500139236,
0.670342743396759,
-0.14912672340869904,
-0.174728929996... | |
Okay so a continuation from [this question](https://stackoverflow.com/questions/409913/can-php-be-installed-on-a-local-machine), where you experts intro'd me to [WAMP](http://www.wampserver.com/en/presentation.php), which can basically execute PHP within a Windows XP environment.
So now I've got it installed, but the ... | [
0.5010251402854919,
-0.0290957260876894,
0.4642849564552307,
-0.046469736844301224,
-0.18260450661182404,
-0.21258904039859772,
0.4452957808971405,
0.16797614097595215,
-0.5597344040870667,
-0.6123701930046082,
0.04292906075716019,
0.5993596315383911,
-0.05110187456011772,
-0.0459032654762... | |
I'm desperate to execute PHP client-side and I'm just reverting to testing on-server for now!
Skype reserves port 80 for its incoming connection which conflicts with WAMP, so simply configure Skype to use another port by doing the following:
In Skype go to Tools|Options|Advanced|Connection uncheck the option --> Use p... | [
0.05005224794149399,
-0.07489777356386185,
0.44587981700897217,
0.3392912447452545,
0.12060195952653885,
-0.1338232010602951,
0.5592201948165894,
0.07897862792015076,
-0.1771281212568283,
-0.6043809056282043,
-0.05255284905433655,
0.9354336261749268,
-0.2841239273548126,
-0.214632377028465... | |
I want to recomment Git to my boss as a new source control system, since we're stuck in the 90s with VSS (ouch), but are the tools and 3rd party support good enough yet?
Specifically I'm talking about GUI front-ends similar to TortoiseSVN, decent visual diff/merge support, as well as stuff like email commit notificati... | [
0.45040586590766907,
0.13180610537528992,
0.27371299266815186,
0.23057805001735687,
-0.16649304330348969,
-0.3399333655834198,
0.12824895977973938,
0.30611658096313477,
-0.15208998322486877,
-0.6496216654777527,
0.009279186837375164,
0.585752010345459,
-0.09091152250766754,
0.1871330589056... | |
(distributed), with nothing but a command-line app and some online tutorials. This would be a step backwards.
So what do you think... is Git ready? What decent tools exist for Git and what third party development apps support it?
EDIT: My original question was pretty vague so I'm updating it to specifically ask for a... | [
0.5905054211616516,
-0.15733903646469116,
0.08326084911823273,
0.45147866010665894,
-0.2891438901424408,
-0.44735080003738403,
0.03144030645489693,
0.18148376047611237,
-0.25486597418785095,
-0.4689086675643921,
-0.008811253122985363,
0.29970782995224,
-0.2696036398410797,
0.19418202340602... | |
offline editing - private and cheap branches being one of them.
Depends on the team. If you're part of a technologically savvy team, then git is wonderful (and often more than wonderful). But if some people arn't comfortable on the command line, there could be some trouble (because [tortoisegit](http://code.google.com/... | [
0.4639451801776886,
-0.29856494069099426,
0.35375073552131653,
0.43431469798088074,
-0.1918564885854721,
-0.2077053338289261,
-0.034444283694028854,
0.6304799914360046,
-0.16716858744621277,
-0.4850732386112213,
-0.3834083378314972,
0.7441226243972778,
0.035809267312288284,
-0.161476820707... | |
I'm writing a sidebar extension for Firefox and need a way to get the URL of the current page so I can check it against a database and display the results. How can I do this?
```
window.top.getBrowser().selectedBrowser.contentWindow.location.href;
```
might work, otherwise I think you need to use:
```
var mainWindow... | [
-0.03768931329250336,
0.14621704816818237,
0.6541376709938049,
-0.0911090224981308,
0.23919248580932617,
-0.18850043416023254,
0.4174753427505493,
-0.10678724199533463,
-0.16687259078025818,
-0.9038462042808533,
-0.04694047570228577,
0.4752494990825653,
-0.5425603985786438,
0.1958720088005... | |
.rootTreeItem
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindow);
mainWindow.getBrowser().selectedBrowser.contentWindow.location.href;
``` | [
-0.48366907238960266,
-0.1498207151889801,
0.22596721351146698,
0.233682781457901,
0.09058239310979843,
-0.012934055179357529,
0.5511183142662048,
0.21021012961864471,
-0.25554054975509644,
-0.7981703877449036,
-0.33945876359939575,
-0.06992260366678238,
-0.23323822021484375,
0.46576231718... | |
I got to thinking about font (typeface) selection today. A site I did for work came with this professsionally done style guide that detailed colour selection, font selection, spacing, etc. It's the first time I'd seen anything like that but I have to admit, what they'd chosen did look good.
Now I've previously read ab... | [
0.7803569436073303,
0.320198655128479,
0.22183717787265778,
-0.2590600550174713,
-0.22884601354599,
0.3584582209587097,
-0.09710018336772919,
0.17567668855190277,
-0.23524998128414154,
-0.7186371684074402,
0.2964511215686798,
0.5159183740615845,
0.04818543419241905,
-0.006507288198918104,
... | |
found some discussions on fonts for printing where you had the option of downloading and including custom fonts. That's not an option on the Web. You're limited to what browsers (or, rather, operating systems) support. I'd be interested in reading something about what IE and Firefox support on Windows and Mac (sorry, L... | [
0.4460151493549347,
0.03136245161294937,
0.16830852627754211,
0.2686465382575989,
-0.08848348259925842,
0.04234178736805916,
0.07139913737773895,
0.43077147006988525,
-0.552375078201294,
-0.7073034644126892,
0.07656308263540268,
0.4905872642993927,
0.02641957439482212,
0.06297104805707932,... | |
I understand that "Exceptions are for exceptional cases" [a], but besides just being repeated [over](https://stackoverflow.com/questions/88541/business-objects-validation-and-exceptions#88917) and [over](https://stackoverflow.com/questions/77127/when-to-throw-an-exception#77227) again, I've never found an actual reason... | [
-0.08180663734674454,
0.24154019355773926,
-0.1427706778049469,
-0.03495326265692711,
-0.2896230220794678,
-0.19239342212677002,
0.724684476852417,
-0.22272056341171265,
-0.6215626001358032,
-0.027655363082885742,
-0.11985630542039871,
0.21670891344547272,
-0.26762855052948,
0.046720173209... | |
and hence is exceptional. Throwing an exception allows me to define exactly what was wrong like StringValueTooLong or or IntegerValueTooLow or InvalidDateValue or whatever. Why is this considered wrong?
Alternatives to throwing an exception would be to either return (and eventually collect) an error code or far worse ... | [
0.1308283805847168,
0.14989939332008362,
-0.3195253610610962,
0.04965429753065109,
-0.512746274471283,
-0.20543617010116577,
0.5121529698371887,
-0.04572274535894394,
-0.36486944556236267,
-0.4038749039173126,
0.030758369714021683,
0.3055020570755005,
-0.26915910840034485,
-0.0371495671570... | |
functionality already built into my language?
Also, I [found this article by Martin Fowler](http://www.martinfowler.com/eaaDev/Notification.html) as to how to handle such things - the Notification pattern. I'm not sure how I see this as being anything other than Exceptions that don't halt execution.
a: Everywhere I'... | [
0.3549029529094696,
0.4915308356285095,
0.12603925168514252,
-0.21065843105316162,
0.08528108149766922,
0.03245290368795395,
0.777565062046051,
-0.45509788393974304,
-0.3969789147377014,
-0.21131545305252075,
-0.13241489231586456,
0.548591673374176,
-0.3322131633758545,
-0.2998983860015869... | |
seems most alternate solutions are just Exceptions in disguise.
Reading these answers, I find it very unhelpful to say, "Exceptions should only be used for exceptional conditions". This begs the whole question of what is an "exceptional condition". This is a subjective term, the best definition of which is "any conditi... | [
0.17905738949775696,
0.18211406469345093,
-0.22000384330749512,
0.1495763510465622,
0.14957651495933533,
-0.05984531715512276,
0.5498853921890259,
0.02065645158290863,
-0.39061814546585083,
-0.37380436062812805,
-0.005412586499005556,
0.34149086475372314,
-0.34280773997306824,
0.0555209964... | |
you are going to argue against exceptions in a certain case, you have to explain how to divide the universe of conditions into "exceptional" and "non-exceptional".
In some ways, it's similar to answering the question, "where are the boundaries between procedures?" The answer is, "Wherever you put the begin and end", a... | [
0.3689989745616913,
-0.016883084550499916,
-0.38675233721733093,
0.23764997720718384,
0.24918587505817413,
-0.1829204112291336,
0.2533697783946991,
-0.40721240639686584,
-0.16193194687366486,
-0.6183218359947205,
-0.09653688967227936,
0.3323163688182831,
-0.2182786464691162,
0.229651406407... | |
I'm trying to create a custom control - a button - which will have multiple styles applied to it depending on the value of a property within the data context.
What I was thinking is using something similar to:
```
<Button Style="{Binding Path=ButtonStyleProperty, Converter={StaticResource styleConverter}}" Text="{Bin... | [
0.11543355882167816,
-0.12863895297050476,
0.6251568794250488,
-0.1293172687292099,
0.15943773090839386,
0.08278200775384903,
-0.0071716466918587685,
-0.45792356133461,
-0.21341021358966827,
-0.6219491958618164,
-0.12661242485046387,
0.5752671360969543,
-0.4920002520084381,
0.1692751348018... | |
the style object and even if this is possible at all...
What I am doing in the mean time is handling the `DataContextChanged` event, then attaching a handler to the `PropertyChanged` event of the object being bound to the button - then running the switch statement in there.
Its not quite perfect but until I can find ... | [
0.39194434881210327,
-0.21507757902145386,
0.39091381430625916,
0.25181251764297485,
0.0012794688809663057,
-0.3004800081253052,
0.031922902911901474,
-0.10508344322443008,
-0.09018689393997192,
-0.44929739832878113,
0.13774897158145905,
0.6429490447044373,
-0.3234591782093048,
-0.08849100... | |
of:
```
<Button>
<Button.Style>
<MultiBinding Converter="{StaticResource StyleConverter}">
<MultiBinding.Bindings>
<Binding RelativeSource="{RelativeSource Self}"/>
<Binding Path="MyStyleString"/>
</MultiBinding.Bindings>
</MultiBinding>
<... | [
-0.1805766224861145,
-0.05884477496147156,
0.5917635560035706,
-0.04398108273744583,
-0.3402863144874573,
0.008490171283483505,
-0.1392797976732254,
-0.7893552780151367,
-0.3576486110687256,
-0.6587488651275635,
0.10550332069396973,
0.24739249050617218,
-0.7157518863677979,
0.2053303718566... | |
resources in our converter. The converter needs to implement IMultiValueConverter (rather than IValueConverter) and can look something like this:
```
class StyleConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
... | [
0.42424890398979187,
-0.12612086534500122,
0.6489285826683044,
0.06369040906429291,
0.07240534573793411,
-0.08092615753412247,
0.27410101890563965,
0.018901348114013672,
-0.008507202379405499,
-0.7343976497650146,
-0.19683898985385895,
0.5169880986213684,
-0.34214481711387634,
0.3615510165... | |
= (Style)targetElement.TryFindResource(styleName);
if (newStyle == null)
newStyle = (Style)targetElement.TryFindResource("MyDefaultStyleName");
return newStyle;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo cultu... | [
0.5224229097366333,
-0.008199657313525677,
0.6683648824691772,
-0.3021123707294464,
0.06448470056056976,
-0.17066273093223572,
0.4825705289840698,
0.02002176269888878,
0.00734297139570117,
-0.4947975277900696,
-0.3932616114616394,
0.49562159180641174,
-0.25586941838264465,
0.32425990700721... | |
I need your help to define a special case in XML schema:
A sequence that contains two elements: 'x' and 'y' whereas:
* `<x>` element can appear 0 to unbound times in the sequence
* `<y>` element can appear 0 to 1 time in the sequence
* `<x>` and `<y>` locations can be anywhere - that is, it is possible to have unbound... | [
0.22861126065254211,
0.28839734196662903,
-0.08657249808311462,
0.25615161657333374,
0.07545621693134308,
-0.01759607158601284,
0.18924355506896973,
-0.34752175211906433,
-0.07898101955652237,
-0.4291965365409851,
-0.03877933695912361,
0.37291839718818665,
-0.23746642470359802,
0.079357005... | |
<xs:complexType name="myComplexType">
<xs:sequence>
<xs:element name="x" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:sequence minOccurs="0">
<xs:element name="y" type="xs:string"/>
<xs:element name="x" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
... | [
-0.2567409574985504,
0.03188277408480644,
0.48269811272621155,
-0.13473981618881226,
-0.12637612223625183,
0.11954197287559509,
0.2613983452320099,
-0.3579936921596527,
0.13814225792884827,
-0.5075111389160156,
-0.3603511154651642,
0.4491853713989258,
-0.36473602056503296,
0.17525200545787... | |
I have the following Hibernate Mapping, which has to be mapped using the Table per Concrete Class Hierarchy:
```
<hibernate-mapping package='dao'>
<meta attribute='class-description'></meta>
<class name='PropertyDAO'>
<id name='id' column='id_property'>
<generator class='assigned'/>
... | [
-0.1356581300497055,
0.03009553998708725,
0.43600764870643616,
-0.17015695571899414,
0.051918886601924896,
0.1733073592185974,
0.09994975477457047,
-0.5563883185386658,
0.19471867382526398,
-1.0031521320343018,
-0.18186306953430176,
0.11141283810138702,
0.12691134214401245,
0.3900958895683... | |
<property name='totalArea' column='totalArea'/>
<property name='price' column='price'/>
</union-subclass>
<union-subclass name='LandDAO' table='land'>
<property name='area' column='area'/>
<property name='unitPrice' column='unitPrice'/>
</union-subclass>
<... | [
-0.05520377680659294,
0.2332821637392044,
0.46651434898376465,
-0.018814614042639732,
0.006297461222857237,
0.5325690507888794,
0.062223881483078,
-0.5085846185684204,
-0.02540614642202854,
-0.5474187135696411,
-0.5202301740646362,
0.023767583072185516,
0.22759298980236053,
0.4306455552577... | |
address, area, unitPrice)
As far as I understood, in this case the ids need to be generated explicitly before calling .save(), so my question is: How can I create a strategy for the automatically generation of the ids, so that the ids from the concrete class form a continuous domain when joined.
The solution is to cre... | [
0.04626978561282158,
-0.15755701065063477,
0.26498931646347046,
0.15404191613197327,
0.24273568391799927,
0.15048161149024963,
-0.17174242436885834,
-0.10769130289554596,
-0.2386603057384491,
-0.4628733992576599,
0.21701830625534058,
0.4419889748096466,
-0.28184881806373596,
0.275218605995... | |
What optimization techniques do you use on extremely large databases? If our estimations are correct, our application will have billions of records stored in the db (MS SQL Server 2005), mostly logs that will be used for statistics. The data contains numbers (mostly integer) and text (error message texts, URLs) alike.
... | [
-0.10067025572061539,
0.3521255850791931,
0.1265123188495636,
0.3631851077079773,
0.048401061445474625,
0.04058142006397247,
-0.13111275434494019,
-0.04966701567173004,
-0.2875431180000305,
-0.545173704624176,
0.1622612625360489,
0.6432781219482422,
-0.3663175702095032,
-0.2039433866739273... | |
disks you can span over, the better the performance.
* Optimize the DB for the type of queries that will be performed. What happens more SELECTs or INSERTs?
* Does the load happens for the entire day, or for just few hours? Can you postpone some of the things to be run for the night?
* Have incremental backups.
* If yo... | [
0.44045335054397583,
-0.12370701134204865,
0.15974131226539612,
0.5977086424827576,
-0.15101388096809387,
-0.26191186904907227,
-0.07933294028043747,
-0.005833107512444258,
-0.4363643229007721,
-0.5792332291603088,
-0.07361308485269547,
0.878153383731842,
-0.04465232416987419,
0.0318115800... | |
as possible. Consider the appropriate indexes as well.
You're gonna have to be more specific about the way you're going to store those logs. Are they LOBs in the DB? Simple text records? | [
0.6795929670333862,
-0.009366788901388645,
0.15039485692977905,
0.45409855246543884,
0.25776106119155884,
-0.3165736198425293,
0.06390345841646194,
0.06821679323911667,
-0.27651703357696533,
-0.4215909242630005,
-0.010126631706953049,
0.4665958285331726,
0.08324303478002548,
-0.16302657127... | |
In my programs infinity usually arises when a value is divided by zero. I get indeterminate when I divide zero by zero. How do you check for infinite and indeterminate values in C++?
In C++, infinity is represented by 1.#INF. Indeterminate is represented by -1.#IND. The problem is how to test if a variable is infinite... | [
-0.004190660081803799,
-0.20322713255882263,
0.057584475725889206,
-0.011736790649592876,
0.14041003584861755,
-0.1359361857175827,
-0.18785496056079865,
-0.10034926980733871,
-0.17631706595420837,
-0.2623940110206604,
0.1216866597533226,
0.5279913544654846,
-0.27570074796676636,
0.0544939... | |
compare it to some value in order to check if that value is infinite.
Indeterminate is a little tricky, because you cannot compare an indeterminate value to some other value. Any comparison returns false. You can use this property to detect an indeterminate value by comparing it to itself. Let's say you have a double ... | [
0.05925629660487175,
-0.19775812327861786,
0.02798481658101082,
-0.07357295602560043,
-0.3391895592212677,
0.3231784701347351,
0.2492484152317047,
-0.013225657865405083,
-0.16348372399806976,
-0.5866050720214844,
0.25005415081977844,
0.5377256870269775,
-0.35923150181770325,
0.223056167364... | |
check for indeterminate and infinite values:
```
#include "limits.h"
#include "math.h"
bool isIndeterminate(const double pV)
{
return (pV != pV);
}
bool isInfinite(const double pV)
{
return (fabs(pV) == std::numeric_limits::infinity())
}
```
Are there better ways for these checks, am I missing anything?
F... | [
0.0845380574464798,
-0.19141785800457,
0.20257477462291718,
0.10990092903375626,
0.11601613461971283,
-0.11583908647298813,
0.1406020075082779,
-0.4203081429004669,
-0.41837114095687866,
-0.20158398151397705,
-0.17919865250587463,
0.6661032438278198,
-0.12485641241073608,
-0.08277008682489... | |
I have some markup like this:
```
<p><a id="1" href="#">Link 1</a></p>
<p id="1show" class="starthidden">Hi! I get shown when link 1 is clicked</p>
<p><a id="2" href="#">Link 2</a></p>
<p id="2show" class="starthidden">Hi! I get shown when link 2 is clicked</p>
<p><a id="3" href="#">Link 3</a></p>
<p id="3show" clas... | [
-0.002027910901233554,
-0.03868527710437775,
0.6741073727607727,
-0.3544822335243225,
-0.2921370565891266,
-0.20716212689876556,
0.3016321361064911,
-0.5189611315727234,
-0.028723927214741707,
-0.7269065976142883,
-0.07535084336996078,
0.33971691131591797,
-0.3121691048145294,
0.1273032724... | |
$("show").slideToggle("slow");
return false;
});
return false;
});
});
```
Now, id and show are both what I'd expect at runtime, but the next line doesn't work. I guess that it's the $("id") bit - though changing this to $(id) doesn't work either.
How do I fix this?
First off, numer... | [
0.19162917137145996,
-0.010874462313950062,
0.7286660075187683,
-0.18115349113941193,
-0.21993789076805115,
-0.15174664556980133,
0.34865325689315796,
-0.31572315096855164,
-0.05387935787439346,
-0.74647456407547,
-0.018320852890610695,
0.6062537431716919,
-0.17454349994659424,
0.138702377... | |
shown when link 1 is clicked</p>
<p><a href="#msg2">Link 2</a></p>
<p id="msg2" class="starthidden">Hi! I get shown when link 2 is clicked</p>
<p><a href="#msg3">Link 3</a></p>
<p id="msg3" class="starthidden">Hi! I get shown when link 3 is clicked</p>
```
Which is both valid and clearer. On devices that don't have... | [
-0.13743050396442413,
-0.21986375749111176,
0.9899361729621887,
-0.30996260046958923,
-0.28989338874816895,
-0.1356692612171173,
0.2960168421268463,
-0.2779640853404999,
-0.2219514399766922,
-0.7452647686004639,
-0.2830313742160797,
0.4795030653476715,
-0.3390989899635315,
0.06347371637821... | |
return false;
});
});
``` | [
-0.02439935877919197,
0.205330029129982,
0.12933647632598877,
-0.43490520119667053,
0.14462830126285553,
-0.26495611667633057,
0.5976847410202026,
-0.09173187613487244,
0.16164034605026245,
-0.07524683326482773,
-0.5845365524291992,
0.8514800071716309,
-0.3197682499885559,
0.33222290873527... | |
I'm trying to create an overridden operator function using both const parameters, but I can't figure out how to do it. Here is a simple example:
```
class Number
{
Number()
{
value = 1;
};
inline Number operator + (const Number& n)
{
Number result;
result.value = value + n... | [
-0.15738308429718018,
-0.17351683974266052,
0.12488129734992981,
-0.1410217583179474,
0.014978568069636822,
0.003851979738101363,
0.13496826589107513,
-0.22930459678173065,
0.008925777859985828,
-0.3499835133552551,
-0.016188617795705795,
0.7101454734802246,
-0.44492948055267334,
0.2448910... | |
int value;
}
```
What I am trying to do here is pass in two arguments into the addition function that are both const and return the result without changing anything in the class:
```
const Number a = Number();
const Number b = Number();
Number c = a + b;
```
Is this possible and how would I go about doing this?
T... | [
-0.06651270389556885,
-0.022954652085900307,
0.14297619462013245,
-0.08652152121067047,
-0.0730326846241951,
-0.09844384342432022,
0.1925782412290573,
-0.10553795844316483,
0.24470721185207367,
-0.3093096911907196,
-0.03839877247810364,
0.7409043312072754,
-0.49404385685920715,
-0.01835764... | |
it needs access to `Number`'s internals.
If you have to have it as a member function then you need to make the function itself const:
```
Number operator+( const Number& n ) const
{ // ...
```
For classes like `Number`, `operator+` is typically implemented in terms of `operator+=` as usually you want all the usual ... | [
-0.40416374802589417,
-0.16107209026813507,
0.19228030741214752,
-0.020605633035302162,
-0.05912940576672554,
-0.0479666143655777,
0.10549964755773544,
-0.17736093699932098,
0.06562992930412292,
-0.4825485050678253,
-0.3125470280647278,
0.3998938500881195,
-0.3693696856498718,
0.1291669756... | |
even:
```
Number operator+( Number left, const Number& right )
{
return left += right;
}
``` | [
-0.7964763045310974,
0.0158994123339653,
0.23596055805683136,
-0.16816018521785736,
-0.04421018809080124,
0.06175239011645317,
-0.017090655863285065,
-0.07346717268228531,
-0.05977771058678627,
-0.22235962748527527,
-0.2963775396347046,
0.3170810639858246,
-0.3840423822402954,
-0.011192887... | |
Or to reformulate the question: is there a performance penalty in using unsigned values?
And in general: what is the most performant type (16bit signed?, 32bit signed? etc.) on the IPhone ARM processor?
It always depends:
For loops signed integers as counters and limits are a tad faster because in C the compiler is f... | [
0.34292152523994446,
-0.1113535538315773,
0.18168415129184723,
0.05977487564086914,
0.1845555156469345,
0.14149515330791473,
0.4495337903499603,
-0.46014469861984253,
-0.3892824649810791,
-0.17087478935718536,
0.014187551103532314,
0.42728185653686523,
-0.34329909086227417,
-0.191562429070... | |
loop the compiler must make sure that the loop even terminates if first is greater than last because I will wrap from UINT\_MAX to 0 on overflow (just to name one example - there are other cases as well). This removes the opportunity for some loop optimizations. With signed loop counters the compiler assumes that wrap-... | [
0.25634655356407166,
-0.02621246688067913,
0.1743108183145523,
0.06506896764039993,
-0.3092189431190491,
-0.06362099200487137,
0.38427430391311646,
-0.39539405703544617,
-0.3928101062774658,
-0.2268901765346527,
-0.1493665874004364,
0.24474026262760162,
-0.11079441756010056,
0.124764837324... | |
some cycles for the extra-code required to turn a signed division into an unsigned division.
For all other things like arithmetic, logic, load and write to memory the choice of sign-ness will not make **any** difference.
---
Regarding the data-size: As Rune pointed out they are more or less of equal speed with 32 bi... | [
0.2120123952627182,
-0.12045232951641083,
0.19495411217212677,
0.17105387151241302,
-0.15320593118667603,
0.11173517256975174,
0.2761911451816559,
-0.40208691358566284,
-0.40870583057403564,
-0.4914615750312805,
0.045851532369852066,
0.2518917918205261,
0.3627650737762451,
-0.1511626243591... | |
relative slow memory. If you're able to utilize the cache more efficient by choosing smaller data-types the code may executes faster even if the theoretical cycle-count goes up.
You have to experiment here. | [
-0.08153170347213745,
-0.1469016671180725,
-0.07866048067808151,
0.21615281701087952,
0.03142666816711426,
0.16599015891551971,
0.15011997520923615,
0.026984546333551407,
-0.24697262048721313,
-0.6310499906539917,
0.2114945948123932,
0.6617951393127441,
-0.11347252875566483,
0.156338110566... | |
Microsoft's live service has an amazing contact details form in their "Account" > "Registered information" page. You are first asked for your country and the rest of the contact form changes accordingly. For example, if you select "United States", the form fields will change to:
Address 1, Address 2, City, State (drop ... | [
0.4785800874233246,
-0.2654440701007843,
0.5596460700035095,
0.26844990253448486,
0.40934887528419495,
0.2691062390804291,
0.31538110971450806,
0.575524628162384,
-0.049056146293878555,
-0.5293371081352234,
-0.6241238713264465,
-0.33328086137771606,
-0.19949474930763245,
0.0107352733612060... | |
zone (drop down).
This contact form provides the best user experience I have ever encountered in a contact form (I may be over sensitive here but enhanced user experiences excites me and I want to provide the same experience to my users).
Is there a way of creating such a form using VS 2008/.NET 3.5? Is there a legal... | [
0.49991801381111145,
-0.3224169611930847,
0.2993622422218323,
0.3713682293891907,
0.3178159296512604,
-0.31454333662986755,
-0.05223735421895981,
-0.09560395777225494,
-0.26992249488830566,
-0.30665817856788635,
0.09904689341783524,
0.19020773470401764,
-0.1916164606809616,
-0.065520003437... | |
loop counter like this:
```
void function (unsigned int first, unsigned int last)
{
unsigned int i;
for (i=first; i!=last; i++)
{
// do something here...
}
}
```
In this loop the compiler must make sure that the loop even terminates if first is greater than last because I will wrap from UINT\_MAX to 0 o... | [
0.2635572850704193,
-0.2106998711824417,
0.3067432940006256,
-0.16474279761314392,
-0.2689005434513092,
-0.1866934448480606,
0.41362714767456055,
-0.36834362149238586,
-0.2478848099708557,
-0.3135850429534912,
-0.1743505448102951,
0.329213410615921,
-0.36305734515190125,
0.3627909421920776... | |
unsigned integers are a tad faster on the ARM. The ARM does not has a hardware divide unit, so division is done in software, and is always done on unsigned values. You'll save some cycles for the extra-code required to turn a signed division into an unsigned division.
For all other things like arithmetic, logic, load ... | [
0.1431797742843628,
0.019295472651720047,
0.24877583980560303,
0.10372797399759293,
-0.17457763850688934,
-0.013578270561993122,
0.21276986598968506,
-0.3209983706474304,
-0.4556235373020172,
-0.5006480813026428,
0.17885702848434448,
0.20031391084194183,
0.20523372292518616,
-0.02565092220... | |
they reside in a 32 bit register and the upper (unused) bits need to be sign or zero extended.
However, the ARM CPU's have a relative small data-cache and are often connected to relative slow memory. If you're able to utilize the cache more efficient by choosing smaller data-types the code may executes faster even if... | [
0.1769423633813858,
0.01833917573094368,
0.07298944145441055,
0.3476827144622803,
-0.03857213258743286,
0.2564435303211212,
-0.0028737105894833803,
-0.4259703457355499,
-0.3260883092880249,
-0.4152217209339142,
0.17037487030029297,
0.15771234035491943,
0.2239975482225418,
-0.05643538758158... | |
I just finished reading [this article](https://stackoverflow.com/questions/410558/why-are-exceptions-said-to-be-so-bad-for-input-validation) on the advantages and disadvantages of exceptions and I agree with the sentiment that Try-Catch blocks should not be used for "normal" control-flow management (don't use them like... | [
0.27987515926361084,
-0.07647506892681122,
0.1046045571565628,
0.17600269615650177,
-0.1984652280807495,
-0.5323535799980164,
0.42867931723594666,
-0.020442552864551544,
-0.5197449922561646,
-0.541041910648346,
-0.11542661488056183,
0.15928305685520172,
-0.17521804571151733,
0.147300422191... | |
this practice but what are your thoughts?
Note: I do have connections wrapped in a DAL and could close connections when the object destructor is called but this seems sketchy to me. As far as I know, you cannot count on a destructor being called in the event of an exception. Am I wrong?
You don't need to avoid the try... | [
0.7278056740760803,
-0.2634321451187134,
0.08986015617847443,
0.09695697575807571,
-0.2853865325450897,
-0.12340336292982101,
0.33161816000938416,
-0.09033285081386566,
-0.2392863929271698,
-0.6323305368423462,
0.10282611101865768,
0.1773054003715515,
-0.23883190751075745,
0.02643228322267... | |
Is there a way to generate a class constraint with CodeDom.
Because when I use something like
```
var method = new CodeMemberMethod();
var genericParam = new CodeTypeParameter("InterfaceType");
genericParam.Constraints.Add("class");
method.TypeParameters.Add(genericParam);
```
the generated code is like
```
privat... | [
-0.28572818636894226,
-0.21589714288711548,
0.4370878040790558,
-0.023829039186239243,
0.006087530869990587,
0.0757698342204094,
0.15375377237796783,
-0.3219574987888336,
-0.28462252020835876,
-0.7215928435325623,
-0.09237098693847656,
0.3543964624404907,
-0.4150373637676239,
0.10596854239... | |
I'm experiencing something really strange!
I have a div that I'm hiding with JS (jQuery).
Like this:
```
$('#myDiv').hide();
```
Then when I make a fadeIn like this:
```
$("#myDiv").fadeIn('slow');
```
then the text loses ClearType in IE but not in FF. If I go with toggle insted of fadeIn, then it's all fine.
W... | [
0.16123884916305542,
0.1044347807765007,
0.6662774085998535,
-0.1689690202474594,
-0.22983510792255402,
-0.34735023975372314,
0.6579189300537109,
0.23730060458183289,
0.034008707851171494,
-0.799922525882721,
-0.05844033136963844,
0.19676224887371063,
-0.2725464403629303,
0.306467652320861... | |
problem would be removing it manually:
```
$('#myDiv').fadeIn('slow', function() {
this.style.removeAttribute('filter');
});
```
As the blog post above explains, this is a rather messy solution.
Excerpt from the blog post, including a **cleaner solution** to this problem:
> This means that every single time we
... | [
0.055459052324295044,
-0.19815218448638916,
0.2500171661376953,
-0.2624921500682831,
0.04652746021747589,
0.01496188249439001,
0.3665545582771301,
-0.35207608342170715,
0.028505252674221992,
-0.7957628965377808,
-0.1761912852525711,
0.42279505729675293,
-0.6682917475700378,
0.2126884013414... | |
instead of directly calling
> the fade functions, we call the
> wrapper. Like so:
```
$('#node').customFadeOut('slow', function() {
//no more fiddling with attributes here
});
```
> So, how do you get this working? Just
> include the following code after you
> include the jQuery library for the
> added func... | [
0.3898136615753174,
-0.6196470260620117,
0.7783892154693604,
-0.18176603317260742,
0.15637782216072083,
-0.24364244937896729,
0.13591937720775604,
-0.4305002987384796,
0.21273936331272125,
-0.8451927900314331,
-0.08154750615358353,
0.8052266240119934,
-0.48706352710723877,
-0.0795264542102... | |
if(callback != undefined)
callback();
});
};
$.fn.customFadeOut = function(speed, callback) {
$(this).fadeOut(speed, function() {
if(jQuery.browser.msie)
$(this).get(0).style.removeAttribute('filter');
if(callback != undefined) | [
0.08974161744117737,
-0.7612940073013306,
0.5641480684280396,
-0.3949497640132904,
0.3558717370033264,
0.14517968893051147,
0.4562678039073944,
-0.20149162411689758,
-0.12300097942352295,
-0.684867799282074,
-0.4259428381919861,
0.6520931720733643,
-0.6805609464645386,
0.08519258350133896,... | |
callback();
});
};
})(jQuery);
``` | [
-0.24580976366996765,
-0.10073549300432205,
0.4836573600769043,
-0.4460648000240326,
0.1594351977109909,
-0.1255115568637848,
0.21986733376979828,
-0.06543323397636414,
0.031440455466508865,
-0.20296259224414825,
-0.569963812828064,
0.7633073925971985,
-0.5359619855880737,
0.34670776128768... | |
I have a function with the same name, but with different signature in a base and derived classes. When I am trying to use the base class's function in another class that inherits from the derived, I receive an error. See the following code:
```
class A
{
public:
void foo(string s){};
};
class B : public A
{
... | [
0.35579824447631836,
0.12986062467098236,
0.10990386456251144,
-0.3727111220359802,
-0.03120214119553566,
-0.039900533854961395,
0.3589872717857361,
-0.2518947422504425,
0.12651896476745605,
-0.4062801003456116,
-0.18750058114528656,
0.45425188541412354,
-0.37028807401657104,
0.47778129577... | |
foo(s);
}
};
```
I receive the following error from the gcc compiler:
```
In member function `void C::bar()': no matching function for call to `C::foo(std::string&)' candidates are: int B::foo(int)
```
If I remove `int foo(int i){};` from class `B`, or if I rename it from `foo1`, everything works fine.
What'... | [
-0.07585545629262924,
0.22630447149276733,
0.16816435754299164,
-0.38929852843284607,
-0.1459757536649704,
-0.13614335656166077,
0.3285498023033142,
-0.2690364122390747,
-0.1469402313232422,
-0.19947141408920288,
-0.2801876962184906,
0.7218385934829712,
-0.6084591746330261,
0.1368196904659... | |
in the bass class which aren't intended to override the base class functions as what you are seeing is not usually desirable behaviour. It is usually preferable to give different functions different names.
If you need to call the base function you will need to scope the call by using `A::foo(s)`. Note that this would ... | [
0.44834572076797485,
-0.3375126123428345,
0.07978811115026474,
-0.2362540066242218,
-0.187087744474411,
-0.29787978529930115,
0.2566116452217102,
-0.25421589612960815,
-0.2896936237812042,
-0.21609166264533997,
-0.002533738734200597,
0.8617212772369385,
-0.6298813819885254,
0.3902054429054... | |
There are plenty of script/tools for counting line of code, and some to count functions size in terms of line of code.
But here I'm looking to a way to measure function size in terms of bytes of generated code.
Does anyone know a way/tools to extract this information from a .lib or a .dll?
For example, I know how to... | [
0.2317081242799759,
-0.11004479974508286,
0.20951217412948608,
0.2917358875274658,
-0.1634862720966339,
0.22025153040885925,
-0.019245438277721405,
0.08942136913537979,
-0.3917165994644165,
-0.7939032912254333,
0.036875396966934204,
0.3156385123729706,
0.0006223604432307184,
-0.06013098359... | |
welcome.
Even though I'm not 100% sure if it fulfills your request for user-orientation, I recommend you to have a look at [www.imagemagick.org](http://www.imagemagick.org "ImageMagick"). I have successfully used its "convert" utility for scripting conversion from svg to png and also for adding custom background colors... | [
0.6166427135467529,
-0.14109836518764496,
0.3285287022590637,
0.03071567602455616,
-0.3312755525112152,
-0.0938488021492958,
-0.09371935576200485,
0.4578026533126831,
-0.23457279801368713,
-0.8863549828529358,
-0.14437171816825867,
0.5243436098098755,
0.05441083759069443,
-0.12829802930355... | |
In Visual Studio (C++), is there a way to easily find duplicate headers that are defined in .cpp files?
I'm also trying to find ways to detect this situation:
* A includes B includes C
* A includes C
* => A doesn't need to include C
If you want to detect this situation you could add this macro to the top of every fil... | [
0.47948041558265686,
0.2805711328983307,
-0.06478960812091827,
-0.0014054966159164906,
-0.12362241744995117,
-0.2335445135831833,
-0.17300409078598022,
-0.02496297098696232,
-0.49157246947288513,
-0.5083361268043518,
0.06479476392269135,
0.46310490369796753,
-0.7193762063980103,
-0.1230041... | |
Is it possible to make the text in a TextBox unselectable without disabling the TextBox?
It's a RichTextBox and I need it's formatting and selection features.
I can't disable it because I want to handle MouseMove and MouseDown events.
So far I've thought about disabling the Text box and putting a panel on top of it wh... | [
0.10666599124670029,
-0.07193177938461304,
0.05096897482872009,
0.16729605197906494,
0.06342605501413345,
-0.2656037211418152,
0.32179734110832214,
-0.23523369431495667,
-0.1940804123878479,
-0.529228150844574,
-0.03976843133568764,
0.6840876936912537,
-0.3335167467594147,
-0.0103183388710... | |
all text on focus in WinForms TextBox](https://stackoverflow.com/questions/97459/automatically-select-all-text-on-focus-in-winforms-textbox). | [
-0.14619804918766022,
-0.012583640404045582,
0.6743379831314087,
0.05541819706559181,
0.09256518632173538,
-0.07865045964717865,
0.19170956313610077,
0.021365627646446228,
-0.16470007598400116,
-0.6386193037033081,
-0.68545001745224,
0.8973565101623535,
-0.2870944142341614,
-0.309035718441... | |
My primary motivation for asking this question is [this uservoice suggestion](https://web.archive.org/web/20090413071456/http://stackoverflow.uservoice.com:80/pages/general/suggestions/29462-make-your-software-open-source). Jeff declined the ticket to make the SO software open source saying that it will take more time.... | [
0.4763071537017822,
0.2648335099220276,
0.06164143979549408,
0.19019359350204468,
0.008735875599086285,
-0.2306588590145111,
0.10328608751296997,
-0.05855414643883705,
-0.14241887629032135,
-0.5051055550575256,
-0.09638581424951553,
0.4866240322589874,
0.039590831845998764,
0.3231263160705... | |
trying to be critical of Jeff or anyone else that delays open sourcing their software, I'm not. I just want to get an understanding of the process for open sourcing stuff and its costs.)
The main answer to your question has been given by others - getting the legal permission to do so (see the SO blog entry on [Reverse ... | [
0.5060774087905884,
0.22198046743869781,
-0.12641404569149017,
0.2649657428264618,
-0.06395964324474335,
-0.13747245073318481,
0.1875646561384201,
-0.1032593697309494,
-0.09686717391014099,
-0.2580159306526184,
-0.08099199831485748,
0.5814590454101562,
0.044278472661972046,
0.0186478290706... | |
on Sourceforge and Google Code and be done with it. But there's obviously something that I'm missing in the whole process.
What you describe - dumping the source - is not really Open Source. It is more akin to either AbandonWare or perhaps 'Available Source'. An Open Source project needs to accept inputs from outside,... | [
0.827546238899231,
0.2931012213230133,
-0.3645077645778656,
0.1600208878517151,
-0.37557005882263184,
-0.6221173405647278,
0.35750678181648254,
0.2237156480550766,
-0.07853778451681137,
-0.4062163829803467,
-0.22500069439411163,
0.41609084606170654,
-0.12871180474758148,
0.3036512732505798... | |
both make code available that would otherwise not be available (and provide some of the benefits of Open Source). But there is more to Open Source than that.
Also, there is management overhead in handling a truly Open Source project. That is not negligible.
And, finally, it is not unheard of for the code quality to b... | [
0.20496977865695953,
0.5770485401153564,
-0.45265528559684753,
0.31519606709480286,
-0.0933714359998703,
-0.4092746675014496,
-0.03305147960782051,
0.236872136592865,
-0.16004319489002228,
-0.4590455889701843,
-0.16383299231529236,
1.0174401998519897,
0.04357798397541046,
-0.01567411608994... | |
i want to organize my ebooks. and want to create an air app that would have the list of my ebooks. i want it, that if i click that ebook name. i would launch/call the ebook file. just like double clicking the icon in a folder.
how could i trigger that in flex?
thanks.
also, is it possible that if i saved the page numb... | [
0.5294864177703857,
0.06689099222421646,
0.41290906071662903,
0.35298284888267517,
-0.15192966163158417,
-0.287687748670578,
0.12734834849834442,
-0.24063241481781006,
0.0023329691030085087,
-0.9807261824607849,
-0.07981995493173599,
0.8118584156036377,
-0.1976560652256012,
-0.123434737324... | |
I am looking to make a website and in the future desktop apps as well and i know nothing about db design so what tutorials or books (online preferably) are there? thanks
The double representation of 2.4 - 2.0 is 0.399999999999. When you convert a number to int the decimal part is truncated so 3.999999999 is truncated t... | [
0.27370426058769226,
0.15133269131183624,
0.25500157475471497,
-0.20065440237522125,
-0.5869691371917725,
0.28046923875808716,
0.4390026926994324,
0.09195943921804428,
-0.03212073817849159,
-0.48201417922973633,
0.23250076174736023,
0.4023381173610687,
-0.09380219876766205,
0.0770451426506... | |
I had some time this afternoon to run a head to head comparison between netTiers and SubSonic.
I used code generated using SubStage (part of the SubSonic 2.1 release) and I used RepositoryRecord as my base class.
I ran the same test against the same database using code generated by .netTiers 2.2
The test was a deriv... | [
0.14773990213871002,
0.009071260690689087,
0.27192482352256775,
0.34125691652297974,
-0.15249943733215332,
-0.017125876620411873,
0.3088870644569397,
-0.2890610992908478,
0.03925230726599693,
-0.6536240577697754,
0.8443518280982971,
0.5724964737892151,
0.05764976888895035,
-0.1094738468527... | |
was no more than a one second deviation from these averages.
Is this a question? :)
As long as you steer cleer of the "deep" methods, and use judicial use of custom stored procs, I've always found netTiers performance to be fine. | [
0.12697073817253113,
-0.1791369915008545,
0.2070620208978653,
0.3720281720161438,
-0.16242672502994537,
-0.04769168049097061,
0.28978297114372253,
0.03014608658850193,
-0.2198924720287323,
-0.47569358348846436,
0.2088673710823059,
0.6867910623550415,
0.27051055431365967,
-0.243894666433334... | |
How can I run a CMD or .bat file in silent mode? I'm looking to prevent the CMD interface from being shown to the user.
I have proposed in StackOverflow question a way to [run a batch file in the background (**no DOS windows displayed**)](https://stackoverflow.com/questions/298562)
That should answer your question.
H... | [
0.4390632212162018,
0.011553896591067314,
0.34354421496391296,
-0.22741475701332092,
-0.34484556317329407,
-0.21608301997184753,
0.4467732608318329,
-0.11718994379043579,
-0.2970568835735321,
-0.6444737315177917,
-0.14380955696105957,
0.5833037495613098,
-0.4002228081226349,
0.296933293342... | |
: 0 means "invisible windows"
* bWaitOnReturn : false means your first script does not need to wait for your second script to finish
See the question for the full invis.vbs script:
```
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run """" & WScript.Arguments(0) & """" & sargs, 0, False
... | [
0.37254413962364197,
-0.06628508120775223,
0.3347699046134949,
-0.3278656601905823,
-0.031537048518657684,
-0.0900491401553154,
0.6350249648094177,
-0.1760432869195938,
0.01618880219757557,
-0.4307714104652405,
-0.34464704990386963,
0.5153888463973999,
-0.2726195752620697,
-0.0394705124199... | |
means "invisible window" ---|
```
---
Update after Tammen's feedback:
If you are in a DOS session and you want to launch another script "in the background", a simple `/b` (as detailed in the [same aforementioned question](https://stackoverflow.com/questions/298562)) can be enough:
> You can use **`start /b second... | [
0.35313647985458374,
-0.3256216049194336,
0.02101224660873413,
-0.10069594532251358,
0.024974897503852844,
-0.04851296916604042,
0.2754697799682617,
0.18071101605892181,
-0.20638306438922882,
-0.24115538597106934,
-0.3927569091320038,
0.4138713777065277,
-0.161269873380661,
0.1463092714548... | |
I have a List (Foo) and I want to see if it's equal to another List (foo). What is the fastest way ?
Here are the steps I would do:
1. Do an object.ReferenceEquals() if true, then return true.
2. Check the count, if not the same, return false.
3. Compare the elements one by one.
Here are some suggestions for the meth... | [
0.37428876757621765,
0.10485679656267166,
0.3706684112548828,
0.07632976025342941,
-0.15686263144016266,
0.07650934159755707,
0.12250060588121414,
-0.7537786364555359,
0.04517413303256035,
-0.5994163155555725,
0.5861343145370483,
0.532855749130249,
-0.5014458894729614,
0.12383832037448883,... | |
of the list. | [
0.0027582026086747646,
0.1541612148284912,
0.028921283781528473,
0.07472339272499084,
-0.0690230205655098,
0.002987209940329194,
0.0349782295525074,
-0.019680969417095184,
-0.20134420692920685,
-0.009415395557880402,
0.135014608502388,
0.47276246547698975,
-0.13334912061691284,
0.248084977... | |
Hi i'v look through the WMI class... but none can help me in getting the partition table information... now i'm having a project which is to display the USB thumbdrive's .MBR how should i go about it? really puzzle... Any help and guide will be very much appreciated!
p.s. the code can only be written in C#
**Edit**
... | [
0.6760380268096924,
0.2705933451652527,
0.4465789496898651,
0.183488667011261,
-0.21663327515125275,
-0.21928757429122925,
-0.01977190002799034,
0.3186242878437042,
-0.16259115934371948,
-0.6953809261322021,
0.189936101436615,
0.6363468766212463,
0.11779727041721344,
0.48548585176467896,
... | |
parse the raw information yourself, you can use P/Invoke to call CreateFile. If your user account has enough mojo, you can open the raw disk device by passing it a string, something like `"\\.\PHYSICALDRIVE0"`. See the documentation for CreateFile for more details. | [
0.6273546814918518,
0.18583478033542633,
-0.03620300814509392,
0.1745901107788086,
0.16599653661251068,
-0.2483954131603241,
0.1330176442861557,
0.2345184087753296,
-0.08913157880306244,
-0.649461030960083,
-0.20629052817821503,
0.6359705328941345,
-0.05374997481703758,
-0.0162300169467926... | |
I have now seen 2 methods for determining if an argument has been passed to a JavaScript function. I'm wondering if one method is better than the other or if one is just bad to use?
```
function Test(argument1, argument2) {
if (Test.arguments.length == 1) argument2 = 'blah';
alert(argument2);
}
Test('... | [
0.5364082455635071,
0.2291429191827774,
0.2813661992549896,
-0.2736576199531555,
0.0025213020853698254,
-0.1818751096725464,
0.33342039585113525,
-0.5625913143157959,
0.01005674246698618,
-0.5317677855491638,
-0.24789424240589142,
0.6293438076972961,
-0.3277471959590912,
0.1128579601645469... | |
one before in production.
Another Option as mentioned by [Tom](https://stackoverflow.com/questions/411352/how-best-to-determine-if-an-argument-is-not-sent-to-the-javascript-function#411368):
```
function Test(argument1, argument2) {
if(argument2 === null) {
argument2 = 'blah';
}
alert(argument2);... | [
0.3261799216270447,
-0.05830059573054314,
0.2683340311050415,
-0.031750570982694626,
-0.15310032665729523,
-0.0018162723863497376,
0.17295333743095398,
-0.3661860525608063,
-0.21533671021461487,
-0.28799498081207275,
-0.0697595551609993,
0.5633854866027832,
-0.45576515793800354,
-0.1592005... | |
(original) question - checking `arguments.length` or using the `||` operator to provide default values - one can also explicitly check the arguments for `undefined` via `argument2 === undefined` or `typeof argument2 === 'undefined'` if one is paranoid (see comments).
Using the `||` operator has become standard practic... | [
0.12333326786756516,
-0.16068419814109802,
0.18505634367465973,
0.15956337749958038,
0.11553137749433517,
-0.4933048188686371,
0.3422843813896179,
-0.11977949738502502,
-0.08242985606193542,
0.0513506755232811,
-0.25680217146873474,
0.9276052713394165,
-0.20947512984275818,
-0.024608632549... | |
slightly different results.
Checking `arguments.length` exhibits the 'most correct' behaviour, but it might not be feasible if there's more than one optional argument.
The test for `undefined` is next 'best' - it only 'fails' if the function is explicitly called with an `undefined` value, which in all likelyhood shou... | [
-0.020169051364064217,
-0.06494839489459991,
0.077330082654953,
-0.19680166244506836,
-0.048821691423654556,
-0.056724026799201965,
0.5249574780464172,
-0.2821744978427887,
0.006887733470648527,
-0.3926851749420166,
-0.35779476165771484,
0.7942073941230774,
-0.1403217911720276,
-0.24188344... | |
also the way to go if there's more than one optional argument and one doesn't want to pass an object literal as a workaround for named parameters.
Another nice way to provide default values using `arguments.length` is possible by falling through the labels of a switch statement:
```
function test(requiredArg, optiona... | [
0.021496113389730453,
-0.5436034202575684,
0.2873799502849579,
-0.09252103418111801,
0.06067213416099548,
-0.07494325190782547,
0.3000139594078064,
-0.3577824532985687,
0.0384097546339035,
-0.3573988676071167,
-0.37871548533439636,
0.754417359828949,
-0.07780175656080246,
-0.24831694364547... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.