text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
begin
m2.Lines.Add(s);
end;
end;
m2.Lines.EndUpdate;
```
**Edit2**: Example of unicode data:
قُلْ هُوَ اللَّهُ أَحَدٌ
If you search only letters without diacritics قل the word قُلْ wont be found.
I find that diacritics are not the only problem.
I would do character replacements, re... | [
-0.3089302182197571,
0.2372540384531021,
0.4271875321865082,
-0.47729676961898804,
-0.5665276646614075,
0.3110806345939636,
0.06804875284433365,
-0.13666555285453796,
0.09854279458522797,
-0.7113177180290222,
-0.6072422862052917,
0.32225143909454346,
-0.30199381709098816,
-0.20739020407199... | |
same for ى ئ ي ؤ و ة ه ...
For search I'd also use a light stemmer like the "khoja stemmer" (Java source [here](http://zeus.cs.pacificu.edu/shereen/ArabicStemmerCode.zip))
A more advanced way is to do it like [TREC](http://trec.nist.gov/pubs/trec10/papers/UMass_TREC10_Final.pdf):
* Remove punctuation
* Remove diacri... | [
-0.16294680535793304,
0.11289980262517929,
-0.02858116663992405,
-0.4621729850769043,
-1.0750775337219238,
0.5775317549705505,
0.5957533121109009,
-0.2111760377883911,
0.14060598611831665,
-0.7795252203941345,
-0.26787519454956055,
0.3789527118206024,
-0.3335971534252167,
-0.16990140080451... | |
آال، بال، وال، ال، ) and و
(and) from the beginnings of normalized words
* Strip 10 suffixes from the ends of words ات ان، ها،ي ة، ه، ية، يه، ين، ون
I would index the text by this modified text (for memos I'd store the index of the word in the original text), and do the same thing for the search query.
I would also s... | [
0.3546271026134491,
0.22262685000896454,
0.2972840964794159,
-0.08980615437030792,
-0.7338379621505737,
0.5825388431549072,
0.06907450407743454,
-0.35773107409477234,
-0.04071391373872757,
-0.642376184463501,
-0.20262958109378815,
0.44594570994377136,
-0.43939319252967834,
-0.0115704219788... | |
I am seeing simple examples regarding custom configuration in .NET. My case is a bit more complex, with nested nodes.
I'd like to be able to read this from the configuration file:
```
<environments>
<environment name="live" url="http://www.live.com">
<server name="a" IP="192.168.1.10"></server>
<server name="b"... | [
0.47236108779907227,
0.08172623068094254,
-0.027535295113921165,
0.06423342227935791,
-0.06891374289989471,
-0.03706430271267891,
0.07823722809553146,
-0.20308950543403625,
-0.2026614546775818,
-1.0156819820404053,
0.17066290974617004,
0.47895580530166626,
-0.20730215311050415,
0.295000284... | |
the "server" element:
```
public class ServerElement: ConfigurationElement
{
[ConfigurationProperty("name", IsRequired = true, IsKey = true)]
public string Name
{
get { return ((string)base["name"]); }
set { base["name"] = value; }
}
...
}
```
The environment element is actually ... | [
-0.1147487461566925,
-0.10741155594587326,
0.5402957201004028,
-0.10122474282979965,
0.23665495216846466,
-0.06344062089920044,
0.054355885833501816,
-0.12497050315141678,
-0.03159579262137413,
-0.5890894532203674,
-0.4341002404689789,
0.4611175060272217,
-0.4271780252456665,
0.43752482533... | |
What is the difference between [ToolStripSplitButton](http://msdn.microsoft.com/en-us/library/system.windows.forms.toolstripdropdown.aspx) and [ToolStripDropDownButton](http://msdn.microsoft.com/en-us/library/system.windows.forms.toolstripdropdownbutton.aspx)?
(Visual Studio 2008) (Also asked [here](http://www.experts-... | [
0.4830140769481659,
-0.31212130188941956,
0.19674286246299744,
0.185753732919693,
-0.4698689579963684,
-0.06591679155826569,
-0.13702492415905,
-0.13989485800266266,
-0.3618450462818146,
-0.19041968882083893,
0.1227104663848877,
0.511702835559845,
-0.16086483001708984,
-0.1783180981874466,... | |
beyond displaying the drop-down menu. They are like the topmost items in a menu: they don't do anything when clicked other than to show you more items. | [
0.4444729685783386,
-0.19679808616638184,
0.23817363381385803,
0.14608317613601685,
0.12091951817274094,
-0.18551447987556458,
-0.06711603701114655,
0.4144775867462158,
-0.3713783025741577,
-0.4016650319099426,
-0.12072084099054337,
0.450688898563385,
-0.028989974409341812,
0.0534325242042... | |
I have a C# application the performs some runtime compilation of source files containing calculations into dynamic assemblies. Obviously this presents a serious security issue.
From the following 'formula', the code below would be generated, and a dynamic assembly created:
Formula:
```
Int32 _index = value.LastIndex... | [
0.04613902419805527,
-0.10325271636247635,
0.4767276644706726,
-0.21476344764232635,
-0.0599028542637825,
0.05955587327480316,
0.33964577317237854,
-0.850953221321106,
-0.24948471784591675,
-0.3529329001903534,
-0.10841136425733566,
0.40226802229881287,
-0.5058496594429016,
0.2693559229373... | |
return _retVal;
// End external code
}
}
}
```
The dynamic assembly is then loaded and the Evaluate method executed via Reflection. This works Great.
The problem is that the potential for malicious code injection is huge, so I want to run the Evaluate method in a 'Sandboxed' thread (without any unmanaged... | [
0.15695852041244507,
-0.0065717934630811214,
0.7973728179931641,
-0.29736191034317017,
-0.15011517703533173,
0.10306542366743088,
0.4176991581916809,
-0.49840736389160156,
0.03590676933526993,
-0.5578308701515198,
0.04772435128688812,
0.9671619534492493,
-0.30411607027053833,
0.06953963637... | |
users' Identity and Principal. How can this be applied to thread tSandbox so the code on that thread runs in the specified Security Context, without using Unmanaged API calls?
Thanks!
If you only need the anonymous account, you might be pretty close -- you just need to assign the principle to the thread (you do this f... | [
0.2738124132156372,
-0.056021079421043396,
0.4933168590068817,
0.17872083187103271,
0.0853089988231659,
-0.3137319087982178,
0.25308486819267273,
0.14813067018985748,
-0.43314361572265625,
-0.47946298122406006,
0.1963547021150589,
0.4380052983760834,
-0.20657722651958466,
0.146347105503082... | |
see a way around that.
Here's some code that works with the anonymous user (it assumes an ASP.Net Web ApplicationProject, where you have a tag on the form named "identityLabel", and you have assigned onInit="IdentityLabelInit")
(note the code runs differently depending upon whether you are running it under IIS or Cass... | [
-0.309219092130661,
-0.2601870000362396,
0.19941751658916473,
0.04286324977874756,
0.30297181010246277,
-0.014766004867851734,
0.13253532350063324,
-0.003776606870815158,
-0.16064110398292542,
-0.6149833798408508,
-0.24190513789653778,
0.3953491747379303,
-0.3952213525772095,
0.36373102664... | |
= new Thread(ReportIdentity);
testThread.Start();
testThread.Join();
}
private void ReportIdentity()
{
identityLabel.InnerText = "Initialized: " + System.Threading.Thread.CurrentPrincipal.Identity.Name;
System.Security.Principal.IPrincipal current... | [
-0.21110282838344574,
-0.25617870688438416,
0.5066030621528625,
0.02336372435092926,
0.34902453422546387,
0.03132917732000351,
0.15577276051044464,
-0.20626063644886017,
-0.21329794824123383,
-0.14572620391845703,
-0.2671912908554077,
0.3293314278125763,
-0.30648842453956604,
0.61327147483... | |
System.Security.Principal.IPrincipal newPrincipal = System.Threading.Thread.CurrentPrincipal;
if (newPrincipal.Equals(currentPrincipal))
identityLabel.InnerText += ("no change");
else
identityLabel.InnerText += " | new name: " + System.Threading.Thread.CurrentPrin... | [
-0.1978222131729126,
-0.4405996799468994,
0.5983971953392029,
0.16124311089515686,
0.542929470539093,
0.03329142928123474,
0.0734165832400322,
-0.11320722848176956,
-0.3483944833278656,
-0.467190146446228,
-0.28525128960609436,
0.37454330921173096,
-0.5683981776237488,
0.5519842505455017,
... | |
{
WindowsIdentity tIdentity = WindowsIdentity.GetAnonymous();
WindowsPrincipal tPrincipal = new WindowsPrincipal(tIdentity);
System.Threading.Thread.CurrentPrincipal = tPrincipal;
}
``` | [
-0.5016077160835266,
-0.39849424362182617,
1.030922532081604,
-0.032353322952985764,
0.3272201120853424,
0.270283579826355,
-0.08801129460334778,
0.2542484998703003,
-0.58393794298172,
-0.7848349809646606,
-0.26467636227607727,
0.5562779307365417,
-0.05853675678372383,
0.3032155930995941,
... | |
Is there any way to set a foreign key in django to a *field* of another model?
For example, imagine I have a ValidationRule object. And I want the rule to define what field in another model is to be validated (as well as some other information, such as whether it can be null, a data-type, range, etc.)
Is there a way ... | [
0.13342104852199554,
0.20484423637390137,
0.19544455409049988,
-0.2712361514568329,
-0.14380541443824768,
-0.368587464094162,
-0.12029306590557098,
-0.10656804591417313,
-0.17192935943603516,
-0.29612910747528076,
0.2075415849685669,
0.694939374923706,
-0.40746456384658813,
-0.144596800208... | |
I am coming from the django world to maintain a fairly complicated classic asp site. Unfortunately the site is riddled with uncommented, copy/pasted, spaghetti code spread out over several hundred files hidden away in a few dozen directories.
To be curt, it's a bit of a nightmare ;)
Anyway, I am most familiar with ec... | [
0.3846047818660736,
0.23808369040489197,
-0.047185804694890976,
-0.1267486959695816,
-0.3025274872779846,
-0.08073974400758743,
0.0783618912100792,
0.07751873135566711,
-0.20370426774024963,
-0.2927912175655365,
0.06897738575935364,
0.5322685837745667,
0.058110348880290985,
-0.086715608835... | |
how?
If I need to add everything to a project, what is the best way to bring it all in? I havn't used vs in a while, but last I checked it liked to add a lot of files to your web server. Is that still an issue?
thanks so much, my sanity may depend on it lol
**edit**: I should note that I'm not married to using vs200... | [
0.7417310476303101,
-0.09079033136367798,
0.24873343110084534,
0.42890673875808716,
-0.03613683953881264,
-0.27730971574783325,
0.3424687683582306,
-0.14139093458652496,
-0.38004371523857117,
-0.42484912276268005,
0.17839276790618896,
0.586564302444458,
0.09863323718309402,
0.1273033469915... | |
asp classic code with visual studio 2005 or later?](https://stackoverflow.com/questions/958968/has-anybody-been-able-to-debug-asp-classic-code-with-visual-studio-2005-or-later)
following these instructions...
<http://www.codeproject.com/KB/debug/DebugVBScriptVS2008.aspx>
<http://codepagoda.com/2009/04/30/debugging-c... | [
-0.13774752616882324,
-0.09285200387239456,
0.41532737016677856,
-0.2302113175392151,
-0.31276634335517883,
-0.15700724720954895,
0.6757407784461975,
-0.1482061743736267,
-0.5282687544822693,
-0.25323987007141113,
-0.37685734033584595,
0.8333539962768555,
0.1333683878183365,
-0.23081348836... | |
So lets say I have an object that it stored in a Database:
```
com.test.dummy.Cat
```
The cat has an integer id.
Outside of my "world" the reference to the object is a String of the form:
Cat-433
Where 433 is the Cats assigned Database ID.
When I get the String passed to me, I need to be able to find it in the D... | [
0.36709466576576233,
0.2763783633708954,
0.018684133887290955,
-0.24224846065044403,
-0.1164044588804245,
0.01989540085196495,
0.3436047434806824,
-0.4895787835121155,
0.07859230786561966,
-0.5719277858734131,
0.005837176460772753,
0.28632813692092896,
-0.39292994141578674,
0.3006159663200... | |
thinking some sort of XML mapping, or hardcoded pure java mapping. What are my options?
If you already know that you're going to be reading a Cat from the database, why isn't your DAO for the Cat table coded to create a new Cat() before populating it with the values you read?
You would have a Factory that would return... | [
0.07864180207252502,
-0.14831982553005219,
0.15798060595989227,
-0.06249808147549629,
0.03809252753853798,
0.1139841303229332,
0.045801907777786255,
-0.29598796367645264,
-0.06966204196214676,
-0.5560407042503357,
-0.09731212258338928,
0.31714311242103577,
-0.5118666887283325,
-0.104873195... | |
method. | [
-0.0940784439444542,
0.017038587480783463,
0.031830962747335434,
0.22511306405067444,
0.08810003101825714,
0.22247709333896637,
-0.017039595171809196,
-0.4458756744861603,
-0.023595772683620453,
-0.5204904675483704,
-0.006134359166026115,
0.19231955707073212,
0.09704526513814926,
0.0449276... | |
What do you think is the best way to markup a snail mail address? I found some different options such as:
```
<div class="address">
<span class="name">Mr. Bob</span><br/>
<span class="street">45654 Bob Ln</span><br/>
<span class="city">Imaginery</span>,<span class="state">OH</span><br/>
<span class="postalCode">44321<... | [
0.2959630489349365,
-0.08472514152526855,
0.3418063819408417,
0.09217695146799088,
-0.11486013233661652,
0.4502689242362976,
-0.13940449059009552,
-0.08727569878101349,
-0.3479340970516205,
-0.9213854670524597,
0.25761300325393677,
0.04241817817091942,
-0.3261062502861023,
-0.0269462782889... | |
context about each element. I also feel the br is part of the content in this case.
Use the adr microformat:
<http://microformats.org/wiki/adr>
If you also want to mark up the persons name use hCard:
<http://microformats.org/wiki/hcard>
Which includes adr. | [
0.29879873991012573,
0.25775569677352905,
0.41379016637802124,
-0.22885335981845856,
-0.5080357789993286,
-0.018695509061217308,
0.188597172498703,
-0.36359667778015137,
-0.026149757206439972,
-0.4408891201019287,
-0.3457656502723694,
0.15440873801708221,
0.04857345297932625,
-0.0982256978... | |
I used the Database Publishing Wizard to generate a script of the schema for a database, how do I make a new database based on this .sql file?
Open the SQL file, and add the CREATE DB syntax to the top.
<http://msdn.microsoft.com/en-us/library/aa258257.aspx>
Save it and run it with sqlcmd or query analyzer.
Or use ... | [
0.5279006361961365,
0.34722089767456055,
0.10254362970590591,
0.058255914598703384,
-0.37324050068855286,
-0.09523385018110275,
0.1423715204000473,
-0.1173645555973053,
0.24007578194141388,
-0.6573542952537537,
0.18940520286560059,
0.46811774373054504,
-0.3937080502510071,
0.38657930493354... | |
```
$ mkdir foo
$ cd foo
$ hg init .
$ hg log
abort: Is a directory
$ hg history
abort: Is a directory
```
Darwin Host.local 9.6.1 Darwin Kernel Version 9.6.1: Wed Dec 10 10:38:33 PST 2008; root:xnu-1228.9.75~3/RELEASE\_I386 i386
```
$ hg --version
Mercurial Distributed SCM (version 1.2.1)
$ python --version
Python ... | [
-0.07733748108148575,
0.31314894556999207,
0.4177793562412262,
-0.14654268324375153,
-0.1699269860982895,
-0.19621844589710236,
0.5917708873748779,
-0.13047364354133606,
-0.17158950865268707,
-0.5605233311653137,
-0.1483038067817688,
0.5311777591705322,
-0.5689182877540588,
0.1765334904193... | |
of python and mercurial. I hope that isn't mercurial's idea of a good error message when it has a permission problem.
2nd update (from dkbits suggestions below):
```
$ sudo dtruss hg log
[snip]
...
stat("/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site- packages/mercurial/templates/git... | [
-0.2083619087934494,
0.16651074588298798,
0.5846657156944275,
-0.21543918550014496,
0.04302316904067993,
-0.23761917650699615,
0.1053849458694458,
-0.07856550067663193,
-0.18080490827560425,
-0.4083127975463867,
-0.4940344989299774,
0.4332140386104584,
-0.3328164219856262,
0.03620057925581... | |
look okay on it.
I took another look and it is actually caused by the .hgrc line:
style = gitweb
Why that is I'm not sure but the error message sure sucks still. | [
0.5285508632659912,
0.2840791940689087,
0.09909971058368683,
0.11429046839475632,
0.24338030815124512,
-0.2385065257549286,
0.5213847160339355,
0.9915697574615479,
-0.2578134536743164,
-0.7789868712425232,
0.22140958905220032,
0.06008350849151611,
-0.01716955192387104,
0.41756880283355713,... | |
In common lisp, the function (trace name) can be used to see output about the calls to a function.
If my function is declared with local scope, how do I describe it to trace?
eg, how do I trace bar, below:
```
(defun foo (x)
(labels ((bar (y) (format t "bar: ~a~&" y)))
(bar x)))
```
Tracing local functi... | [
0.12397253513336182,
0.2555820345878601,
0.4213838279247284,
-0.2631920576095581,
0.040423180907964706,
-0.23810669779777527,
-0.08369436115026474,
-0.2877275347709656,
0.09316620230674744,
-0.2934652268886566,
0.04550202563405037,
0.45596960186958313,
-0.4592618942260742,
-0.1595325469970... | |
might be useful to have a macro so that you can write the call to bar as (trace-it (bar x)) and the macro would expand into code that prints the entry and exit. | [
0.23447014391422272,
0.08524339646100998,
0.36859720945358276,
-0.22953760623931885,
0.344464510679245,
-0.11537285894155502,
-0.22650684416294098,
-0.17287646234035492,
-0.041310444474220276,
-0.20828625559806824,
-0.10003755241632462,
0.2916324734687805,
-0.39791232347488403,
0.028363473... | |
I have the following class hierarchy:
```
public abstract class BaseData
{
//some properties
}
public class CoData : BaseData
{
//some properties
}
```
I am working with a method that requires the return type to be `List<BaseData>`. In the method, I have access to `List<CoData>`
```
public List<BaseData> Save(... | [
-0.002854780061170459,
-0.16755543649196625,
0.1921073943376541,
-0.16765378415584564,
-0.24680238962173462,
0.040593937039375305,
0.08341862261295319,
-0.2890021800994873,
-0.07369223982095718,
-0.8787549138069153,
0.027599889785051346,
0.4243495464324951,
-0.41645336151123047,
0.21338434... | |
the same way as well? from
ie., Can I do this - `List<CoData> listCoData = listBaseData.Cast<BaseData>().ToList();`
Yes; welcome to variance. Ultimately, it **isn't** a list of `BaseData` - for example, if you had another subclass, a `List<BaseData>` would (at compile time) let you `.Add` it... but the runtime type w... | [
0.3418098986148834,
-0.20111730694770813,
0.26564961671829224,
0.009877876378595829,
-0.4748709201812744,
-0.4434598386287689,
0.1001012995839119,
-0.3477243483066559,
-0.2474752813577652,
-0.5046350955963135,
0.24104180932044983,
0.39800840616226196,
-0.3393186330795288,
0.151100262999534... | |
First the code (sorry if its not 100%) I am no expert and then the question follows.
```
public partial class Window1 : Window
{
CollectionView cv;
public Window1()
{
InitializeComponent();
List<Person> ppl = new List<Person>();
BitmapImage b = new BitmapImage(new Uri(@"ht... | [
-0.15022780001163483,
-0.11675556004047394,
0.7887982726097107,
-0.3129618465900421,
-0.1011136919260025,
0.24919702112674713,
0.16947859525680542,
-0.3114805519580841,
-0.12820814549922943,
-0.42899173498153687,
-0.637829065322876,
0.64835125207901,
-0.03104310855269432,
-0.00816562958061... | |
ppl.Add(new Person(b, "world3"));
ppl.Add(new Person(b, "world4"));
ppl.Add(new Person(b, "world5"));
ppl.Add(new Person(b, "world6"));
lb.ItemsSource = ppl;
lb.SelectedIndex = 1;
cv = (CollectionView)CollectionViewSource.GetDefaultView(lb.ItemsSource);
new Tex... | [
-0.17311199009418488,
-0.3217339515686035,
0.7871359586715698,
0.023994578048586845,
-0.02938440628349781,
0.3493608236312866,
0.11921755224466324,
-0.44863075017929077,
-0.23998194932937622,
-0.6446946263313293,
-0.7951671481132507,
0.4171566963195801,
-0.16939608752727509,
0.094903089106... | |
string filterText = "";
cv.Filter = delegate(object obj)
{
Person p = obj as Person;
int index = p.Info.IndexOf(filterText,0,StringComparison.InvariantCultureIgnoreCase);
return index > -1;
};
tb.TextChanged += delegate
{ | [
-0.1020049974322319,
-0.6364246010780334,
0.2973339259624481,
0.06415539979934692,
-0.08026003837585449,
0.39084288477897644,
0.19476673007011414,
-0.3785374164581299,
-0.2322515845298767,
-0.5521551370620728,
-0.24120201170444489,
0.2748405635356903,
-0.7148622274398804,
0.086653836071491... | |
filterText = tb.Text;
cv.Refresh();
};
}
}
class Person
{
private BitmapImage myImage;
private string myInfo = "";
public BitmapImage Image
{
get { return myImage; | [
-0.1803685575723648,
-0.7735560536384583,
0.3125156760215759,
-0.22310537099838257,
0.0790519267320633,
0.24733956158161163,
0.45977312326431274,
-0.123607337474823,
0.08822434395551682,
-0.8692187666893005,
-0.4088902473449707,
0.7716348171234131,
-0.6210670471191406,
-0.06383016705513,
... | |
}
set { myImage = value; }
}
public string Info
{
get { return myInfo; }
set { myInfo = value; }
}
public Person(BitmapImage Image, string Info) | [
-0.11461810022592545,
-0.6319664120674133,
0.21078526973724365,
0.2976711392402649,
0.24083951115608215,
0.28433534502983093,
0.09179997444152832,
0.17144636809825897,
0.18535448610782623,
-0.6177740097045898,
-0.39721444249153137,
0.7872236371040344,
-0.3401387333869934,
-0.14579525589942... | |
{
this.Image = Image;
this.Info = Info;
}
}
```
Thank you for reading so far, as you would have understood by now is that the code filters a listbox based on the input in the textbox, which works like a charm btw.
My problem is how do I preserve the selection during filtering. Whe... | [
0.20770148932933807,
-0.011294987984001637,
0.19598281383514404,
-0.04557236656546593,
-0.20384110510349274,
-0.1765599101781845,
0.10199801623821259,
0.0826147198677063,
-0.19717095792293549,
-0.9381183385848999,
-0.1278732568025589,
0.45468759536743164,
-0.3828660547733307,
0.21676813066... | |
I select the first item, then I type something in the textbox and the listbox filters to only show the relevant items, after selecting another item I remove all the text from the text box which brings it back to the original state but this time the selection has changed to only the item that I selected in the filtered ... | [
0.22727571427822113,
-0.3976239264011383,
0.30160999298095703,
0.08796045184135437,
-0.1867676079273224,
0.32840076088905334,
0.18733231723308563,
-0.20655342936515808,
-0.306410551071167,
-0.7008664608001709,
-0.08454184234142303,
0.25107651948928833,
-0.3456591069698334,
0.34078720211982... | |
preserve the selection? any pointers?
Many Thanks.
Probably in your TextChanged event handler, you should store the ListBox's selected items, like so:
```
Person[] selectedPeople = new Person[lb.SelectedItems.Count];
lb.SelectedItems.CopyTo(selectedPeople, 0);
```
Then after refreshing the filter, add them back usi... | [
0.14122723042964935,
-0.263545423746109,
0.08593641966581345,
-0.00024035600654315203,
0.11009226739406586,
0.15047858655452728,
0.011238236911594868,
-0.3095005750656128,
-0.1717967391014099,
-0.7615734934806824,
-0.17426900565624237,
0.4414462149143219,
-0.5026786923408508,
0.19044177234... | |
be an easier way, but this should get you headed in the right direction. | [
0.29011717438697815,
0.03236035257577896,
0.14408141374588013,
0.04459631070494652,
0.08293014019727707,
-0.27232256531715393,
0.33740532398223877,
0.41669875383377075,
0.011991317383944988,
-0.5260793566703796,
0.2719815671443939,
0.31105178594589233,
0.3052578270435333,
-0.31523910164833... | |
I need a way of getting the active server address, port, and context during runtime from my flex application. Since we are using ant for our build process, the server connection information is dynamically specified in our build properties file, and the {server.name}, {server.port} and {context.root} placeholders are us... | [
0.23973439633846283,
0.08278578519821167,
0.4877779185771942,
0.028365282341837883,
-0.17512039840221405,
0.17902272939682007,
0.22131572663784027,
-0.1027069091796875,
-0.12082132697105408,
-0.9987667798995972,
-0.02528177574276924,
0.16943064332008362,
-0.1586054563522339,
0.224130392074... | |
are presently doing).
I have found that I can at least get the context root by adding the following to our main application MXML file:
```
<mx:Application ... >
<mx:HTTPService id="contextRoot" rootURL="@ContextRoot()"/>
</mx:Application>
```
However, I still need some way of fetching the server address and port,... | [
-0.04012739285826683,
-0.03359849750995636,
0.7285323143005371,
-0.09260015934705734,
-0.15117762982845306,
0.10028283298015594,
0.024982230737805367,
-0.1435757875442505,
-0.5070298314094543,
-0.8957839608192444,
-0.2021791636943817,
0.4690518379211426,
-0.12014219164848328,
0.05712434649... | |
* The URI of the AMF channel endpoint. <br/>
* Default to #rootURI + #channelEndPointContext + #this.channelEndPointPathInfo
*/
public function get channelEndPointURI() : String
{
return this.rootServerURI + ( this.channelEndPointContext ? this.channelEndPointContext : "" ) + this.channelEndPointPathInfo
}
... | [
-0.33042314648628235,
0.04029398784041405,
0.6498449444770813,
-0.2724456489086151,
0.029880225658416748,
0.21222421526908875,
0.17750762403011322,
-0.3664979040622711,
-0.12300257384777069,
-0.6380372047424316,
-0.4306368827819824,
0.4150448143482208,
-0.30413568019866943,
0.3435634374618... | |
{
var result : String = ""
if ( this.url && ( this.url.indexOf("file:/") == -1 ) )
{
var uri : URI = new URI( this.url )
result = uri.scheme + "://" + uri.authority + ":" + uri.port
}
else
{ | [
0.08186320215463638,
-0.24708174169063568,
0.7156438827514648,
-0.12539266049861908,
0.09755308926105499,
0.015506940893828869,
0.21766632795333862,
-0.6483950614929199,
-0.16744272410869598,
-0.3108067214488983,
-0.3290765881538391,
0.546269953250885,
-0.03928569704294205,
0.2870997786521... | |
result = this.localServerRootURI
}
return result
}
```
This generic application supports the `channelEndPointContext`, `channelEndPointPathInfo` and `localServerRootURI` properties (typically "mycontext" and "/messagebroker/amf/" in your example, the local server root being used when the application is... | [
-0.23674169182777405,
-0.1691288948059082,
0.7763710618019104,
-0.2443169504404068,
0.03077320009469986,
-0.13496021926403046,
0.24895888566970825,
-0.20176276564598083,
0.08511083573102951,
-0.5626866817474365,
-0.27105799317359924,
0.4862997829914093,
-0.06487013399600983,
0.300756484270... | |
understand your case too).
So, in your example, one would write :
```
<SuperApplication ...> <!-- SuperApplication is the enhanced Application subclass -->
<mx:HTTPService id="myHTTPService" url="{this.channelEndPointURI}"/>
</SuperApplication>
```
Starting from here, one can also automatically determine the ... | [
-0.10704192519187927,
-0.1825508028268814,
0.6462670564651489,
-0.06269091367721558,
0.0262768417596817,
-0.34095054864883423,
0.1707303524017334,
-0.04859788343310356,
0.019253110513091087,
-0.6858048439025879,
-0.2618299126625061,
0.4963758587837219,
-0.03931388258934021,
0.1490720957517... | |
How can data written to a file **really** be flushed/synced with the block device by Java.
I tried this code with NIO:
```
FileOutputStream s = new FileOutputStream(filename)
Channel c = s.getChannel()
while(xyz)
c.write(buffer)
c.force(true)
s.getFD().sync()
c.close()
```
I supposed that c.force(true) togehter... | [
0.22268186509609222,
-0.3377806544303894,
0.894942045211792,
-0.11274366080760956,
0.08912590891122818,
-0.15431153774261475,
0.33816978335380554,
-0.5804548263549805,
-0.1597263514995575,
-0.6717116832733154,
-0.1581873893737793,
0.7609842419624329,
-0.23913097381591797,
0.105459250509738... | |
last invoked, will have been written to that device. This is useful for ensuring that critical information is not lost in the event of a system crash.
The documentation to [sync](http://java.sun.com/j2se/1.4.2/docs/api/java/io/FileDescriptor.html#sync()) states:
> Force all system buffers to synchronize with the unde... | [
0.03320300206542015,
0.12204266339540482,
0.8126456141471863,
-0.04862082749605179,
0.38203367590904236,
-0.05071885883808136,
0.3637876808643341,
-0.2584676444530487,
-0.0595305897295475,
-0.5467625260353088,
-0.5237022638320923,
0.5044478178024292,
-0.25387418270111084,
0.170437157154083... | |
medium. sync is meant to be used by code that requires physical storage (such as a file) to be in a known state.
These two calls should be sufficient. Is it? I guess they aren't.
Background: I do a small performance comparison (2 GB, sequential write) using C/Java and the Java version is twice as fast as the C versio... | [
-0.08283828943967819,
0.08930960297584534,
0.7137525677680969,
-0.03545315936207771,
0.09029870480298996,
-0.07567591965198517,
0.2304079234600067,
-0.09908133000135422,
-0.09504783898591995,
-0.6901586651802063,
-0.14643363654613495,
0.9236739277839661,
-0.052004098892211914,
-0.070949561... | |
(open,write,close) doesn't change much):
```
FILE* fp = fopen(filename, "w");
while(xyz) {
fwrite(buffer, 1, BLOCK_SIZE, fp);
}
fflush(fp);
fclose(fp);
sync();
```
Without the final call to sync; I got unrealistical values (over 1 GB aka main memory performance).
Why is there such a big difference between C and... | [
-0.32477131485939026,
0.030564816668629646,
0.6621840000152588,
-0.16177213191986084,
0.16870413720607758,
0.16830715537071228,
0.27170515060424805,
-0.4675652086734772,
-0.18100707232952118,
-0.5045090913772583,
-0.1791248321533203,
0.7707153558731079,
-0.2809046506881714,
-0.187967330217... | |
----------------
87.21 0.200012 200012 1 fdatasync
11.05 0.025345 1 32772 write
1.74 0.004000 4000 1 sync
```
C (High-Level API):
MB/s | [
-0.12309148162603378,
0.16112056374549866,
0.621764063835144,
0.21745631098747253,
0.49639832973480225,
0.22549203038215637,
0.2994721233844757,
-0.29141557216644287,
-0.09194217622280121,
-0.33071625232696533,
-0.1897585690021515,
0.6544890403747559,
-0.31916344165802,
0.00135248177684843... | |
61.796458
```
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
73.19 0.144009 144009 1 sync
26.81 0.052739 1 65539 write
```
Java (1.6 SUN JRE, java.io API):
MB/s 128.6755466197537
... | [
-0.4332621693611145,
0.38771629333496094,
0.45105212926864624,
-0.21623386442661285,
0.25425752997398376,
-0.0029850457794964314,
0.549472451210022,
-0.4062337279319763,
-0.051603153347969055,
-0.7699543833732605,
-0.22829808294773102,
0.4608670175075531,
-0.381025105714798,
-0.14754740893... | |
seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
80.07 105.387609 3215 32776 write
2.58 3.390060 3201 1059 read
0.62 0.815251 815251 1 | [
-0.18314120173454285,
-0.18253296613693237,
-0.09750956296920776,
0.11431881040334702,
0.309238076210022,
0.17955484986305237,
0.2789733409881592,
-0.19557912647724152,
-0.08398783206939697,
-0.3403652608394623,
-0.14011718332767487,
0.25359708070755005,
-0.27366408705711365,
-0.0434130243... | |
fsync
```
Java (1.6 SUN JRE, java.nio API):
MB/s 127.45830221558376
```
5.52 0.980061 490031 2 fsync
1.60 0.284752 9 32774 write
0.00 0.000000 0 | [
-0.6129446625709534,
0.16184037923812866,
0.4850437343120575,
-0.10798684507608414,
0.15816280245780945,
0.12561355531215668,
0.12749426066875458,
-0.11067599058151245,
-0.22614778578281403,
-0.38890179991722107,
-0.4375215470790863,
0.7517485618591309,
-0.4004053771495819,
-0.230504408478... | |
80 close
```
The time values seem to be system time only and are therefore pretty meaningless.
Update 2:
I switched to another server, rebooted, and I use a fresh formatted ext3. Now I get only 4% differences between Java and C. I simply don't know what went wrong. Sometimes things are strange. I should ha... | [
0.2212304025888443,
-0.027679551392793655,
0.7263884544372559,
-0.3599759340286255,
-0.1911136507987976,
0.07636594027280807,
0.32160812616348267,
-0.5127557516098022,
-0.11776181310415268,
-0.7312318682670593,
0.033082813024520874,
0.7874859571456909,
-0.3299219608306885,
-0.3683009743690... | |
in C don't forget to sync. A fflush submitted the data to the OS, but doesn't bring your data to the block device.
* Use strace to analyze the syscalls done by a command
* Cross check your results before posting a question.
Update 4:
Please note the following follow-up [question](https://stackoverflow.com/questions/56... | [
0.2786681056022644,
0.2833315432071686,
0.3167245090007782,
-0.07550710439682007,
0.004738175310194492,
-0.4107063114643097,
0.05126119777560234,
-0.13555356860160828,
0.018243813887238503,
-0.4684745967388153,
-0.37659868597984314,
0.8257662057876587,
-0.37332043051719666,
-0.234940052032... | |
C, system calls only, copy argv[1] to argv[2] */
/* This is a test program which simply copies from file to file using
* only system calls (section 2 of the manual.)
*
* Compile:
*
* gcc -Wall -DBUFSIZ=1024 -o rawcopy rawcopy.c
*
* If DIRTY is defined, then errors are interpreted with perror(3).
* This is... | [
0.38520655035972595,
0.2294410616159439,
0.16707126796245575,
-0.047466352581977844,
-0.03061944991350174,
-0.25094321370124817,
0.375566303730011,
-0.18348433077335358,
-0.19228848814964294,
-0.5366237163543701,
0.01723201759159565,
0.8017480969429016,
-0.3509253263473511,
0.1727285832166... | |
DIRTY:
*
* gcc -DDIRTY -Wall -o rawcopy rawcopy.c
*
*/
#include <fcntl.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <stdlib.h>
#include <unistd.h>
#if defined(DIRTY)
# if defined(BUFSIZ)
# error "Don't define your own BUFSIZ when DIRTY"
# endif
# include <stdio.h>
# define PERROR perro... | [
0.27968138456344604,
-0.0710427463054657,
0.3912526071071625,
-0.2281462848186493,
-0.13377447426319122,
0.3131546974182129,
0.27249032258987427,
-0.5366249680519104,
-0.10048317909240723,
-0.6661633253097534,
-0.034447889775037766,
0.35405734181404114,
-0.6060429215431213,
0.2991448044776... | |
be optimal size for read/write */
extern int errno ; /* I/O errors */
int main(int argc, char * argv[]) {
int fdi, fdo ; /* Input/output file descriptors */
ssize_t len ; | [
-0.1590595841407776,
-0.46243950724601746,
0.24665294587612152,
-0.19376607239246368,
0.14177559316158295,
0.28918513655662537,
0.1351805329322815,
-0.3530665338039398,
-0.029169853776693344,
-0.6636343598365784,
-0.3541215658187866,
0.7257199883460999,
-0.28837597370147705,
-0.07679759711... | |
/* length to read/write */
if(argc != 3){
PERROR;
exit(errno);
}
/* Open the files, returning perror errno as the exit value if fails. */
if((fdi = open(argv[1],O_RDONLY)) == -1){
PERROR;
exit(errno);
}
if((fdo = open(argv[2], O_WRONLY|O_CREAT)) == -1){ | [
-0.21200348436832428,
-0.1171438992023468,
0.5927402377128601,
-0.397350549697876,
0.28434351086616516,
0.3581956624984741,
0.37836819887161255,
-0.6473274230957031,
-0.0707492083311081,
-0.3573938310146332,
-0.3141505718231201,
0.7623844146728516,
-0.2144591510295868,
0.16822239756584167,... | |
PERROR;
exit(errno);
}
/* copy BUFSIZ bytes (or total read on last block) fast as you
can. */
while((len = read(fdi, (void *) buffer, BUFSIZ)) > -1){
if(len == -1){
PERROR;
exit(errno);
} | [
-0.07200875878334045,
-0.6376176476478577,
0.5363578796386719,
-0.10558510571718216,
0.20199498534202576,
0.5689497590065002,
0.23284843564033508,
-0.5224540829658508,
-0.2808615565299988,
-0.49400562047958374,
-0.1620692014694214,
0.7414185404777527,
-0.36277997493743896,
0.10140739381313... | |
if(write(fdo, (void*)buffer, len) == -1){
PERROR;
exit(errno);
}
}
/* close and fsync the files */
if(fsync(fdo) ==-1){
PERROR;
exit(errno);
}
if(close(fdo) == -1){
PERROR;
exit(errno); | [
-0.382595032453537,
-0.39623644948005676,
0.4960117042064667,
-0.35151779651641846,
0.6027243137359619,
0.3311346471309662,
0.030796587467193604,
-0.5212106108665466,
0.05316615477204323,
-0.24926091730594635,
-0.5010392665863037,
0.7615318298339844,
-0.3007088899612427,
0.0344741456210613... | |
}
if(close(fdi) == -1){
PERROR;
exit(errno);
}
/* if it survived to here, all worked. */
exit(0);
}
``` | [
0.08087112009525299,
-0.12475930154323578,
0.4988710284233093,
-0.35258471965789795,
0.3887186646461487,
0.016255205497145653,
0.3524566888809204,
-0.369345486164093,
0.1687837690114975,
-0.3186658024787903,
-0.18565796315670013,
0.6650863885879517,
-0.3054162859916687,
0.23323309421539307... | |
I have a `DropDownList` inside an `UpdatePanel` that is populated on postback from a `SqlDataSource`. It has a parameter which is another control. I sometimes need multiple postbacks, but what happens is that each time the update panel refreshes, items are added to the `DropDownList`. So the `DropDownList` ends up havi... | [
0.15157946944236755,
0.1698445975780487,
0.36008161306381226,
0.0980406403541565,
-0.08111603558063507,
-0.023219380527734756,
0.36199596524238586,
-0.10615618526935577,
-0.32906708121299744,
-0.5447390079498291,
0.07428213208913803,
0.5320823788642883,
-0.21599753201007843,
0.326855629682... | |
is in C#)
Instead of using `AppendDataboundItems='true'` (which will cause the problem you are talking about), respond to the `DataBound` event for the `DropDownList` and then add your "blank" item to the top of the list.
```
<asp:DropDownList runat="server" ID="MyList"
ondatabound="MyListDataBound"></asp:DropDownLi... | [
-0.10730703920125961,
-0.20901557803153992,
0.8144504427909851,
-0.18282034993171692,
0.19295911490917206,
-0.051143765449523926,
0.018918490037322044,
-0.2862887680530548,
-0.34119752049446106,
-0.4154101610183716,
-0.7455475926399231,
0.5815870761871338,
-0.31337013840675354,
-0.17114795... | |
I have a singleton service with a dependency on a service with a request scoped lifecycle.
If I allow the container to inject the request scoped service when I first get the singleton it will be fine for the current request but will be disposed of in any subsequent request.
Does this mean I have to use the dependen... | [
0.6687056422233582,
0.05883069336414337,
0.02177315391600132,
-0.1373058259487152,
0.16063232719898224,
0.19206014275550842,
0.05348630249500275,
-0.036813605576753616,
-0.12579555809497833,
-0.6263121962547302,
0.16575677692890167,
0.6217319369316101,
-0.45688897371292114,
0.5772778987884... | |
make it request-scoped. This shouldn't be a problem unless the instantiation of the service is expensive. | [
0.5622154474258423,
-0.21238566935062408,
0.29895561933517456,
0.16715607047080994,
0.26856330037117004,
-0.20700234174728394,
0.2609458267688751,
-0.010271068662405014,
-0.04350094497203827,
-0.5679052472114563,
-0.263619989156723,
0.4705493450164795,
-0.037477441132068634,
-0.08368460834... | |
What a great site this is, I have lurked on here reading others questions for ages but now I have one of my own.
My workmate wrote a class very like the one below. As soon as I saw it I knew it wouldn't work but I have no explination for him why it doesn't work.
What he expected when declaring it as a `ControlItem<B... | [
0.0469534695148468,
-0.009003974497318268,
0.05614670366048813,
0.048017099499702454,
0.057043347507715225,
-0.33227992057800293,
-0.027758179232478142,
0.08222581446170807,
-0.05718088522553444,
-0.5388915538787842,
0.11102245002985,
0.3259865939617157,
-0.5467566251754761,
0.423028022050... | |
{
}
abstract public void Draw();
}
public class ControlItem<T> : ControlItem where T : Control, new()
{
public T MyControl { get; set; }
private ControlItem()
{ }
public ControlItem(T control)
: base()
{
MyControl = control;
}
public override void Draw()
... | [
0.10729408264160156,
-0.5319228172302246,
0.2708980143070221,
0.13531982898712158,
0.22615386545658112,
0.08601388335227966,
0.058309406042099,
-0.28005045652389526,
0.16876564919948578,
-0.32133200764656067,
-0.4107910990715027,
0.4613393247127533,
-0.46963807940483093,
0.2101139426231384... | |
Draw(this.MyControl);
}
public void Draw(Control cntrl)
{
throw new NotImplementedException();
}
public void Draw(Button button)
{
//Do some work
}
}
```
> Is this a covariance issue?
No, it's a static versus dynamic dispatch issue. Static dispatch means an overloaded met... | [
0.06676913052797318,
-0.32603123784065247,
0.4261928200721741,
-0.11270397901535034,
0.05814219266176224,
-0.14258208870887756,
0.01445026881992817,
-0.3007538616657257,
-0.15096020698547363,
-0.29725417494773865,
-0.18935512006282806,
0.6733047366142273,
-0.48563888669013977,
0.1754717975... | |
Foo
{
void Test()
{
Base a = new Base();
Overload(a); // prints "base"
Derived b = new Derived();
Overload(b); // prints "derived"
// dispatched based on c's declared type!
Base c = new Derived();
Overload(c); // | [
0.5202648043632507,
-0.11579810082912445,
0.005960387643426657,
-0.15469788014888763,
-0.049850400537252426,
0.16600419580936432,
0.1841265708208084,
-0.6565691232681274,
-0.08946513384580612,
-0.06709719449281693,
-0.2094694972038269,
0.39449912309646606,
-0.697197437286377,
0.02620447985... | |
prints "base"
}
void Overload(Base obj) { Console.WriteLine("base"); }
void Overload(Derived obj) { Console.WriteLine("derived"); }
}
```
Dynamic dispatch means the function is bound at runtime based on the actual type of the object stored in the variable:
```
class Base
{
public virtual void Ove... | [
0.17651714384555817,
-0.15854103863239288,
0.2495720535516739,
-0.08801071345806122,
0.2045874148607254,
0.08553393185138702,
0.1695685088634491,
-0.5794076919555664,
0.008113066665828228,
-0.13225239515304565,
-0.23796328902244568,
0.5292706489562988,
-0.5266558527946472,
0.21885114908218... | |
a.Override(); // prints "base"
Derived b = new Derived();
b.Override(); // prints "derived"
// dynamically dispatched based type of object stored in c!
Base c = new Derived();
c.Override(); // prints "derived"
}
void Overload(Base obj) { Console.WriteLine("base... | [
-0.07274958491325378,
-0.12713101506233215,
0.565417468547821,
-0.078881174325943,
0.351694256067276,
0.16909858584403992,
0.06599964946508408,
-0.5899772644042969,
-0.1797109991312027,
-0.21729815006256104,
-0.3065313398838043,
0.3772726356983185,
-0.5591164827346802,
0.14741700887680054,... | |
the difference between the two. C#, like most class-based OOP languages, only supports dynamic dispatch for the `this` implicit parameter (referred to as "single dispatch). In other words *overridden* methods are dynamically dispatched, but *overloaded* methods are not.
The typical solution to fake multiple dispatch i... | [
0.08358820527791977,
-0.3459727168083191,
-0.013149859383702278,
0.20431692898273468,
-0.13387548923492432,
-0.11027709394693375,
0.31461429595947266,
0.3726956248283386,
-0.4319019913673401,
-0.22736898064613342,
-0.15817596018314362,
0.6388651728630066,
-0.649703323841095,
-0.03774978592... | |
I have gotten quite familiar with django's email sending abilities, but I havn't seen anything about it receiving and processing emails from users. Is this functionality available?
A few google searches have not turned up very promising results. Though I did find this: [Receive and send emails in python](https://stac... | [
0.636698305606842,
0.3572266697883606,
0.3120879530906677,
-0.02931266836822033,
-0.35413187742233276,
-0.4001188278198242,
-0.08889485895633698,
0.4172345697879791,
-0.5086508393287659,
-0.3808366358280182,
0.30027440190315247,
0.4285721480846405,
-0.18045561015605927,
-0.2765385210514068... | |
up in your account.
There's an app called [jutda-helpdesk](http://code.google.com/p/jutda-helpdesk/) that uses Python's `poplib` and `imaplib` to process incoming emails. You just have to have an account somewhere with POP3 or IMAP access.
This is adapted from their [get\_email.py](http://code.google.com/p/jutda-helpd... | [
0.098630391061306,
0.23208440840244293,
0.5463098883628845,
0.09493570029735565,
-0.038148827850818634,
0.3067518174648285,
0.18321454524993896,
-0.20714372396469116,
-0.7591699957847595,
-0.6711119413375854,
-0.19738121330738068,
-0.019074944779276848,
-0.42425692081451416,
0.049479708075... | |
else:
if not mb.email_box_port: mb.email_box_port = 110
server = poplib.POP3(mb.email_box_host, int(mb.email_box_port))
server.getwelcome()
server.user(mb.email_box_user)
server.pass_(mb.email_box_pass)
messagesInfo = server.list()[1]
for msg in messages... | [
-0.011296882294118404,
-0.039813049137592316,
0.6198337078094482,
-0.3206896185874939,
-0.2029924839735031,
0.23274582624435425,
0.22270676493644714,
-0.17114423215389252,
-0.4235408306121826,
-0.7331823110580444,
-0.26459503173828125,
0.14996765553951263,
-0.7055897116661072,
0.4573481082... | |
msgSize = msg.split(" ")[1]
full_message = "\n".join(server.retr(msgNum)[1])
# Do something with the message
server.dele(msgNum)
server.quit()
elif mb.email_box_type == 'imap':
if mb.email_box_ssl:
if not mb.email_box_port: mb.email_box_port = 993 | [
-0.037710074335336685,
-0.26066145300865173,
0.7247458696365356,
-0.2236170619726181,
0.04018871486186981,
0.10720249265432358,
0.6648015975952148,
-0.22466376423835754,
-0.5914492607116699,
-0.7446974515914917,
-0.17839491367340088,
0.16534797847270966,
-0.8380192518234253,
0.249966382980... | |
server = imaplib.IMAP4_SSL(mb.email_box_host, int(mb.email_box_port))
else:
if not mb.email_box_port: mb.email_box_port = 143
server = imaplib.IMAP4(mb.email_box_host, int(mb.email_box_port))
server.login(mb.email_box_user, mb.email_box_pass)
server.select(mb.email_box_im... | [
-0.3851713538169861,
0.1169285699725151,
0.3971652686595917,
-0.1375785917043686,
-0.4272727966308594,
0.5243638157844543,
0.16470739245414734,
-0.2152440845966339,
-0.4753114879131317,
-0.8099994659423828,
-0.1362813264131546,
-0.024353569373488426,
-0.6344020366668701,
0.5153326392173767... | |
= server.fetch(num, '(RFC822)')
full_message = data[0][1]
# Do something with the message
server.store(num, '+FLAGS', '\\Deleted')
server.expunge()
server.close()
server.logout()
```
`mb` is just some object to store all the mail server info, the rest shou... | [
0.12643779814243317,
0.09857414662837982,
0.6060329079627991,
-0.23148831725120544,
0.15351630747318268,
-0.16344963014125824,
0.2248527556657791,
0.10559248179197311,
-0.14440779387950897,
-0.5828005075454712,
-0.18830661475658417,
0.3864383101463318,
-0.5897107124328613,
0.19740828871726... | |
get specific parts of the message, but hopefully this is enough to get you going. | [
0.7115060091018677,
-0.003480329178273678,
-0.011114126071333885,
0.3291690945625305,
0.03198988735675812,
-0.5642368197441101,
0.4468298554420471,
0.5032202005386353,
-0.0004644250439014286,
-0.3760093152523041,
0.061157986521720886,
0.16546377539634705,
0.15337999165058136,
-0.2696039378... | |
I got a liiitle problem.
There is
```
List<List<UInt32>> temp = new List<List<UInt32>>();
```
For example,
there are two `List<UInt32>` records within the List temp however, when i try to do something like `temp.removeAt(0);` it doesn't remove the first row `(List<UInt32>`) .. Why is that? Do i do something wrong?... | [
0.09955950081348419,
-0.10253159701824188,
0.2512742280960083,
-0.19707392156124115,
-0.05224877968430519,
-0.18431158363819122,
0.5785812735557556,
-0.06603369861841202,
-0.19563530385494232,
-0.7294621467590332,
0.10916077345609665,
0.646145761013031,
-0.5076208114624023,
0.0427743904292... | |
int i = 0;
bool boolA = true;
while (boolA)
{ | [
0.07869604974985123,
-0.16684722900390625,
0.16643469035625458,
-0.5992683172225952,
0.13208997249603271,
-0.02265394665300846,
0.8251137733459473,
-0.33906078338623047,
0.06236957386136055,
0.25511518120765686,
-0.38501766324043274,
0.575278639793396,
-0.16752731800079346,
0.0743666142225... | |
if (temp[i].Count == 1)
{
temp.RemoveAt(i); | [
0.1608230620622635,
-0.189450204372406,
0.078767329454422,
-0.48759937286376953,
0.23463013768196106,
-0.07303488254547119,
0.5483967661857605,
-0.2961511015892029,
0.18106190860271454,
-0.1623082309961319,
-0.34948715567588806,
0.3440406620502472,
-0.6696426272392273,
0.15857546031475067,... | |
temps++;
}
if (i == temp.Count - 1) boolA = false; | [
0.4036909341812134,
-0.07973629236221313,
0.3641807734966278,
-0.32164454460144043,
0.125859335064888,
-0.12962564826011658,
0.7636774778366089,
-0.4599829614162445,
0.03780148923397064,
-0.18849800527095795,
-0.2681974470615387,
0.4414048492908478,
-0.6071075797080994,
-0.0937577858567237... | |
i++;
```
You are removing items, then advancing i, therefore skipping the item that moved into the previous position that i represented.
e.g.
items = 5
i = 0
-> remove i
=> items = 4, i = 0
-> i++
=> items = 4, i = 1
-> remove i
=> items= 3, i = 1
-> i++
=> items = 3, i = 2
-> remove i
=> items = 3, i = 2
-> i+... | [
-0.4797527492046356,
0.04016440734267235,
0.4188792407512665,
-0.2186400145292282,
-0.30169564485549927,
0.5367445349693298,
0.3933810889720917,
-0.6665482521057129,
-0.12583895027637482,
-0.6790894269943237,
-0.3701600432395935,
0.1956569254398346,
-0.270251601934433,
0.1624874770641327,
... | |
What's the simplest way to serialize a bean to a string using GWT? I prefer not to use *GWT.create()* invocations.
**Disclaimer:**
Serializing a bean on the URL isn't such a great idea for GWT. I've learned that if need to put data on the URL, it should be as little as possible and only what is necessary to restore th... | [
0.31762298941612244,
0.21050992608070374,
0.16203215718269348,
0.05023413524031639,
-0.16024067997932434,
-0.0979030430316925,
0.5294941067695618,
0.2732166647911072,
-0.2352324277162552,
-0.7346265912055969,
0.221255823969841,
0.3558395504951477,
-0.539717972278595,
0.16316305100917816,
... | |
by a delimiter. When reading the values back in, I used the String.split() method to get an array. With that array I assign the values back to the right bean properties. In code:
```
public class Sample {
private int a;
private boolean b;
private String c;
//getters and setters for fields not shown
... | [
0.23576602339744568,
-0.08401034772396088,
0.07550366967916489,
-0.10745396465063095,
-0.009818455204367638,
0.08353101462125778,
0.07469549030065536,
-0.2613864839076996,
-0.04856960475444794,
-0.07958106696605682,
-0.14425738155841827,
0.2711263597011566,
-0.22526395320892334,
0.34045857... | |
a=Integer.parseInt(values[0]);
b=Boolean.parseBoolean(values[1]);
c=values[2];
}
}
```
For more complicate scenarios you may have to do more complicated things. For example, for nested objects, you have to write the code to pass the values to the child object(s).
Also, be aware that you have to ... | [
0.08763419836759567,
0.10075822472572327,
-0.13088087737560272,
-0.053173866122961044,
0.16908946633338928,
-0.15563669800758362,
0.4539555311203003,
-0.09539313614368439,
-0.20620498061180115,
-0.3832544982433319,
-0.3026670217514038,
0.4563160836696625,
-0.37820759415626526,
0.2284518778... | |
How do I create a loop in the Linux filesystem? I want to break the directed acyclic graph (DAG) property of the Linux filesystem. Is this possible? I have seen this condition once when I installed the scratchbox cross compiler on my Ubuntu.
I don't know how to reproduce it now.
Some other responders have already answ... | [
0.6404873132705688,
0.046163201332092285,
0.16359688341617584,
0.1268872320652008,
-0.02472984790802002,
-0.45496052503585815,
0.23965007066726685,
-0.17795071005821228,
-0.13375085592269897,
-0.6438493132591248,
0.0918193981051445,
0.40539059042930603,
-0.6396028995513916,
0.3736304044723... | |
make the filesystem location accessible at `/original/path` *also* accessible through `/new/path`. Note that this will *not* following mountpoints! For example, suppose I have the following mountpoints:
```
/something
/something/underneath/that
```
Now suppose I make a `bind` mount for `/something`:
```
mount --bin... | [
-0.08123491704463959,
0.1317726969718933,
0.6974877119064331,
0.0595211498439312,
0.31735026836395264,
-0.19503054022789001,
-0.21177957952022552,
-0.2691168189048767,
-0.3314661383628845,
-0.8828900456428528,
-0.2588927149772644,
0.6801961064338684,
-0.008744735270738602,
0.07516375184059... | |
do not handle the case where a filesystem is mounted after the `rbind` is setup. That is, suppose I have a mount like this:
```
/something
```
Then I set up my `rbind` as above, and *then* I mount `/something/underneath/that`: the `rbind` will not magically make the new mount visible through the `rbind` location. Al... | [
0.3809843063354492,
0.09534116834402084,
0.5123491287231445,
-0.09867450594902039,
0.23670507967472076,
-0.45517101883888245,
0.1834842562675476,
-0.43272629380226135,
-0.21440616250038147,
-0.5836294293403625,
-0.17494405806064606,
0.9177713394165039,
-0.4619057774543762,
0.16819322109222... | |
regular `bind` mount. For an `rbind` mount, you must specify `MS_BIND` and the undocument `MS_REC` flag (defined in `linux/fs.h`).
Hope that helps,
Eric Melski | [
0.06543426215648651,
-0.16578169167041779,
0.4572502076625824,
0.026776837185025215,
0.20887629687786102,
-0.2685767710208893,
0.11309295892715454,
-0.07702559232711792,
-0.5088080763816833,
-0.5086023211479187,
-0.6231145262718201,
0.7255306243896484,
-0.7070608735084534,
-0.0464158207178... | |
Does anyone know of an open source Intelligent Character Recognition (ICR) library? There seems to be plenty out there for OCR but I am focusing on recognizing handwriting and would love it if there was an open source solution out there.
[OCRopus](http://code.google.com/p/ocropus/) claims to do handwriting recognition.... | [
0.3376806080341339,
0.21599015593528748,
0.08157537877559662,
0.14587025344371796,
-0.06146128848195076,
-0.18738557398319244,
0.024294739589095116,
0.03942533954977989,
-0.08095668256282806,
-0.4830743968486786,
0.28352999687194824,
0.03792818263173103,
-0.01981135830283165,
-0.2040185332... | |
I have 3 tables - Table1 Table2 and Table3
I want to change this `$("tr").filter` to only effect Table2
Is this correct?
`$("#Table2 tr").filter` or is there any other way to do so?
The *best* way to do it is using:
```
$('tr', '#Table2')
```
As [noted by the documentation](http://docs.jquery.com/Core/jQuery#expr... | [
-0.11481761932373047,
-0.06170929595828056,
0.7460114359855652,
-0.15213876962661743,
0.25630858540534973,
-0.07569050788879395,
0.10004489123821259,
-0.38782942295074463,
-0.22729560732841492,
-0.8637403845787048,
-0.14482957124710083,
0.5696619153022766,
-0.21640728414058685,
-0.25220406... | |
context, such as a DOM element or jQuery object, the expression will be matched against the contents of that context.
Although what you have will work, the above is the optimal way of doing it. Speed difference for your average use case will be insignificant, though. I just prefer specifying the context whenever possi... | [
0.07117778807878494,
0.01251415815204382,
0.3617548644542694,
0.3358664810657501,
-0.09098991006612778,
0.09231648594141006,
0.04929628595709801,
-0.21577033400535583,
0.3158671259880066,
-0.6423457860946655,
-0.021126365289092064,
0.9721488952636719,
0.03453700244426727,
-0.59314072132110... | |
In WebForms, I would normally have code like this to let the browser present a "Download File" popup with an arbitrary file type, like a PDF, and a filename:
```
Response.Clear()
Response.ClearHeaders()
''# Send the file to the output stream
Response.Buffer = True
Response.AddHeader("Content-Length", pdfData.Length.T... | [
0.21907298266887665,
-0.24177342653274536,
0.9101750254631042,
0.01356431469321251,
-0.2901569604873657,
0.0636284127831459,
0.01861654967069626,
-0.542763888835907,
0.0355585552752018,
-0.6997293829917908,
-0.2686789333820343,
0.5879833698272705,
-0.19786766171455383,
0.02014971151947975,... | |
the fly.
```
public ActionResult GetPdf(string filename)
{
return File(filename, "application/pdf", Server.UrlEncode(filename));
}
``` | [
0.15214523673057556,
-0.07178879529237747,
0.5198764204978943,
-0.08452627062797546,
0.15638689696788788,
-0.31554022431373596,
0.1731303185224533,
-0.1148352324962616,
0.039153292775154114,
-0.4336834251880646,
-0.6530234217643738,
0.8511553406715393,
-0.6264533996582031,
-0.2315701395273... | |
I have a short C program that writes into a file until there is no more space on disk:
```
#include <stdio.h>
int main(void) {
char c[] = "abcdefghij";
size_t rez;
FILE *f = fopen("filldisk.dat", "wb");
while (1) {
rez = fwrite(c, 1, sizeof(c), f);
if (!rez) break;
}
fclose(f);
return 0;
}
```
... | [
0.41761428117752075,
0.1873372495174408,
0.43241605162620544,
-0.33340883255004883,
0.209419384598732,
-0.02545083314180374,
0.45463690161705017,
0.08742447197437286,
-0.21361921727657318,
-0.5579850673675537,
-0.30692070722579956,
0.4751363694667816,
-0.2866252660751343,
0.414225041866302... | |
co are limited to 32 bits size/offset/etc... You need to enable the large file support, or use the \*64 bits option:
<http://www.gnu.org/software/libc/manual/html_node/Opening-Streams.html#index-fopen64-931>
Then your fs needs to support this, but except fat and other primitive fs, all of them support creating files ... | [
0.023193147033452988,
0.33650532364845276,
0.46162307262420654,
-0.2913834750652313,
0.10317555069923401,
-0.2101481854915619,
-0.2767406404018402,
0.031517647206783295,
-0.24926045536994934,
-0.3805738389492035,
0.006492826156318188,
0.4605049788951874,
-0.7850332856178284,
-0.26415136456... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.