text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
858993459 858993459
value >>> 0 // 858993459 858993459 858993459
value - value % 1 // 900719925474099 900719925474099 900719925474099
```
**Negative - Larger numbers**
```
// x = Number.MAX_SAFE_INTEGER/10 * -1 // -900719925474099.1
// value = x // x=-90071992... | [
-0.2644280791282654,
0.38634318113327026,
0.43114128708839417,
0.13391196727752686,
0.14930438995361328,
0.24862168729305267,
0.3614201545715332,
-0.3805752992630005,
-0.735588014125824,
-0.5699484348297119,
-0.13409313559532166,
0.6552392244338989,
-0.09407822787761688,
0.3138184249401092... | |
-900719925474100 -900719925474100
Math.ceil(value) // -900719925474099 -900719925474099 -900719925474099
Math.round(value) // -900719925474099 -900719925474099 -900719925474100
Math.trunc(value) // -900719925474099 -900719925474099 -900719925474099
parseInt(value) // -900719925474099 ... | [
-0.7766019701957703,
0.2867717444896698,
0.34474438428878784,
-0.042779140174388885,
0.11393740028142929,
0.34607625007629395,
-0.011621029116213322,
-0.48028022050857544,
-0.245244562625885,
-0.5638759136199951,
-0.1620607078075409,
0.7742204070091248,
0.15774394571781158,
0.2459811568260... | |
// -858993459 -858993459 -858993459
value >> 0 // -858993459 -858993459 -858993459
value >>> 0 // 3435973837 3435973837 3435973837
value - value % 1 // -900719925474099 | [
-0.3549457788467407,
0.14218640327453613,
-0.04972042515873909,
0.3338187634944916,
-0.03203355148434639,
0.3150664269924164,
0.3251345455646515,
-0.2540154457092285,
-0.19565263390541077,
-0.6002241969108582,
-0.15914782881736755,
0.4981902539730072,
-0.12221095710992813,
0.30606207251548... | |
-900719925474099 -900719925474099
``` | [
-0.28507569432258606,
0.5532274842262268,
0.1820375919342041,
0.535912036895752,
0.15661339461803436,
-0.164962038397789,
0.12127944827079773,
0.24492612481117249,
-0.1997232586145401,
-0.5904402136802673,
-0.29944026470184326,
0.8283120393753052,
0.12356269359588623,
0.4484967589378357,
... | |
When people access my app on www.example.com and log in, they get a cookie. I'm using the cookie option to store session on Rails. Accessing example.com (without the www), they must log in again, because Firefox does not recognize the previous session.
So, what do you think is the best way to avoid this?
I guess I wi... | [
0.2885606586933136,
0.4931629002094269,
0.3280456066131592,
-0.06450973451137543,
0.008069745264947414,
-0.1429748386144638,
0.5717049837112427,
0.12721554934978485,
-0.42228108644485474,
-0.7433176636695862,
0.1128922700881958,
0.6243721842765808,
-0.5893132090568542,
0.2148967683315277,
... | |
www.domain.com
3. When a user agent requests <http://domain.com/>, redirect with a 301 response to <http://www.domain.com/>
4. Only issue cookies from www.domain.com
5. Don't try to make the whole site available from domain.com, just the main page (which is redirected)
You don't need to involve rails in this solution ... | [
0.5102400183677673,
-0.21923349797725677,
0.2139819711446762,
0.11462795734405518,
-0.27667051553726196,
-0.35787269473075867,
0.7230274677276611,
0.050864078104496,
-0.07052108645439148,
-0.6490465998649597,
0.33482134342193604,
0.4097730815410614,
-0.34034037590026855,
0.0658891946077346... | |
Is it wise to redistribute the pdb files along with a commercial application?
Occasionally, I'm using the stack trace to get a more detailed error reporting logs from the deployed applications; can this functionality be achieved without relying to those files?
Also, how much hints of the original source code does the... | [
0.16074419021606445,
0.1385965198278427,
0.07235689461231232,
0.09727274626493454,
0.0887494832277298,
0.010738377459347248,
0.12772732973098755,
0.03762762248516083,
-0.02198074199259281,
-0.5898460745811462,
0.039141494780778885,
0.4174347221851349,
-0.28635427355766296,
0.05469404160976... | |
Luckily you can create a stripped down version of your PDB files which only contains public information with [/PDBSTRIPPED](http://msdn.microsoft.com/en-us/library/y87kw2fd.aspx) parameter.
Oh you edited to add C#/.NET, so I'm not sure if "PDBSTRIPPED" is applicable. However .NET applications are very easy to [revers... | [
0.5154712796211243,
0.05329447612166405,
0.26202428340911865,
0.12969066202640533,
-0.13192351162433624,
-0.27161237597465515,
0.22041383385658264,
0.1337711364030838,
-0.37119826674461365,
-0.7175168991088867,
0.090040422976017,
0.32585054636001587,
-0.1691083461046219,
0.2402948439121246... | |
I have an aspx.cs page with the following code:
```
hypPopup.Attributes.Add("onclick",
"window.open('Popup.aspx',
'',
'height=650, | [
0.11876895278692245,
0.24301506578922272,
0.6607727408409119,
-0.0004605622962117195,
0.01903868094086647,
0.15261250734329224,
0.07516179978847504,
-0.0648699477314949,
-0.22788169980049133,
-0.5802730321884155,
-0.005753857083618641,
0.00312928413040936,
-0.06525316089391708,
0.009542766... | |
width=800,
location=no,
toolbar=no,
status=no, | [
0.04055187478661537,
-0.08985113352537155,
0.3387748599052429,
-0.19873669743537903,
0.21311666071414948,
0.4926780164241791,
0.12841735780239105,
0.2380194514989853,
-0.3581539988517761,
-0.38972482085227966,
0.06261412054300308,
0.566357433795929,
0.3901020586490631,
0.2001212239265442,
... | |
scrollbars=yes,
resizable=yes');
return false"
);
```
When I click the hypPopup link, the window pops up which is fine, but if I | [
-0.013761855661869049,
-0.004219551105052233,
0.9879096150398254,
0.0319245271384716,
0.17734043300151825,
-0.1786818504333496,
0.49948444962501526,
0.12747760117053986,
-0.015547097660601139,
-0.5158368349075317,
-0.41468268632888794,
0.6325610876083374,
-0.14379136264324188,
0.3417383432... | |
close it and refresh the page, the popup keeps popping up. I have to leave the page and come back for it to stop popping up on every refresh. Is this behavior by default or is there a fix to it?
hypPopup.Attributes.Add is done in the Page\_Load
It basically adds information for:
* All non-public types, interfaces, s... | [
0.12203703820705414,
0.09613341093063354,
0.5837399959564209,
-0.09563945978879929,
-0.06399594247341156,
-0.13120470941066742,
0.27526232600212097,
0.21859095990657806,
-0.18774327635765076,
-0.7905614972114563,
-0.22460713982582092,
0.40280336141586304,
-0.29798418283462524,
0.2194505631... | |
information with [/PDBSTRIPPED](http://msdn.microsoft.com/en-us/library/y87kw2fd.aspx) parameter.
Oh you edited to add C#/.NET, so I'm not sure if "PDBSTRIPPED" is applicable. However .NET applications are very easy to [reverse engineer](http://www.red-gate.com/products/reflector/) even without any symbol information... | [
0.4378592371940613,
-0.14781175553798676,
0.34475842118263245,
0.1948014497756958,
-0.18634718656539917,
-0.2129698097705841,
0.035672105848789215,
0.0571662113070488,
-0.2932332754135132,
-0.766310453414917,
-0.015361961908638477,
0.3107413351535797,
-0.2325029969215393,
-0.02304020896553... | |
Is there some kind of subtle difference between those:
```
void a1(float &b) {
b=1;
};
a1(b);
```
and
```
void a1(float *b) {
(*b)=1;
};
a1(&b);
```
?
They both do the same (or so it seems from main() ), but the first one is obviously shorter, however most of the code I see uses second notation. Is there... | [
0.18559838831424713,
0.12139241397380829,
0.1481814682483673,
-0.23565487563610077,
0.03476277366280556,
0.17765526473522186,
0.0051951659843325615,
-0.14328351616859436,
-0.3365437388420105,
-0.10585032403469086,
-0.0063032726757228374,
0.39581674337387085,
-0.2951519787311554,
0.06255626... | |
I have 3D CAD model that I want to show on a web page. I'd like to show it in a form like a `<img>` tag (e.g. inline with everything else rather than as a separate page) and I want the visitor to be able to rotate the model to view it from different perspectives.
What options do I have?
Things I'm thinking of/looking... | [
0.6072594523429871,
0.28519514203071594,
0.5575011968612671,
-0.11260920017957687,
-0.4819627106189728,
-0.02164691872894764,
0.03575526177883148,
-0.06305650621652603,
-0.01977747492492199,
-0.8365386724472046,
0.14071381092071533,
0.774892270565033,
-0.1392994523048401,
0.226763844490051... | |
Experiments has released several 3D Javascript applications. Here's an example:
[Colors Cube](http://www.chromeexperiments.com/detail/colorscube/) | [
0.4427117705345154,
-0.32338055968284607,
-0.08720577508211136,
0.1963258683681488,
-0.1364515721797943,
-0.25151076912879944,
0.18095411360263824,
-0.139666348695755,
-0.10113184154033661,
-0.5175217986106873,
0.07018249481916428,
0.13081318140029907,
-0.19554497301578522,
-0.025906633585... | |
I am writing an API in C# and I want to provide both synchronous and asynchronous versions of the publicly available methods.
For example, if I have the following function:
```
public int MyFunction(int x, int y)
{
// do something here
System.Threading.Thread.Sleep(2000);
return x * y;
}
```
how can I cre... | [
0.24150438606739044,
0.057794343680143356,
0.20718617737293243,
-0.08386451750993729,
0.12516067922115326,
-0.16669917106628418,
0.41383686661720276,
-0.23703517019748688,
0.10628366470336914,
-0.6403766870498657,
-0.09253976494073868,
0.42725449800491333,
-0.3854440450668335,
0.2502767741... | |
context)
{
// Func<int> is just a delegate that matches the method signature,
// It could be any matching delegate and not necessarily be *generic*
// This generic solution does not rely on generics ;)
return new Func<int>(MyFunction).BeginInvoke(callback, context);
}
int EndMyFunction(IAsyncResult res... | [
-0.022280283272266388,
-0.07793392241001129,
0.42440587282180786,
0.051024556159973145,
0.0159074105322361,
-0.12609729170799255,
0.34219804406166077,
-0.5910230278968811,
-0.23198316991329193,
-0.26462864875793457,
-0.1444016546010971,
0.5525994300842285,
-0.4609929621219635,
0.3389146924... | |
I am using the ajax calendar tool. I like its function, but I would like to restrict the user to an option of selecting a time frame starting with Today, and ending with 6 months prior. How do I do this?
If you're using the asp.net calendar control, use the DayRender event to check each day against the date limit you w... | [
0.2665623426437378,
-0.2074129730463028,
0.6287135481834412,
-0.037609852850437164,
0.29982873797416687,
0.0038702201563864946,
0.12799032032489777,
0.2081419676542282,
-0.10666253417730331,
-0.904953122138977,
-0.0623161680996418,
0.4022570252418518,
-0.1039416491985321,
0.208910167217254... | |
e.Day.IsSelectable = false;
}
}
``` | [
-0.027949150651693344,
0.05957639217376709,
0.3649112582206726,
-0.21737143397331238,
0.285626620054245,
-0.2758966386318207,
0.3482915163040161,
0.14422185719013214,
0.10309679061174393,
-0.6346776485443115,
-0.3737485408782959,
0.5146819353103638,
-0.5364927053451538,
0.2753128409385681,... | |
I have a \_Click event that is firing when a chart is clicked on. In this event I immediately cast the sender to type Chart. I often follow this paradigm but feel icky each time that I do.
In this particular instance I am also immediately running out to find a corresponding UpdatePanel so I can add a dynamically rende... | [
0.29419395327568054,
0.04087192937731743,
0.4341658353805542,
-0.21172507107257843,
-0.034510981291532516,
-0.13091939687728882,
0.1380755603313446,
-0.028505800291895866,
-0.2700742781162262,
-0.8743236660957336,
0.04651997983455658,
0.5998470783233643,
-0.452821284532547,
0.1478195786476... | |
ImageMapEventArgs e)
{
Chart chart = (Chart)sender;
UpdatePanel up = (UpdatePanel)chart.Parent.FindControl(chart.ID + "UP");
GridView gv = new GridView();
Dictionary<string, string> displayFields =
new Dictionary<string, string>();
// add data to displayFields by using the ImageMapEventArg... | [
0.1495339423418045,
-0.18312837183475494,
0.8765175938606262,
-0.037565965205430984,
-0.2747342884540558,
0.2201358675956726,
0.17015333473682404,
-0.5266350507736206,
-0.1395760327577591,
-0.6935214400291443,
-0.11688385158777237,
0.5754290819168091,
-0.4571029543876648,
0.001730099902488... | |
ways to deal with the associated controls problem.
* Add a property to the Chart called
"LinkedPanel" and assign your update panel to it
You'll see a similar pattern used in a notification icon, where you [associate it with a context menu](http://msdn.microsoft.com/en-us/library/system.windows.forms.notifyicon.conte... | [
0.030473262071609497,
-0.2990451753139496,
0.4540429413318634,
0.3038366138935089,
-0.06494208425283432,
-0.16840285062789917,
0.008624057285487652,
-0.06921658664941788,
-0.3791324496269226,
-0.8798902034759521,
0.08590156584978104,
0.4003439247608185,
-0.2728738784790039,
-0.070887617766... | |
knows about both controls, and have it handle the events that they raise
I agree that depending on the name just feels wrong; I'd be too embarassed/nervous to use it in production code :-/ (If you're the only developer, then I guess it's up to you...)
Using these other approaches makes it less likely that an "innocen... | [
0.5538969039916992,
0.027131574228405952,
-0.023698244243860245,
0.2116805911064148,
0.2575458586215973,
-0.1655292958021164,
-0.04673168435692787,
-0.2261965125799179,
0.041305433958768845,
-0.3086458146572113,
0.012682928703725338,
0.7139415740966797,
-0.040062714368104935,
-0.1696142703... | |
Starting to look at my last year project now, and so I'm doing the specification-requirements document. Now, it just so happens that this project requires a high degree of "usability" - I dunno if this is the right word in english, but what I mean is that it should be really easy to use from a user PoV. Now - in all th... | [
0.4804530143737793,
0.3427668809890747,
0.21933111548423767,
0.1339990496635437,
0.09620434790849686,
-0.33311983942985535,
0.414872407913208,
0.170060396194458,
-0.09192394465208054,
-0.48026153445243835,
0.06838729977607727,
0.49530014395713806,
0.28470170497894287,
-0.12497289478778839,... | |
usability though, but no one have yet given me an answer I felt was good enough.
*Our teachers have always preached that any requirement given on a project should be "test-able", but how do you test how easily accessable your user-interface is?*
Say I had a real-time application running. Here it wouldnt be too hard t... | [
0.0007023954531177878,
0.13517291843891144,
0.38258183002471924,
0.2705838978290558,
-0.14091722667217255,
-0.3509454131126404,
0.7286637425422668,
0.022905832156538963,
0.10025755316019058,
-0.5130914449691772,
0.0916723757982254,
0.5542659163475037,
0.28482022881507874,
-0.28864538669586... | |
to have thought about this, let alone having problems with it.
Try to define usability in terms of "test-able" requirements.
You already gave yourself the answer, because usability can be described in terms of requirements like "an entry should be deleted in less then 100ms after the initial call".
What makes a user ... | [
0.12725414335727692,
0.1395656317472458,
0.16712796688079834,
0.4423447847366333,
0.014921393245458603,
-0.09408923983573914,
0.4008658826351166,
-0.12102439999580383,
-0.03556343913078308,
-0.3080696761608124,
0.06116752699017525,
0.6116358041763306,
0.2375994771718979,
-0.375794857740402... | |
you get a list of features like:
* The department’s organization must be
shown in a hierarchical tree view.
* In this tree view drag & drop must be
possible.
* The font size must be
configurable and saved for each user.
* On the top of the screen there must
be a list of important links. Each
user may configure and sav... | [
0.3002241849899292,
0.21158811450004578,
0.3699807822704315,
0.18511629104614258,
0.16535347700119019,
0.07218486815690994,
0.4820172190666199,
-0.20884661376476288,
-0.3036019206047058,
-0.6918440461158752,
-0.5073109865188599,
0.8250576853752136,
0.25067421793937683,
-0.17493022978305817... | |
measurements (like in many commercial projects). If you have a "softer" form of project environment where not everybody is poking on figures, then sticking too much on this formalism may be counterproductive since flexibility and agility may suffer from this. | [
0.46683719754219055,
-0.12114649266004562,
-0.08880655467510223,
0.6688872575759888,
-0.1642639935016632,
0.07085661590099335,
0.2071707844734192,
-0.3389816880226135,
-0.3872460722923279,
-0.42720428109169006,
0.017163781449198723,
0.23856937885284424,
0.1422259360551834,
-0.4308978319168... | |
Does anybody have an idea how to use he "publish website" command on VS 2008 and be able to track changes so as to only sent to the hosting server the modified files?
When the command is called, the destination folder files are wiped and replaced with the result of the new build (assembly file are created as well as s... | [
0.6144707798957825,
0.22128020226955414,
0.48171108961105347,
0.03407822549343109,
-0.3764961063861847,
-0.45366379618644714,
0.5243253707885742,
0.06802919507026672,
-0.40870100259780884,
-0.5122297406196594,
0.2539267838001251,
0.5507115125656128,
-0.3140672743320465,
0.22564612329006195... | |
this?
ps: I use FileZila to transfer my files to the server.
Try to define usability in terms of "test-able" requirements.
You already gave yourself the answer, because usability can be described in terms of requirements like "an entry should be deleted in less then 100ms after the initial call".
What makes a user i... | [
0.27354466915130615,
0.009560087695717812,
0.27701613306999207,
0.3841109573841095,
0.10904718190431595,
-0.08665651828050613,
0.12624244391918182,
-0.12186761945486069,
-0.02048306353390217,
-0.44932061433792114,
0.10315898805856705,
0.4517827033996582,
-0.10625740885734558,
-0.1893277913... | |
you get a list of features like:
* The department’s organization must be
shown in a hierarchical tree view.
* In this tree view drag & drop must be
possible.
* The font size must be
configurable and saved for each user.
* On the top of the screen there must
be a list of important links. Each
user may configure and sav... | [
0.3002241849899292,
0.21158811450004578,
0.3699807822704315,
0.18511629104614258,
0.16535347700119019,
0.07218486815690994,
0.4820172190666199,
-0.20884661376476288,
-0.3036019206047058,
-0.6918440461158752,
-0.5073109865188599,
0.8250576853752136,
0.25067421793937683,
-0.17493022978305817... | |
measurements (like in many commercial projects). If you have a "softer" form of project environment where not everybody is poking on figures, then sticking too much on this formalism may be counterproductive since flexibility and agility may suffer from this. | [
0.46683719754219055,
-0.12114649266004562,
-0.08880655467510223,
0.6688872575759888,
-0.1642639935016632,
0.07085661590099335,
0.2071707844734192,
-0.3389816880226135,
-0.3872460722923279,
-0.42720428109169006,
0.017163781449198723,
0.23856937885284424,
0.1422259360551834,
-0.4308978319168... | |
I'm using Visual C# 2008 Express. I'd like to use the same icon for the application (ie, the icon shown for the .exe), and for the main form. Unfortunately, VC# doesn't seem to be very smart about this, and insists on duplicating the icon data.
There doesn't seem to be a way of selecting an "already embedded" icon for... | [
0.2660927176475525,
0.4351332485675812,
0.4866725504398346,
-0.11219552159309387,
-0.19210757315158844,
0.04759666696190834,
0.22242742776870728,
0.21008341014385223,
0.028063524514436722,
-0.6222757697105408,
0.13051506876945496,
0.8002937436103821,
-0.06792548298835754,
0.022375799715518... | |
but it bugs me.
Any idea how to avoid this? Is there a way to programatically load the executable's icon for use when the form is constructed, say? A couple of forum posts about similar things seem to suggest that .NET resources don't use the normal old Windows resource system -- is there a way from within the framewo... | [
0.0025704652070999146,
-0.00523493904620409,
0.40822693705558777,
0.2763303518295288,
-0.18476752936840057,
-0.24907274544239044,
0.39279821515083313,
0.052601635456085205,
-0.2092415988445282,
-0.4239068627357483,
0.06232886016368866,
0.7996862530708313,
-0.44138750433921814,
-0.008734351... | |
to a 16x16 icon in your forms window or on the taskbar, which will look terrible unless your 32x32 icon is very cleverly constructed.
The way I'm doing it is with interop (put the first line in your form constructor):
```
this.Icon = ExtractSmallIconFromLibrary(Application.ExecutablePath);
...
public static Icon Ext... | [
0.058695919811725616,
-0.29770296812057495,
0.8399220108985901,
-0.3284779489040375,
0.08992648124694824,
0.02011474035680294,
0.4502575993537903,
-0.40106573700904846,
-0.3098297417163849,
-0.48461517691612244,
-0.1861942559480667,
0.8016639351844788,
-0.5386390089988708,
0.03507107123732... | |
return icon;
}
[DllImport("Shell32", CharSet = CharSet.Auto)]
extern static int ExtractIconEx(
[MarshalAs(UnmanagedType.LPTStr)]
string lpszFile,
int nIconIndex,
IntPtr[] phIconLarge,
IntPtr[] phIconSmall,
int nIcons
);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
extern static bool ... | [
0.0807182565331459,
-0.24520361423492432,
0.35450857877731323,
-0.010403220541775227,
0.07273650169372559,
-0.13658565282821655,
0.47793668508529663,
-0.4248025417327881,
-0.14380866289138794,
-0.10856930911540985,
-0.03996550664305687,
1.008114218711853,
-0.5998042821884155,
-0.0550556257... | |
this [codeproject](http://www.codeproject.com/KB/dialog/AssigningDefaultIcon.aspx) program, which extracts the whole icon in the first place with a huge pile of code. | [
-0.13319456577301025,
0.05479919910430908,
0.20189440250396729,
0.07749775797128677,
-0.13983792066574097,
-0.31890740990638733,
-0.04208439588546753,
-0.18124979734420776,
-0.5043866038322449,
-0.11069094389677048,
-0.25794631242752075,
0.0825914740562439,
-0.34737932682037354,
0.13399054... | |
If I have a [VBScript](http://en.wikipedia.org/wiki/VBScript) like...
```
inputControl1 = InputBox("Hello World")
WScript.Quit
```
How can a check box be created in there rather then the InputBox?
I know VBScript itself does not have a checkbox control like the InputBox, but is there some library I can use to do so... | [
0.10882589221000671,
0.1421024352312088,
0.22065286338329315,
0.06949833035469055,
-0.03464150428771973,
-0.21785879135131836,
0.2839156687259674,
-0.12436150759458542,
-0.030004553496837616,
-0.8084664344787598,
-0.17047007381916046,
0.16332869231700897,
-0.4311232268810272,
0.27841457724... | |
I've tried `<UIRef Id="WixUI_Minimal" />`, but I get "Unresolved reference to symbol WixUI:WixUIMinimal". What am I doing wrong?
The wixui extension is no longer wixui.wixlib. It was rolled into the WixUIExtension.
If you are on the command line, add `-ext WixUIExtension` to the call to light.exe.
If you have a WiX p... | [
0.3981377184391022,
-0.13701026141643524,
0.692399263381958,
-0.3222567141056061,
-0.24623839557170868,
-0.07581482827663422,
0.4800511598587036,
-0.008251585997641087,
-0.06084124743938446,
-1.1296169757843018,
-0.06490260362625122,
0.4163619577884674,
-0.21718862652778625,
0.296663045883... | |
I'm curious to see how popular the alternatives to C are in the embedded developer world e.g. Ada...
I've only ever used C (with a little bit of assembler), but then my targets have very limited resources. Is there a move else where in this space to something else? What is winning the ware in set top boxes?
If !C wha... | [
0.4008858799934387,
0.17171044647693634,
-0.041666824370622635,
-0.15485712885856628,
-0.44742512702941895,
-0.271243691444397,
-0.013636280782520771,
-0.16787004470825195,
-0.22052103281021118,
-0.5156574845314026,
0.046950485557317734,
0.7741858959197998,
-0.1244037002325058,
-0.02213265... | |
I received some justified critical feedback on my last question ([How to gracefully exit from the middle of a nested subroutine when user cancels?](https://stackoverflow.com/questions/587218/how-to-gracefully-exit-from-the-middle-of-a-nested-subroutine-when-user-cancels)) for using the caption of a command button as a ... | [
-0.11554276943206787,
-0.2652776837348938,
0.1920967996120453,
-0.02680475078523159,
0.10936126857995987,
-0.04647604376077652,
0.1123185008764267,
-0.3967558741569519,
-0.22695350646972656,
-0.30461013317108154,
-0.18096335232257843,
0.14508116245269775,
-0.23475277423858643,
-0.033603228... | |
in a single place so your code won't start failing because you simply changed the text of a command button). I know my variable and control naming convention is poor (OK, nonexistent), so apologies in advance. But I'd like to stay focused on the caption as state variable discussion.
So here we go:
```
' Global variab... | [
0.09548726677894592,
-0.19442076981067657,
0.4924623966217041,
0.22247421741485596,
0.08917788416147232,
-0.32924938201904297,
0.12120479345321655,
-0.23188823461532593,
-0.16191492974758148,
-0.2637827396392822,
-0.3146244287490845,
0.35096123814582825,
-0.532512366771698,
-0.071275398135... | |
the caption state when form initializes
DoTheThing.Caption = DoTheThingCaption(0)
End Sub
Private Sub DoTheThing_Click() ' Command Button
If DoTheThing.Caption = DoTheThingCaption(0) Then
UserCancel = False ' this is the first time we've entered this sub
Else ' We've re-entered this routine (user clicked on butto... | [
-0.043125271797180176,
-0.28513944149017334,
0.970819354057312,
-0.14309126138687134,
0.1514897644519806,
-0.2103884369134903,
0.5288446545600891,
-0.3249008357524872,
0.02329196035861969,
-0.34558242559432983,
-0.5451160073280334,
0.4587773382663727,
-0.4848935604095459,
0.028251899406313... | |
i = 0 To ReallyBigNumber
Call DoSomethingSomewhatTimeConsuming
If UserCancel = True Then Exit For ' Exit For Loop if requested
DoEvents ' Allows program to see GUI events
Next
' We've either finished or been canceled, either way
' we want to change caption back
DoTheThing.Caption = DoTheThingCaption(0)
If UserC... | [
0.05096356198191643,
-0.1995583474636078,
0.7278984189033508,
0.10373412072658539,
0.16889126598834991,
-0.18179410696029663,
0.7705768346786499,
-0.2214743196964264,
-0.10414115339517593,
-0.7333064079284668,
-0.41019928455352783,
0.5022838115692139,
-0.012954553589224815,
0.2256189286708... | |
'Prevent additional clicks
End Sub '******* We exit sub here if we did get canceled *******
```
So there it is. Is there still anything really *that* bad about doing it this way? Is it just a style issue? Is there something else that would give me these four things in a more desirable or maintainable way?
1. Inst... | [
0.37863442301750183,
-0.1351473182439804,
0.3961470127105713,
0.00008250598330050707,
-0.16955125331878662,
-0.2135804295539856,
0.27013736963272095,
-0.42085570096969604,
-0.4572617709636688,
-0.2566503584384918,
-0.09104318171739578,
0.6612273454666138,
-0.28271740674972534,
0.0352448709... | |
clutter on the GUI)
4. A simple, immediate command button disable to prevent multiple close requests
I can see one concern might be the close coupling (in several ways) between the code and the GUI, so I could see how that could get to be a big problem for large projects (or at least large GUIs). This happens to be a ... | [
-0.17056795954704285,
0.09537483751773834,
0.641019344329834,
0.30330291390419006,
0.05422927439212799,
-0.10167420655488968,
-0.015121113508939743,
0.12413957715034485,
-0.34600692987442017,
-0.5344119668006897,
-0.0947108343243599,
0.6539116501808167,
-0.37686067819595337,
-0.06268112361... | |
refactored version...
```
Private Const Caption_Start As String = "Click to Start Doing the Thing"
Private Const Caption_Stop As String = "Click to Stop Doing the Thing"
Private Enum eStates
State_Initialized
State_Running
State_Canceled
State_Completed
End Enum
Private Current_State As eStates
Private Sub ... | [
-0.027278564870357513,
-0.2950952649116516,
0.8019450306892395,
0.05667530745267868,
0.30465254187583923,
-0.128980353474617,
0.4395339787006378,
-0.5591947436332703,
-0.4314393699169159,
-0.2262706756591797,
-0.5846160054206848,
0.40841761231422424,
-0.1590944081544876,
0.2301153391599655... | |
False
Else
'not running - so set state and caption'
Current_State = State_Running
DoTheThing.Caption = Caption_Stop
'do the work'
For i = 0 To ReallyBigNumber
Call DoSomethingSomewhatTimeConsuming
'at intervals check the state for cancel'
If Current_State = State_Canceled The... | [
0.3642768859863281,
-0.2296629697084427,
0.5488781929016113,
0.07380188256502151,
0.4476952850818634,
-0.33929678797721863,
0.8076542019844055,
-0.31198662519454956,
-0.08976167440414429,
-0.11389061063528061,
-0.20021173357963562,
0.7270482778549194,
-0.33406147360801697,
0.07440037280321... | |
Exit For
End If
DoEvents
Next
'did we make it to the end without being canceled?'
If Current_State <> State_Canceled Then
Current_State = State_Completed
DoTheThing.Caption = Caption_Start
End If
End If
End Sub
``` | [
-0.13924330472946167,
-0.07933768630027771,
0.8997324705123901,
0.17324399948120117,
0.6009392142295837,
-0.04375790059566498,
0.6490030884742737,
-0.001530833775177598,
-0.23768553137779236,
-0.4124273955821991,
-0.45798078179359436,
0.09089502692222595,
0.010481086559593678,
0.3821934759... | |
I'm looking to get a more thorough understanding of the ASP.NET page lifecycle. I'm in the process of building custom form controls and have found my knowledge in this area to be lacking.
- Are there any resources, tutorials, etc. that you've used to better understand this area?
- Are there any tools you've used to im... | [
0.20334498584270477,
-0.06634391844272614,
0.11363139748573303,
-0.01434741634875536,
-0.1819145232439041,
0.10855430364608765,
0.2207006812095642,
0.09057100862264633,
-0.7813752293586731,
-0.45950520038604736,
-0.07896295189857483,
0.14430904388427734,
0.2624613046646118,
0.1603356301784... | |
I've done several projects and packaged them into jar files, but I've noticed that my jar files run much more slowly than in my IDE.
I use Eclipse to compile and run my programs. In Eclipse, I have everything working. When I package my project as a runnable Jar and execute it by double-clicking, everything still works... | [
0.5986269116401672,
0.4893907606601715,
-0.06357255578041077,
-0.17938701808452606,
-0.2813585102558136,
0.1298995167016983,
0.3701833486557007,
-0.14499792456626892,
-0.16279487311840057,
-1.0628774166107178,
0.2255057990550995,
0.42133331298828125,
-0.13327892124652863,
0.064960539340972... | |
-jar MyCode.jar`), the lag disappears and my program works as normal.
I currently have no idea what's causing this problem. My computer is running Windows Vista. I'm using the latest version of JRE and JDK. My program contains an animation, nothing fancy.
Thanx
**Solution:**
There were several different versions of ... | [
0.48251664638519287,
0.40407657623291016,
0.588746190071106,
-0.2913596034049988,
-0.11241413652896881,
-0.16001661121845245,
0.7724035382270813,
0.2702207565307617,
-0.0729212835431099,
-0.829544723033905,
0.07557696104049683,
0.6230774521827698,
-0.03884303197264671,
0.4815475344657898,
... | |
This is taken from Jon Skeet's excellent personal C# site (<http://www.yoda.arachsys.com/csharp/>):
```
StringBuilder first = new StringBuilder();
StringBuilder second = first;
first.Append ("hello");
first = null;
Console.WriteLine (second);
```
1) Changing the value of first will not change the value of second -
... | [
-0.10144447535276413,
0.010362633503973484,
0.22578047215938568,
-0.33786293864250183,
-0.09507234394550323,
0.059769708663225174,
0.335350900888443,
-0.2095635086297989,
-0.16330067813396454,
-0.5259261131286621,
-0.24445956945419312,
0.26202550530433655,
-0.3056570887565613,
0.3247499763... | |
another compatible object, it won't have an effect on two?
Everything on that page makes sense, I think it's just an issue with my interpretation of the English.
Thanks
`first` is a reference to an object of type `StringBuilder`. That is, `first` stores a value that can be used to refer to an object on the heap that ... | [
0.05124860629439354,
-0.3497796952724457,
0.3195098340511322,
0.04006107896566391,
-0.23101375997066498,
-0.13884872198104858,
0.14328479766845703,
0.06068483367562294,
0.014258402399718761,
-0.7196819186210632,
-0.1294362097978592,
0.47875073552131653,
-0.38349175453186035,
0.122184947133... | |
is. That is, you are using `first` to refer to a different object. This does not impact `second`; its value is unaffected by changes to the value of `first`. (Remember: the value of `first` and `second` are references that initially have the same referent. But just like with
```
int x = 1;
int y = x;
x = 2;
```
does... | [
0.030871305614709854,
0.11265799403190613,
0.052061498165130615,
-0.01739901304244995,
-0.08956950902938843,
-0.20360466837882996,
0.2034420669078827,
0.03722219169139862,
-0.012782244943082333,
-0.9025198817253113,
-0.24629630148410797,
0.41438546776771545,
-0.2653283476829529,
0.29967764... | |
it like this. Let's say I create a text file `first.html` whose contents are
```
<a href="http://stackoverflow.com">Stack Overflow</a>
```
and I issue the command `copy first.html second.html`. Then both pages can be used to refer to the same webpage; by following the link we arrive at the same referent. If changes ... | [
0.2601831555366516,
0.10199222713708878,
0.6853947043418884,
-0.23717007040977478,
-0.23469702899456024,
-0.26819249987602234,
-0.07799126207828522,
-0.1458626389503479,
-0.3471532464027405,
-0.7267134785652161,
-0.10955826938152313,
0.5040423274040222,
-0.2597740888595581,
0.3193925917148... | |
change does not impact the value of `second.html`. It is still
```
<a href="http://stackoverflow.com>Stack Overflow</a>
```
Think of the contents of these files as the values of a reference type, and the ultimate desination as the referent object. | [
-0.2018030434846878,
-0.14341479539871216,
0.6080058813095093,
-0.10087144374847412,
0.013439729809761047,
-0.13931645452976227,
0.16802425682544708,
-0.15358209609985352,
-0.38774311542510986,
-0.7769021987915039,
-0.2028125524520874,
0.2503253221511841,
-0.19904932379722595,
0.5040942430... | |
I get this error
```
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED
```
The rest of the error message is similar to [here](http://ubuntuforums.org/showthread.php?t=596176).
I have SSH keys in my server. I have my private key in my desktop. I am not sure where I should put it.
```
Add correct host key in ~/Users/S... | [
0.13339629769325256,
0.3699365258216858,
0.38929495215415955,
0.055067308247089386,
0.15120874345302582,
-0.2103027105331421,
0.6600973606109619,
0.23643453419208527,
-0.37470951676368713,
-0.7664171457290649,
-0.24319568276405334,
0.39555105566978455,
-0.25667208433151245,
0.5730767250061... | |
as your intended target in some fashion, in order to steal your credentials or some other malicious behaviour.
The message also naturally occurs if the public key on the server has been explicitly changed, which can happen for a number of legitimate reasons - a vulnerability in Debian-based Linux distributions in the ... | [
0.20477871596813202,
-0.358318030834198,
0.39863499999046326,
0.012529931962490082,
0.15499445796012878,
-0.2448994666337967,
0.5248693227767944,
0.23522120714187622,
-0.440059095621109,
-0.3002859652042389,
-0.5791234970092773,
0.3207607865333557,
-0.2389976531267166,
0.39982345700263977,... | |
via an alternative (secure) channel and update your client's local copy so it recognises the server's credentials once more.
If you don't control the server, contact the person or organisation that does, and find out whether the change was legitimate.
You **don't** need to modify your private key in any way; this is ... | [
0.48334380984306335,
-0.01461282279342413,
0.45567551255226135,
0.12760214507579803,
0.17541193962097168,
-0.20667389035224915,
0.49150973558425903,
0.019373100250959396,
-0.2887241542339325,
-0.5251564979553223,
-0.37699055671691895,
0.5277518033981323,
-0.1620350331068039,
0.172981485724... | |
I want to get the number of rows in my MySQL table and store that number in a php variable. This is the code I'm using:
```
$size = @mysql_query("SELECT COUNT(*) FROM News");
```
$size ends up being "Resource ID #7." How do I put the number of rows directly into $size?
mysql\_query returns a query resource id. In or... | [
0.14579284191131592,
0.20138061046600342,
0.6295502781867981,
-0.13012517988681793,
-0.06207491084933281,
0.21268656849861145,
0.15365135669708252,
-0.4428851902484894,
-0.2708171606063843,
-0.589638352394104,
0.10414274036884308,
0.6024494767189026,
-0.20968031883239746,
0.193405449390411... | |
I have an Office add-in project with a setup project for deployment (using VS 2008), and I need to build the same product in a few different flavours.
I'm looking for a good way to make the installer resources dependent on the build configuration. The product name, manufacturer, manufacturer url, author, etc., etc. p... | [
0.9119516015052795,
0.2759566903114319,
0.2071499526500702,
-0.1308439075946808,
0.08769562840461731,
0.0861763060092926,
0.0929396003484726,
0.02571934089064598,
-0.04946565255522728,
-0.7893121242523193,
-0.060001447796821594,
0.6329714059829712,
-0.03712836280465126,
0.14862878620624542... | |
build events, but this approach seems overly complex and fragile.
Does anyone have any ideas on a clean way to go about doing this?
Another option, although it is a bit more work up front, is to throw the setup project out the window and use e.g. WiX instead (<http://wix.sf.net>) | [
0.8069981336593628,
-0.015973152592778206,
-0.30678147077560425,
0.22543014585971832,
-0.15854674577713013,
-0.4935099482536316,
0.410128653049469,
0.033129170536994934,
-0.22420763969421387,
-0.43317481875419617,
0.011872136034071445,
0.5120182037353516,
-0.11948677152395248,
-0.281775861... | |
I have some C++ doing OpenGL drawing and am trying to figure out how to include the opengl headers without it giving me thousands of errors in the obj-c code.
I'm not getting any errors.
Are you doing
`#include <OpenGLES/ES1/gl.h>`
? | [
0.6470527052879333,
0.16707514226436615,
0.22569401562213898,
0.034221358597278595,
-0.21409255266189575,
-0.25703659653663635,
0.1971401870250702,
0.12298663705587387,
-0.505230724811554,
-0.48829135298728943,
-0.10790097713470459,
0.7615668177604675,
-0.5114790797233582,
-0.1712425500154... | |
It recently occurred to me that I (and I think most people) learned computer programming starting with something like Visual Basic. I began to wonder if we had started at the lower level first if it would be easier now.
Do you think it is any value as a programmer to understand things like how a CPU works, the basic i... | [
0.4877510070800781,
0.11629940569400787,
-0.09198962152004242,
0.4121141731739044,
-0.08947541564702988,
-0.05204758793115616,
0.11912449449300766,
0.22788235545158386,
-0.3269102871417999,
-0.7514780163764954,
0.3322875499725342,
0.8341231942176819,
0.060212019830942154,
-0.18698497116565... | |
a high level easier.
Programming languages are virtual machines. C, C#, Fortran, Basic, etc are CPUs in and of itself, albeit portable. They say that if you are programming on Fortran, you are programming on some sort of Fortran machine. If you are programming on C, you are programming on some sort of C machine. There'... | [
0.1795356422662735,
0.1845184713602066,
0.16224221885204315,
0.5191096663475037,
0.07508988678455353,
0.005739325191825628,
0.15532445907592773,
0.4151547849178314,
-0.3490869700908661,
-0.8028271794319153,
-0.17195487022399902,
0.6135087013244629,
-0.08280321955680847,
-0.0354214906692504... | |
pointers, manual memory manipulation, instructions, pointers to function, etc with languages like C, or C# with unsafe option.
You are not missing something even if you don't know the CPU in depth.
But if you really want to **squeeze performance** out of your program, there's a real value in knowing what goes under t... | [
0.3975878357887268,
0.1469300240278244,
-0.036420341581106186,
0.5326957702636719,
0.22186078131198883,
-0.11788705736398697,
0.4291844666004181,
0.017670737579464912,
-0.33167362213134766,
-0.43245354294776917,
-0.007103626150637865,
0.9122331142425537,
0.10691947489976883,
-0.32263866066... | |
I just stumbled (by accident) on yet another stupid not-sanitized-at-all sql injection flaw in a project I'm working on ...and I'm so tired of it.
Do you have any advise on how to eliminate such bad sql statements and enforce prepared statements where ever feasible? Right now I would prefer a solution like
```
REVOK... | [
0.5846006870269775,
0.41719406843185425,
-0.18916228413581848,
0.21629852056503296,
0.07923339307308197,
-0.47500815987586975,
0.46228647232055664,
0.25398552417755127,
-0.26815181970596313,
-0.4423578381538391,
0.030076876282691956,
0.5558447241783142,
-0.17453308403491974,
0.002355366712... | |
didn't seem to work too well in the past. Therefore I would really prefer something that prevents such queries in the first place. Not to deliberately break existing code but for future projects, some "there are no such queries" solution ;-)
If you are already using static code analysis tools, you could configure it to... | [
0.2579548954963684,
0.05788586661219597,
0.03258752077817917,
0.27750641107559204,
0.04299863055348396,
-0.44734424352645874,
0.3772145211696625,
0.10351942479610443,
-0.34526365995407104,
-0.4753129780292511,
0.03679799661040306,
0.44192567467689514,
-0.35047098994255066,
0.21195763349533... | |
I've reviewed questions [How to use include directive correctly](https://stackoverflow.com/questions/464560/how-to-use-include-directive-correctly) and [C++ #include semantics](https://stackoverflow.com/questions/179213/c-include-semantics) and neither addresses this - nor do the others suggested by SO when I typed the... | [
-0.0141616091132164,
0.337753027677536,
0.04904685541987419,
-0.14619022607803345,
-0.06092897057533264,
-0.19887126982212067,
0.21576598286628723,
-0.42845919728279114,
-0.03769063949584961,
-0.4946386516094208,
-0.038828086107969284,
0.5691492557525635,
-0.003305227030068636,
-0.14132431... | |
is that while you do not need to move files around, you might be able to get away without always using '`-I`' directives to find headers, but the loss of flexibility, and the complexity of compiling in sub-sub-directories, etc seems to outweigh the benefit.
So, am I overlooking a benefit?
---
Thanks for the inputs. ... | [
0.6945692300796509,
0.024428945034742355,
-0.11540330946445465,
0.28434017300605774,
0.26033899188041687,
-0.27844804525375366,
-0.1452644169330597,
0.2628345489501953,
-0.28380391001701355,
-0.5696884989738464,
-0.06258486956357956,
0.16706383228302002,
0.04183609411120415,
0.126403719186... | |
there are various sets of headers, often with a prefix such as `rspqr.h`, `rsabc.h`, `rsdef.h`, `rsxyz.h`. These are all related to code in the `rsmp` directory, but some of the headers are in `rsmp` and others are in the central include directory, which does not have sub-directories such as `rsmp` in it. (And repeat f... | [
0.47852230072021484,
0.09012188017368317,
0.13983431458473206,
0.21821285784244537,
-0.13133712112903595,
-0.17256757616996765,
0.10497176647186279,
-0.11599315702915192,
-0.5856632590293884,
-0.2486518770456314,
-0.4402425289154053,
-0.18169857561588287,
-0.5561168193817139,
0.30942308902... | |
`-I` options are provided. All in all, it is a sad story of not-so-benign neglect over a period of decades. Fixing it all without breaking anything is going to be a long, tedious job.
I prefer the path syntax as it makes it very clear what namespace or module the header file belongs to.
```
#include "Physics/Solver.h"... | [
0.46567124128341675,
0.3976576030254364,
0.11370806396007538,
0.04521027207374573,
0.14836058020591736,
-0.19968321919441223,
0.2810741364955902,
0.0386880598962307,
-0.1317041665315628,
-0.6429691910743713,
-0.5801782011985779,
0.2621711492538452,
-0.06806393712759018,
0.2555552124977112,... | |
I want to validate a date in my model in Ruby on Rails, however, the day, month and year values are already converted into an incorrect date by the time they reach my model.
For example, if I enter February 31st 2009 in my view, when I use `Model.new(params[:model])` in my controller, it converts it to "March 3rd 2009... | [
-0.09741703420877457,
0.1951356679201126,
0.7192745208740234,
-0.034759871661663055,
0.011074316687881947,
0.048152513802051544,
0.4517684280872345,
0.16555757820606232,
-0.2690867781639099,
-0.221956267952919,
0.16505199670791626,
0.13890545070171356,
0.03565990552306175,
0.32689797878265... | |
wrong?
I found this "[Date validation](http://www.ruby-forum.com/topic/53191)" that discusses the problem but it never was resolved.
I'm guessing you're using the `date_select` helper to generate the tags for the date. Another way you could do it is to use select form helper for the day, month, year fields. Like this ... | [
0.13718974590301514,
0.16834723949432373,
0.8429837226867676,
0.09105435758829117,
0.31933045387268066,
0.4337351620197296,
0.21697084605693817,
-0.45362260937690735,
-0.09922037273645401,
-0.21896128356456757,
-0.2512491047382355,
0.5354074835777283,
-0.0851205512881279,
0.221112057566642... | |
false
end
end
def validate_created_at
errors.add("Created at date", "is invalid.") unless convert_created_at
end
```
If you're looking for a plugin solution, I'd checkout the [validates\_timeliness](http://github.com/adzap/validates_timeliness/) plugin. It works like this (from the github page):
```
class Perso... | [
0.2198285162448883,
0.3524616062641144,
0.4516133666038513,
-0.047720760107040405,
0.3008743226528168,
0.030823471024632454,
0.48957356810569763,
-0.3233264684677124,
0.27765265107154846,
-0.22540785372257233,
-0.1786501407623291,
0.5627393126487732,
0.14395056664943695,
0.3872260749340057... | |
- use the :timeliness key and set the type in the hash.
``` | [
0.2449016273021698,
0.4184476137161255,
0.15326641499996185,
0.06139838695526123,
0.2886441946029663,
-0.15469428896903992,
-0.027559610083699226,
-0.04209078848361969,
0.1721278429031372,
-0.404945969581604,
-0.4226933717727661,
0.40160083770751953,
-0.3531671464443207,
0.2826277613639831... | |
How do get the paging functionality (like we have in asp.net gridview) in Listview control?
Thanks!
use the pager control
see this link: <https://web.archive.org/web/20211031102325/https://aspnet.4guysfromrolla.com/articles/021308-1.aspx> | [
0.12885986268520355,
-0.33363500237464905,
0.2701684236526489,
0.21536822617053986,
-0.12772314250469208,
-0.1671673059463501,
0.20473264157772064,
-0.0943141058087349,
-0.4396471083164215,
-0.6381596922874451,
0.18738791346549988,
0.45279553532600403,
-0.10061979293823242,
-0.266423702239... | |
I'm working on a WinForms Jukebox.
I'd like to have a vertical ProgressBar for the volume control.
Does anyone know how to do that?
I don't know that I'd use a progress bar to **control** the volume, but to **display** the volume level you could use a user drawn control or you could just resize a label with a back... | [
0.46782881021499634,
0.11859975010156631,
0.21925240755081177,
0.25418785214424133,
-0.06282097846269608,
0.31983739137649536,
-0.09232664108276367,
0.023940354585647583,
-0.06688222289085388,
-0.6458410620689392,
0.5045208930969238,
0.761415421962738,
0.15820612013339996,
0.30847030878067... | |
vertical orientation](http://msdn.microsoft.com/en-us/library/system.windows.forms.trackbar.orientation.aspx).
For what it's worth, there's [a discussion on how to create a vertical progress bar on MSDN](http://social.msdn.microsoft.com/forums/en-US/winforms/thread/60b2493d-c8ff-495d-b845-d114fe456f54/), where they su... | [
0.27108410000801086,
-0.152190700173378,
0.9764660596847534,
-0.08130042999982834,
0.031183892861008644,
0.31526103615760803,
0.008846155367791653,
-0.44186753034591675,
-0.22126714885234833,
-0.6245831847190857,
0.026402641087770462,
0.12793715298175812,
-0.18917326629161835,
0.2480611354... | |
I'd like to create a sidebar gadget in Vista. I've followed [this tutorial](http://msdn.microsoft.com/en-us/magazine/cc163370.aspx) on how to create one to the letter. However, the gadget simply will not show up in the Gadget Gallery when I go to Add Gadgets in the sidebar.
I've tried resetting the sidebar, deleting t... | [
0.5704399943351746,
0.06446390599012375,
0.40691521763801575,
0.12352091073989868,
0.10637868195772171,
-0.23896244168281555,
0.46742844581604004,
0.2230856716632843,
-0.1040043756365776,
-0.8978276252746582,
0.05026576295495033,
0.5198841691017151,
-0.11381832510232925,
0.2727660238742828... | |
custom gadget in the Gadget Gallery check that the search box does not display 'Microsoft Corporation'.
[alt text http://www.freeimagehosting.net/uploads/6b6b3e75c7.png](http://www.freeimagehosting.net/uploads/6b6b3e75c7.png)
This is the default and will only display Microsoft's gadgets, change this to 'All gadgets' ... | [
0.5590769648551941,
0.11060444265604019,
0.32836446166038513,
0.3961595892906189,
-0.18287456035614014,
-0.025675592944025993,
0.09268214553594589,
0.08126742392778397,
-0.3025118112564087,
-0.20899254083633423,
0.0002926302549894899,
0.48769089579582214,
-0.5641955733299255,
0.34660843014... | |
For a while I've been thinking of trying to do a port of one of my favorite classic PC games, [The Ur-Quan Masters](http://sc2.sourceforge.net) (aka [Star Control 2](http://en.wikipedia.org/wiki/Star_control_2)) to the iPhone. UQM uses SDL for all its graphics, sound, input and other gamey stuff and there does seem to ... | [
0.09207099676132202,
-0.253174751996994,
0.4889206290245056,
0.0905955508351326,
-0.18385528028011322,
-0.1375729888677597,
-0.014035213738679886,
0.12213318794965744,
-0.13748492300510406,
-0.7893281579017639,
-0.17055293917655945,
0.5660607814788818,
-0.21697355806827545,
0.1254654526710... | |
can anyone reccomend an alternative framework to look at that will bridge the gap between SDL and the native libraries like OpenGL ES and Core Audio? Or is coding to those frameworks the best option?
**Edit to add:** Here's a link to a [forum thread](http://forum.uqm.stack.nl/index.php?topic=4254.0) on the UQM forum a... | [
0.3849332630634308,
-0.07005360722541809,
0.4167099893093109,
0.2322445809841156,
-0.12701569497585297,
-0.2994533181190491,
0.3869949281215668,
-0.18923188745975494,
-0.17245781421661377,
-0.5626122355461121,
-0.10537242144346237,
0.6860846877098083,
-0.26822465658187866,
-0.1301539093255... | |
up on view orientation changes, etc. It was nice to see a familiar face but in the end SDL introduced more problems than it solved.
**2009 answer**
The svn version's working well for me.
I had one problem and that was a crash in `atexit(SDL_Quit)`.
So I disabled cleanup.
Plus the library names are not sensible, ... | [
-0.0010906141251325607,
0.20331299304962158,
0.8309161067008972,
0.0627841055393219,
-0.17388004064559937,
0.04258937016129494,
0.2824825942516327,
-0.041907504200935364,
-0.3681444525718689,
-0.6986516714096069,
0.08145827054977417,
0.8986789584159851,
-0.07037727534770966,
-0.20454670488... | |
5 stars. | [
-0.32800614833831787,
0.077537901699543,
0.004479715134948492,
0.45862069725990295,
0.02529301308095455,
-0.17199446260929108,
0.449790358543396,
-0.07602351903915405,
-0.026952501386404037,
-0.17482168972492218,
-0.26692724227905273,
0.712040364742279,
0.3295755088329315,
0.53121525049209... | |
To clarify the title question, I have code such as:
```
<img src='gallery/main.php?g2_view=core.DownloadItem&g2_itemId=8161&g2_serialNumber=2&g2_GALLERYSID=5b24df90ee45f0e01795a3c01a1d634b'>
```
with the file actually residing in the file system under my webroot. Is there any way in PHP to retrieve the images real p... | [
0.3201626241207123,
0.24858400225639343,
0.341510146856308,
0.14766864478588104,
-0.20287089049816132,
-0.29276564717292786,
-0.040999606251716614,
-0.0038835005834698677,
-0.40462958812713623,
-0.4138047397136688,
-0.08397334069013596,
0.39607495069503784,
0.06647294014692307,
0.347372770... | |
it may even have been answered there already.
Using Google Codesearch, I've found that main.php appears to have the code to do this already:
```
$path = GalleryDataCache::getCachePath(
array('type' => 'fast-download', 'itemId' => $itemId));
```
`$path` appears to be a file, which, when included provides maybe t... | [
0.02350921742618084,
-0.1534709632396698,
0.4732247292995453,
0.053657107055187225,
-0.15376025438308716,
-0.025476736947894096,
0.33425694704055786,
0.012653003446757793,
-0.20145542919635773,
-0.4851243793964386,
-0.03268780559301376,
0.3864576518535614,
-0.2964359223842621,
-0.058216985... | |
I frequently encounter situations, especially with sorting in C++, where I am comparing a series of fields in order to compare a larger structure. A simplified example:
```
struct Car{
Manufacturer make;
ModelName model;
Year year;
};
bool carLessThanComparator( const Car & car1, const Car & car2 ){
i... | [
0.3838654160499573,
0.20067332684993744,
0.46701720356941223,
-0.11061682552099228,
0.14825905859470367,
0.27643877267837524,
0.16975577175617218,
-0.2785843312740326,
-0.06720387190580368,
-0.3586224913597107,
-0.2042325884103775,
0.2412388026714325,
0.19741661846637726,
0.704449176788330... | |
return true;
}else if( car1.model == car2.model ){
if( car1.year < car2.year ){
return true;
}
}
}
return false;
}
```
My instinctive approach seems cumbersome, especially for more than 3 fields. How would you structure this series of comparisons in C++... | [
0.287017285823822,
0.32747015357017517,
0.13127493858337402,
0.03543077036738396,
-0.06899159401655197,
0.14421118795871735,
0.20144245028495789,
-0.28643152117729187,
0.06228512153029442,
-0.34914469718933105,
0.02079957351088524,
0.6731862425804138,
-0.026548413559794426,
0.3158141970634... | |
other languages provide a more succinct or elegant syntax?
Well, if your function hits a return in the **if** clause, there's no need for an explicit **else**, since it would have already bailed out. That can save on the "indent valley":
```
bool carLessThanComparator( const Car & car1, const Car & car2 ) {
if( ca... | [
0.024354813620448112,
-0.11243189871311188,
0.32274943590164185,
-0.03709566220641136,
0.19560299813747406,
0.3838556408882141,
0.5115090608596802,
-0.0529952198266983,
-0.06558353453874588,
-0.30760905146598816,
-0.33753466606140137,
0.5430124402046204,
-0.11088059842586517,
-0.0350458733... | |
return true;
if( car1.model != car2.model )
return false;
if( car1.year < car2.year )
return true;
return false;
}
```
I like MarkusQ's LISPish short-circuiting approach as well. | [
-0.0009009837522171438,
0.17273351550102234,
0.058212313801050186,
-0.07366374880075455,
-0.009785756468772888,
0.08079099655151367,
0.37165194749832153,
0.07552266120910645,
0.08486595004796982,
-0.23556143045425415,
-0.38192084431648254,
0.6493091583251953,
0.012539061717689037,
0.253453... | |
Applications like Microsoft Outlook and the Eclipse IDE consume RAM, as much as 200MB. Is it OK for a modern application to consume that much memory, given that few years back we had only 256MB of RAM? Also, why this is happening? Are we taking the resources for granted?
Is it acceptable when most people have 1 or 2 gi... | [
0.03492864593863487,
0.23653694987297058,
0.018492083996534348,
0.21455933153629303,
0.03735972195863724,
-0.14322392642498016,
-0.01903705485165119,
0.19374875724315643,
-0.4475032687187195,
-0.85190749168396,
0.07766279578208923,
0.401027649641037,
-0.20559799671173096,
-0.25115427374839... | |
I have very quickly gets all used up. End result - your app appears slow, resource hungry and takes a long time to startup.
I think people will start to rebel against resource-hungry applications unless they get 'value for ram'. you can see this starting to happen on servers, as virtualised systems gain popularity - p... | [
0.5744598507881165,
0.3909901976585388,
0.16507475078105927,
0.16769470274448395,
0.129904106259346,
-0.03825721517205238,
0.28816482424736023,
0.29615023732185364,
-0.3556373715400696,
-0.5971456170082092,
-0.0032787066884338856,
0.6239600777626038,
-0.1509094387292862,
0.1309584528207779... | |
my machine was responsive.
Today I have a dual-processor 2.8Ghz server box with 3Gb RAM, but I cannot realistically run more than 2 copies of Visual Studio 2008, they both take ages to start up (as all that RAM still has to be copied in and set up, along with all the other startup costs we now have), and even Word tak... | [
0.07362443953752518,
0.30352675914764404,
0.3916398584842682,
-0.1153242364525795,
-0.25838503241539,
0.26128458976745605,
0.23948313295841217,
0.1800106316804886,
-0.21810398995876312,
-0.8570930361747742,
0.30651286244392395,
0.7185423374176025,
0.045427706092596054,
-0.02583363093435764... | |
I have date strings such as *2009-02-28 15:40:05 AEDST* and want to convert it into SYSTEMTIME structure. So far I have:
```
SYSTEMTIME st;
FILETIME ft;
SecureZeroMemory(&st, sizeof(st));
sscanf_s(contents, "%u-%u-%u %u:%u:%u",
&st.wYear,
&st.wMonth,
&st.wDay,
&st.wHour,
&st.wMinute,
&st.wSecon... | [
-0.16252411901950836,
-0.09659211337566376,
0.8877217173576355,
-0.03279123827815056,
0.2710479497909546,
0.21705792844295502,
0.2724522352218628,
0.058546923100948334,
-0.17261014878749847,
-1.0463876724243164,
-0.2307724803686142,
0.4511350691318512,
-0.05566687509417534,
0.1719323843717... | |
TIME_ZONE_INFORMATION TimeZoneInfo;
GetTimeZoneInformation( &TimeZoneInfo );
// Convert local time to UTC.
SYSTEMTIME GmtTime = { 0 };
TzSpecificLocalTimeToSystemTime( &TimeZoneInfo,
&LocalTime,
&GmtTime );
// GMT = LocalTime + TimeZoneInfo.Bias... | [
-0.07746801525354385,
-0.5171730518341064,
0.7390968799591064,
0.08500217646360397,
0.407582551240921,
0.15610197186470032,
0.041890088468790054,
0.13469527661800385,
-0.26786357164382935,
-0.6371446251869202,
-0.29271772503852844,
0.4343600273132324,
-0.12403006106615067,
0.32108113169670... | |
local time
// and GMT in minutes.
// Local time expressed in terms of GMT bias.
float TimeZoneDifference = -( float(TimeZoneInfo.Bias) / 60 );
CString csLocalTimeInGmt;
csLocalTimeInGmt.Format( _T("%ld:%ld:%ld + %2.1f Hrs"),
GmtTime.wHour,
GmtTime.wMinute, | [
0.04666023701429367,
-0.4483981132507324,
0.6978696584701538,
-0.013722825795412064,
0.23704420030117035,
0.3972703516483307,
0.11981884390115738,
0.08992093801498413,
-0.16331394016742706,
-0.8170967102050781,
-0.2507688105106354,
0.22017355263233185,
-0.03369160741567612,
0.2120198309421... | |
GmtTime.wSecond,
TimeZoneDifference );
```
**Question: How do you get the TIME\_TIMEZONE\_INFORMATION for a specific timezone?**
Well unfortunately you cannot do that with the win32 API. Refer to [MSDN](http://msdn.microsoft.com/en-us/library/ms725481(VS.85).aspx) and [How do I get a specif... | [
0.01926576718688011,
-0.1142624095082283,
0.4123358130455017,
0.16387178003787994,
0.3750171959400177,
-0.27907466888427734,
0.15096919238567352,
0.0791240930557251,
-0.202810600399971,
-0.5940723419189453,
-0.27697983384132385,
0.5808680653572083,
-0.0949464812874794,
0.261383056640625,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.