text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
that doesn't work in IE6.
I'd really like not having to add a load of javascript for image replacing/preloading (embedding something like jQuery isn't an option) - can anyone help me here?
Thanks,
IE doesn't repaint anchors unless any rule on `<a>` itself changes. Add anything for `a:hover`, e.g.:
```
#navigation a... | [
0.48072147369384766,
0.07329832762479782,
0.465876966714859,
0.060023900121450424,
-0.08133992552757263,
-0.188556969165802,
0.261692613363266,
0.45261523127555847,
-0.20101898908615112,
-0.9657569527626038,
0.088335782289505,
0.5479062795639038,
-0.111020527780056,
-0.0039445459842681885,... | |
There is a simple C++ method to use pattern matching on strings? The code should sound like this:
```
if (regexpcmp("l?nole*[0-9]", "linoleum1")) {
//we have a match!
} else {
//no match
}
```
Not in the core language. Use Boost.Regex or an external library like `pcre`. In a unix environment you almost certainl... | [
0.14043031632900238,
-0.11451154947280884,
0.28295502066612244,
0.0444302074611187,
-0.07801444828510284,
-0.24801166355609894,
-0.046271391212940216,
-0.15039779245853424,
0.09386990964412689,
-0.41910114884376526,
-0.14156922698020935,
0.8818255066871643,
-0.5420311689376831,
-0.30510970... | |
I have `DataTemplate` containing a `TextBox`. I'm setting this template to a listbox item on a selection.
I'm unable to set focus to textbox in the template. I tried to call MyTemplate.FindName, but it ends up with an Invalid Operation Exception: This operation is valid only on elements that have this template applied... | [
0.1521865576505661,
0.016980675980448723,
0.33149686455726624,
-0.10807973891496658,
-0.025431256741285324,
-0.08099763095378876,
-0.006995614152401686,
-0.2940458655357361,
-0.19288356602191925,
-0.752007782459259,
-0.05635814741253853,
0.4716073274612427,
-0.3021962344646454,
0.090916126... | |
as ListBoxItem;
```
Then you can pass that into this little helper function which focuses a control based on its name:
```
public void FocusItem(ListBoxItem item, string name)
{
if (!item.IsLoaded)
{
// wait for the item to load so we can find the control to focus
RoutedEventHandler onload = ... | [
0.3636293113231659,
-0.39100825786590576,
0.551013708114624,
-0.18091101944446564,
0.03905504569411278,
0.013193158432841301,
0.10027176141738892,
-0.12381792813539505,
-0.2703441381454468,
-0.34147441387176514,
-0.36415010690689087,
0.6007124781608582,
-0.5822834372520447,
0.0303617827594... | |
FocusItem(item, name);
};
item.Loaded += onload;
return;
}
try
{
var myTemplate = FindResource("MyTemplateKey") as FrameworkTemplate; // or however you get your template right now
var ctl = myTemplate.FindName(name, item) as FrameworkElement;
ctl.Focus();
... | [
0.3849261701107025,
-0.2710140347480774,
0.6788180470466614,
-0.3073979914188385,
0.08549470454454422,
0.21624699234962463,
0.39503347873687744,
-0.2846755087375641,
-0.09394584596157074,
-0.60895836353302,
-0.36151671409606934,
0.5378313660621643,
-0.4308144748210907,
0.14354798197746277,... | |
catch
{
// focus something else if the template/item wasn't found?
}
}
```
I guess the tricky bit is making sure you wait for the item to load. I had to add that code because I was calling this from the `ItemContainerGenerator.StatusChanged` event and sometimes the `ListBoxItem` hadn't been fully init... | [
0.34879910945892334,
-0.3548376262187958,
0.26202356815338135,
-0.10243041068315506,
-0.06270658224821091,
-0.3116653561592102,
-0.052330806851387024,
0.08764942735433578,
-0.4627891480922699,
-0.3373313844203949,
0.14043551683425903,
0.613979697227478,
-0.16906562447547913,
-0.01490843389... | |
Well basically I have this script that takes a long time to execute and occasionally times out and leaves semi-complete data floating around my database. (Yes I know in a perfect world I would fix THAT instead of implementing commits and rollbacks but I am forced to not do that)
Here is my basic code (dumbed down for ... | [
0.17880964279174805,
0.3095824122428894,
0.21008215844631195,
-0.30720624327659607,
0.16724562644958496,
-0.28446370363235474,
0.31757643818855286,
-0.3024674952030182,
-0.04215003550052643,
-0.7875073552131653,
0.22238358855247498,
0.5032057166099548,
-0.3760168254375458,
0.19538152217864... | |
process within that while loop isn't complete then I don't want the row inserted to remain there. I think that somehow I could use commits/rollbacks at the beginning and end of the while loop to do this but don't know how.
Take a look at [this tutorial](http://www.phpro.org/tutorials/Introduction-to-PHP-PDO.html#11) on... | [
0.04332435503602028,
0.07529698312282562,
0.4109155535697937,
-0.05480926111340523,
0.09357083588838577,
-0.04778872802853584,
0.15581831336021423,
-0.10529134422540665,
-0.25126728415489197,
-0.40611177682876587,
0.006236070767045021,
0.5266978740692139,
-0.04857310652732849,
0.0920000821... | |
really, you ought to redesign this so that it doesn't depend on the scriipt staying alive. | [
0.21056540310382843,
-0.008173594251275063,
0.07192357629537582,
0.4256878197193146,
0.49716851115226746,
-0.1816355288028717,
0.00026654964312911034,
0.2936097979545593,
-0.3262205421924591,
-0.3435029685497284,
0.13717439770698547,
0.2139163613319397,
0.03520517796278,
-0.154043063521385... | |
I'd like to run some small private/home applications on a local machine, but I dislike the idea to set up a full Win2003 Server with IIS for this.
Is there a easy and cheap way to get an ASP.Net application running at home?
Windows 2000 has ASP, Windows XP Professional also can run it. Look up how to turn on IIS, the... | [
0.19428111612796783,
0.10566039383411407,
0.05287812277674675,
0.2098139077425003,
-0.05381076782941818,
-0.2632480561733246,
0.16151545941829681,
0.10994581133127213,
-0.1490209996700287,
-0.510809600353241,
0.0815797671675682,
0.77428138256073,
-0.08058735728263855,
0.016989771276712418,... | |
One thing I really like about AS3 over AS2 is how much more compile-time type-checking it adds. However, it seems to be somewhat lacking in that there is no type-checked enumeration structure available. What's a good (best / accepted) way to do custom enumerated types in AS3?
your answer after the jump :-)
[Enumeratio... | [
0.20629025995731354,
-0.08135578036308289,
0.16551434993743896,
-0.11337190866470337,
-0.43214845657348633,
-0.02617521956562996,
0.6465207934379578,
-0.45659807324409485,
-0.30951127409935,
-0.34568849205970764,
-0.3067265450954437,
0.27422839403152466,
-0.2290135771036148,
-0.31889539957... | |
How do I achieve authorization with MVC asp.net?
Use the Authorize attribute
```
[Authorize]
public ActionResult MyAction()
{
//stuff
}
```
You can also use this on the controller. Can pass in users or roles too.
If you want something with a little more control, you could try something like [this](http://schotim... | [
0.2753247916698456,
-0.3636651933193207,
0.7125526070594788,
-0.0022150021977722645,
0.2963729202747345,
-0.28602826595306396,
0.29783397912979126,
-0.5557816028594971,
-0.1925337016582489,
-0.41765856742858887,
-0.15455412864685059,
0.6210227012634277,
-0.20953674614429474,
0.061456058174... | |
(!httpContext.User.Identity.IsAuthenticated)
return false;
if (users.Length > 0 &&
!users.Contains(httpContext.User.Identity.Name,
StringComparer.OrdinalIgnoreCase))
return false;
return true; | [
-0.1003400981426239,
-0.012092016637325287,
0.539636492729187,
-0.20282994210720062,
0.07211858034133911,
-0.08845678716897964,
0.47064390778541565,
-0.26246708631515503,
-0.05538453161716461,
-0.48782140016555786,
-0.5186870098114014,
0.4833570718765259,
-0.3281082510948181,
0.18488295376... | |
}
}
``` | [
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,
... | |
In a WPF UserControl, I have to make to call to a WebService. I am making this call on a separate thread but I want to inform the user that the call may take some time.
The WebMethod returns me a collection of objects and I bind it to a ListBox in my UC. So far, so good... This part works really well. However, **I wa... | [
0.30770227313041687,
-0.18060019612312317,
0.7217268347740173,
-0.009694769978523254,
-0.1479608118534088,
0.13280001282691956,
0.20197364687919617,
-0.2852232754230499,
-0.259612113237381,
-0.8843356966972351,
0.10450056195259094,
0.40939033031463623,
-0.14047649502754211,
0.0428077466785... | |
have to draw all controls in protected override void OnRender(DrawingContext drawingContext)... I simply want to add a control for a couple of seconds...
Anybody has an idea of how I could achieve this?
Thanks!
Don't go with the adorner - what I do is have two separate container controls (usually grids) that occupy t... | [
-0.16995525360107422,
-0.12505710124969482,
0.6147974133491516,
-0.057274170219898224,
-0.015693120658397675,
-0.09456895291805267,
0.25306665897369385,
-0.03876034542918205,
-0.12206841260194778,
-0.8143200278282166,
0.009601892903447151,
0.34220388531684875,
-0.16689546406269073,
0.23422... | |
asynchronous call to the webservice you can make the progress control visible and the content control collapsed. When the webservice finishes, have it use Dispatcher.BeginInvoke to update the UI, and at that point, switch the progress control back to collapsed and the content control back to visible.
I generally make ... | [
-0.1879507452249527,
-0.052965302020311356,
0.6024986505508423,
-0.08178817480802536,
0.013469846919178963,
-0.09999488294124603,
0.22412849962711334,
0.15536528825759888,
-0.19831861555576324,
-1.0729295015335083,
-0.3327392637729645,
0.3583519756793976,
-0.2678380608558655,
0.35590937733... | |
<!-- snip -->
</Grid>
<controls:ProgressGrid x:Name="progressGrid" Text="Signing in, please wait..." Visibility="Collapsed"/>
</Grid>
```
And in the code behind, just something simple like this:
```
private void SignInCommand_Executed(object sender, ExecutedRoutedEventArgs e)
{
c... | [
-0.11752896755933762,
-0.1535583734512329,
0.48262789845466614,
-0.16999457776546478,
0.1620672345161438,
0.05696041136980057,
0.4257766306400299,
-0.0905618816614151,
-0.2245415300130844,
-0.8211641311645508,
-0.3084698021411896,
-0.016774924471974373,
-0.3858802020549774,
0.0801355615258... | |
I use svn:externals to reference several open source projects. I then make some local changes to one of these external projects. Obviously I cannot check these changes back into the external repository. How do I keep these changes in my repository while still maintaining the ability to easily incorporate external chang... | [
0.4447938799858093,
0.1793716847896576,
0.1577187180519104,
-0.2640821039676666,
-0.1371673345565796,
-0.0847935602068901,
0.37644103169441223,
0.1281290352344513,
-0.39586323499679565,
-0.49219122529029846,
0.15275605022907257,
0.7793461680412292,
-0.2240304797887802,
0.09095866233110428,... | |
external project in a ['vendor branch'](http://svnbook.red-bean.com/en/1.5/svn.advanced.vendorbr.html).
* import a copy of the external code into a separate project in your repository
* create a branch of it in your own project, to which you can add your own modifications
* regularly, you update the project's code in ... | [
0.09318932145833969,
-0.021740766242146492,
-0.11241727322340012,
0.07473649084568024,
-0.06880626082420349,
0.11097622662782669,
0.2102811485528946,
0.0664583295583725,
-0.2541888356208801,
-0.460701584815979,
-0.28347936272621155,
0.370604008436203,
-0.040225956588983536,
0.2884921431541... | |
i have a few classes that i am trying to move to using generics
Class1: Curve
this class has the following code:
```
public class Curve : IEnumerable
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator(); // Calls non-interface method
}
public RTRatePointEnumerator GetEnumerator()
... | [
-0.0962722897529602,
-0.19871695339679718,
0.4741785228252411,
-0.24787607789039612,
-0.17589567601680756,
0.011684805154800415,
0.1361820101737976,
-0.21813873946666718,
0.07926850765943527,
-1.030727744102478,
0.09327003359794617,
0.7582324743270874,
-0.3150438070297241,
0.15369343757629... | |
to guess based on the names it's RTRatePoint and CurvePoint. I would change the code to be the following
```
class Curve: IEnumerable<RTRatePoint> {
IEnumerator<RTRatePoint> IEnumerable<RTRatePoint>.GetEnumerator() {
return GetEnumerator();
}
public RTRatePointEnumerator GetEnumerator() {
return new RT... | [
0.026859639212489128,
-0.2492332011461258,
0.18993328511714935,
0.15973632037639618,
0.0030266272369772196,
-0.06642182171344757,
0.1429697871208191,
-0.5620152950286865,
0.08015533536672592,
-1.0004040002822876,
0.16740740835666656,
0.7316262125968933,
-0.18049058318138123,
0.049096535891... | |
// Nothing to see here
}
``` | [
0.5588428974151611,
0.6241762638092041,
-0.07916321605443954,
-0.17490163445472717,
0.26983189582824707,
-0.24208000302314758,
0.3214403986930847,
0.5659730434417725,
-0.18041875958442688,
-0.35652947425842285,
-0.1443050503730774,
0.41362226009368896,
-0.1808135062456131,
0.30794760584831... | |
I really love the way Ajax makes a web app perform more like a desktop app, but I'm worried about the hits on a high volume site. I'm developing a database app right now that's intranet based, that no more then 2-4 people are going to be accessing at one time. I'm Ajaxing the hell out of it, but it got me to wondering,... | [
0.3674314022064209,
0.35476154088974,
0.20196688175201416,
0.3477246165275574,
-0.1791943609714508,
-0.3937196731567383,
0.20600871741771698,
0.5119625329971313,
-0.42901676893234253,
-0.7110229730606079,
0.31037479639053345,
0.60721755027771,
0.20985279977321625,
0.018169071525335312,
0... | |
theory, only updating the parts that need updating.
I'm curious if any of you have used Ajax on high volume sites and in what capacity did you use it? Does it create scaling issues?
On my current project, we do use Ajax and we have had scaling problems. Since my current project is a J2EE site that does timekeeping fo... | [
0.3591449558734894,
0.06968379020690918,
0.0805128663778305,
0.4180437922477722,
-0.2884446084499359,
-0.06744415313005447,
0.07785774022340775,
0.1278829276561737,
-0.3623808026313782,
-0.7700404524803162,
0.17164075374603271,
0.36052176356315613,
-0.12002696841955185,
-0.2069995403289795... | |
process the timekeeping for as many employees as possible. This would be akin to how an ERP application might work (or an email application). Consequently our business need is that the browser-side can hold a lot of data, but we don't expect the volume of hits to be a serious problem. So we've kept an XML data island o... | [
0.4972010552883148,
0.10876230150461197,
0.09074506908655167,
0.21360604465007782,
0.05557700991630554,
-0.27085813879966736,
0.12227930128574371,
0.031366314738988876,
-0.2590574026107788,
-0.6233834624290466,
0.0511123351752758,
0.4042404890060425,
0.1402386724948883,
-0.4708717763423919... | |
> **Possible Duplicate:**
>
> [c# - How do I round a decimal value to 2 decimal places (for output on a page)](https://stackoverflow.com/questions/164926/c-sharp-how-do-i-round-a-decimal-value-to-2-decimal-places-for-output-on-a-pa)
I want to truncate the decimals like below
i.e.
* 2.22939393 -> 2.229
* 2.2297777... | [
-0.19572293758392334,
0.3635738492012024,
0.2334989756345749,
0.009314428083598614,
-0.14996959269046783,
0.24000881612300873,
0.282626211643219,
-0.08335011452436447,
-0.39256322383880615,
-0.251171350479126,
0.03540186211466789,
0.4148333668708801,
0.00967023428529501,
-0.024660276249051... | |
I'm trying to display a caret (`^`) in math mode in LaTeX to represent the exclusive or operation implemented in the "C languages". By default, `^` is for creating a superscript in math mode. The closest I can seem to get is by using `\wedge`, which isn't the same.
You might want to use the common symbol for exclusive ... | [
0.20718994736671448,
0.06689385324716568,
0.6394264698028564,
-0.0029744445346295834,
-0.02295723743736744,
0.03400162607431412,
-0.13190993666648865,
0.0040588523261249065,
0.16350044310092926,
-0.5605641603469849,
-0.371653288602829,
0.7408827543258667,
-0.16042858362197876,
-0.084511376... | |
the right spacing around the symbol for a binary operator, and the `\char` ensures that the glyph is obtained from the roman font. | [
-0.1485283374786377,
0.36800476908683777,
0.25845780968666077,
-0.13616669178009033,
0.266613632440567,
0.41077977418899536,
0.036597076803445816,
-0.19039878249168396,
0.20730431377887726,
-0.5713657140731812,
-0.5584112405776978,
0.37466177344322205,
-0.11378053575754166,
-0.219894871115... | |
I have an object, and I want to list all the selectors to which it responds. It feels like this should be perfectly possible, but I'm having trouble finding the APIs.
This is a solution based on the runtime C functions:
class\_copyMethodList returns a list of class methods given a Class object obtainable from an objec... | [
0.090748131275177,
-0.006887760944664478,
0.6887990236282349,
-0.10817363113164902,
0.0538492277264595,
0.1570160686969757,
0.24881741404533386,
-0.45217621326446533,
-0.07877621054649353,
-0.794920027256012,
-0.18670764565467834,
0.4981345534324646,
-0.3734992444515228,
0.1488438844680786... | |
I am trying to establish the best practice for handling the creation of child objects when the parent object is incomplete or doesn't yet exist in a web application. I want to handle this in a stateless way so in memory objects are out.
For example, say we have a bug tracking application.
A Bug has a title and a desc... | [
0.425106942653656,
0.28905364871025085,
0.06098417937755585,
0.33904314041137695,
0.4272989332675934,
0.06363838911056519,
-0.05492083355784416,
0.19941508769989014,
-0.345893532037735,
-0.8766351342201233,
-0.015016860328614712,
0.2631424069404602,
-0.12343324720859528,
0.3236214518547058... | |
add the attachments but we haven't created the Parent Bug as yet.
How do you handle persisting the added attachments ?
Obviously we have to keep track of the attachments added, but at this point we haven't persisted the parent "Bug" object to attach the "Attachment" to.
Create the incomplete bug and define a process... | [
0.39380741119384766,
0.22576655447483063,
0.13300640881061554,
0.4171479344367981,
0.16608725488185883,
-0.19748559594154358,
0.2548474073410034,
-0.05379848927259445,
-0.33436277508735657,
-0.5988737344741821,
-0.17121686041355133,
0.5857115387916565,
-0.11209288239479065,
0.2462177425622... | |
somewhere other than you'd attended. Or it may only contain scattered data points which are meaningless on their own - but could corroborate another user's report. | [
0.7295787930488586,
-0.03250066190958023,
0.09505918622016907,
0.6341906785964966,
0.22601290047168732,
-0.4800158739089966,
0.1257862001657486,
0.36916807293891907,
-0.27131950855255127,
-0.061662327498197556,
-0.19609929621219635,
-0.09348092973232269,
0.2236628234386444,
0.0497880950570... | |
I have a simple row that I edit using LINQ. It has about 30 columns, including a primary key numeric sequence.
When an UPDATE is performed through LINQ, the UPDATE statement includes all the columns of the table (for concurrency checking).
I'm wondering how inefficient this is - if not negligibiel. Since there is an... | [
-0.005132276099175215,
0.36866524815559387,
0.7278099060058594,
-0.0819212794303894,
-0.1502675712108612,
0.537477433681488,
-0.04602601379156113,
-0.382453590631485,
-0.1283194124698639,
-0.5143886208534241,
0.0644136592745781,
0.45340368151664734,
-0.3883781135082245,
-0.0137190306559205... | |
I've seen this UPDATE take over a second in some cases, which just doesnt seem right. There may be other long running operations things going on but it made me curious as to whether or not I should be worried.
I know I can set 'UpdateCheck' to never for all the other fields, but this is a pain.
Is there a way to tur... | [
0.4258090555667877,
-0.18265654146671295,
0.6727522015571594,
0.004983266815543175,
-0.07898149639368057,
-0.28326261043548584,
0.3458442687988281,
-0.06519430130720139,
-0.31977128982543945,
-0.7052828073501587,
-0.06758096814155579,
0.7216378450393677,
-0.19299116730690002,
0.16551490128... | |
@p13
WHERE ([SiteVisitId] = @p0) AND ([SiteUserId] IS NULL) AND ([ClientGUID] = @p1) AND ([ServerGUID] IS NULL) AND ([UserGUID] = @p2) AND ([SiteId] = @p3) AND ([EntryURL] = @p4) AND ([CampaignId] = @p5) AND ([Date] = @p6) AND ([Cookie] IS NULL) AND ([UserAgent] = @p7) AND ([Platform] IS NULL) AND ([Referer] = @p8) AND... | [
0.04875553771853447,
-0.3179437518119812,
0.5683014392852783,
-0.1450420469045639,
-0.23087166249752045,
0.3576495945453644,
0.2535209059715271,
-0.33442673087120056,
-0.4388312101364136,
-0.5524824261665344,
-0.04286990314722061,
0.18972067534923553,
-0.10774940252304077,
-0.3100643455982... | |
AND ([ContentActivatedTime] IS NULL) AND ([ContentCompleteTime] IS NULL) AND ([MasterVersion] = @p11) AND ([VisitedHome] IS NULL) AND ([VisitedStore] IS NULL) AND ([VisitedVideoDemos] IS NULL) AND ([VisitedProducts] IS NULL) AND ([VisitedAdvantages] IS NULL) AND ([VisitedGallery] IS NULL) AND ([VisitedTestimonials] IS ... | [
-0.37702518701553345,
0.08842425793409348,
1.0357304811477661,
0.1899188756942749,
0.12376436591148376,
0.005213695578277111,
0.4647049009799957,
0.15712693333625793,
-0.5217488408088684,
-0.7650900483131409,
-0.38491225242614746,
0.77435702085495,
-0.6162254214286804,
0.4789208173751831,
... | |
satisfied by any part of the where clause, then that will be used. The cost for checking the other columns is negligible. You can confirm this by enabling the execution plan display in SQL management studio (or query analyzer for older versions of SQL Server) and run your update.
Long execution times is most likely ca... | [
0.44937872886657715,
-0.09513911604881287,
0.36483463644981384,
0.13718779385089874,
0.3349074125289917,
-0.4580901563167572,
0.2752293646335602,
-0.12154097110033035,
-0.1829678863286972,
-0.5059604048728943,
-0.23276519775390625,
0.6639783382415771,
-0.17149730026721954,
-0.0670552700757... | |
I'm trying to see if anyone knows how to cluster some Lat/Long results, using a database, to reduce the number of results sent over the wire to the application.
There are a number of resources about how to cluster, either on the client side OR in the server (application) side .. but not in the database side :(
[This ... | [
0.16508610546588898,
0.16639266908168793,
0.34827008843421936,
0.10722999274730682,
0.3014383316040039,
-0.1539200097322464,
0.020529497414827347,
0.08656357228755951,
-0.49344560503959656,
-0.6138618588447571,
0.14070485532283783,
0.22529472410678864,
0.12307316064834595,
0.02952616102993... | |
a hawt and sexy DB challenge?
please help :)
EDIT 1: Clarification - by clustering, i'm hoping to group `x` number of points into a single point, for an area. So, if i say cluster everything in a 1 mile / 1 km square, then all the results in that 'square' are GROUP'D into a single result (say ... the middle of the sq... | [
0.19746218621730804,
-0.02032972313463688,
0.6435146927833557,
0.21588481962680817,
-0.5220350623130798,
-0.14559437334537506,
0.32594627141952515,
-0.6391316652297974,
0.037888430058956146,
-0.35426902770996094,
-0.019123360514640808,
0.2806355357170105,
-0.08919231593608856,
-0.051752950... | |
easy to implement & converges quickly, and adapts to your data no matter what it looks like. Plus, you can pick *k* to suit your bandwidth requirements, and each cluster will have the same number of associated points (mod k).
I'd make a table of cluster centroids, and add a field to the original data table to indicate... | [
0.12838877737522125,
-0.10975629091262817,
0.5408251285552979,
0.12309712171554565,
0.291228711605072,
0.07631488889455795,
0.018963687121868134,
-0.08288180828094482,
-0.23842497169971466,
-0.8170163631439209,
-0.0347365140914917,
0.6834640502929688,
-0.23613958060741425,
-0.0290677510201... | |
of the computed centroid vectors so they'd be on the surface of the earth. Otherwise you'd end up with a bunch of points with negative altitude (when converted back to LLH). | [
0.1135602667927742,
-0.216960147023201,
0.7916755080223083,
0.3010569214820862,
-0.028751153498888016,
-0.11389720439910889,
-0.30251362919807434,
-0.15107400715351105,
-0.06463828682899475,
-0.6007696986198425,
-0.17098881304264069,
-0.01669442467391491,
0.012047690339386463,
0.2172610163... | |
I am stuck at properly aligning the generalization arrow between the classes. I could not make them appear as in the UML books.
Visio UML stencils are not very good and is very frustrating to work with them. Have a look at <http://softwarestencils.com/uml/index.html>, there are some very nice, free stencil updates for ... | [
-0.007834368385374546,
-0.06583134829998016,
0.32254037261009216,
0.039203941822052,
-0.12968578934669495,
0.06405365467071533,
0.3258369266986847,
0.3902762532234192,
-0.0890854150056839,
-0.69148850440979,
-0.022251585498452187,
0.5050491094589233,
-0.05581513047218323,
-0.00256871525198... | |
Can someone tell me how to change directories using FtpWebRequest? This seems like it should be an easy thing to do, but I'm not seeing it.
**EDIT**
I just want to add...I don't have my heart set on FtpWebRequest. If there's a better (easier) way to do FTP in .NET please let me know.
---
Apparently there's no way t... | [
0.2655254900455475,
-0.04305095970630646,
0.3362041115760803,
0.3611393868923187,
-0.1355915367603302,
-0.172968327999115,
0.4908082187175751,
0.40404635667800903,
-0.38470160961151123,
-0.7598628997802734,
0.13378116488456726,
0.35898107290267944,
-0.28305673599243164,
0.16059523820877075... | |
found one open source solution that's passed some of my preliminary tests ([.NET FTP Client](http://sourceforge.net/projects/dotnetftpclient/)).
There's a [blog post](http://blogs.msdn.com/mariya/archive/2006/03/06/544523.aspx) from Mariya Atanasova which shows how you can fake it - basically you have to put the direct... | [
0.44912391901016235,
-0.0542362779378891,
-0.15201951563358307,
0.20882008969783783,
0.12488381564617157,
0.14027220010757446,
0.3807438015937805,
0.22830341756343842,
-0.22136306762695312,
-0.10418854653835297,
0.08071105182170868,
0.35763877630233765,
-0.133487731218338,
0.11808140575885... | |
how they can use the CWD command with our FtpWebRequest.
>
>
> The answer is: you cannot use the command directly, but you can modify the uri parameter to achieve the same result.
>
>
> Let's say you're using the following format:
```
String uri = "ftp://myFtpUserName:myFtpUserPassword@myFtpUrl";
FtpWebRequest Req... | [
0.2069084346294403,
-0.0918489471077919,
0.8791325688362122,
0.06757981330156326,
-0.0789123997092247,
-0.14855428040027618,
0.27129223942756653,
-0.2905285656452179,
-0.25227153301239014,
-0.8561580777168274,
-0.1736147403717041,
0.5623669028282166,
-0.1616632342338562,
0.2905021607875824... | |
this uri
```
uri = "ftp://myFtpUserName:myFtpUserPassword@myFtpUrl/%2E%2E/%2E%2E";
```
> This is equivalent to logging in with your user's credentials and then using `cd ../../`
>
>
> Note: if you try using the `”..”` directly without escaping them the uri class will strip them, so `"ftp://myFtpUserName:myFtpUserP... | [
-0.08116204291582108,
0.02304179221391678,
0.6260572671890259,
-0.022219721227884293,
-0.005299276672303677,
-0.3808017075061798,
0.3362520933151245,
-0.06635989248752594,
-0.21083390712738037,
-0.6539689898490906,
-0.36002272367477417,
0.4583553671836853,
-0.3840668201446533,
0.2429866343... | |
then doing
```
Cd /
cd anotherUserDirectory
``` | [
-0.0390726663172245,
0.36134395003318787,
0.28207486867904663,
-0.031643759459257126,
-0.14126351475715637,
-0.5176354050636292,
0.006253151688724756,
0.003932291176170111,
-0.2340097427368164,
-0.4878838360309601,
-0.29946377873420715,
0.6213033199310303,
-0.18379555642604828,
0.050135161... | |
I'm currently working on a DNA database class and I currently associate each row in the database with both a match score (based on edit distance) and the actual DNA sequence itself, is it safe to modify first this way within an iteration loop?
```
typedef std::pair<int, DnaDatabaseRow> DnaPairT;
typedef std::vector<Dn... | [
-0.010904922150075436,
-0.07852950692176819,
0.4133812189102173,
-0.025212936103343964,
-0.025394007563591003,
0.11107160896062851,
-0.08323676884174347,
-0.5405092239379883,
-0.018544210121035576,
-0.7631111145019531,
0.4659462571144104,
0.3427617847919464,
-0.4000004231929779,
0.28193417... | |
maps and received a compilation error about modifying first, but is there perhaps a better way than this to store all the information for sorting later?
To answer your first question, yes. It is perfectly safe to modify the members of your pair, since the actual data in the pair does not affect the vector itself.
**ed... | [
0.28427132964134216,
-0.24287445843219757,
0.3981569707393646,
0.054127082228660583,
-0.07346425205469131,
-0.1799522191286087,
0.18766088783740997,
-0.25029850006103516,
-0.3614010512828827,
-0.9323437809944153,
0.01835220865905285,
0.20364060997962952,
-0.3938254714012146,
0.000716744340... | |
In maps you cannot change first as it would break the invariant of the map being a sorted balanced tree
**edit:** To answer your second question, I see nothing at all wrong with the way you are structuring the data, but I would have the database hold *pointers* to `DnaPairT` objects, instead of the objects themselves.... | [
-0.101510189473629,
-0.2415686547756195,
0.27830958366394043,
-0.023599088191986084,
-0.23938752710819244,
0.059215568006038666,
-0.1156098023056984,
-0.473755419254303,
-0.14609366655349731,
-1.086931824684143,
0.0920262560248375,
0.05823514983057976,
-0.7230907678604126,
-0.2403625398874... | |
for(DnaDatabaseT::iterator it = database.begin(); it != database.end(); it++)
{
int score = (*it)->second.query(query);
(*it)->first = score;
}
}
// custom sorting function to handle DnaPairT pointers
bool sortByScore(DnaPairT * A, DnaPairT * B) { return (A->first < B->first); }
// function to... | [
-0.26849111914634705,
-0.35235241055488586,
0.4152551591396332,
-0.3089888095855713,
0.014836515299975872,
0.3342829942703247,
0.008676761761307716,
-0.608228325843811,
-0.26108217239379883,
-0.3574163317680359,
-0.2101471722126007,
0.16236282885074615,
-0.3983425199985504,
0.1529125124216... | |
// code that uses the sorted database ...
}
```
The only reason you might need to look into more efficient methods is if your database is so enormous that the sorting loop takes too long to complete. If that is the case, though, I would imagine that your `query` function would be the one taking up most of the processi... | [
0.1779640018939972,
0.2579701542854309,
-0.09604398906230927,
0.18833936750888824,
0.012921571731567383,
-0.13984307646751404,
-0.012775448150932789,
-0.02816600538790226,
-0.15754996240139008,
-0.7925514578819275,
-0.09717387706041336,
0.3862197697162628,
-0.24956628680229187,
0.117965042... | |
One concept I've always wondered about is the use of cryptographic hash functions and values. I understand that these functions can generate a hash value that is unique and virtually impossible to reverse, but here's what I've always wondered:
If on my server, in PHP I produce:
```
md5("stackoverflow.com") = "d0cc85b... | [
0.409071147441864,
0.272325724363327,
0.03400823846459389,
-0.03614337742328644,
-0.0013977052876725793,
-0.033579256385564804,
0.02960968390107155,
0.04902908205986023,
-0.3713605999946594,
-0.3765024244785309,
0.22128303349018097,
0.48633477091789246,
-0.08849490433931351,
0.398572236299... | |
these functions that makes the resulting strings impossible to retrace?
The input material can be an infinite length, where the output is always 128 bits long. This means that an infinite number of input strings will generate the same output.
If you pick a random number and divide it by 2 but only write down the remai... | [
-0.0493924580514431,
-0.1533224731683731,
0.21363088488578796,
0.1356179416179657,
0.004916880279779434,
0.395222932100296,
0.14501066505908966,
-0.3340645730495453,
-0.4149962067604065,
-0.29076486825942993,
-0.06706435978412628,
0.33994007110595703,
-0.2777145206928253,
0.192780569195747... | |
When presenting preformatted text on the web (e.g. code samples), line wrapping can be a problem. You want to wrap for readability without scrolling, but also need it to be unambiguous to the user that it is all one line with no line break.
For example, you may have a really long command line to display, like this:
`... | [
0.40155208110809326,
-0.16911369562149048,
0.2701621353626251,
0.11565782129764557,
-0.050596684217453,
-0.10289105027914047,
0.3151554465293884,
0.05452597886323929,
-0.38168850541114807,
-0.47784653306007385,
-0.41963815689086914,
0.20303669571876526,
-0.17304743826389313,
0.239737629890... | |
like this not to wrap.)
Is there a way of styling with CSS to give the same treatment as you see in books? i.e. to wrap the line, but include an image or glyph that indicates a line continuation.
Obviously I am looking for a style that can be applied to all text, and let the browser's XHTML/CSS rendering engine figu... | [
0.2045506089925766,
-0.0559316910803318,
0.3848288357257843,
0.10089059174060822,
0.05341959372162819,
0.0610528364777565,
0.1379648596048355,
-0.017916573211550713,
-0.44887709617614746,
-0.5329266786575317,
-0.20699487626552582,
0.2962431013584137,
-0.3160860538482666,
-0.141338527202606... | |
lines. It requires an image with repeating glyphs in the vertical, which is offset so that it is invisible if only one unwrapped line. The main requirement of this technique is that every line needs to be within a block (e.g. p, span or div). This means it cannot easily be used manually with existing text that is just ... | [
-0.0019303300650790334,
-0.2844845652580261,
0.8147887587547302,
-0.07231228053569794,
0.005480328109115362,
0.41003578901290894,
0.32645490765571594,
-0.10451947897672653,
-0.476172536611557,
-0.4274021089076996,
-0.44418901205062866,
0.19699428975582123,
-0.41015100479125977,
-0.14144611... | |
background: url(wrap-cont-l.png) no-repeat 0 14px; /* move the background down so it starts on line 2 */
text-indent: -21px;
padding-left: 14px;
margin: 0 0 2px 7px;
}
.wrap-cont-r {
margin-left: 24px;
margin-bottom: 14px;
width: 400px;
}
.wrap-cont-r p {
font-family: Courier New, Monospace;
font-size... | [
-0.1899997889995575,
-0.3338976502418518,
0.7830661535263062,
-0.14374476671218872,
0.21037136018276215,
0.5735626816749573,
-0.00823885016143322,
0.05927333980798721,
-0.46968889236450195,
-0.5223162174224854,
-0.6309107542037964,
0.3231833577156067,
-0.3270856738090515,
-0.19619424641132... | |
a long line</p>
<p>reel him in</p>
</div>
```
But wait, there's more!
-----------------------
I recently discovered [syntaxhighlighter](http://code.google.com/p/syntaxhighlighter) by Alex Gorbatchev. It is a fantastic tool for dynamically and automatically formatting text blocks. It is principally intended for syn... | [
0.11635341495275497,
-0.31578612327575684,
0.31920546293258667,
0.06985542178153992,
-0.21776650846004486,
0.0963248535990715,
0.1993866115808487,
-0.08257104456424713,
0.005250247195363045,
-0.2664492428302765,
-0.26259347796440125,
0.25682857632637024,
-0.7085744142532349,
-0.00858010631... | |
are trivial). So with this as the text in the page:
```
<textarea name="code" class="java:wraplines" cols="60" rows="10">
public class HelloWorld {
public static void main (String[] args)
{
System.out.println("Hello World! But that's not all I have to say. This line is going to go on for a very long time an... | [
-0.10884156078100204,
-0.10180346667766571,
0.7669849395751953,
-0.26945221424102783,
0.09440542012453079,
-0.06654158979654312,
0.4837391972541809,
0.15243056416511536,
-0.22332467138767242,
-0.47663724422454834,
-0.1431683897972107,
0.31260332465171814,
-0.2757450342178345,
0.31410849094... | |
to real problems so here we go...
First each line needs to be wrapped in some sort of containing block. Span or p are probably the most appropriate.
Then the style of the containing block needs to have line height set. and a background image that contains a number of newLine glyphs at the start of every line except t... | [
0.2597840130329132,
-0.13472729921340942,
0.5969734787940979,
0.13419076800346375,
-0.2268674224615097,
0.16084733605384827,
0.360931396484375,
-0.06408584862947464,
-0.4482334852218628,
-0.6161284446716309,
-0.41075000166893005,
0.02298189140856266,
-0.2590266168117523,
-0.152291446924209... | |
every line except the first one. I guess the resulting CSS might look like this:
```
p.codeLine
{
font-size: 12px;
line-height: 12px;
font-family: Monospace;
background: transparent url(lineGlyph) no-repeat 0 12px; /* move the background down so it starts on line 2 */
padding-left: 6px; /* move the... | [
0.12354306131601334,
0.12884432077407837,
0.6522237658500671,
-0.07353830337524414,
-0.14566347002983093,
0.2127193957567215,
0.1957988739013672,
0.00152418517973274,
-0.24520011246204376,
-0.6635146141052246,
-0.5508258938789368,
0.16308645904064178,
-0.26946261525154114,
-0.0337011776864... | |
Is it possible to create a stored procedure as
```
CREATE PROCEDURE Dummy
@ID INT NOT NULL
AS
BEGIN
END
```
Why is it not possible to do something like this?
Parameter validation is not currently a feature of procedural logic in SQL Server, and NOT NULL is only one possible type of data validation. The CHAR dat... | [
0.18798702955245972,
0.154754638671875,
-0.031958065927028656,
0.25967538356781006,
-0.307416170835495,
-0.19764868915081024,
0.10642609000205994,
-0.22036442160606384,
-0.4572879672050476,
-0.16485770046710968,
0.14063763618469238,
0.2785155475139618,
-0.13762909173965454,
-0.124561347067... | |
out of relational systems. On the other hand, stored procedures already have an existing mechanism for raising error events, tied into numerous APIs and languages. There is no such support for declarative data type constraints on parameters. The implications of adding it are extensive; especially since it's well-suppor... | [
-0.05530824512243271,
0.29755011200904846,
-0.11931053549051285,
0.05427856370806694,
-0.06704813987016678,
-0.0017009548610076308,
0.2707763910293579,
-0.22051703929901123,
-0.1785077005624771,
-0.27016475796699524,
-0.16315868496894836,
0.2723137438297272,
-0.4011366665363312,
0.17349852... | |
a lot of years generating a lot of literature establishing the behavior of NULL and the bounds of the definitions for that behavior. And stored procedures isn't one of them.
A stored procedure is designed to be as light-weight as possible to make database performance as efficient as possible. The datatypes of paramete... | [
-0.09226025640964508,
0.009765983559191227,
-0.22534549236297607,
0.4324761927127838,
-0.12970860302448273,
-0.013282793574035168,
0.12768420577049255,
-0.1299772411584854,
-0.2602458894252777,
-0.5058192610740662,
-0.011400463990867138,
0.3015116751194,
-0.28876110911369324,
0.09631591290... | |
of validating arguments. And hence less efficient and heavier.
There's a reason stored procedures aren't written as C# functions. | [
-0.03611878305673599,
0.3493272066116333,
0.0624876506626606,
0.09972738474607468,
-0.2610659599304199,
-0.07913988083600998,
0.18643823266029358,
-0.11000426858663559,
-0.3712521195411682,
-0.04189778119325638,
-0.14436015486717224,
0.7517620921134949,
-0.24316830933094025,
-0.26894891262... | |
In an aspx page I get the Windows username with the function `Request.LogonUserIdentity.Name`. This function returns a string in the format "domain\user".
Is there some function to only get the username, without resorting to the `IndexOf` and `Substring`, like this?
```
public static string StripDomain(string usernam... | [
-0.039776403456926346,
-0.20004186034202576,
1.0023983716964722,
-0.25233229994773865,
-0.12272694706916809,
0.11493194103240967,
-0.009196181781589985,
-0.0840902179479599,
-0.3341519236564636,
-0.6932499408721924,
-0.2811114490032196,
0.14402197301387787,
-0.4273560643196106,
-0.00095533... | |
: name.Substring(0, name.IndexOf("@"));
```
or
```
var name = Request.LogonUserIdentity.Name;
var slashIndex = name.IndexOf("\\");
return slashIndex > -1
? name.Substring(slashIndex + 1)
: name.Substring(0, name.IndexOf("@"));
``` | [
-0.2575284242630005,
-0.4053865969181061,
0.7151892781257629,
-0.14304274320602417,
0.2017231583595276,
0.14452852308750153,
0.10885223746299744,
-0.1100873127579689,
-0.33227214217185974,
-0.5872830748558044,
-0.47163811326026917,
0.43104487657546997,
-0.247838094830513,
0.277554452419281... | |
I have a greasemonkey user script with this single line of code...
```
window.close();
```
but firefox does not allow a user script to close a window (as reported by an error message in the error console)
Is there a work around to this problem?
**You need to change configuration settings of Firefox (about:config) t... | [
0.4125824570655823,
0.45563215017318726,
0.8925994038581848,
-0.4974168837070465,
0.16543394327163696,
-0.1427222341299057,
0.36329537630081177,
-0.055945612490177155,
-0.11762486398220062,
-0.5717786550521851,
0.006293460726737976,
0.8323148488998413,
-0.4035545587539673,
0.22005295753479... | |
Is there any way to re-generate views from newly updated model?
Unless you've made a lot of changes to the scaffold, it's probably easier just to overwrite the current scaffold:
```
./script/generate -f scaffold Model
``` | [
0.3423614501953125,
0.0011785748647525907,
0.4567015469074249,
0.19419260323047638,
0.0906626433134079,
0.023019278421998024,
-0.14975105226039886,
-0.11001210659742355,
-0.4331677556037903,
-0.5745548605918884,
0.07972079515457153,
0.5758967399597168,
-0.31610986590385437,
-0.049291145056... | |
I'm writing a reasonably complex web application. The Python backend runs an algorithm whose state depends on data stored in several interrelated database tables which does not change often, plus user specific data which does change often. The algorithm's per-user state undergoes many small changes as a user works with... | [
0.41097545623779297,
0.2355792373418808,
0.24031655490398407,
-0.14572085440158844,
0.05478199943900108,
0.13410919904708862,
0.3849889039993286,
-0.01983029954135418,
0.03363849222660065,
-0.8570519685745239,
0.1445450335741043,
0.0821678414940834,
-0.1987875998020172,
-0.0247804354876279... | |
it can simply be used and/or updated whenever necessary. However, since this is a web application, there several processes serving requests, so using a global variable is out of the question.
I've tried serializing the relevant object (via pickle) and saving the serialized data to the DB, and am now experimenting with... | [
0.08691170066595078,
0.04282517731189728,
0.12516702711582184,
0.11314264684915543,
-0.32747718691825867,
-0.04182304069399834,
0.07613563537597656,
0.4576738774776459,
-0.13649237155914307,
-0.7666460275650024,
0.1198926791548729,
0.18849408626556396,
-0.3214740455150604,
0.24150240421295... | |
an experimental component into my application.
I need some advice! This is my first shot at developing a web application, so I'm hoping this is a common enough issue that there are well-known solutions to such problems. At this point solutions which assume the Python back-end is running on a single server would be suf... | [
0.4453445076942444,
0.12637795507907867,
0.07751838862895966,
-0.09981833398342133,
-0.009088954888284206,
-0.06338685005903244,
0.43001019954681396,
0.04820237308740616,
-0.2815797030925751,
-0.41954922676086426,
0.10894162207841873,
0.2793460786342621,
-0.12093541026115417,
-0.1782558113... | |
the above mentioned issue is the actual bottleneck. I'm sure pretty sure I could squeeze more performance out of the current setup, but I wanted to ask if there's a better way.
* The setup itself is still a work in progress; assume that the system's architecture can be whatever suites your solution.
I think that the [m... | [
0.5193309783935547,
0.12316592782735825,
0.23210567235946655,
0.16288433969020844,
0.11107336729764938,
-0.17112447321414948,
-0.002423894591629505,
-0.12390676885843277,
-0.36738210916519165,
-0.6628696918487549,
-0.10154757648706436,
0.6089200973510742,
-0.3687330484390259,
0.01143223512... | |
Given a string as below, I need to convert:
1 Dec 2008 06:43:00 +0100
to
MM/DD/YYYY HH:MM:SSAM
using jython what is the best way to do this?
I don't have jython handy, but I'd expect something like this to work:
```
import java
sdf = java.text.SimpleDateFormat
fmt_in = sdf('d MMM yyyy HH:mm:ss Z')
fmt_out = sdf('... | [
-0.21694685518741608,
0.2393743395805359,
0.9789355993270874,
-0.41491469740867615,
-0.17299847304821014,
-0.10930995643138885,
0.4147559702396393,
-0.5337969660758972,
-0.21958284080028534,
-0.8297353982925415,
-0.20043854415416718,
0.8233310580253601,
-0.14218226075172424,
0.137191295623... | |
While checking out the generic collection in .net i found about KeyedByTypeCollection. Although I worked with it and got to know how to use it, I did not get in which scenario it will be useful.
I read through [ServiceProvider, cache etc. done with generics without cast](https://stackoverflow.com/questions/178255/serv... | [
0.5398043990135193,
-0.1318831443786621,
0.1713901311159134,
0.10079232603311539,
-0.1752139776945114,
-0.06856927275657654,
0.325967013835907,
-0.22900500893592834,
-0.06566394120454788,
-0.4368728995323181,
0.05783523991703987,
0.34107881784439087,
-0.38419222831726074,
0.206169977784156... | |
me.
As more of a curiosity does any other languages support this type of collection ?
AFAIK, this generic collection serves just as a simple wrapper for `KeyedCollection<KEY,VALUE>` when `KEY` is the Type of the `VALUE` to store.
For example, it is very convinient to use this collection if you want to implement a fa... | [
0.3593250513076782,
-0.10236931592226028,
0.2780282199382782,
0.08294788748025894,
-0.04913843423128128,
-0.0022963625378906727,
0.1025090292096138,
-0.21626782417297363,
-0.26371514797210693,
-0.5302909016609192,
-0.20169679820537567,
0.4746745526790619,
-0.28921207785606384,
0.6785169243... | |
_singletons.Add(new V());
}
return (V)_singletons[typeof(V)];
}
}
```
The use of this simple factory would be something like the following:
```
[Test]
public void Returns_Singletons()
{
Factory<ICar> factory = new Factory<ICar>();
Opel opel1 = factory.GetSingleton<Opel... | [
0.15507714450359344,
-0.14555324614048004,
0.5409073829650879,
-0.3086484968662262,
0.028103679418563843,
0.5501564145088196,
0.3899155259132385,
-0.5469550490379333,
-0.5237236618995667,
-0.24356260895729065,
-0.2783208191394806,
0.3288772404193878,
-0.41017603874206543,
0.337348103523254... | |
Assert.IsNotNull(opel2);
Assert.AreEqual(opel1, opel2);
}
```
Another usage for `KeyedByTypeCollection<T>` would be inside a service locator... | [
-0.15745587646961212,
-0.22634993493556976,
0.49229952692985535,
-0.20413683354854584,
0.13884133100509644,
0.00015907958731986582,
0.2943662405014038,
-0.5545122027397156,
0.03741105645895004,
-0.14127011597156525,
-0.23220552504062653,
0.6924951076507568,
-0.1588573157787323,
0.009342857... | |
How do I get the battery status on an iPhone?
```
UIDevice *myDevice = [UIDevice currentDevice];
[myDevice setBatteryMonitoringEnabled:YES];
float batLeft = [myDevice batteryLevel];
int i=[myDevice batteryState];
int batinfo=(batLeft*100);
NSLog(@"Battry Level is :%d and Battery Status is :%d",batinfo,i);
switch (i)... | [
-0.05845573917031288,
-0.04292881488800049,
0.7237448692321777,
-0.03871572017669678,
0.4853760302066803,
0.1778472363948822,
0.598939061164856,
-0.35967451333999634,
0.08285678178071976,
-0.4112481474876404,
-0.28566792607307434,
0.8668229579925537,
-0.10941819101572037,
-0.16470712423324... | |
{
[BCStatus setText:NSLocalizedString(@"FullKey", @"")];
break;
}
default:
{
[BCStatus setText:NSLocalizedString(@"UnknownKey", @"")];
break;
}
}
```
BCStatus is uilabel. | [
-0.354645699262619,
-0.17671510577201843,
0.5898940563201904,
-0.07752152532339096,
0.14045386016368866,
-0.3076757490634918,
0.2491985708475113,
0.29633060097694397,
-0.12910594046115875,
-0.7813145518302917,
-0.4372861087322235,
0.4004223346710205,
-0.4318879544734955,
0.2742334306240082... | |
I'm busy writing a class that monitors the status of RAS connections. I need to test to make sure that the connection is not only connected, but also that it can communicate with my web service. Since this class will be used in many future projects, I'd like a way to test the connection to the webservice without knowin... | [
0.38493895530700684,
-0.06472014635801315,
0.2525869607925415,
0.12268514931201935,
-0.030984601005911827,
-0.13096164166927338,
0.1763077825307846,
0.21669183671474457,
-0.2876172661781311,
-0.8337759971618652,
0.2684330642223358,
0.5031787157058716,
-0.027937591075897217,
0.3200483322143... | |
service to be offline.
How can I effectively test that I'm able to get a response from the web service?
You are right that pinging the server isn't sufficient. The server can be up, but the web service unavailable due to a number of reasons.
To monitor our web service connections, I created a IMonitoredService interf... | [
0.41495102643966675,
-0.06953608989715576,
0.4824508726596832,
0.1725967675447464,
0.06113170459866524,
-0.11941435188055038,
0.5494956970214844,
-0.027902042493224144,
-0.33624330163002014,
-0.47698384523391724,
-0.17676964402198792,
0.5875709056854248,
-0.35302573442459106,
0.34265008568... | |
for the monitoring knowing the details of the service.
If you know a bit about what the web service will return from accessing the URL directly, you could try just using the URL. For example, Microsoft's asmx file returns a summary of the web service. Other implementations may behave differently though. | [
0.620435357093811,
-0.20415596663951874,
0.1258658766746521,
0.4250878095626831,
-0.06432902812957764,
-0.42201247811317444,
0.21125054359436035,
0.17227521538734436,
-0.3201260566711426,
-0.43053585290908813,
0.017861392349004745,
0.3935677707195282,
-0.08140216022729874,
0.11267595738172... | |
I just stumbled across this bug in some legacy code:
```
class MyAPIHandler
{
private:
int handle;
public:
void MyApiHandler() // default constructor
{
handle = 42;
};
};
```
It compiles fine, with no warnings - but the behaviour wasn't what I intended, because the constructor name ... | [
-0.08698825538158417,
0.13334396481513977,
-0.00841949600726366,
-0.19491976499557495,
0.14759579300880432,
-0.005407183896750212,
0.7846407890319824,
0.08971484750509262,
-0.26385030150413513,
-0.35328710079193115,
-0.21076029539108276,
0.6055575609207153,
-0.5205420255661011,
0.211064219... | |
'fix' this.
Now, the bugfix was easy, but my question is this:-
What techniques could I use to prevent this type of bug recurring?
Some languages require an explicit "constructor" keyword, which should make this problem obvious. Unit testing, obviously should also have caught it. What else can I do?
If you always u... | [
0.005105479620397091,
0.2762559950351715,
0.15985000133514404,
0.18481823801994324,
-0.012378621846437454,
0.12464264780282974,
0.4271472692489624,
-0.004590964876115322,
-0.38091084361076355,
-0.547040581703186,
-0.4100504219532013,
0.7051257491111755,
-0.3975380063056946,
-0.145292088389... | |
What is the difference between the selectitem and selectitems tags in jsf?
The difference is exactly what you would expect. The `selectitem` tag adds a single item to the HTML list while `selectitems` adds multiple items.
From [JSF Core Tag Reference](http://www.jsftoolbox.com/documentation/help/12-TagReference/core/f... | [
-0.11933539807796478,
-0.3591477870941162,
0.5833816528320312,
0.13290615379810333,
-0.03022727742791176,
0.13104639947414398,
-0.2584831118583679,
-0.632057785987854,
-0.29773303866386414,
-0.7925295829772949,
-0.3879850506782532,
0.33944016695022583,
-0.4284321069717407,
-0.0438198000192... | |
size="1">
<option value="1">Option 1</option>
</select>
```
### SelectItems:
The `SelectItems` tag adds a child `UISelectItems` component to the component associated with enclosing tag. You can use this tag to set a list of objects in your domain model as the options for a select component. The body content of t... | [
-0.19142892956733704,
-0.3805285096168518,
0.841596782207489,
0.17207063734531403,
0.2346619963645935,
0.3043708801269531,
-0.281715989112854,
-0.42920228838920593,
-0.2039315551519394,
-0.739266574382782,
-0.3105067312717438,
0.5204758644104004,
-0.2067403793334961,
-0.05180681496858597,
... | |
I am downloading a text string from a web service into an RBuf8 using this kind of code (it works..)
```
void CMyApp::BodyReceivedL( const TDesC8& data ) {
int newLength = iTextBuffer.Length() + data.Length();
if (iTextBuffer.MaxLength() < newLength)
{
iTextBuffer.ReAllocL(newLength);
... | [
0.17887142300605774,
-0.08562074601650238,
0.9087081551551819,
-0.2092665731906891,
0.1360456794500351,
0.17441467940807343,
0.41461190581321716,
-0.4887821078300476,
0.07317860424518585,
-0.5194432735443115,
-0.1503729671239853,
0.5394570231437683,
-0.36651456356048584,
0.253341943025589,... | |
text %S", charstring);
```
**edit** for clarity..
My conversion function looks like this..
void CMyApp::DownloadCompleteL() {
{
RBuf16 buf;
buf.CreateL(iTextBuffer.Length());
buf.Copy(iTextBuffer);
```
RDebug::Printf("downloaded text %S", buf);
iTextBuffer.SetLength(0);
iTextBuffer.ReAlloc(0); ... | [
0.04393577575683594,
-0.009462657384574413,
0.63909512758255,
0.007877458818256855,
0.0314788892865181,
0.03448743745684624,
0.5061547756195068,
-0.05950623378157616,
-0.03450923413038254,
-0.6431724429130554,
-0.39111003279685974,
0.9976409077644348,
-0.1704455316066742,
0.019432252272963... | |
I'm using an SqlCommand object to insert a record into a table with an autogenerated primary key. How can I write the command text so that I get the newly created ID when I use the ExecuteScalar() method?
```
INSERT INTO YourTable(val1, val2, val3 ...)
VALUES(@val1, @val2, @val3...);
SELECT SCOPE_IDENTITY();
```
Don... | [
0.4081999361515045,
0.3059747815132141,
0.31864291429519653,
-0.07826736569404602,
0.39762207865715027,
-0.1687636375427246,
0.17421957850456238,
-0.0582137256860733,
-0.06133733689785004,
-0.5350197553634644,
-0.03184352442622185,
0.7842066884040833,
-0.32233870029449463,
0.14543288946151... | |
I am using the jQuery Datepicker widget with two input boxes, one for the **"From"** date and the second with the **"To"** date. I am using the [jQuery Datepicker functional demo](http://jqueryui.com/datepicker/) as a basis for getting the two input boxes to work with each other, but I need to be able to add these addi... | [
0.13368037343025208,
-0.4255698621273041,
0.9008267521858215,
-0.22512401640415192,
0.08943547308444977,
-0.10396330058574677,
0.05141700804233551,
-0.026917027309536934,
0.027331581339240074,
-0.32291385531425476,
-0.2031952440738678,
0.18838746845722198,
0.29787537455558777,
0.1736822724... | |
selected first, then the **"From"** date
can only be within the range of 7
days before the **"To"** date (with the
limit of 01 December being the first
selectable date)
I can't seem to get all of the above working together.
In summary, I would like to be able to select a range of up to 7 days between 01 December ... | [
0.4714635908603668,
-0.4976487457752228,
0.9972698092460632,
-0.21326489746570587,
0.32208216190338135,
0.2341129183769226,
0.3368321359157562,
0.11000659316778183,
-0.261819988489151,
-0.5426456928253174,
-0.17728158831596375,
0.3727748692035675,
0.10420433431863785,
0.2742428779602051,
... | |
showOn: "both",
beforeShow: customRange,
dateFormat: "dd M yy",
firstDay: 1,
changeFirstDay: false
});
});
function customRange(input)
{
return {
minDate: (input.id == "txtStartDate" ? new Date(2008, 12 - 1, 1) : | [
-0.03328564763069153,
-0.5867004990577698,
0.6922619938850403,
-0.3900650441646576,
-0.08636175841093063,
0.19409719109535217,
0.17343905568122864,
-0.10702899098396301,
-0.05138670653104782,
-0.4755840301513672,
-0.2459578812122345,
0.5182284712791443,
-0.126573845744133,
0.24842759966850... | |
null),
minDate: (input.id == "txtEndDate" ? $("#txtStartDate").datepicker("getDate") : null),
maxDate: (input.id == "txtStartDate" ? $("#txtEndDate").datepicker("getDate") : null)
};
}
```
I'm missing the 7 day range restriction and also preventing a **"To"** date selection before 01 Decemb... | [
0.37915825843811035,
-0.2858591675758362,
0.7583496570587158,
-0.2111155390739441,
0.27937352657318115,
-0.06834553182125092,
0.6032072305679321,
-0.2553349733352661,
0.0818520039319992,
-0.5017586946487427,
-0.18510852754116058,
0.6408838033676147,
-0.07737959921360016,
0.0636957511305809... | |
URL to see the code
Complete Code below-
```
$(function ()
{
$('#txtStartDate, #txtEndDate').datepicker({
showOn: "both",
beforeShow: customRange,
dateFormat: "dd M yy",
firstDay: 1,
changeFirstDay: false
});
});
function customRange(input) {
var min = new D... | [
0.27684295177459717,
-0.48340272903442383,
0.8844054937362671,
-0.15548457205295563,
0.14443612098693848,
0.17886406183242798,
0.02018568105995655,
0.17061544954776764,
0.013835204765200615,
-0.5240727066993713,
-0.05814504995942116,
0.6683701872825623,
0.09478770196437836,
0.6290960311889... | |
min,
dateMax = null,
dayRange = 6; // Set this to the range of days you want to restrict to
if (input.id === "txtStartDate") {
if ($("#txtEndDate").datepicker("getDate") != null) {
dateMax = $("#txtEndDate").datepicker("getDate");
dateMin = $("#txtEndDate").datepicke... | [
0.44318729639053345,
-0.6019009351730347,
0.6195237636566162,
-0.13756677508354187,
0.531420111656189,
0.193258598446846,
0.3122011721134186,
0.12790964543819427,
-0.007279055658727884,
-0.1996462643146515,
-0.37547653913497925,
0.8629879355430603,
-0.23219043016433716,
0.39788252115249634... | |
if (dateMin < min) {
dateMin = min;
}
}
else {
dateMax = new Date; //Set this to your absolute maximum date
} | [
0.07447319477796555,
-0.688323438167572,
0.5150213837623596,
-0.09384501725435257,
0.518905758857727,
0.059889424592256546,
0.06619497388601303,
0.29573509097099304,
-0.12803076207637787,
-0.4322732985019684,
-0.16262415051460266,
0.736191987991333,
0.16714973747730255,
0.2674998939037323,... | |
}
else if (input.id === "txtEndDate") {
dateMax = new Date; //Set this to your absolute maximum date
if ($("#txtStartDate").datepicker("getDate") != null) {
dateMin = $("#txtStartDate").datepicker("getDate");
var rangeMax = new Date(dateMin.getFullYear(), dateMin.getMonth(),d... | [
0.40878552198410034,
-0.6054245233535767,
0.8855504989624023,
-0.29544204473495483,
0.5671725869178772,
0.0065302480943500996,
0.21504433453083038,
-0.17936933040618896,
-0.15038157999515533,
-0.3109566569328308,
-0.25681543350219727,
0.8119122385978699,
-0.14186251163482666,
0.21792258322... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.