text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I'm experiencing an issue on a test machine running Red Hat Linux (kernel version is 2.4.21-37.ELsmp) using Java 1.6 (1.6.0\_02 or 1.6.0\_04). The problem is, once a certain number of threads are created in a single thread group, the operating system is unwilling or unable to create any more. This seems to be specific...
[ 0.14933982491493225, 0.07297664135694504, 0.31958451867103577, -0.10964186489582062, 0.014419354498386383, -0.24649599194526672, 0.2511395215988159, -0.05747481435537338, -0.4543098509311676, -0.83075350522995, 0.2845803201198578, 0.37473565340042114, -0.3576814532279968, 0.270307689905166...
of threads it's cutting off at is a mere 29 threads. This is testable with a simple Java program that just creates threads until it gets an error and then prints the number of threads it created. The error is a ``` java.lang.OutOfMemoryError: unable to create new native thread ``` This seems to be unaffected by thing...
[ 0.44733989238739014, -0.022092904895544052, 0.20978286862373352, -0.026514997705817223, -0.03232070431113243, 0.020252538844943047, 0.36847156286239624, 0.15119712054729462, -0.5664733052253723, -0.4472406506538391, 0.09096788614988327, 0.24268469214439392, -0.5200018286705017, 0.436392277...
to be with native OS thread creation). The output of "ulimit -a" is as follows: ``` core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited max locked memory (kbytes, -l) 4 max memory size (kbytes, -m) unlimited open files ...
[ -0.10579801350831985, -0.23004375398159027, 0.6980451941490173, -0.2235535830259323, 0.04365704208612442, 0.40653085708618164, -0.11197897791862488, -0.05993567407131195, -0.12811462581157684, -0.6788300275802612, -0.25652024149894714, 0.6725446581840515, -0.37386345863342285, 0.0977319777...
(512 bytes, -p) 8 stack size (kbytes, -s) 10240 cpu time (seconds, -t) unlimited max user processes (-u) 7168 virtual memory (kbytes, -v) unlimited ``` The user process limit does not seem to be the issue. Searching for information on what could be wrong has not turned up much...
[ -0.15960514545440674, -0.046726126223802567, 0.4305352568626404, 0.07471739500761032, 0.1555626094341278, 0.2225007712841034, 0.039116021245718, -0.11703911423683167, -0.6768056154251099, -0.20267659425735474, -0.1524176448583603, 0.6204046010971069, -0.060697127133607864, -0.1127677857875...
some Red Hat kernels limit a process to 300 MB of memory allocated for stack, and at 10 MB per thread for stack, it seems like the issue could be there (though it seems strange and unlikely as well). I've tried changing the stack size with "ulimit -s" to test this, but any value other than 10240 and the JVM does not s...
[ 0.1609572321176529, 0.179250106215477, 0.3452831208705902, -0.03423696756362915, 0.08275604248046875, -0.12077423930168152, 0.19761872291564941, -0.08838353306055069, -0.42280247807502747, -0.5413715243339539, 0.06514781713485718, 0.5941491723060608, -0.22332750260829926, 0.110155157744884...
specifically addressing this kind of situation. Any ideas on what system or JVM settings could be causing this would be appreciated. **Edits**: Running the thread-limit program mentioned by [plinth](https://stackoverflow.com/questions/116640/low-single-process-thread-limit-in-red-hat-linux#116696), there was no failur...
[ -0.03234578296542168, 0.09909021109342575, 0.31142401695251465, -0.1346941888332367, 0.11904706060886383, -0.14025478065013885, 0.4846784472465515, 0.08532942831516266, -0.24609361588954926, -0.5566906332969666, 0.029377998784184456, 0.5802857875823975, -0.40419870615005493, 0.309636354446...
// keep spawning new threads forever while (true) { new TestThread().start(); } } // when out of memory error is reached, print out the number of // successful threads spawned and exit catch ( OutOfMemoryError e ) { System.out.println(TestThread.CREATE_COUN...
[ 0.3948763310909271, -0.25551891326904297, 0.349444717168808, -0.21148614585399628, 0.3910489082336426, -0.0555504709482193, 0.5093353390693665, -0.13249854743480682, -0.04092226177453995, -0.29306504130363464, -0.2555147409439087, 0.5679393410682678, -0.2316942811012268, 0.3160983920097351...
System.exit(-1); } } static class TestThread extends Thread { private static int CREATE_COUNT = 0; public TestThread() { CREATE_COUNT++; } // make the thread wait for eternity after being spawned public void run() { try {
[ 0.6858761310577393, -0.2533243000507355, 0.17785437405109406, -0.05622135475277901, 0.2968218922615051, -0.03698447346687317, 0.6211898922920227, -0.0686429813504219, -0.03267252817749977, -0.309087336063385, -0.10125228017568588, 0.12574347853660583, -0.4978870749473572, 0.647729456424713...
sleep(Integer.MAX_VALUE); } // even if there is an interruption, dont do anything catch (InterruptedException e) { } } } } ``` If you run this with a 1.4 JVM it will hang when it can't create any more threads and require a kill -9 (at least it did for me). **More Edit:** ...
[ 0.5331255197525024, -0.24865445494651794, 0.47932079434394836, -0.15673811733722687, 0.32044529914855957, -0.500461220741272, 0.39302799105644226, 0.09960925579071045, -0.359610378742218, -0.7365598678588867, -0.19052258133888245, 0.6012915968894958, -0.4556480944156647, 0.1778014600276947...
using the LinuxThreads threading model while another system that works fine is using the NPTL model. Updating the kernel to a newer version (2.6.something) with NPTL threading fixed this.
[ -0.008344787172973156, -0.31032028794288635, 0.30936527252197266, 0.13409864902496338, -0.0508679524064064, -0.32150161266326904, 0.26820462942123413, 0.2925074100494385, -0.17606352269649506, -0.7729173302650452, -0.2137630134820938, 0.5347323417663574, -0.5822972655296326, 0.092942066490...
I am tasked with writing an authentication component for an open source `JAVA` app. We have an in-house authentication widget that uses `https`. I have some example `php` code that accesses the `widget` which uses `cURL` to handle the transfer. My question is whether or not there is a port of `cURL` to `JAVA`, or bet...
[ 0.13350741565227509, 0.45526155829429626, 0.5424187183380127, -0.038783781230449677, 0.10629037767648697, -0.07555468380451202, 0.2903634011745453, -0.2739253342151642, -0.24338789284229279, -0.468757301568985, -0.18737640976905823, 0.1822841316461563, -0.14881159365177155, 0.0337226465344...
on the right track, I think I'm going to end up using HttpsURLConnection and then picking out what I need from the response. Exception handling omitted: ``` HttpURLConnection con = (HttpURLConnection) new URL("https://www.example.com").openConnection(); con.setRequestMethod("POST"); con.getOutputStream().write("LOGIN"...
[ 0.222490131855011, 0.018175674602389336, 0.6021230220794678, 0.015497424639761448, 0.13514164090156555, -0.26574429869651794, 0.5854697227478027, 0.050304993987083435, -0.057652831077575684, -0.8523285388946533, -0.5499393939971924, 0.6004580855369568, -0.5289401412010193, 0.16936469078063...
I have a URI here in which a simple document.cookie query through the console is resulting in three cookies being displayed. I verified this with trivial code such as the following as well: ``` var cookies = document.cookie.split(';'); console.log(cookies.length); ``` The variable cookies does indeed come out to th...
[ 0.23366379737854004, 0.3011997938156128, 0.48617133498191833, -0.22912946343421936, -0.1692163199186325, 0.002798471599817276, 0.5494771003723145, -0.3174174129962921, -0.3480741083621979, -0.818688154220581, 0.12143291532993317, 0.6025923490524292, -0.24217817187309265, 0.3328401744365692...
alternative to decipher which tool is giving me the inaccurate information. The alternative to template style meta-programming is Macro-style that you see in various Lisp implementations. I would suggest downloading [Paul Graham's *On Lisp*](http://www.paulgraham.com/onlisp.html) and also taking a look at [Clojure](htt...
[ 0.04692928120493889, 0.11966004967689514, 0.0364358052611351, 0.007941653952002525, -0.3281528353691101, 0.03140222281217575, 0.22033803164958954, -0.07517153024673462, -0.29352861642837524, -0.4195890724658966, 0.013809931464493275, 0.6829061508178711, -0.7167109847068787, -0.381545931100...
I want to call a few "static" methods of a CPP class defined in a different file but I'm having linking problems. I created a test-case that recreates my problem and the code for it is below. (I'm completely new to C++, I come from a Java background and I'm a little familiar with C.) ``` // CppClass.cpp #include <ios...
[ 0.1613815724849701, 0.1857353299856186, 0.2255536913871765, -0.34189897775650024, 0.04669974371790886, 0.021119657903909683, 0.3720060884952545, -0.057531990110874176, -0.23795069754123688, -0.5351921916007996, -0.3183903992176056, 0.5225894451141357, -0.5927979350090027, 0.324732124805450...
cout << "Testing start function." << endl; shutdown = 0; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); pthread_mutex_init(&mutex, NULL);
[ -0.03278682380914688, 0.0192165058106184, 0.38261231780052185, -0.2695726156234741, 0.13109032809734344, -0.23970399796962738, 0.6150845289230347, -0.16123242676258087, 0.34770578145980835, -0.291037917137146, -0.5643011331558228, 0.2708073854446411, -0.4560304880142212, 0.3334839046001434...
pthread_cond_init(&cond, NULL); pthread_create(&thread, &attr, run_thread, NULL); } static void Stop() { pthread_mutex_lock(&mutex); shutdown = 1;
[ 0.22739984095096588, 0.07634874433279037, 0.4493918716907501, -0.3818846642971039, 0.433845579624176, 0.15975728631019592, 0.562210202217102, -0.08981115370988846, -0.053408414125442505, 0.031225139275193214, -0.6788025498390198, 0.4654640555381775, -0.47998324036598206, 0.4969868063926697...
pthread_cond_broadcast(&cond); pthread_mutex_unlock(&mutex); } static void Join() { pthread_join(thread, NULL); } private: static void *run_thread(void *pthread_args) {
[ 0.4618862271308899, 0.03278763219714165, 0.505046546459198, -0.3398391604423523, 0.2761111259460449, 0.1549145132303238, 0.5040099024772644, -0.27474117279052734, -0.2185630351305008, -0.26565706729888916, -0.3753741383552551, 0.46086639165878296, -0.631799578666687, 0.5928608179092407, ...
CppClass *obj = new CppClass(); pthread_mutex_lock(&mutex); while (shutdown == 0) { struct timespec ts;
[ -0.005265284329652786, -0.048480596393346786, 0.642661988735199, -0.4186580181121826, 0.1583690047264099, 0.26066556572914124, 0.48956045508384705, -0.18518280982971191, -0.37074142694473267, -0.30512723326683044, -0.18717993795871735, 0.26285555958747864, -0.11458295583724976, 0.452640354...
ts.tv_sec = time(NULL) + 3; pthread_cond_timedwait(&cond, &mutex, &ts); if (shutdown) {
[ 0.2627555727958679, -0.6333895325660706, 0.7952501177787781, -0.0707835704088211, -0.03289321810007095, -0.24992860853672028, 0.7322431206703186, -0.13974125683307648, -0.357118159532547, -0.08181864023208618, -0.29483821988105774, 0.6291999220848083, -0.5156977772712708, 0.385297715663909...
break; } obj->display(); }
[ -0.30926674604415894, 0.006490012630820274, -0.07876797020435333, -0.3488661050796509, 0.07883449643850327, 0.07839731127023697, 0.5614660978317261, 0.16521286964416504, -0.261033296585083, -0.4671805799007416, -0.7119184732437134, 0.22338810563087463, -0.3032912015914917, 0.13860851526260...
pthread_mutex_unlock(&mutex); pthread_mutex_destroy(&mutex); pthread_cond_destroy(&cond); pthread_exit(NULL); return NULL; } void display() {
[ -0.044514235109090805, 0.42598026990890503, 0.1556459665298462, -0.45810234546661377, 0.28019285202026367, 0.5358417630195618, 0.7190995216369629, -0.42703238129615784, -0.004459853284060955, -0.5689163208007812, -0.5557977557182312, 0.561047375202179, -0.26719731092453003, 0.6428786516189...
cout << " Inside display() " << endl; } }; // main.cpp #include <iostream> /* * If I remove the comment below and delete the * the class declaration part, it works. */ // #include "CppClass.cpp" using namespace std; class CppClass { public: static void Start(); static void Stop(); ...
[ 0.15587358176708221, -0.009233612567186356, 0.6193915605545044, -0.29999855160713196, 0.39424681663513184, 0.2802291214466095, 0.2358999252319336, -0.0030404396820813417, -0.289506196975708, -0.4395692050457001, -0.44760239124298096, 0.39055752754211426, -0.5216294527053833, 0.007823436520...
{ int quit; cout << "Do you want to end?: (0 = stay, 1 = quit) "; cin >> quit; cout << "Input: " << quit << endl;
[ 0.11429579555988312, -0.2848851680755615, 0.12977245450019836, -0.39869368076324463, 0.40023693442344666, -0.31707581877708435, -0.11889448016881943, -0.025415481999516487, -0.11701954901218414, -0.10567348450422287, -0.5078489780426025, 0.8098333477973938, -0.588281512260437, 0.1376676857...
if (quit) { CppClass::Stop(); cout << "Joining CppClass..." << endl;
[ 0.10350184887647629, -0.39549559354782104, 0.35079529881477356, -0.38603630661964417, 0.18923932313919067, -0.36011722683906555, -0.012969954870641232, 0.024490460753440857, -0.12310255318880081, -0.10075075179338455, -0.5139131546020508, 0.6314507126808167, -0.3518769443035126, 0.23100903...
CppClass::Join(); break; } } } ``` When I tried to compile, I get the following error: ``` $ g++ -o go main.cpp CppClass.cpp -l pthread /tmp/cclhBttM.o(.text+0x119): In function `main': : undefined reference to `CppClass::Start()' /tmp/cclhBttM.o(.text+0x182): In func...
[ -0.23495128750801086, 0.13724161684513092, 0.6076405048370361, -0.16574899852275848, 0.13050459325313568, -0.06083408370614052, 0.3034574091434479, -0.054002031683921814, -0.4072571396827698, -0.12786012887954712, -0.42862993478775024, 0.360776424407959, -0.5318882465362549, 0.339400231838...
main.cpp and replace it with #include "CppClass.cpp", it works fine. Basically, I want to put these declarations in a separate .h file and use it. Am I missing something? Thanks for the help. It's obvious you come from a Java background because you haven't yet grasped the concept of header files. In Java the process o...
[ 0.4174486994743347, 0.018230201676487923, -0.017916472628712654, -0.10033607482910156, -0.15684819221496582, -0.2412545531988144, 0.20342746376991272, 0.18239422142505646, -0.5034408569335938, -0.41158586740493774, -0.20834724605083466, 0.2168796956539154, -0.3293687105178833, -0.070768080...
compiler the actual implementation part. Header files are used mostly for declarations, .cpp files for definitions. Header files are there to describe the "API" of classes, but not their actual code. It is possible to include code in the header, that's called header-inlining. You have inlined everything in CppClass.cp...
[ 0.5348387360572815, 0.00948216300457716, -0.18813179433345795, 0.030138948932290077, -0.40652868151664734, -0.0388847254216671, 0.43730607628822327, -0.043636444956064224, -0.05051429197192192, -0.2894740700721741, -0.24497045576572418, 0.5144283771514893, -0.6517358422279358, -0.271701991...
double declaration in your code gives you a compiler error. Leaving the class code out compiles but gives you a linker error because now you only have the header-like class declaration in main.cpp. The linker sees no code that implements your class methods, that's why the errors appear. Different to Java, the C++ linke...
[ 0.6397035121917725, -0.060353390872478485, -0.09555766731500626, -0.02150587923824787, -0.33916547894477844, -0.2680494487285614, 0.6976125240325928, -0.03472946211695671, -0.4227326214313507, -0.6538995504379272, 0.023071663454174995, 0.24588556587696075, -0.7414511442184448, 0.0042220535...
the bottom of the Wikipedia article and contains more examples) In short: For each class, generate a NewClass.h and NewClass.cpp file. In the NewClass.h file, write: ``` class NewClass { public: NewClass(); int methodA(); int methodB(); }; <- don't forget the semicolon ``` In the NewClass.cpp file, write...
[ -0.2917321026325226, -0.06422156095504761, 0.5408328771591187, -0.019962675869464874, 0.23064292967319489, -0.03815123066306114, 0.1616756021976471, -0.13099554181098938, -0.584087610244751, -0.5335838198661804, -0.39566922187805176, 0.1079961508512497, -0.43801283836364746, 0.226986706256...
gcc)
[ -0.43108299374580383, 0.09553459286689758, 0.4896199703216553, -0.15470480918884277, -0.12219052761793137, 0.07673851400613785, 0.07632367312908173, -0.22223758697509766, -0.4805251955986023, 0.41673994064331055, -0.3843887150287628, 0.400149941444397, -0.1510942280292511, 0.47932264208793...
Can I use the ClickOnce deployment method to deploy and auto update applications targeted for the windows mobile platform (eg smartphone or pocket pc)? True Click-Once is not supported. You might look at these articles to give you a better feel for what can be done: * [MSDN Article on Deployment Patterns](http://msdn....
[ 0.4177390933036804, 0.0070725250989198685, 0.3494277000427246, 0.16274723410606384, -0.043988186866045, -0.16075168550014496, 0.20118366181850433, -0.103542260825634, -0.18882714211940765, -0.8974924087524414, -0.040734149515628815, 0.6969740986824036, -0.2983918786048889, 0.00870015565305...
I have a rather weak understanding of any of oracle's more advanced functionality but this should I think be possible. Say I have a table with the following schema: ``` MyTable Id INTEGER, Col1 VARCHAR2(100), Col2 VARCHAR2(100) ``` I would like to write an sproc with the following ``` PROCEDURE InsertOrUpda...
[ -0.26902467012405396, 0.3336764872074127, 0.615279495716095, -0.12864063680171967, 0.05557018145918846, 0.167512446641922, -0.16595470905303955, -0.35386815667152405, -0.2161562740802765, -0.20781005918979645, -0.1034361869096756, 0.5331979990005493, -0.2822355628013611, -0.233089491724967...
Col2='098' exec InsertOrUpdateMyTable(123, NULL, NULL); --results in id=123, Col1='ABC', Col2='DEF' ``` Is there any simple way of doing this without having multiple SQL statements? I am thinking there might be a way to do this with the Merge statement though I am only mildly familiar with it. --- **EDIT:** Cad...
[ 0.011827143840491772, 0.1624678522348404, 0.2614738941192627, -0.022512827068567276, -0.05112388730049133, 0.13686420023441315, 0.23466233909130096, -0.5151458978652954, -0.13560259342193604, -0.5782644152641296, 0.008376020938158035, 0.5009924173355103, -0.31942054629325867, -0.0761087536...
UPDATE SET mt.Col1 = coalesce(p_col1, mt.Col1), mt.Col2 = coalesce(p_col2, mt.Col2) WHEN NOT MATCHED THEN INSERT (ID, Col1, Col2) VALUES (p_id, p_col1, p_col2); ``` Using MERGE and COALESCE? [Try this link for an example](http://blogs.oracle.com/cmar/entry/using_merge_to_do_an) with ``...
[ -0.3551355004310608, 0.039586830884218216, 0.5749264359474182, -0.1978440135717392, 0.09786141663789749, 0.410655677318573, -0.07492267340421677, -0.24150784313678741, -0.010547690093517303, -0.4833552837371826, -0.3670167922973633, 0.7427874803543091, -0.30695655941963196, -0.289138376712...
I am adding custom controls to a FlowLayoutPanel. Each control has a date property. I would like to sort the controls in the flowlayoutpanel based on the date property. I can't presort the controls before I add them because it is possible for the user to add more. My current thought is when the ControlAdded event for ...
[ 0.13581086695194244, -0.05522412061691284, 0.6973938941955566, -0.0414498969912529, 0.3272761106491089, -0.05491264536976814, -0.1063915565609932, 0.01696956902742386, -0.20595963299274445, -0.8755104541778564, 0.0797131136059761, 0.6106644868850708, -0.06967011839151382, 0.166828751564025...
SortedList<DateTime,Control> sl = new SortedList<DateTime,Control>(); foreach (Control i in mainContent.Controls) { if (i.GetType().BaseType == typeof(MyBaseType)) { MyBaseType iTyped = (MyBaseType)i; sl.Add(iTyped.Date, iTyped);
[ -0.37219569087028503, -0.4953564703464508, 0.6007867455482483, -0.4012199640274048, 0.20458224415779114, 0.06262245774269104, -0.033105574548244476, -0.3760613203048706, -0.1401084065437317, -0.3968310058116913, -0.3329928517341614, -0.09016760438680649, -0.3256056308746338, 0.170427277684...
} } foreach (MyBaseType j in sl.Values) { j.SendToBack(); } ```
[ -0.1588512659072876, 0.07120880484580994, 0.2748699188232422, -0.5374323129653931, 0.2189091593027115, -0.1933618187904358, 0.3241387903690338, 0.04565603286027908, 0.3051050901412964, -0.29193270206451416, -0.3243587017059326, 0.5488418936729431, -0.2531231939792633, 0.14303909242153168, ...
I have an int array as a property of a Web User Control. I'd like to set that property inline if possible using the following syntax: ``` <uc1:mycontrol runat="server" myintarray="1,2,3" /> ``` This will fail at runtime because it will be expecting an actual int array, but a string is being passed instead. I can mak...
[ 0.13103240728378296, 0.11468123644590378, 0.37933632731437683, -0.13511402904987335, -0.13460290431976318, 0.08329635858535767, 0.4240858554840088, -0.35931867361068726, 0.0014630727237090468, -0.5290374159812927, 0.0224104393273592, 0.6001949906349182, -0.5061494708061218, 0.2028062939643...
sourceType) { return sourceType == typeof(string); } public override object ConvertFrom(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value) { string val = value as string; string[] vals = val.Split(','); System.Col...
[ 0.09425235539674759, -0.4194754958152771, 0.5911909341812134, -0.08963771164417267, 0.11564686894416809, 0.09994247555732727, 0.5064609050750732, -0.44566476345062256, 0.05587547644972801, -0.5484675168991089, -0.44379904866218567, 0.5483755469322205, -0.4892512261867523, 0.494000047445297...
return ints.ToArray(); } } ``` and tag the property of your control : ``` private int[] ints; [TypeConverter(typeof(IntsConverter))] public int[] Ints { get { return this.ints; } set { this.ints = value; } } ```
[ -0.027188068255782127, -0.37214037775993347, 0.3503781855106354, 0.21915000677108765, 0.45750388503074646, -0.20412033796310425, 0.12771354615688324, -0.38620027899742126, -0.009330886416137218, -0.3505411744117737, -0.22773928940296173, 0.681681752204895, -0.4668913185596466, 0.0586478263...
I want an expression that will fail when it encounters words such as "boon.ini" and "http". The goal would be to take this expression and be able to construct for any set of keywords. ``` ^(?:(?!boon\.ini|http).)*$\r?\n? ``` (taken from [RegexBuddy](http://www.regexbuddy.com)'s library) will match any line that does ...
[ 0.6194242835044861, 0.10388436168432236, 0.3737448751926422, 0.011177165433764458, -0.025963574647903442, 0.0715782567858696, 0.13758118450641632, -0.24659356474876404, 0.3148266077041626, -0.5146456956863403, 0.09664477407932281, 0.7622848153114319, -0.348405122756958, 0.14346766471862793...
Whats the most efficient way of selecting total number of records from a large table? Currently, Im simply doing ``` $result = mysql_query("SELECT id FROM table"); $total = mysql_num_rows($result) ``` I was told this was not very efficient or fast, if you have a lot of records in the table. You were told correctly. ...
[ -0.19868846237659454, 0.0735032707452774, 0.3111092746257782, 0.11929147690534592, -0.09099400043487549, -0.039258405566215515, -0.21314369142055511, -0.33849453926086426, -0.7033194303512573, -0.5897720456123352, 0.13676942884922028, 0.42040306329727173, -0.19754260778427124, 0.2476687729...
In Java, one can declare a variable parameterised by an "unknown" generic type, which looks like this: ``` Foo<?> x; ``` Is there an equivalent construct to this question-mark, in C#? The short answer is no. There isn't an equivalent feature in C#. A workaround, from [C# from a Java developer's perspective](http://...
[ 0.18221259117126465, 0.002433779649436474, -0.20777063071727753, -0.15380001068115234, -0.5590591430664062, -0.03539503738284111, 0.5725162029266357, -0.1972838044166565, -0.4050709009170532, -0.06944139301776886, -0.12754136323928833, 0.3669033944606781, -0.5704666972160339, 0.06212292239...
mechanism for specifying this in C# is via a feature called generic type inferencing while in Java this is done using wildcard types. The following code samples show how both approaches lead to the same result. C# Code ``` using System; using System.Collections; using System.Collections.Generic; class Test{ //...
[ 0.5175203084945679, -0.2548513114452362, 0.43637987971305847, 0.0766143873333931, -0.0012520723976194859, -0.2000015527009964, 0.15137042105197906, -0.5661118030548096, -0.294927716255188, -0.481256365776062, -0.325298935174942, 0.25566983222961426, -0.4460398256778717, 0.09730725735425949...
} } public static void Main(String[] args){ Stack<int> s2 = new Stack<int>(); s2.Push(4); s2.Push(5); s2.Push(6); PrintStackContents(s2); Stack<string> s1 = new Stack<string>(); s1.Push("One"); s1.Push("Two"); s1.Push("Three"); PrintStackContents(s1); ...
[ 0.14883843064308167, -0.15703000128269196, 0.16666047275066376, -0.5342963933944702, 0.1257895976305008, -0.08811657875776291, 0.4853777289390564, -0.6897159814834595, -0.14997243881225586, -0.4583929181098938, -0.3769904375076294, 0.3267051577568054, -0.7293821573257446, 0.100506819784641...
wildcard type public static void PrintStackContents(Stack<?> s){ while(!s.empty()){ System.out.println(s.pop()); } } public static void main(String[] args){ Stack <Integer> s2 = new Stack <Integer>(); s2.push(4); s2.push(5); s2.push(6); PrintStackCont...
[ -0.13555338978767395, -0.7969683408737183, 0.4671229124069214, -0.06507193297147751, 0.2458803355693817, -0.08860349655151367, 0.3067361116409302, -0.5094808340072632, -0.3141605854034424, -0.15480977296829224, -0.5542969107627869, 0.09542812407016754, -0.6120983362197876, 0.19119915366172...
s1.push("Two"); s1.push("Three"); PrintStackContents(s1); } } ```
[ -0.058141324669122696, -0.2650739848613739, 0.4518488943576813, -0.6001604199409485, 0.1530943214893341, -0.011803781613707542, 0.25172489881515503, -0.480912446975708, -0.13940410315990448, -0.6158430576324463, -0.2152908444404602, 0.49027296900749207, -0.5295968055725098, 0.1110753193497...
I am writing a simple Python web application that consists of several pages of business data formatted for the iPhone. I'm comfortable programming Python, but I'm not very familiar with Python "idiom," especially regarding classes and objects. Python's object oriented design differs somewhat from other languages I've w...
[ 0.3014955222606659, 0.22431114315986633, 0.060818083584308624, -0.06710988283157349, -0.013321759179234505, 0.153528094291687, 0.12440658360719681, 0.08198053389787674, -0.044990476220846176, -0.3969620168209076, -0.047434002161026, 0.48282235860824585, -0.3231251835823059, -0.369944334030...
using a list of these objects, then rendering the output from the list of objects. (Sample code below, SQL queries redacted.) Is this sane? Is there a better way? Are there any specific "gotchas" I've stumbled into in my relative ignorance of Python? I'm particularly concerned about how I've implemented the list of row...
[ 0.27978578209877014, 0.018674297258257866, 0.121830053627491, 0.13274583220481873, -0.022902993485331535, 0.11072991788387299, 0.35820406675338745, -0.09656505286693573, -0.25919589400291443, -0.4766800105571747, 0.02508644573390484, 0.7916076183319092, -0.42810145020484924, -0.01523220166...
hash retrieved above if hasattr(record, 'sink') and record.sink: record.da = node_prices[record.sink][0] - node_prices[record.id][0] record.rt = node_prices[record.sink][1] - node_prices[record.id][1] else: record.da = node_prices[record.id][0]
[ -0.38563257455825806, -0.15602315962314606, 0.1985008418560028, 0.06940201669931412, 0.07562854886054993, 0.024781445041298866, -0.1329006403684616, -0.3435956537723541, -0.386467307806015, -0.34366896748542786, -0.32239750027656555, 0.7607634663581848, 0.3252100348472595, 0.44089633226394...
record.rt = node_prices[record.id][1] # calculate dependent values: RT-DA and PNL record.rtda = record.rt - record.da record.pnl = record.rtda * record.mw except: print sys.exc_info() def map_rows(cursor, mappings, callback=None): records = [] for row in...
[ -0.4452347457408905, -0.04734255373477936, 0.3603069484233856, -0.13220132887363434, 0.27396321296691895, 0.10212332010269165, -0.10744699835777283, -0.47468194365501404, -0.5868669152259827, -0.4555458128452301, -0.16096094250679016, 0.6765724420547485, -0.29187530279159546, 0.16042277216...
record = Record() for field, attr in mappings.iteritems(): setattr(record, attr, getattr(row, field, None)) if not callback or callback(record): records.append(record) return records def get_positions(cursor): # get the latest position time cursor.execute("SELECT la...
[ -0.24580121040344238, -0.2540830373764038, 0.740386426448822, -0.049860306084156036, 0.48832640051841736, 0.22435736656188965, -0.18521282076835632, -0.3007363975048065, -0.4399079382419586, -0.4027346670627594, -0.12216649204492569, 0.6047857403755188, -0.027420422062277794, 0.26021885871...
cursor.execute("SELECT stuff FROM atable", (hour)) # read the rows nodes = {} def record_callback(record): if abs(record.mw) > 0: if record.id: nodes[record.id] = None return True else: return False records = util.map_rows(cursor, { 'id':
[ -0.10931546241044998, -0.05012945458292961, 0.5129614472389221, -0.19802698493003845, 0.13167692720890045, -0.015898143872618675, 0.2244148999452591, -0.43285590410232544, -0.3690250515937805, -0.45861881971359253, 0.004120129160583019, 0.6982695460319519, -0.42322513461112976, 0.347824752...
'id', 'name': 'name', 'mw': 'mw' }, record_callback) # query prices for node_id in nodes: # RT price row = cursor.execute("SELECT price WHERE ? ? ?", (node_id, time, time)).fetchone() rt5 = row.lmp if row else None # DA price row = cursor.execute("SE...
[ -0.12091023474931717, -0.42632150650024414, 0.5736404657363892, -0.019375884905457497, 0.3033665120601654, 0.5906954407691956, -0.22929918766021729, -0.5104608535766602, -0.06116504222154617, -0.658898651599884, -0.2790885269641876, 1.2021658420562744, 0.09997543692588806, 0.39675283432006...
WHERE ? ? ?", (node_id, hour, hour)).fetchone() da = row.da_lmp if row else None # update the hash value nodes[node_id] = (da, rt5) # calculate the position pricing calculate_pnl(records, nodes) # sort records.sort(key=lambda r: r.name) # return the records return rec...
[ 0.07787816971540451, -0.20027849078178406, 0.4532340466976166, -0.05375033989548683, 0.5309126377105713, 0.210575133562088, -0.2822287976741791, 0.016428861767053604, -0.3002518117427826, -0.30959436297416687, -0.038218237459659576, 0.6118382215499878, -0.04083247482776642, 0.4419016838073...
designed your class properly. ``` class Record( object ): """Assuming rtda and pnl must exist.""" def __init__( self ): self.da= 0 self.rt= 0 self.rtda= 0 # or whatever self.pnl= None # self.sink = None # Not clear what this is def setPnl( self, node_prices ): ...
[ 0.022848088294267654, -0.39979010820388794, 0.10539506375789642, -0.08733657002449036, 0.09243471175432205, 0.0062976861372590065, 0.3055397868156433, -0.21823948621749878, -0.032723844051361084, -0.7166121602058411, -0.11248698085546494, 0.731744647026062, -0.32974177598953247, -0.0153904...
prices from the hash retrieved above # calculate dependent values: RT-DA and PNL ``` Now, your `calculate_pnl( records, node_prices )` is simpler and uses the object properly. ``` def calculate_pnl( records, node_prices ): for record in records: record.setPnl( node_prices ) ``` The point isn't ...
[ 0.1032307967543602, 0.05189512297511101, -0.13616225123405457, 0.30294936895370483, 0.0008750837296247482, -0.11154218018054962, -0.17538870871067047, -0.3874457776546478, -0.47391054034233093, -0.40088024735450745, -0.11467328667640686, 0.772438108921051, -0.08673663437366486, 0.248535200...
since the collection -- as a whole -- has operations it performs. The "Request-Transform-Render" isn't quite right. You have a Model (the Record class). Instances of the Model get built (possibly because of a Request.) The Model objects are responsible for their own state transformations and updates. Perhaps they get ...
[ 0.16797013580799103, -0.22468531131744385, -0.08044588565826416, 0.4480144679546356, -0.02197967655956745, -0.08958061784505844, 0.1713247299194336, -0.3289162218570709, -0.4353017508983612, -0.43646690249443054, -0.2226056009531021, 0.49615034461021423, -0.11979707330465317, 0.40767028927...
I would like Visual Studio to break when a handled exception happens (i.e. I don't just want to see a "First chance" message, I want to debug the actual exception). e.g. I want the debugger to break at the exception: ``` try { System.IO.File.Delete(someFilename); } catch (Exception) { //we really don't care at ...
[ 0.3164384961128235, 0.02468067593872547, 0.07898922264575958, -0.0687718614935875, -0.09813518822193146, -0.1799352616071701, 0.21195785701274872, -0.19897529482841492, -0.25023719668388367, -0.648476779460907, -0.13401122391223907, 0.39301401376724243, -0.25096163153648376, -0.08274897933...
"When the exception is thrown:" > group box, select "Break into the > debugger" > > > 3) Run your scenario. When the > exception is thrown, the debugger will > stop and notify you with a dialog that > says something like: > "An exception of type "System.NullReferenceException" has > been thrown. > [Break] ...
[ -0.25545838475227356, -0.1065995991230011, 0.11223132163286209, -0.01105745229870081, 0.027816779911518097, -0.35806894302368164, 0.5654269456863403, -0.10580430179834366, -0.28231436014175415, -0.5204102993011475, -0.4114726185798645, 0.6308339238166809, -0.2973391115665436, -0.1713314354...
this options dialog in Visual Studio that the "*When the exception is thrown*" group box, with the option to "*Break into the debugger*"? *Update: The problem was that my **Debug** menu didn't have an **Exceptions** item. I customized the menu to manually add it.* With a solution open, go to the Debug - Windows - Exce...
[ -0.03773295879364014, -0.02680160664021969, -0.011050584726035595, 0.08671467006206512, -0.2523063123226166, 0.00931007694453001, 0.4683218002319336, -0.12255623936653137, -0.4155636429786682, -0.5986554026603699, -0.19817569851875305, 0.6196532845497131, -0.26102638244628906, 0.0294063091...
How do you show your clients/employers that you understood their requirements? What do you recommend to use? Use-Case diagrams? Flow-Charts? Data-Flow-Diagrams? Decision Trees? I'm not really asking for a very detailed answer. Just something simple to help me communicate with the person who wrote the requirements and...
[ 0.7138537168502808, -0.023217640817165375, 0.16189511120319366, 0.3718142807483673, 0.0848003402352333, 0.030503826215863228, -0.28311601281166077, -0.3497905433177948, -0.26882725954055786, -0.7090442180633545, 0.21416261792182922, 0.4119776487350464, 0.22973057627677917, -0.4326246976852...
problem and proposed solution.
[ -0.4139837324619293, 0.19239000976085663, 0.2694864571094513, 0.26137614250183105, 0.27086135745048523, 0.6691338419914246, -0.2546631395816803, -0.40815699100494385, -0.20200376212596893, -0.659486711025238, -0.3121353089809418, 0.17383399605751038, 0.12255170941352844, 0.1322332471609115...
Is it possible to call a JavaScript function from the IMG SRC tag to get an image url? Like this: ``` <IMG SRC="GetImage()" /> <script language="javascript"> function GetImage() {return "imageName/imagePath.jpg"} </script> ``` This is using .NET 2.0. Nope. It's not possible, at least not in all browsers. You ca...
[ 0.36496075987815857, -0.2825479805469513, 0.506170928478241, -0.019222095608711243, -0.25027409195899963, -0.2431367188692093, 0.30472975969314575, -0.07323627173900604, -0.31169283390045166, -0.671894907951355, -0.03021082654595375, 0.6169124841690063, -0.4373105466365814, -0.192146822810...
I have a database full of customer data. It's so big that it's really cumbersome to operate on, and I'd rather just slim it down to 10% of the customers, which is plenty for development. I have an awful lot of tables and I don't want to alter them all with "ON DELETE CASCADE", especially because this is a one-time deal...
[ 0.6746174097061157, 0.3605216145515442, -0.027426084503531456, 0.06679024547338486, 0.2603115439414978, -0.02714124694466591, 0.1705438792705536, -0.12652572989463806, -0.16888011991977692, -0.25990837812423706, 0.445627361536026, 0.40901434421539307, -0.19042450189590454, 0.21647126972675...
you can run to perform a cascaded delete regardless of `ON DELETE CASCADE`. It was probably a big waste of time, but I had a good time writing it. An advantage of doing it this way is, you can put a `GO` statement between each line, and it doesn't have to be one big transaction. The original was a recursive procedure; ...
[ 0.16545861959457397, -0.28883546590805054, 0.30333641171455383, -0.1150941476225853, -0.04910590499639511, -0.08793752640485764, 0.4926835894584656, -0.4444515109062195, -0.2973846197128296, -0.030040806159377098, -0.07365114986896515, 0.4108279347419739, -0.6701002717018127, -0.0736618787...
conditional for selecting rows -- within that table that you want deleted. -- Produces SQL that, when run, deletes all table rows referencing the ones -- you initially selected, cascading into any number of tables, -- without the need for "ON DELETE CASCADE". -- Does not appear to work with self-ref...
[ 0.0028286685701459646, -0.38311508297920227, 0.06368477642536163, -0.07639329135417938, -0.09751025587320328, -0.0011689625680446625, 0.3722755014896393, 0.012334572151303291, 0.09135552495718002, -0.20079702138900757, -0.32236963510513306, 0.6102862358093262, -0.5594305992126465, -0.26051...
@to_delete table ( id int identity(1, 1) primary key not null, criteria nvarchar(1000) not null, table_name varchar(200) not null, processed bit not null, delete_sql varchar(1000) ) insert into @to_delete (criteria, table_name, processed) values (@base_criteria, @base_ta...
[ 0.07394164800643921, -0.19489730894565582, 0.4701842963695526, -0.2045256495475769, 0.10850939154624939, 0.03718514367938042, 0.21187782287597656, -0.5884531736373901, 0.1702542006969452, -0.46905016899108887, -0.16408824920654297, 0.5559002757072449, -0.29122984409332275, 0.05620903149247...
select top 1 @id = id, @criteria = criteria, @table_name = table_name from @to_delete where processed = 0 order by id desc insert into @to_delete (criteria, table_name, processed) select referencing_column.name + ' in (select [' + referenced_column.name + '] from [' + @table_name +'] where ' + @cri...
[ -0.46084243059158325, -0.032256901264190674, 0.5627256631851196, 0.1423511952161789, 0.1812639981508255, -0.11745670437812805, -0.14416567981243134, -0.6077311635017395, -0.008306513540446758, -0.1726817786693573, -0.3532469570636749, 0.2805342972278595, -0.40174025297164917, -0.0074295569...
0 from sys.foreign_key_columns fk inner join sys.columns referencing_column on fk.parent_object_id = referencing_column.object_id and fk.parent_column_id = referencing_column.column_id inner join sys.columns referenced_column on fk.referenced_object_id...
[ -0.3070426285266876, 0.23516754806041718, 0.39574897289276123, -0.16615094244480133, -0.25569501519203186, 0.41174551844596863, 0.06830663233995438, -0.4118126928806305, 0.08026943355798721, -0.31210145354270935, -0.020374542102217674, -0.19356539845466614, -0.13937851786613464, 0.36563879...
and fk.referenced_column_id = referenced_column.column_id inner join sys.objects referencing_table on fk.parent_object_id = referencing_table.object_id inner join sys.objects referenced_table on fk.referenced_object_id = referenced_table.object_id inner join sys.obj...
[ -0.4292472004890442, 0.3134801983833313, 0.371792733669281, -0.10663372278213501, -0.2319483608007431, 0.6479582786560059, -0.031225593760609627, -0.3900642693042755, -0.37147897481918335, -0.42844921350479126, 0.05332037806510925, 0.12385778874158859, -0.2196372002363205, 0.41420993208885...
where referenced_table.name = @table_name and referencing_table.name != referenced_table.name update @to_delete set processed = 1 where id = @id end select 'print ''deleting from ' + table_name + '...''; delete from [' + table_name + '] where ' + criteria from @to_d...
[ -0.14314152300357819, -0.026481814682483673, 0.8019731640815735, 0.028765695169568062, 0.16429096460342407, -0.019369743764400482, 0.1236254870891571, -0.6804500222206116, -0.2740384340286255, -0.28364312648773193, -0.17109733819961548, 0.3056173622608185, -0.4666825532913208, 0.4324150085...
I'm trying to get started on what I'm hoping will be a relatively quick web application in Java, yet most of the frameworks I've tried (Apache Wicket, Liftweb) require so much set-up, configuration, and trying to wrap my head around Maven while getting the whole thing to play nice with Eclipse, that I spent the whole w...
[ 0.49733367562294006, 0.16389816999435425, -0.13795961439609528, 0.06797758489847183, -0.19681748747825623, -0.19696144759655, 0.25558993220329285, 0.0632132813334465, -0.11307672411203384, -0.5704802870750427, 0.22143705189228058, 0.4523489773273468, -0.13111405074596405, -0.19892926514148...
I think <http://www.playframework.org/> has a lot of potential... coming from php and classic asp, it's the first java web framework that sounds promising to me.... *Edit by original question asker - 2011-06-09* Just wanted to provide an update. I went with Play and it was exactly what I asked for. It requires ve...
[ 0.5506446957588196, -0.11739042401313782, 0.011624867096543312, -0.03845975175499916, -0.07219875603914261, 0.050597552210092545, -0.10405853390693665, -0.2528233528137207, 0.06334646046161652, -0.7263382077217102, 0.48049378395080566, 0.6207177042961121, -0.4886680841445923, -0.1783423125...
supported by the Java reflection API. Play's attitude is that its first goal is being a useful web framework, and sticking to common Java best-practices and idioms is secondary to that. This approach makes sense to me, but Java purists may not like it, and would be better-off with [Apache Wicket](http://wicket.apache....
[ 0.5705636143684387, -0.23451170325279236, 0.23326773941516876, 0.08243735879659653, -0.26067450642585754, -0.15383656322956085, -0.056670181453228, -0.05956205725669861, -0.056531745940446854, -0.8348414897918701, 0.019966959953308105, 0.7262735366821289, -0.3971646726131439, -0.4227499365...
It's gotta be free. It's hobby, after all, not a business!. Creating for-profit software isn't an issue, but anything that requires a hardware mod is out. No, all of the major consoles, except for the Xbox 360, do not have open development environments. There are various homebrew kits you can get, but these aren't sanc...
[ 1.134985089302063, 0.14459657669067383, 0.07675344496965408, 0.622637152671814, 0.16857993602752686, -0.6464936137199402, -0.04575585946440697, 0.52110356092453, -0.12080325931310654, 0.13105785846710205, -0.27282971143722534, 0.6825370192527771, 0.053510457277297974, 0.1815832108259201, ...
I would like to be able to monitor my major system health indicators from inside our Java-based system. Major points of interest include CPU temperature, motherboard temperature, fan speed, etc. Is there a package available that: 1. Makes this sort of data available to Java? 2. Works on Windows or Linux or both? 3. ...
[ 0.5268804430961609, 0.14751611649990082, 0.36221539974212646, -0.05628906935453415, 0.19743308424949646, -0.09633573144674301, 0.4374426603317261, 0.06575655937194824, -0.0698084682226181, -0.8640158772468567, 0.20511804521083832, 0.2419321984052658, -0.04035370424389839, -0.06147766858339...
SNMP API](http://www.ireasoning.com/snmpapi.shtml) and they worked great. There is also the open source [SNMP4J](http://www.snmp4j.org/), which I don't personally have experience with, but looks pretty good. So, for your needs, you would turn on the publishing of SNMP information for the hosts you want to monitor. No ...
[ 0.5127933621406555, -0.22483117878437042, 0.7559529542922974, -0.088032566010952, -0.13515600562095642, -0.15592192113399506, 0.3160918056964874, -0.19363893568515778, -0.49485084414482117, -0.8264008164405823, 0.0652490183711052, 0.5412673354148865, -0.1624489426612854, -0.181398883461952...
solution. You can use a Java SNMP library to poll and subscribe to SNMP traps for the hosts you want to monitor. You could also use any commercial or open-source monitoring tool (Google for *SNMP console*).
[ 0.1037178635597229, -0.34356945753097534, 0.2586419880390167, 0.5051248669624329, 0.12561924755573273, -0.27230319380760193, 0.36977964639663696, -0.1053798496723175, -0.2884572446346283, -0.6745575666427612, 0.009126899763941765, 0.1873215138912201, -0.5055900812149048, -0.129240795969963...
I'm working on a billing system for a utility company, and we have the following requirements: * Batch-generate and print approximately 1,500 bills per day that we then mail to customers * Save the bill in a format that can emailed to the customer and also archived (probably PDF) * Built with .NET with MS SQL Server d...
[ 1.056650996208191, 0.1201709732413292, 0.3126189708709717, 0.21118104457855225, 0.1119677945971489, 0.1846371740102768, -0.327208548784256, -0.4957515597343445, -0.2849099636077881, -0.7226553559303284, 0.49452418088912964, 0.448201984167099, -0.041045162826776505, -0.11973609030246735, ...
that's the best technology to use, and I can't get my head around how the batching and PDF conversion would work. Any thoughts? Would WPF work, or is there a better solution? If you are using a SQL Server backend, Reporting Services should work for you. Otherwise I would recommend a third-party report generator that ...
[ 0.5652049779891968, 0.09673503786325455, 0.11156018078327179, 0.47389042377471924, -0.018788104876875877, -0.3204422891139984, -0.2107565850019455, -0.09189330786466599, -0.11864916980266571, -0.4636753499507904, 0.29154834151268005, 0.5634074211120605, -0.06019189953804016, -0.13776609301...
We log values and we only log them once in a table. When we add values to the table we have to do a look up everytime to see if it needs to insert the value or just grab the id. We have an index on the table (not on the primary key) but there are about 350,000 rows (so it is taking 10 seconds to do 10 of these values)....
[ 0.37339290976524353, 0.03287189081311226, 0.29657939076423645, 0.33823832869529724, 0.29051798582077026, -0.08895669877529144, 0.3945375680923462, -0.12516596913337708, -0.2771149277687073, -0.5970990061759949, 0.22320809960365295, 0.4635483920574188, -0.009296777658164501, -0.188376858830...
to the table vs. reading from it. If you have frequent writes and occasional reads, consider just always doing inserts and then handle collapsing the values when doing a select. If you're trying to put everything in one table, consider breaking them out into separate tables to cut down on size, or barring that use par...
[ 0.2290535420179367, -0.2660892903804779, -0.2869360148906708, 0.10978339612483978, -0.024041438475251198, -0.0623687244951725, -0.18184511363506317, -0.09030259400606155, -0.3987175226211548, -0.8337122201919556, 0.009356118738651276, 0.4726306200027466, -0.16649237275123596, 0.10747273266...
When programming by contract a function or method first checks whether its preconditions are fulfilled, before starting to work on its responsibilities, right? The two most prominent ways to do these checks are by `assert` and by `exception`. 1. assert fails only in debug mode. To make sure it is crucial to (unit) te...
[ 0.40873631834983826, -0.013630405068397522, -0.1778227835893631, -0.060121335089206696, -0.05308534577488899, -0.41335007548332214, 0.432638555765152, -0.6110042929649353, -0.10410116612911224, -0.2749199867248535, -0.4197594225406647, 0.8090789914131165, -0.15825796127319336, -0.196683526...
assert in release builds is like saying "I will never have any issues whatsoever in a release build", which is often not the case. So assert shouldn't be disabled in a release build. But you don't want the release build crashing whenever errors occur either, do you? So use exceptions and use them well. Use a good, sol...
[ 0.20249685645103455, -0.010772256180644035, -0.29224565625190735, 0.1431349813938141, -0.34129348397254944, -0.5597478151321411, 0.706612765789032, -0.02016024850308895, -0.018423618748784065, -0.263721764087677, 0.013936374336481094, 1.054221272468567, 0.07620716840028763, -0.289749503135...
**I do not currently have this issue**, but you never know, and thought experiments are always fun. **Ignoring the obvious problems that you would have to have with your architecture to even be attempting this**, let's assume that you had some horribly-written code of someone else's design, and you needed to do a bunc...
[ 0.7512601613998413, 0.18255674839019775, 0.2633449137210846, 0.07537223398685455, 0.20774272084236145, -0.06420515477657318, 0.3898985981941223, -0.022264834493398666, -0.40740057826042175, -0.535568118095398, -0.16571438312530518, 0.3169693648815155, -0.00018920970614999533, 0.30031165480...
copying and pasting try-catches around the many lines of code. How would you attempt to tackle this problem? It's pretty obvious that you'd write the code in VB.NET, which actually does have [On Error Resume Next](http://msdn.microsoft.com/en-us/library/5hsw66as.aspx), and export it in a DLL to C#. Anything else is ju...
[ 0.5679985284805298, 0.00852338969707489, -0.10281728208065033, 0.29760730266571045, -0.1524352878332138, -0.20671868324279785, 0.39871838688850403, 0.2863977551460266, -0.3529307246208191, -0.3609780967235565, 0.06740720570087433, 0.23755362629890442, -0.3007330894470215, 0.336273431777954...
I have a number of tables that use the trigger/sequence column to simulate auto\_increment on their primary keys which has worked great for some time. In order to speed the time necessary to perform regression testing against software that uses the db, I create control files using some sample data, and added running o...
[ 0.5650877952575684, 0.17633812129497528, 0.2223750203847885, 0.09964659810066223, 0.311504065990448, 0.10170643776655197, 0.194216787815094, -0.2958654463291168, -0.00006859178392915055, -0.3123411238193512, 0.23575100302696228, 0.7018833160400391, -0.14871005713939667, 0.00415701558813452...
value in column" or do I need to write out a whole script by hand that updates all these sequences, or can I/should I change the trigger that substitutes the null value for the sequence to some how check this (though I think this might cause the mutating table problem)? You can generate a script to create the sequences...
[ 0.08395542204380035, 0.1510840803384781, 0.5844420790672302, -0.24199500679969788, 0.1253659874200821, 0.19325433671474457, 0.016792820766568184, -0.1635524183511734, 0.026436850428581238, -0.5023347735404968, 0.062091778963804245, 0.42231953144073486, -0.4368375241756439, 0.08137281984090...
How far do you go with `const`? Do you just make functions `const` when necessary or do you go the whole hog and use it everywhere? For example, imagine a simple mutator that takes a single boolean parameter: ``` void SetValue(const bool b) { my_val_ = b; } ``` Is that `const` actually useful? Personally I opt to us...
[ 0.3909161388874054, -0.14418281614780426, -0.07275564968585968, -0.13657283782958984, -0.1459215134382248, -0.13561132550239563, -0.010754615068435669, -0.16339384019374847, -0.1705445647239685, -0.26446545124053955, -0.07562244683504105, 0.8878340125083923, -0.4848789870738983, 0.12124975...
int n, const long l) ``` Is there a reason for this? It seems a little unusual to me. The reason is that `const` for the parameter only applies locally within the function, since it is working on a copy of the data. This means the function signature is really the same anyways. It's probably bad style to do this a lot...
[ 0.35780489444732666, 0.23596997559070587, 0.3951893448829651, -0.11346416175365448, -0.07067162543535233, 0.041882969439029694, 0.1723698526620865, 0.12066681683063507, -0.2456512302160263, -0.340298593044281, 0.13481810688972473, 0.558440089225769, -0.3216106593608856, 0.38764292001724243...
use `const_iterator` though when looping on something and I don't intend on modifying it, so I guess to each his own, as long as `const` correctness for reference types is rigorously maintained.
[ 0.3915873169898987, 0.30973225831985474, 0.14009414613246918, 0.1735190600156784, -0.021948514506220818, -0.36528313159942627, 0.06844896823167801, -0.1302967071533203, 0.1191835105419159, -0.2646786570549011, -0.2279224693775177, 0.48272842168807983, -0.25043025612831116, -0.1345126330852...
I have two files (f1 and f2) containing some text (or binary data). How can I quickly find common blocks? e.g. f1: ABC DEF f2: XXABC XEF output: common blocks: length 4: "ABC " in f1@0 and f2@2 length 2: "EF" in f1@5 and f2@8 Wikipedia has some [pseudocode](http://en.wikipedia.org/wiki/Longest_common_sub...
[ 0.2351686954498291, 0.2996310889720917, 0.09399571269750595, -0.049211058765649796, -0.19252215325832367, -0.008672080002725124, 0.25162315368652344, -0.16657119989395142, -0.1416987031698227, -0.7006021738052368, -0.10409040004014969, 0.1892845630645752, -0.1041608676314354, 0.16098786890...
I'm using Express currently. What extra features do I get with the full edition? There are no differences in Management Studio. The differences are in the database engine LIMITATIONS! The engine is the same but it will deny you some features. Import/Export wizard in the express edition can be found at: C:\Program File...
[ -0.22021383047103882, 0.049172293394804, 0.322244793176651, -0.00907256081700325, -0.3023086488246918, -0.19286102056503296, 0.3483634889125824, 0.010492219589650631, 0.019762182608246803, -0.6077289581298828, 0.14993341267108917, 0.499702513217926, -0.1801934838294983, -0.1520138680934906...
of the SQL Server. Even if you have it installed your express edition server engine will refuse to work with it.
[ -0.06681851297616959, 0.2466634064912796, 0.2594321072101593, 0.234340101480484, 0.013616910204291344, -0.3873603343963623, 0.1709100604057312, 0.21117939054965973, 0.15088650584220886, -0.46688950061798096, 0.10033352673053741, 0.47550931572914124, -0.5570777654647827, 0.18441760540008545...
My Virtual Machine's clock drifts pretty significantly. There's documentation out there about dealing with this, but nothing seems to be working very well. Anyone have any suggestions, things that worked well for them, ... Supposedly updating regularly via ntp is not a good solution. vmware have [a really good PDF do...
[ 0.652364194393158, 0.10622171312570572, 0.3856438994407654, 0.2961161732673645, -0.08037088066339493, -0.08495253324508667, 0.16498473286628723, 0.33798104524612427, -0.4737307131290436, -0.5217291712760925, 0.44943225383758545, 0.3640650510787964, -0.09059605002403259, 0.44569340348243713...
a guest OS that has a low frequency tick rate. Newer versions of Linux come with 1000Hz ticks, but it used only to be 100Hz. That seems easier for the host to deliver. A kernel rebuild is usually needed to change the HZ value.
[ -0.16089574992656708, -0.4257779121398926, 0.6103639602661133, 0.24338799715042114, -0.0013106210390105844, -0.10658520460128784, 0.5032812356948853, 0.21178452670574188, -0.08499044179916382, -0.5742732286453247, -0.2985284626483917, 0.4522008001804352, -0.30943790078163147, 0.31743770837...
I am working on a project that has grown to a decent size, and I am the only developer. We currently don't use any version control, but I definitely need to start. I want to use Subversion. What would be the best way to transfer an existing project to it? I have a test server that I use for developing new features, t...
[ 0.7246227264404297, -0.07024919986724854, 0.07961718738079071, 0.04963884875178337, -0.08917839825153351, -0.1959211826324463, 0.11180830746889114, 0.1887696087360382, -0.18172147870063782, -0.7839901447296143, 0.06129012256860733, 0.4057525098323822, 0.016032129526138306, 0.07857251912355...
a little on the previous answer... 1) Create a new SVN repository 2) Commit all the code you've worked on so far to it 3) Check all that code OUT again, to create a working copy on your dev machine 4) Work! It's definitely not a hurdle, really.
[ 0.45114096999168396, -0.15896108746528625, 0.06154078617691994, 0.5818940997123718, 0.011876078322529793, -0.24768543243408203, 0.4226919710636139, -0.0028102551586925983, -0.06377445161342621, -0.49534276127815247, 0.3453708589076996, 0.6930000185966492, 0.0009964157361537218, -0.19414904...