text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
Manual](https://rads.stackoverflow.com/amzn/click/com/0387948600)
I also recommend you check out the [Stony Brook Algorithm Repository](http://www.cs.sunysb.edu/~algorith/), particularly the [lectures](http://www.cs.sunysb.edu/~algorith/video-lectures/). | [
-0.0422234870493412,
0.0032644758466631174,
0.1750357300043106,
0.29329848289489746,
-0.02928234450519085,
-0.22190526127815247,
0.017354218289256096,
-0.3290921151638031,
-0.08728770911693573,
-0.4848373532295227,
-0.5257994532585144,
0.750420093536377,
0.1962278187274933,
-0.282473623752... | |
Is there a simple way to detect, within Python code, that this code is being executed through the Python debugger?
I have a small Python application that uses Java code (thanks to JPype). When I'm debugging the Python part, I'd like the embedded JVM to be passed debug options too.
A solution working with Python 2.4 (i... | [
0.29883918166160583,
0.09358372539281845,
0.18265001475811005,
-0.12339659035205841,
-0.258399099111557,
-0.27278560400009155,
0.4279513657093048,
-0.4042050540447235,
-0.14435651898384094,
-0.49909090995788574,
-0.0791090726852417,
0.49723654985427856,
-0.6069198846817017,
0.0384591743350... | |
suggested, it tries to find the debugger within the stack of the caller.
Useful links:
* [The Python Debugger](https://docs.python.org/library/pdb.html)
* [The interpreter stack](https://docs.python.org/library/inspect.html#the-interpreter-stack) | [
-0.042320553213357925,
0.07559549063444138,
-0.007401575334370136,
-0.13480527698993683,
-0.08903432637453079,
0.03952346369624138,
0.4487830400466919,
-0.21415679156780243,
0.07901115715503693,
-0.36612173914909363,
-0.22146226465702057,
0.5681675672531128,
-0.2695311903953552,
-0.1700983... | |
I have been trying to get more in to TDD. Currently keeping it simple with lots of `Debug.Asserts` in a console application.
Part of the tests I wanted to complete was ensuring that events were raised from the object, the correct number of times, since client code will depend on these events.
So, I began thinking abo... | [
0.7126781940460205,
-0.34715479612350464,
0.16997042298316956,
-0.018367426469922066,
-0.15761251747608185,
-0.05476627126336098,
0.17488554120063782,
-0.10923983156681061,
-0.28277787566185,
-0.6510690450668335,
0.31804153323173523,
0.4306405484676361,
-0.3918866515159607,
-0.036918047815... | |
events are then hooked up to the monitor, with delegates created which both count and log when the event is raised.
I then go back to my test code and do something like:
```
bool Test()
{
MyObject mo = new MyObject();
MyMonitor mon = new MyMonitor(mo);
// Do some tests that should cau... | [
0.04939869046211243,
-0.2623150050640106,
0.19877368211746216,
-0.09699827432632446,
0.18299899995326996,
-0.04504580795764923,
0.21651533246040344,
-0.2908603847026825,
-0.23059502243995667,
-0.5907148718833923,
-0.06106238067150116,
0.859495997428894,
-0.23624277114868164,
-0.14797261357... | |
fine, and when I intentionally busted my code, the tests failed as expected, but **I wonder, is this too much "free form" test code (i.e. code without supporting tests)?**
---
**Additional Thoughts**
* Do you test for events?
* *How* do you test for events?
* Do you think the above has any holes/room for improvement... | [
0.6419423818588257,
0.246342271566391,
-0.06766114383935928,
0.3776434063911438,
-0.17861878871917725,
-0.3265434205532074,
0.4795185327529907,
0.04919598624110222,
-0.1540207713842392,
-0.5853750109672546,
-0.04813351854681969,
0.6568419933319092,
-0.00994374230504036,
-0.2506623864173889... | |
I've done about the same thing. I've written monitor objects in several projects. Usually they're a bit more generic than your monitor. They just expose public methods that you can subscribe to events and they count the number of times they've been called. This way you can reuse monitor objects for different events.
S... | [
0.3440169394016266,
-0.12365168333053589,
0.19565841555595398,
0.06081560626626015,
-0.3503972291946411,
-0.17949841916561127,
0.303784042596817,
-0.14174872636795044,
-0.11718210577964783,
-0.7907285690307617,
0.1386905461549759,
0.6523663997650146,
-0.7006701827049255,
0.1102440655231475... | |
I just have the standard void EventCatcher(object sender, EventArgs arguments). You could make this more generic by subscribing a lambda of the right type to the event and calling EventCatcher in the lambda. This makes your tests a bit harder to read though. You can also use generics to make the EventCatcher method wor... | [
0.09081829339265823,
-0.23499326407909393,
0.03132083639502525,
0.053529221564531326,
-0.3089679777622223,
-0.15418942272663116,
0.05569089576601982,
0.0331069678068161,
-0.13231801986694336,
-0.26569506525993347,
0.2318979948759079,
0.653290331363678,
-0.5165061950683594,
0.09629121422767... | |
sense for tests with more complex assertions.
Instead of creating your own monitor you let your mocking framework of choice create it for you, you just create an interface for the class that handles the event. Something like this:
```
public interface IEventHandlerStub
{
event EventHandler<T> Event(object sender,... | [
0.43593093752861023,
-0.0930040031671524,
0.389865905046463,
0.33316415548324585,
-0.30774804949760437,
0.023878803476691246,
0.49589329957962036,
-0.4848223924636841,
-0.08161484450101852,
-0.7257529497146606,
0.7093857526779175,
0.8242416381835938,
-0.4352990984916687,
0.0529147051274776... | |
of your mocking framework for it.
*On another note*. Rob and I are working on a generic event-testing monitor class that might make some of this more easy. If people are interested in using something like this I'd like to hear from you. | [
0.8320146203041077,
-0.01265749242156744,
-0.19937007129192352,
0.30461689829826355,
-0.15741753578186035,
-0.4972549378871918,
0.4534471333026886,
0.7330271005630493,
-0.22392553091049194,
-0.47602546215057373,
0.41433003544807434,
0.2731131911277771,
0.10528693348169327,
0.02361782081425... | |
When trying to launch and run a flex/java project in eclipse I kept getting a "Out of Memory Exception" and "Java Heap Space" using Eclipse, Tomcat and a JRE.
While researching trying to adjust the memory settings I found three places to adjust these:
* Eclipse.ini
* The JRE Settings under Window > Preferences
* Cata... | [
0.44664743542671204,
-0.03479090332984924,
-0.0340966172516346,
0.45805299282073975,
-0.2943263053894043,
-0.04093438759446144,
-0.06117326021194458,
-0.19988654553890228,
-0.42884591221809387,
-0.4633270800113678,
0.24700258672237396,
0.4286399781703949,
0.05327501520514488,
-0.4230580627... | |
is the start memory (at the VM start), -xmx is the maximum memory for the VM
* eclipse.ini : the memory for the VM running eclipse
* jre setting : the memory for java programs run from eclipse
* catalina.sh : the memory for your tomcat server | [
0.1937667280435562,
-0.31125056743621826,
0.4499017596244812,
0.2003980129957199,
-0.12155921757221222,
-0.17856794595718384,
-0.07605662196874619,
-0.08777265250682831,
-0.17742137610912323,
-0.24644656479358673,
-0.03503114730119705,
0.25372767448425293,
0.08538307994604111,
-0.304925382... | |
I want to check for data, but ignore it if it's null or empty. Currently the query is as follows...
```
Select
Coalesce(listing.OfferText, company.OfferText, '') As Offer_Text,
from tbl_directorylisting listing
Inner Join tbl_companymaster company
On listing.company_id= company.... | [
0.07640254497528076,
0.3446710407733917,
0.5116416215896606,
-0.2942047417163849,
-0.05203885957598686,
0.11477102339267731,
0.05505054444074631,
-0.1828456073999405,
-0.07402874529361725,
-0.5890058279037476,
-0.12602216005325317,
0.3514310121536255,
-0.15444692969322205,
0.29175701737403... | |
```
SELECT
ISNULL(NULLIF(listing.Offer_Text, ''), company.Offer_Text) AS Offer_Text
FROM ...
```
is the most elegant solution.
And to break it down a bit in pseudo code:
```
// a) NULLIF:
if (listing.Offer_Text == '')
temp := null;
else
temp := listing.Offer_Text; // may now be null or non-null, but not ''
/... | [
-0.15112097561359406,
0.20973365008831024,
0.4504762887954712,
-0.6418079733848572,
-0.1356164813041687,
0.14293496310710907,
0.09229625016450882,
-0.32655301690101624,
-0.08002692461013794,
-0.5320526957511902,
-0.4623168706893921,
0.419221967458725,
-0.3694589138031006,
-0.08274012804031... | |
I'm making modifications to a members-based site whose owner wants to be able to track time spent on site (login/logout) for all users in a DB backend. Login is easy; there's one point of entry (the login form) and as a result, logins can be thrown in the database as soon as they happen.
Logouts, however, are a bit tr... | [
0.6876124739646912,
0.1092856377363205,
0.350890189409256,
-0.02176985889673233,
0.23586758971214294,
-0.12301865220069885,
0.15972474217414856,
-0.07323528826236725,
-0.34939655661582947,
-0.7350066900253296,
-0.13480456173419952,
0.18664708733558655,
-0.10462760180234909,
0.1587976515293... | |
each pageload in the database and associate it with the user that loaded it; the problem with that is that the site is a membership-based video delivery site (not what you're thinking!) and their last pageview is likely going to be a twenty or thirty minute video. We need to capture that time spent on that last page, a... | [
0.3460351228713989,
-0.16023236513137817,
0.6096460223197937,
0.3466930389404297,
-0.07142537087202072,
-0.23863807320594788,
0.08423662930727005,
0.011441860347986221,
-0.32873284816741943,
-0.37098386883735657,
-0.032032560557127,
0.39185285568237305,
-0.29294005036354065,
0.113357201218... | |
whatever doesn't die as soon as the page is unloaded); the problem there is that internal links also register as unload events, so clicking any link would log the user out (you could to check a flag in the 'unload' handler, and have all internal links set that flag--not hard to do dynamically, but a bit kludgy). The ot... | [
0.2792699635028839,
-0.2111554890871048,
0.5433935523033142,
0.07946544140577316,
-0.06421138346195221,
-0.32901397347450256,
0.4965974688529968,
0.09159374982118607,
-0.45116889476776123,
-0.36819902062416077,
-0.07696627080440521,
0.42177650332450867,
-0.2685198187828064,
0.2447829544544... | |
total length of that session; that also seems kind of hackish. Also, neither of these solutions work for users with JS disabled.
It seems that this problem isn't that unusual, and there's got to be a better way; is there a best-practices approach to solving this? If not, do you see any way to improve either of these s... | [
0.42181193828582764,
-0.26603856682777405,
0.18593265116214752,
0.2940024137496948,
-0.06668119132518768,
-0.23974847793579102,
0.6307599544525146,
0.2941065728664398,
-0.638519287109375,
-0.45488256216049194,
0.16397511959075928,
0.4629397392272949,
-0.17088545858860016,
-0.15867149829864... | |
and that event might not fire until 20 minutes after the user abandoned the page.
Now you could improve on this a little by putting an ajax request in a timer on each page (perhaps once or twice per minute) to provide a "heartbeat", but this has some caveats as well: You need to make sure the session will still eventu... | [
0.3721417486667633,
-0.08992417901754379,
0.3450568616390228,
0.05442234128713608,
-0.09742145985364914,
-0.38972586393356323,
0.6844006776809692,
-0.011016891337931156,
-0.29718753695487976,
-0.6752310395240784,
0.05056157335639,
0.2618522346019745,
-0.06335519999265671,
-0.25498574972152... | |
I need a regex for the following pattern:
* Total of 5 characters (alpha and numeric, nothing else).
* first character must be a letter (`A`, `B`, or `C` only)
* the remaining 4 characters can be number or letter.
Clarifcation: the first letter can only be `A`, `B`, or `C`.
Examples:
* `A1234` is valid
* `D1234` is... | [
-0.0610782653093338,
0.21890904009342194,
0.5769025087356567,
-0.03302638232707977,
0.05864468589425087,
0.3591032922267914,
0.4013093113899231,
-0.3863961398601532,
0.3250346779823303,
-0.4766235053539276,
-0.4433637261390686,
0.5541396737098694,
-0.20373356342315674,
0.19230255484580994,... | |
or numbers" | [
0.40022093057632446,
0.17149224877357483,
0.4038611650466919,
0.21908947825431824,
0.33510255813598633,
0.24382373690605164,
-0.2804318368434906,
0.1503002643585205,
-0.5012452602386475,
-0.09789150953292847,
0.12906476855278015,
0.39403828978538513,
-0.2757028341293335,
0.1386543810367584... | |
I created a vbscript custom action which checks for some registry keys and alters them if neccessary. In case a key could not be written or something like that, the setup should be aborted.
In order to achieve this, I set a property which I tried to use as a condition for the next step within the execute sequence but ... | [
0.44003716111183167,
-0.034611646085977554,
0.28257304430007935,
0.011551056988537312,
0.3335352838039398,
-0.208867147564888,
0.6728726625442505,
-0.3159197270870209,
-0.13067223131656647,
-0.32278937101364136,
-0.016904110088944435,
0.5919142961502075,
-0.46746015548706055,
0.19867758452... | |
custom action says? Is there a method to pass an "abort installation request" to the Installer or something like that?
If you search on <http://community.installshield.com> you'll find an article by Robert Dickau entitled "Exiting an MSI Installation from a Custom Action". It's at the following link:
<http://community... | [
0.28852909803390503,
0.0585457943379879,
0.3265637159347534,
-0.21342653036117554,
0.033798880875110626,
0.06003560498356819,
0.6126279234886169,
-0.23565782606601715,
-0.4004916548728943,
-0.30100488662719727,
-0.17623989284038544,
0.4616708755493164,
-0.45478299260139465,
-0.033741962164... | |
I've had a couple of complaints that one of our managed apps is using 20-25Mb of RAM. I normally push back and say that memory's cheap; get over it.
Is this reasonable for a Windows Forms app?
20-25MB is nothing.
The .Net framework doesn't always recycle RAM right away anyway. Over time I've seen apps grow to peak at... | [
0.42655453085899353,
0.2988163232803345,
0.3373609185218811,
0.19668427109718323,
0.1706131547689438,
-0.1108773797750473,
0.2867559790611267,
0.057579733431339264,
-0.4329421818256378,
-0.6376069188117981,
0.13220542669296265,
0.6141765713691711,
-0.08118674904108047,
-0.1208910346031189,... | |
lot of old RAM yet. If the operating system had need of that RAM rest assured that it would be collected. The idea that an app should only use a few hundred K at most just doesn't apply in a *managed* environment — for operating system processes , yes. For native apps, maybe. But not managed code. Otherwise you just en... | [
0.4334188401699066,
0.4908992648124695,
0.1913265734910965,
0.25782936811447144,
0.21272502839565277,
0.32030490040779114,
0.4590117037296295,
0.2519225478172302,
-0.5652342438697815,
-0.3881937265396118,
0.008978513069450855,
0.5347357392311096,
-0.07653918862342834,
-0.12162822484970093,... | |
I would like to document the file format of regedit utility, so data can be merged into the registry.
From the command-line you can (silently) merge data from a batch file like this:
```
regedit /s file.reg
```
Exporting from a subkey goes like this:
```
regedit /e file.reg "HKEY_XX\key"
```
Remove keys and valu... | [
0.043772198259830475,
0.1111084595322609,
0.3519551455974579,
-0.1935509443283081,
0.02854694239795208,
0.2227414846420288,
0.058197539299726486,
-0.11712881177663803,
-0.3597308099269867,
-0.6026058793067932,
-0.25080224871635437,
0.2420390099287033,
-0.25329771637916565,
0.30788025259971... | |
I have been asked to find training resources to bring engineers up to speed on VBA programming.
The target trainee will have some systems engineering experience but little to no non-systems programming experience.
I'm hoping for a computer-based training course or DVD that we can purchase and give to the engineers f... | [
0.8824470043182373,
0.33918440341949463,
0.3345857560634613,
-0.13353002071380615,
-0.05301126092672348,
-0.0882326140999794,
0.40142178535461426,
0.05193260312080383,
-0.14179018139839172,
-0.5328599810600281,
-0.03888074681162834,
0.8582445979118347,
0.43907850980758667,
-0.1278040409088... | |
in non-Office products.
While reference materials are useful, I really need something that guides them through the basics.
Remove keys and values by using the minus sign (-).
```
REGEDIT4
[-HKEY_CURRENT_USER\RemoveThisTree]
[HKEY_CURRENT_USER\RemoveValue]
"valueName"=-
```
### References
* Minus sign to delete me... | [
-0.2078893482685089,
0.24093419313430786,
0.5261203050613403,
0.0369708426296711,
0.314812034368515,
0.13182522356510162,
0.2091781198978424,
-0.1051177904009819,
-0.2011958658695221,
-0.3766172230243683,
-0.6744107007980347,
0.19639615714550018,
-0.23103372752666473,
0.31895560026168823,
... | |
What is the preferred/easiest way to manipulate TDesC strings, for example to obtain a substring.
I will give you an example of my scenario.
```
RBuf16 buf;
...
CEikLabel label;
...
label->SetTextL(buf); // (SetTextL takes a const TDesC&)
```
I want to get a substring from buf. So do I want to manipulate the RBuf16... | [
0.2100859135389328,
-0.09918522089719772,
0.46812835335731506,
-0.12319359928369522,
-0.038407791405916214,
0.13032273948192596,
0.2186966985464096,
-0.23078791797161102,
0.09060090035200119,
-0.5205244421958923,
-0.1654772311449051,
0.6578629016876221,
-0.4306633174419403,
-0.063316635787... | |
original data).
You can use the TDes::Copy function if you want to create a copy of your substring. | [
0.52015221118927,
-0.369976669549942,
0.2606920003890991,
0.3471899628639221,
0.1187710240483284,
-0.23286768794059753,
0.07266225665807724,
-0.20037007331848145,
-0.10401396453380585,
-0.3787885904312134,
-0.24715591967105865,
0.5125259757041931,
-0.35444751381874084,
0.24226771295070648,... | |
I've seen (and used) code to have a link spawn a javascript action many times in my life, but I've never come to a firm conclusion on if the href attribute should be blank or #. Do you have any preference one way or the other, and if so, why?
```
<a href="" onclick="javascript: DoSomething();">linky</a>
```
or
```
... | [
0.3637308180332184,
-0.14896994829177856,
0.3932448625564575,
-0.010966901667416096,
-0.15682868659496307,
-0.29512929916381836,
0.18998469412326813,
-0.13328257203102112,
-0.07190245389938354,
-0.6885617971420288,
-0.27618876099586487,
0.472988098859787,
-0.2742936611175537,
0.13908794522... | |
`onmouseover`, `on...`) are already treated as javascript: you don't need to preface it with `javascript:`
So given your example, the best way to do that inline (which itself is not the best way, *probably*), is like this:
```
<a href="#" onclick="DoSomething(); return false">linky</a>
``` | [
0.4291808009147644,
0.06490487605333328,
0.5267871022224426,
0.021734649315476418,
-0.07410907745361328,
-0.27294930815696716,
0.2337476760149002,
-0.04725150391459465,
0.01797497645020485,
-0.6177247166633606,
-0.025523409247398376,
0.6607645750045776,
-0.3310524523258209,
0.0069758924655... | |
Visual Studio has certainly gone from strength to strength since humble Visual Studio 6 (and previous renditions). There seems to be a lot more coming in Visual Studio 2010 (based on blogs, the PDC and the more recent CTP virtual machines).
The recent Service Pack 1 seemed to introduce some really intriguing new funct... | [
0.2203901708126068,
-0.3683147132396698,
0.2750597596168518,
-0.11615966260433197,
-0.5482088327407837,
-0.2906288802623749,
0.004978658631443977,
0.0443478487432003,
-0.2584167420864105,
-0.6106559634208679,
-0.2363329380750656,
0.8674026131629944,
-0.12897989153862,
-0.369722455739975,
... | |
I know it's probably not the right way to structure a database but does the database perform faster if the data is put in one huge table instead of breaking it up logically in other tables?
I want to design and create the database properly using keys to create relational integrity across tables but when quering, is JO... | [
0.4867932200431824,
0.4114113748073578,
0.23692798614501953,
0.18369019031524658,
0.06135060265660286,
-0.10441489517688751,
0.16496603190898895,
-0.21827253699302673,
-0.29633498191833496,
-0.5703899264335632,
0.41146767139434814,
0.39233723282814026,
-0.022701073437929153,
0.401312559843... | |
pattern? Are there different usage patterns for different subsets of the columns in the table? (i.e., are two columns hit 1000 times per second, and the other 50 columns only hit once or twice a day? ) this scenario would be a prime candidate to split (partition) the table vertically (two columns in one table, the rest... | [
0.24366971850395203,
-0.25140318274497986,
0.07933281362056732,
0.04721041023731232,
-0.06963153928518295,
0.0896681547164917,
0.282164067029953,
-0.41395387053489685,
-0.2790972888469696,
-0.82674241065979,
0.047936685383319855,
0.19995158910751343,
-0.379933625459671,
-0.0284330993890762... | |
Scenario:
Let's say I have four very similar applications (i.e. most of the functionality is the same, but they are different enough to justify each being seperate applications).
What is the best way to re-use the common functionality code between them? COM+? Web services?
In general I'd typically just have the code... | [
0.3257014751434326,
-0.12105788290500641,
0.07477295398712158,
0.2557150721549988,
-0.13438381254673004,
0.213870108127594,
0.0007378202863037586,
-0.1167810782790184,
-0.2669402062892914,
-0.7505946159362793,
0.1887153834104538,
0.6387776136398315,
-0.11717497557401657,
0.0831687301397323... | |
Website projects. The web projects would have a "project" type reference to the DLL project, and everything would build at the same time. Then you could use the "Publish" tool for each of your web projects as needed. | [
0.6407138109207153,
-0.24130384624004364,
0.16053733229637146,
0.4034402072429657,
-0.35690516233444214,
-0.41378670930862427,
0.02121684141457081,
0.1252254992723465,
-0.39193567633628845,
-0.5767434239387512,
0.022968275472521782,
0.2603752613067627,
-0.16666483879089355,
0.1103118807077... | |
We have recently been faced with the problem of porting our C++ framework to an ARM platform running uClinux where the only vendor supported compiler is GCC 2.95.3. The problem we have run into is that exceptions are extremely unreliable causing everything from not being caught at all to being caught by an unrelated th... | [
-0.08481358736753464,
0.26428112387657166,
0.12527629733085632,
0.010223851539194584,
-0.015231659635901451,
-0.26168093085289,
0.48845499753952026,
-0.11512379348278046,
-0.4615425765514374,
-0.2995150089263916,
-0.17267853021621704,
0.2801486551761627,
-0.4104817509651184,
0.137908622622... | |
a constructor failed.
We have tried [lazy evaluation](http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=264), where each method has the ability to instantiate dynamic resources and return a status value but that means that every class method has to return a return value which makes for a **lot** of ifs in... | [
0.11463462561368942,
-0.08486756682395935,
0.2064938098192215,
0.31667014956474304,
-0.010173089802265167,
0.006532089319080114,
0.5669733881950378,
-0.19674992561340332,
-0.4017524719238281,
-0.3937694728374481,
-0.03843584656715393,
0.3701742887496948,
-0.41787296533584595,
0.28598994016... | |
a status value if you want to act on the actual error.
According to Google's C++ Style Guide they [do not use exceptions](http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Exceptions) and only do trivial work in their constructors, using an init method for non-trivial work ([Doing Work in Constructors](ht... | [
0.028782548382878304,
0.1911315768957138,
0.3084292709827423,
0.05050049349665642,
0.120741106569767,
-0.10911377519369125,
0.5321153402328491,
0.038235899060964584,
-0.35980895161628723,
-0.5345417857170105,
-0.26945656538009644,
0.3115902245044708,
-0.19797967374324799,
-0.27734312415122... | |
// phew, we got away with it. Now for the next object...
}
```
And this for objects on the heap. I assume you override global operator new with something that returns NULL instead of throwing, to save yourself remembering to use nothrow new everywhere:
```
MyClassWithNoThrowConstructor *foo = new MyClassWithNoThrowC... | [
-0.13891683518886566,
0.214056596159935,
0.18625105917453766,
-0.0800979733467102,
0.05591905862092972,
-0.0665569081902504,
0.47801217436790466,
-0.237240269780159,
-0.3552740514278412,
-0.4819633364677429,
0.08488535135984421,
0.592837929725647,
-0.20560163259506226,
-0.05710486322641373... | |
having to remember the deletes, but if your compiler doesn't support exceptions properly, then you might have trouble getting Boost or TR1. I don't know.
You also might want to structure the logic differently, or abstract the combined new and init, to avoid deeply-nested "arrow code" whenever you're handling multiple ... | [
-0.016186395660042763,
0.19789814949035645,
0.0785842090845108,
0.10071466863155365,
0.02421720325946808,
0.12578560411930084,
0.4201129078865051,
-0.31442275643348694,
-0.1732618659734726,
-0.38765138387680054,
-0.10570438206195831,
0.8319976925849915,
-0.09818154573440552,
-0.28121498227... | |
it just stores them). The init method can then do the real work, which might fail, and in this case returns 0 success or any other value for failure.
You probably need to enforce that every init method across your whole codebase reports errors in the same way: you do *not* want some returning 0 success or a negative ... | [
-0.22694727778434753,
-0.07929687947034836,
-0.09448808431625366,
0.34672868251800537,
-0.25328168272972107,
-0.1434021145105362,
0.5326547026634216,
0.13331320881843567,
-0.0720989778637886,
-0.5274378061294556,
-0.19706058502197266,
0.3981354534626007,
-0.3973570466041565,
-0.16140571236... | |
API docs online. Symbian uses C++ without exceptions: it does have a mechanism called "Leave" that partially makes up for that, but it's not valid to Leave from a constructor, so you have the same basic issue in terms of designing non-failing constructors and deferring failing operations to init routines. Of course wit... | [
0.4130564033985138,
0.04582929611206055,
0.02616932988166809,
-0.252240926027298,
0.07968448847532272,
-0.25637316703796387,
0.3182573914527893,
-0.11126959323883057,
-0.09593906253576279,
-0.2412358820438385,
-0.21095527708530426,
0.4770143926143646,
-0.5260897874832153,
-0.04504447802901... | |
from somewhere in a way that might fail, defer that to the init and leave the value default-initialised in the ctor.
* If your object holds a pointer, set it to null in the ctor and set it "properly" in the init.
* If your object holds a reference, either change it to a (smart) pointer so that it can null to start with... | [
0.32125091552734375,
0.06661533564329147,
0.3011346757411957,
0.029476817697286606,
-0.01987134851515293,
-0.23700521886348724,
0.47423285245895386,
-0.2490207403898239,
-0.15865077078342438,
-0.48937922716140747,
-0.37173500657081604,
0.6483221054077148,
-0.218813955783844,
-0.06736981123... | |
it's perfectly OK to construct your members (and base classes) in the initializer list in the usual way.
* Make sure you keep track of what's set and what isn't, so that the destructor works when the init fails.
* All functions other than constructors, the destructor, and init, can assume that init has succeeded, provi... | [
0.14930877089500427,
-0.12777844071388245,
-0.21040931344032288,
0.05096738785505295,
-0.2392754852771759,
0.0015026116743683815,
0.6136568784713745,
-0.2264443039894104,
-0.13962367177009583,
-0.44644680619239807,
-0.4472465217113495,
0.45977747440338135,
-0.40340715646743774,
-0.33357766... | |
offer multiple constructors.
* You can't provide implicit conversions that might fail, so if your code currently relies on implicit conversions which throw exceptions then you have to redesign. Same goes for most operator overloads, since their return types are constrained. | [
0.040995966643095016,
0.06746183335781097,
-0.12655878067016602,
0.152099609375,
-0.07954549789428711,
0.12679682672023773,
0.4853508174419403,
-0.2666657269001007,
-0.09661898016929626,
-0.8803554177284241,
-0.15037885308265686,
0.6898053288459778,
-0.22682613134384155,
-0.121934160590171... | |
Here is the situation:
I have been called upon to work with InstallAnywhere 8, a Java-based installer IDE, of sorts, that allows starting and stopping of windows services, but has no built-in method to query their states. Fortunately, it allows you to create custom actions in Java which can be called at any time durin... | [
0.5307078957557678,
-0.04845365509390831,
-0.19509579241275787,
-0.12010809779167175,
-0.024010704830288887,
-0.2958107888698578,
0.3111862242221832,
0.10488028079271317,
-0.3113596439361572,
-0.5225938558578491,
-0.044017285108566284,
0.7429853677749634,
-0.21236498653888702,
-0.062399841... | |
the script is run, there is almost no way to verify that it succeeded, so I'm trying to avoid that.
Any suggestions or criticisms are welcome.
here's what I had to do. It's ugly, but it works beautifully.
```
String STATE_PREFIX = "STATE : ";
String s = runProcess("sc query \""+serviceName+"\"");
// che... | [
-0.040077194571495056,
-0.06343089789152145,
0.45931318402290344,
-0.12450191378593445,
0.10653453320264816,
0.07108849287033081,
0.77309650182724,
-0.1301313042640686,
-0.062256209552288055,
-0.8477681875228882,
-0.11696860194206238,
0.27783122658729553,
-0.3059660792350769,
0.08589421212... | |
{
case (1): // service stopped
break;
case (4): // service started
break;
}
}
```
`runProcess` is a private method that runs the given string as a command line process and returns the resulting output. As I said, ugly, but works. Hope this helps. | [
0.2567634582519531,
0.10964672267436981,
0.08866411447525024,
-0.26531484723091125,
0.09914641827344894,
-0.0326489582657814,
0.5156534314155579,
0.23604419827461243,
-0.04911902919411659,
-0.44545701146125793,
-0.23057153820991516,
0.5082199573516846,
-0.48257118463516235,
0.2812727391719... | |
I have a couple of nagging compiler warnings for an app that I ported from VB6 a while back regarding CLS-Compliance including:
```
Name '_AnIdentifier' is not CLS-Compliant.
Type of parameter 'myType' is not CLS-Compliant.
```
Despite this, my app seems to perform just fine from COM and Managed clients. I have seen... | [
0.28974002599716187,
0.41432806849479675,
0.043115634471178055,
-0.027904454618692398,
-0.22827278077602386,
-0.21284449100494385,
0.357077956199646,
0.12114999443292618,
-0.16262884438037872,
-0.5638867020606995,
0.06554142385721207,
0.7491471171379089,
-0.36215245723724365,
0.24557644128... | |
yet?
Basically, your class may not be accessible (or may act oddly, such as large positive numbers being treated as negative), when used with some .NET languages. I cannot say what languages they might be.
For example, I don't believe a language is required to recognize an identifer that begins with an underscore. C# ... | [
0.5821337103843689,
0.05177576467394829,
-0.20941653847694397,
0.4380561411380768,
0.23003125190734863,
-0.3298637866973877,
0.30596214532852173,
0.3316379487514496,
0.13631770014762878,
-0.30779197812080383,
-0.013451679609715939,
0.30502280592918396,
0.08207469433546066,
0.16704757511615... | |
I'm migrating a website made in classic asp to asp.net, but the asp.net dev server doesn't handle .asp pages.
Is it possible to make it run .asp pages? Maybe a custom httphandler for .asp?
thanks!
Are you running Winxp with IIS installed? If so, here's what I do: hit the asp pages in the browser using your local IIS,... | [
0.45755717158317566,
-0.23873864114284515,
0.2979851961135864,
0.2198410928249359,
-0.09608757495880127,
-0.10743684321641922,
0.3749922513961792,
-0.02002023160457611,
-0.22655680775642395,
-1.050665020942688,
-0.08693349361419678,
0.732774019241333,
-0.19843214750289917,
0.37979149818420... | |
sure the you have setup the virtual directory to allow ASP server-side debugging. After attaching to that process, you can set breakpoints, etc. as usual. | [
0.38214290142059326,
-0.11225130409002304,
0.25407350063323975,
0.3623083531856537,
0.3369547426700592,
-0.5967285633087158,
0.2055908888578415,
0.15267564356327057,
-0.36599215865135193,
-0.3529069423675537,
-0.28642165660858154,
0.39940887689590454,
0.02521800622344017,
-0.12248290330171... | |
I have a legacy MS Access 2007 table that contains 52 fields (1 field for each week of the year) representing historical sales data (plus one field for the year actually). I would like to convert this database into a more conventional Time/Value listing.
Does anyone knows how to do that without writing queries with 52... | [
0.05877995863556862,
0.05607530474662781,
0.5940274000167847,
0.00810727383941412,
-0.0288544911891222,
0.3339107036590576,
-0.06237294152379036,
-0.22357498109340668,
-0.5188667178153992,
0.023067563772201538,
0.03717143088579178,
0.40960413217544556,
-0.023058079183101654,
0.345186024904... | |
stored in the database as `pvt`, and you
> want to rotate the column identifiers
> `Emp1`, `Emp2`, `Emp3`, `Emp4`, and `Emp5` into
> row values that correspond to a
> particular vendor. This means that you
> must identify two additional columns.
> The column that will contain the
> column values that you are rot... | [
0.3127809464931488,
-0.12128417193889618,
0.6142299771308899,
0.20529325306415558,
0.3993723690509796,
0.5489276051521301,
-0.2983550429344177,
-0.19883939623832703,
-0.2473052740097046,
-0.5988194942474365,
-0.1539485901594162,
0.3969440162181854,
-0.1812484711408615,
0.24595023691654205,... | |
the
> Transact-SQL definition. Here is the
> query.
```
--Create the table and insert values as portrayed in the previous example.
CREATE TABLE pvt (VendorID int, Emp1 int, Emp2 int,
Emp3 int, Emp4 int, Emp5 int)
GO
INSERT INTO pvt VALUES (1,4,3,5,4,4)
INSERT INTO pvt VALUES (2,4,1,5,5,5)
INSERT INTO pvt VALUES (3,4... | [
-0.3375432789325714,
-0.1682748794555664,
0.459025502204895,
0.16543032228946686,
0.088155098259449,
0.6178256273269653,
-0.11825715005397797,
-0.5547255277633667,
0.056424207985401154,
-0.5184277296066284,
-0.04865065962076187,
0.5650301575660706,
-0.4121083617210388,
0.10211185365915298,... | |
Orders
1 Emp1 4
1 Emp2 3
1 Emp3 5
1 Emp4 4
1 Emp5 4
2 Emp1 4
2 Emp2 | [
-0.39813870191574097,
0.13194489479064941,
0.5750151872634888,
-0.14828285574913025,
-0.283048152923584,
0.6509277820587158,
0.7837391495704651,
-0.8530922532081604,
-0.4976606070995331,
-0.15235745906829834,
-0.07655521482229233,
-0.04861440509557724,
-0.7943434715270996,
0.17397646605968... | |
1
2 Emp3 5
2 Emp4 5
2 Emp5 5
...
``` | [
-0.2649092674255371,
-0.10154302418231964,
0.5813276171684265,
-0.37626996636390686,
-0.2829066812992096,
-0.07094365358352661,
0.5745450258255005,
-0.6461405754089355,
-0.13049791753292084,
-0.2721256613731384,
-0.15153008699417114,
0.12038513273000717,
-0.3616827726364136,
0.185517445206... | |
Do you have a default type that you prefer to use in your dealings with the results of LINQ queries?
By default LINQ will return an `IEnumerable<>` or maybe an `IOrderedEnumerable<>`. We have found that a `List<>` is generally more useful to us, so have adopted a habit of `ToList()`ing our queries most of the time, an... | [
0.25317317247390747,
0.08204546570777893,
0.4842492640018463,
0.04115546867251396,
-0.017580561339855194,
-0.34404778480529785,
-0.021668650209903717,
-0.12373019754886627,
-0.15495514869689941,
-0.47015008330345154,
-0.015511329285800457,
0.5517480969429016,
-0.2996363639831543,
0.0696097... | |
this to `System.Collections.Generic.List` in the Service Reference Settings dialog in VS2008 for consistency with the rest of our codebase.
What do you do?
`ToList` *always* evaluates the sequence immediately - not just in LINQ to SQL. If you want that, that's fine - but it's not always appropriate.
Personally I woul... | [
0.4628034830093384,
-0.20765674114227295,
0.42580175399780273,
-0.12827523052692413,
0.04963529855012894,
-0.2532657980918884,
0.1609247922897339,
-0.25509288907051086,
-0.4711325764656067,
-0.6083205938339233,
-0.08331062644720078,
0.5963225960731506,
-0.4287009835243225,
-0.0234032031148... | |
a comment, but it would be too bulky.) Deferred execution allows you to deal with data sources which are too big to fit in memory. For instance, if you're processing log files - transforming them from one format to another, uploading them into a database, working out some stats, or something like that - you may very we... | [
0.3967238962650299,
-0.15588495135307312,
-0.16462191939353943,
0.434327632188797,
-0.23849131166934967,
-0.19112512469291687,
0.44409802556037903,
0.19768311083316803,
-0.4809599816799164,
-0.616859495639801,
-0.26657634973526,
0.47558996081352234,
-0.15237824618816376,
-0.222893610596656... | |
I'm using Hibernate 3.1 and Oracle 10 DB. The blob is defined as @Lob @Basic @Column in the Hibernate entity which corresponds to the relevant DB table.
The error -java.sql.SQLException: Closed Connection- seem to appear once in while, not in every attempt to get the blob from the DB.
This seems like a hibernate fetchi... | [
0.048322226852178574,
0.06774301081895828,
0.6693097352981567,
-0.29566559195518494,
-0.236466646194458,
0.16075754165649414,
0.09119518846273422,
-0.20023904740810394,
-0.0480063259601593,
-0.5248085260391235,
0.18774202466011047,
0.30094847083091736,
-0.2965220808982849,
-0.0112972026690... | |
many" relationships etc)
Would appreciate your help, thanks.
I've recently implemented a hibernate system on top of a Oracle 11g db that uses blobs. There isn't any real magic to it.
The standard cause of 'Session closed' hibernate errors is (not to point out the obvious) that the session that your entity is attached... | [
0.3029341697692871,
0.1140909492969513,
0.16731949150562286,
0.2691304385662079,
-0.2183457762002945,
-0.29999616742134094,
0.49712082743644714,
0.07637111842632294,
-0.2864023745059967,
-0.040316417813301086,
0.06924615800380707,
0.31127411127090454,
-0.11617668718099594,
0.03038445301353... | |
or at least an db connection with autocommit turned off.
Gareth | [
0.10655251890420914,
0.06990005820989609,
0.15375611186027527,
0.22962938249111176,
-0.2819642722606659,
-0.02590721659362316,
0.3088603913784027,
0.036040473729372025,
-0.1871320605278015,
-0.0639592781662941,
-0.14695312082767487,
0.4470345973968506,
0.00988558866083622,
0.05611352995038... | |
**Background**
We run all our windows forms applications from a windows share (UNC) mapped locally to user's W drive. We've had connection issues the past few days and are receiving System.Runtime.InteropServices.SEHException's from somewhat random places in our programs after they have been running from several minut... | [
0.583476722240448,
-0.03303782641887665,
0.4860517084598541,
0.09468754380941391,
0.08977043628692627,
0.1050531342625618,
-0.006581753492355347,
0.2746398448944092,
-0.45595553517341614,
-0.8298442363739014,
-0.08643936365842819,
0.267733633518219,
0.061492882668972015,
0.1209641769528389... | |
force these to load earlier? or reload them after they fail?
Any insights or suggestions on running windows forms applications from a network share? Other than the obvious "copy files to local machine" by boss doesn't like that idea.
I don't have compelling proof for this, but it is standard MSFT practice to use memor... | [
0.39297249913215637,
-0.031638968735933304,
0.45730674266815186,
0.1673135757446289,
-0.14782842993736267,
-0.47655758261680603,
0.16319625079631805,
-0.23336468636989594,
-0.3880256116390228,
-0.2576466500759125,
0.11354544013738632,
0.8047330379486084,
-0.04979229345917702,
0.24836413562... | |
inaccessible. It fits your observation very well. There's no workaround for this, other than your boss committing to his preference and purchasing more reliable networking hardware. A MTBF of hours is pretty poor. | [
0.052749861031770706,
0.1280893236398697,
0.14849117398262024,
0.5400320291519165,
0.12172840535640717,
-0.1901998221874237,
0.5725252032279968,
0.4085736870765686,
-0.18564777076244354,
-0.5757014155387878,
-0.2836422920227051,
0.4318237006664276,
-0.4389858543872833,
0.20288586616516113,... | |
Could someone compare and contrast on WCF Rest services vs. ADO.NET Data Services? What is the difference and when to use which?
Thanks,
Ray.
**Edit**: thanks for the first answer, just to give a bit of background on what I'm looking to do: I have a web app I plan to put in the cloud (someday), and the DAL is built ... | [
0.45056113600730896,
-0.1799478977918625,
0.3680938184261322,
0.3360964059829712,
-0.3701081871986389,
0.21740703284740448,
-0.17195157706737518,
0.022874528542160988,
-0.08223427832126617,
-0.7475157380104065,
0.38710957765579224,
0.41223064064979553,
-0.016976842656731606,
0.024837201461... | |
out myself so here’s a go...
The short answer here is that ADO.Net Data Services are meant to provide an interface to the ADO.Net framework (DataContext, Datasets, DataTables etc…) that is seamlessly integrated with the web, using URIs and well-known data to point to your Data. ADO.Net Data Services are also meant for... | [
0.6497951745986938,
0.33744674921035767,
0.3633787930011749,
0.08646908402442932,
-0.3494639992713928,
-0.07570058107376099,
0.10806882381439209,
0.015938838943839073,
-0.2015685886144638,
-0.5306785702705383,
0.039011742919683456,
0.35427573323249817,
-0.15697641670703888,
0.1789241731166... | |
DataContext that acts as the provider to your data source can be easily configured to point your resource in the cloud, ***or***, an on premise database. This allows you to switch your DataContext without changing any code!!! (I was impressed by that if you couldn't tell)
WCF Rest Services are just normal WCF Service... | [
0.34864145517349243,
-0.3429127633571625,
0.5814012885093689,
0.3140161633491516,
-0.19737453758716583,
-0.36205852031707764,
0.01015226449817419,
0.30048710107803345,
-0.10030404478311539,
-0.741113007068634,
-0.11605177819728851,
0.5219583511352539,
-0.1923472285270691,
0.303314298391342... | |
WCF, instead of requiring the caller to use a heavy WSDL implementation and ASMX, you could just use the WCF Rest functionality to publish that service as a JSON service instead and have it consumed via AJAX without having to point to an ASMX resource. For more info on WCF using rest check out the [PDC Presentation](ht... | [
0.19744302332401276,
-0.19037766754627228,
0.4093972146511078,
-0.08706920593976974,
-0.6096243262290955,
-0.2544493079185486,
0.137870654463768,
-0.15178902447223663,
-0.20082740485668182,
-0.6153745055198669,
-0.12245317548513412,
0.42737114429473877,
-0.27926644682884216,
-0.00725532462... | |
What SQL Server Alerts do you always setup for every database? What do you always monitor regardless of the database?
You should monitor and be alerted for severity levels 17 to 25.
Severity levels from 17 through 19 will require intervention from a DBA, they're not as serious as 20-25 but the DBA needs to be alert... | [
-0.04620789363980293,
0.135430708527565,
0.5304177403450012,
0.07955577224493027,
0.14304538071155548,
-0.16796627640724182,
0.5179961919784546,
-0.012821288779377937,
-0.5766012668609619,
-0.35572853684425354,
0.20020058751106262,
0.42065370082855225,
-0.38964852690696716,
0.1529913693666... | |
in Database dbid Processes
22 SQL Fatal Error Table Integrity Suspect
23 SQL Fatal Error: Database Integrity Suspect
24,25 Hardware Error
for more information on the severity levels see <http://msdn.microsoft.com/en-us/library/aa937483(SQL.80).aspx> | [
-0.4039880335330963,
0.3409613370895386,
0.14058242738246918,
0.11063998937606812,
-0.17282770574092865,
0.08293980360031128,
0.437644898891449,
-0.425123393535614,
-0.13778771460056305,
-0.412823885679245,
0.020597219467163086,
0.25181588530540466,
-0.4108547866344452,
0.280520498752594,
... | |
Which would be quicker.
1) Looping a datareader and creating a custom rows and columns based populated datatable
2) Or creating a dataAdapter object and just (.Fill)ing a datatable.
Does the performance of a datareader still hold true upon dynamic creation of a datatable?
The DataAdapter uses a DataReader under the ... | [
0.10673455148935318,
-0.23648764193058014,
-0.06792020052671432,
0.47490453720092773,
-0.06804908066987991,
0.006585281807929277,
0.2093699425458908,
-0.5483442544937134,
-0.2160240262746811,
-0.5454751253128052,
-0.01886417716741562,
0.896759569644928,
-0.16184048354625702,
-0.19895032048... | |
When the command prompt opens and then just closes really fast (because there isn't a pause line) is there a way to see what it just showed you?
Not after the fact, no. Once it's gone, it's gone. If you have the luxury of being able to run it again (i.e., you know what program or command was executed), then you can use... | [
0.1279790699481964,
-0.2416522055864334,
0.2770906984806061,
0.2065054327249527,
0.263798326253891,
0.08332353830337524,
0.13525302708148956,
0.2580045163631439,
-0.4424181282520294,
-0.6402196288108826,
-0.35089731216430664,
0.4276169538497925,
0.12594947218894958,
0.12843698263168335,
... | |
output to a file so you can read it later, and running the program in a batch file that has the `pause` command afterward. | [
0.27457526326179504,
-0.20674771070480347,
0.1794034242630005,
-0.036385323852300644,
0.11425986140966415,
-0.25162583589553833,
0.048331957310438156,
0.21964235603809357,
-0.2849629521369934,
-0.517676055431366,
-0.3794667422771454,
0.5029388070106506,
-0.14438487589359283,
0.141967847943... | |
So I don't do a lot of Win32 calls, but recently I have had to use the [`GetFileTime()`](http://msdn.microsoft.com/en-us/library/ms724320(VS.85).aspx) and [`SetFileTime()`](http://msdn.microsoft.com/en-us/library/ms724933(VS.85).aspx) functions. Now although Win98 and below are not officially supported in my program pe... | [
0.2423582822084427,
-0.08688168227672577,
0.2825629413127899,
0.18815316259860992,
0.11260241270065308,
-0.27039289474487305,
0.2573743462562561,
0.06171848997473717,
-0.2729663848876953,
-0.5337409973144531,
-0.15533287823200226,
0.8219372630119324,
-0.32403790950775146,
0.152579620480537... | |
Win98.
What you can do is use `LoadLibrary()` / `GetProcAddress()` to get a pointer to `GetFileTime()` / `SetFileTime()`. On Win98 this will fail, giving you a null pointer which you can test for and ignore. On 2000 and later you will get a pointer which you can then use.
It's a pain, but it's the only solution I kno... | [
-0.16873934864997864,
0.02867494523525238,
0.5050362944602966,
-0.07164143025875092,
-0.18674592673778534,
-0.29460132122039795,
0.39291656017303467,
-0.13330288231372833,
-0.013026077300310135,
-0.6923912763595581,
-0.1565164178609848,
0.8474835753440857,
-0.3566388785839081,
0.1311446130... | |
Is it possible to create a MySQL select statement that uses an expression as x then checks if the value for x is under a certain amount?
```
SELECT (mytable.field1 + 10) AS x FROM `mytable` WHERE x < 50;
```
no you have to actually do this
```
SELECT (mytable.field1 + 10) AS x FROM `mytable` WHERE (mytable.field1 + ... | [
0.09968440234661102,
0.02516987733542919,
0.32528671622276306,
0.006263631395995617,
0.08981021493673325,
-0.008635371923446655,
0.0030829119496047497,
-0.18387852609157562,
0.040847405791282654,
-0.1739760786294937,
-0.18899820744991302,
0.5338001847267151,
-0.2436351329088211,
-0.1072113... | |
I am currently looking at developing a mobile apps for the S60 platform and is specifically looking at PyS60. It seems to suggest that the it can be compiled into native .sis files without the need for an embedded python interpreter. Reading through the documentations I could not find any statements where this is expli... | [
0.5608384013175964,
-0.11309903860092163,
0.15487554669380188,
0.051608856767416,
0.060086607933044434,
-0.07910269498825073,
0.020508818328380585,
0.2122100442647934,
0.060819972306489944,
-0.5911329984664917,
-0.2324691116809845,
0.47172579169273376,
-0.26043611764907837,
-0.067929543554... | |
yet. You will save yourself a lot of headache using Windows, weirdly enough.
As far as Python is oncerned, I think the developed application is packaged into a .sis file but still requires the PyS60 interpreter to run once installed. | [
0.3379598557949066,
0.1678604781627655,
0.07735379785299301,
0.27732521295547485,
0.09888237714767456,
-0.11140213161706924,
0.2522079646587372,
0.5023146867752075,
-0.261696457862854,
-0.4691058099269867,
-0.059602104127407074,
0.6561318039894104,
0.09110867232084274,
-0.03554208949208259... | |
Velocity DisplayTool has a useful method:
```
$display.list($list)
```
That will format a collection or array into the form "A, B and C".
The problem is lets say I have an ArrayList of objects, how do I output a specific object field instead of the whole object?
For example the regular loop would look like this:
... | [
-0.07652806490659714,
-0.11226613819599152,
0.8937895894050598,
-0.04406416788697243,
-0.3592219650745392,
-0.04229127615690231,
-0.20005904138088226,
0.040300820022821426,
-0.34984469413757324,
-0.8206056356430054,
0.2885145843029022,
0.5797523856163025,
-0.3635571002960205,
-0.0288740452... | |
Take a look at the SortTool, it allows you to sort on properties. Copying code from there should give you a good start toward adding this to DisplayTool. And if you do this and feel like sharing, let us know over on the dev@velocity.apache.org list. Heck, if i'm bored some day, i might do this myself. | [
0.6282323002815247,
-0.24102693796157837,
0.2327990084886551,
0.4529843032360077,
-0.07120589911937714,
-0.5557261109352112,
0.3112437427043915,
0.3366508483886719,
-0.25955867767333984,
-0.880355179309845,
0.5288591980934143,
0.41523516178131104,
0.22626131772994995,
0.048913925886154175,... | |
I have my main GUI thread, and a second thread running inside it's own ApplicationContext (to keep it alive, even when there is no work to be done). I want to call a method on my 2nd thread from my GUI thread, but if I just call thread.Method(); it seems to be running on my main GUI thread and causes my GUI to become u... | [
-0.04581695795059204,
-0.1309017539024353,
0.36086323857307434,
0.2090854048728943,
-0.08802217245101929,
-0.16680651903152466,
0.5958563685417175,
0.101561039686203,
-0.1293506771326065,
-0.9778918623924255,
0.10319843143224716,
0.7860326170921326,
-0.42510977387428284,
-0.048981864005327... | |
the threads that will need to communicate with my 2nd thread.
**Update #2:**
Ok, I must really be missing something. I created an event and a delegate and had my worker thread subscribe to the event. But when I call Invoke(MyEvent); from my GUI thread the work that the worker thread does ends up being on the GUI threa... | [
0.2487935572862625,
-0.3203573226928711,
0.16741247475147247,
0.17715677618980408,
-0.1370455026626587,
-0.3102361559867859,
0.1310635358095169,
0.18101906776428223,
-0.46136564016342163,
-0.6921482086181641,
0.07075019180774689,
0.4522005319595337,
-0.523665189743042,
-0.09203630685806274... | |
I am running a program and want to see what its return code is (since it returns different codes based on different errors).
I know in Bash I can do this by running
> echo $?
What do I do when using cmd.exe on Windows?
A pseudo environment variable named `errorlevel` stores the exit code:
```
echo Exit Code is %err... | [
0.2807062566280365,
0.47931528091430664,
0.17834262549877167,
-0.41682758927345276,
0.01022170577198267,
-0.22148777544498444,
0.6760244965553284,
-0.3120868504047394,
-0.15508608520030975,
-0.5648040771484375,
0.06977848708629608,
0.5938340425491333,
-0.2045600563287735,
0.060310229659080... | |
exit code. Use (`set errorlevel=`) to clear the environment variable, allowing access to the true value of `errorlevel` via the `%errorlevel%` environment variable.* | [
-0.08705493807792664,
0.18457242846488953,
0.0232605691999197,
-0.1239347904920578,
0.4264317750930786,
0.08754463493824005,
0.4091736376285553,
0.0676901638507843,
0.22093930840492249,
-0.5571103096008301,
-0.1732022613286972,
0.3418371379375458,
-0.3301830589771271,
0.13256072998046875,
... | |
```
void some_func(int param = get_default_param_value());
```
Default parameter can be a subset of the full set of expressions. It must be bound at compile time and at the place of declaration of the default parameter. This means that it can be a function call or a static method call, and it can take any number of ar... | [
0.1566232293844223,
-0.05354655906558037,
0.26936909556388855,
-0.07505945861339569,
0.02409924566745758,
-0.2104114592075348,
0.2580101490020752,
-0.026055380702018738,
-0.25763261318206787,
-0.21716037392616272,
-0.7134727239608765,
0.46866917610168457,
-0.5055149793624878,
-0.0531702935... | |
that variable will be used even if a different variable shadows the original at the place of the function call.
```
// Code 1: Valid and invalid default parameters
int global = 0;
int free_function( int x );
class Test
{
public:
static int static_member_function();
int member_function();
// Valid default pa... | [
0.33502617478370667,
-0.12907740473747253,
0.19238689541816711,
-0.2166701853275299,
0.16899965703487396,
0.057233236730098724,
0.3527059257030487,
-0.30370068550109863,
-0.07198305428028107,
-0.3995200991630554,
-0.4679332673549652,
0.5453178286552429,
-0.46946609020233154,
0.150216057896... | |
void invalid1( int x = free_function( member_attribute ) );
void invalid2( int x = member_function() );
private:
int member_attribute;
static int static_int;
};
int Test::static_int = 0;
// Code 2: Variable scope
int x = 5;
void f( int a );
void g( int a = f( x ) ); // x is bound to the previously defined x... | [
0.19397041201591492,
-0.0946156233549118,
0.18263474106788635,
-0.08451757580041885,
-0.029690565541386604,
0.13259807229042053,
0.31993937492370605,
-0.29932916164398193,
-0.4248775839805603,
-0.2135297805070877,
-0.37392324209213257,
0.4122063219547272,
-0.6043100357055664,
0.19883008301... | |
I am using a makefile system with the pvcs compiler (using Microsoft Visual C++, 2008 compiler) and I am getting several link errors of the form:
> `error LNK2019: unresolved external symbol __imp__RegisterFilter@8 referenced in function _main`
This is happening DESPITE using the `extern "C"` declaration, viz.:
```
... | [
0.2157999575138092,
0.27724191546440125,
0.4597313404083252,
-0.30967453122138977,
0.2011922150850296,
-0.14267860352993011,
0.3748975098133087,
0.08753091096878052,
-0.14376801252365112,
-0.5613086819648743,
0.19681045413017273,
0.48333540558815,
-0.45544925332069397,
0.3203117251396179,
... | |
as the system used to work before.
Any help would really be appreciated.
Thanks in Advance,
Sincerely,
Joseph
**-- Edit 1 --**
Does anyone know how to turn verbose on in the makefile system of pvcs?
Note that the above function is already a compiler-decorated version, having
```
__imp__RegisterFilter@8
```
whe... | [
0.24239912629127502,
0.18337459862232208,
0.23312008380889893,
0.1674758493900299,
-0.17063581943511963,
0.035703763365745544,
0.45353060960769653,
0.35218051075935364,
-0.27724239230155945,
-0.5285718441009521,
-0.2810356914997101,
0.4214380383491516,
-0.13788902759552002,
0.0070238038897... | |
article for more information.
There was a working link, but I've lost that, however I suppose one can always search the topic.
Thanks, whoever you were!
**-- Edit 3 --**
Thanks ChrisN (I'm not yet allowed to vote). Despite using the refresh button, your answer disappeared, but then re-appeared after I posted a cut-... | [
0.2515343427658081,
0.0772019699215889,
0.642589271068573,
0.25079435110092163,
-0.30316826701164246,
-0.193632110953331,
0.4043268859386444,
0.07167375832796097,
-0.4908130466938019,
-0.5045496821403503,
-0.2082868367433548,
0.3293910622596741,
0.0011235104175284505,
-0.07623306661844254,... | |
creating a simple Win32 c++ application in VS2005 and I was getting this error:
```
LNK2019: unresolved external symbol __imp__somefunction
```
This application was using property sheets, hence it required this header (prsht.h).
The solution to my problem was as follows: in program **Properties→Configuration Proper... | [
0.06770773977041245,
0.28183725476264954,
0.5767635107040405,
0.0638233944773674,
0.021889815106987953,
-0.1426297426223755,
0.14288756251335144,
-0.1576133817434311,
-0.32529082894325256,
-0.7378094792366028,
0.04020305722951889,
0.41109606623649597,
-0.4351975917816162,
0.223056703805923... | |
linker can see them. | [
0.2787034809589386,
0.052300915122032166,
0.5033109784126282,
0.1665269136428833,
-0.019067872315645218,
-0.15647484362125397,
0.08094455301761627,
0.09695056080818176,
-0.3632808327674866,
-0.5503420829772949,
-0.015413183718919754,
0.2584647834300995,
-0.24449372291564941,
0.101946942508... | |
I have just discovered that if generating assemblies via Reflection.Emit, the .NET framework keeps references in a static member that prevents Reflection.Emit classes not to be GC'ed.
I cannot use DynamicMethod due to limitations. I also generate a lot of assemblies (incremental compiler of IronScheme) over the cours... | [
0.6960586309432983,
0.1294616162776947,
-0.07756085693836212,
-0.0033586525823920965,
-0.3247579038143158,
-0.12336798012256622,
0.6501557230949402,
-0.19683842360973358,
-0.3092239797115326,
-0.5895974636077881,
0.3461432456970215,
0.49996092915534973,
-0.24800002574920654,
0.278484255075... | |
doing some research, trying to find a real reference for this. So far, this is the best I can come up with:
<http://msdn.microsoft.com/en-us/library/aa159887.aspx>
About 2/3 of the way down it calls creating AppDomains "expensive", but then you might say the same about threads in certain contexts- it really depends... | [
0.19792011380195618,
0.17460928857326508,
0.4978046715259552,
0.0883277952671051,
0.2114820033311844,
0.15567052364349365,
0.4356801211833954,
0.0025925873778760433,
-0.5275515913963318,
-0.8099302649497986,
-0.09683942794799805,
0.3679797351360321,
-0.4191935360431671,
0.23603953421115875... | |
each other. To create a new AppDomain within an existing process (application) the framework has to do all the work associated with creating a new thread, plus some additional overhead to set it up within the rest of the applicaion (that may also involve loading one or more assemblies into memory). In the end, an AppDo... | [
-0.05119418352842331,
0.23869329690933228,
0.5458042621612549,
0.2331688106060028,
0.2763623297214508,
0.4681186378002167,
0.057270731776952744,
-0.19030626118183136,
-0.3672965168952942,
-0.7779268026351929,
-0.016853660345077515,
-0.02216385491192341,
-0.5008291006088257,
0.4396765232086... | |
I want to match any line that does not end with 'CA' or 'CA[any number]'. How can I do that using rlike in MySQL? (Note it doesn't support ?! etc).
Here's the regex for a positive match, I just need a way to negate it: `'^.*[C][A][0-9]?$'`
(Due to an embarrassing architecture limitation, I don't want to use `not rlik... | [
0.12255922704935074,
0.15501092374324799,
0.5054154992103577,
-0.14397172629833221,
-0.28777602314949036,
-0.004019783344119787,
0.2430533766746521,
0.0391022264957428,
0.11308379471302032,
-0.5118141174316406,
0.040164459496736526,
0.4372080862522125,
-0.3317478597164154,
0.10153850167989... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.