text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
ZeroC's ICE (www.zeroc.com) looks interesting and I am interested in looking at it and comparing it to our existing software that uses WCF. In particular, our WCF app uses server callbacks (via HTTP).
Anybody who's compared them? How did it go? I'm particularly interested in the performance aspect, since interoperabil... | [
0.8637839555740356,
0.1679171621799469,
0.26848769187927246,
0.3437471091747284,
-0.5601569414138794,
-0.027014248073101044,
-0.07349971681833267,
0.2922385334968567,
-0.17562325298786163,
-0.4715377986431122,
0.3614187240600586,
0.1910495012998581,
-0.011151324026286602,
0.105290845036506... | |
as ICE is a specific remote communication mechanism and WCF is a higher level remote communications framework.
While WCF is often thought of as implementing SOAP web services, and that is indeed its main use to date, it can also be used for implementing remote services using all manner of encodings and transport chan... | [
0.23056474328041077,
0.02554338425397873,
0.22689670324325562,
0.21389243006706238,
-0.3110417425632477,
-0.17520716786384583,
0.2397625893354416,
-0.22481267154216766,
-0.026966063305735588,
-0.653981626033783,
-0.082840695977211,
0.11098802834749222,
-0.3565734028816223,
0.26360282301902... | |
Remoting, and JNI.
However, even though there's no direct correspondence between ICE and WCF, if you need your .NET app to communicate remotely then they're both contenders. Some of the decision points you might want to consider include:
* Resourcing. It'll be easier to find developers with WCF experience than ICE ex... | [
0.11120446026325226,
-0.2714257538318634,
0.22287379205226898,
0.2503049969673157,
-0.4972112476825714,
-0.14893338084220886,
0.5158864259719849,
-0.2181476205587387,
-0.31160300970077515,
-0.9321097135543823,
-0.18404996395111084,
0.5179380178451538,
-0.12030019611120224,
-0.1331553906202... | |
you're limited with the WCF options you can use. In addition, since every SOAP stack seems to implement the standards differently it can be a pain creating truly generic Web Services (though WS-I helps)
If you don't need every ounce of performance from day one, then I'd personally plump for WCF to start with, and then... | [
0.7391988635063171,
0.0023742003832012415,
-0.019815390929579735,
0.13485434651374817,
-0.22116097807884216,
-0.17715013027191162,
0.34788623452186584,
-0.04645995423197746,
-0.14188362658023834,
-0.7758949398994446,
0.01248928252607584,
0.41276851296424866,
-0.0714631900191307,
0.12830811... | |
encoding etc | [
0.3470984697341919,
0.3292714059352875,
0.08835890889167786,
0.1574203222990036,
0.5618322491645813,
-0.028447965160012245,
-0.4113282263278961,
0.09820877760648727,
-0.30125969648361206,
-0.7842354774475098,
-0.5903093814849854,
0.37299373745918274,
-0.43940994143486023,
-0.05879693105816... | |
I am working on a Rails application that needs to handle dates and times in users' time zones. We have recently migrated it to Rails 2.1 and added time zone support, but there are numerous situations in which we use Time#utc and then compare against that time. Wouldn't that be the same as comparing against the original... | [
0.16416104137897491,
-0.09932299703359604,
0.17755232751369476,
-0.01505778357386589,
0.20472577214241028,
-0.0679975152015686,
0.25800713896751404,
-0.08329714834690094,
-0.023709673434495926,
-0.8281604051589966,
0.12066847831010818,
0.5115174055099487,
-0.21901491284370422,
0.0108329830... | |
before\_filter on application.rb is the usual place) to the user's Time Zone, all the times will be automagically converted into the user's timezone from the utc storage.
Just be careful with Time.now.
Also see:
<http://mad.ly/2008/04/09/rails-21-time-zone-support-an-overview/>
<http://errtheblog.com/posts/49-a-zon... | [
0.2107086181640625,
-0.39528992772102356,
0.4624951183795929,
0.17039647698402405,
0.26789745688438416,
-0.22914667427539825,
0.7308383584022522,
0.13487201929092407,
-0.1803489774465561,
-0.875555157661438,
-0.08185648173093796,
0.37031835317611694,
-0.23066645860671997,
-0.04780626296997... | |
My question is what do most developers prefer for error handling, Exceptions or Error Return Codes. Please be language(or language family) specific and why you prefer one over the other.
I'm asking this out of curiosity. Personally I prefer Error Return Codes since they are less explosive and don't force user code to ... | [
0.1629047989845276,
0.2486279010772705,
-0.23315952718257904,
0.28357163071632385,
-0.6086044907569885,
-0.001553791225887835,
0.3616700768470764,
0.09694404900074005,
-0.23856432735919952,
-0.4559928774833679,
-0.20350617170333862,
0.5974093079566956,
0.08249111473560333,
0.05115883424878... | |
languages (i.e. C++) Resources leak should not be a reason
===================================================================
C++ is based on RAII.
If you have code that could fail, return or throw (that is, most normal code), then you should have your pointer wrapped inside a smart pointer (assuming you have a *ver... | [
0.268959641456604,
0.14505831897258759,
0.09834670275449753,
0.11778442561626434,
0.05468108132481575,
-0.26399412751197815,
0.775887131690979,
0.040495872497558594,
0.03912068530917168,
-0.4805721044540405,
-0.17439508438110352,
0.5924023389816284,
-0.6559250950813293,
-0.2713342905044555... | |
}
else
{
// react to failure of doSomethingElseAgain
}
}
else
{
// react to failure of doSomethingElse
}
}
else
{
// react to failure of doSomething
}
```
In the end, you code is a collection of idented instructions (I saw this kind of code in production code).
This co... | [
0.3082500994205475,
0.006763772573322058,
0.18236327171325684,
0.13211219012737274,
0.08169425278902054,
-0.14247898757457733,
0.2520105242729187,
-0.6099212765693665,
0.17508503794670105,
-0.6262959241867065,
-0.022771555930376053,
0.7603310942649841,
-0.2770354449748993,
0.04346235468983... | |
doSomethingElseAgain() ;
}
catch(const SomethingException & e)
{
// react to failure of doSomething
}
catch(const SomethingElseException & e)
{
// react to failure of doSomethingElse
}
catch(const SomethingElseAgainException & e)
{
// react to failure of doSomethingElseAgain
}
```
Which cleanly separate code... | [
0.18340271711349487,
0.08451958000659943,
0.16696713864803314,
0.02896135114133358,
0.2532224655151367,
-0.36064860224723816,
0.6483526825904846,
-0.4434095323085785,
0.08243211358785629,
-0.5438369512557983,
-0.002178604481741786,
0.7787173390388489,
-0.1407407820224762,
0.127670422196388... | |
happen with exception.
The error won't be ignored. Sometimes, you want it to not explode, though... So you must chose carefully.
Return Codes must sometimes be translated
=========================================
Let's say we have the following functions:
* doSomething, which can return an int called NOT\_FOUND\_ER... | [
0.03801164776086807,
0.05530936270952225,
0.2993324100971222,
-0.09981165081262589,
0.12866094708442688,
-0.092619888484478,
0.6028819680213928,
-0.3767772614955902,
0.1370544582605362,
-0.5844579935073853,
0.12853190302848816,
0.8582856059074402,
-0.4243978261947632,
0.18202131986618042,
... | |
solution
=========================================
Operators cannot return an error code. C++ constructors can't, too.
Return Codes means you can't chain expressions
==============================================
The corollary of the above point. What if I want to write:
```
CMyType o = add(a, multiply(b, c)) ;
``... | [
-0.1763473004102707,
0.12169518321752548,
0.3862942159175873,
-0.00025497798924334347,
0.1302010715007782,
0.052492860704660416,
0.41065624356269836,
-0.5087128281593323,
-0.129707932472229,
-0.4766826629638672,
-0.25242555141448975,
0.34746772050857544,
-0.5293330550193787,
0.249040871858... | |
catch can then be specialized.
Don't ever use catch(...) without re-throwing
=============================================
Usually, you should not hide an error. If you do not re-throw, at the very least, log the error in a file, open a messagebox, whatever...
Exception are... NUKE
=====================
The problem... | [
0.32297632098197937,
-0.19176866114139557,
-0.05080850422382355,
0.1407448798418045,
-0.2383335679769516,
-0.35738953948020935,
0.30357620120048523,
0.12526512145996094,
-0.49263739585876465,
-0.54338139295578,
-0.09288511425256729,
0.26663491129875183,
-0.33269527554512024,
0.205592885613... | |
message loop.
The solution could be mixing them?
==================================
So I guess the solution is to throw when something should **not** happen. And when something can happen, then use a return code or a parameter to enable to user to react to it.
So, the only question is "what is something that should ... | [
0.37518829107284546,
-0.17293763160705566,
0.05671897530555725,
-0.027310136705636978,
-0.22032950818538666,
-0.02684594877064228,
0.4760678708553314,
-0.01976749859750271,
-0.2234451323747635,
-0.4478272497653961,
0.13285750150680542,
0.4817825257778168,
-0.7229576706886292,
0.05763699486... | |
pointers, but...)
Another solution would be to show the error
===========================================
Sometimes, your problem is that you don't want errors. Using exceptions or error return codes are cool, but... You want to know about it.
In my job, we use a kind of "Assert". It will, depending on the values of... | [
0.05129799246788025,
0.06462252140045166,
0.1972968876361847,
0.30924853682518005,
-0.03417991101741791,
-0.02373562753200531,
0.33289211988449097,
0.034821540117263794,
-0.5003842711448669,
-0.47403234243392944,
-0.08285657316446304,
0.5634800791740417,
-0.45054832100868225,
-0.2400475442... | |
detected, and not after (when some code cares about the return value, or inside a catch).
It is easy to add to legacy code. For example:
```
void doSomething(CMyObject * p, int iRandomData)
{
// etc.
}
```
leads a kind of code similar to:
```
void doSomething(CMyObject * p, int iRandomData)
{
if(iRandomData ... | [
-0.15387623012065887,
0.0005582446465268731,
0.31147152185440063,
-0.17313389480113983,
0.205428346991539,
-0.10260210186243057,
0.2514345645904541,
-0.40965303778648376,
-0.10981911420822144,
-0.42801085114479065,
-0.17626219987869263,
0.3425004780292511,
-0.33625635504722595,
0.082498624... | |
is equal to " << iRandomData << ". Will throw.") ;
throw std::some_exception() ;
}
if(! p.is Ok())
{
MY_RAISE_ERROR("Hey, p is NOT Ok!\np is equal to " << p->toString() << ". Will try to continue anyway") ;
}
// etc.
}
```
(I have similar macros that are active only on debug).
Note that ... | [
-0.1420898586511612,
-0.04126110300421715,
0.33854177594184875,
-0.26241204142570496,
0.1370275467634201,
-0.11502605676651001,
0.2800581157207489,
-0.2321636825799942,
-0.3154878318309784,
-0.5085416436195374,
-0.28076884150505066,
0.5445309281349182,
-0.40131524205207825,
-0.017361277714... | |
using return codes, you're preparing yourself for failure, and hope your fortress of tests is secure enough.
When you code using exception, you know that your code can fail, and usually put counterfire catch at chosen strategic position in your code. But usually, your code is more about "what it must do" then "what I ... | [
-0.008197166956961155,
0.08734975755214691,
-0.07653360068798065,
0.010286327451467514,
-0.002501842100173235,
-0.06782745569944382,
0.4805849492549896,
-0.19307412207126617,
-0.035615235567092896,
-0.7760491967201233,
-0.1944027841091156,
0.7587542533874512,
-0.1705758273601532,
-0.274786... | |
Using reflection in .Net, what is the differnce between:
```
if (foo.IsAssignableFrom(typeof(IBar)))
```
And
```
if (foo.GetInterface(typeof(IBar).FullName) != null)
```
Which is more appropriate, why?
When could one or the other fail?
If you just want to see if a type implements a given interface, eithe... | [
0.16790585219860077,
-0.11156629770994186,
0.32784202694892883,
-0.07558134198188782,
-0.3184775412082672,
-0.13207657635211945,
0.48723068833351135,
-0.44918808341026306,
0.042112018913030624,
-0.7172136306762695,
0.34937378764152527,
0.8259896039962769,
-0.4259423315525055,
-0.0734896734... | |
Many languages have standard repositories where people donate useful libraries that they want others to have access to. For instance Perl has CPAN, PHP has PEAR, Ruby has RubyGems, and so on. What is the best option for JavaScript?
I ask because a few months ago I ported [Statistics::Distributions](http://search.cpan.... | [
0.31570109724998474,
0.12023031711578369,
0.10915036499500275,
0.0036374006886035204,
-0.35289204120635986,
-0.11349120736122131,
0.07144274562597275,
0.14482787251472473,
-0.4992707669734955,
-0.4069090187549591,
0.04244935140013695,
0.376783549785614,
-0.2814803719520569,
-0.167104631662... | |
same open source license as the original (your choice of the GPL or the Artistic License). But I have no idea where to put it so that people who might want it are likely to find it.
It doesn't fit into any sort of framework. It is just a standalone library that gives you the ability to calculate a number of useful sta... | [
0.7193692326545715,
-0.10611120611429214,
0.09773287177085876,
0.2377910614013672,
-0.08402226865291595,
-0.5049349665641785,
0.019055696204304695,
-0.0021327317226678133,
-0.13111115992069244,
-0.6215226054191589,
0.04471837729215622,
0.2796069383621216,
-0.2876262366771698,
0.04701994732... | |
One thing I am concerned with is that I discovered two ways of registering delegates to events.
1. OnStuff += this.Handle;
2. OnStuff += new StuffEventHandler(this.Handle);
The first one is clean, and it makes sense doing "OnStuff -= this.Handle;" to unregister from the event... But with the latter case, should I do ... | [
0.282062828540802,
0.050732165575027466,
0.1818443089723587,
0.22775785624980927,
-0.1025710180401802,
-0.35322248935699463,
0.07709156721830368,
-0.34479478001594543,
-0.6104989647865295,
-0.6887112259864807,
0.024808252230286598,
-0.01487284991890192,
-0.030880032107234,
0.35283106565475... | |
I previously registered.
What is the downside of doing #1?
What is benefit of doing #2?
You don't need to worry about keeping a reference to the originally registered delegate, and you will not start a "nasty memory pool".
When you call "OnStuff -= new StuffEventHandler(this.Handle);" the removal code does *not* com... | [
0.33513256907463074,
0.038215167820453644,
0.26521432399749756,
0.03698166459798813,
0.010662970133125782,
-0.2419256716966629,
0.29470622539520264,
-0.22028140723705292,
-0.4468371272087097,
-0.5380328893661499,
-0.08130757510662079,
0.23363624513149261,
-0.28133296966552734,
0.5018987655... | |
accessibility of the delegate). | [
-0.11155261844396591,
-0.006364715751260519,
0.17837537825107574,
0.3750767111778259,
-0.013710162602365017,
0.09712665528059006,
0.6390224099159241,
-0.11585730314254761,
-0.7248213291168213,
-0.7144407629966736,
-0.4374946355819702,
0.12700843811035156,
0.18345510959625244,
-0.1196153759... | |
Macs are renowned (or bemoaned) for having an extensive number of shortcuts. However, OS X itself pales in comparison to the shortcut lists in [TextMate](http://macromates.com/) and its bundles.
What are some useful keyboard shortcuts you use?
These are my favorite shortcuts:
* `cmd`+`t` Start typing name of a file t... | [
-0.4329584240913391,
0.22359919548034668,
0.6775116324424744,
0.03025186061859131,
0.14902707934379578,
0.2867737114429474,
0.18786290287971497,
0.4530082941055298,
-0.29966941475868225,
-0.8534742593765259,
-0.08359483629465103,
0.8416210412979126,
-0.3722866475582123,
-0.3848587572574615... | |
I just wanted some opinions from people that have run Selenium (<http://selenium.openqa.org>) I have had a lot of experience with WaTiN and even wrote a recording suite for it. I had it producing some well-structured code but being only maintained by me it seems my company all but abandoned it.
If you have run seleni... | [
0.7230932116508484,
0.26105543971061707,
0.030722813680768013,
0.013548517599701881,
-0.30425697565078735,
-0.3979719877243042,
0.10423904657363892,
-0.18344581127166748,
0.005072062835097313,
-0.3698333501815796,
0.24053047597408295,
0.6420754194259644,
-0.09899911284446716,
0.13243225216... | |
on the system would be greatly appreciated!
If you are using [Selenium IDE](http://selenium-ide.openqa.org/) to generate code, then you just get a list of every action that selenium will execute. To me, Selenium IDE is a good way to start or do a fast "try and see" test. But, when you think about maintainability and mo... | [
0.4707251191139221,
0.18868736922740936,
0.22480706870555878,
0.2004745900630951,
-0.06424833834171295,
-0.23832598328590393,
-0.012087023817002773,
0.06265436112880707,
-0.2573055922985077,
-0.49136754870414734,
0.11081124097108841,
0.26437315344810486,
-0.041842181235551834,
-0.187815949... | |
class GoogleTest {
private Selenium selenium;
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*firefox",
"http://www.google.com/webhp?hl=en");
selenium.start();
}
@Test
public void codingDojo... | [
0.40297314524650574,
-0.3004770874977112,
-0.08677766472101212,
0.132644921541214,
0.20443937182426453,
0.13213883340358734,
0.4798106253147125,
-0.1294952630996704,
0.41404369473457336,
-1.012980580329895,
-0.27806347608566284,
0.2022220939397812,
-0.6478708386421204,
0.17700521647930145,... | |
GoogleHomePage home = new GoogleHomePage(selenium);
GoogleSearchResults searchResults = home.searchFor("coding dojo");
String firstEntry = searchResults.getResult(0);
assertEquals("Coding Dojo Wiki: FrontPage", firstEntry);
}
@After
public void tearDown() throws Exceptio... | [
0.1689605861902237,
-0.1467636227607727,
0.42772895097732544,
-0.060052502900362015,
0.04200230911374092,
0.15016064047813416,
0.43847012519836426,
-0.2010769248008728,
0.39343976974487305,
-0.727843165397644,
-0.5535302758216858,
0.3708319067955017,
-0.5397761464118958,
0.4269599020481109... | |
public GoogleHomePage(Selenium selenium) {
this.selenium = selenium;
this.selenium.open("http://www.google.com/webhp?hl=en");
if (!"Google".equals(selenium.getTitle())) {
throw new IllegalStateException("Not the Google Home Page");
}
}
public ... | [
0.3890908360481262,
0.11508437246084213,
0.3267350494861603,
0.1226240023970604,
0.2836821973323822,
-0.2095455825328827,
0.5418623089790344,
-0.09484993666410446,
0.16861119866371155,
-0.43474310636520386,
-0.22243325412273407,
0.2480672150850296,
-0.6947734355926514,
0.4253329634666443,
... | |
selenium.type("q", string);
selenium.click("btnG");
selenium.waitForPageToLoad("5000");
return new GoogleSearchResults(string, selenium);
}
}
public class GoogleSearchResults {
private final Selenium selenium;
public GoogleSearchResults(String string, Selenium selenium... | [
0.011065525934100151,
-0.10277513414621353,
0.5802901983261108,
-0.26199856400489807,
0.17158100008964539,
0.36998310685157776,
0.5880626440048218,
0.038617298007011414,
0.31290286779403687,
-0.7634469866752625,
-0.6546128392219543,
0.09733486920595169,
-0.22662580013275146,
0.616025745868... | |
" - Google Search").equals(selenium.getTitle())) {
throw new IllegalStateException(
"This is not the Google Results Page");
}
}
public String getResult(int i) { | [
0.023722993209958076,
-0.2057948261499405,
0.34679555892944336,
0.000519534747581929,
0.2603744864463806,
-0.20705899596214294,
0.596466600894928,
-0.18428747355937958,
0.027438145130872726,
-0.34668031334877014,
-0.33822786808013916,
0.39986422657966614,
-0.6545631885528564,
0.15887403488... | |
String nameXPath = "xpath=id('res')/div[1]/div[" + (i + 1) + "]/h2/a";
return selenium.getText(nameXPath);
}
}
```
Hope that Helps | [
0.3321041762828827,
-0.43586575984954834,
0.44457337260246277,
-0.153651162981987,
0.3339848518371582,
0.03669467940926552,
0.44029417634010315,
-0.10369287431240082,
0.27076712250709534,
-0.7965238094329834,
-0.17426462471485138,
0.49122968316078186,
-0.5172915458679199,
0.106318518519401... | |
Attempt to send a message through a socket failed with WinSock error 10038. After around 40 seconds, messages are received successfully from the same socket and subsequently the send() is also succeeding in the same socket. This behaviour has been witnessed in Windows Server 2003. Is this any known behaviour with WinSo... | [
-0.27584415674209595,
-0.011507092043757439,
0.17151705920696259,
-0.1861889511346817,
-0.3406648337841034,
0.003016045317053795,
1.0341625213623047,
-0.04156838357448578,
-0.24905627965927124,
-0.497323215007782,
-0.3294428288936615,
0.5344191193580627,
-0.4861525893211365,
-0.22904054820... | |
it's C/C++, could it be that you are using an invalid socket handle? | [
0.4288182556629181,
0.2759004235267639,
-0.10757465660572052,
0.21173249185085297,
0.022662872448563576,
-0.21269473433494568,
0.05157017707824707,
0.10329274088144302,
-0.18631166219711304,
-0.19781829416751862,
0.04514094814658165,
0.3607725501060486,
-0.21730682253837585,
0.275779157876... | |
I've written a small hello world test app in Silverlight which i want to host on a Linux/Apache2 server. I want the data to come from MySQL (or some other linux compatible db) so that I can databind to things in the db.
I've managed to get it working by using the [MySQL Connector/.NET](http://www.mysql.com/products/co... | [
-0.034392550587654114,
0.035949427634477615,
0.6211146116256714,
-0.16508588194847107,
0.008888867683708668,
-0.01004983950406313,
0.5592403411865234,
-0.2110397219657898,
0.1936301440000534,
-0.7734186053276062,
-0.308057963848114,
0.2696841061115265,
-0.380610853433609,
0.300884038209915... | |
}
this.txtResults.Text = sb.ToString();
}
```
This works fine if I give the published ClickOnce app full trust (or at least SocketPermission) and **run it locally**.
I want this to run on the server and I can't get it to work, always ending up with permission exception (SocketPermission is not allowed).
The d... | [
0.6570155620574951,
0.1979406774044037,
0.4056195318698883,
-0.11001396924257278,
-0.3037742078304291,
-0.4006893038749695,
0.5974576473236084,
-0.08198808878660202,
-0.0390307679772377,
-0.8674008250236511,
0.1206616759300232,
0.5849435925483704,
-0.5166381001472473,
0.22189688682556152,
... | |
service so that it relays data to and from the client/db in a secure way? Are there any examples out there on the web?
Surely, I cannot be the first person who'd like to use a database to power a silverlight application?
The easiest way to do what you want (having read through your edits now :)) will be to expose serv... | [
0.8675910830497742,
0.16482768952846527,
0.15934276580810547,
0.19074086844921112,
-0.3240772783756256,
-0.4443802237510681,
0.4347134828567505,
-0.08759795129299164,
-0.23477797210216522,
-0.4859849810600281,
0.18575070798397064,
0.5508092641830444,
-0.44574493169784546,
0.268932729959487... | |
easiest for you to do right now would be to use a .NET service on a web server or maybe a PHP REST service, and then point your Silverlight app at that service. By doing so, you're protecting your database not only from people snooping through it, but more importantly, you're restricting what people can do to your data... | [
0.5824145078659058,
-0.1585412621498108,
0.33548828959465027,
0.49216896295547485,
0.17833533883094788,
-0.6448235511779785,
0.12824967503547668,
-0.1893647015094757,
-0.20890527963638306,
-0.6608420014381409,
0.01343147549778223,
0.5082715153694153,
-0.2748704254627228,
0.1736187040805816... | |
you choose will affect the code you write, but it's all going to be independent of your database. Your code can be structured such that it's a one-to-one mapping to your database table, or it can be far more abstract (you can set up classes that represent full logical views if you choose). | [
0.38386645913124084,
-0.22690065205097198,
-0.04197821393609047,
0.35722100734710693,
0.16320690512657166,
0.22413170337677002,
0.06793396174907684,
-0.09822596609592438,
-0.02434081956744194,
-0.8783641457557678,
0.03947843238711357,
0.45639434456825256,
-0.30881035327911377,
-0.021979132... | |
I have a folder on my server to which I had a number of symbolic links pointing. I've since created a new folder and I want to change all those symbolic links to point to the new folder. I'd considered replacing the original folder with a symlink to the new folder, but it seems that if I continued with that practice it... | [
0.34099721908569336,
0.2502160370349884,
0.12317989021539688,
-0.0013507696567103267,
0.07121503353118896,
0.20947246253490448,
0.3480605483055115,
0.17610444128513336,
-0.6993274092674255,
-0.6714903116226196,
0.35004401206970215,
0.04790828004479408,
-0.07297730445861816,
0.2774081230163... | |
pointing to a particular folder?
I'd use the find command.
```
find . -lname /particular/folder
```
That will recursively search the current directory for symlinks to `/particular/folder`. Note that it will only find absolute symlinks. A similar command can be used to search for all symlinks pointing at objects call... | [
0.032251905649900436,
0.09955186396837234,
0.5191739797592163,
0.06485089659690857,
-0.17610502243041992,
-0.2605358958244324,
-0.07143251597881317,
0.14457662403583527,
-0.11523625254631042,
-0.505996584892273,
-0.00444332929328084,
0.4817441403865814,
-0.31662631034851074,
0.205009981989... | |
I would like to know what kind of tool you use for writing your specifications. I think it's essential to use a tool that supports some kind of plain text format so that one can control the specification with a source control system like SVN. For the specification as for the code as well, it's important to have a histo... | [
0.6947388052940369,
0.30260372161865234,
0.26120269298553467,
0.22080209851264954,
0.029336875304579735,
-0.29316502809524536,
-0.17423608899116516,
-0.052712831646203995,
-0.059597503393888474,
-0.6316331624984741,
0.04651002958416939,
0.7854775786399841,
0.014847194775938988,
-0.04959178... | |
use for specifications.
DocBook edited with XXE, translated to pdf with xslt when needed to be sent to clients.
Best change ever, so much easier to write, so much easier to merge, and when it's converted it doesn't look so godawfully unprofessional as MSWord.
Plus the structured document style is already there, unlik... | [
0.06104243919253349,
-0.03146917745471001,
0.6323881149291992,
0.21515591442584991,
-0.12152664363384247,
-0.16312871873378754,
0.008517627604305744,
-0.12050646543502808,
0.055016450583934784,
-0.8951671719551086,
-0.08667314797639847,
0.6621586084365845,
-0.05486360192298889,
-0.12758207... | |
I have an OWL ontology and I am using Pellet to do reasoning over it. Like most ontologies it starts by including various standard ontologies:
```
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#... | [
0.30783119797706604,
0.2429208755493164,
0.17492865025997162,
-0.18544435501098633,
-0.349470853805542,
-0.3929887115955353,
0.2846486568450928,
0.003027827711775899,
0.12815378606319427,
-0.5042712092399597,
-0.11802934110164642,
0.3616372346878052,
-0.3957923650741577,
-0.006923822686076... | |
If it does, it suggests the application using Pellet is doing something incorrectly.
You may find more help on [the pellet-users mailing list](http://lists.owldl.com/mailman/listinfo/pellet-users/). | [
0.8015008568763733,
0.10180751979351044,
-0.07674720138311386,
0.15449044108390808,
-0.047552380710840225,
-0.33135849237442017,
0.29539254307746887,
0.15268445014953613,
-0.5151667594909668,
-0.6104431748390198,
0.03374766930937767,
0.4600602686405182,
-0.41845715045928955,
-0.07145443558... | |
I'm trying to integrate running Fitnesse tests from MSBuild im my nightly build on TFS.
In an attempt to make it self contained I would like to start the seleniumRC server only when it's needed from fitness.
I've seen that there is a "Command Line Fixture" but it's written in java can I use that?
I think you might be... | [
0.6272183656692505,
-0.10783057659864426,
0.11427676677703857,
0.09018947184085846,
-0.1733463853597641,
-0.15215475857257843,
0.10710270702838898,
0.03629148006439209,
0.15463154017925262,
-0.912999153137207,
0.20157580077648163,
0.625084400177002,
-0.32766464352607727,
0.1077601388096809... | |
want to run the process, keep it running during your build and then tear it down as your build finishes.
Therefore, I think you are probably going to need to create a custom MSBuild task to do this. See the following post for an example of a tasks that someone has created that will run asynchronously returning control... | [
0.2408905029296875,
-0.023100992664694786,
0.12199137359857559,
-0.10633581876754761,
-0.16555646061897278,
0.06256049871444702,
0.28697341680526733,
-0.06924092024564743,
-0.31359243392944336,
-0.7160788774490356,
-0.050159137696027756,
0.5277050733566284,
-0.26796936988830566,
0.07136321... | |
the process id that you created to an output property so that at the end of your build script you can call another custom MSBuild task that kills the process. It can do this by looking for the process id passed in as a variable in MSBuild and then call [Process.Kill](http://msdn.microsoft.com/en-us/library/system.diagn... | [
0.35190701484680176,
-0.11059229075908661,
0.2495599389076233,
0.03431401029229164,
0.032523881644010544,
0.1958828568458557,
0.20997513830661774,
-0.3942713141441345,
-0.18325980007648468,
-0.8286486268043518,
-0.0064736297354102135,
0.7268049716949463,
-0.3414016366004944,
0.204598933458... | |
RC starter task look for other seleniumRC processes and killing them before starting a new one - that way if a process didn't get closed properly for some reason, it would only run until the next build.
Anyway - my answer sounds like a lot of work so hopefully someone else will come up with an easier way. You might be... | [
0.7295736074447632,
-0.24936193227767944,
0.1362670361995697,
0.49186408519744873,
-0.1671038419008255,
-0.09825059771537781,
-0.1743634194135666,
-0.34222647547721863,
-0.29212212562561035,
-0.5007525682449341,
0.2057189792394638,
0.740955650806427,
-0.17492513358592987,
0.073254577815532... | |
and fires up seleiniumRC asynronously before running the test process and then kills it afterwards.
Good luck,
Martin. | [
0.36003533005714417,
0.5274658203125,
0.29109710454940796,
-0.07272949069738388,
0.19207562506198883,
-0.23494134843349457,
0.48217320442199707,
-0.007465707138180733,
0.1067596971988678,
-0.17094390094280243,
-0.12596967816352844,
0.4194224774837494,
0.0573207251727581,
0.4463600516319275... | |
Whilst refactoring some old code I realised that a particular header file was full of function declarations for functions long since removed from the .cpp file. Does anyone know of a tool that could find (and strip) these automatically?
You could if possible make a test.cpp file to call them all, the linker will flag t... | [
0.6310094594955444,
0.0286896750330925,
-0.06839824467897415,
0.35084396600723267,
0.09207906574010849,
-0.05042143538594246,
0.13572871685028076,
0.002620273968204856,
-0.3693923056125641,
-0.25146979093551636,
0.0746338739991188,
0.3542359173297882,
-0.14176541566848755,
0.19266530871391... | |
AFAIK one of the objectives of Stack Overflow is to make sure anyone can come here and find **good** answers to her Perl related questions. Certainly beginners would ask what is the [best online source to learn Perl](https://stackoverflow.com/questions/70573/best-online-%0Asource-to-learn-perl) but others might just wa... | [
0.1150042861700058,
0.04643882438540459,
0.25177326798439026,
0.0048082079738378525,
-0.08465122431516647,
0.024365626275539398,
0.3989312946796417,
0.025590036064386368,
-0.32605648040771484,
-0.14152461290359497,
0.03741319477558136,
-0.06117664650082588,
-0.027460405603051186,
-0.111035... | |
of your local [Perl Mongers](http://www.pm.org/) group.
Where do **you** go when you are looking for an answer to a Perl related question?
It's worth noting that <http://perlmonks.org>, in addition to the fora, has the Chatterbox, where simple questions can be answered immediately in conversation with other users.
It... | [
0.17056207358837128,
-0.32133322954177856,
0.3139263391494751,
0.31090208888053894,
-0.1518043428659439,
-0.17286400496959686,
0.2839552164077759,
0.06910276412963867,
-0.6218056082725525,
-0.2500060796737671,
-0.19816622138023376,
0.23769015073776245,
-0.17573276162147522,
-0.075918100774... | |
Has any one done this before? It would seem to me that there should be a webservice but i can't find one. I am writing an application for personal use that would just show basic info from IMDB.
There is no webservice available.
But there are enough html scrapers written in every language to suit your needs!
I've used... | [
0.5584360361099243,
0.2039407193660736,
0.2643371820449829,
0.21821725368499756,
-0.059089452028274536,
-0.07947200536727905,
-0.06536088138818741,
-0.18098606169223785,
-0.4683476388454437,
-0.32724907994270325,
0.16297969222068787,
0.390397846698761,
-0.0197386983782053,
0.28525564074516... | |
Imagine I have an function which goes through one million/billion strings and checks smth in them.
f.ex:
```
foreach (String item in ListOfStrings)
{
result.add(CalculateSmth(item));
}
```
it consumes lot's of time, because CalculateSmth is very time consuming function.
I want to ask: how to integrate multithr... | [
0.20260034501552582,
0.03400774300098419,
0.1998274326324463,
0.10812866687774658,
-0.019840294495224953,
0.27689215540885925,
0.2114894837141037,
-0.03871699422597885,
-0.5080187916755676,
-0.847499668598175,
0.3084266185760498,
0.42522314190864563,
-0.4113961160182953,
0.2187138795852661... | |
=>
result.add(CalculateSmth(item));
);
```
Of course result.add would need to be thread safe. | [
-0.04643741622567177,
-0.07319615036249161,
0.5455310940742493,
-0.08045630156993866,
0.023675993084907532,
-0.11610487103462219,
0.3605618178844452,
-0.2729826867580414,
-0.221656933426857,
-0.24133329093456268,
-0.16968803107738495,
0.31437423825263977,
-0.4030274450778961,
0.30764904618... | |
In cake 1.2 there is a feature that allows the developer to no have to create models, but rather have cake do the detective work at run time and create the model for you. This process happens each time and is neat but in my case very hazardous. I read about this somewhere and now I'm experiencing the bad side of this.
... | [
0.39573603868484497,
-0.06379740685224533,
-0.031049834564328194,
0.02001289650797844,
-0.16574932634830475,
-0.40364399552345276,
0.3744075298309326,
0.0855250284075737,
-0.07507640868425369,
-0.6757429838180542,
-0.06698828935623169,
0.4508759677410126,
-0.33933743834495544,
0.1166384145... | |
**I've narrowed it down to cake using this auto model feature instead of throwing and error**! So i have no idea what's wrong!
Does anybody know how to disable this auto model feature? It's a good thought, but I can't seem to find where i've gone wrong with my plugin and an error would be very helpful!
**Cake 1.2**
I... | [
0.22971150279045105,
0.019881755113601685,
0.2708999514579773,
-0.26636606454849243,
-0.03507578372955322,
-0.024553511291742325,
0.511566162109375,
-0.08518783003091812,
-0.12980036437511444,
-0.7518921494483948,
-0.1744384914636612,
0.7431405782699585,
-0.5150730013847351,
-0.03839328885... | |
/* Print out whatever debug info we have then exit */
pr($objects);
die("unable to find class $type, $plugin$class");
/* We don't want to base this on the app model */
${$class} =& new AppModel($options);
}
```
**Cake 2**
Costa recommends changing $strict to true in the init function on line 95 of `C... | [
0.0958806574344635,
-0.22437721490859985,
0.8536468744277954,
-0.2681877315044403,
0.21020333468914032,
-0.05980297550559044,
0.5476405620574951,
-0.13592414557933807,
0.10303596407175064,
-0.5484263896942139,
-0.5595187544822693,
0.809473991394043,
-0.28924494981765747,
-0.095529496669769... | |
I have two webapplication, one is a simple authenticationsite which can authenticate the logged in user and **redirects** him then to another site.
Therefore I have to pass ther userId (GUID) to the second application. Currently this is done via the URL but i would like to hide this id.
Has anybody an idea how to do ... | [
0.31194135546684265,
0.022326920181512833,
0.5144685506820679,
0.05966336652636528,
-0.2571403682231903,
-0.25522878766059875,
0.4996800124645233,
-0.21810154616832733,
-0.14705759286880493,
-0.7181688547134399,
0.08451392501592636,
0.4117727279663086,
-0.026273109018802643,
0.223037704825... | |
the local server, and remotely access that database from the other server to see if the user has successfully logged in and within session timelimit.
With that in mind, you can do the entire authentication remotely as well. Remotely connect to the local database from the remote server and check the login credentials f... | [
0.3751835227012634,
0.0814882218837738,
0.4208873212337494,
0.17632487416267395,
-0.2789451479911804,
-0.3702007830142975,
0.5002391338348389,
-0.04326409101486206,
-0.14360465109348297,
-0.6310024261474609,
-0.06747317314147949,
0.758211076259613,
0.04759984090924263,
0.13532988727092743,... | |
information in your HTML code! This is not the way to do it.
Best choice is the database option, or if not possible, then use HTTP POST. | [
0.3089829385280609,
-0.2258608043193817,
0.19598370790481567,
0.41828709840774536,
-0.19141483306884766,
-0.2604013979434967,
0.44083645939826965,
0.31918784976005554,
-0.05973658710718155,
-0.7876278162002563,
0.050617653876543045,
0.16001607477664948,
-0.22296395897865295,
0.107628434896... | |
In SQL Server 2000/2005,
Is it possible to force the default value to be written to already existing rows when adding a new column to a table **without** using NOT NULL on the new column?
You need two statements. First create the column with not null. Then change the not null constraint to nullable
```
alter table my... | [
-0.36952582001686096,
0.03799140080809593,
0.6947495937347412,
-0.16814309358596802,
-0.19018691778182983,
-0.07707811892032623,
0.03171472251415253,
-0.2889651656150818,
-0.19548296928405762,
-0.27375224232673645,
0.006128150038421154,
0.5707783699035645,
-0.6245262622833252,
-0.134867787... | |
I'm trying to automate a gdb session using the `--command` flag. I'm trying to set a breakpoint on a function in a shared library (the Unix equivalent of a DLL) . My cmds.gdb looks like this:
```
set args /home/shlomi/conf/bugs/kde/font-break.txt
b IA__FcFontMatch
r
```
However, I'm getting the following:
```
shlo... | [
-0.07071002572774887,
0.4022626578807831,
0.3776770830154419,
-0.13795940577983856,
-0.08604054152965546,
-0.26677048206329346,
0.3029874861240387,
0.08615174889564514,
-0.3656369149684906,
-0.15532924234867096,
-0.2429153174161911,
0.4742010831832886,
-0.9057133793830872,
0.03409102186560... | |
found)
Function "IA__FcFontMatch" not defined.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
```
So it doesn't set the breakpoint after all. How can I make it default to answer "y" to set breakpoints on pending future shared library load?
I recall that I was ... | [
-0.005817599594593048,
-0.014257176779210567,
0.3784481883049011,
0.10864777863025665,
0.5498369336128235,
-0.23285487294197083,
0.21036593616008759,
-0.11634599417448044,
-0.08477094024419785,
-0.46158015727996826,
-0.1749032735824585,
0.6125504374504089,
-0.46012523770332336,
0.091579057... | |
specific settings
show breakpoint pending -- Show debugger's behavior regarding pending breakpoints
```
And so **set breakpoint pending on** does the trick; it is used in `cmds.gdb` like e.g.
```
set breakpoint pending on
break <source file name>:<line number>
``` | [
0.14859065413475037,
-0.05369957163929939,
0.7134926915168762,
0.13628032803535461,
0.34271278977394104,
-0.2822454571723938,
0.05275122448801994,
0.02688848413527012,
-0.3298127055168152,
-0.4663916230201721,
-0.27496907114982605,
0.3936653137207031,
-0.24939927458763123,
0.27772551774978... | |
Using the GamerServices component for XNA to access Xbox/GfW Live for networking purposes requires developers and players each to have a US$100/year subscription to Microsoft's Creators Club. That's not much of an issue for Xbox360 XNA projects as you need the subscription anyway to be able to put your game on the 360.... | [
0.6834926009178162,
-0.09513154625892639,
0.09721238911151886,
0.5693598389625549,
-0.2552236318588257,
-0.3986997604370117,
-0.010382580570876598,
0.26924267411231995,
-0.1673850417137146,
-0.30050796270370483,
0.2776566445827484,
0.34227100014686584,
0.0373905673623085,
0.102518640458583... | |
to building their own networking functionality if they don't want to subject their players (and themselves) to that $100/head hit?
Perhaps you could try [Lidgren](http://code.google.com/p/lidgren-network-gen3) | [
0.13338467478752136,
-0.18865296244621277,
0.42482176423072815,
0.24598577618598938,
-0.05500340461730957,
-0.5080122947692871,
0.11039666086435318,
-0.19898231327533722,
-0.46621614694595337,
-0.294097363948822,
0.5335966348648071,
0.5328266024589539,
-0.03945806622505188,
-0.033422905951... | |
Any good tutorial with source that will demonstrate how to develop neural network (step bay step for dummies ;-))
Here is good example:
[Brainnet 1 - A Neural Netwok Project - With Illustration And Code - Learn Neural Network Programming Step By Step And Develop a Simple Handwriting Detection System](http://www.codepro... | [
0.3021741807460785,
-0.32378438115119934,
0.07985857129096985,
0.30839064717292786,
0.08810997754335403,
-0.12038001418113708,
0.14128534495830536,
0.03608071804046631,
-0.17071832716464996,
-0.5245075821876526,
0.09055083990097046,
0.44223201274871826,
0.06777409464120865,
-0.380203604698... | |
Say I have a table called myTable. What is the SQL command to return all of the field names of this table? If the answer is database specific then I need SQL Server right now but would be interested in seeing the solution for other database systems as well.
MySQL 3 and 4 (and 5):
```
desc tablename
```
which is an a... | [
-0.10507020354270935,
0.48246750235557556,
0.713966429233551,
-0.02422892302274704,
-0.2207498997449875,
-0.09902424365282059,
-0.13266168534755707,
-0.09486043453216553,
-0.3062221109867096,
-0.5168982148170471,
0.02391442097723484,
0.5183148384094238,
-0.25709274411201477,
0.384936630725... | |
On a class library project, I set the "Start Action" on the Debug tab of the project properties to "Start external program" ([NUnit](http://en.wikipedia.org/wiki/NUnit) in this case). I want to set an environment variable in the environment this program is started in. How do I do that? (Is it even possible?)
EDIT:
It... | [
0.08742204308509827,
-0.3202124536037445,
-0.07452407479286194,
-0.199582040309906,
-0.0866994857788086,
-0.2806820571422577,
0.17183539271354675,
-0.01926974020898342,
-0.09150174260139465,
-0.46874338388442993,
-0.16187085211277008,
0.4522092342376709,
-0.5347229838371277,
0.069516159594... | |
unit tests are now also run in .NET 2.0. I should probably just make a copy of the executable so it can have its own configuration file...
(I am keeping the question open (not accepting an answer) in case someone does happen to find out how (it might be useful for other purposes too after all...))
In Visual Studio 200... | [
0.28058239817619324,
-0.15786181390285492,
0.18190494179725647,
0.05501594394445419,
-0.2306394726037979,
0.009694971144199371,
0.28267768025398254,
-0.21337288618087769,
-0.10640701651573181,
-0.6027253866195679,
0.011953637935221195,
0.8313062191009521,
-0.18977762758731842,
-0.029035476... | |
to the path when debugging your application, set the 'Environment' value to "PATH=%PATH%;c:\foo\bin".
[](https://i.stack.imgur.com/TxoL0.jpg) | [
-0.08881867676973343,
0.0911484807729721,
0.3002427816390991,
-0.35113266110420227,
0.4366217851638794,
-0.1993532031774521,
0.52006995677948,
-0.12428530305624008,
-0.020752042531967163,
-0.6423059105873108,
-0.2672117054462433,
0.7436318397521973,
-0.5997767448425293,
-0.0309683587402105... | |
A rather comprehensive site explaining the difficulties and solutions involved in using a dll written in c/c++ and the conversion of the .h header file to delphi/pascal was posted to a mailing list I was on recently, so I thought I'd share it, and invite others to post other useful resources for this, whether they be l... | [
0.420855313539505,
0.19849079847335815,
0.037396278232336044,
0.2617246210575104,
-0.30917108058929443,
-0.3784118890762329,
0.0929110124707222,
0.06000177562236786,
-0.27258971333503723,
-0.7503947615623474,
-0.1307617425918579,
0.4153849482536316,
-0.12438257783651352,
-0.217118248343467... | |
is essential information when attempting this task. Here is the description:
> This article is meant for everyone who
> needs to translate C/C++ headers to
> Delphi. I want to share some of the
> pitfalls you can encounter when
> converting from C or C++. This article
> is not a tutorial, just a discussion
> of ... | [
0.1892314851284027,
0.09180096536874771,
0.19766923785209656,
0.007812568917870522,
-0.1963106095790863,
-0.29579535126686096,
0.26174360513687134,
-0.26155954599380493,
0.03972722217440605,
-0.789472222328186,
-0.14472396671772003,
0.6041566133499146,
-0.21534110605716705,
-0.229638963937... | |
code to Delphi:
[](https://i.stack.imgur.com/nwutf.png)
(source: [rvelthuis.de](http://rvelthuis.de/images/convertpackshaded.png))
His other relevant articles on this topic include:
* [Using C++ Objects in Delphi](http://rvelthuis.de/articles/articles-cppobjs.html)... | [
0.2610381543636322,
0.14420892298221588,
-0.18797710537910461,
-0.021603452041745186,
0.004485276062041521,
0.10975334793329239,
0.3019542098045349,
-0.2991224229335785,
-0.2535952031612396,
-0.35285529494285583,
-0.43196097016334534,
0.29634779691696167,
-0.5805799961090088,
-0.2121758311... | |
using `target="_blank"` in the `navigateToUrl`
with Firefox on Windows it opens in new tab, with Firefox on Mac it opens a 'popup',
How to make the window popup in a new tab on Firefox on Mac as well?
Check your Firefox preferences >> Tabs >> New windows should be opened in (a new window | a new tab). Do you have dif... | [
-0.13115501403808594,
-0.0769958645105362,
0.7231730222702026,
-0.2760881185531616,
0.09103699028491974,
-0.013183058239519596,
0.0727977380156517,
-0.06035519391298294,
-0.33531704545021057,
-0.8267929553985596,
-0.19118955731391907,
0.6291717886924744,
-0.3660886883735657,
0.071977995336... | |
After our Ruby on Rails application has run for a while, it starts throwing 500s with "MySQL server has gone away". Often this happens overnight. It's started doing this recently, with no obvious change in our server configuration.
```
Mysql::Error: MySQL server has gone away: SELECT * FROM `widgets`
```
Restarting... | [
-0.07082976400852203,
0.18071401119232178,
0.18426300585269928,
-0.01197054609656334,
0.09247710555791855,
-0.19027520716190338,
0.5914121270179749,
0.4610383212566376,
-0.45052194595336914,
-0.3732948303222656,
-0.3142738342285156,
0.3073726296424866,
-0.2621539235115051,
0.48926034569740... | |
is the code:
```
if defined?(ActiveRecord)
before_dispatch { ActiveRecord::Base.verify_active_connections! }
to_prepare(:activerecord_instantiate_observers) {ActiveRecord::Base.instantiate_observers }
end
```
The method `verify_active_connections!` performs several actions, one of which is to recreate any expire... | [
0.10449300706386566,
0.18311649560928345,
0.35879695415496826,
0.16914822161197662,
0.22668766975402832,
-0.2934959828853607,
0.3873426914215088,
-0.1936856061220169,
-0.3491666913032532,
-0.5262774229049683,
-0.2657495439052582,
0.4958656132221222,
-0.247640922665596,
0.09057660400867462,... | |
I have a problem that confuses my users, being that although an item is highlighted (by the hover style) when the user mouses over it, they have to mouse over the actual item text, sometimes quite small compared to the item. Is there a way to make the whole item clickable?
Add some padding to the A element? Or if it's ... | [
0.14642897248268127,
0.30511003732681274,
0.384680837392807,
-0.06253761053085327,
-0.16893048584461212,
0.07553183287382126,
-0.020032137632369995,
0.15214459598064423,
-0.2129431813955307,
-0.5541754961013794,
-0.19210107624530792,
0.07956428825855255,
-0.329580694437027,
0.0097729647532... | |
I recently heard of WSDL.Exe, but I am not sure where to find this program.
Does anyone know where I can find or download it?
You'll get it as part of a Visual Studio install (if you included the SDK), or in a standalone SDK install. It'll live somewhere like `C:\program files\Microsoft Visual Studio 8\SDK\v2.0\Bin`
I... | [
0.6800059080123901,
-0.03489557281136513,
0.28514429926872253,
0.06481917947530746,
0.029571542516350746,
-0.2669210731983185,
0.020742399618029594,
0.2678094506263733,
-0.1557190716266632,
-0.9160593748092651,
-0.08090169727802277,
0.40307024121284485,
-0.04323640093207359,
0.138449236750... | |
I'm wondering, how expensive it is to have many threads in waiting state in java 1.6 x64.
To be more specific, I'm writing application which runs across many computers and sends/receives data from one to another. I feel more comfortable to have separate thread for each connected machine and task, like 1) sending data,... | [
0.14054904878139496,
-0.021876340731978416,
0.35820141434669495,
0.08983279764652252,
0.013998394832015038,
0.30551382899284363,
0.0927625373005867,
-0.1897476762533188,
-0.6765235066413879,
-0.7452366352081299,
-0.002329770941287279,
0.2369886040687561,
-0.3089215159416199,
0.307274043560... | |
will be sleeping most of the time, so for optimization purposes I could reduce number of threads and give more job to each of them. Like, for example. reestablishing connection is responsibility of receiving thread. Or sending to all connected machines is done by single thread.
So is there any significant perfomance i... | [
0.4671802520751953,
-0.026596616953611374,
0.24098217487335205,
0.08937852084636688,
0.10620591789484024,
0.0009602754143998027,
0.1920221745967865,
-0.12313864380121231,
-0.8363849520683289,
-0.9603135585784912,
-0.10883454233407974,
0.40121152997016907,
-0.4020722508430481,
0.34986105561... | |
large.
I've been in this situation myself, and when the number of connections grew above 500 connections (about a thousand threads), you tend to get into lots of cases where you get OutOfMemoryError, since the threads stack space usage exceeds the maximum amount of memory for a single process. At least in our case, wh... | [
0.14455214142799377,
0.05998411402106285,
0.20402507483959198,
0.06039351969957352,
0.2194812297821045,
-0.0021899593994021416,
-0.20911496877670288,
0.014158070087432861,
-0.7233986258506775,
-0.6806246638298035,
0.20166702568531036,
0.39283332228660583,
-0.19552887976169586,
0.2519505918... | |
or whatever) is the way to go, making it possible to handle lots of connections in the same thread.
Having said that, you shouldn't encounter much of a problem with under a 100 threads on a reasonably modern server, even if it's probably still a waste of resources. | [
0.42796534299850464,
-0.07533631473779678,
0.4264864921569824,
0.2675754725933075,
0.0623205192387104,
-0.11608050763607025,
0.1911018043756485,
0.19687925279140472,
-0.6301982402801514,
-0.6137097477912903,
0.01549248956143856,
0.058169860392808914,
-0.0008870036690495908,
0.1698066741228... | |
The code below shows a sample that I've used recently to explain the different behaviour of structs and classes to someone brand new to development. Is there a better way of doing so? (Yes - the code uses public fields - that's purely for brevity)
```
namespace StructsVsClasses
{
class Program
{
static... | [
0.34139278531074524,
-0.1293557733297348,
0.14502137899398804,
-0.08081735670566559,
-0.07514014095067978,
0.05220554769039154,
0.4027002155780792,
-0.20129461586475372,
-0.048552390187978745,
-0.35475626587867737,
-0.019913045689463615,
0.5101640224456787,
-0.4677623510360718,
0.237262204... | |
struct1.IntegerValue = 3;
Console.WriteLine("struct1.IntegerValue: {0}", struct1.IntegerValue);
sampleStruct struct2 = struct1;
Console.WriteLine();
Console.WriteLine("struct1.IntegerValue: {0}", struct1.IntegerValue);
Console.WriteLine("struct2.IntegerValue:... | [
-0.46660029888153076,
-0.14215795695781708,
0.8889958262443542,
-0.3003460764884949,
0.0814134031534195,
0.5050625801086426,
0.389262855052948,
-0.4372982978820801,
0.04604213312268257,
-0.26909059286117554,
-0.3409188687801361,
0.4092762768268585,
-0.3747332692146301,
-0.04059742018580437... | |
Console.WriteLine("struct1.IntegerValue: {0}", struct1.IntegerValue);
Console.WriteLine("struct2.IntegerValue: {0}", struct2.IntegerValue);
sampleClass class1 = new sampleClass();
class1.IntegerValue = 3;
Console.WriteLine();
Console.WriteLine("class1.Integer... | [
-0.4360603094100952,
-0.27882328629493713,
0.6713770627975464,
-0.2609381079673767,
0.2362254410982132,
0.3563157916069031,
0.22303123772144318,
-0.3764527142047882,
0.10527975112199783,
-0.47706174850463867,
-0.2504376471042633,
0.26460352540016174,
-0.28262948989868164,
0.101886495947837... | |
Console.WriteLine();
Console.WriteLine("class1.IntegerValue: {0}", class1.IntegerValue);
Console.WriteLine("class2.IntegerValue: {0}", class2.IntegerValue);
class1.IntegerValue = 5;
Console.WriteLine();
Console.WriteLine("class1.IntegerValue: {0}", class1.Inte... | [
-0.5428772568702698,
-0.3001580536365509,
0.7765685319900513,
-0.205595925450325,
0.35856062173843384,
0.36393702030181885,
0.1364087611436844,
0.028724804520606995,
0.11780279874801636,
-0.6951409578323364,
-0.4289367198944092,
0.4911893606185913,
-0.16394168138504028,
0.16789759695529938... | |
Console.ReadKey();
}
}
struct sampleStruct
{
public int IntegerValue;
}
class sampleClass
{
public int IntegerValue;
}
}
```
The difference might be easier to understand when the struct/class is a member of another class.
Example with class:
```
class PointClass ... | [
-0.03976579010486603,
-0.2010519951581955,
0.4263576865196228,
0.030174585059285164,
0.04014304652810097,
0.15993131697177887,
-0.1414494812488556,
-0.4363338053226471,
0.041288863867521286,
-0.41964244842529297,
0.010881109163165092,
0.2887544333934784,
-0.2789355516433716,
0.199495285749... | |
0, Y = 0; }
}
static void Main() {
Circle c = new Circle();
Console.WriteLine(c.Center.X);
c.Center.X = 42;
Console.WriteLine(c.Center.X);
}
```
Output:
```
0
42
```
Example with struct:
```
struct Point {
int double X;
int double Y;
}
class Circle {
PointStruct Center = new PointStruct() { X = 0,... | [
-0.45413538813591003,
0.035898562520742416,
0.6590143442153931,
-0.3149808645248413,
-0.09869712591171265,
0.1598799079656601,
-0.03761487826704979,
-0.06472311913967133,
-0.17376862466335297,
-0.29945072531700134,
-0.526118814945221,
0.19660823047161102,
-0.3630317449569702,
0.35386314988... | |
While editing an aspx file I found both these opening tags used for seemingly the same thing. Is there a difference and if yes, what is it?
`<%=` is a equivalent to `<% Repsonse.Write()`
You can write any content out here: for example
```
<%=myProperty + " additional Text" %>
```
`<%#` is a binding expression. You... | [
0.4494333863258362,
-0.22335609793663025,
0.3274746835231781,
0.05281959846615791,
-0.1933450847864151,
-0.24613183736801147,
0.1375470608472824,
-0.1075267419219017,
-0.395723819732666,
-0.7558774948120117,
-0.20779134333133698,
0.4779309928417206,
-0.3681686222553253,
0.06659696251153946... | |
I'm trying to read data from a Delphi DBIV database, every time I access the database it creates a Paradox.lck and a Pdoxusrs.lck file. I'm using only a TQuery Object to do this (nothing else). can I access a Delphi DBIV database without it creating these lock files?
you could create a snprintf wrapper that returns -1 ... | [
0.11358517408370972,
0.03059394285082817,
-0.1227133497595787,
-0.05731445550918579,
-0.18266582489013672,
-0.14653365314006805,
0.35501861572265625,
-0.47303882241249084,
-0.190325528383255,
-0.8653382062911987,
-0.1265750527381897,
0.6257164478302002,
-0.5857132077217102,
0.1556030958890... | |
space. */
va_start(ap, fmt);
n = vsnprintf (p, size, fmt, ap);
va_end(ap);
/* If that worked, return the string. */
if (n > -1 && n < size)
return p;
/* Else try again with more space. */
if (n > -1) /* glibc 2.1 */ | [
0.0911157950758934,
-0.21956069767475128,
0.6084606051445007,
-0.24256496131420135,
0.0801055058836937,
0.5271744728088379,
0.4004722237586975,
-0.5973109006881714,
-0.4524649977684021,
-0.6376185417175293,
-0.3987935185432434,
0.43769559264183044,
-0.38617563247680664,
-0.0434634499251842... | |
size = n+1; /* precisely what is needed */
else /* glibc 2.0 */
size *= 2; /* twice the old size */
if ((np = realloc (p, size)) == NULL) {
free(p);
return NULL;
} else {
p = np; | [
-0.1825568974018097,
-0.1748851239681244,
0.36276906728744507,
-0.17942488193511963,
0.04948817193508148,
0.2514653205871582,
0.23352359235286713,
-0.5678159594535828,
-0.3685920536518097,
-0.41610628366470337,
-0.37450069189071655,
0.666195273399353,
-0.521415114402771,
-0.066116794943809... | |
}
}
``` | [
0.17493881285190582,
0.41805654764175415,
0.05209751054644585,
-0.04864929988980293,
0.437467485666275,
-0.15825650095939636,
0.13202530145645142,
0.5446501970291138,
0.35430577397346497,
-0.4846813380718231,
-0.2295716553926468,
0.546978771686554,
-0.3188462555408478,
0.2798506021499634,
... | |
Can someone explain to me the advantages of using an IOC container over simply hardcoding the default implementation into a default constructor?
In other words, what is wrong about this code?
```
public class MyClass
{
private IMyInterface _myInterface;
public MyClass()
{
_myInterface = new Defau... | [
0.18727020919322968,
0.2363407164812088,
0.07761427015066147,
0.07190750539302826,
-0.07866734266281128,
-0.23154379427433014,
0.2188539206981659,
-0.2343544214963913,
0.1487424075603485,
-0.8024286031723022,
-0.030942419543862343,
0.5367814898490906,
-0.3773287236690521,
0.231094077229499... | |
and mocking is easily done. In addition to which, the default constructor removes the computational overhead of the IOC container (not to mention the whole process is a lot more transparent).
The only benefits i can see to using an IOC container is if you need to switch out the implementation of your interfaces freque... | [
0.5065094232559204,
0.2966216504573822,
-0.27159735560417175,
0.36936065554618835,
-0.2511499524116516,
-0.29530471563339233,
0.3864234387874603,
0.1542857587337494,
-0.061704326421022415,
-0.5522221326828003,
0.18671157956123352,
0.40591856837272644,
-0.3342917561531067,
0.178620576858520... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.