text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
computer with no Active Directory available. We secured it using certificates. Is it an option for you? It's pretty painless (if you get past the 'put the certificate in the store and give the correct user access to it' part). | [
0.15214426815509796,
0.11763966083526611,
0.07544746994972229,
0.4189947545528412,
0.7570505738258362,
-0.045440662652254105,
0.2777247726917267,
0.33834049105644226,
-0.13183794915676117,
-0.358442485332489,
0.04798251762986183,
0.4815690815448761,
-0.003169810166582465,
0.011027039028704... | |
I need to execute a select and then update some of the rows in the `ResultSet` in an atomic way.
The code I am using looks like (simplified):
```
stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
rs = stmt.executeQuery("SELECT ...");
while (rs.next()) {
if (conditions_to_up... | [
0.2727607190608978,
0.07184390723705292,
0.7096301317214966,
-0.18488799035549164,
0.3001887798309326,
-0.07982800900936127,
0.30198898911476135,
-0.36961355805397034,
-0.09444499015808105,
-0.6439619064331055,
-0.026397231966257095,
0.6243942379951477,
-0.3720736801624298,
0.2109720557928... | |
Is there any way to lock the rows in the `ResultSet` ?
There's probably a whole heap of technologies and concepts that come into play here, and things start to get fairly sticky when you start considering multi-threaded / multi request applications.
As Iassevk stated, you should look into using [Transactions](http://j... | [
-0.10902223736047745,
-0.029992561787366867,
0.3983307480812073,
0.14617802202701569,
0.24138377606868744,
-0.2734285891056061,
0.07959264516830444,
-0.14153946936130524,
-0.4308188855648041,
-0.514748752117157,
-0.29257452487945557,
0.5048603415489197,
-0.38196927309036255,
-0.13566084206... | |
con.setAutoCommit(true);
} catch (Exception ex) {
//log the exception and rollback
con.rollback();
} finally {
con.close();
}
```
All the updates would then be batched into the same transaction. If any of the updates generated an Exception (such as an invalid value or the connection failing part way through the... | [
0.16593235731124878,
-0.1680416315793991,
0.3943471908569336,
-0.061303675174713135,
0.09390723705291748,
-0.18063423037528992,
-0.011142672039568424,
-0.1338891237974167,
-0.169939324259758,
-0.5325586199760437,
0.004382771905511618,
0.8496326804161072,
-0.5207496285438538,
0.085493631660... | |
has it's merits and drawbacks.
The easiest approach would be to [Lock the table](http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html) - this would require minimal code changes but has a pretty big drawback. Working on the assumption that, as with most applications, it's more read that write: locking the table will... | [
0.24010977149009705,
0.15089134871959686,
0.5738102197647095,
0.06944584846496582,
-0.03679202124476433,
-0.3658502399921417,
0.029509542509913445,
-0.13844197988510132,
-0.25066322088241577,
-0.6529804468154907,
-0.025271262973546982,
0.4227884113788605,
0.042147066444158554,
0.0994206666... | |
for this table pass through a single Class
* That class implements a Singleton pattern, or exposes the update methods as Static methods
* The update methods utilise the [Synchronized](http://java.sun.com/docs/books/tutorial/essential/concurrency/syncmeth.html) keyword to prevent race conditions | [
0.1183784157037735,
-0.00284644216299057,
-0.06696721911430359,
0.24905647337436676,
0.21309679746627808,
0.09545740485191345,
0.3488559424877167,
-0.10962885618209839,
0.13208691775798798,
-0.2837982177734375,
-0.054993364959955215,
0.5027837753295898,
-0.5034364461898804,
0.0074187829159... | |
In my database, in one of the table I have a GUID column with allow nulls. I have a method with a Guid? parameter that inserts a new data row in the table. However when I say myNewRow.myGuidColumn = myGuid I get the following error: "Cannot implicitly convert type 'System.Guid?' to 'System.Guid'."
The ADO.NET API has s... | [
0.02955336682498455,
0.2855277359485626,
0.26416051387786865,
-0.1309826672077179,
-0.11027676612138748,
-0.12081760168075562,
0.4423353374004364,
0.0913134515285492,
0.11310450732707977,
-0.7379639744758606,
0.23131681978702545,
0.5066913962364197,
-0.5072963237762451,
0.5297752022743225,... | |
null ? (object)DBNull.Value : myGuid.Value
```
It's painful extra work that ADO.NET should handle, but it doesn't seem to do so reliably (even in 3.5 SP1). This at least works correctly.
We've also seen issues with passing nullable value types to SqlParameters where the generated SQL includes the keyword `DEFAULT` i... | [
0.10528133809566498,
0.11843718588352203,
0.22405056655406952,
-0.194292351603508,
-0.41911181807518005,
-0.20442816615104675,
0.38970980048179626,
0.11929400265216827,
-0.017839476466178894,
-0.3123011589050293,
-0.01205602940171957,
0.41473129391670227,
-0.44834524393081665,
0.2412532418... | |
In JUnit 3 I simply called
```
suite.addTestSuite( MyTest.class )
```
However if MyTest is a JUnit 4 test which does not extend TestCase this doesn't work. What should I do instead to create a suite of tests?
Assuming that you are talking about Windows, there are essentially three ways to do this.
The first is to ... | [
0.21041205525398254,
-0.0474921315908432,
0.5169402360916138,
-0.10292454808950424,
-0.16501812636852264,
-0.3885796368122101,
0.2848033905029297,
-0.08406370878219604,
0.20178431272506714,
-0.6153594255447388,
0.09192785620689392,
1.0795464515686035,
-0.14238302409648895,
0.09697469323873... | |
DirectSound in MSDN) to do the capturing.
The second way is to write a filter driver that can intercept the audio stream before it reaches the physical device. Again, this technique will only work for devices that have a suitable driver topology and it's certainly not for the faint-hearted.
This means that neither of... | [
0.11722441762685776,
-0.21680592000484467,
0.5899821519851685,
0.28775957226753235,
-0.13021638989448547,
-0.4916767477989197,
0.23053307831287384,
0.16066938638687134,
-0.03836733475327492,
-0.45923373103141785,
-0.03298400342464447,
0.9199303984642029,
-0.4379144608974457,
0.279010891914... | |
can then record from the same device to capture the summed output. As long as you have control over the device that the application you want to record uses then this option will always work.
All of these techniques have their pros and cons - it's up to you to decide which would be the most suitable for your needs. | [
0.6315422058105469,
-0.06879713386297226,
0.3051017224788666,
0.5572906136512756,
0.4897702932357788,
0.018190506845712662,
-0.14362427592277527,
-0.1452236771583557,
-0.4154145419597626,
-0.42229220271110535,
0.15310166776180267,
0.8116267323493958,
-0.1433071792125702,
0.1057952418923378... | |
I'm just in the process of upgrading my Preview 5 application to Beta 1, and I'm nearly there save for this one error when trying to render a control:
> 'System.Web.Mvc.HtmlHelper' does not
> contain a definition for
> 'RenderPartial' and no extension
> method 'RenderPartial' accepting a
> first argument of type
>... | [
0.067314013838768,
0.06559985876083374,
0.46296635270118713,
-0.21836398541927338,
-0.5124084949493408,
0.16118469834327698,
0.2621859312057495,
-0.019564826041460037,
0.05687525495886803,
-0.7373244166374207,
0.019939817488193512,
0.35617661476135254,
-0.14414852857589722,
0.1674132347106... | |
also don't forget to add namespaces like below to the web config, I think preview 5 default web.config does not have System.Web.Mvc.Html in it:
```
<namespaces>
<add namespace="System.Web.Mvc"/>
<add namespace="System.Web.Mvc.Ajax"/>
<add namespace="System.Web.Mvc.Html"/>
<add namespace="System.Web.Routing"/>
<ad... | [
0.008124367333948612,
0.18681475520133972,
0.7399337291717529,
0.054608896374702454,
0.06669793277978897,
-0.14722375571727753,
-0.03476365655660629,
-0.1504625827074051,
-0.7005923986434937,
-0.9945799112319946,
-0.14459240436553955,
0.28663548827171326,
-0.29977619647979736,
-0.072580352... | |
Is using a handrolled POCO queue class using pseudo code
```
T Dequeue() {
lock(syncRoot) {
if(queue.Empty) Thread.Wait();
}
}
void Enqueue(T item) {
queue.Enqueue(item);
Thread.Notify();
}
```
For WCF is request queueing a scalable approach?
And also don't forget to add namespaces like below to... | [
-0.19247570633888245,
-0.48691290616989136,
0.6820876598358154,
0.08997160196304321,
0.043579086661338806,
0.09664743393659592,
0.022578762844204903,
-0.2749080955982208,
-0.4935223460197449,
-0.6222710609436035,
-0.06810826063156128,
0.14006014168262482,
-0.5736027956008911,
0.48841995000... | |
We use GUIDs for primary key, which you know is clustered by default.
When inserting a new row into a table it is inserted at a random page in the table (because GUIDs are random). This has a measurable performance impact because the DB will split data pages all the time (fragmentation). But the main reason I what a s... | [
-0.17338083684444427,
0.010432876646518707,
0.18247628211975098,
0.19499275088310242,
-0.19914083182811737,
-0.0031297975219786167,
-0.03919405862689018,
0.045331552624702454,
-0.17472407221794128,
-0.7865365147590637,
0.15525510907173157,
0.4727429747581482,
-0.6101870536804199,
0.3306295... | |
something extra to facilitate this. Also, `CreateDate` is not a good candidate for a clustered index.
Back in the day, I used [Jimmy Nielsons COMB's](http://www.informit.com/articles/article.aspx?p=25862), but I was wondering if there is something in the .NET framework for this. In SQL 2005 Microsoft introduced `newse... | [
0.3947594463825226,
-0.12529537081718445,
0.21548150479793549,
0.33431437611579895,
-0.33454930782318115,
-0.482512891292572,
-0.03992388769984245,
0.20172913372516632,
-0.19761423766613007,
-0.7676449418067932,
0.1587134599685669,
0.4657222330570221,
-0.36011019349098206,
0.24677708745002... | |
UuidCreateSequential. The API declaration (C#) below has been taken from [Pinvoke.net](http://www.pinvoke.net/default.aspx/rpcrt4/UuidCreateSequential.html) where you can also find a full example of how to call the function.
```
[DllImport("rpcrt4.dll", SetLastError=true)]
static extern int UuidCreateSequential(out G... | [
-0.08916869014501572,
-0.016354704275727272,
0.8030948042869568,
0.01274900697171688,
0.10148285329341888,
-0.1504063904285431,
0.20226632058620453,
-0.10743310302495956,
0.007347590290009975,
-0.41143524646759033,
-0.4117412865161896,
0.559921383857727,
-0.18238341808319092,
0.17327299714... | |
Can anyone point me to the preferences page that has the setting of the **DEBUG** current line background color? I have changed almost all the colours to dark ones and still get annoyed by this almost white current line indicator while debugging (note that the current line indication in editing mode is OK).
Ok, now I f... | [
-0.05830400437116623,
-0.050568562000989914,
0.2810225188732147,
-0.10224103927612305,
0.1226508617401123,
0.09346562623977661,
0.26173973083496094,
0.4141314625740051,
-0.07101093977689743,
-0.5382140874862671,
-0.10075424611568451,
0.3200210630893707,
-0.259785532951355,
0.21491174399852... | |
I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fashion rather than how to actually use it in produc... | [
0.5416446328163147,
0.47293201088905334,
0.14145810902118683,
-0.024020126089453697,
-0.001945743802934885,
-0.10771104693412781,
0.08908095955848694,
0.017111171036958694,
-0.05681667849421501,
-0.34054020047187805,
0.18235008418560028,
0.4848218262195587,
-0.3291432559490204,
0.159671679... | |
whichever is better).
I created a test script to see if my logic is correct but it's not working. When I create the try statement, it just creates a new database rather than checking if one already exists. The next time I run the script, I get an error that the table already exists, even if I tried catching the except... | [
0.39614343643188477,
0.12657921016216278,
0.13965216279029846,
0.20323094725608826,
0.020577698945999146,
0.04882928729057312,
0.23861940205097198,
-0.025724729523062706,
-0.261305034160614,
-0.5728662610054016,
0.24654346704483032,
0.5721185207366943,
-0.21464259922504425,
-0.103386081755... | |
but they don't address this.
AFAIK an SQLITE database is just a file.
To check if the database exists, check for file existence.
When you open a SQLITE database it will automatically create one if the file that backs it up is not in place.
If you try and open a file as a sqlite3 database that is NOT a database, you w... | [
0.32079097628593445,
0.36870497465133667,
0.2536967992782593,
-0.2265162616968155,
-0.07307891547679901,
-0.22546912729740143,
0.16448503732681274,
-0.3404311239719391,
-0.4393801689147949,
-0.37870174646377563,
0.3158618211746216,
0.219646617770195,
-0.6299875378608704,
0.1786388605833053... | |
Note
----
The question below was asked in 2008 about some code from 2003. As the OP's **update** shows, this entire post has been obsoleted by vintage 2008 algorithms and persists here only as a historical curiosity.
---
I need to do a fast case-insensitive substring search in C/C++. My requirements are as follows:
... | [
-0.08418725430965424,
0.3519703149795532,
0.3774436414241791,
-0.18686798214912415,
-0.023085959255695343,
-0.1317354291677475,
0.2136690765619278,
-0.14017128944396973,
-0.0930655226111412,
-0.5123416185379028,
-0.03532145544886589,
0.4792070984840393,
-0.29075947403907776,
0.013363379053... | |
C Library):
```
/* Return the offset of one string within another.
Copyright (C) 1994,1996,1997,1998,1999,2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Publi... | [
0.4439193308353424,
0.4064212739467621,
0.21611037850379944,
-0.16348378360271454,
-0.1517368108034134,
-0.5056654810905457,
-0.30352723598480225,
0.24054764211177826,
-0.3902757465839386,
0.054988566786050797,
-0.3700772225856781,
0.4318338930606842,
-0.5893107056617737,
0.333324402570724... | |
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
... | [
0.5264626145362854,
0.43108612298965454,
0.3339337408542633,
0.1668795794248581,
0.1445941925048828,
-0.3520415127277374,
0.3669019639492035,
0.04805528745055199,
-0.25863781571388245,
-0.7754397392272949,
-0.28447481989860535,
0.38739076256752014,
-0.4051418602466583,
0.1296989470720291,
... | |
the
* fastest implementation of strstr() in C.
* I deliberately chose not to comment it. You should have at least
* as much fun trying to understand it, as I had to write it :-).
*
* Stephen R. van den Berg, berg@pool.informatik.rwth-aachen.de */
/*
* Modified to use table lookup instead of tolower(), since tol... | [
-0.055071208626031876,
0.008180035278201103,
0.35288333892822266,
-0.18383455276489258,
0.06789333373308182,
0.08384928852319717,
0.3432232737541199,
-0.4089377522468567,
-0.40380600094795227,
-0.6686853170394897,
-0.15697218477725983,
0.48594918847084045,
-0.4416256844997406,
-0.093553155... | |
string[0] = i;
_strlwr(string);
char_table[i] = string[0];
}
}
#define my_tolower(a) ((chartype) char_table[a])
char *
my_stristr (phaystack, pneedle)
const char *phaystack;
const char *pneedle;
{
register const unsigned char *haystack, *needle;
register chartype b, c;
haystack = (const uns... | [
0.15328119695186615,
0.2588483393192291,
0.679339587688446,
-0.16688622534275055,
0.15427975356578827,
0.6101658940315247,
0.3855256736278534,
-0.7450934648513794,
-0.2253243327140808,
-0.36371374130249023,
-0.022623244673013687,
0.17219269275665283,
-0.5145044326782227,
0.3233021199703216... | |
do
{
c = *++haystack;
if (c == '\0')
goto ret0;
}
while (my_tolower (c) != (int) b);
c = my_tolower (*++needle);
if (c == '\0')
goto foundneedle;
++needle;
goto jin;
for (;;)
{ | [
0.0168923232704401,
0.029084892943501472,
0.44162535667419434,
-0.3096001446247101,
0.3177260160446167,
0.1586456298828125,
0.11438276618719101,
-0.4049484133720398,
-0.10413574427366257,
-0.17206275463104248,
-0.12905673682689667,
0.36212798953056335,
-0.21885205805301666,
0.4841666221618... | |
register chartype a;
register const unsigned char *rhaystack, *rneedle;
do
{
a = *++haystack;
if (a == '\0')
goto ret0;
if (my_tolower (a) == (int) b) | [
-0.06160916015505791,
-0.16515779495239258,
0.6786091923713684,
-0.23995178937911987,
0.47768574953079224,
0.47644394636154175,
0.5097488760948181,
-0.33368822932243347,
-0.3295820653438568,
-0.16925913095474243,
-0.29116901755332947,
0.36982256174087524,
-0.4802367091178894,
0.16795799136... | |
break;
a = *++haystack;
if (a == '\0')
goto ret0;
shloop:
;
}
while (my_tolower (a) != (int) b);
jin:
a = *++haystack; | [
-0.07845989614725113,
-0.05805721879005432,
0.3666743040084839,
-0.365185022354126,
0.3535633683204651,
-0.07740547508001328,
0.6537591814994812,
-0.352634459733963,
-0.2765732705593109,
0.11540768295526505,
-0.6131982803344727,
0.38498878479003906,
-0.19338250160217285,
0.3578740954399109... | |
if (a == '\0')
goto ret0;
if (my_tolower (a) != (int) c)
goto shloop;
rhaystack = haystack-- + 1;
rneedle = needle;
a = my_tolower (*rneedle);
if (my_tolower (*rhaystack) == (int) a)
do | [
0.010647916235029697,
0.0337972491979599,
0.6346455216407776,
-0.5417577624320984,
0.3826586604118347,
0.3996838629245758,
0.29946914315223694,
-0.4888361394405365,
-0.2406899780035019,
0.020691988989710808,
-0.41731810569763184,
0.35783854126930237,
-0.21205928921699524,
0.378441929817199... | |
{
if (a == '\0')
goto foundneedle;
++rhaystack;
a = my_tolower (*++needle);
if (my_tolower (*rhaystack) != (int) a) | [
-0.2119918316602707,
0.0893235057592392,
0.5131649971008301,
-0.6114310622215271,
0.3037020266056061,
0.4572349488735199,
0.38157597184181213,
-0.427001953125,
-0.12273511290550232,
-0.2690156400203705,
-0.14391928911209106,
0.2590672969818115,
-0.3591727912425995,
0.28446173667907715,
0... | |
break;
if (a == '\0')
goto foundneedle;
++rhaystack;
a = my_tolower (*++needle);
}
while (my_tolower (*rhaystack) == (int) a);
needle = rneedle; /* | [
-0.15115851163864136,
0.10046026110649109,
0.39281243085861206,
-0.49502119421958923,
0.412146657705307,
0.150151327252388,
0.5249852538108826,
-0.4919542372226715,
-0.3769964277744293,
-0.11997535079717636,
-0.4164026081562042,
0.18442955613136292,
-0.331039696931839,
0.14129172265529633,... | |
took the register-poor approach */
if (a == '\0')
break;
}
}
foundneedle:
return (char*) haystack;
ret0:
return 0;
}
```
Can you make this code faster, or do you know of a better implementation?
**Note:** I noticed that the GNU C Library now has [a new implementation of `strstr()`](http://s... | [
-0.008121257647871971,
0.15828953683376312,
0.26781201362609863,
-0.05709945783019066,
-0.0342186875641346,
-0.2716732323169708,
0.40338581800460815,
-0.14781618118286133,
-0.10501600056886673,
-0.4472286105155945,
0.05269964784383774,
0.7712442874908447,
-0.3672589659690857,
0.05358179658... | |
still used for wide character strings](http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/wcsmbs/wcsstr.c?rev=1.4&content-type=text/x-cvsweb-markup&cvsroot=glibc), so if anyone knows why, please share.
**Update**
Just to make things clear—in case it wasn't already—I didn't write this function, it's a part of the GNU C... | [
0.016296889632940292,
0.08668098598718643,
0.37496575713157654,
-0.19207577407360077,
-0.1576504409313202,
-0.3766103684902191,
0.2572293281555176,
0.33656421303749084,
-0.6075141429901123,
-0.370193213224411,
0.14155608415603638,
0.4367065131664276,
-0.2634628117084503,
0.2488145977258682... | |
as `strcasestr`.
```none
$ gcc -Wall -o my_stristr my_stristr.c
steve@solaris:~/code/tmp
$ gcc -Wall -o strcasestr strcasestr.c
steve@solaris:~/code/tmp
$ ./bench ./my_stristr > my_stristr.result ; ./bench ./strcasestr > strcasestr.result;
steve@solaris:~/code/tmp
$ cat my_stristr.result
run 1... time = 6.32
run 2..... | [
-0.3300530016422272,
0.11467661708593369,
0.7722137570381165,
-0.27990058064460754,
-0.17745132744312286,
0.39307960867881775,
0.3706519603729248,
-0.07646723091602325,
-0.24796129763126373,
-0.8600922226905823,
-0.33399948477745056,
0.5270102024078369,
-0.21568292379379272,
-0.18080787360... | |
time = 3.82
run 8... time = 3.82
run 9... time = 3.82
run 10... time = 3.82
average user time over 10 runs = 3.8200
steve@solaris:~/code/tmp
```
The `main` function was:
```c
int main(void)
{
char * needle="hello";
char haystack[1024];
int i;
for(i=0;i<sizeof(haystack)-strlen(needle)... | [
0.14128656685352325,
-0.1275295466184616,
0.6338833570480347,
-0.24696126580238342,
0.15288957953453064,
0.3649651110172272,
0.5209250450134277,
-0.0746878832578659,
-0.31946614384651184,
-0.3606926500797272,
0.06574947386980057,
0.695044994354248,
-0.4028945863246918,
0.09851714223623276,... | |
memcpy(haystack+i,needle, strlen(needle)+1);
/*printf("%s\n%d\n", haystack, haystack[strlen(haystack)]);*/
init_stristr();
for (i=0;i<1000000;++i)
{
/*my_stristr(haystack, needle);*/
strcasestr(haystack,needle);
}
return 0;
}
```
It was... | [
-0.07998785376548767,
-0.12487053871154785,
0.9668336510658264,
-0.2410709261894226,
0.18517915904521942,
0.3984994888305664,
0.3685549795627594,
-0.3207218050956726,
-0.16914081573486328,
-0.4194906949996948,
-0.0323675163090229,
0.4734249711036682,
-0.27408164739608765,
0.283537894487381... | |
typing this up I left in the `init_stristr` call, but it shouldn't change things too much. `bench` is just a simple shell script:
```c
#!/bin/bash
function bc_calc()
{
echo $(echo "scale=4;$1" | bc)
}
time="/usr/bin/time -p"
prog="$1"
accum=0
runs=10
for a in $(jot $runs 1 $runs)
do
echo -n "run $a... ... | [
0.16313214600086212,
0.09337887167930603,
0.29626163840293884,
-0.5027956366539001,
-0.11289391666650772,
0.09029560536146164,
0.6989284753799438,
-0.7538102269172668,
-0.23860971629619598,
-0.15299226343631744,
0.14816196262836456,
0.49589404463768005,
-0.3272378146648407,
-0.179594263434... | |
$(bc_calc "$accum/$runs")
``` | [
0.5186460018157959,
0.5040488839149475,
-0.056565769016742706,
-0.07867338508367538,
0.13216178119182587,
-0.31717342138290405,
0.3224048614501953,
0.061782415956258774,
-0.10641348361968994,
0.028358034789562225,
-0.17224058508872986,
0.4566246569156647,
-0.5196303129196167,
0.32822492718... | |
Me and some friends are writing a MORPG in Java, and we would like to use a scripting language to, eg. to create quests.
We have non experience with scripting in Java. We have used Python, but we are very inexperienced with it. One of us also have used Javascript.
What scripting language should we use?
What scriptin... | [
0.125810444355011,
0.37125256657600403,
0.05011701211333275,
0.1781967282295227,
-0.06321293860673904,
-0.1858942210674286,
0.17843742668628693,
-0.0774015337228775,
-0.06592768430709839,
-0.46989354491233826,
0.13709500432014465,
0.6777141690254211,
-0.050363630056381226,
-0.2979719638824... | |
Having a strange rendering issue with Safari:
I have a table inside a div. Inside the table <td> I have lots of div's floated left. So the normal display is all of the divs within the td stacked up to the left until they fill the width, then flow to the next line, and so forth. So something like this:
```
|=========... | [
0.20659326016902924,
0.22416871786117554,
0.345941424369812,
-0.006877444218844175,
-0.5104268193244934,
0.1834653615951538,
0.2420876920223236,
0.08606956899166107,
-0.24008940160274506,
-0.6589099168777466,
0.04023721441626549,
0.2506774067878723,
-0.5619967579841614,
-0.0342238433659076... | |
| |
| |---------------------- |
|===========================|
```
That works in all browsers except safari/webkit, where it ends up something like this:
```
|===========================|
| |-------------------------------|
| | XXX XXX XXX XXX XXX XXX |
| | |
| |------------... | [
-0.13154219090938568,
0.20998451113700867,
0.4613510072231293,
-0.04931170865893364,
-0.11767925322055817,
0.010886719450354576,
0.32848596572875977,
0.2104664295911789,
-0.16611100733280182,
-0.6435957551002502,
-0.1305578052997589,
0.6782729625701904,
-0.3418939709663391,
0.0523957088589... | |
had `white-space: nowrap`. Apparently webkit was no-wrap'ing the entire list of divs instead of applying the nowrap within the div.
That was a nasty one.
(This had nothing to do with display:none)
Answering my own question:
Finally figured out the issue: my inner divs (the "XXX"s) had white-space: nowrap. Apparent... | [
0.3543255627155304,
0.030018631368875504,
0.06978841125965118,
-0.11414124071598053,
-0.44362664222717285,
0.21301250159740448,
0.15630201995372772,
0.37923362851142883,
-0.39712727069854736,
-0.4448046386241913,
-0.14444804191589355,
0.28117525577545166,
-0.14276200532913208,
-0.028892902... | |
I am having a problem like that i am having some 10 parameters. I am dispalying the parameter values in the textbox(10 different). I need to display the textbox based on my parameter values
If the parameter has values - show them in textbox
If the parameter has no values - hide the textbox.
Currently I am using this ... | [
0.25561487674713135,
-0.17746220529079437,
0.4170796573162079,
0.3752475082874298,
-0.08699267357587814,
-0.08883466571569443,
0.36711421608924866,
-0.15328969061374664,
-0.42194730043411255,
-0.4778106212615967,
0.3350498378276825,
0.6944354176521301,
-0.3710208237171173,
-0.0023855364415... | |
to dynamically create report objects. Using expressions to hide and show objects is the correct way of achieving this sort of functionality. | [
0.23093287646770477,
-0.1523938924074173,
-0.07741829007863998,
0.3854391574859619,
-0.22318004071712494,
-0.19530163705348969,
0.40136754512786865,
-0.08078445494174957,
-0.2844716012477875,
-0.38313591480255127,
-0.282690167427063,
0.5238912105560303,
-0.6747210025787354,
-0.215153649449... | |
I want to use [JMockit](http://jmockit.dev.java.net)'s incremental test runner instead of the standard JUnit test runners from within Eclipse. Is there a way to do this?
**Edit** Received the following answer to my email to the JMockit dev:
> You would need to start the JVM with a
> command line such as
> "-javaage... | [
0.46661460399627686,
-0.11188946664333344,
0.25059497356414795,
-0.001969138393178582,
-0.2522740662097931,
-0.24490316212177277,
0.36953994631767273,
-0.10339740663766861,
0.055566418915987015,
-0.8086318969726562,
0.11213288456201553,
0.781036376953125,
-0.07133446633815765,
-0.225754052... | |
mainly because this feature is not
> fully developed yet.
Unfortunately this still doesn't work for me. Has anyone gotten the incremental test runner to work?
Reporting Services does not have an event based model that would allow you to hook in custom code in order to dynamically create report objects. Using expressi... | [
0.5458841323852539,
-0.12488303333520889,
-0.03507697209715843,
0.4140314757823944,
-0.2506851553916931,
-0.3386377692222595,
0.7277357578277588,
0.031416408717632294,
-0.14482253789901733,
-0.40932324528694153,
0.34589388966560364,
0.4953674077987671,
-0.24755941331386566,
-0.170909777283... | |
I'm using xsd.exe to make the C# classes for our settings. I have a setting that is per-server and per-database, so I want the class to behave like Dictionary<string, string[][]>. So I want to be able to say
```
string serverName = "myServer";
int databaseId = 1;
FieldSettings fieldSettings = getFieldSettings();
stri... | [
0.09312907606363297,
0.08193282037973404,
0.5620908141136169,
0.025525715202093124,
-0.18542033433914185,
-0.1337679922580719,
-0.16231775283813477,
-0.15458796918392181,
0.0011262291809543967,
-0.7809170484542847,
-0.08660378307104111,
0.54665207862854,
-0.4832371771335602,
0.218078702688... | |
DTOs and your *working* classes as separate things, and simply translate between the two.
[edit] As leppie notes - you can write your own indexer (typically in a partial class if generating cs from the xsd) that loops over the list to find the item: this will give you the caller usage, but not really the full dictiona... | [
0.2449030876159668,
-0.2844706177711487,
0.05307478830218315,
0.23129330575466156,
-0.18148761987686157,
0.1444241851568222,
0.25310271978378296,
0.08569864928722382,
-0.17818741500377655,
-0.7563696503639221,
-0.2945762872695923,
0.36082932353019714,
-0.2201996147632599,
-0.31772765517234... | |
I would like to create a trivial one-off Python object to hold some command-line options. I would like to do something like this:
```
options = ??????
options.VERBOSE = True
options.IGNORE_WARNINGS = False
# Then, elsewhere in the code...
if options.VERBOSE:
...
```
Of course I could use a dictionary, but `opti... | [
-0.08086463809013367,
0.08456936478614807,
-0.013939525000751019,
-0.0018859407864511013,
0.06124024838209152,
0.027409324422478676,
0.2933698892593384,
0.1869966685771942,
-0.024726010859012604,
-0.6586219668388367,
-0.060770563781261444,
0.658635675907135,
-0.4486899673938751,
-0.0144503... | |
`__dict__` member, and so one cannot add attributes to it:
```
options.VERBOSE = True
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'object' object has no attribute 'VERBOSE'
```
What is the simplest "pythonic" way to create an object that can be used this way, preferably w... | [
-0.20815686881542206,
-0.08230362087488174,
0.22123019397258759,
-0.16820800304412842,
0.11896112561225891,
0.2628195285797119,
0.24522240459918976,
-0.10243991017341614,
-0.38434213399887085,
-0.42928773164749146,
-0.31798624992370605,
0.672308087348938,
-0.4331483542919159,
-0.1524907648... | |
= True
IGNORE_WARNINGS = True
```
Then, in `main.py`:
```
import options
if options.VERBOSE:
# ...
```
This has the feature of removing some clutter from your script. The default values are easy to find and change, as they are cordoned off in their own module. If later your application has grown, you can easi... | [
0.33324766159057617,
0.11163806170225143,
0.3756771683692932,
-0.19221985340118408,
0.36699676513671875,
-0.18387974798679352,
0.3866877555847168,
0.09129323065280914,
-0.4544498026371002,
-0.49817517399787903,
-0.502796471118927,
0.6139496564865112,
-0.5257403254508972,
-0.070124551653862... | |
Is there a function in Common Lisp that takes a string as an argument and returns a keyword?
Example: `(keyword "foo")` -> `:foo`
Here's a `make-keyword` function which packages up keyword creation process (`intern`ing of a name into the `KEYWORD` package). :-)
```
(defun make-keyword (name) (values (intern name "KEY... | [
-0.29084154963493347,
0.14880849421024323,
0.0877232775092125,
-0.3377804458141327,
-0.08135414123535156,
-0.2111235111951828,
0.09697219729423523,
-0.1686771661043167,
0.1292153298854828,
-0.21670708060264587,
-0.29913291335105896,
0.494854599237442,
-0.5920965075492859,
-0.14582671225070... | |
I have a sproc that returns a single line and column with a text, I need to set this text to a variable, something like:
```
declare @bla varchar(100)
select @bla = sp_Name 9999, 99989999, 'A', 'S', null
```
but of course, this code doesn't work...
thanks!
If you are unable to change the stored procedure, another s... | [
0.10423742234706879,
0.2546863555908203,
0.8001982569694519,
-0.15452219545841217,
-0.0191460270434618,
0.33766329288482666,
0.16271546483039856,
-0.3825152516365051,
-0.17216353118419647,
-0.28619512915611267,
0.002299539279192686,
0.5410146117210388,
-0.5333223342895508,
0.08437182754278... | |
Is there any way to run ASDoc on your project via the Flex Builder UI? Or, is there a good (preferably free) plugin that will do so?
If there is no UI for it, does someone have a link to a tutorial on how to set it up to be automatic when I build my project, maybe via Ant (which I've never used, but am more than happy... | [
0.29251307249069214,
-0.03908916562795639,
-0.318748414516449,
0.1995839774608612,
-0.5377852320671082,
0.1838633120059967,
0.2368345558643341,
0.023513052612543106,
-0.5056930780410767,
-0.8819972276687622,
-0.1795448511838913,
0.3089573085308075,
-0.2938253879547119,
-0.5955052375793457,... | |
I have no idea. This causes seemingly random time-outs. These in turn break the flash that i am loading it into. Has anyone seen anything like this before?
```
<?php
require_once("../includes/class.database.php");
require_once("../includes/dbConnectInfo.inc");
require_once("../includes/functions.php");
include("../in... | [
0.22760772705078125,
-0.13703177869319916,
0.5882149934768677,
0.07631509006023407,
0.03152499347925186,
-0.2804456353187561,
0.3628612160682678,
-0.540614902973175,
-0.1333492547273636,
-0.404105544090271,
-0.3512880504131317,
0.6319027543067932,
-0.40156280994415283,
0.1241827979683876,
... | |
$media .="]]></title>\n";
} elseif ($row['path']=="") {
$name = explode("/",$row[title],2);
$media .= "<name><![CDATA[";
$media .= $name[0];
$media .="]]></name>\n";
$media .= "<job><![CDATA[";
$media .= $name[1];
$media .="]]></job>\n";
}
if($body... | [
0.38597676157951355,
0.01711486466228962,
0.488574355840683,
-0.08496209979057312,
0.13338224589824677,
-0.36639857292175293,
0.028656527400016785,
-0.6893191933631897,
-0.30950722098350525,
-0.5097422003746033,
-0.6755386590957642,
0.9948423504829407,
-0.724891722202301,
0.188602119684219... | |
$media .= $body;
$media .= "]]></bio>\n";
}
$something = $row['id'];
$result1 = mysql_query("SELECT * FROM media WHERE assets='$something'");
$media .= "<images>";
while($row1 = mysql_fetch_array($result1)) {
$img = explode("/",$row1[path],2);
$media .= "<image url='$img[1]'... | [
0.3332681953907013,
-0.10106848180294037,
0.6019133925437927,
-0.15480317175388336,
0.33996856212615967,
-0.2977887988090515,
0.20406711101531982,
-0.7655807137489319,
-0.49902889132499695,
-0.39786314964294434,
-0.49650806188583374,
0.6809733510017395,
-0.5451714396476746,
0.3195194005966... | |
the code? I usually add that line to long-executing code below the include statements.
Since this works, let me elaborate.
By default, PHP scripts are set up to only execute for so long. I believe the limit is 30 seconds when PHP is installed, but this can be changed in the php.ini file. However, you might not want t... | [
0.6830586791038513,
-0.1205548569560051,
0.20159411430358887,
0.08989842236042023,
-0.08023259043693542,
-0.1327764391899109,
0.623968243598938,
-0.21080686151981354,
-0.09542711079120636,
-0.2582109272480011,
0.22050173580646515,
0.5974454283714294,
-0.02648691087961197,
-0.22702002525329... | |
seconds to run the script, but a value of 0 means the script will run forever. | [
0.38587114214897156,
-0.10733368247747421,
0.14486978948116302,
0.20471127331256866,
0.2054882049560547,
-0.10000491887331009,
0.4728055000305176,
-0.018642272800207138,
0.31397581100463867,
-0.5009279251098633,
-0.10927717387676239,
0.12158462405204773,
0.357356458902359,
0.07888793200254... | |
I have a string column in a database table which maps to an Enum in code. In my dbml file when I set the "Type" to `MyTypes.EnumType` I get the following error:
> Error 1 DBML1005: Mapping between DbType 'VarChar(50) NOT NULL' and
> Type 'MyTypes.EnumType' in Column 'EnumCol' of Type 'Table1' is not
> supported.
Th... | [
0.0853620171546936,
0.22296151518821716,
0.35910531878471375,
-0.12870141863822937,
0.04462581127882004,
-0.2011709362268448,
0.4499654173851013,
-0.5179113745689392,
0.0037451209500432014,
-0.6364216804504395,
0.03946433961391449,
0.4364584982395172,
-0.34157004952430725,
0.10436625033617... | |
fully-qualified enum name (i.e. including the namespace).
[update] From [here](http://blog.rolpdog.com/2007/07/linq-to-sql-enum-mapping.html) it seems that the RTM version shipped with a bug when resolving the enum. One workaround suggested (on that page) was to add the `global::` prefix. It works fine for me without ... | [
0.08411769568920135,
-0.021364424377679825,
0.5833667516708374,
-0.03807937353849411,
0.16809123754501343,
-0.12733541429042816,
0.38533058762550354,
0.07187711447477341,
-0.23171870410442352,
-0.24125561118125916,
-0.39932534098625183,
0.3777468502521515,
-0.22475837171077728,
0.066401161... | |
France,
Belgium,
Brazil,
Switzerland
}
}
```
I then edited the dbml to have:
```
<Column Name="ShipCountry" Type="Foo.Bar.MyEnum" DbType="NVarChar(15)" CanBeNull="true" />
```
This generated:
```
private Foo.Bar.MyEnum _ShipCountry;
//...
[Column(Storage="_ShipCountry", DbType="NVarCha... | [
-0.16161686182022095,
0.2823272943496704,
0.7284343838691711,
-0.004246578086167574,
-0.09412963688373566,
0.5051547288894653,
0.1319422721862793,
-0.29927384853363037,
-0.46029239892959595,
-0.3793395757675171,
-0.23810924589633942,
0.3796679377555847,
-0.31085050106048584,
0.372307389974... | |
|| order.ShipCountry == Foo.Bar.MyEnum.Belgium
select order;
foreach (var order in qry.Take(10))
{
Console.WriteLine("{0}, {1}", order.OrderID, order.ShipCountry);
}
}
```
Worked fine; results:
```
10250, Brazil
10252, Belgium
10253, Brazil
10256, Brazil
10261, Brazil
10287, Brazil
... | [
-0.5880683064460754,
-0.12012462317943573,
1.0537794828414917,
0.22706466913223267,
0.4337407350540161,
0.7163508534431458,
0.011432918719947338,
-0.4123302698135376,
-0.785020649433136,
-0.4183015823364258,
0.0473678782582283,
0.2809893488883972,
0.08212269842624664,
-0.33626797795295715,... | |
Please recommend me a simple web-based document repository for keeping my small company documents (.DOCs, .PDFs) so i can access them from everywhere. There are many available on the internet, but they are heavy and filled with unnecessary features and requirements.
I have little requirements: pleasant interface (AJAX... | [
0.41515401005744934,
0.16961976885795593,
0.3351423144340515,
0.37845757603645325,
0.07410623133182526,
-0.34281161427497864,
-0.08184540271759033,
-0.18398034572601318,
0.12507465481758118,
-0.7922338843345642,
0.07766906172037125,
0.5139394998550415,
0.07842834293842316,
-0.0021610388066... | |
add, and modify documents from anywhere, and then add ViewVC on top of it so that you can see the different files from a web browser.
Another possible option, although it is a little bit more heavyweight, would be to install Trac. Again, this still uses Subversion, but it has a web-viewer for the repository nicely int... | [
0.2376834601163864,
-0.09819120168685913,
0.5775032043457031,
0.42902642488479614,
-0.053209319710731506,
-0.4904051423072815,
-0.003163548419252038,
-0.022202853113412857,
-0.46874311566352844,
-0.5922868251800537,
-0.08552239835262299,
0.7675110697746277,
-0.28644487261772156,
0.01263237... | |
being via a web browser, there are many clients for Linux, Mac, and Windows for the Subversion repository itself to allow manipulation of the files. For windows, the best Subversion Gui is TortoiseSVN. | [
-0.09241040796041489,
-0.4125514030456543,
0.18090090155601501,
0.1366741955280304,
-0.1910639852285385,
-0.018587248399853706,
0.329759418964386,
0.3756754398345947,
-0.5224575996398926,
-0.4976697862148285,
-0.23990236222743988,
0.4984669089317322,
-0.1665603369474411,
0.0933043509721756... | |
I'm using the ListView control (ASP.NET 2008) to show a bunch of lines of data, and at the bottom I want some totals. I was initially going to define the header and footer in the LayoutTemplate and get the totals with some local function, i.e. <%#GetTheSum()%>, but it appears that the LayoutTemplate does not process th... | [
0.16496962308883667,
-0.06966349482536316,
0.6946362853050232,
0.05905063822865486,
-0.1889316588640213,
-0.20011550188064575,
-0.1769404113292694,
-0.18625041842460632,
-0.6008706092834473,
-0.490103542804718,
0.3232749402523041,
0.29831743240356445,
0.10206909477710724,
-0.05491389334201... | |
Literal).Text = GetTheSum()
```
I'd still like to know if there might be a better way though. | [
0.4381740987300873,
0.09134836494922638,
0.3255680501461029,
0.05245677009224892,
-0.2629229426383972,
-0.21555687487125397,
0.38757672905921936,
0.21122801303863525,
0.11726618558168411,
-0.6516858339309692,
0.005344604142010212,
0.5188310742378235,
-0.2709328234195709,
0.125690296292305,... | |
What is the best method for displaying major/minor versions in a C# console application?
The `System.Windows.Forms` namespace includes a `ProductVersion` class that can be used to display the name/version information set via the Visual Studio project properties (Assembly Information). As such, here is my current mecha... | [
0.3017604947090149,
0.021624615415930748,
0.7579576969146729,
-0.3993838429450989,
0.006451238878071308,
-0.14970636367797852,
-0.07637475430965424,
-0.017022905871272087,
-0.17016728222370148,
-0.754231870174408,
-0.2893516421318054,
0.5233622789382935,
-0.20152518153190613,
0.39676904678... | |
OK, so see questions like [this one](https://stackoverflow.com/questions/60620/getting-started-with-silverlight-development) and [this one](https://stackoverflow.com/questions/28826/what-exactly-is-microsoft-expression-studio-and-how-does-it-integrate-with-visu) and the question I have is - does one *have* to use Expre... | [
0.32027482986450195,
-0.09528960287570953,
0.07283443957567215,
0.028071602806448936,
-0.04260925576090813,
-0.27272045612335205,
0.04943675920367241,
-0.2022455930709839,
0.04451966658234596,
-0.6414929628372192,
0.17414459586143494,
0.6585097312927246,
-0.22558949887752533,
-0.4424722492... | |
huge financial investment involved and I already own Visual Studio 2008 - is it possible to do development without Expression Blend or would that just be impossible?
You can do everything in Visual Studio. But then again you can do everything in Notepad as well... it all depends on how much the given tool will help you... | [
0.661817193031311,
0.03273952007293701,
0.30782315135002136,
0.12303600460290909,
-0.21787160634994507,
-0.022374598309397697,
0.1772686392068863,
-0.2843570411205292,
0.1990828961133957,
-0.6493567824363708,
0.4995657801628113,
0.8284899592399597,
-0.163145050406456,
-0.2602388560771942,
... | |
time then it's well worth the purchase. | [
0.3645082414150238,
0.19362659752368927,
0.08273869007825851,
0.08860504627227783,
0.21362921595573425,
0.13417932391166687,
0.05750809237360954,
0.38987892866134644,
0.21872484683990479,
-0.5627797842025757,
0.5656089186668396,
0.3812732696533203,
0.6414756178855896,
0.04895922169089317,
... | |
What is the purpose of the `Using` block in C#? How is it different from a local variable?
If the type implements IDisposable, it automatically disposes that type.
Given:
```
public class SomeDisposableType : IDisposable
{
...implmentation details...
}
```
These are equivalent:
```
SomeDisposableType t = new So... | [
0.37622812390327454,
-0.05392858386039734,
0.20347435772418976,
-0.10505389422178268,
-0.0250332560390234,
-0.22720544040203094,
0.23573148250579834,
-0.19715557992458344,
-0.030350008979439735,
-0.4357733130455017,
-0.34280329942703247,
0.7086325287818909,
-0.6374436020851135,
0.008128419... | |
var x = new SomeDisposableType();
```
It doesn't have a `{ }` block of its own and the scope of the using is from the point of declaration to the end of the block it is declared in. It means you can avoid stuff like:
```
string x = null;
using(var someReader = ...)
{
x = someReader.Read();
}
```
And have this:
... | [
0.1338825523853302,
-0.02360188029706478,
0.2545717656612396,
-0.16854608058929443,
0.1122966781258583,
-0.30335164070129395,
0.5487585067749023,
0.03229815512895584,
-0.1613939106464386,
-0.4230942130088806,
-0.2258782684803009,
0.607674777507782,
-0.39551088213920593,
0.23594795167446136... | |
I'm trying to display a loading icon while my iPhone app downloads a network resource, but I can't figure out how to make it show up correctly.
I searched around and found some details on the `UIActivityView` class, but the available example source code didn't work, and the documentation is kind of terse.
Could someo... | [
0.4186556339263916,
-0.1756400763988495,
0.4088703989982605,
0.004257914610207081,
-0.11685226857662201,
-0.007875540293753147,
0.2930663526058197,
0.12674574553966522,
-0.047916632145643234,
-0.659252941608429,
0.23470696806907654,
0.45743128657341003,
-0.1257343590259552,
0.1236207261681... | |
your interface (.h file):**
```
UIActivityIndicator *indicator;
```
**For your implementation (.m file):**
**Start the Animation**
```
CGRect b = self.view.bounds;
indicator = [[UIActivityIndicator alloc] initWithActivityIndicatorStyle:
UIActivityIndicatorStyleWhite];
... | [
-0.13555118441581726,
0.01131365541368723,
1.0960631370544434,
-0.03581526130437851,
-0.1820884346961975,
0.1643109768629074,
0.11913991719484329,
-0.24353846907615662,
0.054487038403749466,
-0.9184380769729614,
-0.180592343211174,
0.6127533316612244,
-0.17511574923992157,
0.01197564043104... | |
I have read the GOLD Homepage ( <http://www.devincook.com/goldparser/> ) docs, FAQ and Wikipedia to find out what practical application there could possibly be for GOLD. I was thinking along the lines of having a programming language (easily) available to my systems such as ABAP on SAP or X++ on Axapta - but it doesn't... | [
0.4055449962615967,
0.5336836576461792,
0.09642578661441803,
-0.03627702593803406,
-0.07907646149396896,
0.1625176966190338,
0.22020739316940308,
-0.16142864525318146,
-0.1423058956861496,
-0.2179248183965683,
0.17763087153434753,
0.6296818852424622,
-0.010911636054515839,
-0.2601843476295... | |
two phases. The first is "lexing", which convert the raw strings of character in to something that the program can more readily understand (commonly called tokens).
Simple example, lex would convert:
if (a + b > 2) then
In to:
```
IF_TOKEN LEFT_PAREN IDENTIFIER(a) PLUS_SIGN IDENTIFIER(b) GREATER_THAN NUMBER(2) RI... | [
-0.20603416860103607,
-0.2325092852115631,
-0.2818351686000824,
-0.2901979684829712,
-0.2110210359096527,
0.28114593029022217,
-0.13701479136943817,
-0.1879185438156128,
0.19534051418304443,
-0.5497032403945923,
-0.35059142112731934,
0.34227612614631653,
-0.3482338488101959,
-0.18683011829... | |
a token stream, the result of the parsing phase is a Parse Tree.
So, a parser could convert the above in to:
```
if_statement
|
v
boolean_expression.operator = GREATER_THAN
| |
| v
V numeric_constant.string="2"
expression.operator | [
-0.05503515899181366,
-0.193670853972435,
-0.15800490975379944,
0.0076622506603598595,
-0.0509120412170887,
0.16718599200248718,
0.16081136465072632,
-0.4207092523574829,
0.06790075451135635,
-0.3503708839416504,
-0.0065372297540307045,
0.21602763235569,
-0.3390040695667267,
-0.10291691124... | |
= PLUS_SIGN
| |
| v
v identifier.string = "b"
identifier.string = "a"
```
Here you see we have an IF\_STATEMENT. An IF\_STATEMENT has a single argument, which is a BOOLEAN\_EXPRESSION. This was explained in some manner to the parser. When the parser is converting the token stream, it "know... | [
0.1157207116484642,
-0.26407307386398315,
0.1697005182504654,
-0.07844455540180206,
-0.09216724336147308,
0.09616811573505402,
-0.05569133162498474,
-0.2174569070339203,
0.0702846348285675,
-0.4378451704978943,
-0.2342403531074524,
0.34602469205856323,
-0.3494558036327362,
-0.0215945821255... | |
just:
if (a + b) then
The parser could know that it's not a boolean expression (because the + is arithmetic, not a boolean operator) and the parse could throw an error at this point.
Next, we see that a BOOLEAN\_EXPRESSION has 3 components, the operator (GREATER\_THAN), and two sides, the left side and the right sid... | [
-0.08111537992954254,
-0.07570889592170715,
0.21946647763252258,
-0.2421114295721054,
-0.14172038435935974,
-0.022199470549821854,
0.2467535138130188,
-0.3674563467502594,
-0.029285086318850517,
-0.30357420444488525,
-0.2878553867340088,
0.39793503284454346,
-0.45033204555511475,
-0.065415... | |
it wasn't numbers, it would be an IDENTIFIER (like "a" and "b" are).
Note, that if we had something like:
if (a + b > "XYZ") then
That "parses" just fine (expression on the left, string constant on the right). We don't know from looking at this whether this is a valid expression or not. We don't know if "a" or "b" r... | [
0.09781038761138916,
0.06318464875221252,
-0.05866636335849762,
0.19679728150367737,
-0.12656819820404053,
-0.10401134192943573,
0.4084298610687256,
-0.02208537422120571,
-0.12010259181261063,
-0.47807198762893677,
0.09115671366453171,
0.2646385431289673,
-0.28726473450660706,
0.0286358185... | |
code) the IF statement.
If we did:
if [a > b ) then
The parser can readily see that syntax error as a problem, and will throw an error. That string of tokens doesn't look like anything it knows about.
So, the point being that when you get a complete parse tree, you have some assurance that at first cut the "code lo... | [
0.11378789693117142,
0.1907438188791275,
-0.23120059072971344,
-0.11431574076414108,
-0.1692216545343399,
0.1289421170949936,
0.5610489249229431,
-0.22607392072677612,
0.010149549692869186,
-0.49184438586235046,
-0.31940189003944397,
0.4956425726413727,
-0.23841440677642822,
-0.18073765933... | |
we have an interpreter.
```
public void execute_if_statment(ParseTreeNode node) {
// We already know we have a IF_STATEMENT node
Value value = evaluate_expression(node.getBooleanExpression());
if (value.getBooleanResult() == true) {
// we do the "then" part of the code
}
}
public Value evaluat... | [
-0.0027461242862045765,
-0.009563356637954712,
0.25770214200019836,
-0.09719188511371613,
0.41979148983955383,
-0.029072880744934082,
0.5219334363937378,
-0.21204568445682526,
0.22383776307106018,
-0.5606461763381958,
-0.4797894358634949,
0.6187416911125183,
-0.19213348627090454,
-0.120857... | |
{
result = lookupIdentifier(node);
return result;
}
Value leftSide = evaluate_expression(node.getLeftSide());
Value rightSide = evaluate_expression(node.getRightSide());
if (node.getOperator() == '+') {
if (!leftSide.isNumber() || !rightSide.isNumber()) {
throw new Ru... | [
-0.3394314646720886,
-0.5743527412414551,
0.8437500596046448,
-0.47580093145370483,
0.44446802139282227,
0.032128479331731796,
0.12220264226198196,
-0.4526980519294739,
-0.2682984471321106,
-0.6923734545707703,
-0.3960842490196228,
0.2238469123840332,
-0.09389223158359528,
-0.0958125665783... | |
int r = rightSide.getIntValue();
int sum = l + r;
return new Value(sum);
}
if (node.getOperator() == '>') {
if (leftSide.getType() != rightSide.getType()) {
throw new RuntimeError("You can only compare values of the same type");
}
if (leftSide.isNumber()) { | [
-0.22738254070281982,
-0.5323011875152588,
0.757588803768158,
-0.2653489112854004,
0.3287844657897949,
-0.0056772795505821705,
0.3232381343841553,
-0.661228358745575,
-0.10491861402988434,
-0.6604363322257996,
-0.20230881869792938,
0.3853943347930908,
-0.25838416814804077,
0.04578179493546... | |
int l = leftSide.getIntValue();
int r = rightSide.getIntValue();
boolean greater = l > r;
return new Value(greater);
} else {
// do string compare instead
}
}
}
```
So, you can see that we have a recursive | [
-0.2444096952676773,
-0.5273959040641785,
0.5937467217445374,
-0.4015737771987915,
0.09875822812318802,
-0.2630373239517212,
0.02652638964354992,
-0.5908616185188293,
-0.08714127540588379,
-0.6745976209640503,
-0.09815947711467743,
0.5206685662269592,
-0.1990329921245575,
-0.11588588356971... | |
evaluator here. You see how we're checking the run time types, and performing the basic evaluations.
What will happen is the execute\_if\_statement will evaluate it's main expression. Even tho we wanted only BOOLEAN\_EXPRESION in the parse, all expressions are mostly the same for our purposes. So, execute\_if\_stateme... | [
-0.20803722739219666,
-0.007261281367391348,
0.03776490315794945,
-0.07028738409280777,
0.09047306329011917,
0.18782401084899902,
0.4077286422252655,
-0.5253434777259827,
-0.1867252141237259,
-0.20414096117019653,
-0.14617417752742767,
0.7043843269348145,
-0.2987019419670105,
0.07648694515... | |
then we simply return the constants value, if it's an identifier, we look it up as a variable (and that would be a good place to throw a "I can't find the variable 'a'" message), otherwise we're back to the left side/right side thing.
I hope you can see how a simple evaluator can work once you have a token stream from... | [
0.10864561796188354,
-0.04568414017558098,
-0.023230932652950287,
0.10334675014019012,
-0.020862234756350517,
0.003374381922185421,
0.44784313440322876,
-0.1300646811723709,
-0.007829130627214909,
-0.35270461440086365,
-0.21847592294216156,
0.6369724869728088,
-0.10881312936544418,
-0.0715... | |
for example, PLUS operator, we're going to have 2 expressions, the left and right side. Or when we execute an IF statement, that we already have a boolean expression to evaluate. The parse is what does that heavy lifting for us.
Getting started with a new language can be a challenge, but you'll find once you get rolli... | [
0.22497597336769104,
0.011196678504347801,
-0.07967697083950043,
0.09651719778776169,
-0.08353900909423828,
-0.1985434889793396,
0.4238991439342499,
0.05118084326386452,
0.09613257646560669,
-0.4777680039405823,
-0.19289378821849823,
0.7014182209968567,
-0.20913103222846985,
-0.47434768080... | |
I am building an MS Access application in which all the forms are modal. However, after data change in a form, I want to refresh the parent form of this form with newer data. Is there any way to do it. To elaborate further :
Consider there are two forms, Form A and Form B. Both are modal form. From Form A, I initiate ... | [
-0.16412289440631866,
0.038842424750328064,
0.9555277228355408,
0.06378515809774399,
-0.12003170698881149,
0.022250249981880188,
0.41824644804000854,
-0.152019664645195,
-0.0917130783200264,
-0.6922114491462708,
-0.30323293805122375,
0.2632734179496765,
-0.16561511158943176,
0.069406554102... | |
to run Form\_Load
> of Form A,if it is possible
-- Varun Mahajan
The usual way to do this is to put the relevant code in a procedure that can be called by both forms. It is best put the code in a standard module, but you could have it on Form a:
Form B:
```
Sub RunFormALoad()
Forms!FormA.ToDoOnLoad
End Sub
```... | [
0.23151487112045288,
-0.03010915406048298,
0.4245409071445465,
-0.21668224036693573,
-0.12066475301980972,
-0.41110023856163025,
0.6271388530731201,
-0.47683319449424744,
0.022910550236701965,
-0.28107863664627075,
-0.44224420189857483,
0.5784481763839722,
-0.800007164478302,
-0.1536160111... | |
I know Java well. Which caveats and resources will help me cross to the other side (C#) as painlessly as possible.
Biggest tip: go with the [.NET naming conventions](http://msdn.microsoft.com/en-us/library/ms229045.aspx) from the word go. That way you'll constantly be reminded about which language you're in. (Sounds si... | [
-0.07681664079427719,
0.10671841353178024,
-0.06651397049427032,
-0.0617976151406765,
-0.27020928263664246,
-0.37152957916259766,
0.6895868182182312,
0.4754358232021332,
-0.26559436321258545,
-0.6736063957214355,
-0.06971022486686707,
0.5759729146957397,
0.14911985397338867,
-0.38016879558... | |
C# as in Java. (For instance, in C# instance variable initializers are executed before the base class constructor body; in Java they happen after. Subtle things like this can take a while to learn, and are easy to miss if you're skimming.)
If you're going to be using C# 3, I'd get a book which definitely covers that -... | [
0.19046829640865326,
-0.1735115945339203,
-0.05189863592386246,
0.08370787650346756,
-0.47301167249679565,
-0.33707109093666077,
0.26380977034568787,
-0.08584383130073547,
-0.2034885287284851,
-0.1545027196407318,
-0.24539774656295776,
0.8252207636833191,
-0.4170411229133606,
-0.6641511917... | |
want it as a "second" book.) | [
0.21913377940654755,
-0.11220778524875641,
0.10332980006933212,
0.11394508183002472,
0.2587956488132477,
0.1710878163576126,
0.23779457807540894,
-0.12126000970602036,
0.03301969915628433,
-0.12673771381378174,
0.22182956337928772,
0.47055676579475403,
-0.16121691465377808,
0.0473117083311... | |
I have an embedded webserver that has a total of 2 Megs of space on it. Normally you gzip files for the clients benefit, but this would save us space on the server. I read that you can just gzip the js file and save it on the server. I tested that on IIS and I didn't have any luck at all. What exactly do I need to do o... | [
0.38696253299713135,
0.08675845712423325,
0.31734520196914673,
-0.13184475898742676,
-0.2739906907081604,
-0.07218796759843826,
0.17513763904571533,
0.09920573234558105,
-0.34837606549263,
-0.8621037006378174,
0.16277657449245453,
0.4434799253940582,
-0.4113975763320923,
0.1142119020223617... | |
.js
3. Add some kind of header to the response?
Thanks for any help at all.
-fREW
**EDIT**: My webserver can't do anything on the fly. It's not Apache or IIS; it's a binary on a ZiLog processor. I know that you can compress streams; I just heard that you can also compress the files once and leave them compressed.
As... | [
0.18140330910682678,
0.04440371319651604,
0.22556248307228088,
-0.21766838431358337,
-0.6386436820030212,
-0.47005414962768555,
0.6249787211418152,
0.12804239988327026,
-0.09834679216146469,
-0.6970211863517761,
-0.23615214228630066,
0.705805242061615,
-0.7699790596961975,
-0.1759546250104... | |
your html files. Since the file is still foo.js
In the response header of (the gzipped) foo.js you send the header
```
Content-Encoding: gzip
```
This should do the trick. The client asks for foo.js and receives Content-Encoding: gzip followed by the gzipped file, which it automatically ungzips before parsing.
Of... | [
0.008696744218468666,
0.11993028223514557,
0.6829676032066345,
-0.17125849425792694,
-0.4218202233314514,
-0.08907414972782135,
0.3185350000858307,
0.20689941942691803,
-0.23775357007980347,
-0.7370643019676208,
-0.4811316728591919,
0.5761997103691101,
-0.7329984307289124,
-0.1220119222998... | |
I'm a Java developer looking to learn some C#/ASP.NET. One thing I've never liked about .NET from the get-go was that it didn't have support for MVC. But now it does! So I was wondering if anybody knew where to get started learning C# MVC.
Also, do you need the non-free version of developer-studio to do this?
Just to... | [
0.13975466787815094,
-0.204954132437706,
0.5482361316680908,
0.014216144569218159,
-0.24090708792209625,
-0.3834931552410126,
0.05354207381606102,
-0.12495618313550949,
-0.2614520490169525,
-0.698591947555542,
-0.12656481564044952,
0.425611287355423,
-0.2614472210407257,
-0.048938892781734... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.