text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
a7/
1ff8a7b5dc7a7d1f0ed65aaa29c04b1e
``` | [
-0.32337644696235657,
0.41214537620544434,
0.2553884983062744,
-0.2026495337486267,
0.16129940748214722,
-0.1165870875120163,
0.39603105187416077,
-0.09019716829061508,
-0.2959735095500946,
-0.3505008816719055,
-0.3036048412322998,
0.5180319547653198,
-0.11983165889978409,
0.52068966627120... | |
In Bash I'm executing a command and putting the result in a variable like this:
```
export var=`svn ls`
```
But if SVN fails for some reason--say it returns a non-zero error code--export still returns status code 0. How do I detect if the executed command fails?
```
var=`svn ls`
if [[ $? == 0 ]]
then
export v... | [
0.10765652358531952,
0.28690382838249207,
0.3495274782180786,
-0.5251295566558838,
-0.09339621663093567,
-0.07420210540294647,
0.27629682421684265,
-0.5117377042770386,
-0.27466991543769836,
-0.1913648545742035,
-0.17539648711681366,
0.7883137464523315,
-0.1702250838279724,
-0.057019628584... | |
above (`export` of a valid identifier will never fail, unless you've done something horrible and run out of environment space). Take whatever you want -- I use `unset` just to avoid `$var` possibly having a value even though it's not exported. | [
0.3638474643230438,
0.08510266989469528,
-0.031476836651563644,
-0.1017712727189064,
-0.21381600201129913,
-0.2528406083583832,
0.23961332440376282,
-0.11711263656616211,
-0.24587324261665344,
-0.2678695321083069,
-0.04053189978003502,
0.7147774696350098,
-0.39308953285217285,
-0.014636076... | |
While the built-in analytics of MOSS2007 are nice to have - they are inadequate at the same time. Any ideas where I can look for a more comprehensive package? Am I missing something?
Thanks,
Carl
```
var=`svn ls`
if [[ $? == 0 ]]
then
export var
else
unset var
fi
```
`$?` is the exit code of the last... | [
-0.22946007549762726,
0.256700724363327,
0.7878113985061646,
-0.2262030392885208,
0.2664153575897217,
-0.23621313273906708,
0.4910297989845276,
0.12884795665740967,
-0.11347238719463348,
-0.4268287420272827,
-0.44300326704978943,
0.5872893333435059,
-0.3132343888282776,
0.01257110945880413... | |
you've done something horrible and run out of environment space). Take whatever you want -- I use `unset` just to avoid `$var` possibly having a value even though it's not exported. | [
0.6579260230064392,
0.07710620015859604,
-0.19889870285987854,
0.014880070462822914,
0.014278418384492397,
-0.042971521615982056,
0.19437739253044128,
0.20837636291980743,
-0.17863677442073822,
-0.30034875869750977,
-0.08203758299350739,
0.5005123615264893,
-0.5028517246246338,
0.205864861... | |
I am calling a SQL proc that has 3 OUTPUT params. After the call to the proc one of the params does not return a value when the other two do. Profiler shows that all 3 values are being returned.
The params are declared as follows in the proc...
```
@UsrVariableID INT OUTPUT,
@OrganisationName NVARCHAR(256) OUTPUT,
@V... | [
0.049240753054618835,
0.23352211713790894,
0.8795251250267029,
-0.41997891664505005,
-0.059437096118927,
0.24221237003803253,
0.4087097644805908,
-0.6147879958152771,
-0.4915326237678528,
-0.1928887516260147,
-0.3609192669391632,
0.5366732478141785,
-0.5327637195587158,
0.07905746251344681... | |
ideas?
With output parameters that have variable length data types (nvarchar, varchar, etc), I've found that being more explicit leads to better results. In the case you've posted, a type is not specified on the C# side. I would probably change things to look something like the following:
```
SqlParameter theOrganizat... | [
0.45941486954689026,
0.18263600766658783,
0.4664497673511505,
0.3225834369659424,
0.0277729295194149,
0.09990084916353226,
0.09384609758853912,
-0.43315911293029785,
-0.47999897599220276,
-0.6787591576576233,
-0.07776543498039246,
0.07572612911462784,
-0.15757519006729126,
0.32870551943778... | |
If you have an STL vector which has been resized, is it safe to take the address of element 0 and assume the rest of the vector will follow in memory?
e.g.
```
vector<char> vc(100);
// do some stuff with vc
vc.resize(200);
char* p = &vc[0];
// do stuff with *p
```
**Yes, that is a valid assumption (\*).**
From the ... | [
0.03900173306465149,
-0.2985462248325348,
0.37602171301841736,
-0.044615428894758224,
0.12267161905765533,
0.07107963413000107,
0.022611837834119797,
-0.3847184479236603,
-0.15508365631103516,
-0.5594483017921448,
-0.34334322810173035,
0.6164131164550781,
-0.32410910725593567,
-0.122439406... | |
but watch out for the array being reallocated (invalidating any pointers and iterators) after adding elements to it. | [
0.13314971327781677,
0.12209504097700119,
-0.06257607042789459,
0.20669248700141907,
0.18249008059501648,
-0.3004140853881836,
0.47581419348716736,
-0.1713835895061493,
-0.2613215446472168,
-0.37996283173561096,
-0.15482765436172485,
0.46574389934539795,
-0.06800207495689392,
-0.2111249119... | |
I already know: "Don't use css expressions!" My question is not about whether I should be using an expression or if there is an alternative; my question is simply: **Can I get a css expression to only be evaluated in versions of IE prior to version 7 without using conditional comments?**
I occasionally use an undersco... | [
0.659761369228363,
0.12680430710315704,
0.24380378425121307,
-0.2118128538131714,
-0.06902062147855759,
-0.2902300953865051,
0.6488806009292603,
0.03361429274082184,
-0.23230168223381042,
-0.4773622155189514,
-0.22684045135974884,
0.5254043936729431,
-0.25672951340675354,
-0.02703567035496... | |
I am looking for a way to do this without placing a single style rule into a separate file.
A note for those of you who still don't want to let it go: I've chosen to use a css expression, but I didn't do so lightly. I understand the implications and I am using an expression that only evaluates once. Stop worrying abou... | [
0.8161088228225708,
0.23239365220069885,
0.1975545436143875,
-0.10892537981271744,
-0.19847168028354645,
-0.4956987798213959,
0.6386178135871887,
0.23569031059741974,
0.09142959862947464,
-0.768217921257019,
-0.21816648542881012,
0.5012447834014893,
-0.10194826126098633,
-0.043633565306663... | |
* html .myClass {
width: 500px;
}
```
I like it because it doesn't rely on parsing inconsistencies in browsers and it validates according to [W3C](http://jigsaw.w3.org/css-validator/#validate_by_input).
As for being in standards compliant mode, you should always add a valid DOCTYPE to your pages as it results i... | [
0.14436188340187073,
0.04437405616044998,
0.4080992043018341,
0.1862650364637375,
-0.2771188020706177,
-0.23832756280899048,
0.32668718695640564,
-0.024185961112380028,
-0.2500089704990387,
-0.6338715553283691,
0.1203831285238266,
0.3679567873477936,
-0.08818250149488449,
-0.12727934122085... | |
to recognize CSS expressions and mark them as red so you can be reminded that they are evil. Might I ask why you are deciding to use CSS expressions in the first place? A lot of people try to use them to achieve min-width in IE6 but that's not the right solution. If that's the problem you're trying to solve, I've writt... | [
0.27326154708862305,
0.0652145966887474,
0.1564370095729828,
-0.1278744637966156,
-0.25646156072616577,
0.05606603994965553,
0.25309908390045166,
-0.13256987929344177,
-0.3181701600551605,
-0.5798221230506897,
-0.09333806484937668,
0.5515323877334595,
-0.4358706474304199,
-0.08253052830696... | |
display: none;
}
* html .ie6 {
display: expression("block");
}
* html .ie7 {
display: expression("none");
}
</style>
</head>
<body>
<div class="ie6">
This is IE6
</div>
<div class="ie7">
This | [
0.03835718333721161,
-0.17200449109077454,
0.6343094706535339,
-0.4048531949520111,
-0.1992395520210266,
-0.10931865870952606,
0.3112064301967621,
-0.1038270890712738,
-0.20824745297431946,
-1.056246042251587,
-0.3339778780937195,
0.04327784478664398,
-0.28507477045059204,
-0.0982747301459... | |
is Firefox or IE7+
</div>
</body>
</html>
``` | [
0.29758745431900024,
-0.18860319256782532,
0.447748601436615,
-0.16196578741073608,
0.21727365255355835,
-0.5624334812164307,
0.005427098833024502,
0.024746757000684738,
0.12430299073457718,
-0.600097119808197,
-0.5601897239685059,
0.398860365152359,
-0.5902280807495117,
-0.473926961421966... | |
```
a:3:{i:0;i:4;i:1;i:3;i:2;i:2;}
```
Am I right to say that this is an array of size 3 where the key value pairs are `0->4`, `1->3`, and `2->2`?
If so, I find this representation awfully confusing. At first, I thought it was a listing of values (or the array contained `{0, 4, 1, 3, 2, 2}`), but I figured that the ... | [
0.09712792187929153,
0.5519120693206787,
0.0891372412443161,
-0.3776547908782959,
-0.5273433327674866,
0.008500667288899422,
0.32804301381111145,
-0.5122742056846619,
-0.20374242961406708,
-0.23951181769371033,
0.02712353505194187,
0.1606602668762207,
-0.4735214114189148,
0.094555906951427... | |
to serialize in this manner? What advantage does this have over, let's say the way var\_dump and/or var\_export displays its data?
```
$string="a:3:{i:0;i:4;i:1;i:3;i:2;i:2;}";
$array=unserialize($string);
print_r($array);
```
outpts:
```
Array
(
[0] => 4
[1] => 3
[2] => 2
)
```
If think the point is t... | [
0.029189540073275566,
0.06139528751373291,
0.5152939558029175,
0.12952764332294464,
-0.43642640113830566,
-0.24883827567100525,
0.18032675981521606,
-0.3858027458190918,
-0.323709100484848,
-0.2906283140182495,
0.011798621155321598,
0.3028637170791626,
-0.4865855574607849,
0.31617751717567... | |
to use the given format because the underlying variable can be reconstructed by reading the string character by character. | [
0.10995516180992126,
-0.05632986128330231,
-0.0782652348279953,
0.03348840773105621,
0.08124011009931564,
-0.045252736657857895,
0.08726531267166138,
-0.058830782771110535,
0.10738738626241684,
-0.5603964924812317,
-0.21572664380073547,
0.4711032509803772,
-0.02189965732395649,
-0.05433006... | |
Multimap essentially has groups of data sorted by the key. I want a method by which I could access these individual groups and get their aggregate values.
For example, in a `std::multimap< string, int >` I store
```
{"Group1", 1},
{"Group1", 2},
{"Group1", 3},
{"Group2", 10},
{"Group2", 11},
{"Group2", 12}
```... | [
-0.1169399619102478,
-0.06265729665756226,
0.3384447991847992,
-0.03171730786561966,
-0.23456470668315887,
0.17039279639720917,
0.08021022379398346,
-0.4964655041694641,
-0.4704800546169281,
-0.48141762614250183,
0.10508664697408676,
0.13570189476013184,
-0.7111641764640808,
0.194610834121... | |
am hoping there could be better ways already defined in STL ? Can anyone propose a solution as to how I could get the aggregate values for a group in the above example.
```
pair<Iter, Iter> range = my_multimap.equal_range("Group1");
int total = accumulate(range.first, range.second, 0);
```
Is one way.
**Edit:**
If ... | [
0.04296343773603439,
0.09905077517032623,
0.2503783702850342,
-0.24656535685062408,
-0.02765323594212532,
0.07170117646455765,
0.3535047471523285,
-0.647587776184082,
-0.06085367128252983,
-0.5721020698547363,
0.11169236153364182,
0.43949177861213684,
-0.3545680344104767,
-0.10490145534276... | |
return x.first < y.first;
}
};
Iter first = mmap.begin();
Iter last = adjacent_find(first, mmap.end(), Less<MultimapType::value_type>());
``` | [
-0.29760369658470154,
-0.22908712923526764,
0.4516685903072357,
-0.23881228268146515,
0.2412792146205902,
-0.014420927502214909,
-0.05652376264333725,
-0.4358460009098053,
-0.10239003598690033,
-0.6846938729286194,
-0.5017995238304138,
0.3669188618659973,
-0.31101393699645996,
0.2943202853... | |
I have an application built in Flex Builder 3. It has a fair amount of mxml and as3 code which uses some other custom compenents. I have looked at the documentation on building components which shows how to make a simple mxml or action script component that extends something like a combobox, but I'm lost as to how to t... | [
0.7762753367424011,
-0.006657211109995842,
-0.11927064508199692,
0.1354358196258545,
-0.044888686388731,
-0.041945502161979675,
0.04224502295255661,
0.03776288032531738,
-0.2918158769607544,
-0.7304742932319641,
0.22062553465366364,
0.648521363735199,
-0.2812992036342621,
-0.03536672890186... | |
is to swap the Application mxml tag with a VBox tag...thus making it act like a component.
e.g. If this were your application:
```
//Foo.mxml
<mx:Appliction xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Label text = "foo" />
</mx:Appliction>
```
change it to:
```
//Foo.mxml
<mx:VBox>
<mx:Label text = "... | [
0.3731049597263336,
0.07757568359375,
0.6745731830596924,
-0.20545126497745514,
-0.0971347987651825,
0.030236033722758293,
-0.04873839020729065,
-0.526144802570343,
-0.11608190834522247,
-0.1017380952835083,
-0.29193806648254395,
0.6408787369728088,
-0.7754416465759277,
-0.0626748651266098... | |
The scriptaculous wiki has a demo (<http://github.com/madrobby/scriptaculous/wikis/effect-slidedown>) that shows the SlideDown effect in use. However I need to have the same link to slide down if a certain DIV is hidden and SlideUp if that DIV is showing.
How do I achieve this?
Thanks.
Use [Effect.toggle](http://gith... | [
0.0691971555352211,
-0.17063839733600616,
0.42342251539230347,
0.05611461028456688,
-0.042681336402893066,
-0.15067671239376068,
0.000022923715732758865,
-0.05377597734332085,
-0.19619236886501312,
-0.6487383246421814,
0.01389855332672596,
0.779901921749115,
0.0456165112555027,
-0.24502576... | |
I found a while ago (and I want to confirm again) that if you declare a class level variable, you should not call its constructor until the class constructor or load has been called. The reason was performance - but are there other reasons to do or not do this? Are there exceptions to this rule?
**ie: this is what I d... | [
-0.019218480214476585,
-0.2753620445728302,
0.04795881360769272,
-0.2418476939201355,
-0.16415263712406158,
-0.008350946009159088,
0.5220819711685181,
-0.05592135712504387,
-0.12610845267772675,
-0.38399696350097656,
-0.10850878059864044,
0.6965252161026001,
-0.16491857171058655,
0.0221350... | |
private PersonObject _person = new PersonObject("Smitface");
public SomeClass()
{
}
}
```
If you set your variable outside of the constructor then there is no error handling (handeling) available. While in your example it makes no difference, but there are many cases that you may want to have some sort of e... | [
-0.29709112644195557,
-0.3151394724845886,
0.022185195237398148,
-0.13256025314331055,
0.17567764222621918,
-0.10610508918762207,
0.238762766122818,
-0.04276159405708313,
-0.11226595193147659,
-0.487032026052475,
-0.17636728286743164,
0.7567535638809204,
-0.33788132667541504,
0.12747831642... | |
We've got VisualSVN Server set up as our Subversion server on Windows, and we use Ankhsvn + TortoiseSVN as clients on our workstations.
How can you configure the server to require commit messages to be non-empty?
VisualSVN Server 3.9 provides the `VisualSVNServerHooks.exe check-logmessage` pre-commit hook that helps y... | [
0.07380851358175278,
-0.1361747533082962,
0.69424968957901,
0.0772373154759407,
-0.3675187826156616,
0.0009203954832628369,
0.368353009223938,
-0.22920821607112885,
-0.5540122389793396,
-0.2762127220630646,
-0.21181876957416534,
0.5313693284988403,
0.06953839212656021,
-0.07321620732545853... | |
checking
* [`pre-commit`](http://www.visualsvn.com/support/svnbook/ref/reposhooks/pre-commit/) — run at the end of the transaction, but before commit. Often used to validate things such as a non zero length log message.
* [`post-commit`](http://www.visualsvn.com/support/svnbook/ref/reposhooks/post-commit/) — runs after... | [
0.551182210445404,
-0.08641023188829422,
0.5229096412658691,
0.1013750433921814,
-0.06802412122488022,
-0.11018817871809006,
0.40020751953125,
-0.09518424421548843,
-0.036213476210832596,
-0.40366435050964355,
-0.16635474562644958,
0.5066317915916443,
-0.21781907975673676,
-0.1533635705709... | |
of scripts on the web. Googling "svn precommit hook to require comment" I found a couple that looked like they would fit the bill:
* [Perl Script](http://www.stillnetstudios.com/2008/06/16/require-subversion-comments-minimum/)
* [Python Script](http://tarekziade.wordpress.com/2006/11/01/protecting-a-python-svn-code-ba... | [
0.4647241532802582,
-0.008166852407157421,
-0.0790083110332489,
-0.2592010796070099,
-0.18351833522319794,
-0.05369975417852402,
0.37246644496917725,
-0.09731901437044144,
-0.2523791491985321,
-0.17017215490341187,
-0.1462439000606537,
0.7708415389060974,
-0.3353782892227173,
-0.3989550471... | |
I have to connect my rails app in a legacy Postgre database. It uses schemas so in a SQL its is common to use something like
```
SELECT * FROM "Financial".budget
```
I want to write a Budget model but I don't know how to set the table name in this case. I've tried the following:
* set\_table\_name 'budget'
* set\_... | [
0.35793939232826233,
-0.060812290757894516,
0.12360130250453949,
0.14739613234996796,
-0.16649079322814941,
0.013585164211690426,
0.29352858662605286,
-0.08371765911579132,
-0.12524037063121796,
-0.6699016094207764,
0.30192670226097107,
0.5069727897644043,
-0.06700746715068817,
0.041168171... | |
Exception: Failed to compare two elements in the array.
```
private void assignNames(DropDownList ddl, Hashtable names)
{
List<ListItem> nameList = new List<ListItem>();
if (ddl != null)
{
ddl.ClearSelection();
ddl.Items.Add(new ListItem("Select Author"));
foreach (string key in nam... | [
-0.17496293783187866,
-0.09429597109556198,
0.31308823823928833,
-0.21125158667564392,
0.1549522578716278,
-0.005309863016009331,
0.32543715834617615,
-0.473500519990921,
-0.34525999426841736,
-0.44275179505348206,
-0.390609472990036,
0.5026096105575562,
-0.36980071663856506,
0.21326029300... | |
use Sort() to compare on the "names" and not get stuck on the key?
Provide a [`Comparison<T>`](http://msdn.microsoft.com/en-us/library/tfakywbh.aspx) to instruct the [`List`](http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx) on how to sort the items.
```
nameList.Sort(delegate(ListItem thisItem, ListItem otherIte... | [
-0.04428298398852348,
0.03382127359509468,
0.2806517481803894,
-0.06504590064287186,
0.10574320703744888,
-0.12743306159973145,
0.14959773421287537,
-0.5112723112106323,
-0.25474172830581665,
-0.7502903938293457,
-0.44903847575187683,
0.10399409383535385,
-0.2616707980632782,
0.16420085728... | |
I was recently put in charge of the wiki for the development team. The wiki is still in its infancy, so I have a lot of room to work with. It goal is to house internal to the development team. Currently, the main piece of information that the wiki holds is Coding Standards.
* What are some best practices your dev tea... | [
0.850875973701477,
0.3671668469905853,
-0.09290444850921631,
0.11815619468688965,
-0.008625637739896774,
-0.24274426698684692,
0.17742134630680084,
-0.04148399829864502,
-0.04429663345217705,
-0.52615886926651,
0.024515489116311073,
0.5146104097366333,
0.4093252122402191,
0.222730606794357... | |
that shouldn't go on the wiki even though it seems like a good idea?
-- edit --
* Also, is there a good way to organize the information? ( such as by layer ( data, ui), by porject, or other)
* Introduction to the source base for new programmers
* General documentation (not the API documentation per-se, but more tutor... | [
0.678245484828949,
0.33706578612327576,
-0.0023908764123916626,
0.2208407074213028,
0.028290661051869392,
-0.27470746636390686,
0.14685356616973877,
0.11935711652040482,
-0.20127682387828827,
-0.6173727512359619,
-0.08355928212404251,
0.4647342562675476,
0.3447769582271576,
-0.212358400225... | |
are
* Planning / todo lists
* Information that is interesting for others to read
* Everything else that I feel should be shared | [
0.7325723171234131,
0.12117641419172287,
-0.03045128472149372,
0.04448043555021286,
-0.11725206673145294,
-0.44218558073043823,
-0.06059892475605011,
0.11585799604654312,
-0.27351605892181396,
-0.7136414647102356,
-0.04075409471988678,
0.39341500401496887,
0.22734591364860535,
-0.166836276... | |
`pre` tags are super-useful for code blocks in HTML and for debugging output while writing scripts, but how do I make the text word-wrap instead of printing out one long line?
The answer, from [this page](https://longren.io/wrapping-text-inside-pre-tags/) in CSS:
```
pre {
white-space: pre-wrap; /* Since CSS... | [
0.24797813594341278,
-0.06382044404745102,
0.5537916421890259,
-0.3701379895210266,
-0.12568800151348114,
-0.01673397794365883,
0.1445855349302292,
-0.20233872532844543,
-0.2741057276725769,
-0.7626311182975769,
-0.6358708143234253,
0.3030129671096802,
-0.47814613580703735,
0.1628121733665... | |
/* Internet Explorer 5.5+ */
}
``` | [
0.29711154103279114,
0.31250613927841187,
0.2866109609603882,
0.030896281823515892,
0.12508247792720795,
-0.39795663952827454,
0.13477009534835815,
0.33120566606521606,
-0.07185079157352448,
-0.9164913296699524,
-0.2081317901611328,
0.36772412061691284,
-0.3550930321216583,
0.3371247947216... | |
I'm checking for existing of a row in in\_fmd, and the ISBN I look up can be the ISBN parameter, or another ISBN in a cross-number table that may or may not have a row.
```
select count(*)
from in_fmd i
where (description='GN')
and ( i.isbn in
(
select bwi_isbn from bw_isbn where orig_isbn = ?
... | [
0.2566523849964142,
0.5448839068412781,
0.49068400263786316,
-0.10304509848356247,
0.03387381508946419,
0.10860041528940201,
-0.17617438733577728,
-0.428808331489563,
-0.013959496282041073,
-0.5968710780143738,
-0.18221695721149445,
0.520783007144928,
-0.2989073693752289,
0.113373607397079... | |
rows, but rather mere existence of at least one row.
This used to be three separate queries, and I squashed it into one, but I think there's room for more improvement. It's PostgreSQL 8.1, if it matters.
Why bother with the `UNION ALL`
```
select count(*)
from in_fmd i
where (description='GN')
and (
i.isb... | [
0.24699611961841583,
0.3052504062652588,
0.5789786577224731,
-0.0027130888774991035,
-0.028298979625105858,
0.20071442425251007,
0.01591651700437069,
-0.07361280173063278,
-0.35500410199165344,
-0.5817164182662964,
-0.07352721691131592,
0.21919035911560059,
-0.4251558482646942,
0.351660192... | |
)
```
I would probably use a `LEFT JOIN`-style query instead of the `IN`, but that's more personal preference:
```
select count(*)
from in_fmd i
left join bw_isbn
on bw_isbn.bwi_isbn = i.isbn
and bw_isbn.orig_isbn = ?
where (i.description='GN')
and (
bw_isbn.bwi_isbn is not null
or i.isbn... | [
-0.36394232511520386,
0.17682525515556335,
0.4000929296016693,
-0.29706263542175293,
-0.32312458753585815,
-0.0071989623829722404,
0.13450399041175842,
-0.47981083393096924,
-0.07633541524410248,
-0.37867313623428345,
-0.46289119124412537,
0.39233100414276123,
-0.40636229515075684,
0.17652... | |
on bw_isbn.bwi_isbn = i.isbn
and bw_isbn.orig_isbn = ?
and i.isbn <> cast(? as varchar)
and i.description = 'GN'
UNION
select count(*) as ct
from in_fmd i
where i.isbn = cast(? as varchar)
and i.description = 'GN'
) AS x
``` | [
-0.29835718870162964,
0.24611790478229523,
0.630490243434906,
-0.10080208629369736,
-0.019633522257208824,
0.3688618242740631,
0.023525049909949303,
-0.489369660615921,
-0.25621870160102844,
-0.38107702136039734,
-0.77886563539505,
0.47616341710090637,
-0.2691451907157898,
0.36293575167655... | |
What does this mean exactly? I'm doing something like this:
```
File.Copy(@"\\foo\bar\baz.txt", @"c:\test\baz.txt");
```
MSDN doesn't describe this exception except in general terms, and googling around just yields tables of error codes.
I've confirmed the source file exists, and I'm 99% sure that I have the permis... | [
0.21789848804473877,
0.16173890233039856,
0.44334885478019714,
0.10856395959854126,
0.1768292337656021,
-0.5356940031051636,
0.32206112146377563,
0.006104907486587763,
-0.2518627345561981,
-0.8863902688026428,
-0.027809258550405502,
0.19016382098197937,
-0.4204716980457306,
0.3914182484149... | |
of the symlink, and then you'll be able to use File.Copy with it. | [
0.3783356845378876,
0.04506579786539078,
0.4966121315956116,
0.16653093695640564,
0.08535584062337875,
-0.6442611217498779,
-0.3546082377433777,
0.2544345259666443,
-0.109587162733078,
-0.5954892039299011,
-0.16501030325889587,
0.6187231540679932,
-0.23432935774326324,
0.08762680739164352,... | |
`Connection.close()` may throw `SqlException`, but I have always assumed that it is safe to ignore any such exceptions (and I have never seen code that does not ignore them).
Normally I would write:
```
try{
connection.close();
}catch(Exception e) {}
```
Or
```
try{
connection.close();
}catch(Excepti... | [
0.06831644475460052,
0.24956408143043518,
0.1605990082025528,
-0.2531754970550537,
-0.029681729152798653,
-0.6022149920463562,
0.2121456116437912,
-0.24045100808143616,
-0.1016567274928093,
-0.23384225368499756,
-0.2165456861257553,
0.5215409398078918,
-0.47426503896713257,
0.0979139208793... | |
to exceptions thrown when closing a connection (and as I've seen this is fairly common in this case).
Does anyone know when `Connection.close()` may throw anything?
Actually, what you're doing is (almost) best practice :-) here's what I saw in Spring's JdbcUtils.java. So, you might want to add
another Catch block.
`... | [
0.11842243373394012,
0.05000830814242363,
0.3817806541919708,
-0.036536019295454025,
-0.30908095836639404,
-0.4922727942466736,
0.45412778854370117,
-0.3426796495914459,
-0.4686310291290283,
-0.49824514985084534,
-0.37826696038246155,
0.2863476574420929,
-0.24675916135311127,
0.24691303074... | |
resultSet.close();
}
catch (SQLException ex) {
logger.debug("Could not close ResultSet", ex);
}
catch (Throwable ex) {
// We don't trust the driver: It might throw RuntimeException or Error.
logger.debug("Unexpected exception on closing ResultSet", ex);
}
}
}
``` | [
-0.04081250727176666,
-0.08673986792564392,
0.2567630708217621,
-0.11729396879673004,
0.06774786114692688,
-0.22319725155830383,
0.4153057038784027,
-0.11609790474176407,
0.12939323484897614,
-0.24945740401744843,
-0.2879716753959656,
0.38318759202957153,
-0.3594225347042084,
0.18600063025... | |
I got curious by [Jon Limjap's interview mishap](http://dotnet.kapenilattex.com/?p=93) and started to look for efficient ways to do palindrome detection. I checked the [palindrome golf](https://stackoverflow.com/questions/228518/palindrome-golf) answers and it seems to me that in the answers are two algorithms only, re... | [
0.327260822057724,
0.2314653992652893,
0.13777942955493927,
0.024739515036344528,
-0.2920141816139221,
0.18143969774246216,
0.2916715145111084,
-0.3450363278388977,
-0.08746283501386642,
-0.1082475334405899,
0.07675978541374207,
0.4347604811191559,
-0.3191240429878235,
-0.02999053336679935... | |
in huge DNA sequences. I looked around a bit and didn't find any free article about what an ultra efficient way for this might be.
A good way might be parallelizing the first version in a divide-and-conquer approach, assigning a pair of char arrays 1..n and length-1-n..length-1 to each thread or processor.
What woul... | [
0.26251691579818726,
-0.06530720740556717,
-0.06873716413974762,
0.20902478694915771,
-0.0668414831161499,
0.27637508511543274,
-0.05664480850100517,
-0.14079202711582184,
-0.4842560887336731,
-0.5312785506248474,
0.2941910922527313,
-0.04505342245101929,
-0.3214530050754547,
0.29196858406... | |
long, and they are very repetitive. This gives us the opportunity to optimize.
Say you split a 1000-char long string into 5 pairs of 100,100. The code will look like this:
```
isPal(w[0:100],w[-100:]) and isPal(w[101:200], w[-200:-100]) ...
```
etc... The first time you do these matches, you will have to process th... | [
0.05327824875712395,
-0.0800236165523529,
0.22185149788856506,
-0.04612443968653679,
0.0514674037694931,
0.34415942430496216,
0.004424276761710644,
-0.359100878238678,
-0.31639155745506287,
-0.5438824892044067,
0.0874171257019043,
0.43174004554748535,
-0.37056633830070496,
0.03857195004820... | |
key, you will need something like 10^55 megabytes, which is ridiculous.
Maybe if you use smaller strings, the problem can be tractable. Then you'll have a huge hashmap, but at least palindrome for let's say 10x10 pairs will take O(1), so checking if a 1000 string is a palindrome will take 100 lookups instead of 500 co... | [
-0.06271333247423172,
0.09447595477104187,
0.1241254135966301,
0.20757067203521729,
-0.0022586029954254627,
0.32624661922454834,
0.17362026870250702,
-0.1827554702758789,
-0.29860803484916687,
-0.6360971927642822,
-0.12080464512109756,
0.22125627100467682,
-0.10130763053894043,
0.297127455... | |
I'm working on a service that needs to detect user states for all user(s) logged on to a single machine. Specifically, I want to check to see whether or not the screen saver is active and whether or not their session is locked.
This code will run under a system-level service, and has no visible UI, so that may rule ou... | [
0.5754519104957581,
-0.013877815566956997,
0.1356325000524521,
0.13454966247081757,
0.23909202218055725,
-0.3942265212535858,
0.4935210347175598,
0.06630375981330872,
-0.2205767035484314,
-0.7383165955543518,
0.06442134827375412,
0.5203365087509155,
-0.2369009405374527,
0.22417190670967102... | |
involved.
Any ideas on where to begin?
The most straightforward way would be to have a small app running in each user's session. Each instance of this app could communicate with the main instance of the service.
Windows tries pretty hard to keep logon sessions separate -- both between services and the interactive des... | [
0.28707966208457947,
0.08103135228157043,
0.2603248953819275,
0.356558233499527,
-0.06267783790826797,
-0.011423064395785332,
-0.08144640177488327,
0.10143216699361801,
-0.3320205509662628,
-0.5166875123977661,
0.09298426657915115,
0.621315062046051,
-0.0680067241191864,
-0.166358038783073... | |
I have a helper class that is just a bunch of static methods and would like to subclass the helper class. Some behavior is unique depending on the subclass so I would like to call a virtual method from the base class, but since all the methods are static I can't create a plain virtual method (need object reference in o... | [
-0.023423872888088226,
-0.0570589043200016,
0.055148668587207794,
0.12231303006410599,
-0.3614684045314789,
0.031319163739681244,
0.6187389492988586,
0.17368122935295105,
-0.38140660524368286,
-0.6542547941207886,
0.11644004285335541,
0.6414837837219238,
-0.4007176458835602,
0.366256803274... | |
OK yeah I'm crazy. Google search results had me thinking I wasn't for a bit there.
Virtual static methods don't make sense. If I call `HelperClass.HelperMethod();`, why would I expect some random subclass' method to be called? The solution really breaks down when you have 2 subclasses of `HelperClass` - which one would... | [
0.3909570872783661,
0.06176953390240669,
0.03507767990231514,
0.2719501852989197,
-0.01010727696120739,
-0.08975893259048462,
0.3805783689022064,
0.12236867845058441,
-0.5395160913467407,
-0.21966570615768433,
0.003709109267219901,
0.5004451274871826,
-0.4037933349609375,
0.490610182285308... | |
solution makes more sense in your situation. | [
-0.43067866563796997,
-0.145623117685318,
0.0428319126367569,
0.527542233467102,
0.05862904712557793,
0.2370138168334961,
0.30707406997680664,
-0.3543473184108734,
-0.035524845123291016,
-0.8792400360107422,
-0.02561151050031185,
0.16385668516159058,
-0.00800811592489481,
-0.24598985910415... | |
I'm aware that I can grab the CPU identifier and the volume serial number for a physical drive by querying WMI, but WMI usually takes its sweet time. What other speedier options, if any, are available to retrieve this information? Are there Win32 APIs that would accomplish this?
**Edit:** Allow me to clarify. By CPU i... | [
0.3729620575904846,
0.11048393696546555,
0.23598387837409973,
0.357028067111969,
0.07620146125555038,
-0.24661797285079956,
0.009417855180799961,
0.07508566975593567,
-0.4291249215602875,
-0.868426501750946,
0.012175819836556911,
0.7983608841896057,
-0.0524580255150795,
0.3448101878166199,... | |
unique key for a computer instance, check the [Generating Unique Key (Finger Print) for a Computer for Licensing Purposes](http://www.codeproject.com/KB/cs/GenerateUniqueKey.aspx) post by Sowkot Osman at Codeproject; it can give you some hints (also read comments). | [
0.38286292552948,
0.008537590503692627,
-0.320181280374527,
0.27718624472618103,
0.05005048215389252,
-0.1941719949245453,
0.041989609599113464,
-0.07117390632629395,
-0.12743031978607178,
-0.5205952525138855,
0.08747848868370056,
-0.34482917189598083,
-0.2801823318004608,
0.24103638529777... | |
I want to access my sql server database files in a INTEL SS4000-E storage. It´s a NAS Storage. Could it be possible to work with it as a storage for sql server 2000? If not, what is the best solution?
I strongly recommend against it.
Put your data files locally on the server itself, with RAID mirrored drives. The reas... | [
0.3917868137359619,
0.24848832190036774,
0.13716158270835876,
0.21417135000228882,
0.0971633791923523,
-0.24939781427383423,
0.18556909263134003,
0.19435589015483856,
-0.3528672158718109,
-0.7995057702064514,
0.06678968667984009,
0.5717141032218933,
-0.05702103674411774,
0.4736917316913605... | |
to host your datafiles. I don't know what your database size will be, or what your usage pattern will be, so I can't tell you what you MUST have. At a minimum for a database that's going to take any significant load in a production environment, I would recommend two logical drives (one for data, one for your transactio... | [
0.6500402688980103,
0.04799657315015793,
0.2851027548313141,
0.3758673369884491,
0.24138274788856506,
-0.18250726163387299,
-0.26578348875045776,
0.035664819180965424,
-0.3693569302558899,
-0.47801288962364197,
0.09304141998291016,
0.7352272272109985,
-0.23454169929027557,
0.15520782768726... | |
over budget, put your data on a single drive, back up often. But if you choose the single-drive or NAS solution, IMO you are putting your faith in the Power of Prayer (which may not be a bad thing, it just isn't that effective when designing databases).
Note that a NAS is not the same thing as a SAN (on which people t... | [
0.1880059838294983,
-0.2260863482952118,
-0.06560171395540237,
0.6836737394332886,
0.0495624803006649,
-0.23164117336273193,
0.1951175183057785,
-0.049295004457235336,
-0.21888397634029388,
-0.934290885925293,
-0.10243699699640274,
0.713797390460968,
0.08210132271051407,
0.0820856913924217... | |
toward reducing your cost of network storage. | [
0.024186957627534866,
-0.11634903401136398,
-0.005000738427042961,
0.3285900354385376,
0.3224690556526184,
0.06200718879699707,
-0.13954998552799225,
0.3818870186805725,
-0.041181426495313644,
-0.8881968259811401,
0.08230839669704437,
0.5820425748825073,
0.20306195318698883,
0.093557827174... | |
What is the "functional body" of a program?
I thought it was its functions' prototypes, is it?
It's the code that actually gets executed, so that would be the code inside your methods. | [
0.7912105321884155,
0.04988942667841911,
-0.1762344390153885,
0.365029513835907,
0.0020300978794693947,
0.18866024911403656,
0.08354268223047256,
-0.04126666486263275,
-0.1852237433195114,
-0.12414254993200302,
0.02626153640449047,
0.3865206241607666,
0.004355437587946653,
-0.1351731419563... | |
There is a pretty strong need for us to design some workflows around various processes. The problem is none of us actually know any workflow technology yet, and finding good data to compare the available options has been tedious and not entirely fruitful.
So I figured I'd ask you guys.
The main technologies we are lo... | [
0.3204744756221771,
-0.003082854440435767,
-0.016708411276340485,
0.3175816535949707,
-0.17622293531894684,
-0.15391017496585846,
-0.15621426701545715,
0.07966762036085129,
-0.19629165530204773,
-0.653989315032959,
0.07408402860164642,
0.5379863977432251,
-0.024078447371721268,
0.000922836... | |
with eDocs Workflow is that it provides a method for them to edit it themselves. I believe Sharepoint '07 does as well. Is there some other way to allow that with a straight WWF implementation?
Sharepoint and WF more like complementary technologies, designed as two different workflow authoring tools in the same ecosyst... | [
0.12865976989269257,
-0.09704187512397766,
0.2603779435157776,
0.06809837371110916,
-0.2494513988494873,
-0.16178672015666962,
-0.37538260221481323,
-0.24764978885650635,
-0.06933195143938065,
-0.6402285099029541,
-0.19542622566223145,
0.45034897327423096,
-0.21336302161216736,
-0.09772799... | |
actually a component of Visual Studio (by default - as Bernie says you can rehost it), and designed to allow programmers to be able to fully customize workflow, and integrate it with any other code/systems desired. Building and deploying sharepoint sites this way is still possible, through the use of 'Sharepoint Activi... | [
0.6273775696754456,
-0.1460975855588913,
0.05933116003870964,
0.13848751783370972,
-0.09272980690002441,
-0.31570398807525635,
0.07066956162452698,
0.12750093638896942,
-0.5144119262695312,
-0.43947264552116394,
-0.06127912551164627,
0.20878911018371582,
-0.09602367132902145,
-0.0714552998... | |
I am writing a batch file script using Windows command and want to change each occurrence of some blank space with "," What is the simplest way to do that?
If your users are a list of words on one line in a text file, separated by spaces, eg:
```
one two three four
```
Create a batch file SpaceToComma.bat as follows... | [
0.5190211534500122,
0.17570991814136505,
0.31185203790664673,
-0.27725663781166077,
-0.09528232365846634,
0.3406735062599182,
0.1878577470779419,
-0.39448797702789307,
-0.11688034236431122,
-0.44230812788009644,
-0.09270962327718735,
0.26099348068237305,
-0.5043285489082336,
-0.04689008742... | |
off
setlocal
for /F "tokens=* delims= " %%a in (%1) do @call :processaline %%a
endlocal
goto :eof
:processaline
setlocal
set data=%*
echo %data: =,%
endlocal
goto:eof
```
Output
```
C:\>SpaceToComma.bat data.txt
one,two,three,four
five,six,seven
```
(There's probably a clever way of doing this without the subrouti... | [
0.4765402674674988,
-0.35163506865501404,
0.696688711643219,
-0.056622400879859924,
-0.09250412881374359,
0.3927677273750305,
0.026123078539967537,
-0.3118264377117157,
-0.1646622121334076,
-0.3072539269924164,
-0.26159748435020447,
0.41428065299987793,
-0.4532723128795624,
0.1073922142386... | |
I have discovered through trial and error that the MATLAB engine function is not completely thread safe.
Does anyone know the rules?
Discovered through trial and error:
On Windows, the connection to MATLAB is via COM, so the COM Apartment threading rules apply. All calls must occur in the same thread, but multiple c... | [
0.09472933411598206,
0.003759658895432949,
0.34207239747047424,
0.021396689116954803,
0.10984814912080765,
-0.10055756568908691,
0.23328162729740143,
0.010601850226521492,
-0.4649164378643036,
-0.7704665064811707,
-0.03166838362812996,
0.7670231461524963,
-0.35204648971557617,
0.3101246953... | |
run across any documentation on thread safety, so I assumed that it was not thread-safe.
I use a C++ class to synchronize access to an engine instance. For more parallel processing designs, I instantiate multiple instances of the engine class.
(edit) I'm using MATLAB R14 on Solaris. I open the engine using the 'engOp... | [
0.15663760900497437,
0.13987377285957336,
0.5746077299118042,
-0.1537705957889557,
-0.06600331515073776,
-0.19930635392665863,
0.1069408506155014,
0.03325639292597771,
-0.1978895515203476,
-0.7323646545410156,
-0.20525330305099487,
0.6951904296875,
-0.34087157249450684,
0.13013885915279388... | |
I have a Windows Forms (.NET) application that can have multiple documents open simultaneously.
It would be convenient to have each document (form) running its own event loop. With brief experimentation, starting several event loops in their own STA threads seems to work. Is there any reason why this is a bad idea?
I ... | [
0.6441012024879456,
0.07123324275016785,
0.147197887301445,
0.17744718492031097,
-0.19861644506454468,
-0.33886444568634033,
0.15601710975170135,
-0.09771006554365158,
-0.5468676686286926,
-0.749473512172699,
0.1343095898628235,
0.20739123225212097,
-0.27760452032089233,
0.2307906597852707... | |
will have problems (in my case, I found that the menu / toolbar keyboard accelerators did not work properly).
One of the big reasons for doing this is if you have modal dialogs that show up on the different modeless dialogs. If you put everything on the same message loop, then if one of the modeless dialogs has a moda... | [
0.14828769862651825,
-0.2729984521865845,
0.2480860948562622,
0.3488483130931854,
-0.014240182936191559,
-0.27855995297431946,
0.4901250898838043,
-0.030119355767965317,
-0.2763376832008362,
-0.9227492809295654,
-0.18368038535118103,
0.24074435234069824,
-0.6079307794570923,
0.366956800222... | |
thing to consider is how you will be exiting your process. You will most likely need to keep track of the message loops so you can stop them when you want to close everything out. If you don't care and just want the process to end when all the windows are closed, you can do that too. | [
0.5211243033409119,
0.011977698653936386,
0.13260991871356964,
0.24814382195472717,
0.1587865948677063,
-0.2646365761756897,
0.4643452763557434,
0.37603387236595154,
-0.5470902919769287,
-0.471912682056427,
0.18677903711795807,
-0.012400750070810318,
-0.10982158780097961,
0.387444019317626... | |
The issue that prompted me to ask this is a web form that was not persisting data the way I expected it to. That's vague, but the point is, what do you like to do to model state, flow of data, and so forth?
I'll second the whiteboard answer and add that explaining what is *supposed* to be happening, following by verbal... | [
0.5155795216560364,
-0.12814976274967194,
-0.05439213290810585,
0.2933218479156494,
0.05009842291474342,
-0.31780481338500977,
0.131696879863739,
0.18146324157714844,
-0.06392218172550201,
-0.4208284318447113,
0.34796342253685,
0.2527441084384918,
0.1494748890399933,
0.06669492274522781,
... | |
I'm writing a script to remove some build artifacts older than 1 week.
The files have names in the form *artifact-1.1-200810391018.exe*.
How do I go about removing only the files that are greater than 1 week old, excluding the time in hours and minutes at the end of the date-time-stamp?
Currently it is removing all... | [
0.2568757236003876,
0.34748342633247375,
0.7424821257591248,
-0.11418915539979935,
0.1751462072134018,
0.011683346703648567,
0.520758867263794,
-0.27670159935951233,
-0.39957424998283386,
-0.5166423320770264,
-0.0798245519399643,
0.4697401225566864,
0.12739332020282745,
0.6106033325195312,... | |
keep=true
for day in $(seq 0 $((${NUM_TO_KEEP} - 1))); do
date=`date --date="$day days ago" +%Y%m%d`
echo $(basename $file ".exe") " = " $ARTIFACT_PREFIX$date | [
0.38777393102645874,
0.07397588342428207,
0.8823766112327576,
-0.1859031766653061,
0.4189760982990265,
-0.15259717404842377,
0.3402860760688782,
-0.17118504643440247,
-0.04270513728260994,
0.040464576333761215,
-0.24501818418502808,
0.38436681032180786,
-0.059098515659570694,
0.50628054141... | |
if [ "$(basename $file ".exe")" != "$ARTIFACT_PREFIX$date" ]; then
keep=false
fi
done | [
0.8573234677314758,
-0.3179696202278137,
0.5331705808639526,
-0.32240086793899536,
0.9023054242134094,
-0.36025017499923706,
0.34254372119903564,
-0.2289680540561676,
-0.039707034826278687,
0.05946345254778862,
-0.24357737600803375,
0.9223225116729736,
0.020917346701025963,
0.2291584908962... | |
if [ !$keep ]; then
echo "Removing file"
rm -f $file
fi
done done
```
You mean, something along | [
0.056424252688884735,
-0.0650746151804924,
0.4861101806163788,
-0.4155653715133667,
0.4133737087249756,
-0.16771794855594635,
0.12750232219696045,
-0.2531587481498718,
-0.346714049577713,
0.05687709525227547,
-0.08297897130250931,
0.5106166005134583,
-0.22489914298057556,
0.333189129829406... | |
the line of:
```
find /path/to/files -name "artifact*" -type f -mtime +7 -exec rm {} \;
```
? | [
-0.06693162024021149,
0.12391497939825058,
0.5129641890525818,
-0.029402855783700943,
0.40197986364364624,
-0.011609497480094433,
0.05206248164176941,
-0.0942101925611496,
0.10624859482049942,
-0.44929662346839905,
-0.3831188976764679,
0.5445603728294373,
-0.24187646806240082,
0.0617402642... | |
I am writing a custom session handler in PHP and trying to make the methods defined in session\_set\_save\_handler private.
```
session_set_save_handler(
array('Session','open'),
array('Session','close'),
array('Session','read'),
array('Session','write'),
array('Session','destroy'),
array('Sess... | [
0.22607839107513428,
0.2916547358036041,
0.18436038494110107,
-0.24486424028873444,
-0.363086998462677,
-0.11710165441036224,
0.6328579187393188,
-0.08572980016469955,
0.006437507923692465,
-0.48393625020980835,
-0.10000945627689362,
0.7597300410270691,
-0.743254542350769,
0.09318611770868... | |
Barring that I can certainly just make it public, but I'd rather not. There was a post from last year on php.net eluding to a similar thing, but just want to know if anyone had any ideas. Does it really matter? I am using PHP 5.2.0 on my development box, but could certainly upgrade.
They have to be public. Your class i... | [
0.7531531453132629,
-0.037134282290935516,
0.15293776988983154,
0.16233302652835846,
-0.3353734314441681,
-0.22336657345294952,
0.41432154178619385,
0.19565144181251526,
-0.36334484815597534,
-0.2924022674560547,
0.1982390135526657,
0.4182758331298828,
0.0632074624300003,
0.065409518778324... | |
I have defined a fieldset in HTML, and applied the following (simple) CSS rules to it:
```
fieldset
{
margin: 2em 0;
position:relative;
padding: 1em;
border:1px solid #ccc;
}
```
Everything is great, no big deal, except in all versions (well, up to 7 as far as I know) of IE the top border -- but not... | [
0.1209842637181282,
-0.05430623143911362,
0.8306424021720886,
-0.25792214274406433,
-0.003884686389937997,
-0.2974092364311218,
0.3233814835548401,
-0.04387975111603737,
-0.2822340428829193,
-0.7295425534248352,
-0.2769790589809418,
0.2793141007423401,
0.09116266667842865,
-0.1990430802106... | |
to be outside its parent element width-wise to the right, when viewed in Firebug for example.
What is causing this problem in IE? Is this a known issue, and, if so, what is the fix / hack / workaround?
I've struggled with this one for some time; tonight I finally found the answer.
<http://www.sitepoint.com/forums/sho... | [
0.2156372368335724,
-0.26996201276779175,
0.5131775736808777,
-0.2582867741584778,
-0.08031304180622101,
-0.22135630249977112,
0.3867769241333008,
-0.36104366183280945,
-0.1658237725496292,
-0.4485861659049988,
0.17727155983448029,
0.32809093594551086,
-0.2068689614534378,
0.01266948133707... | |
some reason (even though the content inside
> this container was right-aligned and viewable within the border of the
> fieldset).
>
>
> I was able to fix it just by adding overflow:hidden to the fieldset.
I can confirm that this does indeed fix the issue for me as well. | [
0.1501026153564453,
0.030164729803800583,
0.11752495914697647,
0.07137064635753632,
-0.1077229306101799,
-0.27626490592956543,
0.23756033182144165,
0.3513447344303131,
-0.251947820186615,
-0.5492942929267883,
0.2165648341178894,
0.5181139707565308,
-0.2347685545682907,
0.06543561071157455,... | |
Is it possible to have multiple listeners to messages carried by MSMQ?
WCF appears to frame everything in terms of services, making communication a point-to-point affair. I want to use a message queue to buffer incoming traffic for another process that records the logs in a database.
There can be be any number of ot... | [
0.4844357371330261,
0.20077821612358093,
0.47166961431503296,
0.08397959172725677,
-0.2623436152935028,
-0.10421863943338394,
0.4208928942680359,
-0.03632821515202522,
-0.3379988968372345,
-0.5823249816894531,
0.22997744381427765,
0.6016743779182434,
-0.3926195800304413,
0.0663958936929702... | |
the problem: I have a Windows service that accepts connection requests from little black boxes in the field. It sets up sockets and the black boxes send messages describing events annotated with GPS locations in time and space.
I parse message packets from the socket stream and send them via MSMQ to another process th... | [
0.19956479966640472,
0.27947768568992615,
0.054953236132860184,
0.24093227088451385,
0.2366141974925995,
0.12762221693992615,
0.10513529926538467,
0.061383701860904694,
-0.1432432234287262,
-0.6574088335037231,
0.008208195678889751,
0.512968897819519,
-0.38869708776474,
0.20600193738937378... | |
the messages, and several receiving them. One of these receivers is responsible for parsing the packet contents and transcribing the message into a database; this is an obvious candidate for the responsibility of finally removing the message from the queue, but there is the question of how to ensure this is the last ha... | [
0.16543130576610565,
-0.3381601572036743,
0.30292418599128723,
0.09272243827581406,
-0.11266622692346573,
-0.07087000459432602,
0.4140647053718567,
-0.011186301708221436,
-0.3300116956233978,
-0.4157405495643616,
0.017464324831962585,
0.21519699692726135,
-0.25163590908050537,
0.2279271632... | |
all handlers.
What might work is to have your process that transcribes the message be the Observee, and publish the message (perhaps using the .NET Event architecture) to all interested Observers before transcribing the message and writing to the database. This would provide a guarantee that all interested Observers ... | [
0.7662912607192993,
-0.20273077487945557,
-0.11072954535484314,
0.06646401435136795,
-0.2411923110485077,
-0.146553635597229,
0.3728010654449463,
-0.35491684079170227,
-0.15385490655899048,
-0.3764752745628357,
-0.06678174436092377,
0.39465588331222534,
-0.5668177604675293,
-0.024154344573... | |
I have a listbox, and I have the following ItemTemplate for it:
```
<DataTemplate x:Key="ScenarioItemTemplate">
<Border Margin="5,0,5,0"
Background="#FF3C3B3B"
BorderBrush="#FF797878"
BorderThickness="2"
CornerRadius="5">
<DockPanel>
<DockPanel Do... | [
-0.24883073568344116,
-0.1571241319179535,
0.7367733716964722,
-0.07209023833274841,
0.18817207217216492,
0.2538876235485077,
-0.06398407369852066,
-0.31296899914741516,
-0.3829990029335022,
-0.788425624370575,
0.2710546553134918,
0.4213026463985443,
0.2211531549692154,
-0.1395100951194763... | |
Margin="0,2,0,0">
<Button HorizontalAlignment="Left"
DockPanel.Dock="Left"
FontWeight="Heavy"
Foreground="White" /> | [
-0.3190611004829407,
-0.10953614860773087,
0.6985775232315063,
-0.01360279694199562,
0.16542664170265198,
0.6707381010055542,
-0.4062708616256714,
-0.3365606367588043,
-0.4543318748474121,
-0.5676645636558533,
-0.05834934115409851,
0.2712380886077881,
0.20057803392410278,
-0.20074199140071... | |
<Label Content="{Binding Path=Name}"
DockPanel.Dock="Left"
FontWeight="Heavy"
Foreground="white" /> | [
0.2235276997089386,
-0.0977623388171196,
0.5432966947555542,
-0.32017433643341064,
-0.0486917719244957,
0.4233205020427704,
-0.11134492605924606,
-0.4285956621170044,
-0.40419235825538635,
-0.5436643958091736,
-0.0653224065899849,
0.31712254881858826,
-0.22892525792121887,
0.03106154315173... | |
<Label HorizontalAlignment="Right"
Background="#FF3C3B3B"
Content="X"
DockPanel.Dock="Left"
FontWeight="Heavy" | [
0.02815214917063713,
0.08341147750616074,
0.6592229008674622,
-0.11499476432800293,
-0.004490781109780073,
0.3875250518321991,
-0.11700911074876785,
-0.2980198264122009,
-0.5520159602165222,
-0.4437271058559418,
-0.252647340297699,
0.300075501203537,
0.04584819823503494,
-0.015419051051139... | |
Foreground="White" />
</DockPanel>
<ContentControl Name="designerContent"
Visibility="Collapsed" | [
-0.019907040521502495,
-0.07967240363359451,
0.10313572734594345,
-0.08060511946678162,
0.21351853013038635,
0.3927386999130249,
0.07121366262435913,
-0.13550500571727753,
-0.03669360280036926,
-0.7280138731002808,
-0.37529072165489197,
0.032421860843896866,
-0.3423158526420593,
0.18308807... | |
MinHeight="100"
Margin="2,0,2,2"
Content="{Binding Path=DesignerInstance}"
Background="#FF999898">
</ContentControl> | [
-0.1811351776123047,
-0.22511370480060577,
0.47890323400497437,
0.182991161942482,
0.0544465072453022,
-0.1760895997285843,
-0.02622690424323082,
-0.11954458057880402,
0.018526511266827583,
-0.4933287501335144,
-0.1472843438386917,
0.10595043748617172,
-0.07180893421173096,
-0.019935589283... | |
</DockPanel>
</Border>
</DataTemplate>
```
As you can see the ContentControl has Visibility set to collapsed.
I need to define a trigger that causes the Visibility to be set to "Visible"
when the ListItem is selected, but I can't figure it out.
Any ideas?
UPDATE: Of course I could simply duplicate the DataTe... | [
0.32292845845222473,
-0.1987803876399994,
0.4763011932373047,
-0.3066140115261078,
0.017649510875344276,
-0.2683034837245941,
0.11531040817499161,
-0.09747562557458878,
-0.43184739351272583,
-1.1205425262451172,
-0.015295188874006271,
0.4449673891067505,
-0.499759703874588,
0.1345320045948... | |
MinHeight="100"
Margin="2,0,2,2"
Content="{Binding Path=DesignerInstance}"
Background="#FF999898">
<ContentControl.Style>
<Style TargetType="{x:Type ContentControl}">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<DataTrigger
... | [
-0.206308975815773,
-0.2961150109767914,
0.506862223148346,
0.1419164389371872,
-0.0941506028175354,
-0.30744022130966187,
0.08443249017000198,
-0.4663434326648712,
-0.03296290710568428,
-0.43002936244010925,
-0.26152268052101135,
0.11759768426418304,
-0.20526906847953796,
0.01347048208117... | |
RelativeSource={RelativeSource
Mode=FindAncestor,
AncestorType={x:Type ListBoxItem}}, | [
-0.4974311888217926,
-0.4035690128803253,
0.2415768802165985,
0.12486215680837631,
0.4237395226955414,
0.27801212668418884,
0.007150891236960888,
0.06985316425561905,
0.028324753046035767,
-0.7703596949577332,
-0.033258844166994095,
0.07849600166082382,
-0.2439229041337967,
0.4796275794506... | |
Path=IsSelected}"
Value="True">
<Setter Property="Visibility" Value="Visible"/>
</DataTrigger>
</Style.Triggers> | [
0.019835224375128746,
-0.49866271018981934,
0.20175787806510925,
0.29729291796684265,
0.15864379703998566,
-0.062253572046756744,
0.3151281476020813,
-0.3012727200984955,
-0.12512876093387604,
-0.6005362868309021,
-0.16315197944641113,
0.34642523527145386,
-0.21212510764598846,
-0.30280911... | |
</Style>
</ContentControl.Style>
</ContentControl>
```
Alternatively, I think you can add the trigger to the template itself and reference the control by name. I don't know this technique well enough to type it from memory and assume it'll work, but it's something like this:
```
<DataTemplate x:Key="ScenarioItem... | [
0.10964734852313995,
-0.37472543120384216,
0.31784239411354065,
0.16601866483688354,
0.36653047800064087,
-0.0005128521588630974,
-0.15324628353118896,
-0.4364067316055298,
0.017746495082974434,
-0.659744918346405,
0.12997734546661377,
0.4569476842880249,
-0.3589176833629608,
-0.0488068908... | |
Mode=FindAncestor,
AncestorType={x:Type ListBoxItem}},
Path=IsSelected}"
Value="True">
<Setter | [
-0.17616184055805206,
-0.6864767670631409,
0.5909162759780884,
0.1568627506494522,
0.21178250014781952,
-0.03287312015891075,
0.23194000124931335,
-0.11999521404504776,
0.1579757034778595,
-0.5679193139076233,
-0.2052641063928604,
0.420723021030426,
-0.38550692796707153,
0.0667992830276489... | |
TargetName="designerContent"
Property="Visibility"
Value="Visible"/>
</DataTrigger>
</DataTemplate.Triggers>
...
</DataTemplate>
``` | [
0.18436184525489807,
-0.3206305503845215,
0.3045470416545868,
-0.12544476985931396,
-0.14714518189430237,
-0.0326826311647892,
0.03713719919323921,
-0.18834100663661957,
0.16847021877765656,
-0.7967640161514282,
-0.19717074930667877,
0.4212248921394348,
-0.2662968933582306,
0.2291306555271... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.