text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
this.lastFlashingItems.Add(rect);
g.FillRectangle((actualIndex == selectedIndex ? selectedColor : Brushes.Khaki), rect);
g.DrawRectangle(Pens.DarkKhaki, rect);
if (actualIndex == selectedIndex)
{ | [
0.1898079812526703,
-0.5857871174812317,
0.35309576988220215,
0.016038183122873306,
0.13965186476707458,
0.3898116946220398,
-0.005557810887694359,
-0.5370733737945557,
0.08250325918197632,
-0.5165761113166809,
-0.12443921715021133,
0.321827232837677,
-0.37212154269218445,
0.25896680355072... | |
lastRectangle = rect;
}
itemText = this.GetItemText(actualIndex);
if (PaintItemLabels && !string.IsNullOrEmpty(itemText)) | [
-0.08378720283508301,
-0.5951568484306335,
0.6878697872161865,
-0.2910178303718567,
0.3088776767253876,
0.3400161564350128,
0.5550509095191956,
-0.1952727884054184,
-0.12116105109453201,
-0.5151285529136658,
-0.2728952169418335,
0.7338583469390869,
-0.31306716799736023,
-0.1972670555114746... | |
{
// Draw Text next to each notch
sizeItemText = g.MeasureString(itemText, this.Font);
int xxx = size.X + size.Width - 10 - Convert.ToInt32(sizeItemText.Width); | [
-0.22986651957035065,
-0.04920189082622528,
0.6803439855575562,
-0.2598331570625305,
-0.01211467944085598,
0.6091545820236206,
0.34805426001548767,
-0.5692214965820312,
0.15281425416469574,
-0.65031898021698,
-0.19467207789421082,
0.5680342316627502,
-0.10792887955904007,
-0.13228900730609... | |
rectItemText = new Rectangle(xxx, yy, Convert.ToInt32(sizeItemText.Width), Convert.ToInt32(sizeItemText.Height));
PaintHotspot(g, Color.White, rectItemText, 200);
g.DrawString(itemText, this.Font, Brushes.Black, (float)xxx, (float)yy);
} | [
-0.016364211216568947,
-0.38038501143455505,
0.7860334515571594,
-0.25229474902153015,
-0.20377497375011444,
0.48353853821754456,
0.2290353924036026,
-0.7026495933532715,
-0.053375955671072006,
-0.6877543926239014,
-0.27961498498916626,
0.7129533886909485,
-0.24345840513706207,
0.053673133... | |
actualIndex++;
}
}
else
{
lastHeight = size.Height; | [
0.27398088574409485,
-0.5081599354743958,
0.6742856502532959,
-0.006002080626785755,
0.03361644595861435,
0.16619811952114105,
0.45519009232521057,
-0.013811131939291954,
-0.11646527051925659,
-0.3271993100643158,
0.26149097084999084,
0.6506847143173218,
0.22444741427898407,
0.065648868680... | |
for (int i = 0; i < lastFlashingItems.Count; i++)
{
g.FillRectangle((i == selectedIndex ? selectedColor : Brushes.Khaki), lastFlashingItems[i]);
g.DrawRectangle(Pens.DarkKhaki, lastFlashingItems[i]);
if (i == selectedIndex) | [
0.17744164168834686,
-0.5249379873275757,
0.31677576899528503,
-0.15962587296962738,
0.13498786091804504,
0.5353922247886658,
0.1561640501022339,
-0.7849182486534119,
0.1322976052761078,
-0.5897050499916077,
-0.1627511829137802,
0.20350655913352966,
-0.4660507142543793,
0.2954728305339813,... | |
{
lastRectangle = lastFlashingItems[i];
}
}
if (PaintItemLabels) | [
-0.1739952713251114,
-0.618718147277832,
0.38852277398109436,
-0.5167644619941711,
0.2369556725025177,
0.1833287924528122,
0.4804058074951172,
-0.10619208961725235,
-0.14323291182518005,
-0.7052853107452393,
-0.3420431911945343,
0.6236560344696045,
-0.34567585587501526,
-0.0416293963789939... | |
{
int actualIndex = 0;
for (int i = 0; i < countItemsLeft; i++)
{ | [
0.12863771617412567,
-0.3562885522842407,
0.6631163954734802,
-0.009512543678283691,
0.1322319656610489,
0.15279267728328705,
0.4043964743614197,
-0.3864590525627136,
0.1595195084810257,
-0.15537025034427643,
0.1615799367427826,
0.8070594668388367,
-0.10843455791473389,
0.03482446447014809... | |
itemText = this.GetItemText(actualIndex);
if (!string.IsNullOrEmpty(itemText))
{
int yy = size.Y + (tmpHeight * i) + (int)topOffset; | [
-0.07028752565383911,
-0.4083940386772156,
0.6511451005935669,
-0.046594154089689255,
0.17439007759094238,
0.22334720194339752,
0.40435850620269775,
-0.24751977622509003,
-0.23128961026668549,
-0.2154984325170517,
-0.4898233115673065,
0.6072180867195129,
-0.34209591150283813,
0.07955020666... | |
// Draw Text next to each notch
sizeItemText = g.MeasureString(itemText, this.Font);
int xxx = size.X + 10; | [
-0.08225567638874054,
0.019909102469682693,
0.5320959687232971,
-0.18359404802322388,
-0.07263502478599548,
0.4828591048717499,
0.2808244526386261,
-0.4602341651916504,
0.15543414652347565,
-0.5901523232460022,
-0.2746807634830475,
0.3729873597621918,
-0.13910427689552307,
-0.3081892728805... | |
rectItemText = new Rectangle(xxx, yy, Convert.ToInt32(sizeItemText.Width), Convert.ToInt32(sizeItemText.Height));
PaintHotspot(g, Color.White, rectItemText, 200);
g.DrawString(itemText, this.Font, Brushes.Black, (float)xxx, (float)yy); | [
-0.013511037454009056,
-0.3466351330280304,
0.8514319658279419,
-0.19542044401168823,
-0.322456419467926,
0.5081006288528442,
0.12327012419700623,
-0.7259343862533569,
-0.030041083693504333,
-0.723635196685791,
-0.3212573528289795,
0.6303499937057495,
-0.2190912812948227,
0.016176708042621... | |
}
actualIndex++;
}
tmpHeight = (size.Height - (int)topOffset - (int)bottomOffset) / countItemsRight; | [
0.3095284402370453,
-0.4327993094921112,
0.561318039894104,
-0.021516617387533188,
0.22323119640350342,
0.02791866846382618,
0.36939945816993713,
-0.212102010846138,
-0.1253143697977066,
-0.025071658194065094,
0.0929386168718338,
0.7892594337463379,
-0.04666523262858391,
-0.047261081635951... | |
for (int i = 0; i < countItemsRight; i++)
{
itemText = this.GetItemText(actualIndex);
if (!string.IsNullOrEmpty(itemText)) | [
-0.14707252383232117,
-0.4433068335056305,
0.7106903195381165,
-0.08146397024393082,
0.21632252633571625,
0.15857471525669098,
0.41463398933410645,
-0.3958072066307068,
-0.10702455043792725,
-0.2465534806251526,
-0.20644496381282806,
0.6568871140480042,
-0.2956649959087372,
0.0801195427775... | |
{
int yy = size.Y + (tmpHeight * i) + (int)topOffset;
// Draw Text next to each notch | [
-0.04833338409662247,
-0.04923991113901138,
0.6626765727996826,
-0.067304827272892,
0.27121058106422424,
0.4282843768596649,
0.4155355393886566,
-0.38546833395957947,
0.07891615480184555,
-0.31287339329719543,
-0.20090876519680023,
0.7074834108352661,
-0.0020851735025644302,
0.024559138342... | |
sizeItemText = g.MeasureString(itemText, this.Font);
int xxx = size.X + size.Width - 10 - Convert.ToInt32(sizeItemText.Width);
rectItemText = new Rectangle(xxx, yy, Convert.ToInt32(sizeItemText.Width), Convert.ToInt32(sizeItemText.Height)); | [
-0.07912471890449524,
-0.225968137383461,
0.7651637196540833,
-0.18804746866226196,
-0.3737114667892456,
0.39117342233657837,
0.19859153032302856,
-0.6045014262199402,
-0.1353302150964737,
-0.751177966594696,
-0.4943055808544159,
0.3246297836303711,
-0.26361268758773804,
0.1039548665285110... | |
PaintHotspot(g, Color.White, rectItemText, 200);
g.DrawString(itemText, this.Font, Brushes.Black, (float)xxx, (float)yy);
}
actualIndex++; | [
0.015517772175371647,
-0.3088719844818115,
0.7515466213226318,
-0.2072915881872177,
-0.2574661076068878,
0.4647756516933441,
0.15682700276374817,
-0.260481595993042,
0.1810954362154007,
-0.4037989675998688,
-0.05571794882416725,
0.9065849184989929,
-0.3989975154399872,
-0.14774374663829803... | |
}
}
}
// Calling the base class OnPaint
base.OnPaint(pe);
if (this.isRecording)
{ | [
0.10368010401725769,
-0.3337249159812927,
-0.14890535175800323,
-0.23556940257549286,
0.3643457293510437,
0.04610518366098404,
0.21400335431098938,
-0.2578691244125366,
0.3630445897579193,
-0.7218251824378967,
-0.23025637865066528,
0.6350473165512085,
-0.14839568734169006,
-0.0977213680744... | |
for (int i = 0; i < this.recordedRectangles.Count; i++)
{
rect = recordedRectangles[i];
double ratio = (double)size.Height / (double)imageFile.Height; | [
0.49510353803634644,
-0.4685823917388916,
0.6740787029266357,
-0.08669084310531616,
0.1796727329492569,
0.46278437972068787,
0.1557963788509369,
-0.5216418504714966,
-0.4722830653190613,
-0.44214120507240295,
-0.03721560910344124,
0.6034895777702332,
-0.16217559576034546,
-0.03719712793827... | |
Rectangle adjustedRectange = new Rectangle(
size.Left + (int)(rect.X * ratio),
size.Top + (int)(rect.Y * ratio),
(int)(rect.Width * ratio), | [
0.010856729932129383,
-0.3615258038043976,
1.0224319696426392,
-0.06550028175115585,
-0.2186555713415146,
0.3539692759513855,
-0.21484756469726562,
-0.5954565405845642,
-0.3651594817638397,
-0.8572969436645508,
-0.12234196066856384,
0.23279662430286407,
-0.3182961046695709,
0.2565132677555... | |
(int)(rect.Height * ratio));
PaintHotspot(g, Color.LightBlue, adjustedRectange, (i + 1).ToString());
}
}
else if (this.paintHotSpots)
{ | [
-0.010017883032560349,
-0.2949163019657135,
0.7420779466629028,
-0.4353301227092743,
0.14670918881893158,
0.25915127992630005,
0.23542173206806183,
-0.5609540343284607,
-0.04285585135221481,
-0.6710314750671387,
-0.3034172058105469,
0.8714048266410828,
-0.33751893043518066,
-0.174495264887... | |
for (int i = 0; i < hotspots.Count; i++)
{
Rectangle hotspot = hotspots[i];
double ratio = (double)size.Height / (double)imageFile.Height; | [
0.5569037199020386,
-0.37365707755088806,
0.6678623557090759,
-0.11215414851903915,
-0.004910859279334545,
0.30501851439476013,
0.049908481538295746,
-0.5771811604499817,
-0.21013683080673218,
-0.48823848366737366,
-0.2311869114637375,
0.6198461055755615,
-0.49886804819107056,
-0.179104939... | |
Rectangle adjustedRectange = new Rectangle(
size.Left + (int)(hotspot.X * ratio),
size.Top + (int)(hotspot.Y * ratio),
(int)(hotspot.Width * ratio), | [
0.0647515058517456,
-0.438539057970047,
0.9830896854400635,
0.08936615288257599,
-0.13324381411075592,
0.25015780329704285,
-0.17760024964809418,
-0.522026538848877,
-0.3936571776866913,
-0.7444737553596497,
-0.20582003891468048,
0.20456014573574066,
-0.4607658088207245,
0.1581066995859146... | |
(int)(hotspot.Height * ratio));
PaintHotspot(g, Color.LightGreen, adjustedRectange, (i + 1).ToString());
}
}
}
protected virtual void PaintHotspot(Graphics g, Color c, Rectangle hotspot, int alpha) | [
-0.0651525929570198,
-0.15839768946170807,
0.500824511051178,
-0.2850300073623657,
0.06944499164819717,
0.3857695460319519,
0.13910405337810516,
-0.3263099193572998,
0.017743660137057304,
-0.6751213669776917,
-0.40918853878974915,
0.7209499478340149,
-0.562771201133728,
-0.0909470990300178... | |
{
PaintHotspot(g, c, hotspot, alpha, null);
}
protected virtual void PaintHotspot(Graphics g, Color c, Rectangle hotspot, string txt)
{
PaintHotspot(g, c, hotspot, 100, txt);
}
protected virtual void PaintHotspot(Graphics g, Color c, Rectangle hotspot, i... | [
-0.25128185749053955,
-0.02188185416162014,
0.07164569199085236,
-0.10712258517742157,
-0.025537874549627304,
0.4871557056903839,
0.14774107933044434,
0.10750723630189896,
0.05299650877714157,
-0.6339421272277832,
-0.4275611340999603,
0.8803113698959351,
-0.6764147877693176,
-0.21641726791... | |
{
SolidBrush brush = new SolidBrush(Color.FromArgb(alpha, c));
g.FillRectangle(brush, hotspot);
if (!string.IsNullOrEmpty(txt))
g.DrawString(txt, this.Font, Brushes.DarkGreen, hotspot.Location);
}
}
}
```
**Update**
I imagine the following line is causin... | [
0.2261624038219452,
-0.1083080992102623,
0.7046687602996826,
0.1543157696723938,
0.1525593250989914,
0.024162648245692253,
0.2820519208908081,
-0.46920451521873474,
-0.02431749738752842,
-0.5714209675788879,
-0.15966007113456726,
0.5943160653114319,
-0.288900226354599,
0.3126542866230011,
... | |
in the default resource file of the EducationalSuite.Core assembly. First confirm that you are currently editing the said assembly by opening Project Properties and checking the Default Namespace on the Application page. This should state "EducationalSuite.Core". If this isn't the case, you are most likely missing a re... | [
0.7027062773704529,
-0.12772685289382935,
0.143643319606781,
0.4797199070453644,
-0.08137421309947968,
-0.19837437570095062,
0.03578717261552811,
0.0925644263625145,
-0.07873957604169846,
-0.9728620052337646,
-0.07542143017053604,
0.49089309573173523,
0.0019159468356519938,
-0.039211872965... | |
have the file already or if you need to create it. Name the resource "singlepixel".
Visual Studio will generate Resources helper class under Properties namespace for you so you can access the resource through the Properties.Resources.singlepixel under EducationalSuite.Core in your code.
**Old answer**
In general Pro... | [
0.6767451763153076,
-0.03884485363960266,
0.08000291138887405,
0.4313056468963623,
0.02885926142334938,
-0.054755695164203644,
0.0664135292172432,
0.04753343015909195,
-0.4223191738128662,
-0.8560690879821777,
-0.10274667292833328,
0.24919000267982483,
0.11923691630363464,
0.14162033796310... | |
error message the IDE will take you to the line which is causing the error.
Most likely the piece of code is expecting a setting variable which is not added to the project. | [
0.5399759411811829,
-0.22329474985599518,
0.17500242590904236,
0.18866969645023346,
-0.12874974310398102,
-0.04818828031420708,
0.2756379246711731,
0.11053571105003357,
0.05003457888960838,
-0.5900833606719971,
-0.056364018470048904,
0.45397910475730896,
-0.4059743285179138,
-0.04092939198... | |
I'm trying to build an interface between iTunes and MediaMonkeys. When I imported my tracks from iTunes to MM, the field LastPlayed wasn't considered.
So I decided to build an interface that reads the value from iTunes and updates the MM database.
I'm using the package from phxsoftware in order to access the SQLite d... | [
0.34008440375328064,
-0.020932964980602264,
0.4820408523082733,
-0.03038806840777397,
-0.09372922778129578,
-0.01972917839884758,
0.05556025356054306,
-0.1106235459446907,
-0.2657678425312042,
-0.8383859395980835,
0.16136246919631958,
0.5215047597885132,
-0.5957208871841431,
0.365671992301... | |
SQLite is not using Single (single precision 32-bit) it's actually using doubles (64 bit).
2. According to <http://www.mediamonkey.com/wiki/index.php/ISDBSongData::LastPlayed> you need to do following:
LastPlayed.Subtract(new DateTime(1899, 12, 30, 0, 0, 0, DateTimeKind.Utc)).TotalDays;
It's actually better to move t... | [
0.12245623022317886,
-0.15601828694343567,
0.6461336016654968,
-0.021371325477957726,
-0.1524067372083664,
-0.09847397357225418,
0.011609083041548729,
-0.11767438799142838,
-0.47750386595726013,
-0.4505995512008667,
0.33376747369766235,
0.05102047696709633,
-0.15152379870414734,
0.35429701... | |
I am trying to get version information from a file. My code works perfectly for me, but fails on several others' machines. Because I can't reproduce the bug, I'm having quite a time finding the issue.
Does anyone see anything majorly wrong with this?
```
LPBYTE versionInformationBlock;
struct LANGANDCODEPAGE {
WO... | [
0.42876291275024414,
0.045821718871593475,
0.615216851234436,
-0.22337505221366882,
0.07844454795122147,
-0.11969277262687683,
0.7326326966285706,
-0.13225819170475006,
-0.08905864506959915,
-0.7210036516189575,
-0.19289171695709229,
0.5300720930099487,
-0.4158274233341217,
0.3626085519790... | |
disable64.enableFS();
return;
}
versionInformationBlock = new BYTE[lengthOfVersionData];
GetFileVersionInfo(getFileName().c_str(),zero,lengthOfVersionData,versionInformationBlock);
VerQueryValue(versionInformationBlock,L"\\VarFileInfo\\Translation",(LPVOID*)&langBlockPointer,&translationsCount);... | [
-0.012687045149505138,
-0.2047809362411499,
0.6968837976455688,
-0.3340495526790619,
0.23854100704193115,
0.10670950263738632,
0.44518887996673584,
-0.3333142101764679,
-0.07260064780712128,
-0.5024600028991699,
-0.7241186499595642,
0.7153592109680176,
-0.6195780634880066,
0.10732442140579... | |
wchar_t hexLanguage[26] = L"\\StringFileInfo\\ \\";
for( size_t idx = 0; idx < translationsCount; idx++ )
{
hexLanguage[16] = *(hexChars + ((langBlockPointer[idx].wLanguage >> 12) & 0x0F));
hexLanguage[17] = *(hexChars + ((langBlockPointer[idx].wLanguage >> 8 ) & 0x0F));
hexLangua... | [
0.12270680069923401,
-0.01534396130591631,
1.240298867225647,
-0.18681274354457855,
0.0511784553527832,
-0.014319716021418571,
0.36123543977737427,
-0.9851173758506775,
-0.06400109827518463,
-0.372417688369751,
-0.22121000289916992,
0.6320886015892029,
-0.5164753198623657,
0.01779796555638... | |
& 0x0F));
hexLanguage[20] = *(hexChars + ((langBlockPointer[idx].wCodePage >> 12) & 0x0F));
hexLanguage[21] = *(hexChars + ((langBlockPointer[idx].wCodePage >> 8 ) & 0x0F));
hexLanguage[22] = *(hexChars + ((langBlockPointer[idx].wCodePage >> 4 ) & 0x0F));
hexLanguage[23] = *(hexChars + (... | [
-0.2989945411682129,
-0.05127384141087532,
0.9014140367507935,
-0.4249827265739441,
-0.08901556581258774,
0.14421296119689941,
0.2495739609003067,
-0.706369936466217,
-0.37587031722068787,
-0.6499467492103577,
-0.5450483560562134,
0.28475064039230347,
-0.4436860680580139,
-0.17553173005580... | |
(!VerQueryValue(versionInformationBlock,targetResource.c_str(),(LPVOID *)&retString,&retStringLength))
{
return std::wstring(L"!DOESN'T APPER TO EXIST IN FILE! ERROR: ").append(boost::lexical_cast<std::wstring>(GetLastError()));
}
retStringLength--;
if (!result.empty())
... | [
-0.3845040798187256,
-0.12865884602069855,
0.6382002830505371,
-0.4128781259059906,
0.3548438847064972,
0.30059364438056946,
0.45862877368927,
-0.356531023979187,
-0.07540152966976166,
-0.44099271297454834,
-0.6457467675209045,
0.9387648701667786,
-0.2292042225599289,
0.020601028576493263,... | |
result.append(toAppend);
}
return result;
}
std::wstring fileData::getVerCompany()
{
return getVersionInformationString(L"CompanyName");
}
~fileData()
{
if (versionInformationBlock)
delete [] versionInformationBlock;
};
```
What's really bugging me is that it isn't throwing any of my error mes... | [
0.15737435221672058,
-0.18973089754581451,
0.4088623523712158,
-0.16362129151821136,
-0.10118293017148972,
-0.10524821281433105,
0.6493120193481445,
-0.32365748286247253,
-0.12165579944849014,
-0.22894421219825745,
-0.17192217707633972,
0.5232239365577698,
-0.3755142092704773,
0.2031206190... | |
The INSERT syntax I've been using is this
```
INSERT INTO TableName VALUES (...)
```
The UPDATE syntax I've been using is
```
UPDATE TableName SET ColumnName=Value WHERE ...
```
So in all my code, I have to generate 2 strings, which would result in something like this
```
insertStr = "(27, 'John Brown', 102)";
u... | [
-0.23634657263755798,
0.49476566910743713,
0.44680914282798767,
-0.3503507673740387,
-0.11842691898345947,
0.2554076910018921,
-0.0072151487693190575,
-0.18715040385723114,
-0.18472561240196228,
-0.6723710894584656,
-0.09295044839382172,
0.7670451402664185,
-0.633354902267456,
-0.218707814... | |
using insertStr above on UPDATE statement or updateStr on INSERT statement, or a whole new way?
Some DBMS' have an extension to do this but why don't you just provide a function to do it for you? We've actually done this before.
I'm not sure what language you're using but it's probably got associative arrays where you... | [
-0.06930258125066757,
0.06352455914020538,
0.3396531343460083,
0.03363804519176483,
0.036888644099235535,
0.09941822290420532,
0.05941126123070717,
-0.22221189737319946,
-0.1066049262881279,
-0.6265251636505127,
-0.17554284632205963,
0.7646756172180176,
-0.6412645578384399,
-0.067823886871... | |
`update` failed) and passed it to our DBMS. We kept the primary keys separate from our other fields since that made construction of the update statement a lot easier (primary key columns went in the where clause, other columns were just set).
The result of the calls above would result in the following SQL (we had a di... | [
-0.09226465225219727,
0.2903471291065216,
0.5215411186218262,
-0.18547466397285461,
0.1988152265548706,
0.16170315444469452,
0.024775777012109756,
-0.23696132004261017,
-0.06494073569774628,
-0.5844806432723999,
-0.1508406549692154,
0.6938955187797546,
-0.3026524484157562,
0.26487541198730... | |
Name, ItemID) values (
27,
'John Brown',
102
)
```
That's one solution which worked well for us. No doubt there are others. | [
-0.018293896690011024,
0.23522423207759857,
0.32057225704193115,
0.29539254307746887,
0.022168267518281937,
0.44150689244270325,
-0.04147442430257797,
-0.279369056224823,
-0.29983407258987427,
-0.4422643184661865,
-0.0693439394235611,
0.5690035223960876,
-0.157045379281044,
0.1623029261827... | |
I have a PHP file that spits out a form. I want to call this PHP file server-side, (currently using "include"), fill it in, and submit it.
This is better so I don't have to meddle around with the actual form PHP, just deal with the presentation layer so the data gets understood by its own PHP file.
Is this possible? ... | [
0.8307260274887085,
0.09181345999240875,
0.04674627631902695,
0.025714490562677383,
-0.3258475065231323,
-0.3001565635204315,
0.0992775708436966,
-0.08809022605419159,
-0.028696998953819275,
-0.4977050721645355,
0.15631872415542603,
0.28348416090011597,
-0.24021485447883606,
0.018719989806... | |
a POST request. PHP has a popular library called CURL to do this.
Try something like this:
```
$ch = curl_init('http://www.example.com/yourform.php');
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'var1=value1&var2=value2&whatever=stuff');
curl_setopt($ch... | [
0.16353678703308105,
-0.10381657630205154,
0.7706770300865173,
0.07628489285707474,
-0.46751099824905396,
0.03010772541165352,
0.1502837836742401,
-0.13479183614253998,
0.05222814902663231,
-0.5869356393814087,
-0.507628321647644,
-0.15215840935707092,
-0.6459009647369385,
0.14425468444824... | |
OK here is my problem. I have a linked list of card objects.
I have the following method
```
public void removeCard(Card card){
cards.remove(card);
}
```
if I create Card c = new Card(5,C); for example
and there is a card with the exact same values 2, and C in the linked list (cards).
If I call the m... | [
0.04015990346670151,
0.1669635772705078,
0.4243091940879822,
-0.24324224889278412,
0.07138551771640778,
-0.37511739134788513,
0.03795938938856125,
-0.5925045013427734,
-0.3982013761997223,
-0.5258761048316956,
-0.06436587125062943,
0.5466914772987366,
-0.4060992896556854,
0.094912543892860... | |
final char [] rank = {'A','2','3','4','5','6','7','8','9','T','J','Q','K'};
LinkedList<Card> cards;
public CardPile(){
cards = new LinkedList<Card>();
}
public void addCard(Card card){
cards.addLast(card);
}
public void removeCard(Card card){
cards.remove(c... | [
-0.3822384476661682,
-0.26754599809646606,
0.6035491228103638,
-0.10880572348833084,
0.0967639610171318,
0.3777868151664734,
-0.16340096294879913,
-0.3990364968776703,
-0.19562871754169464,
-0.32326453924179077,
-0.3348095118999481,
0.11416309326887131,
0.07569991052150726,
0.1761092692613... | |
LinkedList<Card> temp = new LinkedList<Card>();
for(int i=0; i<cards.size(); i++){
if(cards.get(i).equals(card)){
temp.add(cards.get(i));
} | [
-0.08222200721502304,
-0.4714456796646118,
0.8643201589584351,
-0.09389889240264893,
0.06312825530767441,
-0.011860713362693787,
-0.06523578613996506,
-0.5999889373779297,
-0.4345204830169678,
-0.6908360123634338,
-0.24412284791469574,
0.3414034843444824,
-0.45104867219924927,
-0.080815330... | |
}
cards = temp;
}
public void listCards(){
for(int i=0; i<cards.size(); i++){
System.out.print(cards.get(i).toString()+" ");
}
System.out.println();
}
public boolean isEmpty(){ | [
0.011242948472499847,
-0.4795544147491455,
0.5869412422180176,
0.019776085391640663,
0.14965564012527466,
0.025777310132980347,
-0.12969189882278442,
-0.6551324725151062,
-0.6445236206054688,
-0.38794276118278503,
-0.2867714762687683,
0.21075209975242615,
-0.28747397661209106,
0.0825250446... | |
if(cards.size()==0)
return true;
else
return false;
}
public Card drawCard(){
return cards.removeLast();
}
public boolean hasCard(Card card){ | [
0.026150381192564964,
-0.3671680986881256,
0.5599055886268616,
-0.1655077040195465,
0.19867655634880066,
-0.3948422074317932,
-0.18541152775287628,
-0.5242787003517151,
-0.45515918731689453,
-0.5792710185050964,
-0.22954894602298737,
0.27377066016197205,
-0.17234613001346588,
0.21641518175... | |
int index = 0;
boolean contained = false;
if(cards.size()==0){
System.out.println("error, cards size is 0");
return false;
} | [
-0.17936010658740997,
-0.18704377114772797,
0.41783905029296875,
-0.1639852225780487,
0.2255062460899353,
-0.03061383031308651,
0.11257398873567581,
-0.5581624507904053,
-0.4839130938053131,
-0.29513317346572876,
-0.26121923327445984,
0.35602420568466187,
-0.2582544684410095,
0.08601147681... | |
else{
while(index<cards.size() && !contained){
if(cards.get(index).isEqual(card)){
System.out.println("Card found"); | [
-0.12443950772285461,
-0.2063971608877182,
0.3784591555595398,
-0.12925727665424347,
0.4139830470085144,
-0.23440802097320557,
-0.06944756209850311,
-0.5715354681015015,
-0.1815670281648636,
-0.44647565484046936,
-0.32499802112579346,
0.5144834518432617,
-0.0761440247297287,
0.037617333233... | |
contained=true;
}
index++; | [
0.1480357050895691,
0.04463963210582733,
-0.032732412219047546,
-0.17902356386184692,
-0.106892429292202,
-0.5362746119499207,
0.5375475287437439,
-0.29162493348121643,
0.22880910336971283,
-0.039931051433086395,
-0.44053345918655396,
0.48725762963294983,
-0.5078718066215515,
0.43371826410... | |
}
}
return contained;
}
}
```
Probably they are not equal then.
Check the equals() method on Card. | [
-0.012076027691364288,
0.27464380860328674,
0.2955580949783325,
-0.08638010174036026,
0.15117894113063812,
-0.4494224786758423,
-0.20294484496116638,
-0.30123597383499146,
0.05132981017231941,
-0.5747796893119812,
0.02401338890194893,
0.6305962800979614,
-0.23939161002635956,
0.22558777034... | |
I have two columns, the first column will have the name of a object, the second is who it belongs to. I want a new sheet for each person to list what they had assigned to them. here is a example:
```
dog F
cat F
bell S
whistle
bird F
```
So Fred has a dog, cat, and a bird; Scott has a bell; and no one has a whistle... | [
0.22025834023952484,
0.22038687765598297,
0.36101412773132324,
-0.1386307179927826,
-0.2144286185503006,
0.13900324702262878,
0.07273255288600922,
-0.1436922401189804,
-0.2420453429222107,
-0.3583695590496063,
-0.032697781920433044,
0.00964302197098732,
-0.41946694254875183,
0.245620355010... | |
Scott to be the same.
My current train of thought is to use `=VLOOKUP($C$1,Items!A2:C1000,3)` in a hidden column in D to tell me which row my data is in, (where Column C on Items is a hidden column with the row number of the row and C1 is the search parameter (S or F)), then `=IFERROR(CELL("contents",INDIRECT(ADDRESS... | [
-0.22045280039310455,
0.2620372176170349,
0.2945656180381775,
0.0014902870170772076,
0.1630019098520279,
-0.01718026027083397,
0.27541062235832214,
-0.17714886367321014,
-0.4101482331752777,
-0.5396396517753601,
0.1116473376750946,
0.2187221497297287,
-0.04707983136177063,
0.19909183681011... | |
C# but never have coded in VBA before and I rely heavily on the MSDN and to my knowelge there is no MSDN section dedicated to the Excel API.
Probably they are not equal then.
Check the equals() method on Card. | [
0.272065669298172,
0.25197359919548035,
0.22925816476345062,
-0.1623246669769287,
-0.2676672041416168,
-0.021342825144529343,
-0.12652869522571564,
0.06359400600194931,
-0.1315474808216095,
-0.288716197013855,
0.28675201535224915,
0.8255242705345154,
-0.15475670993328094,
-0.30344730615615... | |
Say you have a Many-Many table between Artists and Fans. When it comes to designing the table, do you design the table like such:
```
ArtistFans
ArtistFanID (PK)
ArtistID (FK)
UserID (FK)
(ArtistID and UserID will then be contrained with a Unique Constraint
to prevent duplicate data)
```
Or do you ... | [
0.035389311611652374,
-0.05296232923865318,
0.46978145837783813,
0.27493801712989807,
-0.33426758646965027,
0.021922267973423004,
-0.44034233689308167,
-0.3085351288318634,
-0.4594813287258148,
-0.5887411236763,
0.3186386227607727,
0.3814796805381775,
-0.33990564942359924,
-0.2863324582576... | |
for using the former schema?
```
ArtistFans
ArtistID (PK)
UserID (PK)
```
The use of an auto incremental PK has no advantages here, even if the parent tables have them.
I'd also create a "reverse PK" index automatically on `(UserID, ArtistID)` too: you will need it because you'll query the table by both col... | [
-0.32247135043144226,
0.22268883883953094,
0.6407930254936218,
-0.04397958889603615,
-0.3398953080177307,
0.1803475171327591,
0.0697728767991066,
-0.35303622484207153,
-0.4796757698059082,
-0.7039230465888977,
-0.04700928553938866,
0.46002912521362305,
-0.31869861483573914,
-0.153615370392... | |
ArtistID)` and `(ArtistID, UserID)` indexes. Adding an auto increments just uses more space (in memory, not just on disk) that shouldn't be used | [
0.014851896092295647,
-0.11551083624362946,
0.4754748046398163,
0.12781840562820435,
0.045061081647872925,
0.06483013927936554,
0.10359208285808563,
-0.2907177209854126,
-0.127012237906456,
-0.8774421215057373,
-0.17212188243865967,
0.4186365604400635,
-0.44788724184036255,
-0.160871714353... | |
If `actions` is a Panel, am I able to raise the `Click` event of it's parent?
I have this code at the moment, but the `Click` event isn't a method, so this code is invalid.
Does anyone know how I can achieve this?
```
actions.Click += delegate(object Sender, EventArgs e)
{
((Panel)Sender).Parent.Click();
}
```... | [
0.007059851661324501,
-0.00859719980508089,
0.06547516584396362,
0.0516447052359581,
-0.20205174386501312,
0.05388767272233963,
0.05944664776325226,
-0.5146116018295288,
-0.572563111782074,
-0.33563369512557983,
-0.12089161574840546,
0.5891162157058716,
-0.19426798820495605,
0.078875601291... | |
I consider that a dirty hack. | [
0.5076260566711426,
0.23049092292785645,
-0.004653831012547016,
0.04381479322910309,
-0.03360286355018616,
-0.050798505544662476,
0.1351562738418579,
0.3355352282524109,
0.13143914937973022,
-0.14150123298168182,
0.13838790357112885,
0.10906564444303513,
0.28430142998695374,
0.115355230867... | |
For some time I am battling to solve this problem but I am not coming to any conclusion so thought to seek some help here.
The problem is that I am getting a blank dropdown instead I should get list of cities populated from the database. Database connection is fine but I am not getting anything in my dropdown.
This i... | [
0.29685840010643005,
-0.06998972594738007,
0.6184630990028381,
0.2908644676208496,
0.13386139273643494,
-0.2874976396560669,
0.4508330523967743,
-0.1005878821015358,
-0.4524244964122772,
-0.6445078253746033,
-0.1651044338941574,
0.15299981832504272,
-0.5146318078041077,
0.4259422719478607,... | |
<select name="city">
<option>Select City</option>
$id = 0;
<?php while ($row = $result->fetch_object()) {
$src = $row->city;
$id = $id + 1;
?>
<option value= <?php $id ?> > <?php $src ?></option>
<?php } ?>
</select>
<?php } ?>
```
ajax script is this:
```
<script>
... | [
-0.0769951194524765,
-0.39454829692840576,
0.6254016757011414,
0.10276105999946594,
-0.2451147735118866,
0.04220117628574371,
-0.20634202659130096,
-0.29787907004356384,
-0.16483096778392792,
-0.768065333366394,
-0.41363659501075745,
0.2749193608760834,
-0.4860459566116333,
-0.031403869390... | |
var xmlhttp=false;
try{mlhttp=new XMLHttpRequest();}
catch(e) {
try{ xmlhttp= new ActiveXObject("Microsoft.XMLHTTP"); }
catch(e){ try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); | [
-0.08095981180667877,
-0.5113812685012817,
0.5595880746841431,
-0.2909552752971649,
-0.10101398080587387,
0.12406228482723236,
0.1672743558883667,
-0.3781696557998657,
0.004176103509962559,
-0.674841046333313,
-0.48011934757232666,
0.4077041447162628,
-0.6357205510139465,
-0.16891582310199... | |
}
catch(e1){
xmlhttp=false;
}
}
} | [
0.2146683633327484,
-0.5077053308486938,
-0.06799913942813873,
-0.031227771192789078,
0.058036062866449356,
-0.27043795585632324,
0.10569363087415695,
-0.022141428664326668,
0.014267501421272755,
-0.12318834662437439,
-0.29397499561309814,
0.4838724136352539,
-0.5103462934494019,
0.0033208... | |
return xmlhttp;
}
function getCity(strURL) {
var req = getXMLHTTP();
if (req) { | [
-0.01600390486419201,
-0.4484926164150238,
0.5149480700492859,
-0.16520573198795319,
-0.2854844033718109,
0.2803308069705963,
0.3012661635875702,
-0.1834607869386673,
-0.06462687253952026,
-0.34977343678474426,
-0.4766896963119507,
0.24436579644680023,
-0.4991472065448761,
-0.0045911013148... | |
req.onreadystatechange = function() {
if (req.readyState == 4) {
if (req.status == 200) { | [
0.22773277759552002,
-0.07666026055812836,
0.6426612138748169,
-0.02847006730735302,
0.7183706760406494,
0.19164906442165375,
0.24598290026187897,
-0.4722256660461426,
0.15564799308776855,
-0.26901906728744507,
-0.5448675751686096,
0.6467589139938354,
-0.35420945286750793,
0.18371981382369... | |
document.getElementById('citydiv').innerHTML=req.responseText;
} else {
alert("There was a problem while using XMLHTTP:\n" + req.statusText); | [
-0.11090138554573059,
-0.46290186047554016,
0.48137277364730835,
-0.09570428729057312,
0.051007431000471115,
-0.20556946098804474,
0.45375290513038635,
-0.16621536016464233,
-0.11370542645454407,
-0.5281142592430115,
-0.5807731747627258,
0.49176791310310364,
-0.6024965047836304,
-0.0292983... | |
}
}
}
req.open("GET", strURL, true); | [
-0.4816948175430298,
-0.0976351797580719,
0.10850894451141357,
-0.36884805560112,
0.34975770115852356,
-0.12998004257678986,
0.6278893947601318,
0.013411398977041245,
0.2857566177845001,
-0.2093667834997177,
-0.5724281072616577,
0.8735063076019287,
-0.33674126863479614,
-0.0201514270156621... | |
req.send(null);
}
}
</script>
```
This is my form code:
```
<form method="post" action="" name="form1">
<table width="60%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150">Country</td>
<td width="150"><select name="country" onChange="getCity('findcity.php?country=... | [
0.23878738284111023,
-0.22125080227851868,
0.8755503296852112,
0.1963718831539154,
0.13447095453739166,
0.17059005796909332,
0.09557543694972992,
-0.2621384263038635,
-0.3194163143634796,
-0.8128103613853455,
0.019369691610336304,
-0.2614726126194,
-0.055895742028951645,
-0.161642208695411... | |
<td ><div id="citydiv"><select name="city">
<option>Select City</option>
</select></div></td>
</tr>
</table>
</form>
```
I think the problem is where you are outputting the `<option>` tags.
Try using this block of code between your `<select>` tags.
```
<option>Select City</option>
<?php
... | [
0.2385178804397583,
-0.717079222202301,
0.5495563745498657,
-0.11529816687107086,
-0.29935136437416077,
-0.1498638540506363,
-0.17368316650390625,
-0.6668898463249207,
-0.2344641089439392,
-0.49551087617874146,
-0.5084254145622253,
0.3872760236263275,
-0.666487991809845,
-0.102884806692600... | |
?>
<option value="<?php echo htmlspecialchars($id,ENT_QUOTES) ?>"><?php echo htmlspecialchars($src) ?></option>
<?php } ?>
```
Edit: To clarify, you didn't have any `echo` statements before the `$id` and `$src` variables. I added `htmlspecialchars()` as a habit to produce properly escaped html. | [
0.2099730223417282,
0.11356587707996368,
0.22125957906246185,
-0.2648622691631317,
-0.16950130462646484,
0.12874868512153625,
0.42223429679870605,
-0.41255709528923035,
-0.3776872158050537,
0.0369013212621212,
-0.24500316381454468,
0.30213260650634766,
-0.5364512205123901,
-0.1051857993006... | |
We all know the usual use of templates to design containers and we all know that you can do things with templates that will make your head spin.
When I first encoutered static polymorphism I was really struck on what you can do with templates. It's obvious that templates are useful for more than for designing containe... | [
0.6493507623672485,
0.1953417956829071,
-0.2481490522623062,
0.37534913420677185,
0.03313019499182701,
-0.35623079538345337,
-0.002891635987907648,
-0.0514342375099659,
-0.20367930829524994,
-0.39161214232444763,
0.15136471390724182,
0.25093600153923035,
-0.3909549117088318,
0.193493723869... | |
templates you've ever encountered?
[boost's Spirit](http://spirit.sourceforge.net/distrib/spirit_1_8_5/libs/spirit/doc/quick_start.html) meta programming for creating a parser's grammar. | [
0.38171952962875366,
-0.0777227059006691,
-0.004131576512008905,
0.2881746292114258,
-0.17003443837165833,
-0.18585969507694244,
0.5290160775184631,
-0.2842980921268463,
-0.08468795567750931,
-0.44487160444259644,
-0.28938162326812744,
0.584767758846283,
-0.40544918179512024,
-0.4761848449... | |
I would like to write a PHP function that calls another function
Page 1.
User selects item from drop down.
(I then post to the same page.)
Page 1.
(I have a query on the page that's based off of which item is selected)
(In this case I'm returning the lat and long of the item.)
$latitude = $row\_farms['lat'];
$long... | [
0.35147950053215027,
0.12009602040052414,
0.46278756856918335,
0.20354191958904266,
0.014368069358170033,
-0.19844497740268707,
0.4936780333518982,
-0.137966126203537,
-0.23244445025920868,
-0.545749843120575,
0.11706790328025818,
-0.08309677988290787,
-0.3687179684638977,
0.29458484053611... | |
into errors, if you really want to:
```
use warnings NONFATAL => 'all', FATAL => 'uninitialized';
``` | [
0.24766330420970917,
0.4167094826698303,
-0.13527603447437286,
0.05916920304298401,
0.2675973176956177,
0.02788589335978031,
0.6508775949478149,
0.1497562825679779,
-0.03995608165860176,
-0.5795682072639465,
-0.3006437420845032,
0.9435964226722717,
-0.3024877607822418,
-0.00023005984257906... | |
Is there some built-in constant for the path delimiter (i.e. \ vs /)
System.IO.Path has two readonly fields for this purpose:
* [Path.DirectorySeparatorChar](http://msdn.microsoft.com/en-us/library/system.io.path.directoryseparatorchar.aspx): contains '\' on Windows, '/' on UNIX
* [Path.AltDirectorySeparatorChar](http... | [
-0.2543713450431824,
-0.08485176414251328,
0.8242515921592712,
0.13246384263038635,
-0.06213654205203056,
0.30718258023262024,
-0.49318408966064453,
-0.3647881746292114,
-0.17350898683071136,
-0.5935264229774475,
-0.18263936042785645,
0.38428351283073425,
-0.15394584834575653,
0.4954224526... | |
Is it possible to add a method to an object class, and use it on all objects?
In Python attributes are implemented using a dictionary :
```
>>> t = test()
>>> t.__dict__["foo"] = "bla"
>>> t.foo
'bla'
```
But for "object", it uses a 'dictproxy' as an interface to prevent such assignement :
```
>>> object.__dict__["... | [
0.21286708116531372,
0.19301769137382507,
0.011759202927350998,
0.07648241519927979,
-0.18327899277210236,
-0.034627873450517654,
0.31392282247543335,
-0.26529809832572937,
0.04391266778111458,
-0.5304851531982422,
0.1360197216272354,
0.5989601016044617,
-0.22188499569892883,
-0.0638922005... | |
I am designing an intranet system for medium business. Should I keep a single log table for all modules or make it separate?
Audit log keeps all admin/staff activities (create, update, delete objects) and the log structure is universal for any kind of module.
And also is it a good idea if I pull report based on log r... | [
0.502448558807373,
0.1686459332704544,
0.4762483239173889,
-0.00021262074005790055,
-0.13194623589515686,
-0.25672435760498047,
0.1635761708021164,
-0.23453234136104584,
-0.4276917576789856,
-0.4824855327606201,
-0.048842862248420715,
0.561877965927124,
-0.06811542063951492,
0.038764715194... | |
your logs, which would you rather do, look in one place where you can see everything or have to check several different places, each of which just shows one piece of the system in isolation?
Keep in mind that, with a single table, it's trivial to filter out entries which are irrelevant or which the user does not have ... | [
0.5645635724067688,
0.07088680565357208,
-0.06771714240312576,
0.4396074116230011,
0.10317672789096832,
-0.102779820561409,
0.1900823563337326,
-0.037432488054037094,
-0.6368649005889893,
-0.4954630732536316,
0.04050850123167038,
0.4474217891693115,
-0.29156485199928284,
-0.004282126668840... | |
log table is added.
I definitely say a single log is preferable. The only situation I can think of where multiple segregated logs would be appropriate would be if security concerns were strong enough to require that log entries with different visibility must be physically segregated - and, in such a case, you'd probab... | [
0.30735844373703003,
0.02267717383801937,
0.2767113149166107,
0.4465203881263733,
0.046855974942445755,
0.15570852160453796,
-0.10097026079893112,
0.00838219653815031,
-0.6867478489875793,
-0.9029775261878967,
-0.05040166899561882,
0.3795984983444214,
-0.15503306686878204,
0.01153950672596... | |
Currently I have tables like: `Pages, Groups, GroupPage, Users, UserGroup`. With pickled sets I can implement the same thing with only 3 tables: `Pages, Groups, Users`.
`set` seems a natural choice for implementing ACL, as group and permission related operations can be expressed very naturally with sets. If I store th... | [
0.044356681406497955,
-0.001449469942599535,
0.4054839015007019,
0.3703271448612213,
-0.34058478474617004,
-0.24047523736953735,
-0.22254662215709686,
-0.07587406784296036,
-0.3398417830467224,
-0.6452978253364563,
0.007124672643840313,
0.43551015853881836,
-0.17337822914123535,
0.19881676... | |
that permissions will ever be edited directly using SQL. So is it a good design idea?
We're using SQLAlchemy as ORM, so it's likely to be implemented with `PickleType` column. I'm not planning to store the whole pickled "resource" recordset, only the `set` object made out of "resource" primary key values.
If you're go... | [
0.2003801465034485,
-0.1293475478887558,
0.05530178174376488,
0.30920639634132385,
0.03927940875291824,
-0.04722769558429718,
-0.3825734853744507,
-0.06588438153266907,
-0.2899668514728546,
-0.19283552467823029,
0.06646517664194107,
0.3692208230495453,
-0.17659896612167358,
-0.045181289315... | |
relational mappings without any BLOBs that must be decoded.
Sets and other first-class objects are really what belongs in a database. The ORM is a hack because some folks think relational databases are "better", so we hack in a mapping layer.
Go with an object database and you'll find that things are often much smoot... | [
0.01682482659816742,
-0.2886979877948761,
0.4876391887664795,
0.344486802816391,
-0.3903661370277405,
-0.4164277911186218,
-0.15264733135700226,
0.4432712495326996,
-0.3873648941516876,
-0.674903929233551,
0.049412474036216736,
0.4316753149032593,
-0.34338802099227905,
0.321071058511734,
... | |
i upgraded my grails 1.0.4 + acegi 0.4.1 project to grails 1.1 with acegi 0.5.1.
I'm able to start my application without errors, but when i want to login i get a "wrong username or password" message. Grails-shell output is:
> 2009-04-26 12:38:46,997
> [403984690@qtp0-0] ERROR
> springsecurity.GrailsDaoImpl - User ... | [
-0.011557326652109623,
0.45917513966560364,
0.1894809752702713,
-0.004386911168694496,
-0.19467800855636597,
-0.06365897506475449,
0.9017713069915771,
-0.2505570650100708,
-0.18941257894039154,
-0.43127912282943726,
0.0737687423825264,
0.6910379528999329,
-0.36482906341552734,
-0.068449012... | |
use encodePassword()! | [
0.3327886760234833,
0.09996543079614639,
-0.2909228205680847,
-0.06029179319739342,
-0.03253614157438278,
-0.6144580245018005,
0.4845275282859802,
-0.2974216341972351,
0.07647422701120377,
-0.7822892069816589,
-0.5628256797790527,
0.3997713029384613,
-0.5994592905044556,
-0.492470860481262... | |
Apple is doing this in a setter method for an instance variable mainSprocket:
```
– (void)setMainSprocket:(Sprocket *)newSprocket {
[mainSprocket autorelease];
mainSprocket = [newSprocket retain];
return;
}
```
Why do they send -autorelease and not -release? Would a -release have a bad effect here? Actua... | [
0.14995868504047394,
0.26956748962402344,
0.5897180438041687,
-0.2598761022090912,
0.4117508828639984,
-0.030387358739972115,
0.2527875602245331,
0.18839110434055328,
-0.4415731132030487,
-0.14930367469787598,
-0.45998069643974304,
0.7163729667663574,
-0.5780643820762634,
-0.02891639247536... | |
fine, I think?
They're doing `autorelease` here in case `newSprocket` and `mainSprocket` happen to be the same object. A call to `release` might inadvertently deallocate the object before it can be retained on the next line, whereas the `autorelease` won't be processed until the autorelease pool is drained at the end o... | [
0.46740487217903137,
-0.161384716629982,
0.44963347911834717,
0.018550779670476913,
0.11007747054100037,
-0.4305708408355713,
0.4916454553604126,
-0.007416930980980396,
-0.5365580916404724,
-0.22719638049602509,
-0.4171662926673889,
0.6682865023612976,
-0.4475601315498352,
0.24275678396224... | |
{
[mainSprocket release];
mainSprocket = [newSprocket retain];
}
}
```
I'll leave it up to others to comment on which is more appropriate or aesthetically pleasing :-) | [
0.26650288701057434,
0.07508593797683716,
0.5286465883255005,
-0.1792716532945633,
0.323467880487442,
-0.16386358439922333,
0.3406863212585449,
0.08407358080148697,
-0.07124435901641846,
-0.25249937176704407,
-0.4724788963794708,
0.609114944934845,
-0.4174743890762329,
0.10800714045763016,... | |
I'm working on amr speech codec (porting/optimization)
I have an arm (for WinCE) optimized version from voiceage and I use it as a reference in performance testing. So far, binary produced with my lib beats the other one by around 20-30%! I use Vs2008 and I have limited access to ARM instruction set I can generate with... | [
0.1511116325855255,
0.23797674477100372,
0.38190191984176636,
-0.14110323786735535,
-0.2687853276729584,
0.16091865301132202,
0.448429673910141,
-0.07333149015903473,
0.28354042768478394,
-0.9970191717147827,
-0.1452009081840515,
0.8111058473587036,
0.2264578491449356,
-0.17761889100074768... | |
way to run code compiled with RVCT on WinCE.
Some of the options are
1) to produce assembly listing (-S option of armcc), and try to assemble with some other assembler that can create COFF (MS assembler for arm)
2) compile and convert generated ELF object file to COFF object (seems like objcopy of gnu binutils could h... | [
0.4583275020122528,
-0.04740704968571663,
0.189428448677063,
0.10192131996154785,
-0.6049934029579163,
-0.2117869257926941,
0.330848753452301,
-0.39136067032814026,
-0.03519829362630844,
-0.7982692718505859,
0.03727658465504646,
0.7171090841293335,
-0.3624642491340637,
-0.14785487949848175... | |
try to run that function on the smartphone.
The emitted assembly cannot be assembled by the ms assembler (not only they are not compatible, but also ms assembler rejects some of the instructions generated with RVCT compiler; ASR opcode in my case)
Then I tried to convert ELF object to coff format and I can't find any i... | [
0.16378770768642426,
0.16316527128219604,
0.5604691505432129,
-0.07597026973962784,
-0.1223221868276596,
-0.09392555803060532,
0.17535057663917542,
-0.010249339044094086,
0.08029400557279587,
-0.7745292782783508,
-0.18489494919776917,
0.7401379346847534,
-0.5381273627281189,
-0.07989724725... | |
as bfdname for input and output format. So, I couldn't get it working either.
Dumping with fromelf and using generated bin file seems to be overkill, so I decided to ask you guys if there is anything I should try to do or maybe someone has already done similar task and could help me.
Basically, all I want to do is to c... | [
0.7397417426109314,
-0.04710402712225914,
0.16571255028247833,
0.29940930008888245,
-0.20099321007728577,
-0.5443031191825867,
0.2743260860443115,
0.03260150924324989,
-0.30562224984169006,
-0.33420634269714355,
-0.014138706028461456,
0.744357168674469,
-0.3530219793319702,
0.2223343402147... | |
might inadvertently deallocate the object before it can be retained on the next line, whereas the `autorelease` won't be processed until the autorelease pool is drained at the end of the event loop.
Consider this scenario:
```
Sprocket *mySprocket = [Sprocket spacelySprocket];
[sprocketManager setMainSprocket:mySproc... | [
0.11466935276985168,
-0.08787205815315247,
0.40977364778518677,
-0.15390515327453613,
0.19759094715118408,
-0.27242061495780945,
0.6709543466567993,
-0.24061812460422516,
-0.2937144935131073,
-0.20534184575080872,
-0.541156530380249,
0.5262784957885742,
-0.3565238416194916,
0.1438203603029... | |
}
}
```
I'll leave it up to others to comment on which is more appropriate or aesthetically pleasing :-) | [
0.3221853971481323,
0.4777930974960327,
0.21394693851470947,
-0.08192916959524155,
0.0776933953166008,
0.08394857496023178,
0.017752153798937798,
0.3861699402332306,
0.38159435987472534,
-0.5032120943069458,
-0.28636470437049866,
0.4760338366031647,
-0.20410481095314026,
0.1703951209783554... | |
Hi I have 2 questions regarding linux directory permissions which I do not understand.
I removed the execute flag from a folder named Documents. After that I cannot use cd on it but I still can do "ls Documents" from the parent directory and it still lists me the files in the Documents directory.
I though the missing... | [
0.17779919505119324,
0.2622975707054138,
0.4260334372520447,
0.04646537825465202,
-0.21058978140354156,
-0.27071887254714966,
0.20760184526443481,
-0.22882960736751556,
-0.30781033635139465,
-0.3116656243801117,
-0.12720061838626862,
0.19480277597904205,
-0.34360089898109436,
0.52030402421... | |
files we just need rights for this directory. Why not simply give each user a separate /tmp/ directory instead of introducing exceptions in the rule system?
I know what the flag does, but I want to know the reasoning on why is was invented.
**Execute bit:** The execute bit is needed to **traverse** a directory. Permis... | [
0.4600127637386322,
0.30437418818473816,
0.500872790813446,
0.03921050578355789,
0.276519775390625,
-0.32706645131111145,
0.23590731620788574,
-0.16298739612102509,
-0.44571855664253235,
-0.46210238337516785,
-0.23644347488880157,
0.58334881067276,
-0.38453608751296997,
0.15737827122211456... | |
2 root root 4096 Apr 27 12:57 foo/bar
-rw-r--r-- 1 root root 0 Apr 27 12:57 foo/bar/file
```
as user:
```
$ ls foo/
bar
$ find foo/ -ls
drwxr-xr-- 3 root root 4096 Apr 27 12:57 foo/
find: foo/: Permission denied
$
```
The usual usage is the other way round though: removi... | [
-0.26669204235076904,
0.30945640802383423,
0.46981504559516907,
-0.28153762221336365,
-0.013924790546298027,
0.11832563579082489,
0.8140000104904175,
-0.14614927768707275,
-0.3082772493362427,
-0.5712565779685974,
-0.3011823892593384,
0.28490135073661804,
-0.3885537087917328,
0.11753373593... | |
but not letting it do the default index listing by setting `--x`.
**Sticky bit:** This was invented exactly to avoid the default rules about deletion within a directory so `/tmp` works. `/tmp` might reside on a different volume than `/home` and/or be governed by different quotas.
The [FHS codifies /tmp](http://proton... | [
0.5329750776290894,
0.19032339751720428,
0.13056156039237976,
-0.2015511393547058,
0.11660443991422653,
-0.14698290824890137,
0.4197676181793213,
0.18529541790485382,
-0.576578676700592,
-0.4285881519317627,
-0.39766207337379456,
0.2284398227930069,
-0.2511044144630432,
0.4445076882839203,... | |
a user-private system-managed directory, which should be cleaned at least on reboot. Even standardised functions like [tmpfile(3)](http://linux.die.net/man/3/tmpfile) do not prescribe the actual path. Although there seem to be important [compatibility and security concerns speaking for /tmp](http://sources.redhat.com/m... | [
-0.07871527224779129,
-0.12186607718467712,
0.3245681822299957,
0.021939978003501892,
-0.16555576026439667,
-0.3066589832305908,
0.5644734501838684,
0.3213934302330017,
-0.46722811460494995,
-0.5029261708259583,
-0.11409524083137512,
0.14848864078521729,
-0.34431713819503784,
0.22012394666... | |
I am working on a practical scenario related with Java;a socket program. The existing system and the expected system are as follows.
**Existing System** - The system checks that a certain condition is satisfied. If so It will create some message to be sent and put it into a queue.
The queue processor is a separate t... | [
0.16499821841716766,
-0.2604166269302368,
0.19212223589420319,
-0.001132308505475521,
0.10455208271741867,
0.2011214941740036,
-0.026594940572977066,
0.1724051535129547,
-0.31270086765289307,
-0.7997790575027466,
-0.023060724139213562,
0.21074999868869781,
-0.16064970195293427,
0.288384765... | |
a certain condition is satisfied but in every case the recipient is not same. So there are many approaches.
1. putting the message into the same queue but with its receiver ID. In this case the 2nd thread can identify the receiver so the message can be sent to that.
2. Having multiple threads. In this case when the c... | [
0.12266071140766144,
-0.3684321343898773,
0.2632933557033539,
0.15596222877502441,
-0.057904202491045,
0.09304503351449966,
0.17325975000858307,
-0.3376604914665222,
-0.2646891474723816,
-0.7998448014259338,
-0.1045413538813591,
0.2589322030544281,
-0.5123252272605896,
0.2829410135746002,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.