text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I have worked with the .NET event model, but the majority of the details have been hidden from me (thanks Microsoft!). I understand that on a basic level, delegate instances are pointers to methods (a gross over-simplification, I know).
I understand that an anonymous method is essentially an in-line unnamed method gen... | [
0.32454776763916016,
0.04351382330060005,
-0.3331989347934723,
0.3221273422241211,
-0.15888382494449615,
-0.1996917724609375,
0.1557680070400238,
0.2741089165210724,
-0.3552261292934418,
-0.3330265283584595,
0.1341271698474884,
0.25043123960494995,
-0.29330572485923767,
0.19023475050926208... | |
basic level to which I understand these topics.
So, the challenge:
1. Can anyone tell me if at least on a basic level if my understanding of these items is even close? I'm not looking for complex esoteric minutiae, just the basics (for now).
2. To what degree do I need to truly understand these concepts before applyi... | [
0.446935772895813,
0.3194228410720825,
0.1705595701932907,
0.32351306080818176,
-0.16750720143318176,
-0.4801924526691437,
0.307309091091156,
-0.07622531056404114,
-0.13656729459762573,
-0.40686458349227905,
-0.08915170282125473,
0.45296236872673035,
0.49216923117637634,
-0.102017790079116... | |
to some good articles that explain these subjects and apply them to "real world" examples so that I can get my head around the basics of the topics and application of them? What I mean by real world, is how might I use this in the context of "Customers and Invoices" rather than abstract "Vectors and Shapes" or "Animals... | [
0.8758613467216492,
0.2609676718711853,
-0.1261242926120758,
0.3985942304134369,
0.033201612532138824,
0.09207059442996979,
0.08967240154743195,
0.4018590748310089,
-0.22366344928741455,
-0.42741110920906067,
0.19217467308044434,
0.43534985184669495,
0.2213083654642105,
0.00182130455505102... | |
patience, time and expertise.
1) Those descriptions sound pretty accurate to me. Sometimes anonymous methods and lambda expressions will need to create a new type to put the target of the delegate in, so they can act as [closures](http://csharpindepth.com/Articles/Chapter5/Closures.aspx).
2/3) I would read up a bit un... | [
0.23549897968769073,
-0.08600825816392899,
0.1426326036453247,
0.11954599618911743,
-0.09984636306762695,
-0.1312171220779419,
0.04083371162414551,
-0.13214562833309174,
-0.4315265417098999,
-0.486612468957901,
0.16196782886981964,
0.41966113448143005,
0.02696128748357296,
-0.2218860983848... | |
different purposes. They're all different ways of looking at the same functionality, but they can *feel* very different:
* Providing the code to call when you start a new thread
* Reacting to UI events
* Providing the filter, selection, ordering etc for a LINQ query
* Providing a callback for when an asynchronous oper... | [
0.3346112072467804,
-0.08385208994150162,
0.4296155273914337,
0.13584540784358978,
-0.12253648787736893,
-0.2753516137599945,
0.06329981237649918,
-0.25151583552360535,
-0.3859478235244751,
-0.4738044738769531,
-0.2740045189857483,
0.32888665795326233,
-0.2600760757923126,
-0.2163483798503... | |
expression trees yet. (They're cool, but one step at a time...) LINQ to XML is really just an XML API which works nicely with LINQ - from what I remember, the only times you'll use delegates with LINQ to XML are when you're actually calling into LINQ to Objects. (That's very nice to do, admittedly - but it means you ca... | [
0.30099067091941833,
0.007876070216298103,
0.402820885181427,
0.45238277316093445,
-0.15712015330791473,
-0.3397352695465088,
0.06335999816656113,
-0.22939161956310272,
-0.14557035267353058,
-0.5975496172904968,
-0.15809744596481323,
0.7408610582351685,
0.11689654737710953,
-0.546427607536... | |
few different examples of delegate use. | [
0.31133756041526794,
-0.020106807351112366,
-0.6306065320968628,
0.35595667362213135,
0.006070852745324373,
-0.1778496503829956,
0.007782969158142805,
0.08307814598083496,
-0.49649715423583984,
-0.48838236927986145,
0.027825094759464264,
-0.10028021782636642,
-0.32995396852493286,
0.288932... | |
I'm having difficulty throwing away the bits of the expression I don't want, and keeping the bits I do.
The problem is - given the input string:
```
{if cond}foo{else}bar{/if}
```
I'd like just to have:
```
0: {if cond}foo{else}bar{/if}
1: cond
2: foo
3: bar
```
And for the input string:
```
{if cond}foo{/if}
... | [
0.009260340593755245,
0.3437488079071045,
0.39814484119415283,
-0.17620688676834106,
0.058224208652973175,
0.12303142994642258,
0.27011802792549133,
-0.20718544721603394,
0.03495016321539879,
-0.3330068290233612,
-0.09831759333610535,
0.677516758441925,
-0.19384297728538513,
0.014432117342... | |
- including `{` in the body of an if statement is allowed to break the regex. The values of `foo` and `bar` can be anything that does not include a `{`.
Thanks,
Dom
What about this?
```
\{if ([a-z0-9]+)\}([^\{]*)(?:\{else\})?([^\{]*)\{/if\}
``` | [
-0.022522494196891785,
0.327007919549942,
0.473781019449234,
-0.08751124143600464,
0.2860894203186035,
-0.2689879536628723,
0.2664100229740143,
-0.2667989134788513,
0.02681354433298111,
-0.11752180755138397,
-0.44240763783454895,
0.8230856657028198,
-0.2622023820877075,
0.22904367744922638... | |
I wrote a quick and dirty wrapper around svn.exe to retrieve some content and do something with it, but for certain inputs it occasionally and reproducibly hangs and won't finish. For example, one call is to svn list:
```
svn list "http://myserver:84/svn/Documents/Instruments/" --xml --no-auth-cache --username myuser... | [
0.18394668400287628,
0.2604013979434967,
0.6673653721809387,
-0.07686936855316162,
0.08250368386507034,
-0.07855679839849472,
0.47176381945610046,
-0.3271864056587219,
-0.18861526250839233,
-0.6506794095039368,
-0.1512824147939682,
0.7633028030395508,
-0.29486334323883057,
0.15911491215229... | |
= false;
Process proc = Process.Start(psi);
StreamReader output = new StreamReader(proc.StandardOutput.BaseStream, Encoding.UTF8);
proc.WaitForExit(ms);
if (proc.HasExited)
{
return output.ReadToEnd();
}
```
This takes the full 5000 ms and never finishes. Extending the time doesn't help. In a separate command pr... | [
0.31483015418052673,
-0.3152684271335602,
0.5315691232681274,
-0.36216750741004944,
0.08194892108440399,
0.11669234186410904,
0.47225290536880493,
-0.32072949409484863,
-0.17289866507053375,
-0.4992370307445526,
-0.15084898471832275,
0.5265040397644043,
-0.15103034675121307,
0.204718202352... | |
screwing up here, and how can I debug this external process stuff?
EDIT:
I'm just now getting around to addressing this. Mucho thanks to Jon Skeet for his suggestion, which indeed works great. I have another question about my method of handling this, though, since I'm a multi-threaded novice. I'd like suggestions on ... | [
0.44189080595970154,
0.27285823225975037,
0.25776633620262146,
-0.043912503868341446,
-0.08122608065605164,
0.011269839480519295,
0.4209430515766144,
0.11599374562501907,
-0.3795910179615021,
-0.7378606200218201,
0.1568053960800171,
0.45417723059654236,
-0.27404332160949707,
0.281608730554... | |
ProcessBufferHandler(proc.StandardOutput.BaseStream,
Encoding.UTF8);
ThreadPool.QueueUserWorkItem(ProcessStream, bufferHandler);
proc.WaitForExit(ms);
if (proc.HasExited)
{
bufferHandler.Stop();
return bufferHandler.ReadToEnd();
}
```
... | [
0.01818171702325344,
-0.3485976755619049,
0.6050272583961487,
-0.42701640725135803,
0.2366149127483368,
0.3458655774593353,
0.31306707859039307,
-0.07053164392709732,
-0.45627361536026,
-0.5940005779266357,
-0.42448362708091736,
0.3647398054599762,
-0.5026874542236328,
0.5215591788291931,
... | |
StringBuilder sb;
public Encoding encoding;
public State state;
public enum State
{
Running,
Stopped
}
public ProcessBufferHandler(Stream stream, Encoding encoding)
{
this.stream = stream;
this.sb = new StringBuilder();
this.encoding = encoding;
... | [
-0.07651040703058243,
-0.21745626628398895,
0.4230893850326538,
-0.4197804927825928,
0.03719320520758629,
0.18816886842250824,
0.6625487208366394,
-0.34026458859443665,
-0.31822603940963745,
-0.5103445053100586,
-0.539320170879364,
0.09105169773101807,
-0.3968716561794281,
0.66552430391311... | |
}
public void ProcessBuffer()
{
sb.Append(new StreamReader(stream, encoding).ReadToEnd());
}
public string ReadToEnd()
{
return sb.ToString();
}
public void Stop()
{
state = State.Stopped;
}
}
```
This seems to work, but I'm doubtful that this is the best ... | [
0.4833235740661621,
-0.13374005258083344,
0.38797619938850403,
-0.33457744121551514,
0.289417564868927,
0.07715421169996262,
0.5923879146575928,
-0.3630922734737396,
-0.2967269718647003,
-0.5629705190658569,
-0.2107168734073639,
0.45235857367515564,
-0.40844401717185974,
0.3826448619365692... | |
be waiting for you to read its output. Create a separate thread to read from its standard output while you're waiting for it to exit. It's a bit of a pain, but that may well be the problem. | [
0.6408876776695251,
-0.19522474706172943,
0.0015666851541027427,
0.3519059121608734,
0.1398199051618576,
-0.09291315823793411,
-0.1064891517162323,
0.20001132786273956,
-0.14028646051883698,
-0.3475078046321869,
0.19991011917591095,
0.33748364448547363,
-0.19345293939113617,
0.212516754865... | |
I am exposing a web service using CXF. I am using the @XmlID and @XmlIDREF JAXB annotations to maintain referential integrity of my object graph during marshalling/unmarshalling.
The WSDL rightly contains elements with the xs:id and xs:idref attributes to represent this.
On the server side, everything works really ni... | [
0.300401896238327,
0.18843413889408112,
0.18128855526447296,
-0.07076630741357803,
-0.2657832205295563,
-0.12434577196836472,
0.2029872089624405,
-0.2785625159740448,
0.012313210405409336,
-0.8146655559539795,
0.11792457848787308,
0.5497447848320007,
-0.31763824820518494,
0.260964184999465... | |
references are either java.lang.String (to match the ID of the referenced type) or the same as the referenced type itself?
OK, so this isn't going to work. It's not possible for JAXB to generate code with the correct types for the IDREFs because the schema can't specify the types of references and there may be IDREF's ... | [
0.4275425374507904,
0.3078516721725464,
0.4130561947822571,
0.28724873065948486,
-0.00849325954914093,
-0.3040163218975067,
0.10933972150087357,
-0.3410452604293823,
-0.12242710590362549,
-0.48111945390701294,
0.30504295229911804,
0.5431928038597107,
-0.6107837557792664,
0.2771675586700439... | |
I have a script that addresses and sends an email but I need a body in the message **without creating a file** and then inserting the file with the standard MAIL commandline.
How can I do that?
Assuming the body you want to create is something you can write to SYS$OUTPUT (e.g. the output of a command procedure or DCL ... | [
0.7043119072914124,
-0.2911709249019623,
0.48378390073776245,
-0.10166553407907486,
-0.017446424812078476,
-0.03050862066447735,
0.028462421149015427,
-0.24942046403884888,
-0.07022629678249359,
-0.6357070803642273,
-0.06414607912302017,
0.47966986894607544,
-0.4230370819568634,
0.06752929... | |
added in OpenVMS V7.1. If you are somehow on an pre-7.1 system, then your only choice is writing to a temporary file and cleaning up.
Edit: To answer the comment, if you want to eliminate the interactive displays from the Mail command, you can redirect SYS$OUTPUT to NLA0:, as in:
```
$ PIPE DIR *.LOG | MAIL SYS$INPU... | [
0.16104666888713837,
-0.3436962068080902,
0.4703696668148041,
-0.2430538833141327,
-0.10723135620355606,
0.1134965643286705,
0.39300060272216797,
0.059410929679870605,
-0.37411409616470337,
-0.8318443894386292,
-0.20197737216949463,
0.43731626868247986,
-0.6237835884094238,
0.1965234875679... | |
My experience with MySQL is very basic. The simple stuff is easy enough, but I ran into something that is going to require a little more knowledge. I have a need for a table that stores a small list of words. The number of words stored could be anywhere between 1 to 15. Later, I plan on searching through the table by t... | [
0.1432444006204605,
0.13711053133010864,
0.1299651861190796,
0.05170876160264015,
-0.029140571132302284,
0.10482838749885559,
0.2925897240638733,
0.25357872247695923,
-0.05980421230196953,
-0.6945156455039978,
0.33617255091667175,
0.2535301446914673,
-0.22117120027542114,
0.281374722719192... | |
It seems really inefficient.
B.) Another option is to use just a single field, and store the data as a comma separated list. Whenever I come back to search, I would just run a regular expression on the field. Again, this seems really inefficient.
I would hope there is a good alternative to those two options. Any adv... | [
-0.027061162516474724,
-0.06372318416833878,
0.4687902629375458,
0.09056273847818375,
-0.16925673186779022,
-0.028988676145672798,
0.10989739000797272,
-0.03853987157344818,
-0.21810774505138397,
-0.48934078216552734,
-0.36427831649780273,
0.43162745237350464,
-0.31802859902381897,
-0.0967... | |
|
| 2 | 1 | bar |
| 3 | 2 | hydrogen |
| 4 | 4 | dasher |
| 5 | 2 | helium |
| 6 | 2 | lithium |
| 7 | 4 | dancer |
| 8 | 3 | winken |
| 9 | 4 | prancer |
| 10 | [
-0.23381644487380981,
0.2160951942205429,
0.024456389248371124,
0.05291971191763878,
-0.01411481760442257,
0.44244909286499023,
0.5774114727973938,
-0.427735835313797,
-0.07181697338819504,
-0.05032828450202942,
0.08498324453830719,
-0.024648716673254967,
-0.5360671281814575,
0.44885730743... | |
| 2 | beryllium |
| 11 | 1 | baz |
| 12 | 3 | blinken |
| 13 | 4 | vixen |
| 14 | 1 | quux |
| 15 | 4 | comet |
| 16 | 2 | boron |
| 17 | 4 | cupid |
| 18 | 4 | donner | [
-0.09822064638137817,
0.04929472506046295,
0.08066006749868393,
-0.12635383009910583,
-0.4147549569606781,
0.7434659600257874,
0.4345601797103882,
0.23753675818443298,
-0.43526506423950195,
-0.2652997374534607,
0.07851479947566986,
0.1282343566417694,
-0.4290628135204315,
0.601440906524658... | |
|
| 19 | 4 | blitzen |
| 20 | 3 | nod |
| 21 | 4 | rudolph |
+----+-----+-----------+
21 rows in set (0.00 sec)
```
This is the table I posted in this other question about [`group_concat`](https://stackoverflow.com/questions/397708/is-it-possible-to-concatenate-strings-from-multiple-rows-and-tables-in... | [
-0.3994647264480591,
0.010124349035322666,
0.4877277612686157,
-0.06858355551958084,
-0.016435690224170685,
0.1621672362089157,
0.3212018609046936,
-0.5771888494491577,
-0.5884429812431335,
-0.11628374457359314,
-0.4953168034553528,
0.19295449554920197,
-0.25306588411331177,
0.078272081911... | |
In Delphi, is normal do this:
```
ob = TObject.create;
try
//code
finally
ob.free;
end;
```
I wonder if that is similar in Obj-c.
You could do it that way, but exceptions tend to have a high cost in Objective-C. There are some differences in their performance between the 32-bit and 64-bit ABIs, as well as the in... | [
-0.037370357662439346,
-0.25603634119033813,
0.4968220591545105,
-0.16234023869037628,
-0.19037099182605743,
-0.32724136114120483,
0.24923522770404816,
-0.19300882518291473,
-0.12770618498325348,
-0.40166452527046204,
-0.39104411005973816,
0.7824680805206299,
-0.5194613933563232,
-0.246242... | |
be released the next time the autorelease pool is drained (usually at the end of the event loop), assuming that the exception is not fatal and causes your program to crash.
Apple has some [documentation](http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/Exceptions/Exceptions.html) about Obj-C exceptions
and [t... | [
0.37733927369117737,
-0.12303317338228226,
0.014714489690959454,
-0.11351445317268372,
0.051843952387571335,
-0.19709767401218414,
0.3942895233631134,
0.013937964104115963,
-0.30927661061286926,
-0.37557899951934814,
-0.771032452583313,
0.51687091588974,
-0.7166019082069397,
-0.46483460068... | |
I have no ideas how to fix this. In my /etc/TIMEZONE file the TZ variable has the correct value (Canada/Eastern) and still it's showing a -1 hour lag. Where else should I be looking?
You should check what your hardware clock is.
I would suggest doing this:
* Set the UTC time correctly. i.e. (5 AM in the example):
$ d... | [
0.5572255849838257,
0.5426366329193115,
0.8352103233337402,
0.28208547830581665,
0.30598095059394836,
-0.040112003684043884,
-0.09483549743890762,
0.21107128262519836,
-0.10859622806310654,
-0.7974194288253784,
0.10337739437818527,
0.6158618330955505,
0.1333463191986084,
-0.224712222814559... | |
I run Selenium tests with Selenium RC from .NET (c#).
In some cases, I would like to keep the test case source as HTML (to be able to modify it from Selenium IDE), but I would like to run/include these tests from my c# unit tests.
Maybe it is obvious, but I can't find the API method in the Selenium Core to achieve th... | [
0.9759372472763062,
0.23551030457019806,
-0.1924094259738922,
-0.10059397667646408,
-0.19621726870536804,
-0.3584255278110504,
0.200502410531044,
-0.10140921175479889,
0.19767411053180695,
-0.5484753847122192,
0.19621038436889648,
0.6075274348258972,
-0.3686439096927643,
-0.010137705132365... | |
in automated functional testing, more to the BDD/ATDD/Specification by Example direction with [SpecFlow](http://www.specflow.org).
I only realize it now however that I have implemented a solution for this concrete question during my experiments. I share my solution, maybe can help others.
I have created a small parse... | [
0.4209021031856537,
-0.1643696129322052,
0.15865929424762726,
0.2251594215631485,
-0.27791428565979004,
0.19398877024650574,
0.2461620718240738,
-0.7140319347381592,
0.10730288922786713,
-0.5143417716026306,
0.006995743606239557,
0.44831299781799316,
-0.17821358144283295,
0.078287698328495... | |
I have a client-server application written in Java using CORBA for the communication. The ORB used is orbd, the one provided by the Java6 platform. I have to replace the Java server implementation with another one written in C++. So the question is, of the free source implementations of CORBA libraries, which one bette... | [
-0.04815352335572243,
0.277567982673645,
0.3240462839603424,
-0.07549938559532166,
-0.3279757797718048,
-0.053083863109350204,
0.002865477465093136,
0.015509028919041157,
-0.13169464468955994,
-0.7203441858291626,
0.07931327074766159,
0.46128392219543457,
-0.5392313599586487,
0.08242247998... | |
should take into account?
It's a long time I didn't use CORBA for Java and C++ interoperability, so maybe my answer will be a bit outdated.
What I found to work very well together was omniORB (C++) and JacORB (Java). You may search for those libraries on google and see if they are still supported.
I also remember I h... | [
0.10611174255609512,
0.3092424273490906,
-0.038370281457901,
-0.1717771291732788,
-0.3107655942440033,
-0.23774339258670807,
0.2390572428703308,
0.03890201449394226,
-0.10113437473773956,
-0.5241803526878357,
0.26737070083618164,
0.7633489370346069,
-0.4334932267665863,
0.13353422284126282... | |
Right now I'm trying to figure out a way to do things smarter, and in the course of doing so all i've managed to do is use a full bottle of excedrin in a single day.
Assume i have an interface called IRepository like so.
```
public interface IRepository<T>
{
T Get(int id);
void Add(T value);
void Update... | [
0.4005415737628937,
0.10191362351179123,
0.7028558850288391,
-0.041867535561323166,
0.10913538932800293,
-0.022426143288612366,
0.25893858075141907,
-0.01230804156512022,
0.011697418056428432,
-0.6379410624504089,
-0.007015802897512913,
1.0981206893920898,
-0.4679809510707855,
-0.074634253... | |
basic operations against the repository to support all CRUD functionality, but i may want specialized operations, so assume i have an interface like this:
```
public interface IUserRepository : IRepository<User>
{
IList<User> GetUsersByRole(Role role);
}
```
And an implementation like such:
```
public class Us... | [
-0.28997066617012024,
-0.010940802283585072,
0.20295953750610352,
0.060483139008283615,
-0.24192936718463898,
-0.05373216047883034,
0.11187298595905304,
-0.06388528645038605,
-0.16764621436595917,
-0.7604409456253052,
0.05069966986775398,
0.9130184650421143,
-0.43953627347946167,
-0.062577... | |
for IRepository, i'll get it wrapped by a LoggingRepository and a TransactionRepository, both of which implement IRepository.
So, what i want to do is something like this:
```
IUserRepository repository = container.Resolve< IUserRepository>();
```
and have it return a user repository that's wrapped in the Logging a... | [
-0.07729960978031158,
0.1308218538761139,
0.3660334348678589,
0.05174306780099869,
-0.16489841043949127,
0.09963231533765793,
0.21523700654506683,
-0.013895802199840546,
-0.2912801504135132,
-0.9131995439529419,
0.06785427033901215,
0.7026844024658203,
-0.3580196797847748,
0.11799674481153... | |
Repository = innerRepository;
}
}
```
This would mean that we would use Dependancy Injection to create a decorated repository and pass that into the constructor of the UserRepository and then use that as the repository in which we run operations against. This would work, but i still don't think it's ideal.
So, m... | [
0.18556775152683258,
0.22812530398368835,
0.050720904022455215,
0.19112180173397064,
-0.006958498619496822,
0.2527962625026703,
0.17110444605350494,
-0.08527284860610962,
-0.08156834542751312,
-0.6461734771728516,
0.09032873809337616,
0.733232855796814,
-0.25783127546310425,
0.055377423763... | |
this problem?
If you are going to use [decorators](http://en.wikipedia.org/wiki/Decorator_pattern) that sounds about right. Each decorator would have a constructor with an argument of IRepository and call the logging or transaction code around calls to the inner repository that it is decorating.
As an alternative you ... | [
0.4317513108253479,
0.12861263751983643,
-0.1544497311115265,
0.22574615478515625,
0.12384407222270966,
0.14297229051589966,
-0.018864722922444344,
-0.21504074335098267,
-0.29934370517730713,
-0.6468349099159241,
0.2477140724658966,
0.6560890674591064,
-0.365291565656662,
0.140718385577201... | |
the case of the [SpringFramework.net](http://www.springframework.net/doc-latest/reference/html/aop.html) at time of injection. | [
0.014204570092260838,
-0.35522034764289856,
0.15367740392684937,
0.002071503782644868,
0.10915423929691315,
0.26408615708351135,
-0.005067839287221432,
-0.21200621128082275,
-0.22605720162391663,
-0.29479146003723145,
-0.18286986649036407,
0.1093362346291542,
-0.11247242242097855,
-0.14007... | |
I have a `HashMap` (although I guess this question applies to other collections) of objects. From what I understand, when the documentation talks about removing mappings, then it is removing the entry from the hashtable, i.e. not necessarily destroying the actual object. If the only remaining reference to the object is... | [
-0.009256620891392231,
0.18044976890087128,
0.05240202322602272,
0.28159937262535095,
0.16848193109035492,
-0.3488534688949585,
0.03815033286809921,
-0.019584141671657562,
-0.3293415606021881,
-0.6547272801399231,
0.01064032968133688,
0.2902076542377472,
-0.16572214663028717,
0.26586735248... | |
the collection is the last place these objects are referenced they are eligible for garbage collection after they have been removed from the collection. And no, you can not destroy these objects forcefully. The garbage collector will handle them when it feels like it. | [
0.45644599199295044,
0.36254796385765076,
0.6502277255058289,
0.4096827208995819,
0.15358805656433105,
-0.4835342764854431,
0.0037777004763484,
0.11359785497188568,
-0.49382483959198,
-0.33910927176475525,
-0.37353256344795227,
0.45055726170539856,
0.06450887024402618,
0.36795809864997864,... | |
When I try to list Synthesizer devices in Java (1.6.0), I get only one device, *Java Sound Synthesizer*. I want to use the Synthesizer in the sound card or use any other installed synthesizer, eg. the Microsoft Synthesizer. How can I go about doing that ? If this capability is not inbuilt, is there any open source proj... | [
0.06908269226551056,
0.19771519303321838,
0.2448163479566574,
-0.16092532873153687,
0.19311995804309845,
0.2823689579963684,
0.02151888981461525,
-0.2600628435611725,
-0.10528358817100525,
-0.3972862660884857,
0.0438896007835865,
0.7399789094924927,
-0.46213945746421814,
0.2099013775587082... | |
a.Bid
AND [my filter condition]
```
should work | [
0.22838212549686432,
-0.14281316101551056,
0.06542886048555374,
-0.19675976037979126,
-0.09444894641637802,
-0.2619270086288452,
-0.04326743632555008,
-0.4676925837993622,
0.38914433121681213,
-0.5889256596565247,
-0.11959186941385269,
0.879795491695404,
-0.23956221342086792,
-0.0993881896... | |
I'm looking for some quick thoughts about a business application I am looking to build. I'd like to separate the three layers of **presentation**, **domain logic**, and **data** using **PHP**, **Python**, and **PostgreSQL**, respectively. I would like to hear, possibly from other folks who have gone down this path befo... | [
0.5866499543190002,
0.3799240291118622,
0.0597793310880661,
0.0625229999423027,
-0.31409379839897156,
-0.12955260276794434,
0.09228241443634033,
0.37254658341407776,
-0.3026008903980255,
-0.8965831995010376,
0.10496504604816437,
0.6141238212585449,
-0.06669226288795471,
-0.0896808505058288... | |
I hear can find more Python programmers that also have subject-matter skills (in this case, finance), and it's an open source language. Plus, it seems easier to code with.
* I'm looking at **PostgreSQL** for the transaction-level features. **MySQL** is also an option here, but I don't need to debate this aspect.
This ... | [
0.6378794312477112,
0.24388186633586884,
0.012076377868652344,
-0.0063682482577860355,
0.039355404675006866,
-0.2667883336544037,
0.028422048315405846,
0.4644182324409485,
-0.5277005434036255,
-0.5141828060150146,
0.026575269177556038,
0.724439799785614,
-0.029078936204314232,
-0.106374241... | |
are able to upgrade the database or domain logic or interface separate from the other layers in the future.
*I'm NOT looking for a buy vs. build debate*, as that's a different discussion.
Thanks for any insight
Look at [Django](http://www.djangoproject.com).
Python code. A template language that permits some of the ... | [
0.7776205539703369,
0.20337851345539093,
0.10836213827133179,
0.07348351925611496,
-0.1567493975162506,
-0.4105410575866699,
0.21319714188575745,
-0.04929884150624275,
-0.155384361743927,
-0.45212945342063904,
0.13533055782318115,
0.8608790636062622,
-0.2442634552717209,
-0.121586017310619... | |
processing in the Django view functions. Render the results as HTML in the template.
Also, Django has an ORM layer to divorce you from petty SQL considerations. MySQL or PostgreSQL are more-or-less equivalent from within Django.
---
**Edit**
"Maturity" means a lot of things. You specifically mentioned skilled peopl... | [
0.17869502305984497,
0.17130525410175323,
0.17908993363380432,
0.07737819850444794,
-0.34405049681663513,
-0.5845203399658203,
0.21859006583690643,
0.020465588197112083,
-0.16524644196033478,
-0.6565843820571899,
0.056867703795433044,
0.805133581161499,
0.022831866517663002,
-0.44869661331... | |
configuration with some care because there are several moving parts. This, however, is the same Apache config problem you have with PHP -- nothing new here.
* A Django site has one or more Django server instances, each with a settings file, a URL mapping and any number of applications. Pure Python at this point.
* A Dj... | [
0.29179853200912476,
0.08175152540206909,
0.22062449157238007,
0.2784370481967926,
-0.27579420804977417,
-0.12951241433620453,
0.04131213575601578,
-0.06760747730731964,
-0.20876041054725647,
-0.8235511183738708,
0.12230423837900162,
0.4830576777458191,
-0.1544356495141983,
-0.154212489724... | |
models because they think either too high-level-uber-generic or they think too much in SQL. Django is a middle ground of mostly object-orientation with some SQL consideration. Get this, and you're unstoppable.
* A Django application may have templates, which are in their own template language. This would be about the o... | [
0.302058607339859,
0.008837427012622356,
0.48569172620773315,
0.41759756207466125,
-0.1716214120388031,
-0.39282435178756714,
0.06879425048828125,
-0.06659486889839172,
-0.20640364289283752,
-0.5825233459472656,
0.22564102709293365,
0.7607696652412415,
-0.5023601651191711,
-0.0339426286518... | |
free to write all the transactional stuff you want. But you don't have to. This leads you to a very, very powerful hybrid.
+ You write a few complicated, critical transactions. Pure Python, BTW.
+ You don't write any of the dumb table-maintenance transactions. No code at all is superior to Python or PHP.
+ After yo... | [
0.34082818031311035,
0.0708111822605133,
0.21693789958953857,
0.36563947796821594,
-0.17852896451950073,
-0.35414227843284607,
-0.022389205172657967,
0.07428856194019318,
-0.20393213629722595,
-0.4869207739830017,
-0.15382054448127747,
0.7864792943000793,
-0.1758381575345993,
-0.5484260916... | |
requires some care in doing things simply and cleanly. The template is it's own language, but considerably simpler than PHP. The rest is SQL, Javascript, HTML, CSS, Apache and what-not.
---
**Edit**
Django Maturity
* See <http://www.djangoproject.com/community/> for the number of active projects.
* Join <http://gro... | [
0.4209515154361725,
0.32806098461151123,
0.136336088180542,
-0.457533061504364,
-0.6475228667259216,
-0.38715335726737976,
0.06565886735916138,
0.09474378824234009,
0.015560105443000793,
-0.5300443172454834,
0.24008986353874207,
0.39158639311790466,
-0.25359290838241577,
-0.167511761188507... | |
This question is probably better phrased: how does running a Java server on a hypervisor such as VMware ESX affect the Java heap?
* Access to JVM heap is random from the OS/hypervisor perspective
* It is difficult to for guest OS or hypervisor to optimize memory that is randomly accessed
* Given this, can the hypervis... | [
-0.0008706228691153228,
-0.28581568598747253,
-0.10264039784669876,
0.18469293415546417,
-0.2851417660713196,
-0.2470553070306778,
0.06726281344890594,
-0.16180403530597687,
-0.34236717224121094,
-0.6389725804328918,
0.0005006866995245218,
0.4040619134902954,
-0.2733519673347473,
0.0789487... | |
heap size to 1GB, your Java process will grab 1GB of contiguous virtual address space (+ whatever is needed for the binaries), memory which is no longer available to other applications.
Is VMware smart enough to detect that some of this heap is in fact unused? How does this affect GC performance? Would it be better to... | [
-0.02124987542629242,
-0.05816865339875221,
0.06857727468013763,
0.07913994789123535,
-0.23204748332500458,
-0.1118423119187355,
0.038017429411411285,
-0.23599685728549957,
-0.48869919776916504,
-0.6954787969589233,
-0.06695865839719772,
0.2338324338197708,
-0.1816883683204651,
0.091257691... | |
Java on VMware guests: [link text](http://communities.vmware.com/servlet/JiveServlet/download/1142080-17786/Best%20Practices%20for%20Java%20in%20Virtual%20Machines%20on%20VMwareESX.pdf "Java in Virtual Machines on VMware ESX: Best Practices") | [
-0.22809767723083496,
-0.024326181039214134,
0.05654677748680115,
-0.1514439880847931,
-0.11387762427330017,
-0.1508854180574417,
0.5504920482635498,
-0.1115466058254242,
-0.44344520568847656,
-0.29342135787010193,
-0.4853253960609436,
0.5506893992424011,
-0.13579301536083221,
-0.142040684... | |
I need to find out the prime factors of over 300 billion. I have a function that is adding to the list of them...very slowly! It has been running for about an hour now and i think its got a fair distance to go still. Am i doing it completly wrong or is this expected?
Edit: Im trying to find the largest prime factor of... | [
0.17719118297100067,
0.2776378095149994,
0.6571001410484314,
-0.09573305398225784,
0.12118420749902725,
0.1749897450208664,
0.32763928174972534,
-0.24894286692142487,
-0.3453628122806549,
-0.6883501410484314,
0.15333989262580872,
0.6663817167282104,
-0.2614971697330475,
0.31087666749954224... | |
{
if (Number % DividingNumber == 0)
{
ListOfPrimeFactors.Add(DividingNumber);
Number = Number/DividingNumber;
}
else
DividingNumber++;
}
ListOfPrimeFactors.Add(Number); | [
-0.08564015477895737,
-0.18103544414043427,
0.43070170283317566,
-0.5574526190757751,
-0.004279686138033867,
0.05462406575679779,
-0.07179706543684006,
-0.6374046206474304,
-0.055800896137952805,
-0.3304682970046997,
-0.35356584191322327,
0.7235310077667236,
-0.6728999614715576,
0.03543755... | |
listBox1.DataSource = ListOfPrimeFactors;
}
}
```
Are you remembering to divide the number that you're factorizing by each factor as you find them?
Say, for example, you find that 2 is a factor. You can add that to your list of factors, but then you divide the number that you're trying to factorise by that value.... | [
0.39825427532196045,
0.04002223536372185,
0.2814376652240753,
-0.14192306995391846,
-0.06748337298631668,
-0.007144941948354244,
0.07754936069250107,
-0.25108030438423157,
-0.7484661936759949,
-0.5885870456695557,
-0.009522695094347,
0.5877144932746887,
-0.5860971212387085,
0.1167855709791... | |
2 again.
And so on... | [
-0.1982973963022232,
0.035892024636268616,
0.20999719202518463,
-0.050486963242292404,
-0.4131295382976532,
-0.06611277908086777,
0.2210228592157364,
-0.2558283507823944,
-0.03447064757347107,
-0.5641614198684692,
-0.13988220691680908,
0.3714578151702881,
0.03667203709483147,
-0.1079248115... | |
I have a crystal report function which requires me to trim off characters which start with a "-" and delete the rest following the the "-" (dash).
For example, I would have order number 00000112345-C43-PJ.
How would I just trim off everything from the right of the "-" get the result as 00000112345?
I looked for a ... | [
-0.04970848932862282,
0.2144487351179123,
0.23258808255195618,
-0.07374900579452515,
-0.34440428018569946,
0.33220115303993225,
0.2821841835975647,
-0.03172241523861885,
-0.060803405940532684,
-0.47991591691970825,
-0.1688094288110733,
0.36274147033691406,
-0.19427791237831116,
0.221756994... | |
What advantages does SQLServer CLR offer over T-SQL? Is using .NET syntax easier than T-SQL? I see that you can define user types, but I'm not quite clear on why that's better. For example, you could define an email type and it would have a prefix property and a domain property. You could then search on domain or prefi... | [
0.19724249839782715,
0.011070194654166698,
0.6012738943099976,
0.22908437252044678,
-0.4320807158946991,
-0.12460728734731674,
-0.25442877411842346,
-0.12012895941734314,
-0.24914854764938354,
-0.5481781959533691,
0.2664378583431244,
0.6054630279541016,
-0.22020307183265686,
0.046903923153... | |
example: CLR has a built in RegEx object, which is sorely lacking in SQL Server. Now it's trivial to write functions to do regex-based validation constraints/repairs. | [
-0.18101032078266144,
0.12347029894590378,
0.3187403678894043,
0.2663698196411133,
-0.05812830850481987,
-0.31190943717956543,
0.14648324251174927,
0.01755182258784771,
-0.2413472980260849,
-0.14379063248634338,
-0.010999290272593498,
0.45604386925697327,
-0.3378187417984009,
0.11397345364... | |
I'm wondering how one could use template databinding to accomplish what the following code produces (a grid of checkboxes with some associated text):
```
int tbIndex = 0;
for (int i = 1; i < 5; i++) {
StackPanel pan = new StackPanel();
pan.Orientation = Orientation.Horizontal;
... | [
0.31321316957473755,
-0.026004280894994736,
0.6926600933074951,
-0.23734688758850098,
0.08304297178983688,
0.3348010182380676,
0.09400375187397003,
-0.6852986216545105,
-0.3498750627040863,
-0.6751500964164734,
-0.15248511731624603,
0.33967623114585876,
0.06786925345659256,
0.2327414453029... | |
pan.Name = "RowPanel" + i;
for (int j = 0; j < 3; j++) {
CheckBox cb = new CheckBox();
TextBlock block = new TextBlock();
block.Width = 75; | [
0.029010210186243057,
0.24540799856185913,
0.22453080117702484,
-0.4262325167655945,
0.17577427625656128,
0.6111987233161926,
0.23700730502605438,
-0.39910462498664856,
-0.4080970585346222,
-0.7802667021751404,
-0.14612293243408203,
0.08635091036558151,
-0.23652000725269318,
0.203263580799... | |
block.Text = "Item " + (++tbIndex).ToString();
pan.Children.Add( cb );
pan.Children.Add( block );
}
ContentPanel.Children.Add( pan );
}
```
In ASP.NET, for example, one could use a DataList and set the repeat direction to horizontal and bind. | [
0.28873270750045776,
-0.22710447013378143,
0.26535314321517944,
-0.016019446775317192,
0.09327863901853561,
0.12582366168498993,
0.11012020707130432,
-0.22428350150585175,
-0.36510738730430603,
-0.7365546226501465,
-0.32171010971069336,
-0.1279137283563614,
-0.2896709144115448,
0.425811797... | |
Is there an equivalent way that is less imperative and more declarative (ie. done up front with a template and using generic "databinding" facilities)?
AnthonyWJones has it right that the Wrap Panel is a good approach but Kent went through the trouble of demonstrating how once could use the ItemSource (albeit with the ... | [
-0.19874149560928345,
-0.10423204302787781,
0.37299320101737976,
0.06775619834661484,
-0.30513063073158264,
0.22361460328102112,
0.011397902853786945,
-0.40077129006385803,
-0.3798544406890869,
-0.5652289986610413,
-0.2937193810939789,
0.19044093787670135,
0.21790508925914764,
-0.448625385... | |
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Width="100">
<CheckBox IsChecked="{Binding MyCheckedProperty, Mode=TwoWay}" x:Name="IsSelectedCheckBox" Height="25"></CheckBox>
<Te... | [
-0.3190363347530365,
-0.08353804051876068,
0.5935877561569214,
0.06672106683254242,
-0.16768622398376465,
0.3896680772304535,
-0.13712145388126373,
-0.4833965599536896,
-0.36123207211494446,
-0.6808423399925232,
-0.10802197456359863,
0.01585896499454975,
0.3201107978820801,
-0.124524191021... | |
</ItemsControl.ItemTemplate>
</ItemsControl>
```
A small gotcha is that the DataTemplate expects a single child so using a StackPanel with horizontal orientation keeps things flowing. | [
-0.28225451707839966,
-0.16248498857021332,
0.46322259306907654,
0.3621738851070404,
0.07131191343069077,
0.16116289794445038,
-0.10666660219430923,
0.028526023030281067,
-0.1140313670039177,
-0.6151441335678101,
-0.35581013560295105,
0.050508465617895126,
0.44335290789604187,
-0.126398786... | |
I've written an installer using NSIS and I need it to install some files (DLLs etc.) in a standard location like C:/Program Files/App Name/. I also need to install files in the current user's Application Data directory. The problem is that when the user is not an admin on Vista I need to elevate privileges and in doing... | [
0.3842596709728241,
0.4086037576198578,
0.5377435088157654,
-0.09426785260438919,
0.23609019815921783,
-0.25964653491973877,
0.21533295512199402,
-0.059210363775491714,
0.039492685347795486,
-1.0041505098342896,
-0.24493558704853058,
0.8299828171730042,
-0.24015799164772034,
0.273844212293... | |
can't grab the username and then elevate. Is there some reasonable way to figure out who the actual user is when I'm running an installer as an admin?
Edit:
Unfortunately having the data copied on first run is not an option. The app won't work without the thing I'm writing to the user's directory because it's a MS Wo... | [
0.19655422866344452,
0.043939027935266495,
0.4600142538547516,
0.05661165714263916,
-0.014108898118138313,
-0.18796908855438232,
0.257548987865448,
-0.08666492998600006,
-0.13162611424922943,
-0.9711923003196716,
-0.2129991352558136,
0.6387966275215149,
-0.5555348992347717,
0.0663431435823... | |
as soon as you launch the installer. This spawns a second instance of your installer that does all of the work. But you can make calls to code segments that will run in the original process as the user that launched the installer.
So you could have an installer section like so:
```
Section "Install My Program" SecMai... | [
0.5684630274772644,
-0.18329936265945435,
0.8144922852516174,
-0.05411491543054581,
0.1801995038986206,
-0.259483277797699,
0.1476038247346878,
0.062149081379175186,
-0.08685703575611115,
-0.8131957650184631,
-0.3460596799850464,
0.9104864597320557,
-0.30896061658859253,
0.1511876285076141... | |
I need ideas to implement a (really) high performance in-memory Database/Storage Mechanism in Java. In the range of storing 20,000+ java objects, updated every 5 or so seconds.
Some options I am open to:
Pure JDBC/database combination
JDO
JPA/ORM/database combination
An Object Database
Other Storage Mechanisms
... | [
0.2968643307685852,
0.1400400996208191,
0.21676763892173767,
0.2731205224990845,
0.1982375830411911,
0.15095146000385284,
0.01676618680357933,
-0.20976270735263824,
-0.3345835208892822,
-0.9492942690849304,
0.24638336896896362,
0.21550972759723663,
0.17987336218357086,
0.127311572432518,
... | |
it's the same set of 20,000 objects, or at least not 20,000 new objects every 5 seconds but lots of changes, you might be better off cacheing the changes and periodically writing the changes in batch mode (jdbc batch updates are much faster than individual row updates). Depends on whether you need each write to be tran... | [
0.3015701472759247,
-0.23125234246253967,
0.4991247057914734,
0.22029812633991241,
-0.13756443560123444,
0.04082820937037468,
0.11122787743806839,
0.11089669167995453,
-0.4741132855415344,
-0.9844560027122498,
0.09325574338436127,
0.026870612055063248,
-0.06128822639584541,
0.2525441348552... | |
sort) which is wrapped in a Prevayler instance, which is serialized to disk. Rather than making changes directly to your map, you make changes by sending your Prevayler instance a serializable record of your change (just an object that contains the change instruction). Prevayler's version of a transaction is to write y... | [
-0.0759449377655983,
-0.4559550881385803,
0.7088857889175415,
0.11481481790542603,
0.301284521818161,
0.1875775307416916,
-0.12970022857189178,
-0.19714893400669098,
-0.369890958070755,
-0.8609926700592041,
0.263276606798172,
0.334095299243927,
-0.3127959072589874,
0.19325242936611176,
-... | |
no generic interfaces, unfortunately. But definitely stable and works as advertised. | [
0.2972019612789154,
0.06215636059641838,
0.3759223520755768,
0.4107305407524109,
-0.09066041558980942,
-0.1760697364807129,
0.34939461946487427,
0.4277719259262085,
0.027639778330922127,
-0.728523313999176,
0.13128595054149628,
0.6014604568481445,
0.04311748594045639,
0.02909720316529274,
... | |
I am interested in developing an application that will allow me to build a list of videos from xml (containing video title, duration, etc) and play that list as my webcam stream. Meaning, if I were to visit ustream.tv, or activate my webcam on live messenger my video playlist would register as my active webcam.
Does a... | [
0.8677733540534973,
-0.04713653773069382,
0.38729462027549744,
0.2426099330186844,
-0.14234396815299988,
-0.33760690689086914,
-0.1112692654132843,
0.11562631279230118,
-0.3936106860637665,
-0.4949801564216614,
0.10379225015640259,
0.5596020221710205,
0.08266137540340424,
0.236686229705810... | |
DirectShow](http://kristoffer.vinther.name/projects/managed-directshow/)
* [DirectShow.NET](http://www.codeproject.com/KB/directx/directshownet.aspx)
* [Another DirectShow.NET](http://directshownet.sourceforge.net/) | [
0.17326214909553528,
-0.0969136655330658,
0.35205331444740295,
-0.05228205397725105,
-0.38666343688964844,
-0.08143896609544754,
0.22062300145626068,
-0.06516233086585999,
-0.3017934560775757,
-0.2545562982559204,
-0.1925901472568512,
0.1692516952753067,
-0.2514258325099945,
0.392541378736... | |
Once a window has been closed, it is possible, and it is recommended, to reuse that window's Form instance to show the same window again? Or is it required or recommended to always create a brand new instance of the class when you will be showing a window.
What this really boils down to is whether it is a good idea to... | [
0.4372950494289398,
-0.09559827297925949,
0.12993444502353668,
0.03913206234574318,
-0.051371980458498,
-0.3155060410499573,
0.3730957508087158,
0.20463310182094574,
-0.3736596703529358,
-0.5637258887290955,
-0.3320438861846924,
0.28309059143066406,
-0.12106563150882721,
0.3298302292823791... | |
Close ends up calling Dispose, and the object is considered disposed.
There is no problem in *hiding* the form and then showing it again, but closing it is a definite no-no, since the state is undefined after it is disposed (well, the state is disposed, but using it is the same as using something that is undefined). | [
-0.10738830268383026,
0.053557466715574265,
0.17015846073627472,
-0.22158783674240112,
-0.46642544865608215,
-0.08655806630849838,
0.36837825179100037,
-0.08211589604616165,
0.06093721464276314,
-0.4750906229019165,
-0.5950735807418823,
0.062790147960186,
-0.18660461902618408,
0.2979081571... | |
I'm debugging on my development machine and when I make changes to the css file, they don't show up and I can't figure out why. I'm using firebug and inspecting the css and the changes are not there. I've tried clear private data and building the project first then running it but nothing seems to work.
Thanks.
Use **... | [
0.5444819927215576,
0.3144932687282562,
0.14877286553382874,
-0.02312490902841091,
0.022485284134745598,
-0.014476913027465343,
0.5179709196090698,
0.26018503308296204,
-0.1633550226688385,
-0.6177692413330078,
-0.09087291359901428,
0.48389726877212524,
-0.11774638295173645,
0.256406098604... | |
We have a SQL query that pulls a large number of fields from many tables/views from a database. We need to put a spec together for integration with a 3rd party, what is the quickest way to compile the data types of the result set?
Clarifications:
* There are 25+ tables/views involved, so functions at the table level... | [
0.6209510564804077,
0.05824621021747589,
0.6448013782501221,
0.348983496427536,
0.11520452052354813,
-0.2897283434867859,
0.15592776238918304,
-0.34764355421066284,
-0.22315174341201782,
-0.5177136063575745,
0.058942295610904694,
0.6899796724319458,
0.1255623996257782,
-0.00837612897157669... | |
only.
If it was me, I think I'd create a view temporarily with the same body as the stored procedure (you may have to declare variables for any parameters). You can then look at the columns returned by the view with the INFORMATION\_SCHEMA queries already discussed. | [
0.3618782162666321,
0.1306672841310501,
0.48265165090560913,
0.10394447296857834,
0.1876988410949707,
0.21563726663589478,
0.1339980959892273,
0.1523408144712448,
-0.2792704403400421,
-0.6841987371444702,
-0.05728137865662575,
0.7570886611938477,
-0.26536306738853455,
0.20465660095214844,
... | |
We are working on standardizing our Bugzilla application across all projects. The default installation has bugs grouped into **Products** which have **Components** and **Versions**.
We are united in our definitions of **Product** and **Version** but there is still some confusion/discussion/argument about what constitu... | [
0.6403981447219849,
-0.05212501809000969,
0.040151432156562805,
0.024789733812212944,
-0.022234462201595306,
-0.012226724065840244,
-0.04259872063994408,
0.20050708949565887,
-0.3221835792064667,
-0.609473705291748,
0.020464977249503136,
0.4448213577270508,
-0.4341098368167877,
0.045132577... | |
User Interface
* Printing
Note that this ***may be different*** than what I, as a developer, would typically consider a **software component**. For example, my EventPlanner app might have use Calendar API, but "User Interface" and "Printing" themselves are not software components. | [
0.163430854678154,
-0.11498561501502991,
0.4532411992549896,
-0.04468012601137161,
-0.15290877223014832,
-0.06636488437652588,
-0.018459005281329155,
0.37843310832977295,
-0.3022865355014801,
-0.9605377912521362,
0.13215303421020508,
0.5484407544136047,
-0.01916884444653988,
-0.23111662268... | |
I'd like to implement a scalable chatroom in rails using AJAX. I know from research that the only scalability happens with a server-side push.
My two questions are:
1) In a reasonably efficient chat server, at what point does polling become prohibitive?
2) I really don't want to use Juggernaut. I don't know much abou... | [
0.03593364730477333,
-0.136015385389328,
0.22858121991157532,
0.5390037298202515,
-0.3283829689025879,
0.06774409115314484,
-0.06296483427286148,
-0.2371862828731537,
-0.008443617261946201,
-0.5162474513053894,
0.44061407446861267,
0.16860352456569672,
-0.31566479802131653,
-0.236979559063... | |
whether I'm even going about it the right way?
The simplest answer I could hope for is a quantified "yes, you put 5 lines of Javascript into the client and 20 lines of ruby into a CGI script, and call it a day".
If it was that easy to do people would not have built those technologies. IMHO I think polling is always a ... | [
0.6134991645812988,
0.21523118019104004,
0.2791822850704193,
0.28289875388145447,
-0.2935894727706909,
-0.04472781717777252,
0.2732527256011963,
-0.15591979026794434,
-0.17646868526935577,
-0.49995094537734985,
0.340167760848999,
0.381931871175766,
0.13306644558906555,
-0.3764757215976715,... | |
sites such as [WeeWar](http://weewar.com/) use the polling method and they have upwards or 400 request a Min. So I think it would take sometime before the scaling became an issue.
Good luck
Cheers | [
0.6707726716995239,
0.06841319054365158,
1.1226121187210083,
0.2761475145816803,
-0.2462950050830841,
0.013649661093950272,
0.7051917314529419,
-0.1595119684934616,
-0.22857773303985596,
-0.38671696186065674,
0.30628281831741333,
0.2969056963920593,
0.3551618754863739,
-0.27470532059669495... | |
Following code, when compiled and run with g++,
prints '1' twice, whereas I expect '1' to be printed
only once, since I am dumping a single structure to
the file, but while reading back it seems to be
reading two structures. Why?
```
#include <iostream.h>
#include <fstream.h>
int main(){
struct student
{
... | [
0.06917354464530945,
-0.18354186415672302,
0.4095796048641205,
-0.43604978919029236,
0.1694485992193222,
0.03764171153306961,
0.1535518616437912,
-0.4202617108821869,
0.03957607224583626,
-0.4878464937210083,
-0.42496609687805176,
0.458951860666275,
-0.4781220555305481,
-0.0997053682804107... | |
struct student tmpStu;
while(!filin.eof())
{
filin.read((char*)&tmpStu,sizeof(tmpStu));
cout << tmpStu.rollNo << endl;
}
filin.close();
}
```
`eof` only gets set after a read fails, so the read runs twice, and the second time, it doesn't modify the buffer.
Try this:
```
while(filin.r... | [
0.15087071061134338,
-0.035687632858753204,
0.8226184844970703,
-0.18086175620555878,
0.36723592877388,
0.23238112032413483,
0.3320115804672241,
-0.21139898896217346,
0.0795961394906044,
-0.5172241926193237,
-0.47926533222198486,
0.5897274017333984,
-0.30901822447776794,
-0.128255739808082... | |
read fails to read any more data, the reference will evaluate to false, which will prevent it from entering the loop. | [
0.4924054443836212,
0.23554673790931702,
0.39921504259109497,
0.028415875509381294,
0.22657334804534912,
-0.17820613086223602,
0.7415998578071594,
-0.4098302721977234,
0.062109991908073425,
-0.38622531294822693,
-0.1667241007089615,
0.4361627697944641,
-0.2610682249069214,
0.45608082413673... | |
I've run into the following case a few times and I was wondering if there is a fast way to handle it in Vim.
I'll have a source file like the following:
```
#ifndef _FOO_H_
#define _FOO_H_
class Foo {
Foo(int foo);
};
#endif
```
And I would like to convert it to the following:
```
#ifndef _BAR_H_
#define _BAR... | [
0.16072116792201996,
0.4190874695777893,
0.4503239691257477,
-0.382947713136673,
-0.15591253340244293,
0.20624782145023346,
0.03478914871811867,
-0.2769114673137665,
-0.10006256401538849,
-0.6425660848617554,
0.08445598930120468,
0.6209875345230103,
-0.3556171953678131,
0.12490914762020111... | |
search/replace.
Copy the script to the plugin directory (`~/.vim/plugin`), then do
```
:set ic
:%s/foo/\=KeepCaseSameLen(submatch(0), 'bar')/g
``` | [
0.2660917341709137,
0.20554332435131073,
0.5657698512077332,
-0.22372737526893616,
0.553817629814148,
-0.029824599623680115,
0.28450271487236023,
-0.05907555669546127,
0.11452716588973999,
-0.6999104022979736,
-0.23760618269443512,
0.676360011100769,
-0.36725568771362305,
0.105522558093070... | |
Our **WinForms** application does lazy loading of the data for auto complete of a textbox. The pseudocode for this is as follows;
1. User types in TextBox
2. On typing pause, determine if we need to fetch the auto complete data
3. In worker thread, contact the server and fetch data
4. Invoke back to the UI thread
5. S... | [
0.3862340748310089,
-0.016903577372431755,
0.6113492250442505,
-0.009530723094940186,
0.16255751252174377,
-0.16145984828472137,
0.4163363575935364,
-0.20306724309921265,
0.1501019448041916,
-0.8035410642623901,
0.033852845430374146,
1.002750039100647,
-0.1830642819404602,
-0.0406862758100... | |
is a hack, but the only way that I have found to get the autocomplete
// to drop down once the data is returned.
textBox.SelectionStart = textBox.Text.Length;
textBox.SelectionLength = 0;
SendKeys.Send( " {BACKSPACE}" );
```
There must be a better way. I can't believe that I am the only person fet... | [
0.08668429404497147,
-0.08351883292198181,
0.2606717050075531,
-0.1576588898897171,
0.06125138700008392,
-0.15503862500190735,
0.5700778365135193,
0.03805965185165405,
-0.22955015301704407,
-0.5181794166564941,
-0.29133468866348267,
0.8102433085441589,
-0.22283785045146942,
0.1331229358911... | |
async autocomplete class for a TextBox using only managed code. Hope it helps.
```
using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
namespace TextboxAutocomplete
{
public abstract class AutoCompleteSource
{
private TextBox mTex... | [
-0.215653195977211,
-0.008124122396111488,
0.24225948750972748,
-0.10634464770555496,
-0.0375496968626976,
0.37057846784591675,
0.385335236787796,
-0.2308046519756317,
-0.31677061319351196,
-0.535027027130127,
-0.53643399477005,
0.8571785688400269,
-0.634005606174469,
-0.14762021601200104,... | |
if (textbox == null)
throw new ArgumentNullException("textbox");
if (textbox.IsDisposed)
throw new ArgumentException("textbox");
mTextBox = textbox;
mAutoCompleteMode = mode;
mTextBox.AutoCompleteSource | [
-0.4776328206062317,
-0.2714853882789612,
0.2820771634578705,
-0.19587238132953644,
0.3788360059261322,
0.170588418841362,
0.4331991374492645,
-0.31034132838249207,
-0.11885111033916473,
-0.4760715663433075,
-0.5808443427085876,
0.8842587471008301,
-0.6564230918884277,
-0.09222858399152756... | |
= System.Windows.Forms.AutoCompleteSource.None;
BackgroundWorker autoCompleteLoader = new BackgroundWorker();
autoCompleteLoader.DoWork += new DoWorkEventHandler(autoCompleteLoader_DoWork);
autoCompleteLoader.RunWorkerCompleted += new RunWorkerCompletedEventHandler(autoCompleteLoade... | [
-0.16852357983589172,
0.04194621369242668,
0.28331613540649414,
-0.3356448709964752,
0.3725782036781311,
0.20311278104782104,
0.3802269697189331,
-0.32357752323150635,
-0.2816031575202942,
-0.4507949948310852,
-0.3777804374694824,
0.8738262057304382,
-0.446834534406662,
0.08609268069267273... | |
collection = e.Result as AutoCompleteStringCollection;
if (collection == null) return;
if (mTextBox.InvokeRequired)
{
mTextBox.Invoke(new SetAutocompleteSource(DoSetAutoCompleteSource), new object[] { collection });
}
else | [
0.18736588954925537,
-0.6375616788864136,
0.4527153968811035,
0.08166088163852692,
0.12849068641662598,
0.06322170794010162,
0.4206908643245697,
-0.847721517086029,
-0.09899889677762985,
-0.23145149648189545,
-0.2519114911556244,
0.730169415473938,
-0.559019148349762,
0.14976708590984344,
... | |
{
DoSetAutoCompleteSource(collection);
}
}
protected void DoSetAutoCompleteSource(AutoCompleteStringCollection collection)
{
if (mTextBox.IsDisposed) return;
mTextBox.AutoCompleteMode = mAutoCompleteMode;
mTextBox.AutoCompleteSour... | [
0.525310754776001,
-0.33411863446235657,
0.6127028465270996,
-0.11932773888111115,
0.3061845898628235,
0.04948049783706665,
0.3861563801765442,
-0.887536883354187,
0.23727023601531982,
-0.2552116811275482,
-0.14113599061965942,
1.0456418991088867,
-0.6380022764205933,
0.02556355483829975,
... | |
System.Windows.Forms.AutoCompleteSource.CustomSource;
mTextBox.AutoCompleteCustomSource = collection;
}
void autoCompleteLoader_DoWork(object sender, DoWorkEventArgs e)
{
List<string> autoCompleteItems = GetAutocompleteItems();
if (autoCompleteItems == null) ... | [
0.0847490057349205,
-0.2669147551059723,
0.604773998260498,
0.08939817547798157,
0.2735523283481598,
0.00602972786873579,
0.3215474486351013,
-0.4667423665523529,
-0.4233279526233673,
-0.296840101480484,
-0.24237312376499176,
0.8479058146476746,
-0.3195163607597351,
0.2508684992790222,
0... | |
collection.AddRange(GetAutocompleteItems().ToArray());
e.Result = collection;
}
protected abstract List<string> GetAutocompleteItems();
}
internal delegate void SetAutocompleteSource(AutoCompleteStringCollection collection);
}
```
Sample implementation:
```
using System;
using S... | [
0.014407421462237835,
0.10550641268491745,
0.30925223231315613,
0.04995816946029663,
-0.011188831180334091,
0.39494559168815613,
0.3224942684173584,
-0.5924507975578308,
-0.3569732904434204,
-0.47022545337677,
-0.4406052529811859,
0.6068265438079834,
-0.4020494222640991,
0.0797607824206352... | |
}
protected override List<string> GetAutocompleteItems()
{
List<string> result = new List<string>();
for (int i = 0; i < 2500; i++)
{
result.Add(Guid.NewGuid().ToString());
} | [
-0.051838651299476624,
-0.43172866106033325,
0.5482025742530823,
-0.11843433976173401,
0.2818886637687683,
-0.07366064190864563,
0.3240073323249817,
-0.7224803566932678,
-0.06748335063457489,
-0.43933215737342834,
-0.40080389380455017,
0.8560816049575806,
-0.38723132014274597,
0.0057514035... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.