text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I don't know how commercial games work inside very much, but the open source games I have come across don't seem to be massively into threading. Same goes for most other desktop applications, normally two or three threads seem to be used (eg program logic and GUI updates).
Why don't games have many threads? Eg separat... | [
0.5142505764961243,
0.08620607852935791,
-0.0867643728852272,
0.5098283290863037,
0.1187145784497261,
-0.02671334147453308,
-0.3225720226764679,
0.15873655676841736,
-0.5835940837860107,
-0.5026008486747742,
0.10539055615663528,
0.5757512450218201,
-0.2341356724500656,
0.227284237742424,
... | |
then sent to be processed by the worker threads as they become available.
This is becoming especially common on consoles. The PS3 is based on Cell architecture so you need to use parallel processing to get the best performance out of the system. The Xbox 360 can emulate a task/job setup that was designed for PS3 as it... | [
0.15170925855636597,
-0.18113404512405396,
0.25547757744789124,
0.3556597828865051,
-0.06834650784730911,
-0.01732303574681282,
-0.1683356910943985,
0.0871373638510704,
-0.4027695655822754,
-0.5870492458343506,
-0.0270611010491848,
0.084833063185215,
-0.1855928748846054,
0.2277430146932602... | |
as many of the other answers indicate, I think there are a few other reasons for the things you're seeing:
* First, many open source games are a few years old. Especially with this generation of consoles parallel programming is becoming popular and even necessary as mentioned above.
* Second, very few open source proj... | [
0.2615351974964142,
0.2504225969314575,
-0.08915187418460846,
0.5004191994667053,
0.0571257658302784,
-0.4059034585952759,
-0.29718267917633057,
0.2038072943687439,
-0.3426045775413513,
-0.5853708386421204,
0.10449565947055817,
0.8431076407432556,
0.09828359633684158,
0.17002999782562256,
... | |
of threads created by a game to mean that it's not using parallel jobs well. | [
0.4862053096294403,
0.2685784697532654,
-0.07197275012731552,
0.38833922147750854,
0.09535720199346542,
-0.012753383256494999,
-0.026602093130350113,
0.25164735317230225,
-0.47906896471977234,
-0.5502424836158752,
0.18274861574172974,
0.2717095613479614,
-0.4160456359386444,
0.269937187433... | |
We want to display a pdf-file on a webpage.
From what i can think of i see two possible solutions, displaying the file with some kind of pdf reader(maybe in flash?) or converting the pdf-file to html before displaying it.
How would you proceed to solve a problem like this?
Which would be the preferable method?
Well, t... | [
0.40946412086486816,
0.11452407389879227,
0.3648352324962616,
0.3643259108066559,
-0.10384870320558548,
-0.2239374816417694,
-0.014603665098547935,
0.1329188048839569,
-0.06291770935058594,
-0.5973610281944275,
0.045461222529411316,
0.5665413737297058,
-0.09410476684570312,
0.0722591131925... | |
I have an application written in .NET 1.1 that calls XmlDocument.Load on a URL. Just recently the xml file was updated. Now whenever I call XmlDocument.Load, the old file is returned. When I hit the same URL from a browser, I see the new file. I deleted all temporary files from IE and I still see the same issue. Any th... | [
0.40682312846183777,
0.11899489909410477,
0.49398353695869446,
-0.11096210777759552,
-0.3048919439315796,
-0.4662213623523712,
0.12195316702127457,
0.26525649428367615,
-0.2748541235923767,
-1.1511300802230835,
0.043588828295469284,
0.4358080327510834,
-0.2637328505516052,
0.35027396678924... | |
share proxy settings, so I would not be surprised if the cache is shared, too. | [
0.2813624441623688,
0.1517881155014038,
0.05254893749952316,
0.35772398114204407,
0.14808513224124908,
-0.13469615578651428,
-0.06662699580192566,
0.45584720373153687,
-0.14268335700035095,
-0.9845353960990906,
0.1294434815645218,
0.27052438259124756,
0.14422236382961273,
0.287994205951690... | |
I need to use a cursor to call a stored procedure that has 2 parameters that i need to pass into from Customers table.
Here is what I mean;
My goal is to pass all the CustomerID and CustomerName from Customers table into my stored procedure called AddCustomers which has 2 parameters of CustomerID and CustomerName.
ie... | [
-0.022167470306158066,
0.16331729292869568,
0.7166603803634644,
-0.10931681841611862,
-0.05977248400449753,
0.06430196017026901,
0.10884561389684677,
-0.1744609922170639,
-0.10550329089164734,
-0.6604632139205933,
-0.18456438183784485,
0.4579260051250458,
-0.54127436876297,
-0.052352271974... | |
but not successfully.
Here is what i have tried but not working.
```
Declare @CustomerID int
Declare @CustomerName varchar(100)
Declare cur CURSOR READ_ONLY
FOR
SELECT CustomerID, CustomerName
from Customers
OPEN cur
FETCH NEXT FROM cur
INTO @CustomerID, @CustomerName
WHILE @@FETCH_STATUS = 0
BEGIN
EXEC AddCus... | [
-0.1205000951886177,
0.21517007052898407,
0.8550224900245667,
-0.14804087579250336,
-0.07969815284013748,
0.1689777970314026,
0.02715378999710083,
-0.08974502235651016,
-0.07794875651597977,
-0.4450989067554474,
0.1206142008304596,
0.7844546437263489,
-0.4602162837982178,
-0.01920796558260... | |
PASS all CustomerID and CustomerName from Customers table
into my AddCustomer stored procedure so that i can do some filtering stuff on each of the CustomerID and CustomerName that i pass into AddCustomer Stored procedure.
Sam,
There are times when using a stored procedure to do a task like this is *perfectly appropri... | [
0.24469691514968872,
0.2506140172481537,
0.4288124442100525,
0.045956533402204514,
0.19166289269924164,
0.053301479667425156,
-0.04168892279267311,
-0.05917150899767876,
-0.420574814081192,
-0.82334965467453,
-0.1471436470746994,
0.47298547625541687,
-0.07293545454740524,
-0.16376027464866... | |
flaws in your code. BTW, I've taken the same approach on more than one occasion and it has worked very well.
So...post the stored procedure as well as we'll see if that doesn't help. Also, what specific error are you seeing?
**UPDATE:** Wait, are you just running this in the SQL Window? I usually package this stuff... | [
0.7376206517219543,
0.3126605153083801,
-0.3039814531803131,
0.1634538322687149,
0.09215780347585678,
-0.19632506370544434,
0.6746281385421753,
0.4814818799495697,
-0.16973960399627686,
-0.46035411953926086,
0.26404404640197754,
0.6150069832801819,
-0.2950200140476227,
0.2281331717967987,
... | |
on your description.
**UPDATE 2:** You say above that the error is something about the table. Are you sure that the data types that you have defined are correct? Could the error be a mismatch between the data pulled from the table and the type of the var into which you are placing it? | [
0.4887370765209198,
0.10747235268354416,
-0.03843168914318085,
0.015402164310216904,
0.034699492156505585,
0.03261014074087143,
0.13526612520217896,
-0.0013602952240034938,
-0.20515091717243195,
-0.6009353995323181,
0.11731553822755814,
0.7208824157714844,
-0.15773047506809235,
0.029357850... | |
In my drupal6 site I have wizard form. I implemented it with FormAPI using form storage and the rebuild property. My form validation is being done with the #required property and with functions in the #element\_validate property. It's working fine but for one thing, when I click on the previous button the form is being... | [
0.640065610408783,
0.09761439263820648,
0.27879059314727783,
0.11623483896255493,
-0.31328365206718445,
-0.3890932500362396,
0.33538612723350525,
-0.168558731675148,
0.0025599293876439333,
-0.45680856704711914,
0.18444186449050903,
0.7499811053276062,
0.1580907106399536,
-0.056994359940290... | |
are two different concepts.
Runway is a quick wire frame soilution to get you up and runnign quickly using common modules, where as my site wizard is used as a demo of a basic site on umbraco and is used to help you learn/understand all the components work together.
In regards to your original question having multipl... | [
0.5063389539718628,
-0.11803758889436722,
0.49519771337509155,
0.020302239805459976,
-0.177388533949852,
-0.08865708857774734,
0.10480514168739319,
-0.14454130828380585,
-0.07732540369033813,
-0.6592410802841187,
0.08994607627391815,
0.3109920620918274,
0.10139071196317673,
0.0597958043217... | |
hostname - yoursite.it | [
-0.07709536701440811,
0.27783966064453125,
0.2647303640842438,
-0.05551864206790924,
-0.03258160501718521,
-0.24239735305309296,
0.46137166023254395,
0.5665701031684875,
-0.2074442356824875,
-0.5488237142562866,
0.029912004247307777,
-0.028137922286987305,
0.08577880263328552,
0.3982594609... | |
I have trouble getting `boost:thread` to work. It runs fine when compiling without optimization:
```
g++ -o test-thread test-thread.cpp -lboost_thread-gcc-mt-s -lpthread
./test-thread
```
But a version that's compiled with optimizations crashes
```
g++ -O2 -o test-thread test-thread.cpp -lboost_thread-gcc-mt-s -lpt... | [
-0.07124552130699158,
0.2800323963165283,
0.4175894260406494,
-0.22406570613384247,
0.20672625303268433,
-0.07528212666511536,
0.4192361533641815,
-0.21706104278564453,
-0.25234296917915344,
-0.39596524834632874,
-0.111534483730793,
0.6354536414146423,
-0.3546510636806488,
0.06783897429704... | |
1.32 on ubuntu linux.
**UPDATE:**
Here is where it crashes in the debugger (where line 37 is the one with `thread_2.join();` in my original code):
```
(gdb) bt
#0 0x080499e0 in boost::thread::join ()
#1 0x080496b8 in main (argc=1, argv=0xbfea3eb4) at ../src/test-thread.cpp:37
```
Here are my actual two functions... | [
-0.48846742510795593,
-0.14006859064102173,
0.33019548654556274,
-0.22734715044498444,
0.08844185620546341,
0.07507666200399399,
0.36037060618400574,
-0.16829124093055725,
-0.08531259000301361,
-0.7519888877868652,
-0.06385597586631775,
0.5287610292434692,
-0.6077315807342529,
0.2505656182... | |
std::cerr << "THREAD 2 END" << std::endl;
}
```
Thanks for any help!
The path to extension\_dir was wrong. | [
-0.07998505234718323,
0.04411430284380913,
0.5038280487060547,
-0.2518260180950165,
-0.06794709712266922,
-0.23316964507102966,
0.4830073416233063,
0.2685040533542633,
-0.2629680931568146,
-0.6004471182823181,
-0.022095639258623123,
0.4688017666339874,
-0.28354722261428833,
0.4615910947322... | |
I am trying to find somebody smarter than me to validate some syntax I wrote up. The idea is to configure the filename of my RollingFileAppender to the name of the assembly in order to make it more re-usable for my projects.
I've seen [this previous SO article](https://stackoverflow.com/questions/308436/log4net-progr... | [
0.18514446914196014,
0.1701432764530182,
0.20613029599189758,
-0.058150626718997955,
-0.15728139877319336,
0.02313685417175293,
0.26408010721206665,
-0.06485870480537415,
-0.4096495509147644,
-0.6160207390785217,
-0.011764771305024624,
0.24962475895881653,
-0.2252238243818283,
0.3829424679... | |
as log4net.Repository.Hierarchy.Hierarchy;
if (root != null)
{
// Bind to the RollingFileAppender
log4net.Appender.RollingFileAppender rfa =
(log4net.Appender.RollingFileAppender)root.Root.GetAppender("RollingLogFileAppender");
if (rfa != null)
{
// Set the file name based on the assembly name
st... | [
0.4689432382583618,
0.09572204947471619,
0.5128101110458374,
-0.43775659799575806,
-0.1542537957429886,
0.3790024220943451,
0.37825602293014526,
-0.2781071662902832,
-0.4929982125759125,
-0.6781647801399231,
-0.18681582808494568,
0.3807234466075897,
-0.34815698862075806,
0.5975770354270935... | |
if I set the file dynamically can I still expect the log4net behavior to rotate the files based on the log4net.config file settings?
Much appreciated!
You are doing this the hard way! Define your log4net config as XML in your application's configuration file and use `%property{}` to advantage:
```
<appender name="You... | [
-0.04198442026972771,
-0.2835324704647064,
0.6588301658630371,
-0.06282121688127518,
0.16216149926185608,
-0.1761498749256134,
0.10281963646411896,
-0.11326319724321365,
-0.521929144859314,
-0.8490729928016663,
-0.2102239429950714,
0.8150848150253296,
-0.3116506040096283,
-0.08846911787986... | |
property name. I've chosen "LogName" for a simple example, but you can have one per application if you want, as long as your code knows what the correct property name is and what the correct value should be. | [
0.21027253568172455,
0.05731107294559479,
0.16134990751743317,
0.2279621660709381,
0.14151398837566376,
-0.2660121023654938,
0.15228433907032013,
-0.05818029120564461,
-0.20490975677967072,
-0.6149546504020691,
-0.22533701360225677,
0.5037426352500916,
-0.03668215870857239,
0.2387391924858... | |
I want to store strings and issue each with a unique ID number (an index would be fine). I would only need one copy of each string and I require quick lookup. I check if the string exist in the table often enough that i notice a performance hit. Whats the best container to use for this and how do i lookup if the string... | [
0.00033189012901857495,
-0.01487303152680397,
0.031314048916101456,
0.03444637730717659,
-0.08543454110622406,
0.021770508959889412,
0.16843828558921814,
-0.2253948599100113,
-0.13360877335071564,
-0.7781997919082642,
-0.009615952149033546,
0.6633837223052979,
-0.29081472754478455,
0.05484... | |
doesn't support tr1.
```
#include <string>
#include <iostream>
#include <tr1/unordered_map>
using namespace std;
int main()
{
tr1::unordered_map<string, int> table;
table["One"] = 1;
table["Two"] = 2;
cout << "find(\"One\") == " << boolalpha << (table.find("One") != table.end()) << endl;
cout ... | [
-0.5960478186607361,
0.026298999786376953,
0.5641158819198608,
-0.45671913027763367,
0.07924884557723999,
0.16412918269634247,
0.32024887204170227,
-0.18448512256145477,
-0.30207356810569763,
-0.5052576065063477,
-0.5326175689697266,
0.45784103870391846,
-0.6922847628593445,
-0.01820736378... | |
Is there a views plugin that I can use to generate a xml file? I would like something that I could choose the fields I would like to be in the xml and how they would appear (as a tag or a attribute of the parent tag).
For example: I have a content type Picture that has three fields: title, size and dimensions. I would... | [
0.6373560428619385,
-0.0025351853109896183,
0.4840795397758484,
0.33681198954582214,
-0.21597892045974731,
0.18169507384300232,
-0.4591487646102905,
-0.1339198499917984,
-0.165625661611557,
-0.6083893179893494,
0.27585217356681824,
0.40277299284935,
-0.07087992876768112,
0.1964180767536163... | |
<title>
title
</title>
</picture>
...
</pictures>
```
If there isn't nothing already implemented, what should I implement? I thought about implementing a display plugin, a style, a row plugin and a field handler. Am I wrong?
I wouldn't like do it with the templates because I can't think in a way to make ... | [
0.6048861145973206,
-0.21536162495613098,
0.4152373969554901,
0.15086618065834045,
-0.3477429449558258,
-0.3328593671321869,
-0.23158898949623108,
-0.24012310802936554,
-0.3510030210018158,
-0.8131912350654602,
-0.08230685442686081,
0.6310158371925354,
-0.30449777841567993,
0.1013990417122... | |
attempt to provide XML and other output formats for Views data, though the latter was a Google Summer of Code project and hasn't been updated recently. Definitely a potential starting point, though. | [
0.3990437090396881,
-0.1700441688299179,
0.37138643860816956,
0.6133326888084412,
-0.06257741153240204,
-0.11852102726697922,
-0.13362328708171844,
0.2916809022426605,
-0.13606692850589752,
-0.5421210527420044,
0.2900228798389435,
-0.09766452759504318,
0.04605570808053017,
-0.2397525161504... | |
I know there is a hr (horizontal rule) in html, but I don't believe there is a vr (vertical rule). Am I wrong and if not, why isn't there a vertical rule?
No, there is no vertical rule.
EDIT: It's 2021 (twelve years after I answered this question), and I no longer think my original explanation is true:
> (original ex... | [
0.22389844059944153,
0.02056843228638172,
1.0997953414916992,
-0.0763368308544159,
-0.18710121512413025,
-0.28188008069992065,
0.49978557229042053,
-0.15812237560749054,
-0.8761500120162964,
-0.8285688161849976,
0.04145171493291855,
0.10548799484968185,
0.09291339665651321,
0.4914107620716... | |
(generally)
> A vr tag does not follow that paradigm.
I'm not sure why a VR tag was never introduced, but it's likely not because of the way HTML is parsed - there are many different layout modes in HTML/CSS now that do not follow this "paradigm".
If I were to now speculate as to why there is no VR tag, I might look ... | [
0.36580967903137207,
0.05337962880730629,
0.5502550601959229,
0.04541923105716705,
-0.43681249022483826,
-0.24240551888942719,
0.18469946086406708,
0.08805540949106216,
-0.24134524166584015,
-0.4745057225227356,
-0.4025452435016632,
0.601344883441925,
-0.3634638786315918,
0.199045911431312... | |
however, the `<hr>` tag often ends up used for things other than it's semantic meaning. Although it may seem based on it's real world use that there should be a `<vr>` tag, it probably would not resemble anything related to the semantic definition of the `<hr>` tag. It was probably never thought to be introduced.
My h... | [
0.1326119303703308,
0.24149492383003235,
0.37052708864212036,
0.07792442291975021,
0.02245452255010605,
0.0670069083571434,
0.21425770223140717,
-0.1548030972480774,
-0.2431076616048813,
-0.27623191475868225,
-0.4439193308353424,
0.37919819355010986,
-0.20185616612434387,
0.226446643471717... | |
of my old answer follows below):
This is easy to do using CSS, however. Ex:
```
<div style="border-left:1px solid #000;height:500px"></div>
```
Note that you need to specify a height or fill the container with content. | [
-0.00582095654681325,
0.11093918979167938,
0.58861243724823,
-0.001162927015684545,
-0.042459119111299515,
-0.11794436722993851,
0.06025031581521034,
-0.10240034013986588,
-0.23944899439811707,
-0.48138144612312317,
-0.10365771502256393,
0.13218705356121063,
0.24585947394371033,
0.23398847... | |
I am new to CSS. I have a Top, Right, and Content div. I want it to look like this:
```
Top Right
Content
```
However, it is showing up like this:
```
Top Content Right
```
I know I need a clear somewhere, but I am not sure where because I am unclear on how clears actually work, so can someone please explain... | [
0.2512736916542053,
0.18215538561344147,
0.6667425036430359,
-0.11680518090724945,
-0.13854791224002838,
-0.09195183962583542,
0.04660928249359131,
0.05130646377801895,
-0.08384785801172256,
-0.7541442513465881,
-0.20175881683826447,
0.4179075062274933,
-0.021140534430742264,
-0.0405902341... | |
border:1px solid black;">Top</div>
<div style="float:right; width:200px; height:800px;
border:1px solid red;">Right</div>
<div style="width:500px; height:600px;
border:1px solid blue;">Content</div>
```
Put the `clear` on the Content `<div>`:
```
<div style="float:left; width:600px; height:1... | [
-0.17335577309131622,
-0.1696511059999466,
0.7655733227729797,
0.2003912776708603,
0.042889878153800964,
0.24395151436328888,
0.10725679993629456,
-0.26049643754959106,
-0.18198657035827637,
-0.40956467390060425,
-0.6283201575279236,
0.39867550134658813,
-0.0277118980884552,
0.016395412385... | |
solid blue;">Content</div>
```
This pushes the Content `<div>` so that it is below any floating elements (from the left *or* the right).
A side note: you probably should use CSS classes or the `id` attribute for convenience instead of inlining using `style`. | [
0.1414959877729416,
-0.08120162785053253,
0.1565181314945221,
0.15538668632507324,
-0.0665043294429779,
-0.4020533263683319,
0.10207682102918625,
0.013172103092074394,
-0.24643230438232422,
-0.421781450510025,
-0.3046174645423889,
0.10750624537467957,
-0.2672204375267029,
0.178318753838539... | |
I have to create a webform that looks something like this
```
column column - column column column column - column column
label: input - label: input
label: input - label: input - label: input
label: input - label: input
label: input
label: input - label: input
l... | [
-0.15695098042488098,
0.48726707696914673,
0.44893088936805725,
-0.02117699384689331,
-0.22100870311260223,
-0.024885643273591995,
-0.09717169404029846,
-0.24048073589801788,
0.0036997462157160044,
-0.9017218947410583,
0.12122835963964462,
0.29337114095687866,
-0.3260418474674225,
0.332745... | |
- label: input - label: input - input: label
```
etc..
Now what would be the best way to go about doing this?
I've been trying ways to accomplish with css but I've failed over and over again.
Should I just go ahead and use tables for this or is there a simple way to do this with css?
How about something... | [
0.1301364302635193,
0.13022300601005554,
0.4790697991847992,
-0.028461065143346786,
-0.36359646916389465,
-0.20256711542606354,
-0.3223782181739807,
-0.3280690312385559,
-0.4425230920314789,
-0.7431110739707947,
-0.1217779666185379,
0.370438814163208,
-0.14351452887058258,
-0.1117508038878... | |
left;
}
.column label {
clear: both;
float: left;
margin-right: 10px;
margin-bottom: 5px;
text-align: right;
width: 75px;
}
.column input {
float: left;
width: 100px;
}
</style>
</head>
<body>
<div class="column">
<label>Label 1:</label> <in... | [
-0.44664591550827026,
-0.1097370982170105,
0.6616604924201965,
-0.024040462449193,
-0.10027902573347092,
0.29033163189888,
-0.14652594923973083,
-0.44957512617111206,
-0.004548447672277689,
-0.6331014037132263,
-0.42284730076789856,
0.27375850081443787,
-0.11153922230005264,
-0.16690541803... | |
type="text" />
<label>Label 3:</label> <input type="text" />
<label>Label 4:</label> <input type="text" />
</div>
<div class="column">
<label>Label 5:</label> <input type="text" />
<label>Label 6:</label> <input type="text" />
<label>Label 7:</label> <input type="text" />
<label>Label 8:</l... | [
-0.03616410493850708,
-0.18696653842926025,
0.437894731760025,
-0.06238160282373428,
-0.5432908535003662,
0.007428710348904133,
-0.037215087562799454,
-0.5411941409111023,
-0.09044984728097916,
-0.8821531534194946,
-0.0034062385093420744,
0.38577184081077576,
-0.26239416003227234,
-0.18482... | |
G'day all,
I have a console project where it is intended the user presses the keyboard direction keys (non-numeric keypad) to move an avatar. I am having difficulty coding to check for the press of these keys. In Pascal it was easy enough to use "readkey" and code, for example, for #80 for the down keypress. However,... | [
-0.05662879720330238,
0.11170317232608795,
0.5992424488067627,
0.11362824589014053,
0.1261422038078308,
0.2115728110074997,
-0.09356788545846939,
0.24705637991428375,
-0.12381292134523392,
-0.7394441962242126,
-0.04363683983683586,
0.8108123540878296,
-0.11272062361240387,
-0.1130627840757... | |
not sure that this is doable.
This was not initially possible with System.in since it used to work line-based.
Sun eventually added a java.io.Console class.
Here are its JavaDocs:
<http://java.sun.com/javase/6/docs/api/java/io/Console.html>
Once you get the console (I think from System.console), you can get a reade... | [
0.00591881200671196,
-0.0395113043487072,
0.4279722273349762,
-0.04761965572834015,
-0.09354240447282791,
0.030676739290356636,
0.10217171162366867,
-0.11654999107122421,
-0.10341805964708328,
-0.6447904706001282,
0.13228239119052887,
0.4767841696739197,
-0.20140288770198822,
-0.1312041580... | |
The following example appears in the MATLAB tutorial:
```
X = [16 2 13;
5 11 8;
9 7 12;
4 14 1]
```
Using a single subscript deletes a single element, or sequence of elements, and reshapes the remaining elements into a row vector. So:
```
X(2:2:10) = []
```
results in:
```
X = [16 9 2 7 13 ... | [
-0.3550284802913666,
0.1794215440750122,
0.2399461269378662,
-0.1568143665790558,
0.018391359597444534,
0.16988714039325714,
0.4808422029018402,
-0.03423745557665825,
-0.19359849393367767,
-0.4386383593082428,
-0.6859327554702759,
0.015175395645201206,
-0.43031543493270874,
0.0702003762125... | |
elements and the index vector `2:2:10`. Can someone please explain?
The example you gave shows [linear indexing](https://www.mathworks.com/help/matlab/math/matrix-indexing.html#f1-85511). When you have a multidimensional array and you give it a single scalar or vector, it indexes along each column from top to bottom an... | [
-0.40927115082740784,
-0.2592475116252899,
0.42994827032089233,
-0.02056880109012127,
-0.07208773493766785,
0.31335559487342834,
-0.14565880596637726,
-0.5604827404022217,
-0.3721638321876526,
-0.49694883823394775,
0.10986273735761642,
0.0912744402885437,
-0.38884857296943665,
0.1062610819... | |
subindex accesses the first dimension (rows) and the second `1:2` accesses the second dimension (columns), extracting a 2-by-2 square. If you don't supply an index for each dimension, separated by commas, but instead just one index, MATLAB will index into the matrix as though it were one big column vector:
```
submat ... | [
-0.6404733657836914,
-0.5345015525817871,
0.6113248467445374,
0.06657163053750992,
-0.26112639904022217,
0.3622644543647766,
0.08457519859075546,
-0.3644041121006012,
-0.22235707938671112,
-0.48788177967071533,
-0.27371540665626526,
0.12063676118850708,
-0.4151342213153839,
0.0840663835406... | |
I have a directory under subversion control. I created a branch out of it just to test merging stuff. I took a file, modified line X in the trunk as "abc" and modified the same line X as "def" in its branch.
Then, from the branch working dir I did:
```
svn merge branchURL trunkURL .
```
It updated the file with the... | [
0.5037829875946045,
-0.061010971665382385,
0.20217320322990417,
-0.21257540583610535,
-0.036324597895145416,
-0.0490700900554657,
0.41435760259628296,
-0.09769544005393982,
-0.23805266618728638,
-0.384436696767807,
0.04173143953084946,
0.37122538685798645,
-0.6021999716758728,
0.2487787455... | |
"def" in the repository.
So does the `svn merge` just replace the content while merging and not bring any conflicts?
And if so the very reason of branching out a proj dir out of main trunk would be useless when one can't merge in a way so as to keep both the changes in trunk and branch.
You do realize what
```
svn ... | [
0.34195148944854736,
-0.2667388916015625,
0.2856377363204956,
0.23945558071136475,
-0.041567832231521606,
-0.3619433641433716,
0.3977143466472626,
-0.09046705812215805,
-0.2333022654056549,
-0.5443016886711121,
-0.16765040159225464,
0.8508155345916748,
-0.18689215183258057,
0.0875613093376... | |
check in your *branchWorkingCopy*, however, you will have made your branch identical to your trunk, which is almost certainly not what you want.
If you just want to copy selected changes from *trunk* to *branch*, you'll need to tell Subversion *which* changes you want to copy and use a different form of the merge comm... | [
0.08451336622238159,
-0.41129982471466064,
0.20078657567501068,
0.10907522588968277,
0.3450581431388855,
-0.19793936610221863,
0.39145052433013916,
-0.02075331099331379,
-0.3784414231777191,
-0.6823418736457825,
-0.16032354533672333,
0.5185231566429138,
-0.37243175506591797,
0.000253995269... | |
by the set of changes necessary to get from **r99** to r100. Revision ranges in Subversion are *half open*.
Also, consider reading the [fine manual](http://svnbook.red-bean.com/en/1.5/svn.branchmerge.basicmerging.html), if you haven't yet. | [
0.1762399524450302,
-0.32478252053260803,
0.40716180205345154,
-0.049840476363897324,
-0.1869756132364273,
-0.37004563212394714,
0.41874539852142334,
-0.0376967191696167,
-0.42871183156967163,
-0.36563780903816223,
-0.2672002911567688,
0.4969477653503418,
0.03823491558432579,
-0.0403458625... | |
In objective-c, how can I convert an integer (representing seconds) to days, minutes, an hours?
Thanks!
In this case, you simply need to divide.
```
days = num_seconds / (60 * 60 * 24);
num_seconds -= days * (60 * 60 * 24);
hours = num_seconds / (60 * 60);
num_seconds -= hours * (60 * 60);
minutes = num_seconds / 60... | [
-0.026394881308078766,
0.00611575972288847,
0.4115403890609741,
-0.10534937679767609,
-0.11355284601449966,
0.06620875000953674,
0.06574023514986038,
-0.020466212183237076,
-0.2678009569644928,
-0.2127160131931305,
0.24815596640110016,
0.4538983106613159,
-0.2878061532974243,
0.14725418388... | |
The context:
I want to have a ListView that wouldn't receive focus (e.g. won't
highlight row when user touches it). Yet each row widget has it's own
OnClickListener.
Here's what I specify in layout xml:
```
android:choiceMode="none"
android:focusableInTouchMode="false"
android:focusable="false"
```
The ListView sti... | [
0.4617233872413635,
-0.1764368861913681,
0.6044464111328125,
-0.11748399585485458,
-0.34192970395088196,
0.007128938566893339,
0.15714241564273834,
-0.21461369097232819,
-0.10246308147907257,
-0.7142471075057983,
0.014057327061891556,
0.7125663161277771,
-0.34608814120292664,
0.11977252364... | |
row widget has it's own ClickListener. There are no row widgets that I am aware of. The `onListItemClick` belongs to the ListView.
I havent been able to figure it out yet, but between `android:listSelector` and `android:background` and adjusting the alpha channels I figure there would be a way to make a selection look... | [
0.06251548230648041,
-0.0258733369410038,
0.9081156253814697,
-0.08239144831895828,
-0.1553879976272583,
0.07285439968109131,
-0.21556280553340912,
0.1733774095773697,
-0.42040327191352844,
-0.8015029430389404,
0.19114883244037628,
0.4825555682182312,
-0.4687565267086029,
0.214218720793724... | |
I understand that this may be construed as one of those "what's your preference" questions, but I really want to know why you would choose one of the following methods over the other.
Suppose you had a *super complex* class, such as:
```
class CDoSomthing {
public:
CDoSomthing::CDoSomthing(char *sUserNa... | [
0.011541439220309258,
-0.48287180066108704,
0.10251475870609283,
-0.1637769490480423,
0.09180246293544769,
-0.09982333332300186,
0.23449641466140747,
-0.15655215084552765,
0.08269831538200378,
-0.43531808257102966,
-0.25841861963272095,
0.44002118706703186,
-0.40455126762390137,
-0.3021190... | |
{
//Do somthing...
}
};
```
How should I declare a local instance within a global function?
```
int main(void)
{
CDoSomthing *pDoSomthing = new CDoSomthing("UserName", "Password");
//Do somthing...
delete pDoSomthing;
}
```
-- or --
```
int main(void)
{
CDoSomthing DoSomthi... | [
-0.3256707489490509,
-0.32528525590896606,
0.46221214532852173,
-0.2733822166919708,
0.2990511655807495,
-0.1564183533191681,
0.45030608773231506,
-0.0005194838158786297,
-0.29624366760253906,
-0.6545338034629822,
-0.36722975969314575,
0.688525378704071,
-0.31739360094070435,
0.10038837045... | |
management.
P.S. If you need a pointer, because you need it to pass to another function, just use the address-of operator:
```
SomeFunction(&DoSomthing);
``` | [
-0.1248202919960022,
0.16980862617492676,
0.29370713233947754,
0.10992668569087982,
0.2543133795261383,
-0.26474693417549133,
0.052626412361860275,
0.15682430565357208,
-0.29214489459991455,
-0.7635634541511536,
-0.27629879117012024,
0.8213843703269958,
-0.033615611493587494,
0.20786894857... | |
I am using the jQuery plugin [Cross Slide](http://www.gruppo4.com/~tobia/cross-slide.shtml). My page is working fine in Chrome and Firefox. But in Internet Explorer 7, I get:
> Debug error as Object expected on line 1:
>
> $(document).ready(function() {
> $('#image').crossSlide({sleep:4,fade:1},[{src:'images/1.j... | [
0.2114231437444687,
0.11253863573074341,
0.6487388610839844,
-0.13996028900146484,
0.16060267388820648,
-0.20531083643436432,
0.43764305114746094,
0.19303394854068756,
-0.20099149644374847,
-0.9294807314872742,
-0.15959395468235016,
0.9135053753852844,
-0.3584878146648407,
0.05368919298052... | |
I'm trying to do a batch upload of photos in my iPhone application. I have one script that's looping through a user's photos, and then for each photo, calls another script to do the upload.
The script that does the upload needs to call back the script that's firing off each of the user's photos to signal success or f... | [
0.695034384727478,
0.18652458488941193,
0.11475115269422531,
0.06872644275426865,
-0.11920323222875595,
0.1427379846572876,
0.15812185406684875,
-0.2310400754213333,
-0.11875871568918228,
-0.1991603523492813,
0.33788353204727173,
0.3906719982624054,
-0.6084440350532532,
-0.1903394460678100... | |
I'll try to use pseudocode:
**Script one:**
```
foreach (photoNeedsUpload in users photos)
upload the photo via Upload Script
callback hook: successOrFailureUploading (called back by the Upload Script)
```
**Upload Script:**
```
1. Do the upload and then wait for NSURLRequest callbacks:
connecti... | [
0.21589158475399017,
-0.2900460660457611,
0.7414419651031494,
-0.0313648022711277,
-0.18114452064037323,
-0.2409614473581314,
0.40571123361587524,
-0.21834062039852142,
-0.28986814618110657,
-0.8426737785339355,
-0.1430787742137909,
0.6733728647232056,
-0.3275948762893677,
-0.0925218835473... | |
get uploaded.
Is there a simple way to do something like this? Should I be putting the thread to sleep, or should I just make the http call synchronous? If so, how to check for success?
I admit that I didn't do my design homework and it's starting to feel like I've created a circular issue for myself!
Starting with... | [
0.33225640654563904,
-0.17911237478256226,
0.6147670149803162,
0.23735971748828888,
0.06775129586458206,
-0.20218919217586517,
0.28142520785331726,
0.11578385531902313,
-0.6394145488739014,
-0.9866400957107544,
0.3124863803386688,
0.5844274163246155,
-0.2672058045864105,
0.1458719074726104... | |
I've seen the word `static` used in different places in C code; is this like a static function/class in C# (where the implementation is shared across objects)?
1. A static variable inside a function keeps its value between invocations.
2. A static global variable or a function is "seen" only in the file it's declared i... | [
0.5027638673782349,
0.11733641475439072,
0.3867488205432892,
-0.39869803190231323,
0.09879448264837265,
-0.05881919711828232,
0.1825818419456482,
0.06907244771718979,
-0.3187512159347534,
-0.24514485895633698,
-0.1979474127292633,
0.4179841876029968,
-0.4030338227748871,
0.4033960402011871... | |
= %d, sa = %d\n", a, sa);
}
int main()
{
int i;
for (i = 0; i < 10; ++i)
foo();
}
```
This prints:
```
a = 15, sa = 15
a = 15, sa = 20
a = 15, sa = 25
a = 15, sa = 30
a = 15, sa = 35
a = 15, sa = 40
a = 15, sa = 45
a = 15, sa = 50
a = 15, sa = 55
a = 15, sa = 60
```
This is useful for cases where... | [
-0.11946097016334534,
0.14163610339164734,
0.09001954644918442,
-0.6694061160087585,
-0.052818506956100464,
0.6605042815208435,
0.4530046582221985,
-0.48325082659721375,
-0.2633977234363556,
-0.19398243725299835,
-0.236988827586174,
0.13130490481853485,
-0.4085802733898163,
0.0621738210320... | |
want to use global variables. Beware, however, this feature should be used very sparingly - it makes your code not thread-safe and harder to understand.
(2) Is used widely as an "access control" feature. If you have a .c file implementing some functionality, it usually exposes only a few "public" functions to users. T... | [
0.13061955571174622,
-0.11587376147508621,
0.1909807026386261,
0.01197053212672472,
-0.03726591914892197,
-0.4080498218536377,
-0.0660228356719017,
0.20497259497642517,
-0.33684661984443665,
-0.3272756040096283,
-0.362732470035553,
0.6017642021179199,
-0.6219594478607178,
0.151257589459419... | |
containing file. In local variables,
> static is used to store the variable
> in the statically allocated memory
> instead of the automatically allocated
> memory. While the language does not
> dictate the implementation of either
> type of memory, statically allocated
> memory is typically reserved in data
> s... | [
-0.2095840722322464,
-0.051614027470350266,
0.2858239412307739,
0.023748479783535004,
-0.10246989130973816,
-0.07223960757255554,
-0.010903188027441502,
0.03531502187252045,
-0.31097012758255005,
-0.3264382481575012,
-0.28183960914611816,
0.2572753131389618,
-0.6491754651069641,
0.36396431... | |
the same class) and methods. In C there are no classes, so this feature is irrelevant. | [
0.03747927397489548,
-0.17430967092514038,
-0.13537324965000153,
0.05122799798846245,
-0.1620529145002365,
-0.29505395889282227,
-0.1228349506855011,
-0.10903861373662949,
-0.0330970473587513,
-0.31793221831321716,
-0.43047475814819336,
0.5876305103302002,
-0.43235644698143005,
-0.02788839... | |
What is the difference between [`git add [--all | -A]`](https://git-scm.com/docs/git-add#Documentation/git-add.txt--A) and [`git add .`](https://git-scm.com/docs/git-add)?
*This answer only applies to **Git version 1.x**. For Git version 2.x, see other answers.*
---
**Summary:**
* `git add -A` stages **all changes**... | [
0.34659871459007263,
-0.11296074092388153,
0.39373067021369934,
0.02505658008158207,
-0.06990702450275421,
0.12376049906015396,
0.0010407953523099422,
-0.3746938705444336,
-0.33888617157936096,
-0.7719095945358276,
-0.12626302242279053,
0.6874765753746033,
-0.4191492199897766,
-0.236479148... | |
or are new and not ignored, it does not stage any 'rm' actions.
`git add -u` looks at all the *already* tracked files and stages the changes to those files if they are different or if they have been removed. It does not add any new files, it only stages changes to already tracked files.
`git add -A` is a handy shortc... | [
0.264979749917984,
-0.13945385813713074,
0.46903330087661743,
-0.23732946813106537,
-0.01682199537754059,
0.26568275690078735,
0.11045094579458237,
-0.5876144170761108,
-0.3243357241153717,
-0.581390917301178,
-0.08394529670476913,
0.5304370522499084,
-0.449933797121048,
-0.046762611716985... | |
add change-me delete-me
git commit -m initial
echo OK >> change-me
rm delete-me
echo Add me > add-me
git status
# Changed but not updated:
# modified: change-me
# deleted: delete-me
# Untracked files:
# add-me
git add .
git status
# Changes to be committed:
# new file: add-me
# modified: change-m... | [
0.0366249606013298,
0.19074822962284088,
0.5630435347557068,
-0.3781076669692993,
-0.09889478981494904,
0.6670636534690857,
0.25176915526390076,
-0.6515390872955322,
-0.1748141050338745,
-0.41571807861328125,
-0.1201157346367836,
0.7506829500198364,
-0.5095054507255554,
-0.0660902261734008... | |
be committed:
# new file: add-me
# modified: change-me
# deleted: delete-me
``` | [
0.24509479105472565,
0.13429534435272217,
0.25245437026023865,
-0.15716785192489624,
0.3247765898704529,
0.0864039734005928,
0.3589790463447571,
-0.10593852400779724,
-0.34696832299232483,
-0.5283575654029846,
-0.35415568947792053,
0.45362889766693115,
-0.32856112718582153,
0.1605037450790... | |
My old system involved using Microsoft FrontPage and a frame page. The top frame contained a (tree) list of the tasks and sub-tasks I'd need to do, while the bottom frame contained any useful project information, notes, etc. I'd invariably need to jot down. I used bookmarks in the page to mark major tasks while highlig... | [
0.07506580650806427,
0.1303941011428833,
0.37900710105895996,
0.23816367983818054,
-0.2279565930366516,
0.12327443808317184,
0.20495641231536865,
0.024723855778574944,
-0.24704620242118835,
-0.8298202753067017,
0.11947508901357651,
0.2652052044868469,
-0.015008587390184402,
-0.222669914364... | |
Any good ideas on how to get a new system in place that can do something similar to my old one (without the crudeness/clumsiness)? That is, a formal piece of software for that purpose?
[ToDoList](http://www.abstractspoon.com/tdl_resources.html) is pretty good. Cons: Windows-only. | [
0.29224520921707153,
-0.31284019351005554,
0.45365267992019653,
0.37494921684265137,
-0.04623255506157875,
-0.2213204801082611,
0.03491991013288498,
0.41074588894844055,
-0.07900487631559372,
-0.4441612660884857,
0.1339944303035736,
0.5752434134483337,
0.040693238377571106,
-0.135705500841... | |
Ideally I'd like to do as little preparation data work on the server as possible. The less I have to do to prep the data from the database to make a given chart, the happier I am and the more view I can make in the time.
Some of the things I'd like to chart are, for example:
* The distribution of a series of response... | [
0.42957043647766113,
0.13805167376995087,
0.552531898021698,
-0.01852095127105713,
-0.12725010514259338,
0.33775392174720764,
0.37012651562690735,
-0.16601146757602692,
-0.4393034875392914,
-0.6164436340332031,
0.15294323861598969,
0.4937276542186737,
-0.16213537752628326,
-0.0317347496747... | |
1] or more likely something like [1.2, 3.2, 3.1, 1.1, 4.3, 3.4] where it isn't just a case of counting the frequency of the item
to an actual distribution would be great.
Thanks.
**EDIT:** To clarify I guess I'm asking for more than just charting APIs, a search on Yahoo or Stack Overflow already finds answers to tha... | [
0.4553975760936737,
-0.22509726881980896,
0.38810423016548157,
0.2826322019100189,
-0.16518501937389374,
0.03681964427232742,
-0.2854633629322052,
-0.012007632292807102,
-0.47397294640541077,
-0.7028926610946655,
0.18018390238285065,
0.3034926652908325,
-0.21619117259979248,
0.138027817010... | |
use. You generate your data in the URL for an image, and the Google server spits back the GIF with the chart in it. You don't need JavaScript or Flash. | [
0.6837687492370605,
0.022717295214533806,
0.03559418022632599,
0.402733713388443,
-0.13736331462860107,
-0.331843763589859,
-0.2004774659872055,
0.41063645482063293,
0.06958416849374771,
-0.7452632188796997,
-0.22483406960964203,
0.39407485723495483,
-0.5591066479682922,
-0.042329732328653... | |
Is there a simple way to do something like..
```
[NSMagicDataConverter humanStringWithBytes:20000000]
```
..which would return "19.1MB"?
Here's my own take on the problem:
```
enum {
kUnitStringBinaryUnits = 1 << 0,
kUnitStringOSNativeUnits = 1 << 1,
kUnitStringLocalizedFormat = 1 << 2
};
NSStrin... | [
-0.21238164603710175,
-0.12463872134685516,
0.2470848560333252,
-0.09693940728902817,
0.05995705723762512,
0.2411659061908722,
0.5272277593612671,
-0.3154875636100769,
-0.33470162749290466,
-0.47847989201545715,
-0.12688952684402466,
0.3230927586555481,
-0.34839680790901184,
-0.01106119714... | |
1024 : 1000;
int exponent = 0;
while (bytes >= multiplier && exponent < maxUnits) {
bytes /= multiplier;
exponent++;
}
NSNumberFormatter* formatter = [[[NSNumberFormatter alloc] init] autorelease];
[formatter setMaximumFractionDigits:2];
if (flags & kUnitStringLocalizedFormat) {... | [
-0.13037854433059692,
-0.11732906103134155,
0.4454452693462372,
-0.10964427888393402,
-0.061962466686964035,
0.10723064839839935,
0.3160364627838135,
-0.4160580337047577,
-0.09533783048391342,
-0.6090604066848755,
-0.41378259658813477,
0.523518443107605,
-0.1799727827310562,
-0.15329071879... | |
return [NSString stringWithFormat:@"%@ %cB", [formatter stringFromNumber: [NSNumber numberWithDouble: bytes]], units[exponent]];
}
```
By default (if `0` is passed for `flags`), it will output SI units (base ten). You can set `kUnitStringBinaryUnits` to select binary (base two) units suitable for memory, or `kUnitStr... | [
-0.4002726376056671,
0.024607568979263306,
0.14932239055633545,
0.012512512505054474,
0.12154720723628998,
0.45062732696533203,
0.2967018783092499,
-0.004696691408753395,
-0.28409287333488464,
-0.6467089056968689,
-0.6079988479614258,
0.11830029636621475,
-0.014980978332459927,
0.276910334... | |
(In Mac OS 10.6, in the US)
unitStringFromBytes(12345678901234567890123456789, kUnitStringOSNativeUnits | kUnitStringLocalizedFormat); // → "12.345,68 YB" (In Mac OS 10.6, in Spain)
```
---
Here's the helper function required for OS-native units:
```
BOOL leopardOrGreater(){
static BOOL alreadyComputedOS = NO;
... | [
-0.5181726217269897,
-0.05543025583028793,
0.46025100350379944,
-0.24008116126060486,
0.08676005899906158,
0.12644897401332855,
0.5205453634262085,
-0.10813839733600616,
-0.17626434564590454,
-0.216147318482399,
-0.724695086479187,
0.5580660104751587,
-0.23719628155231476,
-0.0866185203194... | |
alreadyComputedOS = YES;
}
return leopardOrGreater;
}
``` | [
-0.06584863364696503,
-0.07319501787424088,
0.1757240891456604,
-0.24394647777080536,
0.13003027439117432,
-0.2750852406024933,
0.6244359016418457,
0.033005498349666595,
-0.4466630518436432,
-0.40588852763175964,
-0.20575031638145447,
0.4497552812099457,
-0.4229411780834198,
-0.13738621771... | |
I have the following code:
```
if (HttpContext.Current.Request.IsAuthenticated == false)
{
// this isn't reached so i know user is Authenticated
return;
}
FormsIdentity fIdentity = HttpContext.Current.User.Identity as FormsIdentity;
string[] delimitedUserData = fIdentity.Ticket.UserData.Split('|');
// but at t... | [
0.01756375841796398,
-0.0733320415019989,
0.5630228519439697,
0.18415750563144684,
0.0919225886464119,
-0.38138264417648315,
0.21477599442005157,
-0.37764617800712585,
-0.28776854276657104,
-0.6411583423614502,
-0.01634848117828369,
0.36597949266433716,
-0.1666102111339569,
0.3055310845375... | |
individual callers, you can use:
```
if (field != null)
{
// or the event-name for field-like events
// or your own event-type in place of EventHandler
foreach(EventHandler subscriber in field.GetInvocationList())
{
// etc
}
}
```
However, to assign all at once, just use += or direct as... | [
0.07616201043128967,
-0.08630043268203735,
0.2642320692539215,
-0.08895179629325867,
0.0248025581240654,
0.10181741416454315,
0.28929761052131653,
-0.2933230698108673,
-0.18915298581123352,
-0.4316822290420532,
-0.31844183802604675,
0.6186614632606506,
-0.4385760724544525,
0.03490848466753... | |
In what kind of scenarios would we declare a member function as a 'friend function' ?..What exact purpose does 'friend function' which defies one of central concept of 'Encapsulation' of OOP serve?
You would use a friend function for the same sort of reasons that you would use a friend class, but on a member function (... | [
0.1738094836473465,
-0.0460565909743309,
-0.26478660106658936,
0.30310967564582825,
0.15325377881526947,
-0.3473878502845764,
0.24677662551403046,
-0.08062439411878586,
-0.297210693359375,
-0.26332327723503113,
-0.21933448314666748,
0.5784631371498108,
-0.2049669474363327,
0.02871734835207... | |
whitebox testing. Rather than opening up the entire class to the test harness, you could open up a particular function which accesses the internals required by the test harness. While this still violates encapsulation, it's less risky than opening up the entire class.
Also see [this article](http://www.cprogramming.co... | [
0.4931451380252838,
-0.13694897294044495,
-0.3762728273868561,
0.27108025550842285,
0.15968140959739685,
-0.34072673320770264,
0.3424206078052521,
-0.15180760622024536,
0.03637244179844856,
-0.3348190486431122,
-0.06354650855064392,
0.2619912922382355,
-0.11195234209299088,
-0.140828907489... | |
GAE has various limitations, one of which is size of biggest allocatable block of memory amounting to 1Mb (now 10 times more, but that doesn't change the question). The limitation means that one cannot put more then some number of items in list() as CPython would try to allocate contiguous memory block for element poin... | [
-0.13589291274547577,
-0.17808687686920166,
0.07974494248628616,
0.07211469858884811,
-0.14233095943927765,
0.002117147436365485,
0.022912003099918365,
-0.14755992591381073,
-0.6610291004180908,
-0.5443872809410095,
-0.030903421342372894,
0.270061731338501,
-0.2507631182670593,
0.315707474... | |
tend to allocate bigger and bigger single blocks of memory.
First idea was gc, and disabling it changes application behavior a bit but still some structures are maintained.
A simplest short application that experience the issue is:
```
a = b = []
number_of_lists = 8000000
for i in xrange(number_of_lists):
b.appe... | [
0.1855042576789856,
0.11424747109413147,
0.31419169902801514,
-0.023857606574892998,
-0.0622069425880909,
-0.20897391438484192,
0.1408485770225525,
-0.05354403704404831,
-0.4952370524406433,
-0.6395977139472961,
0.012058254331350327,
0.2039390206336975,
-0.4457523822784424,
0.1740213930606... | |
So you are trying to allocate at least (20+16) \* 8000000 = 20168000000 bytes, about 20 GB. And that's in the best case, if the system malloc only allocates exactly as much memory as requested.
I calculated the size of the list object as follows:
* 2 Pointers in the `PyListObject` structure itself (see [listobject.h]... | [
-0.22690846025943756,
-0.08001614362001419,
0.509604811668396,
-0.20697247982025146,
-0.02059086225926876,
0.5857540369033813,
-0.1621491014957428,
-0.5779784321784973,
-0.562421441078186,
-0.512397050857544,
-0.10853764414787292,
0.35613763332366943,
-0.11195056140422821,
-0.1731605678796... | |
0, 4, 8, 16, 25, 35, 46, 58, 72, 88, ... Thus, your one-element lists will allocate room for 4 elements.
Your data structure is a somewhat pathological example, paying the price of a variable-sized list object without utilizing it - all your lists have only a single element. You could avoid the 12 bytes overallocation... | [
0.2235020101070404,
-0.05035436525940895,
0.19807037711143494,
0.40637028217315674,
-0.03461189195513725,
0.4416045844554901,
0.1976349949836731,
-0.4057590365409851,
-0.5703240633010864,
-0.44738683104515076,
-0.021000443026423454,
0.017154725268483162,
-0.25351616740226746,
0.15637186169... | |
What's the best algorithm for evaluating a mathematical expression? I'd like to be able to optimize this a little in the sense that I may have one formula with various variables, which I may need to evaluate hundreds of times using different variables. So basically if I can initially parse the formula so that it is opt... | [
0.0701921358704567,
0.23784483969211578,
0.16635385155677795,
0.09508109837770462,
0.1421312391757965,
0.09039071202278137,
0.058036018162965775,
-0.12489763647317886,
0.09644519537687302,
-0.6407378911972046,
0.1910913586616516,
0.7460859417915344,
-0.20387662947177887,
-0.462243050336837... | |
by using the shunting yard algorithm, but each time I need to calculate the same formula, I'm having to go through the parsing stage. There must be a better way to do this.
If you want to do it with Delphi, you could look into how the `JclExprEval` unit works, part of the [JEDI Code Library](http://sourceforge.net/proj... | [
0.410460501909256,
-0.0315612331032753,
0.04687453806400299,
0.037056874483823776,
0.024355202913284302,
0.031047195196151733,
-0.0582180917263031,
-0.15276123583316803,
-0.13551193475723267,
-0.3307681679725647,
0.2873513400554657,
0.3387121558189392,
-0.10268417745828629,
-0.126256778836... | |
be calculated accordingly.
In any case, the basics of how it works may be helpful for you. Recursive-descent parsing of expressions is easy, and by building a tree you can evaluate multiple times without re-parsing. JclExprEval actually generates code for a simple stack machine, so that it can work a little faster tha... | [
0.19183684885501862,
-0.1345379650592804,
-0.06418485194444656,
0.24950070679187775,
-0.21778209507465363,
0.1048939898610115,
0.2872221767902374,
-0.32415953278541565,
-0.07278221100568771,
-0.5935637950897217,
0.10338735580444336,
0.4120365381240845,
-0.28703126311302185,
-0.485175490379... | |
in C#, and building up an `Expression`, like Marc suggests, is another perfectly valid approach. The JIT-compiled expression ought to be quite a bit faster than an interpreted expression program or tree, which themselves are a lot faster than parsing. | [
0.19297932088375092,
0.1905411034822464,
-0.058505233377218246,
0.07906820625066757,
-0.11237706989049911,
-0.26938745379447937,
0.18787570297718048,
0.06920052319765091,
-0.15938183665275574,
-0.356621652841568,
-0.3539857864379883,
0.6307752728462219,
-0.19908834993839264,
-0.53432548046... | |
I'm going to be writing a Windows application using the .NET framework and C#. The application will need to store relational data which will be queried, joined and processed.
Previously I've done this using SQL Server, but that is a total overkill for the application I am now making.
What's the simplest, easiest way ... | [
0.1754682958126068,
0.15823893249034882,
0.5441890358924866,
0.08378808200359344,
0.03747248277068138,
-0.23991689085960388,
-0.2039256989955902,
0.00019295325910206884,
-0.22926867008209229,
-0.905461311340332,
0.06421497464179993,
0.6669847965240479,
-0.10628731548786163,
0.1958322376012... | |
app and provides a basic SQL database. The databases themselves are a single .sdf file and are deployed with your app. Since it's part of the framework, it also means there's no additional installation. Actually, It's not actually part of the framework, but it's easily redistributable. I'm using SQL Server CE for a per... | [
0.24555544555187225,
0.19332487881183624,
0.49540480971336365,
0.04381370171904564,
0.054928459227085114,
-0.017034221440553665,
0.039483942091464996,
0.011802499182522297,
-0.3007493317127228,
-0.8314300775527954,
-0.1950959414243698,
0.4939173460006714,
-0.4870975613594055,
-0.0491036213... | |
The following code helps me validate an XML file with an XSD schema.
```
XmlReaderSettings settings = new XmlReaderSettings();
settings.Schemas.Add(null, xsdFilePath);
settings.ValidationType = ValidationType.Schema;
settings.ValidationEventHandler += new System.Xml.Schema.ValidationEventHandler(settings_ValidationEve... | [
0.19130539894104004,
0.3217294216156006,
0.7156065702438354,
0.0015505916671827435,
-0.1597798466682434,
-0.05105675756931305,
0.549557626247406,
-0.5573871731758118,
-0.07771240919828415,
-0.4102846682071686,
0.028471888974308968,
0.5891502499580383,
-0.17506371438503265,
0.05747030675411... | |
pass your own `XmlReaderSettings` object to `XmlDocument.Validate()`.
>
> Instead, you can use a validating `XmlReader` and an `XmlNodeReader` to validate an existing `XmlDocument` (using a `XmlNodeReader` with `StringReader` rather than an `XmlDocument`)
```
XmlDocument x = new XmlDocument();
x.LoadXml(XmlSource);... | [
0.35398223996162415,
-0.14664585888385773,
0.822471022605896,
0.12862291932106018,
-0.060805417597293854,
-0.15982714295387268,
0.2489214539527893,
-0.8163613080978394,
-0.21601341664791107,
-0.3405086100101471,
-0.43149542808532715,
0.4244992733001709,
-0.20235806703567505,
0.111362732946... | |
if (e.Severity == XmlSeverityType.Error || e.Severity == XmlSeverityType.Warning)
System.Diagnostics.Trace.WriteLine(
String.Format("Line: {0}, Position: {1} \"{2}\"",
e.Exception.LineNumber, e.Exception.LinePosition, e.Exception.Message));
}
``` | [
-0.23778973519802094,
-0.24333292245864868,
0.4979851543903351,
-0.2280482053756714,
0.22348840534687042,
-0.01686401478946209,
0.28324320912361145,
-0.3265434205532074,
-0.04288599267601967,
-0.6415154337882996,
-0.44853225350379944,
0.1794009953737259,
-0.17220205068588257,
0.12527519464... | |
EDIT: I used Browser's window instead of page or screen so that if the browser is in "window" mode (and not in full screen) it will be centred anyway.
---
I need to write a countdown which will temporally opacize the page and write (possibly in full window size) in the middle of the browser's window "3" one second of... | [
0.22571627795696259,
0.1257745772600174,
0.6919307708740234,
-0.3168404698371887,
-0.3716786801815033,
0.16266772150993347,
0.2817571759223938,
-0.14650288224220276,
-0.4219038188457489,
-0.6489453911781311,
0.03320951759815216,
0.4765462577342987,
-0.26494958996772766,
-0.0194230824708938... | |
does this thing easyly :P
To put it in a top layer this should be enough:
```
position: absolute;
z-index: 1;
```
supposing I do not have any other element in z >= 1.
How to do the rest part?
I think I'll have to create a full window size div with a semitransparent background (any hint on how to do it?) then wr... | [
0.13647900521755219,
-0.1181577816605568,
0.4327872395515442,
-0.07011694461107254,
-0.3283194303512573,
-0.2680721580982208,
-0.056020595133304596,
-0.09549720585346222,
-0.2390003353357315,
-0.6566696166992188,
-0.22498396039009094,
0.6438748240470886,
-0.21880827844142914,
-0.4100977778... | |
the application, and how the networking is going to be used. For a multiplayer game, you'd probably need a push-pull network layer (where both the client and the server can send data to each others at any time). A `Socket` can do that.
Using HTTP would need your client to request data repeatedly to your server, which ... | [
0.1225614845752716,
-0.3483137786388397,
0.36505892872810364,
0.38294002413749695,
-0.12549661099910736,
-0.20318427681922913,
0.06982093304395676,
-0.08854591101408005,
-0.2829531729221344,
-0.5753285884857178,
-0.058940306305885315,
0.5660200715065002,
-0.21295887231826782,
-0.0597642064... | |
time.
There is a framework for making AS3/Flex application communicate with a Java server, developed by Adobe : [BlazeDS](http://opensource.adobe.com/wiki/display/blazeds/BlazeDS/).
Hope this helps. | [
0.3396954834461212,
-0.21964211761951447,
0.2817910313606262,
0.22411762177944183,
-0.10977719724178314,
-0.004092030227184296,
0.35973843932151794,
-0.149387925863266,
-0.22892706096172333,
-0.867912769317627,
-0.08061058074235916,
0.12385226786136627,
0.03921070322394371,
-0.244956523180... | |
I'm relatively new to Git, but I've found it so easy to work with at home that I'd like to use it at work where our projects are stored in Svn repositories. Unfortunately, the repositories are slightly non-standard and I'm having trouble getting them cloned. Sure, they all have trunk, branches/ and tags/, but branches/... | [
0.5383402109146118,
0.26489102840423584,
0.42780208587646484,
-0.05518118292093277,
0.00042926371679641306,
0.04456249997019768,
0.25101959705352783,
-0.0884043276309967,
-0.10514791309833527,
-0.797760009765625,
-0.23336830735206604,
0.39851826429367065,
0.020897122099995613,
0.1572936177... | |
actual project branches or tags. I actually need to be able to work on the trunk, one maintenance branch and one development branch. I've tried this approach in addition to several hacks at modifying the config, but nothing is working for me.
Is there any way I can get the key components of my non-standard Svn project... | [
0.5640023946762085,
-0.3346846401691437,
0.2817264199256897,
0.23082099854946136,
0.011363716796040535,
-0.14321522414684296,
0.1564895361661911,
0.21716155111789703,
-0.34530627727508545,
-0.6185128688812256,
-0.23308254778385162,
0.37951481342315674,
0.10866793990135193,
0.02271481044590... | |
than I'm willing to undertake until I'm much more comfortable with Git; as I mentioned, I'm still pretty new. I've barely scratched the surface of its capabilities.**
Lee B was right. The answer, provided by doener in #git, is to upgrade Git to 1.6.x (I had been using 1.5.x). 1.6.x offers deep cloning so that multiple ... | [
0.1696970909833908,
-0.0951680913567543,
0.5069935321807861,
0.25914737582206726,
0.2512437403202057,
-0.07577631622552872,
0.1588762402534485,
-0.07208208739757538,
-0.17697545886039734,
-0.9110468626022339,
-0.18659302592277527,
0.5374681353569031,
-0.05678215250372887,
-0.01945204846560... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.