text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
}
void VerticalScrollBar_VisibleChanged(object sender, EventArgs e)
{
VerticalScrollBar.Visible = true;
}
}
``` | [
0.07222480326890945,
-0.2167724072933197,
0.5721718668937683,
-0.2612236738204956,
0.18175478279590607,
0.02001047134399414,
0.48339706659317017,
0.15126602351665497,
-0.2496255338191986,
-0.42391273379325867,
-0.27050092816352844,
0.6205160021781921,
-0.25878870487213135,
0.08935000002384... | |
I created a utility function to return the expected single item from an generator expression
```
print one(name for name in ('bob','fred') if name=='bob')
```
Is this a good way to go about it?
```
def one(g):
try:
val = g.next()
try:
g.next()
except StopIteration:
... | [
-0.1391359120607376,
-0.18277649581432343,
0.15494941174983978,
-0.01459506805986166,
-0.08883156627416611,
0.2625455856323242,
0.2273612916469574,
-0.28733086585998535,
-0.1411622315645218,
-0.3698284327983856,
-0.2985485792160034,
0.5674234628677368,
-0.4901687502861023,
-0.1312617659568... | |
raise Exception('Too many values')
except StopIteration:
raise Exception('No values')
```
A simpler solution is to use tuple unpacking. This will already do everything you want, including checking that it contains exactly one item.
Single item:
```
>>> name, = (name for name in ('bob','fred') if name=='... | [
-0.26522138714790344,
0.3427232503890991,
0.1318652629852295,
-0.0876801609992981,
0.014548706822097301,
0.11254337430000305,
0.23113353550434113,
-0.3010585606098175,
-0.7803511023521423,
-0.4201158285140991,
-0.2845851480960846,
0.19614705443382263,
-0.1542608141899109,
0.176424622535705... | |
call last):
File "<stdin>", line 1, in <module>
ValueError: need more than 0 values to unpack
``` | [
-0.1296985149383545,
-0.1831498146057129,
0.5000122785568237,
-0.22752603888511658,
0.2840256094932556,
0.06005740910768509,
0.23899635672569275,
-0.5885413885116577,
-0.1645027995109558,
-0.3878271281719208,
-0.33911389112472534,
0.4108542799949646,
-0.22180534899234772,
0.022407637909054... | |
Is there a free/open source BAR GRAPH (2d) component or sample file for Flash cs3/cs4
I found a few options for Actionscript2, but I need to use actionscript 3.0
(its preferred to load data from external source, loadvars or similar)
<http://teethgrinder.co.uk/open-flash-chart/> | [
0.15177571773529053,
0.14793267846107483,
-0.07863525301218033,
-0.06639416515827179,
-0.3152082562446594,
0.04966196417808533,
0.07565262913703918,
0.0456475205719471,
-0.0958649143576622,
-0.21278026700019836,
0.12180635333061218,
0.55087810754776,
-0.1687551885843277,
-0.191912710666656... | |
What is the best continuous integration setup for a Devleopment department that codes in multiple environments?
At my company we write some code in C# and some in Java, I've previously used CC.Net but I've never done CInt with Java.
I'm aware of Continuum and was recently told about Hudson, but I've never used either... | [
0.3621569275856018,
-0.2996312379837036,
0.16205696761608124,
0.11998797953128815,
0.3211040496826172,
0.07606732100248337,
-0.2853414714336395,
0.21239539980888367,
-0.16306598484516144,
-0.7430586814880371,
0.5997263193130493,
0.8678992986679077,
-0.048712730407714844,
-0.025063725188374... | |
I know I've seen this done before but I can't find the information anywhere. I need to be able to route with .html extensions in the Zend Framework.
I.E. /controller/action.html should route to the appropriate controller / action.
We have an idea to throw away the .html extension with our .htaccess file but I think c... | [
0.2366211861371994,
-0.26297417283058167,
0.362804651260376,
0.03734971955418587,
-0.10532364994287491,
-0.16339567303657532,
0.021992262452840805,
-0.48276346921920776,
-0.24397170543670654,
-0.5266688466072083,
0.027638616040349007,
0.5608558058738708,
-0.08418870717287064,
0.00328991026... | |
I am trying to get an element using JQuery's selector, but it does not find it even though the element actually exists. Moreover, I can actually find the element using getElementById.
For example:
$('#outputDiv') gives me a null value. But document.getElementById("outputDiv") returns me the Div I was trying to access... | [
0.25078651309013367,
-0.11740544438362122,
-0.08556541055440903,
-0.03100406564772129,
-0.23433683812618256,
-0.18033674359321594,
0.31366342306137085,
-0.04657299444079399,
-0.050889115780591965,
-0.533094048500061,
0.05095110833644867,
0.5166149139404297,
-0.3741435706615448,
0.242717489... | |
How can I convert a `List<MyObject>` to an `IEnumerable<MyObject>` and then back again?
I want to do this in order to run a series of LINQ statements on the List, e. g. `Sort()`
```
List<string> myList = new List<string>();
IEnumerable<string> myEnumerable = myList;
List<string> listAgain = myEnumerable.ToList();
``` | [
0.050845563411712646,
0.03421530872583389,
0.4207157790660858,
-0.17782370746135712,
-0.008603082969784737,
0.006192376837134361,
0.20128889381885529,
-0.35242760181427,
-0.19124838709831238,
-0.7191051244735718,
-0.21155044436454773,
0.4800386130809784,
-0.2749630808830261,
-0.02044526115... | |
I just tested which type of code is executed by the WinForms Designer in VS 2008.
It seems that the designer is not executing the default constructor anymore.
I added a simple thing like this.Text = "foo"; nothing is changed in the designer.
Did I miss a change between VS 2005/2008? (or SP1)
tia
You don't mention if... | [
0.22293947637081146,
-0.04967978224158287,
0.27441516518592834,
-0.22380200028419495,
0.17693381011486053,
0.01695597730576992,
0.2617165446281433,
-0.11174868792295456,
-0.37457478046417236,
-0.36434465646743774,
0.2670542001724243,
0.8667580485343933,
-0.5032699108123779,
-0.013652498833... | |
Is there a POSIX function that will give me the size of a directory (including all sub-folders), roughly equivalent to "`du -s somepath`"?
```
$ man nftw
```
> **NAME**
>
>
> `ftw`, `nftw` - file tree walk
>
>
> **DESCRIPTION**
>
>
> `ftw()` walks through the directory tree
> that is located under the director... | [
-0.18897303938865662,
-0.29958370327949524,
0.48738956451416016,
-0.2666723430156708,
0.09765838086605072,
0.12058798223733902,
-0.048924706876277924,
-0.26637935638427734,
-0.565283477306366,
-0.5531625151634216,
-0.21928374469280243,
0.4948708117008209,
-0.18931950628757477,
-0.160643368... | |
total = 0;
int sum(const char *fpath, const struct stat *sb, int typeflag) {
total += sb->st_size;
return 0;
}
int main(int argc, char **argv) {
if (!argv[1] || access(argv[1], R_OK)) {
return 1;
}
if (ftw(argv[1], &sum, 1)) {
perror("ftw");
return 2;
}
printf("%s: ... | [
0.0036631308030337095,
-0.3408161401748657,
0.5701184868812561,
-0.5707857608795166,
-0.15605098009109497,
0.5260735750198364,
0.4326208829879761,
-0.4832924008369446,
-0.37687036395072937,
-0.3128110468387604,
-0.2846715450286865,
0.48262548446655273,
-0.4181385636329651,
0.27109292149543... | |
Their roadmap says their next release will be in March 2009, and that they'll be adding a new 'runtime language'. I'm hoping its either Java or PHP but realy not sure, and would like to know which language is the most probable so i can plan accordingly for a project I plan on hosting with google app engine.
Any ideas?... | [
0.10207048058509827,
0.22256684303283691,
0.5051658749580383,
-0.1452665477991104,
-0.13835103809833527,
0.18082359433174133,
0.47489723563194275,
0.468237966299057,
-0.17179174721240997,
-0.7131109237670898,
-0.16223807632923126,
0.4801577627658844,
-0.19422386586666107,
-0.14703482389450... | |
run on Linux
Sandboxable
-----------
The language must be safe to run on Google servers. Portions of the language/VM/modules|libraries must be able to be disabled and/or replaced.
Controllable
------------
Notice how Google uses languages that are not controlled by companies?
Python's BDFL GvR works for Google.
Dun... | [
0.48416703939437866,
0.02231355756521225,
0.15030741691589355,
0.004696217831224203,
-0.11929960548877716,
-0.47076261043548584,
0.18979308009147644,
0.31772497296333313,
-0.07507266104221344,
-0.280787855386734,
-0.3624161183834076,
0.8933929800987244,
-0.6087449193000793,
-0.348276823759... | |
and powerful. The new language would have to have significant differences with python, otherwise, why not just use Python. Maybe a very functional language?
Appeal to massive scalability
-----------------------------
Execution time would not be necessarily critical, but the language must be able to support easy start... | [
-0.1884598731994629,
0.14457200467586517,
0.26041853427886963,
0.20126311480998993,
-0.016951603814959526,
-0.25701165199279785,
0.08728380501270294,
-0.025324152782559395,
-0.10936200618743896,
-0.6163285970687866,
-0.22941622138023376,
0.7380143404006958,
-0.027826884761452675,
0.0612372... | |
for editing and managing on these platforms.
Linux
-----
Google servers would run the programs, so these must be able to be safely transferred on google servers and run there, and must be able to be controllable by the Google App Engine load-balancer, so they need to be unixy.
Brainstorming
-------------
I don't th... | [
-0.07229918986558914,
0.13062559068202972,
0.03919625282287598,
0.3209342658519745,
-0.0777222141623497,
-0.2271355241537094,
0.014312013052403927,
-0.06194191426038742,
-0.23696964979171753,
-0.6395525932312012,
-0.08405167609453201,
0.8190218806266785,
-0.5491557717323303,
-0.53142833709... | |
hard-to-learn part.
So something else.
Remember though that they want adoption of the tool, and they need a language that would be adoptable by a lot of people and a lot of businesses.
So I lean to C# with mono. I think that makes the most sense. I know it sounds scary but lately the developers of the language are ... | [
0.6082722544670105,
0.08103029429912567,
-0.22576864063739777,
0.08531893789768219,
-0.22178348898887634,
-0.23446786403656006,
0.11446425318717957,
0.1564588099718094,
-0.1547287553548813,
-0.3043298125267029,
-0.20151744782924652,
1.0982648134231567,
-0.27374744415283203,
-0.068036906421... | |
of April 2008), and I guess Miguel de Icaza can be hired by Google in the future, along with key team members.
So my prediction is C#. | [
0.12303508818149567,
0.21582478284835815,
0.7042776942253113,
0.24898940324783325,
0.24992263317108154,
-0.13646340370178223,
0.060211893171072006,
0.412312388420105,
-0.06044958531856537,
0.023336894810199738,
0.1548902988433838,
0.3493425250053406,
0.1414230465888977,
0.23275312781333923... | |
How do you ensure that your applications in production are up and running?
How do you alert your team of developers if something goes wrong?
I'm asking this because I'm writing a bash script to check for this issue, I'd like to know if there is a smarter or more complete way to achieve this.
The idea behind is this co... | [
0.6019076108932495,
0.2906964123249054,
0.07814336568117142,
0.005154156591743231,
0.10334472358226776,
-0.3082221746444702,
0.3988015353679657,
0.026422828435897827,
-0.3088359236717224,
-0.5122650861740112,
0.007456882391124964,
0.7496880292892456,
-0.3763805031776428,
0.1200881972908973... | |
the list of the team it belongs to.
All my applications are running on Apache Tomcat.
Tomcat can typically be monitored via JMX; as can be seen from this [documentation](http://tomcat.apache.org/tomcat-5.5-doc/monitoring.html). This will normally be the cleanest way to monitor, since this can be integrated into a numb... | [
0.7021395564079285,
-0.08104059100151062,
0.3492627441883087,
-0.08306556940078735,
-0.07118336856365204,
-0.331417053937912,
0.6673066020011902,
0.005827595479786396,
-0.39550018310546875,
-0.32283321022987366,
-0.1043035164475441,
0.7468414902687073,
-0.16609066724777222,
-0.286030262708... | |
you to install agents that do this and integrate into the total monitoring scheme. There are a number of [open source jmx tools](http://java-source.net/open-source/jmx) | [
0.7803995609283447,
-0.20401550829410553,
-0.11071358621120453,
0.1526772677898407,
-0.09823128581047058,
-0.5250710248947144,
0.3310316801071167,
0.043013740330934525,
-0.25659117102622986,
-0.3970118761062622,
0.05585668981075287,
0.6781052350997925,
-0.24447788298130035,
-0.517921566963... | |
EIMI being an explicit interface member implementation. So instead of:
```
public int SomeValue{get;}
```
you have
```
int SomeInterface.SomeValue {get;}
```
I'm currently considering using one as i'm using an internal interface (to decouple, yet restrict) and I don't want to make the methods on the implementing ... | [
-0.12813711166381836,
-0.03133990615606308,
-0.04219197481870651,
0.03632426634430885,
-0.19038783013820648,
-0.2660607397556305,
0.21789643168449402,
-0.008802898228168488,
0.28561216592788696,
-0.9533360600471497,
-0.14157934486865997,
0.7501027584075928,
-0.5431532859802246,
-0.12022464... | |
a class or struct. This is particularly useful when a class or struct implements an internal interface that is of no interest to a consumer of that class or struct.
> * Explicit interface member implementations allow disambiguation of interface members with the same signature. Without explicit interface member implemen... | [
-0.05320780724287033,
0.02326078899204731,
0.006506771314889193,
0.3482687771320343,
-0.24254316091537476,
-0.10085396468639374,
0.20518764853477478,
-0.2459915727376938,
-0.10173222422599792,
-0.72175133228302,
-0.19482947885990143,
0.25403958559036255,
-0.4604940712451935,
0.086327686905... | |
In the example below I have a ListBox with dozens of font names in it.
I would have thought it would automatically have a vertical scrollbar on it so that you can select ANY font, not just the first ones in the list, but it doesn't.
So I added a "ScrollViewer" and that puts a "scrollbar area" on the right but there i... | [
-0.0273677296936512,
0.08076605200767517,
0.4918590486049652,
-0.10883043706417084,
-0.07125040888786316,
0.12611033022403717,
-0.045364826917648315,
-0.5114216208457947,
-0.36756250262260437,
-0.6991429328918457,
-0.06971873342990875,
0.6537426710128784,
-0.21854731440544128,
-0.063708722... | |
<RowDefinition Height="2*"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<ScrollViewer>
<ListBox Grid.Row="0" Name="lstFonts" Margin="3" ItemsSource="{x:Static Fonts.SystemFontFamilies}"/>
</ScrollViewer>
</Grid>
</StackPanel>
``... | [
-0.3341965973377228,
-0.1828877031803131,
0.7928206324577332,
-0.1667719930410385,
-0.1597888320684433,
0.25670143961906433,
0.016210604459047318,
-0.557929277420044,
-0.32343894243240356,
-0.6982083320617676,
-0.1965431571006775,
0.44298112392425537,
-0.10990626364946365,
0.11657255887985... | |
scrollbar in your ListBox, use the ScrollBar.VerticalScrollBarVisibility attached property.
```
<ListBox
ItemsSource="{Binding}"
ScrollViewer.VerticalScrollBarVisibility="Visible">
</ListBox>
```
Setting this value to Auto will popup the scrollbar on an as needed basis. | [
-0.006004261318594217,
-0.13192330300807953,
1.1183987855911255,
-0.3718610107898712,
-0.08236300200223923,
-0.04347934201359749,
0.18082404136657715,
-0.12508215010166168,
-0.20817255973815918,
-0.7844535708427429,
-0.21041914820671082,
0.549799919128418,
-0.20560523867607117,
0.054600950... | |
what select statement would I use to add the excel spreadsheet to an existing table, as i am getting an error trying to create a new table on the database? please can you assist me.
Thanks
Set `neon-debug-mask` in the `[global]` section of your [subversion `servers` config file](http://svnbook.red-bean.com/en/1.7/svn.a... | [
-0.10196170210838318,
-0.0012040665606036782,
0.26639944314956665,
0.09477467834949493,
-0.2176295667886734,
0.10554879903793335,
0.09653179347515106,
-0.04064556211233139,
-0.28952962160110474,
-0.5553768873214722,
0.0751066505908966,
0.7888703346252441,
-0.25937581062316895,
-0.270642459... | |
you've configured in your svn permissions file*.
[Note: I haven't actually had to do this since around SVN 1.3, I assume it still works similarly.] | [
0.3773500919342041,
-0.08694907277822495,
0.3046795725822449,
0.04706074669957161,
0.38830286264419556,
-0.515024721622467,
0.4353138208389282,
0.10783829540014267,
-0.4918028712272644,
-0.6197026968002319,
-0.30808860063552856,
0.6781026124954224,
-0.17233382165431976,
0.01070440933108329... | |
I have two controllers for two respective models, by example, photos and categories. index and show methods are very similar in each controller, and the views are identical. What is the best method for share the view by the two models?
I've though two options:
* Use a helper. In the helper will put the code for the v... | [
0.5942801833152771,
-0.2936641275882721,
0.3457375168800354,
0.3551131784915924,
-0.06652228534221649,
0.1242932677268982,
-0.3654046058654785,
-0.11287889629602432,
-0.18000394105911255,
-0.7947655320167542,
0.45641693472862244,
0.4909885823726654,
-0.1718595027923584,
0.36851567029953003... | |
two models, each one at and exposes a @photo object (photos controller with all the photos, and categories controller with just the selected categorie's photos) and I need one view to show both.
I'm looking for an elegant solution for this, complaining REST and DRY principes. Any idea?
Thanks in advance.
I have a sim... | [
0.39372050762176514,
-0.3587990403175354,
0.563511073589325,
0.40252378582954407,
-0.05468374118208885,
0.036619435995817184,
-0.11304116994142532,
-0.1808885931968689,
-0.05592974275350571,
-0.5752496719360352,
0.2960616648197174,
0.5292136669158936,
-0.19505169987678528,
0.11795301735401... | |
(the developers) did was create a new directory in `app/views` called `shared` and put shared views in there. These could be full template files or just partials.
I would suggest using a shared template (in neither categories nor photos view directories, but rather in the shared directory) and rendering it manually fr... | [
0.6990621089935303,
0.07151075452566147,
0.2725318372249603,
0.2460048347711563,
-0.07410070300102234,
-0.0627148225903511,
-0.028185075148940086,
-0.20940940082073212,
-0.06954494118690491,
-0.9335072636604309,
0.07323528081178665,
0.347700834274292,
-0.40474188327789307,
0.06286565214395... | |
when using a more-or-less empty view in each controller's view directory just to include a shared partial, as I understand your question is suggesting. | [
0.22195693850517273,
-0.09865465760231018,
-0.08174067735671997,
0.33587390184402466,
0.12782876193523407,
-0.0999249666929245,
-0.23544801771640778,
0.1855907440185547,
-0.17083556950092316,
-0.5372940301895142,
-0.025142492726445198,
0.2935121953487396,
-0.15109142661094666,
0.1725237816... | |
I create a plugin which includes the following folder structure:
* src
* native/so/libsystemcommand.so
* META-INF/MANIFEST.MF
The manifest include the command
```
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Commands Plug-in
Bundle-SymbolicName: de.system.commands;singleton:=true
Bundle-Version: 1.0.... | [
0.18854230642318726,
-0.29596924781799316,
0.5991640090942383,
-0.0816287249326706,
-0.08028947561979294,
-0.0528448149561882,
0.2277836799621582,
-0.6361070871353149,
-0.08572520315647125,
-0.6855356693267822,
-0.4053241014480591,
0.39343908429145813,
-0.5044388771057129,
-0.0027590619865... | |
in java.library.path
```
Do I have to set more attributes in the plugin? Do I have to unzip some informations on the target platform?
**EDIT:**
```
java.library.path=/opt/jdk/j2re1.4.2_16/lib/i386/client:/opt/jdk/j2re1.4.2_16/lib/i386:/opt/jdk/j2re1.4.2_16/../lib/i386::/opt/dsa/lib:/opt/dsa/lib
```
I think i found... | [
-0.009178757667541504,
0.1112159863114357,
0.34636881947517395,
0.12505796551704407,
-0.03282510116696358,
-0.1614435762166977,
0.27994582056999207,
-0.48584574460983276,
-0.0809762105345726,
-1.0010863542556763,
-0.2131337970495224,
0.6923076510429382,
-0.30105820298194885,
-0.03409697487... | |
everything without the file
```
<installation>/eclipse/configuration/config.ini
``` | [
0.6652064919471741,
0.1990233212709427,
0.32497721910476685,
0.06299034506082535,
0.10457558929920197,
-0.4104347825050354,
0.11575301736593246,
0.06055733934044838,
-0.40603819489479065,
-0.19242781400680542,
-0.5662845373153687,
0.741180419921875,
-0.296062171459198,
0.1817074418067932,
... | |
As a mostly self-taught programmer, I have never really had anyone explain why certain things should or should not be used. One example (which I picked up years ago and use quite often) is the alternative control structure syntax:
```
x = (y == true) ? "foo" : "bar";
```
I personally find this syntax easy to follow,... | [
0.5683515667915344,
0.5596429109573364,
-0.2842442989349365,
-0.2846906781196594,
-0.10991902649402618,
-0.4003259241580963,
0.3545134365558624,
0.156296044588089,
-0.013945591636002064,
-0.08405376970767975,
-0.16361528635025024,
0.6418755650520325,
-0.664411723613739,
0.00468055298551917... | |
can only give you my opinion, without any special authority behind it.
I find that the ternary conditional operator (?:) is perfectly acceptable when you're using it for an expression with no side-effects. As soon as you start using it to represent a decision to do something vs. do something else, you're (in my opinio... | [
0.2528214454650879,
-0.16704624891281128,
-0.2797289192676544,
0.3232082426548004,
-0.133403018116951,
0.005492291413247585,
0.28519514203071594,
-0.02370920591056347,
0.05290188640356064,
-0.3175342381000519,
-0.2275170385837555,
0.6212977170944214,
-0.3623761832714081,
-0.251772850751876... | |
At my place of work I've been put in charge of creating a coding standards document. Generally we follow what FxCop and StyleCop tools report to some degree but what we really require is document that will explain when to use a convention, why and maybe even a simple example.
This could be extended in the future for o... | [
0.9292805790901184,
0.10201042145490646,
0.032755084335803986,
0.17320749163627625,
0.0422658734023571,
-0.15255428850650787,
-0.2266702502965927,
-0.04409576207399368,
-0.049101315438747406,
-0.6388033628463745,
0.2704891860485077,
0.6032741069793701,
0.03424888849258423,
-0.2358965873718... | |
engine should be in C# so we're able to tweak it to our needs if required.
If you think a wiki solution is the wrong way to go about this then please give an alternative :)
---
**Update**
I've just been informed, although we do have a php server it wont be staying, so I'm afraid php-based wiki ideas are off the tab... | [
-0.0018028626218438148,
0.009977360256016254,
0.5821518301963806,
0.09683741629123688,
-0.01992202363908291,
-0.10657591372728348,
-0.05907003581523895,
0.023365970700979233,
-0.2318437695503235,
-0.3738398551940918,
-0.019776174798607826,
0.7466849684715271,
-0.20524391531944275,
-0.10180... | |
works without any database. It has [several plugins](http://www.screwturn.eu/UsersPlugins.ashx#Users_Storage_Providers_32) to work with Active Directory. | [
0.07556204497814178,
0.024778226390480995,
0.32925236225128174,
0.054424699395895004,
0.24703073501586914,
-0.1754627823829651,
0.2770536243915558,
0.10261473804712296,
-0.12013529986143112,
-0.31542420387268066,
-0.130492702126503,
0.09683264791965485,
-0.5514841079711914,
0.1148642972111... | |
How do you compare a value from jQuery with a fixed number?
I thought this might work but it doesn't:
```
if (parseInt($("#days").value) > 7) {
alert("more than one week");
}
```
if #days is an input then you need .val() instead of value
e.g.
```
if (parseInt($("#days").val()) > 7) {
... | [
0.3740387558937073,
-0.14487388730049133,
0.4482881724834442,
-0.028150223195552826,
0.19478486478328705,
-0.04714880883693695,
0.12338816374540329,
0.034313276410102844,
-0.5246121287345886,
-0.4463779926300049,
-0.3357415199279785,
0.6356388926506042,
-0.2602693736553192,
0.0799277275800... | |
I need to create an SQL query to insert some data into a table based on the results of a SELECT query into a local variable. My DB platform is MySQL 5.1, but I don't think that should make a difference here. Basically, what I want to do is:
```
SELECT id INTO var_name FROM table1 WHERE some_column='something' LIMIT 1;... | [
0.06245885044336319,
0.2608664035797119,
0.1732388138771057,
-0.20747002959251404,
-0.03184095397591591,
-0.09235022962093353,
0.17746637761592865,
-0.30192434787750244,
0.2709289789199829,
-0.6068627834320068,
0.29574114084243774,
0.4017908275127411,
-0.24103067815303802,
0.30583700537681... | |
only that there is an error on the SELECT line. What am I doing wrong?
Try
```
INSERT INTO table2 (`number`)
SELECT id FROM table1 WHERE some_column='something' LIMIT 1
``` | [
0.13247457146644592,
0.3104825019836426,
0.12286390364170074,
-0.2508789598941803,
0.2465393841266632,
-0.17293472588062286,
0.27363356947898865,
-0.17798618972301483,
-0.08872094750404358,
-0.4952360689640045,
0.16674470901489258,
0.5304874181747437,
-0.10074520111083984,
-0.1837026029825... | |
Can someone please help me out with printing the contents of an IFrame via a javascript call in Safari/Chrome.
This works in firefox:
```
$('#' + id)[0].focus();
$('#' + id)[0].contentWindow.print();
```
this works in IE:
```
window.frames[id].focus();
window.frames[id].print();
```
But I can't get anything to w... | [
0.3680720031261444,
0.23853474855422974,
0.507577121257782,
-0.07780283689498901,
-0.04681260883808136,
-0.20257405936717987,
0.07027515769004822,
-0.14369690418243408,
-0.2524383068084717,
-0.9900087714195251,
-0.09520094841718674,
0.4571950435638428,
-0.5025331974029541,
-0.0422219485044... | |
I have an Excel spreadsheet of data like:
```
ColumnA ColumnB
33 11
25 5
6 4
```
What i would like to do is add a third column which shows the ratio of columnA to columnB in the format of A:B. For example:
```
ColumnA ColumnB Ratio
33 11 3:1
25 5 5:1
6 4 | [
-0.013452047482132912,
0.5096312165260315,
0.4743443727493286,
-0.3021117150783539,
-0.48854145407676697,
0.3795868754386902,
-0.05496075376868248,
-0.4099636375904083,
-0.11526966094970703,
-0.6244525909423828,
0.24508631229400635,
0.36654728651046753,
-0.31392738223075867,
-0.14491660892... | |
3:2
```
Does anyone know of a way to achieve this?
Thanks in advance.
You are looking for the greatest common divisor (GCD).
You can calculate it recursively in VBA, like this:
```
Function GCD(numerator As Integer, denominator As Integer)
If denominator = 0 Then
GCD = numerator
Else
GCD = GCD(denomina... | [
-0.2101520597934723,
0.24979647994041443,
0.5153813362121582,
-0.13540121912956238,
-0.5101688504219055,
0.04870886355638504,
-0.0282864049077034,
-0.6563612818717957,
-0.1635819375514984,
-0.40577009320259094,
-0.03554863855242729,
0.16174745559692383,
-0.516916811466217,
-0.0119620356708... | |
B1/GCD(A1; B1)
2 25 5 =A2/GCD(A2; B2) & ":" & B2/GCD(A2; B2)
```
It is recommendable to store the result of the function call in a hidden column and use this result to avoid calling the function twice per row:
```
ColumnA ColumnB ColumnC ColumnD
1 33 11 =GCD(A1; B1) =A1... | [
-0.19324254989624023,
0.28058165311813354,
0.16291746497154236,
-0.5556530952453613,
-0.11098730564117432,
0.4446336328983307,
0.2815779745578766,
-0.6368693709373474,
-0.31929874420166016,
-0.1694905310869217,
-0.30830687284469604,
0.438737154006958,
-0.43267109990119934,
-0.1906848549842... | |
5 =GCD(A2; B2) =A2/C2 & ":" & B2/C2
``` | [
-0.08059673756361008,
-0.06166737154126167,
0.2855718433856964,
-0.47379928827285767,
0.04286298155784607,
0.12489461153745651,
0.26409754157066345,
-0.6201006770133972,
-0.4650481343269348,
-0.20837430655956268,
-0.3421837091445923,
0.33232441544532776,
-0.17415295541286469,
0.22428692877... | |
I've played with boost::pool a few times in places where it seemed to me I was seriously hammering the heap with a lot of object "churn". Generally I've used `boost::object_pool`, or `boost::pool_alloc` as an STL template parameter. However the result is invariably that performance is virtually unchanged, or significan... | [
-0.00872818659991026,
0.1155799850821495,
-0.01683889515697956,
0.02400323376059532,
-0.18440933525562286,
-0.2183927297592163,
-0.0676729753613472,
0.24536292254924774,
-0.32895320653915405,
-0.6133604049682617,
0.10024585574865341,
0.6850883364677429,
-0.05971101298928261,
-0.05291908606... | |
you can allocate to the pool and then when the transaction is done, just dump it into oblivion. The real speed up isn't that each allocation is going to be much faster its that you will have near zero memory fragmentation in an extremely long running application.
In sort, it sounds like your applications do not warran... | [
0.09660674631595612,
-0.09452249109745026,
0.042465340346097946,
0.6374655961990356,
0.1818828582763672,
-0.19150207936763763,
-0.22191980481147766,
0.06714971363544464,
-0.41231709718704224,
-0.5863654613494873,
0.24199698865413666,
0.39893460273742676,
-0.09841673821210861,
0.26629421114... | |
In testing, the user on a db i've used was a big jefe. In production, he only has Execute.
When I called,
```
Membership.DeleteUser(user)
```
In testing, it worked.
I try the same in production, and I get this:
> The DELETE statement conflicted with the REFERENCE constraint
> "FK\_\_aspnet\_Us\_\_UserI\_\_37703C5... | [
0.40755000710487366,
0.38150283694267273,
0.15363474190235138,
-0.13844166696071625,
-0.3815607726573944,
0.18040096759796143,
0.5701618790626526,
-0.4553906321525574,
0.016556326299905777,
-0.3130374550819397,
0.277155339717865,
0.3540414571762085,
-0.16156244277954102,
0.4476653039455414... | |
while to find a solution to
> this across multiple sites and options
> as the error and possible solutions
> were rather misleading. Turns out, at
> least in my case, it was a problem
> with permissions on the membership
> database. The user I'm using to
> connect had access to view the
> membership details wit... | [
-0.021053120493888855,
0.059494879096746445,
0.3320203423500061,
-0.11438096314668655,
0.14556275308132172,
-0.2416890561580658,
0.31562817096710205,
-0.22639361023902893,
-0.2125655561685562,
-0.5073676705360413,
-0.0356919951736927,
0.30560651421546936,
-0.223234623670578,
0.232060149312... | |
overall delete failed.
>
>
> The fix for me was to add the user to
> the aspnet\_Membership\_FullAccess role
> for the membership database.
But when I did that it didn't work. Anyone have any ideas on how to deal with this?
After a little inspection I found the issue is this line in the aspnet\_Users\_DeleteUser ... | [
-0.24312950670719147,
-0.12464335560798645,
0.5204389691352844,
-0.1523534506559372,
-0.0862748771905899,
0.1452753096818924,
0.4021644592285156,
-0.1363668143749237,
-0.3321203291416168,
-0.5015653967857361,
0.13260112702846527,
0.5283151268959045,
-0.4284519851207733,
0.3314038813114166,... | |
have access to vw\_aspnet\_MembershipUsers it won't turn up when selecting from sysobjects. I'm curious to know why that whole EXISTS statement is necessary.
Regardless, the following discussion, "[Access to sysobjects to view user tables without having access to the user tables directly in SQL Server Security](http:/... | [
0.2485169917345047,
0.12924356758594513,
0.7246943712234497,
0.23981547355651855,
0.18934716284275055,
-0.44731712341308594,
0.33093610405921936,
-0.06541045755147934,
-0.16083262860774994,
-0.6015405058860779,
-0.3816518187522888,
0.4621773660182953,
-0.09530013054609299,
0.08760811388492... | |
Java has a lot of frameworks / APIs that help you do logging in your application:
1. The Java API has java.util.logging package.
2. Apache's Log4j.
3. Apache's Commons Logging.
4. SLF4J (logging Facade).
5. jLo.
and many many more...
I've always used the log4j library, i found it sufficient most of the time, and exte... | [
0.22297406196594238,
0.21885830163955688,
0.18701544404029846,
-0.11562313139438629,
-0.3055081069469452,
-0.3108845353126526,
0.18651261925697327,
-0.16568107903003693,
-0.6307188868522644,
-0.5073812007904053,
0.20587484538555145,
0.3778963088989258,
-0.5157379508018494,
-0.0820522233843... | |
that you'd go for Commons Logging if you're writing a library that may be dropped into applications where you have no control over the logging, one of the other choices if not. I personally use CL in all cases, simply because it's common -- I don't need to remember the differences between frameworks. | [
0.5694136619567871,
0.288731187582016,
-0.04766727238893509,
0.3899454176425934,
-0.19842444360256195,
-0.18629851937294006,
-0.087967649102211,
0.04369979724287987,
-0.35078752040863037,
0.030975693836808205,
0.1485014706850052,
0.4970631003379822,
-0.2506196200847626,
-0.0426879972219467... | |
I am trying to have a table header, in a seperate div stay in place while a div undernearth is able to scroll al arge list of records. Both divs are in a div named Layer 3. Hereis the css file I am using:
```css
#Layer3
{
position:absolute;
width: 89%;
height: 40%;
left: 10%;
top: 56%;
backgrou... | [
0.07329542934894562,
0.1143680289387703,
0.6261742115020752,
-0.26505959033966064,
0.2863592803478241,
0.13157443702220917,
0.4891223907470703,
-0.1429920345544815,
-0.11895465850830078,
-0.7992359399795532,
-0.36897751688957214,
0.20792657136917114,
-0.08937206864356995,
-0.06563141196966... | |
overflow: auto;
}
```
and part of the php code I am using to generate the html:
```
echo '<div id="tableheader" class="tableheader">';
echo "<h1>{$query} Auctions</h1>" . "\n";
echo "</div>";
echo '<div id="tablecontent" class="tablecontent">';
echo "<table border='0' width='100%'><tr>" . "\n";
echo "<td width=... | [
-0.03025944158434868,
-0.0653623715043068,
0.9380927085876465,
-0.19697305560112,
-0.07845456153154373,
0.09523951262235641,
0.21127937734127045,
-0.4066890776157379,
-0.2263510674238205,
-0.40441861748695374,
-0.09783818572759628,
0.31193807721138,
-0.26041796803474426,
0.4712842702865600... | |
or even separate from tablecontent.
You can call directly into Application using the static Application.application.yourPublicMethodName() or .yourPublicPropertyName = n, but you might also consider using the event framework, to keep your components loosely coupled. Since your component is by definition an event dispat... | [
0.10628384351730347,
-0.35490894317626953,
0.5404647588729858,
0.04806247726082802,
-0.2285878211259842,
-0.05027339980006218,
-0.10902758687734604,
-0.26016831398010254,
-0.30271443724632263,
-0.6233349442481995,
-0.3111194670200348,
0.6101043224334717,
-0.38207224011421204,
-0.0929671376... | |
<![CDATA[
public var someValue:int = 0;
private function buttonClick():void
{
someValue = 1;
dispatchEvent(new Event("buttonClicked"));
} | [
-0.13191889226436615,
-0.3557266592979431,
0.17123204469680786,
-0.29708677530288696,
0.25132858753204346,
0.01303592137992382,
0.41448378562927246,
-0.10438964515924454,
-0.024977492168545723,
-0.419389545917511,
-0.3475295603275299,
0.6251847743988037,
-0.34038692712783813,
-0.0478115603... | |
]]>
</mx:Script>
<mx:Button label="Click Me" click="buttonClick()" />
</mx:Canvas>
```
... and for the Application, like this:
```
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*">
<mx:Script>
<![CDATA[
... | [
-0.1308567374944687,
-0.04880752041935921,
0.7970460653305054,
-0.3682662844657898,
0.1239100992679596,
0.1151614636182785,
-0.0007539220969192684,
-0.429397851228714,
-0.325460284948349,
-0.3832097053527832,
-0.4319846034049988,
0.7602882981300354,
-0.49260151386260986,
-0.074310176074504... | |
}
]]>
</mx:Script>
<local:MyComponent buttonClicked="myComponent_buttonClicked(event)" />
</mx:Application>
```
The Event metadata tag in the component class tells the compiler the component dispatches a flash.events.Event-type event ("buttonClicked"), which exposes it as an event on the MyComponen... | [
-0.07052595168352127,
0.11416366696357727,
0.26405927538871765,
-0.09562398493289948,
0.2434198558330536,
-0.10713648796081543,
0.20730488002300262,
0.1311081051826477,
-0.27710357308387756,
-0.5419679284095764,
-0.45637816190719604,
0.7337097525596619,
-0.3056328296661377,
-0.016906388103... | |
I am working on a Web based organisation tool. I am not aiming the same market as the wonderful Basecamp, but let's say the way users and data interact look like the same.
I will have to deal with user customisation, file uploads and graphical tweaks. There is a fora for each account as well. And I'd like to provide ... | [
0.49749937653541565,
0.2627123296260834,
0.08152607083320618,
0.021391399204730988,
-0.2606402039527893,
-0.17613068222999573,
0.22658094763755798,
0.10175207257270813,
-0.10344753414392471,
-0.5325190424919128,
0.08293361961841583,
0.24860616028308868,
-0.049248408526182175,
0.14554300904... | |
it possible to think about using one SQLITE DB to store the data for each account and only use MYSQL for the general web site management ?
**The pro :**
* backing up is straightforward : set version, zip, upload.
* don't bother if each account use a massive fora : the mess is in one file for every one of them.
* SQLI... | [
0.18631301820278168,
0.1783432513475418,
0.2356622815132141,
0.23198150098323822,
-0.3084372282028198,
0.012781724333763123,
0.25740382075309753,
-0.21503371000289917,
-0.35942766070365906,
-0.5055041313171387,
0.2308972179889679,
0.7499423027038574,
-0.26021626591682434,
-0.05220357328653... | |
know if there is a way for SQLITE to not be stored in RAM since it would be quickly a disaster
* lots of dir and subdirs : will this be ok ?
* maintenance issue : upgrading the live site means upgrading all the db one by one
* dev issue : setting a dev / pre prod / prod env will be quite hard
* commom data will still r... | [
0.7188499569892883,
0.18458311259746552,
0.44337141513824463,
0.17638401687145233,
-0.016418837010860443,
-0.2678019404411316,
0.40148860216140747,
-0.09406362473964691,
-0.12700384855270386,
-0.6388423442840576,
0.12280715256929398,
0.804283082485199,
-0.041871026158332825,
0.162023082375... | |
is is: Which of the above is better for a multi-tenancy SaaS application?
A thousand little sqlite databases may appeal, but may not scale.
I'll address your points in turn:
* backing up is straightforward : set version, zip, upload.
What happens if an update occurs during your backup? How long does your backup tak... | [
0.13268548250198364,
-0.06353992223739624,
0.4022441506385803,
0.18731604516506195,
0.10134018212556839,
0.004914094228297472,
0.18453794717788696,
-0.26515501737594604,
-0.2543242275714874,
-0.2201932668685913,
-0.13001810014247894,
0.651623010635376,
-0.19310803711414337,
-0.069904819130... | |
you tested these things?
I think backing up a sqlite database isn't as easy as you seem to think, because of the concurrent access issue.
* SQLITE is lightening fast, no expensive connection time...
Your implication that the MySQL connection time would be "expensive" may be false. Do you have hard data? Connecting t... | [
0.43556177616119385,
-0.039108894765377045,
0.06979811191558838,
0.37108445167541504,
0.12114452570676804,
-0.20227378606796265,
0.23908373713493347,
0.09142274409532547,
-0.5614802837371826,
-0.5104668736457825,
0.33761075139045715,
0.6061302423477173,
-0.04387662559747696,
-0.07959466427... | |
What impact will it have on the service?
---
I'll now add some of my own:
* Scalability: If you are relying on a local filesystem with locking semantics (As I believe sqlite does), you cannot simply add more web servers, as they would have their own filesystems.
Because sqlite is not a network-based system, you can... | [
0.37366729974746704,
0.2244596779346466,
0.4268834590911865,
0.20526382327079773,
0.1392771303653717,
-0.18650400638580322,
0.1431276500225067,
0.05967925116419792,
-0.4425559341907501,
-0.7641252875328064,
0.08395281434059143,
0.421686589717865,
-0.1899077445268631,
0.26156455278396606,
... | |
database between servers, which is not going to be pretty, and may well erase any perceived performance advantages that it ever had over (e.g.) MySQL.
* Maintainabiliy - If your development team ever make a schema change to the database (which is not just possible, but very likely), it will need to be applied to these... | [
0.39317530393600464,
0.09420448541641235,
0.4603622555732727,
0.5733215808868408,
0.26333412528038025,
-0.13183751702308655,
0.5244147777557373,
-0.0064084576442837715,
-0.5818609595298767,
-0.6727651953697205,
0.032074835151433945,
0.5404642224311829,
-0.046755895018577576,
0.042006779462... | |
large ones.
Using a dedicated MySQL server will enable you to carry out central backups and migrations. It will enable you to use the resources on that box (i.e. RAM) to cache the most frequently used parts of the database, whichever account they happen to be in.
The RAM used to cache a large MySQL database (e.g. Inn... | [
0.10254247486591339,
0.1533796340227127,
0.28816503286361694,
0.15533117949962616,
0.23881752789020538,
0.03851201757788658,
-0.13178373873233795,
-0.06223990395665169,
-0.7211005091667175,
-0.49937787652015686,
-0.23000779747962952,
0.36825376749038696,
-0.41120675206184387,
0.16599085927... | |
them if you like
* MEASURE the performance of your application with a high simulated load on production-grade hardware. Make sure you use production grade hardware for your database server (e.g. battery backed raid controller)
* Compare it with a sqlite implementation, if you can. | [
0.33730143308639526,
0.1253664344549179,
0.3651924431324005,
0.44895872473716736,
0.18242233991622925,
0.2354997843503952,
-0.09097237139940262,
0.00140859535895288,
-0.366319477558136,
-0.752825915813446,
-0.11594144254922867,
0.7504512071609497,
-0.09172452241182327,
-0.01274312566965818... | |
I have created a simple grid of divs by left floating them and an empty div with a clear at the end of each row.
This works fine in Firefox, but in IE I get extra vertical space between rows. I tried to apply the "clearfix" method, but I must be doing something wrong.
Why does IE insert the extra vertical space and h... | [
0.252607136964798,
0.09573031216859818,
0.5275492668151855,
-0.2902216911315918,
0.03059464693069458,
-0.02473071590065956,
0.21420149505138397,
-0.32451319694519043,
-0.02193625271320343,
-0.8440250754356384,
-0.303603857755661,
0.4448896646499634,
-0.40457165241241455,
-0.053177665919065... | |
display: block;
}
body {
background: white;
}
.colorChip {
position:relative;
float: left;
width: 20px; | [
-0.2531411051750183,
-0.38555002212524414,
0.32053342461586,
-0.19597916305065155,
0.14727401733398438,
0.29477599263191223,
0.03727332130074501,
-0.09046880155801773,
-0.08056757599115372,
-0.7816957235336304,
-0.333758145570755,
0.49159735441207886,
-0.20153047144412994,
-0.0849346742033... | |
height: 20px;
margin: 2px;
border-style: solid;
border-width: 1px;
border-color: black;
}
.clear {
clear: both; | [
-0.4264218211174011,
0.006941892672330141,
0.6372073292732239,
0.22861848771572113,
0.11945152282714844,
0.1621825397014618,
0.17684713006019592,
-0.08295468986034393,
-0.02477322705090046,
-0.31984633207321167,
-0.5725076198577881,
0.2664608359336853,
0.009149477817118168,
-0.205331817269... | |
}
.clearfix {
display:inline-block;
}
.clearfix:after, .container:after {
clear:both;
content:".";
display:block;
height:0;
visibility:hidden; | [
-0.4016684889793396,
-0.13502202928066254,
0.4343862235546112,
-0.12770463526248932,
0.22190530598163605,
0.00014999962877482176,
0.14647231996059418,
0.09890089184045792,
-0.0830780565738678,
-0.5807092785835266,
-0.63335120677948,
0.294898122549057,
-0.4091810882091522,
-0.03242069482803... | |
}
* html .clearfix {
height:1%;
}
.clearfix {
display:block;
}
</style>
<!--[if IE]>
<style type="text/css">
.clearfix {
zoom: 1; /* triggers hasLayout */
</style>
<![endif]-->
</head>
<body> | [
0.24670390784740448,
-0.3737790882587433,
0.6244951486587524,
-0.16216988861560822,
0.09244351834058762,
0.016412366181612015,
0.1507961004972458,
-0.24672986567020416,
-0.2622683346271515,
-0.5080679655075073,
-0.31579914689064026,
0.4326118528842926,
-0.3822636902332306,
-0.4396367073059... | |
<div class="colorChip clearfix" style="background: rgb(163,143,88)"></div>
<div class="colorChip" style="background: rgb(190,170,113)"></div>
<div class="colorChip" style="background: rgb(190,250,113)"></div>
<div class="clear"></div>
<div class="colorChip clearfix" style="background: rgb(187,170,128)">... | [
-0.04466158524155617,
-0.30004653334617615,
0.35727232694625854,
-0.07528392225503922,
-0.08652197569608688,
0.36181360483169556,
0.040790632367134094,
-0.12085393816232681,
-0.09569330513477325,
-0.45359012484550476,
-0.22695495188236237,
0.37545114755630493,
-0.12225166708230972,
-0.0823... | |
text.
If you change `.clear` to this, it'll shrink to 1 pixel:
```
.clear {
clear: both;
height: 1px;
overflow: hidden;
}
```
Put a background colour on to see what's happening | [
0.041814010590314865,
-0.20927675068378448,
0.6556396484375,
-0.12877880036830902,
0.22929617762565613,
0.15715520083904266,
0.29810091853141785,
0.2724359631538391,
-0.27360445261001587,
-0.6012749671936035,
-0.4778625965118408,
0.433676153421402,
-0.4931999146938324,
-0.250268816947937,
... | |
I know that Serialization (Serializable) is not available in the Micro Edition of Java.
It's kinda straight forward to save primitives like int and java.lang.String objects with the RMS.
But if I want to save (make persistant) an arbitrary object? Is that possible?
You can use the Connection API to write the data to a ... | [
0.11286243051290512,
-0.09537323564291,
0.22957073152065277,
0.1286398321390152,
-0.12526369094848633,
-0.32772788405418396,
0.30420854687690735,
0.18629330396652222,
-0.5294076204299927,
-0.5225850939750671,
0.3654976487159729,
0.6219409704208374,
-0.24853849411010742,
0.4661315977573395,... | |
many devices.
So instead of re-inventing the wheel I would advise using Floggy (<http://floggy.sourceforge.net/>). Floggy is a free object persistence framework for J2ME/MIDP applications. The main goal of this framework is to abstract the data persistence details from the developer, reducing the development and main... | [
0.39431139826774597,
0.0074621159583330154,
0.40844762325286865,
0.3466106653213501,
0.10582339018583298,
-0.13260285556316376,
-0.03325808793306351,
0.07925476878881454,
-0.34005188941955566,
-0.5083856582641602,
0.08342184126377106,
0.7548506259918213,
-0.19807636737823486,
0.14755260944... | |
I'm setting up a public site and the first thing on my mind is SQL injection. I have some text fields I'm saving and am using linq to update/write to the database. Am I safe using linq?
This example is creating the user account.
```
Data.MemberRegistrationDataContext context = new MemberRegistrationDataContext();
D... | [
0.20789173245429993,
0.1145373284816742,
0.5225017070770264,
-0.15335646271705627,
0.031517937779426575,
-0.07694592326879501,
0.44576823711395264,
-0.4014909863471985,
-0.2601512670516968,
-0.7605440020561218,
-0.13750503957271576,
0.5819700956344604,
-0.23413188755512238,
0.1483251154422... | |
safe? Does LINQ parameterize the SQL it generates automatically?
Yes, LINQ will help stop SQL injection.
> LINQ to SQL passes all data to the
> database via SQL parameters. So,
> although the SQL query is composed
> dynamically, the values are substitued
> server side through parameters
> safeguarding against the... | [
0.38012903928756714,
0.05147877335548401,
0.3002763092517853,
0.21801333129405975,
0.1562720090150833,
-0.4401254951953888,
0.5191665887832642,
-0.5907660126686096,
0.28222012519836426,
-0.19264103472232819,
0.03776504099369049,
0.7667891383171082,
-0.6214311122894287,
-0.3654389977455139,... | |
I have a simple question related to one-line programming. First an example:
```
function test(a)
{
var b=a.toString();
return b.replace("a","b");
}
```
It's very simple (this function is, of course, useless), but the question here is little more complicated: What if I was to do this in one line? I have my thou... | [
0.05079221352934837,
0.1387544423341751,
0.05828847736120224,
-0.23531286418437958,
-0.13595184683799744,
0.03436501696705818,
0.16866731643676758,
-0.36485418677330017,
0.06455595791339874,
-0.43954870104789734,
0.09882282465696335,
0.6649250984191895,
-0.461686909198761,
0.15651518106460... | |
arguments are deleted also? Or does create new elements in arguments makes this element defined globally? From my tests, it seems that I'm correct, but I'm curious to see if anyone has tried this? Is this a safe and clean solution?:) Thanks for any comments.
Here are a more real problem with One-Line script problem:
... | [
-0.17351838946342468,
-0.05818101018667221,
0.15850946307182312,
0.037604931741952896,
0.1412934809923172,
0.08684904873371124,
0.5121523141860962,
0.08772774785757065,
-0.24719321727752686,
-0.3615247309207916,
-0.22437784075737,
0.7097570896148682,
-0.4957887530326843,
0.0842888802289962... | |
arguments.callee(arguments[2],limiter);
}
```
This one line function do things with given string and return it or parse it recursively to the same function. (on other thread I show how this could be done without recursion, but this is not a case of a problem).
Your example may be over-complicating a simple operation ... | [
0.3798428773880005,
-0.33683207631111145,
0.29868459701538086,
-0.10644394159317017,
-0.09093287587165833,
-0.05302140489220619,
0.1937163770198822,
0.15965449810028076,
-0.28369706869125366,
-0.4531421959400177,
0.06878195703029633,
0.3398183286190033,
-0.47704848647117615,
0.407434701919... | |
aBitLater = DateJs.now().addHours(1).addMinutes(30);
```
Sure, it's syntactic sugar and could be written more verbosely as separate statements, but with careful method nameing you can actually cause this to read like English.
GC / Memory management is not affected by this style, parameters to functions are cleaned u... | [
0.18517108261585236,
-0.141874760389328,
0.21460357308387756,
-0.33283787965774536,
-0.2646788954734802,
0.14582595229148865,
0.6514250040054321,
-0.14901351928710938,
-0.0996808409690857,
-0.3662091791629791,
0.015036173164844513,
0.612616240978241,
-0.48761025071144104,
-0.17818316817283... | |
it makes sense, it's a useful pattern. | [
0.730513870716095,
0.19486159086227417,
0.08899812400341034,
0.0015102315228432417,
0.09576290845870972,
-0.12648111581802368,
0.030820203945040703,
0.16308321058750153,
-0.21814784407615662,
-0.4182327389717102,
0.23564037680625916,
0.0659523531794548,
-0.07547865062952042,
0.086423315107... | |
When retrieving values from a DataRow is it better to use the column name or column index?
The column name is more readable and easier to maintain:
```
int price = (int)dr["Price"];
```
While column index is just faster (I think):
```
int price = (int)dr[3];
```
Would using column names break if you decide to ob... | [
0.08456896245479584,
0.11548541486263275,
0.17626948654651642,
0.22465971112251282,
-0.11841971427202225,
-0.02903725765645504,
0.036956898868083954,
-0.21591715514659882,
-0.18405495584011078,
-0.5177305340766907,
0.04399443417787552,
0.9080383777618408,
-0.09051097929477692,
0.2485623061... | |
I'm working in C++ and I need to know if a scalar value (for instance a `double`) is "defined" or not. I also need to be able to "undef" it if needed:
```
class Foo {
public:
double get_bar();
private:
double bar;
void calculate_bar() {
bar = something();
}
};
double Foo::get_bar() {
if (... | [
0.3537944257259369,
0.2057415097951889,
0.3829180598258972,
-0.44188636541366577,
0.08096122741699219,
-0.11813732981681824,
0.32396459579467773,
-0.27053508162498474,
-0.16148686408996582,
-0.41458967328071594,
-0.2625909149646759,
0.4821409583091736,
-0.38852110505104065,
-0.026983624324... | |
can easily work around it though.
Either you can have an undefined value which you initialize bar to in the constructor, typically -1.0 or something similar.
If you know that calculate\_bar never returns negative values you can implement the undefined function as a check for < 0.0.
A more general solution is having ... | [
0.2205578088760376,
0.08519507199525833,
0.2540445327758789,
-0.3524668514728546,
-0.1315266191959381,
-0.2083018273115158,
0.25429123640060425,
-0.21705283224582672,
-0.15757878124713898,
-0.1989002376794815,
-0.15562324225902557,
0.7771473526954651,
-0.4264971613883972,
-0.20287270843982... | |
double get_bar();
Foo() : barDefined(false) {}
private:
double bar;
bool barDefined;
void calculate_bar() {
bar = something();
}
};
double Foo::get_bar() {
if ( barDefined == false ) {
calculate_bar();
barDefined = true;
}
return bar;
}
``` | [
0.2400539517402649,
0.10266834497451782,
0.40717610716819763,
-0.7675250768661499,
-0.09189551323652267,
0.13109244406223297,
0.5973058342933655,
-0.5369237065315247,
0.20592908561229706,
0.034602243453264236,
-0.3753114640712738,
0.6521672010421753,
-0.32634201645851135,
-0.11619684845209... | |
Does anybody know of an easy to implement site search engine for asp.net? The less complicated the better.
Probably just needs a crawler and backend to store results. Some sort of API to get the search results back would be handy but I can get it straight from the DB as well.
[Dot Lucene](http://incubator.apache.org/... | [
0.5574808716773987,
-0.24135646224021912,
0.05234694853425026,
0.12094133347272873,
-0.11680984497070312,
-0.006879489868879318,
0.07484244555234909,
0.3934957981109619,
-0.2396911233663559,
-0.6607244610786438,
0.001343982177786529,
0.27485421299934387,
0.05432870611548424,
0.014181902632... | |
How do you left pad an `int` with zeros when converting to a `String` in java?
I'm basically looking to pad out integers up to `9999` with leading zeros (e.g. 1 = `0001`).
Use [`java.lang.String.format(String,Object...)`](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#format-java.lang.String-java.lang... | [
-0.08881226181983948,
0.14965814352035522,
0.3317735493183136,
-0.3322112262248993,
-0.17296837270259857,
0.0859672799706459,
-0.10530003160238266,
-0.4406128525733948,
-0.047187238931655884,
-0.505912184715271,
0.025339070707559586,
0.367866188287735,
-0.02536231465637684,
-0.112083606421... | |
I have the following css code:
```
#Layer3
{
position:absolute;
width: 89%;
height: 40%;
left: 10%;
top: 56%;
background-color: #f1ffff;
}
#Layer3 h1
{
font-size: medium;
color: #000033;
text-decoration: none;
text-align: center;
}
.tableheader {
border-width:10px; border-style:solid;
}
.tablecontent {
hei... | [
-0.1227702870965004,
0.0033988410141319036,
1.0220812559127808,
-0.21413683891296387,
-0.05412326380610466,
0.16598156094551086,
0.4095466434955597,
-0.5221008062362671,
-0.04373471811413765,
-0.7354973554611206,
-0.16121728718280792,
0.22984395921230316,
-0.06819292157888412,
0.3319176733... | |
$pk = $row['ARTICLE_NO'];
echo '<tr>' . "\n";
table contens generated in here
echo '</tr>' . "\n";
}
echo "</table>";
}
echo "</div>";
```
which generates this html:
```
<div id="tableheader" class="tableheader">
<h1>hardy Auctions</h1>
</div>
<div id="tablecontent" class="tablecontent">
<... | [
-0.029845554381608963,
-0.29138100147247314,
0.984235942363739,
-0.06896446645259857,
-0.23929277062416077,
-0.09804747998714447,
0.07579533010721207,
-0.543918788433075,
-0.2750374674797058,
-0.5469915866851807,
-0.14533093571662903,
0.030603233724832535,
0.12452293187379837,
0.2685041427... | |
{
border: 10px solid #000;
}
```
Try giving it a color.
EDIT: since its id is tableheader, try changing the style selector to be an id. You could also try using !important to see if anything is overriding your class selector.
Specificity values:
inline: 1000; id: 100, class: 10, element: 1
!important trumps all... | [
-0.014923724345862865,
-0.11644184589385986,
0.5301487445831299,
0.12485672533512115,
-0.021829744800925255,
-0.08003923296928406,
0.17085637152194977,
-0.23786409199237823,
-0.09097949415445328,
-0.7427769899368286,
-0.25288671255111694,
0.24004292488098145,
-0.22252871096134186,
-0.09096... | |
I want to know what the difference is between alt="" and name=""
Would it be better to put the filename within the alt tag, or the description of the photo?
What makes better sense, both from SEO and validation stand-point?
* The `name` attribute exists only to provide a name to refer to in JavaScript.
* The `alt` at... | [
0.5643572807312012,
0.01855384185910225,
0.5603394508361816,
0.03162937983870506,
0.0994037613272667,
-0.11018292605876923,
0.17408399283885956,
-0.0873720720410347,
-0.043884504586458206,
-0.6082949042320251,
-0.11476118862628937,
0.6787363290786743,
-0.13781800866127014,
-0.0148048354312... | |
the `alt` attribute for this purpose when there is no `title` | [
-0.0684765949845314,
0.15760192275047302,
0.2552276849746704,
0.10935738682746887,
-0.05757829546928406,
-0.5737051367759705,
-0.05896414816379547,
0.19333483278751373,
0.03767777979373932,
-0.3103339374065399,
-0.532908022403717,
0.5082191228866577,
0.21405884623527527,
0.1792164891958236... | |
I'm working on a rather large project, and its unlikely will catch everything. I've found the event that notifies me of unhandled exceptions, however I haven't found a way to programmatically shut off the windows error dialog. Ideally, if there is an unhandled exception, I would like to have that event fired, provide a... | [
0.2840840220451355,
0.04773354530334473,
0.10394497960805893,
0.18199369311332703,
0.17322510480880737,
-0.2558032274246216,
0.33678802847862244,
-0.027949070557951927,
-0.3048233389854431,
-0.37891334295272827,
0.026682788506150246,
0.40255212783813477,
-0.13191421329975128,
-0.1553621739... | |
we did.
```
static void Main() {
try
{
SubMain();
}
catch (Exception e)
{
HandleUnhandledException(e);
}
}
private static void SubMain()
{
// Setup unhandled exception handlers
AppDomain.CurrentDomain.UnhandledException += // CLR
new UnhandledExceptionEventHandle... | [
0.3356579840183258,
-0.17087215185165405,
0.6827389001846313,
-0.11918889731168747,
0.3572710454463959,
-0.1066715270280838,
0.4840066432952881,
-0.3014601767063141,
-0.15030409395694733,
-0.22128170728683472,
-0.18453718721866608,
0.5355471968650818,
-0.40337952971458435,
0.32311630249023... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.