text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I have been trying to learn how to add testing to existing code -- currently reading reading [Working Effectively With Legacy Code](https://rads.stackoverflow.com/amzn/click/com/0131177052). I have been trying to apply some of the principles in JavaScript, and now I'm trying to extract an interface.
In searching for c... | [
0.5499143004417419,
0.12425120919942856,
-0.20261192321777344,
0.33257773518562317,
-0.32005560398101807,
-0.018205279484391212,
0.298615038394928,
-0.29960834980010986,
0.07177373766899109,
-0.6989962458610535,
0.4382803440093994,
0.4747861921787262,
-0.13455264270305634,
0.07138296961784... | |
an interface in JavaScript?
There's no definitive **right way**, because so many people are doing so many different things.. There are many useful patterns.
**Crockford** suggests that you "go with the grain", or write javascript in a way that corresponds to javascript's prototypal nature.
Of course, he goes on to sh... | [
0.5114149451255798,
-0.10969729721546173,
0.1011846736073494,
0.03218494728207588,
-0.21446210145950317,
-0.21016825735569,
0.6037172675132751,
-0.13309042155742645,
-0.143301859498024,
-0.7867216467857361,
0.3559075891971588,
0.6326215267181396,
-0.6992902755737305,
-0.24898099899291992,
... | |
not always easy to do develop a clean interface when you have to work with legacy javascript, especially not when you're dealing with large systems, usually including multiple libraries, and each implementing a unique style and different inheritance pattern. In general, I'd say that the "right way" to do inheritance is... | [
0.18732933700084686,
-0.004226071294397116,
-0.08403182774782181,
0.22944727540016174,
-0.006164644844830036,
-0.4052056670188904,
0.5035791993141174,
-0.07347016036510468,
-0.1737590730190277,
-0.886099636554718,
-0.05744340270757675,
0.6042804718017578,
-0.09150642156600952,
-0.055239852... | |
my own work is to keep my interfaces independent of the library interfaces entirely. I'll use a library or module if it's helpful, but won't be bound to it. This has allowed me to refactor a lot of code, phase out some libraries, and use libraries as scaffolding which can be optimized later.
Along these lines, I've wr... | [
0.3976466655731201,
0.12676334381103516,
-0.13416990637779236,
0.25765034556388855,
-0.19798791408538818,
-0.05103886127471924,
0.21823306381702423,
-0.14779961109161377,
0.003241037717089057,
-0.8188284039497375,
0.35231414437294006,
0.645590603351593,
-0.316957026720047,
-0.0103869214653... | |
its interface conventions. | [
-0.11842421442270279,
0.13128846883773804,
0.38379430770874023,
-0.14839428663253784,
0.035736195743083954,
0.013042614795267582,
-0.23121652007102966,
0.10548543184995651,
-0.028241673484444618,
-0.6992157697677612,
-0.2805463671684265,
0.3089967966079712,
-0.12852256000041962,
0.22569043... | |
I see this all the time in Ruby:
```
require File.dirname(__FILE__) + "/../../config/environment"
```
What does `__FILE__` mean?
It is a reference to the current file name. In the file `foo.rb`, `__FILE__` would be interpreted as `"foo.rb"`.
**Edit:** Ruby 1.9.2 and 1.9.3 appear to behave a little differently fro... | [
0.4646996855735779,
0.574356198310852,
0.22343246638774872,
-0.36766886711120605,
-0.049609072506427765,
-0.18765778839588165,
0.5902601480484009,
-0.3197692930698395,
-0.10315630584955215,
-0.2572800815105438,
-0.12054845690727234,
0.5809713006019592,
-0.49845314025878906,
0.2636383771896... | |
Within the last year I have become addicted to subversion. I am an only developer and I also work on a few of my own projects. With SVN its really easy to manage everything - and because it is hosted on an online server though HTTPS I can access my code from anywhere. It is also great for deploying code to our producti... | [
0.7681700587272644,
0.2387772500514984,
0.20759601891040802,
-0.009493935853242874,
-0.223074272274971,
-0.262564092874527,
0.5740253925323486,
0.5307985544204712,
-0.1624501347541809,
-0.4578300416469574,
0.31417059898376465,
0.20942585170269012,
-0.30709218978881836,
0.36260637640953064,... | |
life easier? I am always all about using the best software out there and have no problem migrating to new technologies.
I have heard of GIT and have done some research. I plan on giving that a try but while I am messing with that, are there another other source control systems that are considered "industry standard" a... | [
0.6771506071090698,
-0.22951523959636688,
0.11193975061178207,
0.5118716359138489,
0.019911985844373703,
-0.16502875089645386,
0.014102306216955185,
0.4283025562763214,
-0.3517688512802124,
-0.481985479593277,
0.29652488231658936,
0.7313400506973267,
-0.21575835347175598,
-0.01849522627890... | |
of detached work, sometimes called "airplane mode", as in you're on an airplane and can't commit, take a look at Bazaar. I've found it easier to acclimate to than Git or Mercurial.
If you're always doing work connected to the Net, and you're the only developer, then you can probably stick with Subversion.
Also, pleas... | [
0.684904158115387,
-0.36013901233673096,
0.23056674003601074,
0.2039743959903717,
-0.08869239687919617,
-0.3319193720817566,
0.20295988023281097,
0.2512946128845215,
-0.3791133761405945,
-0.06737244874238968,
-0.23030789196491241,
0.2990555763244629,
-0.26669517159461975,
0.081991426646709... | |
I was taking a look through some open-source C++ code and I noticed a lot of double underscores used within in the code, mainly at the start of variable names.
```
return __CYGWIN__;
```
Just wondering: Is there a reason for this, or is it just some people's code styles? I would think that it makes it hard to read.
... | [
0.31073498725891113,
0.3261747658252716,
0.20035384595394135,
-0.031685441732406616,
-0.16413263976573944,
0.04571382701396942,
0.02649862691760063,
-0.07341081649065018,
-0.20985664427280426,
-0.22249318659305573,
-0.3857608437538147,
0.1506323218345642,
-0.24898354709148407,
0.2083327025... | |
In order to avoid collisions, do not begin an identifier with an underscore. | [
0.11254791915416718,
0.4090811312198639,
-0.006347890943288803,
0.01692925952374935,
-0.06191954016685486,
-0.11535201966762543,
0.028707213699817657,
0.1381024569272995,
-0.26889529824256897,
-0.5535793900489807,
-0.48177987337112427,
0.05464848503470421,
-0.097829669713974,
-0.1731864362... | |
Is there a better/simpler way to find the number of images in a directory and output them to a variable?
```
function dirCount($dir) {
$x = 0;
while (($file = readdir($dir)) !== false) {
if (isImage($file)) {$x = $x + 1}
}
return $x;
}
```
This seems like such a long way of doing this, is there no simple... | [
0.025790737941861153,
-0.13457436859607697,
0.589849591255188,
-0.07518921047449112,
-0.16772840917110443,
-0.0017341242637485266,
0.11467771232128143,
-0.2701503336429596,
-0.12814517319202423,
-0.5330348610877991,
-0.06628793478012085,
0.6691113114356995,
-0.45495742559432983,
-0.0446731... | |
undocumented function called iterator\_count() but probably best not to rely on it for now I would imagine. And you'd need to filter out unseen stuff like . and .. anyway.) | [
0.17809437215328217,
-0.04183997958898544,
0.2284734845161438,
-0.021924858912825584,
0.3179048001766205,
-0.16561748087406158,
0.21424299478530884,
0.028584076091647148,
-0.20374450087547302,
-0.21898241341114044,
-0.05806213617324829,
0.6298220157623291,
-0.1307772845029831,
-0.163503751... | |
My Flash (AS3/AIR) application is currently using a slightly unusual architecture (for a Flash app) to provide particular base classes for loaded content at runtime. The external content is published with 'stub' base classes, which are eclipsed by the 'real' base classes at runtime when it is loaded. I've heard this re... | [
0.24877752363681793,
0.17989735305309296,
0.4931497275829315,
-0.18421868979930878,
-0.3873603343963623,
-0.18179404735565186,
0.1435614824295044,
-0.03343174234032631,
-0.16589979827404022,
-0.3238292932510376,
-0.29359933733940125,
0.6010415554046631,
-0.37632477283477783,
-0.23075529932... | |
`SecurityDomain` (same sandbox), which allows me to easily load the content in a child `ApplicationDomain`. Unfortunately, as far as I can tell, an `ApplicationDomain`s that span `SecurityDomain`s cannot be related - that is, I cannot make an AppDom of one SecurityDom the child of an AppDom from another SecurityDom.
B... | [
0.14457254111766815,
0.43218308687210083,
0.6704276204109192,
0.1754884123802185,
0.04025644809007645,
-0.1168656125664711,
0.23211681842803955,
-0.2484622299671173,
-0.1535564810037613,
-0.6475632786750793,
-0.218246728181839,
0.5710777640342712,
-0.21734929084777832,
0.37945398688316345,... | |
architecture.
I notice that the `LoaderContext` object has a `securityDomain` property, but Flash security prohibits 'local swfs' from touching it (it throws a `SecurityError` or similar).
Flex's `SWFLoader` has a `trustContent` property that looks promising, but I'm inclined to assume that it has the same restricti... | [
0.3914836645126343,
0.23867177963256836,
0.4536665678024292,
0.21616771817207336,
0.06578683108091354,
-0.16493433713912964,
0.1753646582365036,
-0.2793656289577484,
-0.17682687938213348,
-0.81633460521698,
-0.2779127061367035,
0.7899267077445984,
-0.04849117994308472,
0.10623864084482193,... | |
gimme a definitive "yes/no it can/can't be done"...
Thanks in advance!
*Addendum:* I've since decided to re-design the architecture so that the bootstrapping all happens on the external domain. My question still stands, however, out of curiosity.
A warning doesn't automatically mean that code is *bad*, just suspiciou... | [
0.8779230713844299,
0.33133465051651,
0.23938465118408203,
-0.16326497495174408,
-0.08293467015028,
-0.19011500477790833,
0.5352908372879028,
-0.08615778386592865,
-0.07623231410980225,
-0.15444137156009674,
-0.1810770481824875,
0.35891348123550415,
-0.06452026218175888,
0.2406863272190094... | |
I'm using a decimal column to store money values on a database, and today I was wondering what precision and scale to use.
Since supposedly char columns of a fixed width are more efficient, I was thinking the same could be true for decimal columns. Is it?
And what precision and scale should I use? I was thinking prec... | [
0.25882744789123535,
0.3522779643535614,
0.6090530753135681,
-0.00004895956953987479,
-0.0015966304345056415,
0.3358103632926941,
-0.22173035144805908,
-0.15656974911689758,
-0.5012913942337036,
-0.4942382276058197,
0.36769139766693115,
0.5953713059425354,
0.1977650672197342,
0.23291246592... | |
calculations using a conversion rate will be handled by my application so I keep control of rounding issues
I don't think a float for the conversion rate is an issue, since it's mostly for reference, and I'll be casting it to a decimal anyway.
Thank you all for your valuable input.
If you are looking for a one-size-f... | [
0.27255979180336,
0.26312553882598877,
0.41764622926712036,
0.2821655869483948,
-0.1588866412639618,
0.1823824644088745,
-0.34467992186546326,
0.14481748640537262,
-0.3792000412940979,
-0.3875313699245453,
0.1336180716753006,
0.4169067442417145,
0.07164044678211212,
0.07750120013952255,
... | |
implemented) in VB6/VBA6/Jet 4.0.
The rule of thumb for *storage* of fixed point decimal values is to store at least one more decimal place than you actually require to allow for rounding. One of the reasons for mapping the old `Currency` type in the front end to `DECIMAL(19, 4)` type in the back end was that `Currenc... | [
-0.09713056683540344,
-0.09338333457708359,
0.36181697249412537,
0.14711014926433563,
0.02694789692759514,
0.2368220090866089,
-0.33019593358039856,
-0.15370991826057434,
-0.3930022716522217,
-0.26780423521995544,
0.05109697952866554,
0.38815245032310486,
-0.06963566690683365,
0.0949707478... | |
expecting all values ending in .5 to round away from zero).
Yes, `DECIMAL(24, 8)` sounds like overkill to me. Most currencies are quoted to four or five decimal places. I know of situations where a decimal scale of 8 (or more) *is* required but this is where a 'normal' monetary amount (say four decimal places) has bee... | [
0.27967506647109985,
0.1278538703918457,
0.28951922059059143,
0.0712137520313263,
-0.04697767272591591,
0.027218563482165337,
-0.022696929052472115,
0.16757428646087646,
-0.4733303189277649,
-0.09946286678314209,
0.06981337815523148,
0.44565144181251526,
0.08209270238876343,
0.269864946603... | |
in order. Ask your designer or domain expert about accounting rules which may be applicable: GAAP, EU, etc. I vaguely recall some EU intra-state transfers with explicit rules for rounding to five decimal places, therefore using `DECIMAL(p, 6)` for storage. Accountants generally seem to favour four decimal places.
---
... | [
-0.16075356304645538,
0.12663383781909943,
0.16581442952156067,
0.24811942875385284,
0.1547926664352417,
0.10246463865041733,
-0.48320189118385315,
-0.2076922506093979,
-0.44009897112846375,
-0.4040032923221588,
-0.13151207566261292,
0.1590844839811325,
0.07240505516529083,
0.0734415128827... | |
example. And hardware designers chose it because mathematicians prefer it. See [Wikipedia](http://en.wikipedia.org/wiki/Rounding#History); to paraphrase: The 1906 edition of Probability and Theory of Errors called this 'the computer's rule' ("computers" meaning humans who perform computations). | [
0.07429146766662598,
-0.13597610592842102,
-0.21721911430358887,
0.13554535806179047,
-0.0264273751527071,
-0.0020654175896197557,
-0.07540517300367355,
-0.09384487569332123,
-0.4634441137313843,
-0.4890882670879364,
0.07097794860601425,
0.3693235218524933,
-0.08624443411827087,
0.14166705... | |
Today someone asked me what was wrong with their source code. It was obvious. "Use double equals in place of that single equal in that if statement. Um, I think..." As I remember some languages actually take a single equals for comparison. Since I sometimes forget or mix up the syntax details among the several language... | [
0.09818574041128159,
0.28527963161468506,
-0.14902426302433014,
0.1359063982963562,
-0.2130296677350998,
0.2496679723262787,
0.5229055285453796,
0.2898884415626526,
-0.01614673249423504,
-0.5324592590332031,
0.3156876862049103,
0.2976626455783844,
0.1760706752538681,
-0.21589088439941406,
... | |
straight in your mind the syntax (and other) details of multiple languages?
(And nowadays, this applies just as well to the many wiki-like markups!)
IDEs that can draw red and yellow squiggles can help, until you develop that mental muscle memory.
One of the annoying things with XCode (for Cocoa/ObjectiveC) is that ... | [
0.25461336970329285,
0.15738506615161896,
0.09915132820606232,
0.3505004942417145,
-0.26263725757598877,
-0.30621230602264404,
0.37519171833992004,
0.13422372937202454,
-0.30082932114601135,
-0.6033269166946411,
-0.08007363229990005,
0.38729992508888245,
-0.4730517864227295,
-0.31595942378... | |
On an ASP.NET MVC (Beta) site that I am developing sometimes calls to ActionLink will return to me URLs containing querying strings. I have isolated the circumstances that produce this behavior, but I still do not understand why, instead of producing a clean URL, it decides to using a query string parameter. I know tha... | [
0.2736649513244629,
-0.141607865691185,
0.4630109965801239,
0.04515055567026138,
-0.06823746860027313,
-0.007463917136192322,
0.2507341206073761,
-0.35350874066352844,
-0.5288625359535217,
-0.694473385810852,
-0.052122924476861954,
0.18870197236537933,
-0.527274489402771,
-0.04055145755410... | |
= "" });
routes.MapRoute(
"Tagged Photos", //since the Tagged action takes an extra parameter, put it first
"group/{groupname}/Photos/Tagged/{tagname}/{sortby}",
new { controller = "Photos", action = "Tagged", Id = "", SortBy = "" });
routes.MapRoute(
"Photo Gallery", //since the Gallery's defualt act... | [
-0.202342227101326,
-0.6959884166717529,
0.5918441414833069,
0.16590873897075653,
-0.05968286097049713,
0.13294753432273865,
-0.05295392870903015,
-0.4672170877456665,
-0.5811460614204407,
-0.751056432723999,
-0.4296887516975403,
0.2539730370044708,
-0.7997695803642273,
-0.2923366725444793... | |
"Photos", action = "Index", Id = ""});
```
Now the problem only occurs when I am looking at the view described by the route named "Tagged Photos" and execute ActionLink via:
```
Html.ActionLink<PhotosController>(p => p.All((string)ViewData["group"], ""), "Home")
```
Which produces the URL:
```
http://domain/group... | [
0.01264035515487194,
-0.07073134928941727,
0.7007732391357422,
-0.11579509824514389,
-0.10769503563642502,
-0.027324330061674118,
0.29168900847435,
-0.5635553002357483,
-0.554531991481781,
-0.36392566561698914,
-0.4437457025051117,
0.43233293294906616,
-0.5332579016685486,
-0.2170146554708... | |
engine will skip that parameter (if it's in the query string). | [
-0.4048459231853485,
-0.2931498885154724,
0.2964649200439453,
0.07219105213880539,
0.09905161708593369,
-0.09012481570243835,
0.2310047298669815,
-0.1741809844970703,
-0.1173432320356369,
-0.6603060960769653,
-0.2628163695335388,
0.5671799778938293,
-0.45930227637290955,
0.0230136662721633... | |
I am reading over the K&R book, and am a little stuck.
What is wrong with the following?
```
void getInput(int* output) {
int c, i;
for(i=0; (c = getchar()) != '\n'; i++)
output[i] = c; // printf("%c", c) prints the c value as expected
output[++i] = '\0';
}
```
When I run the program it never gets out... | [
0.13713081181049347,
0.2381613552570343,
0.43301594257354736,
-0.2713174521923065,
0.07448957115411758,
0.012643570080399513,
0.670328676700592,
-0.18121382594108582,
-0.03540344908833504,
-0.5150452256202698,
-0.2619537115097046,
0.6665011048316956,
-0.297077476978302,
0.24717380106449127... | |
is wrong with the following?
```
1. void getInput(int* output) {
```
Why is the input argument an int\* when what you want to store in an array of characters?
Probably
```
void getInput(char* output) {
```
is better.
Also, how do you know that the output pointer is pointing somewhere where you hold enough mem... | [
-0.050068434327840805,
0.1754741668701172,
0.10187149047851562,
-0.1512938290834427,
0.055087652057409286,
0.11045602709054947,
0.4404848515987396,
-0.1077408567070961,
-0.38438183069229126,
-0.431008517742157,
-0.10328637808561325,
0.5926809310913086,
-0.28882455825805664,
0.0191100407391... | |
the program runs fine and outputs what we input until return.
FWIW, I tested it by calling it like so:
```
int main(void)
{
char o[100];
getInput(o);
printf("%s", o);
return 0;
}
``` | [
0.3967595398426056,
-0.10626345872879028,
0.36681193113327026,
-0.3195292055606842,
0.3238489627838135,
0.0920502319931984,
0.5228819847106934,
-0.18064716458320618,
-0.1320333182811737,
-0.4921868145465851,
-0.08420475572347641,
0.6999098062515259,
-0.2453620433807373,
0.11163026094436646... | |
I'm considering altering some tables to use nvarchar(50) as primary key instead of an int primary key. Using an int ID for a key really is irrelevant data, it's the string I'm interested in. What sort of performance hit will occur, or where do you research this? Other than cut and try that is.
You have hit upon one of ... | [
0.46333128213882446,
0.006213760934770107,
0.043698761612176895,
0.2342521995306015,
0.024394545704126358,
-0.1638912856578827,
-0.07237986475229263,
-0.11135116219520569,
-0.22943629324436188,
-0.47946399450302124,
0.16534550487995148,
0.6002670526504517,
-0.09868419915437698,
0.375571161... | |
whether a representative key (surrogate, for example an IDENTITY column) should be used versus using the actual data that uniquely describes a record (natural key).
I will say that there is no "right" answer. Performance measures are an artifact of the platform, and should be assessed by experimentation, but performan... | [
0.29497069120407104,
0.051594726741313934,
-0.14746025204658508,
0.476535826921463,
0.23310191929340363,
-0.05231361836194992,
0.050048526376485825,
-0.2360249012708664,
-0.23111632466316223,
-0.3181602358818054,
-0.013156169094145298,
0.6079590320587158,
0.02068973332643509,
0.00468600913... | |
that it may become non-unique at some point in the future. For those reasons, I typically (not always) use surrogate keys for most of my tables.
However, as I mentioned, there is a very long-standing debate filled with discussions of indexing strategies and normal-form adherance to be read if you are so inclined.
I w... | [
0.11607442796230316,
-0.007494693621993065,
0.242734894156456,
0.10710762441158295,
0.1264670193195343,
0.09826257824897766,
-0.10331044346094131,
-0.24345923960208893,
-0.29066330194473267,
-0.2771746516227722,
-0.09561362117528915,
0.7400363087654114,
-0.015564518980681896,
0.32212349772... | |
Given this HTML:
```
<div>foo</div><div>bar</div><div>baz</div>
```
How do you make them display inline like this:
> foo bar baz
not like this:
> foo
>
> bar
>
> baz
That's something else then:
```css
div.inline { float:left; }
.clearBoth { clear:both; }
```
```html
<div class="inline">1<br />2<br />3<... | [
0.03649122267961502,
0.09093629568815231,
0.4813997447490692,
-0.04362078383564949,
-0.48361897468566895,
0.27479779720306396,
0.03588369861245155,
-0.10387986153364182,
-0.19266091287136078,
-0.8119581937789917,
0.1660109907388687,
0.4857288599014282,
-0.5984472632408142,
-0.1269219666719... | |
I'm trying to program ARM using Eclipse + CDT + yagarto (gnu toolchain) + OpenOCD. In several sample projects (from yagarto site for example) I found linker scripts (\*.ld) where a lot of linking information specified (along with sections definitions). Actually I haven't faced this files before (IAR doesn't need them),... | [
0.32051315903663635,
0.12627583742141724,
0.11532995104789734,
0.03586658090353012,
-0.4011070132255554,
-0.060460545122623444,
0.09556133300065994,
-0.0424758717417717,
-0.2396397739648819,
-0.9064127802848816,
0.03457627072930336,
0.4295227527618408,
-0.17113326489925385,
0.0641675516963... | |
If I can use single file for all projects for particular target processor can you please advice where I can find such universal one.
My guess is every third person has a different script or solution. There are a number of problems that have to be solved, different linkers are going to solve those in different ways. I t... | [
0.2374001145362854,
0.025991253554821014,
-0.04739190638065338,
0.34685611724853516,
-0.3503844439983368,
-0.08100508898496628,
-0.21673445403575897,
0.27184954285621643,
-0.5556689500808716,
-0.7234355807304382,
0.21091821789741516,
0.6080069541931152,
0.057914040982723236,
0.033695340156... | |
vector table to tell it essentially where the reset code is and interrupt, etc. So that table has to be in a specific place and you have to tell the linker to put it in that specific place (first).
One of the scripts I like to use is:
```
MEMORY
{
bob (RX) : ORIGIN = 0x0000000, LENGTH = 32K
joe (WAIL) : ORIGI... | [
0.13993319869041443,
-0.18866701424121857,
0.24935969710350037,
0.004526239354163408,
0.04657278582453728,
0.3349469006061554,
-0.03402601182460785,
0.14159542322158813,
-0.33477166295051575,
-0.707517147064209,
0.4327698349952698,
0.4557051360607147,
-0.24547608196735382,
-0.0059680258855... | |
the names are they are just labels.
Another variation on the theme:
```
MEMORY
{
rom(RX) : ORIGIN = 0x00000000, LENGTH = 0x8000
ram(WAIL) : ORIGIN = 0x20000000, LENGTH = 0x2000
}
SECTIONS
{
.text : { *(.text*) } > rom
}
```
The first one allows you to put the files on the linker command line in any o... | [
0.19794486463069916,
-0.09300053119659424,
0.43837541341781616,
0.10115176439285278,
-0.017408054322004318,
0.0407378152012825,
-0.1283612847328186,
-0.03176618739962578,
-0.3601067066192627,
-0.6580865979194641,
-0.15404334664344788,
0.5035374760627747,
-0.39576196670532227,
0.46475690603... | |
memmap -o blinker2.elf
```
Or with ld directly
```
arm-thumb-elf-ld vectors.o putget.o blinker2.o -T memmap -o blinker2.elf
```
The RX tells the linker to put read and execute stuff in that memory section and the WAIL is basically everything else. If you only have one ram for example you can put all the flags RXWA... | [
0.033993907272815704,
-0.14614596962928772,
0.30851414799690247,
-0.15521910786628723,
0.05205364525318146,
-0.05671851709485054,
0.1885863095521927,
0.13517911732196808,
-0.10517226904630661,
-0.5183596014976501,
-0.33017730712890625,
0.8155475854873657,
-0.2680891454219818,
-0.2521973848... | |
The arms (not the cortex-m3) have a branch instruction as the first vector for the reset vector so you can just pretend to build a vector table anyway for a ram solution and will just work.
The are a number of problems with this solution that dont happen to bother me. I initialize variables in my code, not during decl... | [
0.06954333186149597,
-0.04733792319893837,
0.7362396121025085,
0.0692976787686348,
0.2580482065677643,
0.06656553596258163,
0.18969933688640594,
-0.2365439236164093,
-0.6207162737846375,
-0.42277786135673523,
-0.24086743593215942,
0.6070812940597534,
-0.03829413652420044,
-0.12303074449300... | |
linker script as a team can work together to make it easier to automate the resetting of the bss code and copying non-zero init data from rom to ram on boot. (that int rx=7; above requires some code that copies the value 7 from somewhere in rom and writes it to the memory location in ram allocated for the variable rx s... | [
0.3265873193740845,
-0.04140934348106384,
0.381136417388916,
-0.17161831259727478,
-0.020209595561027527,
-0.3279496431350708,
0.2289622575044632,
-0.09586458653211594,
-0.3458554446697235,
-0.37485581636428833,
0.03886595368385315,
0.4082757830619812,
-0.5094894170761108,
0.29167553782463... | |
b hang
b hang
b hang
b hang
b hang
b hang
b hang
b hang
b hang
b hang
b hang
b hang
hang : b hang
reset:
ldr sp,=0x10004000
bl main
b hang
```
You are going to see or read about solutions that allow the startup code and the linker script to work together to no... | [
0.8252160549163818,
-0.24548804759979248,
0.8101744055747986,
0.13297758996486664,
-0.1449439525604248,
-0.1870630830526352,
-0.09330045431852341,
-0.4908979535102844,
-0.6537074446678162,
-0.047656215727329254,
-0.10977820307016373,
0.11123710125684738,
-0.4150955379009247,
-0.14419391751... | |
hardcode stack pointers, heap space, things like that, again you can put a lot of work into complicated startup code and linker scripts to gain some automation and perhaps save some work, perhaps not. The automation, if/when working can and will reduce human error and that can be a good thing, also if you are switching... | [
0.4548003673553467,
0.3883843719959259,
-0.12286736816167831,
0.44088929891586304,
-0.10969403386116028,
-0.17088313400745392,
-0.07833302766084671,
0.017741413787007332,
-0.4478112459182739,
-0.6739497780799866,
0.1679358333349228,
0.8545448184013367,
-0.14741823077201843,
-0.261603593826... | |
have to tailor your work to that script. You are likely not going to find one script that works with everyones example code. The more complicated the script the harder it will be to borrow. Yes, my scripts above can likely be done on the ld command line, but way back when (gcc 2.95) I couldnt get that to work so develo... | [
0.5919125080108643,
0.04531420022249222,
0.0719645693898201,
0.019097430631518364,
-0.3460697531700134,
-0.3760170340538025,
0.22924889624118805,
-0.1731201559305191,
0.07723552733659744,
-0.9598455429077148,
0.30449193716049194,
0.9268852472305298,
-0.3489454984664917,
-0.3023936748504638... | |
Hi Guys could you please help me refactor this so that it is sensibly pythonic.
```
import sys
import poplib
import string
import StringIO, rfc822
import datetime
import logging
def _dump_pop_emails(self):
self.logger.info("open pop account %s with username: %s" % (self.account[0], self.account[1]))
self.popi... | [
0.11014068126678467,
0.2732939124107361,
0.6693900227546692,
-0.03158572316169739,
-0.19561752676963806,
0.1824406236410141,
0.3667299151420593,
-0.09661750495433807,
-0.34788188338279724,
-0.2744591236114502,
-0.21029144525527954,
0.6149974465370178,
-0.334158718585968,
-0.163873285055160... | |
text = string.join(body, '\n')
mesg = StringIO.StringIO(text)
msg = rfc822.Message(mesg)
name, email = msg.getaddr("From")
emailpath = | [
-0.10081444680690765,
-0.015057277865707874,
0.4713234007358551,
-0.2798256278038025,
-0.09926002472639084,
0.20498724281787872,
0.5427524447441101,
0.02201756462454796,
-0.3870597183704376,
-0.5832757353782654,
-0.4138549864292145,
0.18733090162277222,
-0.48909440636634827,
-0.10110994428... | |
str(self._emailpath + self._inboxfolder + "\\" + email + "_" + msg.getheader("Subject") + ".eml")
emailpath = self._replace_whitespace(emailpath)
file = open(emailpath,"wb")
file.write(text)
file.close()
self.popinstance.dele(thisNum)
finally:
self... | [
0.04223751649260521,
0.00439536664634943,
0.7600659728050232,
-0.32330381870269775,
0.08470351248979568,
0.13042108714580536,
0.3507041931152344,
-0.2378847897052765,
-0.4749135971069336,
-0.512042760848999,
-0.32853981852531433,
0.7014483213424683,
-0.5695657730102539,
0.15638470649719238... | |
name.replace(" ", "_")
```
Also in the \_replace\_whitespace method I would like to have some kind of cleaning routine which takes out all illegal characters which could cause processing.
Basically I want to write the email to the inbox directory in a standard way.
Am i doing something wrong here?
This isn't ref... | [
0.1747271567583084,
0.1539240926504135,
0.469736248254776,
-0.1354226917028427,
0.006590232718735933,
-0.0912194475531578,
0.4609562158584595,
-0.3367461860179901,
-0.17781412601470947,
-0.994559645652771,
0.059184201061725616,
0.4560595750808716,
-0.614471971988678,
0.08957432210445404,
... | |
+ self._inboxfolder + "\\" + email + "_" + msg.getheader("Subject") + ".eml")
```
Becomes:
```
emailpath = os.path.join(self._emailpath + self._inboxfolder, email + "_" + msg.getheader("Subject") + ".eml")
```
(If self.\_inboxfolder starts with a slash or self.\_emailpath ends with one, you could replace the first... | [
-0.1553637981414795,
-0.061882100999355316,
0.6503873467445374,
-0.27341991662979126,
-0.07437202334403992,
-0.08945508301258087,
0.3908754885196686,
-0.18594153225421906,
-0.23188215494155884,
-0.7261858582496643,
0.045286379754543304,
0.4981575012207031,
-0.4422098696231842,
0.0410584695... | |
attribute of self. Just use "popinstance" by itself.
Use xrange instead of range.
Instead of just importing StringIO, do this:
```
try:
import cStringIO as StringIO
except ImportError:
import StringIO
```
If this is a POP mailbox that can be accessed by more than one client at a time, you might want to put... | [
-0.08229167014360428,
-0.08878467231988907,
0.42374828457832336,
-0.16641637682914734,
0.008290775120258331,
0.051636721938848495,
0.3656136095523834,
-0.042388297617435455,
-0.2193005383014679,
-0.4453514814376831,
-0.19934897124767303,
0.43504223227500916,
-0.4924400746822357,
-0.1731178... | |
be that you don't really need to parse the whole message, since you're just dumping a copy of the raw bytes, and all you want is the From and Subject headers. You could instead use popinstance.top(0) to get the headers, create the message (blank body) from that, and use that for the headers. Then do a full RETR to get ... | [
0.3916807770729065,
-0.22664770483970642,
-0.05397863686084747,
0.21433421969413757,
-0.2612709403038025,
0.05305511876940727,
0.1541784256696701,
0.02457358129322529,
-0.292193204164505,
-0.5215309262275696,
-0.013971769250929356,
0.3134979009628296,
-0.22249296307563782,
0.06443042308092... | |
nice you want the names to be, and how certain you are that the email and subject make the filename unique (seems fairly unlikely). You could do something like:
```
emailpath = "".join([c for c in emailpath if c in (string.letters + string.digits + "_ ")])
```
And you'd end up with just alphanumeric characters and t... | [
0.28488337993621826,
-0.01892676204442978,
0.48394203186035156,
0.07771670818328857,
0.02934885583817959,
-0.098292276263237,
0.012555834837257862,
0.33503085374832153,
-0.0881003811955452,
-0.7115433216094971,
-0.023886267095804214,
0.7111313343048096,
-0.41143715381622314,
0.033991526812... | |
This is sort of a follow-up to [this question](https://stackoverflow.com/questions/223678).
If there are multiple blobs with the same contents, they are only stored once in the git repository because their SHA-1's will be identical. How would one go about finding all duplicate files for a given tree?
Would you have ... | [
0.26441675424575806,
0.06465783715248108,
0.20103107392787933,
-0.0615677572786808,
-0.20266222953796387,
-0.15238834917545319,
0.26997169852256775,
0.018540646880865097,
-0.5901903510093689,
-0.6063380241394043,
0.12127789109945297,
0.11368155479431152,
-0.4789488911628723,
0.404252290725... | |
(my $line = <STDIN>) {
chomp $line;
if ($line =~ m{ \A \d+ \s+ \w+ \s+ (\w+) \s+ (\S+) \z }xms) {
my $sha1 = $1;
my $path = $2;
push @{$sha1_path->{$sha1}}, $path;
}
}
foreach my $sha1 (keys %$sha1_path) {
if (scalar @{$sha1_path->{$sha1}} > 1) {
foreach my $path (@{$s... | [
-0.48189207911491394,
-0.12293102592229843,
1.0137271881103516,
-0.4918474555015564,
0.03013264201581478,
0.42143040895462036,
0.3399404287338257,
-0.2042396366596222,
-0.12564469873905182,
-0.3731265962123871,
-0.5144904851913452,
0.032947760075330734,
-0.3846956193447113,
0.2281935513019... | |
print "$sha1 $path\n";
}
print '-' x 40, "\n";
}
}
``` | [
-0.3580525517463684,
0.22831173241138458,
0.23516109585762024,
-0.3377476930618286,
-0.12513341009616852,
0.1498333066701889,
0.45690298080444336,
-0.11981628835201263,
-0.1447184830904007,
-0.7027869820594788,
-0.326890766620636,
0.3264594078063965,
-0.5817981362342834,
0.1457392424345016... | |
I have a page which dynamically loads a section of content via AJAX. I'm concerned that this means the content will not be found by search engines.
To show you what I mean, the site is at <http://www.gold09.net> and the dynamic content is at [/speakers.php](http://www.gold09.net/speakers.php) - Normally no one would v... | [
0.5011376738548279,
0.23864123225212097,
0.47814226150512695,
-0.2874079644680023,
-0.25147122144699097,
-0.1089714765548706,
0.24048380553722382,
0.1734645664691925,
-0.4571625292301178,
-0.41052958369255066,
-0.046926453709602356,
0.7111182808876038,
-0.023208286613225937,
0.451708823442... | |
redirects them to the main page, whereas it lets crawlers read the data.
Any suggestions?
**Update: What I've done is this:**
Created another page called [`viewSpeakers.php`](http://www.gold09.net/viewSpeakers.php) which just includes the `speakers.php` file with the standard header and footer around it. This means t... | [
0.5788184404373169,
0.23964141309261322,
0.4913754165172577,
-0.04717031493782997,
-0.2728346884250641,
-0.13658080995082855,
0.38346177339553833,
0.19277900457382202,
-0.3639344871044159,
-0.5989562273025513,
-0.09077112376689911,
0.5845333933830261,
0.01893598772585392,
0.317525029182434... | |
about the speakers. People who have javascript enabled get the AJAXy goodness of the data being loaded dynamically on the same index page and they never have to know about the `viewSpeakers.php` page.
The only downside I can forsee is that someone might come to the `viewSpeakers.php` page via a search listing, and the... | [
0.7703603506088257,
0.09903696179389954,
0.25844812393188477,
0.018795816227793694,
-0.5143078565597534,
-0.10916902124881744,
0.6636790037155151,
0.3477983772754669,
-0.3620147705078125,
-0.23864838480949402,
0.28524696826934814,
0.8699167966842651,
0.025024091824889183,
0.240633860230445... | |
a better way than this.* | [
0.32835668325424194,
-0.003256320022046566,
-0.2816261649131775,
-0.15910081565380096,
-0.1349235326051712,
0.18002286553382874,
0.5166028738021851,
0.06705129891633987,
-0.20547008514404297,
-0.859076976776123,
0.05212849751114845,
-0.06512504816055298,
-0.15246154367923737,
0.14097705483... | |
I just read a post mentioning "full text search" in SQL.
I was just wondering what the difference between FTS and LIKE are. I did read a couple of articles but couldn't find anything that explained it well.
In general, there is a tradeoff between "precision" and "recall". High precision means that fewer irrelevant re... | [
0.4378471076488495,
-0.1725958287715912,
0.30638402700424194,
0.33009108901023865,
-0.1953035593032837,
-0.21174101531505585,
0.37442293763160706,
0.06362582743167877,
-0.25991594791412354,
-0.21313171088695526,
-0.11069083213806152,
0.7091054320335388,
-0.04517463967204094,
-0.00546840718... | |
precision for better recall.
Most full text search implementations use an "inverted index". This is an index where the keys are individual terms, and the associated values are sets of records that contain the term. Full text search is optimized to compute the intersection, union, etc. of these record sets, and usually... | [
-0.06137247383594513,
-0.1310584545135498,
0.5234851837158203,
0.3719208836555481,
-0.2837228775024414,
-0.11324246972799301,
-0.016873782500624657,
-0.2935050427913666,
-0.015011006034910679,
-0.2572048008441925,
-0.044203002005815506,
0.5047613978385925,
-0.18299545347690582,
0.206270709... | |
is indexed, matching can be performed against index keys, but with far less efficiency than most index lookups. In the worst case, the LIKE pattern will have leading wildcards that require every index key to be examined. In contrast, many information retrieval systems can enable support for leading wildcards by pre-com... | [
-0.2898498475551605,
-0.10790031403303146,
0.055135343223810196,
0.6151509284973145,
-0.14391182363033295,
-0.12207674235105515,
0.012264230288565159,
-0.15750877559185028,
-0.16080991923809052,
-0.6147933006286621,
-0.5012525320053101,
0.1408098340034485,
-0.16041159629821777,
0.197927340... | |
of a matching record to
the query string | [
-0.28620266914367676,
0.3786877393722534,
0.10583481192588806,
0.05986086279153824,
0.04766274616122246,
0.0038123554550111294,
-0.29457083344459534,
0.011945756152272224,
-0.0652788057923317,
-0.42219966650009155,
-0.15236832201480865,
0.31602635979652405,
-0.18427075445652008,
0.28317916... | |
I'm after some good tips for fluent interfaces in C#. I'm just learning about it myself but keen to hear what others think outside of the articles I am reading. In particular I'm after:
1. when is fluent too much?
2. are there any fluent patterns?
3. what is in C# that makes fluent interfaces more fluent (e.g. extensi... | [
0.20372411608695984,
0.01380931306630373,
0.2713283896446228,
0.2051108479499817,
-0.18843552470207214,
-0.1119319349527359,
0.3553338348865509,
0.03593648597598076,
-0.2015644758939743,
-0.7798181176185608,
0.1692487597465515,
0.7145493626594543,
-0.11579001694917679,
-0.3552325665950775,... | |
whatever per post. I want to see how they get voted on, too.
Thank you in advance.
On your 4th point;
Yes I think that a complex fluent interface can still be fluent.
I think fluent interfaces are somewhat of a compromise. (although a good one!) There has been much research into using natural language for programmin... | [
0.33617523312568665,
0.11261128634214401,
0.31923818588256836,
0.3800320625305176,
-0.18621326982975006,
0.03305966779589653,
0.44956257939338684,
0.31838077306747437,
0.0399341806769371,
-0.7649975419044495,
0.2060050666332245,
0.875086784362793,
0.036555465310811996,
-0.3870598077774048,... | |
rhino mocks for example the writing part has been complicated compared to a normal library. I took me longer to learn mostly due to the fluent interface but it makes code a lot easier to read. Because programs are usually written once and read a lot more than once this is a good tradeoff.
So to qualify my point a bit.... | [
0.2259596884250641,
0.2209252119064331,
-0.1579788476228714,
0.24623717367649078,
-0.45199692249298096,
0.2041739821434021,
0.26267606019973755,
-0.03740963339805603,
-0.22174504399299622,
-0.3301950693130493,
0.6908676028251648,
0.9943000078201294,
0.005621986463665962,
-0.196289867162704... | |
I'm having trouble with a custom tag:-
org.apache.jasper.JasperException: /custom\_tags.jsp(1,0) Unable to find setter method for attribute : firstname
This is my TagHandler class:
```
package com.cg.tags;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.Tag... | [
0.10327102243900299,
-0.10098530352115631,
0.6492319107055664,
-0.16994845867156982,
0.049189697951078415,
-0.15054857730865479,
0.4879615604877472,
-0.5750482678413391,
0.09927454590797424,
-0.6455697417259216,
-0.08036237955093384,
0.5993859171867371,
-0.4633568823337555,
0.1653106808662... | |
try {
JspWriter out=pageContext.getOut();
out.println( "First name: "+firstname+ "Last name: "+lastname);
} catch (Exception ex) {
throw new JspException("IO problems");
}
return SKIP_BODY;
}
}
```
This is my TLD file:
```
?xml version="1.0" encoding... | [
-0.02311878837645054,
-0.19762271642684937,
0.6069634556770325,
-0.411626398563385,
0.16128480434417725,
-0.07508765906095505,
0.40453314781188965,
-0.3312017023563385,
-0.009634410962462425,
-0.7401669025421143,
-0.25356894731521606,
0.3819020092487335,
-0.5782371759414673,
-0.18756750226... | |
<jspversion>1.1</jspversion>
<shortname>utility</shortname>
<uri>/WEB-INF/nametagdesc.tld</uri>
<info>
A simple tag library for the examples
</info>
<tag>
<name>name</name>
<tagclass>com.cg.tags.NameTag</tagclass>
<bodycontent>empty</bodycontent>
<attribute>
... | [
-0.06328444927930832,
-0.24041110277175903,
0.3746110498905182,
-0.051624495536088943,
-0.43897104263305664,
-0.15167498588562012,
0.01269802637398243,
-0.49147817492485046,
-0.14228083193302155,
-0.6400750875473022,
-0.08197254687547684,
0.33911189436912537,
-0.2760583162307739,
-0.437760... | |
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
</taglib>
```
And this is my JSP page:
```
<%@ taglib uri="/WEB-INF/nametagdesc.tld" prefix="cg" %>
<cg:name firstname="fname" lastname="lname"/>
```
I have checked that the code is recompiled and deployed correctly etc etc.... | [
-0.036514610052108765,
0.01053712796419859,
0.6419576406478882,
-0.19799518585205078,
-0.09213987737894058,
-0.3816699981689453,
0.12392384558916092,
-0.43371638655662537,
0.18261490762233734,
-0.40261930227279663,
-0.41159409284591675,
0.6952535510063171,
-0.24796433746814728,
-0.27171555... | |
is prefixed by 'set', to arrive at the setter name.
In your case, you've called the attribute `'firstname'`, so the rule results in the the JSP compiler looking for the 'setFirstname' method. As you've named your setter `'setFirstName'` (with a capital 'N'), you should use `'firstName'` (Also with a capital 'N') for t... | [
-0.014487523585557938,
0.08015243709087372,
0.3720433712005615,
-0.09167636185884476,
0.12027108669281006,
-0.3954584300518036,
-0.11772561073303223,
0.01494482159614563,
-0.038876015692949295,
-0.3947999179363251,
-0.4129445254802704,
0.5145488977432251,
-0.17545954883098602,
0.0112086804... | |
scratching. | [
0.29435452818870544,
0.6594507098197937,
-0.2463259994983673,
-0.010138504207134247,
-0.09362349659204483,
-0.24083884060382843,
-0.018418900668621063,
0.3019813001155853,
-0.15898993611335754,
-0.7814191579818726,
-0.31638363003730774,
0.4864889681339264,
-0.32824423909187317,
0.241299301... | |
I'm trying to figure out how to pass arguments to an anonymous function in JavaScript.
Check out this sample code and I think you will see what I mean:
```
<input type="button" value="Click me" id="myButton" />
<script type="text/javascript">
var myButton = document.getElementById("myButton");
var myMessage ... | [
0.09504391998052597,
0.016481168568134308,
0.5154755115509033,
-0.29523786902427673,
0.1317100077867508,
-0.08452360332012177,
0.38170430064201355,
-0.14192728698253632,
-0.16275298595428467,
-0.6238977313041687,
-0.2069510966539383,
0.6524048447608948,
-0.5139526128768921,
-0.260367304086... | |
working:
```
<script type="text/javascript">
var myButton = document.getElementById("myButton");
var myMessage = "it's working";
myButton.onclick = function() { alert(myMessage); };
</script>
```
This example will work because the anonymous function created and assigned as a handler to element will have access... | [
0.053680382668972015,
-0.1799032986164093,
0.4500439763069153,
-0.40225011110305786,
0.0438171923160553,
-0.09401596337556839,
0.36020317673683167,
-0.5357369184494019,
-0.2033456563949585,
-0.48692166805267334,
-0.36527925729751587,
0.8440821766853333,
-0.4114856719970703,
-0.260561943054... | |
What is the best way to find out whether two number ranges intersect?
My number range is **3023-7430**, now I want to test which of the following number ranges intersect with it: <3000, 3000-6000, 6000-8000, 8000-10000, >10000. The answer should be **3000-6000** and **6000-8000**.
What's the nice, efficient mathemati... | [
0.12973585724830627,
-0.018900934606790543,
0.6522778868675232,
0.03517550230026245,
0.29086291790008545,
0.11086913198232651,
0.4714934527873993,
-0.26193767786026,
0.03836510702967644,
-0.6329707503318787,
0.17327629029750824,
0.4725145101547241,
-0.02254769764840603,
0.14580972492694855... | |
above our range
results.add(rangeToTest);
done
return results;
}
``` | [
0.514155387878418,
0.25283196568489075,
0.521220862865448,
-0.32991403341293335,
0.2172221541404724,
-0.08048856258392334,
0.585332989692688,
-0.4793115556240082,
0.3425939679145813,
-0.4643098711967468,
-0.1138608306646347,
0.9402317404747009,
-0.08276591449975967,
0.08735853433609009,
... | |
Imagine you're creating a presentation that will be translated into a dozen different languages, including ones with non-latin characters (Chinese, for instance). The client's branding style guide dictates that certain fonts are acceptable for certain languages. The content itself is required to be externalized, so tha... | [
0.2711744010448456,
-0.08024144917726517,
0.2742011249065399,
0.12499172985553741,
0.14090631902217865,
0.05910571664571762,
-0.03524721413850784,
0.30057618021965027,
-0.1906798630952835,
-0.2968897819519043,
-0.3724786341190338,
0.6053985357284546,
-0.26212260127067566,
-0.17076689004898... | |
I'm looking for solutions using **Flash only, not Flex**.
I'm totally disappointed that no-one knew about this - oh well. I finally found someone who'd written a little class to handle the font-loading process, and gave directions on how to create the .swfs for it to load:
[Flash AS3 Loading Fonts](http://www.mokisyst... | [
0.14902359247207642,
0.19495747983455658,
0.21011953055858612,
-0.06727509945631027,
-0.21105587482452393,
0.027968905866146088,
0.455121248960495,
0.08652424812316895,
-0.341555655002594,
-0.49589642882347107,
0.0867183655500412,
0.5147559642791748,
0.043657105416059494,
-0.07991933822631... | |
I have a string (char) and I want to extract numbers out of it.
So I have string: `1 2 3 4 /0`
And now I want some variables, so I can use them as integer: `a=1, a=2, a=3, a=4`
How can I do that?
If the string always contains 4 numbers delimited with spaces, then it could be done with sscanf:
```
sscanf(string, "... | [
-0.03745066374540329,
0.40230727195739746,
0.19511227309703827,
-0.23531460762023926,
-0.08314546942710876,
0.421467125415802,
0.3325475752353668,
-0.2534763216972351,
-0.19981041550636292,
-0.43724963068962097,
0.043961454182863235,
0.4022400379180908,
-0.18325747549533844,
0.172066271305... | |
When debugging in Internet Explorer, I first get an alert box with extremely limited if not useless information (sorry IE) and choose to debug it. After selecting yes, I get another option *every time* to choose between 'New instance of Microsoft script debugger' and 'New instance of Visual Studio'. I'm fed up with hav... | [
0.07059898227453232,
0.10872732102870941,
0.10863170772790909,
-0.16780449450016022,
-0.2734670042991638,
-0.2623714506626129,
0.7719632387161255,
0.27788683772087097,
0.06738650053739548,
-0.9398568272590637,
-0.38741034269332886,
0.7025983929634094,
-0.2175082117319107,
0.164319694042205... | |
on the menu but now I get the dialog box asking me which one to choose and it only displays the Visual Studio - WHY? If there's only one option and you've already asked me if I want to debug, why ask again?!?! Bleh.
Can you tell I'm getting sick of clicking, "yes" twice? Lol.
Apparently the problem happens if you do n... | [
0.548795223236084,
0.22621218860149384,
0.2683074474334717,
0.018135536462068558,
-0.18083497881889343,
0.04161054268479347,
0.08235185593366623,
0.2246759980916977,
-0.260830819606781,
-0.6049548983573914,
0.0026080352254211903,
0.8389265537261963,
-0.16243816912174225,
0.3151584565639496... | |
recall at the moment), if you uninstall the Microsoft Script Debugger at this point, it will mess up the MSE and you will have to reinstall the MSE again. I am on a tight schedule now so I don't have the time to fix the problem properly - just living with it as best as I can. | [
0.3632054328918457,
0.3485046327114105,
0.281546413898468,
0.045634105801582336,
0.1806703507900238,
-0.19231408834457397,
0.4789702892303467,
0.3103058338165283,
0.03059849515557289,
-0.6921245455741882,
-0.15719835460186005,
0.5258004069328308,
-0.07499527186155319,
0.29212167859077454,
... | |
I'm currently looking for a possibility in Java to identify a font as symbolic like OpenOffice does.
Characters with the font Windings or Webdings and so on should be rendered with the correct "pictures".
Anyone an idea how to distinguish between normal fonts and fonts with symbols?
The bug [Java doesn't display all c... | [
0.040337081998586655,
0.24636836349964142,
0.18618717789649963,
0.02365773729979992,
0.022319212555885315,
-0.009538396261632442,
0.3391454219818115,
-0.16267026960849762,
-0.21946117281913757,
-0.8420015573501587,
0.16669712960720062,
0.30227020382881165,
-0.2900788187980652,
-0.084539078... | |
should be loaded through [Property.load()](http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html#load(java.io.InputStream)). | [
0.22286030650138855,
0.0063999732956290245,
0.37205564975738525,
-0.14226587116718292,
0.027727479115128517,
-0.27266809344291687,
0.02496911771595478,
-0.3656007647514343,
-0.19533120095729828,
-0.6317541003227234,
-0.15533633530139923,
0.527305006980896,
-0.1213289424777031,
-0.106462910... | |
Is there a fairly easy way to convert a datetime object into an RFC 1123 (HTTP/1.1) date/time string, i.e. a string with the format
```
Sun, 06 Nov 1994 08:49:37 GMT
```
Using `strftime` does not work, since the strings are locale-dependant. Do I have to build the string by hand?
You can use wsgiref.handlers.format\... | [
-0.04354235529899597,
-0.033903829753398895,
0.6975305080413818,
-0.1827441304922104,
0.0007792958640493453,
-0.1112237200140953,
-0.08593389391899109,
-0.4067986309528351,
-0.2288333624601364,
-0.6493303775787354,
-0.04573461413383484,
0.29782870411872864,
-0.29278334975242615,
0.09094852... | |
datetime
from time import mktime
now = datetime.now()
stamp = mktime(now.timetuple())
print formatdate(
timeval = stamp,
localtime = False,
usegmt = True
) #--> Wed, 22 Oct 2008 10:55:46 GMT
```
If you can set the locale process wide then you can do:
```
import locale, datetime
locale.setloc... | [
0.23181843757629395,
-0.10939619690179825,
0.8955422639846802,
-0.10236053913831711,
-0.008857138454914093,
-0.1706356257200241,
0.010905767790973186,
-0.1472705453634262,
-0.26274701952934265,
-0.5324497222900391,
-0.5332478284835815,
0.49846237897872925,
-0.0002912517811637372,
0.2461100... | |
way to format it which is identical with wsgiref.handlers.format\_date\_time is:
```
def httpdate(dt):
"""Return a string representation of a date according to RFC 1123
(HTTP/1.1).
The supplied date must be in UTC.
"""
weekday = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"][dt.weekday()]
... | [
0.10294298082590103,
-0.22485150396823883,
0.8806046843528748,
-0.200402170419693,
0.038283903151750565,
0.2570830285549164,
0.22839927673339844,
-0.04897712171077728,
-0.011980738490819931,
-0.5416037440299988,
-0.3353198170661926,
0.10315828770399094,
0.1593693047761917,
0.13029319047927... | |
dt.year, dt.hour, dt.minute, dt.second)
``` | [
0.13624736666679382,
0.0822509154677391,
0.30487895011901855,
-0.1692018061876297,
-0.048122525215148926,
0.27367666363716125,
0.039605554193258286,
0.13946908712387085,
-0.300616592168808,
-0.5107309222221375,
-0.27638185024261475,
0.27028873562812805,
0.2646942436695099,
0.44053968787193... | |
I'm starting to look into the whole world of RJS and Prototype/jQuery in Rails and am a little bit confused. There seems to be no clear line of where to use one or the other.
Say I wanted one of the "Active, Hot, Week" tabs like the ones here on SO. When pressing one of them, I want to remove a CSS class (like "active... | [
0.1575116664171219,
-0.23259292542934418,
0.1531483680009842,
0.15947696566581726,
-0.022214388474822044,
-0.00788380391895771,
0.03969797119498253,
0.47018125653266907,
-0.2829638123512268,
-0.5488980412483215,
0.055316295474767685,
0.15866291522979736,
-0.15860241651535034,
0.34728074073... | |
thing would be easiest to do in pure javascript, say put the code in application.js and then updating the div with the content would obviously be easiest in RJS. But what *should* one do?
If you want to give users that ability to link to the generated page directly, then definitly go for a static page. Using AJAX break... | [
0.32880908250808716,
-0.15869899094104767,
0.20936591923236847,
0.21926501393318176,
-0.16344332695007324,
-0.5741000771522522,
0.5737290382385254,
-0.033329859375953674,
-0.22208809852600098,
-0.687379777431488,
-0.15973994135856628,
0.42642202973365784,
-0.1454993486404419,
-0.1768012344... | |
be fine, I think - just have a class change in your RJS file, then you might even find it useful to update the div contents using page.replace and a partial:
```
page.replace(dom_id, :partial => @page_content);
``` | [
0.31950896978378296,
0.047836147248744965,
0.8353798985481262,
-0.08931389451026917,
0.09715352952480316,
-0.24983493983745575,
0.3751005530357361,
-0.13146495819091797,
-0.044629648327827454,
-0.8665311932563782,
-0.2374388426542282,
0.7851004600524902,
-0.26230230927467346,
0.07468398660... | |
Guys, I’ve been writing code for 15+ years, but managed to avoid “Web Development” until 3 months ago.
I have inherited a legacy Asp.net application (started in .net 1.1, we’re now on .Net 2.0), it’s the administration tool for our product.
In several places the admin tool simply maintains long lists of values.
The ... | [
0.6624988317489624,
0.3614271879196167,
0.4335664212703705,
0.01054278202354908,
-0.05138913542032242,
-0.13160340487957,
-0.009436742402613163,
0.023557517677545547,
-0.5054754018783569,
-0.5312123894691467,
0.05207519978284836,
0.3213452994823456,
-0.012635063380002975,
0.068624019622802... | |
values e.g. name and address and preferred colour, breed of cat . . .)
Currently when the user presses “Save” on Page B, we redirect back to Page A. The page opens at the top of the list, this annoys the user as often several items in sequence will need to be configured together, and the user needs to 1. Remember whic... | [
0.5142050981521606,
0.04681014642119408,
0.5926425457000732,
-0.05931661278009415,
0.016888955608010292,
0.10793819278478622,
0.1982206553220749,
-0.08451293408870697,
-0.28136032819747925,
-0.689717173576355,
-0.033915866166353226,
0.3557093143463135,
-0.4014764428138733,
0.25715303421020... | |
together.
**Fastest Gun Stop** . . . and keep reading
1. Suggestions on the lines of “regroup the items so there are fewer in the list” will be considered unhelpful
2. Valid points that .Net 3.5 does this automatically, will be considered unhelpful by me (but post them anyway, it may help some other poor fool)
3. I t... | [
0.48432672023773193,
0.0594429075717926,
0.35414111614227295,
0.07597702741622925,
-0.2533775269985199,
0.05171676352620125,
0.3044043779373169,
-0.4129598140716553,
-0.2511855661869049,
-0.5148895382881165,
0.4033217132091522,
0.5100412964820862,
-0.20702216029167175,
-0.41729697585105896... | |
What is the accepted way of doing this?
Thanks in advance
B. Worrier
This could be achieved using Anchor Tags.
When you output your elements on Page A, set an anchor tag next to each element like follows:
```
<a name="#175"></a>
```
Where this item would be item id 175.
Then when you redirect back to PageA, add a "... | [
0.30182257294654846,
0.07362045347690582,
0.8404224514961243,
-0.06832309812307358,
-0.048905979841947556,
-0.11254260689020157,
-0.06087988615036011,
-0.4224588871002197,
-0.19072923064231873,
-0.41243332624435425,
-0.3216043710708618,
0.2855722904205322,
-0.2070518434047699,
-0.039687130... | |
One of my projects use the MyISAM engine in MySQL, but I'm considering changing it to InnoDB as I need transaction support here and there.
* What should I look at or consider before doing this?
* Can I just change the engine, or should the data be prepared for it?
Yes absolutely, there are many things, you should test... | [
-0.03978349640965462,
0.06811497360467911,
0.2951495051383972,
0.1632428765296936,
0.028494728729128838,
-0.09905096888542175,
0.07249082624912262,
0.14307118952274323,
-0.38765454292297363,
-0.7564621567726135,
0.22862078249454498,
0.8894588351249695,
-0.27073782682418823,
-0.083659619092... | |
Behaviour of indexing will change because InnoDB uses clustered indexes - this may be a beneficial effect in some cases
* Your backup strategy will be impacted. Consider this carefully.
The migration process itself will need to be carefully planned, as it will take a long time if you have a lot of data (during which t... | [
-0.10856195539236069,
-0.02174530178308487,
0.3618561923503876,
0.13082672655582428,
0.2748560905456543,
-0.33482062816619873,
0.33497652411460876,
-0.01939273439347744,
-0.43389564752578735,
-0.6939311027526855,
-0.2560845911502838,
0.32937267422676086,
-0.4535250663757324,
-0.01092368271... | |
I recently upgraded a c# windows service to run as a 64 bit .net process. Normally, this would be trivial, but the system makes use of a 32-bit DLL written in C++. It is not an option to convert this DLL to 64 bit, so I wrapped the DLL in a separate 32 bit .net process and exposed a .net interface via remoting.
This i... | [
0.14662759006023407,
0.06501267105340958,
0.36106693744659424,
0.06864418089389801,
-0.07658355683088303,
-0.031237147748470306,
0.23262549936771393,
-0.005975883919745684,
-0.20767393708229065,
-0.705314040184021,
-0.18141232430934906,
0.5512944459915161,
-0.4252496659755707,
0.3518773019... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.