text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
[MS Excel](http://en.wikipedia.org/wiki/Microsoft_Excel) has eaten my head. It is randomly converting numbers into scientific notation format. This causes a problem when I load the file saved in tab delimited format into SQL Server. I know I can provide a format file and do lot of fancy stuff. But let's say I can't.
... | [
-0.28458186984062195,
0.5938838720321655,
0.15994323790073395,
-0.14961077272891998,
-0.20607109367847443,
0.108002208173275,
-0.048516370356082916,
0.0888565182685852,
-0.2906001806259155,
-0.6641421914100647,
0.33127471804618835,
0.1538355052471161,
-0.4125615358352661,
0.135150998830795... | |
program to resolve this issue. Hope it's of use.
### Input:
Input directory where files reside (assuming files are in .txt format).
### Output:
Output directory where converted files will be spit out.
### Delimiter:
Column delimiter.
### The code
```
using System;
using System.Text.RegularExpressions;
using Sys... | [
0.2249581217765808,
-0.14248129725456238,
0.4376163184642792,
-0.37505632638931274,
0.2004392147064209,
0.3034665882587433,
0.23108196258544922,
-0.2742491066455841,
-0.2832363247871399,
-0.5163504481315613,
-0.4640713334083557,
0.7182875871658325,
-0.5969874262809753,
0.12046997994184494,... | |
from scientific notation, just return it:
if (!str.Contains("E"))
return str;
var positive = true;
if (input < 0)
{
positive = false; | [
0.2770358622074127,
0.2552148103713989,
0.3134721517562866,
-0.2750363349914551,
0.12762725353240967,
-0.18600191175937653,
0.2931728661060333,
-0.5362855792045593,
0.27300164103507996,
-0.23298679292201996,
-0.4410175681114197,
0.6816380023956299,
-0.34602299332618713,
0.10395129770040512... | |
}
string sep = Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator;
char decSeparator = sep.ToCharArray()[0];
string[] exponentParts = str.Split('E');
string[] decimalParts = exponentParts[0].Split(decSeparator);
// Fix missing decimal p... | [
-0.23704566061496735,
-0.3735192120075226,
0.16890773177146912,
-0.0011197371641173959,
0.22695627808570862,
0.4663570821285248,
0.11560732126235962,
0.08779967576265335,
-0.44141528010368347,
0.13432900607585907,
-0.03879722207784653,
0.21898792684078217,
-0.2016325294971466,
0.2055219113... | |
decimalParts = new string[] { exponentParts[0], "0" };
int exponentValue = int.Parse(exponentParts[1]);
string newNumber = decimalParts[0].Replace("-","").
Replace("+","") + decimalParts[1];
string result;
if (exponentValue > 0) | [
-0.29058516025543213,
-0.3511693775653839,
0.4018633961677551,
-0.1253497302532196,
0.042423050850629807,
0.2654285728931427,
0.24589861929416656,
-0.33803242444992065,
0.023704227060079575,
-0.10184304416179657,
-0.5444006323814392,
0.6725596785545349,
-0.14610423147678375,
-0.16555757820... | |
{
if(positive)
result =
newNumber +
GetZeros(exponentValue - decimalParts[1].Length); | [
-0.07935845851898193,
-0.29606950283050537,
0.4636191725730896,
-0.382524311542511,
0.420507550239563,
-0.0007034557056613266,
0.2862946391105652,
-0.49378788471221924,
-0.03914389759302139,
-0.17780821025371552,
-0.5810207724571228,
0.6976014971733093,
0.05050823092460632,
0.0478822477161... | |
else
result = "-"+
newNumber +
GetZeros(exponentValue - decimalParts[1].Length);
} | [
-0.11912773549556732,
-0.3641018867492676,
0.30218881368637085,
-0.22690598666667938,
0.2157987505197525,
0.013768103905022144,
0.2202364057302475,
-0.49121955037117004,
-0.01759319007396698,
-0.08862423151731491,
-0.3763374984264374,
0.6615074276924133,
0.11538904905319214,
-0.02999039366... | |
else // Negative exponent
{
if(positive)
result =
"0" + | [
-0.07038398832082748,
0.017647171393036842,
0.1374252587556839,
-0.3795570731163025,
0.16811580955982208,
-0.05306590721011162,
0.10669389367103577,
-0.2969832718372345,
0.11754769086837769,
0.14930784702301025,
-0.2425621598958969,
0.8519795536994934,
0.06300472468137741,
-0.2984903752803... | |
decSeparator +
GetZeros(exponentValue + decimalParts[0].Replace("-", "").
Replace("+", "").Length) + newNumber;
else | [
-0.13120165467262268,
-0.26131120324134827,
0.22089919447898865,
0.0032716423738747835,
0.10194949805736542,
0.2876788079738617,
0.2258562296628952,
-0.3131534457206726,
-0.15322239696979523,
-0.4079098105430603,
-0.35310181975364685,
0.5653694272041321,
-0.32031741738319397,
0.05362537875... | |
result =
"-0" +
decSeparator +
GetZeros(exponentValue + decimalParts[0].Replace("-", ""). | [
-0.31838497519493103,
-0.21375615894794464,
0.421135812997818,
-0.008707786910235882,
0.14797769486904144,
0.0832773968577385,
0.16930648684501648,
-0.44079458713531494,
-0.024416329339146614,
-0.11155326664447784,
-0.4933364689350128,
0.4955727756023407,
-0.16346150636672974,
-0.071529805... | |
Replace("+", "").Length) + newNumber;
result = result.TrimEnd('0');
}
float temp = 0.00F;
if (float.TryParse(result, out temp))
{
return result; | [
0.2461080402135849,
-0.2579532861709595,
0.551864743232727,
-0.3570435643196106,
0.4930155575275421,
0.07387123256921768,
0.39389514923095703,
-0.9162806868553162,
0.1587458848953247,
-0.17670240998268127,
-0.3719998896121979,
0.7363711595535278,
-0.19476483762264252,
-0.05452430993318558,... | |
}
throw new Exception();
}
private static string GetZeros(int zeroCount)
{
if (zeroCount < 0)
zeroCount = Math.Abs(zeroCount);
StringBuilder sb = new StringBuilder(); | [
-0.10938013345003128,
-0.37111154198646545,
0.2501625716686249,
-0.26280638575553894,
0.1213899701833725,
0.050968099385499954,
0.5564340949058533,
-0.5309555530548096,
-0.12276338785886765,
-0.3938412368297577,
-0.341382771730423,
0.44051527976989746,
-0.48870372772216797,
0.0531896539032... | |
for (int i = 0; i < zeroCount; i++) sb.Append("0");
return sb.ToString();
}
static void Main(string[] args)
{
//Get Input Directory.
Console.WriteLine(@"Enter the Input Directory"); | [
-0.10833313316106796,
-0.09242100268602371,
0.5440906882286072,
-0.6946094036102295,
0.3467702865600586,
0.29526200890541077,
0.572313666343689,
-0.4386039674282074,
0.146543487906456,
-0.4225349426269531,
-0.4206945598125458,
0.3949384093284607,
-0.5715540647506714,
0.21639800071716309,
... | |
var readLine = Console.ReadLine();
if (readLine == null)
{
Console.WriteLine(@"Enter the input path properly.");
return;
}
var pathToInputDirectory = readLine.Trim(); | [
-0.2345527857542038,
-0.5429088473320007,
0.4279206395149231,
-0.22236911952495575,
0.4555462598800659,
0.0047161150723695755,
0.494326651096344,
-0.29696840047836304,
0.21790950000286102,
-0.7480209469795227,
-0.28640303015708923,
0.6060023903846741,
-0.24961760640144348,
-0.0857100337743... | |
//Get Output Directory.
Console.WriteLine(@"Enter the Output Directory");
readLine = Console.ReadLine();
if (readLine == null)
{
Console.WriteLine(@"Enter the output path properly.");
return; | [
-0.10254988819360733,
-0.11914511024951935,
0.5797876119613647,
-0.36604541540145874,
0.5275274515151978,
0.03505637124180794,
0.39246875047683716,
-0.0930938720703125,
0.3422605097293854,
-0.6061686873435974,
-0.48200491070747375,
0.6507105827331543,
-0.1737259030342102,
0.087379775941371... | |
}
var pathToOutputDirectory = readLine.Trim();
//Get Delimiter.
Console.WriteLine("Enter the delimiter;");
var columnDelimiter = (char) Console.Read();
//Loop over all files in the directory.
foreach | [
-0.13932359218597412,
-0.2802463173866272,
0.2881700396537781,
-0.3638891279697418,
0.37005919218063354,
0.276569664478302,
0.4913366734981537,
-0.39254114031791687,
0.12802599370479584,
-0.5442295074462891,
-0.08392252027988434,
0.5201118588447571,
-0.4173811674118042,
-0.0345538631081581... | |
(var inputFileName in Directory.GetFiles(pathToInputDirectory))
{
var outputFileWithouthNumbersInScientificNotation = string.Empty;
Console.WriteLine("Started operation on File : " + inputFileName);
if (File.Exists(inputFileName))
{ | [
-0.17559893429279327,
-0.31282874941825867,
0.8613126873970032,
-0.38189688324928284,
0.5099510550498962,
0.07265625894069672,
0.6255258321762085,
-0.2822137773036957,
-0.021601935848593712,
-0.5570198893547058,
-0.21730509400367737,
0.7460852265357971,
-0.09371732920408249,
0.167048200964... | |
// Read the file
using (var file = new StreamReader(inputFileName))
{
string line; | [
0.09194376319646835,
-0.5489131808280945,
0.451864629983902,
-0.2867910861968994,
0.41749659180641174,
0.10722413659095764,
0.312826544046402,
-0.11017974466085434,
0.2005782276391983,
-0.43920034170150757,
-0.45196887850761414,
0.5868702530860901,
-0.2848910093307495,
0.41192373633384705,... | |
while ((line = file.ReadLine()) != null)
{
String[] columns = line.Split(columnDelimiter);
var duplicateLine = string.Empty; | [
0.026021065190434456,
-0.3166196942329407,
0.18308620154857635,
-0.20858052372932434,
0.10209070891141891,
0.42584794759750366,
0.4173777103424072,
-0.22356484830379486,
-0.3938434422016144,
-0.11366495490074158,
-0.273965060710907,
0.277683824300766,
-0.5360041856765747,
0.231678366661071... | |
int lengthOfColumns = columns.Length;
int counter = 1;
foreach (var column in columns) | [
-0.21602457761764526,
0.07962626218795776,
0.3533044755458832,
-0.46803200244903564,
-0.06130853295326233,
0.27266600728034973,
0.27237996459007263,
-0.4417040944099426,
-0.2681675851345062,
-0.13630612194538116,
-0.17792148888111115,
0.15150614082813263,
-0.19464342296123505,
-0.069024741... | |
{
var columnDuplicate = column;
try | [
-0.363902747631073,
0.01669124886393547,
0.22484824061393738,
-0.31354695558547974,
0.19397617876529694,
0.3086388111114502,
0.4256519377231598,
0.08816125243902206,
0.0026525259017944336,
-0.14670026302337646,
-0.19392040371894836,
0.5740891695022583,
-0.2898804843425751,
0.09473980963230... | |
{
if (Regex.IsMatch(columnDuplicate.Trim(), | [
-0.3096754848957062,
-0.2563461661338806,
0.23922914266586304,
-0.19169503450393677,
0.6045474410057068,
-0.11598460376262665,
0.07791882008314133,
-0.3215703070163727,
0.31133437156677246,
-0.365742951631546,
-0.28156378865242004,
0.515590488910675,
-0.24252963066101074,
-0.18001756072044... | |
@"^[+-]?[0-9]+(\.[0-9]+)?[E]([+-]?[0-9]+)$",
RegexOptions.IgnoreCase)) | [
0.020169615745544434,
-0.04050162434577942,
0.4372505247592926,
-0.16847927868366241,
0.49812760949134827,
0.10437082499265671,
0.6586359143257141,
-0.16910295188426971,
-0.14865483343601227,
-0.30747056007385254,
-0.32669320702552795,
0.6243345141410828,
-0.4515956938266754,
0.05795676633... | |
{
Console.WriteLine("Regular expression matched for this :" + column);
columnDuplicate = ToLongString(Double.Parse | [
-0.235593780875206,
-0.136546328663826,
0.5377774238586426,
-0.3678014874458313,
0.4833604097366333,
0.22846916317939758,
0.3185352087020874,
-0.23935654759407043,
0.11193454265594482,
-0.1854734867811203,
-0.11049271374940872,
0.6611229777336121,
-0.3268469572067261,
0.0724969357252121,
... | |
(column, | [
-0.4150940477848053,
0.3122360110282898,
0.3431852161884308,
-0.025129983201622963,
0.0582609549164772,
-0.05346590653061867,
0.4839916527271271,
-0.1295284628868103,
-0.13085734844207764,
-0.25865495204925537,
-0.1677955985069275,
0.09837793558835983,
-0.17698554694652557,
-0.260269463062... | |
System.Globalization.NumberStyles.Float));
Console.WriteLine("Converted this no in scientific notation " + | [
-0.17518936097621918,
-0.38822218775749207,
0.5930590629577637,
0.11050570011138916,
0.21732936799526215,
0.09868369251489639,
0.03991017863154411,
0.11231730878353119,
-0.08614141494035721,
-0.6455503702163696,
-0.2583877444267273,
0.20629771053791046,
-0.10475669056177139,
0.417238295078... | |
"" + column + " to this number " + | [
-0.05339992046356201,
0.3346641957759857,
0.6926828622817993,
-0.18747760355472565,
-0.01768154837191105,
0.12792932987213135,
0.0030321194790303707,
-0.4165782332420349,
-0.17700502276420593,
-0.17391060292720795,
-0.26177945733070374,
0.04358523711562157,
-0.4063072204589844,
0.249369040... | |
columnDuplicate);
}
} | [
-0.5785784721374512,
-0.1416759490966797,
0.5223152041435242,
-0.48773127794265747,
0.11068511754274368,
0.2483055740594864,
0.33754509687423706,
0.21647636592388153,
-0.10484171658754349,
-0.35620081424713135,
-0.1959473043680191,
0.6470357775688171,
-0.5005485415458679,
0.299752593040466... | |
catch (Exception)
{
} | [
0.1793951690196991,
-0.2898980975151062,
-0.3194405138492584,
-0.089603491127491,
0.19111211597919464,
-0.5386304259300232,
0.20759251713752747,
0.08708961308002472,
-0.22659613192081451,
-0.004618731327354908,
-0.3816891014575958,
0.5012398362159729,
-0.4669261574745178,
-0.17201939225196... | |
duplicateLine = duplicateLine + columnDuplicate;
if (counter != lengthOfColumns)
{ | [
0.0637221485376358,
-0.20212222635746002,
0.3647564649581909,
-0.12844347953796387,
0.22069719433784485,
0.33453452587127686,
0.26265186071395874,
-0.137899711728096,
-0.26118722558021545,
-0.3016664385795593,
0.10063618421554565,
0.1506354957818985,
-0.30079537630081177,
0.464126914739608... | |
duplicateLine = duplicateLine + columnDelimiter.ToString();
}
counter++; | [
-0.1430855542421341,
-0.20866970717906952,
0.29089614748954773,
-0.21290625631809235,
0.056095756590366364,
0.33820751309394836,
0.2624525725841522,
-0.23077797889709473,
-0.2598649561405182,
-0.4404779374599457,
-0.07816962897777557,
0.2104884535074234,
-0.47447943687438965,
0.17301248013... | |
}
duplicateLine = duplicateLine + Environment.NewLine;
outputFileWithouthNumbersInScientificNotation = outputFileWithouthNumbersInScientificNotation + duplicateLine; | [
-0.10348829627037048,
0.15893931686878204,
0.002214436884969473,
-0.1027732640504837,
0.4052230417728424,
0.3001876175403595,
0.5515900254249573,
0.18541985750198364,
-0.26400697231292725,
-0.4736468493938446,
0.0752331092953682,
0.3940439522266388,
-0.5601747632026672,
0.3322562873363495,... | |
}
file.Close();
}
var outputFilePathWithoutNumbersInScientificNotation
= Path.Combine(pathToOutputDirectory, Path.GetFileName(inputFileName)); | [
-0.014463361352682114,
-0.42262810468673706,
0.5338954925537109,
-0.34206271171569824,
0.3491833806037903,
0.185003399848938,
0.5268932580947876,
-0.5491672158241272,
-0.0156507957726717,
-0.6317804455757141,
-0.006345878355205059,
0.7247309684753418,
-0.43408697843551636,
-0.0072237499989... | |
//Create the directory if it does not exist.
if (!Directory.Exists(pathToOutputDirectory))
Directory.CreateDirectory(pathToOutputDirectory);
using (var outputFile = | [
0.2894701361656189,
-0.2949972152709961,
0.37447836995124817,
0.06575863808393478,
0.480673611164093,
-0.011364967562258244,
0.5246908664703369,
-0.1859969198703766,
-0.06042338162660599,
-0.674324631690979,
-0.16608458757400513,
0.37533703446388245,
-0.35127174854278564,
0.096757993102073... | |
new StreamWriter(outputFilePathWithoutNumbersInScientificNotation))
{
outputFile.Write(outputFileWithouthNumbersInScientificNotation);
outputFile.Close(); | [
-0.2524585425853729,
-0.19079171121120453,
0.8589878678321838,
-0.2505178153514862,
0.524510383605957,
0.242085799574852,
0.3827550411224365,
-0.04541222006082535,
0.3089373707771301,
-0.7150861620903015,
-0.299904465675354,
0.6912808418273926,
-0.27076026797294617,
0.31864163279533386,
... | |
}
Console.WriteLine("The transformed file is here :" +
outputFilePathWithoutNumbersInScientificNotation);
}
}
}
}
}
```
This works fairly well in case of huge files which | [
-0.22781550884246826,
-0.1431051790714264,
0.45008137822151184,
-0.21324501931667328,
0.26424142718315125,
-0.2858949899673462,
0.16314063966274261,
-0.045160453766584396,
0.05739463493227959,
-0.6367002725601196,
-0.23101064562797546,
0.8147607445716858,
-0.1327964961528778,
0.06744992733... | |
we are unable to open in MS Excel. | [
0.27512016892433167,
0.41816940903663635,
0.48855623602867126,
0.014746243134140968,
0.4380371868610382,
0.1134813129901886,
0.4287802577018738,
0.2722933888435364,
0.27493903040885925,
-0.7057854533195496,
-0.13650073111057281,
0.2695874869823456,
0.21256224811077118,
0.3665860593318939,
... | |
I have, what I estimate, to be a simple problem. I have a side bar on my page with its own unique color and I would like it to grow and shrink based on the text in the main content area so that it stretches from the nav bar to the footer. I tried setting a height on it but that just forces the whole content area to hav... | [
0.24215462803840637,
0.22479918599128723,
0.4130842089653015,
-0.04018927738070488,
0.01941756159067154,
0.16336272656917572,
-0.25694745779037476,
0.3075603246688843,
-0.28194576501846313,
-0.6317031979560852,
0.22767120599746704,
-0.07273121178150177,
0.04893474653363228,
0.2768949270248... | |
CSS for the sidebar (if I need to post more code please let me know):
```
.LeftSidebar
{
float: left;
background-color: #1b619c;
color: White;
width: 175px;
text-align: center;
padding: 20px;
clear:both;
}
```
I am still trying to learn so any help would be appreciated. Thanks in advance!
What you are looking for is... | [
0.030671795830130577,
0.1785617619752884,
0.4179864525794983,
-0.2259756326675415,
-0.43873628973960876,
0.23793038725852966,
0.24430552124977112,
0.15484391152858734,
-0.40445342659950256,
-0.7666841745376587,
-0.04183090105652809,
0.05733766406774521,
-0.3678815960884094,
-0.187586128711... | |
display: table; }
div#LeftSidebar { display: table-cell; }
div#MainContent { display: table-cell; }
```
I am showing ID's because the only time you should be using a class is when there are multiple references to that class on the same page.
However it's going to be a bit more complicated than just modifying the cs... | [
0.06134175509214401,
0.2624417245388031,
0.453081876039505,
-0.20014089345932007,
-0.32920584082603455,
-0.3086651861667633,
0.20739299058914185,
0.15243443846702576,
0.012980861589312553,
-0.872900664806366,
-0.037327393889427185,
0.366089791059494,
-0.23235341906547546,
-0.11859720945358... | |
Given two strings, I'd like to be able to -- in Python -- be able to determine which words have been added and which words have been removed between the two. I've seen difflib, but apparently it cannot do it.
For example: given 'hello my name is' and 'hello my guys is', it would return ['guys'] as added words, and ['n... | [
0.12694783508777618,
-0.013552396558225155,
0.21823157370090485,
-0.13261252641677856,
-0.34391433000564575,
0.0014787566615268588,
0.13734887540340424,
0.392971932888031,
-0.1842910349369049,
-0.29255974292755127,
-0.35837414860725403,
0.3206891119480133,
-0.37314632534980774,
0.044123500... | |
with regexp "\b". I'll give it a try.
This isn't particularly pretty but seems to work for most cases I can think of. I'm sure this can be tidied up a lot too and should be easy to make case insensitive.
```
def freqs(list):
words = {}
for word in list:
words[word] = words.get(word, 0) + 1
return w... | [
0.019604744389653206,
0.025206871330738068,
0.3097967803478241,
-0.6279781460762024,
-0.25454631447792053,
0.265826553106308,
0.2561700642108917,
-0.385754257440567,
-0.21998190879821777,
-0.4124149680137634,
-0.3188410997390747,
0.9357353448867798,
-0.5710607767105103,
-0.1912049055099487... | |
for key in af:
num = bf.get(key)
if num == None:
if af[key] > 1:
words = [key]*af[key]
removed.extend(words)
else: | [
-0.2421996146440506,
-0.13001784682273865,
0.6355299353599548,
-0.7092063426971436,
0.0008860036032274365,
0.12145105749368668,
0.19875817000865936,
-0.6297689080238342,
-0.02450803481042385,
-0.39460963010787964,
-0.5575037002563477,
0.541547954082489,
-0.18150445818901062,
-0.15648244321... | |
removed.append(key)
for key in bf:
num = af.get(key)
if num == None:
added.append(key)
elif num > 1:
words = [key]*(num-1)
removed.extend(words)
return added, removed
a = 'hello hello hello my name is Dave dave bar foo'
b = 'hello my | [
-0.1483631581068039,
0.2959166467189789,
0.7797531485557556,
-0.8292433619499207,
-0.04386516660451889,
0.33829265832901,
0.339970201253891,
-0.09278138726949692,
0.11506287008523941,
-0.2359355390071869,
-0.3086596429347992,
0.3497944474220276,
-0.6727554798126221,
0.3674013018608093,
0... | |
guys is test easy rob dave beef foo'
added, removed = added_and_removed(a, b)
print added
print removed
```
gives
```
['beef', 'rob', 'easy', 'test', 'guys']
['bar', 'name', 'Dave', 'hello', 'hello']
``` | [
0.13901929557323456,
0.44592779874801636,
0.19160039722919464,
-0.22580058872699738,
0.09738793224096298,
-0.016499094665050507,
0.19444793462753296,
0.10738131403923035,
0.2526607811450958,
-0.1930406093597412,
-0.34113451838493347,
0.857222318649292,
-0.4480719268321991,
-0.4555103778839... | |
Is Scala a good choice to implement a well scalable MMORPG? I read about people suggesting Erlang, because better concurrency handling. But Scala has actors/message driven concurrency and functional programming. Should not that handle the concurrency and scaling also well?
Sorry I don't know Erlang and also don't have... | [
0.0428474098443985,
-0.1500435173511505,
0.22285906970500946,
0.253338098526001,
-0.06011723726987839,
0.14601434767246246,
-0.2973138093948364,
0.0627933144569397,
-0.4955580532550812,
-0.5397794842720032,
0.2165416032075882,
0.38213062286376953,
-0.47082123160362244,
-0.09816951304674149... | |
are available for other platforms (especially C++). Erlang's fault-tolerance and scalability are legendary, but if you use the Akka framework you'll have a comparable set of capabilities (for the most part).
One advantage to using Scala is that you can take advantage of Project Darkstar, a Java-based platform for MMOR... | [
0.2652449607849121,
-0.14938490092754364,
0.05743657797574997,
-0.018637418746948242,
0.1839117705821991,
-0.28624916076660156,
-0.2128157615661621,
-0.009762831963598728,
-0.5482649207115173,
-0.44837304949760437,
-0.046268876641988754,
0.3205263316631317,
-0.3780003488063812,
0.141315147... | |
If user types words "sub search amazon" into google, he can find result like: 
How does Amazon does the search at the same time when user does seach with google directly (not with Amazon)? How can I perform such search as Amazon does on my own site?
If... | [
0.4988785982131958,
0.12381637096405029,
0.592007040977478,
-0.1937682181596756,
-0.16753830015659332,
0.23029303550720215,
0.23191329836845398,
-0.2724894881248474,
-0.3353687524795532,
-0.5706364512443542,
-0.10967904329299927,
0.3309597373008728,
-0.08443520963191986,
0.3691402971744537... | |
(sometimes referred to as the Application Layer) that basically mimics the API that the web service presents. This is an assembly that can be referenced directly if I do not want to distribute this service. Then the actual web service is just a thin layer on top of the Service Layer that provides the actual WCF binding... | [
0.8145349025726318,
0.029519591480493546,
0.6101943850517273,
-0.04806972295045853,
-0.11172115057706833,
-0.1938534826040268,
-0.15149201452732086,
-0.0879380851984024,
-0.008599850349128246,
-0.7541674971580505,
0.14590142667293549,
0.6255269050598145,
-0.38830071687698364,
0.28015121817... | |
The implementation of the addAll method in java.util.Collections simply loops through the source collection and calls the add method of the receiving collection for each element in the source collection.
Thus, resizing of the receiving collection's underlying data structure could occur multiple times if the capacity o... | [
0.042404934763908386,
-0.23843246698379517,
0.1516704261302948,
-0.02346513420343399,
-0.04503597691655159,
0.08924591541290283,
-0.17086352407932281,
-0.48044902086257935,
-0.30436551570892334,
-0.5663431286811829,
-0.19233804941177368,
0.3270873725414276,
-0.5332175493240356,
0.034607574... | |
Does such a utility method exist? And if not, why not?
**Clarification:** I realize that there are implementation specific addAll methods (as in ArrayList) that have this desired behavior. I am wondering if there are Collection utility classes that will get me this behavior in a way that works across all Collection im... | [
0.2981533408164978,
-0.2815358638763428,
0.08569459617137909,
0.1616491973400116,
-0.1257503628730774,
-0.08980821073055267,
-0.07531718909740448,
-0.1220550537109375,
-0.21793699264526367,
-0.588716983795166,
-0.0033054298255592585,
0.5321007370948792,
-0.5367282032966614,
-0.061537906527... | |
completely different :-) | [
0.12185196578502655,
-0.012223951518535614,
0.14829538762569427,
0.01992756687104702,
-0.16081500053405762,
0.2114255577325821,
0.23633155226707458,
-0.028918160125613213,
-0.19155758619308472,
-0.31549015641212463,
-0.05819866433739662,
0.3502439558506012,
-0.345160573720932,
0.1337011307... | |
I wanted to get some feedback on your thoughts of storing entire objects into a session? For example, a customer object. Once a customer logs into their control panel, instead of re-fetching their data each time it is needed from a ID stored in a session, what are the pros and cons of storing the entire customer object... | [
0.3074914515018463,
0.03333110362291336,
0.13721266388893127,
0.10566767305135727,
0.016437027603387833,
0.010147890076041222,
-0.04323215410113335,
0.16123291850090027,
-0.4037857949733734,
-0.24015676975250244,
0.15688902139663696,
0.6172044277191162,
-0.3237306475639343,
0.0449329875409... | |
a null session or after an update is made.
Aside of that, is there any other issues I should be aware of doing it this way? It seems this would be much better as far as programming and also make far less calls to the database. Thoughts anyone?
This is not a good idea.
The main reason for that is the way ORMappers wor... | [
0.6311238408088684,
0.15322643518447876,
0.08333831280469894,
0.2585255205631256,
-0.08236490935087204,
-0.14330534636974335,
0.39726704359054565,
0.1754043996334076,
-0.3157089650630951,
-0.3465486168861389,
0.26754823327064514,
0.3840218782424927,
-0.30879777669906616,
0.2560799121856689... | |
use. Sonner or later you would start to get exceptions.
Personally I prefer an approach where a simple object containing the Customer's ID (and probably other attributes) is stored in a session (or in the custom data section of the forms cookie) and I wrap the access to the customer object in a simple statement which ... | [
0.28754040598869324,
0.1789558082818985,
0.5186905264854431,
-0.03818639740347862,
0.04582067206501961,
-0.10188744217157364,
0.014519105665385723,
-0.0989079624414444,
-0.317110151052475,
-0.7375772595405579,
-0.21882818639278412,
0.6073667407035828,
-0.060948967933654785,
0.1224554181098... | |
{
int id = retrieve_the_id;
using ( DbContext ctx = GetCurrentDbContext() )
{
HttpContext.Current.Items.Add( CUSTOMERITEM, ctx.Customers.FirstOrDefault( c => c.ID == id );
}
}
return | [
-0.2018067091703415,
-0.21422630548477173,
0.672816812992096,
-0.20057208836078644,
0.142246276140213,
0.2710767984390259,
0.018948949873447418,
-0.3559473752975464,
0.02742811106145382,
-0.5321390628814697,
-0.3706325888633728,
0.4423658549785614,
-0.24239829182624817,
0.2696811556816101,... | |
(Customer)HttpContext.Current.Items[CUSTOMERITEM];
}
}
```
Items container lasts only for the time of one request. The snippet above makes sure that the object is loaded only once per request.
Of course, this comes with a price of one additional query per request comparing to your approach. But the advantage is ... | [
-0.008418388664722443,
0.11317779123783112,
0.7050266265869141,
-0.1433103233575821,
-0.051427777856588364,
0.20741677284240723,
0.06438204646110535,
-0.08018464595079422,
-0.2963019609451294,
-0.5713657140731812,
-0.2528439164161682,
0.5690554976463318,
-0.14584633708000183,
0.09799797832... | |
the customer object
}
``` | [
-0.22289641201496124,
0.49558597803115845,
0.12960310280323029,
-0.11497671902179718,
0.14357981085777283,
0.24525387585163116,
-0.10922328382730484,
0.5526849031448364,
0.2255108505487442,
-0.30499187111854553,
-0.466296911239624,
0.8283917903900146,
-0.33022263646125793,
0.35167756676673... | |
I have imported some text from `ISO-8859-1` to a `UTF8` database
after import i found that ` ` has become two weird characters `Â*`
when I checked this with phpmyadmin I found it looks like `Â` the Asterisk doesn't exist so I couldn't match it on a replace query , all what I want is to replace this character with... | [
0.2986825108528137,
0.1831282377243042,
0.04269659146666527,
-0.0033830662723630667,
-0.2766819894313812,
0.05365094915032387,
0.19906708598136902,
0.05539468303322792,
-0.23724140226840973,
-0.6845980286598206,
0.08034934103488922,
0.2781117856502533,
-0.3541739583015442,
0.21418385207653... | |
resize if you use indexes beyond a certain size. This will make your inserts more costly than they need to be and it will also take up more memory than needed. If you know you'll have only say.. 100 items then just pick a random value between 1 - 100.
**EDIT:** Random doesn't produce decimal values if you do the follo... | [
0.11015861481428146,
-0.2791604697704315,
0.10327590256929398,
0.05811416730284691,
-0.039636582136154175,
0.3365636169910431,
0.28275519609451294,
-0.6316591501235962,
-0.12893395125865936,
-0.5433036684989929,
-0.10912313312292099,
0.8478856682777405,
-0.01927233673632145,
0.278022050857... | |
I'm using Eclipse, and after a restart, I suddenly can't open PHP files. When I try, I get a popup error box saying:
```
Error opening the editor. (Time of error: [now])
Reason:
No editor descriptor for id org.eclipse.php.editor
```
Any advice for what's going on and how to fix it?
Are you using the latest Eclipse? ... | [
0.37098097801208496,
0.48414862155914307,
0.0749686136841774,
-0.10213348269462585,
-0.17537152767181396,
-0.2096429169178009,
0.5443550944328308,
0.2113061398267746,
-0.34191930294036865,
-0.4955027103424072,
0.0720614343881607,
0.5028270483016968,
-0.28336817026138306,
0.1499197036027908... | |
is there a database schema-free/less like mongodb but acid transaction support that I can use only when necessary in small parts of web application?
so, I'm building a web application, 70% it does not require a transaction, but 30% yes.
My problem is that when I can query that 30%, it require data also from nosql dat... | [
-0.022127944976091385,
0.2148684412240982,
0.204519584774971,
0.35184168815612793,
-0.20254167914390564,
-0.2148386836051941,
0.1618514508008957,
-0.2248329520225525,
-0.22026707231998444,
-0.46083104610443115,
0.3942488729953766,
0.6353197693824768,
-0.30615517497062683,
-0.09753163158893... | |
well, because I need transaction support.
So is there a dbms document oriented with acid transaction support that I can scaling out well if my web application grow in terms of access read and write operation by users?
I am only going to briefly answer the question.
As others say MongoDB is not fully ACID compliant an... | [
0.1766146570444107,
0.17031623423099518,
0.05145764723420143,
0.035385727882385254,
-0.315976083278656,
-0.5090543031692505,
0.284659743309021,
0.19660598039627075,
-0.20567871630191803,
-0.20505762100219727,
0.1182803213596344,
0.6860031485557556,
-0.2313275784254074,
0.13720391690731049,... | |
has written to disk and replicated across your network which breaks ACID immediately for durable writes. I am not sure how Gigaspaces does this but it sounds like something I would personally not look at.
In order to be ACID you must write to disk first (maybe to two nodes in your network too?) then the DB must write ... | [
0.07024271041154861,
0.028460709378123283,
0.17020994424819946,
0.04808799922466278,
-0.4859146177768707,
-0.2829259932041168,
0.30297285318374634,
0.11117183417081833,
-0.2787025272846222,
-0.5899734497070312,
0.26983264088630676,
0.5648351311683655,
-0.0038777762092649937,
-0.05964233353... | |
should write to before the function (`insert`, `save`, `update`) returns true or false. So you can get write concern within your app. You can also setup your actual replica and shards to be fully consistent, by nature they are not but you can. Not only that but MongoDB has Journaling. In reality even writing to memory ... | [
0.19162645936012268,
0.19316093623638153,
0.27901431918144226,
0.4164297878742218,
-0.04326419159770012,
-0.11941501498222351,
0.7982383370399475,
0.017295975238084793,
-0.16922692954540253,
-0.5495990514755249,
0.31705600023269653,
0.9641295075416565,
0.012961524538695812,
-0.159151673316... | |
overcoming these problems by using hashes of the document to be inserted and/or version numbers. I just did a quick Google search for a Java framework I know does supports ACID transactions and two phase commits but I am having problems finding it. If you search the user group for some they are out there and there are ... | [
-0.000363299302989617,
0.21892771124839783,
-0.02180866338312626,
0.1639246642589569,
-0.14976252615451813,
-0.37680554389953613,
0.3908250331878662,
0.13479013741016388,
-0.30881819128990173,
-0.30440202355384827,
0.3113882839679718,
0.5907666087150574,
-0.15274667739868164,
0.00417559035... | |
of go against the fundamentals of MongoDB.
So now you know how you can start to rely on Mongo and even have a slow transactional handler in your app for those small times you need the durable writes of many documents dependent upon each other.
> So is there a dbms document oriented with acid transaction support that ... | [
0.06232013180851936,
0.17949405312538147,
0.19417963922023773,
0.29155561327934265,
-0.14321178197860718,
-0.2972065210342407,
0.33008769154548645,
-0.0424308255314827,
-0.22331486642360687,
-0.5119249224662781,
0.35583817958831787,
0.8766564726829529,
-0.36187827587127686,
0.0640817657113... | |
Fbs usage of other DBs. Once I lost about 5 wall posts on my wall an hour after writing them. I contacted Fb about it and asked them for a geeky explanation. They said that even though the wall post wrote to the temporary storage it failed to sync to the permanent storage. So all this talk Fb being totally ACID complia... | [
0.35495516657829285,
0.3401210606098175,
0.21361705660820007,
-0.0145820127800107,
-0.1953309327363968,
-0.4674137532711029,
0.6649944186210632,
0.28484442830085754,
-0.2390267550945282,
-0.42544981837272644,
0.015385536476969719,
0.12543894350528717,
-0.48557183146476746,
0.13880591094493... | |
div disappears in ie7 on position absolute, but when I use ie developer tool and assign any css rules like zoom:1; it works, and when I actually put that in code, it does not work at all.
I am only going to briefly answer the question.
As others say MongoDB is not fully ACID compliant and infact breaks ACID compliancy... | [
-0.013269498012959957,
0.016982637345790863,
0.3939138352870941,
-0.13997428119182587,
-0.2609485387802124,
-0.41524168848991394,
0.5154597163200378,
0.311596155166626,
0.09252383559942245,
-0.45363864302635193,
-0.020508507266640663,
0.6865976452827454,
-0.4633464217185974,
0.125010609626... | |
has written to disk and replicated across your network which breaks ACID immediately for durable writes. I am not sure how Gigaspaces does this but it sounds like something I would personally not look at.
In order to be ACID you must write to disk first (maybe to two nodes in your network too?) then the DB must write ... | [
0.07024271041154861,
0.028460709378123283,
0.17020994424819946,
0.04808799922466278,
-0.4859146177768707,
-0.2829259932041168,
0.30297285318374634,
0.11117183417081833,
-0.2787025272846222,
-0.5899734497070312,
0.26983264088630676,
0.5648351311683655,
-0.0038777762092649937,
-0.05964233353... | |
should write to before the function (`insert`, `save`, `update`) returns true or false. So you can get write concern within your app. You can also setup your actual replica and shards to be fully consistent, by nature they are not but you can. Not only that but MongoDB has Journaling. In reality even writing to memory ... | [
0.19162645936012268,
0.19316093623638153,
0.27901431918144226,
0.4164297878742218,
-0.04326419159770012,
-0.11941501498222351,
0.7982383370399475,
0.017295975238084793,
-0.16922692954540253,
-0.5495990514755249,
0.31705600023269653,
0.9641295075416565,
0.012961524538695812,
-0.159151673316... | |
overcoming these problems by using hashes of the document to be inserted and/or version numbers. I just did a quick Google search for a Java framework I know does supports ACID transactions and two phase commits but I am having problems finding it. If you search the user group for some they are out there and there are ... | [
-0.000363299302989617,
0.21892771124839783,
-0.02180866338312626,
0.1639246642589569,
-0.14976252615451813,
-0.37680554389953613,
0.3908250331878662,
0.13479013741016388,
-0.30881819128990173,
-0.30440202355384827,
0.3113882839679718,
0.5907666087150574,
-0.15274667739868164,
0.00417559035... | |
of go against the fundamentals of MongoDB.
So now you know how you can start to rely on Mongo and even have a slow transactional handler in your app for those small times you need the durable writes of many documents dependent upon each other.
> So is there a dbms document oriented with acid transaction support that ... | [
0.06232013180851936,
0.17949405312538147,
0.19417963922023773,
0.29155561327934265,
-0.14321178197860718,
-0.2972065210342407,
0.33008769154548645,
-0.0424308255314827,
-0.22331486642360687,
-0.5119249224662781,
0.35583817958831787,
0.8766564726829529,
-0.36187827587127686,
0.0640817657113... | |
Fbs usage of other DBs. Once I lost about 5 wall posts on my wall an hour after writing them. I contacted Fb about it and asked them for a geeky explanation. They said that even though the wall post wrote to the temporary storage it failed to sync to the permanent storage. So all this talk Fb being totally ACID complia... | [
0.35495516657829285,
0.3401210606098175,
0.21361705660820007,
-0.0145820127800107,
-0.1953309327363968,
-0.4674137532711029,
0.6649944186210632,
0.28484442830085754,
-0.2390267550945282,
-0.42544981837272644,
0.015385536476969719,
0.12543894350528717,
-0.48557183146476746,
0.13880591094493... | |
My Problem
----------
I have read a few chapters, and researched a few websites but none of which fulfil my question, which is where should I put this If statement
```
Public LoginName As String
Public Password As String
LoginName = txtUserName.Text
Password = txtPassword.Text
If (LoginName = "" Or Password = "") T... | [
-0.19329924881458282,
0.07991177588701248,
0.5495830774307251,
-0.05582444742321968,
0.337665319442749,
0.10399923473596573,
0.44833865761756897,
-0.04904738813638687,
-0.20863240957260132,
-0.5084599852561951,
-0.5283372402191162,
0.6304455995559692,
-0.49829375743865967,
0.01579537242650... | |
but unsure what declaration it would go under and which element. I have tried several form elements and declarations but not having the desired effect that I would like
> The idea is once the user has finished inputting text into both
> text-boxes the image on the button changes from a no-go to a
> green-submit butto... | [
0.07762059569358826,
-0.3324544131755829,
0.6445146799087524,
0.13037648797035217,
-0.0033792853355407715,
-0.23658645153045654,
0.24726659059524536,
-0.2153656780719757,
-0.2155187577009201,
-0.6073014736175537,
-0.27595388889312744,
0.5302113890647888,
-0.22595758736133575,
-0.0914625823... | |
so the validation will run every time the user is typing. | [
0.3532387912273407,
0.13618306815624237,
0.4136769771575928,
-0.00039779001963324845,
0.09735175967216492,
-0.1621915102005005,
0.27625173330307007,
-0.05679444968700409,
-0.09948437660932541,
-0.24496659636497498,
0.049030154943466187,
0.3779089152812958,
0.1553453803062439,
-0.1367595046... | |
i have been searching the internet the past few days for a solution to my problem but so far nothing. I have an array of pages that i need to handle as a pagination, that is show my the past item and next item. The array content can change depending what section your viewing but the setup is always the same.
**My arra... | [
0.36826974153518677,
-0.01938689313828945,
0.541477620601654,
-0.0488869808614254,
-0.115299753844738,
0.22913812100887299,
0.31578299403190613,
-0.14681969583034515,
-0.532795250415802,
-0.827090859413147,
0.018787067383527756,
0.31457141041755676,
-0.09600008279085159,
0.4056480228900909... | |
[slug] => kafli1
[undir] => Array
(
[21] => Array
( | [
0.02510707639157772,
-0.34997236728668213,
-0.0910741314291954,
-0.3564007878303528,
-0.10579808056354523,
0.23213300108909607,
0.16176798939704895,
-0.7317900657653809,
-0.06733087450265884,
-0.3605724275112152,
0.08743620663881302,
0.26403865218162537,
-0.3883935809135437,
0.210177123546... | |
[titill] => 1.1 Serhljodar
[slug] => serhljodar
[kaflar] => Array | [
0.003430745331570506,
-0.24859140813350677,
-0.048396460711956024,
-0.2989955246448517,
-0.8139970302581787,
0.4561227858066559,
0.3988041877746582,
-0.5293437242507935,
-0.052624523639678955,
-0.5194311738014221,
-0.07840641587972641,
0.04574938118457794,
-0.22968964278697968,
0.128501191... | |
(
[0] => Array
( | [
-0.006590921897441149,
-0.05073453113436699,
0.05776195600628853,
-0.42975038290023804,
0.18784858286380768,
-0.22248251736164093,
0.5009738206863403,
-0.48862966895103455,
-0.04300787299871445,
-0.0422971248626709,
-0.2770380675792694,
0.3093731105327606,
-0.3479864001274109,
0.0597502440... | |
[id] => 24
[titill] => Æfing 1 | [
0.1734652817249298,
-0.017245426774024963,
-0.17935824394226074,
-0.40253233909606934,
-0.6751423478126526,
0.5667476058006287,
0.6930392980575562,
-0.4945055842399597,
-0.11900423467159271,
-0.7068115472793579,
-0.26358479261398315,
0.2147970199584961,
-0.2809520959854126,
-0.501649022102... | |
[slug] => aefing1
)
[1] => Array | [
0.2510997951030731,
-0.23404717445373535,
-0.25561583042144775,
-0.3105647563934326,
-0.2402438074350357,
0.07374293357133865,
0.25286373496055603,
-0.4295565187931061,
0.014268777333199978,
-0.21310876309871674,
0.161448672413826,
0.45840397477149963,
-0.5896667242050171,
0.00923451874405... | |
(
[id] => 25 | [
0.053456541150808334,
0.2649422287940979,
0.43485569953918457,
-0.27697405219078064,
0.32028281688690186,
0.014868459664285183,
0.24280431866645813,
-0.5347551107406616,
-0.11024443060159683,
-0.510382354259491,
-0.09555482864379883,
0.3541131913661957,
0.030081283301115036,
0.253371089696... | |
[titill] => Æfing 2
[slug] => æfing2 | [
-0.11840514838695526,
-0.31723523139953613,
-0.12954065203666687,
-0.6622453927993774,
-0.8707525134086609,
0.4701361656188965,
0.6858797073364258,
-0.1669812649488449,
-0.2771761417388916,
-0.5420051217079163,
-0.07694562524557114,
0.3648512065410614,
-0.33468592166900635,
-0.511071741580... | |
)
[2] => Array
( | [
-0.01593565195798874,
-0.029774270951747894,
-0.052537400275468826,
-0.46129700541496277,
-0.04171985760331154,
-0.11998012661933899,
0.37972208857536316,
-0.47381591796875,
-0.029653402045369148,
-0.23757344484329224,
-0.22273261845111847,
0.33669036626815796,
-0.4009547531604767,
-0.1409... | |
[id] => 26
[titill] => Próf 1 | [
0.07188607007265091,
0.09522870182991028,
0.1951669454574585,
-0.2683148980140686,
-0.3843284547328949,
0.20963530242443085,
0.41275545954704285,
-0.5468574166297913,
0.136509969830513,
-0.5277429223060608,
-0.3222816586494446,
0.60504150390625,
-0.1262296438217163,
-0.09563624113798141,
... | |
[slug] => prof1
) | [
0.03186526894569397,
-0.03086167387664318,
0.2819167673587799,
-0.24541260302066803,
-0.06935512274503708,
-0.016064148396253586,
0.29839181900024414,
-0.07385615259408951,
-0.1332913041114807,
-0.15865549445152283,
0.14132830500602722,
0.5851443409919739,
-0.3065858781337738,
0.2668268084... | |
)
)
[22] => Array
( | [
0.07257688790559769,
-0.07340340316295624,
0.13834327459335327,
-0.4013572633266449,
-0.1017790287733078,
0.03508223220705986,
0.4591835141181946,
-0.5334672331809998,
-0.22636747360229492,
0.006613436620682478,
-0.25939497351646423,
0.27252328395843506,
-0.3594594895839691,
0.122748702764... | |
[titill] => 1.2. Samhljóðar
[slug] => samhljodar
)
[23] => Array | [
0.1751779168844223,
-0.19390423595905304,
0.16670270264148712,
-0.339847594499588,
-0.7513507604598999,
0.22323383390903473,
0.3393794596195221,
-0.35982275009155273,
-0.21934174001216888,
-0.4112722873687744,
-0.1651553064584732,
0.3327831029891968,
-0.321865975856781,
-0.2192293405532837... | |
(
[titill] => 1.3 Málnotkun
[slug] => malnotkun
) | [
0.065253347158432,
-0.10425261408090591,
-0.18169717490673065,
-0.33152395486831665,
-0.4840124845504761,
0.6767101287841797,
0.7350655198097229,
-0.17376355826854706,
-0.08512763679027557,
-0.6052091717720032,
0.12888148427009583,
0.26474612951278687,
-0.13797487318515778,
0.1930716782808... | |
)
)
[20] => Array
(
[titill] => Kafli 2
[slug] => kafli2
)
)
```
The array keys are the post\_id's and the slug's are the urls. To explain what i'm trying to acchieve with this array i've writtend down a few examples what i want to do:
* | [
0.19589214026927948,
0.1771376132965088,
0.3185460865497589,
-0.40670347213745117,
0.08380753546953201,
0.10949120670557022,
-0.05681922659277916,
-0.3940299153327942,
-0.0577583983540535,
-0.5912446975708008,
0.04182697832584381,
0.4317930042743683,
-0.32172149419784546,
0.255902707576751... | |
if i'm viewing `localhost/kafli1` i would see that the next item is
`localhost/kafli1/serhljodar` (key #21) and the no previous item.
* if i'm viewing `localhost/kafli1/serhljodar` i should see that the next
item is `localhost/kafli1/serhljodar/aefing1` and the previous item
is `localhost/kafli`.
* if 8'm viewing `loca... | [
-0.17692779004573822,
0.16947528719902039,
0.5492492318153381,
-0.14588187634944916,
-0.21631716191768646,
0.001098837237805128,
0.33815672993659973,
-0.13060899078845978,
-0.46542391180992126,
-0.946373462677002,
-0.3114738166332245,
0.5440903306007385,
-0.31431564688682556,
0.05030453205... | |
(`id`, `parent_id`, `category`, `position`, `post_slug`, `titill`) VALUES
(9, 0, 3, 0, 'islenska-stig1', 'Íslenska stig 1'),
(19, 9, 3, 0, 'kafli1', 'Kafli 1'),
(20, 9, 3, 0, 'kafli2', 'Kafli 2',),
(21, 19, 3, 0, 'serhljodar', '1.1 Serhljodar'),
(22, 19, 3, 0, 'samhljodar', '1.2. Samhljóðar'),
(23, 19, 3, 0, 'malnotkun... | [
-0.41234466433525085,
0.26953327655792236,
0.3397769331932068,
-0.1200234591960907,
-0.2798531651496887,
0.6955907940864563,
0.4006807208061218,
-0.5492535829544067,
-0.12755335867404938,
-0.28820276260375977,
-0.46203354001045227,
0.31179529428482056,
-0.36527755856513977,
-0.028062116354... | |
[2] => serhljodar
[3] => aefing1
[4] => prof1
[5] => samhljodar
[6] => malnotkun
[6] => kafli2
)
```
There's no wfopen in C++ standard (2003). Since freetype is meant to be portable, it only uses fopen, which can only accept const char\* filenames. So, either load file to memory (or memory map it) ... | [
0.09266717731952667,
0.007503607776015997,
0.5059359669685364,
-0.22989235818386078,
-0.4394706189632416,
-0.00050814647693187,
0.40833723545074463,
-0.3067091107368469,
0.0027011693455278873,
-0.7021198868751526,
-0.25366559624671936,
0.5346894860267639,
-0.6807137727737427,
-0.1352104097... | |
accept UTF8 strings, convert wchar\_t string to UTF8. However **on windows [it won't work](http://msdn.microsoft.com/en-us/library/x99tb11d%28v=vs.90%29.aspx)**. So either load file to memory, or convert pszFileName to 8-bit encoding, then pass it to FT\_New\_Face. | [
-0.10780823230743408,
-0.23313631117343903,
0.6906092762947083,
-0.2819635570049286,
0.1772710680961609,
0.09615790098905563,
0.4546554386615753,
-0.02042234316468239,
-0.1058586984872818,
-0.9080542325973511,
-0.37738534808158875,
0.6378033757209778,
-0.28183576464653015,
-0.0484305322170... | |
If I'm working with a `double`, and I convert it to a `float`, how does this work exactly? Does the value get truncated so it fits into a float? Or does the value get rounded differently? Sorry if this sounds a bit remedial, but I'm trying to grasp the concept of `float` and `double` conversions.
From the [*Java Langua... | [
0.32562822103500366,
-0.01667751371860504,
-0.04417833685874939,
-0.15650783479213715,
-0.061317361891269684,
-0.016188910230994225,
0.0028838051948696375,
-0.49549007415771484,
0.13025419414043427,
-0.17629262804985046,
0.03666652739048004,
0.32527902722358704,
-0.27671119570732117,
0.033... | |
from a finite double. A double NaN is converted to a float NaN and a double infinity is converted to the same-signed float infinity.
and [section 4.2.4](http://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.2.4) says:
> The Java programming language requires that floating-point arithmetic behave as if eve... | [
-0.2825526297092438,
-0.11690173298120499,
0.1489306092262268,
-0.35840705037117004,
-0.3316734731197357,
0.35075274109840393,
-0.15071198344230652,
-0.47938817739486694,
-0.13474228978157043,
0.03302762657403946,
0.05845079571008682,
0.18057754635810852,
-0.19191429018974304,
0.2188775837... | |
I have a C-array that looks like this:
```
char hexc[] = {
0x41, 0x80, 0x7a, 0x39, 0xea, 0x7e, 0x27, 0xfc,
0xe6, 0x45, 0x9c, 0x8b, 0xb5, 0xce, 0xa7, 0x35,
0x5f, 0xf2, 0x43, 0xcf, 0x89, 0xd8, 0x61, 0xec,
0xe7, 0xed, 0x2e, 0x34, 0x45, 0x0c, 0x32, 0xae,
0x71, 0x4f, 0x1c, 0xd8, 0xb5, 0x8c, 0x1e, 0x... | [
-0.03898649662733078,
0.5059154033660889,
0.36339256167411804,
-0.20485496520996094,
0.09486299753189087,
0.381253182888031,
0.1376088559627533,
-0.06311661005020142,
-0.018943648785352707,
-0.38116589188575745,
0.07623978704214096,
0.2964969575405121,
-0.2662932574748993,
0.17465457320213... | |
0xec, 0x64, 0x02, 0xf8, 0x26,
};
```
I knew that behind this hex-representations is a .GIF-file, what is the best way to generate from this hex-values a viewable file again? And how to add the missing GIF-header?
You would just open the file and write to it:
```
FILE *f = fopen("filename.gif", "wb");
if (!f) return... | [
0.2227693349123001,
0.14177824556827545,
0.37682077288627625,
-0.009918552823364735,
0.08020379394292831,
0.04292715713381767,
0.1719660460948944,
-0.3240697383880615,
-0.17739303410053253,
-0.8050728440284729,
-0.23961922526359558,
0.6628502011299133,
-0.3698629140853882,
0.02157486416399... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.