text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
What's the best technique for exiting from a constructor on an error condition in C++? In particular, this is an error opening a file.
Thanks for the responses. I'm throwing an exception. Here's the code (don't know if it's the *best* way to do it, but it's simple)
```
// Test to see if file is now open; die otherwis... | [
-0.02406226471066475,
0.31674924492836,
0.04875720664858818,
-0.2589484751224518,
-0.26949718594551086,
-0.18959079682826996,
0.4768412709236145,
-0.21256689727306366,
-0.41481971740722656,
-0.4760158658027649,
-0.21550077199935913,
0.40030449628829956,
-0.15965744853019714,
0.166527479887... | |
on the method declarations.
The best suggestion is probably what parashift says. But read my caution note below as well please.
[See parashift FAQ 17.2](http://www.parashift.com/c++-faq-lite/exceptions.html#faq-17.2)
> [17.2] How can I handle a constructor
> that fails?
>
>
> Throw an exception.
>
>
> Construct... | [
0.18011222779750824,
0.3786546587944031,
0.1467888057231903,
-0.09033150225877762,
-0.2823159992694855,
-0.18628935515880585,
0.6370106339454651,
-0.5848401784896851,
-0.14412711560726166,
-0.49733179807662964,
-0.2044086903333664,
0.36590391397476196,
-0.42114773392677307,
0.0843980759382... | |
an internal status bit so the
> object acts sort of like it's dead
> even though it is technically still
> alive.
>
>
> The idea of a "zombie" object has a
> lot of down-side. You need to add a
> query ("inspector") member function to
> check this "zombie" bit so users of
> your class can find out if their
> ... | [
-0.09259451925754547,
-0.2506445050239563,
0.15051408112049103,
0.355040967464447,
0.055704306811094284,
-0.043677981942892075,
0.40579962730407715,
-0.012440497055649757,
-0.2261258065700531,
-0.857937216758728,
-0.2838163375854492,
0.31323760747909546,
-0.15074992179870605,
0.12783420085... | |
an array of objects) you need to check
> that status flag via an if statement.
> You'll also want to add an if to your
> other member functions: if the object
> is a zombie, do a no-op or perhaps
> something more obnoxious.
>
>
> In practice the "zombie" thing gets
> pretty ugly. Certainly you should
> prefer ... | [
0.14057815074920654,
0.27498236298561096,
-0.017034431919455528,
0.15667510032653809,
-0.34151211380958557,
-0.15792222321033478,
0.6648349165916443,
-0.11536164581775665,
-0.5450836420059204,
-0.7874197959899902,
-0.36703118681907654,
0.3589589595794678,
-0.38604500889778137,
-0.032725811... | |
careful though because if an exception is thrown in a constructor, the class's destructor is not called. So you need to be careful about destructing objects that you already constructed before the exception is thrown. The same warnings apply to exception handling in general, but it is maybe a little less obvious when d... | [
0.36199748516082764,
-0.13547205924987793,
-0.19959969818592072,
0.013455689884722233,
0.09461319446563721,
-0.17429755628108978,
0.5714545249938965,
0.0020712309051305056,
-0.17395035922527313,
-0.6549249291419983,
-0.3460143804550171,
0.743486762046814,
-0.22340521216392517,
0.2006089836... | |
B
{
public:
D()
{
p = new char[1024];
throw std::exception("test");
}
~D()
{
delete[] p;
//never called, so p causes a memory leak
}
char *p;
};
int main(int argc, char **argv)
{
B *p;
try
{
p = new D(); | [
-0.00025425845524296165,
-0.14798156917095184,
-0.02385581098496914,
-0.5042455196380615,
0.23372191190719604,
0.2078828364610672,
0.49231046438217163,
-0.2997363209724426,
0.011060401797294617,
-0.16421069204807281,
-0.6773711442947388,
0.3312649428844452,
-0.3699851930141449,
0.216826692... | |
}
catch(...)
{
}
return 0;
}
```
**Protected/Private constructors with CreateInstance method:**
Another way around this is to make your constructor private or protected and make a CreateInstance method that can return errors. | [
0.25530725717544556,
-0.06619036942720413,
-0.2446925938129425,
0.14176495373249054,
-0.02261505089700222,
-0.20061998069286346,
0.21275340020656586,
-0.11128462105989456,
-0.12615248560905457,
-0.45391157269477844,
-0.07981634885072708,
0.6695505976676941,
-0.4121336042881012,
0.130566522... | |
I want to accept a string from a form and then break it into an array of characters using PHP, for example:
```
$a = 'professor';
$b[0] == 'p';
$b[1] == 'r';
$b[2] == 'o';
.
.
.
.
.
$b[8] = 'r';
```
You don't need to do that. In PHP you can access your characters directly from the string as if it where an array:
```... | [
0.2008778601884842,
0.41558533906936646,
0.37106582522392273,
-0.10736021399497986,
-0.17216020822525024,
0.2604158818721771,
0.2797755300998688,
-0.26419416069984436,
0.050527237355709076,
-0.2974904179573059,
-0.16748666763305664,
0.32225167751312256,
-0.3414512276649475,
0.1916580200195... | |
I have written the following method to return a list of Unserializable classes (LINQ classes) from a list of Serializable classes (POCOs):
```
List<UnSerializableEntity> ToListOfUnserializables(List<SerializableEntity> entityList)
{
var tempList = new List<UnSerializableEntity>();
entityList.ForEach(e =>
{... | [
-0.005509286653250456,
-0.07502913475036621,
0.563607394695282,
-0.11081933230161667,
0.26922351121902466,
-0.10540248453617096,
0.21362058818340302,
-0.4068951904773712,
-0.07940459251403809,
-0.667662501335144,
-0.3054071068763733,
0.5900243520736694,
-0.3495900332927704,
0.3516437113285... | |
!= null)`, and suggested to change it to this:
```
if (!Equals(e, default(SerializableEntity)))
```
My question is to **what has this change actually improved or prevented from happening?** and I know the default keyword in this context has to do something with generics, but I'm not sure what it represents exactly.... | [
0.031308580189943314,
-0.3111790120601654,
0.2360096424818039,
-0.16292573511600494,
-0.0854671522974968,
-0.17642360925674438,
0.4573924243450165,
0.19559207558631897,
-0.20933720469474792,
-0.5566607117652893,
-0.4290789067745209,
0.5542494058609009,
-0.5083024501800537,
0.36180797219276... | |
For value types, it is zero (or whatever zero represents for that value type).
If you only want reference types as entities, you should set constraints on your generic parameters. For example:
```
List<UnSerializableEntity> ToListOfUnserializables(List<SerializableEntity> entityList)
where SerializableEntity : cl... | [
-0.09640392661094666,
-0.23257429897785187,
0.2736667990684509,
0.17522300779819489,
0.0669236034154892,
-0.21808570623397827,
-0.1498752236366272,
-0.04383637011051178,
-0.3720448315143585,
-0.430228054523468,
-0.1483793556690216,
0.48574087023735046,
-0.36664584279060364,
0.4058451354503... | |
I have created a dynamic typing system in C in order to create a dictionary that can contain values of different bit widths. The structure of the dynamic object is:
```
typedef struct
{
void* Pointer;
unsigned char Size;
} Dynamic;
```
I need to compare two of these Dynamics that hold A2D readings and the... | [
-0.013271299190819263,
-0.03479400649666786,
0.23986373841762543,
-0.3106973469257355,
-0.1635567843914032,
0.3934003710746765,
0.04667462408542633,
-0.2605826258659363,
-0.07178076356649399,
-0.5380451679229736,
0.3048541843891144,
0.3732372522354126,
-0.5084589123725891,
0.01181383710354... | |
right. I also have an idea to make an array of function pointers based on the number of bytes (or perhaps the type) the Dynamics take up and just make a comparison function for each type supported. Can anyone suggest a different approach? It feels like I am missing something.
UPDATE:
Thanks for telling me about memcm... | [
0.2881280779838562,
-0.32206469774246216,
0.5572926998138428,
0.2895929217338562,
-0.0893176719546318,
-0.190977543592453,
0.08222013711929321,
-0.03578229993581772,
-0.41950488090515137,
-0.5034307837486267,
0.3637405335903168,
0.6603503227233887,
-0.21334394812583923,
0.06452587246894836... | |
to me because the architecture I am compiling against is little endian.
If I were going to do a bignum implementation myself then ephemient feels like the right way to go, but I have decided I am just going to memcpy the values into the largest possible type (i.e. unsigned long long) that I will have to deal with and... | [
0.44780316948890686,
0.4034632444381714,
-0.1386028528213501,
-0.11539886891841888,
0.1797940582036972,
-0.1920405477285385,
0.28410083055496216,
-0.18684591352939606,
-0.03652020916342735,
-0.5924025774002075,
0.1458166539669037,
0.6289253234863281,
-0.3590448796749115,
0.0574196241796016... | |
<string.h>
int compare(Dynamic *a, Dynamic *b) {
if (a->Size != b->Size) return a->Size - b->Size;
return memcmp(a->Pointer, b->Pointer, a->Size);
}
```
Creating a bunch of specialized functions if they perform very similar operations seems like overkill.
### Addendum
If you want to calculate differences...... | [
0.0856364294886589,
-0.2162371426820755,
0.5021601915359497,
-0.06329437345266342,
-0.20439402759075165,
0.331210732460022,
0.21017545461654663,
-0.6992842555046082,
-0.027902856469154358,
-0.33897969126701355,
-0.24905946850776672,
0.6368931531906128,
-0.3778342008590698,
0.07379164546728... | |
// symmetric difference
*dp = *ap ^ *bp;
// arithmetic difference, assuming little-endian
*dp = borrow += *bp - *ap;
borrow >>= 8;
}
}
``` | [
0.04352593049407005,
0.2338835895061493,
0.01750294305384159,
-0.33825764060020447,
-0.006289687938988209,
0.15885178744792938,
-0.13561855256557465,
-0.4677857458591461,
-0.1300581991672516,
-0.26818323135375977,
-0.12911273539066315,
0.5803816914558411,
-0.14891433715820312,
0.0198668036... | |
I am using this simple code to try and update a row
```
var MyDB = new SKN2DataContext();
var s_case = MyDB.SupportCases.FirstOrDefault(sc => sc.Id == 3);
s_case.OpenDate = DateTime.Now;
MyDB.SubmitChanges();
```
On the last line i am presented with the following exception
> Value of member 'Id' of... | [
-0.12028665840625763,
0.07150796800851822,
0.599316418170929,
-0.1387336403131485,
0.0030426993034780025,
-0.01722920499742031,
0.461040735244751,
-0.20317570865154266,
-0.2575165927410126,
-0.687536358833313,
-0.2470674067735672,
0.19232705235481262,
-0.3449518382549286,
0.363177299499511... | |
GetChangeList in QuickWatch, it says that the DataContext is trying to do and update (which i expect) as well as an insert of the same row (WHY???). I can't figure out why the DataContext is trying to do an insert.
**EDIT** Just for the record OpenDate is not included in the primary key.
You should be able to get this... | [
0.33086931705474854,
-0.4146174490451813,
0.6968442797660828,
0.1999579817056656,
-0.0185720045119524,
-0.35855841636657715,
0.26644790172576904,
0.2500801682472229,
-0.27917301654815674,
-0.9005854725837708,
-0.06092120707035065,
0.6043694019317627,
-0.08984703570604324,
-0.05780586972832... | |
How do I map my Windows key (which is defined as the Meta\_L key in Ubuntu) so that it also works as the `Ctrl`+`L` key in Vim? This is a more comfortable mapping for me in some circumstances.
Looks like `Ctrl` and `Alt` are hard-coded into in the Vim source. You can map your Windows key to `Ctrl` globally if you don't... | [
0.15168258547782898,
-0.10228253901004791,
0.5034182667732239,
0.11363540589809418,
0.05514512211084366,
-0.2285708338022232,
0.1449805200099945,
-0.3427075743675232,
-0.21108752489089966,
-0.807252824306488,
-0.08423931896686554,
0.5937429070472717,
-0.3065436780452728,
0.1707773953676223... | |
I am writing a library in C++ and have some functions that work with modules. An example would look like this:
```
void connect(Module *a, Module *b);
```
The problem is, that it would be sometimes handy if the function accepted also references (some of the Modules may be allocated on the stack and some on the heap ... | [
0.21732819080352783,
0.3250825107097626,
0.42437416315078735,
-0.04736258462071419,
-0.14860208332538605,
-0.15824180841445923,
0.21881325542926788,
-0.11382455378770828,
0.03170539438724518,
-0.5672938227653503,
0.09393595159053802,
0.7055376768112183,
-0.7618111968040466,
0.1719267964363... | |
more functions it makes a lot of code to write, read, compile, ...
Another thing that was thinking about is adding `Module::operator Module *()` that would hust return `this`.
What are your thoughts on this? Isn't there any potential for epic failure that I missed?
Thanks.
Why not just call the function with
```
co... | [
0.2623331844806671,
-0.0295368954539299,
0.2551780939102173,
0.06752853840589523,
-0.06742950528860092,
0.13866744935512543,
0.2438487708568573,
0.023571254685521126,
-0.38264477252960205,
-0.6928410530090332,
-0.007977915927767754,
0.8759892582893372,
-0.4188957214355469,
-0.0325487032532... | |
I have this code in Perl:
```
sub f {
return [1,2,3]
}
print f;
```
The function `f` returns reference to array, how can I convert returned value to array without additional variable, like here?
```
sub f {
return [1,2,3]
}
$a = f;
print @$a;
```
Are you just trying to do this?
```
print @{ f() };
```
... | [
0.21207144856452942,
0.10423850268125534,
0.4258945882320404,
-0.15721964836120605,
-0.34683531522750854,
-0.01590605638921261,
0.303103506565094,
-0.23410792648792267,
-0.3161020278930664,
-0.26453787088394165,
0.01423892192542553,
0.636914849281311,
-0.4876321256160736,
0.098904944956302... | |
I've been using SQL for years now but rarely anything more that simple inserts and selects etc... so I'm no SQL expert. I'm wondering if I could get some help in optimizing a more complex SQL statement that I'm executing on SQLite, from PHP through PDO.
The statement seems to work correctly, just seems to take longer ... | [
0.38427749276161194,
-0.12432965636253357,
0.3986174464225769,
-0.1343340277671814,
-0.14790895581245422,
-0.03369684889912605,
0.17426681518554688,
-0.11678934097290039,
-0.1127798855304718,
-0.6535855531692505,
0.18199379742145538,
0.26569807529449463,
-0.5038516521453857,
0.202148079872... | |
WHERE SubscriberGroups.GroupID IN ('1', '2', '3')
AND Subscribers.ID NOT IN
(
SELECT Subscribers.ID FROM Subscribers
INNER JOIN SubscriberGroups ON Subscribers.ID=SubscriberGroups.SubscriberID
WHERE SubscriberGroups.GroupID IN ('4', '5', '6')
);
```
What I've got is a li... | [
0.3899548053741455,
-0.20550769567489624,
0.5410474538803101,
-0.10768817365169525,
-0.017924413084983826,
0.05260640010237694,
0.2803528308868408,
-0.06797876954078674,
-0.38144809007644653,
-0.39313486218452454,
-0.10821764916181564,
0.0004799299349542707,
-0.5604572296142578,
0.23007211... | |
(1,2,3) but exclude those that are also in another set of groups (4,5,6).
Firstly, is the above SQL typical of how to do this?
Secondly, what indicies should I have to make this work as efficiently as possible?
Currently it takes about 30 seconds to get through about 5000 subscriber records (and a handful of groups... | [
0.585297703742981,
-0.026255490258336067,
0.5095465183258057,
0.2017282098531723,
0.10175898671150208,
-0.24787485599517822,
0.4408799707889557,
-0.44710737466812134,
-0.21531036496162415,
-0.6034728288650513,
0.029219379648566246,
0.7024939060211182,
-0.012918198481202126,
0.1230903044342... | |
*
FROM SubscriberGroups
WHERE Subscribers.ID=SubscriberGroups.SubscriberID
AND SubscriberGroups.GroupID IN ('1', '2', '3') )
AND NOT EXISTS( SELECT *
FROM SubscriberGroups | [
0.3029251992702484,
-0.11704810708761215,
0.5138514637947083,
-0.1085071712732315,
-0.023580104112625122,
0.09336341172456741,
0.30898088216781616,
-0.12105327844619751,
-0.06580422073602676,
-0.5691735148429871,
-0.3168494701385498,
-0.09110930562019348,
-0.5253145694732666,
0.15996861457... | |
WHERE Subscribers.ID=SubscriberGroups.SubscriberID
AND SubscriberGroups.GroupID IN ('4', '5', '6')
);
```
You'd also want to make sure that you have an index on SubscriberGroups( SubscriberID, GroupID )
My guess is that Subscribers already has an index on ID, right?
EDIT:
Another option, w... | [
0.46324193477630615,
-0.24694408476352692,
0.6014382243156433,
0.2651742398738861,
0.05252174288034439,
-0.13130396604537964,
-0.0009419064153917134,
-0.09842821955680847,
-0.6117467284202576,
-0.4714384973049164,
-0.03998246788978577,
0.28947994112968445,
-0.34231802821159363,
0.051826767... | |
index scan which *could* be faster than two index seeks, but it depends on SQLite's optimizer...
```
SELECT Subscribers.ID, '1' AS TemplateID
FROM Subscribers
INNER JOIN( SELECT SUM( CASE WHEN GroupID IN('1', '2', '3') THEN 1 ELSE 0 END ) AS inGroup,
SUM( CASE WHEN GroupID IN('4', '5', '6') THEN 1 ... | [
-0.04223565012216568,
-0.3960447311401367,
0.8835363984107971,
0.06194298341870308,
-0.12240749597549438,
-0.04198552668094635,
0.042581718415021896,
-0.44502899050712585,
-0.20449498295783997,
-0.7025712132453918,
0.10295255482196808,
0.12844856083393097,
-0.3964278995990753,
0.1014277413... | |
FROM SubscriberGroups
WHERE SubscriberGroups.GroupID IN ('1', '2', '3', '4', '5', '6' )
) SubscriberGroups
ON Subscribers.ID=SubscriberGroups.SubscriberID
AND inGroup > 0
AND outGroup = 0
``` | [
0.2559009790420532,
-0.13789002597332,
0.6982248425483704,
0.013858466409146786,
-0.16375792026519775,
0.027531268075108528,
0.2233695089817047,
-0.0763971358537674,
-0.202500119805336,
-0.5136457085609436,
-0.3022401034832001,
0.015674974769353867,
-0.5965839624404907,
0.112489253282547,
... | |
I don't want to add `schema.rb` to `.gitignore`, because I want to be able to load a new database schema from that file. However, keeping it checked in is causing all sorts of spurious conflicts that are easily resolved by a fresh `db:migrate:reset`.
Basically I want a way to:
2. Keep schema.rb in the repository for ... | [
0.5123084187507629,
0.4468228220939636,
0.30084481835365295,
-0.10125911235809326,
-0.14368246495723724,
0.049422070384025574,
0.21036803722381592,
-0.23815302550792694,
-0.21987174451351166,
-0.5639098882675171,
0.15307855606079102,
0.5694524645805359,
-0.12278304994106293,
0.183271124958... | |
delete and .gitignore `schema.rb` and then have it regenerated for each developer when they `rake db:migrate`.
You can still achieve what you wanted without migrating from 0 and risking broken migrations from years ago by simply doing a "roll-up" of the migrations periodically. You can do this by:
1. Run all outstand... | [
0.24891209602355957,
-0.12455368787050247,
0.4540484547615051,
0.031082747504115105,
0.15100635588169098,
-0.05186476558446884,
0.3053285479545593,
-0.5061657428741455,
-0.0872720256447792,
-0.7693412899971008,
-0.23338790237903595,
0.6917588710784912,
-0.36287087202072144,
0.2815104722976... | |
`schema.rb` that may not be resolved correctly. It's not magical, but it works. | [
0.5239396095275879,
0.23705805838108063,
0.25551342964172363,
0.08416512608528137,
-0.006618988700211048,
-0.3626018464565277,
0.5235887169837952,
-0.4039524793624878,
0.15604138374328613,
-0.5082224607467651,
-0.031599365174770355,
0.4110918343067169,
-0.26041752099990845,
0.1358312368392... | |
In my application, the client is a Javascript set of functions in the browser, and it does some work - for example, playing a clip.
It uses XmlHttpRequest to talk to the server.
However, the server is allowed to abruptly close the connection since there is no other way it seems, to interrupt the client.
Can the client... | [
0.15320804715156555,
-0.009782723151147366,
0.32624396681785583,
0.22488129138946533,
-0.09021154046058655,
-0.3171606957912445,
-0.10693544894456863,
0.24404406547546387,
-0.10099826008081436,
-0.6864616274833679,
0.024863867089152336,
0.32208451628685,
-0.3449363112449646,
-0.01131429895... | |
as efficient as a notification would have been.
I solved it by specifying that at the NEXT Get request, the client would be told that its session is invalid.
This was implemented by URL rewriting - appending "jsessionid=[id]" on each request sent by the Javascript functions. the servlet stores the current session id. | [
-0.18316413462162018,
-0.05601244047284126,
0.3818404972553253,
-0.021200720220804214,
-0.24661706387996674,
-0.06952507793903351,
0.5318515300750732,
-0.3214183449745178,
0.030933059751987457,
-0.4191511571407318,
-0.20232021808624268,
0.4318278431892395,
-0.26161935925483704,
0.041251327... | |
In 1.x, every web project had a references and web references item in the solution explorer that i can expand and remove/add/refresh.
They don't have it anymore in 2.x
Where did the references go?
**EDIT: I realized what i have is a website and not a web application project**
Right click on Project in Solution Expl... | [
0.3111453950405121,
0.226175457239151,
0.3837542235851288,
0.25224268436431885,
-0.006364204455167055,
0.011669783852994442,
0.17891013622283936,
-0.08335968852043152,
-0.11379913985729218,
-0.993461012840271,
0.11870865523815155,
0.24749770760536194,
-0.4251919388771057,
0.332182556390762... | |
I have a WCF service operation that accepts a data contract parameter of custom type MyQuery -- `function Search(q as MyQuery)`. The MyQuery object contains 2 properties:
```
MyQuery.SearchPhrase (string)
MyQuery.SearchType (custom enum SearchTypeEnum)
```
I also have a Flex client application that consumes this s... | [
0.27216729521751404,
0.037534285336732864,
0.5774394273757935,
-0.18860246241092682,
-0.28609374165534973,
-0.09776367247104645,
0.1746734082698822,
-0.12664270401000977,
-0.0081290602684021,
-0.6874130964279175,
0.06700059771537781,
0.7746117115020752,
-0.27915331721305847,
0.330993026494... | |
redesign the service without enums?
This is how the enum data contract is defined at the service tier:
```
<DataContract(Namespace:="http://mydomain/2009/04/SearchTypeEnum")> _
Public Enum SearchTypeEnum
<EnumMember()> [Boolean] = 0
<EnumMember()> [NaturalLanguage] = 1
End Enum
```
As far as I know this is t... | [
-0.04344445466995239,
-0.35792607069015503,
0.6289728283882141,
-0.18129651248455048,
0.06737058609724045,
0.019864311441779137,
0.16127893328666687,
-0.02577412873506546,
-0.2236853986978531,
-0.9714664220809937,
-0.11285444349050522,
0.6114957332611084,
-0.196981281042099,
0.264759600162... | |
Like others, I think the more important question is "why do you need this?" It's not really UNIX form to use the executable path to find ancillary files. Instead you use an environment variable or a default location, or follow one of the other conventions for finding the location of ancillary files (ie, ~/.<myapp>rc). | [
0.5794469118118286,
-0.1103595495223999,
0.25602927803993225,
0.35108089447021484,
0.37170296907424927,
-0.30365675687789917,
-0.30312249064445496,
0.22111685574054718,
-0.29799216985702515,
-0.35439416766166687,
-0.07094706594944,
0.4646718502044678,
-0.04474092274904251,
0.09975664317607... | |
I have an image that takes up a lot more space than the android screen. I want the image to be presented full size and the user can move in any direction. Like a map.
Any suggestions?
Here is a tutorial I saw that did what you are describing
<http://www.anddev.org/scrolling_a_picture_horizontally_and_vertically-t3245.... | [
0.45199093222618103,
-0.14010637998580933,
0.4389171600341797,
0.12857063114643097,
0.04342145472764969,
0.25074687600135803,
-0.11262677609920502,
0.19444052875041962,
-0.3676286041736603,
-1.0512632131576538,
0.255056232213974,
0.2921638786792755,
0.2624721825122833,
0.1119496077299118,
... | |
When you have 5 dropdowns for date selection (Y, m,d, H,i) how do you insert the selected date and time into a single column of a mySQL table as a datetime using PHP5?
I know they need to be combined in a string such as:
```
$DateTime="$Year-$Month-$Day $Hour:$Minute:00";
```
and then maybe use strtotime:
```
$Dat... | [
0.01245606504380703,
-0.16283664107322693,
0.5913655161857605,
-0.03126547858119011,
0.348645955324173,
0.17636099457740784,
0.06699693202972412,
-0.1833808422088623,
-0.16249555349349976,
-0.2886594235897064,
-0.21023666858673096,
0.29006651043891907,
-0.07579232007265091,
0.1641186773777... | |
GetSQLValueString($_POST['Location1'], "text"),
GetSQLValueString($_POST['Location2'], "text"),
GetSQLValueString($_POST[' ???? '], "date"));
```
Thanks to all who tried to help - the answer was a lot less complicated
(blonde moment I guess! lol)
Just needed to declare th... | [
-0.044153496623039246,
-0.1487361341714859,
0.8320986032485962,
-0.02378530241549015,
0.029048146679997444,
0.251213014125824,
0.12077844142913818,
0.13139931857585907,
0.039875324815511703,
-0.3948320150375366,
-0.19329944252967834,
-0.02869403548538685,
0.3091754615306854,
0.520307004451... | |
Here's what I"m trying to do. I have a hyperlink like this on my page:
```
<a href="http://www.wikipedia.com/wiki/Whatever_Page_Here">Whatever Page Here</a>
```
When a user clicks the link I want to grab that click. If it's a link I don't want them to click (like something that doesn't match the format <http://www.w... | [
-0.02118816040456295,
-0.08211512863636017,
0.7998294830322266,
-0.11059221625328064,
0.12744900584220886,
-0.2030109316110611,
0.3582853078842163,
-0.10993590205907822,
-0.3788202702999115,
-0.4663810133934021,
-0.2924073040485382,
0.7005350589752197,
-0.4907015264034271,
0.03434724733233... | |
popup or direct to a different page
if (redirect)
{
var href = $(this).attr("href").split("/");
location.href = "http://mydomain.com/controller/" + href[href.length - 1];
}
return false;
}
```
The "return false;" tells the anchor not to fire the navigate. | [
-0.0555976927280426,
-0.28970322012901306,
1.0058677196502686,
-0.07007264345884323,
0.37740084528923035,
0.10847096890211105,
0.157113179564476,
0.043519772589206696,
-0.24339964985847473,
-0.5460724830627441,
-0.6520364880561829,
0.3029162883758545,
-0.721152663230896,
0.1979655623435974... | |
How can a filter out the array entries with an odd or even index number?
```
Array
(
[0] => string1
[1] => string2
[2] => string3
[3] => string4
)
```
Like, i want it remove the [0] and [2] entries from the array.
Or say i have 0,1,2,3,4,5,6,7,8,9 - i would need to remove 0,2,4,6,8.
`foreach($arr as ... | [
-0.21246784925460815,
-0.12263122200965881,
0.1816232055425644,
-0.2756318151950836,
0.025475308299064636,
0.15442954003810883,
0.25169962644577026,
-0.37145280838012695,
-0.10147525370121002,
-0.5085024833679199,
-0.1648520976305008,
0.5209348797798157,
-0.5800467133522034,
-0.04173378273... | |
Is it possible to assign the result of a switch statement to a variable.
For example, instead of:
```
switch ($Extension)
{
doc {$Location = "C:\Users\username\Documents\"; break}
exe {$Location = "C:\Users\username\Downloads\"; break}
default {$Location = "C:\Users\username\Desktop\"}
... | [
0.017953038215637207,
-0.3649199306964874,
0.21873848140239716,
-0.09651461988687515,
0.3582291305065155,
-0.15852081775665283,
-0.2209158092737198,
-0.037953462451696396,
-0.2118730992078781,
-0.2178419828414917,
-0.29950451850891113,
0.2151101678609848,
-0.2946746349334717,
0.07470786571... | |
exe {"C:\Users\username\Downloads\"; break}
default {"C:\Users\username\Desktop\"}
}
}
```
Trying the above results in $location containing the entire code block as a String.
For V1, I would wrap the switch statement in a function.
```
function Get-DocumentLocation($Extension)
{
switch ($Extension)
... | [
-0.1516854166984558,
0.08450915664434433,
0.8390180468559265,
-0.15331798791885376,
0.41326379776000977,
-0.06902287155389786,
-0.051366329193115234,
-0.24739663302898407,
-0.19934944808483124,
-0.4523083567619324,
-0.5193896889686584,
0.5242497324943542,
-0.2284865379333496,
0.07088212668... | |
I've built a small .NET winforms utility for internal use at my company, and as the primary interface is a tab control, I've decided to add a tab for the "about box" instead of a separate form. So, I have some space to fill in my about box.
Thus far I have:
* the program's icon & name
* version
* the author's name (m... | [
0.3066595792770386,
0.2135898619890213,
0.3222728669643402,
0.03281193599104881,
-0.16242600977420807,
0.020136961713433266,
0.23791149258613586,
0.13834017515182495,
-0.01127767376601696,
-0.7204369306564331,
-0.000004328912837081589,
0.2801976799964905,
0.22723151743412018,
0.15121732652... | |
version
* Current Directory
* Computer Name
* User Name
I figure in the event of some odd behavior, this could be useful.
What do you think? Is there some useful information you'd like to have displayed in the about box or should I just keep it nice and simple?
I always recommend putting in someone else's email addre... | [
0.6785359382629395,
-0.003936222288757563,
0.15241806209087372,
0.16640470921993256,
-0.002121531870216131,
-0.5256175994873047,
0.4377738833427429,
0.5348631143569946,
-0.22217777371406555,
-0.6813079118728638,
-0.1876371055841446,
0.49707141518592834,
-0.19317203760147095,
0.263149589300... | |
According to css3.info's [selector test](http://www.css3.info/selectors-test/), Firefox 3.0 supports some permutations of the nth-child selector. However, the code shown [here](http://www.css3.info/selectors-test/test-nthchild.html) (#30) doesn't work for me.
It should select the empty paragraphs, so I edited my code ... | [
-0.24384494125843048,
0.21814319491386414,
0.17883670330047607,
-0.27798783779144287,
-0.23693464696407318,
0.06599661707878113,
0.24416550993919373,
-0.4773142635822296,
-0.07243610918521881,
-0.5849676132202148,
-0.32923242449760437,
0.28510579466819763,
-0.6149904727935791,
-0.177464440... | |
3.0 does not support `:nth-child`. | [
-0.3239485025405884,
0.199384868144989,
0.23914606869220734,
-0.3966759443283081,
-0.18681909143924713,
-0.04664134606719017,
0.547734260559082,
-0.09325199574232101,
0.5313499569892883,
-0.5072792768478394,
-0.366890013217926,
0.07617520540952682,
-0.4466824531555176,
0.22047115862369537,... | |
I'm trying to validate that a parameter is both an out parameter and extends an interface (ICollection). The reflection api doesn't seem to want to give me the "real" type of the parameter, only the one with an "&" at the end which will not evaluate correctly in an IsAssignableFrom statement. I've written some c# code ... | [
0.1963551789522171,
0.14896132051944733,
0.40129464864730835,
-0.2984703779220581,
-0.14099423587322235,
0.020470667630434036,
0.35724642872810364,
-0.23958447575569153,
0.16127364337444305,
-0.3286336362361908,
0.20483599603176117,
0.7445828318595886,
-0.43737706542015076,
0.2426122277975... | |
string nameNoAmpersand = typeName.Substring(0, typeName.Length - 1);
Type realType = Type.GetType(nameNoAmpersand);
if (!typeof(ICollection).IsAssignableFrom(realType))
return false;
return true;
}
```
Is there a way to get realType without reloading the Type from its string name? I'm still on .... | [
0.13942410051822662,
-0.0403045229613781,
0.5190559029579163,
-0.19770267605781555,
0.06355857104063034,
-0.09104100614786148,
0.5652576684951782,
-0.2863089144229889,
-0.16002896428108215,
-0.2810307741165161,
-0.10102199763059616,
0.8670606017112732,
-0.3358309268951416,
0.28773513436317... | |
I'm trying to use the SQLite C API in my iPhone app. I'm trying to query an SQLite database for the number of records that have been completed after a certain date. The database saves the completed date as text in
```
YYYY-MM-dd
```
format. For example the text
```
2009-04-10
```
might appear as a completed date.
... | [
0.1250324249267578,
0.47367364168167114,
0.502954363822937,
-0.11057988554239273,
0.22075077891349792,
0.007643291726708412,
0.2614465355873108,
-0.04966605827212334,
-0.39728835225105286,
-0.7112340927124023,
-0.05680844560265541,
0.4062032103538513,
-0.021877950057387352,
0.0887793973088... | |
I expect.
In my app, I execute this code (written in Objective-C, obviously):
```
static sqlite3_stmt *count_tasks_statement = nil;
if(count_tasks_statement == nil) {
const char *sql = "SELECT COUNT(*) FROM tasks WHERE completed > '?'";
if (sqlite3_prepare_v2(database, sql, -1, &count_tasks_statement, NULL) ... | [
-0.04229646176099777,
-0.027307847514748573,
0.532284140586853,
-0.4824617803096771,
0.07938806712627411,
0.41099098324775696,
0.5767820477485657,
-0.4448995888233185,
-0.23557132482528687,
-0.8428129553794861,
-0.1717950999736786,
0.6585580706596375,
-0.3333360552787781,
-0.19436740875244... | |
the result set.
taskCount = sqlite3_column_int(count_tasks_statement, 0);
}
// Reset the statement for future reuse.
sqlite3_reset(count_tasks_statement);
```
When I use the debugger on this code, and examine the taskCount variable, it is set to 0, indicating that no records were found. (If I change the code to ... | [
0.03250471130013466,
0.18828170001506805,
0.5532956719398499,
-0.3668085038661957,
0.21246981620788574,
0.029169583693146706,
0.4587594270706177,
-0.23791925609111786,
-0.4043365716934204,
-0.5135802626609802,
0.04674511030316353,
0.5839014053344727,
-0.20629172027111053,
0.144807919859886... | |
of different ways with no luck. Help!
Don't put parameter placeholders inside quotes, even if the value is a string or date literal.
```
const char *sql = "SELECT COUNT(*) FROM tasks WHERE completed > ?";
``` | [
0.4995902180671692,
0.09946418553590775,
0.14041005074977875,
-0.006808715872466564,
0.18446733057498932,
-0.09936080873012543,
0.35565465688705444,
-0.19179144501686096,
-0.1847211867570877,
-0.2534385025501251,
-0.023683633655309677,
0.6063694357872009,
-0.25127357244491577,
0.0975982472... | |
Let's say I have some contrived models:
```
class Author(Model):
name = CharField()
class Book(Model):
title = CharField()
author = ForeignKey(Author)
```
And let's say I want to use a ModelForm for Book:
```
class BookForm(ModelForm):
class Meta:
model = Book
```
Simple so far. But le... | [
-0.1564125120639801,
0.29158124327659607,
0.09012678265571594,
-0.03085186891257763,
-0.001350227976217866,
0.007818244397640228,
0.19447670876979828,
0.0036510108038783073,
-0.21314957737922668,
-0.5139433145523071,
0.07400060445070267,
0.6943793296813965,
-0.24794256687164307,
0.28421369... | |
say that the queryset I want can't be chosen until `__init__`, because it relies on an argument to be passed.
This seems like it might do the trick:
```
class BookForm(ModelForm):
class Meta:
model = Book
def __init__(self, letter):
# returns the queryset based on the letter
choices = getChoi... | [
-0.12641532719135284,
0.09435223788022995,
0.4227449893951416,
0.08391895890235901,
0.035250596702098846,
-0.11755842715501785,
0.21166355907917023,
-0.2939974367618561,
-0.17622044682502747,
-0.5900470614433289,
-0.07883374392986298,
0.6763640642166138,
-0.3966594338417053,
0.254092127084... | |
this, where I try to override the ModelForm's default field and then set it later:
```
class BookForm(ModelForm):
author = ModelMultipleChoiceField(queryset=Author.objects.all())
class Meta:
model = Book
def __init__(self, letter):
choices = getChoices(letter)
self.author.queryset = choice... | [
0.018353460356593132,
-0.1357576996088028,
0.47364476323127747,
0.07387548685073853,
-0.03308054804801941,
-0.24505920708179474,
0.13941743969917297,
-0.3442161977291107,
-0.22610150277614594,
-0.6672632098197937,
-0.23232804238796234,
0.6823850274085999,
-0.3167055547237396,
0.20352461934... | |
in [this answer](https://stackoverflow.com/questions/500650/django-model-question-newbie/501362#501362) - it's about Models, but Forms work similarly. | [
0.17026090621948242,
0.1919405609369278,
0.26850706338882446,
0.18884606659412384,
0.07292243093252182,
-0.200190469622612,
-0.37038207054138184,
-0.307094544172287,
-0.22591039538383484,
-0.2789516746997833,
-0.1148284375667572,
0.22094978392124176,
-0.06274259835481644,
-0.23185490071773... | |
String comes back from the database with a format: '00/00/0000' I need to then compare it to a date that the user has entered in the same format. How do I make the conversion and compare the two dates?
Use the static ParseExact method on the DateTime structure to convert the string. You will also pass the format you wa... | [
0.17065732181072235,
0.025808533653616905,
0.7666207551956177,
0.1236334815621376,
0.013104378245770931,
-0.011457094922661781,
-0.16548773646354675,
0.11011260747909546,
0.0119747593998909,
-0.7139894366264343,
-0.06343154609203339,
0.17847543954849243,
-0.0033316793851554394,
0.296643763... | |
My organization has been experimenting with the introduction of more "Agile" methods. We've been trying the Scrum approach for a short while, and most of the team has, more or less, adapted to it. I like it as a whole, but I'm concerned about one potentially severe impact of the methodology: as teams are consistently f... | [
0.33172377943992615,
0.26404041051864624,
-0.09493687003850937,
-0.026735924184322357,
0.14036747813224792,
-0.15588757395744324,
0.3211371898651123,
0.006649100221693516,
-0.232415571808815,
-0.7041759490966797,
-0.039805058389902115,
0.4680529236793518,
0.2867753207683563,
-0.14406897127... | |
heavy-weight data provisioning. Others have invested a large amount of their careers learning GUI technologies and have developed a fundamental understanding of users and usability in an application. Neither skill set is better than the other, but they are certainly different.
Is this an inevitable result of the Scrum... | [
0.39524218440055847,
0.05199030414223671,
-0.1563674509525299,
0.4591269791126251,
0.012960203923285007,
-0.22996826469898224,
0.199672132730484,
0.060220617800951004,
-0.259563684463501,
-0.49042198061943054,
-0.269264817237854,
0.8948413133621216,
0.2586542069911957,
-0.40666717290878296... | |
have honed over the years, and the Scrum methodology, in my mind, tends to devalue those very abilities they were previously respected for.
Here's an example for clarification:
If a sudden change of technology occurs on the server-side data provisioning, and every item on the to-do list for the sprint is based on thi... | [
0.21489302814006805,
0.06723331660032272,
-0.008608074858784676,
0.2567070424556732,
0.15461742877960205,
-0.19569139182567596,
0.10556685924530029,
-0.049613773822784424,
-0.15734589099884033,
-0.4966631531715393,
0.010552553460001945,
0.719416081905365,
0.12019806355237961,
-0.3430598080... | |
of their lack of experience.
I understand the need for rapid development to discourage "role silos" but doesn't this discount one fundamental reality: people develop *skills* in accordance to necessity, their interests, or their experiences. People seem to be less motivated when they perceive their position is one of ... | [
0.2672165334224701,
-0.04473591968417168,
-0.22068534791469574,
0.04044627025723457,
0.1409095823764801,
0.03253769502043724,
0.3728295862674713,
-0.08338619023561478,
-0.009119703434407711,
-0.6281270980834961,
-0.16798658668994904,
0.7753698229789734,
0.03612581640481949,
-0.376796364784... | |
focus. We don't do it on purpose with a chart and list, it just happens. We all know who's best at what, or what their main/secondary focuses are. If the 'main' person needs help, they get the person/people with a secondary focus in it to help. We do get plenty of tasks not necessarily in line with whatever our particu... | [
0.5446479916572571,
-0.25264739990234375,
0.3108595311641693,
0.3602384030818939,
-0.13800300657749176,
0.03446211293339729,
-0.040925078094005585,
0.3760562539100647,
-0.4976060688495636,
-0.7013280987739563,
-0.11012338101863861,
0.7610543966293335,
-0.06589595973491669,
-0.5088945031166... | |
that sprint (if the server guys + some help from the others wasn't enough). The way the sprint is supposed to work is that from a prioritized list, the developers pick what they think they can get done in that 30-day timeframe. If that meant the GUI guys needed 2 days of server-side training in order to help, that's wh... | [
-0.1744275689125061,
-0.2511584460735321,
-0.18815143406391144,
0.5766797065734863,
-0.012397625483572483,
-0.2323901653289795,
0.13525554537773132,
-0.0546441525220871,
-0.4403378367424011,
-0.40938839316368103,
0.17789971828460693,
0.6032730937004089,
0.02394518442451954,
-0.744802117347... | |
case-study book by one of the guy/s who invented scrum. | [
-0.04357122629880905,
0.22185364365577698,
0.01099440734833479,
0.18719500303268433,
0.26206591725349426,
-0.1017042025923729,
-0.030061600729823112,
0.002982018282637,
0.0501563660800457,
-0.15894600749015808,
0.2381768822669983,
0.22727073729038239,
0.05361127853393555,
-0.53705805540084... | |
I have two tables:
```
Topic (
TopicID: int, (primary key)
TopicName: varchar
);
Example (
ExampleID: int, (primary key)
TopicID: int, (foreign key to Topic table)
ExampleOrder: int,
ExampleName: varchar
);
```
Using Linq, given an ExampleID, I want to get the next example in the same topic (with the sa... | [
-0.0842214971780777,
0.3978993594646454,
0.5512141585350037,
-0.07763273268938065,
-0.16926313936710358,
0.12409629672765732,
-0.007629645988345146,
-0.28798454999923706,
-0.3221794068813324,
-0.6487393379211426,
0.16950617730617523,
0.5796418786048889,
-0.2131551206111908,
0.0254258885979... | |
queries, but I'm trying to get it done without extra round trips to the database.
The point of Scrum is for the developers to self-organize. We use scrum where I am, and jobs get passively sorted by a person's focus. We don't do it on purpose with a chart and list, it just happens. We all know who's best at what, or wh... | [
0.15077058970928192,
-0.040042635053396225,
-0.07122427225112915,
0.27909332513809204,
-0.1287415623664856,
0.11262666434049606,
0.0572228766977787,
0.02976543828845024,
-0.24672913551330566,
-0.544590175151825,
-0.032022684812545776,
0.38616976141929626,
-0.12005802243947983,
-0.247031599... | |
but you always know who to ask for help then.
For your example - I don't know that if you say had 3 server guys and 5 gui guys, that you'd expect to get all the work done in that sprint (if the server guys + some help from the others wasn't enough). The way the sprint is supposed to work is that from a prioritized lis... | [
0.1693209856748581,
-0.3050181567668915,
-0.2236948013305664,
0.4652619957923889,
-0.18012583255767822,
0.004294412676244974,
0.06158300116658211,
-0.08688156306743622,
-0.35528630018234253,
-0.5779138207435608,
0.044441789388656616,
0.6639668941497803,
0.23794512450695038,
-0.511959791183... | |
Unless there were concurrent things also high up the list that they could do instead. The sprint tasks are not supposed to be dictated by management as a psuedo-deadline.
If you have a Safari account, there's an interesting mostly case-study book by one of the guy/s who invented scrum. | [
0.17410722374916077,
-0.29556456208229065,
-0.31148630380630493,
0.4758230447769165,
-0.0382978618144989,
-0.15242135524749756,
0.4507579803466797,
0.2714422047138214,
-0.6744552254676819,
-0.05548823997378349,
0.34180715680122375,
0.4251192510128021,
-0.03180176392197609,
-0.4595760107040... | |
I had a feature branch of my trunk and was merging changes from my trunk into my branch periodically and everything was working fine. Today I went to merge the branch back down into the trunk and any of the files that were added to my trunk after the creation of my branch were flagged as a "tree conflict". Is there a w... | [
0.2530355155467987,
-0.08355652540922165,
0.2992219924926758,
0.20657356083393097,
0.14707040786743164,
0.20157454907894135,
0.481466680765152,
-0.13007819652557373,
-0.5025323033332825,
-0.5753127932548523,
0.24883687496185303,
0.5570565462112427,
-0.012721698731184006,
-0.159604787826538... | |
directory** with SVN client 1.6.x you can use:
```
svn resolve --accept working -R .
```
where `.` is the directory in conflict.
**WARNING**: *"Committing your working directory" means that your sandbox structure will be the one you are committing, so if, for instance, you deleted some file from your sandbox they w... | [
-0.3997246325016022,
0.011663642711937428,
0.4531720280647278,
-0.25057360529899597,
0.04488702863454819,
-0.038566820323467255,
0.22749993205070496,
-0.07581013441085815,
-0.4776347875595093,
-0.5141499638557434,
-0.3699592053890228,
0.7612300515174866,
-0.3652614653110504,
0.336598813533... | |
I want a trigger to fire only when UPDATEs are user-initiated (not me running updates from the MySQL command line).
What's the 'industry standard' for achieving this? I have been trying unsuccessfully to detect a variable passed in with the query (i.e. @user\_update=true), but without success. A colleague of mine sugg... | [
0.4327787160873413,
0.4058368504047394,
0.38459599018096924,
-0.1811741292476654,
0.0661836490035057,
-0.24800172448158264,
0.41866686940193176,
-0.353863924741745,
-0.04897644743323326,
-0.23842041194438934,
0.012635122053325176,
1.0303478240966797,
-0.43396323919296265,
-0.05766438692808... | |
trigger before doing command-line updates and re-enable it after.
But you're doing this wrong, conceptually.
Why shouldn't the trigger run when you use the command line? I Assume this is some sort of auditing trigger, that captures who updated a row. You at the command line are a "who" too.
Comment from OP:
> Yes -... | [
0.3062475323677063,
0.1619464010000229,
0.5965519547462463,
-0.002578533487394452,
0.05961066111922264,
0.04211780056357384,
0.12860463559627533,
-0.3361580967903137,
-0.4365657866001129,
-0.2942129075527191,
0.10805083811283112,
0.7605552673339844,
-0.08779925853013992,
0.0636807233095169... | |
added history rows after. Even better, do your testing on a separate database, and just don't worry about this at all. | [
0.35912224650382996,
0.0906631276011467,
-0.05075088143348694,
0.5080924034118652,
0.11057410389184952,
-0.16471706330776215,
-0.0362066812813282,
0.280519038438797,
-0.3422430157661438,
-0.6682233214378357,
0.3127044439315796,
0.21140581369400024,
0.251745343208313,
0.07147777080535889,
... | |
I've been a SharePoint admin for a while, and now have been tasked with a bit more of a developer role - which I'm still very much learning. Most things I've been able to figure out on my own or through Google, but this one has me stumped.
For one particular task I need to use PowerShell to script adding items to a li... | [
0.5034025311470032,
-0.008498497307300568,
0.29809778928756714,
0.17583335936069489,
-0.07588626444339752,
-0.07857272773981094,
0.12210967391729355,
0.19952622056007385,
-0.37506893277168274,
-0.7149478197097778,
0.09191138297319412,
0.330783486366272,
0.05578760802745819,
0.1334330588579... | |
one using the following code:
```
$NewItem = $MyList.Items.Add()
$NewItem["My Hyperlink Column"] = $($url.url)
$NewItem.Update()
```
But I want to set the name/title of the link as well and that's what stumps me. I don't want to have to create a separate column in the list and populate that with the link name,... | [
0.16895312070846558,
0.008100959472358227,
0.4335705041885376,
-0.0052690510638058186,
-0.1064700111746788,
-0.32178157567977905,
0.1898629367351532,
-0.2377101182937622,
-0.3185183107852936,
-0.5495158433914185,
-0.02601565606892109,
0.5046496987342834,
-0.4062213897705078,
0.213436022400... | |
updated a row. You at the command line are a "who" too.
Comment from OP:
> Yes - good point! :) It is a "dd/mm/yyyy hh:mm - User A changed First name from "Jane" to "Joan"" type thing. I just don't want it to fill the history table during the test phase when I'm potentially updating rows 'manually'.
Then either disa... | [
0.3014334738254547,
0.037620048969984055,
0.7851075530052185,
0.04870704561471939,
0.2403876781463623,
0.1372411549091339,
0.1669042557477951,
-0.025887761265039444,
-0.40644460916519165,
-0.47999846935272217,
0.04509744420647621,
0.5562195181846619,
-0.07279360294342041,
0.100931018590927... | |
Is it possible to run Ruby IRB ver a named pipe, so I can send commands and get results remotely?
Generally I would like to utilize the IRB engine, while have a different UI (probably written with .Net).
I believe so - this worked for me (mac os x):
in terminal 1:
```
mkfifo rpipe
```
in terminal 2:
```
tail -f r... | [
-0.050862036645412445,
0.050853144377470016,
0.5722635388374329,
-0.3142732083797455,
-0.37284529209136963,
-0.09268064796924591,
0.45289111137390137,
-0.3206796646118164,
0.1355307549238205,
-0.6269209384918213,
0.24000225961208344,
0.6264367699623108,
-0.4206084907054901,
-0.194235131144... | |
Has anyone come across any good tools (preferably but not necessarily FOSS) that can read a SQL Server (2005/2008) trace file and execute the commands against another database. We are attempting to perform some performance testing on our SQL servers and would like to replicate an actual load.
I have come across but n... | [
0.2546040415763855,
-0.04401351511478424,
0.22823001444339752,
0.1965964436531067,
-0.24651087820529938,
-0.29384487867355347,
0.08917751163244247,
0.10830338299274445,
-0.5451575517654419,
-0.38760027289390564,
0.5263556241989136,
0.44084417819976807,
0.016650937497615814,
-0.136301755905... | |
point.
<http://msdn.microsoft.com/en-us/library/ms189604.aspx>
Quest Software also have a tool called Benchmark Factory that can be used to perform SQL Server load testing.
<http://www.quest.com/benchmark-factory/> | [
0.25608450174331665,
-0.01138115394860506,
0.14814011752605438,
0.1272473782300949,
-0.18949094414710999,
0.15085461735725403,
0.21982420980930328,
-0.3632711172103882,
-0.15192188322544098,
-0.3506544828414917,
0.17121587693691254,
0.17822696268558502,
0.10449569672346115,
0.0858507007360... | |
I must be stupid, because all the articles I've seen on OpenID in ASP.NET have simply confused me on the issue. I'm pretty sure I understand the concepts involved here, I'm just a little fuzzy on how things look on the back end side of things.
So a new user comes to my website and wants to create an account. Here come... | [
0.5246545076370239,
0.010559557005763054,
0.11375709623098373,
0.09349142760038376,
0.02854716032743454,
0.043031420558691025,
0.15317174792289734,
0.08455052226781845,
-0.3365284502506256,
-0.628182053565979,
0.13537786900997162,
0.1480700820684433,
0.009424770250916481,
0.171634078025817... | |
to the same openID provider each time he returns, or can he select a new provider each time?
* What does the database look like here? Do I have his username in a table and that is linked to an openID provider?
* What if the user doesn't have an OpenID account? Should I allow him to create a traditional account on my en... | [
0.392668217420578,
0.06344350427389145,
-0.08021510392427444,
0.2817513048648834,
-0.20470573008060455,
-0.001134003745391965,
0.3734310567378998,
0.4210590124130249,
-0.22219258546829224,
-0.7094464302062988,
-0.011602175422012806,
0.3587976396083832,
-0.24197471141815186,
0.2323810905218... | |
timing:**
As mentioned by [woodchips](https://stackoverflow.com/questions/738438/removing-zeros-from-a-matrix-not-sparse/738861#738861), this method seems slow compared to the one used by [KitsuneYMG](https://stackoverflow.com/questions/738438/removing-zeros-from-a-matrix-not-sparse/738484#738484). This has also been ... | [
0.04326072335243225,
-0.2423105537891388,
-0.1359914094209671,
-0.15974855422973633,
-0.17755243182182312,
0.019429916515946388,
0.18505063652992249,
-0.33202889561653137,
-0.39908021688461304,
-0.2664740979671478,
0.18284739553928375,
0.3589411675930023,
-0.22894148528575897,
-0.050679575... | |
help you also remove numbers "close enough" to zero:
```
tolerance = 0.0001; % Choose a threshold for "close enough to zero"
x(abs(x) <= tolerance) = [];
``` | [
0.013786482624709606,
0.10224554687738419,
0.12409108877182007,
-0.1210385337471962,
0.2766146957874298,
-0.21755726635456085,
0.45568209886550903,
-0.2304009050130844,
0.10438120365142822,
-0.48283275961875916,
-0.1439017802476883,
0.5311814546585083,
-0.09666866064071655,
0.0407128520309... | |
My understanding is that if you are using a generic list (List) in C#, that it can support multiple concurrent readers but only one writer. And when you introduce a writer into the mix, you must also provide synchronization constructs to make the operations thread safe.
Is List.Contains considered a read operation? I... | [
0.5460375547409058,
0.04646285995841026,
0.050069354474544525,
0.0819392129778862,
-0.14332441985607147,
-0.2295423299074173,
0.17372705042362213,
-0.15414616465568542,
-0.3947887718677521,
-0.5384495258331299,
0.11331348866224289,
0.4338723421096802,
-0.6961597204208374,
0.136160612106323... | |
I find collections fall into two categories - ones which are created, initialized and then never changed again (thread-safe), and ones which are mutated over time (not thread-safe, lock for all access). | [
0.3034111261367798,
-0.1980314701795578,
0.03393955156207085,
0.42981523275375366,
0.28041326999664307,
0.04614681378006935,
-0.1608976274728775,
0.07760525494813919,
-0.528419554233551,
-0.3631095886230469,
-0.17878244817256927,
-0.18682976067066193,
-0.15307137370109558,
0.66684210300445... | |
What is the best way to search a large binary file for a certain substring in C#?
To provide some specifics, I'm trying to extract the DWARF information from an executable, so I only care about certain parts of the binary file (namely the sections starting with the strings `.debug_info`, `.debug_abbrev`, etc.)
I don'... | [
0.3651295602321625,
-0.011022842489182949,
-0.02724980004131794,
0.1726469248533249,
0.16031499207019806,
-0.12333028018474579,
0.34846705198287964,
0.31695669889450073,
-0.13058245182037354,
-0.39169546961784363,
-0.075032077729702,
0.5519658327102661,
-0.21970434486865997,
-0.02239046245... | |
read in the file chunk by chunk and scan for what you want to find.
You can speed up the search in two ways.
Firstly, use bufferred IO and transfer large chunks at a time - don't read byte by byte, read 64KB, 256KB or 1MB chunks.
Secondly, don't do a linear scan for the piece you want - check out the [Boyer-Moore](h... | [
0.17237982153892517,
0.18339571356773376,
0.03571334108710289,
0.057347655296325684,
-0.34734073281288147,
-0.03727351501584053,
0.11178913712501526,
-0.19908076524734497,
-0.6680470108985901,
-0.7400149703025818,
0.057813551276922226,
0.25379642844200134,
-0.18307583034038544,
0.412421375... | |
I have a case where I'm returning database results and displaying them on a page based on a search term. This part is working fine, but I want to hightlight these search terms by wrapping them in span tags. I started to write a function that I called on each result that used the str\_replace function, but then it dawne... | [
0.672623872756958,
0.09469582885503769,
0.48011642694473267,
0.006393271032720804,
-0.3573789894580841,
-0.22775982320308685,
0.45295870304107666,
-0.05040176957845688,
-0.4874410629272461,
-0.5969846844673157,
0.38917967677116394,
0.7303223609924316,
-0.20681796967983246,
-0.0901505723595... | |
have access to the raw data before it gets churned out in html? If so, then do your modifying on the raw data by adding the span tags in there.
If you are saying that your raw data may *already* have html in it, you may be able to use a regex to detect whether you are inside an html tag, and use preg\_replace instead ... | [
0.3713030517101288,
-0.22066740691661835,
0.435910165309906,
0.2533443570137024,
-0.12890729308128357,
-0.1530040055513382,
0.3225772976875305,
-0.3503793776035309,
-0.34882545471191406,
-0.5969091653823853,
-0.3255878686904907,
0.7850050926208496,
-0.06282519549131393,
-0.1675793677568435... | |
yank out all the HTML tags from your results, put in placeholders like
" [[[tag1]]] balha blah blah [[[tag2]]]" then do your replace on the remaining text, then substitute your tags back in | [
0.3383457362651825,
-0.1484200656414032,
0.22703148424625397,
0.14652666449546814,
-0.05322978273034096,
-0.07484380900859833,
0.37117841839790344,
-0.2173190712928772,
-0.2425815463066101,
-0.1416293978691101,
-0.4265427589416504,
0.17842046916484833,
-0.6042413711547852,
-0.2403860241174... | |
I've inherited an application with a glaring security hole.
It has session-based security, but file uploads (which are user specific) are not secured in any way and they are stored in the public file tree.
Filenames do not follow any convention as such, making them hard to guess, but the data is sensitive and thus I... | [
0.2665163576602936,
0.05727309733629227,
0.09925927966833115,
0.2511659264564514,
0.04035649076104164,
-0.2986581027507782,
0.286929190158844,
-0.1281028389930725,
-0.4520735442638397,
-0.4302107095718384,
0.06661909818649292,
0.2827247381210327,
0.056209251284599304,
0.20390039682388306,
... | |
or any good alternative solutions? Specific examples of .htaccess syntax greatly appreciated, as I'm struggling in this area.
Don't really understand why moving them isn't an option, since pushing requests for them to a handler means it no longer matters where they're stored. But you're the man on the scene.
.htaccess... | [
0.2825828790664673,
-0.1435794085264206,
0.46372848749160767,
0.12451428174972534,
0.27616915106773376,
-0.19197066128253937,
0.2055748999118805,
-0.24981817603111267,
-0.28684431314468384,
-0.7749509215354919,
-0.22216390073299408,
0.5605416893959045,
-0.15220560133457184,
0.0371288470923... | |
If I have a method that returns a `BOOL`, how do I cast that to an `NSString` so I can print it out in console?
For example, I tried doing this, which isn't working:
```
NSLog(@"Is Kind of NSString:", ([thing isKindOfClass:[NSString class]]) ? @"YES" : @"NO");
```
But I really want to actually turn the return valu... | [
-0.05987592786550522,
-0.010354173369705677,
0.1438612937927246,
0.022087527438998222,
-0.09496628493070602,
-0.2203628569841385,
0.17254923284053802,
-0.15389575064182281,
0.00003821782593149692,
-0.45741355419158936,
0.056585174053907394,
0.5196133255958557,
-0.37980446219444275,
0.21897... | |
of NSString: %@", ([thing isKindOfClass:[NSString class]]) ? @"YES" : @"NO");
``` | [
-0.281516969203949,
-0.015611166134476662,
0.2505698800086975,
-0.024319836869835854,
0.22073890268802643,
-0.10195422172546387,
0.31399253010749817,
-0.20449301600456238,
0.029666980728507042,
-0.39604800939559937,
-0.34746113419532776,
0.4208621382713318,
-0.14336960017681122,
0.28419908... | |
I have an XML file containing one (or more) key/value pairs. For each of these pairs I want to extract the value which is a two-byte hex value.
So the XML contains this snippet:
```
<key>LibID</key><val>A67A</val>
```
Which I can match using the following expression, with the ID in parenthesis.
```
Match match = R... | [
0.2308802455663681,
0.004032496362924576,
0.3116340935230255,
0.09948039799928665,
0.05109403282403946,
-0.14490889012813568,
0.27110594511032104,
-0.5618481040000916,
0.3195204734802246,
-0.44771093130111694,
-0.021007319912314415,
0.6143603324890137,
0.058984871953725815,
-0.165024071931... | |
program:
```
using System;
using System.Text.RegularExpressions;
class Program
{
static void Main()
{
Regex regex = new Regex("<key>LibID</key><val>([a-fA-F0-9]{4})</val>");
Match match = regex.Match("Before<key>LibID</key><val>A67A</val>After");
if (match.Success)
{
Console.WriteLine("Foun... | [
-0.5380123853683472,
-0.24879875779151917,
0.31933653354644775,
-0.28278204798698425,
0.26560309529304504,
0.15537826716899872,
0.22374208271503448,
-0.33858761191368103,
-0.005231163464486599,
-0.41946157813072205,
-0.5634356737136841,
0.7968645095825195,
-0.42750221490859985,
0.252949476... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.