text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
This is a continuation question from a previous question [I have asked](https://stackoverflow.com/questions/142237/integrating-external-sources-in-a-build.)
I now have a /externals directory in the root of my project tree. Inside this I have a reference to another project. I'm able to script the build of all my extern... | [
0.2607266902923584,
0.38075894117355347,
0.26013514399528503,
-0.10637471079826355,
-0.09055561572313309,
0.13875247538089752,
0.21290428936481476,
-0.0757589265704155,
-0.20957604050636292,
-0.4583032429218292,
0.049903180450201035,
0.6302248239517212,
0.1989685595035553,
0.28893661499023... | |
in the build artifacts directory or should I implement another NAnt task that copies these to a /thirdparty/libs/ folder?
This means that my build is now dependent on the ability to build this external project (which could either be internal, or thirdparty). Is it a good idea to check in the latest set of build artifa... | [
0.37447068095207214,
0.3213476538658142,
0.3131285607814789,
0.24392661452293396,
-0.027639951556921005,
-0.25018730759620667,
0.38161346316337585,
-0.005158863961696625,
-0.19229218363761902,
-0.8434135913848877,
0.16649051010608673,
0.757485568523407,
0.20563682913780212,
0.0387090370059... | |
so quick I'm not going to check in any build artifiacts. Also going to have to figure out how to deal with the dependencies of the external project (eg: prototype, swfobject, etc).
I'd recommend taking a look at the UK Government Data Standard for postcodes [link now dead; [archive of XML](http://webarchive.nationalarc... | [
0.5200210809707642,
-0.24415235221385956,
0.7282376885414124,
0.026747049763798714,
0.035302724689245224,
0.30247417092323303,
-0.07007484138011932,
-0.18164661526679993,
-0.24318228662014008,
-0.5472750067710876,
-0.31643566489219666,
0.14391185343265533,
-0.10626807808876038,
0.199188172... | |
in format A9A 9AA is allowed by the definition given.
The RegEx supplied by the UK Government was:
```
([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9][A-Za-z]?))))\s?[0-9][A-Za-z]{2})
```
As pointed out on the Wikipedia discuss... | [
-0.031412478536367416,
0.14134661853313446,
0.5058501958847046,
-0.2894054651260376,
-0.019513200968503952,
0.09517174959182739,
0.39057356119155884,
-0.09997623413801193,
-0.03142575919628143,
-0.1686447560787201,
-0.639769434928894,
0.3126503527164459,
-0.26964271068573,
-0.0877234041690... | |
When working on developing new software i normally get stuck with the redundancy vs dependencies problem. That is, to either accept a 3rd party library that i have a huge dependencies to or code it myself duplicate all the effect but reduce the dependencies.
Though I've recently been trying to come up with a metric wa... | [
0.2510286271572113,
0.24365195631980896,
0.24837630987167358,
0.11440956592559814,
0.08568497002124786,
-0.2720547318458557,
0.3761134147644043,
-0.19405122101306915,
-0.24937501549720764,
-0.6887606978416443,
-0.03718465939164162,
0.8065404891967773,
-0.3196488916873932,
0.160468131303787... | |
question is:
Whats a good metric you've used in the past and do use to weigh up dependencies or redundancy in your code?
One thing I think is soo important is if you choose the dependencies route is you need the tool sets in place so you can quickly examine all the routines and functions that use a specified function.... | [
0.2679101228713989,
0.03228525072336197,
0.17212650179862976,
0.2823144793510437,
0.00836512167006731,
-0.08238162100315094,
0.21939852833747864,
-0.10818535834550858,
-0.23388829827308655,
-0.5293065309524536,
0.1478201150894165,
0.625351071357727,
-0.13208776712417603,
0.2575807273387909... | |
grind to a halt if this disappeared". For example if the STL of C++ magically went away, tons of programs would stop working. If .Net or Java disappeared, our economy would probably take a beating due to the number of products that stopped working...
I would think in those terms. Of course many things are a shade of ... | [
0.4204966425895691,
0.23337537050247192,
0.1985960155725479,
0.30405670404434204,
-0.02692677639424801,
-0.14383220672607422,
0.2605217695236206,
0.3799397051334381,
-0.4200393259525299,
-0.45490455627441406,
0.005368734244257212,
0.8016660809516907,
0.03901107981801033,
0.4840626716613769... | |
more users the better.
Its analogous to being a small consumer of some hardware component. Sometimes hardware goes obsolete. Why? Because no one uses it. If you're a small company and need to get a component for your product, you will pick what is commonly available--what the "big players" order in large quantities, ... | [
0.6488465070724487,
-0.06044216826558113,
0.4433274567127228,
0.5132683515548706,
0.09179969131946564,
-0.15683294832706451,
-0.05292205512523651,
0.2206677496433258,
-0.35152408480644226,
-0.6807084083557129,
-0.0257775466889143,
0.7067806124687195,
-0.12791183590888977,
0.390253365039825... | |
the risk that the company selling it to you might not care to keep producing flux-capacitors if you are only ordering 20 a year, and no one seems to care :). In this case, it *might* be worth developing your own flux capacitor instead of relying on that unreliable Doc Brown Inc. Just don't buy Plutonium from the Libyan... | [
0.8480944633483887,
0.03901224955916405,
-0.1718766689300537,
0.3983430564403534,
0.22315393388271332,
0.03116486966609955,
-0.25650617480278015,
0.13561171293258667,
-0.34064754843711853,
-0.5517362952232361,
0.34189552068710327,
0.6474266052246094,
-0.22295492887496948,
0.175989493727684... | |
a real metric? Roughly count how many people depend on something. If its high, the risk of the dependency hurting you is much lower, and you can decide at what point the risk is too much. | [
0.6182785630226135,
-0.3498148024082184,
-0.01292343344539404,
0.5336418151855469,
0.1288755089044571,
0.15439625084400177,
-0.029316427186131477,
-0.2574208080768585,
0.1276494264602661,
-0.5668064951896667,
0.4772813618183136,
0.8840775489807129,
0.004813386593014002,
-0.1390310972929000... | |
I'd like to map a reference to an object instead of the object value with an HashTable
```
configMapping.Add("HEADERS_PATH", Me.headers_path)
```
that way when I'm going to retrieve the value of "HEADERS\_PATH" I'll be able to assign a value to Me.headers\_path
something like the " & " operator in C
I am assuming t... | [
0.10687066614627838,
0.2875092625617981,
0.05406508222222328,
0.12307650595903397,
0.13645820319652557,
-0.17712430655956268,
0.21371285617351532,
-0.0931730568408966,
-0.22982530295848846,
-0.6582968831062317,
-0.046928610652685165,
0.3529863655567169,
-0.5606058239936829,
0.1393521726131... | |
edit to VB and remove this comment later):
```
public class Holder<T> {
public T Value { get; set; }
}
...
Holder<String> headerPath = new Holder<String>() { Value = "this is a test" };
configMapping.Add("HEADERS_PATH", headerPath);
...
((Holder<String>)configMapping["HEADERS_PATH"]).Value = "this is a new tes... | [
0.4990587830543518,
-0.30272176861763,
0.40556514263153076,
-0.09648174047470093,
-0.015071365982294083,
-0.27715685963630676,
0.2953996956348419,
-0.6165834069252014,
-0.11359383910894394,
-0.7042179703712463,
-0.19844584167003632,
0.5338959097862244,
-0.3583342432975769,
0.26619711518287... | |
I read in [this article](http://www.ddj.com/hpc-high-performance-computing/210605281) that a company has created a software capable of using multiple GPU-based video cards in parallel to process hundreds of billions fixed-point calculations per second.
The program seems to run in Windows. Is it possible from Windows ... | [
0.3424067497253418,
0.2848614454269409,
0.3973774313926697,
0.44023847579956055,
0.060747869312763214,
0.06663912534713745,
-0.36926403641700745,
0.19825640320777893,
-0.3999958336353302,
-0.36578476428985596,
0.16432875394821167,
0.4548518657684326,
0.009298350661993027,
0.417510390281677... | |
run on the host CPU, but data are shipped off the the GPUs for processing of advanced algorithms. CUDA is an extension to C syntax, so it makes it easier to programmer than having to learn the older shader languages like [Cg](http://en.wikipedia.org/wiki/Cg_(programming_language)) for programming general purpose calcul... | [
0.266523152589798,
0.027577457949519157,
0.22999349236488342,
-0.0338117815554142,
-0.0630967766046524,
-0.2114322930574417,
-0.20585361123085022,
0.377841591835022,
-0.02815105766057968,
-0.5297160744667053,
-0.3378041088581085,
0.4101437032222748,
-0.38917142152786255,
0.2579075694084167... | |
Does SubSonic.SqlQuery have a between/and for date ranges? If not, what would be the best way to get a range.
Try something like this:
```
SqlQuery query = new SqlQuery().From("Table")
.WhereExpression("Column")
.IsBetweenAnd("1/1/2008", "12/31/2008");
Data... | [
0.08293183147907257,
-0.23939165472984314,
0.613044798374176,
-0.13667114078998566,
-0.12725350260734558,
-0.3681962192058563,
0.25184834003448486,
-0.22247354686260223,
-0.25869178771972656,
-0.11201749742031097,
0.06684025377035141,
0.3164520263671875,
-0.1380271464586258,
0.321323126554... | |
In mysql, how do I get the primary key used for an insert operation, when it is autoincrementing.
Basically, i want the new autoincremented value to be returned when the statement completes.
Thanks!
Your clarification comment says that you're interested in making sure that LAST\_INSERT\_ID() doesn't give the wrong re... | [
0.057075385004282,
-0.11294928938150406,
0.27766507863998413,
-0.12931737303733826,
0.051964353770017624,
-0.23245646059513092,
0.0742114782333374,
-0.0017663589678704739,
-0.1835673749446869,
-0.6748479604721069,
-0.11994251608848572,
0.8638922572135925,
-0.26915422081947327,
-0.099470451... | |
an
AUTO\_INCREMENT key.
3. Shell 1: SELECT LAST\_INSERT\_ID(),
see result.
4. Shell 2: INSERT into the same table.
5. Shell 2: SELECT LAST\_INSERT\_ID(),
see result different from shell 1.
6. Shell 1: SELECT LAST\_INSERT\_ID()
again, see a repeat of earlier
result.
If you think about it, this is the only way that make... | [
0.10818643122911453,
-0.38541507720947266,
0.35420534014701843,
-0.19116520881652832,
0.07225625216960907,
-0.11381452530622482,
0.0895417109131813,
-0.3520776629447937,
-0.3400925397872925,
-0.3346637487411499,
-0.1911911517381668,
1.083982229232788,
-0.542140543460846,
-0.042312942445278... | |
I want to display dates in the format: short day of week, short month, day of month without leading zero but including "th", "st", "nd", or "rd" suffix.
For example, the day this question was asked would display "Thu Oct 2nd".
I'm using Ruby 1.8.7, and [Time.strftime](http://ruby-doc.org/core/Time.html#method-i-strft... | [
0.15536512434482574,
0.04447972774505615,
0.5999521613121033,
-0.19373591244220734,
-0.15949787199497223,
0.2098444253206253,
0.34494441747665405,
-0.2991938591003418,
-0.065974660217762,
-0.6016665101051331,
0.006120678503066301,
0.38284993171691895,
-0.19677963852882385,
0.12634874880313... | |
I'm failing to understand exactly what the IF statement is doing, from what I can see it is checking if the variable `x` is equal to the int `0`. If this is `true` the ABSOLUTE value of the variable `y` is returned... this is when I lose the plot, why would the return statement then go on to include `<= ESPILON`? Surel... | [
0.013964866288006306,
-0.15509763360023499,
0.15556834638118744,
-0.2412201464176178,
0.10209720581769943,
-0.1483750343322754,
0.3367747962474823,
-0.24104256927967072,
0.08671151846647263,
-0.4236260950565338,
-0.10020612180233002,
0.8015754222869873,
-0.17803993821144104,
-0.01145931892... | |
return Math.abs(y) <= EPSILON;
```
Floating-point math is by its nature inaccurate, so rather than testing for equivalence (which is always a bad idea), instead the developer has chosen a small number (1x10^-14 in this case) as the acceptable tolerance for proximity to zero. The return statement returns a comparison, ... | [
-0.2011364847421646,
0.198566734790802,
0.1025739386677742,
0.0011275444412603974,
0.03732360899448395,
0.16897188127040863,
0.335958331823349,
-0.3903692066669464,
0.2235068678855896,
-0.4011780619621277,
-0.18094491958618164,
0.7155070304870605,
-0.012918819673359394,
-0.0859963595867157... | |
I have some c(++) code that uses sprintf to convert a uint\_64 to a string. This needs to be portable to both linux and Solaris.
On linux we use %ju, but there does not appear to be any equivalent on Solaris. The closest I can find is %lu, but this produces incorrect output. Some sample code:
```
#include <stdio.h>
#... | [
0.21943460404872894,
0.16115006804466248,
0.4252818822860718,
-0.44561588764190674,
-0.07539740204811096,
0.1492944359779358,
0.18125537037849426,
0.04250935837626457,
-0.034073356539011,
-1.0737452507019043,
-0.08917564153671265,
0.5011114478111267,
-0.40219077467918396,
0.217756018042564... | |
have have inttypes.h available you can use the macros it provides:
```
printf( "%" PRIu64 "\n", val);
```
Not pretty (I seem to be saying that a lot recently), but it works. | [
0.49139171838760376,
0.016004089266061783,
0.1637880951166153,
-0.39994174242019653,
-0.10630789399147034,
-0.20909728109836578,
0.24029359221458435,
-0.0753251239657402,
0.02186662331223488,
-0.6925910711288452,
0.12955936789512634,
0.7044744491577148,
-0.288787841796875,
-0.0373282358050... | |
I've always assumed that before I can use the Dvorak layout I need to purchase a Dvorak keyboard. But I can't find one on Amazon. Is it simply a matter of popping the keys off a Qwerty keyboard and moving them around?
To help you learn your way around the keyboard layout, you can physically rearrange the keys on your Q... | [
0.46400877833366394,
0.2921561896800995,
0.2229692041873932,
-0.09365285187959671,
0.3758588135242462,
0.42509347200393677,
0.041248854249715805,
0.08125150948762894,
-0.26282718777656555,
-0.6016137003898621,
0.025481298565864563,
0.40600675344467163,
-0.2964111268520355,
0.10716397315263... | |
the Dvorak layout.
* Windows XP/Vista: you can set
your mappings through Control
Panel->Regional and Language
Options->Languages->Details....
* Mac OSX: System Preferences -> International -> Input Menu (thanks jmah)
* Ubuntu: System -> Preferences -> Keyboard, Layouts Tab, Add..., Select the Devorak layout of your c... | [
-0.12339705973863602,
0.07561929523944855,
0.9212127327919006,
0.11619523912668228,
-0.1556672900915146,
0.274380624294281,
-0.05819959193468094,
-0.11096978187561035,
-0.15843862295150757,
-0.8896530270576477,
-0.4613572955131531,
0.6433811783790588,
-0.09808631241321564,
0.01791588589549... | |
We have an SQL 2005 database backend for our website, currently about 10GB in size. There are a lot more reads than writes, though I don't have the exact statistics.
We're upgrading our database server and I was thinking of getting 4 disks and setting them up in two RAID 1 arrays - one for the data files and the other... | [
0.030766135081648827,
0.2942817509174347,
0.4361756145954132,
0.20703446865081787,
-0.07939336448907852,
-0.2570383548736572,
0.12676391005516052,
-0.20233696699142456,
-0.4334580600261688,
-0.581017792224884,
0.32333365082740784,
0.5982807278633118,
-0.027994660660624504,
0.09959517419338... | |
much of the database in RAM (8GB), but it will grow, so I don't want to entirely rely on that.
Edit: we definitely want redundancy on a production server, so RAID 0 by itself is out. RAID 10 is nice, but might be a bit expensive for us.
Your concept of using independent RAID 1 mirrors is the correct strategy.
We have... | [
0.30655160546302795,
0.05091576650738716,
0.22765278816223145,
0.25330018997192383,
-0.3288295567035675,
-0.20773541927337646,
0.26875951886177063,
-0.4170655310153961,
-0.48468291759490967,
-0.5876189470291138,
-0.061207160353660583,
0.7741290330886841,
-0.2614066004753113,
-0.19443808495... | |
to both disks, so you do not gain any performance increase, however this is where you get your data security.
When reading from a RAID 1 array the controller will read from both disks as they have the same data on them.
**RAID 5**
This is useful for protecting larger amounts of data. The cost of RAID 5 increases a l... | [
0.30309242010116577,
-0.23142510652542114,
0.2944278419017792,
0.28311529755592346,
-0.2024695724248886,
-0.20551486313343048,
0.18730171024799347,
-0.3255622088909149,
-0.46932175755500793,
-0.8068856596946716,
0.08198723942041397,
0.7557631134986877,
0.1344965696334839,
0.057198502123355... | |
3x300gb drives, requiring 800-900gb of total purchased drive space. RAID 1 would be 2x600gb drives requiring 1,200gb of purchased space (with 600gb drives being quite more expensive) or RAID 0+1 allowing you to use less expensive capacity drives (ie: 4x300gb or 6x200gb) but still requires a total of 1,200gb of purchase... | [
0.08730345964431763,
-0.4006437659263611,
0.29717785120010376,
0.2203100174665451,
-0.21073514223098755,
-0.07669078558683395,
-0.026031754910945892,
-0.28035011887550354,
-0.19054529070854187,
-0.7632697224617004,
-0.2720664143562317,
0.7443974018096924,
-0.2768549621105194,
-0.0943931937... | |
to help as much. You would see a better advantage on a RAID 0+1 for single applications using large data files, such as video editing.
When I was researching this same issue a while ago for a customer I found this article to be very interesting [http://blogs.zdnet.com/Ou/?p=484](http://www.zdnet.com/blog/ou/comprehens... | [
0.24518488347530365,
-0.01084143202751875,
0.04212959110736847,
0.04131064563989639,
-0.5384804606437683,
-0.17016509175300598,
-0.03901836276054382,
-0.4213455021381378,
-0.26336151361465454,
-0.4289228320121765,
-0.14084486663341522,
0.5827232003211975,
-0.3381608724594116,
0.12818388640... | |
of using just basic uninformed striping of RAID 0+1 is a great concept. | [
0.43844127655029297,
-0.2516686022281647,
-0.1108889952301979,
0.1482143998146057,
-0.04841053485870361,
-0.49366846680641174,
0.11448328197002411,
-0.20455719530582428,
0.06240709498524666,
-0.36942875385284424,
-0.07342731207609177,
0.6029658317565918,
-0.1360975205898285,
-0.25288969278... | |
I'm looking for a way to validate the SQL schema on a production DB after updating an application version. If the application does not match the DB schema version, there should be a way to warn the user and list the changes needed.
Is there a tool or a framework (to use programatically) with built-in features to do th... | [
0.597477376461029,
0.1992184817790985,
0.2256704717874527,
0.23990119993686676,
-0.08505436778068542,
-0.14416846632957458,
0.23551565408706665,
-0.138623908162117,
-0.030077705159783363,
-0.6293114423751831,
0.14155445992946625,
0.6362596750259399,
-0.282918244600296,
0.06437700241804123,... | |
files.
- Diff the text files.
```
/* get list of objects in the database */
SELECT name,
type
FROM sysobjects
ORDER BY type, name
/* get list of columns in each table / parameters for each stored procedure */
SELECT so.name,
so.type,
sc.name,
sc.number,
sc.colid,
... | [
-0.20467108488082886,
-0.014407780952751637,
0.345571368932724,
0.1324993073940277,
0.23494698107242584,
0.3387983739376068,
0.023954764008522034,
-0.015347243286669254,
-0.33065536618232727,
-0.5185550451278687,
-0.1440414935350418,
0.25060033798217773,
-0.5620001554489136,
-0.01287343446... | |
sc.length,
sc.usertype ,
sc.scale
FROM sysobjects so ,
syscolumns sc
WHERE so.id = sc.id
ORDER BY so.type, so.name, sc.name
/* get definition of each stored procedure */
SELECT so.name,
so.type,
sc.number,
sc.text
FROM sysobjects so ,
syscomments sc
... | [
-0.3130647540092468,
-0.28035828471183777,
0.25968748331069946,
0.08529361337423325,
-0.009144483134150505,
0.34615349769592285,
0.05235888436436653,
-0.32988330721855164,
-0.3756854832172394,
-0.5427652597427368,
-0.4311990439891815,
0.07668309658765793,
-0.23853498697280884,
0.0582661963... | |
BY so.type, so.name, sc.number
``` | [
0.2017892748117447,
0.5334208011627197,
0.28595033288002014,
0.05193879082798958,
-0.043788935989141464,
0.007796245161443949,
-0.10081720352172852,
-0.13594003021717072,
-0.2624783217906952,
-0.2864825129508972,
-0.3849567174911499,
-0.08407443761825562,
-0.3050549328327179,
0.41460484266... | |
I need help on this following aspx code
aspx Code:
```
<asp:Label ID ="lblName" runat ="server" Text ="Name"></asp:Label>
<asp:TextBox ID ="txtName" runat ="server"></asp:TextBox>
```
Consider this is my aspx page content. I am going to populate the values for the TextBox only after the postback from server. But th... | [
-0.11733616143465042,
0.1624288558959961,
0.4955509603023529,
-0.019835300743579865,
-0.16856040060520172,
0.08748412877321243,
0.3724849224090576,
-0.21041283011436462,
-0.18485873937606812,
-0.7395291924476624,
-0.0590059868991375,
0.4020525813102722,
-0.3163197338581085,
-0.141698732972... | |
this is the correct way of coding.
If you take the **`runat='server'`** out of the `<label>` element then it won't be parsed as a server control. If you're not going to do anything with *`lblNames`* from the server then it is perfectly okay to leave it out. | [
0.6079088449478149,
0.13901598751544952,
-0.1283767819404602,
0.03902243450284004,
0.23917734622955322,
-0.42623499035835266,
0.15443778038024902,
-0.01314518228173256,
-0.008298895321786404,
-0.3157673478126526,
-0.13201236724853516,
0.26121219992637634,
-0.6560779213905334,
0.17193377017... | |
I'm looking for some good references for learning how to model 2d physics in games. I am **not** looking for a library to do it for me - I want to think and learn, not blindly use someone else's work.
I've done a good bit of Googling, and while I've found a few tutorials on GameDev, etc., I find their tutorials hard t... | [
0.1940402239561081,
0.2307758778333664,
-0.001470137620344758,
0.3910937011241913,
-0.08352497220039368,
-0.1289098560810089,
-0.06935955584049225,
0.28293657302856445,
-0.1654684990644455,
-0.6630911827087402,
0.015423950739204884,
0.40277573466300964,
0.19097289443016052,
-0.017794230952... | |
- and I want to accurately model (among other things) acceleration and speed, heat buildup of 'components,' collisions between models and level boundaries, and missile-type weapons.
Websites, recommended books, blogs, code examples - all are welcome if they will aid understanding. I'm considering using C# and F# to bu... | [
0.4410322904586792,
0.4808956980705261,
0.19494396448135376,
0.6011855006217957,
-0.10362887382507324,
-0.052273403853178024,
0.21861080825328827,
0.12820672988891602,
-0.060594942420721054,
-0.434118390083313,
-0.05285726487636566,
0.4654693603515625,
0.1903952658176422,
-0.09615392982959... | |
the systems involved, and don't really know how to find the resources that will teach me in an understandable way.
Here are some resources I assembled a few years ago. Of note is the Verlet Integration.
I am also including links to some open source and commercial physics engines I found at that time. There is a stackov... | [
0.0093040456995368,
0.34411096572875977,
-0.08868475258350372,
-0.018354525789618492,
0.15049222111701965,
0.05443114414811134,
-0.12815220654010773,
-0.33917003870010376,
-0.19168810546398163,
-0.593403697013855,
-0.17118771374225616,
0.5069227814674377,
-0.07601778954267502,
-0.157120093... | |
physics engine in C++ from scratch. The Author starts with basic particle physics and then adds "laws of motion", constraints, rigid-body physics and on and on. He includes well documented source code all the way through.
**Physics Engines**
* [Tokamak](http://www.tokamakphysics.com) (Open source physics API)
* [APE]... | [
0.1023259162902832,
0.12531645596027374,
0.45627185702323914,
0.19706924259662628,
-0.1386537402868271,
0.13300250470638275,
-0.06733666360378265,
-0.44282007217407227,
-0.11592666804790497,
-0.5026648044586182,
-0.23431044816970825,
0.6157145500183105,
-0.36997878551483154,
-0.42090761661... | |
So i have a piece of assembly that needs to call a function with the fastcall calling convention on windows, but gcc doesn't (afaict) support it. GCC does provide the regparm attribute but that expects the first 3 parameters to be passed in eax, edx and ecx, whereas fastcall expects the first two parameters to be passe... | [
-0.03345221281051636,
-0.10759230703115463,
0.482131689786911,
-0.12750251591205597,
-0.19585789740085602,
-0.16657517850399017,
-0.05465162545442581,
-0.06042971834540367,
-0.11679867655038834,
-0.2710122764110565,
-0.0358152836561203,
0.8219200372695923,
-0.675184428691864,
-0.0487248823... | |
Can the iPhone SDK take advantage of the iPhone's proximity sensors? If so, why hasn't anyone taken advantage of them? I could picture a few decent uses.
For example, in a racing game, you could put your finger on the proximity sensor to go instead of taking up screen real-estate with your thumb. Of course though, if ... | [
0.06588433682918549,
-0.04799419641494751,
0.35699403285980225,
0.27259260416030884,
0.319743275642395,
-0.10346385091543198,
0.014981796033680439,
0.08899816125631332,
-0.22554641962051392,
-0.29565173387527466,
0.5620771050453186,
0.6665758490562439,
-0.1167452335357666,
-0.6074345111846... | |
hold it to your ear, I'm pretty sure that is just an infrared sensor inside the ear speaker. If you start the phone app (you don't have to be making a call) and hold something to cast a shadow over the ear speaker, you can make the display shut off.
When you asked this question it was not accessible via the public API... | [
0.44235101342201233,
-0.32552793622016907,
0.8555002808570862,
0.13914711773395538,
0.34799355268478394,
-0.22458429634571075,
0.2080366015434265,
-0.05179748311638832,
0.060643408447504044,
-0.4706381559371948,
0.2431783527135849,
0.6933014392852783,
-0.133925661444664,
-0.054905399680137... | |
not the iPod touch. | [
-0.0034760371781885624,
-0.17596949636936188,
-0.044053155928850174,
0.25948765873908997,
-0.11218234151601791,
-0.029314473271369934,
-0.15447121858596802,
0.4608026444911957,
-0.10167121142148972,
-0.14614081382751465,
0.2784880995750427,
0.7063351273536682,
-0.3080524206161499,
0.124578... | |
I have the simple class using auto-implemented properies:
```
Public Class foo
{
public foo() { }
public string BarName {get; set;}
}
```
I obviously use the variable BarName throughout my class and now need to add logic when the property value is set (it must be all upper case, go figure). Does this mea... | [
0.2177741676568985,
0.5232445001602173,
-0.0008919460815377533,
-0.34841346740722656,
0.10913652926683426,
0.03777826204895973,
0.35804688930511475,
-0.35855981707572937,
0.024848435074090958,
-0.5189587473869324,
0.019971707835793495,
0.8424088954925537,
-0.3276771903038025,
0.32621532678... | |
string _BarName = "";
public string BarName
{
get {return _BarName;}
set {_BarName = Value.ToString().ToUpper();}
}
}
```
I am trying to make sure I understand the implications of using auto-implemented properties, and what it will entail down the road when/if I need to change something.... | [
0.41164764761924744,
0.3976087272167206,
0.16575026512145996,
-0.45550447702407837,
0.2404111623764038,
-0.004405315034091473,
0.6059479713439941,
-0.3094905614852905,
-0.19233287870883942,
-0.5386735200881958,
-0.13463398814201355,
0.7457340359687805,
-0.2509380578994751,
0.30566421151161... | |
keep it that way and add the needed logic.
Another example, which may be more meaningful is that I need to call some method when a setter or getter is used; more then changing the value.
This seems a fair trade off the the lines and lines of code to setup properties.
> Does this mean that I need to now
> create a ... | [
0.5321410298347473,
-0.017061417922377586,
-0.004660941660404205,
0.06821420788764954,
0.07465161383152008,
-0.08020326495170593,
0.3831460177898407,
-0.2649575471878052,
-0.09670212119817734,
-0.682015597820282,
0.1607399880886078,
0.5933784246444702,
-0.022486358880996704,
0.180984407663... | |
is intended to hide the private variable (among other things), for the purpose of avoiding the sweeping changes you contemplate to the rest of your code.
> I am assuming that the refactoring, as
> shown above, is not a breaking change
> because the property is basically
> staying the same; it just took a
> little ... | [
0.3719777762889862,
0.022041279822587967,
0.03549370914697647,
-0.04148365184664726,
0.16307072341442108,
-0.25112682580947876,
0.4832525849342346,
-0.11838425695896149,
-0.009483110159635544,
-0.27664104104042053,
-0.03187617287039757,
0.6044278740882874,
-0.31886985898017883,
0.102798253... | |
I have a Flex app that does a a fair amount of network traffic, it uses ExternalInterface to make some javascript calls (for SCORM), it loads XML files, images, video, audio and it has a series of modules that it could be loading at some point...
So the problem is - we now have a requirement where the user needs to ru... | [
0.509885311126709,
0.04999825730919838,
0.3450358808040619,
0.05879685655236244,
-0.152398020029068,
-0.18663693964481354,
-0.1380486637353897,
-0.21019451320171356,
-0.5448236465454102,
-0.5887172818183899,
0.048548948019742966,
0.6492117047309875,
-0.21600466966629028,
-0.207384720444679... | |
to launch this thing, they are greeted with a security warning that the swf is trying to communicate with another domain other than the one it's in. We can't wrap it in an exe or an AIR app so I unless there is some way to tweak some obscure security settings we may be hosed. Any idea's?
What you are trying to do is ex... | [
0.6294353604316711,
0.030189242213964462,
0.6316184997558594,
0.48601093888282776,
0.2028941959142685,
-0.5285192131996155,
0.09850259870290756,
0.0931112989783287,
-0.24388259649276733,
-0.2523226737976074,
-0.2802927792072296,
0.20581385493278503,
-0.42444297671318054,
-0.024369304999709... | |
you don't want to have to learn a new system), then modifying the security config file will solve the problem.
Basically what you need to do is create a 'trust' file in the "Global FlashPlayerTrust" directory. This can be done by your installer (which installs all the javascript, SWF, html, etc files onto the local ma... | [
0.28073811531066895,
0.1308286488056183,
0.496608704328537,
0.1533486694097519,
0.11509805172681808,
-0.3302401602268219,
0.3133603036403656,
-0.17700478434562683,
0.45751193165779114,
-0.7450608015060425,
-0.016272366046905518,
0.8234358429908752,
-0.31491270661354065,
-0.2751714885234833... | |
be unlikely to conflict with others. Something like CompanyName.cfg. It's a text file, with one path per line. You can trust either one SWF at a time, or an entire directory. Example:
```
C:\Program Files\MyCompany\CoolApp
C:\Program Files\MyCompany\OtherApp\Main.swf
```
To test that it's working, inside your flash ... | [
0.21925252676010132,
-0.18887880444526672,
0.4176601767539978,
0.21442191302776337,
0.1756604015827179,
-0.405225932598114,
0.3609102964401245,
0.22857236862182617,
0.034425750374794006,
-0.777023196220398,
-0.11022598296403885,
0.553682804107666,
-0.32166343927383423,
-0.34354308247566223... | |
How can I display a calendar control (date picker) in Oracle forms 9/10?
Unfortunately this is not possible in Qt4.
In Qt3 you could create custom slots which where then implemented in the ui.h file. However, Qt4 does not use this file so custom slots are not supported.
There is some discussion of this issue over on... | [
0.3310955762863159,
-0.09500385075807571,
0.37724632024765015,
0.23701712489128113,
-0.045571956783533096,
-0.11845652014017105,
-0.024084148928523064,
-0.1949884593486786,
-0.19076582789421082,
-0.6054664254188538,
0.14544738829135895,
0.46487313508987427,
-0.33533555269241333,
0.22402569... | |
I've seen a couple questions around here like [How to debug RESTful services](https://stackoverflow.com/questions/165720/how-to-debug-restful-services), which mentions:
> Unfortunately that same browser won't allow me to test HTTP PUT, DELETE, and to a certain degree even HTTP POST.
I've also heard that browsers supp... | [
0.23933710157871246,
-0.16336216032505035,
0.22909322381019592,
0.020430341362953186,
-0.17063003778457642,
-0.3300628364086151,
0.4677722156047821,
-0.25259408354759216,
-0.13859590888023376,
-0.6685943007469177,
-0.34544119238853455,
0.48640239238739014,
-0.2181544452905655,
-0.076139070... | |
limitations?
No. The [HTML 5 spec](http://w3c.github.io/html/sec-forms.html#form-control-infrastructure-form-submission) mentions:
> The method and formmethod content attributes are enumerated attributes
> with the following keywords and states:
>
>
> The keyword **get**, mapping to the state GET, indicating the HT... | [
0.19546306133270264,
-0.06106763705611229,
0.5666303634643555,
0.16353082656860352,
-0.0012657956685870886,
-0.1284763664007187,
0.014315277338027954,
-0.5734556913375854,
0.00960741750895977,
-0.6634743809700012,
-0.306260883808136,
0.5630123019218445,
-0.06564440578222275,
0.050644937902... | |
creation of a new web
> page resource, the updating of the existing page, or all of the
> mentioned outcomes.
>
>
> The keyword **dialog**, mapping to the state dialog, indicating that
> submitting the form is intended to close the dialog box in which the
> form finds itself, if any, and otherwise not submit.
> ... | [
0.0916915312409401,
0.022671880200505257,
0.5135493874549866,
0.1769326627254486,
-0.38446319103240967,
-0.16464903950691223,
0.5258736610412598,
-0.17557436227798462,
-0.01372466515749693,
-0.904623806476593,
-0.5969719886779785,
0.20057563483715057,
-0.1999150663614273,
0.166085243225097... | |
is read by the server and the request dispatched accordingly.
However, **GET**, **POST**, **PUT** and **DELETE** *are* supported by the implementations of XMLHttpRequest (i.e. AJAX calls) in all the major web browsers (IE, Firefox, Safari, Chrome, Opera). | [
0.020103391259908676,
-0.19270659983158112,
0.39192995429039,
0.08483579009771347,
-0.35164493322372437,
-0.11899212002754211,
0.29472094774246216,
0.08282984048128128,
0.03328630328178406,
-0.8510416150093079,
-0.670229434967041,
0.36198359727859497,
-0.1861078441143036,
0.040403250604867... | |
It seems pretty common to want to let your javascript know a particular dom node corresponds to a record in the database. So, how do you do it?
One way I've seen that's pretty common is to use a class for the type and an id for the id:
```
<div class="thing" id="5">
<script> myThing = select(".thing#5") </script>
``... | [
0.42059871554374695,
-0.04400554671883583,
-0.07234539836645126,
0.30138447880744934,
-0.16106785833835602,
-0.3746582567691803,
0.045728784054517746,
-0.10056303441524506,
-0.5594395399093628,
-0.5911428928375244,
0.012647958472371101,
0.4633781611919403,
0.0691269040107727,
-0.0587493181... | |
gets around the duplicate IDs problem, but it does mean you have to deal with attributes instead of IDs, which is sometimes more difficult. What do you guys think?
Note that an ID cannot start with a digit, so:
```
<div class="thing" id="5">
```
is invalid HTML. See [What are valid values for the id attribute in HTM... | [
0.3767814040184021,
0.11458458751440048,
0.16387097537517548,
0.24243076145648956,
0.09008900076150894,
-0.2906844913959503,
0.2101021409034729,
-0.012744131498038769,
-0.5508334636688232,
-0.29735997319221497,
0.08514722436666489,
0.47183936834335327,
0.11623840779066086,
0.01624929346144... | |
I'm used to coding Java Swing UIs, and in those if you have some properties that change, and you want your UI to update, you would implement the observer/observable pattern. In Java you do this normally by having your class maintain a list of listeners that it notifies of different events.
I've played with Objective-C... | [
0.44935235381126404,
0.248631089925766,
0.04563692584633827,
-0.14353162050247192,
-0.3816524147987366,
-0.15301185846328735,
0.24083782732486725,
-0.2242094725370407,
-0.053148847073316574,
-0.47823992371559143,
0.3340723514556885,
0.886518657207489,
-0.31680840253829956,
-0.3130489289760... | |
for me to register a UI component with that class so that it can be notified of changes in the data that it needs to display?
There are two built-in ways of doing observation in Cocoa: Key-Value Observing and notifications. In neither system do you need to maintain or notify a collection of observers yourself; the fram... | [
0.23776549100875854,
0.044085126370191574,
0.2758316695690155,
0.1275569051504135,
-0.10347721725702286,
-0.024479029700160027,
0.17099887132644653,
-0.11711780726909637,
-0.46821409463882446,
-0.3648764491081238,
-0.010946427471935749,
0.4760037064552307,
-0.23866403102874756,
-0.30603638... | |
you want to receive updates, the key path of the property (relative to the receiver) for which you want to receive updates, and the types of updates you want to receive. (There are similar methods you can use if you want to observe a property representing a collection.)
Notifications are older and heavier-weight. You ... | [
0.43253031373023987,
-0.24837908148765564,
0.43245649337768555,
0.2011217623949051,
-0.04777750372886658,
-0.22377891838550568,
0.17990317940711975,
-0.022668734192848206,
-0.4753396213054657,
-0.6929471492767334,
-0.19335275888442993,
0.42529523372650146,
-0.1683616042137146,
0.0606898106... | |
name rather than those that apply to a particular object.
Which should you use in any particular case? In general, if you care about changes to a specific property of a specific object, use Key-Value Observing. That's what it's designed for and it's intentionally lightweight. (Among other uses, it is the foundation on... | [
0.24938784539699554,
-0.10426956415176392,
0.1686534583568573,
0.09612192958593369,
-0.10027658939361572,
-0.29127269983291626,
0.19121144711971283,
-0.1455024927854538,
-0.5877553820610046,
-0.5614793300628662,
-0.2366914004087448,
0.42372840642929077,
-0.16235291957855225,
0.196858927607... | |
graph was saved, I'd use notifications. | [
0.2104782611131668,
-0.1936216801404953,
0.204585999250412,
0.2156955897808075,
-0.4899316430091858,
-0.07832519710063934,
0.41268783807754517,
0.3347935676574707,
-0.4293816387653351,
-0.6769955158233643,
0.3282073736190796,
0.24495838582515717,
-0.005028982646763325,
-0.11709272116422653... | |
I'm looking for very simple obfuscation (like encrypt and decrypt but not necessarily secure) functionality for some data. It's not mission critical. I need something to keep honest people honest, but something a little stronger than [ROT13](http://en.wikipedia.org/wiki/ROT13) or [Base64](http://en.wikipedia.org/wiki/B... | [
0.23425060510635376,
0.4378390908241272,
0.03252667561173439,
0.04699976369738579,
-0.16254442930221558,
-0.34816840291023254,
0.6252305507659912,
-0.13861320912837982,
-0.06998001039028168,
-0.4545031189918518,
-0.04197434335947037,
0.5461649298667908,
-0.23355576395988464,
-0.11806624382... | |
the math and make it trivial to crack.
Other answers here work fine, but AES is a more secure and up-to-date encryption algorithm. This is a class that I obtained a few years ago to perform AES encryption that I have modified over time to be more friendly for web applications (e,g. I've built Encrypt/Decrypt methods th... | [
-0.0036087899934500456,
0.24892130494117737,
0.07160242646932602,
0.15216761827468872,
-0.1134306788444519,
-0.06108707934617996,
0.2768339514732361,
-0.22002682089805603,
-0.14818011224269867,
-0.40330538153648376,
0.17353251576423645,
0.5560458302497864,
-0.17573323845863342,
-0.05772256... | |
used this code as-is! All you have to do is change some of the numbers (must be <= 255) in the Key and Vector arrays (I left one invalid value in the Vector array to make sure you do this...). You can use <https://www.random.org/bytes/> to generate a new set easily:
* [generate `Key`](https://www.random.org/cgi-bin/ra... | [
0.20306162536144257,
-0.27966752648353577,
0.23978544771671295,
0.03849939629435539,
0.07033251971006393,
-0.11248382925987244,
0.11410931497812271,
-0.6190757155418396,
-0.5596739649772644,
-0.4425998032093048,
-0.2373550981283188,
0.46020716428756714,
-0.5782379508018494,
0.1610940396785... | |
private byte[] Key = __Replace_Me__({ 123, 217, 19, 11, 24, 26, 85, 45, 114, 184, 27, 162, 37, 112, 222, 209, 241, 24, 175, 144, 173, 53, 196, 29, 24, 26, 17, 218, 131, 236, 53, 209 });
// a hardcoded IV should not be used for production AES-CBC code
// IVs should be unpredictable per ciphertext
private by... | [
-0.04586557671427727,
0.13019482791423798,
0.5276446342468262,
0.07784423977136612,
0.15553933382034302,
0.5943983793258667,
0.19839486479759216,
-0.4512592852115631,
-0.26094698905944824,
-0.13766145706176758,
-0.1864519566297531,
0.5624315738677979,
-0.5036348700523376,
0.194828003644943... | |
private System.Text.UTF8Encoding UTFEncoder;
public SimpleAES()
{
//This is our encryption method
RijndaelManaged rm = new RijndaelManaged();
//Create an encryptor and a decryptor using our encryption method, key, and vector.
EncryptorTransform = rm.CreateEncryptor(this.Key, th... | [
-0.2505757808685303,
-0.0665474534034729,
0.3654232919216156,
0.05878465995192528,
0.0314994715154171,
0.284942090511322,
0.3835015892982483,
-0.37630507349967957,
-0.22700127959251404,
-0.48018255829811096,
-0.2353762835264206,
0.6806484460830688,
-0.30480751395225525,
0.05257412046194076... | |
UTFEncoder = new System.Text.UTF8Encoding();
}
/// -------------- Two Utility Methods (not used but may be useful) -----------
/// Generates an encryption key.
static public byte[] GenerateEncryptionKey()
{
//Generate a Key.
RijndaelManaged rm = new RijndaelManaged();
rm.Gen... | [
-0.3550783395767212,
-0.28863030672073364,
0.4949203133583069,
-0.20042966306209564,
0.024556363001465797,
0.3268747627735138,
0.2700989246368408,
-0.7325522899627686,
-0.29849973320961,
-0.2357673943042755,
-0.1338895559310913,
0.601309597492218,
-0.4212450385093689,
0.11966229975223541,
... | |
public byte[] GenerateEncryptionVector()
{
//Generate a Vector
RijndaelManaged rm = new RijndaelManaged();
rm.GenerateIV();
return rm.IV;
}
/// ----------- The commonly used methods ------------------------------
/// Encrypt some text and return a string suitable for... | [
-0.34349602460861206,
-0.2000858336687088,
0.4504258334636688,
-0.13258080184459686,
-0.19506755471229553,
0.26446306705474854,
0.1834714114665985,
-0.43649575114250183,
-0.27533361315727234,
-0.12813615798950195,
-0.21616344153881073,
0.7165212631225586,
-0.35388755798339844,
-0.112355500... | |
ByteArrToString(Encrypt(TextValue));
}
/// Encrypt some text and return an encrypted byte array.
public byte[] Encrypt(string TextValue)
{
//Translates our text value into a byte array.
Byte[] bytes = UTFEncoder.GetBytes(TextValue);
//Used to stream the data in and out of the C... | [
-0.021821988746523857,
-0.010441247373819351,
0.539414644241333,
-0.049529895186424255,
0.28909415006637573,
0.17253844439983368,
0.3203398883342743,
-0.2569335997104645,
0.09491428732872009,
-0.41566523909568787,
-0.31448957324028015,
0.7229399681091309,
-0.19778703153133392,
-0.107707597... | |
* We will have to write the unencrypted bytes to the stream,
* then read the encrypted result back from the stream.
*/
#region Write the decrypted value to the encryption stream
CryptoStream cs = new CryptoStream(memoryStream, EncryptorTransform, CryptoStreamMode.Write);
cs.Wri... | [
-0.03980078548192978,
-0.3546965420246124,
0.8560148477554321,
0.042327627539634705,
0.532836377620697,
-0.23861843347549438,
0.34706124663352966,
0.14133523404598236,
-0.05703343078494072,
-0.9769532084465027,
-0.5238727331161499,
0.23611924052238464,
0.09315130114555359,
0.32097241282463... | |
#region Read encrypted value back out of the stream
memoryStream.Position = 0;
byte[] encrypted = new byte[memoryStream.Length];
memoryStream.Read(encrypted, 0, encrypted.Length);
#endregion
//Clean up.
cs.Close();
memoryStream.Close();
return encrypted;... | [
-0.25830382108688354,
-0.3848462402820587,
0.5577448010444641,
0.0009690247243270278,
0.519181489944458,
-0.20684173703193665,
0.3370608389377594,
-0.14814896881580353,
-0.3023625314235687,
-0.7595599293708801,
-0.5867146849632263,
0.1779504120349884,
-0.1649237722158432,
0.575141787528991... | |
public string DecryptString(string EncryptedString)
{
return Decrypt(StrToByteArray(EncryptedString));
}
/// Decryption when working with byte arrays.
public string Decrypt(byte[] EncryptedValue)
{
#region Write the encrypted value to the decryption stream
MemoryStream e... | [
-0.21877700090408325,
-0.41183558106422424,
0.6583523750305176,
0.06000716611742973,
0.24952606856822968,
0.008719395846128464,
0.24269412457942963,
-0.13987721502780914,
-0.12249884009361267,
-0.5887815952301025,
-0.5382712483406067,
0.5607367753982544,
-0.048665061593055725,
0.4699859321... | |
decryptStream.FlushFinalBlock();
#endregion
#region Read the decrypted value from the stream.
encryptedStream.Position = 0;
Byte[] decryptedBytes = new Byte[encryptedStream.Length];
encryptedStream.Read(decryptedBytes, 0, decryptedBytes.Length);
encryptedStream.Close();
... | [
-0.11853804439306259,
-0.5833369493484497,
0.7112298607826233,
-0.07357468456029892,
0.3780340254306793,
-0.1173282116651535,
0.40294331312179565,
0.019134333357214928,
-0.047257646918296814,
-0.6646680235862732,
-0.3828362822532654,
0.43581774830818176,
-0.30001646280288696,
0.27093431353... | |
a byte array. NOTE: Normally we'd create a Byte Array from a string using an ASCII encoding (like so).
// System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
// return encoding.GetBytes(str);
// However, this results in character values that cannot be passed in a URL. So, inste... | [
0.03545164316892624,
-0.03692282736301422,
0.4165755808353424,
-0.060303620994091034,
-0.17514802515506744,
0.19644959270954132,
0.1402314454317093,
-0.46137121319770813,
-0.19987066090106964,
-0.5782966613769531,
-0.12988145649433136,
0.25104770064353943,
-0.33268237113952637,
0.017909433... | |
{
if (str.Length == 0)
throw new Exception("Invalid string value in StrToByteArray");
byte val;
byte[] byteArr = new byte[str.Length / 3];
int i = 0;
int j = 0;
do
{ | [
-0.0917460173368454,
-0.024937160313129425,
0.27951061725616455,
-0.2589070796966553,
0.12476108968257904,
0.05610913783311844,
0.5085755586624146,
-0.48210352659225464,
-0.1193159818649292,
-0.20727109909057617,
-0.3959096372127533,
0.5184759497642517,
-0.24507464468479156,
0.102837726473... | |
val = byte.Parse(str.Substring(i, 3));
byteArr[j++] = val;
i += 3;
}
while (i < str.Length);
return byteArr;
}
// Same comment as above. Normally the conversion would use an ASCII encoding in the other direction:
// System.Text.ASCIIEncoding | [
-0.16761073470115662,
-0.07576055824756622,
0.3372619152069092,
-0.37871915102005005,
-0.16527320444583893,
0.49511051177978516,
0.34341827034950256,
-0.4218696057796478,
-0.21197305619716644,
-0.48131006956100464,
-0.4711529314517975,
0.5909466743469238,
-0.28465625643730164,
0.1111620962... | |
enc = new System.Text.ASCIIEncoding();
// return enc.GetString(byteArr);
public string ByteArrToString(byte[] byteArr)
{
byte val;
string tempStr = "";
for (int i = 0; i <= byteArr.GetUpperBound(0); i++)
{
val = byteArr[i];
if | [
0.010505919344723225,
-0.18583860993385315,
0.838886022567749,
-0.15807193517684937,
0.22893774509429932,
0.035369064658880234,
0.31268471479415894,
-0.5347989797592163,
-0.30979543924331665,
-0.36413517594337463,
-0.7757371068000793,
0.6508081555366516,
-0.28176626563072205,
0.14749313890... | |
(val < (byte)10)
tempStr += "00" + val.ToString();
else if (val < (byte)100)
tempStr += "0" + val.ToString();
else
tempStr += val.ToString();
} | [
-0.004123944789171219,
-0.048375971615314484,
0.6328727006912231,
-0.1483672708272934,
0.28048813343048096,
0.22408625483512878,
0.1975255161523819,
-0.4511832296848297,
-0.22557327151298523,
-0.38019219040870667,
-0.5364910364151001,
0.6872642636299133,
-0.24310505390167236,
-0.2586114704... | |
return tempStr;
}
}
``` | [
0.007562140468508005,
0.11446419358253479,
0.5058362483978271,
-0.21350952982902527,
0.1731867492198944,
-0.293461412191391,
0.15948006510734558,
0.0544901005923748,
0.10625821352005005,
-0.4682541787624359,
-0.5159943699836731,
0.7394237518310547,
-0.4875359535217285,
0.10268327593803406,... | |
I need to queue events and tasks for external systems in a reliable/transactional way. Using things like MSMQ or ActiveMQ look very seductive, but the transactional part becomes complicated (MSDTC, etc).
We could use the database (SQL Server 2005+, Oracle 9+) and achieve easier transactional support, but the queuing p... | [
0.1979118287563324,
0.12522739171981812,
0.16487066447734833,
0.28715428709983826,
-0.1331542581319809,
-0.22286958992481232,
0.1403442621231079,
0.14407555758953094,
-0.45798948407173157,
-0.3540095388889313,
0.2465958297252655,
0.44945433735847473,
-0.5411700010299683,
-0.042298465967178... | |
next-run-date has passed, but expiration-date has not yet been reached).
our system has 60 computers, each running 12 tasks (threads) which need to "get next job". All in all, it comes to 50K "jobs" per day. do the math of how many transactions per minute and realize task time is variable, so it is possible to get mult... | [
-0.09625363349914551,
-0.4098309576511383,
0.7017585039138794,
0.2139756679534912,
0.36750727891921997,
0.20527364313602448,
0.2761939764022827,
0.17672060430049896,
-0.4473142921924591,
-0.6346509456634521,
-0.056350868195295334,
0.2979532778263092,
-0.2791457176208496,
0.1665853261947631... | |
security needs that just make it one more thing to set up and fight with the customers network admin.
*Deal breaker:* then came the time we wanted to take the next job, but not using a simple pop but something like "get next BLUE job" or "get next YELLOW job". can't do it!
We went to plan B: Implemented our own Q wit... | [
0.18953518569469452,
0.04659300297498703,
0.3412802219390869,
0.14186742901802063,
-0.075678251683712,
-0.1896194964647293,
0.3669174313545227,
-0.1420750617980957,
-0.1903417557477951,
-0.396441251039505,
0.25198447704315186,
0.7008658647537231,
-0.0470537506043911,
-0.06979859620332718,
... | |
that takes the next item. Since you want it to be fast and NON locking. there are 2 very important SQL **hints** we used based on some research. The magic goes something like this:
```
SELECT TOP 1 @Id = callid
FROM callqtbl WITH (READPAST, XLOCK)
where 1=1 ORDER BY xx,yy
``` | [
-0.1560317426919937,
-0.1513117402791977,
0.4293144643306732,
0.08949799090623856,
0.1647643893957138,
-0.1161133423447609,
-0.12849396467208862,
-0.19961659610271454,
0.11168951541185379,
-0.39310422539711,
-0.09061919152736664,
0.5772943496704102,
-0.21344341337680817,
-0.046167943626642... | |
I have Apache 2 running on a VPS server (running Debian). I recently changed the timezone on the server (using dpkg-reconfigure tzdata) from America/New\_York to America/Los\_Angeles to match my move across country. I have also rebooted the virtual machine since making the change.
However, the Apache processes seem to... | [
0.04419081658124924,
0.010711614042520523,
0.808582067489624,
-0.15359093248844147,
-0.38433191180229187,
-0.390334814786911,
0.8467661738395691,
-0.10075241327285767,
-0.11639104783535004,
-0.7381561994552612,
0.003921730909496546,
0.0652199387550354,
-0.37675824761390686,
0.0954933464527... | |
200 7648 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.2) Gecko/2008091618 Firefox/3.0.2"
127.0.0.1 - - [03/Oct/2008:02:01:45 -0400] "GET /tag/moblog/ HTTP/1.0" 200 6563 "-" "msnbot/1.1 (+http://search.msn.com/msnbot.htm)"
127.0.0.1 - - [02/Oct/2008:23:01:46 -0700] "GET /tag/opensource/ HTTP/1.0"... | [
-0.11950529366731644,
0.18052984774112701,
0.5714590549468994,
-0.03327026218175888,
-0.25320950150489807,
-0.1530468463897705,
0.43453845381736755,
-0.16646453738212585,
-0.5922587513923645,
-0.3386698067188263,
-0.14097246527671814,
0.4278901219367981,
-0.42907974123954773,
-0.2327529042... | |
was accessed first when a new Apache process was created, it would muck up the time zone! | [
0.030855972319841385,
-0.33201730251312256,
0.16875797510147095,
0.5028639435768127,
-0.05032755061984062,
-0.5461284518241882,
0.5098180174827576,
0.3208889961242676,
-0.08372431993484497,
-0.36600595712661743,
0.023313801735639572,
0.06515826284885406,
0.22138026356697083,
0.326355010271... | |
What's the easiest way to compute the amount of working days since a date? VB.NET preferred, but C# is okay.
And by "working days", I mean all days excluding Saturday and Sunday. If the algorithm can also take into account a list of specific 'exclusion' dates that shouldn't count as working days, that would be gravy. ... | [
0.48417139053344727,
-0.053369663655757904,
0.7113543152809143,
-0.21901142597198486,
0.1351797729730606,
-0.3078903555870056,
0.13824647665023804,
0.1552266776561737,
-0.4987376928329468,
-0.413983017206192,
-0.2989051043987274,
0.48741841316223145,
-0.29481926560401917,
0.061596974730491... | |
basic data
int days = (int)(end - start).TotalDays;
int weeks = days / 7;
// check for a weekend in a partial week from start.
if (7- (days % 7) <= (int)start.DayOfWeek)
days--;
if (7- (days % 7) <= (int)start.DayOfWeek)
days--;
// lose the weekends
days -= weeks * 2;
foreach (DateTime dt in holidays)
{
... | [
-0.07598961144685745,
-0.12353294342756271,
0.4857960343360901,
-0.09960261732339859,
0.4315556585788727,
0.06258165836334229,
0.4232850670814514,
-0.19536635279655457,
-0.37698373198509216,
-0.21747659146785736,
-0.5776782035827637,
0.6082322001457214,
-0.13946783542633057,
0.268629789352... | |
Say I have a third party Application that does background work, but prints out all errors and messages to the console. This means, that currently, we have to keep a user logged on to the server, and restart the application (double-click) every time we reboot.
*Not so very cool.*
I was kind of sure, that there was an ... | [
0.34312745928764343,
0.22680367529392242,
0.6288278698921204,
0.08798718452453613,
0.09331785142421722,
-0.24366110563278198,
0.4813796877861023,
0.23145702481269836,
-0.2674481272697449,
-0.4975728392601013,
-0.21856024861335754,
0.46371370553970337,
-0.09612163156270981,
0.30726587772369... | |
batch file. FireDaemon seems to do the trick, but I think it is a bit overkill, for something that can be done in <10 lines of python code... Oh well, *Not Invented Here*...
Check out [`srvany.exe`](http://support.microsoft.com/kb/137890) from the [Resource Kit](http://www.microsoft.com/downloads/details.aspx?familyid=... | [
0.0823383554816246,
0.14325278997421265,
0.42146146297454834,
-0.13613376021385193,
0.17303898930549622,
0.14871808886528015,
0.3237537145614624,
-0.16689838469028473,
-0.3971061408519745,
-0.25412291288375854,
0.029572991654276848,
0.5594226121902466,
-0.21343602240085602,
0.0799641609191... | |
What is meant by ‘value semantics’, and what is meant by ‘implicit pointer semantics’?
Java is using implicit pointer semantics for Object types and value semantics for primitives.
Value semantics means that you deal directly with values and that you pass copies around.
The point here is that when you have a value, yo... | [
0.08763128519058228,
0.19389738142490387,
0.04209347441792488,
-0.2742251455783844,
-0.25082457065582275,
-0.02850322239100933,
0.158254012465477,
-0.16195738315582275,
-0.06532468646764755,
-0.414810448884964,
-0.11654302477836609,
0.6339157819747925,
-0.6461905241012573,
-0.1977597922086... | |
to call methods on the pointee.
Implicit Pointer Semantics in Java :
```
void foo(Bar b) ...
... b.bar() ...
```
Since you don't have the choice of using value semantics, the \* isn't needed nor the distinction between -> and ., hence the implicit. | [
0.12113622575998306,
0.15661576390266418,
-0.02450389973819256,
-0.3172491192817688,
-0.30052515864372253,
0.18411488831043243,
0.2974417507648468,
-0.23627224564552307,
0.031146328896284103,
-0.2736642062664032,
-0.0361604318022728,
0.5975018739700317,
-0.5703282356262207,
-0.192683920264... | |
If I want to call `Bar()` instead of `Foo()`, does `Bar()` return me a copy (additional overhead) of what Foo() returns, or it returns the same object which `Foo()` places on the temporary stack?
```
vector<int> Foo(){
vector<int> result;
result.push_back(1);
return result;
}
vector<int> Bar(){ ... | [
0.4290788769721985,
0.500493049621582,
0.4203416109085083,
-0.2723381817340851,
0.22403670847415924,
-0.04146616533398628,
0.09720490872859955,
-0.27442073822021484,
-0.09695886820554733,
-0.3802855312824249,
-0.1503048986196518,
0.6009163856506348,
-0.6208484768867493,
0.5762515664100647,... | |
do not change the semantic and the program.
Note: This is why you should NEVER have a copy constructor that does anything but copying correctly as you can never be sure if a copy will be actually done or not. | [
0.49036696553230286,
0.33993685245513916,
0.007298095617443323,
0.2624284029006958,
0.09220656007528305,
-0.5682634115219116,
0.5828191041946411,
0.295514851808548,
-0.06316103786230087,
-0.6378704905509949,
-0.053548868745565414,
0.5390732288360596,
-0.22660385072231293,
0.171614632010459... | |
I'm currently trying to pass a mono threaded program to multithread. This software do heavy usage of "refCounted" objects, which lead to some issues in multithread. I'm looking for some design pattern or something that might solve my problem.
The main problem is object deletion between thread, normally deletion only d... | [
0.01717507094144821,
0.12500718235969543,
0.03266261890530586,
0.11065781861543655,
-0.1795489639043808,
0.018497426062822342,
0.3437657654285431,
0.21226586401462555,
-0.6215076446533203,
-0.3987303674221039,
0.16460880637168884,
0.559499979019165,
-0.39991700649261475,
0.7017184495925903... | |
a mutex, only one thread delete the object and block the other one. But when it releases the mutex, then the other thread continue its execution with invalid (freed object), which lead to memory corruption.
Here is an example with this class RefCountedObject
```
class RefCountedObject
{
public:
RefCountedObject()
: ... | [
0.027642233297228813,
0.06792479008436203,
0.25526025891304016,
-0.4391686022281647,
0.003833683440461755,
0.17825603485107422,
0.5827552080154419,
-0.8515828847885132,
-0.14437873661518097,
-0.5452625751495361,
-0.3050786256790161,
0.6466608643531799,
-0.5125923752784729,
0.30603802204132... | |
ACE_Guard< ACE_Mutex > guard( _refCountMutex );
_refCount = obj._refCount;
++(*_refCount);
}
return *this;
}
private:
void Destroy()
{
ACE_Guard< ACE_Mutex > guard( _refCountMutex ); // thread2 are waiting here
--(*_refCount); // This cause a free memory write ... | [
0.4077155590057373,
0.16499590873718262,
-0.10028015077114105,
-0.36503249406814575,
0.36099597811698914,
-0.2062811404466629,
0.7383558750152588,
-0.5697805881500244,
-0.2213897556066513,
-0.6967189311981201,
-0.16080904006958008,
0.6381008625030518,
-0.6786976456642151,
0.369792938232421... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.