text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
Here's a snippet of code from within TurboGears 1.0.6:
```
[dispatch.generic(MultiorderGenericFunction)]
def run_with_transaction(func, *args, **kw):
pass
```
I can't figure out how putting a list before a function definition can possibly affect it.
In dispatch.generic's docstring, it mentions:
> Note that whe... | [
0.47982317209243774,
-0.24159421026706696,
0.15536397695541382,
0.1616591066122055,
-0.13776083290576935,
-0.2297472059726715,
0.3705695569515228,
-0.23944191634655,
-0.3611312508583069,
-0.35632553696632385,
-0.013180093839764595,
0.7463191747665405,
-0.506129801273346,
0.0861119404435157... | |
assignments are taking place. Guido takes a very dim view of this, but the hook's existing functionality isn't going to change in 2.2, 2.3, or 2.4, so don't worry about it too much. This is really a trick to get "early access" to decorators, and the 2.4 lifecycle will be plenty long enough to get our code switched over... | [
0.8211215734481812,
-0.21885809302330017,
0.41166144609451294,
0.08165977150201797,
-0.019245678558945656,
-0.2757997512817383,
0.19244609773159027,
-0.5442830324172974,
-0.10236542671918869,
-0.3342527747154236,
0.05905675143003464,
0.5635512471199036,
-0.07878629118204117,
-0.42801433801... | |
that hooks into special code for debuggers to manipulate what actually gets assigned for the function.
The python docs say this about settrace
"""
Note
The settrace() function is intended only for implementing debuggers, profilers, coverage tools and the like. Its behavior is part of the implementation platform, rath... | [
0.4300720691680908,
-0.11979832500219345,
0.04632924497127533,
0.011760023422539234,
0.030235419049859047,
-0.5084816217422485,
0.0877881571650505,
-0.2555848956108093,
-0.09259001910686493,
-0.3279051184654236,
-0.34313884377479553,
0.6508587002754211,
-0.4540480673313141,
-0.358058363199... | |
I have a site where users can post stuff (as in forums, comments, etc) using a customised implementation of TinyMCE. A lot of them like to copy & paste from Word, which means their input often comes with a plethora of associated MS inline formatting.
I can't just get rid of `<span whatever>` as TinyMCE relies on the s... | [
0.84992915391922,
0.15774044394493103,
0.23908869922161102,
-0.053114116191864014,
-0.19115646183490753,
-0.17487604916095734,
0.04966204985976219,
0.2661329507827759,
-0.2600487470626831,
-0.571790337562561,
0.11256565153598785,
0.6086450815200806,
-0.15125657618045807,
0.4110208451747894... | |
me? It must be a common problem, though I can't find anything definitive. I've been thinking recently that a series of brute-force regexes looking for MS-specific patterns might do the trick, but I don't want to re-write something that may already be available unless I must.
Also, fixing of curly quotes, em-dashes, et... | [
0.6953526139259338,
0.04871058091521263,
0.2676880359649658,
0.0888286828994751,
-0.38624274730682373,
-0.09055833518505096,
0.4901491701602936,
0.044144101440906525,
-0.23021532595157623,
-0.7541158199310303,
-0.0062314532697200775,
0.3720347285270691,
-0.31772270798683167,
-0.04216316714... | |
I use the PECL extension [Tidy](http://www.php.net/tidy) which is a binding for the [Tidy HTML](http://www.w3.org/People/Raggett/tidy/) utility.
If those don't help you, I suggest you switch to FCKEditor which has this feature [built-in](http://docs.fckeditor.net/FCKeditor_2.x/Users_Guide/Common_Tasks/Cut%2C_Copy_and_... | [
0.5255939960479736,
-0.3796755075454712,
0.626072108745575,
-0.0111164515838027,
-0.14350251853466034,
-0.5471159815788269,
-0.03754907846450806,
-0.1358901560306549,
-0.21270446479320526,
-0.5631504058837891,
-0.05343053862452507,
0.4604520797729492,
-0.4849085211753845,
-0.12485592812299... | |
I'm looking for a lightweight way to make my program (written in C) be able to play audio files on either windows or linux. I am currently using windows native calls, which is essentially just a single call that is passed a filename. I would like something similar that works on linux.
The audio files are Microsoft PC... | [
0.3980044424533844,
0.29852616786956787,
0.2950488030910492,
0.19588033854961395,
-0.24463152885437012,
-0.32186585664749146,
0.1467992067337036,
0.07840275019407272,
-0.1438957303762436,
-0.5407474040985107,
0.16020114719867706,
0.8178081512451172,
-0.19635362923145294,
0.4301417469978332... | |
is possible even in a portable way using the already mentioned portaudio and libsndfile (LGPL).
Here is a small test case I've written to test both libs:
```
#include <portaudio.h>
#include <sndfile.h>
static int
output_cb(const void * input, void * output, unsigned long frames_per_buffer,
const PaStreamCal... | [
0.2539140582084656,
0.216256782412529,
0.3485734760761261,
-0.12397635728120804,
0.11679629981517792,
-0.2309720665216446,
0.1428259015083313,
-0.29169344902038574,
-0.43204542994499207,
-0.5708184838294983,
-0.0703866109251976,
0.30173128843307495,
-0.44033581018447876,
0.2265264838933944... | |
* Note although I haven't tested it for stereo I think you have
* to multiply frames_per_buffer with the channel count i.e. 2 for
* stereo */
sf_read_short(file, output, frames_per_buffer);
return paContinue;
}
static void
end_cb(void * data)
{
printf("end!\n");
}
#define error_check(err) \
... | [
0.5163352489471436,
0.04379408061504364,
0.29522186517715454,
-0.29278334975242615,
0.02612466551363468,
-0.021185114979743958,
0.2841487228870392,
-0.5569874048233032,
-0.04656967520713806,
-0.2591748535633087,
0.15570397675037384,
0.6529982686042786,
-0.39174678921699524,
0.1471655517816... | |
fprintf(stderr, "error number: %d\n", err); \
fprintf(stderr, "\n\t%s\n\n", Pa_GetErrorText(err)); \
return err; \
} \
} while (0)
int
main(int argc, char ** argv)
{
PaStreamParameters out_param;
PaStream * stream;
PaError err;
SNDFILE * file;
SF_INFO sfinfo;
... | [
-0.12334559112787247,
-0.34359675645828247,
0.6920479536056519,
-0.27207282185554504,
0.30158281326293945,
0.2475772500038147,
0.27951186895370483,
-0.29770514369010925,
-0.11686187237501144,
-0.19407519698143005,
-0.2586880028247833,
0.5781391859054565,
-0.49206027388572693,
-0.0573007464... | |
fprintf(stderr, "Usage %s \n", argv[0]);
return 1;
}
file = sf_open(argv[1], SFM_READ, &sfinfo);
printf("%d frames %d samplerate %d channels\n", (int)sfinfo.frames,
sfinfo.samplerate, sfinfo.channels);
/* init portaudio */
err = Pa_Initialize();
error_check(err);
/* we... | [
0.01703607477247715,
-0.35694172978401184,
0.6554675698280334,
-0.34359046816825867,
0.43941012024879456,
0.11516625434160233,
0.3318345546722412,
-0.5633070468902588,
-0.13468872010707855,
-0.6041204333305359,
-0.28329941630363464,
0.6781488060951233,
-0.2559939920902252,
-0.1728361546993... | |
fprintf(stderr, "Haven't found an audio device!\n");
return -1;
}
/* stero or mono */
out_param.channelCount = sfinfo.channels;
out_param.sampleFormat = paInt16;
out_param.suggestedLatency = Pa_GetDeviceInfo(out_param.device)->defaultLowOutputLatency;
out_param.hostApiSpecificStreamInfo... | [
0.16496320068836212,
-0.07967887818813324,
0.5953191518783569,
-0.1402658224105835,
0.39378488063812256,
-0.04652576148509979,
0.6129440069198608,
-0.4402666985988617,
-0.12910446524620056,
-0.34963729977607727,
-0.46720221638679504,
0.838533341884613,
-0.2147851288318634,
0.12719199061393... | |
error_check(err);
err = Pa_StartStream(stream);
error_check(err);
printf("Play for 5 seconds.\n");
Pa_Sleep(5000);
err = Pa_StopStream(stream);
error_check(err);
err = Pa_CloseStream(stream);
error_check(err);
sf_close(file);
Pa_Terminate();
return 0;
}
```
Some note... | [
0.15904413163661957,
0.051810070872306824,
0.5673112869262695,
-0.3746507465839386,
0.20899462699890137,
-0.12606416642665863,
0.2710435092449188,
-0.45440202951431274,
-0.16795405745506287,
-0.4932616651058197,
-0.2576424777507782,
1.09348726272583,
-0.17354995012283325,
0.182381272315979... | |
backends support multiple streams for one device, for example the OSS backend doesn't, but the ALSA backend does. I don't know how the situation is on windows. Since all your input files are of the same type you could mix them on you own, which complicates the code a bit more, but then you'd have also support for OSS. ... | [
0.22640380263328552,
-0.23531298339366913,
0.29752740263938904,
0.1047261506319046,
-0.16681034862995148,
-0.10048695653676987,
-0.2825087606906891,
-0.06143493205308914,
-0.16486631333827972,
-0.7083515524864197,
0.34690672159194946,
0.6593808531761169,
-0.48908063769340515,
0.14569213986... | |
One of the items in the [Joel Test](http://www.joelonsoftware.com/articles/fog0000000043.html) is that a project/company should have a specification.
I'm wondering what makes a spec good. Some companies will write volumes of useless specification that no one ever reads, others will not write anything down because "no ... | [
0.7677168250083923,
0.22180642187595367,
0.07449404150247574,
0.3100937604904175,
-0.04477270320057869,
-0.207606241106987,
0.08710251748561859,
0.18072804808616638,
0.09750407934188843,
-0.2056158185005188,
0.23292870819568634,
0.6226356029510498,
0.28036928176879883,
0.22941598296165466,... | |
few ways as possible
4. Is widely-distributed
5. Is agreed-upon as being THE spec by all parties involved
6. Is concise
7. Is consistent
8. Is updated regularly as requirements change
9. Describes as much of the problem as is possible and practical
10. Is testable | [
0.6641443967819214,
0.20255520939826965,
0.25603461265563965,
0.1573631912469864,
0.054934270679950714,
-0.212166890501976,
0.12359856069087982,
-0.3818420469760895,
-0.06570972502231598,
-0.4609045386314392,
-0.39277753233909607,
0.6579517126083374,
0.11170543730258942,
-0.155238762497901... | |
So, I have an API that I need to implement in to an existing framework. This API manages interactions with an external server. I've been charged with coming up with a way to create an easily repeatable "pattern," so that if people are working on new projects in the given framework they have a simple solution for integr... | [
0.36889487504959106,
-0.015202553011476994,
0.1510474681854248,
0.009119017980992794,
0.10279776155948639,
-0.05833844840526581,
0.3001561760902405,
0.1860831081867218,
-0.37362533807754517,
-0.6481680274009705,
0.2721460461616516,
0.21897657215595245,
-0.4471316635608673,
0.20154115557670... | |
"inheritence heavy" and he wants to avoid adding to the madness. I obviously can't incapsulate my API, because that is what the API itself is supposed to be doing, and doing so might hide functionality.
Short of asking futures developers to copy and paste my example, what do I do?
If your boss is hostile to inheritan... | [
0.19061678647994995,
-0.15212416648864746,
0.034321513026952744,
0.05388642102479935,
-0.13032227754592896,
-0.4410181939601898,
0.13597342371940613,
-0.21309737861156464,
-0.30282461643218994,
-0.429979532957077,
0.19562773406505585,
0.5865883827209473,
-0.3156415820121765,
0.267758607864... | |
API isn't object-implemented or you need to load a lot of functionality specific to your environment onto it, that points toward making your own class that goes into that role and relates to the third party API however it needs to. Yeah, this basically means you're building an API to the API. Aggregation allows you to ... | [
0.41290023922920227,
-0.12076682597398758,
-0.159470334649086,
0.135421022772789,
-0.14883354306221008,
-0.20759446918964386,
0.14590182900428772,
0.12023960798978806,
-0.3557167053222656,
-0.3635715842247009,
0.12782710790634155,
0.4708208441734314,
-0.5221160650253296,
0.1455176174640655... | |
I have a collection of an object called Bookmarks which is made up of a collection of Bookmarks. This collection of bookmarks are bound to a treeview control.
I can get the bookmarks back out that I need, but I need a copy of the bookmarks so I can work with it and not change the original.
Any thoughts.
Thanks.
C... | [
0.6851343512535095,
0.10086295008659363,
0.29944899678230286,
0.5053102970123291,
0.189301997423172,
-0.20883768796920776,
0.0330594927072525,
0.031300656497478485,
-0.10923545807600021,
-0.7653976082801819,
0.3154110014438629,
0.5359309315681458,
0.09004969149827957,
0.2807825803756714,
... | |
on MSDN that goes into more detail - see [How to Write a Copy Constructor](http://msdn.microsoft.com/en-us/library/ms173116.aspx). | [
0.033228348940610886,
0.08840527385473251,
0.08678874373435974,
0.29472628235816956,
0.0837395116686821,
-0.4488896429538727,
0.1346130669116974,
0.33013179898262024,
-0.29527747631073,
-0.7995346188545227,
-0.2669799029827118,
0.3979174792766571,
-0.14369109272956848,
-0.1701611578464508,... | |
I have a listbox on an HTML form with a Submit button. The listbox has multiple selection enabled. I am able to select multiple values in the listbox, but I don't know how to figure out what values were selected when the form is submitted. Also, I am adding user generated values to the list box dynamically using JavaSc... | [
0.6367940902709961,
-0.1284392923116684,
0.2852059602737427,
0.1948339194059372,
-0.25905507802963257,
-0.0014654225669801235,
0.1213320642709732,
-0.23616139590740204,
-0.15607814490795135,
-0.788225531578064,
0.1636231690645218,
0.283421128988266,
-0.26007920503616333,
0.1042904704809188... | |
an example of a page.
Note that:
* the select element (and any form element) needs a name to be included in the post.
* only selected options in the select element will be posted.
*What values are selected in the box by the user?*
When the user submits the form only the selected values will be sent to the server. D... | [
0.2513588070869446,
0.03435978293418884,
0.3127371370792389,
0.13164271414279938,
-0.3378123641014099,
-0.05858149006962776,
0.37373441457748413,
0.16143156588077545,
-0.2517360746860504,
-0.8278847336769104,
-0.3514477610588074,
-0.13384556770324707,
-0.4250461757183075,
0.011557887308299... | |
your options and the users options? That depends on what data you are sending the user. The universal answer is thats the value you get back that you didn't send. However this can be simplified depending on your data. Since the options have both a value and a text property, one way it to use a numeric value for your pr... | [
0.028788506984710693,
-0.39900192618370056,
0.1934034526348114,
0.24733048677444458,
0.11946415901184082,
0.22817543148994446,
-0.11469685286283493,
0.12413705885410309,
-0.3401728570461273,
-0.45423561334609985,
0.04567457735538483,
0.6408088803291321,
-0.2653628885746002,
-0.071148894727... | |
prefix to all user generated values (remember you have both a value and a text field for all options)
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test of select box</title>
<script ... | [
0.19749949872493744,
-0.11158102750778198,
0.3923385739326477,
-0.012371944263577461,
-0.13678008317947388,
0.296379029750824,
0.00036724700476042926,
-0.7286606431007385,
0.0304043460637331,
-0.4790825843811035,
-0.4302573502063751,
0.31523793935775757,
-0.4218076169490814,
-0.24050179123... | |
}
</script>
</head>
<body>
<form method="post" action="mypage.html">
<input type="button" onclick="addOpt(this.form.myselect)" value="Add option"/>
<br/>
<select id="myselect" name="mydata" multiple="multiple" size="10">
<option value="0">Test 0</option>
<option value="1">T... | [
0.06711281090974808,
-0.2615966498851776,
0.24537380039691925,
0.05574505776166916,
0.11926683783531189,
0.2264888882637024,
-0.005507069639861584,
-0.5149111151695251,
0.03421625867486,
-0.9252792000770569,
-0.08890453726053238,
0.5227411389350891,
-0.11329835653305054,
-0.280202746391296... | |
I'm looking into writing a wxWidget that displays a graphical node network, and therefore does a lot of drawing operations. I know that using Python to do it is going to be slower, but I'd rather get it working and port it later when its functional. Ideally, if the performance hit isn't too great, I'd prefer to keep th... | [
0.5649915933609009,
-0.07304111868143082,
0.3799985647201538,
0.0837927833199501,
-0.2261606603860855,
-0.10732785612344742,
0.11014692485332489,
-0.12572865188121796,
-0.3054518699645996,
-0.6797121167182922,
0.3870331943035126,
0.5006117820739746,
-0.13129912316799164,
-0.122419208288192... | |
down? Will it be noticeable at all? What are your experiences?
Below you find an example of a page.
Note that:
* the select element (and any form element) needs a name to be included in the post.
* only selected options in the select element will be posted.
*What values are selected in the box by the user?*
When th... | [
0.08902709931135178,
-0.07258690148591995,
0.6603742837905884,
0.19157975912094116,
0.06403608620166779,
0.08217424154281616,
0.15160547196865082,
0.27289295196533203,
-0.5286967754364014,
-0.7194163203239441,
-0.30084049701690674,
0.10698455572128296,
-0.2169676125049591,
-0.0571875162422... | |
only see what options that was selected. But how do you distinguish between your options and the users options? That depends on what data you are sending the user. The universal answer is thats the value you get back that you didn't send. However this can be simplified depending on your data. Since the options have bot... | [
0.0003260112425778061,
-0.35433685779571533,
0.24621710181236267,
0.2803057134151459,
-0.02908848226070404,
0.12021711468696594,
0.031112372875213623,
0.05501178279519081,
-0.1473979949951172,
-0.5104384422302246,
0.04946117103099823,
0.7354062795639038,
-0.2967670261859894,
-0.08345244079... | |
will not enter just a numeric value. Another approach is to add a prefix to all user generated values (remember you have both a value and a text field for all options)
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/x... | [
0.2608419954776764,
-0.11325539648532867,
0.3599100708961487,
-0.05291907116770744,
0.045422933995723724,
-0.11779181659221649,
-0.038913484662771225,
-0.5290473103523254,
0.21805725991725922,
-0.6320281624794006,
-0.5444611310958862,
0.29135286808013916,
-0.3813037872314453,
-0.1173540204... | |
o.selected=true;
e.add(o,null);
}
</script>
</head>
<body>
<form method="post" action="mypage.html">
<input type="button" onclick="addOpt(this.form.myselect)" value="Add option"/>
<br/>
<select id="myselect" name="mydata" multiple="multiple" size="10">
<option value="... | [
0.05703045427799225,
-0.4332655668258667,
0.3195476830005646,
0.011089062318205833,
0.11195976287126541,
0.43346405029296875,
0.06672050803899765,
-0.4916476011276245,
-0.03112075664103031,
-0.8934677839279175,
-0.16504645347595215,
0.4190186858177185,
-0.11433111876249313,
-0.223059251904... | |
<input type="submit"/>
</form>
</body>
</html>
``` | [
0.3290776312351227,
0.10598894208669662,
0.16968856751918793,
0.06297778338193893,
-0.4159814119338989,
-0.049010951071977615,
0.06100544333457947,
-0.3895817995071411,
-0.005071377381682396,
-0.5846265554428101,
-0.5430562496185303,
0.1865111142396927,
-0.10790533572435379,
-0.28969839215... | |
Using C#, is there any way to hook into a running application (my own app) and get an instance of a class? As it stands right now I'm doing this
```
// Find the IAutomation interface.
Type[] types = assembly.GetTypes();
foreach (Type type in types)
{
if (!type.IsAbstract && type.GetInterface("IAutomation") != nul... | [
0.11060690879821777,
0.10907012224197388,
0.23840664327144623,
0.026745155453681946,
0.26114416122436523,
0.18282489478588104,
0.2894887328147888,
-0.5031661987304688,
-0.29840460419654846,
-0.5202932953834534,
-0.08696356415748596,
0.676869809627533,
-0.550254762172699,
0.0854272097349166... | |
your existing instance a COM server, and use COM interop to the existing instance.
Maybe there are some debugging API's that you can use as well, but that I would not consider clean. | [
0.43866443634033203,
-0.09142112731933594,
0.06055053696036339,
0.25295883417129517,
-0.1891343593597412,
-0.09638281166553497,
0.17133362591266632,
0.3369382917881012,
0.007904003374278545,
-0.9907628297805786,
0.06058749556541443,
0.580853283405304,
-0.18923503160476685,
0.32546880841255... | |
What is the best way to determine which ASP.NET button was clicked on a single page using JavaScript?
I just the set the OnClientClick event handler for the button with the JavaScript function I wanted executed when the button was clicked during the Page\_Load event.
```
protected void Page_Load(object sender, EventsA... | [
-0.032231852412223816,
-0.17328982055187225,
0.504481315612793,
0.004667057655751705,
0.04319058358669281,
-0.14342111349105835,
0.24211804568767548,
-0.17229193449020386,
-0.29351648688316345,
-0.5266204476356506,
-0.0032168400939553976,
0.47651994228363037,
-0.4013480544090271,
-0.011644... | |
Some of Oracle's analytic functions allow for a [windowing clause](http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions001.htm#i97640) to specify a subset of the current partition, using keywords like "unbounded preceding/following", "current row", or "value\_expr preceding/following" where value\_e... | [
-0.1045633852481842,
-0.1844796985387802,
-0.03670531511306763,
-0.010524900630116463,
0.22809085249900818,
0.3497724235057831,
-0.3423035144805908,
-0.12405353039503098,
-0.21585647761821747,
-0.3383498787879944,
-0.44536155462265015,
0.440659761428833,
-0.1364879161119461,
0.041263744235... | |
count(*) over (partition by deptno
order by hiredate
range between unbounded preceding and current row) cnt_hired_before1,
count(*) over (partition by deptno | [
-0.29351359605789185,
0.04237949475646019,
0.3493489921092987,
-0.3167368471622467,
0.3051617443561554,
0.5570805668830872,
-0.24912984669208527,
-0.14864996075630188,
-0.6118009090423584,
-0.3929826319217682,
-0.20328238606452942,
0.4223024547100067,
-0.15318305790424347,
0.17279414832592... | |
order by hiredate
range between unbounded preceding and 0 preceding) cnt_hired_before2
from emp
where deptno = 30
order by deptno, hiredate;
```
...can anyone provide an example or documentation where "current row" is different than "0 preceding/following"? It just seems like syntactic s... | [
-0.3456870913505554,
-0.1475977748632431,
0.5775730013847351,
-0.2870001196861267,
-0.08994989097118378,
0.3606308400630951,
-0.15288756787776947,
-0.07801991701126099,
-0.3613269031047821,
-0.41922426223754883,
-0.13068251311779022,
0.650820255279541,
-0.19880133867263794,
-0.103375852108... | |
The term "current row" is one that is common to multiple databases with analytic functions, not just Oracle. It's more of a stylistic difference, in the same way that some people prefer count(\*) over count(1). | [
-0.2113082855939865,
-0.10137246549129486,
0.5544053912162781,
0.08176659792661667,
0.01047870609909296,
0.11141632497310638,
-0.6278710961341858,
0.03789952024817467,
-0.21512626111507416,
-0.20511721074581146,
-0.0248654056340456,
0.15598814189434052,
-0.4364556670188904,
0.4566158354282... | |
I've received some documentation from one of our suppliers for a webservice they're publishing and they're very specific that on one of their WebMethods that an argument has the out modifier(? not sure if that's the right descriptor) for instance consider the following WebMethod signature:
```
[WebMethod]
public void ... | [
0.016467075794935226,
0.1758035570383072,
0.3253028094768524,
0.13293181359767914,
-0.16183613240718842,
0.24193722009658813,
0.014168699271976948,
0.041809048503637314,
-0.11168722063302994,
-0.6194060444831848,
0.4286966621875763,
0.14796993136405945,
-0.3786405622959137,
0.5415893197059... | |
with a few basic Hello World style webmethods...one with a single out string argument, one with two out string arguments and one that doesn't receive any arguments but returns a string.
Upon trying to reference my webmethods from a separate application I notice that I have to access the method with the single out stri... | [
-0.0994449108839035,
0.005508518312126398,
0.3300871253013611,
0.010815910063683987,
-0.34187039732933044,
0.40695589780807495,
0.08808217197656631,
-0.236506387591362,
-0.016096385195851326,
-0.6838985681533813,
0.25225529074668884,
0.4457641541957855,
-0.5117561221122742,
0.3383816778659... | |
them both as such [where x is substituted for the correct method]:
```
string val = HelloWorldX();
```
Having attempted to reference the methods in the way I would access them if they weren't web methods [like so]:
```
string val = string.Empty;
MyService1.HelloWorld(out val);
Console.WriteLine(val);
```
which ca... | [
-0.11846712976694107,
-0.07045391947031021,
0.5191411972045898,
0.047940388321876526,
-0.21318016946315765,
0.22980281710624695,
0.031521476805210114,
-0.4698134958744049,
0.018112821504473686,
-0.5510422587394714,
-0.0703907161951065,
0.6598078608512878,
-0.2895132899284363,
0.23555323481... | |
2 ref arguments...
```
public void HelloWorld3(out string strVal1, out string strVal2)
{
strVal1 = "Hello World";
strVal2 = "Hello World Again!";
}
```
This generates the SOAP content:
```
<HelloWorld3Response xmlns="http://tempuri.org/">
<strVal1>string</strVal1>
<strVal2>string</strVal2>
</HelloWorld3... | [
-0.03826144337654114,
-0.15806080400943756,
0.7113809585571289,
-0.16871944069862366,
-0.2205892950296402,
0.3588738739490509,
0.32982954382896423,
-0.4122355580329895,
0.22357068955898285,
-0.7402429580688477,
0.2661277949810028,
0.4898335039615631,
-0.5168382525444031,
0.1660493165254593... | |
obvious exception that it's complaining about 2 arguments instead of 1 [and in fact I do get the same exception, I tested it].
* What gives?
* Is there a reason or a way to use out/ref arguments in WebMethods that I'm missing?
* If there is, how do I reference WebMethods with multiple out/ref arguments?
I don't know w... | [
-0.02311871573328972,
0.4371214807033539,
-0.14701814949512482,
0.04880177974700928,
-0.3589478135108948,
0.017746416851878166,
0.20539245009422302,
-0.01190757192671299,
-0.38012441992759705,
-0.3918854892253876,
-0.03695361688733101,
0.4218357801437378,
-0.3601904809474945,
0.03816700354... | |
thought I share my findings.
So, consider the following webmethods defined in my WebService:
```
[WebMethod]
public string Method1()
{
return "This is my return value";
}
[WebMethod]
public void Method2(out string strVal1)
{
strVal1 = "This is my value passed as an output";
//No return value
}
[WebMetho... | [
0.12498932331800461,
-0.14928844571113586,
0.4522094428539276,
-0.04397754371166229,
0.03743521496653557,
0.4924508333206177,
-0.017814384773373604,
-0.41638869047164917,
-0.07151281088590622,
-0.6636208295822144,
0.33176034688949585,
0.08557260036468506,
-0.46450451016426086,
0.3348532319... | |
"This is my strVal1 value passed as an output";
strVal2 = "This is my strVal2 value passed as an output";
return "This is my return value";
}
```
Now according to the document, the first parameter defined as Out, if the method returns void, then the first parameter is automatically used as the return paramete... | [
-0.09927672147750854,
-0.033126428723335266,
0.6215020418167114,
-0.3087998032569885,
-0.14779776334762573,
0.43611598014831543,
-0.0013313195668160915,
-0.30813953280448914,
-0.10223671793937683,
-0.5175159573554993,
0.043050412088632584,
0.295306921005249,
-0.44717010855674744,
0.3309905... | |
that out without having been told that by someone else? It is beyond my comprehension, how this could be a good idea.
Method3:
```
public void Method3(out string strVal1, out string strVal) {}
var str2 = String.Empty;
var str1 = svc.Method3(out str2);
Console.WriteLine(str1);
Console.WriteLine(str2);
```
Method4:
... | [
0.12468858808279037,
-0.08940921723842621,
0.6223917007446289,
-0.18686434626579285,
0.02773277275264263,
0.20839130878448486,
0.43825310468673706,
-0.4596143364906311,
-0.32491350173950195,
-0.06526079028844833,
-0.5565350651741028,
0.3414328098297119,
-0.4747365713119507,
0.3553084135055... | |
come across that document. Many thanks for providing that link Steven - I really appreciate it.
To whomever decided that design pattern was a good idea to be written into the .NET Framework - I can't think what would've posessed you to think that was a good idea. I really dislike you quite intensely after all that.
*... | [
0.4225868880748749,
0.3559982478618622,
0.3088380694389343,
0.042776480317115784,
-0.30935919284820557,
-0.40838682651519775,
0.4366135895252228,
0.1700463593006134,
-0.4338892698287964,
-0.6472482681274414,
0.03391339257359505,
0.3442838788032532,
-0.007590454537421465,
0.345147043466568,... | |
void Method3(ref string strVal1, ref string strVal2)
{
strVal1 = "First argument return value";
strVal2 = "Second argument return value";
}
```
Now to call that you'd use:
```
string val1 = String.Empty;
string val2 = String.Empty;
svc.Method3(ref val1, ref val2);
Console.WriteLine(val1);
Console.WriteLine(v... | [
-0.21380425989627838,
-0.23737505078315735,
0.4786895513534546,
-0.29944905638694763,
0.027571815997362137,
0.3703751266002655,
0.519755482673645,
-0.23957639932632446,
-0.003346832236275077,
-0.5886648893356323,
-0.01148909144103527,
0.40772074460983276,
-0.47737255692481995,
0.1337428092... | |
I have a page where I combine labels, input boxes and text areas to display some content.
I would like all of them to have the same font-family and font-size.
I have played with the *font-family: inherit* style but this doesn't seem to work for the input and text areas.
What would be the easiest way to ensure the same... | [
0.1724107265472412,
0.1778334528207779,
0.15981468558311462,
-0.10255342721939087,
-0.19228333234786987,
-0.06835416704416275,
0.29550549387931824,
-0.33595573902130127,
0.20030224323272705,
-0.7548893690109253,
-0.16222567856311798,
0.28990307450294495,
-0.1819436252117157,
0.257911115884... | |
I've created a package that contains a stored procedure that I plan to invoke from a separate application. The stored procedure will return a sorted list of all the views and tables in the schema. To do that, it performs a simple select on the DBA\_TABLES and DBA\_VIEWS synonyms, as shown below:
```
CREATE OR REPLACE
... | [
0.2251567244529724,
-0.12748543918132782,
0.6794849038124084,
-0.06361590325832367,
0.0844181701540947,
-0.020346909761428833,
0.24233655631542206,
-0.5832743048667908,
0.013302624225616455,
-0.49164649844169617,
-0.23794680833816528,
0.7439995408058167,
-0.24451138079166412,
0.23488108813... | |
FROM DBA_TABLES
WHERE OWNER = 'SONAR5'
UNION ALL
SELECT 'V' OBJECTTYPE, VIEW_NAME OBJECTNAME
FROM DBA_VIEWS
WHERE OWNER = 'SONAR5'
ORDER BY OBJECTNAME;
RESULTS := V_CURSOR;
END GETSCHEMAOBJECTS;
END TITAN_ENTITY;
```
I have verified that the synonyms i... | [
0.14162439107894897,
-0.1657148152589798,
0.3475128710269928,
0.04091905057430267,
-0.09340514242649078,
0.0016180380480363965,
0.4578004479408264,
-0.5456775426864624,
-0.10794996470212936,
-0.27418193221092224,
-0.4124481678009033,
0.5151225924491882,
0.015445058234035969,
0.443703353404... | |
PUBLIC SYNONYM "DBA_VIEWS" FOR "SYS"."DBA_VIEWS"
```
My understanding is that, because they are public, I don't need any further permissions to get to them. If that understanding is incorrect, I wish someone would disabuse me of the notion and point me to more accurate data.
Now here's my problem: I can open a works... | [
0.08718786388635635,
0.506253719329834,
0.09829841554164886,
0.08425828814506531,
-0.23935766518115997,
0.16651740670204163,
0.3947354257106781,
-0.2792455554008484,
-0.11263225227594376,
-0.3178917467594147,
0.00029589180485345423,
0.44372814893722534,
-0.29254570603370667,
0.275071620941... | |
or view does not exist
```
When I double-click on that second error message, SQL Developer takes me to the first FROM clause ("FROM DBA\_TABLES").
So I'm fairly stumped. I know SQL Server pretty well, and I'm new to Oracle, so please bear with me. If you could provide some clues, or point me in the right direction, ... | [
0.4784873127937317,
0.43153223395347595,
0.6053870916366577,
0.015392803587019444,
-0.0421154648065567,
0.05700857564806938,
-0.01481704507023096,
0.37163659930229187,
-0.04128684103488922,
-0.5210619568824768,
-0.12375901639461517,
0.8232579827308655,
-0.13846175372600555,
0.0341145135462... | |
First, to make my job explaining a bit easier, here's some of my code:
```
JSpinner spin = new JSpinner();
JFormattedTextField text = getTextField(spin);
text.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
// Do stuff...
}
});
... | [
-0.16543801128864288,
-0.4224245548248291,
0.4678530991077423,
-0.4025711715221405,
-0.040094178169965744,
0.1399458646774292,
0.3296385407447815,
-0.46659764647483826,
-0.13087880611419678,
-0.401312917470932,
-0.34302064776420593,
0.7615143656730652,
-0.4144786596298218,
-0.0846997871994... | |
+ spinner.getEditor().getClass()
+ " isn't a descendant of DefaultEditor" );
return null;
}
}
```
So as you can see, I got that far. And indeed, when I type in a value into the text field component of the spinner (`JFormattedTextField`), and THEN press ENTER, | [
-0.19839081168174744,
-0.310488224029541,
0.34705331921577454,
-0.38572025299072266,
0.19634215533733368,
-0.15579546988010406,
0.23206870257854462,
0.13115079700946808,
0.0734243243932724,
-0.3853829503059387,
-0.297873318195343,
0.6096519827842712,
-0.2712613046169281,
0.3774798214435577... | |
it works.
What I want now is to be able to have the text field respond to ENTER without having to manually type in a new value (which sorta defeats the purpose of making a spinner out of it). How do I do that?
I know this is not the action listener...but maybe this can work for you?
```
text.addKeyListener( new ... | [
0.04061540961265564,
-0.0784236490726471,
0.6460934281349182,
-0.3690544366836548,
0.1747226119041443,
-0.13950061798095703,
0.5791402459144592,
-0.2990354299545288,
0.016856905072927475,
-0.5020162463188171,
-0.11601908504962921,
1.0022099018096924,
-0.22143958508968353,
0.073567405343055... | |
if ( e.getKeyCode() == KeyEvent.VK_ENTER ) {
System.out.println( "enter pressed" );
}
}
} );
``` | [
-0.20293980836868286,
-0.11017445474863052,
0.49338456988334656,
-0.5198441743850708,
0.58931565284729,
0.06473642587661743,
0.2781612277030945,
-0.33598676323890686,
0.02667233720421791,
-0.4080304801464081,
-0.5489712953567505,
0.7689269185066223,
-0.18360070884227753,
0.2771447300910949... | |
Unmanaged languages notwithstanding, is F# really better than C# for implementing math? And if that's the case, why?
I think most of the important points were already mentioned by someone else:
1. F# lets you solve problems in a way mathematicians think about them
2. Thanks to higher-order functions, you can use simpl... | [
-0.0313582643866539,
0.09493193030357361,
0.17579637467861176,
0.3533284664154053,
-0.33319929242134094,
-0.3949647545814514,
0.3085416555404663,
0.0807822123169899,
-0.36515724658966064,
-0.5211915373802185,
-0.08576571941375732,
0.7940776348114014,
-0.49660369753837585,
-0.33177667856216... | |
have tail-recursion) and this is how you write primitive computations in functional/mathematical way. Also, writing complex higher order functions (that take other functions as arguments) in C# is difficult, because you have to write types explicitly (while in F#, types are inferred, but also automatically generalized,... | [
0.27187037467956543,
0.07017334550619125,
-0.05712936446070671,
0.09846620261669159,
-0.2987744212150574,
-0.5147412419319153,
0.36959108710289,
-0.12219633907079697,
-0.13430359959602356,
-0.2622816562652588,
-0.048860881477594376,
0.5929486155509949,
-0.5362882018089294,
-0.0778787359595... | |
of course true. However, the great thing about F# is that you can start writing the program using tuples & head/tail lists and later in the development process turn it into a program that uses .NET IEnumerables and types with properties (and that's how I believe typical F# programmer works\*). Tuples etc. and F# intera... | [
0.407218873500824,
0.22871430218219757,
0.07212145626544952,
0.3277372419834137,
-0.07957351207733154,
-0.3095507025718689,
0.2822529673576355,
0.16268329322338104,
-0.11287209391593933,
-0.7559760212898254,
-0.053159426897764206,
0.6708006858825684,
-0.24648192524909973,
-0.15713813900947... | |
transformations to wrap the code inisde an F# type (which can also be used from C# as an ordinary class). F# also gives you a lot of ways to optimize the code later in terms of performance.
This gives you the benefits of easy to use langauges (e.g. Python), which many people use for prototyping phase. However, you don... | [
0.10747786611318588,
-0.3523159325122833,
0.22869957983493805,
-0.0010865216609090567,
-0.265304297208786,
0.025624461472034454,
0.31189143657684326,
-0.165518656373024,
-0.5188960433006287,
-0.9371498823165894,
-0.18114827573299408,
0.7683335542678833,
-0.33496513962745667,
-0.23981739580... | |
this style in my [functional programming book](http://manning.com/petricek/). | [
0.036882683634757996,
-0.1137695163488388,
0.024093233048915863,
0.07312320917844772,
0.14920112490653992,
-0.16968782246112823,
0.6385005116462708,
-0.047528963536024094,
-0.44220298528671265,
-0.6365966796875,
-0.19060726463794708,
0.5826123952865601,
-0.2837841510772705,
-0.214621290564... | |
I'm a PHP developer who is being considered for a job implementing [IdeaBank](http://www.brainbankinc.com/idealinkOpen.aspx), idea management software written in .net. The software appears to have been selected based on its features and clients. The [OpenDNS community](http://ideabank.opendns.com/) appears to be using ... | [
0.4114915132522583,
-0.08027826994657516,
0.20845086872577667,
0.0018941030139103532,
0.11121749132871628,
-0.08878736197948456,
-0.033616311848163605,
0.12108109146356583,
-0.1388985961675644,
-0.6084818243980408,
0.21345970034599304,
0.29402127861976624,
-0.0370175838470459,
0.1950890421... | |
I'm compiling some C# and VB code at run time using the CodeDomProvider, CompilerInfo, and CompilerParameters. It works great, and I really like being able to add scripting support to my application, but it only seems to support .NET 2.0 syntax. For example, the var keyword isn't supported in C#, and the If(bool, strin... | [
0.5187689661979675,
0.3011767268180847,
-0.08111916482448578,
-0.15706200897693634,
-0.21100135147571564,
-0.06554324179887772,
0.47130659222602844,
-0.11416607350111008,
-0.22805023193359375,
-0.6410797834396362,
0.0933835357427597,
0.5527398586273193,
-0.29368671774864197,
-0.03175264969... | |
docs](http://msdn.microsoft.com/en-us/library/bb537926.aspx), I found that it's cleaner to specify the compiler options in the App.config file. Here's an example:
```
<system.codedom>
<compilers>
<compiler
language="vb;vbs;visualbasic;vbscript"
extension=".vb"
type="Microsoft.VisualBasic.VBCode... | [
0.24405351281166077,
0.3354519307613373,
0.44855546951293945,
-0.16708670556545258,
0.14908210933208466,
0.12111186981201172,
0.2353440672159195,
-0.23494459688663483,
-0.07059802860021591,
-0.5446962714195251,
-0.39851975440979004,
0.6302808523178101,
-0.6237996816635132,
-0.0234620179980... | |
</compiler>
<compiler
language="c#;cs;csharp"
extension=".cs"
type="Microsoft.CSharp.CSharpCodeProvider, System,
Version=2.0.3600.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
compilerOptions="/optimize"
warningLevel="1" >
<providerOption
name="Co... | [
0.31888318061828613,
0.2508894205093384,
-0.08512432873249054,
-0.15412595868110657,
-0.1568639874458313,
0.09665020555257797,
0.5906286239624023,
0.008558964356780052,
-0.23510697484016418,
-0.7235234379768372,
-0.10585853457450867,
0.2043607383966446,
-0.4178782105445862,
0.2145124971866... | |
The configuration documentation says that the App.config should override the machine.config settings, but I get both. So far, the App.config is always after the machine.config, so I just let the later ones override the earlier ones. Anybody know how to avoid the duplication? | [
0.3515836298465729,
0.09511709213256836,
0.38124769926071167,
0.18794892728328705,
0.5298280119895935,
0.00030827888986095786,
0.08450133353471756,
0.21397125720977783,
-0.5861598253250122,
-0.5309278964996338,
-0.013271098956465721,
0.8842483162879944,
-0.3682019114494324,
-0.090947553515... | |
I have some data files to import into a database with some "unique" delimiters:
Field Separator (FS): SOH (ASCII character 1)
Record Separator (RS) : STX (ASCII character 2) +’\n’
I'd like to import the files into Postgres using the COPY command but while I can specify a custom field delimiter, it can't handle the r... | [
0.29754412174224854,
0.31943050026893616,
0.31839919090270996,
-0.0359291210770607,
0.06904488801956177,
0.04796626418828964,
0.07483226805925369,
-0.12138765305280685,
-0.35613059997558594,
-0.5611509680747986,
-0.28994277119636536,
0.2678969204425812,
-0.22123484313488007,
0.257280617952... | |
note: it's not important that newlines in fields are preserved, it's fine if they are just converted into a space.
With this in mind, I was thinking of using something like "sed" to convert newlines into spaces, then convert \002 into newlines. However, since sed is a line-based tool it doesn't seem to see the newline... | [
0.2931888997554779,
-0.09472336620092392,
-0.16476470232009888,
0.07969147711992264,
0.001015801215544343,
-0.00927123986184597,
-0.06328628957271576,
0.15103143453598022,
-0.31844308972358704,
-0.5790612697601318,
-0.030257344245910645,
0.3162464499473572,
-0.38083672523498535,
0.09648194... | |
splitting it up into lines
Based on the suggestion given by [Patrick](https://stackoverflow.com/users/7903/patrick-cuff), I have been able to do it using Perl:
cat file | perl -pe 's/\002\n/\002\002/g' | perl -pe 's/\n/ /g' | perl -pe 's/\002\002/\n/g' | [
-0.139004647731781,
-0.1564321517944336,
0.4956855773925781,
-0.33764877915382385,
0.021739153191447258,
0.23434872925281525,
-0.10766059160232544,
-0.21839585900306702,
-0.6295821070671082,
-0.3193415701389313,
-0.15268641710281372,
0.14076535403728485,
-0.5138190388679504,
-0.12455190718... | |
I have heard several podcasters (most recently the guys on [DotNetRocks](http://www.dotnetrocks.com/)) say that the look and feel of Visual Studio 2010 has been completely redesigned and Visual Studio rewritten in WPF.
I have been watching some [demos on channel9 of the Visual Studio 2010 CTP](http://channel9.msdn.com... | [
0.4145929515361786,
-0.05554186925292015,
0.4451438784599304,
-0.20398758351802826,
-0.37727513909339905,
-0.04268050193786621,
0.09321685880422592,
0.23967979848384857,
-0.3054038882255554,
-0.7554453611373901,
0.2080056518316269,
0.6403567790985107,
0.21831491589546204,
0.242043524980545... | |
what it will look like: I don't even think that they know what it will look like.
However, from what I've heard, they are in fact rewriting portions to be WPF/C#, but they are not throwing everything out and starting from scratch. Instead, they will be rewriting portions as it makes sense. For example, I saw that they... | [
0.5259438753128052,
-0.007270218804478645,
0.14002376794815063,
0.09759148210287094,
0.01227354072034359,
-0.21693196892738342,
-0.1387443244457245,
0.32984182238578796,
-0.2561962902545929,
-0.5300106406211853,
-0.08363236486911774,
0.4210965037345886,
0.09587418287992477,
0.1767016798257... | |
I have a script that did double inserts into the database with the same data. Is there a good way to do this (without scanning through, inserting every record into an array, and then deleting duplicate array entries)?
MySQL supports multi-table DELETE which is really cool and can help here. You can do a self-join on th... | [
-0.11388245970010757,
0.2163548469543457,
0.25976914167404175,
-0.02858383022248745,
-0.3215636909008026,
-0.0950080081820488,
0.26241350173950195,
-0.05767033249139786,
-0.20340704917907715,
-0.5759917497634888,
0.18721213936805725,
0.5644341111183167,
-0.47696754336357117,
-0.04921069741... | |
I'm trying to recreate the iPhone flick / scroll event in a window using JavaScript.
Starting with JQuery, I'm measuring the mouse's acceleration and offset during click - drag - release events using a timer:
```
var MouseY = {
init: function(context) {
var self = this;
self._context = context ||... | [
0.14624238014221191,
-0.08668868243694305,
0.43830499053001404,
-0.3599856197834015,
0.1449199914932251,
0.16814392805099487,
0.22973008453845978,
-0.07191291451454163,
-0.008835692889988422,
-0.7976102232933044,
0.12222184985876083,
0.7177401185035706,
-0.21555151045322418,
0.031839869916... | |
self._offset = 0;
self._timer = 0;
self._acceleration = 0;
$(self._context).mousedown(function() {self._down = true;});
$(self._context).mouseup(function() {self._down = false;});
$(self._context).mousemove(function(e) {self.move(e);});
},
move: function(e) {
v... | [
-0.14173774421215057,
-0.17798404395580292,
0.7209343314170837,
-0.6134604215621948,
0.4875251054763794,
0.4018822908401489,
0.2653939723968506,
-0.4099727272987366,
-0.24336132407188416,
-0.6592985391616821,
-0.26156556606292725,
0.971766471862793,
-0.14148791134357452,
-0.034992512315511... | |
self._now = e.clientY + window.document.body.scrollTop;
self._offset = self._now - self._last;
self._acceleration = self._offset / self._timer;
},
reset: function() {
this._offset = 0;
this._acceleration = 0;
this._timer = 0;
}
};
$(function() {
MouseY.init();
... | [
-0.06623193621635437,
-0.2508886456489563,
0.9485665559768677,
-0.22860804200172424,
0.4987216889858246,
0.38853415846824646,
0.21791894733905792,
-0.2056763619184494,
-0.20481353998184204,
-0.7948517799377441,
-0.14739181101322174,
0.8161970376968384,
-0.21920235455036163,
0.0539276786148... | |
'_acceleration:' + MouseY._acceleration + '<br />' +
'_now:' + MouseY._now + '<br />' +
'_offset:' + MouseY._offset + '<br />' +
'_timer:' + MouseY._timer + '<br />'
);
MouseY.reset();
}, 10);
});
```
Now the problem is translating that acceleration into screen... | [
-0.4328928291797638,
0.020826052874326706,
0.8563838601112366,
-0.2619703412055969,
0.3260147273540497,
0.44607728719711304,
-0.043174680322408676,
-0.023150749504566193,
-0.6155326962471008,
-0.8673032522201538,
-0.5082955956459045,
0.7820373773574829,
-0.23802310228347778,
-0.15995715558... | |
(easing?) or animation libraries that could help me out on this? (I've looked into JQuery's .animate() but I'm unsure of how to apply it continuously during the drag events!
**Update - final solution here:**
<http://johnboxall.github.com/iphone.html>
Hit up this link for the full explanation of one approach that seem... | [
-0.17734473943710327,
-0.1201888844370842,
0.7407699227333069,
0.04980930685997009,
-0.10415621846914291,
0.08817331492900848,
0.16256402432918549,
-0.5874341130256653,
-0.1658540666103363,
-0.8362902402877808,
0.031176071614027023,
0.6554065346717834,
-0.1869809627532959,
-0.2687906324863... | |
intervals. The variables mouseLeft
> and mouseTop hold each samplings mouse
> positions and the sampling rate is
> set to 100 milliseconds in the
> variable monitor.timerDelay.
And some of the author's code:
```
nn4 = (document.layers)? true:false;
mouseLeft = mouseTop = mouseX = mouseY = 0;
monitor = {
timer... | [
0.3396990895271301,
-0.7229897379875183,
0.5406341552734375,
0.14623244106769562,
0.4146687090396881,
0.05445759743452072,
0.08229926973581314,
-0.7004339694976807,
0.0307474248111248,
-0.46734458208084106,
-0.14050443470478058,
0.7136590480804443,
-0.09316340833902359,
-0.2407435178756714... | |
mouseY = evt.pageY;
return true;
}
monitorMouse();
}
function stopMonitor() {
if (!tip) return;
hideTooltip();
if (monitor.timer) {
clearTimeout(monitor.timer);
monitor.timer = null;
}
document.releaseEvents(Event.MOUSEMOVE);
document.onmousemove = null;
... | [
0.033031564205884933,
-0.5438583493232727,
1.0044282674789429,
-0.26492857933044434,
0.5872665643692017,
0.000889922259375453,
0.3943721652030945,
-0.36279967427253723,
-0.22125458717346191,
-0.4024485945701599,
-0.29352036118507385,
0.8447490930557251,
-0.27484261989593506,
0.062026325613... | |
|| Math.abs(mouseY - mouseTop) > monitor.moveLimit)
{
monitor.slowSamples = 0;
}
else if (++monitor.slowSamples > monitor.sampleLimit) {
showTooltip();
return;
}
mouseLeft = mouseX;
mouseTop = mouseY;
monitor.timer = setTimeout("monitorMouse()",monitor.timerDelay);
}... | [
-0.02699136734008789,
-0.22913318872451782,
0.6012516617774963,
-0.41794541478157043,
0.4824669063091278,
0.05453368276357651,
0.3442530930042267,
-0.4562300741672516,
-0.2556362450122833,
-0.3795942962169647,
-0.2985419034957886,
0.5265513062477112,
-0.3238048553466797,
-0.033830832690000... | |
i run Apache web server on windows in order to work on some Perl CGI scripts. in production these scripts run on a linux box, and in the source code repository they all have shebangs like: `#!/usr/bin/perl`, but on my windows machine the shebangs would be `#!c:\perl\bin\perl.exe`, so i have a conflict with the source c... | [
0.4462510645389557,
0.20764771103858948,
0.2835272550582886,
-0.19608044624328613,
-0.28653761744499207,
-0.37327948212623596,
0.6663475632667542,
-0.17493991553783417,
-0.15053077042102814,
-0.4099174737930298,
-0.03136967122554779,
0.375627338886261,
-0.34196707606315613,
0.2404640167951... | |
.cgi
3. edited my registry and added a new String to
> ```
> HKEY_CLASSES_ROOT\.cgi\Shell\ExecCGI\Command=C:\Perl\bin\perl.exe
>
> ```
now, i know that CGIs work on this server as long as they have the right shebang.
but when i try to access a CGI without a shebang the apache log spits out:
> No Exec CGI Verb fo... | [
0.11636334657669067,
0.005392998922616243,
0.29526466131210327,
-0.2238943725824356,
-0.538148045539856,
-0.16931883990764618,
0.4300423860549927,
-0.13760021328926086,
-0.4156974256038666,
-0.38061025738716125,
-0.28773343563079834,
0.48557719588279724,
-0.36462825536727905,
-0.0304288864... | |
slightly different location for the registry key:
```
HKEY_CLASSES_ROOT\.cgi\Shell\ExecCGI\Command\(Default) => C:\Perl\bin\perl.exe -wT
``` | [
-0.13803929090499878,
-0.014005213975906372,
0.32883018255233765,
0.002178468741476536,
0.32574209570884705,
0.3318367004394531,
0.04865243285894394,
-0.13309070467948914,
-0.20675702393054962,
-0.3816011846065521,
0.009773077443242073,
0.19817574322223663,
-0.06045711413025856,
0.46121811... | |
Is there a way to modify/tell dired to copy files asynchronously? If you mark multiple files in dired and then use 'C' to copy them, emacs locks up until every file is copied. I instead want this copy to be started, and for me to continue editing as it goes on in the background. Is there a way to get this behaviour?
E... | [
0.6274843215942383,
0.31200525164604187,
0.2227948158979416,
-0.09629138559103012,
0.11291894316673279,
0.08745112270116806,
0.18350936472415924,
0.1548270434141159,
-0.46765026450157166,
-0.31901732087135315,
-0.25889620184898376,
0.5437276363372803,
-0.518274188041687,
0.2897883057594299... | |
copy.
However, there is a dired command "[dired-do-shell-command](http://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-Commands-in-Dired.html)" which calls out to a shell to do the work in the background. If you select the files you want to copy and then use key '!' (this runs dired-do-shell-command) then t... | [
0.5501608848571777,
0.3828940987586975,
0.1974787563085556,
0.04110720381140709,
0.5092349052429199,
-0.13171733915805817,
-0.129446879029274,
-0.09630278497934341,
-0.2906571328639984,
-0.48877522349357605,
-0.2182466983795166,
0.9962039589881897,
-0.38884660601615906,
0.17693360149860382... | |
I have one class that needs to grab an attribute that is set in another. It's not a standard data type though. Here's the code;
```
class graphics:
def __init__(self, Fullscreen = False, Width = 640, Height = 480):
print "Graphics Init"
SCREEN_SIZE = (Width, Height)
pygame.init()
if Fullscreen:
... | [
-0.03636765107512474,
-0.06436562538146973,
0.4835151433944702,
-0.04113302379846573,
0.032931629568338394,
0.2791402041912079,
0.07961754500865936,
-0.2574172616004944,
-0.15408335626125336,
-0.8468038439750671,
-0.11867821216583252,
0.6176573038101196,
-0.06313060969114304,
0.01805112510... | |
print "Non-Fullscreen Initialized"
```
What I need to do is reference the screen attribute, which I can set with self.screen and be readable within that class...but from another class I have to set
```
screen = ?
```
under
```
class graphics:
```
What does that question mark need to be? I've tried 0, None, ""..... | [
-0.07509593665599823,
0.15026640892028809,
0.5503485202789307,
-0.02526436559855938,
-0.07381235808134079,
0.20261447131633759,
0.08724112063646317,
-0.017678435891866684,
-0.2970033586025238,
-0.6287877559661865,
-0.19722557067871094,
0.6741225719451904,
-0.10895096510648727,
-0.034253459... | |
print "Graphics Init"
self.SCREEN_SIZE = (Width, Height)
pygame.init()
if Fullscreen:
self.screen = pygame.display.set_mode(SCREEN_SIZE, FULLSCREEN, 32)
print "Fullscreen Initialized"
else:
self.screen = pygame.display.set_mode(SCREEN_SIZE, 0, 32)
print "Non-Fullscreen In... | [
-0.3077127933502197,
-0.024316463619470596,
0.6035642027854919,
-0.0028108868282288313,
-0.3069525361061096,
0.40643224120140076,
0.1329224407672882,
-0.15699125826358795,
-0.18134070932865143,
-0.6793162226676941,
-0.2511177659034729,
0.6358301043510437,
-0.29161858558654785,
-0.142075598... | |
(`g`) from our class (`Graphics`). We don't reference the class very often at all. Almost the only time a class name is used is to create object instances (`Graphics()`). We rarely say `Graphics.this` or `Graphics.that` to refer to attributes of the class itself. | [
0.14000451564788818,
0.20242507755756378,
0.039378341287374496,
0.3849651515483856,
-0.4045284390449524,
-0.025904078036546707,
-0.07842572778463364,
0.4489379823207855,
-0.15160946547985077,
-0.8048270344734192,
-0.1979096680879593,
0.4772264063358307,
-0.13760752975940704,
0.382966905832... | |
Whenever I try to write graphical programs (whether a game or really any GUI app) I always wind up with one or two god classes with way too many methods (and long methods, too), and each class having far too many responsibilities. I have graphics being done at the same time as calculations and logic, and I feel like th... | [
0.4381897747516632,
0.5690993070602417,
-0.2220880389213562,
0.07207071036100388,
-0.3886866867542267,
0.15318575501441956,
0.26279416680336,
0.19566428661346436,
-0.14360180497169495,
-0.9199842214584351,
0.14016768336296082,
0.44310426712036133,
0.0014602794544771314,
-0.0915537178516388... | |
write a Minesweeper clone, just sort of as practice and to try to improve my software engineering skills. How would I go about making this nice and object-oriented? For the sake of discussion, let's just say I'm using Java (because I probably will, either that or C#). Here's some things I would think about:
* should e... | [
0.5408257246017456,
-0.07780386507511139,
0.2025437355041504,
0.04103961959481239,
-0.06185493245720863,
0.18516521155834198,
-0.007088820915669203,
0.16928596794605255,
-0.41056862473487854,
-0.6973748207092285,
0.4813345670700073,
0.4673769474029541,
-0.1610071212053299,
0.05068379640579... | |
itself?
* when the user clicks, do the tiles have mouse event listeners or does some other collision detection method loop through the tiles and check each one to see if it's been hit?
I realize that there's not just one way to write a GUI application, but what are some pretty basic things I can start doing to make my... | [
0.4470313489437103,
0.04345165938138962,
0.3267400860786438,
-0.06690520793199539,
-0.21805280447006226,
0.04517313838005066,
0.2922106683254242,
-0.0617438405752182,
-0.16482067108154297,
-0.35811862349510193,
0.2289469838142395,
0.4696718156337738,
-0.10501518100500107,
-0.04048434644937... | |
myself into MVC if that's not necessarily what I need. I did searched for topics on MVC with GUI apps but didn't really find anything that answers my specific question.
---
edit2: Thanks to everyone who answered. I wish I could accept more than one answer..
Here is a simple (but effective) OO design to get you start... | [
0.41137710213661194,
0.1374073624610901,
0.17880195379257202,
0.008669640868902206,
-0.019697057083249092,
-0.15089194476604462,
0.10434898734092712,
-0.2828283905982971,
-0.2446085661649704,
-0.5463322997093201,
0.0519515685737133,
0.5028745532035828,
0.015639271587133408,
0.0256591886281... | |
keeps track of "Number of turns", "Score" etc. You will also need a Timer object to keep track of the game time.
Then create a separate UI object that doesn't know anything about the Game object. It is completely stand alone and completely platform dependent. It has its own UIBoard, UITile, UITimer etc. and can be tol... | [
0.03979320824146271,
-0.2113042026758194,
0.7356929183006287,
0.5609152317047119,
0.19559958577156067,
-0.16677337884902954,
-0.005829447880387306,
-0.2224547266960144,
0.005525071639567614,
-0.6939834952354431,
-0.23452921211719513,
0.5513098239898682,
0.09359380602836609,
-0.153126940131... | |
on the input, is notified by the Game about state changes and then turns around and tells the UI how to update itself.
This is (by the way) an adaption of the MVP (Model, View, Presenter) pattern. And (oh by the way) the MVP pattern is really just a specialization of the Mediator pattern. And (another oh by the way) t... | [
-0.040353577584028244,
-0.13257595896720886,
0.7714837789535522,
0.23357422649860382,
-0.02001381479203701,
-0.2655462324619293,
-0.038401518017053604,
0.1189209520816803,
-0.5676308274269104,
-0.646862804889679,
-0.010764561593532562,
0.5602142810821533,
-0.10264566540718079,
0.1020043715... | |
I'm trying to include JQuery in my DotNetNuke skin by adding these two lines of code at the top of my DNN skin:
```
<%
Page.ClientScript.RegisterClientScriptInclude("jquery", "http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js")
Page.ClientScript.RegisterStartupScript(Me.GetT... | [
-0.0028895793948322535,
0.13686613738536835,
0.7099583148956299,
-0.08854874223470688,
-0.18273167312145233,
0.12857624888420105,
0.22230839729309082,
0.23705792427062988,
-0.16020068526268005,
-1.058532953262329,
0.07465216517448425,
0.6314806938171387,
0.012887418270111084,
0.04978632926... | |
is to make sure you put it in the Page\_Load() method, and not the page rendering code itself. I suppose I was too late in the page lifecycle to do what I'd wanted to do.
```
<script runat="server">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Page.C... | [
-0.3546297550201416,
0.06186226010322571,
0.8624774813652039,
-0.22277459502220154,
-0.1691102832555771,
0.05957941710948944,
0.0916670486330986,
-0.2445419728755951,
-0.12327735126018524,
-0.7197739481925964,
-0.1311253309249878,
0.5025652050971985,
-0.3063579499721527,
-0.126803979277610... | |
As described before, [I work in IT consultancy and move through various customer environments](https://stackoverflow.com/questions/30824/book-on-system-archaeology). It is natural to encounter a variety of security policies, and in most environments we have had to go through a security checklist before authorizating ou... | [
0.22632049024105072,
0.37541675567626953,
0.04618974030017853,
0.05852716788649559,
0.5363944172859192,
-0.10811416804790497,
-0.029428238049149513,
-0.0056441063061356544,
-0.3341393768787384,
-0.3850112855434418,
-0.3474278748035431,
0.6194351315498352,
0.25608330965042114,
0.21447825431... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.