text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
l.LogInformation( "Got lock to read/write file-based server state."
, (Int32)VipEvent.GotStateLock);
var fileStream = File.Open( ServerState.PATH, FileMode.OpenOrCreate
, FileAccess.ReadWrite, FileShare.None); | [
-0.11326504498720169,
-0.13485032320022583,
0.5769177675247192,
-0.28428786993026733,
0.43964603543281555,
0.04652267321944237,
0.3236745297908783,
0.1300467848777771,
-0.08969629555940628,
-0.6643160581588745,
-0.5680254697799683,
0.3673287332057953,
-0.5841935276985168,
0.395006626844406... | |
result = func.Invoke(fileStream);
fileStream.Close();
fileStream.Dispose();
fileStream = null;
ServerState._lock.ReleaseMutex();
l.LogInformation( "Released state file lock."
, (Int32)VipEvent.ReleasedStateLock); | [
0.07103375345468521,
-0.2871323525905609,
0.6897718906402588,
-0.3838130235671997,
0.4351113438606262,
-0.011480230838060379,
0.1996248960494995,
-0.2446710765361786,
-0.330949604511261,
-0.4336526095867157,
-0.6305114030838013,
0.2462053745985031,
-0.4660228192806244,
0.4585619866847992,
... | |
return true;
}
else
{
l.LogWarning( "Could not get a lock to access the file-based server state."
, (Int32)VipEvent.CouldNotGetStateLock);
result = null;
return false;
}
}
```
This *usually* works, but occasionally I cannot get access to the mutex (I see the... | [
0.2039324939250946,
-0.03161006048321724,
0.3518647253513336,
-0.2769365906715393,
0.3013371229171753,
0.0416460856795311,
0.7889134287834167,
-0.338501513004303,
-0.05953741818666458,
-0.29418426752090454,
-0.31497159600257874,
0.7302299737930298,
-0.2753536105155945,
0.38371753692626953,... | |
get a lock" event in the log). I cannot reproduce this locally - it only happens on my production servers (Win Server 2k3/IIS 6). If I remove the timeout, the application hangs indefinitely (race condition??), including on subsequent requests.
When I do get the errors, looking at the event log tells me that the mutex ... | [
0.19179081916809082,
0.16786107420921326,
0.3643200993537903,
-0.13953745365142822,
0.30337104201316833,
-0.06028465926647186,
0.6911856532096863,
-0.30946096777915955,
-0.5876038074493408,
-0.2233959436416626,
-0.49634048342704773,
0.5696156024932861,
-0.39429980516433716,
0.3737224042415... | |
worry about it.
Any suggestions as to why it randomly would fail to get a signal?
---
**Update:**
I've added proper error handling (how embarrassing!), but I am still getting the same errors - and for the record, unhandled exceptions were never the problem.
Only one process would ever be accessing the file - I don... | [
0.40491920709609985,
0.10067785531282425,
0.48304662108421326,
0.14107488095760345,
0.11447547376155853,
-0.21639801561832428,
0.5903695821762085,
0.20898975431919098,
-0.5361149907112122,
-0.6284814476966858,
-0.1574956625699997,
0.4991125166416168,
-0.13291478157043457,
-0.13430170714855... | |
watching the task manager that the issue occurs while there is only one worker process.
@mmr: How is using Monitor any different from using a Mutex? Based on the MSDN documentation, it looks like it is effectively doing the same thing - if and I can't get the lock with my Mutex, it *does* fail gracefully by just retur... | [
0.6498768925666809,
-0.19953970611095428,
0.23868325352668762,
0.0923975333571434,
-0.1277008056640625,
-0.10645780712366104,
0.44404202699661255,
0.10686887800693512,
-0.46012720465660095,
-0.7596971988677979,
0.20051491260528564,
0.8101980090141296,
-0.2752936780452728,
-0.05052702128887... | |
lock is not used for any other call. The only time \_lock is referenced outside the InvokeOnFile method is when it is instantiated.
The Func that is invoked is either reading from the file and deserializing into an object, or serializing an object and writing it to the file. Neither operation is done on a separate thr... | [
0.08720245212316513,
-0.05362452194094658,
0.4847455322742462,
0.0025070738047361374,
0.2305755913257599,
-0.23083941638469696,
0.24963217973709106,
-0.20163315534591675,
-0.264580637216568,
-0.446531742811203,
-0.18380805850028992,
0.7270755767822266,
-0.49907320737838745,
0.2123518735170... | |
a basic understanding of what/how that tool does). As sambo points out, using a Mutex apparently has a lot of overhead, which was causing issues in my application, whereas Monitor is designed specifically for .NET.
You should only be using Mutexes if you need **cross-process synchronization**.
> Although a mutex can ... | [
0.3916809558868408,
-0.06568987667560577,
0.30150845646858215,
0.09663108736276627,
-0.00308303814381361,
0.1368783861398697,
0.4008886218070984,
-0.16116543114185333,
-0.17133235931396484,
-0.7926177382469177,
0.12100140005350113,
0.5823515057563782,
-0.6524773836135864,
0.245836481451988... | |
more powerful
> than a monitor, a mutex requires
> interop transitions that are more
> computationally expensive than those
> required by the Monitor class.
If you need to support inter-process locking you need a [Global mutex](https://stackoverflow.com/questions/229565/what-is-a-good-pattern-for-using-a-global-mu... | [
0.11550769209861755,
-0.15934208035469055,
0.4271188974380493,
0.17982491850852966,
0.06364171952009201,
-0.4136502146720886,
0.2494591772556305,
-0.057532478123903275,
-0.6602122783660889,
-0.5686761140823364,
-0.22259390354156494,
0.5741562247276306,
-0.40555718541145325,
0.1597631126642... | |
it. I would recommend getting the locking right and avoiding the timeout.
I think its best to re-write this to use a lock. Also, it looks like you are calling out to another method, if this take forever, the lock will be held forever. That's pretty risky.
This is both shorter and much safer:
```
// if you want tim... | [
0.06067291647195816,
-0.3188078701496124,
0.5490272641181946,
-0.03491313382983208,
0.381430983543396,
-0.32064786553382874,
0.3712710738182068,
0.004639019723981619,
-0.047711145132780075,
-0.6490746736526489,
-0.28203633427619934,
0.6345502138137817,
-0.3056238293647766,
0.23841093480587... | |
using (var fileStream = File.Open( ServerState.PATH, FileMode.OpenOrCreate
, FileAccess.ReadWrite, FileShare.None))
{
// the line below is risky, what will happen if the call to invoke
// never returns?
result = func.Invoke(fileStream);
}
}
l.LogInf... | [
0.28762033581733704,
-0.34488147497177124,
0.4482792615890503,
-0.11010217666625977,
0.5729659199714661,
-0.03866319730877876,
0.3571169674396515,
-0.41562461853027344,
-0.26556673645973206,
-0.36215895414352417,
-0.39037787914276123,
0.5622603297233582,
-0.3941473960876465,
0.321423649787... | |
true;
// note exceptions may leak out of this method. either handle them here.
// or in the calling method.
// For example the file access may fail of func.Invoke may fail
``` | [
0.19553214311599731,
0.2146613746881485,
0.27252674102783203,
-0.006062212400138378,
0.15368682146072388,
-0.38798969984054565,
0.6603657603263855,
-0.06537339836359024,
0.1040470078587532,
-0.23728127777576447,
-0.5160493850708008,
0.8927798867225647,
-0.1747063845396042,
-0.0383764021098... | |
I'm starting to look into SSRS Report Builder 2.0, and I see in the documentation that it supports connections to SQL 2005.
Does anyone know if the reports made against SQL 2005 can then be upload to the SSRS 2005 website and ran from the site? Or, can they only be run from the SSRS 2008 website if they were generated... | [
0.29092085361480713,
-0.10052840411663055,
0.002023223089054227,
-0.07547830790281296,
-0.43457791209220886,
-0.10062500834465027,
0.2817063629627228,
-0.08510508388280869,
-0.25472721457481384,
-0.20311981439590454,
0.44960281252861023,
0.4054793119430542,
-0.24848301708698273,
0.16232278... | |
If you are motivate to the "pros" of an ORM and why would you use an ORM to management/client, what are those reasons would be?
Try and keep one reason per answer so that we can see which one gets voted up as the best reason.
Making data access more abstract and portable. ORM implementation classes know how to write v... | [
0.42436593770980835,
-0.05266553536057472,
0.03088080696761608,
0.5053891539573669,
-0.028089214116334915,
-0.30789580941200256,
0.05095147341489792,
-0.2786098122596741,
-0.225171759724617,
-0.3377198278903961,
-0.02857236936688423,
0.6294451951980591,
-0.03504013270139694,
-0.17853316664... | |
Is there any guideline or rule for when the **view state** should be enabled on a server control? And when it should ***not***?
I was looking at this [`SqlDatasource` example](http://quickstarts.asp.net/QuickStartv20/util/srcview.aspx?path=~/aspnet/samples/data/GridViewMasterDetailsInsert.src) and noticed that the vie... | [
0.19476769864559174,
-0.12071544677019119,
0.5766675472259521,
-0.2978965938091278,
0.047258030623197556,
-0.29891958832740784,
0.08424917608499527,
-0.2856164574623108,
-0.10947168618440628,
-0.6816774010658264,
-0.16928721964359283,
0.7567416429519653,
-0.13578037917613983,
0.13022367656... | |
a later postback without recalculating the value, then you need to use ViewState.
For example. In my page's markup I might have a Label control specified like this:
```
<asp:Label ID="TitleLabel" runat="server" Text="Update this Employee" />
```
Then in the Page\_Load event I have this code:
```
If Not IsPostBack ... | [
0.03304014727473259,
0.1131683960556984,
0.5335116386413574,
-0.18292340636253357,
0.04113311693072319,
-0.0998457595705986,
0.1591872274875641,
-0.1427941620349884,
-0.19054709374904633,
-0.8744450807571411,
-0.04330945014953613,
0.5056219100952148,
-0.22241578996181488,
0.419738799333572... | |
ViewState used by my page. I [enable tracing](http://msdn.microsoft.com/en-us/library/ms972204.aspx) on the page. The trace output is added to the bottom of your page when its rendered in the browser. The trace output identifies every single server control on your page and includes how much ViewState (measured in bytes... | [
0.3087063729763031,
0.005903889425098896,
0.867444634437561,
0.28657597303390503,
0.1660723239183426,
0.028261329978704453,
-0.0628739520907402,
-0.06928196549415588,
-0.0968526154756546,
-0.7709723114967346,
0.19126799702644348,
0.3097657263278961,
-0.10383599996566772,
0.0117059927433729... | |
updated markup would look:
```
<asp:Label ID="TitleLabel" runat="server" Text="Update this Employee" EnableViewState="false" />
```
And my updated Page\_Load event:
```
If myEmployeeObject.IsNew Then TitleLabel.Text = "Create a new Employee"
``` | [
0.09451909363269806,
0.11255276203155518,
0.7034613490104675,
-0.22576913237571716,
0.15642006695270538,
-0.12463775277137756,
0.2105233520269394,
0.15596072375774384,
-0.08189258724451065,
-0.8458771705627441,
-0.27883896231651306,
0.345700204372406,
-0.012730682268738747,
0.2437889575958... | |
I need an accurate timer to interface a Windows application to a piece of lab equipment.
I used System.Timers.Timer() to create a timer that ticks every 10 msec, but this clock runs slow. For example 1000 ticks with an interval of 10 msec should take 10 wall-clock seconds, but it actually takes more like 20 wall-clock... | [
0.39010855555534363,
0.005424750968813896,
0.6016280651092529,
0.1949930042028427,
0.18931080400943756,
0.06110966205596924,
0.2611517012119293,
-0.21635426580905914,
0.00031462882179766893,
-0.7256724834442139,
0.4058900475502014,
0.6158281564712524,
-0.012820553965866566,
0.1996230632066... | |
run slow. This probably fine if the interval is large (seconds or minutes) but unacceptable for very short intervals.
Is there a function on Windows that will trigger a procedure every time the system clock crosses a 10 msec (or whatever) boundary?
This is a simple console application.
Thanks
Norm
UPDATE: System.T... | [
0.15093038976192474,
-0.3281621038913727,
0.49906474351882935,
0.2145785242319107,
0.211333766579628,
0.1766965091228485,
0.7499902248382568,
0.2532508969306946,
-0.45948442816734314,
-0.37460365891456604,
0.23864974081516266,
0.5539335608482361,
-0.19551368057727814,
-0.0927513837814331,
... | |
like System.Timers.Timer() cannot tick faster that about 15 msec, regardless
of the interval setting.
Note that none of these tests seemed to use any measurable CPU time, so the limit is not the CPU, just a .net limitation (bug?)
For now I think I can live with an inaccurate timer that triggers a routine every 15 mse... | [
0.49484798312187195,
-0.21928879618644714,
0.55061936378479,
0.22896096110343933,
0.19830408692359924,
-0.24117080867290497,
0.21533049643039703,
0.14344027638435364,
-0.4735063910484314,
-0.6232724189758301,
0.27141255140304565,
0.5154504179954529,
-0.07925277203321457,
0.3514392077922821... | |
likely others.
Thanks again.
You need to use a [high resolution timer](http://www.codeproject.com/KB/vb/vbnetstopwatch.aspx) such as QueryPerformanceCounter | [
0.4529591500759125,
-0.4494536817073822,
0.36035987734794617,
0.38867393136024475,
0.08071250468492508,
-0.23483799397945404,
0.2574881911277771,
-0.1366807520389557,
-0.4550015926361084,
-0.51414555311203,
0.006919919513165951,
0.44547414779663086,
-0.05048748105764389,
0.0258213002234697... | |
I am trying to use the following code to load styles from an external SWF, but I keep getting an ActionScript error when the URL is invalid:
```
Error: Unable to load style(Error #2036: Load Never Completed. URL: http://localhost/css/styles.swf): ../css/styles.swf.
at <anonymous>()[C:\autobuild\3.2.0\frameworks\projec... | [
0.4894619584083557,
0.11903898417949677,
0.632693350315094,
-0.31586089730262756,
0.05272592231631279,
0.0399944894015789,
0.6753312349319458,
-0.34931936860084534,
-0.06395336985588074,
-0.6873125433921814,
-0.1971571296453476,
0.36882972717285156,
-0.36964502930641174,
0.1247607991099357... | |
loadStyle_completeHandler);
styleEvent.addEventListener(StyleEvent.ERROR,
loadStyle_errorHandler);
} | [
0.01554273720830679,
-0.2583407461643219,
0.2883433997631073,
-0.3242216110229492,
0.14392469823360443,
-0.12383133918046951,
0.5184208750724792,
-0.27289456129074097,
-0.0775054544210434,
-0.3493017852306366,
-0.31707215309143066,
0.6064113974571228,
-0.37082406878471375,
-0.2071722298860... | |
catch (error:Error)
{
useDefault();
}
}
private function loadStyle_completeHandler(event:StyleEvent): void
{
IEventDispatcher(event.currentTarget).removeEventListener(
event.type, loadStyle_completeHandler);
goToNextStep();
}
private function loadStyle_errorHandler(event:StyleEvent): ... | [
0.4000416398048401,
-0.14068827033042908,
0.29453831911087036,
-0.2554505169391632,
0.15651221573352814,
0.022132348269224167,
0.5078302025794983,
-0.21565362811088562,
0.13969449698925018,
-0.22730652987957,
-0.027947548776865005,
0.7252644300460815,
-0.4395259916782379,
0.087957136332988... | |
that the ERROR Event *is* being triggered twice. So, I simply set a flag the first time the ERROR event handler is triggered, and check that flag for a value of true before continuing:
```
private var isErrorTriggered:Boolean; // Default is false
private function loadStyle_completeHandler(event:StyleEvent):void
{
... | [
0.33622366189956665,
-0.18857358396053314,
0.1447322964668274,
-0.400462806224823,
0.2008144110441208,
0.08632531762123108,
0.5800769329071045,
-0.22455763816833496,
-0.1579822301864624,
-0.32716020941734314,
-0.26163968443870544,
0.9894812107086182,
-0.35526371002197266,
-0.06694974005222... | |
I have a simple function written in Oracle 9i (version 9.2.0.4.0) to simulate an in-line IF. For those interested, here's the code:
```
create or replace
FUNCTION IIF
(testExpression NUMBER,
trueResult NUMBER,
falseResult NUMBER)
RETURN NUMBER
AS
BEGIN
/*
A simple in-line IF function for use w... | [
0.04261438921093941,
0.27525267004966736,
0.1420864313840866,
-0.2392507791519165,
-0.09621433913707733,
-0.04025351628661156,
0.31490859389305115,
-0.31596145033836365,
0.40363365411758423,
-0.373142272233963,
0.06572938710451126,
0.4810526967048645,
-0.24572382867336273,
-0.0429731309413... | |
returned.
*/
IF (testExpression is null) or (testExpression = 0) THEN
return falseResult;
ELSE
return trueResult;
END IF;
END IIF;
```
This isn't rocket science. Now, here's the big mystery: if I execute the following SQL statements, everything is just fine, and works exactly as I expect:
... | [
0.230879545211792,
0.17677587270736694,
0.18702417612075806,
0.17771124839782715,
0.00879975687712431,
-0.31275948882102966,
0.6698257327079773,
-0.2809500992298126,
0.0928400382399559,
-0.16457243263721466,
-0.25846627354621887,
0.7465272545814514,
-0.2903275191783905,
-0.0266495216637849... | |
that isn't the case. Would anyone happen to have an explanation for this little bit of bizarreness?
It's taking a whole lot of self-control at the moment to restrain myself from hurling the Oracle server out the window. Oracle seems *rife* with these kinds of inanities.
EDIT: Is there some kind of magic syntax I hav... | [
0.5251914858818054,
0.33008724451065063,
-0.29715126752853394,
0.3719486892223358,
-0.07551856338977814,
-0.06452350318431854,
0.33794185519218445,
0.21799007058143616,
-0.19893406331539154,
-0.3563896715641022,
0.2295801341533661,
0.1858167201280594,
-0.19430594146251678,
0.18460813164710... | |
of the SQL language for some reason.
The error occurs because Oracle doesn't expect a relational operator in the `select` clause of the query:
```
SQL> SELECT IIF(1>7, 0, 1) FROM DUAL;
SELECT IIF(1>7, 0, 1) FROM DUAL
*
ERROR at line 1:
ORA-00907: missing right parenthesis
SQL> SELECT 1=0 FROM DUAL;
SELEC... | [
-0.1459091454744339,
0.049390990287065506,
0.18638670444488525,
0.03193081170320511,
0.06409246474504471,
0.0623275525867939,
0.5491214990615845,
-0.1322934478521347,
-0.039325226098299026,
-0.027845283970236778,
-0.3215693235397339,
0.6441783308982849,
-0.4488160312175751,
0.0914469733834... | |
I'm currently porting a POSIX C++ application to run on Windows without Cygwin or anything. No problem so far. Now, the application (ZNC, an IRC bouncer, in case you're interested) supports loading modules from .so shared library files on Linux/BSD etc.
I ported the main executable without much of a problem, all wrapp... | [
0.5116462111473083,
0.03195272386074066,
0.46386781334877014,
0.0714712142944336,
-0.1850777566432953,
-0.3116993010044098,
0.07995478808879852,
0.21193526685237885,
-0.48928216099739075,
-0.6629409790039062,
-0.14980371296405792,
0.51641446352005,
-0.349078506231308,
0.18409088253974915,
... | |
the modules (over 20) into separate DLL files. I don't want to create a single VS project for each however. Which means I'll probably have to create a makefile? Or something the like? I've never done that before on Windows, so that's my question. What is the best approach to compile a bunch of .cpps into separate DLL f... | [
0.6984018087387085,
-0.1406530737876892,
0.45451465249061584,
0.27115675806999207,
0.03550096973776817,
-0.16509637236595154,
-0.03230666369199753,
-0.1360919326543808,
-0.670601487159729,
-0.6099353432655334,
-0.10163751244544983,
0.42601069808006287,
-0.12898780405521393,
0.1674521714448... | |
are working against the grain of the SQL language for some reason.
The error occurs because Oracle doesn't expect a relational operator in the `select` clause of the query:
```
SQL> SELECT IIF(1>7, 0, 1) FROM DUAL;
SELECT IIF(1>7, 0, 1) FROM DUAL
*
ERROR at line 1:
ORA-00907: missing right parenthesis
SQ... | [
0.1079384833574295,
0.02807343378663063,
0.24061144888401031,
-0.0199870765209198,
0.1989566832780838,
0.11055160313844681,
0.6452259421348572,
-0.39545074105262756,
-0.008770172484219074,
-0.30335885286331177,
-0.18572592735290527,
0.6072101593017578,
-0.4754622280597687,
-0.0681959092617... | |
I want to know how many users are connected to the IIS web server at any point on a simple .net page. Is there a way using a native .net class in 3.5 that will tell me this information? I want to create a simple web page that will give me the total number of users/open sessions at a given time.
Currently, I am using P... | [
0.39005687832832336,
-0.24741095304489136,
0.14987638592720032,
0.42855513095855713,
-0.14963650703430176,
-0.4262036979198456,
0.512178361415863,
-0.08235697448253632,
-0.1824067234992981,
-0.957882285118103,
0.04211069270968437,
0.7119517922401428,
0.0960245355963707,
0.00525211403146386... | |
get the information I specified below.
**Update 0:** There is a [msdn artical about how to show performance counter](http://msdn.microsoft.com/en-us/library/ms979194.aspx) in asp.net page ( and more, but that is not important).
You can show the
> web service => current connections => total
counter on your page. | [
0.22778235375881195,
-0.36461737751960754,
0.5986483693122864,
0.25249555706977844,
-0.11911868304014206,
-0.031896114349365234,
0.3639002740383148,
-0.07392287254333496,
-0.537804365158081,
-0.6306317448616028,
0.0651145800948143,
0.4897818863391876,
0.22597362101078033,
0.147251278162002... | |
I want to embed multiple audio to my site. I want the file to load but not play until the user hits the button. I also want the ablity to jump to places not yet loaded like youtube does. It would be great if i can play ogg, aac, mp4, etc but i dont expect that would be possible so I wouldnt mind having another version ... | [
0.7579764127731323,
0.16437764465808868,
0.3504974842071533,
0.32429853081703186,
-0.3415583074092865,
-0.2767704427242279,
0.18541787564754486,
-0.020512454211711884,
-0.21072226762771606,
-0.6129839420318604,
0.3705769181251526,
0.7399104833602905,
-0.39983007311820984,
0.004430008586496... | |
solutions?](https://stackoverflow.com/questions/448871/web-nonstreaming-audio-solutions/550427#550427) is the best with sorin following closely behind [web (non?)streaming audio solutions?](https://stackoverflow.com/questions/448871/web-nonstreaming-audio-solutions/562958#562958)
I don't understand why you do not want ... | [
-0.06929778307676315,
-0.009191170334815979,
0.48589131236076355,
0.23064951598644257,
0.15817928314208984,
-0.2994411885738373,
-0.05298634618520737,
-0.08188134431838989,
-0.3487709164619446,
-0.5689593553543091,
-0.2054026871919632,
0.9588885307312012,
-0.07615158706903458,
-0.008216311... | |
I'm attempting to use Mono and Monodevelop (the IDE) to code a C# project in Ubuntu.
Everything is working apart from the fact that the System.Text.RegularExpressions (Package?) is not found. The only relevant thing I have found on the interwebs is [here](https://bugs.launchpad.net/ubuntu/+source/mono/+bug/124857)
Th... | [
0.550595760345459,
0.3280188739299774,
-0.10613219439983368,
-0.0932874083518982,
-0.18110427260398865,
-0.3568827509880066,
0.3039620816707611,
0.016592683270573616,
-0.18205960094928741,
-0.3806932866573334,
-0.15337030589580536,
0.6695656776428223,
-0.5025027990341187,
0.197554856538772... | |
I've read ["what-is-turing-complete"](https://stackoverflow.com/questions/7284/what-is-turing-complete) and the wikipedia page, but I'm less interested in a formal proof than in the practical implications of *requirements for* being Turing Complete.
What I'm actually trying to decide is if the toy language I've just d... | [
0.14395277202129364,
0.3177907466888428,
-0.24119225144386292,
-0.052968766540288925,
-0.11076614260673523,
0.10503359138965607,
0.44734302163124084,
0.2997864782810211,
-0.14484313130378723,
-0.589784562587738,
-0.18206366896629333,
0.4528203308582306,
0.026727717369794846,
0.095690883696... | |
that conditional branching and a readable/writeable memory store will get me most of the way there)*
---
EDIT:
I think I've gone off on a tangent by saying "Turing Complete". I'm trying to guess with reasonable confidence that a newly invented language with a certain feature set (or alternately, a VM with a certain ... | [
0.21630923449993134,
0.12637798488140106,
-0.28163862228393555,
0.16442115604877472,
-0.0527464859187603,
-0.14010609686374664,
0.5806284546852112,
0.19739437103271484,
-0.335732638835907,
-0.2966625988483429,
-0.2630171775817871,
0.426724374294281,
0.13104300200939178,
-0.0092426557093858... | |
*probably* do anything".
You need some form of dynamic allocation construct (`malloc` or`new` or `cons` will do) and either recursive functions or some other way of writing an infinite loop. If you have those and can do anything at all interesting, you're almost certainly Turing-complete.
The lambda calculus is equiva... | [
0.33285021781921387,
-0.1772894710302353,
-0.2031421959400177,
0.5231593251228333,
-0.0662132054567337,
-0.2164653092622757,
0.22177430987358093,
0.2573213577270508,
-0.47898733615875244,
-0.44078871607780457,
-0.30165982246398926,
0.5458837747573853,
-0.18631380796432495,
-0.2987037599086... | |
of special-purpose languages that guarantee termination and therefore are *not* Turing-complete. Sometimes it is useful to give up the extra expressive power in exchange for guaranteed termination. | [
0.001972019672393799,
0.2955201268196106,
-0.45819443464279175,
0.15327708423137665,
-0.11194169521331787,
-0.13339179754257202,
0.6718900799751282,
0.16058595478534698,
-0.25216832756996155,
-0.2387748807668686,
-0.7701017260551453,
0.4536808729171753,
-0.18468351662158966,
-0.19814801216... | |
In XML, how should a list be represented?
With an enclosing list entity:
```
<person>
<firstname>Joe</firstname>
<lastname>Bloggs</lastname>
<children>
<child .../>
<child .../>
<child .../>
<child .../>
<child .../>
</children>
</person>
```
Or without:
```... | [
0.19173797965049744,
-0.14302928745746613,
0.2267528623342514,
0.1370038539171219,
-0.20123468339443207,
0.0071699549444019794,
-0.5535816550254822,
-0.2854580879211426,
-0.4571937024593353,
-0.5061836838722229,
-0.3664992153644562,
0.002651349175721407,
-0.20097878575325012,
0.02468324080... | |
<child .../>
<child .../>
</person>
```
For extensibility, I would use the first solution (the one with the *children* node). If you ever wish to store any data about all of the children then you have a convenient node on which to place attributes. | [
-0.00441232044249773,
0.15472103655338287,
0.11638841778039932,
0.35104432702064514,
0.14196009933948517,
0.3865833878517151,
-0.2947778105735779,
0.019869012758135796,
0.10828635096549988,
-1.066449522972107,
0.03730737790465355,
0.5681878328323364,
0.17104768753051758,
0.1700107902288437... | |
I want to get a simple Python "hello world" web page script to run on Windows Vista/ Apache but hit different walls. I'm using WAMP. I've installed `mod_python` and the module shows, but I'm not quite sure what I'm supposed to do in e.g. http.conf (things like AddHandler mod\_python .py either bring me to a file not fo... | [
0.41721802949905396,
0.2980562746524811,
0.0863255113363266,
-0.17810320854187012,
-0.16330872476100922,
-0.47257155179977417,
0.6533365845680237,
0.19148550927639008,
-0.18101206421852112,
-0.7938791513442993,
0.026620211079716682,
0.6883655786514282,
-0.38608214259147644,
0.1594425141811... | |
That is not true. [Wsgi](http://wsgi.org) is the standard to run python web applications, defined by [PEP 333](http://www.python.org/dev/peps/pep-0333/). So use [`mod_wsgi`](http://code.google.com/p/modwsgi/) instead.
Or alternatively, use some web framework that has a server. [Cherrypy](http://www.cherrypy.org/)'s on... | [
0.25096237659454346,
0.1308290809392929,
0.38621389865875244,
-0.18952593207359314,
-0.11123155802488327,
-0.2865966856479645,
0.30825725197792053,
-0.1224486455321312,
-0.1678513139486313,
-0.2532237768173218,
-0.1748531460762024,
0.46963781118392944,
-0.3305833637714386,
-0.1456418931484... | |
start a webserver. Configuring `mod_wsgi` to it will make it run inside apache. | [
0.30672043561935425,
-0.0327211432158947,
0.06112390384078026,
0.15372055768966675,
-0.16942933201789856,
-0.5747373104095459,
0.4516298472881317,
-0.038116998970508575,
-0.03623437508940697,
-0.6497429013252258,
-0.33025357127189636,
0.3127698600292206,
-0.2612423002719879,
-0.03109226003... | |
I'd like to have something that looks and behaves as hyperlink inside larger rectangle (full page wide) which is also hyperlink. Below there is ASCII-art representation of what it should look like:
```
|-------------------------------------------|
| Some text [_link_] |
|------------------... | [
0.3890043795108795,
0.23917707800865173,
0.4644758403301239,
-0.019751157611608505,
0.15094797313213348,
-0.1794113963842392,
-0.06336233764886856,
-0.06989966332912445,
-0.013616066426038742,
-0.7755290269851685,
-0.002304229885339737,
0.18059591948986053,
-0.16206420958042145,
0.32920041... | |
(X)HTML:
> **12.2.2 Nested links are illegal**
>
>
> Links and anchors defined by the A element must not be nested;
> an A element must not contain any other A elements.
(from <http://www.w3.org/TR/html401/struct/links.html#h-12.2.2>), so the most natural way of implementing above
```
<a href="xxx" style="display... | [
0.14897698163986206,
0.24625104665756226,
0.4481932818889618,
-0.13555513322353363,
-0.09047936648130417,
-0.3210828900337219,
0.28156858682632446,
-0.27453091740608215,
-0.18172797560691833,
-0.7200794816017151,
-0.3244360089302063,
0.1480742245912552,
-0.4643038511276245,
0.1115817949175... | |
HTML and CSS (but no JavaScript), but **without nested link elements** in HTML source. It would be nice if behaviour was as close as possible to the one with nested link elements (for browsers which are not overly strict in implementing HTML standard).
---
*Edit (16-01-2009)*
**Clarification:** Solutions which use m... | [
-0.27125126123428345,
0.022882476449012756,
0.5208149552345276,
-0.0997101217508316,
-0.40943223237991333,
-0.009956959635019302,
0.28256461024284363,
-0.23325127363204956,
-0.4905329644680023,
-0.9079949855804443,
-0.2539497911930084,
0.3329600989818573,
-0.4319651424884796,
-0.2314706295... | |
width: 100%;
height: 100%;
z-index: 1;
}
a.c:hover {
background-color: #88F;
}
a.c span {
display: none;
}
```
```html
<div class="a">
foo
<a href="bar" class="b">bar</a>
<a href="foo" class="c"><span>baz</span></a>
</div>
``` | [
0.048267513513565063,
-0.05213607847690582,
0.7588732838630676,
-0.3660401701927185,
-0.21439631283283234,
0.4207649827003479,
-0.0526532344520092,
-0.2670881152153015,
-0.3978298306465149,
-0.43079710006713867,
-0.4195038080215454,
0.4264066219329834,
0.21427543461322784,
-0.1480665653944... | |
In my application, I need to change some value ("Environment") in appSetting of app.config at runtime.
I use AppSettingsReader
```
private static AppSettingsReader _settingReader;
public static AppSettingsReader SettingReader
{
get
{
if (_settingReader == null)
{
... | [
0.03687730059027672,
0.14360615611076355,
0.9077091813087463,
-0.1959953010082245,
0.32615184783935547,
0.07289034873247147,
0.46634164452552795,
-0.11925310641527176,
0.007810741197317839,
-1.0298351049423218,
-0.5039092898368835,
0.8901437520980835,
-0.4659914970397949,
-0.01396356709301... | |
}
return _settingReader;
}
}
```
Then at some stage I do this
```
config.AppSettings.Settings[AppSettingString.Environment.ToString()].Value = newEnvironment.ToString();
config.Save(ConfigurationSaveMode.Modified);
ConfigurationManager.RefreshSection("appSettings"); ... | [
-0.07111112028360367,
0.0628478154540062,
0.645095705986023,
-0.29746294021606445,
0.6752298474311829,
0.029059099033474922,
0.4803127944469452,
-0.175810769200325,
-0.3097207844257355,
-0.9947242140769958,
-0.38608497381210327,
0.8786564469337463,
-0.6729211807250977,
0.14744356274604797,... | |
that I can fix this by doing
```
_settingReader = new AppSettingsReader();
```
before I read "Environment".
But I think creating a new instance is not the proper approach.
Maybe there is a way to let my SettingReader know, that the values have changed to use the same instance of it, but with refreshed values?
(No... | [
0.17115508019924164,
0.29485049843788147,
0.15945351123809814,
0.11967407912015915,
-0.08124610036611557,
-0.0298115573823452,
0.4235862195491791,
0.08151105046272278,
-0.2889612913131714,
-0.5613407492637634,
0.29885008931159973,
0.6702713370323181,
-0.46773016452789307,
0.037215642631053... | |
app. More like configuration parameters for your application that can be tweaked before startup.
For read-write application settings, I think the Settings mechanism with IDE support ([System.Configuration.ApplicationSettingsBase](http://msdn.microsoft.com/en-us/library/system.configuration.applicationsettingsbase.asp... | [
-0.20501485466957092,
-0.021254999563097954,
0.4697493612766266,
0.17049407958984375,
-0.03492562100291252,
0.19304348528385162,
0.3592643439769745,
-0.2738178074359894,
-0.2749709486961365,
-1.068500280380249,
-0.33309128880500793,
0.6462118029594421,
-0.6396510004997253,
0.21608199179172... | |
the latest value within the application. | [
0.09889841824769974,
0.1489829570055008,
0.5459808111190796,
0.2950114607810974,
0.23625442385673523,
-0.11590847373008728,
-0.23599711060523987,
0.08238139003515244,
0.08476437628269196,
-0.37057968974113464,
-0.24624395370483398,
0.3953036665916443,
0.2615785002708435,
0.0639216750860214... | |
I have a form which contains a whole heap of data entry fields that will be completed by the user including some elements where the user can dictate how many of the same items they will enter. This is as is being used in Phil Haack's blog entry [Model Binding To A List](http://haacked.com/archive/2008/10/23/model-bindi... | [
0.24217218160629272,
0.04443740472197533,
0.4951184093952179,
-0.001333529711700976,
-0.09217174351215363,
-0.14026162028312683,
-0.08451364189386368,
-0.5931895971298218,
-0.3066674470901489,
-0.818735659122467,
-0.11634849011898041,
0.22632649540901184,
-0.33339476585388184,
0.1295222789... | |
am trying to also send it an `IList<Itmes>` as well.
Should I be adding this to the parameters expected by the Controller or accessing via form["items"] or something else?
**View**
```
<form action="/MyItems/Add" method="post">
<input type="text" name="Title" value="" />
<input type="hidden" name="myItem.Inde... | [
-0.06898745149374008,
-0.15717218816280365,
0.5895432829856873,
-0.15788868069648743,
0.15221287310123444,
-0.03635029494762421,
0.14887307584285736,
-0.9375567436218262,
-0.07054714113473892,
-0.5597034096717834,
-0.3548259735107422,
0.6570981740951538,
-0.335511714220047,
0.0129897408187... | |
class Item()
{
int Amount {get; set; };
string Name {get; set; };
}
```
I have decided to work with exclusively with the `FormCollection` rather than muddying the waters with some data being passed through using `FormCollection` and other data being mapped to a List by the framework. The below code takes the i... | [
0.14863362908363342,
-0.35643696784973145,
0.5092563629150391,
0.04700551554560661,
-0.16623587906360626,
-0.11883646249771118,
0.22069042921066284,
-0.5988051295280457,
-0.24976931512355804,
-0.6214426755905151,
0.0005772348376922309,
0.46902281045913696,
-0.2957953214645386,
0.2647055089... | |
itemList.Add(new Item()
{
Amount = Convert.ToInt32(form[String.Format("item[{0}].Amount",i )]),
Name = form[String.Format("item[{0}].Name",i )]
});
}
``` | [
0.21883460879325867,
-0.13438871502876282,
0.5957724452018738,
-0.3159762918949127,
-0.23649385571479797,
0.17095869779586792,
0.08923505246639252,
-0.7107224464416504,
-0.1351279467344284,
-0.579621434211731,
-0.11016680300235748,
0.6369990110397339,
-0.2340114861726761,
0.525606691837310... | |
I'm in the process of designing a system that will allow me to represent broad-scope tasks as workflows, which expose their workitems via an IEnumerable method. The intention here is to use C#'s 'yield' mechanism to allow me to write psuedo-procedural code that the workflow execution system can execute as it sees fit.
... | [
0.3727155327796936,
0.23141056299209595,
0.24952422082424164,
-0.12428119033575058,
-0.0020845860708504915,
-0.23399178683757782,
0.10094428807497025,
-0.12119989097118378,
-0.08627244830131531,
-0.6668123602867126,
-0.049934886395931244,
0.5068771243095398,
-0.13499584794044495,
-0.084294... | |
var db = new DB();
var emailServer = new EmailServer();
// other workitems here
var ci = new FindLowInventoryItems(db);
yield return ci;
if (ci.LowInventoryItems.Any()) {
var email = new SendEmailToWarehouse("Inventory is low.", ci.LowInventoryItems);
yield return email;
}
... | [
0.21108736097812653,
0.0760364979505539,
0.25805410742759705,
-0.4176277220249176,
-0.1456492692232132,
0.03205430880188942,
0.39774274826049805,
-0.44184452295303345,
0.04700702801346779,
-0.5860992074012756,
-0.2658859193325043,
0.5894766449928284,
-0.4757249057292938,
0.317423939704895,... | |
actions. The Execute() method gets called in the workflow framework - I have a WorkflowRunner class which enumerates the Workflow(), wraps pre- and post- events around the workitem, and calls Execute in between the events. This allows the consuming application to do whatever it needs in before or after workitems, inclu... | [
0.10691215097904205,
-0.0415201298892498,
-0.09573571383953094,
0.07558280229568481,
-0.14916488528251648,
0.06593043357133865,
0.1658376306295395,
-0.3167908191680908,
-0.1668446660041809,
-0.5035927891731262,
-0.040058691054582596,
0.6974256038665771,
-0.2752659320831299,
-0.359816491603... | |
IEnumerable, and C#'s syntactic sugar that supports it, I can compose these workflows - like higher-level workflows that consume and manipulate sub-workflows. For example I wrote a simple workflow that just interleaves two child workflows together.
My question is this - does this sort of architecture seem reasonable, ... | [
0.1401679515838623,
0.158718541264534,
0.19245953857898712,
0.08152086287736893,
0.09370281547307968,
-0.13110272586345673,
0.08728677034378052,
-0.19464384019374847,
-0.026244862005114555,
-0.7720345258712769,
0.019079260528087616,
0.5694299936294556,
-0.2489219307899475,
-0.2589722275733... | |
problems with this sort of architecture that I'm not seeing? Finally, has this been tried before - am I just re-discovering this?
Personally, this would be a "buy before build" decision for me. I'd buy something before I'd write it.
I work for a company that's rather large and can be foolish with its money, so if you... | [
0.5398796200752258,
0.2949041724205017,
0.03867150843143463,
0.0519367940723896,
0.2961771488189697,
0.34899452328681946,
-0.05111467465758324,
0.017346471548080444,
-0.3035857677459717,
-0.6305340528488159,
0.30979546904563904,
0.569607138633728,
-0.08189590275287628,
0.18668816983699799,... | |
finite state machine with states, transitions, events, and actions.
I'd want to be able to plug in different actions so I could customize different flows on the fly.
I'd want to be able to register different subscribers who would want to be notified when a particular event happened.
I wouldn't expect to see anyth... | [
0.05381283909082413,
-0.255697101354599,
-0.18542607128620148,
0.3637438118457794,
0.08758682757616043,
0.587429940700531,
-0.09451046586036682,
0.07138446718454361,
-0.32511886954307556,
-0.704758882522583,
0.3547729253768921,
0.30638474225997925,
-0.6729735732078552,
0.3087104558944702,
... | |
the workflows that I deal with are a mix of human and automated processing.
Do you anticipate wanting to connect to other systems, like databases, other apps, web services?
It's a tough problem. Good luck. | [
0.39704468846321106,
0.16693277657032013,
-0.03945304825901985,
0.15205387771129608,
0.3662507236003876,
-0.0833045020699501,
0.08732273429632187,
0.3267281949520111,
-0.30732473731040955,
-0.7376695275306702,
0.06471093744039536,
0.533693790435791,
0.11213614791631699,
-0.1366008818149566... | |
I found this line of code in the Virtuemart plugin for Joomla on line 2136 in administrator/components/com\_virtuemart/classes/ps\_product.php
```
eval ("\$text_including_tax = \"$text_including_tax\";");
```
Scrap my previous answer.
The reason this eval() is here is shown in the [php eval docs](http://www.php.net/... | [
0.1943046599626541,
0.3357890546321869,
0.4153517186641693,
-0.11036413162946701,
0.0017472518375143409,
-0.16014672815799713,
0.2918376922607422,
-0.2741835415363312,
-0.05173755809664726,
-0.033256448805332184,
-0.13120582699775696,
0.5887942910194397,
-0.3548433482646942,
-0.02448200993... | |
An alternative could be to use `sprintf()` | [
0.2535974383354187,
-0.22721260786056519,
-0.25659865140914917,
-0.20168721675872803,
-0.5115317702293396,
-0.289994478225708,
0.2447516918182373,
0.19345848262310028,
-0.212786003947258,
-0.37239089608192444,
-0.6005463004112244,
0.2393656224012375,
-0.2999248504638672,
-0.110873311758041... | |
I'm still learning Castle Windsor and I see that it supports forwarded types - a term I was unfamiliar with.
Quick Google search and I found [this](http://msdn.microsoft.com/en-us/library/ms404275.aspx) article that explains it pretty throughly however I still don't understand how this applies to IoC or how I would us... | [
0.13068287074565887,
0.39569535851478577,
0.3689650893211365,
0.03946678712964058,
-0.27148041129112244,
-0.5238864421844482,
0.13330310583114624,
-0.2668842077255249,
-0.3793969452381134,
-0.3016887903213501,
-0.300442636013031,
0.21759375929832458,
-0.11511565744876862,
0.219198480248451... | |
in the original definition of the string. By using `eval()` it forces it to re-evaluate the string and include the value for `$tax` in the string.
I'm not a fan of this particular method, but it is correct. An alternative could be to use `sprintf()` | [
0.3295873701572418,
-0.03218254819512367,
-0.19565211236476898,
-0.1548723578453064,
-0.00834685005247593,
-0.14366193115711212,
0.1522182673215866,
-0.12485086917877197,
0.11497016996145248,
0.01319956500083208,
0.03368731960654259,
0.4059354066848755,
-0.38674452900886536,
-0.05923346802... | |
If you were trying to create a domain object in a database schema, and in your code said domain object has a hashtable/list member, like so:
```
public class SpaceQuadrant : PersistentObject
{
public SpaceQuadrant()
{
}
public virtual Dictionary<SpaceCoordinate, SpaceObject> Space
{
get;
... | [
-0.08452402800321579,
-0.015195859596133232,
0.1698792576789856,
0.2163265198469162,
0.11020410060882568,
0.06463955342769623,
-0.003500686027109623,
0.26896053552627563,
-0.23379971086978912,
-0.5559603571891785,
-0.04633449390530586,
0.36066266894340515,
-0.29775673151016235,
0.342112332... | |
loading techniques, but they all kind of suck in terms of getting that O(1) access time that you get in a hashtable.
How would you represent the SpaceQuadrant, SpaceCoordinate, and Space Object in a database schema?
A simple schema code description would be nice,
ie.
```
table SpaceQuadrant
{
ID int not null prim... | [
0.026267163455486298,
0.04241226986050606,
0.0798255205154419,
0.4102846682071686,
-0.12826944887638092,
0.08448917418718338,
0.02172907441854477,
0.15674982964992523,
-0.34335488080978394,
-0.6466900706291199,
-0.024905672296881676,
0.6279996037483215,
-0.28037944436073303,
-0.16054598987... | |
the great answers, already, I've only skimmed them, and I want to take some time thinking about each before I respond.
If you think there is a better way to define these classes, then by all means show me an example, any language your comfortable with is cool
First, dedicated support for geo-located data exists in man... | [
-0.07348229736089706,
0.16024823486804962,
0.018990622833371162,
0.5597527623176575,
0.03263628110289574,
-0.013610382564365864,
-0.11951687186956406,
0.21216769516468048,
-0.29160627722740173,
-0.7711886167526245,
-0.4593554139137268,
0.04531366750597954,
-0.03625532239675522,
-0.07289585... | |
SpaceCoordinate,
Quadrant Foreign Key SpaceQuadrant(ID),
SpaceObject -- whatever the object is (by ID)
Primary Key(SpaceCoordinate, Quadrant)
}
```
This is a `(SpaceCoordinate, Quadrant) -> SpaceObjectId` dictionary.
=====
Now, about your O(1) performance concern, there is a lot of reasons why it's wron... | [
-0.07827187329530716,
0.18002545833587646,
0.3246496915817261,
0.10703768581151962,
-0.027650687843561172,
0.09683079272508621,
-0.0007652225904166698,
-0.11881198734045029,
0.01889878883957863,
-0.7320034503936768,
-0.11567088961601257,
0.39811620116233826,
-0.256108820438385,
0.303618639... | |
to benchmark on the actual data (with actual data sizes).
Also, forcing a table into memory can have worse implications.
If something ever gets swapped, you're dead - if you had used a B-Tree (i.e. normal disk-based index), its algorithms would have minimized the needed I/O. Otherwise, all DBMS's would use hash table... | [
0.2620484232902527,
-0.20162878930568695,
0.05841585993766785,
0.2905122637748718,
0.017358073964715004,
-0.12512946128845215,
0.24048501253128052,
-0.2502332627773285,
-0.36596524715423584,
-0.6846597194671631,
-0.30196666717529297,
0.541854977607727,
-0.26520663499832153,
0.1403151154518... | |
for that to be 4, and if you have so much data you'd need a big iron server anyway for that to fit in memory. So, it's almost O(1), and the constant factors are what actually matters.
Ever heard about low-asymptotic-complexity, big-constant-factor algorithms, that would be faster than simple ones just on unpractical... | [
0.16238199174404144,
0.1883184015750885,
0.18538285791873932,
0.28535112738609314,
-0.12709994614124298,
0.06083613634109497,
0.15499494969844818,
-0.1906527280807495,
-0.29892995953559875,
-0.4743311405181885,
0.09040924906730652,
0.6321988701820374,
-0.19808968901634216,
-0.1398048251867... | |
disk index, as needed, if it was worth it. Investigate your docs for that.
But the bottom line is that, premature optimization is evil, especially when it's of this kind (weird optimizations we're thinking on our own, as opposed as standard SQL optimizations), and with a declarative language. | [
0.047957275062799454,
0.26464182138442993,
-0.1291954666376114,
0.3980386257171631,
-0.10527587682008743,
-0.034992657601833344,
0.07624463737010956,
0.3818054497241974,
0.031266409903764725,
-0.49649104475975037,
0.030166001990437508,
0.7512345910072327,
-0.041804246604442596,
-0.03629768... | |
I have been trying to add a scroller to my context section that will only allow the box to scroll horizontally within the visible of the viewer's screen, not vertical.
Does anyone know any code to have scrollable content in a div in a fluid css layout design?
Also, here is a link to a website that has the exact scrol... | [
0.26793432235717773,
-0.021163856610655785,
0.6552377343177795,
-0.3352718651294708,
-0.08646999299526215,
-0.01761513203382492,
0.1335517019033432,
-0.28365978598594666,
-0.2729080021381378,
-0.5642246007919312,
-0.021508028730750084,
0.39056429266929626,
-0.1585429161787033,
0.1571633368... | |
overflow-x: scroll">
<p>Hello world!</p>
<p>Here is a div with a horizontal scrollbar!</p>
</div>
``` | [
-0.35670390725135803,
-0.025288475677371025,
0.7758966684341431,
-0.029287852346897125,
-0.221896231174469,
0.031282294541597366,
-0.09527718275785446,
0.2611226737499237,
0.06382855027914047,
-0.7500585913658142,
-0.2548169791698456,
0.2900148034095764,
-0.4102080464363098,
0.306822776794... | |
I'm looking at ORMs for Java and [Active Objects](http://java.net/projects/activeobjects/pages/Home) caught my eye. Apparently, it was [inspired by Rails' ActiveRecord](http://www.javalobby.org/articles/activeobjects/). Based on what I've read, this approach seems to solve a lot of problems with existing Java ORMs by e... | [
0.4064790904521942,
0.1415124088525772,
-0.057167548686265945,
0.16812020540237427,
-0.08249030262231827,
-0.29945051670074463,
0.22256307303905487,
-0.20451779663562775,
-0.4678609371185303,
-0.5663909912109375,
-0.04373596981167793,
0.5714146494865417,
-0.5248217582702637,
-0.08669459819... | |
working in a high-load environment, etc. But sometimes, all you need is simple, and well, there are other projects, like [Databinder](http://databinder.net/) that integrate with Active Objects. (Wicket + Databinder is a pretty nice, lightweight web framework for Java.)
But, for example, I'd stay away from a persistenc... | [
0.09629210084676743,
-0.15384265780448914,
-0.41787445545196533,
0.18911118805408478,
-0.31995850801467896,
-0.32044947147369385,
0.36056044697761536,
-0.21854202449321747,
-0.504016637802124,
-0.7922815680503845,
-0.039080359041690826,
0.4287949204444885,
-0.40859198570251465,
-0.06623967... | |
simplifying IO by using specialized commands like `COPY`
I've solved a lot of DB performance problems by just writing straight SQL code, replacing the use of an ORM that wasn't suited for the task. | [
0.37605369091033936,
0.43035581707954407,
0.18353663384914398,
-0.15952861309051514,
-0.3149178922176361,
-0.20012161135673523,
-0.0016502904472872615,
-0.020417427644133568,
-0.02696857787668705,
-0.7013789415359497,
0.32022327184677124,
0.5657843351364136,
-0.4175693392753601,
0.02679425... | |
I'd like to play videos, as well as display images and possibly other flash content using adobe air, and reading from the local file system. I've been searching APIs and I have not yet been able to connect the dots.
I know of **flash.filesystem.File** and **flash.filesystem.FileStream** and have experimented with load... | [
0.6310150027275085,
0.09326734393835068,
0.5004075765609741,
0.18741367757320404,
-0.23873405158519745,
-0.16510440409183502,
-0.124396413564682,
0.017412899062037468,
-0.27743640542030334,
-0.76690673828125,
0.003889769781380892,
0.7347245812416077,
-0.09933269023895264,
0.250812023878097... | |
to reference a local file
Can anyone help me out here? I specifically want to load and play video directly off the local disk, not from a web server or a streaming file server... assume no network connectivity.
Slightly related question: [Loading a video from the local file system…](https://stackoverflow.com/question... | [
0.531436562538147,
-0.06024264916777611,
0.4874732196331024,
0.3397136330604553,
-0.0960078090429306,
-0.2652137577533722,
0.03009841963648796,
0.040043361485004425,
-0.3548056185245514,
-0.5959554314613342,
0.02977936528623104,
0.6040714383125305,
-0.14932841062545776,
0.2215498387813568,... | |
to access local files as well:
```
private function playVideo():void {
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
# onMetaData listener is required otherwise you get a ReferenceError
var client:Object = new Object();
client.onMetaData = function(me... | [
0.3554128110408783,
-0.5358249545097351,
0.8863756656646729,
0.13102708756923676,
0.2105744332075119,
-0.16546569764614105,
0.32714903354644775,
-0.3823431432247162,
-0.49343833327293396,
-0.8283728957176208,
-0.3829215168952942,
0.7187396883964539,
-0.23713380098342896,
0.4500245153903961... | |
I want to prevent automated html scraping from one of our sites while not affecting legitimate spidering (googlebot, etc.). Is there something that already exists to accomplish this? Am I even using the correct terminology?
EDIT: I'm mainly looking to prevent people that would be doing this maliciously. I.e. they aren... | [
0.6390892267227173,
0.1299162358045578,
0.1488669365644455,
0.012296131812036037,
-0.1578240543603897,
-0.22228547930717468,
0.45842891931533813,
0.08064138889312744,
-0.38353195786476135,
-0.619205117225647,
0.050301697105169296,
0.37334516644477844,
-0.5936823487281799,
0.152491271495819... | |
the user agent string, so it is difficult to identify them. You can try to block them via their IP address, but it is difficult to keep up with adding new IP addresses to your block list. It is also possible to block legitimate users if IP addresses are used since proxies make many different clients appear as a single ... | [
0.19840916991233826,
-0.12912742793560028,
0.29037535190582275,
0.08300669491291046,
-0.18922705948352814,
-0.2092784196138382,
0.7046021819114685,
0.14588452875614166,
-0.538908839225769,
-0.8261216878890991,
0.04940106347203255,
0.18728262186050415,
-0.6785671710968018,
0.178591638803482... | |
and "bad" user agents/IPs. In a system we wrote to do some internal page view/session counting, we eliminate sessions based on page view rate, but we also don't worry about eliminating "good" spiders since we don't want them counted in the data either. We don't do anything about preventing any client from actually view... | [
0.2631026804447174,
0.17883744835853577,
0.11887849867343903,
0.17961819469928741,
-0.10750602185726166,
-0.21194486320018768,
0.40642887353897095,
0.054876599460840225,
-0.6647470593452454,
-0.5381327271461487,
0.17821906507015228,
0.41594934463500977,
-0.30616188049316406,
0.003293920541... | |
I'm currently using session variables as a cache to cut down the calls to the database.
I'm wondering at about how many concurrent users does this stop working at? 1,000, 10,000 ....100,000??? Also will iis start flaking out at a certain load? And are there
any alternatives?
I know it depends on how much data I'm st... | [
0.2826319932937622,
0.13365016877651215,
0.24071179330348969,
0.10337355732917786,
-0.13593611121177673,
0.03354911506175995,
0.6629032492637634,
-0.087192602455616,
-0.5119121670722961,
-0.7244382500648499,
0.4139159619808197,
0.37652918696403503,
-0.3313850164413452,
0.5249530673027039,
... | |
handles sessions better.
**Edit:** Yes I'm using application variables for non user specific data.
You should probably be looking at [Memcached](http://www.danga.com/memcached/) if you're getting to this point. | [
0.26008468866348267,
0.014753862284123898,
0.024145642295479774,
0.13739173114299774,
-0.23060598969459534,
-0.35215702652931213,
0.3784831464290619,
0.2160583883523941,
-0.5012593269348145,
-0.5127898454666138,
0.0929207056760788,
0.6089008450508118,
0.37894007563591003,
-0.10908159613609... | |
Let's say, for instance, I have the following extremely simple window:
```
<Window x:Class="CalendarGenerator.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1"
Height="300"
Width="447... | [
-0.18371805548667908,
-0.06935788691043854,
0.6541545987129211,
-0.22261835634708405,
-0.25557366013526917,
0.09783507138490677,
-0.24309219419956207,
0.07318088412284851,
-0.42535364627838135,
-0.6284047365188599,
-0.07362733036279678,
0.4919946789741516,
0.23983687162399292,
0.0793167799... | |
</Grid>
</Window>
```
And a simple list defined as:
```
List<String> ListOfNames = new List<String>();
```
And let's assume that the list has several names in it. How would I go about binding the List to the ListBox using as much code-behind as possible?
First you'd need to give your ListBox a name so that it's ac... | [
-0.07667520642280579,
-0.12401536107063293,
0.610821545124054,
-0.25126397609710693,
-0.21685166656970978,
-0.16342727839946747,
-0.11314710974693298,
-0.4054427444934845,
-0.38312429189682007,
-0.7297221422195435,
-0.2760733962059021,
0.5337939262390137,
-0.2920432686805725,
-0.0186549853... | |
changes made to the list. To get WPF's databinding to react to changes within the list, define it as an [ObservableCollection](http://msdn.microsoft.com/en-us/library/ms668604.aspx)`<String>` instead. | [
0.024019431322813034,
-0.2294447273015976,
0.6262570023536682,
-0.08927540481090546,
0.0972018912434578,
-0.23399865627288818,
0.06710100173950195,
-0.23868754506111145,
-0.5477656126022339,
-0.5534796118736267,
-0.3223995268344879,
0.1880238652229309,
-0.4859746992588043,
0.36505860090255... | |
I've seen implementations of Singleton patterns where instance variable was declared as static variable in GetInstance method. Like this:
```
SomeBaseClass &SomeClass::GetInstance()
{
static SomeClass instance;
return instance;
}
```
I see following positive sides of this approach:
* The code is simpler, beca... | [
0.12385677546262741,
-0.015363669954240322,
0.03397863730788231,
0.15150660276412964,
-0.25434690713882446,
-0.17644326388835907,
0.44315096735954285,
-0.17956939339637756,
-0.32437774538993835,
-0.7191295623779297,
0.1766183078289032,
0.7036525011062622,
-0.5519296526908875,
0.22361256182... | |
not very OOP-ish) ? Is this thread-safe?
In C++11 it is thread safe:
> §6.7 [stmt.dcl] p4 If control enters the declaration concurrently while the variable is being initialized, the concurrent execution shall wait for completion of the initialization.
In C++03:
* Under g++ it is thread safe.
But this is because ... | [
-0.054109636694192886,
-0.15865662693977356,
0.20081856846809387,
0.04384395107626915,
0.16898877918720245,
-0.23494191467761993,
0.20517504215240479,
0.03662624582648277,
-0.5379546880722046,
-0.4320967197418213,
-0.20900435745716095,
0.5416189432144165,
-0.41630128026008606,
0.1972611993... | |
this situation the singleton has definitely been destroyed, but the get method will still return a reference to the destroyed object.
There are ways around this but they are messy and not worth doing. Just don't access a singleton from the destructor of a global variable.
A Safer definition but ugly:
I am sure you... | [
-0.031262222677469254,
0.14668427407741547,
0.28914111852645874,
0.20607444643974304,
0.10938724130392075,
-0.21619389951229095,
0.41394227743148804,
-0.0862298235297203,
-0.45428624749183655,
-0.806763768196106,
-0.25663042068481445,
0.7342044711112976,
-0.3784255385398865,
0.234521791338... | |
from this post [What is the most efficient way to store tags in a database?](https://stackoverflow.com/questions/334183/what-is-the-most-efficient-way-to-store-tags-in-a-database)
It was recommended to store tag tables like this.
```
Table: Item
Columns: ItemID, Title, Content
Table: Tag
Columns: TagID, Title
Table... | [
0.0095802191644907,
-0.04016229510307312,
0.3756418228149414,
0.30943062901496887,
-0.2870430052280426,
-0.30458980798721313,
-0.13301591575145721,
-0.3168257474899292,
-0.1945161074399948,
-0.6690149307250977,
-0.07180368155241013,
0.2670287489891052,
-0.5102809071540833,
0.10022592544555... | |
"sql" "noob" "etc"
There's nothing wrong with the second design you show, the one with the `TagList` table, except that it takes more space.
That is, if you tag 10,000 items with the tag "database-design", then in the two-table design, you have to store that string 10,000 times. If space-efficiency is more important,... | [
0.252035528421402,
0.1033073365688324,
0.16841796040534973,
0.23850342631340027,
-0.14421266317367554,
-0.1095416322350502,
-0.09812343865633011,
-0.31074076890945435,
-0.29565951228141785,
-0.4818970561027527,
0.19399452209472656,
0.48032957315444946,
-0.2916048765182495,
0.08971974253654... | |
though they have different integer ID values. So in the `ItemTag` table, they would appear to be different tags, and you'd never know that they're actually tagged similarly. Whereas in the two-table design, tags with the same spelling become grouped together implicitly.
Another point: if you have the need to change th... | [
0.1965256929397583,
-0.004103531129658222,
0.2552119493484497,
0.09721549600362778,
-0.13522593677043915,
-0.044826749712228775,
0.07616651058197021,
-0.28925246000289917,
-0.2991700768470764,
-0.8681588768959045,
-0.17024993896484375,
0.4280970096588135,
-0.3455013334751129,
-0.1758537590... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.