text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
| |
| | | | | |
| | +-----------+ | | | |
| | |Screen :0.0| | | | |
| | +-----------+ | | | [
-0.33513522148132324,
0.1811617910861969,
0.43929076194763184,
-0.04767167195677757,
0.07964836806058884,
0.23234426975250244,
0.1565575897693634,
-0.15183556079864502,
0.29317253828048706,
-0.46491074562072754,
-0.46497106552124023,
0.35003915429115295,
-0.1814170479774475,
0.255157172679... | |
| |
| | +-----------+ | | | |
| | |Screen :0.1| | | | |
| | +-----------+ | | | |
| | +-----------+ | | +-----------+ | |
| | |Screen :0.2| | | |Screen :1.0| | | [
-0.4693337082862854,
0.22146174311637878,
0.3903545141220093,
0.0027880233246833086,
0.05441509932279587,
0.42561718821525574,
0.18797576427459717,
-0.39792001247406006,
0.1766267716884613,
-0.5280562043190002,
-0.482785701751709,
0.49357545375823975,
-0.21106477081775665,
0.09005039185285... | |
|
| | +-----------+ | | +-----------+ | |
| | +-----------+ | | +-----------+ | |
| | |Screen :0.3| | | |Screen :1.1| | |
| | +-----------+ | | +-----------+ | |
| | +-----------+ | | +-----------+ | |
| | | Keyboard | | | | Keyboard | | |
| | +-----------+ | | +-----------+ | |
| | +-----------... | [
-0.617215096950531,
0.3995620310306549,
0.424202561378479,
0.13087645173072815,
0.19889448583126068,
0.4544309377670288,
0.30633431673049927,
-0.5224921703338623,
0.09053630381822586,
-0.32978636026382446,
-0.4783271551132202,
0.6967529058456421,
-0.028757592663168907,
0.13481172919273376,... | |
| | Mouse | | |
| | +-----------+ | | +-----------+ | |
| +---------------+ +---------------+ |
| |
+----------------------------------------+
```
Here you have a single machine (`paxbox1.paxco.com`) with two display servers. The first has four screens and the second ... | [
0.0155496122315526,
0.08406230062246323,
0.41558608412742615,
0.1191827803850174,
0.1494697630405426,
0.5617514848709106,
0.02065054140985012,
0.10243336111307144,
-0.39578768610954285,
-1.0377473831176758,
0.044158875942230225,
0.4625534117221832,
-0.2653108537197113,
0.24709679186344147,... | |
and which input devices you want to use. | [
0.379678338766098,
0.15562443435192108,
0.21234382688999176,
0.29321372509002686,
0.42350876331329346,
0.10613761842250824,
-0.6670243740081787,
0.05159469321370125,
-0.10556691139936447,
-0.5602461695671082,
-0.11428490281105042,
0.7177392840385437,
0.035529691725969315,
-0.18404534459114... | |
I have developed a reverse-string program. I am wondering if there is a better way to do this, and if my code has any potential problems. I am looking to practice some advanced features of C.
```
char* reverse_string(char *str)
{
char temp;
size_t len = strlen(str) - 1;
size_t i;
size_t k = len;
... | [
-0.11377677321434021,
0.1267097443342209,
0.1638750433921814,
-0.669844925403595,
-0.19500891864299774,
0.4688628017902374,
0.622294545173645,
-0.2539827525615692,
0.08322395384311676,
-0.026666725054383278,
-0.11129694432020187,
0.5239700675010681,
-0.5941076874732971,
0.13439823687076569... | |
str[i] = temp;
k--;
/* As 2 characters are changing place for each cycle of the loop
only traverse half the array of characters */
if(k == (len / 2))
{
break;
}
}
}
```
If you | [
0.21907158195972443,
-0.11152825504541397,
0.13368602097034454,
-0.33037179708480835,
-0.004107051994651556,
0.1748439520597458,
0.7373024225234985,
-0.31480103731155396,
-0.24741408228874207,
-0.377726286649704,
-0.16002565622329712,
0.28786253929138184,
-0.2144409865140915,
0.10683175176... | |
want to practice advanced features of C, how about pointers?
We can toss in macros and xor-swap for fun too!
```
#include <string.h> // for strlen()
// reverse the given null-terminated string in place
void inplace_reverse(char * str)
{
if (str)
{
char * end = str + strlen(str) - 1;
// swap the values in... | [
0.021053558215498924,
0.07170282304286957,
0.09341622143983841,
-0.30722618103027344,
0.26077741384506226,
0.052091050893068314,
0.1233953908085823,
-0.26678404211997986,
-0.10084190964698792,
-0.2987143099308014,
-0.09666508436203003,
0.5743687152862549,
-0.43264538049697876,
-0.000766100... | |
^= a;\
a ^= b;\
} while (0)
// walk inwards from both ends of the string,
// swapping until we get to the middle
while (str < end)
{
XOR_SWAP(*str, *end);
str++;
end--;
}
# undef XOR_SWAP
}
}
```
A **pointer** (e.g. `char *`, read from right-to-left as a *pointer ... | [
-0.10257536172866821,
-0.08158157765865326,
0.36164167523384094,
-0.5403870344161987,
-0.09064684063196182,
0.1679893434047699,
-0.04073065519332886,
-0.2799534201622009,
0.04687971994280815,
-0.36419838666915894,
-0.44562336802482605,
0.15026210248470306,
-0.5377242565155029,
0.0560809262... | |
is used
to refer to location in memory of another value. In this case,
the location where a `char` is stored. We can *dereference*
pointers by prefixing them with an `*`, which gives us the value
stored at that location. So the value stored at `str` is `*str`.
We can do simple arithmetic with pointers. When we increme... | [
0.04696895182132721,
0.1942342221736908,
0.09363678842782974,
-0.06944581121206284,
-0.04928471893072128,
0.30862095952033997,
0.00421086186543107,
-0.021621400490403175,
-0.1091371476650238,
-0.3894879221916199,
-0.40181294083595276,
0.11944898217916489,
0.05272641032934189,
0.41603216528... | |
refer to the first unprocessed
`char` of the string (`str`) and another to refer to the last (`end`).
We swap their values (`*str` and `*end`), and move the pointers
inwards to the middle of the string. Once `str >= end`, either
they both point to the same `char`, which means our original string had an
odd length (and ... | [
0.08843999356031418,
0.12374759465456009,
0.15913012623786926,
-0.24053911864757538,
0.11269745975732803,
0.3522230088710785,
-0.13702242076396942,
-0.0001686707983026281,
-0.033484213054180145,
-0.5645462870597839,
-0.24427323043346405,
0.546363890171051,
-0.33682578802108765,
0.098539151... | |
copy of the values you give it. When you call
a macro, it simply does a textual substitution - so the arguments you give
it are used directly.
Since I only used the `XOR_SWAP` macro once, it was probably overkill to define it,
but it made more clear what I was doing. After the C preprocessor expands the macro,
the whi... | [
0.43125656247138977,
-0.13392308354377747,
0.35957279801368713,
-0.39379170536994934,
0.2701862156391144,
-0.07881271094083786,
-0.1601230800151825,
-0.2205650508403778,
-0.13942700624465942,
-0.23777301609516144,
-0.1666322648525238,
0.6456314325332642,
-0.49647000432014465,
0.13155780732... | |
end--;
}
```
Note that the macro arguments show up once for each time they're used in the
macro definition. This can be very useful - but can also break your code
if used incorrectly. For example, if I had compressed the increment/decrement
instructions and the macro call into a single line, like
```
XOR_... | [
0.09785293787717819,
0.09683026373386383,
0.4507286846637726,
-0.4594472050666809,
0.13800272345542908,
0.15132921934127808,
0.11886480450630188,
-0.4144728183746338,
-0.1211756095290184,
-0.4073663055896759,
-0.2999522387981415,
0.7570897340774536,
-0.47915542125701904,
-0.214696064591407... | |
subject, you should know what **xor** (`^`) means. It's a basic
arithmetic operation - like addition, subtraction, multiplication, division, except
it's not usually taught in elementary school. It combines two integers bit by bit
- like addition, but we don't care about the carry-overs. `1^1 = 0`, `1^0 = 1`,
`0^1 = 1`,... | [
0.364623099565506,
0.08815470337867737,
0.0332513153553009,
0.2642078697681427,
-0.1811545342206955,
0.08469705283641815,
-0.17852924764156342,
-0.17892926931381226,
-0.12784557044506073,
-0.26190605759620667,
0.007759047206491232,
0.5245471596717834,
-0.17255909740924835,
0.06632652133703... | |
`a` and `b` that are initially storing two values
`va` and `vb`.
```
// initially:
// a == va
// b == vb
a ^= b;
// now: a == va ^ vb
b ^= a;
// now: b == vb ^ (va ^ vb)
// == va ^ (vb ^ vb)
// == va ^ 0
// == va
a ^= b;
// now: a == (va ^ | [
-0.10437207669019699,
0.2248142957687378,
0.3825102150440216,
-0.44171732664108276,
-0.1276988983154297,
0.6263992786407471,
0.20017936825752258,
-0.3724879324436188,
-0.4314463138580322,
-0.5165132284164429,
-0.48945075273513794,
0.6516932249069214,
-0.24221956729888916,
0.049864031374454... | |
vb) ^ va
// == (va ^ va) ^ vb
// == 0 ^ vb
// == vb
```
So the values are swapped. This does have one bug - when `a` and `b` are the same variable:
```
// initially:
// a == va
a ^= a;
// now: a == va ^ va
// == 0
a ^= a;
// now: a == | [
-0.23800671100616455,
-0.1319294422864914,
0.47907814383506775,
-0.2683996558189392,
-0.0339738093316555,
0.4343727231025696,
0.2414689064025879,
-0.18539442121982574,
-0.4167017340660095,
-0.4985644221305847,
-0.2991562783718109,
0.5946987271308899,
-0.43968573212623596,
0.165346264839172... | |
0 ^ 0
// == 0
a ^= a;
// now: a == 0 ^ 0
// == 0
```
Since we `str < end`, this never happens in the above code, so we're okay.
While we're concerned about correctness we should check our edge cases. The `if (str)` line should make sure we weren't given a `NULL` pointer for string. What about t... | [
-0.18338480591773987,
0.09845836460590363,
0.43716055154800415,
-0.35421448945999146,
-0.09706051647663116,
-0.07282815128564835,
0.3900207579135895,
-0.09192413091659546,
-0.11325967311859131,
-0.3517380654811859,
-0.152870774269104,
0.4429223835468292,
-0.13702145218849182,
0.21281333267... | |
< end)` condition is never true, so we don't do anything. Which is correct.
There's a bunch of C to explore. Have fun with it!
**Update:** [mmw](https://stackoverflow.com/users/92202/mmw) brings up a good point, which is you do have to be slightly careful how you invoke this, as it does operate in-place.
```
char s... | [
0.051964253187179565,
0.30410224199295044,
0.5397551655769348,
-0.27522313594818115,
0.17617915570735931,
-0.48137906193733215,
0.6764875650405884,
-0.2890211045742035,
0.018904972821474075,
-0.3259526193141937,
-0.2707212567329407,
0.6731098890304565,
-0.3499898612499237,
0.12824235856533... | |
merely points to the string that is stored as part of your executable - which is normally memory that you are not allowed to edit by the OS. In a happier world, your compiler would know this, and cough an error when you tried to compile, telling you that `string_literal` needs to be of type `char const *` since you can... | [
0.24861867725849152,
0.27255842089653015,
0.20319394767284393,
0.08759112656116486,
-0.06847576051950455,
-0.15392135083675385,
0.3287445902824402,
0.2549610733985901,
-0.29569363594055176,
-0.39694303274154663,
-0.0952543392777443,
0.10540929436683655,
-0.2898196876049042,
0.1357762366533... | |
not necessarily portable, and it could be pretty ugly. However, I'm more than happy to throw responsibility for this to the function invoker. I've told them that this function does in place memory manipulation, it's their responsibility to give me an argument that allows that. | [
0.41723841428756714,
0.5178176164627075,
0.13715457916259766,
0.1625146120786667,
0.2121557891368866,
0.18771086633205414,
-0.02549894154071808,
0.22809873521327972,
-0.21643215417861938,
-0.6657559871673584,
0.062415774911642075,
0.5923665165901184,
0.11818811297416687,
0.1225851774215698... | |
I was looking around, and couldn't find the Python equivalent of browscap (that I've used in PHP to detect what browser a given user-agent string is.
I'm hoping I'm not going to have to write my own.. :P
Check this out, it should do what you want: [browscap.ini-parser](http://www.djangosnippets.org/snippets/267/).
Pl... | [
0.632563054561615,
0.19771377742290497,
0.2197750061750412,
-0.2924978733062744,
-0.28207066655158997,
-0.3444187641143799,
0.054411742836236954,
0.08969639241695404,
-0.5013070702552795,
-0.5044150948524475,
0.17165811359882355,
0.38046178221702576,
-0.2507324814796448,
-0.130855366587638... | |
I have the following DBIx::Class code :
```
my $where = 'me.loginid = ? AND me.code = ?';
my @bind = ( $loginID, $code );
my $tip_signals = $bom_schema->resultset('Table1')->search_literal(
$where, @bind,
{
join => 'table2',
group_by => [ 'me.id' ],
'+select' => [ {'count' => '*'}, 'ta... | [
0.2137158066034317,
0.2406860888004303,
0.7986969351768494,
-0.17235521972179413,
-0.047927290201187134,
-0.08823145925998688,
0.28726235032081604,
-0.6427976489067078,
0.22439391911029816,
-0.44738566875457764,
0.06188075989484787,
0.36990872025489807,
-0.38254669308662415,
0.175994277000... | |
the above DBIx::Class code:
```
SELECT me.id, me.loginid, me.tipster_date, me.code, me.short_code_without_payout, COUNT( * ), table2.id
FROM table1 me LEFT JOIN table2 table2 ON table2.tip_signals_id = me.id
WHERE (
me.loginid = 'yccheok' AND me.code = 'ALIBABA_CODE'
)
GROUP BY me.id
```
Now, I wish to get r... | [
-0.06372189521789551,
0.3763953745365143,
0.551841676235199,
0.0034904431086033583,
-0.26469627022743225,
0.17477256059646606,
0.13677360117435455,
-0.5381224155426025,
-0.1423262059688568,
-0.5956568121910095,
-0.025183027610182762,
0.21955470740795135,
-0.07220129668712616,
0.32522362470... | |
as follows:
```
my $where = 'me.loginid = ? AND me.code = ? AND table2.tip_signals_id = me.id AND referrers.affiliates_id = affiliates.id AND affiliates.loginid = me.loginid AND referrers.loginid = table2.loginid';
my @bind = ( $loginID, $code );
my $tip_signals = $bom_schema->resultset('Table1')->search_literal(
... | [
0.26772844791412354,
0.15819363296031952,
0.9441062211990356,
0.054057661443948746,
-0.029071921482682228,
-0.14036181569099426,
0.12533938884735107,
-0.668500542640686,
-0.328945130109787,
-0.33294978737831116,
0.09530974924564362,
0.17097416520118713,
-0.2856270670890808,
0.1795261353254... | |
'table2.id' ],
'+as' => [ 'Count', 'ID' ],
});
```
I get exception "Not an ARRAY reference" while I try to perform *next* on *resultset*. Please note that, I was not allowed to use *join* in DBIx::Class, as *referrers* and *affiliates* tables, has no relationship with \*table\*\*\* tables.
How can... | [
-0.025255920365452766,
0.0015217333566397429,
0.240644633769989,
-0.09793371707201004,
-0.40033072233200073,
0.0556497722864151,
0.3266007602214813,
-0.41005468368530273,
-0.22108608484268188,
-0.8404995203018188,
0.06650403887033463,
0.3589359223842621,
-0.4296072721481323,
0.153289079666... | |
line of DBIx :
```
$bom_schema->resultset('View_Of_Table1_And_Table2_And_Referrers_And_Affiliates');
``` | [
0.007482821587473154,
-0.019133783876895905,
0.623386800289154,
-0.04497124254703522,
-0.3189159035682678,
0.0845097005367279,
0.13672269880771637,
-0.038663964718580246,
0.22347760200500488,
-0.4774883985519409,
-0.4861431419849396,
0.15420518815517426,
-0.3518996238708496,
-0.00984297413... | |
What is the exact path to %allusersprofile% folder in Windows Vista? On some systems, I have seen the folder as 'c:\Users\All Users', on some it is mapped to 'C:\ProgramData', while on others it has been mapped to 'C:\Users\Public'.
If you can provide link to microsoft documentation reference would be highly helpful ... | [
0.02548348344862461,
0.038630276918411255,
0.4873449504375458,
0.024990150704979897,
0.14357268810272217,
-0.09339427202939987,
0.22630707919597626,
0.3078104555606842,
-0.3884480595588684,
-0.8744727373123169,
-0.21913757920265198,
0.5937488079071045,
-0.4298906922340393,
0.18463668227195... | |
Vista?
[This document](http://msdn.microsoft.com/en-us/library/bb756896.aspx) on MSDN shows the new methods in Vista to locate known folders, including the one you ask about specifically: `"C:\Documents and Settings"`.
I gather this can be changed simply by changing the registry (and moving the current directory). | [
0.24284815788269043,
0.22595539689064026,
0.282958060503006,
0.04776354134082794,
0.4754074811935425,
-0.2151748239994049,
0.04236683249473572,
0.011514677666127682,
-0.28011655807495117,
-0.6733018755912781,
-0.2652217447757721,
0.7752156853675842,
-0.0920318216085434,
-0.0424381159245967... | |
I'm working on an Open Office document with a partner and we are using subversion to collaborate on it. However, we are saving the document as a .odt file and subversion reads this as a binary file type. Therefore it has me worrying that when we go to merge the files and the diff pops up that we will not be able to ade... | [
0.4795461595058441,
0.03525586426258087,
-0.1254180669784546,
0.27841177582740784,
-0.07948552072048187,
-0.1266937255859375,
0.03342792019248009,
-0.0691344290971756,
0.018115347251296043,
-0.7875604033470154,
-0.06383253633975983,
0.35456541180610657,
-0.21103915572166443,
0.134902209043... | |
formatting you would expect and want but does save as a binary file and therefore can be easily merged?"
Or am I using the wrong method to do this? (Which is more than likely)
As much as you might hate it, LaTeX provides you a means to create documents, but maintain them in subversion as text, which is easily merged.
... | [
0.6066296100616455,
-0.062467437237501144,
0.22899971902370453,
0.40249136090278625,
-0.20195366442203522,
-0.6284814476966858,
0.007055096328258514,
0.16737845540046692,
-0.36374732851982117,
-0.5267487168312073,
-0.12440115213394165,
0.7018639445304871,
-0.5628343820571899,
0.14229840040... | |
I need to write a Ruby method that takes a word, runs it through OS 10.5’s Dictionary.app’s thesaurus function, and returns alternative words.
If the Ruby method ends up calling the command-line, that’s fine; I just need to be able to do it programmatically from Ruby.
After looking through Ruby OSA, I realize that th... | [
0.25202134251594543,
0.22223570942878723,
0.22816431522369385,
-0.06258580088615417,
0.08085394650697708,
0.2659826874732971,
0.6635102033615112,
-0.0034820865839719772,
0.15921063721179962,
-0.7210432291030884,
-0.0928710326552391,
0.7541896104812622,
-0.3274475038051605,
0.12819674611091... | |
the shell for some reason (it kept saying that it couldn’t find the word, but when looking manually it worked).
Unfortunately the only programmatic interface to this (Dictionary Services) doesn't support setting a dictionary.
However, it does consult the dictionary preferences to use the first dictionary specified, so... | [
0.2466709017753601,
0.06073998287320137,
0.12829454243183136,
0.22181901335716248,
0.14307716488838196,
-0.25424981117248535,
0.21633361279964447,
0.08660916239023209,
0.06419247388839722,
-0.5422657132148743,
-0.08865877240896225,
0.6473856568336487,
-0.2762821912765503,
0.170941233634948... | |
= [[NSAutoreleasePool alloc] init];
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
NSMutableDictionary *dictionaryPrefs =
[[userDefaults persistentDomainForName:@"com.apple.DictionaryServices"] mutableCopy];
NSArray *activeDictionaries = [dictionaryPrefs objectForKey:@"DCSActiveDiction... | [
-0.3195550739765167,
-0.1688195765018463,
0.43248018622398376,
-0.04681074246764183,
0.05606705695390701,
0.18821288645267487,
0.7162933945655823,
-0.2846367657184601,
-0.5034691095352173,
-0.4833131730556488,
-0.6045231819152832,
0.5725005865097046,
-0.09396343678236008,
0.225499331951141... | |
CFRangeMake(0, [word length])) UTF8String]);
[dictionaryPrefs setObject:activeDictionaries forKey: @"DCSActiveDictionaries"];
[userDefaults setPersistentDomain:dictionaryPrefs forName:@"com.apple.DictionaryServices"];
}
```
And use it as:
```
% ./thesaurus string
noun
1 twine, cord, yarn, thread, strand.
2 cha... | [
-0.048092734068632126,
0.05982440710067749,
0.5741702914237976,
0.08107419312000275,
-0.05329188331961632,
0.562568724155426,
0.2245602160692215,
-0.09092144668102264,
-0.25112617015838623,
-0.26392000913619995,
-0.3217386305332184,
0.19688333570957184,
-0.2624416649341583,
0.4092565774917... | |
`DataContractSerializer` requires classes and members to be marked with the `DataContract` and `DataMember` attributes. However, in my case the classes are auto-generated with the EFPocoAdapater framework and these attributes are not present.
How can I force serialization of all members using the DataContractSerialize... | [
0.006527711171656847,
-0.14014241099357605,
0.4889114797115326,
-0.20303885638713837,
-0.13563653826713562,
0.038824789226055145,
-0.05770772695541382,
-0.1791977882385254,
-0.1872313767671585,
-0.4820442795753479,
0.16768169403076172,
0.375409871339798,
-0.573178231716156,
0.1658298224210... | |
DataContractSerializer is "opt-in" - you have to explicitly tell it (by means of the attributes) which fields and/or properties to serialize.
**UPDATE:** As several folks have pointed out, with .NET 3.5 SP1, Microsoft loosened those rules up a bit - any public read/write property will be serialized automatically by th... | [
0.041140273213386536,
-0.435435950756073,
0.4284364879131317,
-0.025486072525382042,
-0.07472966611385345,
-0.4653361141681671,
0.0229756161570549,
0.1204107254743576,
-0.0462111197412014,
-0.6351723074913025,
0.0027290955185890198,
0.5096405148506165,
-0.5241407752037048,
-0.0069168722257... | |
read/write property
* doesn't allow you to specify a defined chosen ordering of the parameters - it will just use them in the order they appear in the class
* now requires you to have a parameterless constructor in your class again for deserialization
I still think these thing ought to be explicit and clear, making th... | [
0.29995182156562805,
0.1947517991065979,
-0.015180809423327446,
0.06749959290027618,
0.03551629185676575,
-0.2543054521083832,
0.2658974230289459,
0.1994885504245758,
-0.22491005063056946,
-0.7094800472259521,
0.055784113705158234,
0.6143877506256104,
-0.13248085975646973,
0.27528586983680... | |
If you have 1,000,0000 source files, you suspect they are all the same, and you want to compare them what is the current fasted method to compare those files? Assume they are Java files and platform where the comparison is done is not important. cksum is making me cry. When I mean identical I mean ALL identical.
**Upd... | [
0.6240294575691223,
0.2872519791126251,
0.32474035024642944,
0.3599588871002197,
-0.20662452280521393,
0.02193162776529789,
0.3047901391983032,
0.14350257813930511,
-0.3927741050720215,
-0.5116718411445618,
0.20335863530635834,
0.3644384741783142,
0.00462921941652894,
0.2554258406162262,
... | |
versions of the output are the same.
**Update:** read the number of blocks rather than bytes? Immediatly throw out those? Is that faster than finding the number of bytes?
**Update:** Is this ANY different than the fastest way to compare two files?
I'd opt for something like the approach taken by the `cmp` program: o... | [
0.2520550787448883,
-0.13310638070106506,
0.4359626770019531,
0.11921824514865875,
-0.285430371761322,
0.10396324098110199,
0.043927568942308426,
0.013629152439534664,
-0.19201911985874176,
-0.8868771195411682,
-0.026747310534119606,
0.36994054913520813,
-0.22523844242095947,
0.06209376081... | |
of file 1, close file 2 and open file 3 in its place, and repeat until you've checked all files. I don't think there's any way to avoid reading all bytes of all files if they are in fact all identical, but I think this approach is (or is close to) the fastest way to detect any difference that may exist.
**OP Modificat... | [
0.05491608381271362,
0.1857740432024002,
0.40803709626197815,
-0.057758089154958725,
0.4118417501449585,
-0.10007879883050919,
0.0360211580991745,
-0.18359912931919098,
-0.6750250458717346,
-0.5247857570648193,
-0.2653310000896454,
0.5674403309822083,
-0.1542636752128601,
-0.06960039585828... | |
on thrashing trying to read two files at once." | [
0.7512730360031128,
-0.1805342137813568,
0.013252400793135166,
0.41405174136161804,
0.13673672080039978,
0.014450857415795326,
-0.34142541885375977,
-0.10019197314977646,
-0.4931003749370575,
-0.16562776267528534,
0.2523772716522217,
0.5450333952903748,
-0.18861383199691772,
0.221222653985... | |
### Duplicate:
> * [Why do I see a double variable initialized to some value like 21.4 as 21.399999618530273?](https://stackoverflow.com/questions/177506/why-do-i-see-a-double-variable-initialized-to-some-value-like-21-4-as-21-39999961)
> * [Is JavaScript’s math broken?](https://stackoverflow.com/questions/588004/is-j... | [
-0.03324820101261139,
0.31693005561828613,
0.1573438048362732,
0.21076712012290955,
-0.15912312269210815,
0.07274150848388672,
0.5023751258850098,
-0.3472888171672821,
-0.5464432835578918,
-0.3828021287918091,
-0.20172004401683807,
0.25526678562164307,
-0.37427136301994324,
-0.008642605505... | |
I know for a fact that 0.1 can't be represented exactly, so it makes sense that 0.6 can't as well. | [
0.20757286250591278,
0.3093232214450836,
0.023717328906059265,
0.018495136871933937,
-0.05416945368051529,
-0.0993412658572197,
0.1319570094347,
-0.17144881188869476,
0.18395429849624634,
-0.273832231760025,
0.008296510204672813,
0.13742639124393463,
0.04272034391760826,
0.5490255355834961... | |
I've encountered this apparently common problem and have been unable to resolve it.
**If I call my WCF web service with a relatively small number of items in an array parameter (I've tested up to 50), everything is fine.**
**However if I call the web service with 500 items, I get the Bad Request error.**
Interesting... | [
0.5333752036094666,
-0.20087821781635284,
0.5564526319503784,
0.22384411096572876,
-0.09240227192640305,
-0.2536976635456085,
0.5342038869857788,
-0.32445964217185974,
-0.6001448035240173,
-0.6796668767929077,
0.07654634863138199,
0.34321698546409607,
-0.20173770189285278,
0.17150543630123... | |
an error: (400) Bad Request.
**The `system.serviceModel` section of my client config file is:**
```xml
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IMyService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout... | [
-0.3024483025074005,
-0.052330996841192245,
0.627526581287384,
-0.017550252377986908,
0.16969366371631622,
-0.007516124285757542,
0.793851375579834,
-0.1826045960187912,
-0.19450150430202484,
-0.71327143907547,
-0.2461072951555252,
0.6513649225234985,
-0.18941177427768707,
0.26726114749908... | |
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="2147483647"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession o... | [
-0.5823309421539307,
-0.1959131360054016,
0.4964299201965332,
0.33859995007514954,
0.3128075897693634,
-0.0760432556271553,
0.9624022841453552,
0.014257899485528469,
-0.1347925364971161,
-0.4581852853298187,
-0.3130308985710144,
0.776131808757782,
-0.30620241165161133,
-0.09149809926748276... | |
enabled="false" />
<security mode="None">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" | [
-0.422686368227005,
-0.37406033277511597,
0.6964429616928101,
0.051313940435647964,
0.2637372612953186,
0.25625085830688477,
0.40356549620628357,
-0.23633454740047455,
-0.268272340297699,
-0.9991204738616943,
-0.36812469363212585,
0.5911779403686523,
-0.15207485854625702,
0.003114601364359... | |
establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://serviceserver/MyService.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IMyService"
contract="SmsSendingS... | [
-0.17221571505069733,
-0.047287702560424805,
0.645744800567627,
-0.010084274224936962,
0.20067062973976135,
-0.6605695486068726,
0.5694134831428528,
-0.4262755215167999,
-0.10473527759313583,
-0.2807680368423462,
-0.3498942255973816,
0.30819153785705566,
-0.08444474637508392,
0.01647905632... | |
</client>
</system.serviceModel>
```
**On the server side, my web.config file has the following `system.serviceModel` section:**
```xml
<system.serviceModel>
<services>
<service name="MyService.MyService" behaviorConfiguration="MyService.MyServiceBehaviour" >
<endpoint address="" binding="wsH... | [
-0.5499578714370728,
0.11654911190271378,
0.6962218880653381,
-0.1688051074743271,
-0.0643346980214119,
0.20839674770832062,
0.31932759284973145,
-0.34451889991760254,
-0.32633063197135925,
-0.92179274559021,
-0.397258460521698,
0.415906697511673,
-0.0508740171790123,
0.28238487243652344,
... | |
<binding name="MyService.MyServiceBinding">
<security mode="None"></security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="MyService.MyServiceBehaviour">
<!-- To avoid disclosing metadata information, set the v... | [
-0.051901720464229584,
0.17363977432250977,
0.3496306538581848,
0.012286147102713585,
-0.0887894555926323,
-0.5427637100219727,
0.5018042922019958,
-0.3895632326602936,
-0.25668594241142273,
-0.41480791568756104,
-0.3713003993034363,
0.5014024972915649,
-0.30879005789756775,
0.314004182815... | |
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
</beha... | [
-0.013531751930713654,
-0.10044073313474655,
0.3132699728012085,
-0.23853157460689545,
-0.17416583001613617,
0.2066299170255661,
0.6773419976234436,
-0.461007297039032,
-0.30547839403152466,
-0.18678849935531616,
-0.24457824230194092,
0.2800368368625641,
-0.14353139698505402,
0.20775091648... | |
[answers](http://www.stonejunction.com/post/2008/12/01/WCF-Call-gives-400-Bad-Request-response.aspx) to [this question](http://www.experts-exchange.com/Programming/Languages/.NET/Web_Services/Q_24002313.html) with [no success](http://joewirtley.blogspot.com/2007/08/maximum-string-content-length-and.html).
Can anyone h... | [
-0.1509094536304474,
0.06033266335725784,
0.5385969877243042,
0.24879957735538483,
-0.07540303468704224,
0.04439110681414604,
0.3177855908870697,
-0.36406904458999634,
-0.3182905912399292,
-0.3873482942581177,
-0.10620090365409851,
0.5635567307472229,
-0.08210507035255432,
0.18658402562141... | |
tips for troubleshooting problems connecting to WCF services:
* Enable tracing on the server as described in [this MSDN article](http://msdn.microsoft.com/en-us/library/ms733025.aspx).
* Use an HTTP debugging tool such as [Fiddler](http://www.fiddler2.com/fiddler2/) on the client to inspect the HTTP traffic. | [
0.16242755949497223,
0.06030101701617241,
0.2605854272842407,
0.15186165273189545,
0.06557796895503998,
-0.20846784114837646,
0.5781859159469604,
-0.39192822575569153,
-0.3398045599460602,
-0.27291834354400635,
-0.11723380535840988,
0.6076310873031616,
-0.006421329919248819,
-0.38968735933... | |
Coming from ASP.NET into WindowsForms app development I was expecting to see the similar controls to work with. To my surprise, I didn't see any security controls (login, user management, etc.)
Am I missing something, or I'd have to implement my own security for the application (role based security, user management, e... | [
-0.09692854434251785,
-0.2008441835641861,
0.27642565965652466,
0.20929265022277832,
-0.048419445753097534,
0.13324056565761566,
-0.08281358331441879,
0.024156758561730385,
-0.33266475796699524,
-0.5576372742652893,
0.09489592909812927,
0.5663012862205505,
-0.22528882324695587,
0.074624374... | |
i found [this article](http://forums.asp.net/p/953477/1168282.aspx#1168282), I'll give that a try, any other suggestions are appreciated.
Most times a Windows Forms application is used in an internal network with Windows Domain accounts.
In this case you should use "Integrated security" to connect to the database an... | [
0.28794488310813904,
0.031749699264764786,
0.8507195115089417,
0.045746978372335434,
0.3072897791862488,
-0.6627167463302612,
0.4980214536190033,
-0.3669350743293762,
0.05995955690741539,
-0.7400416731834412,
-0.2657257616519928,
0.7063133716583252,
-0.2357322871685028,
0.03677902743220329... | |
authenticate the user/pass via your own method (db call)
1. use a generic connection string
(not recommended)
2. set the user/pass of the connection string to your
authenticated user/pass
AND set the Thread.CurrentPrincipal to your own Principal object | [
0.2628770172595978,
-0.1455754041671753,
0.5934513807296753,
0.2187221795320511,
-0.00866240356117487,
-0.24828381836414337,
0.3543497920036316,
-0.19987156987190247,
0.054504815489053726,
-0.22207535803318024,
-0.07453661412000656,
0.09948191046714783,
-0.3689733147621155,
0.5158456563949... | |
I am opening a window as a modal.
window.showModalDialog("<http://www.google.com>","","dialogWidth:500px;dialogHeight:500px")
as I set height, what are other options available?
Like option buttons, menus etc. where I can find tutorials?
**EDIT**
*It works in Mozilla firefox, but people are saying it doesn't!*
My ... | [
0.3060196340084076,
0.33495762944221497,
0.7836838960647583,
-0.42405790090560913,
0.12192162871360779,
0.08991554379463196,
0.43303167819976807,
-0.26316285133361816,
0.037775132805109024,
-0.9578100442886353,
-0.3832952678203583,
0.37660256028175354,
-0.46901634335517883,
0.0505294278264... | |
in corme and opera
[Are there any security risks associated with me using OpenID as the authentication method on my site?](https://stackoverflow.com/questions/182258/are-there-any-security-risks-associated-with-me-using-openid-as-the-authenticatio) | [
-0.08243857324123383,
-0.056026212871074677,
0.032648660242557526,
0.03708713874220848,
-0.03964610770344734,
-0.3792206346988678,
0.0474325492978096,
-0.08426452428102493,
-0.2712787389755249,
-0.2615010142326355,
-0.38829201459884644,
0.35729658603668213,
-0.30009064078330994,
-0.1431199... | |
Im using latest SVN 2.2 build compiled with VS 2008.
When I build my VB classes using Sonic.exe any columns of type **Date** (Not **Datetime**) are generated as "System.String".
Has anybody else found this problem and have a solution or is this a problem with Subsonic?
Submit an issue here: <http://code.google.com/p/su... | [
0.2929573655128479,
0.058386072516441345,
0.4896322190761566,
0.014735820703208447,
-0.18577434122562408,
-0.15937264263629913,
0.2537587583065033,
-0.3723726272583008,
-0.21737709641456604,
-0.4212779104709625,
-0.052145734429359436,
0.4156002998352051,
-0.41241827607154846,
-0.0049903970... | |
Link [this](https://stackoverflow.com/questions/111345/getting-image-dimensions-without-reading-the-entire-file) post I want to be able to read an image files height and width without reading in the whole file into memory.
In the post Frank Krueger mentions there is a way of doing this with some WPF Imaging classes. A... | [
0.2340969741344452,
0.2719171643257141,
0.8740864992141724,
0.10142093896865845,
-0.11395328491926193,
-0.14507897198200226,
0.16621166467666626,
-0.3665180802345276,
-0.3542461693286896,
-0.6681084632873535,
-0.11284025758504868,
0.27593088150024414,
-0.26141178607940674,
0.49338898062705... | |
So, as I learned from [Michael Burr](https://stackoverflow.com/users/12711/michael-burr)'s comments to [this answer](https://stackoverflow.com/questions/784417/c-reverse-a-string/784455#784455), the C standard doesn't support integer subtraction from pointers past the first element in an array (which I suppose includes... | [
-0.1848258376121521,
0.37877410650253296,
0.16191019117832184,
-0.42683732509613037,
0.08478353917598724,
0.12208987772464752,
0.22692906856536865,
-0.4335804283618927,
-0.336039274930954,
0.033338189125061035,
-0.030797844752669334,
0.36761999130249023,
-0.2921179533004761,
0.027648383751... | |
given:
```
int a[1];
int * b = a - 3;
int * c = b + 3;
```
That `c == a`.
So while I believe I've done that sort of thing before, and not gotten bitten, it must have been due to the kindness of the various compilers I've worked with - that they've gone above and beyond what the standards require to make pointer ... | [
0.28689539432525635,
0.4202497899532318,
-0.16812320053577423,
-0.20306149125099182,
-0.1866178810596466,
0.125081405043602,
0.6172615885734558,
-0.06290749460458755,
-0.22721897065639496,
-0.4985436201095581,
0.19009368121623993,
0.5831976532936096,
-0.30641329288482666,
-0.22656567394733... | |
a defacto standard?
This is not "implementation defined" by the Standard, this is "undefined" by the Standard. Which means that you can't count on a compiler supporting it, you can't say, "well, this code is safe on compiler X". By invoking undefined behavior, your program is undefined.
The practical answer isn't "how... | [
0.7383317947387695,
-0.03294067457318306,
0.09132947027683258,
0.10241368412971497,
-0.1861928254365921,
-0.4985332190990448,
0.7370282411575317,
-0.4897075593471527,
-0.15686874091625214,
-0.038772620260715485,
-0.012585006654262543,
0.6591205596923828,
-0.6602128148078918,
-0.07357294857... | |
is there a gem or plugin that will populate a database with test data?
As ever, Ryan Bates has a [Railscast](http://railscasts.com/episodes/126-populating-a-database) on this very subject that covers using the [Faker](http://faker.rubyforge.org/) and [Populator](http://populator.rubyforge.org/) gems. | [
0.581155002117157,
0.009422666393220425,
-0.2869916558265686,
0.4381164014339447,
-0.05904237553477287,
-0.16298601031303406,
0.3807159662246704,
0.2060125321149826,
-0.3418029248714447,
-0.06590021401643753,
-0.09518302232027054,
0.34205344319343567,
0.13928258419036865,
0.032030355185270... | |
I'm looking for a library or toolkit (so I don't have to write it) that will allow me to do common things like the following in Linux:
* Get the uid for a username.
* Get user / group membership information.
* Get information about free space on disk drives.
* Any other potentially useful API calls that are not normal... | [
0.683661937713623,
0.19864705204963684,
-0.1269901692867279,
0.0006447043851949275,
0.10576790571212769,
-0.3323144018650055,
-0.05238794907927513,
0.35222548246383667,
-0.4206140339374542,
-0.6585367918014526,
0.16440828144550323,
0.4847404956817627,
-0.00912453792989254,
-0.0658197551965... | |
I'm building a webapp using spring MVC and am curious as to whether there is any clean way to make SEO urls.
For example, instead of <http://mysite.com/articles/articleId> and the such, have:
<http://mysite.com/articles/my-article-subject>
This might be of interest to you:
<http://tuckey.org/urlrewrite/>
If you are... | [
0.5156453847885132,
0.1304081231355667,
0.39714619517326355,
-0.013577381148934364,
-0.4968442916870117,
-0.3792083263397217,
0.17043210566043854,
-0.1363990604877472,
-0.2290044128894806,
-0.4638294577598572,
0.11978121101856232,
0.28867167234420776,
-0.05869360640645027,
0.10643567889928... | |
I am thinking of developing a Silverlight application and want to make use of Windows Azure for the data storage (as well as scalability etc). But I am not sure how to get data to and from Azure using Silverlight. What technologies should I be investigating? What is the recommended approach for this scenario?
Should I... | [
0.644665002822876,
0.054055891931056976,
0.4020198881626129,
0.42046600580215454,
-0.059388477355241776,
-0.3901560604572296,
-0.09693536907434464,
-0.10274521261453629,
-0.23933055996894836,
-0.5930625200271606,
0.14222855865955353,
0.5536375045776367,
0.08453080803155899,
0.2310680896043... | |
that are really standards, i.e., products that don't comply with them just don't work. File specifications fall into that category. But then you also have "standards" that are more like guidelines: they may defined as standards with point-by-point definitions, but routinely implemented only partially or with significan... | [
0.8442519307136536,
0.25171902775764465,
-0.02774767577648163,
0.4039705991744995,
0.03211594745516777,
-0.2723514437675476,
0.13993553817272186,
-0.09987480193376541,
-0.23353137075901031,
-0.6219919919967651,
-0.3593795895576477,
0.2785058617591858,
-0.10167188197374344,
-0.1098273396492... | |
there were no SQL standard and each database vendor used its own completely proprietary querying language. There would be much more vendor lock-in, and developers would have a much harder time working with more than one product.
So, no, ANSI SQL doesn't serve the same purpose as ANSI standards do in other industries. ... | [
0.2922784388065338,
0.09425406157970428,
0.053567077964544296,
0.26101917028427124,
-0.25597456097602844,
-0.2466980367898941,
-0.10521817207336426,
0.05745655670762062,
-0.15232591331005096,
-0.12815739214420319,
0.18356440961360931,
0.2786473035812378,
-0.41474300622940063,
0.23162238299... | |
I have installed Openoffice.org3 on our server and it's running in headless
mode. We use it with jodconverter to convert word and excell files.
It used to work fine, but one day it just stopped working and I really
don't understand why.
When I run /usr/local/bin/java -jar
jodconverter-2.2.2/lib/jodconverter-cli-2.2... | [
-0.036644916981458664,
0.39782044291496277,
0.5376291871070862,
-0.32312729954719543,
-0.18308596312999725,
-0.10836368054151535,
0.5004189610481262,
0.06299979239702225,
-0.06569883972406387,
-0.8942313194274902,
0.020258452743291855,
0.5446986556053162,
-0.4073966443538666,
0.47152587771... | |
and 3.0 installed and neither
of the work now. (They both have the same problem) so it's not
directly a problem with the openoffice install.
I even tried to create a new user on the server, and run openoffice as him
but that don't work either.
So does anyone have any idear about what might be wrong, or how I
do get o... | [
0.0866413563489914,
0.25720611214637756,
0.2602382302284241,
-0.07689271122217178,
-0.0991240069270134,
-0.2705249488353729,
0.6011444330215454,
0.17354810237884521,
-0.1977790743112564,
-0.8740488290786743,
-0.10664934664964676,
0.706804633140564,
-0.3966071903705597,
0.4121023714542389,
... | |
understand
why it stopped working but sometimes you just have to accept that a
reinstall is a solution. | [
0.21069692075252533,
-0.2329472005367279,
0.22207124531269073,
0.2348593771457672,
0.37834882736206055,
0.15915516018867493,
0.42131516337394714,
-0.1009298637509346,
0.06547564268112183,
-0.2163224071264267,
-0.06469924002885818,
0.22391530871391296,
-0.013419555500149727,
0.1366008371114... | |
I'm trying to modify a C# WinForms application that uses multiple forms. At startup, a login window will be shown. If the user logs in with a correct user name and password combo a form with three different tabs will be shown as a sort of administrators view. If no password or user name is supplied, a much simplified G... | [
0.5924375057220459,
-0.232713982462883,
0.5580378770828247,
-0.08508127182722092,
0.057905808091163635,
0.19179701805114746,
0.1764698624610901,
-0.07292071729898453,
0.14084000885486603,
-0.9989010095596313,
-0.035010017454624176,
0.5331501960754395,
-0.3448525369167328,
0.050640888512134... | |
can input information that will be saved to a database. Once the DB-operation has been executed successfully, the first form with the two buttons will be displayed again.
Button 2: A form is shown where the user can input a code that will be written to DB. Once the DB operation is concluded, the user will automaticall... | [
0.10970339179039001,
-0.016990792006254196,
0.6304422616958618,
0.07031010836362839,
-0.22008748352527618,
-0.06895601749420166,
0.2117106169462204,
-0.3279273808002472,
0.10775720328092575,
-0.8150573372840881,
-0.3451346755027771,
0.5208379030227661,
-0.15126438438892365,
-0.100785993039... | |
all the forms involved. Where should I instantiate the first (login) form? Once the login validation is done there are two possible ways to go. Either show the tabbed admin form (if user name and password is correct) or the simplified user form with two large buttons. It should also be possible to logout from the admin... | [
0.22874882817268372,
0.10842312127351761,
0.6831518411636353,
0.29331448674201965,
-0.0007086744881235063,
-0.056744471192359924,
-0.045463014394044876,
-0.07826747000217438,
-0.24394789338111877,
-0.8640629649162292,
-0.0022445081267505884,
0.5563669204711914,
-0.19402122497558594,
-0.194... | |
might be an issue in the future so a solution that takes this into account would be excellent.
I'm thinking that what is needed is really a class that handles the displaying and disposing of the forms right from the start, but I'm not quite sure where I should put the instantiation of this handling class.
Form managem... | [
0.5283478498458862,
-0.007706931792199612,
0.30857527256011963,
0.31411996483802795,
0.033580947667360306,
-0.26401036977767944,
0.14349080622196198,
-0.10314875096082687,
-0.2295183688402176,
-0.7423136830329895,
0.059102896600961685,
0.3702232241630554,
-0.2046712189912796,
0.04485310614... | |
them onto the same form, and show and hide the controls as appropriate (this can also be achieved by loading the forms, stripping form borders and such and setting their parent to a panel or something similar; this will almost make them behave like user controls, but only almost)
* There are many other methods, of cour... | [
0.5202222466468811,
-0.06688027083873749,
0.6247703433036804,
0.20254522562026978,
0.031387656927108765,
-0.32999521493911743,
0.16656437516212463,
-0.270675390958786,
-0.02995368465781212,
-0.8358238339424133,
-0.29572272300720215,
0.6750232577323914,
-0.189001202583313,
-0.13525253534317... | |
Having nicked some code from msdn I'm miffed that it doesn't work exactly as I want straight away. I'm trying to use google translate to, well, translate some stuff for me on the fly. The problem is that t5he responseFromServer doesn't contain the translated text, nor does the source when I look at it using a browser a... | [
0.34513071179389954,
0.2953418493270874,
0.44652900099754333,
0.20564939081668854,
-0.4601823389530182,
-0.1489095538854599,
0.5356142520904541,
0.10634195059537888,
0.11488736420869827,
-0.75373774766922,
-0.4756474196910858,
0.41573265194892883,
-0.1978466957807541,
0.26147735118865967,
... | |
WebResponse response = request.GetResponse();
// Display the status.
Console.WriteLine(((HttpWebResponse)response).StatusDescription);
// Get the stream containing content returned by the server.
Stream dataStream = response.GetResponseStream();
// Open the stream using a StreamR... | [
-0.08655481040477753,
-0.3369462490081787,
0.8062641620635986,
0.1782931536436081,
-0.09889301657676697,
-0.012303799390792847,
0.38680195808410645,
0.03272460773587227,
-0.32205212116241455,
-0.911561131477356,
-0.5244530439376831,
0.3273691236972809,
-0.27159383893013,
0.4418734014034271... | |
string responseFromServer = reader.ReadToEnd();
int index = 0;
while (responseFromServer.Substring(index).Contains("dog"))
{
index = responseFromServer.IndexOf("dog", index + 1);
Console.WriteLine(responseFromServer.Substring(index < 50 ? 0 : index - 50, 100));
... | [
-0.08159296959638596,
0.042979344725608826,
0.7240935564041138,
-0.2626717984676361,
0.18242791295051575,
0.28078189492225647,
0.7178482413291931,
-0.3284320533275604,
0.08612609654664993,
-0.46990489959716797,
-0.326070636510849,
0.7764852643013,
-0.301798015832901,
0.2049521803855896,
... | |
to understand here? Or of a website that returns a translation as simple as the request?
The reason is that the translation request itself is an asynchronous AJAX request. If you view the source of the page you are trying to retrieve, you won't find the word `chien`.
You could take a look at the [Google AJAX Language ... | [
0.34581753611564636,
0.11219709366559982,
0.24899397790431976,
0.26125308871269226,
-0.32515662908554077,
-0.110123410820961,
0.3028067648410797,
0.26684635877609253,
0.010542422533035278,
-0.5865625739097595,
-0.3038131296634674,
0.5429500341415405,
-0.12325947731733322,
0.156904280185699... | |
Is it possible to extend the SubSonic generator without modifying it's code?
I would like to add my own custom methods that i can use inside the templates. Somthing similair like the Utility.GetVariableType method.
I've found the solution for my own problem :).
I can now extend SubSonic with functionality i need in ... | [
0.4518176019191742,
-0.2640146017074585,
0.220610111951828,
0.31604525446891785,
-0.4031949043273926,
-0.43261149525642395,
0.23776371777057648,
-0.17127929627895355,
-0.006623045075684786,
-0.5027384161949158,
0.3725452423095703,
0.5232794284820557,
-0.36248254776000977,
0.111982323229312... | |
looking like this:
```
using System;
using System.Collections.Generic;
using System.Text;
namespace Helpers.SubSonic
{
public class GeneratorHelper
{
public bool IsColumnAllowed(string columnName)
{
return columnName.Length == 1 ||
(columnName.Length > 1 &&
... | [
-0.07788121700286865,
-0.2705649435520172,
0.5911591053009033,
-0.2317698895931244,
0.1717531979084015,
-0.01831929013133049,
0.3183630108833313,
-0.38473081588745117,
-0.014186732470989227,
-0.49361810088157654,
-0.011699404567480087,
0.554527759552002,
-0.4729844629764557,
0.194338172674... | |
columnName[columnName.Length - 1].ToString().Equals("_"))))
}
}
}
```
2. Build the assembly and copy SubSonicHelper.dll to your subsonic project.
3. Setup your SubSonic project to use your own templates using the templateDirectory parameter.
4. Edit your own templates and at the following after the `const ... | [
0.2359105944633484,
-0.14499309659004211,
0.6983188390731812,
-0.038978204131126404,
-0.10012791305780411,
0.03506377711892128,
0.43615710735321045,
-0.791115403175354,
0.04830477386713028,
-0.7125893235206604,
-0.079663947224617,
0.5096263885498047,
-0.5398205518722534,
0.0658940821886062... | |
you need to do the following:
1. Create an array of objects for the parameters of the method you want to use. I have the columnName parameter which i set to col.propertyName. This is inside the foreach (TableSchema.TableColumn col in cols) loop in the Update method.
2. Call the method you want to use with the object a... | [
-0.2248135358095169,
0.05870050936937332,
0.8427762389183044,
-0.11786752939224243,
0.1471429020166397,
-0.2043784260749817,
0.3709862530231476,
-0.5388844013214111,
-0.04845922067761421,
-0.4424724876880646,
-0.06602922827005386,
0.5996893644332886,
-0.1630478799343109,
0.0578035973012447... | |
template. | [
0.5425430536270142,
-0.01000487431883812,
0.06671921908855438,
0.16615639626979828,
0.3739183247089386,
0.06276915967464447,
-0.13173632323741913,
-0.37508589029312134,
-0.24071983993053436,
-0.750545084476471,
-0.20880374312400818,
0.15693435072898865,
-0.20095135271549225,
0.138112053275... | |
I'd like to use `os.system("md5sum myFile")` and have the result returned from os.system instead of just runned in a subshell where it's echoed.
In short I'd like to do this:
```
resultMD5 = os.system("md5sum myFile")
```
And only have the md5sum in resultMD5 and not echoed.
[`subprocess`](http://docs.python.org/li... | [
0.011196548119187355,
0.05275440961122513,
0.7817931175231934,
-0.1693638116121292,
0.046848226338624954,
-0.002112607005983591,
0.01897663064301014,
-0.4019775092601776,
-0.3000258207321167,
-0.6093006730079651,
-0.038905225694179535,
0.575931966304779,
-0.017756788060069084,
0.1378252208... | |
When is one called versus the other? Is there a situation were onChange would be called but onBlur would not be called?
The `onBlur` event is fired when you have moved away from an object without necessarily having changed its value.
The `onChange` event is only called when you have changed the value of the field and ... | [
-0.11309714615345001,
-0.512900173664093,
0.40226683020591736,
0.18746086955070496,
-0.11011627316474915,
-0.28940844535827637,
-0.02546176314353943,
0.18382476270198822,
-0.5806540250778198,
-0.16285933554172516,
0.07892066985368729,
0.49417316913604736,
-0.10331251472234726,
0.0311218444... | |
I want to do something like this:
```
foreach ($array as $key=>$value except when $key="id")
{
// whatever
}
```
... without having to put an "if" clause inside the body of the loop. It is not guaranteed that "id" will the be the first or last element in the array, and I don't really want to unset or slice the arra... | [
0.3815031945705414,
0.08356023579835892,
-0.08887375146150589,
-0.26353442668914795,
0.19247280061244965,
-0.24098961055278778,
0.26832351088523865,
-0.242742657661438,
0.08361028134822845,
-0.5188551545143127,
-0.10554961860179901,
0.7005179524421692,
-0.38008928298950195,
0.0268690176308... | |
($key == 'ignore_me') continue;
if ($key == 'ignore_me_2') continue;
```
If you want a fancy solution, you can use [`array_diff_key`](http://de.php.net/manual/en/function.array-diff.php):
```
$loop_array = array_diff_key($actual_array, array('ignore_me' => NULL, 'ignore_me_2' => NULL));
foreach ($loop_array as $... | [
0.06436163932085037,
-0.0012300334637984633,
0.7344964146614075,
-0.24897387623786926,
0.3874799907207489,
0.08685998618602753,
0.6884171366691589,
-0.3206503391265869,
-0.28197699785232544,
-0.24687039852142334,
-0.5793081521987915,
0.4247833490371704,
-0.32984066009521484,
0.058010850101... | |
I was looking for a simple function to get the week of the month (rather than the easy week of the year) in a mysql query.
The best I could come up with was:
```
WEEK(dateField) - WEEK(DATE_SUB(dateField, INTERVAL DAYOFMONTH(dateField)-1 DAY)) + 1
```
I'd love to know if I'm reinventing the wheel here, and if there... | [
-0.010468731634318829,
0.04070420190691948,
0.528700590133667,
-0.05780312046408653,
-0.27941301465034485,
0.2442127913236618,
-0.003517484525218606,
0.24940969049930573,
-0.4307699203491211,
-0.21094807982444763,
-0.022303931415081024,
0.20553599298000336,
-0.06335515528917313,
0.40702882... | |
WEEK(DATE_SUB(dateField, INTERVAL DAYOFMONTH(dateField) - 1 DAY), 5) + 1
```
so that the year transitions are handled correctly, and the weeks start on `Monday`.
Otherwise, your query is fine. | [
0.23678354918956757,
-0.2704751491546631,
0.7684215307235718,
-0.031875353306531906,
0.18038713932037354,
0.0032925864215940237,
0.11820823699235916,
0.09272801876068115,
-0.5441656708717346,
-0.13292159140110016,
-0.34386906027793884,
0.19671383500099182,
-0.22588208317756653,
0.607244789... | |
can any one post any link/tutorial which will explain how to search data from a table in sql server ,like using some stored procedure...any example?
In details:
Lets say I have a table havinh columns ID,title,username description etc, so now first it will search for username and then title and so on.
Are you running an... | [
0.3781331479549408,
0.22821447253227234,
0.06512615829706192,
0.253503680229187,
-0.12502749264240265,
-0.5458183288574219,
0.045593712478876114,
0.21386252343654633,
-0.5353969931602478,
-0.7511305212974548,
0.18844479322433472,
0.3255918622016907,
-0.21114639937877655,
0.4634790718555450... | |
you must Dispose it:
```
using (var resource = ResourceType.Create())
{
// Use the resource
} // resource.Dispose called here even if your code throws an exception
``` | [
0.09865407645702362,
0.022548027336597443,
-0.01410252321511507,
-0.05373237282037735,
0.3049742877483368,
-0.4486623704433441,
0.18467210233211517,
-0.1868792474269867,
-0.040907859802246094,
-0.6972059011459351,
-0.3057495355606079,
0.4907976984977722,
-0.22755727171897888,
0.31776043772... | |
I have an image and there is unwanted background-color coming to the image in IE6. Although it looks fine in all others IE6 messes it up with unwanted background-color.Any Ideas??
Is the image a transparent PNG image? If so, IE6 does simply not support PNG transparency. There is a JavaScript-based fix available [somewh... | [
0.7875415682792664,
0.24690665304660797,
0.5204803943634033,
-0.153208926320076,
-0.19750085473060608,
-0.34026622772216797,
0.5316696763038635,
0.03148823603987694,
-0.2541847229003906,
-0.6923675537109375,
-0.04324973747134209,
0.7720845937728882,
-0.1397997885942459,
0.19747532904148102... | |
I want to figure out in which cases I need to care about memory management when it comes to properties. I wrote down something from a site I don't remember anymore, where they said that if a property has any value other than NSNumber or NSValue, and if it has no setter, then UIKit would autorelease the old value and re... | [
0.2930503785610199,
0.14814342558383942,
0.19602583348751068,
0.2614334225654602,
-0.22138142585754395,
-0.2311703860759735,
0.24166685342788696,
0.09354325383901596,
-0.2730996608734131,
-0.7402030825614929,
0.04272697493433952,
0.5694074034690857,
-0.11641630530357361,
0.0980915427207946... | |
There is a JavaScript-based fix available [somewhere](http://homepage.ntlworld.com/bobosola/), if you really need to support IE6. I know that some companies refuse to upgrade IE unless absolutely necessary, but seriously I would no longer support IE6, since the current version is 8 and most people should have 7 by now. | [
0.619806706905365,
0.12328191846609116,
0.31472817063331604,
-0.08198422193527222,
0.02390182577073574,
-0.3524165153503418,
0.5444236993789673,
0.21187680959701538,
-0.3108736574649811,
-0.3780454993247986,
-0.08297090232372284,
0.7512561082839966,
-0.10156447440385818,
-0.019066676497459... | |
I have a script that is running slowly and I was wondering how I could time it and see which fixes improve the speed. Is there some sort of a PHP timer?
Update: Thought I should clarify... The script that is running slowly is my mailing list script that sends an email to everyone on the list. So I am looping through a... | [
0.5945888161659241,
-0.10029779374599457,
0.37884238362312317,
0.28365227580070496,
-0.27654969692230225,
0.06211577728390694,
0.396587073802948,
0.3782595098018646,
-0.37632203102111816,
-0.6803657412528992,
0.4453720152378082,
0.17628055810928345,
-0.04421853646636009,
0.0982354357838630... | |
and easy way to test that.
I ended up using a timer class I found similar to this one: <http://forum.codecall.net/php-tutorials/4254-php-timer-class.html>
I just started a timer at the beginning of my loop and logged the duration at the end of each iteration. Found out, on average, it was taking between 3 and 4 second... | [
0.6388030648231506,
0.08574745059013367,
0.060523878782987595,
0.04917963966727257,
-0.32431650161743164,
-0.1330505758523941,
0.664536714553833,
-0.1652432531118393,
-0.28773754835128784,
-0.45186084508895874,
0.47292473912239075,
0.33962923288345337,
0.11638226360082626,
-0.2928978800773... | |
I am writing my first portlet based application (for liferay, but the solution should be container agnostic) and I am wondering how people solve to provide links to the user that "lead" to different portlets (maybe on different "pages" in the portal).
While you can easily have different view modes inside your portlet,... | [
0.3851340413093567,
0.042935390025377274,
0.2708844542503357,
0.0070717716589570045,
-0.29712897539138794,
-0.14764796197414398,
0.1424320936203003,
0.5385181903839111,
-0.4630877673625946,
-0.8782881498336792,
0.13022629916667938,
0.461330771446228,
-0.39195433259010315,
0.214582070708274... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.