text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
efl=00010246
ChartFX_ClientServer_Core!Ordinal5507+0x97b7:
31666110 8a404d mov al,byte ptr [eax+4Dh] ds:0023:0000004d=??
```
[edit:]
I also wasn't able to get the unmamanged stack details from WinDbg (it said "Stack unwind info not available"):
```
0:000> kP
ChildEBP RetAddr
WARNING: Stack unwin... | [
-0.5238342881202698,
0.2395888715982437,
0.6776908040046692,
0.03842281922698021,
0.011662530712783337,
0.4047599732875824,
0.2963694930076599,
-0.3405924141407013,
-0.7057405710220337,
-0.5949248671531677,
-0.12487476319074631,
0.5926187634468079,
-0.16486261785030365,
0.12638504803180695... | |
comctl32!DefSubclassProc+0x92
0015ea04 747fd4e6 comctl32!DefSubclassProc+0x46
0015ea20 747fd073 comctl32!DefSubclassProc+0x505
0015ea84 747fd118 comctl32!DefSubclassProc+0x92
0015eae4 7719f8d2 comctl32!DefSubclassProc+0x137
```
**3. Bug is not easy to reproduce (although it can be provoked usually in less than 5 min.... | [
-0.011286581866443157,
0.033034585416316986,
0.4212435483932495,
0.04777813330292702,
0.11886952072381973,
-0.09614456444978714,
0.6400442719459534,
-0.09375423192977905,
-0.253874272108078,
-0.7445321679115295,
-0.05169125646352768,
0.8737608790397644,
-0.5194710493087769,
-0.201444804668... | |
should be my next step?**
If someone could point me to the next step I should do to find the actual cause, I would be very grateful. Experimenting (removing and returning code) does not do much good, because I don't know how to reproduce it, so it would take large amounts of time on each iteration just to convince mys... | [
0.6702202558517456,
0.14114660024642944,
0.06129559129476547,
0.20552749931812286,
0.05148728936910629,
0.16972960531711578,
0.2857080101966858,
-0.032495368272066116,
-0.16734592616558075,
-0.4647979736328125,
0.18921765685081482,
0.15787987411022186,
0.0673990324139595,
0.187648132443428... | |
of log traces all over the code, I've managed to notice that in some cases one of the Chart's properties turns into Double.NaN. After I get that, app always crashed during next Chart repaint. By handling the Chart's PrePaint and PostPaint events (luckily it has these events), I confirmed that the crash happens right be... | [
0.15767444670200348,
-0.0831407681107521,
0.41214048862457275,
0.25355544686317444,
0.08033090829849243,
0.1293272078037262,
0.5256395936012268,
0.3868319094181061,
-0.8405068516731262,
-0.6799526810646057,
0.016681130975484848,
0.34071990847587585,
-0.05838663876056671,
0.1207176297903060... | |
very satisfied with this "solution", since it is obviously some internal problem which cannot be precisely detected before it actually crashes, and I may be only hiding it this way. But I have to leave it as it is for now because I am losing too much time otherwise.
**[Update]**
**Replicated the bug successfully**
... | [
0.49459826946258545,
-0.09573730826377869,
0.5518185496330261,
0.22676204144954681,
0.1650758683681488,
0.02389495074748993,
0.46673449873924255,
0.12340421229600906,
-0.47442856431007385,
-0.7542402148246765,
0.2402878850698471,
0.6032751798629761,
0.10334019362926483,
-0.0904905125498771... | |
for our next release we're switching to their managed (.Net) version, so we will at least have Reflector to find out how to resolve those bugs.
Anyway thanks everyone! | [
0.5538046956062317,
-0.04261810705065727,
0.4080806076526642,
0.4142685830593109,
-0.09390214085578918,
-0.3549100458621979,
0.5695599913597107,
0.581669270992279,
-0.04003046452999115,
-0.6245026588439941,
0.06889406591653824,
0.4432860314846039,
0.0026704759802669287,
-0.1229446530342102... | |
I'm reading information from an XML which contains the type of an object that I need to instantiate along with it's constructor parameters.
The object type is actually in another project, within a sibling namespace. (I need to create a Company.Project2.Type within Company.Project1 class.)
I found [this question](http... | [
0.16263945400714874,
0.21026936173439026,
0.07830482721328735,
0.019684091210365295,
0.02343818172812462,
-0.16698777675628662,
0.2040477842092514,
-0.22869333624839783,
-0.2734122574329376,
-0.49260297417640686,
-0.11578252911567688,
0.22138772904872894,
-0.06516404449939728,
0.3705973029... | |
(or mscorlib), you need to give the assembly name too, including version information if it's strongly typed. For example, for a non-strongly typed assembly `Company.Project2.dll`, you might specify "Company.Project2.Type, Company.Project2".
* To call a constructor with parameters you can call [`Activator.CreateInstance... | [
-0.2466859668493271,
-0.22122912108898163,
0.425439715385437,
0.037468794733285904,
-0.036663852632045746,
-0.18431715667247772,
-0.08567693084478378,
-0.13169696927070618,
-0.3443184196949005,
-0.3542117178440094,
-0.2196677327156067,
0.3829580843448639,
-0.3382164537906647,
0.32534700632... | |
Is there a defined behavior for handling a stack overflow?
Apart from terminating the process, it doesn't seem like there's a whole lot that can be done. I'm just wondering if anyone might know what the C standard has to say about it.
The standard does not require the use of a stack, and has nothing to say about stack... | [
0.33031079173088074,
0.2559969425201416,
0.05977139621973038,
0.08543287217617035,
0.26537856459617615,
-0.2965937852859497,
0.2687206268310547,
0.1286487728357315,
-0.27268722653388977,
-0.11132768541574478,
0.03873318433761597,
0.5183511972427368,
-0.13163992762565613,
0.2567190825939178... | |
What is the best (and fastest) way to retrieve a random row using Linq to SQL when I have a condition, e.g. some field must be true?
You can do this at the database, by using a fake UDF; in a partial class, add a method to the data context:
```
partial class MyDataContext {
[Function(Name="NEWID", IsComposable=tr... | [
0.24086324870586395,
-0.07997874915599823,
0.3321859538555145,
0.26583331823349,
0.24287061393260956,
-0.2078971117734909,
-0.08860419690608978,
-0.2241072803735733,
0.06425740569829941,
-0.49494999647140503,
0.12775374948978424,
0.6076889038085938,
-0.2353312224149704,
0.24955938756465912... | |
`order by ctx.Random()`; this will do a random ordering at the SQL-Server courtesy of `NEWID()`. i.e.
```
var cust = (from row in ctx.Customers
where row.IsActive // your filter
orderby ctx.Random()
select row).FirstOrDefault();
```
Note that this is only suitable for small-to-mid-si... | [
-0.07626061886548996,
-0.24023261666297913,
0.39986199140548706,
-0.3761516809463501,
-0.102672278881073,
-0.03594895452260971,
-0.13332746922969818,
-0.3105419874191284,
-0.4699932932853699,
-0.6524007320404053,
-0.393766850233078,
0.34255120158195496,
-0.5936941504478455,
0.1605757921934... | |
count approach:
```
var qry = from row in ctx.Customers
where row.IsActive
select row;
int count = qry.Count(); // 1st round-trip
int index = new Random().Next(count);
Customer cust = qry.Skip(index).FirstOrDefault(); // 2nd round-trip
``` | [
-0.30553269386291504,
-0.35655447840690613,
0.6315983533859253,
-0.19688837230205536,
-0.05993335694074631,
0.18644782900810242,
-0.12588775157928467,
-0.38766735792160034,
-0.32398751378059387,
-0.4349583089351654,
-0.16641567647457123,
0.4836282432079315,
-0.3928090035915375,
0.138713598... | |
I'd like to query Windows Media player from an external app to find out what track (album and artist) it's currently playing.
Is that information exposed anywhere?
One way to do it would be to write a Windows Media Player plug-in. There's an API for doing this at <http://msdn.microsoft.com/en-us/library/bb262326(VS.85... | [
0.32070496678352356,
-0.0668640062212944,
0.1780986487865448,
0.2190769612789154,
0.15374112129211426,
-0.27440816164016724,
-0.19406172633171082,
-0.012689922004938126,
-0.19376294314861298,
-0.7707378268241882,
0.1547923982143402,
0.8221278786659241,
-0.03582841902971268,
0.3015620708465... | |
PHP's assert statement doesn't behave like most other languages.
`assert('return false');` actually evaluates the string and then asserts its result (false).
Instead of comparing the parameter to true, it goes through the extra step of examining the argument, and if it's a string evaluating it, then performing the co... | [
-0.17680828273296356,
0.2976926267147064,
0.05111195147037506,
0.1586783081293106,
-0.7002770304679871,
-0.18677206337451935,
0.6909605860710144,
-0.19954846799373627,
0.19592639803886414,
-0.02031221054494381,
0.09864110499620438,
0.7498189806938171,
-0.134837806224823,
-0.266270011663436... | |
off and messages containing the assertion expression when an assertion fails. This means that if you pass a boolean condition as assertion this condition will not show up as parameter to the assertion function which you may have defined with the assert\_options() function, the condition is converted to a string before ... | [
0.2717268466949463,
-0.08070962131023407,
0.38464248180389404,
-0.2150791436433792,
0.1662023961544037,
-0.019944779574871063,
0.3348613977432251,
-0.2988124191761017,
-0.027591777965426445,
-0.18122054636478424,
-0.3736594021320343,
0.8592836856842041,
-0.31167957186698914,
0.348372191190... | |
I want to ask why all extern method calls are static?
How the CLR handles these calls?
Extern method calls are to unmanaged code. As such, it doesn't make sense to be called on a (managed) object instance - the first (hidden) argument in an instance method is the instance reference, aka `this`. Typically, `extern` meth... | [
-0.23418745398521423,
-0.10732907056808472,
0.32322824001312256,
0.2197725772857666,
-0.2172594964504242,
-0.08534078299999237,
0.2525441646575928,
0.08960077911615372,
-0.0028801923617720604,
-0.04098958522081375,
-0.26278766989707947,
0.6388651132583618,
-0.5624207854270935,
0.1827743947... | |
I'm writing a php application that submits via curl data to sign up for an iContact email list. However I keep getting an invalid email address error. I think this may be due to the fact that I'm escaping the @ symbol so it looks like %40 instead of @. Also, according to the php documentation for curl\_setopt with CURL... | [
0.28077811002731323,
0.07428547739982605,
0.5207024812698364,
-0.1175263524055481,
-0.32006776332855225,
-0.03040006197988987,
0.46674755215644836,
0.0015287995338439941,
-0.11582647264003754,
-0.7799676656723022,
0.12074556201696396,
0.16329239308834076,
-0.33329057693481445,
0.1235860586... | |
in php without running it through urlencode first?
Use [`http_build_query()`](http://php.net/http_build_query) on your data-array first before passing it to `curl_setopt()`, that will lead to it sending the form as `application/x-www-form-encoded` instead of `multipart/form-data` (and thus the @ is not interpreted).
A... | [
0.20970317721366882,
0.05781925469636917,
0.6207457184791565,
-0.03294416144490242,
-0.4505779445171356,
-0.12741315364837646,
0.20692694187164307,
0.007562433835119009,
-0.070646733045578,
-0.6364558935165405,
-0.07849958539009094,
0.1187286525964737,
-0.25019264221191406,
0.0413149222731... | |
When I send `");--` from an input field to my localhost PHP server, it AUTOMATICALLY converts it to
> \");--
It seems great, except that I don't know how trustworthy this behavior is.
Although it seems to avoid SQL injections, my development environment is not the same as the production environment and I'm afraid tha... | [
0.14957770705223083,
0.07540341466665268,
0.4235171973705292,
-0.14361423254013062,
-0.2081346958875656,
-0.15029239654541016,
0.6655796766281128,
-0.03740255907177925,
0.019226299598813057,
-0.512041449546814,
-0.05960506200790405,
1.0000277757644653,
-0.5449527502059937,
0.01771323010325... | |
have [Magic Quotes](http://docs.php.net/manual/en/security.magicquotes.php) enabled. But you better disable this option or revert them. `mysql_real_escape_string` is more secure. | [
0.15522396564483643,
-0.07785938680171967,
0.5945549607276917,
0.06677398830652237,
0.09851113706827164,
-0.3685159981250763,
0.7879630923271179,
-0.1869061142206192,
-0.2677783668041229,
-0.3658638298511505,
-0.3602965772151947,
0.9001758098602295,
-0.15495900809764862,
-0.133565366268157... | |
I'm having some trouble with a tricky SQL-query.
In my MySQL database there is the tables topics, tags and tags\_topics to join them.
I want to fetch topics that share the same specified tags. For example, let's say i have 3 tags with ids 1, 2 and 3, i want to fetch all topics that have tag 1, 2 and 3 associated to t... | [
0.04939401149749756,
0.004968045279383659,
0.3578222990036011,
0.1894339919090271,
-0.21621465682983398,
-0.10545088350772858,
-0.06762433797121048,
-0.16066928207874298,
-0.42476412653923035,
-0.6494413614273071,
0.1439698338508606,
0.33988305926322937,
-0.43020856380462646,
0.10351645946... | |
table (SQL)](https://stackoverflow.com/questions/333750/fetching-only-rows-that-match-all-entries-in-a-joined-table-sql)
If anyone have a more elegant solution, please post :)
**`JOIN` solution:**
```
SELECT t.*
FROM topics t
JOIN tags_topics t1 ON (t.id = t1.topicId AND t1.tagId = 1)
JOIN tags_topics t2 ON (t.id = ... | [
-0.29860156774520874,
0.10693095624446869,
0.7821998000144958,
0.12972649931907654,
-0.17510774731636047,
0.13026192784309387,
-0.3042270541191101,
-0.4268157184123993,
-0.6275008916854858,
-0.5797480344772339,
-0.15987791121006012,
0.37873563170433044,
-0.25799626111984253,
-0.12476464360... | |
FROM tags_topics tt WHERE tt.tagId = 1)
AND t.id = ANY (SELECT topicId FROM tags_topics tt WHERE tt.tagId = 2)
AND t.id = ANY (SELECT topicId FROM tags_topics tt WHERE tt.tagId = 3);
```
**Modified `GROUP BY` solution:**
Simplifies `GROUP BY` clause by isolating search in a subquery.
```
SELECT t.*
FROM topics ... | [
-0.12515468895435333,
-0.167192742228508,
0.6522143483161926,
0.14286962151527405,
-0.204384446144104,
0.15723013877868652,
-0.13090582191944122,
-0.6473543643951416,
-0.3412173092365265,
-0.5948594808578491,
-0.521528959274292,
0.5943037271499634,
-0.336260586977005,
-0.18267907202243805,... | |
I see the word **"BUFFER"** everywhere, but I am unable to grasp what it exactly is.
1. Would anybody please explain what is buffer in **layman's language**?
2. When is it used?
3. How is it used?
Imagine that you're eating candy out of a bowl. You take one piece regularly. To prevent the bowl from running out, someon... | [
0.6685040593147278,
0.13141638040542603,
0.3899928331375122,
-0.05221621319651604,
-0.1168494001030922,
0.11105779558420181,
-0.007890741340816021,
0.35763853788375854,
-0.34002456068992615,
-0.7996939420700073,
0.08074460178613663,
0.17290319502353668,
-0.042649246752262115,
0.13631908595... | |
the next 5 minutes or so into a buffer, that way your computer doesn't have to download the movie as you're watching it (which would cause hanging). | [
0.5958750247955322,
-0.3851654529571533,
0.34105756878852844,
0.3407595753669739,
0.23741944134235382,
-0.5400087833404541,
0.06350734829902649,
0.15284094214439392,
-0.145743727684021,
-0.27752745151519775,
0.15171553194522858,
0.15032558143138885,
0.49750038981437683,
0.11602717638015747... | |
I wonder if anyone else has asked a similar question.
Basically, I have a huge tree I'm building up in RAM using LINQ objects, and then I dump it all in one go using `DataContext.SubmitChanges()`.
It works, but I can't find how to give the user a sort of visual indication of how far has the query progressed so far. I... | [
0.23435620963573456,
0.42470449209213257,
0.20082014799118042,
-0.012085114605724812,
-0.2675108313560486,
0.3433593213558197,
0.22600898146629333,
-0.38393715023994446,
-0.1847132444381714,
-0.5567255616188049,
0.032051585614681244,
0.2121298462152481,
-0.020694589242339134,
0.19128347933... | |
it exactly, but it does take a long while to put them in.
**Edit:** I thought I'd better give some indication of what I'm doing.
Basically, I'm building a suffix tree from the Lord of the Rings. Thus, there are a lot of Nodes, and certain Nodes have positions associated to them (Nodes that happen to be at the end of ... | [
-0.03669506311416626,
0.286649614572525,
0.5215238332748413,
0.05274590104818344,
0.1118331179022789,
-0.05595586821436882,
0.12462368607521057,
-0.2598535716533661,
-0.17275802791118622,
-0.5355278849601746,
-0.1817985326051712,
0.2442023605108261,
-0.0015638680197298527,
0.09743823111057... | |
takes a few seconds), I then call `suffixTreeDB.submitChanges();`
What I'm wondering is if there is any faster way of doing this. Thanks!
**Edit 2:** I've did a stopwatch, and apparently it takes precisely 6 minutes for the DB to be written.
I suggest you divide the calls you are doing, as they are sent in separate c... | [
0.5145996809005737,
-0.0033416275400668383,
0.4780803322792053,
0.1347285956144333,
-0.30894604325294495,
-0.10857704281806946,
0.4133642017841339,
-0.2425059825181961,
-0.1509416103363037,
-0.8587137460708618,
0.0063722701743245125,
0.4226987361907959,
-0.004283145070075989,
-0.0494975894... | |
I think you should take a look at SqlBulkCopy instead. If you need to improve the time of the operation, that's the way to go. Check this related question/answer: [What's the fastest way to bulk insert a lot of data in SQL Server (C# client)](https://stackoverflow.com/questions/24200/whats-the-fastest-way-to-bulk-inser... | [
0.2586714029312134,
-0.16622169315814972,
0.09269051253795624,
0.2448500543832779,
-0.08229026198387146,
-0.2992953360080719,
-0.24823346734046936,
0.21086014807224274,
-0.6751008033752441,
-0.36416593194007874,
0.15770357847213745,
0.5939203500747681,
0.19916202127933502,
-0.0759061053395... | |
In the following code sample, do the C++ standard guarantee that '++i' is evaluated after the memory allocation (call to operator new) but before the call to X’s constructor?
```
new X( ++i )
```
From my copy of n2798:
> **5.3.4 New**
>
>
> 21 Whether the allocation function is called before evaluating the constru... | [
0.007909041829407215,
0.1756008118391037,
0.003906309604644775,
-0.2650737166404724,
0.04409266263246536,
0.22477346658706665,
0.1283523291349411,
-0.39224115014076233,
-0.18123184144496918,
-0.2671833634376526,
-0.26371142268180847,
0.5028080344200134,
-0.21953420341014862,
-0.03001407906... | |
8 A new-expression obtains storage for the object by calling an allocation function (3.7.4.1). If the newexpression terminates by throwing an exception, it may release storage by calling a deallocation function (3.7.4.2). If the allocated type is a non-array type, the allocation function’s name is operator new and the ... | [
-0.3778535723686218,
0.1683705449104309,
0.5188886523246765,
-0.4707023501396179,
0.13043749332427979,
0.01270414236932993,
0.19780826568603516,
-0.2830512523651123,
-0.2701506018638611,
-0.29302817583084106,
-0.544901967048645,
0.47677263617515564,
-0.4199684262275696,
0.33714839816093445... | |
What is the best way to communicate visually that an element has been added to or removed from a list of items? (I'm going for usability, not gratuitous eye candy)
1. Slide the other items up or down to show the new item or hide the deleted item
2. Fade items in or out, but do not animate the other items
3. A combinat... | [
0.28211718797683716,
-0.13099408149719238,
0.26285767555236816,
0.34307006001472473,
-0.013014464639127254,
0.16663141548633575,
0.33344313502311707,
0.026719165965914726,
-0.3452150225639343,
-0.3843892812728882,
-0.2229999452829361,
0.19951945543289185,
-0.2054247111082077,
-0.1196315959... | |
Basically I have a folder on my webserver that I assign to new domains whenever I buy them that only has an index.html and an images folder. It is basically just has my logo and says the domain is under construction and coming soon.
Normally when I want to force the www. prefix I use the following code:
```
rewriteco... | [
0.8851819038391113,
0.20177140831947327,
0.9646610617637634,
-0.05024665221571922,
0.07135201245546341,
-0.37416088581085205,
0.01975996419787407,
0.19893881678581238,
-0.24175997078418732,
-0.5288345217704773,
0.34436604380607605,
0.2600637376308441,
-0.2513565719127655,
0.631700873374939... | |
a go but honestly got no one where close.
Try this:
```
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
``` | [
-0.1981394737958908,
-0.08519812673330307,
0.48880258202552795,
-0.19128428399562836,
0.11439154297113419,
-0.19816583395004272,
0.4710172116756439,
-0.15948277711868286,
0.00733522791415453,
-0.2203572392463684,
0.029663903638720512,
0.5933996438980103,
-0.26586583256721497,
-0.3055115640... | |
I basically want to the C of equivalent of this (well, just the part with the array, I don't need the class and string parsing and all that):
```
public class Example
{
static int[] foo;
public static void main(String[] args)
{
int size = Integer.parseInt(args[0]);
foo = new int[size]; // T... | [
0.1322759985923767,
0.32332727313041687,
0.11568182706832886,
-0.05475258827209473,
0.1642257422208786,
0.038027942180633545,
0.16958218812942505,
-0.001467476598918438,
-0.13924139738082886,
-0.3869501054286957,
0.09847646951675415,
0.8001745343208313,
-0.2961503863334656,
0.3011131882667... | |
on the freestore
* free -- releases memory allocated via above
* atoi -- convert a C-style string to an integer
* strtoul -- is strongly suggested though as a replacement
*/
#include <stdlib.h>
static int *foo;
int main(int argc, char *argv[]) {
size_t size = atoi(argv[ 1 ]); /*argv[ 0 ] is the executable's ... | [
0.07054129242897034,
0.0745091512799263,
0.26165223121643066,
-0.06012585759162903,
-0.1511492133140564,
0.05413619056344032,
0.1861211061477661,
-0.13983136415481567,
-0.3376307189464569,
-0.5305710434913635,
-0.43276622891426086,
0.6556305289268494,
-0.7685313820838928,
-0.04928953945636... | |
free(foo); /* release the memory */
}
return 0;
}
```
*Caveat:Off the cuff stuff, without any error checking.* | [
0.4779798686504364,
-0.009216034784913063,
0.45793336629867554,
0.0014256045687943697,
0.33901211619377136,
-0.6306353807449341,
0.2654704451560974,
-0.3191254436969757,
-0.16920892894268036,
-0.05564092844724655,
-0.4919978678226471,
0.6264864206314087,
-0.4936753809452057,
0.123217798769... | |
The situation is: there is a file with 14 294 508 unsigned integers and 13 994 397 floating-point numbers (need to read `double`s). Total file size is ~250 MB.
Using `std::istream` takes ~30sec. Reading the data from file to memory (just copying bytes, without formatted input) is much faster. Is there any way to impro... | [
-0.04521792754530907,
0.8149877786636353,
0.22866061329841614,
0.1596895009279251,
0.38695505261421204,
0.3710607588291168,
0.3518384099006653,
-0.29562750458717346,
-0.2438676357269287,
-0.645001232624054,
-0.1722310483455658,
0.1598832607269287,
-0.21740497648715973,
-0.20177172124385834... | |
i/o routines. Also, are you reading in the whole file in one go? | [
0.41945087909698486,
-0.15366682410240173,
-0.17005302011966705,
0.1187574714422226,
0.1834387630224228,
-0.03992438316345215,
0.2414301633834839,
0.017252923920750618,
-0.3618926405906677,
-0.5006760358810425,
0.10100270807743073,
0.8209696412086487,
-0.23589064180850983,
-0.6310258507728... | |
I have just started learning objective-C and the iphone sdk and I have a question that I hope someone can help shed some light on.
What is the difference in the following:
```
self.view = someView;
```
and
```
[self.view addSubView: someView];
```
Say for example, in a simple app, where we have only one controll... | [
0.38013511896133423,
-0.009049694985151291,
0.42935433983802795,
0.036631885915994644,
-0.13709135353565216,
0.015950854867696762,
0.08861011266708374,
0.12174777686595917,
-0.1735011488199234,
-0.555719256401062,
0.03593334183096886,
0.5657597780227661,
-0.18002748489379883,
0.03546507656... | |
here
}
```
As I understand it the initWithFrame: CGRectZero, creates a frame with size at [0,0,0,0] (essentially invisible).
When I directly set the view with
```
self.view = someView;
```
I notice the view actually displays the image. But when I add the view to as a subview of controller's 'default' view, it d... | [
0.36042019724845886,
-0.10196951776742935,
0.40819883346557617,
-0.004836888052523136,
0.20808760821819305,
0.006461357697844505,
0.11193988472223282,
0.13393613696098328,
-0.24898308515548706,
-0.5474122762680054,
0.15305852890014648,
0.5487428307533264,
-0.35742485523223877,
0.1867183297... | |
you're seeing a bunch of views. There's a big containing view.[1] Within that, there's a navigation bar view, a table view, and a toolbar view. Within the navigation bar view, there's a button view on each side and a label view in the middle. Inside the table view, there are a bunch of table cell views, and each of tho... | [
0.19297413527965546,
0.08767998218536377,
0.5426406860351562,
0.1865522861480713,
0.12694644927978516,
0.22715815901756287,
-0.2764972746372223,
0.27724912762641907,
-0.6083097457885742,
-0.7360026240348816,
0.17555053532123566,
0.40988588333129883,
-0.3541620373725891,
0.07300439476966858... | |
superview; the views below it are its subviews. So a table cell view has a table view as its superview and a bunch of label views as its subviews. The top view, the one that has all the other views inside it, is called the root view.
Each view has its own drawing surface. The rectangle formed by that drawing surface i... | [
-0.1872241497039795,
-0.04489167034626007,
0.8428484201431274,
0.23592320084571838,
-0.09828843176364899,
0.2950332760810852,
-0.292572945356369,
-0.14074328541755676,
-0.29810813069343567,
-0.5341755151748657,
-0.4173068106174469,
0.16804777085781097,
-0.13011348247528076,
0.3524211943149... | |
cell's top left corner, even if the cell is halfway down the screen.
When you're writing a view controller, `self.view` is that root view I mentioned earlier; all the other views are subviews of that one (or subviews of its subviews, etc.). One of the features of a view controller is that it automatically resizes its ... | [
-0.06930238008499146,
-0.15144959092140198,
0.8271179795265198,
-0.04834027215838432,
-0.010337905958294868,
0.08657533675432205,
0.17090938985347748,
-0.07394176721572876,
-0.10779254138469696,
-0.7787829041481018,
0.007609567604959011,
0.6006670594215393,
0.03338148817420006,
-0.05239174... | |
by a navigation controller or tab bar controller, but that's a different story.) But just because you resize its root view doesn't mean that the root view's subviews will automatically resize. To do that, you need to set their autoresizing mask (a property which tells the view how it should react when its superview cha... | [
0.06371605396270752,
-0.3295866549015045,
0.85882568359375,
0.24560287594795227,
-0.1609158217906952,
-0.008624905720353127,
0.20453692972660065,
-0.2071729600429535,
-0.12130718678236008,
-0.8213587999343872,
-0.0929616242647171,
0.7733670473098755,
-0.047735102474689484,
0.19890627264976... | |
in the inspector window and look at the "Autosizing" section.)
Even that's not enough, though, if `someView` isn't the right size to start with. To do that, adjust its frame before you add it as a subview of `self.view`:
```
someView.frame = CGRectMake(
0, // all the way to the left | [
0.18123576045036316,
-0.1460481435060501,
0.6228468418121338,
-0.10301681607961655,
0.10993415862321854,
-0.07170889526605606,
0.15798014402389526,
-0.19875188171863556,
-0.06227392330765724,
-0.553281307220459,
0.16095688939094543,
0.6694229245185852,
-0.1387193351984024,
0.02981747873127... | |
0, // all the way at the top
self.view.frame.size.width, // same width as the root view
self.view.frame.size.height, // same height too | [
-0.21270714700222015,
-0.12583027780056,
0.7127091884613037,
-0.15049882233142853,
0.03259342536330223,
0.14278674125671387,
0.2896263003349304,
-0.09620053321123123,
0.13283947110176086,
-0.5265967845916748,
-0.057802800089120865,
0.5174413323402405,
0.1117878183722496,
0.0993510782718658... | |
);
```
So why would you ever use subviews if you have to do all this twiddling that the root view does for you? Simple: you can only have one root view, but one view is almost never enough for what you need to do. If you really need only one view, of course, you can just set it as the root view and go on your merry w... | [
0.3430127203464508,
0.0769457146525383,
0.19130443036556244,
0.061842720955610275,
-0.03659197315573692,
0.012873361818492413,
0.13626240193843842,
0.40351182222366333,
-0.13556447625160217,
-0.42559945583343506,
-0.07022660225629807,
0.6939172744750977,
-0.36198848485946655,
0.11983752250... | |
I want to pass a variable set by the user to the `setcookie` function.
I would like to let user change the color of some parts of website. so far the information about color is sent to server with `$_SESSION['colorcode']` and I would like to add it to `setcookie` as well so when the user logs in to the site next time,... | [
0.6183009743690491,
-0.14843444526195526,
0.4821876883506775,
-0.09367913752794266,
0.3805716931819916,
0.3013192415237427,
0.18876922130584717,
0.1381918489933014,
0.06250634044408798,
-0.9432920217514038,
0.00307064619846642,
0.4913465976715088,
-0.5329834818840027,
0.07316049933433533,
... | |
false,
true
);
```
I would like to save the value of variable in cookie, but it works just for the session.
what is wrong? how to do it so the color is there when the user logs in? I'm looking for another way than storing it in database or file.
Did you read back the value from the cookie at the beginning of the ... | [
0.4642183482646942,
-0.050930190831422806,
0.09404550492763519,
-0.06584655493497849,
0.3422240614891052,
-0.07077945023775101,
0.6627506613731384,
-0.08991578221321106,
0.051807571202516556,
-0.6056429743766785,
0.06816352903842926,
0.9998074769973755,
-0.41501230001449585,
-0.00695681944... | |
data back in, when the user returns to your site the next time.
```
if ( !isset($_SESSION['colorcode']) and isset($_COOKIE['colorcode']) ) {
if ( preg_match('/^#?[0-9a-fA-F]{6}$/', $_COOKIE['colorcode']) ) {
$_SESSION['colorcode'] = $_COOKIE['colorcode'];
} else {
// bad value... delete cookie ... | [
0.045363880693912506,
0.10475381463766098,
0.6328911185264587,
-0.017722604796290398,
0.26710349321365356,
-0.1350419968366623,
0.4040279984474182,
-0.17795702815055847,
0.020229941233992577,
-0.43894073367118835,
-0.7725542783737183,
0.7213167548179626,
-0.17768718302249908,
0.05565225705... | |
nessessary because a cookie is data that comes from the user and therefore potentially malicious. | [
0.32125523686408997,
0.0828964039683342,
0.26103535294532776,
-0.003671196987852454,
0.11324498802423477,
-0.18959642946720123,
0.3584182560443878,
-0.07663577049970627,
0.09163103997707367,
-0.14512810111045837,
-0.17893856763839722,
0.2524621784687042,
-0.3561078608036041,
0.465707123279... | |
What is the best/simplest way to prevent people hotlinking to images from my hosted ASP.NET website? I don't need to prevent all images/resources from hotlinking, I just want to prevent hotlinking to specific images/resources on a site. FYI. It's hostesd on GoDaddy.com so IIS tricks probably wont work.
Streaming the im... | [
0.287641316652298,
-0.06388051807880402,
0.26988744735717773,
0.20710909366607666,
-0.21944598853588104,
-0.16832230985164642,
0.4797689914703369,
-0.02029087208211422,
-0.3216524124145508,
-0.7931889891624451,
0.1742340475320816,
0.5075563192367554,
-0.24889715015888214,
0.183579370379447... | |
an expiry on images as well. Store this "keycode" in the cookies. Whenever images are served you basically pass this via the querystring. The validation happens on the ASPX on the other end. You could even regenerate a new "keycode" between each request using either an HTTPRequestModule or the Global.asax page.
There... | [
0.23074866831302643,
-0.39799386262893677,
0.8509512543678284,
0.2702735662460327,
-0.023834746330976486,
-0.22103683650493622,
0.2516511082649231,
-0.05084548145532608,
-0.17560452222824097,
-0.7035437226295471,
-0.2581895589828491,
0.27805864810943604,
-0.006130601745098829,
-0.014169780... | |
I'm looking for a programming that monitors my activity in Windows Vista/XP/2003 that lets me know what commands, shortcuts, web sites, etc. I visit more frequently.
with this information I could create shortcuts, hotkeys, aliases, etc to increase productivity, as time goes on I could know how much time I saved in co... | [
0.43999606370925903,
-0.36284592747688293,
0.48283547163009644,
-0.0029099308885633945,
-0.11462584137916565,
-0.30653730034828186,
0.22926709055900574,
0.30215510725975037,
-0.27890411019325256,
-0.4836590588092804,
0.5060303211212158,
0.5685850977897644,
-0.10105836391448975,
-0.07097855... | |
Well i writing in .net and i have a list to witch i will only add item never remove and its a linked list i can change that if its not the best pick but any way to the point would it be safe to not use any locking in this case when i know that this list will never be changed in any other manner but that its added to? (... | [
0.43836408853530884,
-0.02787698432803154,
0.2640782296657562,
0.15970677137374878,
-0.35490697622299194,
-0.41441893577575684,
0.3549600839614868,
-0.19422957301139832,
-0.30358633399009705,
-0.6005894541740417,
0.40653175115585327,
0.38060104846954346,
-0.324089914560318,
0.4575669169425... | |
LinkedList is multiple readers
<http://msdn.microsoft.com/en-us/library/he2s3bh7.aspx> | [
0.0039800177328288555,
-0.09143298119306564,
0.5551501512527466,
0.24348607659339905,
-0.05947943031787872,
0.04414873197674751,
0.12323084473609924,
0.05950818955898285,
-0.5882947444915771,
-0.6115168929100037,
-0.26711493730545044,
-0.011180633679032326,
0.030561739578843117,
0.02954966... | |
for a tool i need to figure all vim buffers that are still listed (there are listed and unlisted buffers)
unfortunately `vim.buffers` contains all buffers and there doesnt seem to be an attribute to figure if a buffer is listed or unlisted
the vim command of what i want to do is
```
:buffers
```
unfortunately all ... | [
0.19285866618156433,
-0.11081288009881973,
0.4004165530204773,
-0.12416140735149384,
-0.1922547072172165,
-0.08417937159538269,
0.2744547724723816,
-0.2470717579126358,
-0.3264850676059723,
-0.5894386172294617,
-0.04762418940663338,
0.6244453191757202,
-0.28251948952674866,
0.0360470078885... | |
if !buflisted(buffer_number)
continue
endif
call add(result, buffer_number)
endfor
return result
endfunction
``` | [
-0.15432114899158478,
-0.18191532790660858,
0.6332607269287109,
-0.6229828596115112,
0.23825901746749878,
0.0009769299067556858,
0.3544654846191406,
-0.28937897086143494,
0.055645737797021866,
-0.23005738854408264,
-0.42262205481529236,
0.8003583550453186,
-0.4275728166103363,
0.0187239497... | |
I want a thread to execute in the background every 500 milliseconds. To do that, I extended a Thread, implemented ActionListener and put the class that I extended into a Timer. The Timer calls run() every 500 milliseconds. However, my whole Swing GUI freezes up when this thread is downloading stuff from the Internet. I... | [
0.32471659779548645,
-0.17665691673755646,
0.4977305829524994,
-0.3427279591560364,
0.061394140124320984,
-0.18311774730682373,
0.22471827268600464,
-0.3053469657897949,
-0.4386312961578369,
-0.5193465948104858,
-0.26333048939704895,
0.6537418365478516,
-0.3952042758464813,
-0.247442513704... | |
static void gogogo()
{
t= new Downloader();
new Timer(500, (ActionListener) t).start();
}
public void run()
{
doStuff(); //the code that i want repeatedly called
}
public void actionPerformed(ActionEvent e)
{
run();
}
}
```
Just start the thread once, make it loop, and do `Thread.sleep(500L)` with... | [
0.45262905955314636,
-0.5394279360771179,
0.49405673146247864,
-0.22778242826461792,
0.4455326199531555,
-0.08495359122753143,
0.3168836832046509,
0.05559895187616348,
-0.4257389307022095,
-0.5707467794418335,
-0.2295062243938446,
0.816366970539093,
-0.3207472264766693,
0.3176683783531189,... | |
I see this kind of thing sometimes:
```
(k for k in (j for j in (i for i in xrange(10))))
```
Now this really bends my brain, and I would rather it wasn't presented in this way.
Are there any use-cases, or examples of having used these nested expressions where it was more elegant and more readable than if it had be... | [
0.2055744230747223,
0.08078524470329285,
0.15018343925476074,
0.00420981552451849,
-0.12313283234834671,
-0.10133524239063263,
0.3600168228149414,
0.11739537864923477,
-0.4722145199775696,
-0.6159413456916809,
0.0030557590071111917,
0.35231122374534607,
-0.37274473905563354,
-0.31936010718... | |
the language.
For understanding your example, there is a simple rule from Guido himself:
* The form [... for x... for y...] nests, with the last index
varying fastest, just like nested for loops.
Also from PEP 202, which serves to answer your question:
```
Rationale
List comprehensions provide a more concise ... | [
0.27538931369781494,
-0.012955477461218834,
-0.17357274889945984,
0.2051595002412796,
-0.2489161640405655,
0.01438819244503975,
0.2653360068798065,
-0.09221938997507095,
-0.4622235894203186,
-0.714872419834137,
-0.02697981894016266,
0.4575347602367401,
-0.42514723539352417,
-0.420527040958... | |
than nested for loops, since `for` loops are easily parsed visually. | [
0.05771755054593086,
-0.19625146687030792,
-0.43597695231437683,
0.1629120111465454,
-0.1065518781542778,
-0.21656134724617004,
0.2487601786851883,
-0.0900074765086174,
-0.36457058787345886,
-0.6429303288459778,
-0.1754559725522995,
0.005734571255743504,
-0.29435911774635315,
0.02692978456... | |
Is there any way to access the backing field for a property in order to do validation, change tracking etc.?
Is something like the following possible? If not is there any plans to have it in .NET 4 / C# 4?
```
public string Name
{
get;
set
{
if (value != <Keyword>)
{
RaiseEvent... | [
0.5634509325027466,
-0.08044443279504776,
0.42360615730285645,
-0.07032788544893265,
0.29027989506721497,
-0.3168902099132538,
0.04834772273898125,
-0.20932456851005554,
-0.1908780187368393,
-0.0754324346780777,
-0.3997172713279724,
0.6155058741569519,
-0.1522119790315628,
0.24970380961894... | |
<Keyword> = value;
}
}
```
The main issue I have is that using auto properties doesn't allow for the same flexibility in validation etc. that a property with a explicit backing field does. However an explicit backing field has the disadvantage in some situations of allowing the class it is contained in to access ... | [
0.22889050841331482,
0.23143526911735535,
0.13532401621341705,
-0.023651601746678352,
-0.02127428539097309,
-0.21103191375732422,
0.21606983244419098,
-0.35214298963546753,
-0.060662902891635895,
-0.3788895010948181,
-0.20278404653072357,
0.8261927366256714,
-0.1988622397184372,
0.22469940... | |
preventing circumvention of the property validation, change tracking etc.
**Edit:** I've changed < Backing Field > to < Keyword >. I would propose a new keyword similar to value. **field** would do nicely although I'm sure it's being used in a lot of existing code.
Having read your comments in Mehrdad's answer, I thin... | [
0.548940122127533,
0.22429241240024567,
-0.18754717707633972,
0.08701580762863159,
-0.013481357134878635,
-0.07282397896051407,
0.6144277453422546,
-0.08063464611768723,
-0.10144254565238953,
-0.5111170411109924,
-0.1096390038728714,
0.32248154282569885,
0.04226544499397278,
0.337629228830... | |
suggest the following strategy. Write a generic class that represents a ValidatedValue. This class holds only the backing value and only allows access/mutation via get and set methods. A delegate is passed to the ValidatedValue to represent the validation logic:
```
public class ValidatedValue< T >
{
private T m_v... | [
0.3321554958820343,
-0.09652985632419586,
0.5547793507575989,
-0.12366914004087448,
0.03230829909443855,
-0.08111758530139923,
0.3686732351779938,
-0.48957380652427673,
-0.14176079630851746,
-0.09370709955692291,
-0.6199648976325989,
0.6547395586967468,
-0.3718007206916809,
0.2373893409967... | |
{
return m_val;
}
public void set(T v)
{
if (m_validationFn(v))
{
m_val = v;
}
}
}
```
You could, of course, add more delegates as required (eg, to support pre/post change notification).
Your class would now use the ValidatedValue in place of a backing sto... | [
0.49912071228027344,
-0.20860423147678375,
0.42842552065849304,
0.006283098366111517,
0.28643667697906494,
-0.317744642496109,
0.0819927230477333,
-0.42114943265914917,
-0.3094621002674103,
-0.2495378851890564,
-0.2926984429359436,
0.6101651787757874,
-0.16341456770896912,
0.36026653647422... | |
shows a class, MyClass, with an integer that is validated to be less than 100. Note that the logic to throw an exception is in MyClass, not the ValidatedValue. This allows you to do complex validation rules that depend on other state contained in MyClass. Lambda notation was used to construct the validation delegate - ... | [
-0.12551787495613098,
0.06784049421548843,
0.24800416827201843,
-0.019679395481944084,
-0.03142179921269417,
0.07722492516040802,
0.27203992009162903,
-0.4468115568161011,
-0.1405760794878006,
-0.19645550847053528,
-0.08620905131101608,
0.2357928454875946,
-0.31345269083976746,
0.183744043... | |
v =>
{
if (v >= 100) RaiseError();
return true;
}
);
}
private void RaiseError()
{
// Put your | [
0.3348941206932068,
-0.16723991930484772,
0.7667253017425537,
-0.17923836410045624,
-0.02981807105243206,
0.27539879083633423,
0.20202335715293884,
-0.7550753355026245,
-0.18514811992645264,
-0.3769799768924713,
-0.003177580190822482,
0.6577996611595154,
-0.028445592150092125,
0.0208750143... | |
logic here....
throw new NotImplementedException();
}
public int Foo
{
get { return m_foo.get(); }
set { m_foo.set(value); }
}
}
```
Hope that helps - somewhat off the original topic, but I think it's more inline with your actual concerns. What we have done is taken the valida... | [
0.20146940648555756,
0.1623983532190323,
0.07512274384498596,
0.007430288940668106,
0.02637461945414543,
-0.32647085189819336,
0.3689661920070648,
-0.3611416816711426,
-0.03686361759901047,
-0.11857109516859055,
-0.09446033835411072,
0.6956213116645813,
-0.14954903721809387,
0.047529853880... | |
Whenever you allocate a new array in C# with
```
new T[length]
```
the array entries are set to the default of T. That is `null` for the case that `T` is a reference type or the result of the default constructor of `T`, if `T` is a value type.
In my case i want to initialize an `Int32` array with the value -1:
``... | [
-0.14921808242797852,
0.08652561157941818,
0.5564457178115845,
-0.34968405961990356,
0.25029832124710083,
0.044106531888246536,
0.18277667462825775,
-0.2791700065135956,
-0.0222646314650774,
-0.3650786578655243,
-0.339542418718338,
0.5649980306625366,
-0.12565293908119202,
0.07461968809366... | |
code sets all entries to -1.
That makes the initialization redundant. Does the JIT detect this and neglects the initialization to 0 and if not, is there a way to directly initialize a portion of memory with a custom value?
Referring to [C# Array initialization - with non-default value](https://stackoverflow.com/ques... | [
0.12299033999443054,
-0.15308132767677307,
0.09015097469091415,
-0.18763530254364014,
0.09664570540189743,
-0.008162196725606918,
0.19095559418201447,
-0.40546751022338867,
-0.44330623745918274,
-0.09623263031244278,
-0.20309561491012573,
0.41749370098114014,
-0.33232173323631287,
0.035270... | |
bad idea, particularly from a security standpoint. That's why the CLR guarantees that any newly allocated memory is wiped to a 0 bit pattern.
The same argument holds for fields in an object, by the way.
I suppose in both cases the CLR could check that you're not going to make the array visible elsewhere before finish... | [
0.23561160266399384,
0.28871583938598633,
0.051039792597293854,
-0.0065447441302239895,
0.15649957954883575,
-0.15322108566761017,
0.41631820797920227,
0.3053571283817291,
-0.25568509101867676,
-0.3302365839481354,
-0.07521484792232513,
0.3801228106021881,
-0.011141907423734665,
0.12283331... | |
If you have an enum in your application and you only have a few items, should you force the underlying type to be the smallest possible type?
```
enum smaller : byte
{
one,
two,
three
};
```
No. Don't prematurely optimize **unless** you've proved with a profiler that it's actually ... | [
0.22580209374427795,
0.1679997593164444,
-0.007179947569966316,
-0.15233321487903595,
0.44914060831069946,
0.002315462799742818,
0.23709189891815186,
-0.09130547195672989,
-0.10294293612241745,
-0.664307177066803,
-0.38885289430618286,
0.5541549324989319,
-0.23250241577625275,
-0.097025193... | |
Management has decided to go for Windows 2008 64 bit with IIS7 to service our main website.
They want to have it staged on a Windows 2003 server with IIS6. **[Edit]** Yes 32 bit is what they are planning for staging **[End Edit]**
I want to know what issues, [beyond the security issues](http://learn.iis.net/page.aspx... | [
-0.25754594802856445,
-0.19176581501960754,
0.3438066244125366,
-0.03125329688191414,
-0.167692631483078,
0.017305418848991394,
0.42486900091171265,
-0.12804177403450012,
-0.4299491047859192,
-0.5818108916282654,
0.17612424492835999,
0.5315455794334412,
0.025358805432915688,
0.015315013006... | |
any seasoned developer to understand, my problem is that I am trying to explain this to upper level management people who seem to have already made up their mind...
---
**[Edit]**
@Luke:
Its basically a website which gets updated quite often, the whole site is to be staged, tested, before deploying to the live envir... | [
0.34501659870147705,
0.10018133372068405,
0.20053374767303467,
-0.2592197358608246,
-0.09899966418743134,
0.03113945759832859,
0.11097314953804016,
0.22827313840389252,
-0.24391373991966248,
-0.3626798391342163,
-0.238259956240654,
0.5457815527915955,
-0.09717154502868652,
-0.3400693237781... | |
for a 64-bit Windows 2008 production server or you are in for a world of pain.
The staging server should be, as far as possible, the equivalent of the production server because what you are using it for is to answer the question "Does this software work on the production environment?" before actually committing to loa... | [
0.2420649230480194,
0.21559669077396393,
-0.19000151753425598,
0.026783829554915428,
0.0404672771692276,
0.09642088413238525,
0.1918254792690277,
-0.03377098962664604,
-0.08740050345659256,
-0.30166342854499817,
0.2242935746908188,
0.7681819796562195,
-0.23823752999305725,
0.00625809608027... | |
but in an environment that you won't actually use. Its more work and in the end you still don't know if it works on your production environment, which is the entire point of having a staging server in the first place. | [
0.7249063849449158,
-0.011681213043630123,
-0.0674753189086914,
0.3731778562068939,
0.464258074760437,
0.05763796344399452,
0.07595573365688324,
0.05083993449807167,
-0.061122700572013855,
-0.5489792227745056,
0.3124317526817322,
0.10679227113723755,
0.07757987827062607,
-0.092495702207088... | |
I am migrating from a Dreamweaver forced working environment to a free-of-choice one. That said I must say I was rather enthusiastic about being able to use Dreamweaver PDT. However I have come to rely very heavily on the use of the "auto upload on save" function.
I am developing LAMP but oriented to a Windows base ma... | [
0.20655357837677002,
0.005543427541851997,
0.15143586695194244,
-0.1942538321018219,
-0.21024678647518158,
-0.12396495044231415,
0.18283012509346008,
0.273591548204422,
0.06007442995905876,
-1.0085210800170898,
-0.08005696535110474,
0.8943923115730286,
-0.3029833734035492,
0.13235226273536... | |
have a Virtual machine on windows running Linux that works as my Dev Server.
As you can tell the auto-update on save works like a charm.
I've dug up some of the documentation and I've also Google quite a bit and found nothing (besides Aptana) to suit my needs. I am looking in the wrong direction or isn't there really... | [
0.647040605545044,
-0.05248912796378136,
0.2597956359386444,
0.31827953457832336,
-0.17241550981998444,
-0.051709432154893875,
0.13866977393627167,
0.4966510534286499,
-0.31464964151382446,
-0.8267309665679932,
0.06516028195619583,
0.6502446532249451,
-0.027197998017072678,
0.2965297400951... | |
past work well enough. | [
0.15459074079990387,
0.10409925878047943,
-0.016603577882051468,
-0.2177189141511917,
0.1009657233953476,
-0.03196725994348526,
0.09936556220054626,
-0.03355492278933525,
-0.2852427661418915,
-0.33419567346572876,
0.02918797917664051,
0.3461140990257263,
0.14493483304977417,
0.000931815651... | |
I'm trying to retrieve a list of `Id`'s from a collection that is a few levels deep in an object heirachy. When i try to do a `ToList()`, I keep getting an `EntityList<>` retrieved instead .. which means it's not allowing me to retrieve an instance's `BarId` property because the `EntitySet` is a `Enumerable`, not a sin... | [
0.1124468445777893,
0.384452223777771,
0.36582958698272705,
-0.1851242035627365,
0.29554542899131775,
0.5219340324401855,
-0.027020417153835297,
-0.49777889251708984,
-0.1487814486026764,
-0.6027058959007263,
-0.1493767350912094,
0.41809940338134766,
-0.34408456087112427,
0.326700031757354... | |
`BarId`'s from `children2List`.
please help!
Your can use:
```
var children2List = fooList.SelectMany( x => x.Child1.Children2 ).ToList();
```
This will allow you to do something like:
```
children2List.ForEach( b => b.BarId.Print() );
``` | [
0.19976770877838135,
0.11124598979949951,
0.26078134775161743,
-0.11753012239933014,
0.33170682191848755,
0.2886394262313843,
-0.00771857937797904,
-0.19563713669776917,
-0.21512188017368317,
-0.6290075778961182,
-0.08955786377191544,
0.6368845701217651,
-0.19699953496456146,
0.05254973843... | |
There are many different bad practices, such as memory leaks, that are easy to slip into a program on accident. Sometimes, they might even be able to jury-rig your program together.
I'm working on a project right now and it works if I deliberately put a memory leak in my code. If I take the leak out, the code crashes... | [
0.6286311745643616,
0.43093469738960266,
-0.21907305717468262,
0.275844931602478,
0.2792987823486328,
-0.036067672073841095,
0.4650215208530426,
0.14820818603038788,
-0.2747507095336914,
-0.45879682898521423,
0.15378916263580322,
0.4554952085018158,
-0.10551982372999191,
0.2192809134721756... | |
impact on actual usage of the system can be reasonably expected to be none or negligible, and the delivery date cannot be pushed back, and it can be fixed within a scope of time before the problem's impact becomes more than negligible, ship it.
Obviously this is not ideal or even recommended, but you're clearly pushed... | [
0.21881860494613647,
0.30040857195854187,
0.2525275945663452,
0.2914200723171234,
0.22751910984516144,
0.09438272565603256,
0.01872076466679573,
0.23795796930789948,
-0.2639879584312439,
-0.3923485577106476,
-0.19667081534862518,
0.4973178207874298,
-0.09840594232082367,
-0.149744421243667... | |
becomes a real problem, that can sometimes be better than delivering late. It depends on the conditions of the agreement and the customer.
It's always better to at least *try* to push back the delivery date, but I am assuming you've already tried that and it's not an option here.
It is typical once an application has... | [
0.30182838439941406,
-0.20068185031414032,
0.5985629558563232,
0.029688676819205284,
0.4837431013584137,
0.1912968009710312,
0.18878939747810364,
0.2018633931875229,
-0.13289472460746765,
-0.4830094873905182,
-0.28783226013183594,
0.5491970777511597,
0.2137356549501419,
0.3841181695461273,... | |
a delivery date than correctness, it's less likely anyone will be convinced to pay off any debt once you go live. This is a bad situation to be in. Only the person with all the facts can make the right choice. | [
0.43878602981567383,
-0.19131174683570862,
-0.058218762278556824,
0.23325341939926147,
0.28784728050231934,
0.009233379736542702,
0.0772278755903244,
0.0936761349439621,
-0.00016244541620835662,
-0.6458916664123535,
0.14637237787246704,
0.34905365109443665,
0.13907088339328766,
-0.14734275... | |
This is a quickly cooked up script, but I am having some difficulty due to unfamiliarity with regexes and Perl.
The script is supposed to read in an HTML file. There is a place in the file (by itself) where I have a bunch of <div>s. I want to remove every third of them -- they are grouped in fours.
My script below wo... | [
0.2011992186307907,
0.1029927060008049,
0.23676683008670807,
-0.35080644488334656,
-0.1311899572610855,
0.028507275506854057,
0.5766574144363403,
-0.21069183945655823,
0.02112261764705181,
-0.5748933553695679,
-0.25837624073028564,
0.31831908226013184,
-0.6311915516853333,
0.35345238447189... | |
open OUTPUT, ">$output" or die "couldn't open file $output: $!\n";
my @file = <INPUT>;
foreach (@file) {
my $int = 0;
if ($_ =~ '<div class="cell">') {
$int++;
{ // this brace was the wrong way
if ($int % 4 == 3) {
$_ =~ '/s\<div class="cell">\+.*<\/div>/;/g'; | [
0.02103010192513466,
0.10277800261974335,
0.5049036145210266,
-0.5471234321594238,
0.21015214920043945,
0.25960397720336914,
0.702590823173523,
-0.3259875178337097,
0.22132961452007294,
-0.544143557548523,
-0.23359054327011108,
0.5873997211456299,
-0.4649231433868408,
0.22837670147418976,
... | |
}
}
print OUTPUT @file;
}
```
Thanks for all your help. I know it is wrong to parse with a regex, but I just want this one to work.
Postmortem: The problem is almost solved. And I shame those who told me that a regex is not good -- I knew that to begin with. But then again, I wanted something fast and had pro... | [
0.17625634372234344,
0.38752245903015137,
0.27318689227104187,
0.18472647666931152,
0.1984383761882782,
-0.18444085121154785,
0.4806566536426544,
0.49221470952033997,
-0.046656109392642975,
-0.8742241859436035,
0.012074454687535763,
0.6511498689651489,
-0.34752699732780457,
-0.054714251309... | |
that HTML can't really be parsed by regexes, but for quick little hacks on HTML that you know the format of, regexes work great. The trick to doing repetition replacements with a regex is to put the repetition into the regex. If you don't do that you'll run into trouble syncing the position of the regex matcher with th... | [
0.37731167674064636,
-0.21801310777664185,
0.4207063913345337,
0.27334022521972656,
-0.3289237320423126,
-0.07758630067110062,
0.20583286881446838,
-0.05175812169909477,
-0.2462100237607956,
-0.34083616733551025,
0.1675737202167511,
0.7895225882530212,
-0.6019497513771057,
-0.2602281272411... | |
make the regex do the counting. If you haven't seen the "x" modifier before, all it does is let you add spaces for formatting—the spaces are ignored in the regex.
```
remove(@ARGV);
sub remove {
my ($input, $output) = @_;
open(INPUT, "<", $input) or die "couldn't open file $input: $!\n";
open(OUTPUT, ">", $out... | [
-0.13613338768482208,
0.00892695877701044,
0.6106230616569519,
-0.10693009197711945,
0.1536988615989685,
0.04199574515223503,
0.1594100296497345,
-0.3939296007156372,
-0.1525157392024994,
-0.4195064306259155,
-0.3358342945575714,
0.38832858204841614,
-0.46664437651634216,
0.233364433050155... | |
(.*? <div \s+ class="cell">)|$1$2|sxg;
print OUTPUT $content;
close OUTPUT;
}
``` | [
-0.06535082310438156,
0.17792943120002747,
0.3565393388271332,
-0.2863920331001282,
0.13895808160305023,
-0.18993237614631653,
0.25467509031295776,
-0.10506979376077652,
0.004540668334811926,
-0.45683661103248596,
-0.6388669610023499,
0.34607091546058655,
-0.6254326105117798,
0.28364348411... | |
Let me pose a bit of background information before asking my question:
I recently joined a new software development group that uses Rational tools for configuration management, including a source control and change management system.
In addition to these tools, the team has a standard practice of noting any code chang... | [
0.7326936721801758,
0.5799737572669983,
0.1291027069091797,
-0.37179917097091675,
0.11414763331413269,
-0.15462461113929749,
0.11723735183477402,
-0.2029554545879364,
-0.21404558420181274,
-0.30822017788887024,
0.2136252224445343,
0.5478153824806213,
-0.15667688846588135,
0.189637169241905... | |
team should get rid of this standard immediately.
To wit - the change management system is the place to build traceability from requirement to code modification, and source control can provide detailed history of changes by performing a Diff between versions. When source code is checked in, the corresponding change ma... | [
0.1336963027715683,
0.23632341623306274,
0.5653845071792603,
0.1346701830625534,
0.1313924491405487,
-0.3820895552635193,
0.20929372310638428,
-0.21722501516342163,
-0.3708544373512268,
-0.5082815885543823,
-0.10986766219139099,
0.4960509240627289,
0.10329442471265793,
-0.22407196462154388... | |
management and source control systems cannot provide?
For myself, I have always found such comments to be more trouble than they're worth: they can cause merge conflicts, can appear as 'false positives' when you're trying to isolate the diffs between two versions, and may reference code changes that have since been obs... | [
0.4725310206413269,
0.28188014030456543,
0.0980420708656311,
0.21147631108760834,
0.05827290937304497,
-0.26810190081596375,
0.2876708209514618,
0.04007018357515335,
-0.40160617232322693,
-0.6318617463111877,
-0.10749546438455582,
0.8902103900909424,
-0.12095602601766586,
0.339655518531799... | |
I have some text like "item number - item description" eg "13-40 - Computer Keyboard" that I want to split into item number and item description.
Is this possible with 1 regular expression, or would I need 2 (one for item and one for description)?
I can't work out how to "group" it - like the item number can be this ... | [
-0.17103427648544312,
0.3781154453754425,
0.40780749917030334,
0.07697417587041855,
-0.022626610472798347,
0.08500895649194717,
0.22836561501026154,
-0.6165932416915894,
-0.11061625182628632,
-0.40577882528305054,
-0.29885464906692505,
0.5417391657829285,
-0.39297717809677124,
-0.007331778... | |
the code you posted, you are using regex wrong. You should be having one regex pattern to match the whole product and using the captures within the match to extract the number and description.
```
string RegExString = @"(?<number>[\d-]+)\s-\s(?<description>.*)";
Regex rx = new Regex(RegExString, RegexOptions.Compiled ... | [
0.28548726439476013,
0.0882340595126152,
0.4019342362880707,
-0.06910918653011322,
0.00020951223268639296,
0.09151332825422287,
0.2760735750198364,
-0.3103232681751251,
-0.24157284200191498,
-0.45146533846855164,
-0.08046621084213257,
0.555243194103241,
-0.6416904926300049,
-0.002190469065... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.