text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
End Using
End Using
```
are both showing as mostly red, I'm running a clean install of MS VS2005 and these codes were both recomended to me, am I missing something else I need to install or declare?
for vb6.0 you need
```
Dim value As String = My.Computer.FileSystem.ReadAllText(file)
``` | [
0.3724130690097809,
0.021392961964011192,
0.5768452882766724,
-0.06331445276737213,
0.233073890209198,
-0.16309426724910736,
0.3517381548881531,
-0.21815164387226105,
-0.2603079080581665,
-0.5780568718910217,
-0.05174023285508156,
0.6841768622398376,
-0.3044792711734772,
0.3962749242782593... | |
This is related to some other questions, such as: [this](https://stackoverflow.com/questions/34987/how-to-declare-an-array-of-strings-in-c), and some of my other questions.
In [this question](https://stackoverflow.com/questions/34987/how-to-declare-an-array-of-strings-in-c), and others, we see we can declare and initi... | [
0.13973471522331238,
-0.15752704441547394,
-0.018956465646624565,
-0.1365547776222229,
-0.10851767659187317,
-0.14172400534152985,
0.0162908174097538,
-0.22616127133369446,
-0.38183480501174927,
-0.5348696112632751,
-0.10847442597150803,
0.4541204571723938,
-0.1877979189157486,
-0.07357262... | |
const mStringData[] = {"Name1", "Name2", "Name3", ... "NameX"};
public:
DataProvider();
~DataProvider();
char* GetData()
{
int index = GetCurrentIndex(); //work out the index based on some other data
return mStringData[index]; //error checking and what have you omitted
}
};
```
... | [
-0.2687486410140991,
-0.20612294971942902,
0.28761595487594604,
-0.09241417050361633,
0.026428479701280594,
0.08908063173294067,
0.2997468113899231,
-0.2473052591085434,
-0.0770721510052681,
-0.399259477853775,
-0.338748037815094,
0.6613496541976929,
-0.4733498692512512,
-0.012376410886645... | |
the keyword static and external initialization to make the array a static member of the class:
In the header file:
```
class DataProvider : public SomethingElse
{
static const char* const mStringData[];
public:
DataProvider();
~DataProvider();
const char* const GetData()
{
int index = Ge... | [
-0.13258731365203857,
-0.15233740210533142,
0.3609633445739746,
-0.12375787645578384,
0.07353147864341736,
0.13697874546051025,
0.09702460467815399,
-0.1662367433309555,
-0.2879221737384796,
-0.33215001225471497,
-0.49235713481903076,
0.47472918033599854,
-0.2783729135990143,
0.17331549525... | |
... "NameX"};
``` | [
-0.14394237101078033,
0.20971991121768951,
0.13882915675640106,
-0.3171476721763611,
0.3169656991958618,
-0.00933945830911398,
-0.09948351979255676,
0.35849130153656006,
0.07620818167924881,
-0.4522688388824463,
-0.44165313243865967,
0.43396618962287903,
-0.5083571076393127,
0.312372118234... | |
If you have a sequence of block elements and you wanted to place margin in between them.
Which do you prefer, margin-top or margin-bottom or both? Why?
I always use `margin-bottom`, which means there is no unnecessary space before the first element. | [
-0.03329847753047943,
0.24853232502937317,
0.12147115170955658,
-0.05099543184041977,
-0.06555471569299698,
0.08084423094987869,
-0.205160990357399,
-0.11392387747764587,
-0.09784729778766632,
-0.7097604274749756,
0.14366121590137482,
0.08478450775146484,
0.1162107065320015,
-0.09509994089... | |
I'm looking for a library to read a SWF file and let me parse through its actionscript and header information. Is there anything out there that will work?
I ended up finding one at:
<http://sourceforge.net/projects/swfdotnet/> | [
0.7403841614723206,
-0.17376790940761566,
0.18553167581558228,
0.0961788222193718,
0.058255888521671295,
0.035337626934051514,
0.25746971368789673,
0.19864575564861298,
-0.42393437027931213,
-0.7496947050094604,
0.2000959813594818,
0.023239804431796074,
-0.01698015071451664,
-0.08285840600... | |
My project requires a file where I will store key/value pair data that should be able to be read and modified by the user. I want the program to just expect the keys to be there, and I want to parse them from the file as quickly as possible.
I could store them in XML, but XML is way to complex, and it would require tr... | [
0.4002011716365814,
0.35073578357696533,
-0.08743846416473389,
0.08285300433635712,
0.2783701717853546,
-0.01541841495782137,
0.2364765852689743,
-0.24716782569885254,
0.14777803421020508,
-0.6279985904693604,
-0.037951454520225525,
0.4397759437561035,
-0.262154757976532,
0.165940076112747... | |
with as little code as possible.
I could code a class like that myself, but I'd rather learn how it's don'e in the framework than inventing the wheel twice. Are there some built in magic class in .NET (3.5) that are able to do so?
```
MagicClass kv = new MagicClass("Settings.ini"); // It doesn't neccesarily have to b... | [
-0.016782639548182487,
-0.05498872324824333,
0.3857702612876892,
0.2612306773662567,
0.06297176331281662,
-0.04939362406730652,
0.07176988571882248,
-0.39230290055274963,
-0.2706988453865051,
-0.642303466796875,
0.010510185733437538,
0.7601113319396973,
0.2006770670413971,
0.11181053519248... | |
about traversing nodes. Calling the Deserialize function will do that for you. The user could edit the values in the file if they wish also. | [
0.5158634185791016,
-0.1630307137966156,
-0.12145515531301498,
0.41176170110702515,
0.24960747361183167,
-0.1420675367116928,
0.44002366065979004,
0.059974949806928635,
-0.33338725566864014,
-0.7015172243118286,
0.24196302890777588,
0.702400803565979,
-0.23083829879760742,
0.02293349616229... | |
I am trying to gain a better understanding of tcp/ip sockets in c#, as i want to challenge myself to see if i can create a working MMO infrastructure (game world, map, players, etc) purely for educational purposes as i have no intention of being another one of those "OMGZ iz gonna make my r0x0r MMORPG that will be bett... | [
0.6051035523414612,
0.5027541518211365,
0.08343692123889923,
0.2570238411426544,
-0.11157285422086716,
-0.2273780107498169,
-0.12554332613945007,
0.602310061454773,
-0.31103163957595825,
-0.4801875054836273,
-0.08354225754737854,
0.675110936164856,
0.09350688010454178,
0.2744501829147339,
... | |
out for?
My initial idea was to break up the system into seperate client/server connections with each connection (on its own port) performing a specific task, such as updating player/monster positions, sending and receiving chat messages, etc. which to me would make processing the data easier because you wouldn't alwa... | [
0.6921749711036682,
-0.31647080183029175,
0.05796925351023674,
0.0883367732167244,
-0.18644732236862183,
0.28037235140800476,
-0.08703628182411194,
-0.2628433108329773,
-0.2772805094718933,
-0.32355716824531555,
0.22423066198825836,
0.46414366364479065,
-0.615414023399353,
0.16222132742404... | |
message type, you still need to have a header of some sort. Even if it is just the length of the rest of the message. Having said that it is easy to add a simple header and tail structure to a message. I would think it is easier to only have to deal with one port on the client side.
I believe the modern MMORPGs (and m... | [
0.3630390167236328,
-0.11296388506889343,
0.35302749276161194,
0.27104470133781433,
-0.24884137511253357,
-0.21401047706604004,
-0.11634057760238647,
0.2068198174238205,
-0.6123411059379578,
-0.3153345584869385,
-0.07926107197999954,
0.4257262051105499,
-0.16823667287826538,
0.219056174159... | |
world information. Even so this still only requires the client to have one socket open, but does not disallow having more.
Additionally most MMORPGS also encrypt all their data. If you are writing this as an exercise for fun, then this will not matter so much.
For designing/writing protocols in general here are the t... | [
0.14247868955135345,
0.17014387249946594,
0.439577579498291,
0.24063216149806976,
-0.2349662184715271,
-0.17102985084056854,
0.2550739049911499,
0.2609170973300934,
-0.32483598589897156,
-0.6255491375923157,
0.08118990808725357,
0.6115362048149109,
-0.15273024141788483,
0.2412228286266327,... | |
This is what the older protocols did/do hence the term network order which was always big endian. It doesn't actually matter which endianess you specify just that you specify one or the other. Some crusty old network programmers will get up in arms if you don't use big endianess, but if your servers and most clients ar... | [
-0.02564440853893757,
0.003850943176075816,
0.32432082295417786,
-0.00043614572496153414,
-0.2839880585670471,
-0.4111167788505554,
0.32176849246025085,
0.05077536404132843,
-0.3398832380771637,
-0.45705875754356384,
0.08270134031772614,
0.23072417080402374,
-0.3425455689430237,
0.29074066... | |
be converted accordingly as needed. Extra work!
4. Make your protocol agnostic - If you send everything as ASCII strings, then endianess is irrelevant, but also a lot more inefficient.
Of the 4 I would usually choose 2, and specify the endianess to be that of the majority of the clients, which now days will be little ... | [
0.1555900275707245,
0.11108706891536713,
0.6096376776695251,
0.010370137169957161,
-0.19192849099636078,
0.055115919560194016,
0.295462965965271,
-0.3718125522136688,
-0.1666937619447708,
-0.6257234215736389,
-0.1346757560968399,
0.5520052909851074,
-0.23482738435268402,
0.0119061153382062... | |
handle minor changes that really shouldn't be part of the versioning. You can punt on this and use XML, but you lose a lot of efficiency.
For the overall versioning I usually design something simple. The client sends a versioning message specifying that it speaks version X.Y, as long as the server can support that ve... | [
0.014909681864082813,
0.09482109546661377,
0.7414780855178833,
-0.11355209350585938,
-0.08052011579275131,
-0.04559182748198509,
0.42334479093551636,
0.04099553823471069,
-0.5625700950622559,
-0.5807186365127563,
-0.0850081816315651,
0.6519989967346191,
-0.3063167929649353,
0.2898707389831... | |
bytes) | Msg (length - 6 bytes) |
+-------------------------+-------------------+-----------------+------------------------+
```
The length obviously tells you how long the message is, not including the length itself. The MsgType is the type of the message. Only two bytes for this, since 65356 is plenty of messages t... | [
-0.13060761988162994,
-0.13367262482643127,
0.8201682567596436,
-0.02841436304152012,
0.003422053065150976,
0.09987405687570572,
0.17468732595443726,
-0.09735286980867386,
-0.38226205110549927,
-0.5362453460693359,
-0.2875441610813141,
0.3612244725227356,
-0.37451520562171936,
0.2570017874... | |
your deserialization code can do something like the following:
```
uint32 length = MessageBuffer.ReadUint32();
uint32 start = MessageBuffer.CurrentOffset();
uint16 msgType = MessageBuffer.ReadUint16();
uint32 flags = MessageBuffer.ReadUint32();
if (flags & FLAG_0)
{
// Read out whatever FLAG_0 represents.
// ... | [
0.3456357419490814,
-0.3032574951648712,
0.38905876874923706,
-0.024174530059099197,
-0.055156633257865906,
0.0029887910932302475,
0.5476536154747009,
-0.7137241363525391,
-0.35401150584220886,
-0.930629551410675,
-0.1268128901720047,
0.628803014755249,
-0.3239814341068268,
0.4161987900733... | |
protocol version.
**Use a Frame Work or Not**
There are various network frameworks I would consider using for a business application. Unless I had a specific need to scratch I would go with a standard framework. In your case you want to learn socket level programming, so this is a question already answered for you.
... | [
0.6794010996818542,
-0.07337208092212677,
0.24158743023872375,
0.05222272127866745,
-0.2790910303592682,
-0.5016546249389648,
0.42786040902137756,
-0.18018296360969543,
-0.35346224904060364,
-0.7886112332344055,
0.08063572645187378,
0.3521672785282135,
-0.5202566981315613,
-0.1071589812636... | |
server/client you need to communicate with. This implies a few scenarios:
* They already have a protocol defined - Simply use their protocol.
* You already have a protocol defined (and they are willing to use it) - again simple use the defined protocol
* They use a standard Framework (WSDL based, etc) - Use the framew... | [
0.09596767276525497,
-0.1963461935520172,
0.6356386542320251,
0.21792364120483398,
-0.15168873965740204,
-0.1689172089099884,
0.27589598298072815,
-0.019423948600888252,
-0.4018823206424713,
-0.7857030034065247,
-0.00390377314761281,
0.5048878192901611,
-0.10950767248868942,
0.036621205508... | |
agree on and understand the protocol. From experience this can be painful or pleasant. It depends on who you are working with.
In either case you will not be working with a third party, so this is really just added for completeness.
I feel as if I could write much more about this, but it is already rather lengthy. I ... | [
0.276883065700531,
0.17309953272342682,
0.44981199502944946,
-0.07655072212219238,
-0.07285670936107635,
-0.4313252866268158,
0.1260896921157837,
-0.6004558801651001,
0.09585428237915039,
-0.7264962792396545,
0.19102028012275696,
0.387773334980011,
-0.23734819889068604,
-0.2529062032699585... | |
When I compile an application with VS2008 I sometimes end up with 2 identical config files:
* \*.exe.config
* \*.vshost.exe.config
What is the latter one for?
Here's a blog post that talks about the vshost process and its purpose.
<http://blogs.msdn.com/dtemp/archive/2004/08/17/215764.aspx> | [
0.33096709847450256,
-0.04268321022391319,
0.41989096999168396,
0.11386864632368088,
-0.07855837792158127,
-0.01981133222579956,
0.39746204018592834,
-0.1867496222257614,
-0.40334242582321167,
-0.8096458315849304,
0.10532131046056747,
0.6519742608070374,
-0.21254649758338928,
0.08225735276... | |
We have a few SGI Onyx 350 and Orgin 350 systems running IRIX 6.5.x that we would like to install Subversion on. One of them will likely be used as a simple repository server running svnserve. The others will only need client installs.
The Subversion webpage has links to unofficial binaries for many \*NIX systems, inc... | [
0.5864340662956238,
-0.12483884394168854,
-0.022693010047078133,
0.2774946689605713,
-0.47039663791656494,
-0.1507769674062729,
0.17110711336135864,
0.3848356306552887,
-0.19850638508796692,
-0.47245603799819946,
0.05139508843421936,
0.1269153654575348,
-0.5984499454498291,
0.2501573264598... | |
systems? How hard is it to track down all of the dependencies? Are there any caveats we should be aware of?
For a machine like yours, the source code build is probably the way to go(it's one of the advantages of having source). The dependencies aren't that bad. The dependencies are [zlib](http://www.zlib.net/), the [Ap... | [
0.24672996997833252,
0.19204849004745483,
0.4127678871154785,
0.03340359777212143,
0.2737296521663666,
0.041214101016521454,
0.01970590278506279,
-0.08103375881910324,
-0.24725820124149323,
-0.5004806518554688,
-0.21104583144187927,
0.7465693354606628,
-0.4200587868690491,
-0.1351232081651... | |
I want to write a small program that should print something like
> testing CPU... done
>
> testing RAM... done
and so on.
I wrote the following program in C:
```
printf( "testing RAM...\t\t" );
sleep( sleep_time );
printf( "done\n\n" );
printf( "testing HDD...\t\t" );
sleep( sleep_time );
printf( "done\n\n" );... | [
0.6258279085159302,
0.40528854727745056,
-0.03033125028014183,
-0.24341991543769836,
0.16618086397647858,
0.1042662039399147,
0.24342793226242065,
-0.17027489840984344,
0.08183082938194275,
-0.7840738892555237,
-0.000830517616122961,
0.7070391178131104,
-0.17538470029830933,
-0.13791765272... | |
XCode 3.1 on OSX 10.5.6
Thank you,
Bastian
The issue is that your printings are buffered. immediately before sleeping, call fflush(stdout); to flush the buffer | [
0.3321380317211151,
0.30976247787475586,
0.6680922508239746,
-0.11939526349306107,
0.04693783074617386,
-0.2408309429883957,
0.41324567794799805,
0.0626978874206543,
-0.16378623247146606,
-0.8595821261405945,
-0.20798775553703308,
0.4248623251914978,
-0.633048415184021,
-0.2160266637802124... | |
I'm working on a Linux machine through SSH (Putty). I need to leave a process running during the night, so I thought I could do that by starting the process in background (with an ampersand at the end of the command) and redirecting stdout to a file.
To my surprise, that doesn't work. As soon as I close the Putty wind... | [
0.31655246019363403,
0.11956723034381866,
0.5740802884101868,
-0.15158367156982422,
0.1827397495508194,
-0.1945791393518448,
0.5311263799667358,
0.3933536410331726,
-0.40145567059516907,
-0.5187578797340393,
-0.3750033676624298,
0.6017754077911377,
-0.08571061491966248,
0.6289513111114502,... | |
Is there a way to write log4j logging events to a log file that is also being written to by other applications. The other applications could be non-java applications. What are the drawbacks? Locking issues? Formatting?
Log4j has a SocketAppender, which will send events to a service, which you can implement yourself or ... | [
0.2013440579175949,
-0.19118593633174896,
-0.05054153501987457,
0.25349903106689453,
-0.20521396398544312,
-0.28907182812690735,
0.27121707797050476,
0.09738098084926605,
-0.36468446254730225,
-0.6417726874351501,
-0.11641711741685867,
0.547348141670227,
-0.41365355253219604,
-0.3811867535... | |
than trying to coordinate a consistent locking strategy among diverse logging applications. | [
-0.21806837618350983,
-0.03453342244029045,
-0.17271587252616882,
0.4512579143047333,
-0.10094072669744492,
-0.5265082120895386,
-0.18439622223377228,
-0.30804553627967834,
-0.20693498849868774,
-0.5074276328086853,
0.20885296165943146,
0.5094193816184998,
-0.16897828876972198,
-0.15740360... | |
Given a week-day (1-7), how can I calculate what that week-day's last date was?
**Example:** Today is **Wednesday**, 2008/11/12, and I want to know what last **Friday's** date was.
If `today` is the current day of the week, then you can use something like:
```
days_since_friday = (((today - 1) + 7) - (6 - 1)) % 7
``... | [
0.2526651620864868,
-0.16890758275985718,
0.6164877414703369,
-0.16486528515815735,
-0.12982118129730225,
0.09991208463907242,
0.32732734084129333,
0.17977140843868256,
-0.5645970702171326,
-0.39033833146095276,
-0.15626536309719086,
0.46804457902908325,
-0.010370378382503986,
0.5988185405... | |
If your day-of-week started at 0 for Sunday, it simplifies to:
```
days_since_friday = ((today + 7) - 5) % 7
```
or
```
days_since_friday = (today + 2) % 7
``` | [
0.13718467950820923,
-0.18687669932842255,
0.6131776571273804,
-0.17902331054210663,
-0.03892165794968605,
0.24407939612865448,
0.20441500842571259,
0.25331902503967285,
-0.35123786330223083,
-0.41863587498664856,
-0.26701945066452026,
0.7726148366928101,
-0.2178279459476471,
0.20668642222... | |
I've done a good bit of research to find an upload component for .NET that I can use to upload large files, has a progress bar, and can resume the upload of large files. I've come across some components like [AjaxUploader](http://ajaxuploader.com), [SlickUpload](http://krystalware.com/products/slickupload/Default.aspx)... | [
0.16532891988754272,
-0.21221567690372467,
0.2074071764945984,
0.08559463173151016,
0.13333506882190704,
-0.21702146530151367,
0.09952576458454132,
-0.07300517708063126,
-0.2829359769821167,
-0.3465583622455597,
0.004198354668915272,
0.8823863863945007,
0.2343616783618927,
-0.4540832042694... | |
a file upload on the client without using flash/java/Silverlight?
2. Does anyone have some code or a link to an article that explains how to write a .NET HTTPHandler that will allow streaming upload and an ajax progress bar?
Thank you,
Austin
**[Edit]**
I realized I do need to be able to do resumable file uploads... | [
0.281121164560318,
-0.001413140562362969,
0.2917799651622772,
0.24827846884727478,
-0.11885089427232742,
-0.481189101934433,
0.32234352827072144,
-0.007104917429387569,
-0.46774429082870483,
-0.5077576637268066,
-0.10495191067457199,
0.7936394810676575,
-0.08710812032222748,
-0.19182597100... | |
you'd still need to use something else like FTP on the server.
I've "solved" this problem in the past by writing a custom client application in C# which broke the file down into small chunks (2meg), transmitted those separately, and then the server combines them all back together.
> 2) Does anyone have some code or... | [
0.4448797106742859,
-0.15105241537094116,
0.1693439930677414,
0.11506325006484985,
-0.05091013386845589,
-0.28775861859321594,
0.1439434438943863,
0.12504306435585022,
-0.40471723675727844,
-0.7203841209411621,
0.03819134086370468,
0.7516654133796692,
-0.00026332310517318547,
-0.4317444264... | |
file browser (where you can prompt the user for only jpeg files, etc) and upload progress tracking, all without needing to modify your server at all. | [
0.20607587695121765,
-0.05093853175640106,
0.4736405313014984,
0.3164059817790985,
-0.14591266214847565,
-0.22718776762485504,
0.2117796540260315,
0.153518944978714,
-0.24379384517669678,
-0.874142587184906,
-0.32431328296661377,
0.39723706245422363,
-0.17946015298366547,
-0.03955508768558... | |
I'm trying to duplicate the effect used in the Firefox search box where, if the search field does not have focus ( the user has not clicked inside of it ), it just says *Google* in gray text. Then, when the user clicks in the box, the text is removed and they can fill in their search term.
I want to use this to provid... | [
0.6845710873603821,
0.18314942717552185,
0.15748544037342072,
-0.0013088540872558951,
0.019437896087765694,
-0.46930980682373047,
0.12507891654968262,
0.17708615958690643,
-0.26503705978393555,
-0.496481716632843,
-0.023975729942321777,
0.49082502722740173,
-0.7261358499526978,
0.209542036... | |
input #normal { color: #OOO; }
</style>
<script type='text/javascript'>
function addTextHint(elem, hintText)
{
if (elem.value == '')
{
elem.value = hintText;
elem.style.className = 'ghost';
} | [
-0.23560121655464172,
-0.25291478633880615,
0.5732590556144714,
-0.24396666884422302,
0.23656517267227173,
0.02776404283940792,
0.4883505403995514,
-0.13490751385688782,
0.2581605315208435,
-0.5289431810379028,
-0.547225296497345,
0.47311916947364807,
-0.45039305090904236,
-0.1782980561256... | |
elem.onfocus = function ()
{
if (elem.value == hintText)
{
elem.value = '';
elem.className = 'normal'; | [
-0.347383975982666,
-0.317880243062973,
0.5303750038146973,
-0.3389173448085785,
0.7117919325828552,
0.12644892930984497,
0.535585343837738,
-0.28893041610717773,
0.4032838046550751,
-0.5332295298576355,
-0.8040317296981812,
0.7500288486480713,
-0.3127458691596985,
0.0593562126159668,
0.... | |
}
}
elem.onblur = function ()
{
if (elem.value == '')
{
elem.value = hintText;
elem.className = 'ghost'; | [
-0.3271925449371338,
-0.16347777843475342,
0.433157742023468,
-0.3131278157234192,
0.6443602442741394,
0.08596924692392349,
0.6801409721374512,
-0.2321603000164032,
0.2880895733833313,
-0.3075884282588959,
-0.49648749828338623,
0.5841585993766785,
-0.29754388332366943,
0.2970225214958191,
... | |
}
}
}
addTextHint(document.getElementById('foobar'),'Google');
</script>
```
Just whipped this up for you. jQuery would make it smaller I'm sure, but I don't use it. | [
0.13775236904621124,
0.20194505155086517,
0.31914281845092773,
-0.2527124285697937,
0.11737638711929321,
-0.22301191091537476,
0.3144940733909607,
0.2199794203042984,
0.085972361266613,
-0.5924454927444458,
-0.009896846488118172,
0.6453893780708313,
-0.2779102921485901,
0.02198944240808487... | |
I'm mostly a .Net person at the moment, but I've been playing with Java some lately-- exploring what's out there.
Now I'm looking for the Java equivalent for WPF. I know I could find an OpenGL library or two out there, but that's not really as rich or simple as the WPF system.
I think a combination of JavaFX, Swing, J... | [
0.775933027267456,
-0.04556901007890701,
0.2953750789165497,
0.08010535687208176,
-0.2621324062347412,
-0.06388437747955322,
-0.033799707889556885,
-0.011938189156353474,
-0.21865792572498322,
-0.7699375748634338,
-0.20039497315883636,
0.708477258682251,
-0.20897875726222992,
-0.0912352055... | |
UI capabilities, and can be used in both Java and JavaFX
* Java2D, which provides the underpinnings for all drawing tasks (including Swing), takes advantage of hardware acceleration and DirectX support
* The JRE on the desktop or the browser enable Java applications to be deployed to multiple environments (including ot... | [
0.13739825785160065,
-0.20449087023735046,
0.48969772458076477,
0.08776750415563583,
-0.1578231155872345,
-0.017670124769210815,
-0.026142854243516922,
-0.07908007502555847,
-0.26578783988952637,
-1.1290158033370972,
-0.2561867833137512,
0.2886810600757599,
-0.09336963295936584,
-0.2696192... | |
I've written a rails app that follows the regular directory structure (model code in models, controller code in controllers).
But I'm now working on a new feature and for that I have written some (what I would call) "service" code.
The new feature is to import some data into the system, at the moment it's two class... | [
0.35917988419532776,
-0.1890680193901062,
0.24531492590904236,
0.15579478442668915,
0.15118014812469482,
0.03448370099067688,
0.2014002650976181,
0.05160175636410713,
-0.21270978450775146,
-0.7882980704307556,
0.2389860451221466,
0.33303454518318176,
-0.17724519968032837,
0.014237879775464... | |
presentation logic.
So, I've created a "app/services" directory and put it in there.
I've also created a "test/services" directory where I have put my tests.
All well and good I thought but when I run 'rake:test' or 'autotest' my new services tests are not run.
Now I expect there is a way to make rake pick them up... | [
0.24452964961528778,
0.0018708383431658149,
0.005080517381429672,
0.3544174134731293,
-0.17044149339199066,
0.11329369992017746,
0.6374366283416748,
0.046474117785692215,
-0.15383005142211914,
-0.7213965654373169,
0.390039324760437,
0.4144655466079712,
0.007828104309737682,
0.1372418254613... | |
rails had a solution already, but I was not aware of the convention.
Is this one of those cases?
This is what the 'lib' folder is for.
The lib folder is in the automatically looked up path, so you can have
```
class MyFoo
end
```
in `lib/my_foo.rb` and then just by calling
```
MyFoo.new
```
from a controller the... | [
0.03594426065683365,
-0.2102532833814621,
0.2045188844203949,
0.1938236802816391,
0.17528946697711945,
-0.31388789415359497,
0.018292948603630066,
0.17824165523052216,
-0.1870926469564438,
-0.5999534726142883,
0.07320940494537354,
0.6446130275726318,
-0.4345753490924835,
-0.115902446210384... | |
Is it possible to call a constructor from another (within the same class, not from a subclass)? If yes how? And what could be the best way to call another constructor (if there are several ways to do it)?
Yes, it is possible:
```
public class Foo {
private int x;
public Foo() {
this(1);
}
pub... | [
0.07434247434139252,
-0.17296786606311798,
-0.10576900094747543,
0.08612510561943054,
-0.12394032627344131,
-0.16639897227287292,
0.10646269470453262,
-0.11206342279911041,
-0.24890746176242828,
-0.20740489661693573,
-0.3260374367237091,
0.5742653012275696,
-0.596601128578186,
0.2188490331... | |
the same class, use `super` instead of `this`. Note that **you can only chain to one constructor**, and **it has to be the first statement in your constructor body**.
See also [this related question](https://stackoverflow.com/questions/284896), which is about C# but where the same principles apply. | [
0.3119119107723236,
-0.1328604817390442,
-0.11017673462629318,
0.09714319556951523,
-0.23829996585845947,
-0.5023390650749207,
0.2730897068977356,
-0.2052425891160965,
-0.5240139365196228,
-0.09390036016702652,
-0.46101298928260803,
0.5709171891212463,
-0.33295300602912903,
0.1123463585972... | |
I'm embedding an IE control into my C++ application. The problem is that although system-wide, ClearType is disabled, IE7 has its own separate setting, and unless I specifically disable that too, text inside the IE control will be antialiased while the rest of the app will not.
The same goes for IE7's font size settin... | [
0.04562155529856682,
0.0648767277598381,
0.3702324330806732,
0.08899196237325668,
-0.2430594116449356,
0.183637335896492,
0.3323747515678406,
-0.4619026482105255,
0.20070451498031616,
-0.5223580002784729,
-0.21628546714782715,
0.43518614768981934,
-0.3897974193096161,
-0.2824798822402954,
... | |
- <http://www.advancedintellect.com/product.aspx?mx>
We most likely will be going with one of them. Probably go with aspNetMx from Advanced Intellect (at least that is where I am leaning right now). The sample test on <http://www.aspnetmx.com/demo.aspx> worked for my email addresses (valid and not valid).
And will pr... | [
0.27758413553237915,
-0.18211407959461212,
0.051649171859025955,
0.5037603378295898,
-0.1285051703453064,
0.056007906794548035,
0.32181262969970703,
-0.4303992688655853,
0.12850120663642883,
-0.6333457231521606,
0.132730171084404,
0.583908200263977,
0.3334527611732483,
-0.24616827070713043... | |
We have a system where customers, mainly European enter texts (in UTF-8) that has to be distributed to different systems, most of them accepting UTF-8, but now we must also distribute the texts to a US system which only accepts US-Ascii 7-bit
So now we'll need to translate all European characters to the nearest US-Asc... | [
0.08628974109888077,
0.2819633185863495,
0.29984837770462036,
-0.03462768346071243,
0.11482475697994232,
0.3161688446998596,
0.3771609365940094,
0.16839444637298584,
-0.04697789251804352,
-0.5033747553825378,
-0.21292026340961456,
0.2002112865447998,
-0.1381179541349411,
-0.232455015182495... | |
and try and fix that for the next release, but it seems very inefficient and somebody else must have done something similair before.
The [uni2ascii](http://billposer.org/Software/uni2ascii.html) program is written in C, but you could probably convert it to Java with little effort. It contains a large table of approxima... | [
0.287051796913147,
0.09251782298088074,
0.0924207791686058,
-0.1373930275440216,
-0.07151439785957336,
0.02853534370660782,
0.45270127058029175,
0.019823923707008362,
-0.029026037082076073,
-0.3025268018245697,
-0.024058165028691292,
0.3631957471370697,
-0.33114174008369446,
-0.38549479842... | |
correct AA better. | [
0.14448732137680054,
0.39581143856048584,
0.007574563845992088,
-0.07507936656475067,
-0.31905144453048706,
0.027293523773550987,
0.5671928524971008,
-0.18155430257320404,
0.23515135049819946,
-0.300819456577301,
-0.006655743345618248,
0.6815420389175415,
0.05447925999760628,
-0.5273285508... | |
I maintain the build system at my company, which is currently using CVS. This build system is used across multiple projects and multiple CVS repositories.
Whenever we have a release milestone, we create a tag. In CVS, this is easy:
```
$ cvs tag TAG_NAME
```
That command works regardless of the CVS module or reposi... | [
0.7846208214759827,
0.298573762178421,
0.20825769007205963,
-0.23699721693992615,
-0.0066996607929468155,
-0.10994775593280792,
0.004425398539751768,
0.03605736047029495,
-0.23695001006126404,
-0.6084403395652771,
0.030018027871847153,
0.7597250938415527,
0.07956552505493164,
0.32506164908... | |
-m"Created tag TAG_NAME"
```
This of course assumes that the svn repository has the recommended "trunk, tags, branches" directory structure. So to be safe I'll probably need to verify this first.
That seems like a lot of work just to map a revision number to a symbolic name. Is there a better way?
Here is how I impl... | [
-0.06724835187196732,
0.11139491200447083,
0.6125996708869934,
-0.03751571476459503,
-0.052960846573114395,
-0.10393359512090683,
0.1484648585319519,
-0.2939314842224121,
-0.24603024125099182,
-0.36984190344810486,
-0.2015697956085205,
0.5751819014549255,
-0.2432136833667755,
0.18442195653... | |
<linecontains>
<contains value="Repository Root: "/>
</linecontains>
<tokenfilter>
<replacestring from="Repository Root: " to=""/>
</tokenfilter>
</outputfilterchain>
</redirector>
</exec>
<echo level="verbose" message="Root from | [
-0.300447940826416,
-0.3392607569694519,
0.4690200686454773,
-0.1689186543226242,
-0.24042025208473206,
0.3172741234302521,
0.4870849847793579,
-0.5105787515640259,
-0.0736418291926384,
-0.0541311651468277,
-0.5979262590408325,
0.12234671413898468,
-0.3439500033855438,
0.018114319071173668... | |
svn info: ${svninfo.out}"/>
<!-- Set the svn.root property from the svn info output, and append
the module prefix if it exists. The module prefix allows multiple
projects to use the same repository root. -->
<condition property="svn.root" value="${svninfo.out}/${svn.module.prefix}">
<isset property="svn.module.pre... | [
-0.010854125022888184,
-0.14849457144737244,
0.5775822997093201,
-0.27028778195381165,
0.07750078290700912,
0.031263917684555054,
0.4609276056289673,
-0.6038256883621216,
-0.23982970416545868,
-0.4830382168292999,
-0.3927508294582367,
0.6229295134544373,
-0.294270396232605,
-0.164591044187... | |
errorproperty="svn.ls.error">
<arg line="ls ${svn.root}/tags"/>
</exec>
<fail>
Cannot find 'tags' subdirectory.
${svn.ls.error}
The subversion repository is expected to have 'trunk', 'branches', and 'tags'
subdirectories. The tag '${tag}' will need to be manually created.
<condition>
<not>
... | [
-0.10960276424884796,
-0.06946757435798645,
0.40899458527565,
0.030107874423265457,
0.0695580393075943,
-0.05106668919324875,
0.38520586490631104,
-0.12499257922172546,
-0.3518955707550049,
-0.2703653872013092,
-0.32806310057640076,
0.5511724948883057,
-0.2801988422870636,
-0.2194293141365... | |
of the differences between CVS and subversion with respect to tagging, and that the subversion revision is, for all practical purposes, equivalent to the tag. Unfortunately, that is not really relevant; my users want a symbolic name composed of the module name and a (different) version number. | [
0.4296327829360962,
-0.12737517058849335,
0.3797050714492798,
-0.2530967593193054,
-0.18298818171024323,
-0.48573699593544006,
0.156491219997406,
0.12417591363191605,
-0.2735540270805359,
-0.07199022173881531,
-0.15518400073051453,
0.6471149325370789,
-0.30719348788261414,
0.09448099881410... | |
I have a number of string arrays. The string in every array are ordered the same way, according the same criteria. However, some string may be missing from some arrays, and there may be no array that has a complete set of strings. Moreover, the criteria used to compare the strings is not available to me: outside of the... | [
0.25075533986091614,
0.18639348447322845,
-0.15829305350780487,
0.1347806453704834,
-0.22892895340919495,
0.13908779621124268,
0.18966886401176453,
-0.30881404876708984,
-0.17534209787845612,
-0.6132654547691345,
-0.07250490039587021,
0.3995058238506317,
-0.1348816603422165,
0.200859814882... | |
with this kind of problem? What is the proper algorithm?
Examples:
```
A B D
A C D
```
Can't order correctly, can't decide the order of B and C
```
A B D
A B C
A C D
```
This has enough information to order ABCD correctly.
This sounds like a special case of the [topological sorting](http://en.wikipedia.org/wiki... | [
-0.042282771319150925,
0.004906214773654938,
-0.004796591121703386,
-0.13305529952049255,
-0.14352372288703918,
-0.16244594752788544,
-0.01211622729897499,
-0.23377983272075653,
-0.34122246503829956,
-0.6651606559753418,
-0.31114083528518677,
0.25955429673194885,
-0.6032949686050415,
0.163... | |
I have just started to look at .NET 3.5 so please forgive me if this type of question have been asked before. I am struggling with a decent usage for extension methods, in that I have just downloaded suteki shop an MVC ecommerce offering. In this project there is a pretty standard Repository pattern that extends IRepos... | [
0.09829772263765335,
-0.19353662431240082,
0.4446326792240143,
0.059829454869031906,
-0.3220611810684204,
-0.32584482431411743,
-0.05286749452352524,
-0.11328563839197159,
-0.22388529777526855,
-0.6110275387763977,
-0.27529212832450867,
0.5498769283294678,
-0.1790437251329422,
0.1542724817... | |
is all well and good, but Interfaces, as far as I am concerned act as contracts to the objects that implement them.
The fact that the repository has been interfaced out suggests an attempt at a data layer agnostic approach. That said, if I were to create my own data layer I would be confused as to what extension meth... | [
0.32063156366348267,
0.14768311381340027,
0.34745603799819946,
0.0553230382502079,
-0.04157238081097603,
-0.050275616347789764,
-0.046547193080186844,
0.08866231888532639,
-0.16254915297031403,
-0.4849936068058014,
0.11881891638040543,
0.6851489543914795,
0.03568248823285103,
0.12749373912... | |
visibility of what is required e.g.
```
ICategoryRepoitory : IRepository<Category>
{
Category GetRootCategory();
}
```
So I guess my question is does this use of Extention methods seem wrong to anyone else? If not, why? Should I not be moaning about this?
EDIT:
The above example does seem to be a good example... | [
0.2742864787578583,
0.06563486158847809,
0.34261634945869446,
0.0717901661992073,
-0.20892024040222168,
-0.39874109625816345,
0.09773100167512894,
-0.02605799026787281,
-0.26096898317337036,
-0.7560012340545654,
-0.0009144999785348773,
0.5562174916267395,
-0.15262471139431,
0.2534461021423... | |
in that assembly.
The point is that if you've implemented all of `IRepository<T>` appropriately, you (as the data layer implementor) don't have to know about root categories at all. For the scope of this extension method, it is assumed that any *repository* of categories will have a root category of ID 1. That may well... | [
0.3220888078212738,
-0.06718264520168304,
0.0009005516767501831,
0.07099326699972153,
-0.2126288264989853,
-0.18340718746185303,
0.1486576646566391,
-0.2747515141963959,
-0.3061906099319458,
-0.6038198471069336,
-0.26462775468826294,
0.4180179536342621,
-0.32384926080703735,
0.168542012572... | |
scope is appropriate - if it's in a namespace (or closely related one) where that assumption about root categories will be valid.
I don't think the "older" way would really be an interface extending `IRepository<Category>` - it would be a normal static method taking `IRepository<Category>`. That's where extension meth... | [
0.4610811769962311,
-0.1814076006412506,
0.18543896079063416,
0.23695234954357147,
-0.05164223909378052,
-0.46186500787734985,
0.08343445509672165,
-0.11366232484579086,
-0.2683313488960266,
-0.5403674840927124,
0.03725443780422211,
0.8385111093521118,
-0.24223998188972473,
0.1449444890022... | |
I'm building a tool that automates a process then runs some tests on it's own results then goes to do some other stuff.
In trying to clean up my code I have created a separate file that just has the test cases class. Now before I can run these tests, I have to pass the class a couple of parameters/objects before they ... | [
0.5790948271751404,
0.3286063075065613,
-0.06823579221963882,
0.08858542144298553,
-0.06320943683385849,
-0.061329275369644165,
0.3755825459957123,
-0.16855913400650024,
-0.16120585799217224,
-0.5836296677589417,
0.38895803689956665,
0.48883676528930664,
-0.2104836255311966,
0.348256617784... | |
but it feels "wrong" to use a temporary file for this. If anyone has a nicer solution that would be great!
\*\*\*\*\*\*\*\*\*\*\*\*\*\*Edit\*\*\*\*\*\*\*\*\*\*\*\*
Example Code of what I am doing right now:
```
#!/usr/bin/ruby
require 'test/unit/ui/console/testrunner'
require 'yaml'
require 'TS_SampleTestSuite'
aut... | [
0.29943981766700745,
0.1503930538892746,
0.38535940647125244,
0.23170214891433716,
-0.0849607065320015,
-0.5857375860214233,
0.170160710811615,
-0.42257803678512573,
-0.011630530469119549,
-0.6555351614952087,
-0.16863884031772614,
0.49360191822052,
-0.05254757031798363,
0.1294538527727127... | |
to index it for performance reasons.
### Answer:
5000 records is really not many at all, and regardless of whether you have an index, searches will still be fast. At that rate of inserts, it'll take you 3 years to get to 10000 records, which is still also not many.
I personally wouldn't bother with adding an index... | [
0.3623310625553131,
-0.10952862352132797,
0.30301856994628906,
0.4755879044532776,
0.10793212056159973,
0.011026157066226006,
0.2086620330810547,
-0.12576018273830414,
-0.41667690873146057,
-0.7155294418334961,
0.17953446507453918,
0.29362785816192627,
-0.02476644143462181,
-0.085684426128... | |
single row and read every single field. Adding an index prevents this.
The downside of the index is that each time data gets inserted, the DB has to update the index in addition to adding the data. This is usually a small overhead, but you'd really notice it if you had loads of indexes, and were doing a lot of writes.... | [
0.33788156509399414,
0.13142266869544983,
0.21738366782665253,
0.12678001821041107,
-0.061109934002161026,
-0.053539108484983444,
0.2757430374622345,
-0.2848125994205475,
-0.22619618475437164,
-0.6534952521324158,
-0.10840462148189545,
0.4464040994644165,
-0.22585763037204742,
0.2864356637... | |
on fields "just in case I need it" | [
0.7565130591392517,
0.06563874334096909,
-0.250125914812088,
-0.03374255821108818,
-0.07722111791372299,
0.2586362063884735,
0.19348113238811493,
0.3222942650318146,
-0.22124646604061127,
-0.2188064008951187,
-0.13599170744419098,
0.5921655893325806,
-0.4731290638446808,
-0.386971324682235... | |
I've got an SQL query that looks like this:
```
INSERT INTO DB..incident
(
incident_number --nvarchar(10)
)
VALUES
(
N'I?'
)
```
What does the ? do in the value statement?
EDIT:: Turns out there's some funny business via triggers and custom datatypes that occur on insert (we've got a bit of a messe... | [
0.28326427936553955,
0.381448894739151,
-0.016600077971816063,
0.04293293133378029,
-0.03071080893278122,
-0.04303871467709541,
0.3929500877857208,
-0.23053917288780212,
-0.07021288573741913,
-0.38064131140708923,
0.0885782241821289,
0.4076109230518341,
-0.25713202357292175,
0.242220208048... | |
N'I?' )
SELECT *
FROM @TestTable
``` | [
0.6003320217132568,
0.36744391918182373,
0.028375331312417984,
-0.07425203174352646,
0.022494319826364517,
-0.04129653796553612,
0.22384122014045715,
-0.15868732333183289,
0.05676053464412689,
-0.3830501139163971,
-0.09244376420974731,
0.26613563299179077,
-0.12381217628717422,
0.277913957... | |
I have a form in VB6 with two combo boxes (cboCustomer and cboItemNumber). When someone selects a value from cboCustomer, I want to populate cboItemNumber with a list of item numbers relevent to the customer selected. What event does VB6 offer that I can use? I've tried \_Change and \_LostFocus and neither are doing wh... | [
0.6273637413978577,
0.22930198907852173,
0.25606784224510193,
-0.061462149024009705,
-0.10585693269968033,
-0.015907811000943184,
0.013851616531610489,
-0.42950084805488586,
-0.24721525609493256,
-0.5940985083580017,
0.16584265232086182,
0.6477471590042114,
-0.29385465383529663,
0.18168607... | |
the up/down arrow keys to change the selected item, the click event still fires. | [
-0.17791864275932312,
0.03879781812429428,
0.6476895213127136,
0.12302826344966888,
0.045116353780031204,
0.28698381781578064,
0.18282032012939453,
-0.43795540928840637,
-0.1944122314453125,
-0.34624335169792175,
-0.26359638571739197,
0.4761020541191101,
-0.01881931535899639,
-0.0641086474... | |
I am trying to make the [Validation plugin](http://docs.jquery.com/Plugins/Validation) work. It works fine for individual fields, but when I try to include the demo code for the error container that contains all of the errors, I have an issue. The problem is that it shows the container with all errors when I am in all ... | [
0.5125290751457214,
0.21028763055801392,
0.07496896386146545,
-0.020222565159201622,
-0.25247877836227417,
-0.13963380455970764,
0.42665791511535645,
0.0435933843255043,
-0.03424506634473801,
-0.5620959401130676,
0.1589062362909317,
0.6789194941520691,
-0.23850181698799133,
0.1215212345123... | |
answer below for the container, the container output just displays the number of errors in plain text.
What is the trick to get a list of detailed error messages? What I would like is to display "ERROR" next to the control in error when the user presses the tab button, and to have a summary of everything at the end w... | [
0.13264119625091553,
0.04073157161474228,
0.38600048422813416,
0.036260537803173065,
0.24383430182933807,
-0.05527130514383316,
0.09067467600107193,
-0.26489922404289246,
-0.06510382890701294,
-0.6233360171318054,
0.10510653257369995,
0.6918317079544067,
-0.10575413703918457,
0.15475971996... | |
keyup and submit
$("#frmEnregistrer").bind("invalid-form.validate", function(e, validator) {
var err = validator.numberOfInvalids();
if (err) {
container.html("THERE ARE "+ err + " ERRORS IN THE FORM")
container.show();
} else {
container.hide(); | [
0.11387985199689865,
-0.11144932359457016,
0.5503386855125427,
-0.2551918625831604,
-0.047306109219789505,
0.11644432693719864,
0.3403492569923401,
-0.6531407833099365,
-0.12238729000091553,
-0.5213653445243835,
-0.30905473232269287,
0.46161404252052307,
-0.17845265567302704,
0.25110334157... | |
}
}).validate({
rules: {
nickname_in: {
required: | [
-0.058148398995399475,
-0.0019774578977376223,
0.30546942353248596,
0.13391560316085815,
0.5501051545143127,
-0.35250523686408997,
0.4279117286205292,
-0.33828508853912354,
0.16354158520698547,
-0.3420804440975189,
-0.6171021461486816,
0.53413325548172,
-0.10152687877416611,
0.007993391714... | |
true,
minLength: 4
},
prenom_in: { | [
-0.18516261875629425,
-0.19757360219955444,
0.41620969772338867,
0.07541575282812119,
0.06686776131391525,
0.27830803394317627,
0.37798431515693665,
0.23162195086479187,
-0.16384214162826538,
-0.20361271500587463,
-0.24562640488147736,
0.49266523122787476,
0.04839611053466797,
0.1270667612... | |
required: true,
minLength: 4
}, | [
-0.049764715135097504,
-0.11441951245069504,
0.46388837695121765,
0.15442726016044617,
0.10391217470169067,
0.15925082564353943,
0.5282070636749268,
-0.271514892578125,
0.06564250588417053,
-0.11166585236787796,
-0.3669182062149048,
0.6878020167350769,
0.16379518806934357,
-0.0995407104492... | |
nom_in: {
required: true,
minLength: 4 | [
-0.25506287813186646,
-0.0844520553946495,
0.42122340202331543,
0.31005045771598816,
0.24868445098400116,
0.15000185370445251,
0.2811860144138336,
-0.08719372749328613,
-0.3028862774372101,
0.031210552901029587,
-0.46930739283561707,
0.4447762668132782,
0.1453150510787964,
0.06723646819591... | |
},
password_in: {
required: true, | [
0.03444166108965874,
0.16744078695774078,
0.05479104444384575,
0.01480581983923912,
0.6269493699073792,
0.10005448013544083,
0.5394427180290222,
0.18780632317066193,
0.1953190416097641,
-0.070518858730793,
-0.49016857147216797,
0.8764137029647827,
0.04243442788720131,
0.03271394222974777,
... | |
minLength: 4
},
courriel_in: { | [
-0.5019339323043823,
0.058558955788612366,
0.20790153741836548,
0.03663400188088417,
-0.12396706640720367,
0.46239179372787476,
0.20679022371768951,
0.08647660911083221,
-0.3026396632194519,
-0.27458083629608154,
-0.36760565638542175,
0.1304943561553955,
-0.13877496123313904,
0.20748004317... | |
required: true,
email: true
}, | [
0.3556727170944214,
0.1066119596362114,
0.2259676158428192,
0.16553331911563873,
0.3325411379337311,
-0.037400536239147186,
0.46296876668930054,
0.0518781915307045,
0.26650944352149963,
-0.1096414104104042,
-0.4470703601837158,
0.7200003862380981,
-0.14482901990413666,
-0.05741826072335243... | |
userdigit: {
required: true
} | [
-0.07174341380596161,
0.08137014508247375,
0.12527181208133698,
0.2110084742307663,
0.024409404024481773,
-0.020899532362818718,
0.3298199772834778,
0.2754690647125244,
0.0669923797249794,
-0.2524808645248413,
-0.3015856146812439,
0.705797016620636,
-0.209228977560997,
-0.00661138631403446... | |
},
messages: {
nickname_in: "ERROR",
prenom_in: "ERROR", | [
-0.28016725182533264,
-0.057021502405405045,
-0.3704330027103424,
0.19719649851322174,
0.44132351875305176,
0.47501957416534424,
0.44412466883659363,
0.430023729801178,
0.08358371257781982,
-0.508484423160553,
-0.3242885172367096,
0.5985071659088135,
-0.11566659808158875,
0.125151872634887... | |
nom_in: "ERROR",
password_in: "ERROR",
courriel_in: "ERROR",
userdigit: "ERROR" | [
-0.4659910202026367,
0.18718987703323364,
-0.04945392906665802,
0.11871659010648727,
0.1293288916349411,
0.2173553854227066,
0.1659725159406662,
0.2502352297306061,
-0.17807045578956604,
-0.3622835874557495,
-0.48805898427963257,
0.5175645351409912,
-0.12186292558908463,
0.1715286076068878... | |
}
,errorPlacement: function(error, element){
container.append(error.clone());
error.insertAfter(element); | [
-0.13902395963668823,
0.10103839635848999,
0.0767541155219078,
-0.3642510175704956,
0.5799456834793091,
0.4099479019641876,
0.16899330914020538,
-0.19879378378391266,
0.27918541431427,
-0.43228256702423096,
-0.08491368591785431,
0.6544920802116394,
-0.5063902139663696,
0.2983962297439575,
... | |
}
});
});
```
You will find the documentation for the meta option in <http://docs.jquery.com/Plugins/Validation/validate#toptions>
If you want to display the errors beside the inputs **AND** in a separate error container you will need to override the `errorPlacement` callback.
From your example:
``... | [
-0.1173500195145607,
0.16866813600063324,
0.10936614871025085,
-0.11457890272140503,
0.23811031877994537,
0.1651628315448761,
0.48139673471450806,
-0.2446017563343048,
-0.2004908323287964,
-0.3841860592365265,
-0.2496403455734253,
0.8545646667480469,
-0.40749168395996094,
-0.06298547238111... | |
userdigit: "ERROR"
}
,errorContainer: container
,errorPlacement: function(error, element){
var errorClone = error.clone();
container.append(errorClone);
error.insertAfter(element) | [
-0.2935903072357178,
-0.047517839819192886,
0.052053485065698624,
-0.21638865768909454,
0.4122844338417053,
0.3698749542236328,
0.23906947672367096,
-0.2862839698791504,
0.051869381219148636,
-0.520399808883667,
-0.008637405931949615,
0.6260436773300171,
-0.36393752694129944,
0.12390900403... | |
}
// We don't need this options
//,errorLabelContainer: $("ol", container)
//,wrapper: 'li'
//,meta: "validate"
});
...
```
The `error` parameter is a jQuery object containing a `<label>` tag. The `element` | [
-0.2264130860567093,
-0.002958376659080386,
0.0815865695476532,
-0.07404416054487228,
0.3304946720600128,
-0.03225497528910637,
0.2759902775287628,
-0.1227293610572815,
0.11944890767335892,
-0.2883177399635315,
-0.16003939509391785,
0.7197415828704834,
-0.347010999917984,
-0.00526178395375... | |
parameter is the input that has failed validation.
Update to comments
==================
With the above code the error container will not clear errors because it contains a cloned copy. It's easy to solve this if jQuery gives a "hide" event, but it doesn't exist. Let's add a hide event!
1. First we need the [AOP plu... | [
-0.06104572117328644,
-0.16094833612442017,
0.1264496147632599,
0.22356395423412323,
-0.05937489494681358,
0.14858856797218323,
0.19486330449581146,
-0.08190703392028809,
-0.002277590101584792,
-0.4012770652770996,
0.16785208880901337,
0.6925581097602844,
-0.31232044100761414,
0.0254974551... | |
this.trigger("hide");
});
```
3. We bind the hide event to hide the cloned error:
```
...
,errorPlacement: function(error, element){
var errorClone = error.clone();
container.append(errorClone);
error.insertAfter(element).bind("hide", function(){ | [
0.22126246988773346,
-0.11896240711212158,
0.2247575968503952,
-0.3575421869754791,
0.44204747676849365,
-0.08433803915977478,
0.41179150342941284,
-0.4764101207256317,
0.1795116513967514,
-0.43650373816490173,
-0.08892597258090973,
0.628926694393158,
-0.5353827476501465,
0.192088931798934... | |
errorClone.hide();
});
}
...
```
Give it a try | [
0.176080584526062,
0.026037106290459633,
0.01174195297062397,
-0.2264508306980133,
0.3959977924823761,
-0.24965263903141022,
0.8335993885993958,
-0.14887310564517975,
0.12611711025238037,
-0.32523441314697266,
-0.03842420130968094,
0.6602080464363098,
-0.3991549015045166,
0.071567222476005... | |
Under normal circumstances, a VB.NET application of mine can check the ClientName environmental variable to get the name of the workstation the user is connecting from.
So when WorkstationX RDPs into ServerA:
* ComputerName=ServerA
* ClientName=WorkstationX
That works fine.
If I right-click on the application and c... | [
0.6134937405586243,
0.1214272528886795,
0.42133015394210815,
0.017668353393673897,
0.0776897445321083,
-0.24334336817264557,
0.36704781651496887,
0.2714555859565735,
-0.4728719890117645,
-0.6934653520584106,
0.06818067282438278,
0.5803657174110413,
-0.21573057770729065,
0.40620914101600647... | |
a given server, and to retrieve the names of the workstations connected to those sessions. The code I have has a lot of p-invoke stuff and is rather unwieldy, but I can post it if you want. | [
0.5893228650093079,
0.14045320451259613,
0.08993751555681229,
0.13718757033348083,
-0.10894239693880081,
-0.11347872763872147,
0.09412910789251328,
0.37461400032043457,
0.017440877854824066,
-0.49238601326942444,
-0.04446451738476753,
0.07382135093212128,
-0.17900168895721436,
0.1060675159... | |
Given the following, how could I insert rows in my db? (Or what should I correct in my schema?)
Models:
```
class Item < ActiveRecord::Base
has_many :tran_items
has_many :transactions, :through => :tran_items
end
class TranItem < ActiveRecord::Base
belongs_to :item
belongs_t... | [
-0.2161433845758438,
-0.0763988271355629,
0.7076981663703918,
-0.1244693249464035,
0.029176391661167145,
-0.18676283955574036,
-0.14243559539318085,
-0.5737144351005554,
-0.3245861530303955,
-0.5134228467941284,
0.12045301496982574,
0.7610557079315186,
-0.2503383159637451,
0.23488195240497... | |
:tran_items
has_many :items, :through => :tran_items
end
```
Schema:
```
create_table :items do |t|
t.references :tran_items #answer: remove this line
t.string :name
end
create_table :tran_items do |t|
t.belongs_to :items, :transactions, :null => false #answer: unpluralize
t.integer :quan... | [
0.1737106442451477,
0.2061101198196411,
0.7395547032356262,
0.16788597404956818,
0.19292689859867096,
0.005046809557825327,
-0.11970014125108719,
-0.6104444265365601,
-0.37459367513656616,
-0.3212304711341858,
-0.08435781300067902,
0.6635161638259888,
-0.14802968502044678,
0.20048254728317... | |
"Transaction" may cause you some problems due to ActiveRecord::Transactions. [There is a lighthouse ticket](https://rails.lighthouseapp.com/projects/8994/tickets/993-having-column-named-transaction-in-a-model-leads-to-weird-behavior).)
Your schema is not set up correctly. "references" is an alias to "belongs\_to". Ite... | [
-0.21562689542770386,
-0.14495797455310822,
0.5507482886314392,
0.3615339696407318,
-0.04187815636396408,
-0.38830962777137756,
0.2173846960067749,
-0.5166035890579224,
-0.5504089593887329,
-0.31206658482551575,
0.21217679977416992,
0.4857368767261505,
-0.40306130051612854,
0.2126964926719... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.