text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I am now designing an SNMP library. The problem is caused by a special function like this,
\*\*\* GetTable(string id)
This function may return Variable[,] which is a two dimensional array sometimes, but also Variable[,,] and arrays with more dimensions. So I believe it is not reasonable to return fixed array such as ... | [
0.21893233060836792,
-0.16081860661506653,
0.3123146891593933,
0.12492237240076065,
-0.26701590418815613,
-0.00888648722320795,
0.07640208303928375,
-0.16974659264087677,
-0.34029707312583923,
-0.49998411536216736,
0.020723868161439896,
0.5264284610748291,
-0.4031729996204376,
0.2960990071... | |
the data in this collection, rather than exposing multidimensional arrays.
I generally avoid using multidimensional rectangular arrays myself. In many cases, multidimensional jagged arrays are more convenient as you can lift a slice out in isolation. | [
0.2174948900938034,
-0.07811696082353592,
-0.21597252786159515,
0.16984164714813232,
-0.2971038818359375,
0.06747878342866898,
0.11987870186567307,
-0.24505770206451416,
-0.38302865624427795,
-0.7959762811660767,
-0.3318869173526764,
0.3118078112602234,
0.012523499317467213,
0.173117369413... | |
I want to use java.util.ConcurrentLinkedQueue as a non-durable queue for a Servlet.
Here's the blurb from the javadoc for the class.
> An unbounded thread-safe queue based on linked nodes. A ConcurrentLinkedQueue is an appropriate choice when many threads will share access to a common collection. This queue does not p... | [
-0.03942732512950897,
-0.10571267455816269,
0.5390713214874268,
0.1524813324213028,
-0.12654243409633636,
-0.0618865005671978,
0.17898474633693695,
0.009859929792582989,
-0.4649653434753418,
-0.6317124366760254,
0.03464886546134949,
0.22103038430213928,
-0.3716512620449066,
0.4348285794258... | |
thread-safe guarantee without needing to do my own synchronization.
2. I will not lose any requests if the traffic load goes beyond 1000 concurrent request.
Thanks
You're essentially asking three different questions (two of them explicitly and one implicitly.) Here they are, with my answers:
**1. Do I need to do my o... | [
0.2899201214313507,
-0.10144004970788956,
0.11644018441438675,
0.28218522667884827,
0.12634584307670593,
-0.1512300670146942,
0.43065908551216125,
-0.11994650959968567,
-0.3547752797603607,
-0.391259104013443,
0.05020212009549141,
0.6583698391914368,
-0.4926627278327942,
-0.147863939404487... | |
threadsafe without any action on your part:
```
queue.add(obj);
```
or
```
queue.poll(obj);
```
However; non-atomic calls to the queue are not automatically thread-safe. For example, the following operations are **not** automatically threadsafe:
```
if(!queue.isEmpty()) {
queue.poll(obj);
}
```
That last on... | [
-0.3071591854095459,
-0.17034125328063965,
0.5074023008346558,
-0.20700803399085999,
0.01960095390677452,
-0.002136658411473036,
-0.013526245951652527,
-0.30491605401039124,
-0.5980045795440674,
-0.4469660818576813,
-0.1339796781539917,
0.543759286403656,
-0.541671097278595,
0.104502268135... | |
Am I guaranteed not to lose calls to `java.util.ConcurrentLinkedQueue` if there are 1000 simultaneous requests?**
Because this is an unbounded implementation you are guaranteed that no matter how many simultaneous requests to make, the queue will not lose those requests (because of the queue's concurrency...you might ... | [
0.08901529014110565,
0.07542689889669418,
0.28182119131088257,
-0.11190865188837051,
0.12750090658664703,
-0.2211930900812149,
0.32428985834121704,
-0.4560464918613434,
-0.26804786920547485,
-0.6234233379364014,
-0.22537294030189514,
0.5353443026542664,
-0.35151270031929016,
-0.23111917078... | |
concurrency. What I mean, is that Concurrent classes guarantee that they are thread-safe (or robust against dead-lock, starvation, etc.) When we talk about that, we aren't making any guarantees about performance (how fast calls to the collection are) - we are only guaranteeing that they are "correct."
However; the Con... | [
0.1923215687274933,
0.028539499267935753,
0.00760692497715354,
0.4051421284675598,
-0.17023183405399323,
-0.42180296778678894,
0.38280045986175537,
0.0846143364906311,
-0.591657280921936,
-0.22228959202766418,
-0.03290466591715813,
0.5417938828468323,
-0.42812007665634155,
0.02796313725411... | |
In my old job I used XMLSpy to do my XML authoring and editing, but now I require a free plugin for Eclipse to do this. My basic requirements are:
```
- General XML document editing
- Creating XSD files
- Creating WSDL files
```
Can you recommend a free Eclipse plugin for this?
In the free department, [**WTP** (Web ... | [
0.5009527206420898,
0.2866216003894806,
0.29687660932540894,
0.045422106981277466,
-0.4090443551540375,
-0.41724374890327454,
-0.1799287647008896,
-0.15573666989803314,
-0.07744382321834564,
-0.7207095623016357,
-0.15634974837303162,
0.6392003297805786,
0.00990949384868145,
-0.101337708532... | |
AFAIK ROWID in Oracle represents physical location of a record in appropriate datafile.
In which cases ROWID of a record may change ?
The one known to me is UPDATE on partitioned table that "moves" the record to another partition.
Are there another cases ? Most of our DBs are Oracle 10.
As you have said, it occurs an... | [
-0.14886146783828735,
-0.06179603934288025,
0.16859231889247894,
-0.16749167442321777,
0.08539795130491257,
-0.09259471297264099,
-0.08147989213466644,
-0.4213055968284607,
-0.2968817353248596,
-0.4950265884399414,
0.20322492718696594,
0.22038070857524872,
-0.12084980309009552,
0.121231406... | |
index organized table, then an update to the primary key would give you a different ROWID as well. | [
-0.1607609987258911,
-0.20546382665634155,
0.4768986403942108,
0.305237740278244,
-0.22009529173374176,
0.12504862248897552,
-0.20279249548912048,
-0.09879700839519501,
-0.34180405735969543,
-0.6753752827644348,
0.22525733709335327,
0.3972460627555847,
-0.22643552720546722,
0.1752482205629... | |
I will implement a virtual machine in x86 and I wonder what kind of design would yield best results. What should I concentrate on to squish out the juice? I will to implement the whole virtual machine in x86 assembly.
I haven't much instructions and I can choose their form. The instructions project directly into small... | [
0.20852430164813995,
0.18860387802124023,
0.22809316217899323,
-0.17587469518184662,
-0.2806019186973572,
0.13383851945400238,
0.4288071393966675,
-0.09476187825202942,
0.005159302614629269,
-0.6787218451499939,
-0.19717487692832947,
0.6138004660606384,
-0.34450650215148926,
-0.00584749784... | |
selector: #selector:)
var := ... # set
var # get
```
The sort of VM I were thinking about:
```
mov eax, [esi]
add esi, 2
mov ecx, eax
and eax, 0xff
and ecx, 0xff00 # *256
shr ecx, 5 # *8
jmp [ecx*4 + operations]
align 8:
operations:
dd retnull
dd ret
# so on...
retnull: # jumps here at retn... | [
-0.04647519811987877,
-0.06372028589248657,
0.6726288795471191,
-0.2255498468875885,
0.10851020365953445,
0.39826706051826477,
0.2648915946483612,
-0.7801852822303772,
-0.5372289419174194,
-0.43758103251457214,
-0.28506308794021606,
0.8366672396659851,
-0.3010212182998657,
-0.1145917922258... | |
you need them. Most virtual machines you are proposing elsewhere are weighted towards portability with the cost of performance. My goal is not the portability, my goal is the performance.
The reason this interpreter is needed at all is because smalltalk blocks doesn't end up gotten interpreted the same way:
```
A := ... | [
-0.23288513720035553,
0.12487249821424484,
0.1742357611656189,
0.02202541008591652,
-0.08195102214813232,
0.16325567662715912,
0.2571287155151367,
-0.16233715415000916,
-0.20215576887130737,
-0.6983216404914856,
-0.15361425280570984,
0.6585532426834106,
-0.40654629468917847,
-0.26669690012... | |
"oranges" toUpper
]
```
I need the real benefit coming from the interpretive routines, that is the choice of context where to read the program in. Of course, good compiler should just most of the time compile the obvious cases like: 'ifTrue:ifFalse' or 'whileTrue:', or the list example. The need for interpreter doesn... | [
-0.0998082384467125,
0.38802438974380493,
-0.04408968240022659,
0.0482618510723114,
0.12402541935443878,
-0.01573476940393448,
0.1705542504787445,
0.19188444316387177,
-0.307052344083786,
-0.6995013356208801,
-0.4676623046398163,
0.6477187275886536,
-0.14125722646713257,
-0.385237902402877... | |
to object against them.
I assume you came accross <http://www.complang.tuwien.ac.at/forth/threading/> if you consider writing a VM seriously, so I won't dwell upon the described techniques.
Already mentioned, targeting a VM has some advantages such as reduced code size, reduced compiler complexity (often translates ... | [
0.524307906627655,
0.010259036906063557,
-0.030746646225452423,
-0.16084763407707214,
-0.6377042531967163,
0.028429299592971802,
0.3206653296947479,
-0.35043570399284363,
-0.1502826064825058,
-0.3928346633911133,
0.0460384301841259,
0.7889191508293152,
-0.12950046360492706,
-0.154525831341... | |
is very on the spot. If I were to design a VM for a very dynamic language, I would separate interpretation into two stages;
1. A producer stage which consults an AST stream on demand and transforms it to a more meaningful form (for example, taking a block, deciding whether it should be executed right away or stored in... | [
0.5259910225868225,
-0.4093775153160095,
0.05962737649679184,
0.18988503515720367,
-0.22190265357494354,
0.27204641699790955,
0.07694482058286667,
-0.2518226206302643,
0.13799172639846802,
-0.32986652851104736,
-0.045989882200956345,
0.5911238193511963,
-0.09265504032373428,
0.035003032535... | |
make it Forth like, you can just push a stored stream and be done with it instead of jumping instruction pointer around.
As you say, just mimicking how the damn processor work in another way doesn't accomplish any dynamism (or any other feature worth a damn, like security) that you require. Otherwise, you would be wri... | [
0.3854472041130066,
-0.1805785596370697,
-0.20729735493659973,
0.1852463185787201,
0.17125117778778076,
0.03451607748866081,
0.12669621407985687,
-0.20920398831367493,
0.02466157078742981,
-0.42965736985206604,
0.29896509647369385,
1.0168516635894775,
-0.39767518639564514,
-0.1520956307649... | |
I would like to associate the **last installed** version of my Mac OS X application with a certain type of file. A little experimentation shows that the **info.plist** file seems to be read and interpreted by the operating system when launching the application, not when dragging the application bundle to the disk. [App... | [
0.38046032190322876,
0.2656426727771759,
0.3583168387413025,
-0.1394580602645874,
0.10395313054323196,
-0.07272118330001831,
-0.028996357694268227,
0.03700459375977516,
-0.2440045028924942,
-0.5081921219825745,
-0.35016074776649475,
0.6103492379188538,
-0.010228024795651436,
0.046699278056... | |
want this to be done automatically during the installation (I don't want my users to have to do it themselves).
When a user drags an application into the Applications folder, the system should register it with Launch Services automatically. See [Application Registration](http://developer.apple.com/library/mac/#document... | [
0.5085482597351074,
0.4201371967792511,
0.08695201575756073,
-0.08851390331983566,
0.5920650959014893,
-0.26583364605903625,
-0.2616405189037323,
0.023409709334373474,
-0.5189697742462158,
-0.4451454281806946,
-0.6762135624885559,
0.5713000297546387,
-0.09080430120229721,
-0.42513161897659... | |
I have a very slow query that I need to run on a MySQL database from time to time.
I've discovered that attempts to update the table that is being queried are blocked until the query has finished.
I guess this makes sense, as otherwise the results of the query might be inconsistent, but it's not ideal for me, as the ... | [
0.17100271582603455,
0.021337289363145828,
0.2426573932170868,
0.2527945041656494,
-0.01831895299255848,
-0.06302224099636078,
0.06235842406749725,
0.03438463807106018,
-0.20400582253932953,
-0.34223672747612,
0.12064769864082336,
0.25749823451042175,
-0.19741536676883698,
0.37928220629692... | |
it before the update?
2. Is there a way to make the slow query not blocking? I guess the options might be:
* Kill the query when an update is needed.
* Run the query on a copy of the table as it was just before the update took place
* Just let the query go wrong.
Anyone have any thoughts on this?
It sounds like yo... | [
0.35426971316337585,
-0.2891024947166443,
0.341533362865448,
0.2486831545829773,
-0.06047705560922623,
-0.21058514714241028,
0.08776415884494781,
0.045277465134859085,
-0.284602552652359,
-0.6071906089782715,
0.06663808971643448,
0.5001348257064819,
-0.1946798413991928,
0.22758032381534576... | |
SELECT is done. Once it is done, the UPDATE will run like normal.
[MyISAM Locking](http://dev.mysql.com/doc/refman/5.1/en/table-locking.html)
If you switched to InnoDB, then your SELECT will set no locks by default. There is no need to change transaction isolation levels as others have recommended (repeatable read is... | [
-0.04693258926272392,
-0.3809054493904114,
0.5900101661682129,
-0.029668807983398438,
0.2178935557603836,
-0.4177134335041046,
0.07761572301387787,
-0.1683163046836853,
-0.5465711355209351,
-0.87351393699646,
-0.1906086802482605,
0.6642153859138489,
-0.22109107673168182,
0.1753894388675689... | |
have a FOR UPDATE/LOCK IN SHARE MODE option to the query, or it is part of some sort of write statement (such as INSERT...SELECT) and you are using statement based binary logging.
[InnoDB Locking](http://dev.mysql.com/doc/refman/5.1/en/innodb-transaction-model.html) | [
0.1270638257265091,
-0.2453249841928482,
0.28758201003074646,
-0.025071708485484123,
0.2705656886100769,
-0.40587806701660156,
0.14820127189159393,
-0.30078181624412537,
-0.31047967076301575,
-0.3994198441505432,
-0.24545331299304962,
0.799872100353241,
-0.5369894504547119,
0.1170394793152... | |
One of my colleagues has totally messed up the contents of a directory in our main CVS repository. I need to just revert the whole module to the state it was in at the end of last year. What's the CVS command to do this please?
He has added and removed hundreds of files, so a simple "copy over files from old checkout ... | [
0.3007843792438507,
0.3712865710258484,
0.5429159998893738,
-0.11199057847261429,
0.380113810300827,
-0.28870725631713867,
0.22168128192424774,
-0.2001715898513794,
-0.5281476378440857,
-0.4264296293258667,
-0.06827860325574875,
0.9296804070472717,
-0.4327947199344635,
0.473354697227478,
... | |
files and directories don't get resurrected. (I didn't commit it).
I can probably write a shell script for this, but surely this functionality must be in CVS already?
Update: Some clarifications:
* I can get a *local checkout* of the module at a specific date. The question is how to get that back into CVS.
* I do ha... | [
0.39942359924316406,
0.10008953511714935,
0.3618345260620117,
0.3382890820503235,
0.24985091388225555,
-0.27989113330841064,
0.584001362323761,
0.24400414526462555,
-0.7203418016433716,
-0.6423799991607666,
-0.14811471104621887,
0.7822191715240479,
0.12478289008140564,
0.22759385406970978,... | |
may lose up to a day's work).
* I know that CVS is old, and we should move to something newer. But in a large team with a large number of CVS-based tools (checkout & build scripts, nightly build server, etc) the time cost of such a move is considerable. (Evaluation, updating scripts, testing, migration, training, lost ... | [
0.6963000893592834,
0.1949092149734497,
0.3079277276992798,
0.18127839267253876,
0.28520140051841736,
-0.18966996669769287,
0.16541938483715057,
-0.2587546408176422,
-0.36708393692970276,
-0.6204192042350769,
0.06749243289232254,
0.7942421436309814,
0.24930626153945923,
0.03122540563344955... | |
how to revert using normal CVS commands, not with a hacky shell script.**
Update #3: The server is [CVS 1.12.13](http://www.nongnu.org/cvs/). Access is via pserver. I can use the same version of CVS on a Linux PC, or the [CVSNT 2.0.51d](http://en.wikipedia.org/wiki/CVSNT) client on Windows.
Actually your initial appro... | [
0.10888252407312393,
0.011672217398881912,
1.1340608596801758,
-0.3356897830963135,
-0.047079864889383316,
-0.2892131507396698,
0.26430824398994446,
-0.23779980838298798,
-0.25744470953941345,
-0.42130061984062195,
-0.3217669129371643,
0.8460513949394226,
0.028318051248788834,
0.2604401707... | |
2008-12-30:
```
cd .. && mkdir code_base2 && cd code_base2
cvs co modulename
cvs update -d -j HEAD -j code_base_2008_12_30 # use -d to resurrect deleted directories
```
Compare the contents of code\_base1 and code\_base2. They should be identical except for the CVS meta information. Finally commit the code as it wa... | [
-0.2618235647678375,
0.26230335235595703,
0.5810055732727051,
-0.26911869645118713,
-0.11454549431800842,
-0.19917279481887817,
0.299570232629776,
-0.34606844186782837,
-0.3436402380466461,
-0.32499921321868896,
-0.217344269156456,
0.7068607211112976,
-0.24928142130374908,
0.26409551501274... | |
I'm finishing an internship at a company and have just been thrown onto this project for the last month where the program is built upon an engine that they "failed" to buy the source code for. Now I've been given the task of finding out why it is failing, on only certain conditions and customer feedback hasn't been gre... | [
0.5644286870956421,
0.37480881810188293,
0.18223005533218384,
0.03553401678800583,
0.3230295479297638,
-0.17726318538188934,
0.5222151875495911,
0.12145055085420609,
-0.04040045291185379,
-0.6701462268829346,
-0.23609015345573425,
0.50011146068573,
0.1408769190311432,
-0.08676370978355408,... | |
through the regular app and pinpoint the problem. I suspect it is something to do with fields not being re-initialized properly.
**Is there a way to attach a debugger to the exe to see callstacks and all that hotness?**
Any help that would avoid countless use cases would be received gratefully.
You can attach the Del... | [
0.13390159606933594,
-0.029827049002051353,
0.2693043351173401,
0.42519673705101013,
-0.09613382071256638,
-0.3230655789375305,
0.3229879140853882,
0.18143662810325623,
-0.04936843365430832,
-0.5121884346008301,
-0.5013468265533447,
0.7654473185539246,
-0.215078666806221,
-0.18824926018714... | |
Your only chance is in that if your application is a Debug release. In that case, Delphi debugger should help more than a generic debugger.
You might also want to have a look at this thread - [Is there a program to decompile Delphi?](https://stackoverflow.com/questions/335104/is-there-a-program-to-decompile-delphi) | [
0.06173476576805115,
-0.11747995018959045,
0.14208105206489563,
0.28157663345336914,
0.19809600710868835,
-0.39155715703964233,
0.3331134021282196,
0.019896170124411583,
-0.5208951234817505,
-0.39609456062316895,
-0.20154255628585815,
0.4390667676925659,
-0.25804293155670166,
0.03317971155... | |
I'm using an ORM (SQLAlchemy, but my question is quite implementation-agnostic) to model a many-to-many relationship between a parent class and its children.. I was wondering, what would be a simple way to express the concept "one of the children is the default/main one"?
For example, I'd need to persist the followin... | [
-0.340831458568573,
-0.1359744518995285,
0.01708003506064415,
0.3270568549633026,
0.05218365043401718,
0.27190321683883667,
-0.07304483652114868,
0.29593625664711,
0.007788717281073332,
-0.420575886964798,
-0.03957228735089302,
0.3455754518508911,
-0.10706478357315063,
0.33622297644615173,... | |
be to have a join table, PersonAddressRelation, and also a DefaultAddress column on the Person table that keys to the Address table. | [
-0.3813316226005554,
-0.0757061094045639,
0.6627606153488159,
0.018196938559412956,
0.24589143693447113,
0.11785046756267548,
0.14917339384555817,
0.07648327201604843,
0.12260890752077103,
-0.5543748140335083,
-0.5596628785133362,
0.46279776096343994,
-0.12489870190620422,
-0.0548170767724... | |
I've got an assembly containing several WCF services, each with its own contract. It all works nicely. The service config in the app.config for the service looks like this:
```
<services>
<service behaviorConfiguration="WcfService.AlyzaServiceBehavior"
name="Sam.Alyza.WcfService.ServiceWebsites">
<endpoint a... | [
0.34466826915740967,
-0.015396208502352238,
0.8951290249824524,
-0.20524325966835022,
0.03137561306357384,
0.11503847688436508,
0.27479901909828186,
-0.452789306640625,
-0.2022043913602829,
-1.1363838911056519,
-0.018610181286931038,
0.3492305278778076,
-0.009254716336727142,
0.23688732087... | |
</baseAddresses>
</host>
</service>
<service behaviorConfiguration="Sam.Alyza.WcfService.LogReaderServiceBehavior"
name="Sam.Alyza.WcfService.ServiceLogReader">
<endpoint address="" binding="netTcpBinding" contract="Sam.Alyza.WcfInterface.IServiceLogReader">
<identity>
<dns value="localhos... | [
-0.4188077449798584,
0.056288253515958786,
0.5544857978820801,
-0.10577163845300674,
-0.11948489397764206,
0.1704035997390747,
0.2532404363155365,
-0.493984580039978,
-0.4587233066558838,
-0.9111011028289795,
-0.4580780267715454,
0.3603389263153076,
-0.10545771569013596,
0.2820756435394287... | |
address="" binding="netTcpBinding" contract="Sam.Alyza.WcfInterface.IServiceSystemverwaltung">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddres... | [
0.0013858502497896552,
-0.10230007022619247,
0.646245539188385,
0.0419575497508049,
-0.019297592341899872,
-0.0032148263417184353,
0.0327950157225132,
-0.4128642678260803,
-0.24569107592105865,
-0.9323055744171143,
-0.25008195638656616,
0.03779878094792366,
-0.028888944536447525,
0.1119286... | |
just be one service with different contracts and endpoints, I could set a ommon baseaddress, but how do I set a common baseaddress for more than one service?
Of course I'd need something similar for the client.
You can combine all contracts in one class, so you have one service with a baseaddress and one (or more) end... | [
0.7226933240890503,
-0.3876485228538513,
0.01832278072834015,
0.010898706503212452,
0.03014623187482357,
0.143588125705719,
-0.04676219820976257,
-0.2699044644832611,
-0.2030269205570221,
-0.8734281659126282,
-0.008378664962947369,
0.795654833316803,
-0.5242458581924438,
-0.047567427158355... | |
inheritance, but that imply a large amount of discipline...
Your config would look like this:
```
<services>
<service behaviorConfiguration="WcfService.AlyzaServiceBehavior"
name="Sam.Alyza.WcfService.ServiceAll">
<endpoint address="Websites/" binding="netTcpBinding" contract="Sam.Alyza.WcfInterface.IServic... | [
-0.07782045006752014,
-0.056960076093673706,
0.21444563567638397,
0.111409991979599,
-0.028648320585489273,
-0.288737952709198,
0.057372260838747025,
-0.6535168290138245,
-0.24596822261810303,
-0.6368556022644043,
-0.22461986541748047,
0.5445584654808044,
-0.19758673012256622,
0.2354898452... | |
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8731/Design_Time_Addresses/SamAlyza/" />
</baseAddresses>
</host>
</service>
</servic... | [
-0.20190396904945374,
-0.1484975516796112,
0.4511893093585968,
-0.07817471772432327,
-0.05976276099681854,
-0.10771539062261581,
0.09285959601402283,
-0.5105099678039551,
-0.42404988408088684,
-0.8151758313179016,
-0.47523486614227295,
0.10550256818532944,
-0.1576424092054367,
0.2106397897... | |
What is the preferred/easiest way to find the control that is currently receiving user (keyboard) input in WinForms?
So far I have come up with the following:
```
public static Control FindFocusedControl(Control control)
{
var container = control as ContainerControl;
return (null != container
? FindFo... | [
-0.23563332855701447,
-0.2874297499656677,
0.7384958267211914,
-0.08915088325738907,
0.20412777364253998,
-0.022247420623898506,
-0.14583107829093933,
-0.13451234996318817,
-0.046009719371795654,
-0.45241716504096985,
-0.2838663160800934,
0.8264921307563782,
-0.4085753858089447,
0.07772500... | |
be using instead?
Note that a single call to ActiveControl is not enough when hierarchies are used. Imagine:
```
Form
TableLayoutPanel
FlowLayoutPanel
TextBox (focused)
```
(formInstance).ActiveControl will return reference to TableLayoutPanel, not the TextBox (because ActiveControl seems to... | [
0.0022339674178510904,
-0.2825948894023895,
0.4476604461669922,
0.007525607477873564,
0.11763585358858109,
-0.09979089349508286,
0.22074608504772186,
-0.039289284497499466,
-0.15599487721920013,
-0.9313760995864868,
-0.15729548037052155,
0.4772881269454956,
-0.5606802701950073,
0.106743887... | |
solution as yours, using only the Framework functionalities. After all, the performance difference (if there is one) shouldn't be significant.
I would take a non recursive approach:
```
public static Control FindFocusedControl(Control control)
{
var container = control as IContainerControl;
while (container !... | [
-0.623720645904541,
-0.22280700504779816,
0.7061678171157837,
0.12638027966022491,
0.3901195526123047,
0.3238065540790558,
0.2640245854854584,
-0.22708651423454285,
-0.2756233215332031,
-0.6764139533042908,
-0.2569729685783386,
0.4855507016181946,
-0.4760841131210327,
0.2457413524389267,
... | |
Our java applet needs to open a new htm page to web browser but popup blocker seem to block this code:
```
try
{
AppletContext a = getAppletContext();
URL url = new URL(link);
a.showDocument(url,"_blank");
}
```
can you use somehow live javascript to open a window instead?
`AppletContext`... | [
0.36030763387680054,
0.26649045944213867,
0.48286113142967224,
-0.27618280053138733,
-0.0063347406685352325,
-0.14469853043556213,
0.43452444672584534,
-0.17551341652870178,
-0.14243370294570923,
-0.8853782415390015,
-0.19693242013454437,
0.44062402844429016,
-0.5564092993736267,
-0.150834... | |
to open the popup, but using a URL supplied by the applet (so the applet never has to call out to JavaScript). | [
-0.06665300577878952,
0.12527385354042053,
0.44244131445884705,
-0.29195964336395264,
0.12281832098960876,
-0.24271540343761444,
0.2549073100090027,
0.22743892669677734,
-0.08246511965990067,
-0.5039124488830566,
-1.0148433446884155,
0.18199583888053894,
-0.36948755383491516,
0.01212905906... | |
I am writing a JSON response from a perl/cgi program. The header's content type needs to be "application/json". But it doesn't seems to be recognized as response is thrown as a text file.
I would be capturing response using JSON library of jQuery. Where am I missing in sending the JSON response.
I am doing this in a ... | [
0.012184401974081993,
-0.013846876099705696,
0.36300551891326904,
-0.2303583174943924,
-0.49463045597076416,
0.04741457477211952,
0.15681611001491547,
-0.25068268179893494,
-0.18518692255020142,
-0.5509641766548157,
-0.4632490277290344,
0.6297643184661865,
-0.48871809244155884,
-0.18666027... | |
like this:
```
$.ajax({
type: 'GET',
url: 'myscript.pl',
dataType: 'json',
data: { action: "request", last_ts: lastTimestamp },
success: function(data){
lastTs = data.last_mod;
for (var entryNumber in data.entries) { | [
-0.19356103241443634,
-0.4138263463973999,
0.3044649064540863,
-0.06177973374724388,
-0.019701536744832993,
-0.09127330780029297,
0.2812994718551636,
-0.21400479972362518,
-0.15596814453601837,
-0.6484342217445374,
-0.2913077771663666,
0.5638200044631958,
-0.1421775072813034,
-0.0423800200... | |
//Do stuff here
}
},
error: function(){
alert("Handle Errors here");
},
complete: function() {
}
});
```
You don't necessarily have to use the JSON library if you don't want to install it, you could print straight JSON formatted text, | [
0.20874816179275513,
0.015070604160428047,
-0.010395313613116741,
-0.011540235951542854,
0.00645868293941021,
-0.4275808334350586,
0.41964131593704224,
-0.04942430183291435,
-0.10957732796669006,
-0.4308758080005646,
-0.5152528882026672,
0.8079810738563538,
-0.40446171164512634,
-0.3326437... | |
but it makes converting perl objects to JSON prety easy. | [
-0.14894071221351624,
-0.0033914551604539156,
0.19897449016571045,
0.027915824204683304,
-0.3837786614894867,
-0.29580438137054443,
0.16144828498363495,
0.15060141682624817,
-0.0778547078371048,
-0.2392575591802597,
-0.23057857155799866,
0.41948550939559937,
-0.15675711631774902,
-0.040447... | |
I'm changing our application from "one set of code & one database" to "one set of code to multiple databases (one database per customer)".
The original code is VS2005 ASP.NET(VB) & lots of XSD's in a separate DLL. The web.config's ConnectionString would override the one stored in the DLL at runtime.
Now I need to cha... | [
0.35660988092422485,
-0.16803152859210968,
0.7910662293434143,
0.2330251783132553,
-0.06257219612598419,
-0.0942201092839241,
0.01787525601685047,
0.0902366042137146,
-0.5524470210075378,
-0.961259126663208,
0.09011167287826538,
0.3332177400588989,
-0.3583143353462219,
0.44879189133644104,... | |
on your XSD diagram, click the TableAdapter part of the diagram (where the queries are defined).
In the properties window, change ConnectionModifier to Public and click Save. (This seems to change the property for all the Datasets on that page too.)
Back in the main code of your site you can now do something like thi... | [
0.1590353548526764,
-0.07425499707460403,
0.8151429295539856,
0.05979006737470627,
-0.05398944392800331,
-0.4809345602989197,
0.24355193972587585,
-0.13992279767990112,
-0.026807691901922226,
-0.8775883316993713,
-0.08454041928052902,
0.6244916319847107,
-0.2771620452404022,
0.306357026100... | |
every time you declare something from an XSD. | [
0.7439023852348328,
0.06723665446043015,
0.03235018998384476,
0.17562434077262878,
-0.22167839109897614,
-0.32412096858024597,
0.304303914308548,
0.40313243865966797,
-0.20476888120174408,
-0.38562217354774475,
-0.15959224104881287,
-0.017684651538729668,
-0.31645986437797546,
-0.035465601... | |
I have a C# project in VS2008 which I wish to build for two targets - x86 and the compact framework for dot net (CF.Net) depending on a chosen configuration (say Debug/SmartDeviceDebug etc). How do I go about this? I have an inkling this can be done somehow using the command line and msbuild but I am interested in a so... | [
0.5738298892974854,
0.0843341127038002,
0.40265750885009766,
0.11369426548480988,
-0.1537579596042633,
-0.3504277765750885,
0.13833710551261902,
0.31975048780441284,
-0.21048705279827118,
-0.9317984580993652,
0.2815495431423187,
0.5139322876930237,
-0.31220078468322754,
0.22708319127559662... | |
not help (its not a scalable solution, the names and number of files change too frequently.)
Any and all suggestions will be appreciated.
I believe the csproj has to be radically different to build for different frameworks. However, there are tricks; for example, you can use wildcards in the csproj. I use this in [pro... | [
0.3598308563232422,
0.20522600412368774,
0.03420975059270859,
-0.05527356266975403,
-0.04978498816490173,
-0.2344721257686615,
0.37907296419143677,
0.015829073265194893,
-0.23374125361442566,
-0.7322264313697815,
-0.021068476140499115,
0.5842106342315674,
-0.3928358554840088,
0.01876974664... | |
Meaning . . . I've seen cases where I've bound components to a [Bindable] dataProvider. When I updated the data in the dataProvider, the component doesn't reflect the change immediately. Do I need to do something to refresh the data? What event causes a component to refresh its dataProvider data?
This is probably overk... | [
0.9116078615188599,
-0.1900128722190857,
-0.2206691950559616,
0.27775195240974426,
-0.04032086580991745,
-0.37852564454078674,
0.13453516364097595,
-0.2573302984237671,
-0.21147510409355164,
-0.27760079503059387,
0.06857272237539291,
0.4213152527809143,
-0.19317345321178436,
0.043517272919... | |
you will find.
To view it you'll need to download [Adobe Media Player](http://www.adobe.com/products/mediaplayer/) (which runs on Adobe Air). If you have problems subscribing to the 360|Flex sessions in the Adobe Media Player, follow Ted Patrick's advice from **Deleted link** his blog post.
His presentation is also o... | [
0.7606267929077148,
-0.33000823855400085,
0.23492617905139923,
0.3508218824863434,
0.043212953954935074,
-0.44633838534355164,
-0.0334806889295578,
-0.06757331639528275,
-0.33736228942871094,
-0.312894731760025,
-0.15990634262561798,
0.49254706501960754,
0.1326645314693451,
-0.155374735593... | |
I have a database which is in Access (you can get it [link text](http://cid-84dd6ce2da273835.skydrive.live.com/self.aspx/.Public/Unisa.accdb)). If I run
```
SELECT DISTINCT Spl.Spl_No, Spl.Spl_Name
FROM Spl INNER JOIN Del
ON Spl.Spl_No = Del.Spl_No
WHERE Del.Item_Name <> 'Compass'
```
It provides the names of th... | [
0.048518840223550797,
-0.05689161643385887,
0.7428386807441711,
-0.09256385266780853,
0.0013693091459572315,
0.3005901277065277,
0.003352163592353463,
-0.26540035009384155,
-0.2720014452934265,
-0.5097734332084656,
0.13740770518779755,
0.3880726397037506,
0.03316407650709152,
0.43373611569... | |
COUNT(DEL.SPL_No) = 0
```
So the question: Is this possible to do with a sub-query.
Do you mean something like this?
```
SELECT SPL.SPL_Name
FROM SPL
WHERE NOT SPL.SPL_no IN
(SELECT SPL_no FROM DEL WHERE DEL.Item_Name = "Compass")
``` | [
-0.023823149502277374,
-0.2658955156803131,
0.6836076974868774,
-0.022699154913425446,
-0.05747377127408981,
-0.11967050284147263,
-0.08468940109014511,
-0.4218845069408417,
-0.5036271214485168,
-0.025668106973171234,
0.07574646174907684,
0.21650156378746033,
-0.2741306722164154,
0.2137959... | |
What would be a good tool, or set of tools, to download a list of URLs and extract only the text content?
Spidering is not required, but control over the download file names, and threading would be a bonus.
The platform is linux.
[`wget`](http://linux.die.net/man/1/wget) `|` [`html2ascii`](http://s23.org/wiki/Html2asc... | [
0.03293716907501221,
-0.11111880093812943,
0.3401079475879669,
0.04226329177618027,
-0.39414888620376587,
-0.13082954287528992,
0.013842533342540264,
0.25738251209259033,
-0.3783961236476898,
-0.869313657283783,
-0.23748193681240082,
0.22125282883644104,
-0.3356698751449585,
0.007072442676... | |
Does creating an object using reflection rather than calling the class constructor result in any significant performance differences?
**Yes - absolutely.** Looking up a class via reflection is, *by magnitude*, more expensive.
Quoting [Java's documentation on reflection](http://java.sun.com/docs/books/tutorial/reflect/... | [
0.2985765337944031,
-0.023052679374814034,
-0.2073764055967331,
0.10833977162837982,
-0.554345965385437,
0.032998647540807724,
0.6292157769203186,
-0.2613140344619751,
-0.045594438910484314,
-0.47953319549560547,
0.1655612736940384,
0.6163254380226135,
-0.017560040578246117,
-0.02620742283... | |
static void main(String[] args) throws Exception
{
doRegular();
doReflection();
}
public static void doRegular() throws Exception
{
long start = System.currentTimeMillis();
for (int i=0; i<1000000; i++)
{
A a = new A(); | [
-0.05854688212275505,
-0.21108311414718628,
0.35342538356781006,
-0.3742775321006775,
0.26658007502555847,
0.29598093032836914,
0.41518598794937134,
-0.20556744933128357,
-0.24602068960666656,
-0.11770060658454895,
-0.4045228660106659,
0.25598594546318054,
-0.4612377882003784,
0.4856005012... | |
a.doSomeThing();
}
System.out.println(System.currentTimeMillis() - start);
}
public static void doReflection() throws Exception
{
long start = System.currentTimeMillis();
for (int i=0; i<1000000; i++)
{
A a = (A) Class.forName("misc.A").newInstance();
... | [
-0.053753361105918884,
-0.311689168214798,
0.42966336011886597,
-0.373687207698822,
0.2573050260543823,
0.2805781364440918,
0.5329298377037048,
-0.5424959063529968,
-0.10436803847551346,
-0.4010173976421356,
-0.27190524339675903,
0.4454110860824585,
-0.43218228220939636,
0.5620524287223816... | |
}
System.out.println(System.currentTimeMillis() - start);
}
}
```
With these results:
```
35 // no reflection
465 // using reflection
```
Bear in mind the lookup and the instantiation are done together, and in some cases the lookup can be refactored away, but this is just a basic example.
Even if you ... | [
-0.33057379722595215,
-0.04795340448617935,
0.35507065057754517,
-0.1859707087278366,
0.01795048452913761,
-0.028844375163316727,
0.31155481934547424,
-0.4854941666126251,
-0.26913219690322876,
-0.5635203123092651,
-0.1335243135690689,
0.7449210286140442,
-0.24169188737869263,
-0.139396011... | |
I'm trying to display a table full of twitter statuses (yes, this is the [Stanford Presence 2](http://cs193p.stanford.edu/downloads/AssignmentPresence2.pdf) assignment), which are variably sized. I can relatively easily determine the appropriate height for my rows with code that approximates (from [accompanying lecture... | [
0.015139639377593994,
-0.06649830937385559,
0.7201522588729858,
-0.10215204209089279,
-0.35403701663017273,
0.2808245122432709,
0.18177013099193573,
0.03402877226471901,
-0.30657753348350525,
-0.9175825715065002,
0.006539253983646631,
0.4850119650363922,
-0.11494294553995132,
-0.2524076700... | |
field of text into my table row.
1. Add a UILabel as a subview to my custom UITableCell subclass, and set the `numberOfLines` property to either a calculated number based on the height above (say, 6), or to 0 (theoretically unlimited). The `numberOfLines` is ignored; I see either 1 or 2 lines, and no more.
2. Add a re... | [
0.1747197061777115,
-0.3538135886192322,
0.9650590419769287,
0.038686174899339676,
-0.28471970558166504,
0.029400795698165894,
0.19337476789951324,
0.0941150039434433,
-0.15506790578365326,
-0.8754135370254517,
-0.24539166688919067,
0.38104209303855896,
-0.27490726113319397,
-0.01858140714... | |
scroll at all.
This is a pretty common thing to do; what's the best way to accomplish it?
You might want to look at the `userInteractionEnabled` property of the `UITextView`. That should allow input to be passed through to the `UITableView` so you get scrolling. | [
0.34331199526786804,
-0.24818579852581024,
0.5604800581932068,
0.44290149211883545,
-0.09531619399785995,
-0.3633982837200165,
0.25844061374664307,
0.22933951020240784,
-0.10602930188179016,
-0.7661080360412598,
0.043833937495946884,
0.7625572085380554,
0.057650353759527206,
-0.06951759010... | |
For some reason, when I use the standalone build from InstallShield 2009 Professional, there are times when I get an error and times when the build completes successfully, with no major distinguishable reason why. The error that shows up usually reads something like:
IsCmdBld.exe - Application Error
The instruction a... | [
0.18440967798233032,
0.3451205790042877,
0.2546820640563965,
-0.11725189536809921,
0.17712348699569702,
-0.2411099076271057,
0.6518493294715881,
0.24667741358280182,
-0.08114880323410034,
-0.4882122576236725,
-0.20036110281944275,
0.8693292737007141,
-0.26925474405288696,
0.148106098175048... | |
a bug in IsCmdBld.exe causing this. | [
-0.03890953212976456,
0.10998178273439407,
-0.0014978761319071054,
0.05237111076712608,
0.1464555710554123,
-0.5579081177711487,
0.36915042996406555,
0.4499201476573944,
-0.2976992428302765,
-0.5663561224937439,
0.08480405062437057,
0.21126723289489746,
-0.5171605944633484,
0.4632766246795... | |
What is the easiest way using common linux tools to check if a bunch of ip addresses belongs to given network? I just need a number of how many of given addresses belongs to given subnet. Lets say network is 192.16.55.40/27 and addresses is 192.16.55.45, 192.16.55.115, 88.87.45.8, 192.16.55.37, 192.16.55.60 and 192.16.... | [
0.23612384498119354,
0.02347724325954914,
0.20206798613071442,
0.09957845509052277,
-0.3666241765022278,
-0.11344926804304123,
0.5078010559082031,
-0.2362421303987503,
-0.3039191961288452,
-0.9343509674072266,
0.18706515431404114,
0.45347288250923157,
-0.5665048360824585,
0.002825976116582... | |
< backgound>
I'm at a point where I really need to optimize C++ code. I'm writing a library for molecular simulations and I need to add a new feature. I already tried to add this feature in the past, but I then used virtual functions called in nested loops. I had bad feelings about that and the first implementation pr... | [
0.21163608133792877,
0.06464265286922455,
0.33876916766166687,
-0.0022476501762866974,
-0.1488088220357895,
-0.1832946389913559,
0.10052135586738586,
-0.01750032790005207,
-0.3161082863807678,
-0.46361789107322693,
0.18496599793434143,
0.4178542494773865,
-0.17392657697200775,
0.1067394092... | |
than less).
Now I know a little bit more about templates and class policies (from Alexandrescu's excellent book) and I think that a compile-time code generation may be the solution.
However I need to test the design before doing the *huge* work of implementing it into the library. The question is about the best way to... | [
0.4526599943637848,
0.19584445655345917,
0.1745499223470688,
0.3323467969894409,
-0.010846806690096855,
-0.02265205606818199,
0.2562175989151001,
-0.27943968772888184,
-0.07820723950862885,
-0.6219949722290039,
0.10906399041414261,
0.734513521194458,
-0.27826058864593506,
0.127057805657386... | |
benchmark because a delta of 1e-3 second can make the difference between a good and a bad design (this feature will be called million times in the real program).
The problem is that g++ is sometimes "too smart" while optimizing and can remove a whole loop if it consider that the result of a calculation is never used. ... | [
0.4074445366859436,
-0.008023126050829887,
0.21533994376659393,
-0.03585771843791008,
-0.19818702340126038,
0.07084134966135025,
0.4147528111934662,
-0.26733827590942383,
-0.1809297353029251,
-0.5303624868392944,
0.256832480430603,
0.5213286876678467,
-0.2759903073310852,
-0.20570410788059... | |
do a **correct** benchmark of a little feature extracted from a library ?
Related question: is it a correct approach to do this kind of *in vitro* tests on a small unit or do I need the whole context ?
Thanks for advices !
---
There seem to be several strategies, from compiler-specific options allowing fine tuning t... | [
0.4898439347743988,
-0.02723776362836361,
-0.3474600911140442,
0.48751765489578247,
-0.2757861912250519,
0.006342588923871517,
0.38219594955444336,
-0.162981778383255,
0.06746349483728409,
-0.29925575852394104,
0.06415162235498428,
0.600763201713562,
0.013248078525066376,
0.028214437887072... | |
That operation cannot be optimized out, by definition.
```
template<typename T> void sink(T const& t) {
volatile T sinkhole = t;
}
```
No iostream overhead, just a copy that has to remain in the generated code.
Now, if you're collecting results from a lot of operations, it's best not to discard them one by one. T... | [
0.12306452542543411,
0.15822908282279968,
0.019564393907785416,
-0.005339041352272034,
0.15820114314556122,
0.05520019680261612,
0.24587546288967133,
-0.17632564902305603,
-0.14935168623924255,
-0.5016146302223206,
-0.20137688517570496,
0.5407291650772095,
-0.5778145790100098,
-0.040491696... | |
values together modulo 1<<32. This adds hardly any overhead; the strings will likely be in cache. The result of the addition will subsequently be assigned-to-volatile so each char in each sting must in fact be calculated, no shortcuts allowed. | [
0.1130615696310997,
0.19000323116779327,
0.22834214568138123,
-0.033649325370788574,
-0.12259291112422943,
-0.1452452540397644,
0.36027953028678894,
-0.4823356866836548,
-0.13510170578956604,
-0.2726115882396698,
0.16420826315879822,
0.5846747159957886,
-0.29189133644104004,
-0.19067335128... | |
I register my two interfaces on application start as so:-
```
container.Register(Component.For(typeof(IEntityIndexController)).ImplementedBy(typeof(SnippetController)).LifeStyle.Transient);
container.Register(Component.For(typeof(ISnippetController)).ImplementedBy(typeof(SnippetController)).LifeStyle.Transient);
```
... | [
0.2133592814207077,
-0.05157443508505821,
0.4817907512187958,
0.04568886011838913,
0.03326152637600899,
-0.022174760699272156,
0.3280811309814453,
-0.2734640836715698,
-0.1448795646429062,
-1.0000910758972168,
0.10383064299821854,
0.47436246275901794,
-0.37081050872802734,
0.29806607961654... | |
something obvious here that I'm missing? (p.s. im using .net 3.5, windsor RC3)
Have you tried registering with different syntax (`AddComponent<>`)?
Try updating to latest trunk version and see if it helps. Looks like a bug to me.
If it does not happen, create a test that exhibits the bug, and submit it [here](http://s... | [
0.5364980101585388,
-0.051482997834682465,
0.019510993734002113,
0.1476108878850937,
0.11948010325431824,
-0.5175766348838806,
0.4361972212791443,
-0.1692802906036377,
-0.4688822329044342,
-0.4461052119731903,
-0.13559457659721375,
0.02144576981663704,
-0.10361144691705704,
-0.100337773561... | |
Suppose you have a history containing the three commits *A, B* and *C*:
```
A-B-C
```
I would like to combine the two commits *A* and *B* to one commit *AB*:
```
AB-C
```
I tried
```
git rebase -i A
```
which opens up my editor with the following contents:
```
pick e97a17b B
pick asd314f C
```
I change this... | [
-0.028012361377477646,
0.26838159561157227,
0.23485159873962402,
-0.22109076380729675,
0.003037168411538005,
0.21537308394908905,
0.1931288242340088,
-0.29609256982803345,
-0.6172745823860168,
-0.7935314774513245,
-0.14495863020420074,
0.30802199244499207,
-0.2954173684120178,
-0.103345081... | |
will combine the two commits *A* and *B* to one commit *AB*.
Found in [this answer](https://stackoverflow.com/a/9254257/105137). | [
0.16288869082927704,
0.1905895471572876,
0.13825643062591553,
0.0821940004825592,
0.3564389646053314,
0.09421995282173157,
0.262897253036499,
-0.46589258313179016,
-0.5860693454742432,
-0.4008752405643463,
-0.21648094058036804,
0.19016171991825104,
-0.23729118704795837,
-0.0874035730957984... | |
Looking for some sample code (C#) for a simple thread pool implementation.
I found one on codeproject, but the codebase was just huge and I don't need all that functionality.
This is more for educational purposes anyways.
There is no need to implement your own, since it is not very hard to use the existing .NET imple... | [
0.38426876068115234,
-0.2426488697528839,
0.5444718599319458,
-0.13690270483493805,
0.3523733615875244,
0.12531372904777527,
0.03896894305944443,
-0.1643259972333908,
-0.5272433757781982,
-0.593376636505127,
0.07564227283000946,
0.5361329913139343,
-0.5298813581466675,
0.27871546149253845,... | |
Wrapper method for use with thread pool.
public void ThreadPoolCallback(Object threadContext)
{
int threadIndex = (int)threadContext;
Console.WriteLine("thread {0} started...", threadIndex);
_fibOfN = Calculate(_n);
Console.WriteLine("thread {0} result calculated...", threadIndex... | [
0.0636146292090416,
-0.4747084379196167,
0.5683130621910095,
-0.2054453045129776,
0.22476835548877716,
0.12283094972372055,
-0.025838656350970268,
-0.42550352215766907,
-0.18336735665798187,
-0.3345564603805542,
0.059211164712905884,
0.5444219708442688,
-0.5085488557815552,
0.2552120685577... | |
if (n <= 1)
{
return n;
}
return Calculate(n - 1) + Calculate(n - 2);
}
public int N { get { return _n; } }
private int _n;
public int FibOfN { get { return _fibOfN; } }
private int _fibOfN;
private ManualResetEvent _doneEvent;
}
public | [
0.1179407462477684,
-0.23113426566123962,
0.4178764522075653,
-0.16129715740680695,
0.40484702587127686,
0.10850142687559128,
0.15504813194274902,
-0.4800114631652832,
-0.16418056190013885,
-0.18306006491184235,
-0.6855663657188416,
1.1194334030151367,
-0.09957613050937653,
-0.195062026381... | |
class ThreadPoolExample
{
static void Main()
{
const int FibonacciCalculations = 10;
// One event is used for each Fibonacci object
ManualResetEvent[] doneEvents = new ManualResetEvent[FibonacciCalculations];
Fibonacci[] fibArray = new Fibonacci[FibonacciCalculations];
R... | [
-0.0837797299027443,
-0.6726726293563843,
0.2710670232772827,
-0.04667814448475838,
0.3403906524181366,
0.17059405148029327,
-0.07565934956073761,
-0.03172265738248825,
-0.43933525681495667,
-0.3302750289440155,
-0.15528886020183563,
0.6503901481628418,
-0.31083914637565613,
0.259728610515... | |
FibonacciCalculations);
for (int i = 0; i < FibonacciCalculations; i++)
{
doneEvents[i] = new ManualResetEvent(false);
Fibonacci f = new Fibonacci(r.Next(20,40), doneEvents[i]);
fibArray[i] = f;
ThreadPool.QueueUserWorkItem(f.ThreadPoolCallback, i);
... | [
-0.03339941427111626,
-0.6331019997596741,
0.9120010733604431,
-0.18269896507263184,
0.6394821405410767,
0.4391222894191742,
0.24062833189964294,
-0.3199746012687683,
-0.5025719404220581,
-0.4890112280845642,
-0.3540014624595642,
0.7557276487350464,
-0.2508833706378937,
0.40645015239715576... | |
Wait for all threads in pool to calculation...
WaitHandle.WaitAll(doneEvents);
Console.WriteLine("All calculations are complete.");
// Display the results...
for (int i= 0; i<FibonacciCalculations; i++)
{
Fibonacci f = fibArray[i];
Console.WriteLine("Fibo... | [
0.2396334409713745,
-0.4199290871620178,
0.7933593392372131,
-0.16503645479679108,
0.6746211647987366,
0.20120906829833984,
0.02262505702674389,
-0.2868369221687317,
-0.41579657793045044,
-0.5024713277816772,
-0.0745503157377243,
0.4979650676250458,
-0.29136794805526733,
0.1246167421340942... | |
}
}
``` | [
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,
... | |
I am trying to add data to a newly created column...
```
DataSet ds = new DataSet;
ds.Tables[0].Columns.Add("Count");
Data.DataSource = ds;
Data.DataBind();
```
Where do I add, a hardcoded count? (I want count column to have '4')
There is no need to implement your own, since it is not very hard to use the existing ... | [
0.26798316836357117,
-0.05124383419752121,
0.697507917881012,
-0.33274587988853455,
0.2714729607105255,
0.2965987026691437,
0.38535812497138977,
-0.44650790095329285,
-0.2859379053115845,
-0.707619845867157,
-0.19726791977882385,
0.37771540880203247,
-0.5519985556602478,
0.1878197491168975... | |
with thread pool.
public void ThreadPoolCallback(Object threadContext)
{
int threadIndex = (int)threadContext;
Console.WriteLine("thread {0} started...", threadIndex);
_fibOfN = Calculate(_n);
Console.WriteLine("thread {0} result calculated...", threadIndex);
_doneEvent.S... | [
0.030146805569529533,
-0.5094078779220581,
0.4537486135959625,
-0.21663020551204681,
0.3915606439113617,
0.09337928146123886,
-0.0524819940328598,
-0.39468318223953247,
-0.30844536423683167,
-0.3946651220321655,
0.13049378991127014,
0.5814111828804016,
-0.4949371814727783,
0.27100774645805... | |
if (n <= 1)
{
return n;
}
return Calculate(n - 1) + Calculate(n - 2);
}
public int N { get { return _n; } }
private int _n;
public int FibOfN { get { return _fibOfN; } }
private int _fibOfN;
private ManualResetEvent _doneEvent;
}
public class ThreadPoolEx... | [
0.2236865609884262,
-0.4052969217300415,
0.5859203934669495,
-0.22045284509658813,
0.5305459499359131,
0.06661064922809601,
0.1593395471572876,
-0.15507912635803223,
-0.18448680639266968,
-0.27993524074554443,
-0.41652601957321167,
0.9566925168037415,
-0.3175656497478485,
0.160604208707809... | |
static void Main()
{
const int FibonacciCalculations = 10;
// One event is used for each Fibonacci object
ManualResetEvent[] doneEvents = new ManualResetEvent[FibonacciCalculations];
Fibonacci[] fibArray = new Fibonacci[FibonacciCalculations];
Random r = new Random();
... | [
-0.02048896625638008,
-0.6010149121284485,
0.2770393490791321,
-0.15102453529834747,
0.27996623516082764,
0.26600930094718933,
0.033312298357486725,
-0.010468730702996254,
-0.4090223014354706,
-0.2556731700897217,
-0.29555606842041016,
0.5545395016670227,
-0.4270491302013397,
0.38531360030... | |
for (int i = 0; i < FibonacciCalculations; i++)
{
doneEvents[i] = new ManualResetEvent(false);
Fibonacci f = new Fibonacci(r.Next(20,40), doneEvents[i]);
fibArray[i] = f;
ThreadPool.QueueUserWorkItem(f.ThreadPoolCallback, i);
}
// Wait for all thr... | [
-0.01244782842695713,
-0.5315066576004028,
0.8312526345252991,
-0.23459966480731964,
0.43299731612205505,
0.4106552302837372,
0.2846221923828125,
-0.17162589728832245,
-0.49952811002731323,
-0.36875486373901367,
-0.1480877846479416,
0.6285165548324585,
-0.06862784922122955,
0.4225234389305... | |
in pool to calculation...
WaitHandle.WaitAll(doneEvents);
Console.WriteLine("All calculations are complete.");
// Display the results...
for (int i= 0; i<FibonacciCalculations; i++)
{
Fibonacci f = fibArray[i];
Console.WriteLine("Fibonacci({0}) = {1}", f.... | [
0.22842098772525787,
-0.3434855341911316,
0.6054579615592957,
-0.07408053427934647,
0.6362560987472534,
-0.017975812777876854,
-0.3641241788864136,
-0.48651596903800964,
-0.38602325320243835,
-0.6197050213813782,
0.0036850261967629194,
0.5589583516120911,
-0.25962284207344055,
0.0630239695... | |
I would like to delay a hover event in jquery. I am reading from a file when user hovers over a link or label. I don't want this event to occur immediately in case the user is just moving the mouse across the screen. Is there a way to delay the event from firing?
Thank you.
Example code:
```
$(function() {
$('#c... | [
0.3222857415676117,
-0.16265615820884705,
0.5154686570167542,
-0.08117388188838959,
0.16576118767261505,
0.018288634717464447,
-0.23806634545326233,
0.07300151139497757,
-0.32034122943878174,
-0.5672652125358582,
0.019721783697605133,
0.45357367396354675,
-0.09018994122743607,
0.2618202865... | |
$(this).appendTo('#info');
}
);
},
function() { $('#info').remove(); }
});
});
```
**UPDATE:** *(1/14/09)*
After adding the HoverIntent plugin the above code was changed to the following to implement it. Very simple to implement.
```
$(function() {
hiConfig = {
sensit... | [
0.02174565941095352,
-0.37348443269729614,
0.879627525806427,
-0.290495902299881,
0.05939103290438652,
0.035791561007499695,
0.04305652901530266,
-0.7069151997566223,
-0.04128040373325348,
-0.7652025818824768,
0.17670035362243652,
0.9402936697006226,
-0.29899337887763977,
-0.00217309244908... | |
interval: 200, // number = milliseconds for onMouseOver polling interval
timeout: 200, // number = milliseconds delay before onMouseOut
over: function() {
$('<div id="fileinfo" />').load('ReadTextFileX.aspx', {filename:'file.txt'},
function() {
$(this).appe... | [
0.1478603482246399,
-0.6434994339942932,
0.6317814588546753,
0.0866977870464325,
0.18893477320671082,
0.371817022562027,
0.27394092082977295,
-0.4764552414417267,
0.15596726536750793,
-0.5530673265457153,
-0.11635901778936386,
0.6302446126937866,
-0.2992454171180725,
-0.07660682499408722,
... | |
}
);
}, // function = onMouseOver callback (REQUIRED)
out: function() { $('#info').remove(); } // function = onMouseOut callback (REQUIRED)
}
$('#container a').hoverIntent(hiConfig)
}
```
Use the hoverIntent plugin for jquery: <http://cherne.net/brian/resources/jquery.hoverIntent.... | [
-0.21425971388816833,
-0.239298477768898,
0.8238201141357422,
-0.1282029151916504,
0.07709325104951859,
-0.03721679747104645,
-0.2837646007537842,
0.001258893753401935,
-0.33732494711875916,
-0.7979199290275574,
-0.10783021152019501,
0.7303979396820068,
-0.021631764248013496,
0.11395781487... | |
are devoid of a 'hover' state eg. mobile browsers like safari on the iphone. You may be hiding an important part of the interface or navigation with no way to open it on such a device. You could get round this with device specific CSS. | [
0.3289850354194641,
0.3328174948692322,
0.262129545211792,
0.4447874426841736,
0.17908887565135956,
-0.41164758801460266,
0.3030732274055481,
0.5152689814567566,
-0.20141015946865082,
-0.5351484417915344,
-0.42732203006744385,
0.06213675066828728,
-0.24728740751743317,
0.04799199104309082,... | |
I would like to know your experience with ASP.NET webparts as a reusable component in your website.
How useful did you find it? Did you find any serious issues with it? Would you recommend it using in any asp.net project?
Any best practices or tips you would like to highlight with respect to this.
Would you recommen... | [
0.47626572847366333,
-0.12091705948114395,
-0.4519329369068146,
0.27979376912117004,
-0.28054821491241455,
-0.2891163229942322,
-0.17391365766525269,
0.38172030448913574,
-0.08212028443813324,
-0.4682043790817261,
0.18145379424095154,
0.044849276542663574,
0.1288006752729416,
-0.0419479422... | |
comments.
Advantages of WebParts over UserControls:
1. Support for user editable properties and personalization built in
2. Customizable Editor Parts
3. Customizable standard WebPart menus
4. Drag'n'Drop WebParts between WebPartZones
5. Support for connections between WebParts, useful for master/detail views, filters,... | [
0.14648093283176422,
-0.27835530042648315,
0.44737038016319275,
0.24811917543411255,
-0.5237016677856445,
0.1954135298728943,
0.1317976415157318,
-0.16557630896568298,
-0.3160672187805176,
-0.8600913882255554,
0.07462318986654282,
0.3715221881866455,
-0.23005972802639008,
-0.19546528160572... | |
with User Controls and Custom Web Parts](http://msdn.microsoft.com/en-us/magazine/cc300767.aspx "Personalize Your Portal with User Controls and Custom Web Parts") | [
-0.04766712710261345,
-0.0012087563518434763,
0.4049622416496277,
0.5278403759002686,
0.195992574095726,
-0.06996908038854599,
0.09579328447580338,
0.010969109833240509,
-0.3485909104347229,
-0.65543133020401,
-0.21492305397987366,
0.1443309187889099,
-0.005765832029283047,
0.2046950012445... | |
I'm just trying to understand SSIS packages a bit better and how they are deployed. Correct me I'm wrong but for any deployment, I believe there needs to be at least two files a .SSISDeploymentManifest and a .dtsx. The .SSISDeploymentManifest acts as the equivalent windows installer package which points to the .dtsx. T... | [
0.5131790041923523,
-0.028454260900616646,
0.23751451075077057,
0.0261184461414814,
-0.026574190706014633,
-0.29607075452804565,
0.23959027230739594,
0.05003216490149498,
-0.17112533748149872,
-0.9575337171554565,
-0.41352587938308716,
0.589060366153717,
-0.1704464703798294,
0.051010362803... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.