text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
rely on. | [
0.4186272621154785,
0.22717392444610596,
-0.07003995031118393,
0.32648545503616333,
0.2239055186510086,
-0.0900259017944336,
0.049202799797058105,
-0.1553313285112381,
0.27474695444107056,
-0.8413416147232056,
-0.036976221948862076,
0.965192973613739,
-0.3579751253128052,
-0.24650552868843... | |
Below is the program I used for the test.
It prints (as expected):
```
Raise A
Event from A
Raise B
Event from B
```
Now, if we change first two lines of the Main to be:
```
A a = new B();
B b = new B();
```
the Program will print:
```
Raise A
Raise B
Event from B
```
which is also expected, as... | [
0.13502585887908936,
0.031709495931863785,
0.23074893653392792,
-0.2652638554573059,
-0.2129727303981781,
0.0755886659026146,
0.21092240512371063,
-0.4198266267776489,
-0.1152576133608818,
-0.051674336194992065,
-0.19795306026935577,
0.7263530492782593,
-0.2684117257595062,
-0.070669569075... | |
b = new B();
A a = b;
```
and the program starts printing:
```
Raise A
Raise B
Event from A
Event from B
```
What's going on?
```
class A
{
public virtual event EventHandler VirtualEvent;
public void RaiseA()
{
Console.WriteLine("Raise A");
if (VirtualEvent != null)
{
... | [
-0.016872981563210487,
-0.10579633712768555,
0.4896685481071472,
-0.3859022557735443,
0.12483089417219162,
0.09789533168077469,
0.24294732511043549,
-0.392923504114151,
-0.3268324136734009,
-0.22757023572921753,
-0.4337693750858307,
0.5434826612472534,
-0.18772003054618835,
0.4205100834369... | |
event EventHandler VirtualEvent;
public void RaiseB()
{
Console.WriteLine("Raise B");
if (VirtualEvent != null)
{
VirtualEvent(this, EventArgs.Empty);
}
}
}
class Program
{
static void Main(string[] args)
{
A a | [
-0.29841241240501404,
-0.543117880821228,
0.18933528661727905,
-0.35915514826774597,
-0.007930569350719452,
0.18270233273506165,
0.3550971746444702,
-0.02239474095404148,
-0.2657291889190674,
-0.32102474570274353,
-0.23989683389663696,
0.6199689507484436,
-0.20486915111541748,
0.3376522064... | |
= new A();
B b = new B();
a.VirtualEvent += (s, e) => Console.WriteLine("Event from A");
b.VirtualEvent += (s, e) => Console.WriteLine("Event from B");
a.RaiseA();
b.RaiseB();
}
}
```
We have a single instance (of B) which has the following fields:
* A.VirtualEvent: null
... | [
0.1733889877796173,
0.05010246858000755,
0.20176969468593597,
-0.3778935372829437,
-0.1691877692937851,
0.3786243796348572,
0.0834236815571785,
-0.502325177192688,
-0.2770393192768097,
-0.4169064164161682,
-0.013995062559843063,
0.6224084496498108,
-0.302009642124176,
0.32445356249809265,
... | |
null.
The call to `b.RaiseB()` prints the remaining three lines, because the event has been subscribed to twice (once to print "Event from A" and once to print "Event from B").
Does that help?
EDIT: To make it clearer - think of the virtual event as a pair of virtual methods. It's very much like this:
```
public cl... | [
0.08435187488794327,
-0.1768774390220642,
0.14272440969944,
-0.38476210832595825,
-0.08759607374668121,
0.2142161875963211,
0.06945891678333282,
-0.3481941521167755,
-0.20271144807338715,
-0.270602285861969,
-0.30179673433303833,
0.3326459228992462,
-0.6277779340744019,
0.14013828337192535... | |
handlerA -= handler;
}
// RaiseA stuff
}
public class B : A
{
private EventHandler handlerB;
public override void AddEventHandler(EventHandler handler)
{
handlerB += handler;
}
public override void RemoveEventHandler(EventHandler handler)
{
handlerB -= handler;
}
... | [
0.2554803788661957,
-0.37960803508758545,
0.05268896743655205,
-0.561689019203186,
-0.22620847821235657,
-0.10965803265571594,
0.11060073226690292,
-0.45464813709259033,
-0.2502005100250244,
-0.2785060703754425,
-0.18712998926639557,
0.31302428245544434,
-0.6612114906311035,
-0.06658243387... | |
aware you can't override just "part" of an event (i.e. one of the methods) but it gives the right general impression. | [
0.3815063536167145,
-0.09972146153450012,
0.20666277408599854,
0.21294978260993958,
-0.16977459192276,
-0.7342395186424255,
0.5225583910942078,
-0.34770795702934265,
-0.03399967402219772,
-0.4281875789165497,
-0.23055139183998108,
0.4812015891075134,
0.03074444830417633,
-0.251788794994354... | |
Whilst learning the "assembler language" (in linux on a x86 architecture using the GNU as assembler), one of the aha moments was the possibility of using [system calls](http://www.ibm.com/developerworks/linux/library/l-system-calls/). These system calls come in very handy and are sometimes even necessary as your progra... | [
-0.05724215880036354,
0.15819396078586578,
0.08087548613548279,
-0.30072924494743347,
-0.08591821044683456,
0.13009728491306305,
0.1083630844950676,
0.0981665626168251,
-0.18014182150363922,
-0.6024641990661621,
-0.1055670976638794,
0.5653964877128601,
-0.21293817460536957,
-0.096439808607... | |
a compiler (for a university project) and one of the extra features I wanted to add is the support for multi-threaded code in order to enhance the performance of the compiled program. Because some of the multi-threaded code will be automatically generated by the compiler itself, this will almost guarantee that there wi... | [
0.33071407675743103,
0.1166408509016037,
-0.20079079270362854,
0.3004090487957001,
-0.024898920208215714,
-0.2965697646141052,
0.3697730600833893,
0.13854151964187622,
-0.22198621928691864,
-0.7508997917175293,
-0.02322125993669033,
0.490953654050827,
-0.4041655957698822,
0.005656144116073... | |
The tiny little (auto-generated) threads will therefore be highly affected by the time it takes to make these system calls, which could even lead to a performance loss...
**my question is therefore twofold (with an extra bonus question underneath it):**
* Is it possible to write assembler
code which can run multiple... | [
0.39803624153137207,
0.09797167778015137,
-0.017822416499257088,
0.3225204050540924,
0.17855331301689148,
0.1900385469198227,
0.34084317088127136,
-0.12058313190937042,
-0.5534121990203857,
-0.6411581039428711,
0.005264621693640947,
0.6035361289978027,
0.017290601506829262,
-0.096111439168... | |
possible without system calls. Even if this is the case, do you have a suggestion (or even better: some real code) for implementing threads as efficient as possible?
The short answer is that you can't. When you write assembly code it runs sequentially (or with branches) on one and only one logical (i.e. hardware) threa... | [
0.1850639432668686,
0.12519513070583344,
0.11188409477472305,
0.08039077371358871,
0.3762730360031128,
0.0954715833067894,
0.3923163414001465,
0.006995362229645252,
-0.3691592514514923,
-0.9416483640670776,
-0.3519607484340668,
0.17620223760604858,
-0.36406558752059937,
0.00088257557945325... | |
to point to the code you want to run. This implies using system calls to get the OS to do what you want.
User threads won't give you the threading support that you want, because they all run on the same hardware thread.
**Edit:** Incorporating Ira Baxter's answer with *Parlanse*. If you ensure that your program has a... | [
0.704358696937561,
0.1394929140806198,
-0.14736531674861908,
0.1490384191274643,
0.2652040421962738,
0.04896596074104309,
0.14361783862113953,
-0.06138046085834503,
-0.4849337637424469,
-0.40127816796302795,
-0.027661234140396118,
0.4112056493759155,
-0.6101576685905457,
0.0868861600756645... | |
assembly instructions to handle multi-threading. The scheduler itself can't rely on any special assembly, but rather on conventions between parts of the scheduler in each thread.
Either way, whether or not you use the OS, you still have to rely on some scheduler to handle cross-thread execution. | [
0.3480411469936371,
-0.022327842190861702,
0.1637093871831894,
0.103129081428051,
-0.055993061512708664,
-0.027495021000504494,
0.19109398126602173,
-0.0957932099699974,
-0.4990743398666382,
-0.5573474764823914,
-0.30921101570129395,
0.37820500135421753,
-0.5483108162879944,
0.038328260183... | |
Scenario: The system has number of components, each with its own POM. There are some long dependency chains (A depends on B depends on C, etc.). I want each "non-developer-desktop" build to be a potential release candidate -- if it passes QA, we will deploy it without rebuilding. In other words, I never want to build S... | [
0.06805413961410522,
-0.04789755865931511,
0.09317481517791748,
-0.09325902909040451,
0.25590065121650696,
0.17610593140125275,
0.32464203238487244,
-0.07975614815950394,
-0.26386839151382446,
-0.6734117269515991,
-0.1584259569644928,
0.3794614374637604,
-0.2670542895793915,
-0.01304968353... | |
magic way I can have my dependency versions not be SNAPSHOTs in the POMs but still let the developers work on more than one component at once?
**How should we manage the project and dependency versions in all of our our POMs?** Right now it's just SNAPSHOTs everywhere, which makes things simple for the developers (th... | [
0.40275755524635315,
0.03862908482551575,
0.4782009422779083,
0.10047590732574463,
0.035746339708566666,
-0.1483752429485321,
0.3931353986263275,
-0.07704534381628036,
-0.4653134047985077,
-0.5821688771247864,
0.23105446994304657,
0.7806610465049744,
0.08560999482870102,
-0.290248066186904... | |
say I have components util, libj, libk, APP, and UI, with dependencies as follows:
libj -> util (libj depends on util)
libk -> util
APP -> libj
UI -> libj, libk
I have development teams working on APP and UI, and they will sometimes need to make changes/additions to some of the dependencies (even util) in order to ena... | [
0.05114796385169029,
0.3997896611690521,
0.7334953546524048,
-0.33475548028945923,
0.04801143333315849,
0.08602124452590942,
0.0768887847661972,
-0.1939077079296112,
0.03887122496962547,
-0.5400627851486206,
-0.3129875957965851,
0.4986252784729004,
-0.3714681565761566,
-0.01936051808297634... | |
this.
Try to layout your builds such that modules that need to be developed together are released together. This will let the maven release plugin do most of the work for you.
For dependencies that really should have a separate lifecyle...because they change infrequently or are shared by multiple projects, you want t... | [
0.5952127575874329,
-0.06930246949195862,
0.25368425250053406,
0.026220137253403664,
0.19090239703655243,
-0.2346702516078949,
0.01027653831988573,
-0.14744362235069275,
-0.3908669352531433,
-0.5616274476051331,
-0.021304229274392128,
0.7402721643447876,
-0.3583179712295532,
0.061883475631... | |
be released simply by following the snapshot trails.
I find it also helpful to keep the external dependency versions specified as properties in the top pom of my project. This makes it easy to see at a glance what needs to be released. Look for an example of the [Nexus](http://nexus.sonatype.org) pom. | [
0.49452129006385803,
-0.2712263762950897,
0.5192809104919434,
0.13739292323589325,
0.24178174138069153,
-0.35298681259155273,
-0.16612385213375092,
0.10986515134572983,
-0.2287682145833969,
-0.6768178939819336,
-0.24693213403224945,
0.3778994381427765,
-0.276349276304245,
-0.39253756403923... | |
I'm trying to write a WCF function that gives me back the URI of an image in the App\_Data folder so I can display it in a silverlight application.
How do I get the location of the App\_Data folder so that I can search inside it to find the Image I want to display?
[Access App\_Data in WCF service](https://stackoverfl... | [
0.3064405620098114,
0.11857540160417557,
0.7071858644485474,
-0.03698530048131943,
0.27461951971054077,
0.13148540258407593,
0.2752593755722046,
-0.11534445732831955,
-0.507929265499115,
-0.7131805419921875,
0.008827589452266693,
0.32678937911987305,
-0.3731505274772644,
0.2831556797027588... | |
I am using triggers for the first time.
If I update a field in a table by an update trigger on the same table, with this spark a loop? Does sql server guard against this recursive behavior?
Thanks
[This page](http://msdn.microsoft.com/en-us/library/ms190739.aspx) (search for `RECURSIVE_TRIGGERS`) describes some of th... | [
0.2607397735118866,
0.03193547949194908,
0.028911016881465912,
-0.0025638246443122625,
-0.0503675676882267,
-0.31083279848098755,
0.2841451168060303,
-0.2999662160873413,
-0.6608225703239441,
-0.42795127630233765,
0.056715063750743866,
0.6000645160675049,
-0.3342016935348511,
0.07137424498... | |
updated, you can protect the call in the trigger:
```
CREATE TRIGGER Whatever ON TableName AFTER UPDATE
AS
BEGIN
IF UPDATE(B)
BEGIN
/* Update column C here */
END
END
```
This way you avoid calling the trigger recursively when column `C` is updated by your trigger. `COLUMNS_UPDATED()` is also use... | [
0.1672637164592743,
0.20941147208213806,
0.7561795115470886,
-0.30487629771232605,
-0.04493102803826332,
-0.15413814783096313,
0.09280206263065338,
-0.3351862132549286,
-0.3294629454612732,
-0.4756537675857544,
-0.06141605228185654,
0.9507626295089722,
-0.4486081302165985,
0.07007316499948... | |
I have a table with roughly 100.000 blog postings, linked to a table with 50 feeds via an 1:n relationship. When I query both tables with a select statement, ordered by a datetime field of the postings table, MySQL always uses filesort, resulting in very slow query times (>1 second). Here's the schema of the `postings`... | [
0.31710800528526306,
0.18862512707710266,
0.5102112889289856,
0.03207269310951233,
-0.1484893560409546,
0.10953672975301743,
0.20667265355587006,
-0.003682891372591257,
-0.14391912519931793,
-0.8042665123939514,
0.1949029117822647,
0.2541843056678772,
-0.20834852755069733,
0.23914736509323... | |
|
+---------------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| feed_id | int(11) | NO | MUL | NULL | |
| crawl_date | datetime | [
-0.21518278121948242,
-0.3615534007549286,
0.587161123752594,
-0.05119814723730087,
0.4085407257080078,
0.24493557214736938,
-0.10716382414102554,
0.14794330298900604,
-0.20910711586475372,
-0.8692572116851807,
-0.0771365612745285,
0.17949868738651276,
-0.3586755692958832,
0.43614971637725... | |
| NO | | NULL | |
| is_active | tinyint(1) | NO | MUL | 0 | |
| link | varchar(255) | | [
-0.1418018788099289,
-0.1842545121908188,
0.2783219516277313,
-0.18209125101566315,
-0.06696563959121704,
-0.13122490048408508,
0.31319090723991394,
-0.11786976456642151,
-0.1395418494939804,
-0.2272484302520752,
-0.10639408230781555,
0.33336809277534485,
-0.5828235745429993,
0.44720590114... | |
NO | MUL | NULL | |
| author | varchar(255) | NO | | NULL | |
| title | varchar(255) | NO | | [
-0.3909459412097931,
0.551954984664917,
0.1784266233444214,
-0.055714406073093414,
-0.14453686773777008,
0.0014793436275795102,
0.3726033866405487,
-0.08160640299320221,
-0.1718965470790863,
0.1664341241121292,
-0.48450884222984314,
0.3346550166606903,
-0.2973785400390625,
0.53393167257308... | |
| NULL | |
| excerpt | text | NO | | NULL | |
| long_excerpt | text | NO | | [
-0.20671160519123077,
0.026706630364060402,
0.0785754919052124,
0.1382606476545334,
-0.14379799365997314,
-0.21000277996063232,
0.5490492582321167,
-0.11273755133152008,
-0.19012902677059174,
-0.0035492312163114548,
-0.6408752799034119,
0.059698812663555145,
-0.5284205079078674,
0.21544991... | |
| NULL | |
| user_offtopic_count | int(11) | NO | MUL | 0 | |
+---------------------+--------------+------+-----+---------+----------------+
```
And here's the `feed` table:
```
+-------------+--------------+------+-----+---------+----------------+
| Field | Type ... | [
-0.18844473361968994,
-0.09105302393436432,
0.3496510982513428,
0.09054761379957199,
0.26822301745414734,
-0.16499851644039154,
0.16431355476379395,
-0.21287815272808075,
-0.017279133200645447,
-0.3908083140850067,
-0.45037320256233215,
0.7588039636611938,
-0.3893316388130188,
0.0239735264... | |
|
+-------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| type | int(11) | NO | MUL | 0 | |
| title | varchar(255) | NO | | NULL | [
-0.2784578204154968,
0.10354353487491608,
0.36998051404953003,
0.009521967731416225,
0.22743283212184906,
0.2641298472881317,
0.013049832545220852,
-0.5454492568969727,
-0.22066836059093475,
-0.10354688763618469,
-0.3290170729160309,
0.44303056597709656,
-0.14510509371757507,
0.29081499576... | |
| |
| website | varchar(255) | NO | | NULL | |
| url | varchar(255) | NO | | NULL | |
+-------------+--------------+------+-----+---------+----------------+
```
And | [
-0.23238220810890198,
0.42545998096466064,
0.40641865134239197,
0.07184816896915436,
-0.17529840767383575,
-0.2835971415042877,
0.3579302728176117,
-0.06905195116996765,
-0.20924986898899078,
-0.19555550813674927,
-0.5013349056243896,
0.4997570216655731,
-0.2720089554786682,
0.631314873695... | |
here's the query that takes >1 second to execute. Please note that the `post_date` field has an index, but MySQL isn't using it to sort the postings table:
```
SELECT
`postings`.`id`,
UNIX_TIMESTAMP(postings.post_date) as post_date,
`postings`.`link`,
`postings`.`title`,
`postings`.`author`,
... | [
0.13586167991161346,
-0.022336410358548164,
0.6170757412910461,
0.17131562530994415,
0.032517366111278534,
-0.15163692831993103,
0.13817819952964783,
-0.08434154093265533,
0.035572875291109085,
-0.7111578583717346,
-0.29218587279319763,
0.3074690103530884,
-0.23448176681995392,
0.351067245... | |
`feeds`.`type` = 1 AND
`postings`.`user_offtopic_count` < 10 AND
`postings`.`is_active` = 1
ORDER BY
`postings`.`post_date` desc
LIMIT
15
```
The result of the `explain extended` command on this query shows that MySQL is using filesort:
```
+----+-------------+----------+--------+--------------... | [
0.009395590983331203,
-0.04785967990756035,
0.49873533844947815,
-0.017398707568645477,
0.07778733223676682,
-0.21724550426006317,
0.22323958575725555,
-0.11594275385141373,
0.005390375852584839,
-0.7481858134269714,
-0.1560387909412384,
0.7004413604736328,
-0.4421059489250183,
0.106502659... | |
| rows | Extra |
+----+-------------+----------+--------+---------------------------------------+-----------+---------+--------------------------+-------+-----------------------------+
| 1 | SIMPLE | postings | ref | feed_id,is_active,user_offtopic_count | is_active | 1 | const ... | [
-0.5604992508888245,
0.039811622351408005,
0.6422284841537476,
0.16009317338466644,
-0.09174759685993195,
0.26943907141685486,
0.11310410499572754,
-0.2520126700401306,
-0.44337549805641174,
-0.4470219612121582,
-0.42828765511512756,
0.30755719542503357,
-0.5032492876052856,
-0.15916018187... | |
Using where; Using filesort |
| 1 | SIMPLE | feeds | eq_ref | PRIMARY,type | PRIMARY | 4 | feedian.postings.feed_id | 1 | Using where |
+----+-------------+----------+--------+---------------------------------------+-----------+---------+--------------------... | [
0.08916385471820831,
-0.0177770908921957,
0.6851369738578796,
-0.04218341037631035,
0.12162202596664429,
-0.13046620786190033,
0.2416950762271881,
-0.11584936082363129,
-0.04035993292927742,
-0.5660234093666077,
-0.18353575468063354,
0.4393394887447357,
-0.4460453689098358,
0.3345798850059... | |
me know if you have any ideas on how to optimize this query to get MySQL to sort and select the data by using indexes. I have already tried a few things such as creating a combined index on all where/order by fields, as suggested by a few blog postings, but this didn't work either.
Create a composite index either on `p... | [
0.41550615429878235,
0.03536517173051834,
0.255618691444397,
0.19272758066654205,
-0.21056021749973297,
-0.12400581687688828,
0.06158244609832764,
-0.026202118024230003,
-0.2056131213903427,
-0.7704508900642395,
0.2821369767189026,
0.2740829288959503,
-0.24011272192001343,
0.35037100315093... | |
you cannot use an index over this field both in filtering and in sorting by other field.
Depending on how selective is your `user_offtopic_count` (i. e. how many rows satisfy `user_offtopic_count < 10`), it may be more useful to create an index on `user_offtopic_count` and let the post\_dates be sorted.
To do this, c... | [
-0.03410965949296951,
0.025200720876455307,
0.4496363699436188,
0.041492778807878494,
-0.25074151158332825,
0.10836169868707657,
-0.04084978625178337,
-0.1360684037208557,
-0.30153632164001465,
-0.8304889798164368,
-0.030516844242811203,
0.2948162853717804,
-0.420169860124588,
0.2145784944... | |
(is_active, post_date);
SELECT
`postings`.`id`,
UNIX_TIMESTAMP(postings.post_date) as post_date,
`postings`.`link`,
`postings`.`title`,
`postings`.`author`,
`postings`.`excerpt`,
`postings`.`long_excerpt`,
`feeds`.`title` AS feed_title,
`feeds`.`website` AS feed_website
FRO... | [
-0.13995394110679626,
0.08022737503051758,
0.6233077049255371,
0.02949441969394684,
0.22901758551597595,
0.06174275279045105,
0.23684853315353394,
-0.03541436791419983,
-0.0699639767408371,
-0.6467283964157104,
-0.6828389167785645,
0.5692529678344727,
-0.31693246960639954,
0.06039340049028... | |
`postings`.`post_date` desc
LIMIT
15
/* This should show RANGE access with few rows and keep the FILESORT */
SELECT
`postings`.`id`,
UNIX_TIMESTAMP(postings.post_date) as post_date,
`postings`.`link`,
`postings`.`title`,
`postings`.`author`,
`postings`.`excerpt`,
`postings`.`lo... | [
0.24645490944385529,
0.10119997709989548,
0.6869297027587891,
0.1540927141904831,
-0.02312716655433178,
0.06694509088993073,
0.1995457410812378,
-0.21339410543441772,
-0.11192359030246735,
-0.6957663893699646,
-0.3243148922920227,
0.7122988104820251,
-0.19194884598255157,
0.082403741776943... | |
1 AND
`postings`.`user_offtopic_count` < 10 AND
`postings`.`is_active` = 1
ORDER BY
`postings`.`post_date` desc
LIMIT
15
/* This should show REF access with lots of rows and no FILESORT */
``` | [
-0.07002362608909607,
0.1504989117383957,
0.6424576640129089,
-0.24950498342514038,
0.10424289852380753,
0.023761412128806114,
0.1085486114025116,
-0.04281499981880188,
-0.30756041407585144,
-0.657661497592926,
-0.258503794670105,
0.5610297322273254,
-0.2281205952167511,
0.1289193928241729... | |
I have discovered that in SQL Reporting there might be a problem. I have a ReportViewer on my page and I am sending in parameters using the following method:
```
List<ReportParameter> myParams = new List<ReportParameter>();
myParams.Add(new ReportParameter("Start_Date", StartDate));
myParams.Add(new ReportParameter("... | [
0.12300178408622742,
0.1211603656411171,
0.7326918840408325,
-0.17428967356681824,
-0.24694472551345825,
-0.23704688251018524,
0.48214128613471985,
-0.184682697057724,
-0.2256695032119751,
-0.7884451746940613,
-0.11370851844549179,
0.3612942099571228,
-0.2794058620929718,
0.286173462867736... | |
anyone come across a work around or a different technique to get this working?
Also if I initially do not define the parameter, then assign the parameter, then do not define the paramter, it maintains the value that was assigned. (These are all postbacks, each event)
Do something like this..I've tested it in my own li... | [
0.3363581895828247,
-0.08450944721698761,
0.6244641542434692,
-0.06562705338001251,
-0.16495351493358612,
-0.12485670298337936,
0.524860143661499,
-0.35713744163513184,
-0.357892245054245,
-0.563233494758606,
-0.04728488624095917,
0.4470677971839905,
-0.31809285283088684,
0.137774184346199... | |
I want to add the ability for the users to capture the current screen in my app and email it. I have a very non-technical user base so I need this to be as simple as possible. I plan to let them click a menu item called Help Me! which will then capture the current Application Screen, hopefully as a jpg or png, and then... | [
0.568807065486908,
0.05220986530184746,
0.6328771114349365,
0.025027111172676086,
-0.0008496098453179002,
0.051647864282131195,
0.09695733338594437,
0.1016719713807106,
-0.13647790253162384,
-0.9347366094589233,
0.15926605463027954,
0.34663766622543335,
0.02574271708726883,
0.0418858155608... | |
I would check if there is a better way of doing this.
How do I get started on this? Is there a library or are the built in capabilities enough?
Thanks!
That post you linked is the right approach, they just made it very complex. You would want to use [`Graphics.CopyFromScreen`](http://msdn.microsoft.com/en-us/librar... | [
0.42247167229652405,
-0.028666554018855095,
0.5733392238616943,
0.14277814328670502,
-0.35674768686294556,
-0.0895436629652977,
0.16336438059806824,
-0.4110828936100006,
-0.3730824589729309,
-0.8358744978904724,
0.013520962558686733,
0.38887181878089905,
-0.24327579140663147,
-0.0538664795... | |
A workstation is scanning ports in the LAN; however virus scan have not picked anything up (McAffee, Sophos, MS).
Is the only option to clean the hard drive?
Are there any new malware of this description that have not yet been picked-up for scanning by the anti-virus software vendors.
If no one is running legitimate ... | [
0.46166953444480896,
-0.12704075872898102,
0.3628237843513489,
0.29285162687301636,
0.2842964231967926,
-0.5267345309257507,
0.3880956172943115,
0.16002164781093597,
-0.6129001379013062,
-0.8636481165885925,
-0.5179257392883301,
0.5753738284111023,
-0.2033981829881668,
0.11686751991510391,... | |
are doing that, check the typical known locations in the registry for start-up files to see if there's anything unusual.
Whether or not you find anything, wipe the HD and restore from an image. You'll spend more time trying to clean the system than you would re-imaging it and you won't be 100% sure you got the system ... | [
0.6399783492088318,
0.11994630843400955,
0.13160085678100586,
0.44289180636405945,
0.22414614260196686,
-0.5425034165382385,
0.27857300639152527,
0.11472789943218231,
-0.237579345703125,
-0.7126002907752991,
-0.08091486245393753,
0.48651885986328125,
-0.01176420133560896,
0.015470475889742... | |
I came across some code that boils down to the following:
```
enum BAR { /* enum values omitted */ }
class Foo{
public:
void set(const BAR& bar);
private:
uint32_t bits;
};
void Foo::set(const BAR& bar)
{
(uint32_t&)bits = bits | bar;
}
```
I don't understand the point of the c-style cast in the assignment in... | [
0.6245636343955994,
0.098404161632061,
0.04367751255631447,
0.1451641023159027,
-0.059609394520521164,
-0.1498219072818756,
0.20506596565246582,
-0.23664450645446777,
0.11701061576604843,
-0.042822420597076416,
-0.028969429433345795,
0.327515572309494,
-0.5722647905349731,
0.30165413022041... | |
assignement operator to be used.
I will now repeat my mantra: If your code contains casts, there is probably something wrong with the code or the design and you should examine both with a view to removing the cast. | [
0.6605387330055237,
0.18383494019508362,
-0.13204142451286316,
-0.1769445836544037,
0.1944352686405182,
0.013592720031738281,
0.015888813883066177,
-0.17382769286632538,
-0.05500137060880661,
-0.6534420251846313,
-0.05238049477338791,
0.541890025138855,
-0.5071374773979187,
-0.110864467918... | |
Can I set up an IIS server so that it will cache the most frequently used static files (binary) from disk into RAM, and serve from RAM on request?
Update: [mod\_mem\_cache](http://httpd.apache.org/docs/2.2/mod/mod_mem_cache.html) in [Apache Caching Guide](http://httpd.apache.org/docs/2.2/caching.html#inmemory) seems t... | [
-0.37762075662612915,
-0.14401045441627502,
0.12599137425422668,
-0.043372780084609985,
0.018950460478663445,
-0.193387970328331,
0.11022255569696426,
-0.04090030863881111,
-0.22704580426216125,
-0.9371599555015564,
-0.2026173323392868,
0.4249836802482605,
-0.3170616626739502,
0.0744579806... | |
JavaScript performance in Internet Explorer sucks. No news there. However there are some tips and tricks to speed it up. For example, there is this [three](http://blogs.msdn.com/ie/archive/2006/08/28/728654.aspx) [part](http://blogs.msdn.com/ie/archive/2006/11/16/ie-javascript-performance-recommendations-part-2-javascr... | [
-0.10385720431804657,
0.17473997175693512,
0.34183934330940247,
-0.231515571475029,
-0.34014734625816345,
-0.063089519739151,
0.34136030077934265,
-0.3534923195838928,
-0.19956819713115692,
-0.9192689061164856,
0.22328995168209076,
0.572087287902832,
-0.1296715885400772,
-0.367270886898040... | |
my dummy code:
```
<html>
<body>
<script type="text/javascript">
function MakeTable(parent)
{
var i, j;
var table = document.createElement('table');
var insertRow = table.insertRow;
for ( i = 0; i < 300; i++ )
{
var row = insertRow(-1); | [
0.36792927980422974,
0.05298604443669319,
0.4605746269226074,
-0.29951900243759155,
-0.12604157626628876,
0.23322397470474243,
0.30062156915664673,
-0.23108962178230286,
0.23319774866104126,
-0.29942309856414795,
-0.0011089214822277427,
0.14684456586837769,
-0.0641275942325592,
0.244976356... | |
for ( j = 0; j < 10; j++ )
{
var cell = row.insertCell(-1);
cell.innerHTML = i + ' - ' + j;
}
}
parent.appendChild(table);
}
</script>
<div onclick="MakeTable(this);">Click Me!</div> | [
-0.2722514271736145,
-0.06638793647289276,
0.5161868333816528,
-0.31889835000038147,
0.3462424874305725,
0.27450913190841675,
0.3510991036891937,
-0.1731347292661667,
0.08826401829719543,
-0.6796956062316895,
-0.17663203179836273,
0.33106425404548645,
-0.31467926502227783,
0.24594607949256... | |
</body>
</html>
```
**Added:** Hmm, apparently string-concatenation (with array.join) is the only way to go. Well, sad, of course. Was hoping to do it the "proper" DOM-way. :)
Here is an interesting link I found when looking for an answer on this:
The page uses five different scripts / methods to generate a table.
... | [
0.2477283477783203,
-0.16894423961639404,
0.4966946542263031,
0.1397002786397934,
-0.12423063069581985,
0.14910416305065155,
0.19262784719467163,
-0.32374268770217896,
-0.45119762420654297,
-0.5427326560020447,
-0.0870501771569252,
0.2064799964427948,
0.017686301842331886,
-0.1180427595973... | |
How do you get a class to interact with the form to show a message box?
```
using System.Windows.Forms;
...
MessageBox.Show("Hello World!");
``` | [
0.0009206037502735853,
-0.14274653792381287,
0.014282677322626114,
0.07535642385482788,
-0.21973544359207153,
-0.08979792147874832,
0.4726507365703583,
0.2377205640077591,
-0.08786830306053162,
-0.7083832025527954,
-0.18201453983783722,
0.32408714294433594,
-0.4850931465625763,
0.174485102... | |
I have a method that validates a combo box control like so:
```
Public Function ValidateComboBox(ByVal objMessageMode As Errors.MessageMode, ByVal cboInput As ComboBox) As Boolean
Dim blnValidated As Boolean
'no value--invalidate'
If cboInput.SelectedValue Is Nothing Then
Errors.InvalidateField(c... | [
-0.13786981999874115,
0.07053004950284958,
0.5079662203788757,
0.014490311034023762,
-0.04219558835029602,
-0.0022253727074712515,
0.45099812746047974,
-0.37992116808891296,
0.0614350363612175,
-0.24584345519542694,
-0.23551249504089355,
0.5023881793022156,
-0.39226794242858887,
0.28883576... | |
Return blnValidated
End Function
```
What I want is to be able to substitute any control as a parameter that implements the behavior of the "SelectedValue" object. Is there an interface that I could specify? Thanks for the help!
```
using System.Windows.Forms;
...
MessageBox.Show("Hello World!");
``` | [
-0.094626285135746,
-0.15868812799453735,
0.3535873591899872,
-0.02942105568945408,
0.07501864433288574,
-0.20036710798740387,
0.2592250108718872,
0.1635575294494629,
0.10820098221302032,
-0.5671553015708923,
-0.14592450857162476,
0.6306898593902588,
-0.4585997760295868,
0.2271238714456558... | |
See this example:
```
''//file1.vb
Sub Something()
''//...
Functions.LogInfo("some text")
''//...
End Sub
''//functions.vb
Sub LogInfo(ByVal entry as String)
Console.WriteLine(entry)
End Sub
```
Can I get the the name "Something" inside LogInfo?
Sorry for the briefness of this post, I am not sure... | [
0.42215508222579956,
-0.16178059577941895,
0.32429420948028564,
0.1216016411781311,
0.15676680207252502,
-0.4166601002216339,
0.2995978891849518,
0.2159729152917862,
-0.3660676181316376,
-0.5295799374580383,
-0.23446273803710938,
0.22010549902915955,
0.12942849099636078,
0.3380325138568878... | |
like this: (the NoInlining is to make sure it behaves properly...)
```
Imports System.Diagnostics
Imports System.Runtime.CompilerServices
Public Class Test
Shared Sub Main()
Something()
End Sub
<MethodImpl(MethodImplOptions.NoInlining)> _
Shared Sub Something()
Functi... | [
0.3286093771457672,
-0.12295684963464737,
-0.025263754650950432,
-0.022838449105620384,
0.1872830092906952,
-0.2871003746986389,
0.43604087829589844,
-0.2722721993923187,
-0.1912432163953781,
-0.49500083923339844,
-0.31386131048202515,
0.4024384021759033,
-0.21126237511634827,
0.0165511015... | |
Dim frame as StackFrame = new StackFrame(1, False)
Console.WriteLine("{0}: {1}", _
frame.GetMethod.Name, _
entry)
End Sub
End Class
``` | [
0.30452507734298706,
-0.11925464123487473,
0.872294545173645,
-0.1585850566625595,
0.10698460787534714,
-0.08082162588834763,
0.2992851436138153,
-0.40556713938713074,
-0.002445099176838994,
-0.4525893032550812,
-0.06332290172576904,
0.40873536467552185,
-0.3793279826641083,
0.562393367290... | |
[Sample.xlsx]
```
Column 0, Row 0 = "ItemA"
Column 0, Row 1 = "ItemB"
Column 0, Row 2 = "ItemC"
Column 0, Row 3 = "ItemD"
```
[Application]
```
DataSet dsData = new DataSet();
string strConn = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Sample.xlsx;Extended Properties='Excel 12.0;'";
OleDbDa... | [
-0.08183589577674866,
-0.19594967365264893,
0.3851061165332794,
-0.028102489188313484,
-0.025833336636424065,
0.11370684206485748,
0.13649362325668335,
-0.5178635716438293,
-0.09574160724878311,
-0.33849993348121643,
-0.4667813181877136,
0.41054391860961914,
-0.5448533296585083,
0.13696511... | |
set HDR=NO in the Extended Properties setting of the connection string.
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Sample.xlsx;Extended Properties='Excel 12.0;HDR=NO'"
<http://connectionstrings.com/excel-2007> | [
-0.026660174131393433,
-0.2216828465461731,
0.33219823241233826,
-0.04690038412809372,
-0.1760704219341278,
0.016783257946372032,
-0.1597021073102951,
-0.24088750779628754,
-0.006138782016932964,
-0.3662049174308777,
-0.3339851498603821,
0.28285378217697144,
-0.2988349497318268,
0.18259051... | |
I'm trying to figure out how to create an Item Template but according to the online articles I've encountered so far, all of the articles point you to an Export Template Wizard tool under the File menu option. My problem is that this feature doesn't exist and I can't seem to find it.
I'm using Visual Studio Team Syste... | [
0.3353309631347656,
-0.0912548303604126,
-0.07356932759284973,
0.1588447540998459,
-0.2732689082622528,
-0.20828883349895477,
0.23591528832912445,
0.03483976051211357,
-0.42407792806625366,
-0.5363796949386597,
0.2316344678401947,
0.7770243287086487,
-0.3222070336341858,
0.0412825495004653... | |
menu, but you may not initially see it there. In that case:
>
>
> * Right-click the menu bar and choose 'Customize....'
> + Click on the File category and then 'Rearrange Commands'
> + Click the 'Add...' button, then click the 'File' category in the dialogue that pops up
> + Scroll down until you see 'Export Templ... | [
0.03448500856757164,
-0.20205126702785492,
0.4469195604324341,
-0.12261158972978592,
-0.12672080099582672,
0.09026127308607101,
0.12268103659152985,
-0.015392531640827656,
-0.17420031130313873,
-0.7511938810348511,
-0.4212508201599121,
0.8346205353736877,
-0.1845269650220871,
-0.0146318292... | |
I wondering about how serial number generators and validator work. My aim would be to generate a serial number with five parts consisting of numbers and letters only.
I enjoy coding as a hobby and would not call myself a professional programmer. However, I am very interested in how those interesting functions work tec... | [
0.3088778555393219,
0.23277315497398376,
0.284357488155365,
-0.0807180255651474,
-0.10573694854974747,
-0.15448836982250214,
0.3755612373352051,
0.18468260765075684,
-0.3923451900482178,
0.04897698387503624,
0.1301429718732834,
0.4051389694213867,
-0.11150465160608292,
-0.03110583126544952... | |
Recently I’ve found myself in a database tangle where management wants the ability to remove data from the database, but still wants that data to appear in other places. Example: They want to remove all instances of the product whizbang, but they still want whizbang to appear in sales reports. (if they ran one for a pr... | [
0.64256751537323,
0.4095854163169861,
0.192177414894104,
0.1166873499751091,
0.29276028275489807,
-0.1738726645708084,
-0.018378490582108498,
0.20435084402561188,
-0.5851712822914124,
-0.1250382959842682,
0.2566433846950531,
0.29023244976997375,
0.05754078924655914,
0.5757773518562317,
-... | |
is never accessed again). How to handle this is not my question.
I’m curious to find out, in your experience what is the average life span of data? That is, on average how long is data alive or good for before it gets either replaced or deleted? I understand that this is relative to the type of data you are housing, ... | [
0.3412284851074219,
-0.031434740871191025,
0.3982093334197998,
0.4825640618801117,
0.4534842073917389,
-0.46392524242401123,
0.127745121717453,
0.5291484594345093,
-0.7628030180931091,
-0.2895307242870331,
-0.1006198599934578,
0.03197621554136276,
0.04416630417108536,
0.5747461915016174,
... | |
it won't appear on sales reports before it's official launch), and an end date (so that it drops off of reports after it's been end-of-lifed). Using the proper dates as criteria for your reporting as well as your applications, you won't see the whizbang except for when you should, and the data still exists (which it sh... | [
0.49390411376953125,
-0.10529035329818726,
0.4132450520992279,
0.28063103556632996,
0.37568309903144836,
-0.2826405465602875,
-0.06883962452411652,
0.22462494671344757,
-0.4311358332633972,
0.2956516742706299,
-0.37456613779067993,
-0.009873966686427593,
0.059195902198553085,
0.24793052673... | |
access. | [
0.020704150199890137,
-0.051549963653087616,
0.11959315091371536,
0.45644912123680115,
0.2999424338340759,
0.09493419528007507,
-0.03182266652584076,
0.08640646934509277,
-0.258012592792511,
-0.9155113101005554,
-0.28171297907829285,
0.17502939701080322,
-0.022416826337575912,
0.4156107902... | |
I am just starting on ASP.NET MVC trying to understand the philosophy first. I think I am pretty clear on the roles played by the controller and the view but I am a little confused on the model part. Some sources say its the domain model, some say its the data model, some say its the objects that are bound to the view.... | [
0.3968029022216797,
-0.10737704485654831,
0.28973960876464844,
0.2178400754928589,
-0.16695691645145416,
-0.38924163579940796,
-0.15282413363456726,
0.11802893877029419,
-0.3660775423049927,
-0.5590193271636963,
0.24875251948833466,
0.6154875159263611,
-0.31171363592147827,
0.3655891418457... | |
and knows how to persist itself (assuming persistence is part of the domain).
IMO, the other layer I referred to I call the ViewModel ... sometimes, the "model" that gets passed to the view really has nothing to do with the domain ... it will have things like validation information, user display info, lookup list valu... | [
0.11628670990467072,
-0.028352295979857445,
0.6928825974464417,
0.2854340076446533,
0.03551071509718895,
-0.3670889437198639,
0.19204437732696533,
0.04040797799825668,
-0.34430065751075745,
-0.28481659293174744,
-0.0017376000760123134,
0.35501381754875183,
-0.02220233716070652,
0.341326326... | |
Objective-c/cocoa offers a form of binding where a control's properties (ie text in a textbox) can be bound to the property of an object. I am trying to duplicate this functionality in C# w/ .Net 3.5.
I have created the following very simple class in the file MyClass.cs:
```
class MyClass
{
private string myName... | [
0.2954486906528473,
0.27235856652259827,
0.2051338404417038,
-0.04233317822217941,
-0.34027498960494995,
-0.20988813042640686,
-0.149958074092865,
-0.13128691911697388,
0.12425249814987183,
-0.3181385099887848,
0.0697716549038887,
0.5135703086853027,
-0.5904340147972107,
0.1418342441320419... | |
}
set
{
myName = value;
}
}
public MyClass()
{
myName = "Allen";
}
}
```
I also created a simple form with 1 textbox and 1 button. I init'd one instance of Myclass inside the form code and built the project. Using the DataSource Wizard in Vs2008, I selecte... | [
-0.2905230224132538,
-0.0775374099612236,
0.4012550711631775,
-0.09177623689174652,
-0.08871983736753464,
0.22141046822071075,
0.44993263483047485,
-0.19611263275146484,
0.19061650335788727,
-0.8901934623718262,
0.08678280562162399,
0.3770505487918854,
-0.31663307547569275,
0.0665398016571... | |
to create a data source based on object, and selected the MyClass assembly. This created a datasource entity. I changed the databinding of the textbox to this datasource; however, the expected result (that the textbox's contents would be "allen") was not achieved. Further, putting text into the textbox is not updating ... | [
-0.21164387464523315,
-0.08625341206789017,
0.13614055514335632,
-0.12993988394737244,
-0.2307351976633072,
0.14997294545173645,
0.3365301787853241,
-0.15812386572360992,
0.025454889982938766,
-0.7249782681465149,
0.15160080790519714,
0.632661759853363,
-0.3601589798927307,
0.2437235563993... | |
using DataBinding with an object (or i'm missing the mark entirely), so any help is great appreciated.
Edit:
Utilizing what I learned by the answers, I looked at the code generated by Visual Studio, it had the following:
```
this.myClassBindingSource.DataSource = typeof(BindingTest.MyClass);
```
if I comment that... | [
0.2141280174255371,
-0.03443292900919914,
0.29484087228775024,
-0.054709937423467636,
-0.3102441728115082,
-0.0571356937289238,
0.29409486055374146,
-0.1927417516708374,
0.0009073950932361186,
-0.7659145593643188,
0.06222241744399071,
0.7040504217147827,
-0.4926762282848358,
0.104027859866... | |
But additionally, you must assign the datasource's datasource to be an instance of your class.
```
MyDataSource.DataSource = new MyClass();
TextBox1.DataSource = MyDataSource;
```
That should work for your first pass. As others have mentioned, you may need to implement additional interfaces on your class (INotifyPro... | [
-0.18917986750602722,
-0.06038844957947731,
0.3243520259857178,
0.09910287708044052,
0.00918698962777853,
-0.22575098276138306,
0.39338418841362,
0.06747550517320633,
-0.16528068482875824,
-1.0659284591674805,
-0.16608506441116333,
0.5601758360862732,
-0.29887405037879944,
0.24039831757545... | |
I need something similar to these 2 SO questions, but using Informix SQL syntax.
* [Concatenate several fields into one with SQL](https://stackoverflow.com/questions/37696/concatenate-several-fields-into-one-with-sql)
* [SQL Help: Select statement Concatenate a One to Many relationship](https://stackoverflow.com/ques... | [
0.08173753321170807,
0.08418837189674377,
0.6633880138397217,
0.12155731767416,
-0.248543381690979,
0.1270650327205658,
-0.07886062562465668,
-0.2228841334581375,
-0.18031050264835358,
-0.4415508508682251,
0.17172934114933014,
0.541122317314148,
-0.34891825914382935,
0.09132863581180573,
... | |
LVARCHAR;
RETURN '';
END FUNCTION;
CREATE FUNCTION gc_iter(result LVARCHAR, value VARCHAR(255))
RETURNING LVARCHAR;
IF result = '' THEN
RETURN TRIM(value);
ELSE
RETURN result || ',' || TRIM(value);
END IF;
END FUNCTION;
CREATE FUNCTION gc_comb(partial1 LVARCHAR, partial2 LVARCHAR)
... | [
-0.6516228318214417,
-0.23835088312625885,
0.534619927406311,
-0.647919774055481,
-0.03030562959611416,
0.4456230401992798,
0.34172919392585754,
-0.41748160123825073,
0.18972983956336975,
-0.36651745438575745,
-0.7880405783653259,
0.6798324584960938,
-0.4574354290962219,
0.2337762266397476... | |
RETURN partial1;
ELSE
RETURN partial1 || ',' || partial2;
END IF;
END FUNCTION;
CREATE FUNCTION gc_fini(final LVARCHAR) RETURNING LVARCHAR;
RETURN final;
END FUNCTION;
CREATE AGGREGATE group_concat
WITH (INIT = gc_init, ITER = gc_iter,
COMBINE = gc_comb, FINAL = gc_fini);
```
Given... | [
-0.5979123711585999,
-0.012173390947282314,
0.24136658012866974,
-0.39088985323905945,
-0.122279591858387,
0.25603705644607544,
0.04846196249127388,
-0.5319679379463196,
0.020184656605124474,
-0.3751724362373352,
-0.26034966111183167,
0.2465028017759323,
-0.5591033697128296,
0.138866454362... | |
WHERE atomic_number < 10;
Hydrogen,Helium,Lithium,Beryllium,Boron,Carbon,Nitrogen,Oxygen,Fluorine
```
Applied to the question, you should obtain the answer you need from:
```
SELECT id, group_concat(codes)
FROM anonymous_table
GROUP BY id;
```
---
```
CREATE TEMP TABLE anonymous_table
(
id INTEG... | [
0.090633325278759,
0.23427270352840424,
0.2463103085756302,
0.27496030926704407,
0.3602760136127472,
0.4333583414554596,
-0.24798670411109924,
-0.4627457857131958,
0.09533152729272842,
-0.2661837041378021,
-0.23152734339237213,
0.04103035852313042,
-0.5531226992607117,
0.12909558415412903,... | |
FROM anonymous_table
GROUP BY id
ORDER BY id;
```
The output from that is:
```
58640 SUBL,USBL
63592 PELL
73571 PELL,SUBL,USBL
73572 PELL,SUBL,USBL
```
The extra set of data was added to test whether insert sequence affected the result; it appears not to do so (the codes are in sorted order; I'm not sure w... | [
-0.16538435220718384,
0.27812662720680237,
0.5024275183677673,
-0.1678275614976883,
-0.14884351193904877,
0.2005012333393097,
0.17963021993637085,
-0.3190441131591797,
-0.2970984876155853,
-0.3410426378250122,
0.1074700728058815,
0.3442898988723755,
-0.6215664148330688,
0.1636773645877838,... | |
the aggregate size to 2048 bytes. If you think you need longer lengths, specify `LVARCHAR(10240)` (for 10 KiB), for example.
3. As of Informix 12.10.FC5, the maximum length that works seems to be 16380; anything longer seems to trigger `SQL -528: Maximum output rowsize (32767) exceeded`, which surprises me.
4. If you n... | [
0.004702320788055658,
0.18624362349510193,
0.6374238133430481,
-0.062014300376176834,
-0.2524767518043518,
0.2614249885082245,
-0.0480637364089489,
-0.34813979268074036,
-0.4408377707004547,
-0.45984727144241333,
0.07015816122293472,
0.36240848898887634,
-0.40965449810028076,
0.19264034926... | |
I would like to examine the structure of pieces of JavaScript, i.e. once an object has been interpreted, what is the structure of the memory space the interpreted parts occupy, e.g. it has an 'array' of members, probably a header record, etc. Pretty much like I can present a simple C function as assembly code, or vice ... | [
0.5767310857772827,
0.24920248985290527,
-0.19413629174232483,
0.13318796455860138,
-0.2545146644115448,
-0.30074870586395264,
0.13149785995483398,
0.06776542216539383,
-0.2306106686592102,
-0.329914927482605,
-0.014273971319198608,
0.33032405376434326,
-0.15956617891788483,
0.144063204526... | |
highly proprietary for various interpreters.
Here is some info on how V8 works (the chrome engine):
<http://code.google.com/p/v8/>
You may also like to take a look at the source code to SquirrelFish (WebKit/Safari)...
info:<http://trac.webkit.org/wiki/SquirrelFish>
... and TraceMonkey (FF3.1+) as they are both ava... | [
0.7503624558448792,
0.37687429785728455,
-0.28439271450042725,
-0.09798847883939743,
-0.3712196350097656,
0.12791845202445984,
0.30261000990867615,
-0.17722973227500916,
-0.22179089486598969,
-0.3144286870956421,
0.7107303738594055,
0.5698797702789307,
-0.31433454155921936,
-0.054663304239... | |
After spending some hours reading about Unit Testing and test driven development here on StackOverflow and on other sites posts pointed me to, I know two things:
1. I want to use it
2. I don't know where to start
There are lots of good posts here about details, best practices etc, but what I am looking for is a begin... | [
0.4004027843475342,
0.07538242638111115,
-0.2752273976802826,
0.17403176426887512,
-0.29915663599967957,
-0.3077087998390198,
0.09222431480884552,
-0.1833295375108719,
0.24678541719913483,
-0.5105897784233093,
0.008189421147108078,
0.5929548740386963,
0.23630346357822418,
-0.15663902461528... | |
different testing frameworks although the specific idioms may be different. | [
0.8195151090621948,
0.2564330995082855,
-0.34797051548957825,
0.2875385880470276,
-0.13976344466209412,
-0.1591082215309143,
0.3839808702468872,
-0.3843373954296112,
0.12489225715398788,
-0.6095256805419922,
-0.04016842320561409,
0.3077082633972168,
0.19600334763526917,
0.07643285393714905... | |
**method\_missing**
\*obj.method\_missing( symbol h , *args i ) → other\_obj*
> Invoked by Ruby when obj is sent a
> message it cannot handle. symbol is
> the symbol for the method called, and
> args are any arguments that were
> passed to it. The example below
> creates a class Roman, which responds
> to meth... | [
-0.14948400855064392,
0.04125341773033142,
0.13706883788108826,
-0.13198621571063995,
-0.24273903667926788,
0.05933932587504387,
0.3970974087715149,
-0.38576897978782654,
-0.09445270895957947,
-0.1773422509431839,
-0.22456519305706024,
0.3855307996273041,
-0.6706960797309875,
0.08940619230... | |
str = method_id.id2name
roman_to_int(str)
end
end
r = Roman.new
r.iv ! 4
r.xxiii ! 23
r.mm ! 2000
```
I just heard about method-missing and went to find out more in *[Programming Ruby](http://www.ruby-doc.org/docs/ProgrammingRuby/)* but the above explanation quoted from the book is over my head. Does anyone hav... | [
0.1395154744386673,
0.5744746923446655,
0.009742961265146732,
-0.04716477170586586,
-0.19186417758464813,
-0.20524533092975616,
0.5591329336166382,
-0.06117447093129158,
-0.3801502585411072,
-0.12215276807546616,
-0.007421616930514574,
0.45573320984840393,
-0.3533421456813812,
0.2954007089... | |
methods an object has when the script is first parsed, because this can be dynamically changed as the application runs.
What method\_missing does, is let you intercept and handle calls to methods that don't exist for a given object. This provides the under-the-hood power behind pretty much every DSL (domain-specific l... | [
0.20664383471012115,
0.034250933676958084,
0.46287983655929565,
0.26363006234169006,
-0.022230597212910652,
-0.2114918977022171,
0.24588726460933685,
-0.3357763886451721,
-0.2771258056163788,
-0.04530533403158188,
-0.1902434080839157,
0.5660735368728638,
-0.5259688496589661,
0.248443752527... | |
that was called, as well as whatever arguments were passed.
method\_missing then converts the method name from a symbol to a string, and parses it as a Roman number, returning the output as an integer. | [
-0.138516366481781,
0.10593104362487793,
0.019623929634690285,
-0.26832038164138794,
0.0774717777967453,
0.17727378010749817,
0.07895693182945251,
-0.22725270688533783,
0.12675954401493073,
0.030557822436094284,
-0.1027667298913002,
0.14690417051315308,
-0.6140406727790833,
0.0398388989269... | |
I'm trying to get some results from UniProt, which is a protein database (details are not important). I'm trying to use some script that translates from one kind of ID to another. I was able to do this manually on the browser, but could not do it in Python.
In <http://www.uniprot.org/faq/28> there are some sample scr... | [
0.26265278458595276,
0.11438324302434921,
0.2189202606678009,
-0.1933024525642395,
-0.19066940248012543,
-0.06454141438007355,
0.2564143240451813,
-0.20405130088329315,
-0.08496052026748657,
-0.687739908695221,
-0.09339138120412827,
0.4107491970062256,
-0.6226288676261902,
0.04727876931428... | |
'tab',
query => 'P13368 P20806 Q9UM73 P97793 Q17192'
};
my $agent = LWP::UserAgent->new;
push @{$agent->requests_redirectable}, 'POST';
print STDERR "Submitting...\n";
my $response = $agent->post("$base/$tool/", $params);
while (my $wait = $response->header('Retry-After')) {
print STDERR "Waiting ($wait)...\n";
... | [
0.1631121188402176,
-0.28169235587120056,
0.5303351879119873,
-0.30226677656173706,
-0.10402214527130127,
0.0626654177904129,
0.4042784571647644,
-0.542815089225769,
-0.3490739166736603,
-0.4299769699573517,
-0.3992171287536621,
0.6635218262672424,
-0.18835382163524628,
-0.0269783660769462... | |
urllib2
import time
import sys
query = ' '.join(sys.argv)
# encode params as a list of 2-tuples
params = ( ('from','ACC'), ('to', 'P_REFSEQ_AC'), ('format','tab'), ('query', query))
# url encode them
data = urllib.urlencode(params)
url = 'http://www.uniprot.org/mapping/'
# fetch the data
try:
foo = urllib... | [
0.08164788037538528,
-0.16245104372501373,
0.7121167778968811,
-0.12159547209739685,
-0.3298873007297516,
0.3556961119174957,
0.16440334916114807,
-0.6987636685371399,
-0.3910196125507355,
-0.4983661472797394,
-0.424335241317749,
0.0776662826538086,
-0.470263808965683,
0.22848568856716156,... | |
time.sleep(wait_time)
foo = urllib2.urlopen(url, data)
# foo is a file-like object, do with it what you will.
foo.read()
``` | [
0.7096501588821411,
0.05434428155422211,
0.44983720779418945,
-0.40370601415634155,
0.4445919692516327,
-0.40559977293014526,
0.1869458556175232,
-0.06094767898321152,
-0.26115483045578003,
-0.6244546175003052,
-0.39058297872543335,
0.6828833818435669,
-0.5128070116043091,
0.23817121982574... | |
In python I have a dictionary that maps tuples to a list of tuples. e.g.
`{(1,2): [(2,3),(1,7)]}`
I want to be able to encode this data use it with javascript, so I looked into json but it appears keys must be strings so my tuple does not work as a key.
Is the best way to handle this is encode it as "1,2" and then ... | [
0.1396426260471344,
0.3326624631881714,
0.026356935501098633,
-0.3426121771335602,
-0.33773699402809143,
0.021401330828666687,
0.408340185880661,
-0.09337835758924484,
-0.2449209839105606,
-0.302725613117218,
-0.18945352733135223,
0.6735669374465942,
-0.5794066190719604,
-0.216250747442245... | |
keys themselves as JSON objects, which all modern browsers can do with the built-in `JSON.parse` method (I'm using `jQuery.each` to iterate here but you could use anything):
```
var myjson = JSON.parse('{"[1,2]": [[2,3],[1,7]]}');
$.each(myjson, function(keystr,val){
var key = JSON.parse(keystr);
// do somethi... | [
-0.2467958629131317,
0.17561450600624084,
0.49442118406295776,
-0.17809483408927917,
0.11344122141599655,
0.08449289947748184,
0.4010506570339203,
-0.24934154748916626,
-0.34089651703834534,
-0.5052762031555176,
-0.42328330874443054,
0.5862128734588623,
-0.251722127199173,
0.20363973081111... | |
To my surprise as I am developing more interest towards dynamic languages like Ruby and Python. The claim is that they are 100% object oriented but as I read on several basic concepts like interfaces, method overloading, operator overloading are missing. Is it somehow in-built under the cover or do these languages just... | [
-0.11093636602163315,
0.08451361209154129,
-0.007119045592844486,
0.08292989432811737,
-0.2825978696346283,
-0.3663330376148224,
0.553921639919281,
0.27729281783103943,
-0.19333912432193756,
-0.30390140414237976,
-0.27665725350379944,
0.6850362420082092,
-0.5614069700241089,
-0.10944293439... | |
In Java/C#, interfaces are used to declare that some class has certain methods and it is checked during compile time; in Python, whether a method exists is checked during runtime.
Method overloading in Python does work:
```
>>> class A:
... def foo(self):
... return "A"
...
>>> class B(A):
... def foo(self):
...... | [
0.03095950558781624,
0.1374204158782959,
-0.16392244398593903,
-0.21271362900733948,
-0.3041355013847351,
-0.19771885871887207,
0.21661563217639923,
-0.19420403242111206,
-0.23459729552268982,
-0.4283132553100586,
-0.1114354357123375,
0.6422560214996338,
-0.5713356733322144,
-0.15837287902... | |
I'm working with some xml 'snippets' that form elements down the xml. I have the schema but I cannot validate these files because they are not complete xml documents. These snippets are wrapped with the necessary parent elements to form valid xml when they are used in other tools so I don't have much option in making t... | [
0.4433010518550873,
0.06734443455934525,
0.07524121552705765,
0.3169824182987213,
-0.03239472955465317,
-0.24334272742271423,
0.04892702028155327,
-0.20983266830444336,
-0.13179288804531097,
-0.49358636140823364,
-0.0814456194639206,
0.29467475414276123,
-0.05625557899475098,
0.14873459935... | |
of my XML document. I came up with this method here:
```
private void ValidateSubnode(XmlNode node, XmlSchema schema)
{
XmlTextReader reader = new XmlTextReader(node.OuterXml, XmlNodeType.Element, null);
XmlReaderSettings settings = new XmlReaderSettings();
settings.ConformanceLevel = ConformanceLevel.Fra... | [
0.0458139106631279,
0.1724630892276764,
0.9098982214927673,
0.02074800804257393,
-0.13411100208759308,
-0.003016783157363534,
0.2341669350862503,
-0.6695406436920166,
0.05552945286035538,
-0.5469415187835693,
-0.1302635371685028,
0.3983811140060425,
-0.05917805805802345,
0.2672265172004699... | |
}
}
private void XSDValidationEventHandler(object sender, ValidationEventArgs args)
{
errors.AppendFormat("XSD - Severity {0} - {1}",
args.Severity.ToString(), args.Message);
}
```
Basically, I pass it an XmlNode (which I select from the entire XmlDocument by means of .SelectSingleNode),... | [
-0.06724829971790314,
0.13314494490623474,
0.5337767601013184,
-0.003194228745996952,
-0.04601192846894264,
0.030090423300862312,
0.4316353499889374,
-0.1441125124692917,
-0.09741976112127304,
-0.5639215707778931,
-0.2795039117336273,
0.47713419795036316,
-0.1733018010854721,
-0.0096239475... | |
there were any errors recorded, or not.
Works for me - your mileage may vary :-) | [
0.5189694762229919,
0.21309058368206024,
0.2655317187309265,
0.2279251217842102,
0.4748930335044861,
0.17417100071907043,
0.4492599368095398,
0.08332812041044235,
-0.2181125283241272,
-0.3600941598415375,
0.7401078343391418,
0.5228582620620728,
0.18154481053352356,
-0.17032548785209656,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.