text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
`TestDataTemplate123.Customer`).
**Window1.cs**
```
using System.Collections.ObjectModel;
using System.Windows;
namespace TestDataTemplate123
{
public partial class Window1 : Window
{
public static ObservableCollection<Customer> Customers()
{
return Customer.GetAllCustomers();
... | [
-0.2660367786884308,
-0.14986571669578552,
0.29101255536079407,
-0.20087499916553497,
0.10879300534725189,
0.20152828097343445,
0.2207908034324646,
-0.12581494450569153,
-0.024021854624152184,
-0.6195501685142517,
-0.5153030157089233,
0.35202598571777344,
-0.33009016513824463,
0.0449611917... | |
public class Customer
{
public string FirstName { get; set; }
public string LastName { get; set; }
public int Age { get; set; }
public static ObservableCollection<Customer> GetAllCustomers()
{
ObservableCollection<Customer> customers = new ObservableCollection<Cu... | [
-0.12205172330141068,
-0.2286529242992401,
0.8330466151237488,
-0.3107623755931854,
0.31949713826179504,
0.43270066380500793,
-0.06644758582115173,
0.05327660217881203,
-0.31986862421035767,
-0.5227038264274597,
-0.5406812429428101,
0.5514971613883972,
-0.19150801002979279,
0.2073677182197... | |
{FirstName = "Jim", LastName = "Smith", Age = 23});
customers.Add(new Customer() {FirstName = "John", LastName = "Jones", Age = 22});
customers.Add(new Customer() {FirstName = "Jay", LastName = "Anders", Age = 21});
return customers;
}
}
}
```
I've tried many different ... | [
0.1709386259317398,
0.06561429798603058,
0.5038907527923584,
-0.23639100790023804,
0.19686616957187653,
0.5042053461074829,
-0.05632179602980614,
0.10602249950170517,
-0.2635800838470459,
-0.43005988001823425,
-0.25982826948165894,
0.6096222400665283,
-0.10756456851959229,
0.46341517567634... | |
change so that I it just lists out `TestDataTemplate123.Customer` so I can go on making my DataTemplate?
If this is a manual process where you copy across you're website, you'll have to seperately copy your GAC dll and install that on your production server.
You can do this using GacUtil.exe (found in the Visual Studi... | [
0.6083694696426392,
-0.1963263601064682,
0.5218889713287354,
-0.17995116114616394,
-0.009419889189302921,
0.08470296114683151,
-0.04425792768597603,
-0.209211066365242,
-0.1657056212425232,
-0.8373687863349915,
0.023418694734573364,
0.6590921878814697,
-0.39952218532562256,
0.2649672031402... | |
I want to have HttpModule to inject javascripts, css links into HEAD element from some simple config data. I am not sure which event I should hook?
Curently I use
- context.PreRequestHandlerExecute for changing the masterpage dynamically
- Context.BeginRequest for SEO optimalization
There is some help at [HTTP... | [
0.1964738816022873,
-0.019057655707001686,
0.4221232533454895,
0.01120740082114935,
-0.22006717324256897,
-0.40540358424186707,
0.31258678436279297,
-0.3627149760723114,
-0.22074489295482635,
-0.5158160924911499,
-0.06895747780799866,
0.5292018055915833,
-0.16605210304260254,
-0.3882069885... | |
needs the JS included so I decided to put it in the base Page class of the project.
I implemented this years ago, and wanted to be able to include more than just scripts, it supports css, meta tags, etc.... I forget why I used Page.Header.Controls.Add instead of just Page.ClientScript.RegisterClientScriptInclude but t... | [
0.2593684792518616,
-0.1556245982646942,
0.36201751232147217,
-0.11500689387321472,
-0.18970835208892822,
-0.16715823113918304,
0.2672519087791443,
-0.368452787399292,
-0.28431275486946106,
-0.8506882190704346,
-0.08901099115610123,
0.27223894000053406,
-0.6648484468460083,
0.1087760776281... | |
{
IncludeScript(s, null);
}
public bool IsIncluded(string file)
{
return (m_IncludedFiles.Find(s => s.Equals(file, StringComparison.InvariantCultureIgnoreCase)) != null);
}
public void IncludeScript(string script, string condition)
{
... | [
0.23298592865467072,
-0.13846999406814575,
0.4801371991634369,
-0.19187761843204498,
-0.06972022354602814,
-0.003534558927640319,
0.7201941013336182,
-0.3308277726173401,
-0.19747883081436157,
-0.6139222383499146,
-0.39176249504089355,
0.23915061354637146,
-0.6167269945144653,
0.1270150393... | |
page = HttpContext.Current.CurrentHandler as Page;
if (!IsIncluded(script) || page == null)
return;
string scriptFile = string.Format("/{0}/{1}?v={2}", MyConfig.JSDir, script, MyConfig.BuildNumber);
if (page.Header != null)
{
string script... | [
-0.28136134147644043,
-0.2932329773902893,
0.8802657127380371,
-0.39198556542396545,
0.09986508637666702,
0.0663662999868393,
0.43030381202697754,
-0.19322139024734497,
-0.04798465594649315,
-0.836755096912384,
-0.41363948583602905,
0.3367559313774109,
-0.3653492033481598,
0.24088989198207... | |
= String.Format("<script language=\"javascript\" type=\"text/javascript\" src=\"{0}\"></script>\n", scriptFile);
if (!String.IsNullOrEmpty(condition))
scriptTag = String.Format("<!--[{0}]><script language=\"javascript\" type=\"text/javascript\" src=\"{1}\"></script><![endif]-->\n", c... | [
-0.2972659468650818,
-0.31881701946258545,
0.7026699781417847,
-0.42305973172187805,
0.23423732817173004,
0.12027212232351303,
0.2782815992832184,
-0.5607687830924988,
-0.04111003875732422,
-0.7853082418441772,
-0.476491242647171,
0.3761672377586365,
-0.3688749372959137,
-0.298690319061279... | |
else if (!page.ClientScript.IsClientScriptIncludeRegistered(GetType(), scriptFile))
{
page.ClientScript.RegisterClientScriptInclude(GetType(), scriptFile, scriptFile);
m_IncludedFiles.Add(script);
}
}
public void IncludeCss(string css)
{ | [
0.2125048041343689,
-0.03479371219873428,
0.3570834994316101,
-0.4462469220161438,
0.08340954780578613,
-0.03834029287099838,
0.5599669814109802,
-0.3174268305301666,
-0.27872487902641296,
-0.5759645104408264,
-0.5717220902442932,
0.3924422860145569,
-0.6769412159919739,
-0.044613316655159... | |
Page page = HttpContext.Current.CurrentHandler as Page;
if (!IsIncluded(css) || page == null)
return;
string cssfile = string.Format("/{0}/{1}?v={2}", MyConfig.CssDir, css, MyConfig.BuildNumber);
if (page.Header != null)
{ | [
-0.3129678964614868,
-0.07414335757493973,
0.8802633881568909,
-0.24310292303562164,
-0.12032122164964676,
0.10931277275085449,
0.36021703481674194,
-0.28671687841415405,
-0.24767586588859558,
-0.8476480841636658,
-0.5766066312789917,
0.17167071998119354,
-0.43158575892448425,
0.3132638037... | |
((Page)HttpContext.Current.CurrentHandler).Header.Controls.Add(new LiteralControl(String.Format("<link href=\"{0}\" rel=\"stylesheet\" type=\"text/css\" />\n", cssfile)));
m_IncludedFiles.Add(css);
}
}
public void IncludeJQuery()
{
Inc... | [
-0.00238096434623003,
-0.07625441998243332,
0.3420352339744568,
-0.39530515670776367,
0.055096279829740524,
-0.18761880695819855,
0.529159426689148,
-0.339596688747406,
-0.16799601912498474,
-0.5525901913642883,
-0.5981276631355286,
0.3623392581939697,
-0.7392128109931946,
0.04175243154168... | |
}
public void IncludeJQueryUI()
{
IncludeJQuery();
IncludeScript("jquery.ui.1.0.min.js");
IncludeCss("jquery-theme.css");
}
public void IncludeFlotScripts()
{
IncludeJQuery(); | [
0.1379084587097168,
-0.08202312141656876,
0.32455506920814514,
-0.2113320231437683,
0.1289386749267578,
-0.19389624893665314,
0.5126455426216125,
-0.32194969058036804,
-0.09027908742427826,
-0.4126461148262024,
-0.5803536772727966,
0.4567992389202118,
-0.49921754002571106,
0.36394619941711... | |
IncludeScript("flot/jquery.flot.js");
IncludeScript("flot/excanvas.pack.js", "if IE");
}
}
public class MyPage : Page
{
public HeaderIncludesManager HeaderIncludes = new HeaderIncludesManager();
}
public class MyControl : UserControl
{
public new MyPage Page... | [
-0.16678951680660248,
-0.010403607971966267,
0.5976330637931824,
-0.06359505653381348,
-0.05900586396455765,
-0.25579342246055603,
0.48413708806037903,
-0.2756558954715729,
-0.11715683341026306,
-0.8534228205680847,
-0.5677968263626099,
0.2165590077638626,
-0.5806193947792053,
-0.083221822... | |
get
{
return (MyPage)base.Page;
}
}
}
public class SomeControlThatNeedsScripts : MyControl
{
protected override void OnLoad(EventArgs e)
{ | [
-0.21548806130886078,
-0.26336905360221863,
0.375514954328537,
0.027841828763484955,
0.21340253949165344,
-0.09024214744567871,
0.5796635150909424,
0.0761847123503685,
-0.009057287126779556,
-0.8089532852172852,
-0.5112272500991821,
0.6479291915893555,
-0.2730504870414734,
0.08228352665901... | |
Page.HeaderIncludes.IncludeJQueryUI();
base.OnLoad(e);
}
}
}
``` | [
0.04377296566963196,
0.04565999656915665,
0.34008628129959106,
-0.1128593161702156,
-0.0004884210648015141,
-0.35130056738853455,
0.42152777314186096,
0.08562210202217102,
-0.19986672699451447,
-0.7345803380012512,
-0.3499121069908142,
0.2967226803302765,
-0.5832887887954712,
0.46741095185... | |
I have disassembled a VB6 application that calls a function in a DLL library, but I can't find any reference to the DLL in the disassembly. How can the calling code load this DLL? It is dynamically linked, as I can observe the effects of removing and replacing the DLL.
I'm using IDA Pro Free, the calling application i... | [
0.4343370497226715,
0.32484495639801025,
0.023240791633725166,
0.09450932592153549,
-0.21459811925888062,
0.004384521394968033,
0.12755098938941956,
-0.09897858649492264,
0.09587913006544113,
-0.7977604269981384,
-0.2676306962966919,
0.44775494933128357,
-0.06669079512357712,
0.32123890519... | |
I'm not sure exactly what went wrong here, but ReSharper 4.5 RTM seems to have stolen my Visual Studio colour theme. I normally use [Fredrik Kalseth's wicked theme](http://www.frickinsweet.com/tools/Theme.mvc.aspx), and I've been using ReSharper since version 2.0. Never before has this happened - not even while using t... | [
0.31699293851852417,
-0.05318721383810043,
0.7147521376609802,
-0.21102607250213623,
-0.09420118480920792,
-0.012455709278583527,
0.5023936629295349,
-0.10177963227033615,
-0.3842969834804535,
-0.5047462582588196,
-0.08673275262117386,
0.6367422938346863,
-0.10252010077238083,
0.4385654628... | |
but firstly, I don't want to have to do that, and secondly, I want to understand why this has happened only now, and never before.
When I uninstall ReSharper, the colours go back to normal. I have tried removing the theme and resharper and reinstalling in different orders to no avail. I apply the theme with a code fil... | [
0.37780243158340454,
-0.3203911781311035,
0.8060156106948853,
-0.049318403005599976,
-0.1310005784034729,
-0.2057235687971115,
0.32386186718940735,
-0.054910458624362946,
-0.3362829089164734,
-0.32451915740966797,
-0.5679419040679932,
0.6720272898674011,
-0.10456277430057526,
0.44672557711... | |
and then the crappy colours overlay themselves again. I say they are crappy only in the context of a dark theme, on a light theme they look just fine.
I just want to know how to have my cake and eat it like it's been all this time. I must stress, that the theme and resharper have been working hand in hand perfectly to... | [
0.44350287318229675,
0.20686538517475128,
0.561926007270813,
-0.17961867153644562,
-0.04129072651267052,
0.17632874846458435,
0.4016859531402588,
0.5848237872123718,
-0.3499375283718109,
-0.49925661087036133,
0.05634521320462227,
0.3345097005367279,
0.23127922415733337,
0.5131003856658936,... | |
not a trial.
Any help is much appreciated.
Open Visual Studio
Go to Resharper > Options... > Code Inspection > Settings
Untick "Color identifiers".
Press ok. | [
0.4282771050930023,
-0.1235995888710022,
0.399025022983551,
-0.11721174418926239,
-0.07911013811826706,
-0.3155612647533417,
0.5254113674163818,
-0.23852704465389252,
-0.04448799416422844,
-0.7727274894714355,
-0.1360592246055603,
0.694766104221344,
-0.16879136860370636,
-0.136996984481811... | |
I need to check if a file is on HDD at a specified location ($path.$file\_name).
Which is the difference between [`is_file()`](http://www.php.net/manual/en/function.is-file.php) and [`file_exists()`](http://www.php.net/manual/en/function.file-exists.php) functions and which is better/faster to use in PHP?
`is_file()`... | [
0.5532838106155396,
0.060481294989585876,
0.435975044965744,
0.1255381852388382,
0.20500117540359497,
-0.3372156023979187,
0.27688926458358765,
-0.08686458319425583,
0.1718800812959671,
-0.9034512639045715,
-0.15921612083911896,
0.6759138703346252,
0.08500725030899048,
0.22650550305843353,... | |
I'm writing a script to tidy up a bunch of media spread across my hard drives, and it works pretty well so far at home (on my Mac) as I use symlinks in a directory to give the impression that everything is organised in one location, whilst the actual data is spread across the 4 drives.
Unfortunately, I have to use Win... | [
0.006434734910726547,
-0.03591886907815933,
0.6744284629821777,
-0.12165670841932297,
-0.01926710642874241,
-0.1942981481552124,
0.3316400945186615,
0.18196523189544678,
-0.30667704343795776,
-0.8078761696815491,
0.03773212432861328,
0.5618228316307068,
-0.0983719602227211,
0.0865361467003... | |
a way of doing it. Is it possible, or is there a better solution I've not considered?
Thanks to the above answer, I found that you can indeed call COM from php, here's my first draft of a symlink() replacement:
```
if (! function_exists('symlink')) {
function symlink($target, $link) {
if (! substr($link, -... | [
0.34777727723121643,
-0.35323429107666016,
0.4593258202075958,
-0.13174976408481598,
-0.11067074537277222,
0.2548324465751648,
0.30518871545791626,
-0.21112927794456482,
-0.10873175412416458,
-0.8239798545837402,
0.04446287453174591,
0.724668025970459,
-0.3553558886051178,
-0.1046560555696... | |
$shortcut->targetpath = $target;
$shortcut->save();
}
}
``` | [
0.21393992006778717,
-0.24023456871509552,
0.01510255690664053,
-0.4197736084461212,
0.16065114736557007,
0.09626509994268417,
0.26719772815704346,
0.14157414436340332,
-0.003976995591074228,
-0.5892033576965332,
0.03493225574493408,
0.7732173204421997,
-0.4230387210845947,
-0.125169008970... | |
There is a nasty right-side inactive scrollbar in the textarea in IE, in FF the textarea is clean. How to make it clean in IE as well?
Quick experimentation suggests that IE6 and IE8 (unable to test 7 at the moment) both honor the auto value for overflow. Thus, to make the scroll bars appear when necessary, but hidden ... | [
0.0853915885090828,
0.2604885995388031,
0.4074763357639313,
-0.17998486757278442,
-0.017400771379470825,
-0.24024656414985657,
0.7995089292526245,
0.10337212681770325,
-0.005232928786426783,
-0.6924522519111633,
-0.30398109555244446,
0.7150990962982178,
-0.3595585823059082,
-0.073260314762... | |
I'm parsing some html using regex and I want to match lines which start with a word without any html tags while also removing the white space. Using c# regex my first pattern was:
```
pattern = @"^\s*([^<])";
```
which attempts to grab all the white space and then capture any non '<' characters. Unfortunately if the... | [
0.14808034896850586,
-0.0803227573633194,
0.3271860182285309,
-0.2051035612821579,
-0.5099225640296936,
0.07933413982391357,
0.23852753639221191,
0.05123639479279518,
-0.11401959508657455,
-0.918834388256073,
0.20753422379493713,
0.17039568722248077,
-0.7640637755393982,
-0.183230683207511... | |
it in mind for the future. I'm writing a utility program to make a few pages multi-language (i.e: add asp:literals for hardcoded text etc), I think regex is sufficient for this purpose but if there are better tools please let me know (web stuff isn't my area...). | [
0.28969961404800415,
-0.06353693455457687,
0.35748091340065,
0.10473573952913284,
0.03342444449663162,
-0.14496085047721863,
0.33111926913261414,
0.21453069150447845,
-0.12342005968093872,
-0.6370728611946106,
0.11065814644098282,
0.40557920932769775,
0.07355435192584991,
-0.14145039021968... | |
I want to `show()` `"<div id="test">write text here</div"` on click and not on page load.
```js
$(document).ready(function() {
$("#click_test").stop(function(event) {
event.preventDefault();
$("#test").slideup();
});
$("#click_test").click(function(event) {
event.preventDefault();
$("#te... | [
0.5150526762008667,
0.04960933327674866,
0.6223180294036865,
-0.0862012580037117,
-0.06657935678958893,
-0.021995848044753075,
0.39366787672042847,
-0.29448387026786804,
0.10473541170358658,
-0.4929296672344208,
-0.043165504932403564,
0.320498526096344,
-0.24937456846237183,
-0.06468295305... | |
but if there are better tools please let me know (web stuff isn't my area...). | [
0.5759978294372559,
-0.0265926793217659,
0.0172192994505167,
0.23872587084770203,
0.15986934304237366,
-0.525506317615509,
0.3046354353427887,
0.48982954025268555,
-0.18472211062908173,
-0.7172242403030396,
0.04607069119811058,
0.23591117560863495,
0.37140265107154846,
0.030447043478488922... | |
Is it possible to pass credentials using AJAX to a webserver that request www-authentication?
I want to log in to a website that uses .NET Bsic www-authentication, and pass the credentials using ajax. When visiting the server with a browser, the browser prompts the user with an authentication/login window.
The html h... | [
0.4652019143104553,
0.21158361434936523,
0.47842687368392944,
0.19345827400684357,
-0.07995139807462692,
-0.47927770018577576,
0.23953938484191895,
-0.04014996811747551,
0.0021498133428394794,
-0.6312339901924133,
-0.1220984011888504,
0.3429625332355499,
-0.0050497278571128845,
-0.04000237... | |
cookie set) so that the user can procedd to the site later and be 'already' logged in.
can this be done in the way I describe here?
You can pass the username and password in the URL like so:
<http://username:password@example.com/secure>
Here's an example with jQuery:
```
<script type="text/javascript" src="http://a... | [
0.011371465399861336,
-0.00776539696380496,
0.4223234951496124,
-0.050839658826589584,
-0.007924769073724747,
-0.19879050552845,
0.025875013321638107,
-0.2361847460269928,
-0.16643665730953217,
-0.8238848447799683,
-0.20723141729831696,
0.6033450961112976,
-0.184883251786232,
-0.0502513796... | |
I want to use display tag but don't understand the official documentation. Can anyone show me other good tutorials?
Assuming you're talking about the **[JSP display tag library](http://displaytag.sourceforge.net/1.2/)**, they have an extensive usage tutorial on [**their Sourceforge code site**](http://displaytag.source... | [
0.5550652146339417,
-0.020661955699324608,
0.21835735440254211,
-0.14064745604991913,
-0.06968507170677185,
-0.1439359188079834,
0.31517529487609863,
0.11575054377317429,
-0.24086979031562805,
-0.7697791457176208,
-0.013479991815984249,
0.8114696145057678,
-0.02169233374297619,
-0.06340551... | |
### Duplicate
> [Custom Compiler Warnings in .NET](https://stackoverflow.com/questions/154109/custom-compiler-warnings)
I'd like to be able to tag my code with a `NotImplementedAttribute` and have the compiler either give a warning or an error at build time if the method is used.
I know there is the `ObsoleteAttribu... | [
0.19035999476909637,
0.2787834405899048,
0.435065358877182,
-0.24626757204532623,
0.18126721680164337,
-0.33539143204689026,
0.7038495540618896,
-0.12728412449359894,
-0.2485676407814026,
-0.5186032652854919,
-0.1522306203842163,
0.6208838224411011,
-0.4440443813800812,
0.18336844444274902... | |
if you want to write it out
</script>
```
A working demo: <http://jsbin.com/isuqi> | [
0.22713252902030945,
-0.07407470047473907,
0.078598752617836,
-0.10841033607721329,
0.10549836605787277,
-0.3434767723083496,
0.18115052580833435,
0.28441762924194336,
0.17913708090782166,
-0.7578660845756531,
-0.3107694089412689,
0.2734583020210266,
-0.25291678309440613,
-0.21360255777835... | |
What is a reasonable, efficient, and fair method to calculate page views?
For example, how does Stack Overflow compute question views? I thought that Stack Overflow computes views per registered user. However, [this question](https://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-e... | [
-0.04169341176748276,
0.08691340684890747,
0.519086480140686,
0.17069011926651,
-0.24084490537643433,
-0.14814451336860657,
-0.02919052168726921,
-0.1495472490787506,
-0.5625734925270081,
-0.26716047525405884,
0.05588620528578758,
0.5425930023193359,
-0.22197365760803223,
0.200055390596389... | |
im wondering about how to set up a clever way to have all my input 'clean', a procedure to run at the begin of every my script.
I thought to create a class to do that, and then, add a 2 letter prefix in the begin of every input to identify the kind of input, for example:
```
in-mynumber
tx-name
ph-phone
em-email
```
... | [
0.5066556334495544,
0.11960584670305252,
0.24478670954704285,
-0.08299387246370316,
-0.1605718582868576,
0.1492103785276413,
0.5746135711669922,
-0.11618851125240326,
-0.10807100683450699,
-0.5864245891571045,
0.09114199131727219,
0.33323943614959717,
-0.3807646930217743,
0.386767596006393... | |
case 'in':
//I assume this input is an integer
$cGet[$taintedKey] = intval($taintedValue);
break;
case 'tx':
//i assume this input is | [
0.08556455373764038,
-0.17770622670650482,
-0.06545961648225784,
-0.1620127260684967,
0.22190731763839722,
0.19321209192276,
0.3736921548843384,
0.09972821921110153,
-0.2643771171569824,
-0.00008178421558113769,
0.019029244780540466,
0.4536396861076355,
-0.5480493903160095,
0.1885261237621... | |
a normal text
//can contains onely letters, numbers and few symbols
if(preg_match($regExp, $taintedValue)){
$cGet[$taintedKey] = $taintedValue;
}else{ | [
0.11371965706348419,
-0.05034643039107323,
-0.005092656705528498,
-0.055093541741371155,
-0.0432765930891037,
-0.0020453687757253647,
0.7234392166137695,
0.2862236797809601,
0.07183490693569183,
-0.19165877997875214,
-0.2808420658111572,
0.280155211687088,
-0.603376567363739,
0.15730114281... | |
$cGet[$taintedKey] = false;
}
break;
case 'em':
//i assume this input is a valid email
if(preg_match('/^[a-zA-Z0-9-_.]+@[a-zA-Z0-9-_.]+.[a-zA-Z]{2,4}$/', $taintedValue)){ | [
0.3146168887615204,
0.023238861933350563,
0.2553366720676422,
-0.13866248726844788,
0.11954846233129501,
-0.07613958418369293,
0.7723899483680725,
-0.04643071070313454,
-0.04554219916462898,
-0.06472678482532501,
-0.180789515376091,
0.3297601640224457,
-0.6108757257461548,
0.45284274220466... | |
$cGet[$taintedKey] = $taintedValue;
}else{
$cGet[$taintedKey] = false;
}
break;
}
}
}
```
..so i'll create other 2 arrays, $cGet and $cPost | [
0.21115180850028992,
-0.16237643361091614,
0.11362556368112564,
0.003005031030625105,
-0.07943565398454666,
0.002424242440611124,
0.22169552743434906,
-0.2751654088497162,
-0.32860490679740906,
-0.09749236702919006,
0.1400841623544693,
0.5334535837173462,
-0.42238306999206543,
0.1924683004... | |
with the clean data respectively of $\_GET and $\_POST, and in my script i'lllook for use those arrays, completely forget the $\_GET/$\_POST
I'm even thinkin about add a second prefix to determinate the input's max lenght... for example:
tx-25-name
..but im not pretty sure about that.. and if i take this way, maybe a ... | [
0.20166103541851044,
0.20501476526260376,
0.29935958981513977,
0.017315085977315903,
-0.03356919437646866,
0.012208176776766777,
0.12744338810443878,
0.06873060017824173,
-0.34341689944267273,
-0.7949540019035339,
-0.008605299517512321,
0.7215279340744019,
-0.15224766731262207,
-0.19125667... | |
my application not to be much restrictive;
2. My sent variable's names will become little longer (but we are talking of 3-6 chars, shouldnt be a problem)
Any suggestion is really appreciated!
**EDIT:**
Im not triyn to reinvent the wheel, my post was't about the sistem to sanitizing input, but is about the procedure ... | [
0.06367992609739304,
0.10922723263502121,
0.5095843076705933,
0.1449599713087082,
-0.3899640142917633,
-0.08616671711206436,
0.5620903372764587,
-0.09571196883916855,
-0.02771284617483616,
-0.7678838968276978,
0.05294106900691986,
0.6197113394737244,
-0.12724506855010986,
-0.05730964615941... | |
method i thougt is not miracolous and nothing new under the sun, but i think that truncate the input if is not in the format that i aspect, can be usefull...
Why check for sql injection in the 'name' field, that must contain just letters and the apostrophe char?
Just remove everythings that is not letter or apostophe,... | [
-0.015606716275215149,
0.06179856136441231,
0.338980495929718,
0.18636777997016907,
-0.33352428674697876,
-0.07352526485919952,
0.4602055847644806,
-0.2949254512786865,
-0.03962542489171028,
-0.42721137404441833,
0.10887067019939423,
0.4321712851524353,
-0.3137020766735077,
0.1414530277252... | |
and HTML injections can (should) be protected in another way. SQL injections are prevented by parametrized queries (a must-have this day and age); and HTML injections are prevented by `htmlspecialchars()` method, which should be called **right before outputting the string to the user**. Don't store encoded strings in t... | [
0.28219524025917053,
0.13742788136005402,
0.11426590383052826,
0.21219657361507416,
-0.22991536557674408,
-0.21310913562774658,
0.7837890982627869,
-0.06837821006774902,
-0.261522501707077,
-0.5711216926574707,
0.03806927055120468,
0.439247727394104,
-0.5309159755706787,
-0.052938293665647... | |
that's just a part of all the validations you will have to do. Other common cases that you cannot validate there are cross-checking of inputs (start date before end date), and checking that a value is in a list of allowed predefined values (say, for a `<select>` element). And there are an infinite number of custom vali... | [
0.6952410936355591,
0.004196863155812025,
0.24123777449131012,
0.29209429025650024,
0.19827768206596375,
-0.3456995487213135,
0.19679032266139984,
-0.3129684329032898,
-0.32195231318473816,
-0.1816602647304535,
0.25194472074508667,
0.5409414768218994,
-0.19181789457798004,
0.34005165100097... | |
We have a WPF application where parts of it may throw exceptions at runtime. I'd like to globally catch any unhandled exceptions and log them, but otherwise continue program execution as if nothing happened (kinda like VB's `On Error Resume Next`).
Is this possible in C#? And if so, where exactly would I need to put t... | [
0.4631289541721344,
0.021968044340610504,
0.08457059413194656,
-0.00527007644996047,
0.034425489604473114,
-0.3895414173603058,
0.31193897128105164,
-0.13547252118587494,
-0.46200647950172424,
-0.36697253584861755,
-0.09255670011043549,
0.3563757538795471,
-0.21891114115715027,
0.005790744... | |
horribly wrong directions here?
**ETA:** Because many people below pointed it out: The application is not for controlling nuclear power plants. If it crashes, it's not that big a deal, but it throws random exceptions that are mostly UI-related that are a nuisance in the context where it would be used. There were (and ... | [
0.5350766181945801,
0.19048623740673065,
0.2343081682920456,
0.44207289814949036,
0.22869868576526642,
-0.5876545310020447,
0.21829046308994293,
0.08474269509315491,
-0.3868156671524048,
-0.32094302773475647,
-0.14553701877593994,
0.20151376724243164,
-0.12672309577465057,
0.05320592597126... | |
to a log file, including the complete stack trace. That was the whole point of that exercise. Just to counter those people that were taking my analogy to VB's OERN too literally.
I know that blindly ignoring certain classes of errors is dangerous and might corrupt my application instance. As said before, this program ... | [
0.6011620759963989,
0.1569759100675583,
-0.010069988667964935,
0.22689765691757202,
0.1774493157863617,
-0.3976592719554901,
0.4885614514350891,
0.08626945316791534,
-0.3009530305862427,
-0.32867228984832764,
0.14117026329040527,
0.7649396657943726,
-0.1169501543045044,
0.00834547914564609... | |
an exception:
* No exception handling – error dialog and application exit. Experiment has to be repeated, though likely with another subject. No errors have been logged, which is unfortunate.
* Generic exception handling – benign error trapped, no harm done. This should be the common case judged from all errors we wer... | [
0.15555815398693085,
0.30035296082496643,
0.23462095856666565,
0.18927036225795746,
0.05415619537234306,
-0.22307127714157104,
0.5473119020462036,
0.11575465649366379,
-0.4639042615890503,
-0.49198344349861145,
-0.32007265090942383,
0.4414113163948059,
-0.36984729766845703,
0.0337202623486... | |
far. The error is logged anyway and a crash might be inevitable. So this is conceptually similar to the very first case, except that we have a stack trace. And in the majority of cases the user won't even notice.
As for the experiment data generated by the program: A serious error would at worst just cause no data to ... | [
0.46327170729637146,
0.09712783247232437,
0.12978048622608185,
0.3421204090118408,
0.4569346308708191,
-0.2535470426082611,
0.06664979457855225,
0.2214847058057785,
-0.2459891438484192,
-0.18338324129581451,
0.10657168179750443,
0.5636134743690491,
0.185618057847023,
0.1857045590877533,
... | |
a total outlier.
To summarize: Yes, I consider myself still at least partially sane and I don't consider a global exception handling routine which leaves the program running to be necessarily totally evil. As said twice before, such a decision might be valid, depending on the application. In this case it was judged a ... | [
0.4556655287742615,
0.42832136154174805,
-0.1759996861219406,
0.13243623077869415,
-0.22763165831565857,
-0.10232799500226974,
0.5398885607719421,
0.10761883854866028,
-0.24967031180858612,
-0.16131450235843658,
0.10051386803388596,
0.240923210978508,
-0.36578723788261414,
0.22567008435726... | |
user for that application. It's not something like Windows or Office that gets used by millions where the cost of having exceptions bubble to the user at all would be very different in the first place already.
Use the [`Application.DispatcherUnhandledException Event`](http://msdn.microsoft.com/en-us/library/system.wind... | [
-0.1510038822889328,
-0.07070983946323395,
0.2700760066509247,
0.16906915605068207,
0.11331500113010406,
-0.30456119775772095,
0.29794737696647644,
0.04178828373551369,
-0.48111167550086975,
-0.6349970102310181,
-0.4179028570652008,
0.6861052513122559,
-0.23417864739894867,
-0.211260691285... | |
I'm developing a project in which I need to change the language according to the flag I click using AJAX. It's working fine in IE7 but it shows an error when I run it in IE6.
```
<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script language="javascript">
google.... | [
-0.1516486555337906,
0.053047310560941696,
0.6697449684143066,
-0.38812121748924255,
0.042467858642339706,
0.13939926028251648,
0.4929567575454712,
-0.2597024738788605,
0.018659019842743874,
-0.7693524360656738,
-0.4810118079185486,
0.6121994853019714,
-0.6279387474060059,
-0.2086605876684... | |
window.location.toString();
var strLang = x.substring(x.indexOf("=")+1);
if((x.indexOf("="))==-1) return;
strFLang = strLang.substring(0,2)
strTLang = strLang.substring(strLang.indexOf("-")+1);
var strText = document.getElementById(strFromTxtBox).innerHTML;
if(strFLang != 'en')
fnTrans(... | [
-0.5201199054718018,
-0.1955789476633072,
1.0306164026260376,
-0.30160626769065857,
0.1678149700164795,
0.10512716323137283,
0.3348352313041687,
-0.40597108006477356,
-0.2106158286333084,
-0.5001546144485474,
-0.5182048678398132,
0.5092200040817261,
-0.2141021341085434,
0.10916861146688461... | |
{
initialize(label[i].id,label[i].id);
}
document.getElementById("curlang").value=strTLang;
}
function fnClick(lang)
{
if(lang=="") return;
var curlang=document.getElementById("curlang").value;
if(lang==curlang) return;
window.location='language.php?strLang=' + curlang+'-'+lang;
}
</sc... | [
-0.31541863083839417,
-0.02261277101933956,
0.6415944695472717,
-0.22328339517116547,
0.06434964388608932,
0.3807375729084015,
0.12576718628406525,
-0.6707075834274292,
-0.09930592030286789,
-0.4677034020423889,
-0.48207101225852966,
0.23371154069900513,
-0.11117563396692276,
-0.1228740811... | |
href="#" onclick="fnClick(this.value);">
<area shape="rect" alt="German" value="de" coords="95,6,121,21" href="#" onclick="fnClick(this.value);">
</map>
</body>
</html>
```
have you tried?
```
$.jmsajax({
...
data: { uname: $uname },
...
});
``` | [
0.17976854741573334,
0.05173349007964134,
0.5649420619010925,
-0.21534816920757294,
0.014901580289006233,
0.3038492500782013,
0.569310188293457,
-0.5324094891548157,
-0.2691892087459564,
-0.6264142990112305,
-0.2512000799179077,
0.3941018879413605,
0.07789695262908936,
0.075971320271492,
... | |
I'm using SAS 9.2 on OpenVMS to connect to an external data source over a socket specifed with a filename statement:
```
filename extsrc SOCKET "extserver:port" recfm=v;
data foo;
infile extsrc;
input;
.... some statements to read stuff ...;
run;
```
This works (as it should) 99% of the time. However, once in a whi... | [
0.2942236363887787,
0.237180694937706,
0.6247010231018066,
-0.1856401264667511,
-0.016899343580007553,
-0.3355206251144409,
0.7045781016349792,
-0.04847313463687897,
-0.08432371914386749,
-0.6628121733665466,
-0.3175245225429535,
0.9520405530929565,
-0.28874915838241577,
0.2451648563146591... | |
anybody know of a way to detect this type of error in SAS?
I've tried checking the validity of the fileref extsrc using the fileref() function, but that just returns -20005 , which means that the fileref is assigned but does not point to a local file (which is true). The error only becomes apparent when I use the file... | [
0.3002502918243408,
0.23111432790756226,
0.11001867055892944,
-0.20253969728946686,
0.08628451079130173,
-0.23033270239830017,
0.5563308000564575,
-0.07179749011993408,
-0.23686054348945618,
-0.5998002290725708,
-0.16265377402305603,
0.5663880109786987,
-0.16203850507736206,
0.096425943076... | |
[heisenbug](http://en.wikipedia.org/wiki/Unusual_software_bug) fashion the problem has failed to crop up over the last few days, so I'm not sure what the final solution is yet.
[/update1]
[update2]
The error finally cropped up again. As per cmjohns answer, the value of syserr is 1012 after this error occurs. I'll now ... | [
-0.042115360498428345,
0.3902955949306488,
0.814481794834137,
-0.26614275574684143,
-0.06113823503255844,
-0.1202290877699852,
0.866564154624939,
-0.35370728373527527,
-0.26452457904815674,
-0.5709559917449951,
-0.26156312227249146,
0.5211995244026184,
-0.1048053726553917,
0.14289709925651... | |
this causes the program to end completely, or it causes the program to continue with `obs=0` in syntaxchek mode. Both are undesirable. The solution is to set `options noerrorabend nosyntaxcheck` before the datastep that produces this error. Additionally, if the error occurs I have to clear filename extsrc and reassign ... | [
-0.19574490189552307,
0.1456809937953949,
0.33869466185569763,
-0.26875993609428406,
0.127737358212471,
-0.11280734091997147,
0.7973519563674927,
0.18713149428367615,
-0.06436987966299057,
-0.6705819964408875,
-0.6649628281593323,
0.4874904453754425,
-0.0654788389801979,
0.1532373577356338... | |
problem.
You can see return values [here](http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/a000208995.htm). Judging by the list I'd guess a 1012 or 1020 is what you are getting during the socket error. | [
-0.057437747716903687,
0.37565097212791443,
0.027817297726869583,
-0.10223139822483063,
-0.01049052830785513,
0.31474199891090393,
0.5413074493408203,
0.21966862678527832,
-0.38683828711509705,
-0.6057026386260986,
-0.25633737444877625,
0.7333658337593079,
-0.09540005028247833,
0.140702903... | |
I am wondering if there are any django based, or even Python Based Reporting Services ala JasperReports or SQL Server Reporting Services?
Basically, I would love to be able to create reports, send them out as emails as CSV or HTML or PDF without having to code the reports. Even if I have to code the report I wouldn't ... | [
0.7375172972679138,
0.18873541057109833,
0.0729883536696434,
0.43450218439102173,
-0.22565588355064392,
-0.3438321352005005,
-0.13323576748371124,
0.3485240340232849,
-0.4306783676147461,
-0.37353119254112244,
0.2442685067653656,
0.4833262264728546,
-0.12579283118247986,
-0.089371316134929... | |
brings together the apps needed.
PPS: It would have to work off Postgres
I just thought after a fair bit of investigation I would report my findings...
<http://code.google.com/p/django-reporting/> - I think that this project, looks like an awesome candidate for alot of the functionality I require. Unfortunately its D... | [
-0.059734784066677094,
0.4259515404701233,
0.5390434861183167,
0.017560282722115517,
-0.5040761828422546,
-0.4175735116004944,
-0.07130102068185806,
-0.028913741931319237,
-0.3257153332233429,
-0.4540789723396301,
0.03521246835589409,
0.7125968337059021,
-0.2533471882343292,
-0.29609692096... | |
could make a nice Reporting System. | [
0.22197796404361725,
0.14987283945083618,
0.17719481885433197,
0.21752209961414337,
0.19985859096050262,
-0.2547624409198761,
0.10257432609796524,
0.1806955635547638,
-0.19656476378440857,
-0.23646824061870575,
0.2801873981952667,
0.135441392660141,
0.14080575108528137,
-0.0438196212053298... | |
I have a method where the user can search for a article number and if its available in the database the articlenumber gets bound to a BindingList. Now I want to let the user know if the article is not available in database. How do I do that the right way?
Just pass the message errorMessage to my interface method?
Pre... | [
0.09577156603336334,
0.3554482161998749,
0.49503856897354126,
-0.3114653527736664,
-0.11040078848600388,
-0.07506994903087616,
0.3201039135456085,
-0.24129675328731537,
-0.2859102487564087,
-0.5451496839523315,
0.22090162336826324,
0.5445210933685303,
-0.49206146597862244,
0.30804634094238... | |
error is detached from the original presenter.
I haven't really found a use for that, for me, it always ends in the presenter and view implementing both interfaces. | [
-0.058575764298439026,
0.32680878043174744,
0.17047059535980225,
0.09856503456830978,
-0.22568099200725555,
0.26651492714881897,
0.21667787432670593,
0.22020716965198517,
0.16983871161937714,
-0.6258012056350708,
0.08819200843572617,
0.7289185523986816,
-0.28440067172050476,
0.167264416813... | |
I am new in iPhone application development and currently working on .net (C#).
Please suggest the development platform to create iPhone application so I can adopt very soon.
Which is best among these:
1. Xcode
2. Unity using script language c#
3. tersus
Or any other tool that is not on the list.
Is it possible to ... | [
0.5108403563499451,
0.408100962638855,
0.24487565457820892,
-0.06603476405143738,
0.004091318231076002,
-0.11782518774271011,
0.3023088574409485,
0.1790057271718979,
0.014890595339238644,
-0.819219708442688,
-0.02296261303126812,
0.5484302043914795,
-0.21464411914348602,
0.0044517782516777... | |
You can run the apps you build on the iPhone Simulator, which is an application that runs on your Mac. It looks and behaves pretty much like a real iPhone, minus a few obvious things (no GPS, no camera).
Go to <http://developer.apple.com/iphone/> to get started. | [
0.5238794684410095,
0.08369269967079163,
-0.13974304497241974,
0.45699426531791687,
0.40821635723114014,
0.21826764941215515,
0.3873145878314972,
0.4569973647594452,
0.06738094240427017,
-0.6591960191726685,
0.07215192168951035,
0.6947083473205566,
-0.06793446093797684,
-0.2921723425388336... | |
I need to use year() and month() functions in Criteria API to be able to express a business filter constrain. Expressions like
```
cri.Add(Expression.Ge("year(Duration.DateFrom)", Year.Value));
cri.Add(Expression.Le("year(Duration.DateTo)", Year.Value));
```
obviously do not work - is there any solution how to achi... | [
0.1495460867881775,
0.2967347800731659,
0.7567856907844543,
-0.11323755979537964,
0.024599608033895493,
0.20489302277565002,
0.23887109756469727,
-0.4246649146080017,
-0.21378716826438904,
-0.5484499335289001,
-0.08556614071130753,
0.28446346521377563,
0.11836269497871399,
0.20919568836688... | |
this using Projections.SQLFunction. Working solution:
```
ISQLFunction sqlAdd = new VarArgsSQLFunction("(", "+", ")");
ISQLFunction sqlMultiply = new VarArgsSQLFunction("(", "*", ")");
var ym = Year.Value * 100 + Month.Value;
var dateFromMonthProj = Projections.SqlFunction("month", NHibernateUtil.Int32, Projections.P... | [
-0.13330568373203278,
-0.14059720933437347,
0.8616459965705872,
0.01726187951862812,
0.29130566120147705,
0.4074285328388214,
-0.05579020828008652,
-0.5254457592964172,
-0.23634807765483856,
-0.5979534387588501,
-0.2580069303512573,
0.3618926405906677,
0.032028619199991226,
0.3639748394489... | |
Would you write xml-doc for a namespace? And if yes, how and where?
I would think, if it is possible, maybe an almost empty file like this:
```
/// <summary>
/// This namespace contains stuff
/// </summary>
namespace Some.Namespace
{
}
```
But will that work? Since you... "declare", or at least use the namespace i... | [
0.1181824654340744,
0.08999740332365036,
-0.12742526829242706,
-0.037619929760694504,
0.05107543244957924,
-0.2610355615615845,
-0.18040446937084198,
-0.0066448082216084,
-0.2454582005739212,
-0.44224992394447327,
-0.07854218035936356,
0.43175357580184937,
-0.2382887899875641,
0.0286556575... | |
but Sandcastle appears to support the same trick.
**Edit:**
For example:
```
namespace Some.Namespace
{
/// <summary>
/// This namespace contains stuff
/// </summary>
public static class NamespaceDoc
{
}
}
``` | [
0.18481050431728363,
0.20064809918403625,
0.10615810751914978,
0.008595568127930164,
0.11088747531175613,
-0.4221592843532562,
0.11096621304750443,
0.08227182179689407,
-0.2328643947839737,
-0.648450493812561,
-0.3101006746292114,
0.33405500650405884,
-0.27291369438171387,
0.13067528605461... | |
In a testing environment, I self-signed a cert and installed it on a web site in IIS 6. This is using .NET 2.0. Cert seems fine (minus the fact that client services don't fully trust it as one would expect). I can do whatever I want to by hitting the site locally from the server on HTTPS or HTTP.
The problem is coming... | [
0.23597535490989685,
0.131842240691185,
0.332124263048172,
-0.09320276230573654,
-0.11999194324016571,
-0.26789945363998413,
0.5255294442176819,
0.10554026067256927,
-0.0761646032333374,
-0.9471036195755005,
0.036184173077344894,
0.5762757062911987,
-0.11321362853050232,
0.2654661834239959... | |
churns for a few seconds, where I can see TCP traffic from the client IP coming in).
The interesting part is that I can create a blank ASPX page, with nothing on it, and it's fine over HTTPS. But the minute I put **throw new Exception();** on the page, it goes back to dropping. By the way, it seems to act completely n... | [
0.05016012117266655,
0.07767291367053986,
0.4871201813220978,
-0.03521351516246796,
-0.06283482909202576,
-0.19342930614948273,
0.2306680530309677,
0.6771738529205322,
-0.5878497958183289,
-0.319324791431427,
0.07279200106859207,
0.00007766894123051316,
-0.20902299880981445,
0.307965815067... | |
to make sure it's not something I could fix before I bug other teams.
**EDIT** ...looks to be a firewall whitelisting problem. Others on my subnet have the same problem, but people in other locations can hit it just fine.
This is not a proxy or firewall issue, because the Yellow Screen Of Death is just text which tran... | [
0.6036094427108765,
0.04551297798752785,
-0.02205965481698513,
0.0942007377743721,
-0.192321315407753,
-0.33574798703193665,
0.6041635274887085,
0.4706727862358093,
-0.4444515109062195,
-0.7870529294013977,
0.13171006739139557,
0.4247269034385681,
-0.40487754344940186,
-0.1485278308391571,... | |
HTTPS. Such as some special handling of Error code.
2. Create a new cert and see if the same issues occures.
3. Try to reproduce this issue on another machine, it could just be a configuration issue.
4. Try getting a real cert from GoDaddy, they are only 29.99.
That is all that I can come up with right now. One thing ... | [
0.5829384922981262,
-0.12770186364650726,
0.3283466100692749,
0.5349206924438477,
-0.1461382657289505,
-0.26436835527420044,
0.7261191010475159,
0.0031034224666655064,
-0.011223562061786652,
-1.0530869960784912,
0.2746705710887909,
0.5506954193115234,
-0.43403080105781555,
-0.1629704535007... | |
I need to find release notes for Bash from 3 to 4.
I could not find them neither by google.com/linux nor by default google.
I also looked unsuccessfully at gnu.org.
**Where are the release notes for Bash?**
From [Bash website](https://www.gnu.org/software/bash/) you can download "Bourne again shell (BASH)".
Inside the... | [
0.5296894311904907,
0.3800700306892395,
0.010215326212346554,
-0.2817627191543579,
-0.1221863180398941,
0.05796685069799423,
0.1211346685886383,
-0.02014889009296894,
-0.23800913989543915,
-0.766826331615448,
0.0234636552631855,
0.8686420321464539,
-0.14179719984531403,
-0.1245256289839744... | |
In WPF Databinding, I understand that you have **`DataContext`** which tells an element what data it is going to bind to and **`ItemsSource`** which "does the binding".
But e.g. in this simple example it doesn't seem that **`ItemsSource`** is doing anything useful since, **what else would you want the Element to do t... | [
-0.0166308730840683,
-0.41410812735557556,
0.7749350666999817,
-0.21685953438282013,
-0.08861777931451797,
-0.3739093244075775,
-0.06353466957807541,
-0.6702250838279724,
-0.32102787494659424,
-0.8175966739654541,
-0.18194568157196045,
0.4823765158653259,
-0.43923431634902954,
-0.034353703... | |
understand these two concepts as to know when and how to apply each of them in various coding scenarios?**
`DataContext` is just a handy way to pick up a context for bindings for the cases where an explicit source isn't specified. It is inherited, which makes it possible to do this:
```
<StackPanel DataContext="{Stati... | [
0.026061948388814926,
-0.11248063296079636,
0.146220400929451,
-0.011731577105820179,
-0.016344888135790825,
-0.19045676290988922,
-0.272642582654953,
-0.4692571461200714,
-0.4289517104625702,
-0.645248293876648,
-0.21482820808887482,
0.4660089612007141,
-0.3258821964263916,
-0.04671180620... | |
I need to use xsl/xpath (version 1.0) to do something special (for simplifying, say insert some dummy text) when the value of SupplierId changes. I need to handle 3 variations;
1. Do something when on the first Order
(the first occurence of SupplierId)
2. Do somwthing when on OrderId O3 (SupplierId changed from S1 to ... | [
0.23628763854503632,
-0.2315446436405182,
0.9332103729248047,
-0.5169866681098938,
0.018379749730229378,
0.14771954715251923,
0.2185593694448471,
-0.24170048534870148,
-0.0942862406373024,
-0.7111596465110779,
-0.17599323391914368,
0.464686781167984,
-0.45692697167396545,
-0.03673651814460... | |
<OrderId>O2</OrderId>
<SupplierId>S1</SupplierId>
</Order>
<Order>
<OrderId>O3</OrderId>
<SupplierId>S2</SupplierId>
</Order>
<Order>
<OrderId>O4</OrderId>
<SupplierId>S2</SupplierId>
</Order>
<Order>
<OrderId>O5</OrderId>
<SupplierId>S2</S... | [
-0.5240870118141174,
0.19961050152778625,
0.4506012201309204,
-0.5276321172714233,
-0.2792859673500061,
0.8095493316650391,
0.055437251925468445,
-0.2945876121520996,
-0.23823876678943634,
-0.8487175703048706,
-0.14975380897521973,
0.359498530626297,
-0.09401045739650726,
0.118325166404247... | |
appreciate any help on this newbie question.
Wally
**This is one natural and easy solution**:
```
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="Order[1]">
First OrderId = <xsl:text/>
<xsl:value-of select="OrderId"/>
... | [
0.05045958608388901,
-0.17759113013744354,
0.5013018846511841,
0.05032242834568024,
-0.16356998682022095,
-0.19382719695568085,
-0.0042375666089355946,
-0.7133257389068604,
-0.1172676533460617,
-0.7653731107711792,
0.18399499356746674,
0.6751377582550049,
-0.3595656156539917,
-0.1019820272... | |
=
preceding-sibling::Order[1]/SupplierId
)
]">
Changes in Order OrderId = <xsl:text/>
<xsl:value-of select="OrderId"/>
SupplierId = <xsl:text/>
<xsl:value-of select="SupplierId"/>
Previous Order OrderId = <xsl:text/>
<xsl:value-of select= | [
-0.17736852169036865,
-0.29577741026878357,
0.7571753859519958,
-0.46669310331344604,
0.03713613376021385,
0.43282589316368103,
-0.09011441469192505,
-0.545007586479187,
0.0983559787273407,
-0.4776950478553772,
-0.35749903321266174,
0.6309440732002258,
-0.2955859303474426,
0.27687010169029... | |
"preceding-sibling::Order[1]/OrderId"/>
SupplierId = <xsl:text/>
<xsl:value-of select=
"preceding-sibling::Order[1]/SupplierId"/>
</xsl:template>
<xsl:template match="text()"/>
</xsl:stylesheet>
```
**When this transformation is applied on the provided XML document**:
```
... | [
-0.3948540985584259,
-0.2172883152961731,
0.7323413491249084,
-0.3136562407016754,
0.058558207005262375,
0.3606581687927246,
-0.12805704772472382,
-0.5808855295181274,
-0.051410507410764694,
-0.7362581491470337,
-0.4188200831413269,
0.4976454973220825,
-0.10965026170015335,
0.2102338671684... | |
<SupplierId>S1</SupplierId>
</Order>
<Order>
<OrderId>O3</OrderId>
<SupplierId>S2</SupplierId>
</Order>
<Order>
<OrderId>O4</OrderId>
<SupplierId>S2</SupplierId>
</Order>
<Order>
<OrderId>O5</OrderId>
<SupplierId>S2</SupplierId>
</Order>
</Orde... | [
-0.386070191860199,
-0.017403779551386833,
0.6065253019332886,
-0.4285622239112854,
0.007020359393209219,
0.7981756925582886,
-0.009990562684834003,
-0.5033915638923645,
-0.06863805651664734,
-0.7569378614425659,
-0.4564879238605499,
0.5252657532691956,
-0.16643640398979187,
0.059618592262... | |
= S2
Previous Order OrderId = O2
SupplierId = S1
Last OrderId = O5
``` | [
0.02945474162697792,
0.08424288034439087,
0.5568241477012634,
-0.4422745704650879,
-0.14996154606342316,
0.435246080160141,
0.2656426429748535,
-0.19859914481639862,
0.2196919322013855,
-0.21636445820331573,
-0.29115787148475647,
0.695534348487854,
-0.1383522003889084,
0.3506471514701843,
... | |
I'm trying to insert some value pairs into a std::map.
In the first case, I receive a pointer to the map, dereference it and use the subscript operator to assign a value. i.e.
```
(*foo)[index] = bar;
```
Later, when I try to iterate over the collection, I'm returned key/value pairs which contain null for the valu... | [
0.12397104501724243,
0.14852361381053925,
0.30474910140037537,
-0.28598371148109436,
0.111187644302845,
0.016401706263422966,
0.3526003658771515,
-0.1787707507610321,
-0.12702041864395142,
-0.6004211902618408,
-0.3392454981803894,
0.5877034664154053,
-0.28857746720314026,
0.120372809469699... | |
for context
```
...
typedef std::map<int, SCNode*> SCNodeMap;
...
void StemAndCycle::getCycleNodes(SCNodeMap* cycleNodes)
{
(*cycleNodes)[root->getId()] = root;
SCNode* tmp = root->getSucc();
while(tmp->getId() != root->getId())
{
// (*cycleNodes)[tmp->getId()] == tmp; // crashes (in loop bel... | [
-0.16175250709056854,
-0.26602470874786377,
0.2440132349729538,
0.11056341975927353,
0.07137532532215118,
0.08564645051956177,
0.17610614001750946,
-0.39296039938926697,
-0.6866351962089539,
-0.6386610269546509,
-0.6132766008377075,
0.32459643483161926,
-0.4119296371936798,
-0.007314180955... | |
std::map<int, SCNode*>::iterator it = cycleNodes->begin();
while(it != cycleNodes->end())
{
std::pair<int, SCNode*> p = (*it);
SCNode* tmp = (*it).second; // null except for it = cycleNodes->begin()
std::cout << "tmp node id: "<<tmp->getId()<<std::endl;
it++;
}
}
```
I'm ... | [
-0.21021029353141785,
-0.1939496546983719,
0.3636235296726227,
-0.11549509316682816,
0.06818272173404694,
0.040509555488824844,
0.24075551331043243,
-0.2677120864391327,
-0.4010586440563202,
-0.879852831363678,
-0.3624085783958435,
0.15848681330680847,
-0.5511257648468018,
-0.1067799180746... | |
the map creating an empty value (see @Neil Butterworth) - you have == instead of =. What you want is:
```
(*cycleNodes)[tmp->getId()] = tmp;
``` | [
0.13593822717666626,
-0.23890291154384613,
0.3527218997478485,
0.1579035073518753,
0.18328143656253815,
-0.07656808942556381,
0.15985557436943054,
-0.1752091497182846,
-0.41968104243278503,
-0.693954586982727,
-0.2058316022157669,
0.4207986295223236,
-0.6492984294891357,
-0.123187266290187... | |
I keep getting this error after my application is running for 2 days.
I've been told it's been some kind of buffer overflow, but is it the only option?
The app is written in C++ using Visual C++ 6.0.
In debug, when you get dynamic buffer by `new`, a special code gets inserted before and after the buffer to guard the ... | [
0.21885694563388824,
0.32960614562034607,
0.2961481213569641,
-0.17935416102409363,
0.11509740352630615,
0.14172254502773285,
0.620598554611206,
-0.08061067014932632,
-0.15061743557453156,
-0.7083606719970703,
-0.22094543278217316,
0.7372380495071411,
-0.6056873202323914,
-0.15838053822517... | |
code base. I would suggest couple of ways which can help you to detect this scenario:
* Using tools like [Rational Purify](http://www-01.ibm.com/software/awdtools/purify/):
Its good tool to detect memory corruption.
* Debugging by Windbg with GFlags
enabled:
Refer my [answer](https://stackoverflow.com/questions/78... | [
0.020089948549866676,
0.004216141998767853,
0.04462428018450737,
0.22934435307979584,
0.0591622069478035,
0.009205391630530357,
0.25673994421958923,
-0.12887607514858246,
-0.2011401355266571,
-0.4385768175125122,
-0.11585265398025513,
0.463967502117157,
-0.00009311342728324234,
-0.03164302... | |
I am pulling a value via JavaScript from a textbox. If the textbox is empty, it returns `NaN`. I want to return an empty string if it's null, empty, etc.
What check do I do? `if(NAN = tb.value)`?
Hm, something is fishy here.
In what browser does an empty textbox return NaN? I've never seen that happen, and I cannot r... | [
0.15117903053760529,
0.0233490951359272,
-0.1972501575946808,
-0.18413972854614258,
-0.1927761435508728,
0.27870750427246094,
0.2163671851158142,
0.11664348095655441,
-0.1507142186164856,
-0.6320444941520691,
0.1673165112733841,
0.3740943670272827,
-0.2511402666568756,
0.48285114765167236,... | |
parsed as a number, except for empty strings. That means it's a good check for numeric input (much easier than regexes):
```
if (tb.value != "" && !isNaN(tb.value))
{
// It's a number
numValue = parseFloat(tb.value);
}
``` | [
-0.16759000718593597,
0.33639228343963623,
0.045278456062078476,
-0.21473060548305511,
-0.02960234507918358,
0.09388630092144012,
0.30953848361968994,
-0.18833789229393005,
-0.1705615520477295,
-0.266399621963501,
-0.22053731977939606,
0.37831830978393555,
-0.43898895382881165,
-0.10282289... | |
I'd like to declare a function that returns a pointer to a function of the same type.
I would like to use it to implement state machines like the one below:
```
typedef event_handler_t (*event_handler_t)(event_t*); // compilation error
event_handler_t state2(event_t* e);
event_handler_t state1(event_t* e) {
swi... | [
0.15053032338619232,
-0.4220724403858185,
-0.09142475575208664,
-0.17061293125152588,
0.1353539675474167,
-0.0115974061191082,
0.11869452893733978,
-0.11804623156785965,
-0.07028179615736008,
-0.7432913184165955,
-0.19691121578216553,
0.5075569748878479,
-0.5115467309951782,
0.244858369231... | |
//...
}
}
//...
event_handler_t event_handler;
//...
event_handler(&e);
//...
```
I manage to work around the compliation error using structures as follows:
```
typedef struct event_handler {
struct event_handler (*func)(event_t *);
} event_handler_t;
```
But this makes return statment more complicated... | [
-0.10409891605377197,
-0.32376357913017273,
-0.0038838174659758806,
-0.16615064442157745,
-0.0070729912258684635,
0.08786281198263168,
0.0695292055606842,
-0.40776705741882324,
-0.28315094113349915,
-0.6181240677833557,
-0.33010655641555786,
0.5057945847511292,
-0.4030589461326599,
0.00122... | |
way to create such function pointers in c.
It's not possible to do this in C: a function can't return a pointer to itself, since the type declaration expands recursively and never ends. See this page for an explanation: <http://www.gotw.ca/gotw/057.htm>
The workaround described on the above page means returning `void ... | [
0.14421269297599792,
-0.21069900691509247,
0.07137113064527512,
0.0231651421636343,
-0.10459648817777634,
-0.24266764521598816,
0.3111090660095215,
-0.12360412627458572,
-0.29650163650512695,
-0.4919669032096863,
-0.13459162414073944,
0.7274115681648254,
-0.30586639046669006,
0.10979127883... | |
**Background:** Trevor is working with a PHP implementation of a standard algorithm: take a main set of default name-value pairs, and update those name-value pairs, but only for those name-value pairs where a valid update value actually exists.
**Problem:** by default, PHP array\_merge works like this ... it will over... | [
-0.08877409994602203,
0.02577582746744156,
0.22379647195339203,
0.05259086936712265,
0.3983384072780609,
0.27831101417541504,
0.5686119198799133,
-0.0033910805359482765,
-0.4462141692638397,
-0.3586924076080322,
-0.1464233249425888,
0.2152988165616989,
-0.6036719679832458,
0.28800863027572... | |
NOT COOL!
[age] => 33 // <-- update set this to 33, thats cool
[lastname] => griffin // <-- update added this key-value pair, thats cool
[nation] => usa // <-- update filled in a blank, thats cool.
)
*/
```
**Question:** What's the fewest-lines-of-code way to do array\_merge where... | [
0.18581633269786835,
-0.07756341993808746,
0.18284089863300323,
0.15906046330928802,
0.30325183272361755,
-0.0909026637673378,
0.43606966733932495,
-0.043966736644506454,
-0.14929306507110596,
-0.21866348385810852,
-0.3761240541934967,
0.22744987905025482,
-0.31767550110816956,
-0.19507558... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.