text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
are vectors of floats.
Maybe what you actually want to do is creating a vector of complex objects whose real and imaginary parts are floats?
EDIT: myComplexVector is *not* a vector, is a complex. That's why a `const_iterator` for it is not defined. | [
0.2933570146560669,
-0.15464024245738983,
0.45879262685775757,
0.39869269728660583,
-0.40168583393096924,
-0.2744542062282562,
-0.15410061180591583,
0.07841392606496811,
-0.09076964855194092,
-0.5692081451416016,
0.0629354789853096,
0.39068320393562317,
-0.45620185136795044,
0.242421463131... | |
How could I send additional view parameters after I have done a redirect (e.g. $this->\_redirect->gotoSimple();)?
For example, let's say I have an Edit action which will redirect the user to an Error action handler and I would like to be able to send custom, detailed error messages to its view. To illustrate it cleare... | [
0.36211761832237244,
-0.272576242685318,
0.45281147956848145,
-0.0977645143866539,
-0.2584537863731384,
-0.018383584916591644,
0.4776991605758667,
-0.22311802208423615,
-0.16506849229335785,
-0.5259534120559692,
0.03418465331196785,
0.5141090750694275,
-0.36284518241882324,
0.3152059614658... | |
error message, and editAction() needs a means to pass in some value to that "errorMessage" view variable
A quick code snippet would probably look like:
```
public function editAction() {
//DO THINGS...
// Upon failure
if($fail) {
$this->_redirector->gotoUrl('/error/index');
//TODO: I need... | [
0.018498336896300316,
0.1511833369731903,
0.4101513624191284,
-0.05342596396803856,
0.21087251603603363,
-0.08655506372451782,
0.6010216474533081,
-0.05197145417332649,
-0.017089473083615303,
-0.7894594073295593,
-0.2028658390045166,
0.7586804032325745,
-0.3907126784324646,
-0.047398116439... | |
appreciated.
I have not seen anywhere that an action (editAction) accesses another action's view (errorView). for the special case of error handling, my idea is using Exceptions. you throw different exceptions for different bad situations, and in your error handler action, you can decide what to show to user based on t... | [
0.257315069437027,
-0.04422541335225105,
0.2995985448360443,
-0.21673746407032013,
0.061803799122571945,
-0.02052399143576622,
0.3382193446159363,
-0.1433059573173523,
-0.09735780209302902,
-0.6359289884567261,
0.08567637205123901,
0.7317701578140259,
-0.27184736728668213,
-0.2662613093852... | |
throw new Exception('describe the other bad thing',$errorCode2);
}
}
// file: ErrorController.php
public function errorAction() {
$error = $this->_getParam('error_handler');
$exception = $error->exception; // the original Exception object thrown by some code
$code = $exception->getCode();
switc... | [
-0.08300043642520905,
-0.044658731669187546,
-0.07959809899330139,
-0.11516449600458145,
-0.15393976867198944,
-0.3015412390232086,
0.3896918296813965,
-0.1240004301071167,
-0.16366223990917206,
-0.787067174911499,
-0.08904462307691574,
0.5858191847801208,
-0.2378200739622116,
-0.009290191... | |
communicate between these 2 actions. using flashMessenger action helper is the first thing comes into my mind:
```
// file: ProductContorller.php
public function editAction() {
// some code
if ($badThing) {
$this->_helper->flashMessenger->addMessage('error1');
$this->_redirect('error');
}... | [
-0.20965848863124847,
-0.09568998962640762,
0.5138764381408691,
-0.30381348729133606,
-0.09861454367637634,
0.12863792479038239,
0.6276220679283142,
-0.4426022171974182,
0.10459049046039581,
-0.7466822266578674,
0.08591214567422867,
0.8396404981613159,
-0.5144655108451843,
-0.2554714679718... | |
if ( in_array('error1',$errors) ) {
// do something
} // elseif ( ...
}
```
although remember that flashMessenger uses sessions, so sessions and most likely cookies are going to be involved in this messaging process. | [
0.07391846925020218,
-0.018744023516774178,
-0.04151073843240738,
-0.03308451548218727,
0.08666287362575531,
-0.4866763651371002,
0.570296585559845,
0.08202499151229858,
-0.14624810218811035,
-0.7767411470413208,
-0.23574809730052948,
0.6291999220848083,
-0.28490665555000305,
-0.0906524136... | |
I am develop a simple iPhone app. I need a font that looks like LED.
Is any font that looks like LED in iPhone ?
You might want to try "DBLCDTempBlack"
A list of available fonts can be found here:
<http://ajnaware.wordpress.com/2008/10/24/list-of-fonts-available-on-the-iphone/> | [
0.30060407519340515,
-0.028753895312547684,
0.12495595216751099,
-0.20706066489219666,
-0.09887184202671051,
0.30523550510406494,
0.40856069326400757,
-0.10564891248941422,
0.09043806046247482,
-0.5057808756828308,
0.20247703790664673,
0.5420165061950684,
-0.1309850811958313,
-0.1670308560... | |
Does anyone know of a technique to prevent someone (me!) accidentally committing a file with a public database connection string in it to Google Code. I need to run some unit tests on the database from my local machine (to update the DB schema) but I'm concerned that I'll forget that I've changed the connection to poin... | [
0.5786582827568054,
0.34298720955848694,
0.18373651802539825,
0.19749394059181213,
-0.051135141402482986,
-0.39331430196762085,
0.5521615147590637,
0.027436034753918648,
-0.3056102693080902,
-0.4893745183944702,
0.11861836165189743,
0.3003115952014923,
-0.24737457931041718,
0.3775289058685... | |
**svn:ignore**-property the correct configuration file
eg your config-file should reside on:
```
./config/app.conf
```
then you should ignore this file for subversion:
```
svn propset svn:ignore "app.conf" ./conf
```
and copy the app.conf to app.conf.example and add this file to subversion:
cp app.conf app.con... | [
0.23071405291557312,
0.14261680841445923,
0.5707902312278748,
0.0694233700633049,
0.12590789794921875,
0.049075279384851456,
0.38636645674705505,
-0.11008279770612717,
-0.5165733098983765,
-0.5911641716957092,
-0.2689802050590515,
0.474364697933197,
-0.6393605470657349,
0.202789306640625,
... | |
Using SQL Server 2008 and I'm doing some schema construction in the Management Studio designer.
I created a table early in the process called "Animal", but then decided to delete shortly after. I deleted it via the tree view in Management Studio (right-click delete).
Now I'm late in the process, I would like to recre... | [
-0.13065846264362335,
0.1878875344991684,
0.11005190014839172,
-0.18211999535560608,
-0.17164795100688934,
-0.21454201638698578,
0.15748289227485657,
-0.04344842955470085,
-0.24379968643188477,
-0.48735305666923523,
0.5299139022827148,
0.49922624230384827,
-0.5864353179931641,
0.2358291298... | |
designer".
What's the deal? How can I use this table normally again and not suffer from older table naming conflicts?
Alternatively, if the table is marked for deletion, can I actually invoke deletion somehow? Then recreate another table with the same name.
This is a little annoying. Would appreciate any help.
What ... | [
0.28721895813941956,
-0.22475898265838623,
0.08743790537118912,
0.26204246282577515,
-0.12509921193122864,
-0.18255555629730225,
0.17031268775463104,
0.09694264829158783,
-0.45489904284477234,
-0.7232274413108826,
-0.017426947131752968,
0.6478062272071838,
-0.41083937883377075,
0.658262372... | |
I'm supposed to be setting up a 'geolocation based', ipv6, wireless mesh network to run on google android.
I found what seems to be a good app to support the meshing:
<http://www.open-mesh.net/wiki/batman-adv>
> "Batman-advanced is a new approach to
> wireless networking which does no
> longer operate on the IP b... | [
0.3349299132823944,
-0.08606833219528198,
0.3120558559894562,
0.18141824007034302,
-0.16400498151779175,
-0.026327960193157196,
-0.013421248644590378,
-0.5603876113891602,
-0.158721923828125,
-0.5895218253135681,
-0.02281375043094158,
0.27318763732910156,
-0.26160603761672974,
-0.102521263... | |
appear to be link local, thus all
> higher operating protocols won't be
> affected by any changes within the
> network. You can run almost any
> protocol above B.A.T.M.A.N. Advanced,
> prominent examples are: IPv4, IPv6,
> DHCP, IPX."
But other members in my team has said it's a no-go because it operates on OSI,... | [
0.01765725016593933,
-0.03867005184292793,
0.5419492721557617,
0.05577746406197548,
0.1431746780872345,
-0.26020991802215576,
0.32590678334236145,
0.2633424699306488,
-0.17941313982009888,
-1.1429457664489746,
-0.062253374606370926,
0.39724063873291016,
-0.4857003390789032,
0.2162302434444... | |
we don't need to worry too much about compatibility with existing apps, so does it matter?
I haven't spent a lot of time working with networks, so please put in noobmans terms.
"You can run almost any protocol above B.A.T.M.A.N. Advanced, prominent examples are: IPv4, IPv6, DHCP, IPX."
"But other members in my team ... | [
0.22059156000614166,
0.093667171895504,
0.13753962516784668,
0.2817671597003937,
-0.3865286111831665,
-0.49574536085128784,
0.008165118284523487,
-0.0802997499704361,
-0.3735864758491516,
-0.44397881627082825,
-0.1620045304298401,
0.5531672835350037,
-0.18897825479507446,
-0.29054373502731... | |
I'm new to StackOverflow, so please let me know if there is a better way to ask the following question.
I need to create a regular expression that detects whether a field in the database is numeric, and if it is numeric does it fall within a valid range (i.e. 1-50). I've tried `[1-50]`, which works except for the inst... | [
0.38794445991516113,
0.2773732542991638,
0.41030529141426086,
0.13353869318962097,
-0.10000033676624298,
-0.28393471240997314,
0.1464914232492447,
-0.3179319500923157,
-0.27466505765914917,
-0.40317443013191223,
0.17202740907669067,
0.38585442304611206,
-0.006023986265063286,
-0.0131484242... | |
expressions, and have been learning all I can from: [www.regular-expressions.info](http://www.regular-expressions.info/). If you guys have recommendations of other sites to bone up on this stuff I would appreciate it!
Try this
```
^(0?[1-9])|([1-4][0-9])|(50)$
```
The idea of this regex is to break the problem down ... | [
-0.028160272166132927,
0.05902433022856712,
0.37418967485427856,
0.014711814001202583,
-0.09077055007219315,
0.6066030263900757,
0.3278445303440094,
-0.19165939092636108,
-0.19936808943748474,
-0.5282496213912964,
-0.24220305681228638,
0.6535312533378601,
-0.2941584587097168,
-0.3375688791... | |
I need to change the contextmenustrip width dynamically, by default the contextmenustrip width depends on the text length of the ToolstripmenuItems.
And BTW I really don't wanna redraw the control again!!!
Thanks in advance.
You need to set the ContextMenuStrip AutoSize property to false. Then you can set the Width p... | [
0.11582210659980774,
-0.044203612953424454,
0.7051180005073547,
-0.1929347664117813,
0.10236115753650665,
-0.02544255182147026,
0.46543627977371216,
-0.17526289820671082,
0.05194222927093506,
-0.4981854557991028,
0.04472395405173302,
1.3207687139511108,
-0.25035127997398376,
0.003838739823... | |
Why does the first constructor in ClassA cause the compiler error 'cannot use "this" in member intializer'?
... or how can i get this to work?
Thanks
```
public sealed class ClassA : IMethodA
{
private readonly IMethodA _methodA;
public ClassA():this(this)
{}
public ClassA(IMethodA methodA)
{
... | [
0.044547852128744125,
0.11414939910173416,
-0.009076074697077274,
-0.2277171015739441,
0.22788448631763458,
-0.11744903028011322,
0.5122818946838379,
-0.3208737075328827,
0.06930901110172272,
-0.44933009147644043,
-0.41905614733695984,
0.5022674798965454,
-0.5667566061019897,
0.34929141402... | |
{
Console.WriteLine(i.ToString());
}
}
public interface IMethodA
{
void MethodA(int i);
}
```
You can't use the `this` keyword when chaining constructors essentially because `this` refers to an object that hasn't been instantiated yet (creation of the object doesn't begin until some (the top-level or ... | [
-0.005844683386385441,
-0.0033830469474196434,
0.1928323656320572,
0.01708984188735485,
-0.13938206434249878,
-0.31314539909362793,
0.3136363923549652,
-0.1600910723209381,
0.20141619443893433,
-0.4489647150039673,
-0.3149482011795044,
0.6297805309295654,
-0.48595094680786133,
0.4485851228... | |
IMethodA _methodA;
public ClassA()
{
_methodA = this;
}
public ClassA(IMethodA methodA)
{
_methodA = methodA;
}
}
```
Perhaps I misunderstand what you're trying to do, but hopefully that will solve the issue for you. | [
0.12318100780248642,
0.3814653158187866,
-0.04975930228829384,
-0.15663255751132965,
0.15971526503562927,
-0.40250125527381897,
0.4842183291912079,
-0.2772289216518402,
0.16146735846996307,
-0.6526581048965454,
-0.22562025487422943,
0.5751997828483582,
-0.42075175046920776,
0.3468644618988... | |
With jQuery version 1.2.3 I'm trying to add nodes after textarea elements with attribute 'maxlength' but it doesn't work:
`$("textarea[@maxlength]").after("<b>Aint working</b>");`
This is the HTML code:
`<textarea maxlength="500">This is a test.</textarea>`
`<textarea maxlength="250">Yet another line.</textarea>`... | [
0.03716487064957619,
-0.11703603714704514,
0.7161064743995667,
-0.03538303077220917,
-0.12572799623012543,
-0.20491059124469757,
0.2620208263397217,
-0.2870721220970154,
-0.14566652476787567,
-0.6393181681632996,
0.053385209292173386,
0.6206868290901184,
-0.2562219798564911,
-0.10111240297... | |
all falls down for any kind of nesting, in which case the language is no longer regular and regexs aren't suitable - find a parser* | [
-0.17540249228477478,
0.3550684154033661,
-0.03321518748998642,
0.1033615693449974,
0.03394939377903938,
0.02678721398115158,
0.786283016204834,
0.10393625497817993,
-0.04844474419951439,
-0.4338831603527069,
-0.5337233543395996,
0.1873559057712555,
-0.20897383987903595,
-0.002534615108743... | |
I'm trying to create a custom class that is based off of an XML file (using xsd.exe). The end goal of this class is to bind it to a UI element (probably a gridview or something like that - I haven't decided yet). Are there any interfaces that I need to be sure to implement in order to do this? I would think IEnumerable... | [
0.24524693191051483,
-0.18615013360977173,
0.6194533705711365,
0.03571208193898201,
-0.27557626366615295,
-0.20741941034793854,
0.2029794305562973,
0.14736321568489075,
-0.0755506083369255,
-1.0458612442016602,
0.12200270593166351,
0.36306032538414,
-0.15548115968704224,
-0.002083161612972... | |
binding.
You want to bind you control to a list implements IEnumerable. | [
0.25121793150901794,
-0.15545307099819183,
0.27599138021469116,
0.38211384415626526,
-0.2809225022792816,
-0.30718162655830383,
-0.0401126965880394,
-0.5130040049552917,
-0.1468808352947235,
-0.38817352056503296,
-0.07855372875928879,
0.22470703721046448,
-0.5651753544807434,
0.30368715524... | |
Can anyone explain why the following code does not compile (on g++ (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-49))?
```
struct X {
public:
enum State { A, B, C };
X(State s) {}
};
int main()
{
X(X::A);
}
```
The message I get is:
jjj.cpp: In function 'int main()':
jjj.cpp:10: 'X X::A' is not a static m... | [
-0.016285954043269157,
0.2903759777545929,
0.46774011850357056,
-0.2930087149143219,
-0.527642548084259,
0.12097962200641632,
0.812735378742218,
-0.11487231403589249,
-0.26448240876197815,
-0.4463707506656647,
-0.26997238397598267,
0.23958812654018402,
-0.549240231513977,
0.265345752239227... | |
function declaration. If you really want this code, use:
```
(X)(X::A);
``` | [
0.2692405581474304,
-0.07919707149267197,
0.1413896232843399,
-0.3141491115093231,
-0.1440257728099823,
-0.33769139647483826,
0.3104346692562103,
0.006047968287020922,
0.10073596239089966,
-0.22453895211219788,
-0.5421324372291565,
0.9269837737083435,
-0.5698572993278503,
-0.01181451138108... | |
The following code works fine in Delphi 7. However, in Delphi 2009 the form does remain hidden but the button on the taskbar is now appearing.
```
ShowWindow(Handle, SW_HIDE);
SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW );
ShowWindow(Handle, SW_SHOW);
```
The above code ... | [
0.01218163687735796,
-0.018538255244493484,
0.9973898530006409,
-0.4526230990886688,
-0.06524117290973663,
-0.21429862082004547,
0.535473644733429,
-0.20932859182357788,
0.04526055231690407,
-0.6209076642990112,
-0.2306087762117386,
0.6297701597213745,
-0.46359217166900635,
-0.026973897591... | |
We have a setup with a development "trunk" in our recently-migrated-to-from-VSS TFS system and developers have been doing work in branches off the trunk, which are merged back in.
We've been diligently commenting our changesets at check in time, something we never did in the VSS days. However when I right-click on a t... | [
0.4378069043159485,
-0.35664689540863037,
0.1431383639574051,
0.3539507985115051,
0.3803727924823761,
-0.08264479786157608,
0.012870517559349537,
0.0015987188089638948,
-0.2678253650665283,
-0.779161274433136,
0.04096641764044762,
0.3702413737773895,
-0.13424518704414368,
0.254396498203277... | |
let alone any info about the changesets that make it up, or the comments that go with them.
How have other TFS users dealt with this issue?
Is there another way to view the history that I'm missing here?
This might be what you are looking for: <http://www.codeplex.com/TFSBranchHistory>
Haven't used it personally, s... | [
0.7099003791809082,
-0.12087853997945786,
-0.10335366427898407,
0.03260824829339981,
-0.04936913400888443,
-0.12506145238876343,
0.16932383179664612,
0.23979251086711884,
-0.46655380725860596,
-0.5199647545814514,
0.12613338232040405,
0.24523696303367615,
-0.12766094505786896,
0.2916046380... | |
Rails 2.3 was released last week and I installed it with gem install rails. Everything is working fine. However, I noticed a bug, so I searched a bit and sure enough a new commit was accepted 2 days ago that fixes the same bug I saw.
How can I get these latest changes into my version of rails that I'm running locally... | [
0.4265086352825165,
-0.17434217035770416,
0.11240039765834808,
-0.049671273678541183,
-0.34174105525016785,
-0.13304288685321808,
0.5936915278434753,
-0.09923850744962692,
-0.16601316630840302,
-0.7185782194137573,
0.2386925220489502,
0.6949775815010071,
-0.36041259765625,
-0.0269586294889... | |
some comprehensive instructions for this here:
<http://www.napcsweb.com/blog/2008/04/24/create-a-new-edge-rails-project> | [
0.32894814014434814,
-0.5295628309249878,
0.17084558308124542,
0.11475035548210144,
0.1561390459537506,
-0.27378249168395996,
0.44724956154823303,
-0.1454520970582962,
-0.2718776762485504,
-0.7179132103919983,
-0.09567715972661972,
0.15145154297351837,
0.012924299575388432,
-0.237573295831... | |
I was wondering if the 'find' method on strings was implemented with a linear search, or if python did something more sophisticated. The Python documentation doesn't discuss implementation details, so <http://docs.python.org/library/stdtypes.html> is of no help. Could someone please point me to the relevant source code... | [
0.36187228560447693,
0.12296634167432785,
-0.06142649054527283,
-0.018073759973049164,
-0.19529597461223602,
-0.10813795775175095,
0.40517598390579224,
-0.1585584580898285,
-0.40199148654937744,
-0.0733935609459877,
0.14961040019989014,
0.24265791475772858,
-0.3353951871395111,
0.071809425... | |
If `front()` returns a reference and the container is empty what do I get, an undefined reference? Does it mean I need to check `empty()` before each `front()`?
You get undefined behaviour - you need to check that the container contains something using empty() (which checks if the container is empty) before calling fro... | [
0.08867642283439636,
0.05059761181473732,
0.19496190547943115,
-0.3084189295768738,
-0.062003202736377716,
0.10996360331773758,
0.1776975840330124,
-0.2702251970767975,
-0.06370667368173599,
-0.17169417440891266,
-0.09568178653717041,
0.6235046982765198,
-0.36512210965156555,
0.28487873077... | |
How do I programmatically get the revision description and author from the SVN server in c#?
Using [SharpSvn](http://sharpsvn.net/):
```
using(SvnClient client = new SvnClient())
{
Collection<SvnLogEventArgs> list;
// When not using cached credentials
// c.Authentication.DefaultCredentials = new NetworkCr... | [
-0.2935764789581299,
0.07430098950862885,
1.10800302028656,
-0.15235461294651031,
0.24001754820346832,
0.02108454518020153,
0.2529837489128113,
-0.4412281811237335,
-0.23163896799087524,
-0.5719084739685059,
-0.3273891806602478,
0.50718092918396,
0.005010643042623997,
0.3073938190937042,
... | |
}
}
``` | [
0.17493881285190582,
0.41805654764175415,
0.05209751054644585,
-0.04864929988980293,
0.437467485666275,
-0.15825650095939636,
0.13202530145645142,
0.5446501970291138,
0.35430577397346497,
-0.4846813380718231,
-0.2295716553926468,
0.546978771686554,
-0.3188462555408478,
0.2798506021499634,
... | |
Sorry if I am asking same question again but want to verify!
I have two processes P1 and P2.
P1 is a writer (Producer).
P2 is a reader (Consumer).
There is some shared memory or a file that P1 writes to and as soon as P1 writes, P2 should be notified for reading.
Now as per my understanding pseudocode for P1 sho... | [
0.10106595605611801,
0.09463749825954437,
0.3436603844165802,
-0.06618814170360565,
-0.05212219059467316,
0.21686796844005585,
-0.16856345534324646,
-0.35089340806007385,
-0.24071690440177917,
-0.37533286213874817,
-0.0714372843503952,
0.4422246813774109,
0.10900857299566269,
0.26641201972... | |
required to have locks in the reader? The reader will just read the file and not change it. So I guess no locks are required in the reader. Thoughts? Can it go wrong in some case without locks?
2. I am opening and closing handles to the file every time during reading and writing. I think that is not required. I can ope... | [
0.33212482929229736,
0.2772790789604187,
0.2411506474018097,
0.0462324358522892,
-0.023386549204587936,
0.04196411371231079,
0.23699851334095,
-0.3055639863014221,
-0.36224493384361267,
-0.5641101598739624,
0.045301079750061035,
0.6043649315834045,
0.033380791544914246,
-0.0316110141575336... | |
end of File and reader is supposed to read the latest 10 bytes written by writer.
The answer is: locking is necessary if (and only if) both threads can use the same shared resources at the same time. There isn't enough information about your specific implementation, but I have few remarks:
1. Locking only during writi... | [
0.269952654838562,
0.053240951150655746,
0.5894312858581543,
0.1884189248085022,
0.29547205567359924,
-0.31243279576301575,
0.0970313772559166,
-0.36382347345352173,
-0.2957789897918701,
-0.36525392532348633,
-0.1701197624206543,
0.5912500023841858,
-0.26156869530677795,
0.3644604384899139... | |
that P1 could start writing to the file when P2 is still reading. If reading and writing operations modify the same system structures without any underlying synchronization you will end up with corrupted data. It's hard to say if this is the case here because you didn't mention which particular function (libraries) you... | [
-0.009178773500025272,
-0.13836908340454102,
0.2806147336959839,
0.21241401135921478,
0.029875878244638443,
0.11403974145650864,
0.10377340018749237,
-0.4388020932674408,
-0.4611378610134125,
-0.4503982961177826,
-0.07792238891124725,
0.32191699743270874,
-0.3441079556941986,
-0.0877095758... | |
to be read P1 notifies P2 about that (by the event; event passing should be internally synchronized, anyhow). P2 knows that it could read quantum of data and then needs to wait for subsequent notification. It may happen that subsequent notification would be sent before previous one is handled. So, the events needs to b... | [
0.14145909249782562,
-0.34396088123321533,
0.31428268551826477,
0.13454334437847137,
-0.1432253122329712,
-0.09896420687437057,
0.28222811222076416,
-0.20233161747455597,
-0.3316880762577057,
-0.5327788591384888,
-0.26542073488235474,
0.06730545312166214,
-0.5638569593429565,
0.06302487105... | |
**Yes/no-question: Is there a Groovy GDK function to capitalize the first character of a string?**
I'm looking for a Groovy equivalent of Perl's ucfirst(..) or Apache Commons StringUtils.capitalize(str) (the latter capitalizes the first letter of all words in the input string).
I'm currently coding this by hand using... | [
-0.021410534158349037,
0.09323669970035553,
0.48903360962867737,
-0.17318536341190338,
-0.3612419068813324,
0.3045850098133087,
0.2607733905315399,
0.19996067881584167,
-0.15640459954738617,
-0.41988322138786316,
-0.2614487409591675,
0.44529393315315247,
-0.08744730800390244,
-0.0723037421... | |
couple of more groovy ways to do what you're asking though (if you don't want to use StringUtils in the Java idiomatic way as Vladimir suggests).
You can simplify your method using a negative value in the second half of your range:
```
def str = "foo"
assert "Foo" == str[0].toUpperCase() + str[1..-1]
```
Or you ca... | [
0.1851186454296112,
0.15345875918865204,
0.3604510426521301,
-0.12680238485336304,
-0.35843566060066223,
-0.04089502617716789,
0.18377836048603058,
-0.3838562071323395,
-0.21689866483211517,
-0.21709978580474854,
0.03415091708302498,
0.9122801423072815,
-0.6346463561058044,
-0.010343827307... | |
Say I defined a char column Type. I want to strict its value to say for example (Black, White, Red, Blue) Only...
How can I do that??
All i know, this is easy in Access :P
If there are just a few permitted values then you can use a [`CHECK` constraint](http://msdn.microsoft.com/en-us/library/ms188258.aspx):
```
ALTE... | [
-0.15648877620697021,
0.3617076873779297,
0.5088858008384705,
-0.19505956768989563,
-0.08104217052459717,
0.3132276237010956,
-0.055234670639038086,
-0.259975403547287,
-0.2650335133075714,
-0.4159892201423645,
-0.04127431660890579,
0.19597503542900085,
-0.5997584462165833,
0.1003976389765... | |
REFERENCES dbo.Lookup_Colours (Colour)
``` | [
0.7215878367424011,
0.4066210687160492,
0.025804536417126656,
-0.5109819173812866,
0.24240408837795258,
-0.0860339030623436,
0.2928159534931183,
-0.014896811917424202,
-0.4731625020503998,
-0.3227408826351166,
-0.5809459090232849,
0.2253512293100357,
-0.3416399657726288,
0.1954032629728317... | |
I have a Django project with multiple applications (say, two), and both need different versions of *MEDIA\_ROOT* and *MEDIA\_URL*.
The documentation does specify how to modify a specific setting, but here is what I did.
I created a project1/settings.py,
```
# project1/settings.py,
from django.conf import settings... | [
0.20861826837062836,
0.36660096049308777,
0.2983092665672302,
-0.14734084904193878,
0.17341221868991852,
-0.36184951663017273,
-0.03347599878907204,
-0.27404099702835083,
-0.06351714581251144,
-0.6660048365592957,
0.12271489948034286,
0.6123967170715332,
-0.4105069041252136,
-0.20451396703... | |
what is the best practices way to achieve this?
Jarret is right. Best case scenario: this will work if you run a very simple test after restarting the server. Just about anything else will break it.
If you're just using MEDIA\_\* as constants, I'd recommend using some other constant. If you really are using them for d... | [
0.4187479019165039,
-0.1311081200838089,
0.1503172218799591,
0.36114656925201416,
0.08183163404464722,
-0.2826671004295349,
0.619685709476471,
-0.21610891819000244,
-0.22823522984981537,
-0.6873317360877991,
0.20823074877262115,
0.7108117341995239,
-0.3720196783542633,
0.08910450339317322,... | |
made
2. Avoiding bad race conditions
1 is best accomplished through custom [MiddleWare](http://docs.djangoproject.com/en/dev/topics/http/middleware/?from=olddocs), probably with a process\_request method. What you want to avoid, however, is the
```
settings.MEDIA_URL = 'foo'
```
global variable abuse. That will br... | [
0.06496678292751312,
0.0026031755842268467,
0.27346983551979065,
-0.07250043004751205,
-0.07306665182113647,
-0.327141672372818,
0.2964121401309967,
-0.3350590169429779,
-0.014624368399381638,
-0.7306506633758545,
-0.033411409705877304,
0.608415961265564,
-0.5973616242408752,
0.01807436533... | |
If my client's connection is broken on the other `end( kill -9 server)`. It takes several minutes for the client to determine that something is wrong. `Socket.Connected` returns true even though connection is actually broken.
What is the fastest way to determine that the connection doesn't exist, once the other end br... | [
0.17832787334918976,
-0.08889299631118774,
0.596451461315155,
0.06354029476642609,
0.23256716132164001,
-0.23004615306854248,
0.5165269374847412,
0.04729596525430679,
-0.1475229114294052,
-0.7656655311584473,
-0.25857844948768616,
0.5336088538169861,
-0.14337821304798126,
0.361581295728683... | |
/*Do some processing*/
}
}catch (SocketException se){
Console.WriteLine(ex.Message);
} catch (Exception ex){
Console.WriteLine(ex.Message);
}
finally
{
Console.WriteLine("something bad happen");
}
```
This seems to work for me... Does anyone see any issues?
```
public bool IsConnected
{
... | [
0.23858462274074554,
-0.18028630316257477,
0.3819379508495331,
0.04715351015329361,
0.021923134103417397,
-0.13107281923294067,
0.41816824674606323,
-0.0823923796415329,
-0.17394523322582245,
-0.6000714898109436,
-0.17291802167892456,
0.46604666113853455,
-0.3871910274028778,
0.19250650703... | |
==0)}
}
```
---
Can also be put into an extension method.
```
public static class SocketExtensions
{
public static bool IsConnected(this Socket @this)
{
return !(@this.Poll(1, SelectMode.SelectRead) && @this.Available == 0);
}
}
```
Now you can easily use it in your code dealing with sockets.
```
var m... | [
0.0855642631649971,
-0.11062775552272797,
0.5669556260108948,
-0.06425518542528152,
0.21037298440933228,
-0.06856831163167953,
0.1244518905878067,
0.058515872806310654,
-0.1925482451915741,
-0.49779829382896423,
-0.311838835477829,
0.5352609753608704,
-0.39155226945877075,
0.32927086949348... | |
I have an expect script that connects to a few routers through ssh. All these routers have the same password (I know, it's wrong), and the script needs to know that password in order to be able to connect to the routers. Currently, the password is passed to my script as an argument on the command line, but this means t... | [
0.5023819804191589,
0.3981512784957886,
0.15624549984931946,
-0.3076067268848419,
0.23942941427230835,
-0.02035866677761078,
0.2827211022377014,
-0.1012377217411995,
-0.25532835721969604,
-0.8319836854934692,
0.13546189665794373,
0.7233515381813049,
0.007782979868352413,
-0.122845128178596... | |
possible to prompt the user for a password with expect?
Thank you.
*Edit*: if I was connecting to servers instead of routers, I would probably use ssh keys instead of passwords. But the routers I'm using just support passwords.
Use expect's `stty` command like this:
```
# grab the password
stty -echo
send_user -- "P... | [
0.060434602200984955,
-0.16390274465084076,
0.1814008504152298,
-0.2061930149793625,
0.12271562218666077,
-0.06758379936218262,
0.5721526145935059,
-0.2647351920604706,
0.2676931321620941,
-0.9841390252113342,
-0.02485276199877262,
1.1353403329849243,
-0.3723057806491852,
-0.68470311164855... | |
I have a Standard .net 2.0 data grid which uses a XMLDatasource. The datasource is set dynamically by passing in XML string to the "Data" property of the XMLdatasource on a button click event.
This workd fine the first time around but not on subsequent button clicks.
i.e. eventhough the xml passed in changes the gri... | [
0.30571067333221436,
-0.23365414142608643,
0.5956324338912964,
-0.026729565113782883,
-0.09667590260505676,
-0.18322481215000153,
0.034638840705156326,
-0.2816658914089203,
-0.06448207795619965,
-1.023665428161621,
0.2089986950159073,
0.5211413502693176,
-0.17898814380168915,
0.16648629307... | |
DataSourceID="XmlDataSource5"
AutoGenerateColumns="False" AllowPaging="True"
style="width:100%; height:100%;"
AutoGenerateSelectButton="True"
EnableViewState="False">
<SelectedRowStyle BackColor="Red" />
<Columns>
<asp:BoundField DataField="TYPE" HeaderText="TYP... | [
-0.30157721042633057,
-0.19265584647655487,
0.49388936161994934,
0.04297483339905739,
0.11969098448753357,
0.20394086837768555,
0.1299123466014862,
-0.47703319787979126,
-0.17826716601848602,
-0.5626081228256226,
-0.4797956645488739,
0.4072498083114624,
-0.22641800343990326,
-0.01012905873... | |
XmlDataSource5.Data = _testLib.GetGridXML(_Num)
GridView1.DataBind()
End Sub
```
where \_testLib.GetGridXML is a function that returns an XML string based on the \_Num passed in.
Here's an approach.
Read all the ID3 tags for the MP3 files enqued in the playlist or folder using [C# ID3 Library](http://sourceforg... | [
0.2695872187614441,
-0.2561100721359253,
0.3444077968597412,
0.1257854551076889,
-0.3367439806461334,
-0.23840120434761047,
0.024963220581412315,
-0.41597920656204224,
-0.10585612058639526,
-0.5263555645942688,
-0.04804811626672745,
0.5679891109466553,
-0.24283233284950256,
-0.055581286549... | |
Given the following code, can you figure out what caused "You input 7 characters" showed up 3 times especially the
last time?
```
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include <semaphore.h>
void *thread_function(void *arg);
sem_t bin_sem;
#define WORK_SIZ... | [
0.17172513902187347,
-0.09901991486549377,
0.5253699421882629,
-0.4817236661911011,
0.12698224186897278,
0.5643868446350098,
0.6974536180496216,
-0.5085846781730652,
-0.2149793654680252,
-0.6781989932060242,
-0.31482353806495667,
0.3977096974849701,
-0.3467894494533539,
0.4081459939479828,... | |
perror("Thread creation failed");
exit(EXIT_FAILURE);
}
printf("Input some text. Enter ‘end’ to finish");
while (strncmp("end",work_area,3)!=0){
if(strncmp(work_area,"FAST",4)==0){
sem_post(&bin_sem);
strcpy(work_area,"Wheeee...");
}else{
fgets(wor... | [
-0.14456933736801147,
-0.26744842529296875,
0.5881070494651794,
-0.2660391926765442,
0.15412487089633942,
0.42363959550857544,
0.7260509133338928,
-0.247419074177742,
-0.09960658848285675,
-0.5560314059257507,
-0.5624253153800964,
0.31014284491539,
-0.22828765213489532,
0.5113234519958496,... | |
}
printf("\nWaiting for thread to finish\n");
res = pthread_join(a_thread,&thread_result);
if(res!=0){
perror("Thread join failed!");
exit(EXIT_FAILURE);
}
printf("Thread joined\n");
sem_destroy(&bin_sem);
exit(EXIT_SUCCESS);
}
void *thread_function(void* arg){
sem_wait(&... | [
-0.06643841415643692,
-0.0947786420583725,
0.5477023124694824,
-0.5012964606285095,
0.3117384910583496,
0.23428544402122498,
0.47216400504112244,
-0.3820236623287201,
-0.20851464569568634,
-0.384175181388855,
-0.4605332314968109,
0.5337234735488892,
-0.31079602241516113,
0.5594481229782104... | |
./thread3a
Input some text. Enter ‘end’ to finish
Excession
You input 9 characters
FAST
You input 7 characters
You input 7 characters
You input 7 characters
end
Waiting for thread to finish...
Thread joined
```
After typing "FAST" :
* sem\_post (the one at the end of while loop) --> bin-sem = 1
* test if work\_area =... | [
0.032620497047901154,
-0.07179585099220276,
0.43668314814567566,
-0.32111242413520813,
-0.11997168511152267,
0.24841541051864624,
0.6094504594802856,
-0.3580152690410614,
-0.26893696188926697,
-0.6401419043540955,
-0.0484723299741745,
0.29217734932899475,
-0.15926341712474823,
0.0346711762... | |
calls fgets(..stdin..), then the thread function can run and consume the semaphore token.
Here a trace of what happens.
```
> Input some text.
Main thread :
work_area = ?;
bin_sem = 0;
thread function :
wait on semaphore;
< Excession
Main thread :
work_area = Excession;
bin_sem = 1;
thr... | [
-0.08201073110103607,
-0.16737516224384308,
0.6966539621353149,
-0.13962019979953766,
0.4321618974208832,
0.5678362250328064,
0.1420484036207199,
-0.0016762063605710864,
-0.17733407020568848,
-0.7333486080169678,
-0.22892430424690247,
0.30903488397598267,
-0.3502201735973358,
0.26364800333... | |
work_area == Excession; (!= end)
work_area == Excession; (!= FAST)
< FAST
bin_sem = 1;
work_area == FAST; (!= end)
work_area == FAST;
bin_sem = 2;
work_area == Wheeee...;
bin_sem = 3;
wait on stdin;
thread function :
work_area == Wheeee...; (!= end)
> You input 7 characters; (Why ... | [
0.01802941970527172,
-0.3237660527229309,
0.47642281651496887,
-0.24008071422576904,
0.07809871435165405,
0.5640098452568054,
0.5484887957572937,
-0.21828821301460266,
-0.36070680618286133,
-0.47002342343330383,
-0.4812491834163666,
0.40581101179122925,
-0.21713563799858093,
0.385241806507... | |
7 characters; (Why seven?)
bin_sem = 1-1 = 0;
wait on semaphore;
``` | [
0.025107895955443382,
0.04508449137210846,
0.483195960521698,
-0.09999998658895493,
0.044359996914863586,
0.2336328774690628,
0.3917187452316284,
-0.055711161345243454,
0.03294365480542183,
-0.3711000084877014,
-0.38633471727371216,
0.4894021153450012,
-0.08352336287498474,
0.2883532345294... | |
I have a ascx that looks like this:
```
<UpdatePanel Parent mode = Conditional>
<UpdatePanel1 mode = Conditional>
//A form here with textboxes, etc
//A repeater here with a linkbutton that causes a postback
</UpdatePanel1>
</UpdatePanel Parent>
```
In the OnItemCommand of the repeater, I get the form v... | [
0.22918982803821564,
0.017491506412625313,
0.484231173992157,
-0.09596686065196991,
-0.21876314282417297,
-0.05173424631357193,
0.4798925220966339,
-0.03920391947031021,
-0.11367278546094894,
-0.7064030766487122,
0.022220971062779427,
0.4358818233013153,
-0.03673360496759415,
-0.0001678094... | |
into its different updatepanels. But, the problem now is that the form doesnt get updated when I click on the linkbutton in the repeater even though the server side code runs.**
EDIT AGAIN:
I think I know what's going on. I have 1 question before nailing this (hopefully). The form looks like this:
```
<tr>
<td>
... | [
0.36909762024879456,
-0.16074413061141968,
0.7615361213684082,
-0.2164658159017563,
-0.22001227736473083,
-0.2892920672893524,
0.43508097529411316,
0.010698718950152397,
-0.17617657780647278,
-0.8486515283584595,
-0.061438098549842834,
0.45509734749794006,
-0.3205656111240387,
0.0764841958... | |
id="txtSomething2" runat="server" />
</td>
</tr>
```
All I care about when the linkbutton is clicked is to update ONLY the textbox controls. I want everything else to remain the way they were.
Is there a way to conditionally trigger updates only on those controls?
I understand I can use JS but would rather avoid ... | [
0.4315682649612427,
0.014511472545564175,
0.6966388821601868,
-0.16184626519680023,
-0.016059769317507744,
-0.38039952516555786,
0.3785923421382904,
0.0757177397608757,
-0.12603141367435455,
-0.6334471106529236,
0.04992842301726341,
0.6169047951698303,
-0.3295184373855591,
0.06264445185661... | |
have much control over the script***
As I said in [this answer](https://stackoverflow.com/a/22309117/458193):
[Pen](http://sofish.github.io/pen/) is a new (active as of 2014) WYSIWYG editor that outputs Markdown.
It's not perfect—I've had issues with pasting HTML there—but it works. | [
0.08539596199989319,
-0.15421931445598602,
0.29047003388404846,
-0.2075149118900299,
-0.216093048453331,
-0.2760460674762726,
0.2264293134212494,
-0.2587412893772125,
0.0715038999915123,
-0.720741331577301,
0.02544533647596836,
0.42833012342453003,
0.17015403509140015,
-0.2524535357952118,... | |
How do I create a decorator that applies to classes?
Specifically, I want to use a decorator `addID` to add a member `__id` to a class, and change the constructor `__init__` to take an `id` argument for that member.
```
def getId(self): return self.__id
classdecorator addID(cls):
def __init__(self, id, *args, **... | [
0.15387803316116333,
0.22119830548763275,
0.11192487180233002,
-0.07621068507432938,
0.005960432346910238,
0.3235326111316681,
0.20668697357177734,
-0.5262947082519531,
0.07017983496189117,
-0.7011707425117493,
-0.006203337572515011,
0.5593254566192627,
-0.5242002010345459,
0.2275750935077... | |
equivalent to:
```
class Foo:
def __init__(self, id, value1):
self.__id = id
self.value1 = value1
def getId(self): return self.__id
```
I would second the notion that you may wish to consider a subclass instead of the approach you've outlined. However, not knowing your specific scenario, YMMV... | [
-0.2049773931503296,
-0.23594911396503448,
-0.03606759384274483,
-0.0976184755563736,
-0.16368870437145233,
-0.03476507589221001,
0.46327367424964905,
-0.13659630715847015,
-0.10351382195949554,
-0.5810559391975403,
-0.26296618580818176,
0.5403454303741455,
-0.4107339680194855,
0.177715763... | |
out the constructor for a new one.
Example:
```
def substitute_init(self, id, *args, **kwargs):
pass
class FooMeta(type):
def __new__(cls, name, bases, attrs):
attrs['__init__'] = substitute_init
return super(FooMeta, cls).__new__(cls, name, bases, attrs)
class Foo(object):
__metaclass... | [
-0.16965748369693756,
0.05267870053648949,
0.13661447167396545,
-0.24550092220306396,
-0.030307650566101074,
0.21165752410888672,
0.39532071352005005,
-0.2497909963130951,
0.018626324832439423,
-0.45006537437438965,
-0.3489958941936493,
0.4379950165748596,
-0.6075167655944824,
-0.058994878... | |
I have 3 solutions and solution A requires built versions of the DLLs from solution B and C in order to compile. It is not possible to merge it to one solution...
So far it seems that Visual Studio doesn't support solution references and msbuild is clever enough to know that you are building one solution from another ... | [
0.09961756318807602,
0.22734802961349487,
0.40687277913093567,
-0.07327213883399963,
-0.1470467746257782,
0.2593555748462677,
0.34523114562034607,
-0.3910692036151886,
-0.17178048193454742,
-0.7940281629562378,
0.24729369580745697,
0.18786022067070007,
-0.3965393602848053,
0.25799855589866... | |
has popped up in [different](https://stackoverflow.com/questions/200954/), but [related](https://stackoverflow.com/questions/284856/), forms. There is actually an [MSDN page that covers this](http://msdn.microsoft.com/en-us/library/ee817674.aspx).
What you're looking for is a multi-solution approach akin to the **Part... | [
0.11388885974884033,
-0.18938271701335907,
0.19228217005729675,
0.2675749659538269,
0.0811852514743805,
-0.023577047511935234,
0.09866063296794891,
-0.2334892749786377,
-0.6181771755218506,
-0.5325056910514832,
-0.2218257039785385,
0.17505349218845367,
-0.22278210520744324,
0.1874279528856... | |
This seems like it would be a simple affair, and I am sure I have done this before, but it has been a while since I have done any UI programming in Access. What I need to do is put a button on a form to toggle between datasheet and form view for a subform.
I have found a defaultview property, but nothing that looks li... | [
0.25534024834632874,
0.05359554663300514,
0.7141846418380737,
0.11721614748239517,
0.18501482903957367,
-0.2659863233566284,
0.014676767401397228,
-0.028886226937174797,
-0.14142151176929474,
-0.734214186668396,
0.05903570353984833,
0.804755687713623,
-0.11439964175224304,
0.13749428093433... | |
because it used the silly and clunky RunCommand syntax instead of a simple property or method on the control or form classes.
It ain't pretty, but for posterity, here is the answer.
```
'You have to set focus to the subform control or the change view call will'
'fail (UGH!)'
MyForm.mySubFormControl.SetFocus
'Change ... | [
0.006593598518520594,
-0.25313204526901245,
0.8798311352729797,
0.11083241552114487,
-0.13388843834400177,
-0.1993151158094406,
0.26533254981040955,
-0.11537659913301468,
-0.18121187388896942,
-0.5223818421363831,
-0.2761060297489166,
0.6337096691131592,
-0.4033218026161194,
0.240577533841... | |
Good morning, all. This is my first question on stackoverflow, so hopefully this isn't something that's been beaten to death and I haven't been able to find it.
I'm developing an application that is going to be distributed shrinkwrapped. We have gotten the rights to distribute SQL Server 2008 Express Edition with our ... | [
0.4439423978328705,
0.2691945433616638,
0.34768012166023254,
0.2734600901603699,
-0.176430344581604,
-0.3910145163536072,
0.1455215960741043,
0.1774808168411255,
-0.33618009090423584,
-0.6911782026290894,
0.13280528783798218,
0.37118107080459595,
0.06054415926337242,
0.12417396903038025,
... | |
;)
The road I had started going down was to include the self-extracting EXE with our package, then use a custom install action to extract it and pass command line arguments to the SQL installer to create our named instance. Here's where the problem comes in.
Extraction is fine. I can run the script from Windows and i... | [
-0.09333799034357071,
0.3387482166290283,
0.2136765867471695,
-0.05654145032167435,
-0.0054273600690066814,
-0.02107715979218483,
0.3492399752140045,
0.02988448366522789,
-0.057906631380319595,
-0.45339223742485046,
0.14166593551635742,
0.9064450860023499,
-0.4430079460144043,
0.1125439479... | |
SQL Server finishes, so we're essentially at a deadlock until SQL finally gives up and errors out.
What I WANT is a named instance of SQL server for my application that is installed with it and gets uninstalled with it. Writing my own installer is not an option because of time, and my coworker says InstallShield is no... | [
0.5083881616592407,
0.4972148537635803,
0.24737995862960815,
0.029315145686268806,
0.0958862230181694,
-0.43702220916748047,
0.2741355895996094,
0.2948632836341858,
-0.05786509066820145,
-0.4614972770214081,
0.16657736897468567,
0.5670154094696045,
-0.17769627273082733,
0.2792110741138458,... | |
information on SO...from everything that I've been able to tell, it just isn't possible to install a custom instance of SQL Server (2008 anyway, and probably 2005) that is linked to the installation of custom software without going down the road of either a custom bootstrapper or a third-party installer product (Instal... | [
0.277622252702713,
0.16846944391727448,
0.29698964953422546,
0.26297271251678467,
0.02988218516111374,
-0.4680265486240387,
0.07242166250944138,
0.04959193617105484,
-0.44411852955818176,
-0.29331904649734497,
0.29936352372169495,
0.432451993227005,
0.029335852712392807,
0.1392951458692550... | |
I'm trying to use Telerik's RadSpell to spellcheck some text when the user submits it.
The way this is supposed to work is by stopping the postback, triggering the spellcheck through javascript, then in the spellcheckfinished event manually starting the real postback. The problem is that in the last step the Clicked ... | [
0.14887791872024536,
0.04557206854224205,
0.5503597855567932,
-0.40628066658973694,
-0.11562817543745041,
-0.10106421262025833,
0.7255753874778748,
-0.48076897859573364,
0.21063734591007233,
-0.5802817344665527,
-0.15139979124069214,
0.6354735493659973,
-0.2986307442188263,
-0.107106678187... | |
btnClicked = btnTrigger;
var spell = GetRadSpell('<%= rsMessage.ClientID %>');
// spell.add_clientCheckFinished(checkFinished);
spell.startSpellCheck();
return false;
}
function checkFinished(sender, args)
{
args.SuppressCompleteMessage = true;
setTimeout('... | [
0.048319727182388306,
-0.17448435723781586,
0.8004274964332581,
-0.43686550855636597,
0.24126943945884705,
-0.11563031375408173,
0.9457073211669922,
-0.4981454908847809,
-0.25175920128822327,
-0.24827151000499725,
-0.323283851146698,
0.4307653605937958,
-0.479622483253479,
0.12345907837152... | |
{
WebForm_DoPostBackWithOptions(
new WebForm_PostBackOptions(btnClicked.id, '', true, '', '', false, true)
);
}
</script>
<tr>
<td>
<asp:Button ID="btnSubmit" OnClientClick="return doSpellCheckStuff(this);" Text="Submit" | [
0.1272369921207428,
-0.037471819669008255,
0.44380319118499756,
-0.08065788447856903,
-0.07120627909898758,
0.15371713042259216,
0.574040949344635,
-0.5348808765411377,
0.248586505651474,
-0.836162805557251,
-0.40683865547180176,
0.3297501802444458,
-0.12420664727687836,
0.0955292358994484... | |
OnClick="btnSubmit_Click" runat="server" />
</td>
<telerik:RadSpell ID="rsMessage" ControlToCheck="txtMessage" ButtonType="None"
UseClassicDialogs="true" FragmentIgnoreOptions="All" | [
0.04836250841617584,
-0.050336625427007675,
0.22550268471240997,
0.15517200529575348,
0.056483179330825806,
-0.12768326699733734,
0.4132063388824463,
-0.32652023434638977,
-0.2621840834617615,
-0.37319642305374146,
-0.38711783289909363,
0.31936943531036377,
-0.34183886647224426,
0.14961588... | |
OnClientCheckFinished="checkFinished" runat="server" />
</tr>
```
Any idea why btnSubmit\_Click isn't getting called and how I can fix it?
Try to inject your postback script as :
```
string script = @"function MySubmit(){" +
this.Page.ClientScript.GetPostBackEventReference(myButton, string... | [
0.12133482843637466,
-0.08803495764732361,
0.7488916516304016,
-0.10027942806482315,
0.19846947491168976,
0.03084949590265751,
0.3657830059528351,
0.0015592119889333844,
-0.05311733856797218,
-0.6395651698112488,
-0.3159309923648834,
0.52386474609375,
-0.5254728198051453,
0.124824933707714... | |
I have a task to validate addresses entered into a system I am currently creating. The system requires that address entered are validated against a valid data source. In the UK the dataset comes from the Royal Mail and is expensive to access.
The data needed is post code info for the whole of europe to start with acc... | [
0.7147982716560364,
0.2894260287284851,
0.853050708770752,
-0.19911658763885498,
0.2207183688879013,
0.05062321946024895,
0.13119754195213318,
-0.3131549656391144,
-0.07220237702131271,
-0.3903349041938782,
-0.050698913633823395,
0.05263935402035713,
0.06312350183725357,
0.2517380118370056... | |
Ireland
I was also wondering if there would be a way to utilize the Google Maps API to validate this data via postal code and country.
Would the google maps method be possible or do I have to go down the line of one of these expensive companies? Any thoughts on what line I should take.
The answer probably depends ho... | [
0.19496916234493256,
0.1306326985359192,
-0.011585072614252567,
-0.39737480878829956,
0.16390739381313324,
0.07919318974018097,
0.2787458598613739,
0.5066947340965271,
-0.6792358160018921,
-0.20340606570243835,
-0.05149407312273979,
-0.07131346315145493,
-0.01415505912154913,
-0.1358636468... | |
a given address. If the address is not found (invalid), you will receive an appropriate response. Here's a useful page: <http://code.google.com/apis/maps/documentation/services.html#XML_Requests>
Note that Google's aim in providing the Maps API is to plot addresses on actual maps. While you can certainly use the data ... | [
0.24248801171779633,
-0.1223863810300827,
0.7580900192260742,
0.5023175477981567,
-0.05327415466308594,
-0.1602262705564499,
0.11055216938257217,
-0.15051236748695374,
-0.06976266950368881,
-0.7374178767204285,
-0.2653387486934662,
0.1348082721233368,
-0.01000592764467001,
-0.0707019567489... | |
you get what you pay for ;) . If you have the time, though, why not try implementing a Google-based solution then going from there? The API looks pretty slick, and it's free, after all. | [
0.6190156936645508,
-0.10002018511295319,
0.2302369773387909,
0.6285234689712524,
0.13959155976772308,
-0.0677395761013031,
-0.014685926958918571,
0.32956624031066895,
-0.06709498167037964,
-0.3175044357776642,
0.21277035772800446,
0.6619380712509155,
0.22540707886219025,
-0.12147153913974... | |
We have Informix running on our Solaris server and under `/usr/informix/bin` there are several executables, such as `'dbaccess'` and `'isql'`.
Each of them produce different version information when typing 'isql -V' for example.
How do you identify the exact version of the SE running?
**Output:**
```
'esql -V'
INFO... | [
0.47430312633514404,
0.10398901998996735,
0.6878901720046997,
0.05220867693424225,
-0.09967237710952759,
-0.0920940563082695,
-0.19979503750801086,
0.15706904232501984,
0.22601206600666046,
-0.8344215750694275,
-0.21838894486427307,
0.4452028274536133,
-0.08215032517910004,
-0.095448158681... | |
version unless there was at some time a copy of Informix Dynamic Server (or Informix OnLine Dynamic Server as it would have been labelled back then).
All the software is seriously archaic. Version 6.03 of ISQL was released circa 1996; SE 7.13 would be a little earlier, if anything. The ESQL/C was probably released in ... | [
-0.1897023320198059,
-0.1883784383535385,
1.2500778436660767,
0.11627349257469177,
-0.4648621380329132,
-0.3291332721710205,
0.10316441208124161,
0.3003278076648712,
-0.4957030415534973,
-0.2786153554916382,
0.12434659898281097,
0.3666774034500122,
-0.3684348464012146,
0.19952435791492462,... | |
minimum version numbers. However, the problems with SE and Y2K were far less serious than with other versions. The main issue is that the code will add 1900 to 2-digit years, not 2000.
The current version of SE is 7.26; the current version of ISQL is 7.50; the current version of ESQL/C is (don't ask) 3.50. | [
0.3143431842327118,
-0.05904434621334076,
1.1628141403198242,
0.04241172596812248,
0.16582061350345612,
-0.32777705788612366,
-0.09562812000513077,
-0.08510039001703262,
0.07944586873054504,
-0.4594019651412964,
-0.06998638063669205,
0.37602630257606506,
-0.02524087019264698,
-0.1855066567... | |
This is one of an interview question which I had recently. I would like to know others perception of approach for this problem.
**Question:**
You are given a structure which holds employee details with two elements, `int` department and `string` name.
```
struct Employee
{
string Name;
int Dept;
}
```
You... | [
-0.023763444274663925,
0.15062935650348663,
0.11951763927936554,
0.15259501338005066,
0.4129648208618164,
0.30915138125419617,
-0.2152494192123413,
-0.23154956102371216,
-0.31497591733932495,
-0.40122687816619873,
-0.32498300075531006,
0.3308626115322113,
-0.13352811336517334,
0.2731313705... | |
0s in the original record should be maintained.
For example, given the following sample data:
```
Name Dept
X1 0
X2 1
X3 0
X4 1
X5 0
```
after sorting the result should be:
```
Name Dept
X2 | [
0.10571344941854477,
0.07804101705551147,
0.04530540108680725,
-0.2764935791492462,
0.21297279000282288,
0.19123898446559906,
0.10041093826293945,
-0.3651508092880249,
-0.09411443024873734,
-0.1973804384469986,
-0.3697769343852997,
0.16362908482551575,
-0.2497519850730896,
0.44334164261817... | |
1
X4 1
X1 0
X3 0
X5 0
```
The algorithm should be stable and the time complexity should be O(N), with constant space for additional variables (which means sorting should be done in-place).
Okey, here is my approach.
e.g a[] = { 1,0,0,0,1,1,1,0,0,1};
**Pseudocode:**
1. Have ... | [
-0.08076491206884384,
0.3259055018424988,
0.32004714012145996,
-0.3499714434146881,
-0.00987242441624403,
0.22614796459674835,
0.32971853017807007,
-0.7217802405357361,
-0.43880876898765564,
-0.49425408244132996,
-0.15133006870746613,
0.13444805145263672,
-0.49068015813827515,
0.0073080891... | |
arr[ i ] = count1++;
} else {
arr[ i ] = count2++
};
```
3. At the end of the traversal, you have array filled with numbers 0 to n-1 like:
```
a[ ] = { 0, 5, 6, 7, 1, 2, 3, 8, 9 4}
```
4. Now the problem comes to sort the above resultant array, this can be done in O(N) as below:
```
for(j = 0; j <= 1; j++)
... | [
-0.4550575315952301,
0.26093557476997375,
0.5727379322052002,
-0.6624678373336792,
-0.05995507910847664,
0.2918105721473694,
0.44350528717041016,
-0.9462642669677734,
-0.3471326231956482,
-0.19398163259029388,
-0.1299671083688736,
0.4326571524143219,
-0.27972301840782166,
0.009000241756439... | |
i ] != i)
{
swap(arr[ i ], arr[ arr[ i ] ]);
}
}
}
```
Note: j loop runs only twice irrespective on 'n' and has constant complexity. The order of this whole loop is 2\*n = O(n).
5. After the array is sorted, Again traverse through the array and set elements `arr[0]` to `arr[n... | [
-0.16324444115161896,
0.11309964954853058,
0.2921734154224396,
-0.4192293584346771,
0.11345245689153671,
0.10911811143159866,
0.563764214515686,
-0.7753772735595703,
-0.3093987703323364,
-0.531048059463501,
-0.34994199872016907,
0.46276697516441345,
-0.20939213037490845,
0.0971516668796539... | |
is constant and time complexity is O(step2) + O(step4) + O(step5) = n + 2n +n = 4\*n = O(n). | [
-0.5224258303642273,
-0.06757307797670364,
0.516752302646637,
-0.40521228313446045,
0.45605286955833435,
0.46776384115219116,
0.3566943109035492,
-0.6107190847396851,
-0.20884381234645844,
-0.6720725297927856,
-0.30625247955322266,
0.41582149267196655,
-0.09498445689678192,
0.0557826422154... | |
I have a SQLServer 2005 Reporting Services ServerReport deployed and frequently used by my Winforms app (Framework 2.0) via the ReportViewer control.
What I need is to provide a one-click print button from one of the forms of the app that triggers only the print dialog, without bringing up the ReportViewer.
I've bee... | [
0.22349902987480164,
0.21105924248695374,
0.4901553690433502,
-0.02024306170642376,
-0.37248697876930237,
-0.18375080823898315,
0.3250311613082886,
-0.0710674300789833,
-0.13828180730342865,
-0.7147157192230225,
0.28824692964553833,
0.666200578212738,
-0.314516544342041,
-0.066990546882152... | |
reference to local reports:
<http://msdn.microsoft.com/en-us/library/ms252091(VS.80).aspx>
And the little information that I can get on server side reports are using Web references to the ReportServer web service, and I don't want that.
<http://blogs.msdn.com/bryanke/articles/71491.aspx>
Is there any way to print a... | [
0.4225451946258545,
0.10107728093862534,
0.45663982629776,
0.2789084017276764,
-0.13767102360725403,
-0.2654716968536377,
0.2318326085805893,
0.2263154834508896,
-0.25387629866600037,
-0.5108616948127747,
0.18615230917930603,
0.42528605461120605,
-0.15615905821323395,
-0.010823092423379421... | |
asking the user for the printer settings:
```
Dim doc As New Printing.PrintDocument()
AddHandler doc.PrintPage, AddressOf PrintPageHandler
Dim dialog As New PrintDialog()
dialog.Document = doc
Dim print As DialogResult
print = dialog.ShowDialog()
doc.PrinterSettings = dialog.PrinterSettings
```
Having that, we proce... | [
0.07100971043109894,
-0.11784996092319489,
1.282166600227356,
-0.21112394332885742,
0.036932747811079025,
-0.0332346111536026,
-0.22398962080478668,
-0.3809064030647278,
-0.28340086340904236,
-0.5979694724082947,
0.004927337169647217,
0.616407573223114,
-0.2702450156211853,
-0.056843426078... | |
warnings() As Warning
Dim streamids() As String
Dim mimeType, encoding, filenameExtension, path As String
mimeType = "" : encoding = "" : filenameExtension = ""
```
Finally, we render the report with all its pages.
Note that if the report has only one page, the renderStream method is never used.
rpt\_control is th... | [
0.030855288729071617,
0.0379234179854393,
0.9444329738616943,
-0.19210417568683624,
-0.14105643332004547,
-0.07634693384170532,
0.20845487713813782,
-0.2433016002178192,
-0.1738320291042328,
-0.5227381587028503,
-0.183221697807312,
0.6110203862190247,
-0.5453982353210449,
0.096526987850666... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.