text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
with it.
* You were checking the value of the radio button, but it was always evaluating to true because you need to filter it out to only get the [`:checked`](http://docs.jquery.com/Selectors/checked) one.
So, the working code:
```
$(document).ready(function() {
$("form.shipping").submit(function() {
if(... | [
0.2724356949329376,
-0.09593583643436432,
0.4060468375682831,
0.009160083718597889,
0.3961629271507263,
-0.17785625159740448,
0.11923117190599442,
-0.6398352980613708,
-0.11924159526824951,
-0.39118537306785583,
-0.07126287370920181,
0.9055517911911011,
-0.24821986258029938,
-0.03301250189... | |
});
});
``` | [
-0.09954391419887543,
0.23971500992774963,
0.4336956739425659,
-0.5432102084159851,
0.2865300476551056,
-0.26544851064682007,
0.3198486864566803,
-0.014538511633872986,
0.19142629206180573,
-0.3682454824447632,
-0.44257283210754395,
0.9352086186408997,
-0.5493782758712769,
0.27220249176025... | |
I am using:
```
if (RadioButtonList_VolunteerType.SelectedItem != null)
```
or how about:
```
if (RadioButtonList_VolunteerType.Index >= 0)
```
or how about (per Andrew Hare's answer):
```
if (RadioButtonList_VolunteerType.Index > -1)
```
To those who may read this question, **the following is not a valid meth... | [
0.534774124622345,
0.29590049386024475,
0.5127003788948059,
-0.1790553629398346,
0.0515633150935173,
-0.4533976912498474,
0.4228484034538269,
-0.7317355871200562,
-0.0013652766356244683,
-0.46654000878334045,
-0.30896565318107605,
0.6466087698936462,
-0.3541446328163147,
0.3674174249172210... | |
I've a WPF app organized with tabs. I added a small button to each tabitem header that allow the user to close the tab.
When the user click on the small button, I remove the tabItem from the tabControl.
tabControl.Items.Remove(tabItem);
As result of this the tabItem dissapears, and that is fine, but here comes the p... | [
0.2719270884990692,
0.0206673014909029,
0.6272302269935608,
0.021867629140615463,
-0.10179338604211807,
0.021694568917155266,
0.29136478900909424,
-0.13058727979660034,
-0.4105188250541687,
-0.45354005694389343,
0.4226113557815552,
0.268717885017395,
-0.3791465163230896,
0.4025600552558899... | |
the problem and I've implemented some of the advices described. It didn't work.
Can anyone help me?
Thanks
This is what I've been using, and as far as I can tell it removes the tabitem from memory. The problem with leaving a timer inside of the tabitem, is that the GC won't collect and dispose of it because it detects... | [
0.08080350607633591,
0.1570109874010086,
0.1957186460494995,
-0.03740737587213516,
0.14757944643497467,
-0.1159723550081253,
0.2967987358570099,
-0.19258661568164825,
-0.39815953373908997,
-0.42120641469955444,
0.07750186324119568,
0.6436502933502197,
-0.38846826553344727,
0.19772638380527... | |
public delegate void CloseEvents(ReportTab TabIndex);
public event CloseEvents Closing;
public ReportTab(string Title)
{
InitializeComponent();
tbTitle.Text = Title;
}
private void Image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{ | [
0.22440879046916962,
-0.1892075091600418,
0.4140240550041199,
-0.09560743719339371,
0.13817623257637024,
-0.09667526930570602,
0.29627159237861633,
-0.3422929644584656,
-0.06357016414403915,
-0.29551953077316284,
-0.617366373538971,
0.5932132601737976,
-0.37556901574134827,
0.3633504807949... | |
Closing(this);
}
}
}
```
The xaml:
```
<TabItem x:Class="Reports.Controls.ReportTab"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<TextB... | [
-0.44287165999412537,
0.21974699199199677,
0.9100190997123718,
-0.25659292936325073,
-0.1292944699525833,
0.09156142175197601,
-0.23877260088920593,
-0.13232146203517914,
-0.4282096028327942,
-0.16526630520820618,
-0.5734841227531433,
0.3852927088737488,
-0.11914916336536407,
0.15393511950... | |
MouseLeftButtonUp="Image_MouseLeftButtonUp"/>
</StackPanel>
</TabItem.Header>
<Grid>
//Tabitem stuff
</Grid>
</TabItem>
```
Here's the page with the Tabcontrol to add a tab:
```
void AddTab(string Title)
{
Controls.ReportTab rt = new Controls.ReportTab(Title);
rt.Closing += new C... | [
-0.4158540666103363,
-0.14044058322906494,
0.9001463651657104,
-0.22559121251106262,
0.029781170189380646,
0.19770032167434692,
0.010332053527235985,
-0.5827290415763855,
-0.3424639403820038,
-0.46136990189552307,
-0.4901254177093506,
0.5044284462928772,
-0.40638411045074463,
0.04190458729... | |
//This resets the tabcontrol back to it's first tabindex
tabControl.SelectedIndex = 0;
}
``` | [
-0.277764230966568,
-0.2652567923069,
0.2577698826789856,
-0.09777071326971054,
0.1899295151233673,
0.14418968558311462,
0.2113797813653946,
0.1883057802915573,
-0.13313378393650055,
-0.518414318561554,
-0.15066613256931305,
0.4517197906970978,
-0.43416112661361694,
0.3347252905368805,
0... | |
Please help me I am New in PHP and since last 5 Hours i am try to semd mail and now really tired. Thanks.
**Here is my code. I am using Gmail account.**
```
include("class.phpmailer.php");
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail = ... | [
0.32567107677459717,
0.08471827954053879,
0.8109893798828125,
-0.11654471606016159,
-0.26073789596557617,
0.04439908638596535,
0.9125611782073975,
-0.26664552092552185,
-0.07795411348342896,
-0.9927734732627869,
-0.09837111830711365,
0.6464870572090149,
-0.0983310118317604,
0.0033081879373... | |
// enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 465; // set the SMTP port for the GMAIL server
$mail->Username = "hussaintalha@gmail.com"; // G... | [
-0.14185547828674316,
-0.15500280261039734,
0.9334776997566223,
-0.08731965720653534,
-0.24414239823818207,
0.08255406469106674,
0.7595973610877991,
-0.2067614644765854,
-0.272943913936615,
-0.4061640202999115,
-0.3228234052658081,
0.13679151237010956,
-0.508975088596344,
0.335093200206756... | |
= "xxxxxxxx"; // GMAIL password
$mail->AddReplyTo("hussaintalha@gmail.com","First Last");
$mail->From = "hussaintalha@gmail.com.com";
$mail->FromName = "First Last";
$mail->Subject = "PHPMailer Test Subject via gmail";
//$mail->Body = "Hi,<br>This is the HTML BODY<br>"; ... | [
0.21770505607128143,
0.1379765421152115,
0.8527217507362366,
-0.10444439202547073,
-0.5399944186210632,
0.026765333488583565,
0.5889657735824585,
-0.520267128944397,
0.28334546089172363,
-0.6964849233627319,
-0.21980538964271545,
0.3813624382019043,
-0.32904955744743347,
0.0255075786262750... | |
// set word wrap
$mail->MsgHTML($body);
$mail->AddAddress("hussaintalha@gmail.com", "John Doe");
$mail->AddAttachment("images/phpmailer.gif"); // attachment
$mail->IsHTML(true); // send as HTML
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
?>
```
... | [
0.45962241291999817,
0.020086903125047684,
0.7439960837364197,
-0.2556539475917816,
-0.247697651386261,
-0.02767513319849968,
0.9398261308670044,
-0.5795087218284607,
-0.15851394832134247,
-0.47556939721107483,
-0.3544602394104004,
0.44435593485832214,
-0.6924856305122375,
0.08940139412879... | |
in
> D:\xampplite\htdocs\WebEng\class.smtp.php
> on line 122 Mailer Error: SMTP Error:
> Could not connect to SMTP host.
When you only need one method, think Func... perhaps a `Func<DataRow, T>`
```
public static IList<T> ToList<T>(this DataTable table,
Func<DataRow,T> converter)
{
IList<T> list = new Lis... | [
-0.2325195074081421,
-0.31520941853523254,
0.45900726318359375,
-0.23689152300357819,
-0.16770216822624207,
0.22064223885536194,
0.28397953510284424,
-0.2403995543718338,
-0.16233059763908386,
-0.9998291730880737,
-0.11672738939523697,
0.284612238407135,
-0.85743647813797,
0.24818561971187... | |
I have a very minimal install of Ubuntu 8.04 64-bit.
When I try to run some 32-bit programs, such as my `jhead` program, I get the message `No such file or directory`.
I figured it may be a library problem, but when I do:
```
ldd jhead
```
instead of a list of libraries it needs, I just get the message `not a dyna... | [
0.14030247926712036,
0.4552844166755676,
0.1307309865951538,
-0.012997878715395927,
-0.04953231289982796,
-0.13798494637012482,
0.22151482105255127,
0.470395565032959,
-0.15654481947422028,
-0.8451317548751831,
-0.11117556691169739,
0.6528581380844116,
-0.6780581474304199,
0.12738002836704... | |
- ia32 shared libraries for use on amd64 and ia64 systems
go and execute
```
sudo aptitude install ia32-libs
``` | [
0.04393095150589943,
0.2440873682498932,
-0.25536656379699707,
0.18488577008247375,
-0.016582194715738297,
-0.353790283203125,
0.1890803873538971,
-0.14135262370109558,
0.4695577621459961,
-0.9089730381965637,
-0.3685089945793152,
0.7000860571861267,
-0.45144960284233093,
-0.20130692422389... | |
We have the Trie structure to efficiently access data when the key to that data set is a string. What would be the best possible index if key to a data set is an image?
By key, I mean some thing which uniquely distinguishes data. Is this a less frequently used scenario i.e. accessing data by an image? I do feel there ... | [
0.5984929203987122,
0.11877996474504471,
0.4409145414829254,
0.32206740975379944,
0.0165986567735672,
-0.18869583308696747,
-0.043221086263656616,
-0.04387569800019264,
0.018338698893785477,
-0.6642423272132874,
0.1678146868944168,
0.5092326402664185,
0.08429800719022751,
0.236685976386070... | |
trying to do, but hashing should give you a unique string to identify an image with. You didn't specify your language, but most have a function to hash an entire file's data, so you could just run the image file through that. (For example, PHP has [`md5_file()`](http://php.net/md5_file)) | [
0.03529329597949982,
-0.15910740196704865,
0.17327865958213806,
0.0009863169398158789,
-0.27477946877479553,
-0.1883457750082016,
0.34006503224372864,
0.14027811586856842,
-0.42876434326171875,
-0.5166430473327637,
0.007857836782932281,
0.2229224145412445,
-0.24505190551280975,
-0.14771765... | |
I am making a POST to a webservice that is local to the webserver. Everything works great until I host the site at my SSL enabled webserver. The webservice path is relative, meaning, I am making no reference to the protocol. **eg. /webservices/method.asmx**
The POST results in a runtime error. Has anyone seen this bef... | [
0.31554341316223145,
0.1944257616996765,
0.3840322494506836,
-0.27104276418685913,
-0.1310855746269226,
-0.4408355951309204,
0.7749003171920776,
0.2954665422439575,
-0.10472403466701508,
-0.8598141074180603,
-0.10608294606208801,
0.4202823340892792,
-0.3085058927536011,
0.15154896676540375... | |
function (msg) {
alert("Broken: " + theURL + "/" + method + msg.responseText);
}
});
```
Yep, using the [`staticmethod`](https://docs.python.org/3/library/functions.html#staticmethod "staticmethod") decorator:
```
class MyClass(object):
@staticmethod
def the_static_method(x):
print(x)
MyC... | [
-0.019833456724882126,
-0.20157867670059204,
0.6432557106018066,
-0.40897253155708313,
-0.15416106581687927,
0.13328389823436737,
0.17235976457595825,
-0.2516072988510132,
-0.2752079963684082,
-0.3956577479839325,
-0.3476063013076782,
0.661385178565979,
-0.7945080399513245,
0.0215020347386... | |
print(x)
the_static_method = staticmethod(the_static_method)
MyClass.the_static_method(2) # outputs 2
```
This is entirely identical to the first example (using `@staticmethod`), just not using the nice decorator syntax.
Finally, use [`staticmethod`](https://docs.python.org/3/library/functions.html#staticmetho... | [
-0.04978422820568085,
-0.06145690008997917,
0.37575283646583557,
-0.2826058268547058,
-0.298327773809433,
-0.07137244194746017,
0.06608077883720398,
0.14820486307144165,
-0.3350467085838318,
-0.18073046207427979,
-0.08874444663524628,
0.5789289474487305,
-0.6803694367408752,
-0.10642546415... | |
def f(arg1, arg2, ...): ...
>
> ```
>
> The @staticmethod form is a function [*decorator*](https://docs.python.org/3/glossary.html#term-decorator "term-decorator") – see the description of function definitions in [*Function definitions*](https://docs.python.org/3/reference/compound_stmts.html#function "Function defin... | [
0.10984363406896591,
-0.1332360953092575,
0.2430081069469452,
-0.21636848151683807,
-0.42029836773872375,
-0.025915203616023064,
0.3584939241409302,
-0.3627634644508362,
-0.3670908808708191,
-0.2598831057548523,
-0.3207179605960846,
0.6642065644264221,
-0.5494257807731628,
-0.1437896639108... | |
standard type hierarchy*](https://docs.python.org/3/reference/datamodel.html#types "types").
>
>
> New in version 2.2.
>
>
> Changed in version 2.4: Function decorator syntax added. | [
0.24565334618091583,
-0.0912775844335556,
0.6241825819015503,
-0.04806588217616081,
-0.3033168613910675,
0.10073097050189972,
-0.020170457661151886,
-0.4203605353832245,
-0.16581550240516663,
-0.5662465691566467,
-0.10990962386131287,
0.5539536476135254,
-0.5895752906799316,
-0.06667510420... | |
Is there any way to Query against the objects stored by a Terracotta instance?
I am looking for SQL-Like Queries or any way to filter objects based on fields.
```
string BBCSplit = Regex.Replace(BBC, @"<(.|\n)*?>|[:;]", string.Empty);
```
By careful if the "special" characters you want to remove include '"", ']', et... | [
0.4405360519886017,
0.18604792654514313,
0.2674682140350342,
-0.08610691130161285,
0.11592225730419159,
0.3939688801765442,
0.246839702129364,
-0.06565456092357635,
-0.1828889101743698,
-0.5475183129310608,
0.12117285281419754,
0.46118292212486267,
-0.4851308763027191,
0.3283649981021881,
... | |
I have a python script called showdate.py which I want to map to
I do this by:
```
map <F2> :r! showdate.py
```
in my \_gvimrc file.
The problem is that I have to press enter when I press F2 to execute
instead of executing immediately. Any ideas?
Thanks!
Add a newline to the end of the mapping:
```
map <F2> :r!... | [
0.04466821998357773,
0.016466611996293068,
0.5456011295318604,
-0.3033355474472046,
0.013507361523807049,
0.046914152801036835,
-0.1139451190829277,
0.038469504565000534,
-0.33560264110565186,
-0.824288010597229,
0.06774112582206726,
0.4668714702129364,
-0.23301582038402557,
-0.02849967963... | |
I've got some Python code that runs through a list of strings and converts them to integers or floating point numbers if possible. Doing this for integers is pretty easy
```
if element.isdigit():
newelement = int(element)
```
Floating point numbers are more difficult. Right now I'm using `partition('.')` to split ... | [
-0.3059665560722351,
0.11244863271713257,
0.23501056432724,
-0.13943471014499664,
0.14012721180915833,
0.06761731952428818,
-0.012955225072801113,
-0.3914741277694702,
-0.36132189631462097,
-0.4361843764781952,
-0.12943042814731598,
0.2329523265361786,
-0.27916571497917175,
-0.058835245668... | |
= float(element)
```
This works, but obviously the if statement for that is a bit of a bear. The other solution I considered is to just wrap the conversion in a try/catch block and see if it succeeds, as described in [this question](https://stackoverflow.com/questions/354038/checking-if-string-is-a-number-python).
A... | [
0.1573001742362976,
0.04089619219303131,
0.31431329250335693,
-0.35843175649642944,
-0.1845865249633789,
-0.13324551284313202,
0.23471656441688538,
-0.5828905701637268,
-0.07903359085321426,
-0.3732373118400574,
-0.07147544622421265,
0.5052355527877808,
-0.4056538939476013,
-0.139627218246... | |
print "Not float"
``` | [
0.5337854623794556,
0.504172682762146,
0.0644443929195404,
0.13414466381072998,
0.03499804809689522,
-0.2402605265378952,
0.007403566036373377,
0.13234905898571014,
-0.298095703125,
-0.15601280331611633,
-0.4393363893032074,
0.2792704999446869,
-0.36149275302886963,
-0.16556957364082336,
... | |
I have a simple web method and ajax call and continue to recieve an error that saying that it can't convert a string to an IDictionary object???
Here is the ajax call:
```
var params = '{"ID":"' + rowid + '"}';
$.ajax({
url: 'EDI.asmx/GetPartnerDetails',
type: "POST",
contentType: "application/json; charset=utf... | [
0.05607990920543671,
-0.019599875435233116,
0.7433108687400818,
-0.06021998077630997,
-0.17031262814998627,
-0.02356654964387417,
0.3199371099472046,
-0.6466448307037354,
-0.16705672442913055,
-0.5403098464012146,
-0.12726692855358124,
0.5088686943054199,
-0.15862597525119781,
0.0902099907... | |
objParam("ID")
Dim objController As New HealthComp.BLL.X12Partners.TradingPartnersController
Dim objInfo As TradingPartnersInfo = objController.FetchByPartnerID(Int32.Parse(ID))
Return JsonConvert.SerializeObject(objInfo)
End Function
```
Here is what I see from FireBug:
Response Headers
Server: Mic... | [
-0.4661111831665039,
-0.19702813029289246,
0.9837748408317566,
-0.30675560235977173,
-0.4099894165992737,
0.3450421988964081,
0.5760480165481567,
-0.4805620610713959,
-0.2634434700012207,
-0.46246224641799927,
-0.11795761436223984,
0.5833755731582642,
-0.618958055973053,
0.2395418286323547... | |
at System.Web.Script.Serialization.JavaScriptSerializer
.Deserialize[T](String input)\r\n at System.Web.Script.Services.RestHandler.GetRawParamsFromPostRequest
(HttpContext context, JavaScriptSerializer serializer)\r\n at System.Web.Script.Services.RestHandler
.GetRawParams(WebServiceMethodData methodData, HttpContext ... | [
-0.09548290073871613,
-0.17762108147144318,
0.4579523205757141,
0.029834160581231117,
-0.0780002623796463,
-0.006252880208194256,
0.41417795419692993,
-0.38379958271980286,
-0.5918050408363342,
-0.5987756252288818,
-0.49194881319999695,
0.43624386191368103,
-0.30206242203712463,
-0.1522383... | |
the following articles:
<http://elegantcode.com/2009/02/21/javascript-arrays-via-jquery-ajax-to-an-aspnet-webmethod/>
<http://encosia.com/2008/03/27/using-jquery-to-consume-aspnet-json-web-services/> | [
0.004021964967250824,
-0.16009841859340668,
0.19494885206222534,
0.030627315863966942,
-0.44706177711486816,
0.017681995406746864,
0.06855198740959167,
-0.0668165534734726,
-0.48946067690849304,
-0.5083897113800049,
-0.05200260132551193,
0.5189553499221802,
-0.24120545387268066,
-0.4467335... | |
I need to rename a file in the IsolatedStorage. How can I do that?
There doesn't appear to anyway in native C# to do it (there might be in native Win32, but I don't know).
What you could do is open the existing file and copy it to a new file and delete the old one. It would be slow compared to a move, but it might be ... | [
0.03041798062622547,
0.00986919179558754,
0.18607187271118164,
-0.10360050201416016,
0.13947926461696625,
0.08236855268478394,
0.5892038345336914,
-0.3088073134422302,
0.13248677551746368,
-0.895651638507843,
-0.0064469254575669765,
0.5797852873802185,
-0.5093320608139038,
0.19898743927478... | |
= new StreamWriter(writeStream))
{
writer.Write(reader.ReadToEnd());
}
``` | [
-0.030911589041352272,
-0.14004936814308167,
0.5532057285308838,
-0.4162939786911011,
0.4587422311306,
0.13035446405410767,
0.4403955340385437,
-0.03637712821364403,
0.12499336153268814,
-0.8523761630058289,
-0.1960945874452591,
0.6090923547744751,
-0.25547313690185547,
0.44577428698539734... | |
When I see any Ruby method printed in text, it usually appears as:
```
Class#method
```
or
```
#method
```
Now, I would use:
```
Class.method
```
Why are all Ruby methods preceded by a pound sign? Is there any reason for it?
From the [rdoc docs](http://www.ruby-doc.org/stdlib/libdoc/rdoc/rdoc/index.html) (emph... | [
0.49888262152671814,
0.2806711494922638,
0.11670320481061935,
-0.17925786972045898,
-0.5587109923362732,
-0.01884363405406475,
0.18694184720516205,
-0.08466959744691849,
-0.3442386984825134,
-0.23985640704631805,
-0.06416423618793488,
-0.08779093623161316,
-0.12607838213443756,
0.073564402... | |
This problem is a challenging one. Our application allows users to post news on the homepage. That news is input via a rich text editor which allows HTML. On the homepage we want to only display a truncated summary of the news item.
> For example, here is the full text we are displaying, including HTML
>
>
>
>
>... | [
0.45571577548980713,
0.47447630763053894,
0.23276127874851227,
0.2347138524055481,
0.05553003400564194,
-0.20996341109275818,
0.07847487926483154,
0.32906824350357056,
-0.5108714699745178,
-0.5696882605552673,
0.085121288895607,
0.24728912115097046,
-0.2237628549337387,
0.23070977628231049... | |
Cheyenne Courier mug from 1992 or perhaps that BC Tel Advanced Communications mug from 1997, they will be put in a box and donated to an office in more need of mugs than us.**
We want to trim the news item to 250 characters, but exclude HTML.
The method we are using for trimming currently includes the HTML, and this ... | [
0.3611876368522644,
0.5090370178222656,
-0.0910157635807991,
0.1939127892255783,
-0.3036031723022461,
0.18353892862796783,
0.5085192322731018,
0.05845560505986214,
-0.1542704701423645,
-0.4162462055683136,
0.6285023093223572,
0.1044432744383812,
-0.2967657446861267,
-0.0776868686079979,
... | |
is not what we want.
Does anyone have a way of tokenizing HTML tags in order to maintain position in the string, perform a length check and/or trim on the string, and restore the HTML inside the string at its old location?
Start at the first character of the post, stepping over each character. Every time you step ove... | [
0.5898658037185669,
-0.24175463616847992,
0.5463429689407349,
-0.016193879768252373,
-0.10419350862503052,
0.20312699675559998,
0.34223034977912903,
-0.23041340708732605,
-0.02432873845100403,
-0.443666934967041,
0.04809720441699028,
-0.006913143675774336,
-0.439313679933548,
-0.0173777434... | |
another problem that you'll have to deal with when an HTML tag is opened but not closed before the cutoff. | [
0.15338444709777832,
-0.17935049533843994,
0.14010144770145416,
0.29958733916282654,
-0.1445581018924713,
-0.2743089497089386,
0.37691113352775574,
0.3253649175167084,
-0.5454256534576416,
-0.5029716491699219,
-0.12585605680942535,
0.30712392926216125,
-0.1745937317609787,
-0.0482372939586... | |
I have a DataContext (Linq to Sql) with over 100 tables, is it possible to get a list of all those tables and lets say print them to the console? This might be a silly question.
Thanks.
It's much easier than above and no reflection required. Linq to SQL has a Mapping property that you can use to get an enumeration of ... | [
0.24315513670444489,
0.26455923914909363,
0.6927787065505981,
0.22117651998996735,
0.02517029084265232,
-0.2298135757446289,
-0.14646373689174652,
-0.12990659475326538,
0.00961678009480238,
-0.5810465216636658,
0.12271108478307724,
0.43359681963920593,
-0.13706998527050018,
0.0335261486470... | |
I am trying to execute the following code from a firefox extension but it is not working. The actual code inside the else part was different but even this simple for loop is not getting executed. alert box without the for loop is working. Can someone have any idea about why this is not working.
Thanks
```
window.addEv... | [
0.4525564908981323,
0.05782165005803108,
0.5585367679595947,
0.0010020654881373048,
0.29457202553749084,
-0.29719170928001404,
0.5793612003326416,
-0.29592058062553406,
-0.07892992347478867,
-0.5738822221755981,
-0.26436537504196167,
0.81633061170578,
-0.5062291622161865,
-0.09347087144851... | |
else
{
for(i=0;i<3;i++)
{
alert("hi");
}
}
},true);
```
If it's inside a Firefox extension, try using content.document instead of just document.
**EDIT**:
```
var metaTags = content.document.getElementsByTagName("meta");
for(var i = 0; | [
0.3095715343952179,
-0.03791432082653046,
0.8352758884429932,
-0.41198834776878357,
0.3533467650413513,
-0.2851097881793976,
0.5938965678215027,
-0.776985228061676,
-0.040321920067071915,
-0.5566579103469849,
-0.4381895959377289,
0.5914531946182251,
-0.7469024062156677,
0.08074487745761871... | |
i < metaTags.length; i++) {
// do something with metaTags[i]
}
```
Also, if it helps, feel free to look through the source of any of the [extensions I've written](https://addons.mozilla.org/en-US/firefox/user/1014082). | [
0.41177651286125183,
0.18018506467342377,
0.34920409321784973,
-0.15972596406936646,
0.060063689947128296,
-0.2547565996646881,
0.4085512161254883,
-0.0929369181394577,
-0.28644365072250366,
-0.5310512781143188,
-0.13662315905094147,
0.5316599607467651,
-0.7847298979759216,
-0.066765360534... | |
Is this the proper way to iterate over a `read` on a socket? I am having a hard time getting this to work properly. `data.size` is an `unsigned int` that is populated from the socket as well. It is correct. `data.data` is an `unsigned char *`.
```
if ( data.size > 0 ) {
data.data = (unsigned char*)malloc(data.size... | [
0.19371406733989716,
-0.1037476435303688,
0.3701997995376587,
-0.13842490315437317,
0.32027190923690796,
0.2238038033246994,
0.19407270848751068,
-0.3325437009334564,
-0.19990243017673492,
-0.4815439283847809,
-0.3176206052303314,
0.5658358335494995,
-0.17501914501190186,
-0.04271299764513... | |
= read(connect_fd, iter, remainingSize);
iter += count;
remainingSize -= count;
} while (count > 0 && remainingSize > 0);
}
else {
data.data = 0;
}
```
Thanks in advance.
You need to check the return value from read before you start adding it to other values.
You'll get a zero when the socket... | [
0.1437394767999649,
0.052906036376953125,
0.3304988443851471,
-0.2862560749053955,
0.1577005386352539,
-0.0950557067990303,
0.42482447624206543,
-0.12723283469676971,
0.007593066897243261,
-0.42769864201545715,
-0.4050346910953522,
0.780746340751648,
-0.15399740636348724,
0.000016505409803... | |
Say I want to echo an array but I want to make the value in the array I echo variable, how would I do this?
Below is kind of an explanation of what I won't to do but it isn't the correct syntax.
```
$number = 0;
echo myArray[$number];
```
I'm not sure what you mean. What you have isn't working because you're missing... | [
0.2999727129936218,
0.3287675976753235,
0.46994802355766296,
-0.3283854126930237,
-0.3988039195537567,
0.07114733755588531,
0.4565849304199219,
-0.49427998065948486,
-0.01423560082912445,
-0.07864780724048615,
-0.03774852305650711,
0.26764556765556335,
-0.47856324911117554,
0.1806064993143... | |
I recently read that for a faster web page load it's a good practice to put the JavaScript links at the end. I did, but now the functions of the referenced file doesn't work. If I put the link at the beginning of the page, everything is fine.
Does this thing of putting JavaScript at the end work only under certain cir... | [
0.5078815817832947,
-0.09859535098075867,
0.32546743750572205,
0.07719829678535461,
-0.15128499269485474,
-0.4971390962600708,
0.4036250412464142,
0.0010644765570759773,
-0.2748764753341675,
-0.593433141708374,
0.31229814887046814,
0.45476821064949036,
-0.1714964359998703,
0.18507583439350... | |
some of my visual effects noticeable. For example, if I was using jQuery to format a table, the table would come up unformatted and then the code would run to reformat it. I didn't find this to be a good user experience and would rather the page came up complete.
Secondly, putting it at the end made it hard to put cod... | [
0.39309215545654297,
0.05317267030477524,
0.37571200728416443,
0.12151170521974564,
-0.21172389388084412,
0.10791889578104019,
0.2535446286201477,
-0.09010886400938034,
-0.3676818311214447,
-0.6048479676246643,
0.19488786160945892,
0.49798840284347534,
-0.34069228172302246,
0.2612081170082... | |
above will produce an error.
Now you could argue that all that styling code could be put in the external file but that would be a mistake for performance reasons. I started off doing that on a project and then found my page took a second to run through all the Javascript that had been centralized. So I created functio... | [
0.5254783630371094,
0.11461352556943893,
0.43710100650787354,
-0.14919164776802063,
0.06911111623048782,
0.01234358549118042,
0.39388665556907654,
-0.4253636300563812,
-0.012972652912139893,
-0.7133236527442932,
0.15303964912891388,
0.9797662496566772,
-0.09353899955749512,
-0.063599780201... | |
headers so they're only loaded once (each time they're changed), at which point where they are in the file is largely irrelevant.
So all in all I found putting putting the Javascript files at the end of the file to be cumbersome and ultimately unnecessary. | [
0.5258945226669312,
0.023877914994955063,
-0.08210353553295135,
0.13606467843055725,
-0.3950449228286743,
-0.43207868933677673,
0.12544454634189606,
-0.23889006674289703,
-0.19727468490600586,
-0.3096833825111389,
0.04946009814739227,
0.3686152994632721,
-0.38075608015060425,
-0.0067538805... | |
I am trying to get the difference in hours for two different Time instances. I get these values from the DB as a :datetime column
How can I do this so that it includes the months and years as well in the calculation while ignoring or rounding the minutes? Can this only be done manually or is there a function to do th... | [
0.6156677603721619,
0.12334854900836945,
0.329454243183136,
-0.04790031164884567,
0.10340815782546997,
0.12119095027446747,
0.12022451311349869,
-0.2408367097377777,
-0.09931421279907227,
-0.5276399850845337,
0.2671619653701782,
0.33222290873527527,
-0.05306557938456535,
0.4065352082252502... | |
What's the best way to center a label in a `UIView`? If you do something such as
```
UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(view.frame.origin.x / 2, view.frame.origin.y / 2, 50.0, 50.0)];
```
Then you're setting the origin point of the label to the center of the view. The best bet would be to s... | [
0.039542101323604584,
-0.1977098435163498,
0.8157026171684265,
0.1162777990102768,
-0.007999053224921227,
-0.0635286420583725,
-0.2846376597881317,
-0.16056329011917114,
-0.01037245336920023,
-0.547706127166748,
-0.1046130433678627,
0.29347100853919983,
-0.010575168766081333,
0.34864661097... | |
which is pretty much outside the bounds of the view in the upper left hand corner.
The main thing you are doing wrong is taking half the *origin* values, rather than half the *sizes*
However, you don't need to even calculate that in this case - just do something like the following:
```
UIView *aView = [[[UIView allo... | [
0.03018486313521862,
-0.2461341917514801,
0.8347261548042297,
-0.0346430167555809,
-0.1127706840634346,
0.1644703894853592,
0.09273558855056763,
-0.28690680861473083,
-0.13211676478385925,
-0.7090001106262207,
-0.17243093252182007,
0.38311856985092163,
-0.3175681531429291,
0.03197801858186... | |
already using property syntax (`aView.backgroundColor`) you may as well use it for the center property too :-) | [
0.10712289810180664,
-0.2799520492553711,
0.340727835893631,
-0.037280622869729996,
0.12629134953022003,
-0.23062361776828766,
-0.16940812766551971,
-0.0678868442773819,
-0.22036105394363403,
-0.4838213622570038,
-0.2619694471359253,
0.3400709331035614,
-0.08361779153347015,
0.084068730473... | |
Suppose that ThreadA and ThreadB both call `WaitOne()` in that order on the same AutoResetEvent. When the event is set, why does ThreadB get released instead of ThreadA?
I ran a test to find out what happens when you set an AutoResetEvent on which mutiple threads are waiting:
```
private static void Test()
{
... | [
0.4233109652996063,
-0.4320876896381378,
0.0015282430686056614,
-0.21798144280910492,
0.22263328731060028,
-0.011527389287948608,
0.07279624044895172,
-0.11915653198957443,
-0.2736957371234894,
-0.40874314308166504,
-0.060118865221738815,
0.42948517203330994,
-0.5859320759773254,
0.3678985... | |
AutoResetEvent autoEvent = new AutoResetEvent(false);
Thread thread1 = new Thread(new ThreadStart(WriteSomeMessageToTheConsole));
thread1.Start(); // this will now block until we set the event
Thread thread2 = new Thread(new ThreadStart(WriteSomeOtherMessageToTheConsole));
thread2.Sta... | [
0.24845334887504578,
-0.04709029942750931,
0.4066278040409088,
-0.1572142392396927,
0.46429070830345154,
0.19389258325099945,
0.497424453496933,
-0.30776071548461914,
-0.46199432015419006,
-0.44755643606185913,
-0.1702653020620346,
0.8751984238624573,
-0.5610802173614502,
-0.03300034254789... | |
Console.WriteLine("Stuff done.");
// set the event - I thought this would mean both waiting threads are allowed to continue
// BUT thread2 runs and thread1 stays blocked indefinitely
// So I guess I was wrong and that Set only releases one thread in WaitOne()?
// And why thread2 first?
... | [
0.41437649726867676,
-0.08198526501655579,
0.9224825501441956,
-0.020845098420977592,
0.6329498291015625,
-0.3761892318725586,
0.11116950958967209,
-0.06279531121253967,
-0.12954606115818024,
-0.4343286156654358,
-0.2278928905725479,
0.7581321001052856,
-0.2894887924194336,
0.1674076020717... | |
not useful, it's just a simple example.
IIRC, which thread is released by an auto-reset event is unspecified. As everyone else mentioned, you want a manual reset event if you want to broadcast a condition. If you want to release an exact number (say exactly 3 of n), then you probably want to use a semaphore.
If you re... | [
0.5004050135612488,
-0.14263875782489777,
-0.1551201194524765,
0.1847512125968933,
0.3116980493068695,
-0.24656543135643005,
0.31681570410728455,
0.25015789270401,
-0.5463082194328308,
-0.40549400448799133,
-0.1414600908756256,
0.3004239499568939,
-0.5266003012657166,
0.2692070007324219,
... | |
I have an MS Access database that contains translated sentences in source-target pairs (a translation memory for fellow users of CAT tools). Somewhat annoyingly, source and target are not stored in separate columns, but in rows linked by ID, like this:
```
+---+----+--------------+
|id |lang| text |
+---+----+... | [
0.184038445353508,
0.2749735713005066,
0.5475435256958008,
-0.38900086283683777,
-0.2565137445926666,
0.09650418907403946,
0.266583651304245,
-0.24291858077049255,
0.029578393325209618,
-0.7325046062469482,
-0.12419376522302628,
0.1367354840040207,
-0.35129913687705994,
0.14326493442058563... | |
text...
+---+----+--------------+
```
What SQL could I use to turn that into a table such as:
```
+---+--------------+--------------+
|id | lang A | lang B |
+---+--------------+--------------+
1 lang a text lang b text
2 more a text... more b text...
```
Performance doesn't matter here, since... | [
-0.4413677453994751,
0.1515628844499588,
0.5688798427581787,
-0.4257456064224243,
-0.4061615765094757,
-0.03029058873653412,
0.03508720546960831,
-0.6221070885658264,
-0.11871093511581421,
-0.5059487223625183,
-0.31658118963241577,
0.3866700232028961,
-0.5831066370010376,
-0.32244223356246... | |
I wanted to have more than one controller and view for same object/model in asp.net mvc, but it turned out to be a little complicated than I expected.
Basically what I want to do is something like this :
```
site.com/product
-> will show product details to visitors.
site.com/admin/product
-> will show som... | [
0.38235539197921753,
-0.14549872279167175,
0.44189438223838806,
-0.049261290580034256,
-0.19419097900390625,
-0.1673882156610489,
-0.15526168048381805,
0.039549320936203,
-0.2299809455871582,
-0.6293600797653198,
-0.06164247542619705,
0.3451777696609497,
-0.25604018568992615,
0.51078760623... | |
and the view folders, so the things would look this way :
```
> Controllers
> Admin
ProductController.cs
ProductController.cs
> Views
> Admin
> Product
Index.aspx
> Product
Index.aspx
```
I can map the urls to the correct controllers without a problem (provided th... | [
0.11811976134777069,
-0.19523514807224274,
0.6873955726623535,
0.2684036195278168,
-0.09775586426258087,
0.06491686403751373,
-0.3156924843788147,
0.16320577263832092,
-0.11706550419330597,
-0.8148541450500488,
-0.33634400367736816,
0.22235889732837677,
-0.2178528904914856,
0.3353392481803... | |
the Controller under admin folder, it does not display the Index view under the Views/Admin/Product folder but the one under Views/Product.
I know I can say `return View("Full path here")` to return the view I want. But that's obviously not a good solution and I don't want to do that.
My question is, what is the best... | [
0.14215785264968872,
-0.2464529573917389,
0.6841467022895813,
0.2312568724155426,
-0.20704285800457,
-0.1735559105873108,
0.04762478172779083,
0.16891418397426605,
-0.12641474604606628,
-0.620621919631958,
-0.0342310331761837,
0.7879211902618408,
-0.20930811762809753,
0.43269556760787964,
... | |
is returned?
+ This one is an ugly hack, but would work.
* Create a custom view engine that also takes folders into consideration?
+ I don't exactly know how I can do this, but as far as I understand, this should also solve the problem
* Use [Areas Prototype](http://haacked.com/archive/2008/11/04/areas-in-aspnetmvc... | [
-0.046049851924180984,
-0.06908878684043884,
0.5592480897903442,
0.018280867487192154,
-0.23056432604789734,
0.021572832018136978,
0.17039212584495544,
-0.35260480642318726,
-0.1775449514389038,
-0.6537559032440186,
0.052145421504974365,
0.36237090826034546,
-0.15237610042095184,
0.0280820... | |
leaning towards the custom view engine idea, that takes the folders into consideration when returns the views, but like I said, I don't know how to do that.
Any suggestions?
Try out Phil Haack's /Areas/ for your MVC project: <http://haacked.com/archive/2008/11/04/areas-in-aspnetmvc.aspx>
You'd have your normal Root f... | [
-0.053140923380851746,
0.04831298068165779,
0.4533499777317047,
0.03730359673500061,
-0.3340986669063568,
-0.13241422176361084,
0.22915755212306976,
-0.0340878963470459,
-0.46533650159835815,
-0.4169965982437134,
-0.3349619507789612,
0.30973342061042786,
-0.1987488716840744,
-0.12110579013... | |
I'm running into a situation where I need the atomic sum of two values in memory. The code I inherited goes like this:
```
int a = *MemoryLocationOne;
memory_fence();
int b = *MemoryLocationTwo;
return (a + b) == 0;
```
The individual reads of a and b are atomic, and all writes elsewhere in the code to these two mem... | [
0.21682585775852203,
0.27078762650489807,
-0.019837429746985435,
-0.18213391304016113,
0.2631050646305084,
0.03138101100921631,
0.2208150029182434,
-0.3455055058002472,
-0.21134889125823975,
-0.5726529359817505,
0.32019853591918945,
0.5632726550102234,
-0.18029266595840454,
0.2960535287857... | |
that's not quite what I want to do here.
Is there a way to do it, or is the best option to refactor the code so that I only need to check one value?
Edit: Thanks, I didn't mention that I wanted to do this locklessly in the first revision, but some people picked up on it after my second revision. I know no one believe... | [
0.4619770348072052,
0.13733716309070587,
0.012257845140993595,
0.22471468150615692,
0.10038499534130096,
-0.018388913944363594,
0.42607513070106506,
-0.3614312708377838,
-0.5005741119384766,
-0.08571553230285645,
0.1377311497926712,
0.5078550577163696,
-0.0529356524348259,
0.09930943697690... | |
instead of two.
For now my method of investigation involves taking advantage of the fact that the values are consecutive and grabbing them atomically with a 64 bit read, which I'm assured are atomic on my target platforms. If anyone has new ideas, please contribute! Thanks.
If you truly need to ensure that `a` and `b`... | [
0.6633254885673523,
0.15733174979686737,
0.008802738972008228,
0.3532644510269165,
0.17799611389636993,
0.058722350746393204,
0.16114762425422668,
-0.13630464673042297,
-0.17178504168987274,
-0.5983761548995972,
0.03670099377632141,
0.5944329500198364,
-0.1506088227033615,
0.13995824754238... | |
timeslice lock, or whatever mechanism is used.
With this, you can ensure that if you:
```
memory_fence_start();
int a = *MemoryLocationOne;
int b = *MemoryLocationTwo;
int test = (a + b) == 0;
memory_fence_stop();
return test;
```
then `a` will not change while you are reading `b`. But again, you have to use the ... | [
0.14259788393974304,
-0.09851459413766861,
0.25158455967903137,
-0.07402878254652023,
0.37864458560943604,
-0.12225547432899475,
0.21142777800559998,
-0.2888050377368927,
-0.3403768837451935,
-0.6878355145454407,
-0.15684305131435394,
0.3171980381011963,
-0.27264946699142456,
0.30460515618... | |
aligned properly.
Assuming these are consecutive in memory and 32 bits each and that your processor has an atomic 64-bit read, then you can issue an atomic 64-bit read to read the two values in, parse the two values out of the 64-bit value, do the math and return what you want to return. Assuming you never need an ato... | [
0.4906757175922394,
0.027912365272641182,
0.5172047019004822,
0.34005972743034363,
0.2775532007217407,
-0.07360973954200745,
0.28140944242477417,
-0.5082709789276123,
-0.3451603353023529,
-0.21707138419151306,
0.04922368749976158,
0.9327073693275452,
-0.3840702772140503,
-0.104222148656845... | |
I'm using delphi6, and our company don't want to upgrade it,
and I found Tidftp lack the MLSD command,
So what is the free ftp component you are using now?
ps : I searched for one on Google, but I don't know which is stable and standard.
I haven't used [Synapse](http://www.ararat.cz/synapse/doku.php), but I hear good ... | [
0.02237551286816597,
-0.10130806267261505,
0.33414530754089355,
0.024181680753827095,
-0.11809150129556656,
-0.03687499836087227,
0.10658128559589386,
-0.13808757066726685,
-0.4243657886981964,
-0.8538827896118164,
-0.2848573625087738,
0.29467418789863586,
-0.5913476347923279,
-0.138332352... | |
protocol (client and
> server).
Beyond that I have had good luck with [Indy's TidFTP](http://www.indyproject.org/Sockets/index.EN.aspx), although I have used Indy 9 more than 10.
BTW, I don't know about the MLSD command specifically, but it seems like there was a way to send custom commands to the server with Indy. ... | [
0.13922981917858124,
-0.32243409752845764,
0.6108679175376892,
-0.015227274969220161,
-0.24335616827011108,
-0.48571041226387024,
0.23245224356651306,
0.12048278748989105,
-0.4181181490421295,
-0.6729583144187927,
0.186391219496727,
0.5486293435096741,
-0.3966678977012634,
-0.0469504632055... | |
In iTron there is lighter version of the message-queue called data-queue. They are very easy to use for fast message transfers. Is there any equivalent synchronization primitive in Linux?
**Definition of data-queue: It is a queue for one word messages**
On the few occassions I have needed to implement my own message q... | [
-0.03553006798028946,
-0.3053605556488037,
0.4024890959262848,
0.04287686198949814,
-0.24307754635810852,
0.25390294194221497,
0.024856073781847954,
0.20756182074546814,
-0.3147856295108795,
-0.5230947732925415,
0.028919972479343414,
0.336526483297348,
-0.3863208293914795,
0.22406733036041... | |
OS mechanism for thread to suspend/wait upon new messages.
The mutex is used to protect the overall queue structure.
So, it might look a bit like this (very much pseudo code):
```
DataQueueRx( Queue*, WORD*, timeout? )
{
WaitOnSemaphore( Queue->sema, timeout? ); //get token
LockMutex
{
//manipulate y... | [
0.059496209025382996,
-0.08460663259029388,
0.5743803977966309,
-0.02400800958275795,
0.21651792526245117,
0.2250070869922638,
0.28868356347084045,
-0.051239483058452606,
-0.45033156871795654,
-0.508831799030304,
-0.13035443425178528,
0.3252946436405182,
-0.4970124363899231,
0.282579302787... | |
}
UnlockMutex
}
```
However, perhaps this isn't very "light weight". This also assumes that queues are not destroyed while in use. Also, I suspect that with a "WORD" only queue, there could be some optimizations.
If you are seeking "Lock-free code", then I suggest spending a day or two reading through these [art... | [
0.060053009539842606,
0.21702203154563904,
0.2890510559082031,
-0.1511281281709671,
0.19767871499061584,
-0.3654027283191681,
0.8025981783866882,
0.07439535111188889,
-0.2557956278324127,
-0.7137100696563721,
-0.21810412406921387,
0.6154128909111023,
-0.20110197365283966,
0.038132987916469... | |
I am using jquery to highlight on hover, but it highlights entire div instead of just text. I tried using an "a tag" but do not want a reference link obviously. im sure this is simple, but im wasting too much time on trial and error. tia
This is explained thoroughly in the VB6 manual under [Error Handling Hierarchy](ht... | [
0.13457562029361725,
-0.0862765833735466,
0.04513290897011757,
0.06216640770435333,
-0.06644093245267868,
-0.28604164719581604,
0.4471694231033325,
-0.3834114670753479,
-0.1417502909898758,
-0.6058917045593262,
-0.009815910831093788,
0.7750383019447327,
-0.2945586144924164,
-0.109643749892... | |
backward through the pending
> procedures in the calls list — and executes the first
> enabled error handler it finds. If it
> doesn't encounter an enabled error
> handler anywhere in the calls list, it
> presents a default unexpected error
> message and halts execution.
As others have said, you can go to **Tool... | [
-0.012597627006471157,
0.08387446403503418,
0.4551750421524048,
-0.11858328431844711,
-0.013730118051171303,
0.1542643904685974,
0.7475552558898926,
-0.32183781266212463,
-0.23940256237983704,
-0.7171460390090942,
-0.20088058710098267,
0.6535420417785645,
-0.1791144758462906,
0.31250855326... | |
a file exists, or when the user presses cancel in a common dialogue. You don't want the IDE to break every time on those lines. But you might have boilerplate error handlers in all your event handling procedures, to stop the program crashing out on unexpected errors. But they are a nuisance when you're debugging proble... | [
0.6097471714019775,
0.17268557846546173,
-0.08163289725780487,
0.16523876786231995,
0.14636123180389404,
-0.51935213804245,
0.05988151952624321,
0.16538192331790924,
-0.25157487392425537,
-0.44325903058052063,
-0.2832094132900238,
0.7893843054771423,
-0.4761206805706024,
0.0900646522641182... | |
Function InIDE() As Boolean
Debug.Assert Not TestIDE(InIDE)
End Function
Private Function TestIDE(Test As Boolean) As Boolean
Test = True
End Function
```
Then you can write your error handlers like this.
```
Private Sub Form_Load()
If Not InIDE() Then On Error Goto PreventCrashes
<lots of code>
... | [
0.28712937235832214,
-0.21422424912452698,
0.1273685246706009,
0.10190246254205704,
-0.050150252878665924,
-0.056881438940763474,
0.236563578248024,
-0.33608192205429077,
0.14092475175857544,
-0.36764436960220337,
0.06887493282556534,
0.3210846185684204,
-0.5030020475387573,
0.221067547798... | |
stack trace](https://stackoverflow.com/questions/116289/what-is-the-better-way-to-handle-errors-in-vb6/116498#116498). You might also log the errors immediately in every error handler.
EDIT: Ant has correctly pointed out that `On Error Goto -1` is a [VB.Net statement](http://msdn.microsoft.com/en-us/library/5hsw66as(V... | [
0.08505290001630783,
0.0632552057504654,
0.17401373386383057,
0.23520654439926147,
0.01892811991274357,
-0.21185952425003052,
0.44557276368141174,
-0.2872762084007263,
-0.334721177816391,
-0.5654754638671875,
-0.10186424106359482,
0.46125221252441406,
-0.2359144687652588,
-0.22637371718883... | |
Consider the code below:
```
ScriptRuntimeSetup setup = Python.CreateRuntimeSetup(null);
ScriptRuntime runtime = new ScriptRuntime(setup);
ScriptEngine engine = Python.GetEngine(runtime);
ScriptScope scope = engine.CreateScope();
scope.SetVariable("message", "Hello, world!");
string script = @"print message";
ScriptS... | [
0.20681801438331604,
-0.11904621124267578,
0.2898217439651489,
-0.38306954503059387,
0.011128612793982029,
-0.20630212128162384,
0.5850823521614075,
-0.20727774500846863,
-0.19693951308727264,
-0.5496649146080017,
-0.20716796815395355,
0.6247845888137817,
-0.6099451184272766,
0.19218292832... | |
how do i debug something like this? i need the debugger to stop and show me where the problem is. don't just show it in the event log & then hang.
**first chance exception: system error 8: not enough storage space to perform the command**
i'm using delphi 2009. the problem doesn't happen regulary. i'm not eager to pe... | [
0.1492510288953781,
0.16023601591587067,
0.30218732357025146,
0.17870275676250458,
0.03346167504787445,
-0.2389518767595291,
0.5461729168891907,
0.08355984836816788,
-0.5950808525085449,
-0.4378831088542938,
-0.18829114735126495,
0.5407367944717407,
-0.0788123607635498,
0.1214078962802887,... | |
be other causes, but I think a resource leak is your #1 cause...
You are going to have to either find it and fix it, or start putting debug checks in on all memory allocations, handle allocations, and log them anytime you can't get memory, or handles.
It's also possible that your CLIENT machine is out of resources, b... | [
0.21140903234481812,
0.3588293194770813,
0.03097102791070938,
0.39194977283477783,
0.2135147601366043,
-0.11129787564277649,
0.39293158054351807,
0.31895896792411804,
-0.570867657661438,
-0.42254605889320374,
-0.1249072253704071,
0.3529830574989319,
-0.2599326968193054,
0.10813180357217789... | |
Given a set\*\* S containing duplicate elements, how can one determine the total number all the possible subsets of S, where each subset is unique.
For example, say S = {A, B, B} and let K be the set of all subsets, then K = {{}, {A}, {B}, {A, B}, {B, B}, {A, B, B}} and therefore |K| = 6.
Another example would be if ... | [
-0.0991477370262146,
0.06389062851667404,
-0.07855809479951859,
0.04432138800621033,
-0.17416121065616608,
0.5172634124755859,
0.2895315885543823,
-0.20955413579940796,
-0.42389971017837524,
-0.5499994158744812,
-0.3725375533103943,
-0.10687906295061111,
-0.563315749168396,
0.3827186226844... | |
that if S is a real set, having only unique elements, then |K| = 2^|S|.
What is a formula to calculate this value |K| given a "set" S (with duplicates), without generating all the subsets?
\*\* Not technically a set.
Take the product of all the (frequencies + 1).
For example, in {A,B,B}, the answer is (1+1) [the num... | [
0.44391730427742004,
-0.21610194444656372,
0.26377490162849426,
-0.17034950852394104,
-0.2545951008796692,
0.14365503191947937,
0.3036738634109497,
-0.588020920753479,
-0.38028812408447266,
-0.42048317193984985,
-0.34174859523773193,
0.07511831074953079,
-0.5389971733093262,
0.191572248935... | |
for {A,B,B}, the subsets can be described as {A=0,B=0}, {A=0,B=1}, {0,2}, {1,0}, {1,1}, {1,2}.
For each number in counts[] there are (frequencies of that object + 1) possible values. (0..frequencies)
Therefore, the total number of possiblities is the product of all (frequencies+1).
The "all unique" case can also be ... | [
-0.05268353223800659,
-0.4819844663143158,
0.26474350690841675,
-0.02262384630739689,
-0.24616661667823792,
0.37816569209098816,
0.07735460996627808,
-0.4847005605697632,
-0.3909921944141388,
-0.6174234747886658,
-0.24145516753196716,
0.22958379983901978,
-0.40315258502960205,
0.1625518053... | |
Is it possible to load a xaml file from *disk* (ie not from an application resource) and create the object tree without creating the outer object? In other words, I want to create a class that derives from Window and loads a xaml file from disk. It seems I can either create a class that does not derive from Window and ... | [
-0.06792232394218445,
0.1760523021221161,
0.41763585805892944,
-0.14325085282325745,
-0.04074979946017265,
-0.07015197724103928,
0.052484121173620224,
-0.1613825410604477,
-0.11817286163568497,
-0.722727358341217,
-0.2398706078529358,
0.6020536422729492,
-0.4118010103702545,
0.110304169356... | |
Window;
```
but what I really want to do is this:
```
class MyWindow : Window
{
public MyWindow()
{
System.Uri resourceLocater = new System.Uri("file://c:/mywindow.xaml", UriKind.Absolute);
System.Windows.Application.LoadComponent(this, resourceLocater);
}
}
...
MyWindow w = new MyWindow(... | [
-0.09829826653003693,
0.12076059728860855,
0.5812017917633057,
-0.09772808104753494,
0.13775871694087982,
-0.0762062594294548,
0.303734689950943,
0.2253284901380539,
-0.13392047584056854,
-0.835656464099884,
-0.40993642807006836,
0.6809430122375488,
-0.307706743478775,
0.3512243330478668,
... | |
string strXaml = String.Empty;
using (var reader = new System.IO.StreamReader(filePath, true))
{
strXaml = reader.ReadToEnd();
}
object xamlContent = System.Windows.Markup.XamlReader.Parse(strXaml);
} | [
-0.3520224690437317,
-0.1058531403541565,
0.5970472097396851,
-0.2569356858730316,
0.06305108964443207,
0.31639522314071655,
0.2957264184951782,
-0.1321980357170105,
-0.21962971985340118,
-0.6131526231765747,
-0.36143580079078674,
0.3306679427623749,
-0.6909403204917908,
0.3081963658332824... | |
catch (System.Windows.Markup.XamlParseException ex)
{
// You can get specific error information like LineNumber from the exception
}
catch (Exception ex)
{
// Some other error
}
```
Then you should be able to set the xamlContent to the Content property | [
0.19861014187335968,
-0.11244696378707886,
0.32048898935317993,
-0.11776778846979141,
0.2545076608657837,
-0.23482176661491394,
0.10379386693239212,
-0.1802176535129547,
-0.20470166206359863,
-0.3624824583530426,
-0.16948874294757843,
0.414736807346344,
-0.28270184993743896,
0.059476274996... | |
of the Window.
```
Window w = new Window();
w.content = xamlContent;
w.ShowDialog();
``` | [
0.08827272057533264,
0.09080448001623154,
0.8655728697776794,
-0.368293821811676,
0.07101035118103027,
-0.13602027297019958,
0.15081161260604858,
0.13749557733535767,
-0.09129060804843903,
-0.8599235415458679,
-0.5275713205337524,
0.29786059260368347,
-0.4906211197376251,
0.453283697366714... | |
I would like to take a string
```
var a = "http://example.com/aa/bb/"
```
and process it into an object such that
```
a.hostname == "example.com"
```
and
```
a.pathname == "/aa/bb"
```
```
var getLocation = function(href) {
var l = document.createElement("a");
l.href = href;
return l;
};
var l = get... | [
0.08748422563076019,
0.09033893048763275,
0.5432457327842712,
-0.26299819350242615,
0.29351863265037537,
0.2701112627983093,
-0.06175883486866951,
-0.27992695569992065,
0.11311888694763184,
-0.8659403324127197,
-0.14972828328609467,
0.41846635937690735,
-0.3008480668067932,
0.2702926397323... | |
I have a web application I want to build, how should I manage all my tasks with fogbugz.
If I want to list all the tasks I have on a page by page basis, should I use areas for that?
I also want to break it down to modules, again I use areas?
example:
* Users
+ add user
+ delete user
+ assign permissions/roles to ... | [
0.30250489711761475,
0.3890507221221924,
0.31071045994758606,
0.014824483543634415,
-0.14062215387821198,
-0.018465695902705193,
0.10840662568807602,
-0.31091615557670593,
-0.5650565028190613,
-0.5312135219573975,
0.24212725460529327,
0.5908169150352478,
-0.4026678204536438,
0.065110459923... | |
into FogBugz under the right project and area with a good title.
So, the Project is whatever the product or business project is that you're working on.
The areas should be things like UI, Code, Docs, Data Migration, the kinds of things that people have different responsibilities and/or abilities in.
Then title your ... | [
0.44747409224510193,
-0.06606049090623856,
0.9953684210777283,
0.09399466216564178,
0.19020698964595795,
-0.2525210380554199,
-0.026946337893605232,
0.006759325508028269,
-0.1782117635011673,
-0.5065627694129944,
-0.05079285427927971,
0.5136677026748657,
-0.19357015192508698,
0.08910729736... | |
User
* Delete User
* List Users
* Add dependency checks to delete role.
To be honest, even the above is probably a little over-board, you'd probably get away with:
* User Role add/view/update/delete/list
* User add/view/update/delete/list
The simpler you make it, and more trust you put in your devs, the less hampere... | [
0.2746000587940216,
-0.0316866971552372,
0.2147197276353836,
0.08118559420108795,
-0.22696229815483093,
0.044951923191547394,
0.4223564863204956,
-0.030867742374539375,
0.0126734534278512,
-0.8386491537094116,
-0.053774986416101456,
0.8735432028770447,
-0.31214770674705505,
-0.064879976212... | |
I'm using Visual Studio 2005, C# with Framework 2.0. I'd like to use auto complete, but would like the list to come from a table in my database.
Is there a way to databind the AutoCompleteSoure?
You might want to take a look at this [blogpost](http://csharpdotnetfreak.blogspot.com/2009/01/winforms-autocomplete-textbox... | [
0.3151134252548218,
0.03234175592660904,
0.18736857175827026,
-0.18302318453788757,
-0.2940620481967926,
0.009671395644545555,
0.24412648379802704,
0.1238037496805191,
-0.23871223628520966,
-0.5716925263404846,
0.12424509227275848,
0.7143668532371521,
-0.22787323594093323,
-0.2640097141265... | |
Is there a way to display all functions in a C source file using vim. This feature is available with the brief editor. And this would help me a lot.
Note: This is not a programming question.
I think the [Taglist](http://www.vim.org/scripts/script.php?script_id=273) plugin is what you are looking for. It shows function... | [
0.5856328010559082,
-0.058186765760183334,
0.13784614205360413,
0.17251227796077728,
-0.20495672523975372,
-0.41031280159950256,
0.030917124822735786,
0.12279951572418213,
-0.23968741297721863,
-0.5813199877738953,
0.059308506548404694,
0.6531909108161926,
-0.24610652029514313,
0.105216704... | |
I can't find any documentation on implementing a class that inherits `System.Windows.Media.Brush` - what would it need to provide to do the job?
My specific goal is a triangle gradient; I can handle the details of calculating the colors if I can just find out how to actually implement a new brush.
First, look into a U... | [
0.04432521015405655,
-0.2796061038970947,
0.43842750787734985,
0.22197790443897247,
-0.20507900416851044,
0.09014541655778885,
-0.26649194955825806,
-0.2567882239818573,
-0.13748864829540253,
-0.8357959389686584,
0.41492441296577454,
0.3167048692703247,
-0.29255273938179016,
-0.00227747834... | |
I am trying to integrate some OpenCV functionality into my application. Currently I have code set up with DirectShow to get a video feed from my camera, which is then showed in an MFC window. This code cannot be changed or removed.
The code runs completely fine, but regardless of the location i place the following li... | [
0.5227332711219788,
0.2484729140996933,
0.4212346374988556,
-0.25671905279159546,
0.195058211684227,
-0.16195672750473022,
0.6460142135620117,
-0.16514894366264343,
-0.15954053401947021,
-0.6355239748954773,
0.027045903727412224,
0.5800331830978394,
-0.3255717158317566,
0.3224872350692749,... | |
know what is going on here?
CoInitialize will fail if the thread was previously initialized as a different apartment, i.e., if there was a previous CoInitializeEx(NULL, COINIT\_MULTITHREADED)
I would guess that OpenCV calls CoInitializeEx(NULL, COINIT\_MULTITHREADED), causing your subsequent calls to CoInitializeEx to... | [
0.5679657459259033,
0.0813530758023262,
0.1493140310049057,
0.008636850863695145,
0.32574334740638733,
-0.12867195904254913,
0.4533049762248993,
-0.030717521905899048,
-0.5588010549545288,
-0.6203650236129761,
0.06930625438690186,
0.39398840069770813,
-0.47366222739219666,
0.61909002065658... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.