text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
(where ctx is HttpContext.Current and pathAndQuery is ctx.Request.Url.PathAndQuery)
```
// SSL required and current connection is not SSL
if (requestRequiresSSL & !ctx.Request.IsSecureConnection)
ctx.Response.Redirect("https://www.myurl.com" + pathAndQuery);
// SSL not required but current connection is SSL
if (!re... | [
0.10034716129302979,
0.07895515859127045,
0.8623310327529907,
-0.1892995983362198,
-0.08079638332128525,
-0.1475159376859665,
0.6568136215209961,
-0.3392956852912903,
-0.30566278100013733,
-0.7926846146583557,
-0.4320577085018158,
0.7414036989212036,
-0.40697604417800903,
0.111642755568027... | |
some header and footers as well, or even CSS files, if you use any.
As you always throw away SSL for such a content, it may happen that part of the page (main html) requires SSL, but the consequential request for an image on this page does not.
The browser is warning you, that some parts of the page were not delivere... | [
0.351192444562912,
0.11857616156339645,
0.42702269554138184,
0.21324500441551208,
-0.3616905212402344,
-0.4210178852081299,
0.31063711643218994,
0.2414809763431549,
-0.4237539768218994,
-0.614902138710022,
-0.3647406995296478,
0.24285364151000977,
-0.2431555986404419,
0.07629789412021637,
... | |
if you have:
```
<html>
<body>
Some content...
<img src="images/someimage.jpg">
</body>
</html>
```
and you request this page using SSL, but your evaluation of *requestRequiresSSL* does not take into account the images as secured resources, it will form a http, not https request, and you will see the warning.
... | [
0.16824932396411896,
-0.031714871525764465,
0.806250274181366,
0.08757711201906204,
-0.12810170650482178,
-0.3090256452560425,
0.3354473412036896,
-0.2506733238697052,
-0.21842321753501892,
-1.1104800701141357,
-0.29275232553482056,
0.2633969783782959,
-0.27159857749938965,
0.0272360984236... | |
from a disk location), just check the the resource filename (.aspx, .asmx, .ashx, .html, etc.).
That way, if the connection is encrypted, but the resource itself is not html, and no set for "encryption", you are not going to drop the encryption. | [
-0.026999447494745255,
-0.04119465500116348,
0.3005080819129944,
0.4406547248363495,
0.21186509728431702,
-0.35023707151412964,
0.06031151860952377,
0.260522723197937,
-0.5092446804046631,
-0.7674530744552612,
-0.39831748604774475,
0.6271185874938965,
0.021592410281300545,
0.10018106549978... | |
I'm having trouble compiling the example program presented in section 5.11 of the book. I have removed most of the code and left only the relevant stuff.
```
#define MAXLINES 5000
char *lineptr[MAXLINES];
void qsort1(void *lineptr[], int left, int right, int (*comp)(void *, void *));
int numcmp(char *, char *);
main... | [
0.024679657071828842,
-0.20632776618003845,
0.8027494549751282,
-0.32120099663734436,
0.16137517988681793,
0.36770153045654297,
0.4182244837284088,
-0.2912691533565521,
-0.08518251031637192,
-0.6898788213729858,
-0.21472524106502533,
0.3113700747489929,
-0.3177165985107422,
0.2494003474712... | |
/* ... */
}
```
The problem is that the code doesn't compile (I'm using Digital Mars compiler). The error I get is this:
```
qsort1((void**) lineptr, 0, nlines - 1, (int (*)(void*, void*))(numeric
? numcmp : strcmp));
^
go.c(19) : Error: need explicit cast to convert
from: int (*C func)(cha... | [
0.29535943269729614,
0.4092153012752533,
0.24877525866031647,
-0.20773975551128387,
0.042365819215774536,
0.1225762590765953,
0.6074578166007996,
-0.2572118937969208,
0.015131719410419464,
-0.47766342759132385,
-0.08680003881454468,
0.9831282496452332,
-0.2613641023635864,
0.06573339551687... | |
know enough to make the right changes (the section about the function pointers could certainly have been written more extensively).
EDIT: I should have mentioned that I'm reading the ANSI version of the book.
I think the error comes from the fact that old C did not know const yet: strcmp there took two pointers to non... | [
-0.0726659744977951,
0.18370570242404938,
0.09153804183006287,
-0.08716396242380142,
-0.10594630986452103,
-0.21953915059566498,
0.4954518675804138,
0.041293226182460785,
-0.08523110300302505,
-0.567659318447113,
0.13076291978359222,
0.6386185884475708,
-0.4355035722255707,
-0.001754467259... | |
I am working with C++ unmanaged and Excel 2007. I am using a call to the Excel4 API to get the range of cells selected by the user.
When the user selects what I call a "common" range, this call returns a range like this "R1C1:R4C3", which is exactly the format that I need for doing other operations in my application.
... | [
0.2769598960876465,
0.43560874462127686,
0.43661728501319885,
-0.5059261322021484,
-0.13184669613838196,
0.11806190013885498,
0.07181795686483383,
-0.5220653414726257,
-0.3029879033565521,
-0.406304270029068,
0.18958568572998047,
0.49744752049446106,
-0.4581351578235626,
-0.206196203827857... | |
it so it looks like the the range above; in other words I have to manually add it the rows range.
So I take this range "C1C3" and change it to be "R1C1:R65534C3".
Perhaps at this point you already noticed my problem, as you can see I'm hard coding the rows range to be the max numbers of rows supported by Excel 2003 (... | [
-0.058775175362825394,
0.3016001582145691,
0.7131786942481995,
-0.3377426862716675,
-0.04024256765842438,
0.0973038524389267,
0.08634734898805618,
-0.29781457781791687,
-0.4504798948764801,
-0.29906168580055237,
0.003936861176043749,
0.7208465933799744,
-0.17996715009212494,
0.014995512552... | |
to the server, so imagine that the user only entered data until row 534 and still my query will have 65000 rows with nothing.
So my question is how can I get the last cell in which the user entered data, I think it is called the last active cell, so I can delimit my range until that row and please remember that I'm wo... | [
0.15705472230911255,
0.056787408888339996,
0.5141919255256653,
0.09111187607049942,
-0.1740322709083557,
0.07610787451267242,
0.24376678466796875,
0.2719682455062866,
-0.11127499490976334,
-0.5858243703842163,
0.10510090738534927,
0.4917847216129303,
-0.23861752450466156,
-0.18511423468589... | |
I'm trying to figure out how to make a virtual listbox (or tree or outline) in Swing -- this would be one where the listbox can show a "view" within a large result set from a database without getting the entire result set's contents; all it needs to give me is a heads up that Items N1 - N2 are going to need to be displ... | [
0.3333926200866699,
-0.03464788198471069,
0.5255634188652039,
-0.0922459214925766,
-0.026457741856575012,
-0.040413182228803635,
-0.03823946416378021,
-0.36370086669921875,
-0.40847283601760864,
-0.6570208668708801,
-0.04647842422127724,
0.27051058411598206,
-0.15686142444610596,
-0.009440... | |
[SWT](http://www.java2s.com/Tutorial/Java/0280__SWT/Createatablewith1000000itemslazy.htm), but not Swing.
Any suggestions?
---
update: aha, I didn't understand what to look for in search engines, & the tutorials don't seem to call it a "virtual listbox" or use the idea. I found a [good tutorial](http://www.java2s.co... | [
0.3139970898628235,
-0.039572823792696,
0.5668294429779053,
-0.18207809329032898,
-0.44682765007019043,
-0.04571842402219772,
0.06750106811523438,
-0.20127858221530914,
-0.38260042667388916,
-0.6003639101982117,
0.07314591109752655,
0.37107595801353455,
-0.22332791984081268,
-0.11677848547... | |
don't understand why...)
```
package com.example.test;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.AbstractListModel;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax... | [
0.11010785400867462,
0.18857768177986145,
0.6241973042488098,
-0.3274848759174347,
0.012154767289757729,
0.19217532873153687,
0.14561054110527039,
-0.6791151165962219,
-0.3658911883831024,
-0.17765499651432037,
-0.5244924426078796,
0.5296065807342529,
-0.5196272730827332,
-0.07580221444368... | |
Towers of Hanoi");
this.getContentPane().setLayout(new BorderLayout());
this.setSize(new Dimension(400, 300));
list1.setModel(hdata);
SpinnerModel model1 = new SpinnerNumberModel(initialLevel,1,31,1);
final JSpinner spinner1 = new JSpinner(model1);
this.getContentPane()... | [
-0.0007046110113151371,
-0.08225570619106293,
0.994233250617981,
0.008929068222641945,
-0.2540438771247864,
0.1712958961725235,
-0.004814432468265295,
-0.4891136884689331,
-0.6403347253799438,
-0.24649767577648163,
-0.5028839111328125,
0.38985684514045715,
-0.07099927216768265,
0.022976407... | |
BorderLayout.WEST);
panel1.add(spinner1, BorderLayout.CENTER);
this.getContentPane().add(panel1, BorderLayout.SOUTH);
ChangeListener listener = new ChangeListener() {
public void stateChanged(ChangeEvent e) {
Integer newLevel = (Integer)spinner1.getValue();
... | [
-0.07092448323965073,
-0.3979949653148651,
0.8423086404800415,
-0.21643763780593872,
0.23762927949428558,
0.1588454693555832,
0.510330855846405,
-0.5621187090873718,
-0.07300090789794922,
-0.7325868010520935,
-0.3326883614063263,
0.23154379427433014,
-0.32469168305397034,
0.679066121578216... | |
}
};
spinner1.addChangeListener(listener);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
}
class HanoiData extends AbstractListModel {
public HanoiData(int level) { this.level = level; }
private int level;
public int getLevel() { return level; }
... | [
0.21489067375659943,
-0.23676234483718872,
0.6405115127563477,
-0.05700553208589554,
0.260832816362381,
-0.15909364819526672,
0.2668503522872925,
-0.2617085576057434,
0.002555225044488907,
-0.5248904228210449,
-0.33706825971603394,
0.6415640115737915,
-0.022748365998268127,
-0.027356443926... | |
int newSize = getSize();
if (newSize > oldSize)
fireIntervalAdded(this, oldSize+1, newSize);
else if (newSize < oldSize)
fireIntervalRemoved(this, newSize+1, oldSize);
}
public int getSize() { return (1 << level); }
// the ruler function (http://mathworld.wolfra... | [
-0.2916775941848755,
-0.3175405263900757,
0.5587248802185059,
0.12997667491436005,
0.22016791999340057,
-0.11107049882411957,
0.31086787581443787,
-0.255018949508667,
-0.06466526538133621,
-0.807611346244812,
-0.391095370054245,
0.404329776763916,
-0.024660173803567886,
0.1777227818965912,... | |
bit-twiddling hacks page:
// http://www-graphics.stanford.edu/~seander/bithacks.html#ZerosOnRightMultLookup
public int rulerFunction(int i)
{
long r1 = (i & (-i)) & 0xffffffff;
r1 *= 0x077CB531;
return MultiplyDeBruijnBitPosition[(int)((r1 >> 27) & 0x1f)];
}
final priv... | [
0.3095284402370453,
-0.37379419803619385,
0.547654926776886,
0.1886930763721466,
-0.11850564926862717,
0.47083014249801636,
0.3057042062282562,
-0.4864502251148224,
-0.12491089850664139,
-0.1366228312253952,
-0.11194989085197449,
0.7385336756706238,
-0.2808718979358673,
0.2707679569721222,... | |
15, 25, 17, 4, 8,
31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9
};
public Object getElementAt(int index) {
int move = index+1;
if (move >= getSize())
return "Done!";
int disk = rulerFunction(move)+1;
int x = move | [
0.09646645933389664,
-0.5184289813041687,
0.6392549872398376,
0.18765874207019806,
0.2763321101665497,
0.17718100547790527,
0.041896186769008636,
-0.20289583504199982,
-0.49642714858055115,
-0.38992929458618164,
-0.39847514033317566,
0.43434521555900574,
-0.09676532447338104,
0.55359971523... | |
>> (disk-1); // guaranteed to be an odd #
x = (x - 1) / 2;
int K = 1 << (disk&1); // alternate directions for even/odd # disks
x = x * K;
int post_before = (x % 3) + 1;
int post_after = ((x+K) % 3) + 1;
return String.format("%d. move disk %d from post | [
-0.08527905493974686,
-0.3128226101398468,
0.4961737096309662,
-0.060583632439374924,
0.09497232735157013,
0.19869829714298248,
0.2685737609863281,
-0.19224965572357178,
-0.005775110330432653,
-0.5891056060791016,
-0.2899967133998871,
0.5029696226119995,
-0.2229984700679779,
0.310497105121... | |
%d to post %d",
move, disk, post_before, post_after);
}
}
```
---
update:
per jfpoilpret's suggestion, I put a breakpoint in the `getElementData()` function.
```
if ((index & 0x3ff) == 0)
{
System.out.println("getElementAt("+index+")");
}
```
I looked at the stacktrace for the thread in qu... | [
-0.1812128871679306,
-0.13931304216384888,
0.47334882616996765,
-0.2944813072681427,
0.30536913871765137,
0.03618006408214569,
0.35542023181915283,
-0.1412111222743988,
-0.11425657570362091,
-0.415198415517807,
-0.31152433156967163,
0.4088064432144165,
-0.3115282356739044,
0.39649096131324... | |
and refetches ALL of the row contents immediately (or at least it puts requests into the event queue to do so).
There **must** be some way to tell it Don't Do That!!!! but I don't know what.
```
com.example.test.HanoiMoves at localhost:3333
Thread [main] (Suspended (breakpoint at line 137 in HanoiData))
... | [
0.007730531040579081,
0.010019044391810894,
0.7333315014839172,
-0.17400895059108734,
0.3926454186439514,
0.06876756250858307,
0.4338100254535675,
0.09351345896720886,
-0.38462889194488525,
-0.4535059928894043,
-0.29033342003822327,
0.3582555651664734,
-0.28619271516799927,
0.5319749712944... | |
BasicListUI.getPreferredSize(JComponent) line: not available
JList(JComponent).getPreferredSize() line: not available
ScrollPaneLayout$UIResource(ScrollPaneLayout).layoutContainer(Container) line: not available
JScrollPane(Container).layout() line: not available
JScrollPane(... | [
-0.12316574901342392,
-0.21399669349193573,
0.6086868643760681,
0.0955268144607544,
0.027154210954904556,
0.24296732246875763,
0.3699471950531006,
-0.05205340310931206,
-0.12316481024026871,
-0.4257671535015106,
-0.4374425709247589,
0.16883507370948792,
-0.163810133934021,
0.11888547986745... | |
JLayeredPane(Container).validateTree() line: not available
JRootPane(Container).validateTree() line: not available
HanoiMoves(Container).validateTree() line: not available
HanoiMoves(Container).validate() line: not available
HanoiMoves(Window).show() line: not available
... | [
0.14374776184558868,
-0.2204924374818802,
0.604739248752594,
0.01622101478278637,
-0.020301712676882744,
0.17047683894634247,
0.21559883654117584,
0.18723851442337036,
-0.23240800201892853,
-0.275516539812088,
-0.4511110186576843,
0.3079889416694641,
-0.5170478224754333,
0.181169331073761,... | |
HanoiMoves.<init>() line: 69
HanoiMoves.main(String[]) line: 37
Thread [AWT-Shutdown] (Running)
Daemon Thread [AWT-Windows] (Running)
Thread [AWT-EventQueue-0] (Running)
```
---
Update: I tried using some of the FastRenderer.java code from the [Advanced JList Programming article](http:... | [
0.31338468194007874,
0.18126501142978668,
0.5933586359024048,
-0.30930811166763306,
-0.03998228535056114,
0.3160131871700287,
0.0844891294836998,
0.06862997263669968,
-0.5404284000396729,
-0.5925161838531494,
-0.10190616548061371,
0.6874406337738037,
-0.47124817967414856,
-0.07934665679931... | |
might be related to list size computation.
What you could try is to add some breakpoint in your model getElementAt() method. I suggest you do it this way:
```
if (index == 100)
{
System.out.println("Something");//Put the breakpoint on this line
}
```
The 100 constant is a value < getSize() but bigger than the i... | [
0.16751155257225037,
-0.1416190266609192,
0.34921905398368835,
0.0975562036037445,
0.16003550589084625,
0.054931093007326126,
0.0002584078174550086,
-0.131918266415596,
-0.32016435265541077,
-0.7317372560501099,
0.12191326916217804,
0.19811387360095978,
-0.27033478021621704,
0.201050594449... | |
further. | [
0.0949573814868927,
0.06088055297732353,
-0.024052418768405914,
0.08660969138145447,
0.3207849860191345,
0.06520932912826538,
-0.10827743262052536,
0.048216938972473145,
0.013323735445737839,
-0.6991578340530396,
-0.21750320494174957,
0.1539667397737503,
0.2892955541610718,
0.2848478257656... | |
```
> seq { for i in 0..3 do yield float i };;
val it : seq<float> = seq [0.0; 1.0; 2.0; 3.0]
> seq [ for i in 0..3 do yield float i ];;
val it : seq<float> = [0.0; 1.0; 2.0; 3.0]
```
P.S. why did F# originally expect sequences without the "seq" prefix, but now they want the prefix?
More clarification on the two form... | [
0.0482410304248333,
-0.01615157723426819,
0.37912848591804504,
-0.14507809281349182,
0.013004479929804802,
0.06241156533360481,
0.18121285736560822,
-0.07708999514579773,
-0.033890921622514725,
-0.6612194180488586,
-0.27137893438339233,
0.4954277276992798,
-0.3018704950809479,
0.0345006175... | |
and the workflow syntax more difficult or something.
Now, the second one is a pure list:
```
> let x = [ for i in 0..3 do yield float i ];;
val x : float list
```
"seq" is also a function:
```
> seq;;
val it : (seq<'a> -> seq<'a>) = <fun:clo@0_1>
```
And since any list is also a sequence, doing "seq [1;2;3;]" i... | [
-0.14590880274772644,
0.0557343065738678,
0.5372703075408936,
-0.21157515048980713,
-0.08156511932611465,
0.07339902222156525,
0.12356369942426682,
-0.4692748486995697,
-0.0049496004357934,
-0.5077982544898987,
-0.32033076882362366,
0.4422183036804199,
-0.31649646162986755,
-0.020904637873... | |
is:
```
let seq (x : seq<_>) = (x :> seq<_>)
```
So, "sorta like casting it" should read "casting it via a helper function". As for the printing of sequences inside brackets, I think that's just a pretty printing artifact. | [
0.6021056771278381,
0.21897859871387482,
0.1772877275943756,
-0.24103659391403198,
-0.02378994971513748,
0.04236026108264923,
-0.05579879879951477,
-0.18075235188007355,
0.11156811565160751,
-0.36241206526756287,
0.11603531241416931,
0.2368754744529724,
-0.0920388326048851,
-0.025160564109... | |
how can i make a tcp (ive heard it called a listener?) server (simplicity is optional at this point) that can recieve data from a client thats connected as well as send data back to that individual client (more multiple clients)?
ive done several tutorials but i could not get any of them to work or they did not do wha... | [
0.40444397926330566,
0.17252737283706665,
-0.026888525113463402,
0.19886937737464905,
-0.3695944845676422,
0.02393263392150402,
0.23773694038391113,
-0.3903755843639374,
-0.06353287398815155,
-0.5470799803733826,
0.2697709798812866,
0.48570016026496887,
-0.014919085428118706,
0.21400867402... | |
I am trying to use my join table "showing" to get a list of movies
I was trying to use this code but it does not work.
---
```
@showing_list = Showing.find_sorted_showings("time")
@movie_list = @showing_list.movies <-- NoMethodError
```
---
Here is my Showing class
---
```
class Showing < ActiveRecord::Base
b... | [
0.44759875535964966,
0.1558559089899063,
0.5691976547241211,
-0.08896035701036453,
-0.5091286897659302,
-0.0934951975941658,
0.11232994496822357,
-0.2110186517238617,
-0.23609039187431335,
-0.5356327295303345,
0.31158438324928284,
0.5709912180900574,
-0.17957277595996857,
0.590045213699340... | |
I am using the Spring Source 2.0 security plugin and I've done the tutorial described on this page using the Requestmap method of security.
[Acegi Plugin Tutorial](http://www.grails.org/AcegiSecurity+Plugin+-+Basic+Tutorial)
I now want to create a second bookstore as follows and implement the same tutorial.
```
gra... | [
0.4588194191455841,
-0.03575891628861427,
0.1654098480939865,
-0.060608770698308945,
-0.0915956199169159,
-0.04531922936439514,
0.22131723165512085,
-0.24917905032634735,
-0.14094705879688263,
-0.45660799741744995,
-0.1589592695236206,
0.6785394549369812,
-0.11742594838142395,
-0.099706217... | |
I followed Chris Hanson's [advice](http://chanson.livejournal.com/119578.html) about debugging framework unit tests in Xcode 3.1, but when trying to run the custom executable, the program crashes, stating the below error message [substituted $(BUILD\_PRODUCTS\_DIR) for the real location of the build products].
```
20... | [
0.05958813801407814,
0.3997582793235779,
0.4359872043132782,
0.0018005507299676538,
0.010285179130733013,
0.2545272409915924,
0.6656628251075745,
-0.32054927945137024,
0.11232099682092667,
-0.45911893248558044,
-0.23057323694229126,
0.5788565874099731,
-0.04308214411139488,
0.1336179673671... | |
it is built for a different architecture than the currently-running
test rig (which is running as unknown).
2009-03-02 19:56:03.568 otest[28060:203] *** NSTask: Task create for path
'$(BUILD_PRODUCTS_DIR)/Unit Tests.octest/Contents/MacOS/Unit Tests'
failed: 8, "Exec format error". Terminating temporary proc... | [
0.08658641576766968,
0.2855697572231293,
0.5856485366821289,
0.008990739472210407,
-0.0893874540925026,
0.010662778280675411,
0.5685595273971558,
-0.11679613590240479,
-0.027958432212471962,
-0.8046249151229858,
0.09062910079956055,
0.8809491395950317,
0.0841066762804985,
0.218335941433906... | |
telling you that it can't load *the test bundle*, and that the reason why it can't load the test bundle is because it doesn't know what architecture it's running as.
The solution is to set `ARCHPREFERENCE` in otest's environment. You can do this in Xcode's custom executable editor. Set it to the architecture you want ... | [
0.4953509569168091,
-0.045235875993967056,
0.04097146913409233,
0.331590473651886,
-0.08168049901723862,
-0.11102500557899475,
0.03821835294365883,
-0.06971289962530136,
0.1390303522348404,
-0.7936990261077881,
-0.0761735811829567,
0.37851232290267944,
-0.45479726791381836,
0.0046378611586... | |
I'm working through a wide variety of procs that have a WHERE clauses that look like this:
```
WHERE ... AND ( ( myTbl.myValue = 1234)
or (myTbl.myValue = 1235) )-- Value = No
```
I've talked this over with some colleagues and this sort of code seems unavoidable. I think it's a good idea to put this sort of c... | [
0.15636590123176575,
0.49104833602905273,
0.026088356971740723,
-0.14343716204166412,
-0.020461518317461014,
0.08806074410676956,
0.13452836871147156,
-0.2034168839454651,
-0.236283540725708,
-0.6317221522331238,
-0.09246629476547241,
0.4478028118610382,
-0.057268302887678146,
0.1471332460... | |
or 1235 is a 0. Or a 'N', etc. That way I can add 'No' values at will without having to change any code. I wouldn't use a UDF for this, too many function calls if you use it in a join.
What are some other options for dealing with special values in your database? Are views a good solution for this? Are there any ways ... | [
0.5799528956413269,
0.09687613695859909,
0.20195886492729187,
0.0663975328207016,
0.020760638639330864,
-0.028988296166062355,
-0.14877411723136902,
-0.29874348640441895,
-0.46200889348983765,
-0.2663215100765228,
0.29204660654067993,
0.34380415081977844,
-0.1364184021949768,
-0.0103556672... | |
join so it's a performance hit.
Update: if anyone has strategies for just getting rid of the damn things that'd be great too. Like I said, talked it over with colleagues and these things seem unavoidable in organizations that have a lot of business logic in the db layer.
PS: I saw some magic number questions, but n... | [
0.5783342123031616,
-0.20966848731040955,
0.14826303720474243,
0.33995839953422546,
-0.1698891520500183,
-0.32594549655914307,
0.5163097381591797,
-0.3210471272468567,
-0.2389434427022934,
-0.3325269818305969,
0.13324831426143646,
0.16082626581192017,
-0.14705756306648254,
-0.2525399327278... | |
1235 in your example), assign a category column and use IN or EXISTS. (Neither of those will be a meaningful performance hit with a small amount of magic numbers and an appropriate index.)
I detest hard-coded numeric values like those in your example for anything except ad hoc SQL statements. It makes maintenance a re... | [
0.3234650790691376,
0.2944074273109436,
-0.011588593944907188,
0.1740739494562149,
-0.2117280811071396,
-0.4264116883277893,
0.4730471670627594,
-0.2044428586959839,
-0.1397741138935089,
-0.269218772649765,
-0.0031027281656861305,
0.4741169214248657,
-0.09068658202886581,
-0.15715293586254... | |
Most Hibernate associations support "fetch" parameter:
```
fetch="join|select"
```
with "select" being default value.
How to decide which one to use for which association?
I tried changing all from "select" to "join" application wide - number of generated queries decreased probably 10 times but performance stayed... | [
0.04721904173493385,
-0.3140489161014557,
0.4467830955982208,
0.02086416259407997,
-0.16468356549739838,
0.15709716081619263,
0.3331493139266968,
-0.30423596501350403,
-0.24055220186710358,
-0.4066582918167114,
0.02890896424651146,
0.04190883785486221,
-0.4736948311328888,
0.05086534470319... | |
on the same server as the application or if the network is really fast, but if there is latency in each database call, it can add up. The join method is a little less efficient on the initial query because you're duplicating the parent columns in every row, but you only make one round-trip to the database.
Generally, ... | [
0.2200157344341278,
-0.18134847283363342,
0.1327405720949173,
0.23861989378929138,
0.19587789475917816,
0.18875840306282043,
0.039544589817523956,
-0.023343542590737343,
-0.17618490755558014,
-0.6075478196144104,
-0.015195833519101143,
0.31946802139282227,
-0.08542633056640625,
0.108716048... | |
Basically I want someone to be able to click a bunch of events on my website, and have them all synced in a pain-free way to their primary Outlook calendar.
* I know I can send an ics with multiple events in it, but this creates a second calendar (unless you import the calendar which is more than 3 clicks).
* I can al... | [
0.33585289120674133,
-0.04245510324835777,
0.3754054605960846,
0.2837360203266144,
-0.027048209682106972,
-0.04282206669449806,
0.08442046493291855,
0.38991305232048035,
-0.42891964316368103,
-0.5946328043937683,
0.27903005480766296,
0.36282628774642944,
-0.22596143186092377,
0.01009249128... | |
to work in Firefox too, so no ActiveXObject hackery.
Three clicks is the "spirit" of the answer. If it takes 4, that's fine.
So far webcal is the best I've got, but being able to stick the events in their original Calendar would be better.
EDIT: Recurrence Rules have been mentioned - Is there a way to use RRULE (BYD... | [
0.3152569830417633,
-0.1686355024576187,
0.7218027710914612,
0.16861273348331451,
-0.20679591596126556,
-0.08489366620779037,
0.45492327213287354,
0.20462021231651306,
-0.27401500940322876,
-0.5972573161125183,
0.13471978902816772,
0.6241958737373352,
-0.23530282080173492,
-0.1122999414801... | |
parameters). So recurrence can't make arbitrary event times in Outlook.
It can't be done the way I want - Outlook sucks.
Best options:
1. If you're ok with a second calendar:
Give them a link to a webcal://blah.com/blah.ics that they can subscribe to and keep forever up to date with Outlook 2007. With Outlook 2003 i... | [
0.0241351630538702,
-0.1704322248697281,
0.596621572971344,
0.02828756719827652,
-0.5573830008506775,
-0.12318041175603867,
0.5592405200004578,
0.016536712646484375,
-0.46309369802474976,
-0.34255528450012207,
0.1340750753879547,
0.6923359632492065,
-0.4584901034832001,
-0.0774896517395973... | |
afford the above:
Gotta do one event at a time. Sucks. | [
0.9420375227928162,
0.23006358742713928,
-0.23266273736953735,
0.16796904802322388,
0.17252592742443085,
-0.10711202025413513,
0.519109845161438,
0.6243330240249634,
-0.07687520980834961,
-0.28022563457489014,
0.3409747779369354,
0.3877427279949188,
0.06043494492769241,
-0.1551079750061035... | |
I've got an old project written in Delphi 4.
I'm looking for a way to:
1. use that code with minimal changes from within .NET
2. use other .NET assemblies from that Delphi code
3. use Visual Studio to work on the solution which will
contain Delphi project and C#
projects.
Is that possible? What will i need for that?
... | [
0.25020459294319153,
-0.10396385937929153,
0.5828765630722046,
0.08351295441389084,
-0.2310965359210968,
-0.2947031557559967,
0.45788252353668213,
-0.16079647839069366,
-0.305094450712204,
-0.7245006561279297,
-0.18177977204322815,
0.5252645611763,
-0.21845313906669617,
0.20601706206798553... | |
the Prism compiler, formerly known as Oxygene) has made available a utility application that attempts to convert the syntax differences automatically, but I haven't tried it on anything yet.
You might be able to reuse some of your old Delphi 4 code by converting what you can to ActiveX controls and using COM to make t... | [
0.4204002022743225,
-0.13263586163520813,
-0.022596348077058792,
0.11043615639209747,
-0.29863759875297546,
-0.0712270587682724,
0.24376684427261353,
-0.14119896292686462,
0.009637344628572464,
-0.8634350299835205,
0.03031362220644951,
0.49061453342437744,
-0.35078325867652893,
-0.20572988... | |
I have an Array of Events and I want to divide them into a 2-dimensional Array based on event\_date (which returns a Time object). But I want it to be by the day part of the date. Here's what I have so far:
```
def divide_events_by_day(events)
# Sort, so we can start with the first day.
events = events.sort { |x,y... | [
0.015013141557574272,
-0.17853301763534546,
0.4313526749610901,
-0.08038149029016495,
0.10709422081708908,
0.03732440248131752,
-0.14444658160209656,
-0.13061334192752838,
-0.2511982321739197,
-0.5748106837272644,
-0.046471405774354935,
0.2350664585828781,
-0.32783058285713196,
0.392914861... | |
# With meaningful hours and minutes.
while events.length > 0 do
# Find events for the current date.
day_events = events.select { |e|
(e.event_date.year == current_date.year) &&
(e.event_date.yday == current_date.yday)
}
# Move them to their subarray.
days << day_events
events = ... | [
0.08120651543140411,
-0.16382423043251038,
0.5102903842926025,
0.1361701786518097,
0.25779080390930176,
0.1569211333990097,
0.10488142818212509,
-0.05310127139091492,
-0.2714325785636902,
-0.5783184766769409,
-0.2524867057800293,
0.20119735598564148,
-0.14401108026504517,
0.450599193572998... | |
day.
current_date = (current_date + (60 * 60 * 24))
end
days
end
```
Any suggestions to make it simpler or faster?
For a start, you could try something like this:
```
def divide_events_by_day(events)
days = [[]]
events.sort_by { |x| x.event_date }.each { |e|
if days.last.empty? or days.last.... | [
0.2561176121234894,
-0.27168846130371094,
0.6135298609733582,
-0.0023389849811792374,
0.333646684885025,
-0.16024768352508545,
-0.04244454950094223,
-0.07799573987722397,
-0.3729802370071411,
-0.700087308883667,
-0.21075905859470367,
0.26201745867729187,
-0.41946953535079956,
0.64484190940... | |
[e]
end
}
days
end
```
It doesn't produce empty days, but other than that follows yours pretty closely.
I have a `Time#date` method on my machine, but I'm not seeing it in a clean distribution build (1.8.7), so you may need to add something like:
```
class Time
def date
to_i/(6... | [
0.406301885843277,
-0.049793753772974014,
0.46054205298423767,
-0.08258814364671707,
0.3619672656059265,
-0.1066281870007515,
0.06727368384599686,
0.15073558688163757,
-0.3063778281211853,
-0.6905163526535034,
-0.2312774509191513,
0.3435981571674347,
-0.331045925617218,
0.4150559902191162,... | |
I was training a new developer the other day and realized I don't know the actual term for "catching" a return value in a variable. For example, consider this pseudocoded method:
```
String updateString(newPart) {
string += newPart;
return string;
}
```
Assume this is being called to simply update the string - t... | [
0.2785659432411194,
-0.28204771876335144,
0.10047084838151932,
-0.2128729671239853,
0.1632080227136612,
-0.246784046292305,
0.14842720329761505,
-0.024462047964334488,
-0.1324549913406372,
-0.1151520311832428,
-0.008286275900900364,
0.6323164701461792,
-0.49196991324424744,
-0.057052928954... | |
you were trying to ask someone to make this change, what terminology would you use? Is it different in different languages (since technically, you may be calling either a function or a method, depending on the language)?
**assign** the return value *to a variable*? | [
0.38010865449905396,
-0.22841952741146088,
0.014644483104348183,
-0.10538286715745926,
-0.11389221251010895,
0.1288852095603943,
0.038748182356357574,
-0.17280294001102448,
-0.12046556174755096,
-0.22563524544239044,
0.06311733275651932,
0.515384316444397,
-0.3153398334980011,
0.1950607001... | |
If I have a table as shown below, and have a up and down arrow that moves rows up and down, how would I go about swapping rows in JQuery?
```
<tr id="Row1">
<td>Some label</td>
<td>Some complex control</td>
</tr>
<tr id="Row2">
<td>Some label</td>
<td>Some complex control</td>
</tr>
<tr id="Row3">
<td>Some l... | [
-0.1591404676437378,
-0.1366903930902481,
0.3042350709438324,
-0.07041077315807343,
0.017427287995815277,
0.1958691030740738,
-0.12135827541351318,
-0.6015856862068176,
-0.04779244214296341,
-0.7278257608413696,
-0.00942797027528286,
0.4173695147037506,
-0.42969584465026855,
-0.29206362366... | |
Is there any place to get patterns for shipping tracking numbers for all shipping companies like UPS,FedEX, DHL, AirBorne, USPS ...
Fedex:
XXXXXXXXXXXX (12 numbers)
DHL:
* International Air Freight Shipments -
7 digit HAWB number 1234567
* International Ocean Shipments - 9
character HBL number SEA123456
* U.S. Domest... | [
0.23301580548286438,
-0.18940070271492004,
0.3572775721549988,
0.1520448476076126,
0.05242052674293518,
0.25424808263778687,
0.06282351166009903,
0.3816767632961273,
-0.7356482744216919,
-0.2950327694416046,
-0.2895251214504242,
-0.10799551755189896,
-0.39966824650764465,
-0.06083422154188... | |
I have some data that I would like to gzip, uuencode and then print to standard out. What I basically have is:
```
compressor = Popen("gzip", stdin = subprocess.PIPE, stdout = subprocess.PIPE)
encoder = Popen(["uuencode", "dummy"], stdin = compressor.stdout)
```
The way I feed data to the compressor is through co... | [
0.38823920488357544,
0.2672732472419739,
0.4041909873485565,
-0.3480476140975952,
-0.11815689504146576,
0.15588900446891785,
0.22773173451423645,
-0.08600973337888718,
0.19241294264793396,
-0.8818695545196533,
-0.04648134484887123,
0.4362691640853882,
-0.4560861587524414,
0.342869818210601... | |
terminate and stalls on compressor.wait().
Suggestions? In this case, gzip is an example and I really need to do something with piping the output of one process to another.
Note: The data I need to compress won't fit in memory, so communicate isn't really a good option here. Also, if I just run
```
compressor.commu... | [
0.40119242668151855,
-0.05621228367090225,
0.033949535340070724,
-0.21807213127613068,
0.0966549664735794,
0.019548287615180016,
0.3206762671470642,
-0.05172672122716904,
-0.0492008812725544,
-0.5090346336364746,
0.065242700278759,
0.5318758487701416,
-0.385325163602829,
0.4124990701675415... | |
whine when you launch it if there's no incoming pipe in just the right way (try launching the darn thing on it's own in a Popen call to see the explosion with just PIPE as the stdin and stdout)
Try this:
```
encoder = Popen(["uuencode", "dummy"], stdin=PIPE, stdout=PIPE)
compressor = Popen("gzip", stdin=PIPE, stdout=... | [
0.6591911315917969,
-0.31948408484458923,
0.311238557100296,
-0.19988113641738892,
-0.23888136446475983,
-0.059439174830913544,
0.4148782193660736,
-0.3688889145851135,
0.23004935681819916,
-0.5914896130561829,
-0.16816657781600952,
0.8494846820831299,
-0.4878654181957245,
0.01571397297084... | |
about uuencode. As a shell program, it's default behaviour is to expect console input. If you run it without a "live" incoming pipe, it will block waiting for console input. By opening the encoder second, before you had sent material down the compressor pipe, the encoder was blocking waiting for you to start typing. Je... | [
0.24233044683933258,
-0.038833267986774445,
0.03341381624341011,
-0.42013663053512573,
-0.4287490248680115,
-0.08074894547462463,
0.33207088708877563,
0.10236869752407074,
0.2790810465812683,
-0.6114708781242371,
0.06003890186548233,
0.1806437224149704,
-0.4261259436607361,
0.3278269767761... | |
I am researching Prism v2 by going thru the quickstarts. And I have created a WCF service with the following signature:
```
namespace HelloWorld.Silverlight.Web
{
[ServiceContract(Namespace = "http://helloworld.org/messaging")]
[AspNetCompatibilityRequirements(RequirementsMode =
AspNet... | [
0.37306708097457886,
-0.017619021236896515,
0.9366673231124878,
-0.1916327178478241,
-0.39584338665008545,
-0.2646498680114746,
0.7409348487854004,
-0.24961698055267334,
-0.10835576057434082,
-0.5031337141990662,
-0.12529753148555756,
0.36608248949050903,
-0.2880875766277313,
0.25848954916... | |
}
[OperationContract]
public string GetMessage()
{
return message;
}
}
}
```
When I add a service reference to this service in my silverlight project it generates an interface and a class:
```
[System.ServiceModel.ServiceContractAttribute
(Namespace="http://helloworld.org/messaging",... | [
-0.1674671769142151,
-0.05084173381328583,
0.5897667407989502,
-0.21881775557994843,
-0.056137990206480026,
0.1581803858280182,
0.5587111115455627,
-0.3991760015487671,
-0.007711262907832861,
-0.6321130990982056,
-0.39072200655937195,
0.5599246621131897,
-0.5052459836006165,
0.157057732343... | |
EndUpdateMessage(System.IAsyncResult result);
[System.ServiceModel.OperationContractAttribute(AsyncPattern=true, Action="http://helloworld.org/messaging/HelloWorldMessageService/GetMessage", ReplyAction="http://helloworld.org/messaging/HelloWorldMessageService/GetMessageResponse")]
System.IAsyncResult BeginGet... | [
-0.2970832884311676,
0.10798010230064392,
0.6141238212585449,
-0.19364017248153687,
0.11655168980360031,
0.013005111366510391,
0.6511656641960144,
-0.2951961159706116,
-0.2237190455198288,
-0.7200005650520325,
-0.3449089229106903,
0.34360066056251526,
-0.333863765001297,
0.3654734492301941... | |
Invalid cross-thread access`.
```
string messageresult = _service.EndGetMessage(result);
Application.Current.RootVisual.Dispatcher.BeginInvoke(() => this.Message = messageresult );
```
The exception is thrown by `Application.Current.RootVisual`.
Just revisiting old posts left unanswered where I finally found an an... | [
0.007742202840745449,
0.4635869264602661,
0.38569384813308716,
0.017545131966471672,
-0.07007390260696411,
0.07998006045818329,
0.8718732595443726,
-0.04506632685661316,
-0.38285404443740845,
-0.5544707179069519,
-0.1230168417096138,
0.2580161690711975,
-0.2170569747686386,
0.8397278189659... | |
When you create an application from the "View-Based" template in the iPhoneSDK the following code is generated. I basically understand what is happening here, but I do not see where window and viewController are instantiated. Any Help?
```
@class jojojViewController;
@interface jojojAppDelegate : NSObject <UIApplicat... | [
-0.06717800348997116,
0.002917584730312228,
0.6978905200958252,
-0.22545617818832397,
0.13966186344623566,
0.032460641115903854,
0.2875918447971344,
-0.5167977213859558,
-0.23119132220745087,
-0.7639312744140625,
-0.44062721729278564,
0.727707028388977,
-0.18961232900619507,
0.057112459093... | |
[window release];
[super dealloc];
}
@end
```
They come from the MainWindow.xib (or similar) file in your project.
This is the file that in your info.plist is set as the application window. When your application starts this xib is loaded and the viewcontroller and window are unarchived and loaded. | [
0.40512385964393616,
-0.0028689175378531218,
0.7732440829277039,
-0.1564352959394455,
0.06398357450962067,
-0.37818601727485657,
0.04288091883063316,
0.1673034131526947,
-0.12867356836795807,
-0.8900814652442932,
-0.4630725681781769,
0.5279088616371155,
-0.20872756838798523,
0.230146482586... | |
Is there a standard and reliable way of creating a temporary directory inside a Java application? There's [an entry in Java's issue database](http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4735419), which has a bit of code in the comments, but I wonder if there is a standard solution to be found in one of the usua... | [
-0.024515725672245026,
0.15815044939517975,
0.7452412247657776,
-0.1785602569580078,
0.1882825493812561,
-0.22297349572181702,
0.15526513755321503,
-0.3028709888458252,
-0.2962817847728729,
-0.6615376472473145,
-0.22850623726844788,
0.47752276062965393,
-0.2417851686477661,
0.0458142459392... | |
if(!(temp.delete()))
{
throw new IOException("Could not delete temp file: " + temp.getAbsolutePath());
}
if(!(temp.mkdir()))
{
throw new IOException("Could not create temp directory: " + temp.getAbsolutePath());
}
return (temp);
}
```
You could make better exceptions (subclas... | [
0.1326330006122589,
-0.09389138221740723,
0.16585344076156616,
-0.2098761647939682,
0.08779190480709076,
0.05167523771524429,
0.4874204695224762,
-0.1664293110370636,
-0.09222929924726486,
-0.5064818859100342,
-0.3811214566230774,
0.5477880835533142,
-0.4041913151741028,
0.0847023203969001... | |
How can I refer to a nested div by id when it has the same id as a div nested in a similarly named div
eg
```
<div id="obj1">
<div id="Meta">
<meta></meta>
</div>
</div>
<div id="obj2">
<div id="Meta">
<meta></meta>
</div>
</div>
```
I want to get the innerHTML of meta
```
document... | [
0.12433314323425293,
0.047649625688791275,
0.39761102199554443,
0.06751025468111038,
-0.217939093708992,
0.09995429962873459,
0.11180884391069412,
-0.3457411229610443,
-0.10933627188205719,
-0.8121073246002197,
-0.11277284473180771,
0.1650431603193283,
-0.3862116038799286,
0.14162789285182... | |
have a repeating element.
Code there doesn't work because you're referring to an element by unique ID, but have more than one on the page. | [
0.4320550560951233,
0.25189408659935,
-0.11707261204719543,
0.3299282193183899,
-0.169225811958313,
-0.14762645959854126,
0.28506579995155334,
0.021466055884957314,
-0.3932410180568695,
-0.4527907073497772,
-0.020853416994214058,
-0.2904947102069855,
-0.5196855068206787,
0.2696037292480469... | |
It seems like every effort talking to Sharepoint through its web services needs a domain\user name. For example:
```
UserProfileService.GetUserProfileByName(string accountName)
```
The accountName should be domain\user name.
If I only got full name (FirstName LastName), is it possible to communicate with SharePoin... | [
-0.03823987767100334,
0.09531830251216888,
0.8546633124351501,
-0.026100462302565575,
0.1542513519525528,
-0.202238529920578,
0.2631298899650574,
0.01438920758664608,
-0.051644351333379745,
-0.8236767649650574,
-0.27659571170806885,
0.5722030401229858,
-0.3098478615283966,
0.32240641117095... | |
= new DirectoryEntry(ADPATH, USERNAME, PASSWORD, AuthenticationTypes.Secure);
return directoryObject;
}
public string GetUserNameByCompleteName(string completeName)
{
DirectoryEntry adObject = GetDirectoryObject();
//filter based on complete name
DirectorySearcher searcher ... | [
-0.3348962068557739,
-0.5007631182670593,
0.8947001695632935,
-0.494893878698349,
0.021551650017499924,
0.0036038761027157307,
0.2983713448047638,
-0.2104720026254654,
0.05435016378760338,
-0.7913780808448792,
-0.5977586507797241,
0.6409928202629089,
-0.48508432507514954,
0.261103957891464... | |
DirectoryEntry userInfo = result.GetDirectoryEntry();
//getting user name
string userName = (string)userInfo.Properties["samaccountname"].Value ?? string.Empty;
userInfo.Close();
adObject.Close();
return DOMAIN + userName;
}
```
Here you go: if eregi() fail... | [
-0.13061906397342682,
-0.13521037995815277,
0.7836742401123047,
-0.3719833791255951,
0.41901370882987976,
-0.07543498277664185,
0.09507922828197479,
-0.11395690590143204,
-0.05060519278049469,
-0.5954263806343079,
-0.38416844606399536,
0.6934672594070435,
-0.39845219254493713,
0.3188891410... | |
be executed. If it matches, but there's nothing between the tags, $outdata will be assigned an empty string. In both cases, !$outdata will be true, so we can fallback to a second match on the title tag instead.
```
if(eregi("<linkto>(.*?)</linkto>", $string, $link_match)) {
$outdata = $link_match[1];
}
if(!$outdat... | [
0.20941166579723358,
-0.20307472348213196,
0.392667680978775,
-0.141673743724823,
0.012384074740111828,
-0.039654556661844254,
0.38844189047813416,
-0.5220722556114197,
-0.028510238975286484,
-0.3717813491821289,
-0.35846906900405884,
0.6407661437988281,
-0.6176387071609497,
0.033150661736... | |
title tag!
```
Because it tries to match as much as possible, as long as the text is between any and any other !. In the (.\*?) form, the match does what you'd expect - it matches
```
Page Title
```
And stops as soon as it is able.
...
As an aside, this thing is an interesting scheme, but why do you need it? Pag... | [
0.31054121255874634,
-0.037615809589624405,
0.8279911875724792,
0.0681287944316864,
-0.20575805008411407,
-0.32182398438453674,
0.0465063713490963,
-0.09054157137870789,
-0.10801318287849426,
-0.45169776678085327,
-0.12736643850803375,
0.8743270039558411,
-0.3487453758716583,
0.20893210172... | |
I have a feeling I may already know the answer to this question, but I'll ask it anyway.
Are there any *better* ways of using the .Net Profiling API than the COM/Managed C++ route?
My reluctance to follow the suggested COM approach is as such:
* Effort, it's a lot of legwork to get started
* Don't like the magic inv... | [
0.5568515658378601,
0.08119252324104309,
0.0026370773557573557,
0.23493558168411255,
-0.19332192838191986,
-0.14263755083084106,
0.3880418837070465,
-0.06334086507558823,
-0.2037491798400879,
-0.6867963075637817,
0.07565729320049286,
0.5429796576499939,
-0.16215495765209198,
0.030704932287... | |
attach a debugger to the actual C++ layer, so you're back to log files and such
I came across a project called [NProf](http://sourceforge.net/projects/nprof), which was an attempt to wrap the API with a managed layer. Unfortunately it hasn't been updated since 2003.
Does anyone have any leads that might help? This al... | [
0.5560920834541321,
0.13400183618068695,
0.16154338419437408,
-0.05048058554530144,
-0.48904141783714294,
-0.4348660707473755,
0.15479137003421783,
-0.0967186689376831,
-0.15174947679042816,
-0.22574535012245178,
0.2884168028831482,
0.5732259154319763,
-0.3995097279548645,
0.04240791499614... | |
do its job. Not sure how good or bad the code is, and of how much help it'll be for you (GPL may be an issue as well), but its something you may want to take a look at. It's been updated late last year and then went silent, so I'm not sure if the project is still active. | [
0.6948221325874329,
0.08171483874320984,
0.1906665414571762,
-0.061830174177885056,
0.10933412611484528,
-0.4230903089046478,
0.44288578629493713,
0.5593817830085754,
0.045302052050828934,
-0.2138746976852417,
0.28581109642982483,
0.4952065646648407,
0.1525883972644806,
-0.1649852544069290... | |
Which physical file stores the main form name for a Delphi application?
e.g. `MyApplication` has a form `MyForm` which is set as the "Main form" via Project options. Where is the information "Main Form = MyForm" actually stored?
In the Delphi IDE the application "Main form" is specified via the menu: `Project | Optio... | [
0.14429296553134918,
-0.10002749413251877,
0.6383979320526123,
-0.09088323265314102,
-0.09030366688966751,
-0.1602269560098648,
-0.12047234177589417,
-0.12436749041080475,
0.04958399757742882,
-0.6285360455513,
-0.4818468987941742,
0.27773845195770264,
-0.16475872695446014,
0.0188078600913... | |
application's main form.
Note that a TDataModule doesn't satisfy the above requirement; that's actually useful, as you can autocreate a datamodule before your main form and then access that datamodule in the main form's constructor. | [
0.21175700426101685,
-0.19065110385417938,
0.5280352830886841,
0.246116504073143,
-0.06520263850688934,
-0.22330105304718018,
0.37581247091293335,
-0.22230371832847595,
0.3013833165168762,
-0.5217054486274719,
-0.2560003101825714,
0.6730965375900269,
-0.42438626289367676,
-0.04309666156768... | |
I've been using EasyEclispe for a long time, and I've noticed that they haven't really kept up-to-date with the main Eclipse distro. So I was wondering if anybody knew of an EasyEclipse-like distribution that would contain common things people in different areas of Java/Groovy development might need.
Go to the [eclipse... | [
0.3573967218399048,
0.014963877387344837,
0.03933131694793701,
-0.016702448949217796,
-0.28737708926200867,
0.07686527073383331,
-0.07686998695135117,
0.5455965399742126,
-0.5264462232589722,
-0.655501127243042,
0.016988130286335945,
0.48530349135398865,
-0.33272311091423035,
-0.2724485695... | |
I want to override certain function calls to various APIs for the sake of logging the calls, but I also might want to manipulate data before it is sent to the actual function.
For example, say I use a function called `getObjectName` thousands of times in my source code. I want to temporarily override this function som... | [
0.42245006561279297,
0.11123131960630417,
-0.04732740670442581,
-0.20935390889644623,
0.07016704231500626,
-0.10075726360082626,
0.6789069771766663,
-0.22609417140483856,
-0.06013001129031181,
-0.36033108830451965,
-0.03478986397385597,
0.6774888038635254,
-0.6506080031394958,
0.1694183051... | |
return "(null)";
else
return "name should be here";
}
```
I compile all my other source as I normally would, but I link it against this function first before linking with the API's library. This works fine except I can obviously not call the real function inside my overriding function.
Is there an easier... | [
0.4546542763710022,
0.3879043161869049,
0.21054893732070923,
-0.18710185587406158,
0.028351493179798126,
-0.1765003353357315,
0.37164542078971863,
-0.15319016575813293,
0.11444003880023956,
-0.5265417098999023,
0.06552278250455856,
0.7517749071121216,
-0.39725273847579956,
0.14834953844547... | |
actual source code of my program.
If it's only for your source that you want to capture/modify the calls, the simplest solution is to put together a header file (`intercept.h`) with:
```c
#ifdef INTERCEPT
#define getObjectName(x) myGetObjectName(x)
#endif
```
Then you implement the function as follows (in `inter... | [
0.15000151097774506,
-0.028753602877259254,
0.5071364045143127,
0.1406855583190918,
0.09229219704866409,
0.005786244757473469,
0.12538844347000122,
0.06304915249347687,
0.20012399554252625,
-0.45975422859191895,
-0.060322992503643036,
0.7473778128623962,
-0.35529404878616333,
-0.0463132783... | |
real one, whereas your function will still call the real one.
Compiling without the "`-DINTERCEPT`" will prevent interception from occurring.
It's a bit trickier if you want to intercept all calls (not just those from your source) - this can generally be done with dynamic loading and resolution of the real function (... | [
-0.12713922560214996,
-0.40547603368759155,
0.16119544208049774,
0.27620500326156616,
-0.11405689269304276,
-0.24466505646705627,
0.4167449176311493,
0.012066335417330265,
-0.05658898130059242,
-0.5535223484039307,
-0.2389034777879715,
1.0741798877716064,
-0.6075950860977173,
-0.0218422003... | |
Lets say you build an application which needs to serve several customers (data is never shared between customers) and the customer data itself is sensitive.
How would you design the database to prevent that suddenly (e.g. a bug) data from one customer is visible to another?
E.g. We have a projects table which contain... | [
0.734417200088501,
0.08620073646306992,
-0.027750760316848755,
0.2967936098575592,
0.12562884390354156,
-0.20407481491565704,
-0.12177599966526031,
-0.006558951921761036,
-0.44311368465423584,
-0.45623475313186646,
0.0978258028626442,
0.43151989579200745,
-0.2181679606437683,
0.16900391876... | |
is a good approach (e.g. change of the schema would require the maintenance of all customer schemes).
**Important:** The application contains master data which is shared across all customers (e.g. customer accounts, settings, templates, etc.) as well. So another disadvantage what I expect would be the maintenance of ... | [
0.47520142793655396,
0.2036612331867218,
0.37293529510498047,
0.20151862502098083,
-0.004011358600109816,
-0.2124592661857605,
0.30563411116600037,
-0.274760901927948,
-0.39005473256111145,
-0.6248441934585571,
-0.0005703512579202652,
0.801913321018219,
-0.08610931038856506,
-0.02050423808... | |
about cross-sharing data. If you have high quality code where the authorization logic is secure, then I would always use one schema; maintenance is so much easier that way
On the flip side. If you have cobbled together asp pages with no business object library with no standard and centralized authorization logic; then... | [
0.759051501750946,
0.26495790481567383,
0.05452719330787659,
0.14350444078445435,
0.017060909420251846,
-0.3378792405128479,
0.17130115628242493,
0.280678927898407,
-0.25902649760246277,
-0.5480579137802124,
0.3719145357608795,
0.5099555850028992,
-0.05193892493844032,
0.10762027651071548,... | |
For instance, if I need to fill a bounding box that is 100px wide by 50px tall, the following input images would have the following behavior:
1. 200w x 200h gets scaled down 50% and
25% gets chopped off the top and
bottom.
2. 200w x 100h gets scaled down 50%
with no cropping.
3. 100w x 200h gets is not scaled, but
75p... | [
0.3605797588825226,
-0.28636643290519714,
0.18934142589569092,
0.021646663546562195,
-0.2773945927619934,
0.3621554970741272,
0.22605016827583313,
-0.7321972846984863,
0.05983801186084747,
-0.5996047258377075,
-0.16801615059375763,
0.1789582073688507,
-0.08047802746295929,
-0.0317383706569... | |
is great too!
What you're asking for is pretty easy. Calculate the different scaling factors for the width and the height, then pick the larger one for your actual scale factor. Multiply your input size by the scale, and crop whichever one comes out too large.
```
scale = max(maxwidth/oldwidth, maxheight/oldheight)
sc... | [
0.3096854090690613,
-0.29267367720603943,
0.35265418887138367,
-0.3068310618400574,
0.1570388227701187,
0.08578602969646454,
0.150527685880661,
-0.1257375180721283,
-0.5644344687461853,
-0.4839598834514618,
-0.15659591555595398,
0.7978794574737549,
0.07740771025419235,
-0.21198770403862,
... | |
- cropleft
``` | [
0.2261599898338318,
-0.03410443663597107,
0.24659334123134613,
0.05489926412701607,
-0.031412653625011444,
0.19966168701648712,
-0.4618740379810333,
0.23550790548324585,
-0.11531735956668854,
-0.39428964257240295,
-0.3183627128601074,
0.8228459358215332,
-0.20027993619441986,
0.27530607581... | |
Since the age of the dinosaurs, Turbo Pascal and nowadays Delphi have a Write() and WriteLn() procedure that quietly do some neat stuff.
* The number of parameters is variable;
* Each variable can be of all sorts of types; you can supply integers, doubles, strings, booleans, and mix them all up in any order;
* You can... | [
0.2944665551185608,
0.07368471473455429,
0.15265341103076935,
-0.1509917974472046,
0.1038602739572525,
-0.011515208519995213,
0.3029468059539795,
0.04734918102622032,
-0.21318337321281433,
-0.5764691233634949,
0.13462437689304352,
0.6141738891601562,
-0.3077225387096405,
-0.015098043717443... | |
WriteLn don't have the same brackets in the code completion dropdown. Therefore it looks like this was not automatically generated, but it was hard-coded by someone.
Anyway, am I able to write procedures like these myself, or is all of this some magic hardcoded compiler trickery?
Writeln is what we call a compiler "ma... | [
0.48682504892349243,
-0.08244109898805618,
0.06918244063854218,
-0.049828991293907166,
-0.5391494631767273,
-0.34018805623054504,
0.6901761889457703,
-0.18770405650138855,
-0.24785734713077545,
-0.2747562527656555,
0.14216798543930054,
0.6164838671684265,
-0.16461145877838135,
-0.031128106... | |
does all the same things as the built-in writeln without modifying the compiler. | [
0.41191476583480835,
0.013486340641975403,
0.025593193247914314,
-0.032169830054044724,
-0.04419320076704025,
-0.43658459186553955,
0.3318561017513275,
-0.00539099145680666,
0.2514533996582031,
-0.3378881514072418,
-0.10859382897615433,
0.6185093522071838,
0.025397680699825287,
-0.08250331... | |
I need to locate the index position of a record in a large database table in order to preset a pager to that item's page. I need an efficient SQL query that can give me this number. Sadly SQL doesn't offer something like:
```
SELECT INDEX(*) FROM users WHERE userid='123'
```
Any bright ideas?
EDIT: Lets assume ther... | [
0.21756191551685333,
0.34480616450309753,
0.31590715050697327,
0.13809390366077423,
0.1626613587141037,
-0.0022578625939786434,
-0.08255868405103683,
-0.1927797496318817,
-0.3233717083930969,
-0.8313283920288086,
0.021870603784918785,
0.28810814023017883,
-0.3294501304626465,
0.27408590912... | |
chosen - because i want to provide information about that already chosen item within a context that allows a user to choose a different one.
You might use something like (pseudo-code):
* counting query: $n = select count(uid) from {users} where ... (your paging condition including userid 123 as the limit)
* $page = fl... | [
0.017283275723457336,
-0.2346067726612091,
0.5318678021430969,
0.07597634196281433,
0.04846925288438797,
0.10786895453929901,
-0.32095688581466675,
-0.4737345576286316,
-0.3019654154777527,
-0.5887249112129211,
0.01709721051156521,
0.23549556732177734,
-0.3666844666004181,
0.09143379330635... | |
to build the counting query automatically. | [
0.20823876559734344,
0.16819603741168976,
0.035130441188812256,
0.15227222442626953,
-0.10749264061450958,
0.1348697543144226,
-0.0733470469713211,
-0.5331336259841919,
-0.17913031578063965,
-0.4342147707939148,
0.025260699912905693,
0.5008491277694702,
-0.25023695826530457,
-0.36669456958... | |
How can I construct a stored procedure that will allow me to pass (for example) an `@IDList` so that I can write:
```
Select * from Foo Where ID in @IDList
```
Is this doable?
see this answer...
[T-SQL stored procedure that accepts multiple Id values](https://stackoverflow.com/questions/43249/t-sql-stored-procedure... | [
0.0661899670958519,
0.08054551482200623,
0.14195004105567932,
0.07914885133504868,
0.16548191010951996,
-0.11758188903331757,
0.23821090161800385,
-0.4495750069618225,
-0.22634701430797577,
-0.2993345558643341,
0.015244930051267147,
0.3299127221107483,
-0.24003927409648895,
-0.047540087252... | |
Overloading the comparison operator, how to compare if the two variables points to the same object(i.e. not value)
```
public static bool operator ==(Landscape a, Landscape b)
{
return a.Width == b.Width && a.Height == b.Height;
}
public static bool operator !=(Landscape a, Landscape b)
{
return !(a.Width == ... | [
-0.0244919266551733,
0.08123603463172913,
0.4427095949649811,
-0.09321818500757217,
-0.3127554655075073,
0.3088706433773041,
0.2767757475376129,
-0.6555022597312927,
0.005845136009156704,
-0.5177649259567261,
-0.1369631588459015,
0.8728194832801819,
-0.5161452889442444,
0.30389052629470825... | |
I'm building an object to search orders in my database. There are a bunch of possible parameters that the user can set, and they can set as many as then want for each search. I've created setter methods to collect all the parameters needed for the search.
My question is this. What would be "best practice"
1. Storing ... | [
0.6246883869171143,
-0.009651008993387222,
0.22960492968559265,
0.0663435235619545,
0.0647486075758934,
-0.14607426524162292,
0.08071105182170868,
-0.5571195483207703,
0.1460532695055008,
-0.5391088128089905,
0.2926962375640869,
0.6309871077537537,
-0.38440895080566406,
0.0702514499425888,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.