text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
This question has been in my mind for a few years and I never actually found the answer for this.
What I would like to do is extract the actual waveform/PCM of an MP3 file, so that I can play it using the soundcard (of course).
Ideally I would be experimenting some DSP effects.
My first step was to look into LAME, b... | [
0.4298836886882782,
0.18074877560138702,
0.16249807178974152,
0.20819704234600067,
0.14995582401752472,
-0.09772523492574692,
-0.12926985323429108,
0.07485879212617874,
-0.33366942405700684,
-0.29431748390197754,
0.4130726158618927,
0.8518307209014893,
-0.18609297275543213,
0.0764638856053... | |
that would do the job more efficiently.
Thanks!
Guillaume.
The question boils down to: what are you trying to accomplish?
From the description of your question of decoding an MP3 and playing it on the sound card makes it sounds as if you are trying to make a media player.
However, if your intent is to play around w... | [
0.3618422746658325,
-0.11546716839075089,
0.048666391521692276,
0.43271467089653015,
0.1495976448059082,
-0.12764735519886017,
0.24219314754009247,
-0.4626930058002472,
-0.24891793727874756,
-0.586677610874176,
-0.1043359786272049,
0.8496721386909485,
0.07508669048547745,
-0.29088291525840... | |
to accomplish.
Frankly, learning to write your own decoder from scratch is not just a programming problem but a mathematical one, so using existing libraries are the way to go. Talking to the operating system or libraries like DirectSound to output audio seems like unnecessary work if anything. I feel that working on ... | [
0.5105717778205872,
0.1469486504793167,
-0.0339953675866127,
0.32763171195983887,
0.2956695556640625,
-0.06973467767238617,
0.1831679344177246,
-0.27741479873657227,
-0.3069444000720978,
-0.6333743333816528,
0.09732736647129059,
0.77699214220047,
-0.1117551252245903,
-0.181304931640625,
... | |
language of your choice would accomplish your goal of dealing with effects with sound.
The language choice is going to depend on whether you are going to interact directly with MP3 decoding libraries, or whether you can just use raw audio input, which would allow you to use pretty much any language of your choice.
Th... | [
0.12429563701152802,
-0.10660608112812042,
0.21372905373573303,
0.04724535346031189,
-0.25718921422958374,
0.1841529756784439,
0.21226365864276886,
-0.03507509455084801,
-0.22952261567115784,
-0.38740503787994385,
-0.004803108051419258,
0.7104014754295349,
-0.26539525389671326,
-0.34133717... | |
SQL Server 2005 is giving me the following error during the "System Check" portion of the initial install: "The SQL Server Configuration Checker cannot be executed due to WMI configuration on the machine Error:2147749907 (0x80041013)."
Machine is a Dell D620 running XP SP2.
I found a batch command online that is sup... | [
-0.3259662687778473,
0.17837786674499512,
0.3415800631046295,
-0.01580401323735714,
0.0938481017947197,
-0.4052818715572357,
0.3952917754650116,
-0.2235131710767746,
-0.08004063367843628,
-0.268498033285141,
-0.041200652718544006,
0.5854344964027405,
-0.3682413399219513,
0.0937026515603065... | |
%windir%/system32. As the installer would stop and ask for a file I would search around until I found a copy.
Manju found the answer online and documents it on her [blog](http://manjumadhavan.blogspot.com/2009/04/wmi-failed-to-connect.html). | [
0.07310854643583298,
-0.18228591978549957,
0.11812791973352432,
-0.19224576652050018,
0.08661233633756638,
0.17472214996814728,
0.36943891644477844,
-0.4511817395687103,
0.13264723122119904,
0.018562978133559227,
-0.06974820792675018,
0.09448213130235672,
-0.041071973741054535,
0.511412620... | |
Does anyone know where I can find a discussion on how type inference works when using Generics in Java.
This is originally specified in [Section 15.12.2.7 of the Java Language Specification](http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#341287), as a result of the [Java Specification Requests #... | [
0.18015742301940918,
0.018689453601837158,
0.12074574083089828,
-0.13024641573429108,
-0.4123488664627075,
-0.1401037573814392,
0.13885430991649628,
-0.17352105677127838,
-0.3625929057598114,
-0.1835860013961792,
0.30265599489212036,
0.11072355508804321,
-0.32681843638420105,
0.08609423786... | |
I'm hosting a website on Zymic (free host) that utilizes MySQL. I opened an account, and wrote the SIMPLEST function to connect to the DB. It looks like this:
```
<?php
$conn = mysql_connect("uuuq.com","paulasplace_sudo","mypassword");
if(!$con)
{
die("Could not connect: " . mysql_error());
}
... | [
0.3920641243457794,
0.4014275372028351,
0.44320619106292725,
-0.24406692385673523,
0.01178206130862236,
0.05459602177143097,
0.5870603919029236,
-0.2802272140979767,
0.03058173879981041,
-0.5106943249702454,
0.22353006899356842,
0.30769649147987366,
-0.27095451951026917,
0.4720689952373504... | |
111 in /www/uuuq.com/p/a/u/paulasplace/htdocs/index.php on line 9
Could not connect: Lost connection to MySQL server at 'reading initial communication packet', system error: 111
Any ideas what might be wrong?
This may be just from when you copied the code into your post, but you store the results of mysql\_connect() i... | [
0.3800037205219269,
0.11896342039108276,
0.45492875576019287,
-0.037186939269304276,
0.07920175790786743,
0.27682405710220337,
0.5308672785758972,
0.14522472023963928,
-0.23296454548835754,
-0.31661099195480347,
0.33377087116241455,
-0.010439736768603325,
-0.39166462421417236,
-0.064697347... | |
I have a SW that the minimal screen size requirement is 1024x768, 800x600 may be too small, 1024x768 would be too big? Maybe something in between? What screen size is better or the best? Thanks.
Are you asking what size you should design your application for?? If so, the best "size" would be a flowing layout that allow... | [
0.25085678696632385,
-0.07991179823875427,
0.3011499047279358,
0.0511280819773674,
0.11014662683010101,
0.1357450932264328,
-0.114176906645298,
0.272163450717926,
-0.31271445751190186,
-1.000996470451355,
0.16873084008693695,
0.6416268944740295,
-0.15871785581111908,
0.17173480987548828,
... | |
```
std::vector< std::vector<coords> >::iterator iter;
for(iter = characters.begin(); iter != characters.end(); iter++)
{
std::vector<coords>* cha = iter; // doesn't work.
}
// does work.
std::vector<coords>* character = &characters.at(0);
coords* first = &character->at(0);
```
And I don't get why. Isn't iter s... | [
-0.1495562195777893,
0.14390605688095093,
0.24088183045387268,
-0.09753867238759995,
0.02311614528298378,
0.15685012936592102,
0.12736360728740692,
-0.16432592272758484,
-0.23213165998458862,
-0.4814363121986389,
-0.3051224648952484,
0.5574416518211365,
-0.41107797622680664,
0.124419420957... | |
and `operator->()`. It doesn't have to be a pointer.
So use `&*iter` if you want to get the address of the vector. | [
0.024753382429480553,
-0.30884885787963867,
0.1484859436750412,
-0.03421536833047867,
-0.0453958697617054,
-0.0928516611456871,
-0.06299233436584473,
0.1640482395887375,
0.06286844611167908,
-0.5442782640457153,
-0.06957521289587021,
0.5904520750045776,
-0.33819571137428284,
-0.20955491065... | |
Is there a way to get a value I am storing in a Master Page hidden field from a User Class which I created and placed in the App\_Code folder of my ASP.Net 2.0 Application?
Some examples would preferably in VB.Net is highly appreciated.
Thanks.
To give further details, assume the following:
MasterPage.Master
Master... | [
0.2895098626613617,
-0.006984807085245848,
-0.07983805239200592,
0.280631422996521,
0.020797422155737877,
0.08837631344795227,
0.3456968069076538,
-0.11631555110216141,
-0.11748103052377701,
-0.6136065721511841,
0.10764121264219284,
0.4351143538951874,
-0.007070814725011587,
-0.11777877807... | |
take note that TestClass is NOT a user control but a user defined class, which contains some Business-Specific logic which is accessed by myPage.aspx.vb.
I tried ScarletGarden's suggestion but it did not seem to get the Masterpage Hiddenfield which I need to get the value.
Would something like this work?
```
((Hidden... | [
0.5232227444648743,
-0.253493994474411,
-0.2513403296470642,
0.15394170582294464,
-0.051541272550821304,
-0.23502114415168762,
0.5180724859237671,
-0.06970822066068649,
0.28538787364959717,
-0.5635024309158325,
0.186849445104599,
0.3194299638271332,
-0.12427205592393875,
0.1362936347723007... | |
I'm working on an iPhone game, and trying to use a UIScrollView to display some icons, which I then want to enable the user to drag off the bar being scrolled, onto another view (basically, dragging them from their hand into play on the game board). The problem is that the UIScrollView clips everything outside it's own... | [
0.4319162666797638,
-0.16042178869247437,
0.3406180441379547,
-0.13918046653270721,
0.05175920948386192,
0.028730075806379318,
-0.09726278483867645,
-0.047555115073919296,
-0.532529354095459,
-0.7016898989677429,
0.42201611399650574,
0.42227548360824585,
-0.15548640489578247,
-0.0348591618... | |
can temporarily disable the clipping that a scroll view does, or is there some way to get around it? Hacky or not, I would really like to make it happen.
Does anyone have any other possible solutions for this? Or maybe any alternate approaches? I've considered if maybe a page view might work, but haven't tried it yet.... | [
0.6081900596618652,
0.07317212224006653,
0.31516921520233154,
0.338075190782547,
0.09436438977718353,
-0.15844130516052246,
0.4547863006591797,
0.29266881942749023,
-0.1490640491247177,
-0.5170412063598633,
0.28101620078086853,
0.5451452732086182,
-0.028926212340593338,
-0.0318302623927593... | |
about that.
I think you're looking for the clipsToBounds property of UIView. I've used it successfully with UIScrollView:
```
scrollView.clipsToBounds = NO;
```
However, the dragging you want to do from the scroll view to the game view may require you to remove the icon view from the scroll view, place it in the sup... | [
-0.0030913716182112694,
-0.294715940952301,
0.9166263937950134,
0.005496102850884199,
0.16333933174610138,
0.024197520688176155,
-0.04394639655947685,
-0.15356461703777313,
-0.16330327093601227,
-0.7505106925964355,
0.20933781564235687,
0.9048754572868347,
-0.05591150373220444,
-0.08765695... | |
the scroll view. | [
-0.04124510660767555,
-0.05151906609535217,
0.20886731147766113,
0.08910800516605377,
-0.19322071969509125,
-0.1353157013654709,
0.03988860547542572,
0.293777197599411,
-0.23005399107933044,
-0.34310096502304077,
0.033836282789707184,
0.39451712369918823,
0.0709904283285141,
0.165166467428... | |
How can I recognize when a user has missed a space when entering a search term? For example, if the user enters "usbcable", I want to search for "usb cable". I'm doing a REGEX search in MySQL to match full words.
I have a table with every term used in a search, so I know that "usb" and "cable" are valid terms. Is ther... | [
0.1072562113404274,
-0.01973089575767517,
0.27082374691963196,
0.06709911674261093,
0.048181887716054916,
-0.294443279504776,
0.007645460311323404,
0.08582453429698944,
0.056425511837005615,
-0.9366427659988403,
-0.02856244519352913,
0.5250581502914429,
-0.16905774176120758,
0.340286344289... | |
ideas?
[Text Segmentation](http://en.wikipedia.org/wiki/Text_segmentation) is a part of [Natural Language Processing](http://en.wikipedia.org/wiki/Natural_language_processing), and is what you're looking for in this specific example. It's used in search engines and spell checkers, so you might have some luck with examp... | [
0.42793095111846924,
-0.05342165008187294,
-0.09267836064100266,
0.24276752769947052,
0.12721212208271027,
0.05421363189816475,
-0.12290089577436447,
0.10665253549814224,
-0.5199901461601257,
-0.2684839367866516,
-0.28466376662254333,
-0.0886164978146553,
-0.0849883034825325,
-0.0733522400... | |
Problem: I have a developers machine (read: fast, lots of memory), but the user has a users machine (read: slow, not very much memory).
I can simulate a slow network using Fiddler (<http://www.fiddler2.com/fiddler2/>)
I can look at how CPU is used over time for a process using Process Explorer (<http://technet.microso... | [
-0.18963150680065155,
0.21398356556892395,
0.11548350006341934,
0.11350656300783157,
0.12115401774644852,
0.18523919582366943,
0.20351526141166687,
-0.0759759172797203,
-0.412537544965744,
-0.6813390851020813,
0.3025763928890228,
0.6364259719848633,
-0.13646093010902405,
0.1867826581001281... | |
bit lighter.
I'm using Windows XP, but a solution for any Windows machine would be welcome. Thanks.
The platform SDK used to come with stress tools for doing just this back in the good old days (`STRESS.EXE`, `CPUSTRESS.EXE` in the SDK), but they might still be there (check your platform SDK and/or Visual Studio insta... | [
0.2753162384033203,
0.18696974217891693,
0.09073296934366226,
0.35562223196029663,
-0.1743963658809662,
0.06688171625137329,
0.19787441194057465,
-0.1345599740743637,
-0.37430575489997864,
-0.8711726069450378,
0.008873354643583298,
0.7526880502700806,
0.1903150975704193,
-0.252458453178405... | |
(GDI, User): reliability (e.g. handling failed GDI resource allocation): ??? may have to write your own, but running out of GDI handles (buggy GTK apps would usually eat them all away until all other apps on the system would start falling dead like flies) is a real test for any Windows app
* **disk**: performance & rel... | [
-0.06508083641529083,
0.15157450735569,
0.19701020419597626,
0.2249009609222412,
-0.16971440613269806,
-0.043468769639730453,
0.37515488266944885,
-0.31379586458206177,
-0.06863760948181152,
-0.5310410857200623,
-0.34066811203956604,
0.6996119618415833,
-0.010984156280755997,
-0.3523772358... | |
I got a Java Swing GUI and got a problem with a `JTable` in a `JScrollPane`. For some reason, when the rows of the table model are increased during the program execution, the `JScrollPane` isn't updated - that is, if the rows are increased so that the height of the table is over the height of the scroll view, the scrol... | [
0.003963598981499672,
-0.008115768432617188,
0.5085181593894958,
-0.11836923658847809,
-0.1458193063735962,
-0.08350442349910736,
0.29146063327789307,
-0.22295652329921722,
-0.35306864976882935,
-0.5217215418815613,
0.08617980778217316,
0.8077465295791626,
-0.2678484618663788,
-0.110549241... | |
complex so I can't provide an code sample causing the problem. But thought to ask if somebody got some ideas straight..
**EDIT:** Still a bit more confusing : horizontal scrolling policy is `HORIZONTAL_SCROLLBAR_AS_NEEDED`, and if the table width if over the view width (that is, the horizontal scrollbar is used), this... | [
-0.11878040432929993,
0.14500124752521515,
0.6311751008033752,
-0.04608844593167305,
-0.146650031208992,
-0.11770086735486984,
0.2511943578720093,
-0.015236740931868553,
-0.40847113728523254,
-0.7357487678527832,
0.20473001897335052,
0.8238105773925781,
-0.27593597769737244,
0.090074218809... | |
I need to access the DOM tree and get the elements just 1 level below the current element.
Read the following code:
```
<div id="node">
<div id="a">
<div id="aa">
<div id="ab">
<div id="aba"></div>
</div>
</div>
</div>
<div id="b"> | [
0.009101775474846363,
0.12399757653474808,
0.28992760181427,
-0.38397642970085144,
0.1014680415391922,
0.1116924062371254,
0.26011496782302856,
-0.8053298592567444,
0.09875041246414185,
-0.47568944096565247,
0.03917583078145981,
0.490974098443985,
-0.23289085924625397,
0.13539238274097443,... | |
<div id="ba">
<div id="bb">
<div id="bba"></div>
</div>
</div>
</div>
<div id="c">
<div id="ca">
<div id="cb"> | [
0.5097269415855408,
0.3792817294597626,
-0.17355099320411682,
-0.36587733030319214,
-0.28761225938796997,
0.19803890585899353,
-0.11916839331388474,
-0.2598947286605835,
-0.35964861512184143,
-0.09454324841499329,
-0.33382102847099304,
0.15805833041667938,
-0.4608730971813202,
0.2764326333... | |
<div id="cba"></div>
</div>
</div>
</div>
</div>
```
I want to get the 3 elements "a", "b", "c" under "node". What should I do?
var nodes = node.getElementsByTagName("div") <---- I get all the divs but not the 3 divs I need.
var nodes = node.childNodes; <---- works in IE, but FF contains Tex... | [
0.14907757937908173,
0.0686335414648056,
0.38535431027412415,
-0.039909638464450836,
0.3399386703968048,
0.2511841058731079,
0.4218899607658386,
-0.5617607235908508,
-0.09722617268562317,
-0.775874674320221,
-0.1642211377620697,
0.2633149027824402,
-0.340806782245636,
0.04253440350294113,
... | |
child in node.childNodes) {
if(node.childNodes[child].nodeType == 1) {
children.push(child);
}
}
return children;
}
``` | [
-0.33798572421073914,
-0.22287774085998535,
0.4197370409965515,
-0.254745751619339,
0.5974334478378296,
0.3658961057662964,
0.15071401000022888,
-0.19128485023975372,
-0.16815443336963654,
-0.7582417726516724,
-0.35759204626083374,
0.03554195165634155,
-0.21572603285312653,
0.5254204273223... | |
I'm a bit rusty on my Windows system programming...
Is it possible for a program to send a keystroke (I'm guessing by `SendMessage()` api call) to another application, if the (open) target application does not currently have the focus? If it is possible, does it then make the target application become the active appli... | [
0.0916641354560852,
0.14455115795135498,
0.2265402376651764,
0.10278529673814774,
0.38058772683143616,
-0.12009339779615402,
0.28626134991645813,
0.20992933213710785,
-0.3835766315460205,
-0.5952700972557068,
-0.5075883865356445,
0.5350112915039062,
-0.24801574647426605,
0.1168978884816169... | |
Having some problems figuring out the regex to match this:
```
function Array() { [native code] }
```
I'm trying to only match the text that will occur where "Array" is.
Are you trying to find out what type a variable is in javascript? If that's what want you can just compare the object's constructor to the construc... | [
0.26734063029289246,
0.10482874512672424,
0.24375222623348236,
-0.19782330095767975,
-0.3878210186958313,
-0.20316453278064728,
0.2821672260761261,
-0.3106715977191925,
-0.18197758495807648,
-0.6509710550308228,
0.04106740280985832,
0.74797523021698,
-0.5079600214958191,
-0.165675640106201... | |
that a variable will have certain members if it's created by a certain constructor because javascript is a pretty dynamic languages and anything that an object gets from its constructor can be overwritten at runtime.
Instead it's really better to use duck typing and ask your objects what they can do rather than what ... | [
0.16314736008644104,
-0.20447221398353577,
0.01977296732366085,
0.025878755375742912,
-0.04524419456720352,
-0.12425781786441803,
0.02486100047826767,
-0.25860410928726196,
-0.31398510932922363,
-0.15186065435409546,
-0.14791028201580048,
0.2867065966129303,
-0.5291986465454102,
0.07808336... | |
I have a application which I suspects to get into problems because network nodes closes its sockets to various other servers it communicates to.
I would like to mimic that behaviour by shutting down one or severel connections that can be seen in netstat.
I'm not an expert in networking on OS level, so this question may... | [
0.42749303579330444,
-0.07482817023992538,
0.23274892568588257,
0.049906861037015915,
0.0424196794629097,
-0.3898165225982666,
0.3180501163005829,
0.11370976269245148,
-0.45492061972618103,
-0.5265052914619446,
0.1594712734222412,
0.5238903760910034,
-0.4769344925880432,
0.0545464530587196... | |
whether one of the server(s) is sending you a `RST` or not.
If you are receiving `RST` then this may be due to the servers themselves (time-outing and closing the connection while waiting for you to send them a response or data, or closing the connection because of server bugs or load limits), to your ISP's network eq... | [
-0.0993850827217102,
-0.23111113905906677,
0.4743720293045044,
0.17838798463344574,
0.11014409363269806,
-0.29600366950035095,
0.5285001993179321,
0.02727162092924118,
-0.5592178702354431,
-0.12687043845653534,
-0.4615452289581299,
0.4231303930282593,
-0.6678465008735657,
0.373453617095947... | |
network cable should simulate a forceful closing of the connection with `RST`, whereas disconnecting a cable between you and the internet, but not the cable that directly connects your PC (e.g. disconnecting the cable between your router and your cable/DSL modem, or disconnecting the cable/DSL modem from the cable comp... | [
-0.08296924829483032,
-0.32883405685424805,
0.4312257170677185,
0.19360384345054626,
0.3529033660888672,
-0.4692308008670807,
0.19311603903770447,
0.13976554572582245,
-0.29394423961639404,
-0.5733749270439148,
-0.508136510848999,
0.5474127531051636,
-0.17834775149822235,
0.147539988160133... | |
I am running a user mode program on normal priority. My program is searching an NP problem, and as a result, uses up a lot of memory which eventually ends up in the swap file.
Then my mouse freezes up, and it takes forever for task manager to open up and let me end the process.
What I want to know is how I can stop m... | [
0.3520927131175995,
0.18179742991924286,
0.06488602608442307,
0.1954180896282196,
0.24978390336036682,
-0.2271585911512375,
0.5005177855491638,
0.1012069582939148,
-0.2509419322013855,
-0.5856003165245056,
-0.15450096130371094,
0.3205103576183319,
-0.2025764286518097,
0.25392234325408936,
... | |
it just doesn't make sense to me that the whole OS should lock up.
The problem is that when another program (e.g. explorer.exe) is going to execute, all of its code and memory has been swapped out. To make room for the other program Windows has to first write data that your program is using to disk, then load up the ot... | [
0.17549727857112885,
0.16999907791614532,
0.24808017909526825,
0.09253200888633728,
0.3591875731945038,
-0.12725016474723816,
0.23709474503993988,
0.2607698142528534,
-0.23848772048950195,
-0.6805264949798584,
-0.19736933708190918,
0.3612140417098999,
-0.4133705198764801,
0.396034151315689... | |
pages a lot in a random fashion, which makes the problem worse because as soon as Windows evicts a memory page from your program, suddenly you need it again and Windows has to find some other page to give the same treatment.
To give other processes more RAM to live in, you can use [SetProcessWorkingSetSize](http://msd... | [
0.529045820236206,
-0.09695515781641006,
0.1910657286643982,
0.48139292001724243,
0.08401098847389221,
0.050727151334285736,
0.08350052684545517,
-0.19665756821632385,
-0.5002379417419434,
-0.6888730525970459,
-0.08027186244726181,
0.3312055766582489,
-0.4754648506641388,
0.313878953456878... | |
over those. You may have a dual-core CPU, but you have only a single drive. Distributing the swap file over multiple drives allows Windows to balance work across them (although I don't have first-hand experience of how well it does this). | [
0.4330800473690033,
-0.24903906881809235,
0.16700458526611328,
0.42304253578186035,
0.07612688839435577,
-0.03720938414335251,
-0.4476810693740845,
0.11852175742387772,
-0.3905467092990875,
-0.7798541784286499,
-0.08183468878269196,
0.6864698529243469,
-0.06092791259288788,
0.0210920795798... | |
if you have an entity which is reference in the client and a webservice like this
```
public class Post
{
public int ID {get; set;}
string Data {get; set;}
}
public class MyService: System.Web.Services.WebService
{
[WebMethod]
public int Write (Post post)
{
... | [
0.46552345156669617,
-0.02783764898777008,
0.33172890543937683,
0.20265479385852814,
0.1582927405834198,
-0.025325175374746323,
0.11717298626899719,
-0.19360819458961487,
-0.07708068937063217,
-0.9236071705818176,
-0.17727869749069214,
0.28517886996269226,
-0.2944592535495758,
0.4437714517... | |
stuff
}
}
```
on the client in order to use the entity you to instantiate from the proxy class
```
public void ClientMethod()
{
var post = new proxyclass.Post();
//fill post
new ProxyClass.Myservice().Write(post)
}
```
how can i use my domain entity to call t... | [
0.2891005277633667,
0.1270643025636673,
0.6405351161956787,
-0.07445333153009415,
0.2403009980916977,
-0.26339200139045715,
0.30036604404449463,
0.09568950533866882,
-0.23949185013771057,
-0.6888863444328308,
-0.13136187195777893,
0.3366145193576813,
-0.3718673288822174,
0.5300262570381165... | |
{
var post = new Post();
//fill post
new ProxyClass.Myservice().Write(post)
}
```
Basically, you can't - with regular web-services, at least... the proxy class is completely separate. However, the above *is* possible with WCF, where you don't actually need proxy clas... | [
0.21796444058418274,
0.06339770555496216,
0.38563814759254456,
0.03547028824687004,
-0.03699277713894844,
-0.33421897888183594,
0.5748780369758606,
0.024333050474524498,
0.14055591821670532,
-0.8701118230819702,
-0.09904906153678894,
0.21640987694263458,
-0.2247156947851181,
0.484538584947... | |
could use reflection (etc) to copy the properties *between* your domain entities and the proxies, but it is quite hard to get this 100% right (although xml serialization should work [in theory] as an intermediate language).
---
So; if you want to use assembly sharing; consider using WCF, which supports this ;-p
To g... | [
0.45170190930366516,
-0.36097320914268494,
0.40264004468917847,
0.23172327876091003,
0.041207585483789444,
-0.22111932933330536,
0.2577621340751648,
-0.24883311986923218,
-0.14895276725292206,
-0.8077110052108765,
0.041711702942848206,
0.7193896174430847,
-0.2857741117477417,
0.03839035332... | |
add a few constructor overloads matching to the base constructor overloads)
Then:
```
interface IFoo {void Bar();}
...
using(WcfClient<IFoo> client = new WcfClient<IFoo>()) {
client.Service.Bar();
}
``` | [
0.015522153116762638,
0.09984803199768066,
0.9693533778190613,
-0.36482998728752136,
0.04920801520347595,
0.15211768448352814,
0.3760276436805725,
-0.4516998827457428,
-0.015555583871901035,
-0.8756177425384521,
-0.17537322640419006,
0.6328631639480591,
-0.7183734774589539,
0.2490423619747... | |
I am working on a lib that I want to release in open source. I have started writing the tests for the code, and I was wondering how I am suppose to test a property in a .Net object. Lets say I have the following:
```
public class Person{
#region variables
private string _name = String.Empty;
private strin... | [
0.04187941923737526,
-0.3249640166759491,
0.12247192114591599,
-0.01918380707502365,
0.24251054227352142,
-0.12878139317035675,
0.19713091850280762,
-0.05424553155899048,
0.021057788282632828,
-0.8338487148284912,
-0.34505027532577515,
0.22003509104251862,
0.12463892996311188,
0.3848143219... | |
_name;
}
}
public string Surname{
get{
return _surname;
}
set{
_surname = value;
}
}
}
```
I have two questions related to the code:
1. How do I Unit test a Property that just has a | [
0.39277681708335876,
0.037393249571323395,
-0.1689625233411789,
0.07860581576824188,
0.024622252210974693,
-0.18550308048725128,
0.2685777246952057,
-0.45473676919937134,
0.22572185099124908,
-0.624809205532074,
-0.060494564473629,
0.4373863637447357,
0.05138222128152847,
0.197715952992439... | |
getter (Like Name in the example)
2. How do I Unit test a Property with a setter and a getter (Like Surname in the example)
I want to test properties that are that simple because I have already found errors in other code were Itellinsense did the wrong autocomplete and the property was not returning the correct variab... | [
-0.11190494149923325,
-0.03453797847032547,
-0.19889183342456818,
0.24032777547836304,
-0.2895612418651581,
-0.19288219511508942,
0.38438209891319275,
-0.41821232438087463,
0.14159049093723297,
-0.49176719784736633,
-0.22223877906799316,
0.6417712569236755,
-0.28124263882637024,
-0.3219068... | |
if there is a fail I won't know which method to blame. I am using properties because they were added as public variables and later more logic had to be added.
> How do I Unit test a Property that
> just has a getter (Like Name in the
> example)
Really not so different from testing if you had a setter. you'll just ne... | [
0.1602117121219635,
-0.1260196417570114,
-0.013286023400723934,
0.00603157514706254,
0.023611146956682205,
-0.03403884172439575,
0.4717315137386322,
-0.36220383644104004,
0.004223199561238289,
-0.460553914308548,
-0.13985377550125122,
0.5982248783111572,
-0.1815384328365326,
0.342166572809... | |
here that will set up the Person object
// so that you know what the name will be
Assert.AreEqual("some known value...", p.Name);
}
```
If we had setters for Name and SurName, but only a getter for FullName, the test could look like this:
```
[Test]
public void NamePropTest()
{
Person p = new Person();... | [
-0.23057280480861664,
-0.1064368486404419,
-0.06678715348243713,
-0.08168632537126541,
0.25699394941329956,
0.203245609998703,
0.26995229721069336,
-0.22557899355888367,
0.187839537858963,
-0.4012419879436493,
-0.31094685196876526,
0.5825315117835999,
-0.0392245277762413,
0.031122790649533... | |
I know this is simple, but I haven't used Zend\_Gdata before, so I need some guidance. Please correct me if any of my assumptions are incorrect.
I am using Google Apps on my domain, so to get started, I would like to do something simple like listing all the users on the domain.
From what I understand, you need to use... | [
0.1936909556388855,
0.2009347379207611,
0.6257554888725281,
-0.07957303524017334,
-0.04643215611577034,
-0.1964293122291565,
0.2171531319618225,
0.1064562201499939,
-0.289743036031723,
-0.8117592930793762,
-0.20347070693969727,
0.6468788385391235,
-0.46708881855010986,
0.09370535612106323,... | |
<HEAD> <TITLE>Token invalid</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1>Token invalid</H1> <H2>Error 401</H2> </BODY> </HTML>
```
What does that mean? What am I doing wrong? I don't know if it matters, but I am running this PHP script locally, but my Google Apps are running on a remote server. I am us... | [
0.4778945744037628,
0.3221612870693207,
0.6321980953216553,
-0.12148880958557129,
-0.17395734786987305,
-0.10578566789627075,
0.5757664442062378,
-0.3639565706253052,
0.09234057366847992,
-0.6971994042396545,
0.16163064539432526,
0.5175028443336487,
0.02035747841000557,
-0.1390147805213928... | |
standard (free) version of Google Apps, which means that the Provisioning API is not available to me unless I have a premier (paid) version of Google Apps.
You're missing the service parameter, for Google Apps it's `'apps'`
```
$client = Zend_Gdata_ClientLogin::getHttpClient('admin@mydomain.com', 'password','apps');
... | [
0.5742680430412292,
0.19958065450191498,
0.6419095396995544,
0.1629081815481186,
0.07865066826343536,
-0.12629148364067078,
0.28744858503341675,
-0.07463247328996658,
-0.23185968399047852,
-0.6703801155090332,
-0.432485431432724,
0.7799934148788452,
-0.5140612125396729,
-0.0813894495368003... | |
Having read all the StackOverflow entries regarding **Model-View-ViewModel architecture** along with most of the readily available resources on the net I have come to the conclusion that it is the de-facto standard for building **SOLID** Silverlight apps.
I started to plan my next application using this architecture... | [
0.7285646796226501,
0.22256577014923096,
0.6209569573402405,
-0.07173848897218704,
-0.024186810478568077,
-0.017798786982893944,
-0.026758521795272827,
-0.24251100420951843,
-0.46913087368011475,
-0.6960856318473816,
0.24731118977069855,
0.39292657375335693,
-0.3372141122817993,
-0.0391400... | |
pattern and think where the code responsible for attaching the new components should go. I concluded that it doesn't belong to any of the MVVM layers and therefore it is impossible to apply this architecture in scenarious where you have to manipulate the component tree at runtime.
Is there a way to still use **Model... | [
0.33128756284713745,
-0.5189095139503479,
0.21710409224033356,
0.1323501318693161,
0.08203885704278946,
-0.0730673149228096,
0.11517897993326187,
-0.26703158020973206,
-0.3749011754989624,
-0.9978498816490173,
0.26699453592300415,
0.5636604428291321,
-0.5003754496574402,
-0.061480458825826... | |
model to produce its visuals.
What follows is a really simplified example. **It just shows the concepts - please don't take it as indicative of how you should factor your code.**
First, my model:
```
public abstract class Shape
{
public double Left { get; set; }
public double Top { get; set; }
}
public clas... | [
0.46971699595451355,
-0.3059595823287964,
0.37636834383010864,
0.09777230769395828,
-0.10288318991661072,
0.364543616771698,
-0.014409460127353668,
-0.3108137249946594,
-0.2171768993139267,
-1.0864602327346802,
0.14484171569347382,
0.4025697708129883,
-0.31504109501838684,
0.21502852439880... | |
in my view:
```
<Window x:Name="_root" x:Class="WpfApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfApplication1"
Title="Window1" Height="300" Width="300">
<Window.Resources>
... | [
-0.41701942682266235,
0.08055805414915085,
0.6883402466773987,
-0.21375855803489685,
-0.15965332090854645,
0.1437682807445526,
-0.2905774712562561,
-0.5076823830604553,
-0.3763826787471771,
-0.4691706895828247,
-0.22989310324192047,
0.3306604027748108,
0.18302498757839203,
0.00282089528627... | |
<Canvas/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerStyle>
<Style>
<Setter Property="Canvas.Left" Value="{Binding Left}"/>
<Setter Property="Canvas.Top" Value="{Binding Top}"/>
</Style> | [
-0.04299147054553032,
-0.40871569514274597,
0.2567608058452606,
-0.06396012753248215,
-0.29592165350914,
0.18911129236221313,
-0.08467976003885269,
-0.4698944389820099,
-0.5534273982048035,
-0.6007739305496216,
-0.07759782671928406,
0.09122135490179062,
0.10123886913061142,
-0.122285239398... | |
</ItemsControl.ItemContainerStyle>
</ItemsControl>
</Window>
``` | [
-0.12316392362117767,
-0.037657480686903,
0.3182360827922821,
0.20197968184947968,
-0.24366119503974915,
0.16139884293079376,
0.11585230380296707,
0.18406687676906586,
-0.4015931189060211,
-0.5871290564537048,
-0.39776524901390076,
0.20219188928604126,
-0.09076140075922012,
0.2425739467144... | |
I received an `NSString` from the server. Now I want to split it into the substring which I need.
How to split the string?
For example:
substring1:read from the second character to 5th character
substring2:read 10 characters from the 6th character.
You can also split a string by a substring, using NString's [compo... | [
0.18981358408927917,
-0.004678886849433184,
0.16979244351387024,
-0.13002686202526093,
-0.10917378962039948,
0.4172389507293701,
0.14591047167778015,
-0.21407289803028107,
-0.5503562688827515,
-0.4705161452293396,
-0.2745310068130493,
0.3327603340148926,
-0.3728736340999603,
0.078178532421... | |
Is it possible to use hibernate as Glassfish's persistence provider and if so HOW?
While I'm not an expert on either Glassfish or Hibernate, I think you'd probably find this interesting: [Instructions on using Hibernate in Glassfish](http://www.hibernate.org/374.html) | [
0.6090666651725769,
-0.279264897108078,
0.21338137984275818,
0.3226456344127655,
0.018521470949053764,
-0.10746648907661438,
0.4920746088027954,
0.12269212305545807,
-0.04448363557457924,
-0.3069520592689514,
0.26181864738464355,
0.3771776556968689,
-0.2831660211086273,
-0.0461633615195751... | |
Consider this code:
```
#include <vector>
void Example()
{
std::vector<TCHAR*> list;
TCHAR* pLine = new TCHAR[20];
list.push_back(pLine);
list.clear(); // is delete called here?
// is delete pLine; necessary?
}
```
Does `list.clear()` call `delete` on each element? I.e. do I have to free the ... | [
0.11367923766374588,
-0.02282719500362873,
0.45239076018333435,
-0.3508491516113281,
0.08561290055513382,
-0.012523326091468334,
0.18888327479362488,
-0.4663656949996948,
-0.28874659538269043,
-0.36460554599761963,
-0.27373427152633667,
0.6718131303787231,
-0.40402477979660034,
-0.09277798... | |
it Do The Right Thing (`auto_ptr` would not work correctly in a container as it has incompatible behaviour under copying etc.), but be sure you understand the pitfalls of such smart pointers before use. (As Benoit mentions, in this case, `basic_string` is what you're really looking for here.)
Having said that there's ... | [
0.25770896673202515,
-0.018887246027588844,
0.10538153350353241,
0.23452438414096832,
0.15767942368984222,
-0.2992103099822998,
0.33140474557876587,
-0.47784873843193054,
0.29096418619155884,
-0.19715122878551483,
-0.22574086487293243,
0.8168029189109802,
-0.028150197118520737,
-0.85629743... | |
the Earwicker and James Matta - thanks for pushing me to do the due diligence on this! | [
0.5263420939445496,
0.28586918115615845,
0.4456378221511841,
0.27974098920822144,
0.038475990295410156,
-0.30096063017845154,
0.05052853748202324,
0.3094063997268677,
0.33606207370758057,
-0.5514341592788696,
-0.0793699398636818,
0.7692767381668091,
0.4549485743045807,
0.09635937958955765,... | |
I am talking about classic enterprise applications. Typically hosted in some kind of application-server or container. Nothing fancy, just entities, services, Presentation/UI and relational storage.
Whenever I see the `synchronized` keyword (either on methods or for blocks) in such an application I get very suspicious.... | [
0.5237484574317932,
0.34398597478866577,
-0.04005125164985657,
0.44404152035713196,
0.19122666120529175,
-0.27508819103240967,
0.07463445514440536,
0.29721203446388245,
-0.4400289058685303,
-0.4932980537414551,
-0.06241888925433159,
0.2603091597557068,
-0.4259248673915863,
0.39410200715065... | |
necessary in a classic enterprise application?
I agree with you for business logic code, but in an enterprise application you also have technical code and sometimes you need some synchronization for shared 'technical' state. The synchronized keyword may be used for this. (You also may relay on atomic variable, or use s... | [
0.4086793065071106,
0.22449816763401031,
0.0597495473921299,
0.34704264998435974,
0.28280964493751526,
-0.08248881250619888,
0.16970683634281158,
-0.41138187050819397,
-0.07394842803478241,
-0.491787850856781,
-0.06467614322900772,
0.7020295262336731,
-0.4108003079891205,
-0.06735838949680... | |
My Application is built to a scan MS Access database in VB.NET.
When the Access application is distributed to end users, they may have different versions of COM components. Is it possible to Add/Remove references programmatically to resolve broken references due to differing versions?
Please share me code or link fo... | [
0.21753592789173126,
0.3916587233543396,
0.6646730303764343,
0.10521653294563293,
0.1919769048690796,
-0.028869517147541046,
0.13737791776657104,
0.00935015082359314,
-0.01052085030823946,
-1.1962891817092896,
0.061471085995435715,
0.37683984637260437,
-0.1079634502530098,
0.63770163059234... | |
Sub
Function ReferenceFromFile(strFileName As String) As Boolean
Dim ref As Reference
On Error GoTo Error_ReferenceFromFile
References.AddFromFile (strFileName)
ReferenceFromFile = True
Exit_ReferenceFromFile:
Exit Function
Error_ReferenceFromFile:
ReferenceFrom... | [
-0.36082151532173157,
-0.06089697778224945,
0.9707210063934326,
-0.2173888087272644,
-0.0465003103017807,
0.10838659107685089,
0.5088245272636414,
-0.31287291646003723,
-0.11008419096469879,
-0.10681508481502533,
-0.44773322343826294,
0.7720653414726257,
-0.26609522104263306,
0.32473921775... | |
'You need a reference to remove '
Set ref = References(RefName)
References.Remove ref
End Sub
You can use the references collection to find if a reference exists.
```
**Reference Exists**
```
Function RefExists(RefName)
Dim ref As Object
RefExists = False
For Each ref In References
... | [
0.2702699899673462,
0.17765693366527557,
0.8452949523925781,
-0.20176710188388824,
-0.28924304246902466,
0.0269478689879179,
0.5371133685112,
-0.4752032160758972,
-0.12234468758106232,
-0.31668853759765625,
-0.1267016977071762,
0.7004914283752441,
-0.5609910488128662,
0.6783772110939026,
... | |
End If
Next
End Function
```
From: <http://wiki.lessthandot.com/index.php/Add,_Remove,_Check_References>
**You may also wish to read** <http://www.mvps.org/access/modules/mdl0022.htm> | [
0.038080766797065735,
-0.2824038565158844,
0.6179163455963135,
-0.023263713344931602,
0.2363494336605072,
-0.2857057750225067,
0.059364285320043564,
-0.26465269923210144,
-0.16735367476940155,
-0.7681974768638611,
-0.22748087346553802,
0.24312034249305725,
-0.2855769395828247,
0.2831631302... | |
I'm really hesitant to ask this question, since it's sure to have such a terribly easy answer, but I just can't figure it out. Here goes:
I have this Objective-C code in a file called `Copier.h`:
```
#import <Cocoa/Cocoa.h>
#import "CopyQueue.h";
@interface Copier : NSObject {
IBOutlet NSTextField *statusField;
... | [
0.44391050934791565,
0.3861161470413208,
0.39675766229629517,
-0.16269642114639282,
0.08042588084936142,
-0.07423616200685501,
0.10395412892103195,
-0.06300325691699982,
-0.2114422470331192,
-0.4953742027282715,
0.01639549247920513,
0.48600950837135315,
-0.45747697353363037,
-0.09671045839... | |
can't be the solution, can it? Replacing all typed references with generic ones?
Try...
```
@class CopyQueue
@interface {
...
}
...
@end
``` | [
0.4081117808818817,
0.14288662374019623,
0.3871189057826996,
0.3392883241176605,
0.15679775178432465,
-0.265471875667572,
0.30455482006073,
0.1393606960773468,
-0.15724271535873413,
-0.4846401810646057,
0.010327773168683052,
0.34694570302963257,
-0.68386310338974,
0.740669310092926,
-0.2... | |
I'm confused.
I have TFS installed on my development server, which also doubles as the build machine. The builds work fine when I check-in code, but when the build attempts to run the tests I get an error:
MSBUILD : warning MSB6004: The specified task executable location "C:\Program Files\Microsoft Visual Studio 9.0\... | [
0.1727670580148697,
0.391628623008728,
0.08271774649620056,
-0.19981297850608826,
0.16220995783805847,
-0.2395322173833847,
0.7096983194351196,
-0.022385399788618088,
-0.044051866978406906,
-0.32784056663513184,
-0.11838633567094803,
0.6705248355865479,
-0.13306181132793427,
-0.08099254965... | |
to be installed on the build server. Can anyone confirm that this is true and more importantly whether it will solve me problem? Or can I merely install professional edition?
Thanks, Confused.
Yes - you need either the Developer or the Test edition of VSTS 2008 (Or the Team Suite Edition installed). This is so that th... | [
0.7175547480583191,
0.0390227735042572,
0.2507728338241577,
0.336603045463562,
-0.06513911485671997,
-0.26993483304977417,
0.3642675280570984,
-0.13686026632785797,
0.07414264976978302,
-0.5877118706703186,
-0.11593257635831833,
0.8085467219352722,
0.1993900090456009,
-0.14558707177639008,... | |
they are checking in then you are covered in terms of licensing for it being built on the build server AFAIK. (Though I only have a degree in Physics so I am woefully under-qualified for figuring out Microsoft licensing terms :-) )
Hope that helps,
Martin. | [
0.7485999464988708,
0.5961869955062866,
0.1889788657426834,
0.15127407014369965,
0.23037424683570862,
-0.4327889680862427,
0.33814847469329834,
0.3452058732509613,
0.14068153500556946,
-0.48621344566345215,
0.22426706552505493,
0.5644878149032593,
0.3911100924015045,
-0.11847850680351257,
... | |
I have developed a simple interactive Flash game, but now it appears that sometimes Flash Adds (3rd party ones displayed by facebook) somehow steal the focus from my flash application (by mistake?). My app has textfield() where the focus should remain until game is over.
My flash object uses urlrequest/javascript to a... | [
0.4271146059036255,
-0.05342456325888634,
0.4477245807647705,
0.11834287643432617,
0.008716877549886703,
-0.48625198006629944,
0.06511416286230087,
0.09129804372787476,
-0.03895033150911331,
-0.4951391816139221,
-0.13878421485424042,
0.8047662377357483,
-0.19922804832458496,
-0.05898103863... | |
currently not working with Safari/Crome browser, so what is most compatible way to request focus and keep it?
For me, the output looks a bit different:
```
testA: 1 wallclock secs ( 0.16 usr + 0.11 sys = 0.27 CPU) @ 37.04/s (n=10)
(warning: too few iterations for a reliable count)
testB: 0 wallclock sec... | [
0.33412355184555054,
-0.3182065784931183,
0.5088483095169067,
-0.1505151093006134,
-0.08274570852518082,
0.04114888608455658,
0.5407249331474304,
0.03473490849137306,
-0.1619892418384552,
-0.8566965460777283,
-0.2974615693092346,
0.695739209651947,
-0.31392842531204224,
-0.3927325010299682... | |
iterations (I chose 100,000), I get this:
```
testA: 23 wallclock secs (12.15 usr + 10.05 sys = 22.20 CPU) @ 4504.50/s (n=100000)
testB: 11 wallclock secs ( 6.02 usr + 5.57 sys = 11.59 CPU) @ 8628.13/s (n=100000)
```
A look at the code tells me that those two subs probably spend most of their time globbing the fi... | [
-0.0771842673420906,
-0.023753466084599495,
0.3747510015964508,
-0.12046458572149277,
0.22612711787223816,
0.556195855140686,
0.4565693438053131,
-0.3136696517467499,
-0.2611953020095825,
-0.7369077205657959,
0.24919280409812927,
0.3642001450061798,
-0.008768302388489246,
0.068185947835445... | |
map $_->[0],
sort {$a->[1] <=> $b->[1]} | [
-0.4466876685619354,
-0.29005303978919983,
0.31108370423316956,
-0.10322330892086029,
0.1684974879026413,
0.18260307610034943,
0.14068816602230072,
-0.2853376269340515,
-0.15150102972984314,
-1.0352553129196167,
-0.36139753460884094,
0.3251807689666748,
-0.4756240248680115,
-0.057563878595... | |
map [$_, -s $_],
@files;
},
testB => sub { | [
-0.06971552222967148,
-0.3320249915122986,
0.0740378275513649,
-0.1199379414319992,
0.24122333526611328,
-0.008468043990433216,
0.42431744933128357,
-0.23727014660835266,
0.25269681215286255,
-0.9798176288604736,
-0.32714876532554626,
0.32706567645072937,
-0.28053879737854004,
-0.038002185... | |
sort { -s $a <=> -s $b } @files;
},
}
);
```
And get:
```
testA: 103 wallclock secs (56.93 usr + 45.61 sys = 102.54 CPU) @ 9752.29/s (n=1000000)
testB: -1 wallclock secs ( | [
-0.3686729669570923,
-0.040858615189790726,
0.4769856035709381,
-0.30172452330589294,
0.10234058648347855,
0.33485788106918335,
0.440823495388031,
-0.4628193974494934,
-0.09361646324396133,
-0.7649853229522705,
-0.33183202147483826,
0.16106776893138885,
-0.11222342401742935,
0.017957773059... | |
0.12 usr + 0.00 sys = 0.12 CPU) @ 8333333.33/s (n=1000000)
(warning: too few iterations for a reliable count)
```
Something smells fishy here, doesn't it?
So, let's take a look at the docs:
perldoc -f sort
> In scalar context, the behaviour of
> "sort()" is undefined.
Aha! So let's try it again:
```
m... | [
0.32597339153289795,
0.13764962553977966,
0.3726743459701538,
-0.35959282517433167,
0.12855392694473267,
0.057840798050165176,
0.37852564454078674,
-0.12631183862686157,
-0.15123234689235687,
-0.6302345395088196,
0.16791145503520966,
0.24258281290531158,
-0.25277191400527954,
0.23378798365... | |
my @arr= map $_->[0],
sort {$a->[1] <=> $b->[1]}
map [$_, -s | [
-0.1901659369468689,
0.06020359694957733,
0.6939846873283386,
-0.3443587124347687,
-0.028826892375946045,
0.36465033888816833,
0.3925158381462097,
-0.011622296646237373,
-0.10969273746013641,
-0.845722496509552,
-0.02846212312579155,
0.20877660810947418,
-0.08478322625160217,
0.20732529461... | |
$_],
@files;
},
testB => sub { | [
0.2911525368690491,
0.03565763309597969,
-0.07066842168569565,
-0.24426895380020142,
0.32190054655075073,
0.12151269614696503,
0.7271460294723511,
-0.1710478663444519,
0.1803145557641983,
-0.4114133417606354,
-0.16518303751945496,
0.5464512705802917,
-0.3671431839466095,
0.1800701767206192... | |
my @arr = sort { -s $a <=> -s $b } @files;
},
}
);
```
This gives me:
```
testA: 12 wallclock secs ( 7.44 usr + 4.55 sys = 11.99 CPU) @ 8340.28/s (n=100000)
testB: 34 wallclock | [
0.0014961499255150557,
0.24142804741859436,
0.652947187423706,
-0.1848425716161728,
0.12088187783956528,
0.29522597789764404,
0.5203405618667603,
-0.41476261615753174,
0.00552075682207942,
-0.6429916620254517,
-0.03774067386984825,
0.4630461037158966,
0.034470830112695694,
0.01638686656951... | |
secs ( 6.44 usr + 28.30 sys = 34.74 CPU) @ 2878.53/s (n=100000)
```
So. To answer your questions: A Schwartzian transform will help you whenever you use it in a meaningful way. Benchmarking will show this when you benchmark in a meaningful way. | [
-0.23831744492053986,
-0.5011711716651917,
0.2977892756462097,
0.15181519091129303,
0.045680027455091476,
0.06699927896261215,
0.21848483383655548,
-0.11972511559724808,
-0.026064662262797356,
-0.5515483617782593,
-0.23872864246368408,
0.6171639561653137,
-0.16857388615608215,
0.0569088459... | |
I found this code:
```
this.Invoke(new EventHandler(EventGetSum));
```
Is this not the same as writing:
```
EventGetSum();
```
What's the use of this?
If you write `EventGetSum()` that immediately *calls* the EventGetSum method.
If you write `new EventHandler(EventGetSum)` that creates a delegate which will (in ... | [
-0.03166905790567398,
-0.21851375699043274,
0.3034139573574066,
0.19188418984413147,
0.19389662146568298,
-0.40304696559906006,
0.1755250245332718,
-0.18792112171649933,
-0.08495069295167923,
-0.5231609344482422,
-0.29989591240882874,
0.4353134334087372,
-0.24784407019615173,
0.22873017191... | |
What would be the best way to go about getting a function that returns a random English word (preferably a noun), without keeping a list of all possible words in a file before hand?
Word lists need not take up all that much space.
Here's a [JSON wordlist with 2,465 words, all nouns](https://www.randomlists.com/data/wo... | [
0.012863635085523129,
-0.19846032559871674,
0.19515851140022278,
0.11928371340036392,
-0.37352073192596436,
0.4265245199203491,
0.006174230948090553,
-0.1281018704175949,
-0.3853776752948761,
-0.4800924062728882,
-0.05542747676372528,
0.17011232674121857,
-0.03212833032011986,
-0.108352117... | |
I hear a lot about NHibernate lately (mostly good things) and would like to get to know it. At my company we are planning to create a db based application in C#, and I was wondering if NHibernate was suitable for this project. But as I have no experience with ORM, I can not assess the risks involved.
**Background:**
... | [
0.5760923027992249,
0.2058172971010208,
-0.061878446489572525,
-0.2319849133491516,
-0.33807188272476196,
-0.4333984851837158,
0.12418340146541595,
-0.18177640438079834,
0.1193128153681755,
-0.3245735168457031,
-0.08766709268093109,
0.1598232388496399,
-0.42246633768081665,
0.4799983501434... | |
given part, while others may require the evaluation of 100 or 1000 measurements. The calculations have to be updated on each new measurement entry. The type of calculation for a part will be configurable, as well as the boundaries for acceptable values and the actions taken if the result violates those boundaries.
The... | [
0.06516396999359131,
0.08898485451936722,
0.2483694851398468,
0.3218766748905182,
-0.26121944189071655,
-0.019418546929955482,
-0.058517638593912125,
-0.20007818937301636,
0.19805310666561127,
-0.2594216465950012,
0.08576402068138123,
0.20891471207141876,
-0.02786135859787464,
0.3322390317... | |
project like this. It would give you even the option to decide later which DB to use.
Sometimes you may want to improve performance using direct sql queries and you have the tag in NH for this, there you will have differences between DB's but most of the work will be independent of the final decision.
In a statistical... | [
0.1734769344329834,
0.051023632287979126,
0.032901581376791,
0.3351292908191681,
-0.2889420986175537,
-0.35919493436813354,
0.05528215318918228,
-0.20827414095401764,
-0.15909582376480103,
-0.5659656524658203,
0.2736985385417938,
0.2076554298400879,
-0.07833162695169449,
0.2615705132484436... | |
The following XML namespaces references are included in at the top of every new Xaml file.
```
//http://schemas.microsoft.com/winfx/xaml/presentation
//http://schemas.microsoft.com/winfx/xaml
```
The **winfx/xaml/presentation** holds references to a bunch of windows namesapces such as Windows.Navigation, Windows.Con... | [
0.12170690298080444,
0.40405896306037903,
0.4389897882938385,
0.18864203989505768,
-0.07358521223068237,
-0.2391376495361328,
0.0274912491440773,
-0.002503396011888981,
-0.3135923445224762,
-0.6476953625679016,
-0.30942079424858093,
0.22050583362579346,
-0.3672694265842438,
0.3093049526214... | |
read the MSDN docs and I am looking for a more granular answer. Example why can some elements be used interchangeably.
XAML is not just used by WPF thus the seperation of the namespaces! The <http://schemas.microsoft.com/winfx/xaml> is stuff that is related to XAML and can be reused on other frameworks (Like WF, Silver... | [
0.345983624458313,
0.031136032193899155,
0.11300648748874664,
0.10829932987689972,
-0.11570737510919571,
-0.44409507513046265,
-0.03657430410385132,
-0.18348871171474457,
-0.3488607108592987,
-0.6504584550857544,
-0.31874582171440125,
0.27630725502967834,
-0.4399186670780182,
0.05054844170... | |
I need to generate a table from a list of objects. Each row will contain only the basic information for each object. However when the user hovers over a specific cell I want a popup, that contains all the information for that particular object, to appear. Maybe the popup should be in the form of a table with all the de... | [
0.5979996919631958,
0.001182686653919518,
0.10843195021152496,
-0.07412271946668625,
0.15812252461910248,
-0.030936773866415024,
-0.21847184002399445,
-0.1709548830986023,
-0.4342239201068878,
-0.4819527864456177,
0.26109322905540466,
0.36396947503089905,
-0.16524194180965424,
-0.290167272... | |
tooltip pane, which you can arbitrarily style. See the examples. | [
0.5243420004844666,
-0.04880286008119583,
-0.17857803404331207,
0.13388444483280182,
0.08258674293756485,
0.050963182002305984,
-0.08102571964263916,
-0.36749207973480225,
-0.33771637082099915,
-0.8173369765281677,
0.04727041721343994,
0.839507520198822,
-0.07711904495954514,
-0.0233183801... | |
In the code below I want to replace EventLogEntryType.Warning with a value selected from a combo box, the combobox values are EventLogEntryType.Warning, EventLogEntryType.Information, EventLogEntryType.Error. The combo box would just show "Warning", "Information" and "Error". How can I do this?
Thanks
```
EventLog my... | [
0.49069252610206604,
0.012667628936469555,
0.27404850721359253,
-0.14474330842494965,
0.19339336454868317,
-0.25246521830558777,
0.4023716151714325,
-0.29164940118789673,
-0.13526266813278198,
-0.7852368354797363,
0.10741814970970154,
0.7359958291053772,
-0.12252010405063629,
-0.3012478053... | |
can arbitrarily style. See the examples. | [
-0.14994972944259644,
0.14357906579971313,
-0.25466740131378174,
0.22602598369121552,
0.3878463804721832,
-0.31043240427970886,
0.19159343838691711,
-0.3032033443450928,
0.003553743939846754,
-0.5191198587417603,
-0.05381591618061066,
0.8251011371612549,
-0.03586355224251747,
-0.1458397507... | |
I'm wanting to get some binding working in my mvc application. I find nested properties are not automatically bound by the default model binder in the RC1 release of asp.net mvc. I have the following class structure:
```
public class Contact{
public int Id { get; set; }
public Name Name { get; set; }
... | [
0.19629046320915222,
0.23490211367607117,
0.5689237117767334,
-0.30120018124580383,
-0.0700649544596672,
-0.21153998374938965,
0.09458541870117188,
-0.3054507374763489,
-0.05762508511543274,
-0.7164265513420105,
0.03132114186882973,
0.6250705122947693,
-0.377821147441864,
0.171653613448143... | |
public string Surname { get; set; }
}
```
My view is defined along the lines of:
```
using(Html.BeginForm()){
Html.Textbox("Name.Forename", Model.Name.Forename);
Html.Textbox("Name.Surname", Model.Name.Surname);
Html.Textbox("Email", Model.Email);
Html.SubmitButton("save", "Save");
}
```... | [
-0.1912624090909958,
-0.2574648857116699,
0.5972161293029785,
-0.16915622353553772,
0.05047064647078514,
0.12551218271255493,
0.11377962678670883,
-0.44279730319976807,
-0.10718746483325958,
-0.5529112219810486,
-0.08082837611436844,
0.5619288682937622,
-0.43962377309799194,
0.116113185882... | |
successfully bound but not the `Name.Forename` or `Name.Surname` properties. Can anyone tell if this should work using the default model binder and I'm doing something wrong or if it doesn't work and I need to roll my own code for binding nested properties on model objects?
I think the problem is due to the Name prefix... | [
-0.0671682357788086,
0.1366976797580719,
0.3049139678478241,
0.20136529207229614,
0.28695181012153625,
-0.23252174258232117,
0.48451322317123413,
-0.554379940032959,
-0.08913742750883102,
-0.5205587148666382,
-0.08513906598091125,
0.567647397518158,
-0.12637202441692352,
0.1876584738492965... | |
a whitelist of properties to consider.
```
public ActionResult Save( int id )
{
Contact contact = db.Contacts.SingleOrDefault(c => c.Id == id);
UpdateModel(contact, new string[] { "Email" } );
string[] whitelist = new string[] { "Forename", "Surname" };
UpdateModel( contact.Name, "Name", whiteli... | [
-0.10762334614992142,
0.006790790241211653,
0.2730880677700043,
-0.4131638705730438,
0.2771860957145691,
0.13700024783611298,
0.3113829493522644,
-0.47398748993873596,
-0.05571445822715759,
-0.7218273282051086,
-0.4023160934448242,
0.5921910405158997,
-0.5073150992393494,
0.069107808172702... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.