text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
`Command` e.g. `ScreenshotCommand` and execute it (via `CommandProxy.execute` method)
... and that's it!
Hope this helps. | [
0.40263986587524414,
0.010443824343383312,
0.3149522542953491,
0.11270736902952194,
0.3514072299003601,
-0.444524884223938,
0.20108263194561005,
0.3127783536911011,
-0.1013258546590805,
-0.6835451722145081,
-0.10101640969514847,
0.7444678544998169,
0.14538194239139557,
0.018802037462592125... | |
I'm really confused as to why this operation works. Can someone explain it?
```
$test1 = "d85d1d81b25614a3504a3d5601a9cb2e";
$test2 = "3581169b064f71be1630b321d3ca318f";
if ($test1 == 0)
echo "Test 1 is Equal!?";
if ($test2 == 0)
echo "Test 2 is Equal!?";
// Returns: Test 1 is Equal!?
```
For clarification, I ... | [
0.35174933075904846,
0.37975993752479553,
-0.03885691240429878,
0.018474020063877106,
-0.1706826537847519,
-0.10003692656755447,
0.643822431564331,
-0.44103822112083435,
-0.016677508130669594,
-0.4063798487186432,
0.19337747991085052,
0.543965756893158,
-0.3778751790523529,
0.2111653834581... | |
mention that Loose comparisons between string and 0 is true. But I still don't know why.
**Edit 2:** I've revised my question, why does the `$test2` value of `"3581169b064f71be1630b321d3ca318f"` not work?
[From the PHP manual](http://il.php.net/manual/en/language.types.string.php#language.types.string.conversion):
> ... | [
0.16399624943733215,
0.24322618544101715,
0.2289239764213562,
-0.018430570140480995,
-0.21569298207759857,
-0.011550048366189003,
0.20260228216648102,
-0.3762476146221161,
0.04368992894887924,
-0.3088296949863434,
-0.13027863204479218,
0.41009989380836487,
-0.3082737922668457,
-0.000212334... | |
initial
> portion of the string. If the string
> starts with valid numeric data, this
> will be the value used. Otherwise, the
> value will be 0 (zero). Valid numeric
> data is an optional sign, followed by
> one or more digits (optionally
> containing a decimal point), followed
> by an optional exponent. The e... | [
-0.23554731905460358,
-0.08857424557209015,
0.45945391058921814,
0.17814362049102783,
-0.18654057383537292,
0.07364467531442642,
-0.03978069871664047,
-0.1471780687570572,
0.4676245450973511,
-0.4937882125377655,
-0.5938464403152466,
0.22234486043453217,
-0.09208036214113235,
0.08841280639... | |
If I say:
x = "abc"
this seems like a declaration, definition and assignment, all at the same time, regardless of whether I have said anything about x in the program before.
Is this correct?
I'm not sure what the correct terminology is in Ruby for declarations, definitions and assigments or if there is even a disti... | [
0.7248364090919495,
0.20982977747917175,
-0.15328775346279144,
-0.12242001295089722,
-0.2719855308532715,
-0.16060715913772583,
0.3311034142971039,
-0.11718280613422394,
-0.10339459776878357,
-0.4131719172000885,
0.08377258479595184,
0.5547462701797485,
-0.21337509155273438,
0.437516629695... | |
in Ruby, because there's nothing analogous to a declaration in the languages. Languages designed for compilers have declarations because the compiler needs to know in advance how big datatypes are and how to access different parts of them. *e.g.*, if I say in C:
```
int *i;
```
then the compiler knows that somewhere... | [
0.45939165353775024,
0.3264513313770294,
-0.09148728102445602,
0.1134013757109642,
-0.23840217292308807,
-0.3114508390426636,
0.31223663687705994,
-0.03881167247891426,
-0.2111807018518448,
-0.5576528310775757,
-0.3177182972431183,
0.20793792605400085,
-0.2890682518482208,
0.05661815404891... | |
typically set an initial value for something (at least in the familiar compiled languages). If `x` didn't exist before the `x = "abc"` statement, then I guess you could call this a definition, since that is when Ruby has to assign a value to the symbol `x`.
Again, though, *definition* is a specific term that people ty... | [
0.4279218912124634,
-0.11374947428703308,
-0.4223235845565796,
0.18184754252433777,
-0.1825890988111496,
-0.4107605814933777,
0.25986436009407043,
-0.009224596433341503,
-0.25470730662345886,
-0.48291346430778503,
-0.34970059990882874,
0.25649285316467285,
-0.3211174011230469,
0.1819378286... | |
scope, and you say it's *undefined* if it hasn't.
You usually don't talk about it having a *definition*, because in Ruby that just amounts to *assignment*. There's no special context that would justify you saying *definition* like there is in other languages.
Which brings us to...
3. **Assignment:** *Yes.*
You can... | [
0.8653333783149719,
-0.10360046476125717,
-0.09722387790679932,
0.0033649171236902475,
-0.42666101455688477,
-0.5335807800292969,
0.3717532455921173,
-0.03148777037858963,
-0.1848757416009903,
-0.5905306339263916,
0.0387493260204792,
0.4651341438293457,
-0.3537764847278595,
0.1228881925344... | |
i have a question regarding the visitor pattern, I currently have two assemblies. My first assembly contains several interfaces.
```
public interface INode
{
void Visit(INodeVisitor visitor);
}
public interface INodeVisitor
{
void VisitContainer(IContainer container);
}
public interface IContainer : INode
{
... | [
-0.2836648225784302,
-0.16700319945812225,
0.8688972592353821,
-0.37039536237716675,
-0.2226937711238861,
0.24930985271930695,
0.09060699492692947,
0.07814254611730576,
-0.4177527129650116,
-0.7972635626792908,
0.06972119957208633,
0.5197676420211792,
-0.6345399618148804,
0.519518792629241... | |
Container container = value as Container;
// Do some stuff...
}
}
public class Container : IContainer
{
public void Visit(INodeVisitor visitor)
{
visitor.VisitContainer(this);
}
}
```
What i want to do is avoid the need to cast in the ContainerVisitor class, I want to referenc... | [
0.12610171735286713,
-0.023879827931523323,
0.5927006006240845,
-0.09671193361282349,
-0.13635613024234772,
-0.008141955360770226,
0.24533338844776154,
-0.18911117315292358,
-0.3821007013320923,
-0.4977266192436218,
0.031292691826820374,
0.6300168633460999,
-0.29959988594055176,
0.31622877... | |
unavoidable, but you could abstract it out a bit to remove it from the actual ContainerVisitor class.
```
public class NodeVisitor<T> : INodeVisitor where T : IContainer {
public void VisitContainer(T node) {
var container = node as T;
if ( container != null ) {
VisitTyped(container);
}
}
prot... | [
-0.3322250545024872,
-0.47046083211898804,
0.47766393423080444,
-0.06988709419965744,
0.1822919398546219,
-0.1659398078918457,
0.1138005331158638,
-0.0815553218126297,
-0.16049204766750336,
-0.6509263515472412,
-0.23413310945034027,
0.5240289568901062,
-0.41751477122306824,
0.3772143721580... | |
stuff...
}
}
``` | [
0.5119616389274597,
0.4356711506843567,
0.22848112881183624,
0.3251477777957916,
0.36857467889785767,
-0.3830626308917999,
0.0548899807035923,
0.5933519005775452,
0.014300499111413956,
-0.5193557739257812,
-0.18802520632743835,
0.434565007686615,
-0.16286219656467438,
0.4106545150279999,
... | |
I've just been working on a page which needs to be accessible to both sighted and visually impaired users. Some elements of the content, just by the nature of relating only to visual elements, simply do not apply to people using screen readers. For example, a link opens an audio-visual presentation in a new window, but... | [
0.6710255146026611,
0.15882211923599243,
0.1579795777797699,
0.21341609954833984,
0.05311500281095505,
-0.282206654548645,
0.31742483377456665,
0.09730476140975952,
-0.3769170343875885,
-0.47379109263420105,
0.11053145676851273,
0.2631138861179352,
0.07983915507793427,
0.4099796414375305,
... | |
to make screen readers ignore some content?
Halfway through writing the question I remembered where to look.
CSS can do this:
```
<span class="dontRead">Screen readers shouldn't read this</span>
.dontRead {
speak: none;
}
``` | [
0.4685361981391907,
0.1881878823041916,
0.24660974740982056,
-0.1332688182592392,
0.13708913326263428,
-0.3361744284629822,
0.3855815529823303,
0.43436741828918457,
-0.16189737617969513,
-0.35022369027137756,
0.032298631966114044,
0.3976788818836212,
-0.5029904246330261,
-0.099466018378734... | |
My experience thus far has shown me that even with multi-core processors, parallelizing an algorithm won't always speed it up noticably. In fact, sometimes it can slow things down. What are some good hints that an algorithm can be sped up significantly by being parallelized?
(Of course given the caveats with premature... | [
-0.0877964049577713,
-0.02210337668657303,
0.026713546365499496,
0.31309595704078674,
-0.15199987590312958,
0.3656969964504242,
-0.11509028822183609,
0.15614613890647888,
-0.39675813913345337,
-0.7852306365966797,
0.12194840610027313,
0.47137001156806946,
-0.3680683970451355,
0.10295939445... | |
will have a finite speed-up regardless of the number of physical cores available.
[The caveat to this, is those architectures that have a very large no. of 'cores' (such as the connection machines 64,000 cores). These are well suited to calculations that can be broken into relatively simple actions assigned to a parti... | [
-0.0842614471912384,
0.018771018832921982,
0.39856240153312683,
0.49837616086006165,
0.3819529414176941,
0.11671062558889389,
-0.024953287094831467,
-0.05149058252573013,
-0.42423132061958313,
-0.8738006353378296,
-0.5022984147071838,
0.07534781098365784,
-0.05411021411418915,
0.0797106325... | |
I looked online for some references but didn't have too much luck. Hopefully it's just some simple thing I'm overlooking, but in my code I'm looping through the participant list and storing the queried results into the array. As you can tell, my foreach statement will just add the last element of the array since the fi... | [
0.49856990575790405,
-0.011745362542569637,
0.4758158028125763,
0.09725915640592575,
-0.012156346812844276,
0.09800640493631363,
-0.04316449165344238,
-0.12131348997354507,
-0.19545218348503113,
-0.8161861896514893,
0.3344215452671051,
0.52584308385849,
-0.24876363575458527,
0.119446963071... | |
me know.
```
if (leftParticipants.Length >= 0) // Check to see if LeftParticipants exists
{
for (int c = 0; c < leftParticipants.Length; c++)
{
var l_entityIDs =
from BioList in o_data.Descendants(bp + "physicalEntityParticipant")
where BioList.Attribute(rdf + "ID").Value == leftParti... | [
0.47064319252967834,
-0.21799427270889282,
0.5483227372169495,
-0.14886310696601868,
0.7751662731170654,
0.014413614757359028,
0.04022912681102753,
-0.33017751574516296,
-0.1356002539396286,
-0.6231836676597595,
0.1927613914012909,
0.44937995076179504,
-0.03867439180612564,
0.4392789304256... | |
o_entityIDs = BioList.Elements(bp + "PHYSICAL-ENTITY")
.Select(entityID => entityID.Attribute(rdf + "resource").Value).ToArray()
};
foreach (var entity in l_entityIDs)
{
this.physEntityPhysicalLeftEntityIDs = entity.o_entityIDs; // Set SmallMolecules from Left
}... | [
-0.06750675290822983,
0.08031897991895676,
0.6310876607894897,
-0.12500086426734924,
0.34672239422798157,
0.10171155631542206,
-0.14515210688114166,
-0.23278947174549103,
-0.22060920298099518,
-0.6396977305412292,
-0.052383534610271454,
0.6062655448913574,
-0.1739966869354248,
-0.054560143... | |
look at [CiviCRM](http://civicrm.org/).
A search at [drupalmodules.com](http://drupalmodules.com/search/node/campaign+management) also revealed some other modules. | [
0.3037712574005127,
-0.37444737553596497,
0.25004735589027405,
0.21685338020324707,
-0.3562287390232086,
0.030339615419507027,
-0.04271966964006424,
-0.35946106910705566,
-0.5592209100723267,
-0.36827993392944336,
-0.07491800934076309,
0.12777012586593628,
0.1312694549560547,
-0.3619957566... | |
I'm looking to use [Slide.Show2](http://slideshow2.codeplex.com/) on a website, however I have run into a few problems, and I am wondering if they are worth fighting through or not?
Problems Thus Far:
1. XmlDataProvider does not support query string parameters in the Path argument. While I've managed to hack around i... | [
0.3954469859600067,
-0.10886401683092117,
0.23940475285053253,
0.2204192578792572,
-0.2494111955165863,
-0.07851812988519669,
0.3058871328830719,
0.009370820596814156,
-0.29093098640441895,
-0.6669543385505676,
0.32204288244247437,
0.5061629414558411,
-0.29990920424461365,
0.06367082893848... | |
do was set up one master divider that all of my content goes into. Then, I always set the updateTargetID to that divider so that it doesn't matter what content it displays, just that it displays it. This actually turns out to be easier because you don't have to waste Javascript functions setting other div tags on and o... | [
0.42071861028671265,
-0.10108954459428787,
0.49251559376716614,
-0.09905678033828735,
-0.07935614138841629,
-0.3463580906391144,
-0.23602604866027832,
-0.07220271974802017,
0.1123013123869896,
-0.48459872603416443,
0.15008367598056793,
0.5789126753807068,
-0.3035828173160553,
0.00765906181... | |
I have a simple line of text I'm replacing with sIFR for a header on my site. The site is liquid so it scales when the browser window changes width. But when I shrink the browser window down, the alt text (when I turn it on for testing) wraps to another line, but the sIFR text doesn't.
I've seen written elsewhere on t... | [
0.5729454159736633,
-0.05474016070365906,
0.5568701028823853,
-0.09296786785125732,
-0.30015668272972107,
-0.25462213158607483,
0.4594021141529083,
-0.19353638589382172,
-0.12581659853458405,
-0.823019802570343,
0.01970032788813114,
0.45202314853668213,
-0.2648046612739563,
-0.067382834851... | |
letter-spacing: 1px;
font-size: 18px;
text-align: center;
line-height: 1.5em;
}
```
And the relevant JavaScript:
```
sIFR.replaceElement(named({sSelector: "h2",
sFlashSrc: "flash/h2_font.swf", sBgColor: "#006633",
sColor: "#FFFFFF", sFlashVars: "textalign=center", sWmode: "transparent"}));
```
Not s... | [
-0.013458065688610077,
0.16346314549446106,
0.8674301505088806,
-0.18803079426288605,
-0.10561533272266388,
-0.055333707481622696,
0.3964620530605316,
-0.35808542370796204,
-0.05347857251763344,
-0.6062371730804443,
-0.4625750184059143,
0.5381566286087036,
-0.328289270401001,
-0.1818081587... | |
it. This actually turns out to be easier because you don't have to waste Javascript functions setting other div tags on and off because you're only using one that is continuously updated. | [
0.45973122119903564,
-0.33182665705680847,
0.4178900420665741,
0.383199542760849,
0.06388702988624573,
-0.5390558242797852,
0.023075703531503677,
0.01680760271847248,
0.06868896633386612,
-0.6478625535964966,
-0.05660872161388397,
0.7750425934791565,
-0.2495654821395874,
-0.150981783866882... | |
I am trying to implement a little 'intranet' on my home network, but I am an apache/mysql configuration noob...
Running fedora 10, and have apache, mysql, and php set up as well as i know how. However, when I try using a standard form with POST, the php script seems to error out on the mysql\_connect(...); line. I don... | [
0.12469874322414398,
0.30922675132751465,
0.3628707826137543,
-0.21762202680110931,
0.09951532632112503,
0.041286345571279526,
0.17880378663539886,
0.29643887281417847,
-0.1753801703453064,
-1.0292468070983887,
0.0669856071472168,
0.7748225927352905,
-0.22610491514205933,
0.069100357592105... | |
as I saw the 1186 port referenced in my my.cnf file.
Obviously I have something configured wrong, any ideas?
Agree with validator comment - validating usually helps. But, if it doesn't heres a few pointers for z-index in IE:
1) elements who's z-index you're manipulating should be on the same level ie. you should be s... | [
0.268232524394989,
-0.17549005150794983,
0.4238041937351227,
0.07672592997550964,
0.004378028213977814,
-0.12010213732719421,
0.21272563934326172,
-0.21245300769805908,
-0.03676607087254524,
-0.819161593914032,
0.12036602944135666,
0.7600308656692505,
-0.10013968497514725,
-0.0311544183641... | |
Is there any in-built class/method for comparing content of two audio/
video files?
Or is there any in-built class/method for converting a audio/video
file to bit stream?
You could use the hash functions in System.Security.Cryptography on two file streams and compare them. This is easy to do and works well for small fi... | [
0.19157493114471436,
-0.1255917251110077,
-0.06024150177836418,
0.38466519117355347,
0.032570138573646545,
-0.19383685290813446,
-0.14455708861351013,
-0.18232101202011108,
-0.14147143065929413,
-0.5453550219535828,
0.07396089285612106,
0.5916251540184021,
0.10573990643024445,
0.0448788031... | |
There is a good chance that we will be tech crunched in the next few days. Unfortunately, we have not gone live yet so we don't have a good estimation of how our system handles a production audience.
Our production setup consists of 2 EngineYard slices each with 3 mongrel instances, using Postgres as the database serv... | [
0.6200973987579346,
0.11269650608301163,
-0.0031497206073254347,
0.3570514917373657,
-0.10764710605144501,
0.2795824110507965,
0.07762543112039566,
0.03867359459400177,
0.21585573256015778,
-0.5075543522834778,
-0.07329630851745605,
0.5325772762298584,
0.23357351124286652,
-0.0304712560027... | |
have been through it. Does 6 mongrel instances (possibly 8 if the servers can take it) sound like it will handle the load, or are at least most of it?
I have worked on several rails applications that experienced high load due to viral growth on Facebook.
Your mongrel count should be based on several factors. If your m... | [
0.5001436471939087,
0.17967724800109863,
0.06532368063926697,
0.15895408391952515,
-0.14606395363807678,
-0.030647089704871178,
0.5222501158714294,
0.07099639624357224,
-0.49656039476394653,
-0.48880770802497864,
0.23707586526870728,
0.4238305985927582,
-0.22058682143688202,
-0.12520150840... | |
Balancer (not round robin). Here is the nginx module that does this: <http://github.com/gnosek/nginx-upstream-fair/tree/master>
And here are some other tips on improving and benchmarking your application performance to handle the load:
**ActiveRecord**
The most common problem Rails applications face is poor usage of... | [
0.1346329003572464,
-0.1268361508846283,
0.42521271109580994,
0.20252013206481934,
-0.31419456005096436,
0.01107324194163084,
0.10011090338230133,
-0.08545170724391937,
-0.4817337691783905,
-0.5084094405174255,
0.15943339467048645,
0.5841630697250366,
-0.13604335486888885,
0.07597865909337... | |
number of very similar queries sequentially (select \* from posts where id = 1, select \* from posts where id = 2, select \* from posts...) this may be a sign that you need to use a :include in one of your ActiveRecord calls.
*Some other basic ActiveRecord tips (These are just the ones I can think of off the top of my... | [
0.3312092125415802,
-0.10780921578407288,
0.07654805481433868,
0.22459569573402405,
-0.1293419897556305,
-0.094852015376091,
0.4651472866535187,
0.04047143831849098,
-0.39810261130332947,
-0.6135363578796387,
0.16660583019256592,
0.5961149334907532,
-0.1636061668395996,
0.00586972478777170... | |
making database queries in views. Push all queries and calculations into your models or controllers.
3. Avoid making queries in iterators. Usually this can be done by using an :include.
4. Avoid having rails build ActiveRecord objects for large datasets as much as possible. When you make a call like Post.find(:all).siz... | [
0.028629129752516747,
-0.4212599992752075,
0.0033402787521481514,
0.2961943447589874,
-0.34570392966270447,
-0.1340802013874054,
0.3449740409851074,
-0.22899477183818817,
-0.4288486838340759,
-0.8513458967208862,
0.27080240845680237,
0.4126602113246918,
-0.5319602489471436,
-0.008145553059... | |
and `user.object_ids` method. The latter skips instantiation of ActiveRecord objects and can be much faster. Especially when dealing with large numbers of objects this is a good way to speed things up.
6. Learn and use named\_scope whenever possible. It will help you keep your code tiny and makes it much easier to have... | [
0.4194295108318329,
-0.2538377046585083,
0.3319478929042816,
0.05205972492694855,
-0.11854879558086395,
-0.10245382785797119,
0.6763929128646851,
-0.11640644818544388,
-0.4345669746398926,
-0.7606465816497803,
-0.18584603071212769,
0.741972804069519,
-0.5040724873542786,
-0.060960724949836... | |
to handle new requests.
If you absolutely must make external calls during a request, you will need to run as many mongrels as possible since you may run into a situation where many of them are waiting for an API response and not doing anything else. (This is a very common problem when building Facebook applications)
... | [
0.27887487411499023,
-0.3698197901248932,
0.08030872046947479,
0.19597512483596802,
-0.22460989654064178,
0.03494668006896973,
0.5237685441970825,
-0.22345466911792755,
-0.5614608526229858,
-0.6023358702659607,
-0.021139781922101974,
0.5255864262580872,
-0.17925554513931274,
-0.33602887392... | |
storing emails in your database an using a separate script to deliver them.
Tools like [BackgroundRB](http://backgroundrb.rubyforge.org/) have been created to solve this problem.
**Caching**
[Here's a good guide on the different methods of caching in rails.](http://guides.rubyonrails.org/caching_with_rails.html)
**... | [
-0.16511432826519012,
0.021146750077605247,
0.121555395424366,
0.1253906786441803,
-0.21798931062221527,
-0.07837586849927902,
0.47625741362571716,
-0.09441094100475311,
-0.2695483863353729,
-0.6303877830505371,
0.002335574943572283,
0.4035605192184448,
-0.4987715482711792,
-0.162084639072... | |
also cache the method yourself using [Memoization](http://ryandaigle.com/articles/2008/7/16/what-s-new-in-edge-rails-memoization).
NewRelic will also provide a nice overview of how long methods and SQL calls take to execute.
Good luck! | [
-0.09948933869600296,
-0.039451465010643005,
0.44191449880599976,
0.27013418078422546,
-0.07233904302120209,
-0.46797850728034973,
0.5485416650772095,
0.26925912499427795,
-0.2992548644542694,
-0.7492894530296326,
0.15328361093997955,
0.5175145268440247,
0.23753318190574646,
-0.03524263575... | |
I am learning C and writing a simple program that will take 2 string values assumed to each be binary numbers and perform an arithmetic operation according to user selection:
* Add the two values,
* Subtract input 2 from input 1, or
* Multiply the two values.
My implementation assumes each character in the string is ... | [
0.11134124547243118,
0.12171012163162231,
-0.0758080706000328,
-0.14888182282447815,
-0.06790535151958466,
-0.04895893484354019,
0.2657577693462372,
-0.09752769768238068,
0.0713607668876648,
-0.49388694763183594,
-0.08017479628324509,
0.319645494222641,
-0.2017212063074112,
-0.069683514535... | |
there a better way to treat the input as binary values rather than `scanf()` and get each bit from the string?
I did some research but I didn't find any approach that was obviously better from the perspective of a beginner. Any suggestions would be appreciated!
**Advice:**
There's not much that's obviously better t... | [
0.4215462803840637,
-0.13611340522766113,
-0.4366599917411804,
0.23148339986801147,
-0.17303144931793213,
0.19164326786994934,
0.5383108854293823,
-0.027133235707879066,
-0.31426820158958435,
-0.4050426781177521,
0.027818048372864723,
0.3771497905254364,
-0.11944255977869034,
-0.3375228643... | |
that. The user could enter anything, and you'd like to be able to tell them if they screwed up or not.
It's true that this seems mind-bogglingly slow compared to the couple cycles it probably takes to add the actual numbers, but does it really matter if you get your answer in a nanosecond or a millisecond? Humans can ... | [
0.3903380036354065,
-0.10034824907779694,
0.06346966326236725,
0.3630785644054413,
0.15042246878147125,
0.08435063809156418,
0.4175218343734741,
-0.0008388304268009961,
-0.1529667228460312,
-0.3741759657859802,
0.10361360758543015,
0.38590946793556213,
0.1843714863061905,
-0.12646715342998... | |
here. Save your fancy optimizations for things that are actually computationally intensive :-).
What you should focus on here is making the task less manpower-intensive. And, it turns out someone already did that for you.
**Solution:**
Take a look at [the `strtol()` manpage](http://linux.die.net/man/3/strtol):
``... | [
0.07177595794200897,
-0.1289355456829071,
0.32763388752937317,
-0.24418748915195465,
0.1789405792951584,
0.07687373459339142,
0.42920345067977905,
-0.29623568058013916,
-0.38976624608039856,
-0.5331807136535645,
-0.1909695714712143,
0.5438862442970276,
-0.2844887375831604,
0.06451594829559... | |
a long converted from a valid binary string.
}
```
Supplying base 2 tells `strtol` to convert binary literals. | [
0.05769729986786842,
0.19858363270759583,
0.2775339186191559,
-0.29696136713027954,
-0.055065397173166275,
-0.25072476267814636,
0.20450112223625183,
-0.2699867784976959,
0.17445769906044006,
-0.29132452607154846,
-0.4970577359199524,
0.6523920297622681,
-0.3690630793571472,
-0.07197942584... | |
I'm trying to copy a custom object from a RDC window into host (my local) machine. It fails.
Here's the code that i'm using to 1) copy and 2) paste:
1) Remote (client running on Windows XP accessed via RDC):
```
//copy entry
IDataObject ido = new DataObject();
XmlSerializer x = new... | [
0.3114781379699707,
0.3721177279949188,
0.4230872690677643,
-0.15916667878627777,
0.015681322664022446,
0.0432138629257679,
0.2175375521183014,
-0.3209552764892578,
0.226063534617424,
-0.7113269567489624,
-0.038349803537130356,
0.6645759344100952,
-0.3864004611968994,
0.38203921914100647,
... | |
x.Serialize(sw, new EntryForClipboard(entry));
ido.SetData(typeof(EntryForClipboard).FullName, sw.ToString());
Clipboard.SetDataObject(ido, true);
```
2) Local (client running on local Windows XP x64 workstation):
```
//paste entry
IDataObject ido = Clipboard.G... | [
-0.04136095941066742,
0.07245011627674103,
0.45950180292129517,
-0.04830339923501015,
0.05363573879003525,
0.23495501279830933,
-0.015102170407772064,
-0.1345590353012085,
0.1094273030757904,
-0.6842914819717407,
-0.35077565908432007,
0.712911069393158,
-0.5862481594085693,
0.1250518858432... | |
cdf = DataFormats.GetFormat(typeof(EntryForClipboard).FullName);
if (ido.GetDataPresent(cdf.Name)) //<- this always returns false
{
//can never get here!
XmlSerializer x = new XmlSerializer(typeof(EntryForClipboard)); | [
0.12690553069114685,
-0.1539297252893448,
0.6249624490737915,
-0.175038680434227,
0.14170189201831818,
-0.49388453364372253,
0.3870152533054352,
-0.02774374559521675,
0.044340383261442184,
-0.5705031752586365,
-0.5034185647964478,
0.2568027377128601,
-0.4525386691093445,
0.3555954396724701... | |
string xml = (string)ido.GetData(cdf.Name);
StringReader sr = new StringReader(xml);
EntryForClipboard data = (EntryForClipboard)x.Deserialize(sr);
}
```
It works perfectly on the same machine though.
Any hints?
To do it manually, press the F5 key to bring up t... | [
0.03474732115864754,
-0.12372953444719315,
0.6613415479660034,
-0.06933528184890747,
0.02192441187798977,
-0.28482526540756226,
0.16964863240718842,
-0.4305652678012848,
-0.0465405099093914,
-0.5937333703041077,
-0.26577988266944885,
0.5324488282203674,
-0.22933219373226166,
-0.06322420388... | |
On the next screen, select Formulas (it's an option on the right).
Excel will select all of the cells that match. Now it's just a matter of applying formatting. | [
0.10642559081315994,
0.19356559216976166,
0.33541035652160645,
0.2991686761379242,
0.3142126202583313,
-0.16650350391864777,
-0.18892556428909302,
0.05675721913576126,
-0.0234057679772377,
-0.8203673362731934,
0.1160302683711052,
0.4668720066547394,
-0.0017197690904140472,
-0.2088991552591... | |
I work for a team of ASP.net MVC and they are using Cruisecontrol, nUnit and nAnt for the automated testing and build. I am new to the group and i handle the Javascript layer and i am looking for ways to incorporate my work with my teams workflow.
Are there any possoble way to do this?
Thanks
A few thoughts:
* There... | [
0.32084816694259644,
0.05565369129180908,
0.28975388407707214,
0.20619283616542816,
-0.09810290485620499,
-0.18370983004570007,
0.20775482058525085,
0.2973422706127167,
-0.29395896196365356,
-0.8298655152320862,
0.13499900698661804,
0.6466195583343506,
0.3225354254245758,
-0.18614152073860... | |
the repository. If so, then just make sure your JavaScript is kept in the same repo, so it will trigger builds, automatic kickoff of unit tests, etc.
* If you have portions of your JavaScript layer that can only be tested in a browser, think about using Selenium or a similar tool to create a kind of automated tests tha... | [
0.5716460943222046,
0.023313472047448158,
-0.19755761325359344,
0.5604358911514282,
-0.07348496466875076,
-0.28905871510505676,
0.11028294265270233,
0.1905573308467865,
-0.1846194863319397,
-0.43763136863708496,
0.05298718065023422,
0.6798437833786011,
0.14717231690883636,
-0.0033701485954... | |
Say I have classes `Foo` and `Bar` set up like this:
```
class Foo
{
public:
int x;
virtual void printStuff()
{
std::cout << x << std::endl;
}
};
class Bar : public Foo
{
public:
int y;
void printStuff()
{
// I would like to call Foo.printStuff() here...
std::cout... | [
0.3941676616668701,
0.341317355632782,
0.6097050905227661,
-0.377874493598938,
0.2558806240558624,
0.08640851080417633,
-0.12453090399503708,
-0.1847468912601471,
-0.16124080121517181,
-0.4090314209461212,
-0.11460396647453308,
0.5360931754112244,
-0.4863944947719574,
0.33563530445098877,
... | |
able to call the base class's function that I'm overriding. In Java there's the `super.funcname()` syntax. Is this possible in C++?
In C++ you have to explicitly name the base class in calling the derived class method. This can be done from any method from the derived class. The override is a special case of the method... | [
0.09460204094648361,
-0.03756106272339821,
0.23984655737876892,
-0.15962427854537964,
-0.3448846638202667,
-0.2907015085220337,
0.05014130845665932,
-0.3131272494792938,
-0.17182417213916779,
-0.4380675256252289,
-0.15004515647888184,
0.7371203303337097,
-0.6650185585021973,
-0.00973024964... | |
help the compiler to check
Foo::printStuff(); // calls base class' function
}
};
``` | [
0.289562463760376,
0.2138003408908844,
0.020984916016459465,
-0.145325168967247,
0.13275164365768433,
-0.28767961263656616,
0.18883907794952393,
-0.021956821903586388,
-0.06624118983745575,
-0.2639355957508087,
-0.40091073513031006,
0.6932371258735657,
-0.4929671883583069,
-0.3845288157463... | |
Is there anyway I can get the name of class property `IntProperty`?
```
public class ClassName
{
public static int IntProperty { get { return 0; } }
}
//something like below but I want to get the string of "IntProperty"
ClassName.IntProperty.GetType().Name
```
Basically what I want to do is to dynamically save pr... | [
0.24659982323646545,
-0.0685475766658783,
0.18313050270080566,
0.020283157005906105,
0.18129494786262512,
-0.032889869064092636,
0.11881589889526367,
-0.08476535975933075,
-0.38784435391426086,
-0.38602498173713684,
0.0214427188038826,
0.5400801301002502,
-0.22234685719013214,
0.0947355106... | |
class (class is used to group tasks).
```
public class ApplicationTask
{
public static Task<string> SendIncompleteNotification
{
get
{
return new Task<string>
(
a => Console.WriteLine("Sample Task") | [
-0.03282025083899498,
-0.26316389441490173,
0.2601431608200073,
0.0075878966599702835,
0.18519307672977448,
0.12069949507713318,
0.31071311235427856,
-0.2916189134120941,
-0.07528851926326752,
-0.666628360748291,
-0.19383612275123596,
0.5070031881332397,
-0.6279816031455994,
0.081711605191... | |
, "This is a sample task which does nothing."
);
}
}
}
```
So, the code will be able to retrieve the full name of the class and property something like: `namespace.ApplicationTask.SendIncompleteNotification` and save this into the database. Later on, the code will read the string and dynam... | [
-0.11058168858289719,
-0.19381742179393768,
0.2558044493198395,
-0.11612892895936966,
0.2454865723848343,
0.03413054347038269,
0.33639994263648987,
-0.15433676540851593,
-0.1231556162238121,
-0.4181317985057831,
-0.3106963634490967,
0.46724486351013184,
-0.3500012755393982,
0.3819376528263... | |
no trace of it having come from `IntProperty`.
If you're using .NET 3.5 you can use an expression tree instead, usually created via a lambda expression:
```
Expression<Func<int>> exp = () => ClassName.IntProperty;
```
You can then compile and execute the expression *and* separately find out what it's doing (retriev... | [
0.19062761962413788,
-0.23819029331207275,
0.09476462751626968,
0.0539293996989727,
0.053757164627313614,
-0.08890198916196823,
0.22438843548297882,
0.029715776443481445,
-0.23627303540706635,
-0.49437808990478516,
-0.4012216627597809,
0.6127121448516846,
-0.263728529214859,
0.006928150542... | |
how you want to use this, we could help more. You've shown just an expression - if you could show it in terms of where you'd be using it, that would be great.
EDIT: You've expanded the property, but not how it's being called. Do you *need* to call it directly, rather than just fetching the list of properties using `Ty... | [
0.5509539842605591,
-0.11281415075063705,
0.19758503139019012,
0.1274486929178238,
0.17356611788272858,
-0.17240305244922638,
-0.03990992158651352,
0.005618981085717678,
-0.3777269721031189,
-0.714924693107605,
-0.12020811438560486,
0.4917180836200714,
-0.07397246360778809,
0.0668800696730... | |
The decorator design pattern is a very good solution for extending a class functionality. For instance if I want pre and post processing methods on an existing class method I can create a decorator and override the existing method in the base class and call my pre and post processing methods respectively.
My question ... | [
0.48920169472694397,
0.035554397851228714,
0.13080891966819763,
0.23707570135593414,
0.1791040599346161,
-0.039379462599754333,
0.4053288996219635,
-0.16442346572875977,
-0.09379903227090836,
-0.7064260244369507,
0.06363685429096222,
0.4616309404373169,
-0.3580053150653839,
0.4463748037815... | |
classes so that in situations where I want to override any methods it can be done in the best possible manner.
The result of `ClassName.IntProperty` is just an integer value. As soon as it's executed and the result is returned, there's no trace of it having come from `IntProperty`.
If you're using .NET 3.5 you can use... | [
0.09395573288202286,
-0.18588727712631226,
-0.01572616957128048,
0.15446321666240692,
0.033611103892326355,
-0.028351880609989166,
0.21478375792503357,
0.013714692555367947,
-0.16350677609443665,
-0.4962405264377594,
-0.27923715114593506,
0.5008247494697571,
-0.3552945852279663,
0.11742472... | |
want to do though.
If you *do* work out how to save the property name in the database, then `GetProperty` is the way to go on the retrieval front.
Perhaps if you could give more context in the question in terms of how you want to use this, we could help more. You've shown just an expression - if you could show it in ... | [
0.5745642185211182,
-0.13335686922073364,
0.2993236780166626,
0.1570727825164795,
0.34409865736961365,
-0.1927775740623474,
-0.11878155916929245,
-0.027132149785757065,
-0.40622374415397644,
-0.4748288691043854,
-0.29471635818481445,
0.4624602794647217,
-0.021659044548869133,
0.14842775464... | |
and storing the list of property names in the database?
Again, if you could show the code which *calls* the property, and how you want it to interact with the database, we may be able to make more progress. | [
0.5294758677482605,
0.1378706693649292,
-0.0014422902604565024,
0.33078137040138245,
0.21457795798778534,
-0.32164645195007324,
-0.09889821708202362,
-0.17014099657535553,
-0.35942843556404114,
-0.3831513226032257,
0.2419009953737259,
0.5309182405471802,
0.21522006392478943,
0.177700474858... | |
For 2 owners the answer is easy - use a slider with one owner on the left, the other on the right, and slide to control the percentage of each.
How do I do it with 3 or more owners?
Specifically I'm talking about Java Swing-based GUI, but am mainly looking for the design idea.
Thanks!
Create a triangle control, wh... | [
-0.04684901237487793,
-0.048826608806848526,
0.5086548924446106,
0.19712163507938385,
-0.1802501529455185,
0.017099183052778244,
0.036165133118629456,
-0.6598035097122192,
-0.26619666814804077,
-0.5899222493171692,
0.12256357818841934,
0.30592480301856995,
-0.1490076333284378,
-0.357079118... | |
What is stack alignment?
Why is it used?
Can it be controlled by compiler settings?
The details of this question are taken from a problem faced when trying to use ffmpeg libraries with msvc, however what I'm really interested in is an explanation of what is "stack alignment".
The Details:
* When runnig my msvc com... | [
0.2680051624774933,
0.04122869297862053,
0.11616486310958862,
-0.12382061034440994,
-0.10185922682285309,
-0.19715525209903717,
0.2890028655529022,
-0.38718536496162415,
-0.39271900057792664,
-0.5330007672309875,
0.38257986307144165,
0.7826249003410339,
-0.5689202547073364,
0.0662213638424... | |
avcodec.dll everything works well.
* ffmpeg.exe was not compiled with msvc, it was complied with gcc / mingw (same as avcodec.dll)
Thanks,
Dan
Alignment of variables in memory (a short history).
In the past computers had an 8 bits databus. This means, that each clock cycle 8 bits of information could be processed. W... | [
0.03192470595240593,
0.07051131129264832,
0.258518248796463,
0.25151312351226807,
-0.23817108571529388,
-0.059753239154815674,
0.2308858335018158,
-0.04924728721380234,
-0.5130372047424316,
-0.6252672076225281,
0.14520235359668732,
0.5856884121894836,
-0.35602325201034546,
-0.1544662863016... | |
a memory map:
```
+----+
|0000|
|0001|
+----+
|0002|
|0003|
+----+
|0004|
|0005|
+----+
| .. |
```
At each address there is a byte which can be accessed individually.
But words can only be fetched at even addresses. So if we read a word at 0000, we read the bytes at 0000 and 0001. But if we want to read the word at... | [
-0.4953586459159851,
0.2333323359489441,
0.05233784019947052,
0.23989467322826385,
-0.0428430549800396,
0.4503278434276581,
0.12734061479568481,
-0.20255181193351746,
-0.1252712905406952,
-0.7879990935325623,
0.0747026577591896,
0.3147445321083069,
0.003228716552257538,
0.27459052205085754... | |
we have a structure with a byte field (B) and a word field (W) (and a very naive compiler), we get the following:
```
+----+
|0000| B
|0001| W
+----+
|0002| W
|0003|
+----+
```
Which is not fun. But when using word alignment we find:
```
+----+
|0000| B
|0001| -
+----+
|0002| W
|0003| W
+----+
```
Here memory is ... | [
0.10997864603996277,
0.3919764757156372,
-0.018592292442917824,
0.0546543188393116,
-0.022434338927268982,
0.1446051299571991,
0.17685768008232117,
-0.2071908563375473,
-0.15092642605304718,
-0.8402965068817139,
0.007697946857661009,
0.5752632021903992,
-0.28348642587661743,
-0.04298327490... | |
I have switched to JUnit4.4 from JUnit3.8. I run my tests using ant, all my tests run successfully but test utility classes fail with "No runnable methods" error. The pattern I am using is to include all classes with name \*Test\* under test folder.
I understand that the runner can't find any method annotated with @Te... | [
0.32677656412124634,
-0.08478499203920364,
0.05246613919734955,
-0.19821058213710785,
-0.5596507787704468,
0.023226024582982063,
0.6503123044967651,
0.10366373509168625,
0.1771463006734848,
-1.0735359191894531,
0.06812227517366409,
0.5658904314041138,
-0.29572808742523193,
-0.0826478078961... | |
execute them.
I know I can exclude these specific classes in the junit target in ant script. But I don't want to change the build file upon every new utility class I add. I can also rename the classes (but giving good names to classes was always my weakest talent :-) )
Is there any elegant solution for this problem?... | [
0.5671789646148682,
-0.04956304281949997,
-0.26715439558029175,
0.13968606293201447,
-0.08362140506505966,
-0.011623484082520008,
0.2929883897304535,
-0.02517155557870865,
0.0497298501431942,
-0.8270228505134583,
0.2379254698753357,
0.35900330543518066,
-0.18658101558685303,
-0.22442050278... | |
Can someone put a list of open source software of each of these components included in the question ["Building a web search engine"](https://stackoverflow.com/questions/112248/building-a-web-search-engine)?
That will save many people's time in the search for high quality open source components.
Component List:
1. C... | [
0.10627708584070206,
-0.00835905596613884,
0.020739879459142685,
0.29921647906303406,
-0.1568366438150406,
-0.1296444684267044,
0.18891870975494385,
-0.23489870131015778,
-0.14051899313926697,
-0.49664631485939026,
-0.15033464133739471,
0.4203391969203949,
-0.24393542110919952,
0.223904490... | |
a call to `base()`. In other words:
```
public Foo(int x)
```
is equivalent to
```
public Foo(int x) : base()
```
In both cases the base class's parameterless constructor is called before the body of the `Foo` constructor is executed. The compiler makes sure that you don't get into an infinite loop - every (non-s... | [
0.03602026030421257,
-0.1413787454366684,
0.06853343546390533,
-0.281113862991333,
-0.11037741601467133,
-0.27235206961631775,
0.32481592893600464,
-0.21639566123485565,
-0.13931545615196228,
0.03569469973444939,
-0.4748383164405823,
0.5825497508049011,
-0.6921139359474182,
0.2106770724058... | |
more information. | [
0.5990589261054993,
-0.19652456045150757,
0.2708381116390228,
0.6157041788101196,
-0.10394000262022018,
-0.45546644926071167,
0.1016717404127121,
0.4354291260242462,
-0.2015155851840973,
-0.6985343098640442,
-0.05083617940545082,
0.003768177703022957,
0.0076761734671890736,
0.2487924993038... | |
I have a .mdf which I need to import into MS Access. I have read that .mdf is a Sql Server format so Access wont recognize it. But is there some way I can get the database created in MS Access. I am using Access 2003 and Sql Server 2005
Why not right click the database in SQL Management Studio, click export and then sp... | [
-0.0010156836360692978,
0.3022240698337555,
0.49408677220344543,
0.025190073996782303,
-0.12389638274908066,
-0.2186322659254074,
-0.03431833162903786,
0.18636736273765564,
-0.2784677743911743,
-0.7151137590408325,
0.3456531763076782,
0.5514404773712158,
-0.34111443161964417,
0.35107925534... | |
O' LINQ-fu masters, please help.
I have a requirement where I have to add items into a List(Of T) (let's call it Target) from an IEnumerable(Of T) (let's call it Source) using Target.AddRange() in VB.NET.
```
Target.AddRange(Source.TakeWhie(Function(X, Index) ?))
```
The ? part is a tricky condition that is somethi... | [
0.18025295436382294,
0.06880682706832886,
0.45797643065452576,
-0.08856794983148575,
0.0567510612308979,
-0.13917529582977295,
-0.20112252235412598,
-0.388766884803772,
-0.09748867899179459,
-0.44734102487564087,
-0.05431460589170456,
0.6219937801361084,
-0.34764641523361206,
0.12984092533... | |
part is that \_curr\_count\_of\_items\_taken needs to be incremented each time the TakeWhile statement is satisfied. How would I go about doing that?
I'm also open to a solution that uses any other LINQ methods (Aggregate, Where, etc.) instead of TakeWhile.
If all else fails then I will go back to using a good old fo... | [
0.2382855862379074,
0.01694241352379322,
0.5869084596633911,
-0.12299685925245285,
0.046205565333366394,
-0.022572362795472145,
0.16521954536437988,
-0.053134579211473465,
-0.23086929321289062,
-0.4175201952457428,
-0.03225678205490112,
0.6828466057777405,
-0.26540106534957886,
0.101759232... | |
OrElse NumberGenerator.GetRandomNumberBetween1And100 <= _possibility_item_is_taken Then
Target.Add(Source(_index))
End If
Next
```
EDITDIT:
David's no-side-effects answer comes closes to what I need while staying readable. Maybe he's the only one who could understand my poorly communicated pseudo-code =).... | [
0.06489664316177368,
0.040750063955783844,
0.6577181220054626,
-0.010599354282021523,
0.054365124553442,
0.10615210235118866,
0.34010109305381775,
-0.3671242892742157,
-0.051800016313791275,
-0.4814737141132355,
-0.20101119577884674,
0.6432411670684814,
-0.3760724663734436,
-0.009097728878... | |
too hard to add:
```
target.AddRange( source
.Select( (x, i) => new {x, i})
.OrderBy(GetRandomNumber)
.Take(3)
.OrderBy( z => z.i)
.Select( z => z.x)
);
```
---
If requirements are to (for whatever reason)
* favor items at the end of the list
* allow more items through than requested (5 instead of 3, but... | [
0.10705436021089554,
-0.13465937972068787,
0.38823965191841125,
-0.3849787414073944,
0.1278422325849533,
0.07888796180486679,
0.3840482234954834,
-0.520695686340332,
0.04332868382334709,
-0.6056213974952698,
-0.16755712032318115,
0.7035439014434814,
-0.3919152319431305,
0.03961401432752609... | |
I would expect this would be a common need. Can anyone help or point me to a page that explains how to do this?
If you mean like the auto-complete options on `TextBox`, I'm not aware of any in-built support for this. The closest (although not the same) would be to use a `DataGridViewComboBoxColumn`.
For things *not* d... | [
0.7178919315338135,
-0.28286030888557434,
0.3287542164325714,
0.38812515139579773,
0.02497624233365059,
-0.323138564825058,
0.021495448425412178,
0.17062442004680634,
-0.47140011191368103,
-0.5069966912269592,
0.20453989505767822,
0.6241809725761414,
0.15236634016036987,
-0.119228906929492... | |
I have an application written in C# targeting .NET Compact Framework 3.5, running on Windows CE. From time to time, operations lasting for a second or so are being performed on the UI thread. I currently set the `Cursor.Current` property to indicate that the application is busy, but this does not prevent mouse events f... | [
0.060396548360586166,
0.09487170726060867,
0.5899127125740051,
-0.23133790493011475,
0.20609663426876068,
-0.1523570716381073,
0.16386695206165314,
-0.005097718443721533,
-0.2521587908267975,
-0.677167534828186,
-0.062315504997968674,
0.5515707731246948,
-0.316638708114624,
0.0065972427837... | |
my POS application that the users can sneak in another click in about 50ms, especially when using a touch screen that is not calibrated.
One of the problems this creates is when producing an invoice, you can't have a duplicate click produce another invoice, just because there's a 50ms delay before clearing the current... | [
-0.27881506085395813,
-0.20155462622642517,
0.5556651949882507,
-0.14817304909229279,
0.2673972547054291,
0.030063556507229805,
0.22612550854682922,
0.0011804529931396246,
-0.190133735537529,
-0.7658643126487732,
0.13864219188690186,
0.4132523834705353,
-0.27027371525764465,
-0.10650551319... | |
{
}
}
private object approvalLockObject = new object();
private void btnApproveTransaction_Click(object sender, EventArgs e)
{
ApproveTransactionAndLockForm();
}
private void ApproveTransactionAndLockForm()
{
lock (approvalLockObject)
{
if (... | [
0.2135075181722641,
0.0076433508656919,
0.5539817214012146,
-0.13444453477859497,
0.4858620762825012,
-0.07578498870134354,
0.14068379998207092,
-0.5812655687332153,
-0.0570853091776371,
-0.14883537590503693,
-0.1193409189581871,
0.359776109457016,
-0.26556864380836487,
0.4181866943836212,... | |
{
ApprovalLockCount++;
ApproveTransaction();
}
else
{
CloseAndRetry(); | [
0.21432553231716156,
0.18735933303833008,
0.8310810923576355,
-0.452873170375824,
0.5718017220497131,
-0.15646956861019135,
0.07729969918727875,
-0.4797888398170471,
0.26069703698158264,
-0.19333718717098236,
-0.27077820897102356,
0.4310159981250763,
-0.19969946146011353,
0.158413469791412... | |
}
}
}
private void ApproveTransaction()
{
ClearMouseClickQueue();
this.Enabled = false;
Logger.LogInfo("Before approve transaction");
MouseHelper.SetCursorToWaitCursor();
... validate invoice and print
}
```
In case you need to reenable the screen, ... | [
0.18891528248786926,
0.1497112363576889,
0.622682511806488,
-0.37070775032043457,
0.7568942904472351,
-0.38048988580703735,
0.183294877409935,
-0.4229864776134491,
-0.09104473888874054,
-0.4619015157222748,
-0.27466610074043274,
0.6315310001373291,
-0.4918447434902191,
0.02117190696299076,... | |
this.Enabled = true;
ApprovalLockCount = 0;
DialogResult = DialogResult.None;
``` | [
0.30231204628944397,
0.2288041114807129,
0.930842936038971,
-0.06138588860630989,
0.6018075346946716,
-0.18015991151332855,
0.4372159242630005,
-0.2948954403400421,
-0.11615104228258133,
-0.26996952295303345,
-0.351593554019928,
0.4876619279384613,
-0.39255136251449585,
0.2220778912305832,... | |
How to move data from one listview to another using c#
```
ListViewItem itemClone;
ListView.ListViewItemCollection coll = listView1.Items;
foreach (ListViewItem item in coll)
{
itemClone = item.Clone() as ListViewItem;
listView1.Items.Remove(item);
listView2.Items.Add(itemClone);
}
``` | [
-0.0015903543680906296,
-0.363236665725708,
0.7777449488639832,
-0.13551945984363556,
0.4035143554210663,
0.1899200677871704,
0.2090032696723938,
-0.6254666447639465,
-0.36277103424072266,
-0.7127665877342224,
-0.4648539125919342,
0.38954630494117737,
-0.2916838228702545,
0.185068994760513... | |
My Code:
```
// Read in Xml-file
XmlDocument doc = new XmlDocument();
doc.Load("C:/Web.config");
XmlNode d = doc.SelectSingleNode("/configuration");
XmlNode MYNODE = doc.CreateNode("element", "connectionStrings", "");
//newParent.(childNode);
d.AppendChild(MYNODE);
//Saving the document
doc.Save("C:/Web.config");
... | [
0.07290954887866974,
0.1741979867219925,
0.512742817401886,
0.058473262935876846,
0.4551377594470978,
0.3063831329345703,
0.1443999707698822,
-0.33861464262008667,
-0.05927802249789238,
-1.0948123931884766,
-0.10340142995119095,
0.24843266606330872,
0.05586029216647148,
0.09106844663619995... | |
"");
MYNODE.InnerText = " ";
```
this will have no effect in actual use of connection strings elements.. but the output will be as you want. | [
-0.053532760590314865,
-0.1003044918179512,
0.49044230580329895,
-0.11681322008371353,
0.009535469114780426,
-0.11732083559036255,
0.2622889578342438,
-0.05874314159154892,
-0.27773424983024597,
-0.5324650406837463,
-0.508599042892456,
0.4524308145046234,
-0.38402214646339417,
0.3803564608... | |
How can I define a macro (or a workaround for this) where the parameter is at the beginning of the line?
```
#define SINGLETON_IMPLEMENTATION(className) \
##className* ##className::instance_ = NULL;
```
This give a compiler warning (GCC 3.2.3): " '##' cannot appear at either end of a macro expansion"
`##` is the... | [
-0.0750071331858635,
-0.024690810590982437,
0.25979065895080566,
-0.2840009927749634,
0.268533319234848,
-0.09786209464073181,
0.08535025268793106,
-0.12351236492395401,
-0.2697516083717346,
-0.6247296929359436,
-0.1501832753419876,
0.462108314037323,
-0.433571457862854,
0.1365634351968765... | |
to initialize a singleton pointer, remove both `##`s from your macro. | [
-0.05992697551846504,
0.07262272387742996,
-0.1376039832830429,
-0.15818960964679718,
0.16709327697753906,
-0.09738249331712723,
0.028837155550718307,
0.07368828356266022,
0.07488363981246948,
-0.6321477890014648,
-0.3006036877632141,
0.46584954857826233,
-0.4359701871871948,
0.25399026274... | |
I'm using the Infragistics Windows Ultragrid, version 7.3. I'm trying to use an UltraDataSource along with the LoadOnDemand mode. I have three bands defined: root, child and grandchild.
When I click on the first row, it requests the data for the child band but also requests the grandchildren rows under the first chil... | [
-0.16584424674510956,
-0.15142691135406494,
0.6612535715103149,
0.013017117977142334,
0.43834424018859863,
0.2719234526157379,
0.08198054134845734,
-0.16580983996391296,
-0.20968233048915863,
-0.773949921131134,
0.18384309113025665,
0.374828577041626,
0.06213334947824478,
0.549890577793121... | |
very simple Wrapper around you jdbc driver that creates wrapped PreparedStatements and logs all parameters and there settings before actually executing the statement. | [
0.19637079536914825,
0.23923632502555847,
0.030742434784770012,
0.07496901601552963,
-0.17078864574432373,
-0.17935574054718018,
0.08716385066509247,
-0.3436036705970764,
0.11819827556610107,
-0.4598093330860138,
-0.11746370792388916,
0.5858805179595947,
-0.09446728974580765,
-0.1090927571... | |
In a project I maintain, I see a lot of code like this for simple `get`/`set` methods
```
const int & MyClass::getFoo() { return m_foo; }
void MyClass::setFoo(const int & foo) { m_foo = foo; }
```
What is the point in doing that instead of the following?
```
int MyClass::getFoo() { return m_foo; } // Removed 'con... | [
0.25937050580978394,
0.1426122635602951,
0.2658527195453644,
-0.12285146862268448,
0.15501905977725983,
-0.12942856550216675,
0.5998245477676392,
-0.35742196440696716,
-0.04065961390733719,
-0.4360828101634979,
-0.21084800362586975,
0.5158872008323669,
-0.5123800039291382,
0.00879164226353... | |
micro-optimization or is there a true benefit?
The difference is that if you get that result into a reference yourself you can track the changes of the integer member variable in your own variable name without recalling the function.
```
const &int x = myObject.getFoo();
cout<<x<<endl;
//...
cout<<x<<endl;//x might h... | [
-0.18450112640857697,
-0.10823965817689896,
0.3207319378852844,
0.33535829186439514,
0.2801145911216736,
0.26426762342453003,
-0.11306492239236832,
-0.29290276765823364,
-0.16218313574790955,
-0.6998535394668579,
0.17724855244159698,
0.862302839756012,
-0.6344709992408752,
0.17939944565296... | |
the modifier too, but again probably not something that is worth doing or that was intended.
```
void test1(int x)
{
cout<<x<<endl;//prints 1
}
void test2(const int &x)
{
cout<<x<<endl;//prints 1 or something else possibly, another thread could have changed x
}
int main(int argc, char**argv)
{
int x = 1;
tes... | [
0.23241391777992249,
-0.3117064833641052,
0.3547954559326172,
-0.04695172235369682,
0.19852538406848907,
-0.009859875775873661,
0.4361362159252167,
-0.3012946546077728,
-0.2737638056278229,
-0.530307412147522,
-0.18081159889698029,
0.49312806129455566,
-0.5132282376289368,
0.17450791597366... | |
I want to add a new tab page for every newly opened form.
Example:
```
frmReport reportform = new frmReport();
report.Show();
```
When I open the `frmReport` form, it must be opened in a new `TabPage`, as in Windows Internet Explorer 7-8 tabpages.
i used DevExpress Controls for tabPages. | [
0.20676195621490479,
0.09922874718904495,
0.8042957186698914,
-0.27260223031044006,
-0.2808077037334442,
-0.3342701494693756,
0.40553468465805054,
-0.12499534338712692,
-0.13028188049793243,
-0.7528185248374939,
-0.26598307490348816,
0.7138305306434631,
-0.30274465680122375,
0.241379022598... | |
I'm using .NET WebBrowser control.
How do I know when a web page is fully loaded?
I want to know when the browser is not fetching any more data. (The moment when IE writes 'Done' in its status bar...).
Notes:
* The DocumentComplete/NavigateComplete events might occur multiple times for a web site containing multipl... | [
0.31620344519615173,
-0.11058104038238525,
0.5341419577598572,
0.11632942408323288,
-0.3400413990020752,
-0.5226927995681763,
0.9310334920883179,
-0.0716300904750824,
-0.11644310504198074,
-0.9046738147735596,
0.03172114118933678,
0.5655261278152466,
-0.16442140936851501,
0.226662218570709... | |
in the Document Complete handler.
Here's what finally worked for me:
```
public bool WebPageLoaded
{
get
{
if (this.WebBrowser.ReadyState != System.Windows.Forms.WebBrowserReadyState.Complete)
return false;
if (this.HtmlDomDocument == null) | [
0.18373946845531464,
-0.11311137676239014,
0.492648184299469,
-0.01749846525490284,
-0.151650071144104,
-0.32427749037742615,
0.7404572367668152,
-0.38684025406837463,
-0.004827391821891069,
-0.4215095043182373,
-0.42535465955734253,
0.666080117225647,
-0.38940176367759705,
0.0946800410747... | |
return false;
// iterate over all the Html elements. Find all frame elements and check their ready state
foreach (IHTMLDOMNode node in this.HtmlDomDocument.all)
{
IHTMLFrameBase2 frame = node as IHTMLFrameBase2;
if (frame != null) | [
0.17536868155002594,
-0.13220492005348206,
0.517434298992157,
-0.24742379784584045,
0.1875225454568863,
-0.11731112748384476,
0.6100883483886719,
-0.6055986285209656,
-0.018419304862618446,
-0.563066303730011,
-0.18677303194999695,
0.3268203139305115,
-0.41207268834114075,
0.08271677047014... | |
{
if (!frame.readyState.Equals("complete", StringComparison.OrdinalIgnoreCase))
return false;
}
} | [
-0.07394976913928986,
-0.2139003425836563,
0.16989396512508392,
-0.213506817817688,
0.3385631740093231,
-0.014657284133136272,
0.34906232357025146,
-0.39720261096954346,
0.008842485956847668,
-0.30437859892845154,
-0.24801252782344818,
0.43344974517822266,
-0.5019829869270325,
0.1122163534... | |
Debug.Print(this.Name + " - I think it's loaded");
return true;
}
}
```
On each document complete event I run over all the html element and check all frames available (I know it can be optimized). For each frame I check its ready state.
It's pretty reliable but just like jeffamaphone said I ha... | [
0.6301344633102417,
0.17694391310214996,
0.28412944078445435,
0.021992221474647522,
-0.20171254873275757,
-0.3113822638988495,
0.6927446722984314,
-0.37567028403282166,
-0.15262502431869507,
-0.6055683493614197,
-0.23030231893062592,
0.5717905759811401,
-0.4705154299736023,
0.0850821956992... | |
be updated to recursively check the state of every frame. | [
0.49937185645103455,
-0.045103661715984344,
0.1695304661989212,
0.12836185097694397,
0.22757509350776672,
-0.2557559013366699,
0.28011345863342285,
-0.022877518087625504,
-0.1125619187951088,
-0.9049398899078369,
-0.31375637650489807,
0.40371400117874146,
-0.26277247071266174,
-0.237818673... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.