text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
m_MoneyBox.Focus();
m_MoneyBox.Text = "100";
m_TextBox.Focus();
Assert.That(m_MoneyBox.Amount, Is.EqualTo(100), "Amount isn't 100");
}
}
```
I get the exception(s) at the respective m\_MoneyBox.Focus() calls.
Solved - See Joseph's comments
I created a test case with exactly the same layo... | [
-0.03511624038219452,
0.26587530970573425,
0.2245967984199524,
0.004986560437828302,
0.26217928528785706,
0.4010581076145172,
0.25959548354148865,
-0.3478688597679138,
-0.118964284658432,
-0.3712804913520813,
0.08630288392305374,
0.5751350522041321,
-0.3556615710258484,
-0.0018761408282443... | |
reference exception.
In case you are interested, the sequence was [constructor called], [setup called], [test called], [tear down called]. The deconstruction never output anything to the screen for some reason.
My original thought was that the Controls property on myTestClass would not be initialized, but on my test... | [
0.24502421915531158,
-0.054930247366428375,
0.18328839540481567,
0.33121100068092346,
0.16117002069950104,
-0.19061356782913208,
0.17943085730075836,
0.15586914122104645,
-0.28305354714393616,
-0.32865339517593384,
0.09584759175777435,
0.539347231388092,
-0.3394761085510254,
0.049115505069... | |
I am building a SSRS 2005 report that has potentially multiple pages. I would like to put in a hyperlink so that it appears on the top of every page. The hyperlink links back to the same report - basically I have a "summary" and "detail" mode and want to have hyperlinks to switch between.
So far I tried two approach... | [
0.5330443382263184,
0.09621429443359375,
0.15853767096996307,
0.12773080170154572,
-0.2834487855434418,
-0.11260021477937698,
0.16895176470279694,
-0.10478829592466354,
-0.2857505679130554,
-0.6395602822303772,
0.2965548634529114,
0.3470008969306946,
-0.09698891639709473,
-0.24990969896316... | |
Now it appears on every page, but clicking on it results in an error message: "The source of the report definition has not been specified".
google turned up nothing, what now?
Thanks.
The best way to do this is to implement the summary report to drill-down into the detail report and use the data on the detail row o... | [
0.42661842703819275,
0.016018444672226906,
0.5819832682609558,
0.37599557638168335,
0.023795127868652344,
-0.20874738693237305,
-0.08319161087274551,
0.0516500286757946,
-0.3964036703109741,
-0.6669122576713562,
0.2156355082988739,
0.4616357386112213,
0.10072948783636093,
0.194045379757881... | |
1. Right-click the InvoiceNumber field in the detail row of the table and choose Properties
2. Click the Navigation tab
3. Click the Jump to report radio button and select the detail report from the drop down list
4. Click the Parameters button and fill in the parameter name and value - in this example, the parameter n... | [
0.06316154450178146,
0.14441296458244324,
0.7145216464996338,
0.08663161844015121,
-0.013136007823050022,
-0.11084385961294174,
0.2934255599975586,
-0.5138741731643677,
-0.05006667971611023,
-0.7039475440979004,
-0.12891164422035217,
0.9072831869125366,
0.030108148232102394,
0.107135303318... | |
visual indication that this is a hyperlink so I set the Color to MediumBlue
If you just want to link directly to the complete detail report from the summary report and vice versa, you can use the same style on navigation settings but this time do it on a textbox on the header row of your table and make sure that the h... | [
-0.11527033895254135,
-0.3139612674713135,
0.8025141954421997,
-0.018561042845249176,
-0.1745874285697937,
-0.3256880044937134,
0.40084946155548096,
0.6290504932403564,
-0.3337058424949646,
-1.0153406858444214,
0.01498307753354311,
0.7079786658287048,
-0.1487484723329544,
0.106524221599102... | |
I want to separate a string consisting of one or more two-letter codes separated by commas into two-letter substrings and put them in a string array or other suitable data structure. The result is at one point to be databound to a combo box so this needs to be taken into account.
The string I want to manipulate can ei... | [
0.2067701667547226,
-0.10190346837043762,
0.005193605553358793,
-0.0013257893733680248,
0.1686708629131317,
0.4414350986480713,
0.05615440756082535,
-0.20185771584510803,
-0.09260253608226776,
-0.5529714226722717,
-0.19329488277435303,
0.21462956070899963,
-0.42987415194511414,
0.165107458... | |
go.
So... what data structure would you recommend that I use and how would you implement it?
Definitely at least start with a string array, because it's the return type of `string.Split()`:
```
string MyCodes = "AB,BC,CD";
char[] delimiters = new char[] {',', ' '};
string[] codes = MyCodes.Split(delimiters, StringSpl... | [
0.07464245706796646,
-0.15723493695259094,
0.00406827125698328,
0.06240444257855415,
0.05795406177639961,
-0.02697286754846573,
0.20494750142097473,
-0.17578190565109253,
0.02303461916744709,
-0.646965742111206,
-0.28403279185295105,
0.6011542677879333,
-0.47530314326286316,
-0.06253246963... | |
C++ templates have been a blessing in my everyday work because of its power. But one cannot ignore the (very very very very long) compilation time that results from the heavy use of templates (hello meta-programming and Boost libraries). I have read and tried quite a lot of possibilities to manually reorganize and modi... | [
0.3388565182685852,
0.2951558828353882,
-0.25320306420326233,
0.10457222163677216,
-0.3635891079902649,
-0.24734923243522644,
0.2625463902950287,
0.08919768035411835,
-0.33286288380622864,
-0.6567164063453674,
0.11595786362886429,
0.7098120450973511,
-0.23964935541152954,
-0.14697608351707... | |
template interpretation to their previous versions.
My questions are :
* Is c++ template code so difficult to interpret that there is not much to optimize ? (i highly doubt that)
* Are there c++ compilers that truly optimize "c++ templates" interpretation ?
* Are there projects to develop a new generation of c++ comp... | [
0.4973523020744324,
-0.21499942243099213,
-0.10625722259283066,
0.11414226144552231,
-0.198659285902977,
-0.20564092695713043,
0.00829367060214281,
-0.27483972907066345,
-0.23090146481990814,
-0.7834384441375732,
-0.006680929102003574,
0.7440153956413269,
-0.4414375424385071,
-0.2533844411... | |
omit any template arguments which come from default template arguments." That could be considered a subtle modification, but it will have an enormous impact on development with c++ templates (ever heard of unreadable error messages... ? No more !)
* "Compilation time for code that uses templates should now scale linear... | [
0.4653705358505249,
0.12023917585611343,
0.10420215874910355,
-0.02926882542669773,
-0.10061917454004288,
-0.1855446696281433,
0.3743986487388611,
-0.13456517457962036,
-0.4451156556606293,
-0.37146469950675964,
-0.20285409688949585,
0.808297872543335,
-0.4945358335971832,
-0.0988099798560... | |
the bright side for now ! | [
0.1890982836484909,
-0.2880198061466217,
-0.22250483930110931,
0.20997761189937592,
-0.07452685385942459,
-0.4203121066093445,
0.06796655803918839,
0.748456597328186,
0.028769459575414658,
-0.3617683947086334,
0.06453186273574829,
0.6749820113182068,
0.26057595014572144,
-0.023303128778934... | |
I was wondering if anyone has some general sys admin questions on how best to setup MS SQL server for speed. I have placed the log files on a different drive with its own controller and moved the indexes to their drive but on the same controller as the main data files.
What other way can a system admin setup MS SQL se... | [
0.23961246013641357,
0.2843208312988281,
0.24490953981876373,
0.4124625623226166,
0.2210383266210556,
-0.10634247958660126,
-0.06110618636012077,
0.12986615300178528,
-0.30049172043800354,
-0.8734560608863831,
0.030096838250756264,
0.7005863785743713,
0.03126018866896629,
0.155069932341575... | |
machine is a dedicated DB server.
* If using 64 bit OS - even better. Much more RAM could be put to good use.
* Analyze indexes and application performance regularly. When needed, rebuild indexes, create new ones, delete old ones, etc.
* Learn the different types of indexes - Clustered, Partitioned, etc.
* When necessa... | [
-0.02399756945669651,
0.19797596335411072,
0.3652355670928955,
0.28012868762016296,
-0.03338329493999481,
0.13215255737304688,
0.3700643479824066,
-0.1734992265701294,
-0.2274954468011856,
-0.9628969430923462,
-0.10727933794260025,
0.5705679059028625,
-0.3010978102684021,
0.149250149726867... | |
I've been fighting the git/git-svn learning curve and last night, as part of that learning curve, I did something very, very bad. I've since gotten it corrected, but I'm hoping to understand the error my ways.
I have an svn repository from which I've cloned the trunk and branches (tags I ignored since we don't work on... | [
0.32516852021217346,
0.074464812874794,
0.25511038303375244,
-0.0984821692109108,
0.18946686387062073,
0.1647001951932907,
0.4288165867328644,
0.0596228763461113,
-0.3242245018482208,
-0.7243548035621643,
-0.09693755209445953,
0.5341882705688477,
-0.2853477895259857,
0.045597903430461884,
... | |
before getting pulled away for a few days. I cam back to it yesterday wanted to integrate any changes that had been made to the trunk so that I was working with the latest and greatest. What I did was a complete update of all brances first, via **git svn rebase** (no one else had worked on the feature1 branch). With ev... | [
0.3111731708049774,
-0.3020361363887787,
0.419026255607605,
-0.10990548133850098,
0.039332155138254166,
0.06880754232406616,
-0.00749947177246213,
0.07409780472517014,
-0.33387210965156555,
-0.5221982598304749,
0.06267857551574707,
0.5684943795204163,
-0.14550770819187164,
0.01183678582310... | |
I was very, very wrong. After merging all of the conflicts, I did a **git svn dcommit** and found that my changes had been applied to the trunk.
My first question is simply where was the core error in my thought process? My second is, after much reading and Googling, I see people espousing pulls, merges and rebases. G... | [
0.22322477400302887,
0.08481094986200333,
-0.1395556777715683,
0.18566550314426422,
0.17867405712604523,
0.15317076444625854,
0.2707284986972809,
-0.05742223933339119,
-0.340372771024704,
-0.4268890619277954,
0.030633870512247086,
0.38222187757492065,
-0.21468736231327057,
0.00508108828216... | |
syntax for rebase doesn't match your (very reasonable, IMO) expectations.
```
$ git checkout feature1
$ git rebase trunk
```
This sequence adds the unshared feature1 commits onto the HEAD of trunk, and you were expecting that it would place the new trunk commits onto the HEAD of feature1.
The syntax actually makes ... | [
0.17432864010334015,
0.08865312486886978,
0.4473259747028351,
-0.09072975069284439,
-0.17704936861991882,
-0.0010505253449082375,
0.2392711639404297,
0.01981430873274803,
-0.0841226726770401,
-0.5615144371986389,
-0.27692973613739014,
0.6732261180877686,
-0.5001115798950195,
-0.32019397616... | |
understand how to interact with the SVN repo using git-svn. So ignore what you found in Googling about push and pull and merge -- there's a lot of nearly right discussion by people who act as if push and pull and merge are the same in git and svn. Nearly right is still wrong. | [
-0.008873813785612583,
-0.19555439054965973,
0.1543876677751541,
0.3723299205303192,
-0.2360985428094864,
-0.11325448751449585,
-0.08776157349348068,
-0.04976898804306984,
-0.007226164452731609,
-0.5312100052833557,
0.005210544914007187,
0.6816428899765015,
-0.019648075103759766,
-0.178629... | |
Perfmon is a Windows utility that helps the developer to find bottlenecks in his applications, by measuring system counters.
I was reading a [perfmon tutorial](http://adminfoo.net/2007/04/windows-perfmon-top-ten-counters.html) and from this list of essential counters I have found the following ones on my machine:
1. ... | [
-0.06008463352918625,
-0.007444920018315315,
0.7093870639801025,
0.00698939710855484,
-0.2452666461467743,
0.4904945492744446,
0.13817158341407776,
-0.3733516037464142,
-0.3832891881465912,
-0.4404444396495819,
0.12089183181524277,
0.44118601083755493,
-0.034555815160274506,
0.125664189457... | |
perfmon counters](http://www.google.com/search?q=missing+perfmon+counters)" and you will find lots of people, on all versions of windows, that have encountered similar problems.
The fix is to follow the instructions found in [MS KB 300956](http://support.microsoft.com/kb/300956).
There are lots of other good resource... | [
-0.09228825569152832,
0.40922102332115173,
0.5140974521636963,
0.21003182232379913,
-0.22469459474086761,
0.24761487543582916,
0.33424192667007446,
-0.2905077338218689,
-0.462575227022171,
-0.271598219871521,
-0.019073300063610077,
0.3252749443054199,
-0.21449966728687286,
0.54296028614044... | |
Portuguese* to figure out which counters are the equivalent for the English ones you actually want, then I'm afraid I can't help you. Just use [Google Translate.](http://translate.google.com) | [
0.12749789655208588,
0.05093292519450188,
0.23491942882537842,
0.14765335619449615,
-0.055366840213537216,
0.11470102518796921,
0.391461044549942,
0.8575488924980164,
0.036414749920368195,
-0.5635156035423279,
0.25918686389923096,
0.5922669768333435,
0.07433641701936722,
-0.443529963493347... | |
I am using the ReportViewer control to render some local reports. These reports have some elements that are links to supreports. Some of these elements contain a lot of data ( to be passed as arguments to subreport). The problem is when i export the report to excel, it wont open in excel because of the cell max charact... | [
-0.011454285122454166,
0.3325803875923157,
0.41432568430900574,
0.16805224120616913,
-0.1707575023174286,
-0.15026283264160156,
0.4296148717403412,
0.07057155668735504,
-0.01144396886229515,
-0.6059419512748718,
0.037608373910188675,
0.4719085395336151,
-0.25975075364112854,
0.040433596819... | |
the winforms version of it, and there 2 possible solutions to this, one is to write your own renderer ( which was a overkill for this), and the other was to tweak the report definition
I loaded the report definition in an XmlDocument and removed all Action nodes from it, this would take out all the links, and then re ... | [
0.13317008316516876,
-0.20665733516216278,
0.2927955389022827,
0.06429378688335419,
-0.31505364179611206,
-0.23990826308727264,
0.15559956431388855,
-0.35236090421676636,
0.37510302662849426,
-0.7229238748550415,
0.2538834810256958,
0.7540473937988281,
-0.27874860167503357,
-0.361539661884... | |
I am trying to compile the code from here: <http://www.brackeen.com/javagamebook/#download> (Chapter 6) and am having trouble. I don't understand how `java.util.logging.Logger` and log4j work together, but that seems to be the issue. The errors I get are all on the `log.error()` or `log.warn()` method calls.
Here is ... | [
-0.13424016535282135,
0.2687985897064209,
0.15612709522247314,
-0.2562730014324188,
0.14807264506816864,
0.028271129354834557,
0.5546363592147827,
-0.31101301312446594,
-0.07023758441209793,
-0.8069692850112915,
-0.20268957316875458,
0.44877731800079346,
-0.34647032618522644,
0.17878918349... | |
^
C:\JB\NetBeansProjects\WRServer\src\com\hypefiend\javagamebook\server\GameServer.java:152: cannot find symbol
symbol : method warn(java.lang.String)
location: class java.util.logging.Logger
log.warn("error during serverSocket select(): " + ioe.getMessage());
^
C:\JB\NetBeansProject... | [
-0.3307510018348694,
0.09538227319717407,
0.23264500498771667,
-0.36879661679267883,
0.031074222177267075,
0.3916456401348114,
0.34718263149261475,
-0.39749079942703247,
-0.23066790401935577,
-0.6248269081115723,
-0.2016536295413971,
0.3208635151386261,
-0.4025239944458008,
0.0037934400606... | |
symbol
symbol : method error(java.lang.String)
location: class java.util.logging.Logger
log.error("no gamecontroller for gameNameHash: " + gameNameHash);
^
C:\JB\NetBeansProjects\WRServer\src\com\hypefiend\javagamebook\server\GameServer.java:203: cannot find symbol
symbol : method error(jav... | [
-0.46714335680007935,
0.15794964134693146,
0.25323691964149475,
-0.18851181864738464,
0.11334407329559326,
0.18936476111412048,
0.42544057965278625,
-0.5904496908187866,
-0.26672136783599854,
-0.573968231678009,
-0.26987266540527344,
0.20614904165267944,
-0.30988073348999023,
0.12870956957... | |
log.warn("class file does not extend GameController: " + file);
^
C:\JB\NetBeansProjects\WRServer\src\com\hypefiend\javagamebook\server\GameServer.java:238: cannot find symbol
symbol : method error(java.lang.String,java.lang.Exception)
location: class java.util.logging.Logger
log... | [
-0.17778345942497253,
-0.05562601238489151,
0.013571689836680889,
-0.05744180083274841,
0.20559732615947723,
-0.037807680666446686,
0.43395450711250305,
-0.35387271642684937,
-0.2165011465549469,
-0.5445622205734253,
-0.29278677701950073,
0.20759399235248566,
-0.15281178057193756,
0.248540... | |
with -Xlint:unchecked for details.
7 errors
BUILD FAILED (total time: 0 seconds)
```
Here is the code straight from the book. I have not tried to edit it yet.
```
package com.hypefiend.javagamebook.server;
import com.hypefiend.javagamebook.common.*;
import com.hypefiend.javagamebook.server.controller.*;
import jav... | [
0.11686550080776215,
-0.08281951397657394,
0.6843575835227966,
0.056192271411418915,
-0.16583825647830963,
-0.2031540423631668,
0.02867204137146473,
-0.42207419872283936,
-0.22740128636360168,
-0.9971825480461121,
-0.0364346019923687,
0.7460770606994629,
-0.28949570655822754,
0.15698602795... | |
ServerSocketChannel sSockChan;
/** selector for multiplexing ServerSocketChannels */
private Selector selector;
/** GameControllers keyed by GameName */
private Hashtable gameControllers;
/** classname prefix used for dynamically loading GameControllers */
private static final String CONTROLLER_CLASS_PREFIX =
"com.... | [
-0.3253673315048218,
-0.37642285227775574,
0.7717740535736084,
-0.05831505358219147,
0.18505510687828064,
0.03815239667892456,
0.06324983388185501,
-0.26974570751190186,
-0.3561493456363678,
-0.5491601228713989,
-0.4428637623786926,
0.6989588141441345,
-0.17649558186531067,
0.2322150468826... | |
our workers, etc.
*/
public void init() {
log.info("GameServer initializing");
loadGameControllers();
initServerSocket();
selectAndRead = new SelectAndRead(this);
selectAndRead.start();
eventWriter = new EventWriter(this, Globals.EVENT_WRITER_WORKERS);
}
/**
* GameServer specific initialization, bind to the ser... | [
0.04158293455839157,
-0.15612198412418365,
0.7884877324104309,
-0.2024332731962204,
0.3861882984638214,
0.36673179268836975,
0.3403409719467163,
-0.1743374466896057,
-0.3497392535209656,
-0.8930065035820007,
-0.2512752115726471,
0.49458441138267517,
-0.2510247528553009,
0.18715281784534454... | |
Selector.open();
// register the channel with the selector to handle accepts
SelectionKey acceptKey = sSockChan.register(selector, SelectionKey.OP_ACCEPT);
}
catch (Exception e) {
log.error("error initializing ServerSocket", e);
System.exit(1);
}
}
/**
* Here's the meat, loop over the select() call t... | [
0.3864971995353699,
-0.2828467786312103,
0.27742889523506165,
-0.18651090562343597,
0.10667543858289719,
0.03831520676612854,
0.22278167307376862,
-0.33453330397605896,
-0.18196120858192444,
-0.6591587066650391,
-0.06331943720579147,
0.8886899948120117,
-0.3361918330192566,
0.3497798144817... | |
for
// later additions such as listening on another port
// for administrative uses.
try {
// blocking select, will return when we get a new connection
selector.select();
// fetch the keys
Set readyKeys = selector.selectedKeys();
// run through the keys and process
Iterator i = r... | [
-0.0014681192114949226,
-0.4330655336380005,
0.6375143527984619,
-0.2485073059797287,
0.43763652443885803,
0.26550590991973877,
0.2564646899700165,
-0.7774976491928101,
-0.515453577041626,
-0.81561279296875,
-0.2974855303764343,
0.5039342045783997,
-0.25840747356414795,
0.49083688855171204... | |
i.remove();
ServerSocketChannel ssChannel = (ServerSocketChannel) key.channel();
SocketChannel clientChannel = ssChannel.accept();
// add to the list in SelectAndRead for processing
selectAndRead.addNewClient(clientChannel);
log.info("got connection from: " + clientChannel.sock... | [
-0.19791099429130554,
-0.4063536822795868,
0.723020613193512,
-0.25043416023254395,
0.2556074261665344,
0.1730508953332901,
0.40366023778915405,
-0.3222472369670868,
-0.23726174235343933,
-0.5910202264785767,
-0.19225597381591797,
0.5188850164413452,
-0.30354389548301697,
0.417341470718383... | |
catch (Exception e) {
log.error("exception in run()", e);
}
}
}
/**
* shutdown the GameServer
*/
public void shutdown() {
selector.wakeup();
}
/**
* Return the next available sessionId
*/
public synchronized String nextSessionId() {
return "" + nextSessionId++;
}
/**
* finds the GameController for a gi... | [
-0.050783026963472366,
-0.16692769527435303,
0.301820307970047,
-0.008799899369478226,
0.14725357294082642,
-0.14046983420848846,
0.05931004881858826,
-0.17101071774959564,
-0.4149157702922821,
-0.3617780804634094,
-0.6828758716583252,
0.6190605759620667,
-0.2939200699329376,
0.24452446401... | |
all class files in the same directory as GameController
String baseClass = "com/hypefiend/javagamebook/server/controller/GameController.class";
File f = new File( this.getClass( ).getClassLoader().getResource(baseClass).getPath());
File[] files = f.getParentFile().listFiles( );
if (files == null) {
log.error("erro... | [
-0.16609476506710052,
-0.6723537445068359,
0.8419275283813477,
0.06818225979804993,
0.4656451642513275,
-0.06691688299179077,
0.23161016404628754,
-0.35496750473976135,
-0.35159096121788025,
-0.4638690650463104,
-0.6724457740783691,
0.7782471776008606,
-0.4523135721683502,
0.28125208616256... | |
log.info("loading class: " + controllerClassName);
Class cl = Class.forName(controllerClassName);
// make sure it extends GameController
if (!GameController.class.isAssignableFrom(cl)) {
log.warn("class file does not extend GameController: " + file);
continue;
}
// get an instance... | [
-0.10414634644985199,
-0.24729163944721222,
0.6487974524497986,
0.16579337418079376,
0.37905141711235046,
-0.3118560016155243,
-0.15416143834590912,
-0.2705601453781128,
-0.14723919332027435,
-0.714215099811554,
-0.2875058352947235,
0.8151540756225586,
-0.2416204810142517,
0.27447131276130... | |
gc);
log.info("loaded controller for gameName: " + gameName + ", hash: " + gameName.hashCode());
}
catch (Exception e) {
log.error("Error instantiating GameController from file: " + file, e);
}
}
}
/**
* pass the event on to the EventWriter
*/
public void writeEvent(GameEvent e) {
eventWriter.h... | [
-0.4321875274181366,
-0.4544120132923126,
0.31729575991630554,
-0.16575215756893158,
0.18682217597961426,
-0.11909939348697662,
-0.11373863369226456,
-0.3484182059764862,
-0.24741658568382263,
-0.5682585835456848,
-0.6420043706893921,
0.7325069904327393,
-0.3324601650238037,
0.282099306583... | |
sessionId
*/
public static Player getPlayerBySessionId(String id) {
return (Player) playersBySessionId.get(id);
}
/**
* add a player to our lists
*/
public static void addPlayer(Player p) {
playersByPlayerId.put(p.getPlayerId(), p);
playersBySessionId.put(p.getSessionId(), p);
}
/**
* remove a player from our li... | [
-0.12546738982200623,
-0.12485494464635849,
0.620986819267273,
-0.2889936864376068,
0.027650415897369385,
-0.22395095229148865,
0.18813365697860718,
-0.19927747547626495,
-0.6716312766075134,
-0.6430261135101318,
-0.3564687967300415,
0.6568741798400879,
-0.5006407499313354,
0.3458617627620... | |
NOT contain any import of java.util.logging.Logger there. My guess is thus:
* You do not have log4j on the classpath of your project
* You or your IDE tried to somehow organize the imports automatically. This ended up adding java.util.logging.Logger to the imports because no other class of that name was found in proje... | [
0.578851044178009,
0.09605814516544342,
-0.07287485897541046,
0.04086187481880188,
0.02814299240708351,
-0.2757045328617096,
0.27551981806755066,
0.015967709943652153,
-0.35402393341064453,
-0.5598858594894409,
-0.3014329969882965,
0.3897859752178192,
-0.46208199858665466,
0.05173941701650... | |
Can someone point me in the direction to hook the DOM loaded event?
Basically, i want to display a loader while the dom is loading (I dont mean Ajax requests- the first time a user hits a page) ?
Thanks all in advance
All of the popular Javascript libraries have a "DOM loaded" event you can use for this.
Essential... | [
0.3028586506843567,
-0.15849851071834564,
0.38093996047973633,
-0.028647949919104576,
-0.18196310102939606,
-0.2079518586397171,
0.11607848852872849,
-0.3249877393245697,
-0.08274026960134506,
-0.5685012340545654,
0.1257205307483673,
0.5837370753288269,
-0.22403500974178314,
-0.11966608464... | |
<!-- rest of page -->
</body>
</html>
``` | [
0.2629295289516449,
0.38594895601272583,
0.7897664308547974,
0.07406589388847351,
-0.3259381055831909,
-0.12439151108264923,
0.10825663059949875,
-0.09761513024568558,
-0.21608854830265045,
-0.7573512196540833,
-0.3283529579639435,
0.25924304127693176,
-0.09538640826940536,
0.0065539255738... | |
I've installed PostgreSQL using MacPorts on a couple of different computers, no problem, but when it comes to my own laptop, I cannot get it to build.
When I do this command:
```
sudo port install postgresql83
```
I get this error:
```
checking test program... failed
configure: error:
Could not execute a simple te... | [
-0.10456912964582443,
0.45256662368774414,
0.3157518208026886,
-0.061681926250457764,
0.06398233771324158,
0.029045891016721725,
0.7556353211402893,
0.08315583318471909,
0.01916317082941532,
-0.9489855170249939,
-0.034948933869600296,
0.4532127380371094,
-0.2802591919898987,
0.137277707457... | |
do have the developer tools and what not installed and I have updated to the latest version of MacPorts and sync'ed my ports tree. I can install other things via MacPorts.
I've Googled in vain for details on what this means. Any suggestions? Thanks!
UPDATE: I *think* this is what is causing it to fail (from config.lo... | [
-0.015225843526422977,
0.4089568257331848,
0.4895395040512085,
-0.12921912968158722,
0.24465306103229523,
-0.2960636019706726,
0.6730422973632812,
-0.056921303272247314,
-0.02169112116098404,
-0.8613812923431396,
-0.13753287494182587,
0.8866185545921326,
-0.47589871287345886,
-0.0492885075... | |
Referenced from: /opt/local/lib/libxslt.1.dylib
Reason: image not found
```
This was not near the bottom of the config.log, it was at about line 700.
Despite the fact that I'd already upgraded libxml to the appropriate version (which has been a problem I've had to address previously when installing postgresql) it... | [
-0.02970363199710846,
0.27774128317832947,
0.8153620958328247,
-0.04680122435092926,
-0.10280166566371918,
0.0043777418322861195,
0.3918481469154358,
-0.04464142024517059,
0.025133822113275528,
-0.7307044267654419,
0.3310583531856537,
0.6136600375175476,
-0.42609965801239014,
0.09833062440... | |
I am playing around with getting some basic stuff to work in Python before i go into full speed dev mode. Here are the specifics:
```
Python 2.5.4
PyQt4 4.4.3
SqlAlchemy 0.5.2
py2exe 0.6.9
setuptools 0.6c9
pysqlite 2.5.1
```
setup.py:
```
from distutils.core import setup
import py2exe
setup(windows=[{"script" : "m... | [
0.3292892575263977,
0.017225302755832672,
0.5540814399719238,
0.0068751792423427105,
0.2241000235080719,
-0.2907770276069641,
0.40859586000442505,
-0.07835444062948227,
-0.1396140605211258,
-0.7165133357048035,
-0.3022187352180481,
0.7995311617851257,
-0.3374193012714386,
-0.17000359296798... | |
File "sqlalchemy\engine\url.pyc", line 91, in get_dialect
ImportError: No module named sqlite
```
I've been googling my heart out, but can't seem to find any solutions to this. If i can't get this to work now, my hopes of using Python for this project will be dashed and i will start over using Ruby... (not that there... | [
0.1395057737827301,
0.4219827353954315,
0.2355538308620453,
0.038150686770677567,
0.10522443056106567,
-0.371421754360199,
0.44539642333984375,
0.2460901141166687,
-0.10537780076265335,
-0.40332546830177307,
-0.12826943397521973,
0.5990325212478638,
-0.2881937623023987,
0.05547207593917847... | |
Is it worthwhile learning C# if you are a Linux user? There is Mono but it seems destined to always be behind the curve with the constant threat of MS action if they start to lose money.
Currently I am leaning more towards Java as its is fully GPLed and there are no major threats of software patents. It already has a ... | [
0.2774147093296051,
0.18032586574554443,
-0.10110250115394592,
0.2123175412416458,
-0.42672720551490784,
-0.17229889333248138,
0.29404976963996887,
0.31640902161598206,
-0.41106149554252625,
-0.27547019720077515,
0.19025124609470367,
0.7442598938941956,
0.04621744528412819,
0.0034577224869... | |
portable C# code is though. Can one simply take a C# app written to target Mono and run it on windows?
I've written a number of C# command-line programs, specifically to run as distributed simulation engines, that were targeted for Ubuntu. They work perfectly there or on Windows.
It's hard to say what the future holds... | [
0.4374888837337494,
0.38291507959365845,
-0.12519057095050812,
0.20346279442310333,
-0.3915070593357086,
-0.09618698805570602,
-0.014501940459012985,
0.14131158590316772,
-0.16161110997200012,
-0.5398871898651123,
0.05142581835389137,
0.7805182337760925,
-0.24811480939388275,
0.06201637908... | |
I think that their relationship with Microsoft adds some weight to the idea that .NET for Linux will stick around.
[Here's a list](http://www.mono-project.com/Companies_Using_Mono) of some of the companies using Mono. | [
1.017625093460083,
0.2467678189277649,
-0.48663151264190674,
-0.06584236770868301,
-0.16030023992061615,
-0.15657112002372742,
0.20261068642139435,
0.16929645836353302,
-0.23125876486301422,
0.07734163105487823,
-0.001295133144594729,
0.48735249042510986,
-0.18414296209812164,
0.1496343910... | |
I apologize for the newbie question, but I am struggling with this problem. I have the following TextBlock defined:
```
<TextBlock Text="{Binding Source={x:Static local:DeviceManager.Instance},
Path=Player.CurrentArtist}"></TextBlock>
```
The DeviceManager is a singleton that functions as a facade for other classes... | [
0.033051762729883194,
-0.008454718627035618,
0.7725199460983276,
-0.13141068816184998,
0.2281385064125061,
-0.40440991520881653,
-0.17960047721862793,
-0.33259594440460205,
-0.35006245970726013,
-0.7910769581794739,
0.026724861934781075,
0.8705546259880066,
-0.3987914025783539,
0.540600955... | |
not have an event handler attached to it.
Does anyone have a suggestion for how to update the text block while preserving the singleton-facade?
Here is the code for the INotifyPropertyChanged members in both the DeviceManager and the IPlayer subclass:
```
public sealed class DeviceManager : INotifyPropertyChanged
{... | [
-0.1463906168937683,
-0.41842275857925415,
0.288119912147522,
0.040038105100393295,
0.04271259158849716,
-0.2427271455526352,
-0.0478777177631855,
0.0186820887029171,
-0.310494601726532,
-0.5685447454452515,
-0.21990181505680084,
0.6058858036994934,
-0.3889172077178955,
0.19168463349342346... | |
this.player = value;
player.PropertyChanged += new PropertyChangedEventHandler(device_PropertyChanged);
}
}
#region INotifyPropertyChanged Members
public event PropertyChangedEventHandler PropertyChanged;
private void device_PropertyChanged(object sender, PropertyChangedEventArgs ... | [
-0.312091588973999,
-0.5858110189437866,
0.5148423314094543,
-0.12120760977268219,
0.45589810609817505,
-0.31847167015075684,
0.146352156996727,
-0.25612545013427734,
-0.23562289774417877,
-0.4717922508716583,
-0.608669638633728,
0.632111668586731,
-0.227208212018013,
0.7795892357826233,
... | |
}
}
#endregion
}
class MediaPlayer : IPlayer
{
private string artist;
private string title;
public event PropertyChangedEventHandler PropertyChanged;
public void Play(string artist, string title)
{
this.artist = artist;
this.title = title;
OnPropertyChanged("Playe... | [
0.1136796697974205,
-0.5377382636070251,
0.6704109907150269,
0.09832590073347092,
0.16785648465156555,
-0.04595644772052765,
0.0788753554224968,
-0.17167042195796967,
-0.13875766098499298,
-0.5933334231376648,
-0.4345625936985016,
0.7887712121009827,
-0.34214869141578674,
0.384546488523483... | |
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(p));
}
}
public string CurrentTitle
{
get { return title; }
}
public string CurrentArtist
{
get { return artist; } | [
0.22013849020004272,
-0.5986254215240479,
0.44809845089912415,
-0.003566751489415765,
0.47386446595191956,
-0.0310289915651083,
-0.007218880578875542,
-0.4594287872314453,
-0.11612193286418915,
-0.26986783742904663,
-0.18044675886631012,
0.8335875868797302,
-0.1311640739440918,
0.330900073... | |
}
}
```
The problem is that WPF is never notified of the value of the `CurrentArtist` property changing. You can either implement a private setter for the `CurrentArtist` property, which will trigger the `PropertyChanged` event, or trigger a `PropertyChanged` event for the `CurrentArtist` property in `MediaPlayer.Pla... | [
0.13947349786758423,
-0.5181756019592285,
0.5914033651351929,
0.11674407869577408,
0.46103155612945557,
-0.5963941216468811,
-0.10116242617368698,
0.13782614469528198,
-0.22239747643470764,
-0.6136404275894165,
-0.2622346878051758,
0.7911087274551392,
-0.4982023239135742,
0.349017173051834... | |
I want to delete records from a db table based on a time-stamp for each record. I would like to have it automatically delete records compared to a date/time interval without user intervention or admin intervention.
What would be the best way to go about this, I could create a process that runs in the background that ... | [
0.5792783498764038,
0.1019323393702507,
-0.13950015604496002,
0.11974325031042099,
0.23748475313186646,
-0.1530202329158783,
0.15215228497982025,
0.043751310557127,
-0.31850847601890564,
-0.5772537589073181,
0.12715397775173187,
0.5012528300285339,
-0.19291792809963226,
0.13324905931949615... | |
There is an easy to use wizard interface for job creation. | [
-0.006405515596270561,
0.188983753323555,
-0.01935630477964878,
0.1756126582622528,
-0.03349015489220619,
-0.3358730971813202,
0.10859142988920212,
0.18351005017757416,
-0.013517847284674644,
-0.579321026802063,
-0.2046068161725998,
0.5167325139045715,
0.07587972283363342,
0.11580339819192... | |
```
DECLARE @TestVal int
SET @TestVal = 5
SELECT
CASE
WHEN @TestVal <=3 THEN 'Top 3'
ELSE 'Other'
END
```
I saw this sample code online but I couldn't find an example where there was no expression and it had more than one WHEN, so I am wondering if this type of thing is OK:
```
DECLA... | [
0.16863742470741272,
0.002971435198560357,
0.10314597934484482,
-0.1517636626958847,
-0.015037521719932556,
-0.17853689193725586,
0.4007846713066101,
-0.4533841013908386,
-0.03987983986735344,
-0.5881386995315552,
-0.16740724444389343,
0.44914624094963074,
-0.19321754574775696,
-0.25751990... | |
WHEN (select ...) = 1 THEN 'Other Value'
WHEN (select ...) = 2 THEN 'Other Value 2'
ELSE 'Other'
END
```
Or do I need to say CASE WHEN for each line?
[Case](http://msdn.microsoft.com/en-us/library/ms181765.aspx) takes the following form
```
CASE WHEN Condition THEN Result
WHEN Condit... | [
-0.19431757926940918,
-0.2320774793624878,
0.3604854941368103,
-0.12829124927520752,
0.2571546733379364,
-0.06512950360774994,
0.2570127546787262,
-0.2048323005437851,
-0.04714694991707802,
-0.530367910861969,
-0.33929282426834106,
0.3165987730026245,
-0.3020631670951843,
0.189716756343841... | |
I am creating a sample C# project to demonstrate some patterns. Along with the project, I'd like to include a "Readme.mht" which contains an overview of the sample, some diagrams, and instructions for how to test it.
1. When the project is opened in Visual Studio, I would like this file to appear.
2. By default, MHT ... | [
0.6091338396072388,
-0.00305413780733943,
0.10479530692100525,
-0.05194535851478577,
-0.07599987834692001,
-0.5651170611381531,
0.23261034488677979,
-0.05396078899502754,
0.003980615641921759,
-0.7048106789588928,
-0.2345636785030365,
0.3025948405265808,
-0.22997628152370453,
-0.0614348202... | |
the following form
```
CASE WHEN Condition THEN Result
WHEN Condition2 THEN Result2
ELSE Default
END
```
Edit
====
This assumes your using Microsoft SQL Server other DBMS might be different | [
0.05740942806005478,
0.027700910344719887,
0.22138990461826324,
0.0006464006728492677,
-0.001997302984818816,
-0.4442693293094635,
0.30261459946632385,
-0.11727513372898102,
0.011182651855051517,
-0.5809656977653503,
-0.19005276262760162,
0.5374397039413452,
-0.1655646115541458,
0.26093789... | |
I am trying to learn how Hibernate works, and I am running into an almost unacceptable learning curve. I can't see how to get Hibernate to respect the auto\_increment policy for my objects. Instead, it is overwriting entries in the database with existing IDs, beginning with 1.
I have a simple `Foo` object, backed by a... | [
0.21343176066875458,
0.4828687310218811,
0.3778993785381317,
-0.3094441890716553,
-0.11611839383840561,
-0.11271766573190689,
0.26926538348197937,
-0.31951406598091125,
0.2168152630329132,
-0.45494723320007324,
0.128722682595253,
0.5230852365493774,
-0.452003538608551,
0.07326839119195938,... | |
like this:
```
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="fooId")
private Integer id;
```
I then execute some test code that simply instantiates Foo objects and saves them to the database (using `session.save(obj)`). It seems that it uses its own primary key sequence, beginning with one, and doe... | [
0.2597949504852295,
-0.000781858223490417,
0.08707717061042786,
-0.22390367090702057,
-0.16303357481956482,
-0.1810251921415329,
0.35275018215179443,
-0.18339461088180542,
-0.04697201028466225,
-0.5493475794792175,
0.1534351259469986,
0.5747494697570801,
-0.4137148857116699,
-0.00763927353... | |
suggest one. I am making prototypes, not long-lasting mondo-engineered projects.)
I believe you want `GenerationType.IDENTITY`. MySql does not use a table or sequence for generating the Id value. | [
0.27127549052238464,
-0.10100610554218292,
-0.02016301639378071,
0.14175623655319214,
0.07166650891304016,
-0.26721182465553284,
-0.20985154807567596,
-0.011773071251809597,
0.21130730211734772,
-0.6555777788162231,
0.3191314935684204,
0.1932833045721054,
-0.3403245806694031,
0.07621654123... | |
I need to salt and hash some passwords so that I can store them safely in a database.
Do you have any advice or ideas as to how best to do this using Linq To SQL?
LINQ to SQL doesn't have much relevance in this case. You could use any mechanism you want to, because you won't be doing hashing and salting in SQL.
The st... | [
0.34876278042793274,
0.3024495542049408,
0.2483050674200058,
0.24678562581539154,
0.16201546788215637,
-0.09418360888957977,
0.13977661728858948,
-0.2726760506629944,
0.2551138401031494,
-0.7715539336204529,
0.2055862694978714,
0.5718809366226196,
0.06036034971475601,
-0.0917433351278305,
... | |
Hash the resulting text with your hash function
5. Store the user ID, the hash and the salt in your DB.
The steps to verify a password would go along these lines:
1. Receive the password as cleartext, along with the user's ID.
2. Retrieve the hashed and the salt from the DB for the supplied user ID.
3. Combine the sa... | [
0.05309981107711792,
0.2973848581314087,
0.1928149163722992,
0.11881868541240692,
-0.26723721623420715,
0.020550189539790154,
0.4701184332370758,
-0.5710083842277527,
0.592602014541626,
-0.5955783128738403,
-0.117926225066185,
0.5346190333366394,
-0.04263369366526604,
0.050333764404058456,... | |
I know i can use `LogicalTreeHelper` class to find children node for every element searching it by name. But is there a possibility to find a child node by Type? For example, what if i would like to find a ListBox element in my Window without knowing its Name property??
LINQ to SQL doesn't have much relevance in this c... | [
0.18656055629253387,
0.12105831503868103,
0.19555020332336426,
0.43362006545066833,
0.2521062195301056,
-0.16646194458007812,
-0.001854997593909502,
-0.11893778294324875,
-0.06592506915330887,
-0.5314154028892517,
0.007446523290127516,
0.500918984413147,
-0.020088933408260345,
0.2041172981... | |
the salt.
3. Combine the salt with the password text, e.g. prepend it or append it.
4. Hash the resulting text with your hash function
5. Store the user ID, the hash and the salt in your DB.
The steps to verify a password would go along these lines:
1. Receive the password as cleartext, along with the user's ID.
2. R... | [
0.09320703893899918,
0.37614643573760986,
0.24143031239509583,
0.14254385232925415,
-0.19403991103172302,
-0.09687589108943939,
0.5346110463142395,
-0.6257438659667969,
0.5852888226509094,
-0.6025486588478088,
-0.09355256706476212,
0.4767281115055084,
-0.003138285130262375,
-0.013814754784... | |
are equal, the supplied password was correct. | [
0.19065725803375244,
0.43097150325775146,
0.5223268866539001,
0.3604947030544281,
0.1495814323425293,
0.075672946870327,
0.19182273745536804,
-0.3905298709869385,
0.1582343578338623,
-0.5684881806373596,
0.0704166442155838,
0.8088300824165344,
0.14810657501220703,
0.07081340998411179,
-0... | |
This is something i seeem to get a different answer for, every time i ask a developer. So i thought it would be a good question for the overflow to see what everyone does.
If you have a sqlClient.sqlconnection object, in the cleanup code (finally block etc) do you dispose of the object or do you set it to nothing, or ... | [
0.41498684883117676,
-0.05451498180627823,
0.04860277473926544,
0.2218458652496338,
0.1535464972257614,
-0.44618451595306396,
0.0020883658435195684,
0.0019421044271439314,
-0.3452540636062622,
-0.4749371111392975,
0.007374811451882124,
0.5228520035743713,
-0.21112951636314392,
0.2380647510... | |
soon as the SqlConnection object you declared in code goes out of scope, the GC will clean up that memory as well.
If you'd like to prod the GC, you can always call its .Collect() method. | [
0.3275372385978699,
-0.05704794451594353,
0.4779708981513977,
0.18026134371757507,
-0.07925759255886078,
-0.5166213512420654,
-0.050564635545015335,
0.08202453702688217,
-0.35053005814552307,
-0.19681434333324432,
-0.15281790494918823,
0.5832980275154114,
-0.2631835639476776,
0.14838342368... | |
**Summary:** The basic question here was, I've discovered, whether you can pass a code block to a Ruby array which will actually reduce the contents of that array down to another array, not to a single value (the way **inject** does). The short answer is "no".
I'm accepting the answer that says this. Thanks to Squeeg... | [
0.0956147164106369,
-0.0912465900182724,
0.20963861048221588,
-0.017648741602897644,
-0.3792707622051239,
0.168964222073555,
-0.024852965027093887,
-0.06803419440984726,
-0.38909927010536194,
-0.6066174507141113,
-0.0597245916724205,
0.21130292117595673,
-0.37304913997650146,
0.03203016892... | |
of positive or negative numbers. For instance, a -3 represents three consecutive negative numbers. A 2 represents two consecutive positive numbers.
Sample script:
```
original_array = (-10..10).to_a.sort{rand(3)-1}
original_array.reject!{|i| i == 0} # remove zero
streaks = (-1..1).to_a # this is a placeholder.
# ... | [
-0.11214229464530945,
-0.01177096925675869,
0.3208305239677429,
-0.2474244385957718,
0.10992893576622009,
0.5002298951148987,
0.29734572768211365,
-0.43025994300842285,
-0.4325505495071411,
-0.38226890563964844,
-0.0734114721417427,
-0.0392729789018631,
-0.43642663955688477,
0.244844496250... | |
sum of the original).
* The sum of the absolute values of the streak array is always 20.
Hope that's clear!
**Edit:** I do realize that such constructs as reject! are actually looping through the array in the background. I'm not excluding looping because I'm a mean person. Just looking to learn about the language. If... | [
0.22040586173534393,
-0.2127469778060913,
0.4235150218009949,
-0.3311741054058075,
-0.24381180107593536,
0.13797397911548615,
0.5530712604522705,
-0.5233249664306641,
-0.4440118968486786,
-0.374826043844223,
0.12099495530128479,
0.4119076430797577,
-0.4949975907802582,
-0.00987061019986867... | |
[-1, [-4, -6]], [1, [1]], [-1, [-10, -5]], [1, [7]], [-1, [-8]], [1, [9]], [-1, [-3, -7]], [1, [8, 10, 4, 2, 5]], [-1, [-2]], [1, [6]], [-1, [-1, -9]]]
```
This is almost exactly what OP asks for, except the resulting groups need to be counted up to get the final streaks array. | [
0.1969989687204361,
0.2065485566854477,
0.4087826907634735,
-0.21202199161052704,
0.2081424444913864,
0.44089779257774353,
-0.005311579909175634,
-0.14874599874019623,
-0.7801077961921692,
-0.35899707674980164,
-0.18421584367752075,
-0.01177295297384262,
-0.2668370008468628,
0.036872532218... | |
I'm having major problems getting Django working with my Apache configuration. I did not create the server, so I don't have too much leeway as to how the server works. Essentially there are three virtual hosts:
board.site.org, students.site.org and insider.site.org
The insider.site.org is the main one I'm concerned w... | [
0.2690785229206085,
0.16077087819576263,
0.21531715989112854,
0.11630420386791229,
0.0540056973695755,
-0.17659245431423187,
-0.21293281018733978,
0.31789493560791016,
-0.44113409519195557,
-0.5908629894256592,
0.2605874538421631,
0.3736669421195984,
0.409807413816452,
0.27928170561790466,... | |
insider.site.org's config looks like
insider.conf
```
LoadModule python_module /usr/lib64/apache2/mod_python.so
<VirtualHost 10.10.1.1:80>
ServerName insider.site.org
DocumentRoot /media/nss/VWEB/docs
<Directory /media/nss/VWEB/docs>
Options Indexes Multiviews
AllowOverride None
Order Allow,Deny... | [
-0.08248832076787949,
0.024249399080872536,
0.09794769436120987,
0.0861278846859932,
0.08413437008857727,
-0.25142762064933777,
0.2456962764263153,
-0.28842636942863464,
-0.02789418026804924,
-0.24772877991199493,
0.16499285399913788,
0.8787646889686584,
0.1313265860080719,
-0.037500519305... | |
</Directory>
Alias /media /srv/www/Media
<Directory /srv/www/Media>
SetHandler None
</Directory>
</VirtualHost>
```
* Note that when saying site.org, I'm referring to my site, not the actually "site.org" web address.
Now, it seems like that should be right to me, but for some reason, accessing <http:/... | [
-0.21634483337402344,
0.1729045957326889,
0.23342083394527435,
0.17344915866851807,
0.11331350356340408,
-0.021863996982574463,
0.3486812710762024,
-0.17816150188446045,
-0.32362452149391174,
-0.42661765217781067,
-0.2660806477069855,
0.5047298669815063,
-0.29530033469200134,
0.21958172321... | |
import\_module
> f, p, d = imp.find\_module(parts[i], path)
>
>
> ImportError: No module named index
Whereas <http://insider.site.org/tech> (no trailing forward slash) results in a 403 error. I do have Django in this directory, but it simply isn't getting executed (I have \_ *init* \_.py in all my directories under... | [
0.2704433500766754,
0.23213748633861542,
0.09770303964614868,
-0.13272418081760406,
-0.09541672468185425,
-0.13008350133895874,
0.4191668927669525,
0.055541373789310455,
-0.4169483780860901,
-0.6470566987991333,
0.08773418515920639,
0.8245055675506592,
-0.43302223086357117,
-0.041493922472... | |
specified? On my server, the list in my PythonPath includes the directory containing the top-level django directory, which itself contains the bin, contrib, admin, core, etc. directories, in addition to \_\_init\_\_.py. (Also make sure your Apache user has read and execute permissions for these files and directories, a... | [
0.33748385310173035,
0.23284420371055603,
0.32653841376304626,
-0.0809093713760376,
0.11618973314762115,
-0.08446580916643143,
0.14549346268177032,
-0.27740275859832764,
-0.14951303601264954,
-0.5261921286582947,
0.025141920894384384,
0.6319384574890137,
-0.3144480884075165,
0.066298924386... | |
like a problem for mod\_rewrite. See [here](http://httpd.apache.org/docs/2.0/misc/rewriteguide.html). You can let the server append the slash you need automatically by defining a rewrite rule:
```
RewriteEngine on
RewriteBase /~quux/
RewriteRule ^foo$ foo/ [R]
```
Hope that helps. | [
0.2181086391210556,
0.017686547711491585,
0.4218577444553375,
-0.22566571831703186,
0.09357507526874542,
-0.12253997474908829,
0.43515029549598694,
0.12273526191711426,
-0.09793476015329361,
-0.7182425260543823,
0.07160323858261108,
0.7313315868377686,
-0.32323363423347473,
0.0516122095286... | |
In python, a module doesn't *have* to have a main function, but it is common practice to use the following idiom:
```
def my_main_function():
... # some code
if __name__=="__main__": # program's entry point
my_main_function()
```
I know Ruby doesn't *have* to have a `main` method either, but is there some ... | [
0.27081745862960815,
0.09139332920312881,
-0.04730258136987686,
-0.42852315306663513,
-0.1897522211074829,
-0.5562613010406494,
0.5869093537330627,
0.04510020837187767,
-0.2730821669101715,
0.011259655468165874,
-0.37188196182250977,
0.5216522812843323,
-0.5185529589653015,
0.0802313387393... | |
entry point
import sys
sys.exit(my_main_function(sys.argv))
```
I usually use
```
if __FILE__ == $0
x = SweetClass.new(ARGV)
x.run # or go, or whatever
end
```
So yes, you can. It just depends on what you are doing. | [
-0.23006975650787354,
0.08705609291791916,
0.2633626163005829,
-0.1664326786994934,
0.21553419530391693,
-0.07602304965257645,
0.07559869438409805,
0.27155208587646484,
0.1899281144142151,
-0.7586915493011475,
-0.1951841413974762,
0.26205676794052124,
-0.09770210832357407,
0.18847990036010... | |
I need to get a value from an API I made with ASHX and normally it is called from javascript but I need to call it right in ASP.NET I figured this shouldn't be a problem but I'm not sure the syntax.
Well you have a couple options
1. You can refactor the code in your ASHX to be in a shared library so you can access the... | [
0.48172175884246826,
-0.18864566087722778,
-0.09207630902528763,
0.20287011563777924,
-0.660024881362915,
-0.12305602431297302,
0.34374260902404785,
-0.31831783056259155,
-0.04006686434149742,
-0.6363670229911804,
0.19114044308662415,
0.37391820549964905,
-0.3796307146549225,
-0.0661345943... | |
a few of the easy ways.
I personally like the first method because it promotes code reuse, but depending on scenario you can do what you like.
Edit to provide answers for question in comment.
Essentially Yes... Instead of having a bunch of code in your handler you make a class called something meaningful to you cont... | [
0.3688318133354187,
-0.40998345613479614,
-0.22890979051589966,
0.3633039593696594,
-0.4262048304080963,
-0.056817907840013504,
0.20391081273555756,
0.011225338093936443,
-0.09848184138536453,
-0.7852907776832581,
0.11185085773468018,
0.5152881741523743,
-0.4729371964931488,
-0.14306174218... | |
logic to run correctly. Do the same thing in your ASPX page. You can now call into an object that contains the logic from anywhere in your app instead of having it reside in the handler alone.
EX:
```
Public Class MyCommonLogic
Public Shared Function ReturnSomethingCommon(context As HttpContext) As String
... | [
0.12704433500766754,
-0.07933836430311203,
0.5452149510383606,
0.06514676660299301,
0.07795293629169464,
-0.12146054953336716,
0.5239107608795166,
-0.012182662263512611,
-0.0659010261297226,
-0.38637325167655945,
0.021339943632483482,
0.8434033989906311,
-0.38105738162994385,
0.11232613027... | |
in your scenario.
Changed code to VB sorry about that. | [
0.23634281754493713,
-0.2065461426973343,
-0.0866703987121582,
-0.06024664267897606,
0.16473521292209625,
0.06256386637687683,
0.5269283056259155,
0.42510443925857544,
-0.2616766691207886,
-0.666553258895874,
0.07793240249156952,
0.17576834559440613,
-0.38861599564552307,
0.026262259110808... | |
I'm curious as to whether or not there is a real difference between the `money` datatype and something like `decimal(19,4)` (which is what money uses internally, I believe).
I'm aware that `money` is specific to SQL Server. I want to know if there is a compelling reason to choose one over the other; most SQL Server sa... | [
0.2647482752799988,
0.36002928018569946,
0.04292258620262146,
0.3785996735095978,
0.04282688722014427,
0.06686803698539734,
-0.5019984841346741,
0.12683872878551483,
-0.30262356996536255,
-0.1423012912273407,
0.34833306074142456,
0.5298745632171631,
0.13502095639705658,
0.17947499454021454... | |
:)
Never ever should you use money. It is not precise, and it is pure garbage; always use decimal/numeric.
Run this to see what I mean:
```
DECLARE
@mon1 MONEY,
@mon2 MONEY,
@mon3 MONEY,
@mon4 MONEY,
@num1 DECIMAL(19,4),
@num2 DECIMAL(19,4),
@num3 DECIMAL(19,4),
@num4 DECIMAL(19,4)
... | [
0.5823061466217041,
0.23665662109851837,
0.13914430141448975,
-0.07697323709726334,
0.12375809252262115,
0.17333512008190155,
0.14277131855487823,
-0.12874442338943481,
-0.3254011571407318,
-0.3344067335128784,
0.09331637620925903,
0.7088049054145813,
-0.1284664124250412,
0.065152995288372... | |
SET @num4 = @num1/@num2*@num3
SELECT @mon4 AS moneyresult,
@num4 AS numericresult
```
Output: 2949.0000 2949.8525
To some of the people who said that you don't divide money by money:
Here is one of my queries to calculate correlations, and changing that to money gives wrong results.
```
select t1.index_id... | [
0.11066845804452896,
-0.259890079498291,
0.3770260810852051,
-0.0016563982935622334,
0.005758258514106274,
0.21410009264945984,
-0.24166196584701538,
-0.5386326909065247,
-0.5111123919487,
-0.40678438544273376,
-0.15304520726203918,
0.383003830909729,
-0.30452269315719604,
0.23138466477394... | |
join Table1 t2 on t1.Date = traDate
group by t1.index_id,t2.index_id
``` | [
-0.19850359857082367,
-0.022220885381102562,
0.4418504238128662,
-0.21954604983329773,
0.0872606709599495,
-0.10867935419082642,
0.03383578732609749,
-0.1655077487230301,
-0.2322411984205246,
-0.4880967438220978,
-0.3633638620376587,
-0.09958664327859879,
-0.34576350450515747,
0.3608965873... | |
What would be the best way to send/receive audio data over RTP using Java? I have read a little about [JMF](http://en.wikipedia.org/wiki/Java_Media_Framework), but it seems to be out of date. Are there are other viable alternatives.
[JMF](http://java.sun.com/javase/technologies/desktop/media/jmf/) is still the canonica... | [
0.533781886100769,
-0.030562972649931908,
0.6283566355705261,
0.1494801640510559,
-0.1948036104440689,
-0.5095621943473816,
-0.015156802721321583,
-0.1696557253599167,
-0.21642901003360748,
-0.7232241630554199,
-0.2317391335964203,
0.813247561454773,
-0.35581207275390625,
0.081626281142234... | |
I have a `byte[]` that is represented by an `Image`. I am downloading this `Image` via a `WebClient`. When the `WebClient` has downloaded the picture and I reference it using its URL, I get a `byte[]`. My question is, how do I load a `byte[]` into an `Image` element in WPF? Thank you.
*Note*: This is complementary to ... | [
0.52907395362854,
-0.1391088217496872,
0.5604435205459595,
0.15407928824424744,
-0.013702411204576492,
0.032356660813093185,
-0.18662992119789124,
-0.3384997248649597,
-0.2875749170780182,
-0.56160569190979,
-0.09013431519269943,
0.5645966529846191,
-0.2457093745470047,
-0.0183429028838872... | |
to make a `stream` from a `byte[]`, use a [`MemoryStream`](http://msdn.microsoft.com/en-us/library/system.io.memorystream.aspx):
```
MemoryStream stream = new MemoryStream(bytes);
``` | [
-0.04080958664417267,
-0.049112748354673386,
0.29532498121261597,
-0.014832347631454468,
0.12473281472921371,
0.14086617529392242,
-0.2245861291885376,
0.17715750634670258,
-0.10197676718235016,
-0.48097434639930725,
-0.2831224799156189,
0.27920904755592346,
-0.22123318910598755,
0.1405225... | |
C# 2.0 has a neat feature called anonymous functions. This is intended to be used mostly with events:
```
Button.Click += delegate(System.Object o, System.EventArgs e)
{ System.Windows.Forms.MessageBox.Show("Click!"); };
```
Now, suppose that Button is a static member, then adding delegates to it... | [
-0.15038904547691345,
-0.02737959288060665,
0.2436884492635727,
-0.11311079561710358,
-0.09298793971538544,
-0.27129828929901123,
0.012399944476783276,
-0.16887201368808746,
-0.33539867401123047,
-0.2365795075893402,
-0.11095811426639557,
0.569688081741333,
-0.6646056175231934,
0.123633734... | |
anonymous functions will not get deregistered automatically. You should make sure to do it yourself, if the event should not be hooked up for the whole lifetime of your application.
To do this, of course, you would have to store the delegate reference, to be able to de-register it.
Something like:
```
EventHandler h... | [
-0.06535526365041733,
-0.3215090036392212,
0.09461206942796707,
0.10663166642189026,
0.05033804476261139,
-0.3203752040863037,
0.30488625168800354,
-0.20000240206718445,
-0.35770168900489807,
-0.28975263237953186,
-0.175784170627594,
0.4239397943019867,
-0.7049874067306519,
0.0629576966166... | |
With the following:
```
this.AcceptButton = this.OKButton;
this.OKButton.Enabled = false;
```
... will the OK button click handler still be invoked when the user presses Enter?
No, it won't be invoked. | [
-0.1385013312101364,
0.10699418187141418,
0.5706580877304077,
-0.3984834551811218,
0.36603856086730957,
0.06057406961917877,
0.43928587436676025,
-0.1149505227804184,
-0.18407224118709564,
-0.37384721636772156,
-0.543335497379303,
0.639958918094635,
-0.6032624840736389,
0.06521540880203247... | |
I have no experience writing batch scripts, but I was wondering if there was a way to install a .NET Windows service using `installutil.exe` using such a script, or uninstall the service if it is already installed, ideally with some kind of confirmation that I actually would like to perform the uninstall (e.g. press y ... | [
0.6751601099967957,
-0.011088925413787365,
0.3100271224975586,
-0.14781060814857483,
0.15060316026210785,
-0.10032546520233154,
0.42108821868896484,
0.17291034758090973,
-0.02534029819071293,
-0.7587413787841797,
-0.2697490453720093,
0.6490653157234192,
-0.12692177295684814,
0.077042818069... | |
(we'll call it `program.log`, also in this directory) after the service has been installed
* The machine is running Windows Server 2003 with the .NET Framework installed in the default directory `C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727`
If you feel this could be done in a better way it would be nice to hear othe... | [
0.17178961634635925,
0.08817966282367706,
0.4412529766559601,
-0.036151397973299026,
-0.14590582251548767,
-0.06160047650337219,
0.4547555446624756,
-0.09332071244716644,
-0.09915672987699509,
-0.5406774282455444,
-0.11165005713701248,
0.8107990026473999,
-0.20148229598999023,
0.1427746415... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.