text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
/>
</fileset>
</delete>
</target>
```
Unfortunately i dont have control over the contents on the batch file and it spews out a lot of garbage onto the screen which is of no use in the log. So to get around this im redirecting the output from the bat file to a text file using the
```
> ${make.log}
```
... | [
0.5111694931983948,
0.28760072588920593,
0.23802754282951355,
-0.22993236780166626,
-0.27045387029647827,
-0.0737910196185112,
0.3405068814754486,
0.0005312528228387237,
0.04329727962613106,
-0.8529689908027649,
-0.05045895278453827,
0.4945814907550812,
-0.41781383752822876,
0.347151160240... | |
this file after the bat file has executed.
The problem is i now need to run a similar task for another project entirely and if they run at the same time then the first will lock the file called "program" and the second will fail. Not exactly a great situation for Continuous integration.
I searched on the net but bec... | [
0.6270753145217896,
0.08666843175888062,
0.04712706431746483,
0.02886972203850746,
-0.22762827575206757,
-0.08253061026334763,
0.428460031747818,
-0.08987261354923248,
-0.13699954748153687,
-0.6300496459007263,
0.24387145042419434,
0.4882233738899231,
-0.23560619354248047,
0.37337580323219... | |
trying to create a file with a long file name with space in it (**`c:\program files`** in your case), but it is not using quotes around the long file name. | [
0.25752121210098267,
0.22107674181461334,
-0.16832590103149414,
0.1329386681318283,
0.06848997622728348,
-0.05505019426345825,
0.1551440954208374,
0.21838119626045227,
-0.18597251176834106,
-0.6130149960517883,
-0.1976126879453659,
0.2062837928533554,
-0.18413223326206207,
0.02191820554435... | |
Hey everyone, I'm working on a widget for Apple's Dashboard and I've run into a problem while trying to get data from my server using jquery's ajax function. Here's my javascript code:
```
$.getJSON("http://example.com/getData.php?act=data",function(json) {
$("#devMessage").html(json.message)
if(json.version ... | [
0.2252870500087738,
0.15447311103343964,
0.8200648427009583,
-0.134991854429245,
-0.08979898691177368,
-0.11031468957662582,
0.36689066886901855,
0.07556047290563583,
-0.5394473671913147,
-0.6863047480583191,
-0.2833813428878784,
0.6938519477844238,
-0.14956389367580414,
-0.197103291749954... | |
me think that Apple has some kind of external URL block in place. I know this can't be true though, because many widgets phone home to check for updates.
Does anyone have any ideas as to what could be wrong?
EDIT: Also, this code works perfectly fine in Safari.
---
As requested by Luca, here's the PHP and Javascrip... | [
0.1840694695711136,
0.0010932954028248787,
0.5942243337631226,
-0.28205955028533936,
-0.1254875808954239,
-0.09627439826726913,
0.6904926300048828,
-0.2721818685531616,
-0.29861634969711304,
-0.5223982334136963,
-0.30071812868118286,
0.6063445806503296,
-0.2828170359134674,
0.1341583430767... | |
$("#latestVersion").css("color","red")
}
$("#latestVersion").html(json.version)
})
}
```
In Dashcode click **Widget Attributes** then **Allow Network Access** make sure that option is checked. I've built something that simply refused to work, and this was the solution. | [
0.14278088510036469,
-0.17758134007453918,
0.7752371430397034,
-0.11495816707611084,
0.18265876173973083,
-0.42111656069755554,
0.3235548436641693,
0.23923513293266296,
-0.12959012389183044,
-0.871562123298645,
-0.1506214588880539,
0.6791056990623474,
-0.2931217551231384,
0.003851769957691... | |
I have a div with style="overflow: auto" with some text in it. That text has some anchors, which I have links left of the div (not within the div) and everytime I click to go to an anchor, th page goes to the bottom, like the anchor was in the bottom of the page.
Is there any way to prevent this from happening?
```
<... | [
0.08238495886325836,
0.28498703241348267,
0.7211676836013794,
-0.18403297662734985,
-0.029251573607325554,
0.06509332358837128,
0.16767781972885132,
-0.09743092954158783,
-0.13403372466564178,
-0.665320634841919,
-0.20120008289813995,
0.509517252445221,
-0.19808059930801392,
0.016955224797... | |
Big text with <hr id='#id24' /> here
Text Inside, Big text with <hr id='#id20' /> here
Text Inside, Big text with <hr id='#id21' /> here
Text Inside, Big text with <hr id='#id23' /> here
Text Inside, Big text with <hr id='#id22' /> here
Text Inside, Big text with <hr id='#id2' /> here
<div>
```
EDIT: I'm nor using Ja... | [
-0.022359002381563187,
0.3378470540046692,
0.46635666489601135,
-0.16283074021339417,
-0.10281732678413391,
0.06434967368841171,
0.34407883882522583,
-0.3290691673755646,
-0.1300603598356247,
-0.8228166103363037,
-0.18210971355438232,
0.6374496221542358,
-0.35057419538497925,
-0.1714646071... | |
I have this code:
```
public partial class FrmPrincipal : Form
{
private Image imagen;
public FrmPrincipal()
{
InitializeComponent();
...
}
private void menuItem1_Click(object sender, EventArgs e)
{
Thread t = new Thread(RequestImage);
t.Start();
}
pri... | [
0.07625670731067657,
-0.3249036371707916,
0.9577396512031555,
-0.30314603447914124,
0.06209626793861389,
0.25159069895744324,
0.2308736890554428,
-0.23677842319011688,
-0.15932303667068481,
-0.7209957838058472,
-0.24254567921161652,
0.5533571839332581,
-0.2917523682117462,
0.31116724014282... | |
{
...
// I want to update this.token
this.imagen = retrieveImageFromWebService();
...
}
catch (Exception ex)
{
... | [
0.01916596107184887,
-0.3119090497493744,
0.29501017928123474,
-0.22843456268310547,
0.16941921412944794,
0.026094792410731316,
0.3405357897281647,
-0.2565748989582062,
-0.19316670298576355,
-0.45940420031547546,
0.00276353326626122,
0.3907041549682617,
-0.22963793575763702,
0.042137645184... | |
}
}
}
```
How can I update image? I want to save a copy of image to update a pictureBox when user needs it.
Thanks!
The code you have there should work fine. If you are using token in the other thread through, you'll probably want to syncronize gets and sets to avoid data corruption:
```
private string token {
... | [
0.03224048763513565,
-0.0816645547747612,
0.36922675371170044,
0.2577478587627411,
0.14648300409317017,
-0.04529721662402153,
0.48314592242240906,
-0.05520166829228401,
-0.29423514008522034,
-0.8084924221038818,
0.23066572844982147,
0.5532371997833252,
-0.2865334451198578,
0.11945919692516... | |
I am using CR 9. Sorry about that.
I have never used Crystal Reports; however, my boss has asked me to provide him the "logic" used in a report generated for one of our customers. The report was created several years ago and the customer contact is new. He wants to know what information we use to calculate the data re... | [
0.5683757662773132,
0.42656663060188293,
0.5450769066810608,
0.2877424955368042,
-0.09416960179805756,
0.13948629796504974,
-0.18317848443984985,
0.28542470932006836,
-0.45142862200737,
-0.545409619808197,
0.30015280842781067,
0.43311938643455505,
-0.27576324343681335,
0.15991069376468658,... | |
file menu, click on "Database" and on the drop down menu, there should be an option to "Show SQL Query". | [
0.03604191169142723,
0.046932153403759,
0.3251858949661255,
0.41686582565307617,
0.30442672967910767,
-0.3195461630821228,
-0.05875920504331589,
0.4202980101108551,
-0.15514494478702545,
-0.4143220782279968,
-0.25764337182044983,
0.5948490500450134,
-0.12687519192695618,
0.208359494805336,... | |
I have a manytomany relationship between publication and pathology. Each publication can have many pathologies. When a publication appears in the admin template, I need to be able to see the many pathologies associated with that publication. Here is the model statement:
```
class Pathology(models.Model):
pathology... | [
0.05683436989784241,
0.2661512494087219,
0.46139320731163025,
-0.19378171861171722,
0.020932259038090706,
0.308284193277359,
0.07780428975820541,
-0.517114520072937,
0.045793935656547546,
-0.8027914762496948,
0.14717607200145721,
0.31433799862861633,
-0.3333236873149872,
0.1939798146486282... | |
return self.pubtitle
class Meta:
ordering = ["pubtitle"]
```
Here is the admin.py. I have tried variations of the following, but always
get an error saying either publication or pathology doesn't have a foreign key
associated.
```
from myprograms.cpssite.models import Pathology
class PathologyAdmin(admi... | [
0.12221193313598633,
0.2585742175579071,
0.5453944802284241,
0.026457268744707108,
-0.13476531207561493,
0.4245362877845764,
0.3355776071548462,
-0.3711284399032593,
0.020747611299157143,
-0.6229866743087769,
0.06493233889341354,
0.273847371339798,
-0.2371649146080017,
0.27153223752975464,... | |
help.
I realize now that Django is great for the administration (data entry) of a website, simple searching and template inheritance, but Django and Python are not very good for complex web applications, where data is moved back and forth between a database and an html template. I have decided to combine Django and PHP... | [
0.24004383385181427,
0.17365816235542297,
0.11307333409786224,
0.44166100025177,
-0.3002798557281494,
-0.33077818155288696,
0.25917306542396545,
0.155747190117836,
-0.3288326859474182,
-0.4628472924232483,
0.2703504264354706,
0.5353533029556274,
0.13695240020751953,
-0.0854237899184227,
... | |
I have an older library that uses COleDateTime as a return type in a C++ MFC Dll. When I do a PInvoke, can I marshal that with confidence to a DateTime object? Or should I do something wacky, like convert the COleDateTime into the number of ticks since 1970, and then convert those ticks back to a DateTime object in the... | [
0.4304329752922058,
-0.13724319636821747,
0.2509462237358093,
-0.21952460706233978,
0.012116021476686,
0.189918652176857,
0.06792338192462921,
-0.11883269995450974,
-0.33240896463394165,
-0.3546173870563507,
0.20827844738960266,
0.22908860445022583,
-0.49849700927734375,
0.0928219705820083... | |
Given the following HQL Query:
```
FROM
Foo
WHERE
Id = :id AND
Bar IN (:barList)
```
I set `:id` using the Query object's `setInteger()` method.
I would like to set `:barList` using a `List` of objects, but looking at the Hibernate documentation and list of methods I cannot see an obvious choice of whi... | [
-0.042250856757164,
-0.03730796277523041,
0.6821148991584778,
-0.3922378420829773,
-0.23011812567710876,
0.3467688262462616,
0.22549590468406677,
-0.5396443009376526,
-0.10166461765766144,
-0.6049207448959351,
-0.2635406255722046,
0.45045948028564453,
-0.4381592571735382,
-0.16076971590518... | |
I have a java applet running in a browser that is calling some javascript functions and expecting a result from theses functions. This is working with the following configurations :
* Internet Explorer
* FireFox / Windows
* Safari / Mac
BUT It's not working with Firefox on MAC OS
The source of the problem seems to b... | [
-0.05934477970004082,
0.2951972186565399,
0.2665292024612427,
-0.2608191967010498,
-0.04917669668793678,
-0.27940961718559265,
0.8096574544906616,
-0.3717113435268402,
-0.04626111686229706,
-0.5582015514373779,
-0.02065153419971466,
0.6782673597335815,
-0.533232569694519,
-0.02125621028244... | |
with win.call and got the same result.
My applet tag includes the mayscript and scriptable attributes.
---
I found the answer thanks to Tristan. Testing his solution I created a really simple test that could work and worked my way to find the culprit. I was sure I did my tests with an empty testfunc() that just retu... | [
0.2755180597305298,
0.19083313643932343,
-0.1485111266374588,
0.20235568284988403,
-0.2673055827617645,
0.06796318292617798,
0.6099037528038025,
-0.23355963826179504,
0.12650363147258759,
-0.42281898856163025,
0.08155292272567749,
0.6669561862945557,
-0.4297754466533661,
-0.299869775772094... | |
class :
```
public class MyApplet extends Applet {
public int getMyValue() {
return 5;
}
public void somefunction() {
JSObject win = (JSObject) JSObject.getWindow(this);
Object exp = win.eval("jsfunc()");
System.out.println("exp = " + exp.toString());
}
}
``... | [
-0.044253356754779816,
0.011755496263504028,
0.5624512434005737,
-0.39960533380508423,
0.24080859124660492,
0.10538467764854431,
0.5106247663497925,
-0.342044472694397,
-0.21607854962348938,
-0.5354215502738953,
-0.6287093162536621,
0.6995439529418945,
-0.36172032356262207,
-0.020657839253... | |
return myApplet.getMyValue() + 5;
}
```
exp will be null in somefunction BECAUSE jsfunc calls the getMyValue() method of the applet. If you remove all calls to properties of the applet you're cool.
To solve my problem I decided to give all the values of the applet that I neeeded as parameters of my javascript func... | [
-0.20423629879951477,
0.27657803893089294,
0.44794562458992004,
-0.23631419241428375,
0.0784655511379242,
-0.031991664320230484,
0.6418723464012146,
0.06380383670330048,
-0.34532439708709717,
-0.6317378878593445,
-0.3792765438556671,
0.6080629229545593,
-0.3945564925670624,
-0.074963182210... | |
or maybe just win.eval("testfunc()")
```
That would be my experiment. But I've been calling "window.close()" on FF on Mac OS X, and that still works. | [
0.006774016655981541,
0.0341767892241478,
0.17557711899280548,
-0.04899124801158905,
-0.24000674486160278,
-0.1641232967376709,
0.2516535520553589,
0.1714814454317093,
-0.03501610830426216,
-0.39041900634765625,
0.13329221308231354,
0.6285295486450195,
-0.0796581581234932,
-0.1725934743881... | |
In Perl, one can often avoid using control blocks, like this:
```
print "$_\n" foreach(@files);
```
instead of:
```
foreach(@files){
print "$_\n";
}
```
How does this syntax work in the following, more complex case:
```
die("Not a file: $_") unless -f $_ foreach(@files);
```
It gives me a syntax error. I'm n... | [
0.07973245531320572,
0.180894672870636,
0.35595083236694336,
-0.006551850121468306,
-0.3145639896392822,
0.2865094542503357,
0.03661002963781357,
-0.25562191009521484,
-0.1722273826599121,
-0.1903437227010727,
-0.06206529214978218,
0.4181658625602722,
-0.4503195285797119,
-0.19434599578380... | |
"Not a file: $_" foreach @files;
```
And the following one is at least as good. I like that `die` is at the beginning of the statement because that's what the reader's attention should be directed toward:
```
die("Not a file: $_") for grep {!-f} @files;
```
Just to be Perlish (TMTOWTDI) you can use logic short-circ... | [
0.312947541475296,
0.09696412831544876,
0.08036889880895615,
-0.03948783501982689,
-0.30523955821990967,
-0.1780547797679901,
0.29689905047416687,
0.15067410469055176,
-0.1585541069507599,
-0.3408242166042328,
-0.2916763424873352,
0.6810178160667419,
-0.1296284794807434,
0.1022554412484169... | |
I'm trying to debug some legacy asp.net 1.1 code. I have moved the app to my local machine to debug. When I try to load any aspx page I get the following error.
-2147467259 (0x80004005)
That's all that's on the page. Anybody have a clue where I should start to fix this.
So it turned out to be a problem with the asp.n... | [
-0.043575968593358994,
0.3490845263004303,
0.18797077238559723,
-0.16550782322883606,
-0.053953129798173904,
0.05942121520638466,
0.7913662195205688,
0.14338283240795135,
-0.12027376145124435,
-0.41316694021224976,
-0.10106354206800461,
0.266888827085495,
-0.3289438784122467,
0.34362673759... | |
I am new to Windows Mobile development and am running into a DLL issue.
I am using Assembly.LoadFrom() to load a DLL on my handheld and it fails with the following:
System.IO.IOException:
File or assembly name 'MyCustom.dll', or one of its dependencies, was not found.
The DLL does exist, I am doing a File.Exists() ... | [
0.2966361343860626,
0.19804024696350098,
0.5980351567268372,
-0.013393471017479897,
0.31241098046302795,
-0.011410078965127468,
0.3857976198196411,
-0.20538277924060822,
-0.03672010451555252,
-0.9295073747634888,
0.01698712259531021,
0.6346438527107239,
-0.08152969181537628,
0.151351481676... | |
I am using Python to connect to an FTP server that contains a new list of data once every hour. I am only connecting once a day, and I only want to download the newest file in the directory. Is there a way to do this?
Look at ftplib in your current version of python. You can see a function to handle the result of the L... | [
0.3403211832046509,
-0.3034450113773346,
0.3984754979610443,
-0.11908882111310959,
-0.09999160468578339,
-0.1084260642528534,
0.15977843105793,
0.1609887033700943,
-0.38613083958625793,
-0.5859985947608948,
0.16596315801143646,
0.86983722448349,
-0.3826397657394409,
-0.17714260518550873,
... | |
new files on the directory. See the [ftplib](https://docs.python.org/3/library/ftplib.html) for more info on how to do it. The retrlines function is what I would expect to use. | [
-0.005841981153935194,
-0.503415584564209,
0.9889780879020691,
-0.06041112169623375,
0.20193761587142944,
-0.3341731131076813,
-0.09689961373806,
-0.07475056499242783,
-0.5399928092956543,
-0.5852131843566895,
-0.14949920773506165,
0.6250636577606201,
-0.3815891146659851,
-0.08027448505163... | |
I have mysql database and I want to get the last ID from field in a table .
example : -
```
id Value
1 david
2 jone
3 chris
```
I want a function return 3 if this table exist .
If you want to select the ID of the most recently inserted row in a table with an AUTO\_INCREMENT column, you will likey be int... | [
0.16258850693702698,
0.2751912772655487,
0.3010733127593994,
-0.41927582025527954,
-0.12912242114543915,
0.07793262600898743,
0.2040470391511917,
-0.3037640154361725,
0.06628769636154175,
-0.5292066931724548,
-0.10381632298231125,
0.584383487701416,
-0.2790773808956146,
0.05547377094626427... | |
I want to show a title and description from a db query in each form, but I don't want it to be in a charfield, I want it to be html-formatted text.
sample template code:
```
{% for form, data in zipped_data %}
<div class="row">
<div class="first_col">
<span class="title">{{ data.0 }}</span>
... | [
0.3414723873138428,
0.16380055248737335,
0.4330844581127167,
-0.06248428300023079,
-0.09021279960870743,
0.026509180665016174,
0.1447768360376358,
-0.6797724962234497,
0.12128977477550507,
-0.7928054332733154,
-0.232860267162323,
0.4181882441043854,
-0.18314537405967712,
0.1448850035667419... | |
</div>
{% for field in form %}
<div class="fieldWrapper" style="float: left; ">
{{ field.errors }}
{{ field }}
</div>
{% endfor %}
{% endfor %}
```
Is this the most idiomatic way of doing this? Or, is there a way to add text that will not be displayed inside of a ... | [
0.16602957248687744,
0.10572613030672073,
0.2682851254940033,
-0.20288266241550446,
-0.1408151239156723,
-0.04133472964167595,
0.3362562358379364,
-0.15178442001342773,
0.03829243406653404,
-0.4261055588722229,
-0.31540659070014954,
0.5646807551383972,
-0.2278270423412323,
0.01267853099852... | |
input to my model:
```
class ReportForm(forms.Form):
comment = forms.CharField()
```
?
Instead of zipping your forms with the additional data, you can override the constructor on your form and hold your title/description as *instance-level* member variables. This is a bit more object-oriented and learning how to ... | [
0.19663190841674805,
-0.04116154834628105,
0.43775659799575806,
0.06552352756261826,
-0.1943056583404541,
-0.011637657880783081,
0.16799362003803253,
-0.3220422565937042,
-0.023949729278683662,
-0.7371628880500793,
-0.21201089024543762,
0.6822422742843628,
-0.1383991688489914,
0.3007199466... | |
(MyForm, self).__init__ (*args, **kwargs) # call base class
```
Then in your view code:
```
form = MyForm ('Title A', 'Description A')
```
Adjust accordingly if you need these values to come from the database. Then in your template, you access the instance variables just like you do anything else, e.g.:
```
<h... | [
0.41118088364601135,
0.23285266757011414,
0.3488641083240509,
-0.03828410059213638,
-0.25513938069343567,
0.010102802887558937,
0.11223970353603363,
-0.3926522433757782,
0.11184311658143997,
-0.7406406998634338,
-0.14033430814743042,
0.4356124699115753,
-0.04788409546017647,
0.241594702005... | |
[Check out this link for a good discussion on the distinction](https://stackoverflow.com/questions/207000/python-difference-between-class-and-instance-attributes)
* [And this one](https://stackoverflow.com/questions/206734/why-do-attribute-references-act-like-this-with-python-inheritance) | [
-0.02309977076947689,
-0.008955653756856918,
-0.09463082253932953,
0.04079720750451088,
-0.16969555616378784,
-0.15503714978694916,
0.15938343107700348,
-0.22396977245807648,
-0.31380829215049744,
-0.08935374766588211,
-0.051787298172712326,
0.6313104629516602,
-0.2841304540634155,
-0.0222... | |
I am heavily using byte array to transfer objects, primitive data, over the network and back. I adapt java's approach, by having a type implement ISerializable, which contains two methods, as part of the interface, ReadObjectData and WriteObjectData. Any class using this interface, would write date into the byte array.... | [
-0.03233760967850685,
-0.18259279429912567,
0.11225932836532593,
-0.14341117441654205,
0.07567101716995239,
-0.0050324671901762486,
-0.24051201343536377,
0.040386516600847244,
-0.14369957149028778,
-0.7898234128952026,
0.124985471367836,
0.1898472160100937,
-0.15966947376728058,
0.20707285... | |
is complete for all object, I send an array of the network.
---
This is actually two-fold question. Is it a right way to send data over the network for the most efficiency (in terms of speed, size)?
Would you use this approach to write objects into the file, as opposed to use typically xml serialization?
**Edit #1*... | [
0.20014537870883942,
-0.09166471660137177,
0.17762444913387299,
0.08896239846944809,
-0.20098578929901123,
-0.237208291888237,
0.1477310061454773,
-0.10485006868839264,
-0.4318958520889282,
-0.7638158798217773,
-0.17489072680473328,
0.28021466732025146,
-0.15831750631332397,
0.110859796404... | |
class.
Rather than needing to implement your own Read/WriteOjbectData() methods for each specific type you can just use this class that can already handle most any object. It basically takes an exact copy of the memory representation of almost any .Net object and writes it to or reads it from a stream:
```
BinaryForm... | [
-0.0842822715640068,
-0.33865565061569214,
0.1639227271080017,
0.25544488430023193,
0.04892003536224365,
-0.2530171573162079,
0.18550878763198853,
-0.02230667509138584,
-0.11401364207267761,
-0.7982767224311829,
-0.10962280631065369,
0.319096177816391,
-0.4438600540161133,
0.23268607258796... | |
Say I have a Point2 class, and I want to implement the following Equals:
```
public override bool Equals ( object obj )
public bool Equals ( Point2 obj )
```
This is from the Effective C# 3 book:
```
public override bool Equals ( object obj )
{
// STEP 1: Check for null
if ( obj == null )
{
ret... | [
-0.26958680152893066,
0.24405504763126373,
0.49528709053993225,
-0.3870355486869812,
-0.12317255139350891,
-0.09711512178182602,
0.26008862257003784,
-0.4491725265979767,
0.13207513093948364,
-0.5663502216339111,
0.034129634499549866,
0.4276416301727295,
-0.49221205711364746,
-0.1000332683... | |
{
return false;
}
return Equals ( ( Point2 ) obj );
}
public bool Equals ( Point2 obj )
{
// STEP 1: Check for null if nullable (e.g., a reference type)
if ( obj == null )
{
return false;
}
// STEP 2: Check for ReferenceEquals if this is a reference type
if ( ReferenceEq... | [
-0.3725113868713379,
0.14639174938201904,
0.47862693667411804,
-0.3301956355571747,
-0.26726967096328735,
0.15422530472278595,
0.48595529794692993,
-0.5544593930244446,
0.13835228979587555,
-0.5513017177581787,
0.011827666312456131,
0.29586338996887207,
-0.5029261112213135,
-0.119554199278... | |
{
return true;
}
// STEP 4: Possibly check for equivalent hash codes
if ( this.GetHashCode ( ) != obj.GetHashCode ( ) )
{
return false;
}
// STEP 5: Check base.Equals if base overrides Equals()
System.Diagnostics.Debug.Assert (
base.GetType ( ) != typeof ( object ) );... | [
-0.014070700854063034,
-0.03165535256266594,
0.487942636013031,
-0.2797946631908417,
0.11404578387737274,
0.16830450296401978,
0.6754944920539856,
-0.6942421793937683,
0.01746967062354088,
-0.4450916349887848,
-0.026434987783432007,
0.40103763341903687,
-0.4140335023403168,
0.0673980414867... | |
)
{
return false;
}
// STEP 6: Compare identifying fields for equality.
return ( ( this.X.Equals ( obj.X ) ) && ( this.Y.Equals ( obj.Y ) ) );
}
```
Is that an overkill?
Supporting equality with an inheritance hierarchy is tricky. You need to work out exactly what you mean. Do you really need... | [
-0.11167434602975845,
0.1392575353384018,
0.1844649463891983,
0.013190047815442085,
0.006685423664748669,
-0.2014777511358261,
0.426259309053421,
-0.5073655843734741,
0.063897043466568,
-0.42464911937713623,
-0.050515614449977875,
0.4912799596786499,
-0.37167447805404663,
0.239423274993896... | |
bool Equals (object obj)
{
return Equals(obj as Point2);
}
public bool Equals (Point2 obj)
{
// STEP 1: Check for null if nullable (e.g., a reference type)
// Note use of ReferenceEquals in case you overload ==.
if (object.ReferenceEquals(obj, null))
{
return false;
}
// STEP 2: Ch... | [
-0.24956496059894562,
0.17867983877658844,
0.4798159599304199,
-0.24173158407211304,
-0.26990121603012085,
0.17278803884983063,
0.4698154032230377,
-0.3811044991016388,
0.02184011973440647,
-0.5849819779396057,
0.17425690591335297,
0.32575303316116333,
-0.5375362038612366,
-0.1039472147822... | |
// not worth it. If the later checks are costly, it could be.
if (object.ReferenceEquals( this, obj))
{
return true;
}
// STEP 4: Possibly check for equivalent hash codes
// Skipped in this case: would be *less* efficient
// STEP 5: Check base.Equals if base overrides Equals()
// S... | [
0.23890484869480133,
0.09320075809955597,
0.39293748140335083,
-0.1384330540895462,
0.05391843989491463,
0.034895334392786026,
0.5647118091583252,
-0.4828932583332062,
-0.05387312173843384,
-0.453574538230896,
0.1458326280117035,
0.4919823110103607,
-0.06973583251237869,
0.0294581111520528... | |
using == instead of Equals for brevity
// - assuming X and Y are of a type which overloads ==.
return this.X == obj.X && this.Y == obj.Y;
}
``` | [
-0.1735437661409378,
0.18242809176445007,
0.4256414473056793,
-0.030655527487397194,
0.18436671793460846,
0.03961363062262535,
0.3499409258365631,
-0.3047218322753906,
0.026042604818940163,
-0.42790061235427856,
-0.2826261818408966,
0.6629028916358948,
-0.39355573058128357,
0.1055572628974... | |
This might seem like a basic question and back to Http protocol 101. But I am having difficulty in understanding how Basic Authentication works. I am implementing a windows service and need it to be secure. I would like to obtain the user name and password and authenticate the user to a custom user store. I also want t... | [
0.23391565680503845,
0.2319278120994568,
0.25032931566238403,
-0.03574923425912857,
0.06565780192613602,
-0.3796240985393524,
0.30720067024230957,
-0.10856609046459198,
-0.13110844790935516,
-0.486798495054245,
0.1954798400402069,
0.5036894083023071,
-0.1252436339855194,
0.2681982517242431... | |
But, I don't want to have to do that every single time. Does basic authentication maintain if you are logged in, or is there a caching thread safe solution that I should explore.
Oh yeah I'd also like to make it so that when a user is authenticate and object is created and maintained in the thread for the listener to ... | [
0.24991321563720703,
0.22681394219398499,
0.2970849275588989,
0.03951883316040039,
-0.07059136033058167,
-0.4320726990699768,
0.4037211835384369,
0.29205647110939026,
-0.2672862410545349,
-0.4574783444404602,
0.0006087194778956473,
0.621636688709259,
-0.2811000645160675,
0.4790836274623871... | |
= ConfigurationManager.AppSettings["ListenerPrefix"];
HttpListener listener = new HttpListener();
listener.Prefixes.Add(uriPrefix);
listener.AuthenticationSchemes = AuthenticationSchemes.Basic;
listener.Start();
Console.WriteLine("Start listening on " + uriPrefix);
Console.WriteLine("Press Con... | [
-0.16203773021697998,
0.02197013609111309,
0.563668429851532,
-0.39278218150138855,
0.04120390862226486,
0.16118884086608887,
0.7575270533561707,
-0.8190783262252808,
-0.05080296844244003,
-0.3993559777736664,
-0.446774423122406,
0.7426499724388123,
-0.43831148743629456,
0.4332559108734131... | |
context.Response.SendChunked = false;
FileLogger.Level = LogLevel.Debug;
engine.IgnoreExceptions = false;
if (UserAutorized(context)) {
try {
engine.Run(context, listener.Prefixes);
engine.CommitTransaction();
} catch {
engine.RollBackTransaction();
... | [
-0.28839609026908875,
-0.38243594765663147,
0.6447365283966064,
-0.23323580622673035,
0.20891910791397095,
0.09956342726945877,
0.5898207426071167,
-0.3810943067073822,
-0.12742730975151062,
-0.1606176495552063,
-0.43559253215789795,
0.759546160697937,
-0.17821712791919708,
0.1024807840585... | |
engine.CloseConnection();
}
} else
context.Response.StatusCode = 401;
if (context.Response.StatusCode == 401)
ShowLoginDialog(context, context.Response);
try {
context.Response.Close();
} catch {
// client closed connection before the content was sent
}
}
p... | [
-0.3933030366897583,
-0.4670099914073944,
0.6824791431427002,
-0.2710244059562683,
-0.053762782365083694,
0.2195906788110733,
0.32473042607307434,
-0.2502581775188446,
-0.12153498083353043,
-0.3303109407424927,
-0.48836955428123474,
0.7684852480888367,
-0.49992993474006653,
0.0721353664994... | |
string username = identity.Name;
// workaround for Windows Vista Basic authentication. User name may be submitted in the following format: Machine\User.
int ind = username.LastIndexOf('\\');
if (ind > 0)
username = username.Remove(0, ind + 1);
Console.WriteLine("Trying Auth... | [
-0.2671383023262024,
0.05402948707342148,
0.3815879225730896,
-0.25257349014282227,
0.03195977210998535,
0.10485883057117462,
0.3734951913356781,
-0.3502641022205353,
0.20219047367572784,
-0.6709380745887756,
-0.27642181515693665,
0.41679269075393677,
-0.18764878809452057,
0.25621592998504... | |
Console.WriteLine("identity.IsAuthenticated: " + identity.IsAuthenticated.ToString());
return identity.IsAuthenticated;
}
}
```
**EDIT:** +1 for the document alone, that really opened my eyes to the caparison of authentication schemes and how they work. Unless I a readying this wrong, it does ... | [
-0.010848326608538628,
0.0622580461204052,
0.7389006018638611,
0.2100052684545517,
0.37612998485565186,
-0.31767502427101135,
0.3178013563156128,
0.05363000929355621,
0.2427956908941269,
-0.6615437269210815,
0.09564991295337677,
1.0513017177581787,
-0.1396033614873886,
-0.01837072707712650... | |
it was not spec related but rather a design/hosting issue. | [
0.2690831422805786,
-0.01349730882793665,
0.26917076110839844,
0.11864329129457474,
-0.02625555917620659,
-0.3827567994594574,
-0.2701232135295868,
0.006350427865982056,
0.14104332029819489,
0.0644359216094017,
0.0020371952559798956,
0.16735686361789703,
0.06694915145635605,
0.209643244743... | |
This code surprised me yesterday and I'm curious about what was going on.
If I refer to a Div element that I know is on the page in a Form, even copy/pasting the exact name, using getElementsByName the following could would not find it.
```
var coll = document.getElementsByName("txtState"); //coll will be null
```
... | [
0.042702436447143555,
0.18127761781215668,
0.5199804902076721,
-0.21300609409809113,
0.014289641752839088,
-0.14734478294849396,
0.4794193506240845,
-0.401927649974823,
0.007608511950820684,
-0.612511932849884,
-0.2913239598274231,
0.517250120639801,
-0.5146580338478088,
0.2656985223293304... | |
{
if (el.name.length > 0) {
if (el.name == "txtState") {
alert("Found");
}
}
}
}
```
So, what's up? Why is Javascript blind to getting the specific element? Why do I have to iterate over the collection?
From [here](http://www.aglasshalffull.org/css-resources... | [
0.48108139634132385,
0.19247989356517792,
0.3750414550304413,
-0.108055979013443,
0.1279582381248474,
-0.5391516089439392,
0.24471652507781982,
-0.3064294159412384,
-0.24441902339458466,
-0.276456356048584,
-0.2578471601009369,
0.3960966169834137,
-0.2503429055213928,
0.30737194418907166,
... | |
a few books and on the Internet: Contrary to what some have said, there is no legal way to use the name attribute from such tags as div or span, according to the W3C HTML 4.01 specs. You must confine the usage of this attribute to such tags as input, img, frame, iframe, form, map, param, meta, object, A, select, applet... | [
0.6590371131896973,
-0.06721554696559906,
0.4513297975063324,
0.10736341029405594,
-0.14058224856853485,
-0.5242213606834412,
0.27463820576667786,
-0.12920595705509186,
-0.22028286755084991,
-0.34932926297187805,
-0.3433051109313965,
0.28776440024375916,
-0.1764165461063385,
0.162402614951... | |
Can someone confirm that its **not** possible to change the height of a dropdown that is shown when you click on a select box.
The size attribute of the select makes it look like a list, the height attribute in the CSS doesnt do much good either.
Confirmed.
The part that drops down is set to either:
1. The height n... | [
0.14455296099185944,
-0.13607212901115417,
0.5788987278938293,
-0.06320375949144363,
0.2593073844909668,
-0.1626347154378891,
0.2429860383272171,
-0.41423192620277405,
-0.17968839406967163,
-0.5518072843551636,
-0.40654346346855164,
0.5711827278137207,
-0.12811410427093506,
-0.276682436466... | |
4
* 18 for Safari 5
* 11 in IE 5.0, 5.5
3. In IE/Edge, if there are no options, a stupidly high list of 11 blanks entries.
For (3) above you can see the results in this [JSFiddle](http://jsfiddle.net/c9Ltzwa5/) | [
0.32973000407218933,
0.17129388451576233,
0.4347456991672516,
-0.10330522805452347,
-0.17499889433383942,
-0.011158284731209278,
0.733801007270813,
-0.3612894117832184,
-0.3911607265472412,
-0.5502200722694397,
-0.06524881720542908,
0.4103822708129883,
-0.3614351153373718,
-0.1685870736837... | |
Is there an isnan() function?
PS.: I'm in [MinGW](http://en.wikipedia.org/wiki/MinGW) (if that makes a difference).
I had this solved by using isnan() from `<math.h>`, which doesn't exist in `<cmath>`, which I was `#include`ing at first.
According to the IEEE standard, NaN values have the odd property that comparison... | [
-0.21098430454730988,
0.005275401286780834,
0.05764319747686386,
-0.12450728565454483,
-0.187181755900383,
0.21072663366794586,
-0.0720759704709053,
-0.12039835005998611,
-0.11097322404384613,
-0.2217879295349121,
0.31156808137893677,
0.4231773018836975,
-0.0745018869638443,
-0.11392673850... | |
guarantee that it *will* work in practice. Check with your compiler, if in doubt. | [
0.736566424369812,
0.45923346281051636,
-0.24174194037914276,
-0.1398218721151352,
0.29185882210731506,
-0.2319261133670807,
0.47082212567329407,
0.35741591453552246,
0.06287126243114471,
-0.7479429244995117,
-0.23383788764476776,
0.6726484298706055,
0.18145306408405304,
-0.500138163566589... | |
I need to watch properties for changes. Which method is better in terms of performance and memory use: implementing `INotifyPropertyChanged` or using a `DependencyProperty`?
Note: Yes, I have read the other question [INotifyPropertyChanged vs. DependencyProperty in ViewModel](https://stackoverflow.com/questions/291518... | [
-0.12395866215229034,
-0.1269054114818573,
0.3078466057777405,
0.16037119925022125,
0.044542327523231506,
-0.16239705681800842,
0.15440142154693604,
-0.22803635895252228,
-0.27611684799194336,
-0.794368326663971,
0.1528673768043518,
0.8306647539138794,
-0.22278232872486115,
-0.104335762560... | |
ever, I would wager that INotifyPropertyChanged will be the perf winner as well.
Unless you have a defined reason for wanting/needing the behaviors provided by a DP I would just go with INotifyPropertyChanged.
**Update**
As the comment mentions binding performance is a bit faster for DPs (15-20% faster, but still on... | [
0.22443656623363495,
-0.3191932141780853,
0.8966568112373352,
0.4451087415218353,
-0.291913777589798,
-0.2541173994541168,
0.5331474542617798,
-0.39358219504356384,
-0.10013673454523087,
-0.9379693269729614,
0.17610126733779907,
0.5738707184791565,
-0.25485265254974365,
-0.0364134088158607... | |
correct either. So a few examples and alot of .NET Reflector digger later it looks... inconclusive. Both paths do a ton of work under the covers and I wasn't able to get any examples to show a definitive difference in update performance.
I still stick with INotifyPropertyChanged unless I have specific need for DPs, bu... | [
0.33261656761169434,
-0.07564099133014679,
0.3637065291404724,
0.27280938625335693,
-0.23119306564331055,
-0.2521219551563263,
0.32706862688064575,
0.07156384736299515,
0.0590418204665184,
-0.6244781613349915,
0.17524577677249908,
0.6612951159477234,
0.039892278611660004,
-0.08316146582365... | |
I have a `JObject` (I'm using Json.Net) that I constructed with LINQ to JSON (also provided by the same library). When I call the `ToString()` method on the `JObject`, it outputs the results as formatted JSON.
How do I set the formatting to "none" for this?
Call JObject's `ToString(Formatting.None)` method.
Alternati... | [
-0.19109663367271423,
0.07410655915737152,
0.3800278902053833,
-0.23242823779582977,
-0.05602641776204109,
-0.000669943168759346,
0.1265394240617752,
-0.0867902860045433,
-0.2912765443325043,
-0.5024725794792175,
-0.4022931456565857,
0.7421646118164062,
-0.4082545340061188,
-0.210191324353... | |
After switching from C++ to C++ w/boost, do you think your OOD skills improved?
Do you notice patterns in "Normal" C++ code that you wouldn't consider that you've switched, or do you find that it enables a more abstract design?
I guess I'm really wondering if you just use it as a tool, or if you change your entire a... | [
0.1681162714958191,
0.0873282253742218,
-0.07288525998592377,
0.15919235348701477,
-0.2993285357952118,
0.005378564354032278,
-0.10516124963760376,
0.04828629270195961,
-0.3686468005180359,
-0.2821354866027832,
0.05722340941429138,
0.5120130777359009,
0.00505662988871336,
-0.40584206581115... | |
my work on it before moving to a managed language) that it's harder to think in OO in C++ than a managed language.
From looking at these posts, I'm guessing that you learn the value of OO before finding a need for a better way to manage memory, so by the time you start looking for something like Boost, you're already ... | [
-0.26967853307724,
0.2420690804719925,
-0.0061438800767064095,
0.09991997480392456,
-0.0016441266052424908,
0.2379564493894577,
0.026026420295238495,
0.4472818970680237,
-0.1958983838558197,
-0.4142001271247864,
-0.13131175935268402,
0.6607668399810791,
0.13387927412986755,
-0.372680932283... | |
you wouldn't see the need for them (so you wouldn't have replied).
In a project in C++ I was doing about six years ago, we implemented our own boost-like automatic pointer scheme. It worked pretty well, except for the various bugs in it. (Sure wish we had used boost...)
Nonetheless, it really didn't change how we dev... | [
-0.15685707330703735,
0.1258053481578827,
0.06958507001399994,
0.2869888246059418,
-0.37658700346946716,
-0.08083154261112213,
0.15006044507026672,
0.22144268453121185,
-0.10967779904603958,
-0.3604430854320526,
0.29247671365737915,
0.8584352135658264,
-0.2868848443031311,
-0.4140324294567... | |
you design your application. Instead of passing a potentially dangerous memory leak around, you can pass that same data and be fairly certain that it's not going to leak.
In that respect, there are some things you can tend to do more with smart pointers: simplify your code. Instead of returning integers or basic struc... | [
0.5987079739570618,
0.07522811740636826,
-0.01432369276881218,
0.47482922673225403,
-0.0878644585609436,
-0.20911721885204315,
0.29699504375457764,
-0.0249310489743948,
-0.4182719588279724,
-0.7352011799812317,
-0.0027291413862258196,
0.6200124025344849,
-0.1973893791437149,
-0.13490231335... | |
using C or C++ if you didn't need it?) and have the ease of memory management that's such an amazing productivity boost. If automatically managed memory wasn't useful, it wouldn't be in almost every other language on the planet! | [
-0.016795800998806953,
0.1043642982840538,
-0.09689290821552277,
0.43567579984664917,
0.048269663006067276,
-0.07307546585798264,
0.14079882204532623,
0.1994541436433792,
-0.4285111427307129,
-0.4040517210960388,
-0.09872182458639145,
0.4930070638656616,
0.21775683760643005,
-0.12095786631... | |
I have a stored procedure that returns a valueI call it from other stored procedures that need to retrieve this value. The calling stored procedure is inside a transaction, the stored procedure that returns the value (and actually creates the value and stores it in a table that no other proc touches) is not inside its ... | [
0.08821450173854828,
0.28128576278686523,
0.2583869993686676,
-0.2101546823978424,
0.24934101104736328,
0.17821954190731049,
-0.2490575909614563,
-0.30576759576797485,
-0.050287578254938126,
-0.4354857802391052,
0.1413097232580185,
0.6599846482276917,
-0.2846459746360779,
0.181252270936965... | |
wondering if its very inefficient?
```
DECLARE @tmpNewValue TABLE (newvalue int)
INSERT INTO @tmpNewValue EXEC GetMyValue
DECLARE @localVariable int
SET @localVariable = (SELECT TOP 1 newvalue FROM @tmpNewValue )
```
Isn't there a more straight forward way of doing this? Isn't this an expensive (in terms of perform... | [
-0.2116168588399887,
0.026514289900660515,
0.37273088097572327,
0.14512565732002258,
-0.15594251453876495,
-0.053063493221998215,
0.3030216693878174,
-0.38213542103767395,
-0.27328914403915405,
-0.5644795298576355,
0.1529732346534729,
0.5963138341903687,
-0.436370849609375,
-0.032879676669... | |
I am building a state machine with windows workflow, and I am trying to new up an object from another assembly in my solution. When I build the solution, I get a TypeLoadException from the StateActivityValidator (which runs after a successful build to see that all the required properties are set and such).
The type I ... | [
0.11394265294075012,
0.3537041246891022,
0.007438361179083586,
-0.1424497812986374,
-0.029741555452346802,
-0.00389846065081656,
0.49488258361816406,
0.06293252855539322,
-0.08069650083780289,
-0.7905798554420471,
0.09221266955137253,
0.3790530562400818,
-0.3427104651927948,
0.325949639081... | |
I'm trying to make a GUI in java, but JMenuBar has been giving me a hard time for two days. Can someone please tell me why it isn't showing up?
```
import java.awt.*;
import javax.swing.*;
import javax.swing.JPanel;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import java.util.Arrays;
impor... | [
0.31411054730415344,
0.09820611029863358,
0.5595269799232483,
-0.3591247498989105,
-0.13429245352745056,
0.44887101650238037,
0.4105253219604492,
-0.6696944236755371,
-0.013022398576140404,
-1.0787813663482666,
0.03595464304089546,
0.5872886180877686,
-0.499660849571228,
-0.013286828063428... | |
JMenuBar createMenuBar()
{
JMenuBar menuBar;
JMenu m_file;
JMenuItem mi_save;
JMenuItem mi_load;
JMenu m_edit;
JMenuItem mi_tileHeight;
JMenuItem mi_tileWidth;
menuBar = new JMenuBar();
m_file = new JMenu("File");
m_edit = new JMenu("Edit");
mi_save = new JMenuItem("Save file", Key... | [
-0.4128081798553467,
-0.1797446310520172,
0.7507694363594055,
-0.5273432731628418,
0.15968437492847443,
0.26202157139778137,
0.4777587056159973,
-0.4714903235435486,
-0.3877931237220764,
-0.8561758399009705,
-0.8577179312705994,
0.6982355713844299,
-0.12891456484794617,
0.10242307186126709... | |
m_edit.add(mi_tileWidth);
return menuBar;
}
public static void main(String[] args) //run
{
selectionFrame sel = new selectionFrame();
sel.setLocationRelativeTo(null);
sel.setSize((int) 400 + (sel.getInsets().left + sel.getInsets().right),(int) 400 + (sel.getInsets().top + sel.getInsets().bottom));... | [
0.08513513207435608,
-0.1728910356760025,
0.7214387059211731,
-0.29525521397590637,
0.28465455770492554,
0.35684940218925476,
0.4909001290798187,
-0.5277051329612732,
-0.25817379355430603,
-0.8242518901824951,
-0.6794759631156921,
0.6224696040153503,
-0.41623541712760925,
0.279973149299621... | |
Font title;
>
> public SelectionFrame()
> {
> setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
> setJMenuBar(createMenuBar());
> }
>
> public JMenuBar createMenuBar()
> {
> JMenuBar menuBar;
> JMenu m_file;
> JMenuItem mi_save;
> JMenuItem mi_load;
> ... | [
-0.22569935023784637,
-0.11050360649824142,
0.4892033040523529,
-0.23023651540279388,
0.28040605783462524,
0.28784245252609253,
0.4259212911128998,
-0.30728963017463684,
-0.09308578819036484,
-0.7551490664482117,
-0.5831470489501953,
0.3476041853427887,
-0.12182005494832993,
0.304457545280... | |
JMenu m_edit;
> JMenuItem mi_tileHeight;
> JMenuItem mi_tileWidth;
>
> menuBar = new JMenuBar();
> m_file = new JMenu("File");
> m_edit = new JMenu("Edit");
>
> mi_save = new JMenuItem("Save file", KeyEvent.VK_S);
> mi_load = new JMenuItem("Load file", KeyEvent.... | [
-0.361034631729126,
-0.1604728251695633,
0.5115917921066284,
-0.3443366289138794,
0.49806439876556396,
0.39824455976486206,
0.5125175714492798,
-0.37794801592826843,
-0.23662765324115753,
-0.8387881517410278,
-0.6035648584365845,
0.5769497752189636,
-0.05172274261713028,
0.0769013240933418... | |
new JMenuItem("Set tile height",
> KeyEvent.VK_H);
> mi_tileWidth = new JMenuItem("Set tile width",
> KeyEvent.VK_W);
>
> menuBar.add(m_file);
> m_file.add(mi_save);
> m_file.add(mi_load);
>
> menuBar.add(m_edit);
> m_edit.add(mi_tileHeight);
> m... | [
-0.149545818567276,
-0.24248865246772766,
0.6909663081169128,
-0.26196274161338806,
0.27824899554252625,
0.28618648648262024,
0.3420313894748688,
-0.5150776505470276,
-0.2684862017631531,
-0.9953425526618958,
-0.6547123789787292,
0.4452858865261078,
-0.15984639525413513,
0.0807343050837516... | |
return menuBar;
> }
>
> public void main( String args[] )
> {
>
> SelectionFrame sel = new SelectionFrame();
> sel.setLocationRelativeTo(null);
> sel.setSize(400 + (sel.getInsets().left + > sel.getInsets().right), 400
> + (sel.getInsets().top + sel.getInsets().bottom));
>
... | [
0.03577728196978569,
-0.4091270864009857,
0.4567568302154541,
-0.13504564762115479,
0.0873459056019783,
0.48171958327293396,
0.28879767656326294,
-0.5038849711418152,
-0.18349634110927582,
-0.8350346088409424,
-0.4863722026348114,
0.35710182785987854,
-0.4665296971797943,
0.098353743553161... | |
sel.setFocusable(true);
>
> sel.getContentPane().add( new JLabel( "Content", SwingConstants.CENTER),
> BorderLayout.CENTER );
> sel.setLocation(sel.getX() - (sel.getWidth() / 2), sel.getY() - > (sel.getHeight() / 2));
> sel.setVisible(true);
>
> }
> }
>
> ```
That sh... | [
0.32623085379600525,
-0.2993980646133423,
1.0038328170776367,
-0.06747297197580338,
0.15574784576892853,
-0.13932408392429352,
0.15804259479045868,
-0.1472802460193634,
-0.18481172621250153,
-0.8044487237930298,
-0.7364720106124878,
0.28280913829803467,
-0.44250568747520447,
0.122653774917... | |
layout), the center automatically fills the whole content area, you don't have to resize anything.
This shows up as a window with a menu bar and everything works fine.
What platform are you doing this on? I'm on Vista, i get what i expect to see. | [
0.4178529977798462,
-0.45018666982650757,
0.4256879389286041,
0.41163182258605957,
0.2317645251750946,
-0.19717620313167572,
-0.07648000121116638,
0.294223427772522,
-0.19239842891693115,
-0.8498052954673767,
0.03165664151310921,
0.514067530632019,
-0.03495657444000244,
0.21410414576530457... | |
I am using C#.Net. I have textbox which allow only number, decimal and percentage(%) sign. I have the keycode for all number and decimal, but what is the "%" sign's keycode?
How can I check the `keydown` event for %?
Something like this:
```
private void yourControl_KeyDown(object sender, KeyEventArgs e)
{
if((e.K... | [
0.2636604905128479,
0.227853462100029,
0.36507731676101685,
-0.24731124937534332,
0.2637776732444763,
-0.06446519494056702,
0.3861834704875946,
-0.04509440064430237,
0.10514877736568451,
-0.7032871246337891,
-0.31299859285354614,
0.649063766002655,
-0.18543869256973267,
0.25210776925086975... | |
if(e.Shift)
{
// Handle '%'
}
else
{
// Handle '5' | [
0.039012372493743896,
-0.2686728537082672,
0.06954141706228256,
-0.43152207136154175,
0.16622282564640045,
0.22441990673542023,
-0.04405803233385086,
-0.18393683433532715,
0.028853198513388634,
-0.34563344717025757,
-0.38520413637161255,
0.5485295057296753,
-0.06905040889978409,
-0.1163999... | |
}
break;
// ...
}
}
```
You want to check that the key being pressed is the 5 key, and that it has been modified by pressing the shift key. | [
0.11123411357402802,
0.26163235306739807,
0.18758344650268555,
-0.25807884335517883,
0.593740701675415,
-0.3697375953197479,
0.0809686928987503,
-0.17422838509082794,
-0.1731126755475998,
-0.41553670167922974,
-0.44763877987861633,
0.7921786308288574,
-0.1389131247997284,
0.094090655446052... | |
How can I change the Amazon S3 url from <http://bucket.amazons3.com/imagepath.jpg> to <http://image.mydomain.com/imagepath.jpg>
EDIT:
Basically the whole reason for this is to hide the amazon s3 url from my users.
I was thinking about a HttpModule that would redirect the request from image.mydomain.com to bucket.ama... | [
0.5768763422966003,
-0.3444039225578308,
0.6408331394195557,
0.05303110554814339,
-0.42471733689308167,
0.08597497642040253,
0.2774644196033478,
-0.10960589349269867,
-0.23450762033462524,
-0.7711924910545349,
0.247686967253685,
0.21914854645729065,
-0.2316085547208786,
0.3880949914455414,... | |
image to the client as well fetch the image for S3.
I am not sure is there any S3 specific way to handle this.
Below is Amazon S3 specific way taken from [Amazon S3, CNAME record](http://5thirtyone.com/archives/1763)
> The average user may sign up for
> Amazon S3 hosting and begin uploading
> files - accepting th... | [
0.2679145038127899,
-0.29780313372612,
0.7744038701057434,
0.0353698655962944,
-0.5749544501304626,
-0.09095600247383118,
0.37775781750679016,
-0.16509440541267395,
-0.32490548491477966,
-0.846611738204956,
-0.089020736515522,
0.38589611649513245,
-0.1805620789527893,
-0.02669033780694008,... | |
to look
> as though they are being served from
> your own domain - virtual hosting. The
> easiest and most attractive method
> would be a hosted file URL that like
> this:
>
>
> <http://s3.your-site.com/some-file.txt>
> To get started, create a bucket on S3
> that you want as the root for your
> hosted files.... | [
0.21765150129795074,
-0.15539182722568512,
0.5353701710700989,
0.04554954543709755,
-0.18127423524856567,
-0.001108229043893516,
-0.006660806015133858,
0.05145657807588577,
-0.45071423053741455,
-1.1244093179702759,
0.09639675170183182,
0.11052572727203369,
-0.038579005748033524,
0.4151194... | |
DNS settings to take
> up to 24-48 hours to resolve. | [
0.06428205966949463,
-0.26500698924064636,
0.6114982962608337,
0.29286471009254456,
0.264213502407074,
-0.2645094394683838,
0.4282780885696411,
-0.07638738304376602,
-0.10468747466802597,
-1.1100751161575317,
-0.36719322204589844,
0.3872949481010437,
-0.10221406072378159,
-0.03615673631429... | |
Does null inherit from Object as well in C#?
Where does the null itself defined?
null is of the "null type", which does inherit from object.
See ECMA-334 11.2.7 | [
-0.058826059103012085,
-0.02500368095934391,
-0.3117167055606842,
-0.038026027381420135,
-0.17703081667423248,
-0.4908767342567444,
0.2715105712413788,
-0.09013139456510544,
-0.21740643680095673,
0.0021301889792084694,
-0.330715149641037,
0.33200863003730774,
-0.48084557056427,
-0.06693259... | |
I'm trying to write a string processing function in F#, which looks like this:
```
let rec Process html =
match html with
| '-' :: '-' :: '>' :: tail -> ("→" |> List.of_seq) @ Process tail
| head :: tail -> head :: Process tail
| [] -> []
```
My pattern matching expression against several elements is a ... | [
-0.0624147467315197,
0.1369612067937851,
0.3765751123428345,
-0.20242102444171906,
-0.3634655475616455,
-0.10611550509929657,
0.3595755994319916,
-0.22335223853588104,
-0.15647676587104797,
-0.7263453006744385,
0.15147191286087036,
0.48175960779190063,
-0.4300859570503235,
-0.1298930197954... | |
is, e.g., being able to write something like this:
```
match html with
| "-->" :: tail ->
```
I agree with others that using a list of characters for doing serious string manipulation is probably not ideal. However, if you'd like to continue to use this approach, one way to get something close to what you're asking ... | [
0.23036698997020721,
-0.26841479539871216,
0.48554831743240356,
-0.11611898988485336,
-0.2763175368309021,
-0.17857690155506134,
-0.017246363684535027,
-0.3700557351112366,
-0.3492090106010437,
-0.6661128401756287,
-0.44354546070098877,
0.3273411989212036,
-0.4051336348056793,
-0.419638603... | |
xs)
| _ -> None
```
Then you can use it like:
```
let rec Process html =
match html with
| Prefix "-->" tail -> ("→" |> List.of_seq) @ Process tail
| head :: tail -> head :: Process tail
| [] -> []
``` | [
-0.006019271910190582,
-0.2174796462059021,
0.8052814602851868,
-0.10466264188289642,
-0.1634453982114792,
-0.27217838168144226,
-0.0027363188564777374,
-0.4759960174560547,
-0.3478856682777405,
-0.649239182472229,
-0.1184832826256752,
0.2873041331768036,
-0.34862151741981506,
0.0316215343... | |
In a Rails application, I need a table in my database to contain constant data.
This table content is not intended to change for the moment but I do not want to put the content in the code, to be able to change it whenever needed.
I tried filling this table in the migration that created it, but this does not seem to... | [
0.03218620643019676,
0.008675620891153812,
-0.014502162113785744,
0.23209884762763977,
0.16724081337451935,
0.17221631109714508,
0.3397519588470459,
0.07742436230182648,
-0.12591169774532318,
-0.5936682820320129,
0.32661619782447815,
0.3853151202201843,
-0.48205479979515076,
-0.20369453728... | |
even in test environment ? Is there another way of handling these kind of data that should not be in code ?
**edit**
Thanks all for your answers and especially Vlad R for explaining the problem.
I now understand why my data are not loaded in test. This is because the test environment uses the `db:load` rake command ... | [
0.7495889067649841,
0.22514547407627106,
-0.045630812644958496,
0.5231446027755737,
-0.3070639967918396,
-0.26070085167884827,
0.535258412361145,
-0.13012924790382385,
-0.20781321823596954,
-0.6628508567810059,
0.06663075089454651,
0.48132258653640747,
-0.011507024057209492,
0.212737515568... | |
but loading db/schema.rb directly (db:load) instead.
You have two options:
1. continue to use the migration for production and development; for the test environment, add your constant data to the corresponding yml files in db/fixtures
2. leave the existing db/fixtures files untouched, and create another set of yml fi... | [
0.6397825479507446,
-0.3032718300819397,
0.5280464291572571,
0.2271800935268402,
-0.03858182206749916,
-0.21985898911952972,
0.03871183469891548,
-0.4318060576915741,
-0.039127614349126816,
-0.39996203780174255,
-0.030718693509697914,
0.7820484638214111,
-0.38443613052368164,
0.02401775866... | |
etc.) is create a drop-in rakefile in RAILS\_APP/lib/tasks to augment the db:load task by loading your constant intialization data from "seed" yml files (one for each model) into the database.
Use the db:seed rake task as an example. Put your seed data in db/seeds/.yml
```
#the command is: rake:db:load
namespace :db ... | [
0.30155670642852783,
-0.22521859407424927,
0.32077905535697937,
0.13146144151687622,
0.23972369730472565,
0.03682805225253105,
-0.30726882815361023,
-0.4887276291847229,
0.24112479388713837,
-0.661247968673706,
0.2688720226287842,
0.44722065329551697,
-0.29848065972328186,
0.24282577633857... | |
as the task defined above.
If your seed data ever changes, you will need to add another migration to remove the old seed data and load the new one instead, which may be non-trivial in case of foreign-key dependencies etc. | [
0.028712198138237,
-0.12308088690042496,
0.0006371863419190049,
0.12235414981842041,
0.47225722670555115,
-0.1930837333202362,
0.03038611076772213,
0.03107491508126259,
-0.2728486955165863,
-0.7072222828865051,
-0.06485573947429657,
0.45967403054237366,
-0.4122774302959442,
0.0860677659511... | |
I've got a 'git-svn' working tree. I'd like to clone a "pure" git repo off this, and then use git push/pull to move changes between the git-svn tree and the git tree, while also using 'git svn dcommit/rebase' to move changes between the git-svn tree and the SVN repo it's based on.
This seems to work okay as far as mov... | [
0.13543106615543365,
-0.2696666717529297,
0.44496119022369385,
-0.08551258593797684,
-0.1638210564851761,
0.4300328493118286,
-0.13556711375713348,
0.03949693590402603,
0.017605312168598175,
-0.6253190636634827,
0.07246257364749908,
0.5017955899238586,
-0.15428192913532257,
0.0772129148244... | |
trees, or I lose commits in the git-svn tree, or other oddness.
Is this type of SVN <-> git-svn <-> git workflow supported at all or should I just quit barking up this tree?
Based on what I've seen, this workflow isn't supported with git-svn, and won't be, due to the way SVN represents merges. | [
0.16524353623390198,
0.03626629337668419,
0.19780558347702026,
0.19756431877613068,
-0.002910659648478031,
-0.14179356396198273,
0.4853985905647278,
0.11073446273803711,
-0.36371853947639465,
-0.5346923470497131,
-0.013281719759106636,
0.5435875654220581,
-0.6200660467147827,
0.03947523236... | |
Are there any open source tools for building or designing houses? Does it have many features, like calculating costs or simulating extreme weather conditions/aging, etc?
I had the idea to start up a project like this, or join it; I think it would be really neat, but I couldn't find anything on it.
[Here](http://www.os... | [
0.7615147829055786,
-0.03798820823431015,
-0.05184004828333855,
0.4286194145679474,
0.13149702548980713,
-0.26714909076690674,
-0.12049121409654617,
0.41530805826187134,
-0.2943432927131653,
-0.4223162829875946,
0.08640482276678085,
0.27012166380882263,
-0.03549367934465408,
0.028959902003... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.