text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
sb.Append(System.Text.Encoding.UTF8.GetString(bytes, 0, count));
}
responseData = sb.ToString();
Console.WriteLine(responseData);
// Close everything.
client.Close();
return responseData;
}
// The following | [
-0.12753042578697205,
-0.17371518909931183,
0.7168541550636292,
-0.577437698841095,
-0.03507739678025246,
0.29649272561073303,
0.5991165637969971,
-0.6521834135055542,
-0.21213002502918243,
-0.6442127227783203,
-0.5031844973564148,
0.25263774394989014,
-0.6476188898086548,
0.13396455347537... | |
method is invoked by the RemoteCertificateValidationDelegate.
// We want to make sure the SSL has no Policy errors and is safe.
public static bool ValidateServerCertificate(
object sender,
X509Certificate certificate,
X509Chain chain,
SslPolicyErro... | [
-0.15715065598487854,
-0.12575329840183258,
0.6707084774971008,
0.21617044508457184,
-0.06794057041406631,
-0.11272616684436798,
0.6163038611412048,
-0.23096749186515808,
-0.13252757489681244,
-0.18289098143577576,
-0.167338564991951,
0.4151063561439514,
-0.3004434108734131,
0.363986074924... | |
{
// Somehow the cert always has PolicyErrors so I am returning true regardless.
return true;
//if (sslPolicyErrors == SslPolicyErrors.None)
// return true;
//Console.WriteLine("Certificate error: {0}", sslPolicyErrors); | [
0.03597572073340416,
0.07515262067317963,
0.609880805015564,
-0.15293225646018982,
0.20824892818927765,
0.023722190409898758,
0.5434558987617493,
-0.20379212498664856,
0.14538313448429108,
-0.3670261800289154,
-0.22426670789718628,
0.6575834155082703,
0.10872253030538559,
0.276393324136734... | |
//// Do not allow this client to communicate with unauthenticated servers.
//return false;
}
}
public static class Extensions
{
public static byte[] ToByteArray(this string input)
{
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBy... | [
0.0882984846830368,
-0.3741416037082672,
0.42221230268478394,
-0.16935399174690247,
0.2607482671737671,
0.1342931091785431,
0.44832268357276917,
-0.031672991812229156,
-0.2679288983345032,
-0.6216996908187866,
-0.39929085969924927,
0.3987838625907898,
-0.5847288966178894,
0.342938065528869... | |
}
public static string ToBase64String(this byte[] input)
{
return Convert.ToBase64String(input);
}
}
}
``` | [
-0.22310738265514374,
0.16284216940402985,
0.18405781686306,
-0.31863486766815186,
0.23280173540115356,
0.014238742180168629,
0.01748485304415226,
0.049991726875305176,
0.09078957140445709,
-0.30721616744995117,
-0.5363895893096924,
0.7522668838500977,
-0.5525779724121094,
0.23770695924758... | |
When displaying my DateTime values, I want them to be formatted like so: "February 9, 2009 7:00 AM"
I am using the following code, but am concerned that the date may display incorrectly in other cultures. Can anyone tell me if this is the case or not, and if it is how can I fix it?
```
Date.ToString("MMMM dd, yyyy hh... | [
0.2668250799179077,
0.20883940160274506,
0.9132119417190552,
0.06237256899476051,
-0.013152151368558407,
-0.08288940787315369,
0.30004459619522095,
0.6058999300003052,
-0.3895513713359833,
-0.438837468624115,
0.1981631964445114,
0.5141481161117554,
-0.0367528535425663,
0.12638325989246368,... | |
for.
If you *do* want locale-friendly times in a client-side app then using the default long date format will give you the smoothest results. In my locale I wouldn't want to see 12-hour clock or the month before the day, though I'd surely understand it.
If you're a server-side app you don't want to use any default-lo... | [
0.43152540922164917,
-0.17088927328586578,
0.4806663393974304,
-0.059874944388866425,
0.37767189741134644,
0.20704543590545654,
0.23145607113838196,
0.34181493520736694,
-0.35138604044914246,
-0.7120007276535034,
-0.3485388159751892,
0.40251997113227844,
-0.08302886039018631,
0.00331727159... | |
month names.
(Or, to avoid the problem, no month names. In which case ISO-8601 format “YYYY-mm-dd HH:MM:SS” would be the default choice.) | [
0.36826199293136597,
0.3805816173553467,
0.639247477054596,
0.05905206874012947,
-0.44563114643096924,
0.17192766070365906,
0.12987466156482697,
0.21100443601608276,
-0.4262833297252655,
-0.30904868245124817,
-0.6224433779716492,
0.01060282252728939,
0.07985461503267288,
0.7411736249923706... | |
Is there an "official" naming / casing convention for F#?
I'm always in doubt of using C# style or not:
```
Class.MyFunctionName or Module.my_function_name
```
In F# you're meant to mix BCL classes and F# library ones: they have different casing and the code looks very ugly.
Yes, there is confusion, because F# has... | [
0.07997564971446991,
0.2445751577615738,
0.5209619402885437,
-0.16774772107601166,
-0.32147642970085144,
-0.18848273158073425,
-0.007474243640899658,
0.32195183634757996,
-0.31075555086135864,
-0.32376939058303833,
-0.44507667422294617,
0.6129992008209229,
-0.29078277945518494,
0.035958211... | |
* All .NET and F# OO code uses PascalCase according to existing .NET guidelines
> * The F# functional programming operators such as List.map are for use in F# internal implementation code. This kind of code uses camelCase for operator names
> * Underscores should not be used.
**So, your question...**
```
Class.MyFunc... | [
-0.05304551497101784,
0.06244903430342674,
0.7321046590805054,
0.10247214138507843,
0.04820108786225319,
-0.153825044631958,
0.05659383535385132,
-0.2773840129375458,
-0.18160630762577057,
-0.945988118648529,
-0.6350123882293701,
0.7558321356773376,
-0.3337622582912445,
0.01865804195404052... | |
I want my app to loop in python but have a way to quit. Is there a way to get input from the console, scan it for letter q and quick when my app is ready to quit? in C i would just create a pthread that waits for cin, scans, locks a global quit var, change, unlock and exit the thread allowing my app to quit when its do... | [
0.4878303110599518,
-0.13062304258346558,
-0.039876386523246765,
0.19763483107089996,
-0.03183203190565109,
-0.13132432103157043,
0.05479002371430397,
0.05579178407788277,
-0.27886253595352173,
-0.49789294600486755,
0.07581862807273865,
0.7049058079719543,
-0.5151306390762329,
-0.006881535... | |
python that was windows specific)
The particular file you specified, sps.resx is actually in 12\CONFIG\Resources (but there's a bunch of others in 12\Resources). | [
0.2847777009010315,
-0.2715549170970917,
0.044337041676044464,
0.020797742530703545,
-0.023309536278247833,
-0.0756005272269249,
0.2411288470029831,
0.0018146662041544914,
-0.6699732542037964,
-0.41483205556869507,
0.06421971321105957,
0.7662070989608765,
-0.3107108771800995,
-0.3336918354... | |
I want to update a cell in a spreadsheet that is used by a chart, using the Open XML SDK 2.0 (CTP). All the code samples I have found insert new cells. I am struggling with retrieving the right worksheet.
```
public static void InsertText(string docName, string text, uint rowIndex,
string columnName)
{
// Open th... | [
0.3470373749732971,
0.2479412853717804,
0.5367380976676941,
-0.17088240385055542,
0.3880240023136139,
-0.07332462817430496,
0.28906866908073425,
-0.40859004855155945,
-0.0629282146692276,
-0.8698978424072266,
-0.22216425836086273,
0.5488908290863037,
-0.49781742691993713,
-0.01445542089641... | |
GetFirstChild<SheetData>();
// If the worksheet does not contain a row with the specified
// row index, insert one.
Row row;
if (sheetData.Elements<Row>().Where(
r => r.RowIndex == rowIndex).Count() != 0)
// At this point I am expecting a match for a row that exists
// in sheet1 but ... | [
-0.13009792566299438,
-0.12945018708705902,
0.5858035683631897,
-0.08932005614042282,
0.06022470071911812,
0.14258933067321777,
0.3500651717185974,
-0.3908666968345642,
-0.1932983100414276,
-0.9429163336753845,
-0.1608787178993225,
0.4631862938404083,
-0.3999499976634979,
-0.14502026140689... | |
any children. What am I missing?
Here is the working code. This is a prototype. For a larger number of changes, one might open the document only once. Also, there are some hard-coded things like sheet name and cell type that would have to be parameterized before this can be called production-ready.
<http://openxmldevel... | [
0.18340452015399933,
0.13035081326961517,
0.35756343603134155,
0.12646563351154327,
0.15200603008270264,
0.179962158203125,
0.018670538440346718,
-0.017207501456141472,
-0.37192216515541077,
-0.5666431784629822,
-0.29216209053993225,
0.2958669662475586,
-0.26333582401275635,
0.160650297999... | |
UpdateCell("Chart.xlsx", "20", 2, "B");
UpdateCell("Chart.xlsx", "80", 3, "B");
UpdateCell("Chart.xlsx", "80", 2, "C");
UpdateCell("Chart.xlsx", "20", 3, "C");
ProcessStartInfo startInfo = new ProcessStartInfo("Chart.xlsx");
startInfo.WindowStyle = ProcessWin... | [
-0.12841156125068665,
-0.3643772304058075,
0.8773783445358276,
-0.26244816184043884,
0.30355772376060486,
0.09779583662748337,
-0.0996871218085289,
-0.08489076793193817,
-0.25079911947250366,
-0.7397499680519104,
-0.5614471435546875,
0.5756168365478516,
-0.22286182641983032,
0.410603374242... | |
}
public static void UpdateCell(string docName, string text,
uint rowIndex, string columnName)
{
// Open the document for editing.
using (SpreadsheetDocument spreadSheet =
SpreadsheetDocument.Open(docName, true)) | [
-0.050470396876335144,
0.033206045627593994,
0.6660080552101135,
-0.0241681095212698,
0.39577004313468933,
-0.28139346837997437,
0.055153463035821915,
-0.08544842898845673,
0.1974637657403946,
-0.5586329698562622,
-0.48571354150772095,
0.9241264462471008,
-0.5273191928863525,
-0.0069339689... | |
{
WorksheetPart worksheetPart =
GetWorksheetPartByName(spreadSheet, "Sheet1");
if (worksheetPart != null)
{ | [
-0.07879508286714554,
-0.2337070107460022,
0.3332797884941101,
0.09518791735172272,
-0.024497315287590027,
-0.018765166401863098,
0.5714114904403687,
-0.296625018119812,
-0.14497454464435577,
-0.5762779116630554,
-0.4126492142677307,
0.20861388742923737,
-0.5178084373474121,
0.226089879870... | |
Cell cell = GetCell(worksheetPart.Worksheet,
columnName, rowIndex);
cell.CellValue = new CellValue(text);
cell.DataType = | [
-0.3544928729534149,
-0.2548978924751282,
0.4040563702583313,
-0.09352973848581314,
0.4060839116573334,
0.008036556653678417,
0.31150978803634644,
-0.12100525945425034,
-0.06646443903446198,
-0.8442952632904053,
-0.48330071568489075,
-0.07977105677127838,
-0.5072255730628967,
0.35765162110... | |
new EnumValue<CellValues>(CellValues.Number);
// Save the worksheet.
worksheetPart.Worksheet.Save();
}
} | [
-0.15105637907981873,
-0.19144730269908905,
0.44346094131469727,
-0.15847285091876984,
0.4859025180339813,
0.02314945124089718,
0.36460041999816895,
-0.13928702473640442,
-0.14302828907966614,
-0.9611180424690247,
-0.41662096977233887,
0.17072120308876038,
-0.2879497706890106,
0.3073908388... | |
}
private static WorksheetPart
GetWorksheetPartByName(SpreadsheetDocument document,
string sheetName)
{
IEnumerable<Sheet> sheets =
document.WorkbookPart.Workbook.GetFirstChild<Sheets>().
Elements<Sheet>().Where(s => s.Name == sheetN... | [
-0.18159759044647217,
-0.14423692226409912,
0.60029536485672,
0.1345987319946289,
-0.00300585082732141,
-0.03899450600147247,
0.18016505241394043,
-0.38524484634399414,
-0.0465451218187809,
-0.7140458822250366,
-0.42252737283706665,
0.2164129763841629,
-0.3416532278060913,
0.18839263916015... | |
if (sheets.Count() == 0)
{
// The specified worksheet does not exist.
return null;
}
string relationshipId = sheets.First().Id.Value; | [
0.07123817503452301,
-0.2664922773838043,
0.5238944292068481,
-0.11706258356571198,
-0.0027160909958183765,
-0.13538898527622223,
-0.12932780385017395,
-0.6050906181335449,
-0.07314621657133102,
-0.44318145513534546,
-0.09800458699464798,
0.10906288027763367,
-0.4929125905036926,
0.3574300... | |
WorksheetPart worksheetPart = (WorksheetPart)
document.WorkbookPart.GetPartById(relationshipId);
return worksheetPart;
}
// Given a worksheet, a column name, and a row index,
// gets the cell at the specified column and
private static Cell GetCell(Workshe... | [
-0.25871771574020386,
0.07205116748809814,
0.5555104613304138,
-0.029211189597845078,
0.25453612208366394,
0.03688354790210724,
0.4050724506378174,
-0.5943076014518738,
-0.04068206623196602,
-0.51369309425354,
-0.32996317744255066,
0.2822781801223755,
-0.43676164746284485,
0.03095660917460... | |
string columnName, uint rowIndex)
{
Row row = GetRow(worksheet, rowIndex);
if (row == null)
return null;
return row.Elements<Cell>().Where(c => string.Compare | [
-0.37571290135383606,
-0.08153591305017471,
0.4976230561733246,
-0.14478406310081482,
0.16073618829250336,
0.27827659249305725,
0.27944624423980713,
-0.625123143196106,
0.135407954454422,
-0.48283684253692627,
-0.13772675395011902,
0.4942765533924103,
-0.2985135614871979,
0.439398288726806... | |
(c.CellReference.Value, columnName +
rowIndex, true) == 0).First();
}
// Given a worksheet and a row index, return the row.
private static Row GetRow(Worksheet worksheet, uint rowIndex)
{
return worksheet.GetFirstChild<SheetData>(). | [
-0.10148017853498459,
-0.2666240632534027,
0.6528897881507874,
-0.1147923693060875,
0.2618721127510071,
0.11833975464105606,
0.04600409418344498,
-0.38387882709503174,
0.025798793882131577,
-0.5575706362724304,
-0.3733792304992676,
0.4632028341293335,
-0.2757779061794281,
0.425318419933319... | |
Elements<Row>().Where(r => r.RowIndex == rowIndex).First();
}
}
}
``` | [
-0.4222742021083832,
0.12930476665496826,
0.3354894816875458,
-0.35197126865386963,
0.21972642838954926,
0.05923702195286751,
0.09509619325399399,
-0.5704643130302429,
-0.016270631924271584,
-0.4753795564174652,
-0.30065950751304626,
0.5046949982643127,
-0.4638090133666992,
0.0997155308723... | |
I'm building some code completion style text expansion functionality for text areas and inputs in a web application. I'm trying to work out a safe keyboard shortcut for invoking the completion proposals for browsers running on Mac OS X.
I've eliminated some potential candidates:
* `Command` + `Space` - activates the ... | [
0.14058716595172882,
0.08451695740222931,
0.5104888677597046,
-0.17687086760997772,
0.06134852021932602,
-0.24073471128940582,
0.18227519094944,
-0.07179669290781021,
-0.16288739442825317,
-0.7269495129585266,
-0.4641677439212799,
0.8155981302261353,
-0.23317281901836395,
-0.01422571670264... | |
missed with Option+Space? Or do you have a better idea for a keyboard shortcut, and why?**
I discussed these ideas with our design team. One of them suggested using `Control` + `Enter`, which is what we decided to go with. This causes forms that only contain a single input field to automatically submit in Firefox, but ... | [
0.1600058674812317,
-0.09391862154006958,
0.2970467805862427,
-0.21202073991298676,
0.07078640162944794,
-0.015705116093158722,
0.09314782172441483,
-0.3051746189594269,
-0.10649136453866959,
-0.5602039694786072,
-0.21155498921871185,
0.47669824957847595,
-0.4044683277606964,
-0.1185905262... | |
```
<root>
<thing>
<specs>
<spec1 />
<spec3 />
<spec2 />
</specs>
<details />
<more_info>
<info1 />
<info2 />
</more_info>
</thing>
</root>
```
okeee so i got this sample xml and the problem is i cant seem to get the values of the innerxml,
when i use `$reader-... | [
0.30203455686569214,
0.12220479547977448,
0.31405842304229736,
0.001877589151263237,
-0.2630515694618225,
-0.16319984197616577,
0.16035357117652893,
-0.3232868015766144,
-0.046169765293598175,
-0.46757447719573975,
0.10927312076091766,
0.558131992816925,
-0.24390599131584167,
0.04830481857... | |
what i wanted was to get the values of spec1, spec2, spec3 separately
the code is pretty long so i posted it [here](http://pastebin.com/f48b9bd38)
i've been stuck with this for 3days now T\_T poor me, i'd gladly accept any corrections
It depends what you mean by "value". If you have something like
```
<spec3 />Val... | [
0.42874258756637573,
0.09730009734630585,
0.6780956983566284,
-0.07457207143306732,
-0.30214425921440125,
0.049101270735263824,
0.08704826235771179,
-0.2424619048833847,
-0.06279244273900986,
-0.5749095678329468,
0.21025198698043823,
0.7302292585372925,
-0.14132718741893768,
0.287129431962... | |
this.
Finally, if the node contains more nested XML,
```
<spec2><foo><baz thing="la de da">Value</baz></foo></spec2>
```
There's no direct way at that moment in time for the reader to understand values/elements inside of it. You'd need to do one of the following
1. Change you reader parsing code to hook into elem... | [
0.08823192864656448,
-0.17197729647159576,
0.3259811997413635,
0.1645081341266632,
-0.09428048133850098,
-0.14334289729595184,
-0.027274971827864647,
-0.5790767073631287,
-0.05713129788637161,
-0.6258205771446228,
-0.0938725396990776,
0.4964594542980194,
-0.2746933102607727,
-0.08837309479... | |
<spec1 foo="my attribute">Value</spec1>
<spec3>
My Text
</spec3>
<spec2 foo="foo again" bar="another attribute" baz="yet another attribute" />
</specs>
<details />
<more_info>
<info1 />
<info2 />
</more_info>
</thing>
</root>
'));
$last_node_at_depth = array();
$a... | [
0.15007634460926056,
-0.17921581864356995,
1.0198354721069336,
-0.3632756471633911,
-0.05565035343170166,
0.025136832147836685,
-0.03635657951235771,
-0.7085920572280884,
-0.3150770962238312,
-0.2897137999534607,
-0.16693897545337677,
0.6577104926109314,
-0.2888508141040802,
0.012114285491... | |
$last_node_at_depth[($reader->depth-1)] == 'specs' &&
!in_array ($reader->localName,$already_processed)
){
echo "\n".'Processing ' . $reader->localName . "\n";
$already_processed[] = $reader->localName;
echo '--------------------------------------------------'."\n";
ech... | [
-0.09431184083223343,
-0.3804791569709778,
0.4898817539215088,
-0.4874628186225891,
0.46444404125213623,
-0.037250395864248276,
0.42093828320503235,
-0.36836257576942444,
-0.10047205537557602,
-0.46963217854499817,
-0.35006386041641235,
0.06507911533117294,
-0.21630482375621796,
0.21556650... | |
echo trim($reader->readInnerXML());
echo ']'."\n";
if($reader->attributeCount > 0){
echo 'This node has attributes, lets process them' . "\n";
//grab attribute by name
echo ' Value of attribute foo: ' . $reader->getAttribute('foo') . "\n";
//or | [
-0.01435408927500248,
-0.2594643533229828,
0.27302929759025574,
-0.3844356834888458,
0.11623983085155487,
-0.04106675833463669,
0.5797693133354187,
-0.7471425533294678,
0.10949358344078064,
-0.2511987090110779,
-0.35072794556617737,
0.40448394417762756,
-0.6122478246688843,
-0.135088741779... | |
use the reader to itterate through all the attributes
$length = $reader->attributeCount;
for($i=0;$i<$length;$i++){
//now the reader is pointing at attributes instead of nodes
$reader->moveToAttributeNo($i);
echo ' Value of attribute ' | [
-0.28731101751327515,
-0.17542441189289093,
0.7007512450218201,
-0.21165861189365387,
0.07038478553295135,
0.11664280295372009,
0.09703018516302109,
-0.38083168864250183,
0.2626023292541504,
-0.6624530553817749,
-0.09300815314054489,
0.5724856853485107,
-0.3162574768066406,
0.0742815658450... | |
. $reader->localName;
echo ': ';
echo $reader->value;
echo "\n";
}
}
//echo $reader->localName . "\n";
} | [
-0.15851430594921112,
-0.0070469677448272705,
0.03308312967419624,
-0.3161274790763855,
0.05467083305120468,
0.046600520610809326,
0.532400369644165,
-0.27949029207229614,
0.1429571509361267,
-0.5807411074638367,
-0.3959636390209198,
0.22205112874507904,
-0.5625519156455994,
0.215613022446... | |
}
``` | [
0.3354566991329193,
0.5660994052886963,
-0.045124202966690063,
0.08949362486600876,
0.36271432042121887,
-0.03456072509288788,
0.2035233974456787,
0.4996976852416992,
0.20306141674518585,
-0.48415371775627136,
-0.1802433431148529,
0.4521971344947815,
-0.138974130153656,
0.3154967725276947,... | |
I've been writing tools in Maya for years using MEL and Python. I'd consider myself an expert in custom window/gui design in Maya except for one area; modifying existing panels and editors.
Typically, I'm building tools that need totally custom UIs, so its customary for me to build them from scratch. However, recently... | [
0.6055384278297424,
0.2351672500371933,
0.015104532241821289,
-0.014196889474987984,
-0.3206288814544678,
0.21113145351409912,
0.06992549449205399,
0.39588260650634766,
-0.10277292877435684,
-0.916678786277771,
0.30482569336891174,
0.6468529105186462,
0.07029825448989868,
-0.00493103452026... | |
be great. I just need to know how to find the layer editor/panel and, say, add a button or text field to it.
Have you tried searching ui item names in MEL files under maya installation directory? It should be one of the MEL scripts included, and from there you can just modify it. | [
0.5712714195251465,
-0.10107788443565369,
0.44122314453125,
0.10033730417490005,
0.19191250205039978,
-0.14040535688400269,
-0.04059526324272156,
0.19417940080165863,
0.07298970967531204,
-0.9070770740509033,
0.16596344113349915,
0.7377909421920776,
0.25405433773994446,
-0.1687381565570831... | |
I mean not on open source, but software to build and sell.
They don't have to be programmers, they can be also people who have ideas or with a marketing background.
Is there any good internet platform for this?
[Professional social network LinkedIn](http://www.linkedin.com/) is a good place to start out with. You can... | [
1.0375336408615112,
0.10316543281078339,
-0.2660007178783417,
0.33054497838020325,
0.06877317279577255,
-0.2962298095226288,
0.09986212104558945,
0.5821120738983154,
-0.4057227075099945,
-0.5929037928581238,
0.020466191694140434,
0.4022327959537506,
0.26429760456085205,
0.01595592498779297... | |
I have large batches of XHTML files that are manually updated. During the review phase of the updates I would like to programmatically check the well-formedness of the files.
I am currently using a **XmlReader**, but the time required on an average CPU is much longer than I expected.
The XHTML files range in size from... | [
0.49486321210861206,
0.2594875991344452,
0.6018094420433044,
0.056818827986717224,
-0.21460014581680298,
-0.27147117257118225,
0.3333243727684021,
0.0625690445303917,
-0.11914069950580597,
-0.7453346848487854,
-0.10941536724567413,
0.3806708753108978,
-0.08735254406929016,
0.13386705517768... | |
a simple XML well-formedness check? Maybe using external XML libraries?
---
I can confirm that validating "regular" XML based content is lightning fast using the XmlReader, and as suggested the problem seems to be related to the fact that the XHTML DTD is read each time a file is validated.
```
<!DOCTYPE html PUBLIC... | [
0.08063971251249313,
0.08968396484851837,
0.4098910093307495,
-0.036644916981458664,
-0.33072903752326965,
-0.4726898670196533,
0.11971967667341232,
-0.36976197361946106,
-0.17794226109981537,
-0.6674753427505493,
-0.3402799665927887,
0.5594865679740906,
-0.05371111258864403,
-0.0738795399... | |
we ignore the DTD).
---
The problem was solved by using a **custom XmlResolver** as suggested, in combination with local (embedded) copies of both the DTD and entity files.
I will post the solution here once I cleaned up the code
I would expect that `XmlReader` with `while(reader.Read)() {}` would be the fastest *m... | [
0.04506372660398483,
0.04588322341442108,
0.45435088872909546,
0.22453317046165466,
-0.1299358606338501,
-0.06477870792150497,
0.27538439631462097,
-0.19337569177150726,
-0.1811968833208084,
-0.6758711338043213,
-0.1656818985939026,
0.7201029062271118,
-0.28072986006736755,
0.1231037676334... | |
remote fetch...
The following does ~300KB virtually instantly:
```
using(MemoryStream ms = new MemoryStream()) {
XmlWriterSettings settings = new XmlWriterSettings();
settings.CloseOutput = false;
using (XmlWriter writer = XmlWriter.Create(ms, settings))
{
writer.WriteS... | [
-0.20486430823802948,
-0.3416425287723541,
1.044673204421997,
0.02549000084400177,
0.11446939408779144,
-0.08546872437000275,
0.464655339717865,
-0.33661720156669617,
-0.059572260826826096,
-0.6054113507270813,
-0.0472213476896286,
0.783251941204071,
-0.0084796492010355,
0.5488085150718689... | |
{
writer.WriteElementString("value", i.ToString());
}
writer.WriteEndElement();
}
Console.WriteLine(ms.Length + " bytes");
ms.Position = 0;
int nodes = 0;
Stopwatch watch = Stopwatch.StartNew(); | [
-0.1989743560552597,
-0.24988435208797455,
0.7912165522575378,
-0.3958786725997925,
0.5141229033470154,
0.2400386780500412,
0.31790125370025635,
0.04006986692547798,
-0.14935287833213806,
-0.6032724380493164,
-0.2427516132593155,
0.49378085136413574,
-0.3215111196041107,
0.2377609759569168... | |
using (XmlReader reader = XmlReader.Create(ms))
{
while (reader.Read()) { nodes++; }
}
watch.Stop();
Console.WriteLine("{0} nodes in {1}ms", nodes,
watch.ElapsedMilliseconds);
}
``` | [
-0.14542557299137115,
-0.32844364643096924,
0.9773073792457581,
0.012804663740098476,
0.31315383315086365,
0.1125495433807373,
0.16988632082939148,
-0.265090674161911,
-0.17575061321258545,
-0.7456944584846497,
-0.30500537157058716,
0.4145476520061493,
-0.30632761120796204,
0.2868719398975... | |
I am doing something like this in python
```
class MyThread ( threading.Thread ):
def run (s):
try:
s.wantQuit = 0
while(not s.wantQuit):
button = raw_input()
if button == "q": | [
0.15626773238182068,
-0.2656797468662262,
0.06894432008266449,
-0.13479721546173096,
0.29157429933547974,
-0.003592638997361064,
0.3870461583137512,
0.025928251445293427,
-0.12694700062274933,
-0.5933436751365662,
-0.03470722585916519,
0.49588513374328613,
-0.32998645305633545,
-0.22184243... | |
s.wantQuit=1
except KeyboardInterrupt:
s.wantQuit = 1
myThread = MyThread ()
myThread.start()
a=5
while not myThread.wantQuit:
print "hey"
if (a == 0):
break;
a = a-1;
time.sleep(1)
#"""
sys.exit()
```
What happens is my app locks up for 5 seconds printing "hey" (5 times)... | [
0.14913563430309296,
0.06872957199811935,
0.8875187039375305,
-0.24867989122867584,
0.34042349457740784,
0.1376359760761261,
0.5690244436264038,
0.04357060045003891,
-0.32443004846572876,
-0.5094282031059265,
-0.391395628452301,
0.5044074058532715,
-0.05519747734069824,
-0.3160678446292877... | |
instead of when my loop runs out?
You mean the while loop runs before the thread? Well, you can't predict this unless you synchronize it. No one guarantees you that the thread will run before or after that while loop. But if it's being blocked for 5 seconds that's akward - the thread should have been pre-empted by then... | [
0.44391489028930664,
-0.3915463387966156,
0.3640153408050537,
0.13010293245315552,
0.29218435287475586,
-0.07591551542282104,
0.4548085629940033,
0.14461928606033325,
-0.2766624987125397,
-0.2921627163887024,
0.14748138189315796,
0.6492336392402649,
0.0007329319487325847,
0.197071462869644... | |
In a FLEX app, I am trying to "re-dispatch" a custom event. I.e. component1 does dispatchEvnet(event), component2 registers a handler for the event, the only function of the handler being, again, dispatch(event). Finally, component3 listens for the event coming out of component2. What I am trying to do is similar to th... | [
0.2402232438325882,
-0.5042278170585632,
0.4318326711654663,
0.05962292477488518,
-0.19259095191955566,
0.1373746693134308,
0.3597147464752197,
-0.33301204442977905,
-0.22080987691879272,
-0.7125846743583679,
-0.1340368688106537,
0.8026745319366455,
-0.474480003118515,
-0.5114789009094238,... | |
CustomEvent while calling the handler in component3. Tracing code in the debugger shows that by the time component3 is called, the event is, indeed, a generic one, with all my custom stuff lost. Is this supposed to be the case?
The problem you are experiencing is caused by not overriding the [clone()](http://livedocs.a... | [
0.4597911834716797,
-0.306609570980072,
0.23148438334465027,
-0.011291171424090862,
0.058319106698036194,
-0.048506222665309906,
0.3246511220932007,
-0.43239328265190125,
-0.4846024811267853,
-0.38894468545913696,
0.21388906240463257,
0.874085009098053,
-0.39768680930137634,
0.129764750599... | |
own custom Event class, you must override the inherited Event.clone() method in order for it to duplicate the properties of your custom class. If you do not set all the properties that you add in your event subclass, those properties will not have the correct values when listeners handle the redispatched event. | [
0.609350323677063,
-0.223791241645813,
0.30711957812309265,
0.0513017475605011,
0.11108196526765823,
-0.1509096771478653,
0.5152563452720642,
-0.2149876207113266,
-0.2692093551158905,
-0.516826331615448,
0.09647542238235474,
0.7234403491020203,
-0.1485031694173813,
0.3411792516708374,
-0... | |
What is the best way to determine if a string represents a web address? I need to let the user enter a web address into a form, but how do I validate the input? The user should be allowed to enter strings like "<http://www.google.com>" or "www.vg.no", but he shouldn't be required to enter the "http://". Also, there are... | [
0.5501422882080078,
0.07037389278411865,
0.593575119972229,
0.25389423966407776,
-0.09053171426057816,
-0.2950696349143982,
0.2995305061340332,
-0.0873335674405098,
0.08084575831890106,
-0.5693269371986389,
0.14901980757713318,
0.29221466183662415,
0.15265175700187683,
0.16570794582366943,... | |
maybe some of the fine minds here at SO can enlighten me?
First, try to validate if the input text is a well-formed URL by using regular expressions. If the check is OK, try a DNS lookup to validate if the host is known. Don't forget the special case of localhost or 127.0.0.1. Also take care of hosts specified by their... | [
0.4968958795070648,
0.11386983841657639,
0.3778367042541504,
0.23298795521259308,
-0.15033918619155884,
-0.298202246427536,
0.4280548393726349,
0.23629318177700043,
-0.32667434215545654,
-0.7805121541023254,
-0.2049475610256195,
0.5596838593482971,
-0.09389299899339676,
0.2055567055940628,... | |
`:8080`, `:8888`, whatever
* mix any of the above solutions
* try also prepending `file:///` for a local access | [
-0.005886368919163942,
0.08751460164785385,
0.27547863125801086,
0.24995161592960358,
0.24830569326877594,
-0.02929127961397171,
0.4302347004413605,
0.25090762972831726,
-0.2906959056854248,
-0.7251013517379761,
-0.2925102114677429,
0.6312931776046753,
-0.22004181146621704,
0.1592292338609... | |
**Background**: I have a small Python application that makes life for developers releasing software in our company a bit easier. I build an executable for Windows using py2exe. The application as well as the binary are checked into Subversion. Distribution happens by people just checking out the directory from SVN. The... | [
0.5881243944168091,
-0.004187167622148991,
-0.06533470004796982,
-0.16263660788536072,
0.04376337304711342,
0.09420377761125565,
0.35369956493377686,
0.3837311267852783,
-0.40440383553504944,
-0.6365587115287781,
0.15753240883350372,
0.6926661133766174,
-0.38113364577293396,
-0.23741883039... | |
6 libraries installed locally using easy\_install.
**The Problem**
* This is not a public, classical open source environment: I'm inside a corporate network, the tool will never leave the "walled garden" and we have seriously inconvenient barriers to getting to the outside internet (NTLM authenticating proxies and/or... | [
0.49375665187835693,
0.1887035369873047,
0.06588911265134811,
0.10353787243366241,
-0.09911618381738663,
-0.4019680917263031,
0.726906955242157,
0.17695671319961548,
-0.2193230837583542,
-0.5701034069061279,
-0.16070735454559326,
0.4932774603366852,
-0.35975298285484314,
0.2941012978553772... | |
the program from Subversion.
**Anecdote**: The more self-contained the process is the easier it is to repeat it. I had my machine swapped out for a new one and went through the unpleasant process of having to reverse engineer the dependencies, reinstall distutils, hunting down the libraries online and getting them to ... | [
0.6964008808135986,
-0.15470585227012634,
0.1115393191576004,
0.06979826092720032,
0.09270425140857697,
-0.20209293067455292,
0.4901569187641144,
0.35003843903541565,
-0.31417176127433777,
-0.31807824969291687,
-0.14940980076789856,
0.3369666635990143,
-0.46016064286231995,
0.3735918104648... | |
time.
* I agree to a certain extent to the critisisms by @Ali A and @S.Lott
Anyway, the approach I use depends on modifying sys.path, and works like this:
* Require python and setuptools (to enable loading code from eggs) on all computers that will use your software.
* Organize your directory structure this:
```
pr... | [
0.6357011795043945,
0.18104158341884613,
0.1790466010570526,
-0.04744958132505417,
0.34910914301872253,
-0.046419914811849594,
0.0913347527384758,
-0.0701812133193016,
-0.2856003940105438,
-0.8355441689491272,
-0.036004312336444855,
0.5944303870201111,
0.08613839000463486,
-0.1718246489763... | |
code/
elementtree\
*.py
...
```
* In your top-level script(s) include the following code at the top:
```
from scriptcustomize import apply_pth_files
apply_pth_files(__file__)
```
* Add scriptcustomize.py to your project folder:
```
import os
from glob import glob
import f... | [
-0.05510064959526062,
0.21042552590370178,
0.7005589604377747,
-0.10214304178953171,
0.2624235153198242,
0.281169593334198,
0.03961559385061264,
-0.1626545488834381,
0.009920469485223293,
-0.8468322157859802,
-0.4875544011592865,
0.5619325041770935,
-0.25291943550109863,
-0.128967344760894... | |
directory = os.path.dirname(scriptfilename)
files = glob(os.path.join(directory, '*.pth'))
if not files:
return
for line in fileinput.input(files):
line = line.strip()
if line and line[0] != '#':
path = os.path.join(directory, line)
if at_beginning:
... | [
-0.33694952726364136,
-0.5060797333717346,
0.7762700915336609,
-0.3162824809551239,
0.3505430221557617,
0.2322578877210617,
0.13425330817699432,
-0.16572558879852295,
-0.028002165257930756,
-0.650154709815979,
-0.38742607831954956,
0.6241862177848816,
-0.2481970489025116,
0.140891090035438... | |
path)
else:
sys.path.append(path)
```
* Add one or more \*.pth file(s) to your project folder. On each line, put a reference to a directory with packages. For instance:
```
# contents of *.pth file
thirdparty/code
thirdparty/eggs/mako-vNNN.egg
```
* I "kind-of" like this approach. What... | [
0.4756205081939697,
-0.17390601336956024,
0.2447802722454071,
-0.06179571896791458,
0.03164473548531532,
0.0009293665643781424,
0.2229628711938858,
-0.1801043599843979,
0.05900655686855316,
-0.9825826287269592,
-0.16764481365680695,
0.5143365263938904,
-0.23196925222873688,
-0.080055020749... | |
I use virtualenv most of the time. But I tend to use virtualenv for projects where I have tight control of the deployment scenario. In cases where I do not have tight control, I tend to use the approach I describe above. It makes it really easy to package a project as a zip and have the end user "install" it (by unzipp... | [
0.597396194934845,
-0.18841877579689026,
0.21591399610042572,
-0.14190718531608582,
-0.023851998150348663,
-0.40914931893348694,
0.15433356165885925,
0.16256219148635864,
-0.4680773615837097,
-0.8401286602020264,
-0.41995182633399963,
0.6490648984909058,
-0.056741658598184586,
0.0335264690... | |
I need to execute a PowerShell script from within C#. The script needs commandline arguments.
This is what I have done so far:
```
RunspaceConfiguration runspaceConfiguration = RunspaceConfiguration.Create();
Runspace runspace = RunspaceFactory.CreateRunspace(runspaceConfiguration);
runspace.Open();
RunspaceInvoke ... | [
0.6317431926727295,
0.012452437542378902,
0.0732601210474968,
-0.13588768243789673,
0.23009800910949707,
0.12258280813694,
0.4313020706176758,
-0.29804354906082153,
0.14817343652248383,
-0.8321394920349121,
0.09480726718902588,
0.7780131101608276,
-0.5572938323020935,
0.08501270413398743,
... | |
separate command:
```
Command myCommand = new Command(scriptfile);
```
then you can add parameters with
```
CommandParameter testParam = new CommandParameter("key","value");
myCommand.Parameters.Add(testParam);
```
and finally
```
pipeline.Commands.Add(myCommand);
```
---
***Here is the complete, edited code:... | [
0.10158518701791763,
-0.09529878199100494,
0.5415980219841003,
-0.13124948740005493,
0.2674543857574463,
0.17071983218193054,
0.3207862079143524,
-0.310420423746109,
0.1520630419254303,
-0.803235650062561,
-0.17919546365737915,
0.7836077809333801,
-0.30393773317337036,
0.2428043931722641,
... | |
I find myself defining classes like:
```
struct AngleSize {
explicit AngleSize(double radians) : size(radians) {}
double size;
};
```
This has a bunch of advantages over storing anglesizes as plain doubles.
**Advantage 1**, it makes it possible to define these 2 distinct constructors:
```
Vec2::Vec2(doubl... | [
0.37729841470718384,
0.08345119655132294,
0.6039333343505859,
-0.25061628222465515,
-0.22607360780239105,
0.135748028755188,
0.273413747549057,
-0.48165953159332275,
-0.06486827880144119,
-0.6185137629508972,
-0.25447049736976624,
0.6593963503837585,
-0.0522158108651638,
-0.224906504154205... | |
length, AngleSize direction) {
x = length * cos(direction.size);
y = length * sin(direction.size);
}
```
Ugh, this should really say `cos(direction)` yet without allowing an unsafe implicit conversion, I need to verbosely access the actual value.
**Disadvantage 2**, *too many classes for every single thing*,... | [
-0.1568736732006073,
-0.24873507022857666,
0.8521589636802673,
-0.14047087728977203,
-0.1085781529545784,
0.2513168454170227,
0.12606145441532135,
-0.3119125962257385,
0.35941803455352783,
-0.7488059997558594,
-0.04719861224293709,
0.5404371619224548,
-0.015654269605875015,
0.1251293718814... | |
Angle(Line line1, Line line2);
};
struct PositionedAngle {
// angle defined by two rays. this is getting just silly
PositionedAngle(Ray firstRay, AngleSize angle);
PositionedAngle(Point center, AngleSize fromAngle, AngleSize toAngle);
// and so on, and so forth.
};
// each of those being a legit math c... | [
0.10089617967605591,
-0.3229905962944031,
0.5303515791893005,
-0.003265480976551771,
-0.28832677006721497,
-0.007131913676857948,
-0.17606104910373688,
-0.23480470478534698,
-0.0049440027214586735,
-0.6314307451248169,
0.002203940413892269,
0.6266348361968994,
0.009743569418787956,
-0.1495... | |
sense. Compare with [How do you make wrong code look wrong? What patterns do you use to avoid semantic errors?](https://stackoverflow.com/questions/26086/how-do-you-make-wrong-code-look-wrong-what-patterns-do-you-use-to-avoid-semantic/26174#26174).
In the example of Joel's article he discusses two cases:
* The case o... | [
0.25779989361763,
0.03061213530600071,
0.31347912549972534,
-0.002907722955569625,
-0.34951549768447876,
-0.07569868117570877,
0.5126502513885498,
-0.5574643611907959,
0.23627689480781555,
-0.8578465580940247,
0.1717994213104248,
0.6739104390144348,
-0.5468396544456482,
0.01333697605878114... | |
doesn't matter in this case, because the implicit conversion can still sanitize the string).
* The example of Microsoft Word where the programmers needed to distinguish between screen coordinates and document coordinates. This is the classical case where two distinct types offer a lot of advantages, even though these t... | [
0.012896819040179253,
-0.03218064457178116,
0.06269095838069916,
0.19323348999023438,
-0.32907816767692566,
-0.13974732160568237,
0.36357200145721436,
0.04900794103741646,
0.08147422969341278,
-0.8200174570083618,
-0.0603455975651741,
0.48627567291259766,
-0.2876758277416229,
-0.1469398736... | |
casts in the presence of appropriate overloads.
> Disadvantage 2, too many classes for every single thing, where do you draw the line?
Make as many custom types as you need (but not more). Some languages, such as Haskell, actually encourage the proliferation of types. The only thing that makes us hesitate in language... | [
0.4826664924621582,
0.07166275382041931,
-0.34161290526390076,
0.24423864483833313,
-0.2906387150287628,
-0.11537466943264008,
0.523861825466156,
-0.08289406448602676,
-0.08419899642467499,
-0.6842822432518005,
0.2942942976951599,
0.489078551530838,
-0.4604986011981964,
-0.1437326669692993... | |
simply balanced. | [
0.32194843888282776,
-0.12318684160709381,
-0.34062469005584717,
0.07700806111097336,
-0.3162956237792969,
-0.25215551257133484,
-0.05878860503435135,
0.10505171865224838,
0.01093299686908722,
-0.5018175840377808,
0.24602261185646057,
0.01191430538892746,
-0.04724093899130821,
0.0447967387... | |
This is a (hopefully) really simple question - I have been told recently that using C++ style initialisation is better than traditional (and more common) assignment.
So this code:
```
std::SomeSTLContainer::const_iterator it = container.begin();
std::SomeSTLContainer::const_iterator itEnd = container.end();
```
wou... | [
-0.3494211435317993,
0.11174719780683517,
0.2933051586151123,
-0.4034135043621063,
0.059895534068346024,
-0.2193799912929535,
-0.03301512077450752,
-0.10988129675388336,
-0.06269247084856033,
-0.5774091482162476,
-0.6003891825675964,
0.45708543062210083,
-0.15879224240779877,
-0.0795586109... | |
than traditional (and more common) assignment.
This is simply wrong.
> I understand the reason for this - the first example causes default construction and initialisation then subsequent assignment rather than specific construction and direct assignment in the second example. However, on modern processors / compilers... | [
0.14067411422729492,
0.28595903515815735,
-0.25006648898124695,
0.19552579522132874,
-0.14252260327339172,
-0.3316417932510376,
0.19213420152664185,
-0.2538362741470337,
-0.01755717769265175,
-0.30645719170570374,
-0.19256988167762756,
0.5786758661270142,
-0.5121302604675293,
0.11112920939... | |
as I've said, even this doesn't happen. | [
0.5542160272598267,
0.10635502636432648,
-0.05790114775300026,
0.13427045941352844,
0.3105003833770752,
0.013611693866550922,
0.30852529406547546,
0.37362006306648254,
-0.06924036890268326,
-0.1531171202659607,
0.18405702710151672,
0.32447633147239685,
-0.17197364568710327,
0.2963749468326... | |
I am not sure when I should use *anonymous types* instead of *local variables* in C#.
I have:
```
string fullMessage // This is the full message including sender and recipient names
string sender = GetMessagePart(fullMessage, "from");
string recipient = GetMessagePart(fullMessage, "to");
//do some stuff and delive... | [
-0.08000851422548294,
-0.23986995220184326,
0.5071746706962585,
-0.11962619423866272,
-0.08428221195936203,
-0.11129370331764221,
0.45869186520576477,
-0.14267483353614807,
-0.26724639534950256,
-0.3790785074234009,
-0.37674447894096375,
0.5273299217224121,
-0.4393980801105499,
0.149778500... | |
to know about the data within a single method, and it is read-only, then an anonymous type is handy (and this covers a lot of cases, in reality).
If you need to mutate the data or pass it out to a caller, then use either a bespoke class, or simple variables (etc).
In the case given, I can't see a reason to use an ano... | [
0.45108288526535034,
-0.2748560309410095,
-0.0042952243238687515,
0.329817533493042,
-0.08645793050527573,
-0.22706615924835205,
0.3013117015361786,
0.07909596711397171,
-0.15507133305072784,
-0.398806631565094,
-0.09813696146011353,
0.5438167452812195,
-0.47148072719573975,
0.200303524732... | |
When building a Delphi 2009 component package, how do you specify which directory should contain the resulting .hpp and .lib files needed for C++ Builder users?
There is a known bug: <http://qc.embarcadero.com/wc/qcmain.aspx?d=67513>
This is /expected/ to be fixed in the forthcoming Update 3. (Don't worry about the 10.... | [
-0.17620868980884552,
-0.05982017144560814,
0.49413609504699707,
-0.0651404857635498,
-0.123582623898983,
-0.407230406999588,
0.23982354998588562,
-0.1476430743932724,
-0.28026682138442993,
-0.12100810557603836,
-0.030321843922138214,
0.6354973316192627,
-0.5908896327018738,
-0.25970572233... | |
I feel the need to refactor my old CF5 based code into CFC's. We already have some code in ColdSpring and Transfer but feel a large rewrite to ColdSpring and Transfer is pointless.
What tips, approaches and gotchas will I hit.
How can I make this easy?
I don't mind keeping ColdSpring in the mix but Transfer is the ... | [
0.5141159296035767,
0.32614222168922424,
0.3673659861087799,
-0.10853444784879684,
-0.11062198877334595,
-0.21438093483448029,
0.41611218452453613,
0.24720565974712372,
-0.19640465080738068,
-0.6187193393707275,
0.30622661113739014,
0.10649701952934265,
0.08939824253320694,
0.3824943900108... | |
sake of it if it basically works would be introducing a lot of potential bugs into your system. I don’t think there is an easy way to do it.
If you look at the areas of your site which are 1: most likely to change and 2: executed the most you may be able to target some areas which could benefit from change and see ho... | [
0.45566946268081665,
0.2423952966928482,
0.17553633451461792,
0.16467635333538055,
-0.07155561447143555,
0.1764475703239441,
0.3240487575531006,
-0.17328456044197083,
0.09567243605852127,
-0.5674200654029846,
0.11508411914110184,
0.6518858671188354,
-0.06632451713085175,
-0.027796087786555... | |
need to do a major alteration to part of the system it may be worth looking at that from an OO perspective and moving the existing code over, where applicable. | [
0.4200815260410309,
0.1106736958026886,
0.2412564754486084,
-0.0036410088650882244,
0.4472392201423645,
-0.085086889564991,
-0.06463605910539627,
0.020300284028053284,
-0.27011623978614807,
-0.5728481411933899,
-0.3194403350353241,
0.09969198703765869,
-0.1026373952627182,
-0.1129962131381... | |
I'm want to learn a desktop programming language, preferably C, C++ or C#. I'm a PHP/HTML/CSS programmer and I would like to get into desktop applications. I need something pretty powerful and I would like to be able to create applications with Windows GUI's.
What would the Stack Overflow community recommend? Is ther... | [
0.7085124254226685,
0.33292752504348755,
0.1408773958683014,
0.3447076976299286,
0.09031389653682709,
-0.20825918018817902,
0.3030191659927368,
0.3038502335548401,
-0.2152164727449417,
-0.6421915292739868,
0.15952248871326447,
0.7184444069862366,
-0.005237450823187828,
0.09059835225343704,... | |
the new Microsoft toys in .NET. If you know your way around PHP, you should already be familiar with the syntax, object oriented concepts, exception handling, etc.
I suggest you don't complicate your life with C and definitely not with C++ if all you want is to create Windows GUIs. They do provide a good educational ... | [
0.17208486795425415,
-0.08249965310096741,
0.3837173581123352,
0.48346132040023804,
-0.03616755083203316,
0.07565180212259293,
-0.11799696832895279,
0.5059600472450256,
-0.024909811094403267,
-0.8751684427261353,
0.005940788891166449,
0.6462345719337463,
-0.13769525289535522,
0.18395048379... | |
that you can (realistically, heh) use for the web. ASP.NET is not a bad framework and might be worth investigating too. | [
0.4989925026893616,
-0.10151248425245285,
-0.009327135048806667,
0.5265616774559021,
0.033404555171728134,
-0.2965312600135803,
0.10112568736076355,
0.10980090498924255,
-0.3473866581916809,
-0.544121265411377,
-0.020391464233398438,
0.25330618023872375,
-0.008066173642873764,
-0.112122446... | |
I'm looking for access to financial data from Google services.
I found [this URL](http://finance.google.com/finance/info?client=ig&q=NASDAQ:MSFT) that gets the stock data for Microsoft.
What are all the possible parameters that Google allows for this kind of HTTP request? I'd like to see all the different informatio... | [
0.7781524658203125,
0.30662062764167786,
0.052992239594459534,
0.24865566194057465,
0.0008033517515286803,
0.07777699828147888,
-0.34870243072509766,
0.17433403432369232,
-0.2693377733230591,
-0.18238694965839386,
0.5321829915046692,
0.4974084794521332,
0.07261083275079727,
0.1805200278759... | |
but doesn't seem to be documented (as far as I've been able to find anyway).
Here is some information on [historical prices](http://computerprogramming.suite101.com/article.cfm/an_introduction_to_google_finance), just for reference sake. | [
0.4985343813896179,
0.09636106342077255,
0.12302243709564209,
0.11347397416830063,
0.48965615034103394,
-0.12253470718860626,
-0.5113997459411621,
0.42616981267929077,
-0.31427672505378723,
-0.10498657822608948,
0.08947157859802246,
0.6462281942367554,
0.404826283454895,
0.1251378953456878... | |
I am developing a small windows app, but have some trouble deciding whether to use .NET or not. As a coder I would like to make use of the .NET libraries. On the other hand, requiring my users to download the gargantuan .NET runtime seems like a horrible decision.
A 100 meg prerequisite might be alright for software i... | [
0.45299938321113586,
0.18825356662273407,
0.11788517981767654,
0.097871333360672,
0.028951866552233696,
-0.06253022700548172,
0.31177911162376404,
0.3307681381702423,
-0.02908162772655487,
-0.8500168919563293,
-0.0012994834687560797,
0.5836881995201111,
-0.07002831995487213,
0.112705230712... | |
run, I feel uneasy.
In your opinion/experience, is 2009 too early for a small app to go .NET? Should I wait for the bigger players to pave the way?
*Edit: Which versions, if any, come by default with XP SP2 and Vista?*
.NET is shipped with any recent version of Windows, so I doubt that you will be severely limited by... | [
0.5527867674827576,
-0.08200820535421371,
0.2949984669685364,
0.11947044730186462,
0.025338057428598404,
-0.29324010014533997,
0.447475790977478,
0.24656404554843903,
-0.6258676052093506,
-0.33182206749916077,
0.2534414231777191,
0.8792299032211304,
-0.17052993178367615,
-0.178044959902763... | |
it is no problem.
EDIT: It seems like I was mistaken regarding XP SP2. .NET 2.0 is not included in service pack 2 for XP. According to [wikipedia](http://en.wikipedia.org/wiki/.NET_Framework) W2003R2 was the first release to include .NET 2.0. | [
0.2710959315299988,
-0.23113703727722168,
0.5215379595756531,
-0.20101319253444672,
-0.6693265438079834,
-0.6849291920661926,
0.3598996698856354,
-0.3132324516773224,
-0.1356416791677475,
-0.4354648292064667,
-0.3438913822174072,
0.6017446517944336,
-0.47827431559562683,
-0.335890471935272... | |
I have the following example code:
```
class A(object):
def __init__(self, id):
self.myid = id
def foo(self, x):
print 'foo', self.myid*x
class B(A):
def __init__(self, id):
self.myid = id
self.mybid = id*2
def bar(self, x):
print 'bar', self.myid, self.mybid, x... | [
0.020793084055185318,
0.41342416405677795,
0.358924001455307,
-0.3859384059906006,
-0.029056791216135025,
0.3053729832172394,
0.05326717346906662,
-0.35747793316841125,
0.15300391614437103,
-0.8707312941551208,
0.1184995248913765,
0.5134093165397644,
-0.43134573101997375,
0.311211615800857... | |
30
>>> b.bar(12)
bar 3 6 12
```
Now lets say I have some more subclasses `class C(A):` and `class D(A):`. I also know that the id will always fit in either B, C or D, but never in 2 of them at the same time.
Now I would like to call A(23) and get an object of the correct subclass. Something like this:
> ```
> >>> t... | [
0.489552766084671,
0.12589004635810852,
0.24233920872211456,
-0.15886710584163666,
-0.20687803626060486,
0.1442927122116089,
0.10278007388114929,
-0.4476289451122284,
-0.21638749539852142,
-0.6628693342208862,
0.10512565076351166,
0.6780802011489868,
-0.3958788514137268,
-0.005486422684043... | |
pattern](http://en.wikipedia.org/wiki/Abstract_factory_pattern), and your factory would then build any object you like, depending on provided parameters. That way your code will remain clean and extensible.
Any hack you could use to make it directly can be removed when you upgrade your interpreter version, since no on... | [
0.7128241062164307,
-0.09257728606462479,
0.16016408801078796,
-0.30761203169822693,
-0.11809291690587997,
0.10181138664484024,
0.2171003669500351,
-0.012136140838265419,
-0.40525832772254944,
-0.728536069393158,
0.31941428780555725,
0.3005349338054657,
-0.6605204939842224,
0.0728812664747... | |
I'm currently working on a project where I've created a CA cert and a couple of child certs to that CA cert. The certificates are going to be used to protect inter-server communication in a SAMLV2 setup so I'm going to have a cert for the identity provider and a cert for the service provider. The user/browser isn't goi... | [
0.5494385957717896,
0.443351686000824,
0.5059857368469238,
0.09415889531373978,
0.07665844261646271,
-0.04116673395037651,
0.014446116983890533,
-0.09255285561084747,
-0.07893427461385727,
-0.55437833070755,
0.22231775522232056,
0.5819493532180786,
0.026788359507918358,
0.05149944126605987... | |
production. But when I ask why, people usually just mutters something about security but never go into the details. Are there any technical reasons not to use my own certs in production? I can't think of any... Of course I realize that if I lose control of my root cert anyone could start creating all sorts of certifica... | [
0.5432884693145752,
0.26793068647384644,
0.35171234607696533,
0.006418608129024506,
-0.1006660982966423,
0.012129922397434711,
0.13277263939380646,
0.08625869452953339,
-0.5176288485527039,
-0.2558949887752533,
-0.35069793462753296,
0.30370041728019714,
0.1181471198797226,
0.37118169665336... | |
problem, this solution (using home-made certs in production) would still be better than the login setup we have today.
Ask yourself what a certificate proves.
If you get a certificate issued by a reputable CA, then it proves that the certificate holder has verified their identity to that CA, to their standards of proo... | [
0.5375345349311829,
0.38129493594169617,
0.026767157018184662,
0.354390412569046,
0.3133033812046051,
-0.10502979159355164,
-0.07976338267326355,
-0.187136709690094,
-0.2818583846092224,
-0.15856556594371796,
0.22899332642555237,
0.40902289748191833,
0.09404463320970535,
-0.136558368802070... | |
make this very secure indeed (by keeping the CA private key in a safe place offline, and making signing a sneakernet exercise).
The difficulty would be if you needed to persuade anyone else to trust your CA. Why should they? You would need to convince them that it was safe to do so, and they would have the admin overh... | [
0.37002718448638916,
0.21929480135440826,
0.33599987626075745,
0.07548829913139343,
0.31928834319114685,
-0.26137685775756836,
0.06160826236009598,
-0.2264382243156433,
-0.06886585801839828,
0.06285932660102844,
0.1608366221189499,
0.331508070230484,
0.16028806567192078,
-0.317872822284698... | |
How do I write a sub-select in LINQ.
If I have a list of customers and a list of orders I want all the customers that have no orders.
This is my pseudo code attempt:
```
var res = from c in customers
where c.CustomerID ! in (from o in orders select o.CustomerID)
select c
```
How about:
```
var res = from c ... | [
0.11456765979528427,
-0.0674806460738182,
0.5200542211532593,
-0.16012877225875854,
0.24988023936748505,
0.33167168498039246,
-0.00028689554892480373,
-0.4069133996963501,
-0.29450541734695435,
-0.5555471181869507,
-0.20731137692928314,
0.6692270636558533,
-0.2269284427165985,
0.0080604227... | |
join o in orders
on c.CustomerID equals o.customerID
into customerOrders
where customerOrders.Count() == 0
select c;
```
Are you using LINQ to SQL or something else, btw? Different flavours may have different "best" ways of doing it | [
0.3545648157596588,
0.05124271288514137,
0.5853803157806396,
-0.3309338092803955,
0.20164132118225098,
0.27582043409347534,
-0.2172415554523468,
-0.03352489694952965,
-0.1577213555574417,
-0.24307924509048462,
-0.06588946282863617,
0.4315803647041321,
-0.2060348093509674,
0.089238092303276... | |
I've set up Textpattern's hak\_tinymce plugin on a website I run, and it works great in Firefox, Chrome, Safari and Opera. However, in IE the content area is gray (e.g. it just isn't there), and the Javascript fails with this error:
```
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6... | [
-0.0422397255897522,
0.2780568301677704,
0.9933243989944458,
-0.10405062139034271,
0.1258390098810196,
-0.1912069469690323,
0.7309402227401733,
0.05216027423739433,
-0.3318478465080261,
-0.7167893052101135,
-0.18475094437599182,
0.8907005786895752,
-0.24339719116687775,
0.11745355278253555... | |
have a src element in MSIE HTTPs breaks aswell as absoute URLs
if (tinyMCE.isMSIE)
iframe.setAttribute("src", this.settings['default_document']);
iframe.style.width = tinyMCE.settings['area_width'];
iframe.style.height = tinyMCE.settings['area_height']; // ** THIS LINE! **
// MSIE 5.0 issue
if (tinyMCE.isMSIE)
... | [
0.19644704461097717,
-0.007092552725225687,
0.7804896235466003,
-0.2771320044994354,
0.24763546884059906,
-0.2287299633026123,
0.38035571575164795,
-0.2527199685573578,
-0.3088546097278595,
-0.6313362121582031,
-0.23025277256965637,
0.3942925035953522,
-0.3168940842151642,
0.15089619159698... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.