text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
I'm currently enabling JSON calls to my web services using the ScriptService attribute. The problem is that one of my classes references a second class and .Net is not picking up and writing out the JavaScript for the second class.
As a workaround I can write a dummy method that just returns the second class. Then .N... | [
0.3568863868713379,
-0.025680357590317726,
0.27863287925720215,
-0.04503027722239494,
-0.17659665644168854,
-0.14970329403877258,
0.2513355612754822,
-0.1424424648284912,
-0.15353085100650787,
-0.8247142434120178,
-0.045258812606334686,
0.5794782638549805,
-0.4193721115589142,
0.3316712975... | |
class Class1 {
public Class2 class2 { get; set; }
}
[Serializable]
public class Class2 {
}
```
MyService.asmx/js won't write code to allow me to instantiate Class2 in order for me to populate Class1. But I can make it work if I add:
```
[WebMethod]
public Class2 Dummy() {
return new Class2();
}
```
to MyS... | [
0.1441880166530609,
-0.03774790093302727,
0.26566311717033386,
0.021529385820031166,
-0.1774667352437973,
-0.18997585773468018,
0.3117864429950714,
-0.10145080834627151,
-0.2241826355457306,
-0.5847039818763733,
-0.25074172019958496,
0.2648014426231384,
-0.45363813638687134,
0.276158183813... | |
{
[WebMethod]
public void SaveClass1(Class1 class1) {
// ...
}
}
``` | [
0.12815220654010773,
-0.07044218480587006,
-0.03123021498322487,
0.05759883299469948,
0.22082380950450897,
-0.08571918308734894,
0.45769497752189636,
0.13044269382953644,
-0.12169298529624939,
-0.8276175856590271,
-0.12827689945697784,
0.4313160181045532,
-0.4219414293766022,
0.23414291441... | |
I've seen a lot of links to MSDN and "works on my machine!" answers so I'd like to ask my question with the exact steps to duplicate what I'm doing. Because we are using an already existing webservice, I'm asking with the context of having a webservice hosted outside of my project, unlike many of the tutorials and vide... | [
0.4986664354801178,
-0.014641652815043926,
0.2449667900800705,
0.23929817974567413,
0.04087544232606888,
-0.018499312922358513,
0.3190825879573822,
0.06522177159786224,
-0.010147281922399998,
-0.7117533087730408,
0.08558965474367142,
0.5380546450614929,
-0.12365367263555527,
0.169260755181... | |
> On my machine, the URL is: "<http://localhost:15511/WebSite5/Service.asmx>"
\*\*\* Start a new instance of Visual Studio, create a Silverlight Web Application Project.
\*\*\* Stick a single button on there with an event handler to call the web service. I personally nuke the Grid and use a simple StackPanel. eg.
`... | [
0.3699379861354828,
0.41427886486053467,
0.559665322303772,
-0.36205238103866577,
-0.4100152552127838,
-0.01923946663737297,
0.06941833347082138,
-0.13233928382396698,
-0.18200239539146423,
-0.640240490436554,
-0.0321316123008728,
0.2533893585205078,
-0.076970174908638,
0.10466274619102478... | |
<TextBlock Text="Test"/>
</Button.Content>
</Button>
</StackPanel>
</UserControl>
```
Add the web reference, using statement and event handler for the Button\_Click:
```
private void Button_Click(object sender, RoutedEventArgs e)
{
ServiceSoapClient client = new ServiceSoapCli... | [
0.07886159420013428,
-0.10072091966867447,
0.9126065373420715,
-0.2768320143222809,
-0.03838099539279938,
0.08549676835536957,
0.3077925741672516,
-0.18884915113449097,
-0.06386923789978027,
-0.5931150913238525,
-0.3844783902168274,
0.3931870460510254,
-0.43626490235328674,
0.1755072474479... | |
};
client.HelloWorldAsync();
}
```
* Run the Silverlight Application. In my case I'm going to my Silverlight Test Page at:
<http://localhost:15558/SilverlightApplication1TestPage.aspx>
Run and of course it blows up because of crossdomain issues. So next add the **clientaccesspolicy.xml** file with the f... | [
0.131601482629776,
0.3124467730522156,
0.708443820476532,
-0.2731069326400757,
-0.04669399559497833,
-0.2676808536052704,
0.21782709658145905,
0.018322201445698738,
-0.0756685882806778,
-0.6875144243240356,
-0.2858349084854126,
0.44040173292160034,
-0.47114527225494385,
0.4379778802394867,... | |
<resource include-subpaths="true" path="/"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
```
This should open things up since it's got a wildcard for headers, uris, and resources, right?
* Run again and you get an error:
An error occurred while trying to make a request to URI '<http://... | [
0.3027081787586212,
0.03191850334405899,
0.18575607240200043,
-0.06637056171894073,
0.046948473900556564,
-0.2531939446926117,
0.5774494409561157,
-0.11252588033676147,
-0.2854582369327545,
-0.8328575491905212,
-0.2509039640426636,
0.3262028098106384,
-0.1813819259405136,
0.410221695899963... | |
to ensure it allows SOAP-related HTTP headers to be sent.
So question: is there a secret to the clientaccesspolicy file? One could alternately try with the crossdomain.xml but it gives a similar result.
I've had this same problem a couple of times. In the past I've solved this by using the Web App as start up, but it ... | [
0.7901243567466736,
0.029571019113063812,
0.32346662878990173,
0.011894271709024906,
-0.2579502463340759,
-0.24031949043273926,
0.36248549818992615,
-0.04841461777687073,
-0.14419610798358917,
-0.41041022539138794,
0.545254647731781,
0.27217018604278564,
-0.17410694062709808,
0.31641680002... | |
Assuming a series of points in 2d space that do not self-intersect, what is an efficient method of determining the area of the resulting polygon?
As a side note, this is not homework and I am not looking for code. I am looking for a description I can use to implement my own method. I have my ideas about pulling a sequ... | [
0.30010145902633667,
0.19042398035526276,
0.2374209761619568,
-0.10772460699081421,
-0.37896138429641724,
0.19296663999557495,
0.12186501175165176,
-0.35777631402015686,
-0.26798945665359497,
-0.7035290002822876,
-0.023216966539621353,
0.19274529814720154,
-0.1304260641336441,
0.1438654363... | |
vertex. Much simpler than triangulation.
Python code, given a polygon represented as a list of (x,y) vertex coordinates, implicitly wrapping around from the last vertex to the first:
```
def area(p):
return 0.5 * abs(sum(x0*y1 - x1*y0
for ((x0, y0), (x1, y1)) in segments(p)))
def segment... | [
-0.12944917380809784,
-0.16135543584823608,
0.3177676200866699,
-0.06200166419148445,
-0.29617929458618164,
0.40013906359672546,
0.2210218757390976,
-0.5374967455863953,
-0.39601850509643555,
-0.6972141861915588,
-0.2569679617881775,
-0.13758766651153564,
-0.27010324597358704,
-0.000084981... | |
exactly in the way a [planimeter](https://en.wikipedia.org/wiki/Planimeter#Principle_of_the_linear_planimeter) works. More specifically:
Formula above =
`integral_over_perimeter(-y dx + x dy) =`
`integral_over_area((-(-dy)/dy+dx/dx) dy dx) =`
`2 Area` | [
0.06274031102657318,
-0.39762336015701294,
0.9400790333747864,
-0.2559478282928467,
0.1248093768954277,
-0.3237655460834503,
0.07372471690177917,
-0.8472651839256287,
-0.12596039474010468,
-0.3935917615890503,
-0.11070483177900314,
0.22606238722801208,
-0.15745963156223297,
0.2276261746883... | |
I have a large query (not written by me, but I'm making some modifications). One thing that kind of bugs me is that I've got the same COALESCE function in about four places. Is there a way to factor that out, possibly by joining with a select from DUAL? Is there a performance benefit to factoring it out?
Here is the q... | [
0.17152507603168488,
-0.13074330985546112,
0.12066883593797684,
-0.0911354348063469,
-0.24308651685714722,
0.277351975440979,
0.16441883146762848,
-0.46690240502357483,
-0.28387317061424255,
-0.6331854462623596,
0.20662011206150055,
0.5172247290611267,
-0.4800854027271271,
0.09122242778539... | |
ON (t2_pk = wpck_wrkr_id AND
t2_ind_1 ='Y' AND
COALESCE(t1_end_dt, t6_actl_end_dt, t6_calc_end_dt)
BETWEEN t2_strt_dt AND t2_end_dt)
JOIN tbl3 | [
-0.0468086339533329,
-0.22793953120708466,
0.42527449131011963,
-0.20220819115638733,
-0.18480472266674042,
0.24630902707576752,
0.14150556921958923,
-0.46079447865486145,
0.11417204141616821,
-0.5792933106422424,
-0.23379872739315033,
0.3892938792705536,
-0.4373953938484192,
0.14079493284... | |
ON (t3_pk = t2_fk_t3_pk AND
COALESCE(t1_end_dt, t6_actl_end_dt, t6_calc_end_dt)
BETWEEN t3_strt_dt AND t3_end_dt)
LEFT JOIN tbl4 tbl4_a ON (tbl4_a.t4_pk = chkw_wkt_id)
.....
GROUP BY tbl1.gid
.....
,COALESCE(t1_end_dt, t6_actl_end_dt, t6_calc_end_dt) | [
-0.12490537762641907,
0.14085546135902405,
0.4884873628616333,
-0.12549541890621185,
-0.10190052539110184,
0.7047948837280273,
0.01543609518557787,
-0.7290899753570557,
-0.06958801299333572,
-0.43382567167282104,
-0.20996563136577606,
0.13433460891246796,
-0.2766275703907013,
0.38498386740... | |
,COALESCE(tbl4_b.t4_or_id, tbl4_a.t4_or_id, t7_or_id )
,t1_end_dt
ORDER BY perd_end_dt
```
Note that I already factored out one of the COALESCEs by naming it pred\_end\_dt in the SELECT and then referring to it by that name in the ORDER BY.
You should be able to replace the occurrence in the GROUP BY clause w... | [
0.10699429363012314,
-0.01432185247540474,
0.11480139195919037,
0.0051699248142540455,
-0.05083654448390007,
0.14185863733291626,
0.24397975206375122,
-0.39880800247192383,
-0.058564383536577225,
-0.5985742807388306,
-0.11946073919534683,
0.32711586356163025,
-0.2569710910320282,
0.3223099... | |
in the JOIN condition, so the impact might be very
slight. That is, the terms involving `t2_pk` and `t2_ind_1` may already reduce the rowset so the date comparison only has to deal with a small set. It depends on how many rows we're talking about and how the data is distributed.
One way to factor out the `COALESCE()` ... | [
0.14990344643592834,
-0.01226580049842596,
0.09732233732938766,
0.08169785887002945,
0.05990178510546684,
0.012093687430024147,
0.09831923246383667,
-0.10181677341461182,
-0.33084532618522644,
-0.4094216823577881,
0.09923413395881653,
0.28688570857048035,
-0.29868772625923157,
0.1509711742... | |
more trouble than it's worth. It'd be more work, and you should be sure that this change would make the code more maintainable, more correct, or more speedy.
---
Another option would be to define an alias for the `COALESCE()` expression
in a subquery. I can't tell which tables the columns come from, because
you're no... | [
0.05982613563537598,
0.03310851752758026,
0.1640237271785736,
0.12420086562633514,
-0.04428720846772194,
0.2546321451663971,
0.35048773884773254,
-0.3560265898704529,
-0.22298188507556915,
-0.5911418795585632,
0.1085987389087677,
0.33997294306755066,
-0.4127880930900574,
0.1639864891767501... | |
'Y'
AND t1.perd_end_dt BETWEEN tbl2.t2_strt_dt AND tbl2.t2_end_dt)
...
``` | [
0.2852559983730316,
0.10213953256607056,
0.2857450842857361,
-0.13761065900325775,
0.1779933124780655,
0.23900580406188965,
0.14700114727020264,
-0.02276591956615448,
0.007483130320906639,
-0.5319796204566956,
-0.2046438455581665,
0.5170109868049622,
-0.36240336298942566,
0.474488466978073... | |
So this seems pretty basic but I can't get it to work. I have an Object, and I am using reflection to get to it's public properties. One of these properties is static and I'm having no luck getting to it.
```
Public Function GetProp(ByRef obj As Object, ByVal propName as String) as PropertyInfo
Return obj.GetType.... | [
0.09397809207439423,
0.1454378366470337,
0.6500714421272278,
-0.17328184843063354,
-0.14955371618270874,
-0.12350128591060638,
0.41594862937927246,
-0.25758710503578186,
-0.2613334655761719,
-0.5400719046592712,
-0.2782321274280548,
0.6007281541824341,
-0.43339404463768005,
0.3032419383525... | |
obj As Object, ByVal propName as String) as PropertyInfo
Return obj.GetType.GetProperty(propName, Reflection.BindingFlags.Static Or Reflection.BindingFlags.Instance Or Reflection.BindingFlags.Public)
End Function
```
But still, requesting any Static members return nothing. .NET reflector can see the static prope... | [
-0.3129744529724121,
-0.0815880075097084,
0.6947285532951355,
-0.10767804831266403,
-0.3227197825908661,
0.1701725274324417,
0.35534363985061646,
0.077127605676651,
-0.22203673422336578,
-0.6675009727478027,
-0.23130272328853607,
0.4363201856613159,
-0.5325552821159363,
0.23962396383285522... | |
Now I appreciate the moral of the story is "don't hog the UI thread" but we tried to KISS by keeping things on the UI thread for as long as possible but I think we've just hit the tipping point and we're going to have to change our design.
But anyway..... something I noticed on our device that doesn't happen on deskt... | [
0.507808268070221,
-0.12054867297410965,
0.5551093816757202,
0.1403222233057022,
0.19530344009399414,
-0.4682261347770691,
0.26564821600914,
0.08347096294164658,
-0.06997042149305344,
-0.5768844485282898,
-0.27425146102905273,
0.7516972422599792,
-0.530592143535614,
0.3376777470111847,
0... | |
/// <summary>
/// The main entry point for the application.
/// </summary>
[MTAThread]
static void Main()
{
Application.Run(new Form1());
}
private int ctr;
public Form1() | [
0.06989634037017822,
-0.04010394588112831,
0.46688130497932434,
-0.33072903752326965,
0.22561147809028625,
-0.0012112923432141542,
0.3497600555419922,
0.013539532199501991,
-0.08104711771011353,
-0.36825984716415405,
-0.5659244656562805,
0.2701570391654968,
-0.5142115950584412,
0.399010837... | |
{
InitializeComponent();
KeyPreview = true;
KeyDown += Form1_KeyDown;
}
void Form1_KeyDown(object sender, KeyEventArgs e)
{
for (int i = 0; i < 1000000; i++) | [
-0.11008023470640182,
-0.33313602209091187,
0.4451311528682709,
-0.36147966980934143,
0.27361437678337097,
0.06241242587566376,
0.5744615197181702,
-0.44774630665779114,
0.05914765223860741,
-0.5436382293701172,
-0.5207943916320801,
0.38866499066352844,
-0.13460583984851837,
0.085329495370... | |
{
}
ctr++;
button1.Text = ctr.ToString();
}
private void button2_Click(object sender, EventArgs e)
{
ctr = 0;
button1.Text = ctr.ToString(); | [
-0.5806989669799805,
-0.3436538577079773,
0.7862387299537659,
-0.40183326601982117,
0.21219214797019958,
0.16855217516422272,
0.39748328924179077,
-0.04758793115615845,
-0.2545943260192871,
-0.2898590564727783,
-0.7237066030502319,
0.8005240559577942,
-0.4655427932739258,
0.118080981075763... | |
}
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be... | [
0.22536930441856384,
-0.17233332991600037,
0.15675142407417297,
0.031417638063430786,
0.16079853475093842,
0.3651580810546875,
0.3885244131088257,
-0.5239722728729248,
-0.3602263331413269,
-0.4581298530101776,
-0.19147609174251556,
0.43002524971961975,
-0.5232740044593811,
0.19774322211742... | |
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
} | [
0.5105593800544739,
-0.19912181794643402,
-0.031217647716403008,
-0.26064932346343994,
0.43964749574661255,
-0.24439312517642975,
0.3308854401111603,
-0.5876458883285522,
-0.0546092689037323,
-0.23187100887298584,
-0.2950338125228882,
0.6478176116943359,
-0.5182790756225586,
0.237701728940... | |
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.For... | [
-0.10348574072122574,
-0.5903249979019165,
0.74635910987854,
-0.22560839354991913,
0.2692334055900574,
-0.13328902423381805,
0.1551462858915329,
-0.3142431378364563,
-0.2736327350139618,
-0.8828162550926208,
-0.4259607791900635,
0.0745217576622963,
-0.3160970211029053,
0.4777611792087555,
... | |
this.button2 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(235, 137);
this.button1.Name = "button1"; | [
-0.10640119016170502,
-0.18060515820980072,
0.8156364560127258,
-0.4165308177471161,
0.19052132964134216,
0.2498970478773117,
0.16441009938716888,
-0.2967892289161682,
-0.49486127495765686,
-0.49710530042648315,
-0.37552759051322937,
-0.013246766291558743,
-0.4609580338001251,
0.1862667649... | |
this.button1.Size = new System.Drawing.Size(329, 239);
this.button1.TabIndex = 0;
this.button1.Text = "button1";
//
// button2
//
this.button2.Location = new System.Drawing.Point(62, 291);
this.button2.Name | [
-0.31451845169067383,
-0.13888590037822723,
0.7288084626197815,
-0.1949951946735382,
0.1454804539680481,
0.6048699617385864,
-0.11767085641622543,
-0.22689147293567657,
-0.5907471776008606,
-0.4897299110889435,
-0.15723656117916107,
-0.07203847914934158,
-0.32610374689102173,
0.45680180191... | |
= "button2";
this.button2.Size = new System.Drawing.Size(72, 20);
this.button2.TabIndex = 1;
this.button2.Text = "Clear";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// Form1
// | [
-0.2528790831565857,
-0.5039393901824951,
0.7559834718704224,
-0.24834014475345612,
0.28525617718696594,
0.07125955820083618,
0.049542032182216644,
-0.25676366686820984,
-0.5268797278404236,
-0.5863974690437317,
-0.3808212876319885,
0.3231474757194519,
-0.37891215085983276,
-0.102560743689... | |
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.AutoScroll = true;
this.ClientSize = new System.Drawing.Size(638, 455);
this.Controls.Add(this.button2);
this.Controls.Add(this.but... | [
-0.14966854453086853,
-0.3089742362499237,
0.7344300746917725,
-0.40458738803863525,
0.20226497948169708,
0.008489825762808323,
0.3708333671092987,
-0.6157846450805664,
-0.38884371519088745,
-0.6351587772369385,
-0.3562662601470947,
0.556552529335022,
-0.7394521832466125,
-0.11565089225769... | |
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
private Button button1;
private Button button2;
}
}
```
When I run this on my custom box I can press four keys in succession but my ctr only increments by two. If I then add a few zeros (to compensate for th... | [
0.050906192511320114,
-0.05725967139005661,
1.0854676961898804,
-0.5275939702987671,
0.17460942268371582,
0.03178570047020912,
0.3890347480773926,
-0.18883484601974487,
-0.19726236164569855,
-0.5206561088562012,
0.07873500883579254,
0.7867632508277893,
-0.31235748529434204,
0.1454131007194... | |
run it on desktop I get all the keys.
What's going on here?
The issue was to do with a bug in the BSP (apparently from some Freescale code) that meant that the keyboard driver was functioning at a much lower priority interrupt than was intended.
This is now fixed and everything works awesome fine. :) | [
0.18148955702781677,
0.08845933526754379,
0.5820749402046204,
0.24521856009960175,
0.2925935983657837,
-0.21569643914699554,
0.38505786657333374,
0.49820181727409363,
-0.3983142375946045,
-0.4920623302459717,
0.07006345689296722,
0.9348945617675781,
-0.440865695476532,
0.07541993260383606,... | |
Emacs has [Paredit](http://mumble.net/~campbell/emacs/paredit.el) which actively prevents you from typing unbalanced parentheses (short of `C-Q (` to force-insert a literal one, or other craziness). Inserting an open paren also inserts a closing one. Backspacing over a paren either deletes both the opening and closing ... | [
-0.0493968166410923,
0.45221763849258423,
0.20229333639144897,
-0.009445318952202797,
-0.11715922504663467,
0.5008066296577454,
0.3007833659648895,
0.13961829245090485,
-0.10209987312555313,
-0.1302848756313324,
0.005566192790865898,
0.5328794717788696,
-0.16739879548549652,
-0.17186532914... | |
Paredit in Vim?
May I suggest [my bracketing](http://code.google.com/p/lh-vim/wiki/lhBrackets) system?
NB: prefer to fetch it directly from the svn repository, the new version is much more easier to tune to our needs.
If you are interested in the details/do-it-yourself-way, have a look at the [related tip on vim.wik... | [
0.2802446782588959,
-0.011016391217708588,
0.5519672632217407,
-0.05596878007054329,
-0.20977815985679626,
0.25819092988967896,
0.1269204020500183,
-0.05127386003732681,
-0.2568897604942322,
-0.3396051824092865,
-0.09873834997415543,
0.6796926259994507,
-0.1501031219959259,
-0.256787627935... | |
So i am working with some email header data, and for the to:, from:, cc:, and bcc: fields the email address(es) can be expressed in a number of different ways:
```
First Last <name@domain.com>
Last, First <name@domain.com>
name@domain.com
```
And these variations can appear in the same message, in any order, all in ... | [
0.5310797691345215,
0.057494547218084335,
0.30558010935783386,
0.06621252000331879,
-0.04364989325404167,
0.11357003450393677,
-0.0720992162823677,
-0.03664298728108406,
-0.2667360305786133,
-0.6845338344573975,
0.18208162486553192,
0.24034883081912994,
-0.1271737515926361,
0.4069912731647... | |
on the commas, which would work except in the second example where the last name is placed first. I suppose this method could work, if after i split, i examine each element and see if it contains a '@' or '<'/'>', if it doesn't then it could be assumed that the next element is the first name. Is this a good way to appr... | [
0.2383461743593216,
0.004557107575237751,
0.12507270276546478,
0.051273662596940994,
-0.04246586188673973,
-0.001075275125913322,
0.1751265972852707,
0.10869038850069046,
-0.21866151690483093,
-0.44801145792007446,
-0.1848522424697876,
0.294661283493042,
-0.1319952756166458,
0.244711950421... | |
containing the address in whatever format it was sent in. I have my own methods for validating and extracting the information from an address, it was just tricky for me to figure out the best way to separate each address.
Here is the solution i came up with to accomplish this:
```
String str = "Last, First <name@doma... | [
-0.1800011694431305,
-0.059961479157209396,
0.7796512842178345,
-0.0831756517291069,
-0.041210997849702835,
0.14773593842983246,
0.045260753482580185,
-0.43645885586738586,
-0.14811131358146667,
-0.5102004408836365,
-0.2138843685388565,
0.2573334872722626,
-0.2814007103443146,
0.5452750325... | |
if (str[c] == ',')
commaIdx = c;
if (commaIdx > atIdx && atIdx > 0)
{
string temp = str.Substring(lastComma, commaIdx - lastComma);
addresses.Add(temp);
lastComma = commaIdx;
atIdx = commaIdx;
}
if (c == str.Length -1)
{
string temp = | [
-0.1724681556224823,
-0.051505375653505325,
1.0492420196533203,
-0.6879759430885315,
-0.1856469064950943,
0.7391207218170166,
0.30484697222709656,
-0.8151112198829651,
-0.3458864390850067,
0.0030304202809929848,
-0.35838940739631653,
0.38429996371269226,
-0.2944749593734741,
0.096957057714... | |
str.Substring(lastComma, str.Legth - lastComma);
addresses.Add(temp);
}
}
if (commaIdx < 2)
{
// if we get here we can assume either there was no comma, or there was only one comma as part of the last, first combo
addresses.Add(str);
}
```
The above code generates the individual addresses that i ... | [
-0.08482541143894196,
-0.13591180741786957,
0.9536363482475281,
-0.4600307047367096,
-0.32430294156074524,
0.28523361682891846,
0.016100667417049408,
-0.5425739288330078,
-0.43555909395217896,
-0.665450930595398,
-0.2955973446369171,
0.3257749676704407,
-0.41965365409851074,
0.172514647245... | |
0;
for (int c = 0; c < str.Length; c++)
{
if (str[c] == '@')
atIdx = c;
if (str[c] == ',')
commaIdx = c;
if (commaIdx > atIdx && atIdx > 0)
{
string temp = str.Substring(lastComma, commaIdx - lastComma);
addresses.Add(temp);
lastComma = commaIdx;
atIdx = commaIdx;
}
if (c == str.Length -1)
{
... | [
-0.17014968395233154,
-0.030229169875383377,
1.231783390045166,
-0.7202329039573669,
-0.24740387499332428,
0.7535231709480286,
0.37424010038375854,
-0.7711563110351562,
-0.5109350681304932,
-0.03673751279711723,
-0.2767309248447418,
0.27795612812042236,
-0.41668859124183655,
0.221486270427... | |
only one comma as part of the last, first combo
addresses.Add(str);
}
``` | [
0.12317359447479248,
0.05035156011581421,
0.43402099609375,
-0.29982057213783264,
-0.11137412488460541,
0.18146991729736328,
0.05082055926322937,
-0.13812819123268127,
-0.15011189877986908,
-0.539415180683136,
-0.47714856266975403,
0.6280047297477722,
-0.40229788422584534,
0.01558218803256... | |
I am writing a small app to teach myself ASP.NET MVC, and one of its features is the ability to search for books at Amazon (or other sites) and add them to a "bookshelf".
So I created an interface called IBookSearch (with a method DoSearch), and an implementation AmazonSearch that looks like this
```
public class Ama... | [
0.12124622613191605,
-0.1626129448413849,
0.4063419997692108,
0.10372294485569,
-0.04898708313703537,
0.08888456970453262,
0.41349172592163086,
-0.27531319856643677,
-0.006882067304104567,
-0.47209346294403076,
0.044458966702222824,
0.3195628523826599,
-0.1433730572462082,
-0.1714974641799... | |
select new Book
{
ASIN = GetValue(ns, item, "ASIN"),
Title = GetValue(ns, item, "Title"), | [
-0.43414658308029175,
-0.4178924560546875,
0.5479431748390198,
0.22247405350208282,
0.15849138796329498,
0.12743040919303894,
0.14892764389514923,
-0.3111906945705414,
-0.21565957367420197,
-0.6500868201255798,
-0.7534242868423462,
0.31784048676490784,
-0.3395451009273529,
0.01835445128381... | |
Author = GetValue(ns, item, "Author"),
DetailURL = GetValue(ns, item, "DetailPageURL")
};
return books.ToList();
}
private static XElement GetAmazonResults(string searchTerms)
{
const string AWSKey = "MY AWS KEY";
string encodedTerms = HttpUtility.UrlPath... | [
0.04812723025679588,
-0.24182724952697754,
0.3527331054210663,
0.008350151591002941,
0.15535420179367065,
0.156124547123909,
0.4824028015136719,
-0.21422606706619263,
0.1829831749200821,
-0.5147762894630432,
-0.6032440066337585,
0.5894838571548462,
-0.2590254843235016,
0.291619211435318,
... | |
string url = string.Format("<AMAZONSEARCHURL>{0}{1}",AWSKey, encodedTerms);
return XElement.Load(url);
}
private static string GetValue(XNamespace ns, XElement item, string elementName)
{
//Get values inside an XElement
}
}
```
Ideally I would like to have done this TDD-style, writing first a tes... | [
0.5305054187774658,
-0.005968642886728048,
0.346235066652298,
0.07722928375005722,
-0.1656709462404251,
-0.3455549478530884,
0.5089197754859924,
-0.2417854368686676,
0.21631498634815216,
-0.4321114420890808,
-0.10652309656143188,
0.5178235173225403,
-0.4248206317424774,
0.28516092896461487... | |
list of books.
What else could I test first? The only test I can think of would be one that mocks the call to the cloud (at GetAmazonResults) and then checks that DoSearch can execute the Linq2XML select correctly and return the correct list. But it seems to me that this type of test can only be written after I have s... | [
0.6434831619262695,
0.16895143687725067,
0.15661180019378662,
0.4356464743614197,
-0.04257195442914963,
-0.01703229360282421,
0.18047721683979034,
-0.05767447501420975,
-0.265182763338089,
-0.30571842193603516,
0.5024279356002808,
0.5692352652549744,
-0.2404022216796875,
-0.187587484717369... | |
point: if you haven't written the code yet, how can you mock it?
I think the answer is that you want to start your TDD with very, very simple tests, as Kent Beck does in [*Test Driven Development*](https://rads.stackoverflow.com/amzn/click/com/0321146530). Start by writing a test that calls DoSearch and asserts that w... | [
0.4693778157234192,
0.23207706212997437,
0.15656940639019012,
0.06297750771045685,
-0.2539046108722687,
-0.07463584095239639,
0.34163349866867065,
-0.35814568400382996,
0.3200847804546356,
-0.2324347347021103,
-0.12394313514232635,
0.3779558837413788,
-0.07103228569030762,
-0.0019600898958... | |
valid Book data to pass a test, and at that point, you'll have a portion of DoSearch written, and you can think about mocking it (or portions of it). | [
0.88779616355896,
0.2202770859003067,
0.506782054901123,
0.35891109704971313,
0.10353469103574753,
-0.4777408242225647,
0.09703076630830765,
-0.23608744144439697,
0.4432883858680725,
-0.2683084011077881,
0.11587321013212204,
0.4647609293460846,
0.003873200621455908,
-0.29610753059387207,
... | |
In the Visual Studio code editor, I sometimes have an extraneous mark on the white background. It's a short diagonal slash, one pixel wide. If I scroll up and down, the mark remains in the same place, more or less as if it was a scratch on the screen.
It's sometimes there, and sometimes not. I don't know how to make ... | [
0.6745206117630005,
-0.022424006834626198,
-0.007875604555010796,
0.06332810968160629,
-0.17300568521022797,
-0.012666520662605762,
-0.06906517595052719,
0.2559545636177063,
-0.12884213030338287,
-1.000078558921814,
0.27352482080459595,
0.08136577159166336,
-0.13869358599185944,
0.06460499... | |
possible if I had not seen it. Anyone have any ideas on what could cause it?
I don't think I've ever used a version of Visual Studio that drew the background of the code editor correctly 100% of the time. I've seen the diagonal line and many variations of it. It's almost certainly a VS bug. | [
0.657639741897583,
0.017811618745326996,
-0.16446948051452637,
0.009949934668838978,
-0.04480055719614029,
0.038892049342393875,
0.23421728610992432,
0.22572597861289978,
-0.3446350693702698,
-0.6611142158508301,
0.4548017084598541,
0.4753899574279785,
-0.26979219913482666,
0.0328426212072... | |
So we have this web app where we support UTF8 data. Hooray UTF8. And we can export the user-supplied data into CSV no problem - it's still in UTF8 at that point. The problem is when you open a typical UTF8 CSV up in Excel, it reads it as ANSII encoded text, and accordingly tries to read two-byte chars like ø and ü as t... | [
0.27612292766571045,
0.206776425242424,
0.057773102074861526,
-0.01100681908428669,
-0.17767399549484253,
-0.13602156937122345,
0.1368815153837204,
0.40117257833480835,
-0.332943856716156,
-0.5604079365730286,
-0.13822203874588013,
0.3679174780845642,
-0.1857515573501587,
-0.04717446118593... | |
Among them:
* supplying a UTF-16 Little Endian TSV file which Excel will interpret correctly, but which won't support multi-line data
* supplying the data in an HTML table with an Excel mime-type or file extension (not sure if this option supports UTF8)
* there are some three or four ways to get XML data into the vari... | [
0.49556857347488403,
0.10691742599010468,
0.42883074283599854,
0.12414596974849701,
-0.2934078872203827,
0.10320598632097244,
0.08445753902196884,
-0.09531975537538528,
-0.31612470746040344,
-0.5352349281311035,
-0.05583586543798447,
0.4164879322052002,
-0.20295973122119904,
-0.18255513906... | |
aren't using it for Excel anyway, and a separate download option for Excel.
What's the simplest way of generating that Just-For-Excel file that will correctly support UTF8, my dear Stack Overflowers? If that simplest option only supports the latest version of Excel, that's still of interest.
I'm doing this on a Rail... | [
0.35601869225502014,
-0.03280172497034073,
0.46291786432266235,
0.19863605499267578,
0.07139506191015244,
-0.47080859541893005,
0.05874498561024666,
0.10701227933168411,
-0.1889743059873581,
-0.6900478601455688,
0.1078760027885437,
0.6455463767051697,
0.07802891731262207,
-0.23542991280555... | |
exports when I first posted this question. One of my coworkers, Erik Hollensbee, threw together a quick filter for Ruport to provide us with actual Excel XSL output, and I figured I'd share that here for any other ruby-ists:
```
require 'rubygems'
require 'ruport'
require 'spreadsheet'
require 'stringio'
Spreadsheet.... | [
-0.01162708643823862,
0.16534781455993652,
0.36887869238853455,
-0.08405663073062897,
-0.12221536040306091,
0.1137869730591774,
0.04642272740602493,
-0.42258697748184204,
-0.33235278725624084,
-0.4598294794559479,
-0.3419746160507202,
0.5940131545066833,
-0.5806965827941895,
-0.17894497513... | |
book_args = { :name => options.worksheet_name }
else
book_args = { }
end
sheet = book.create_worksheet(book_args)
offset = 0
if options.show_table_headers
sheet.row(0).default_format = Spreadsheet::Format.new(
options.format_options ||
{
:color => :blue,
... | [
-0.12008036673069,
-0.003733048215508461,
0.7337478399276733,
-0.011585191823542118,
0.20194540917873383,
0.11065050959587097,
-0.05286156013607979,
-0.44519317150115967,
-0.35927891731262207,
-0.5012766718864441,
-0.3963523507118225,
0.3153667747974396,
-0.3892365097999573,
0.020443204790... | |
:size => 18
}
)
sheet.row(0).replace data.column_names
offset = 1
end
data.data.each_with_index do |row, i|
sheet.row(i+offset).replace row.attributes.map { |x| row.data[x] }
end
book.write retval
retval.seek(0)
return retval.read
end
end
```
You're forgettin... | [
-0.11636579781770706,
-0.03504076972603798,
1.0306808948516846,
0.020979536697268486,
-0.062100060284137726,
-0.2124420553445816,
0.22232434153556824,
-0.5929610729217529,
-0.14709410071372986,
-0.6848481893539429,
-0.2671998143196106,
0.6304484009742737,
-0.35586661100387573,
0.1663635969... | |
pretty well, odds are your platform has some decent tools for building xml files, and it's fully supported as far back as OfficeXP. Office2000 is not supported, but personal experience is that it works in a limited way. | [
0.17106764018535614,
0.004043839406222105,
0.2585221529006958,
0.22134238481521606,
0.11506439000368118,
-0.3097057640552521,
-0.07727903872728348,
0.31389862298965454,
-0.30263760685920715,
-0.5057973861694336,
0.238753080368042,
0.33673858642578125,
0.007791351992636919,
-0.0630951598286... | |
The keyword `protected` grants access to classes in the same package and subclasses (<http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html>).
Now, every class has `java.lang.Object` as superclass (<http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html>).
Hence I conclude that every class may... | [
0.21431037783622742,
0.03414612263441086,
-0.055835314095020294,
0.044456612318754196,
0.14883190393447876,
-0.2597775459289551,
0.3133714497089386,
-0.37503761053085327,
-0.28695958852767944,
-0.3015804886817932,
-0.3646646738052368,
0.4522413909435272,
-0.30566737055778503,
0.58122682571... | |
nor what's the difference (regarding the access of `java.lang.Object`s members) with `getOne()`.
You can only access protected members of a type in a different package if the compile-time type of the expression you're referencing it through is either your own class or a subclass. (Where "your" class is the class contai... | [
0.11296597868204117,
-0.015444232150912285,
0.1957172453403473,
-0.0028715175576508045,
0.1212245374917984,
-0.2957918047904968,
0.27764052152633667,
-0.19871564209461212,
-0.18521332740783691,
-0.6302580237388611,
-0.21393060684204102,
0.6726363301277161,
-0.26261550188064575,
-0.06091022... | |
its own file normally - but treat
// all the classes below as being in package "second"
package second;
public class Child extends Base
{
public void OtherMethod(Object x)
{
((Base) x).Foo(); // Invalid: Base is not Child or subclass
((Child) x).Foo(); // Valid: Child is Child
((GrandCh... | [
0.15845493972301483,
0.085259348154068,
0.15462256968021393,
-0.16463996469974518,
0.3826690912246704,
-0.0480915792286396,
0.1730877161026001,
-0.5101552605628967,
-0.11200572550296783,
-0.22420528531074524,
-0.3924447000026703,
0.08703716099262238,
-0.31336838006973267,
0.307092249393463... | |
class GrandChild extends Child {}
public class OtherChild extends Base {}
```
In other words, it's letting you have access to the protected members of "objects which are a like you".
Details are in [section 6.6.2 of the Java Language Specification](http://java.sun.com/docs/books/jls/third_edition/html/names.html#6.6... | [
-0.10105952620506287,
-0.06231136992573738,
0.17863088846206665,
-0.08996906131505966,
0.17475785315036774,
-0.24642083048820496,
0.21142250299453735,
-0.25604769587516785,
-0.12688997387886047,
-0.4738174080848694,
-0.23029860854148865,
0.048911530524492264,
-0.11390550434589386,
0.559211... | |
permitted only within the body of a
> subclass *S* of *C*. In addition, if Id
> denotes an instance field or instance
> method, then: If the access is by a
> qualified name *Q.Id*, where *Q* is an
> *ExpressionName*, then the access is
> permitted if and only if the type of
> the expression *Q* is *S* or a subcl... | [
-0.2059841901063919,
0.0702238380908966,
0.3524482250213623,
0.2193135768175125,
0.019593851640820503,
-0.4255530536174774,
0.20190675556659698,
-0.2883310317993164,
-0.13602131605148315,
-0.46885591745376587,
-0.5462283492088318,
0.469455748796463,
-0.02024253085255623,
0.0921662747859954... | |
*Primary* expression, then the access is
> permitted if and only if the type of *E*
> is *S* or a subclass of *S*. | [
-0.14910238981246948,
-0.07631447911262512,
0.26634159684181213,
0.15083424746990204,
-0.05957590043544769,
-0.08752269297838211,
0.3456929922103882,
0.14580488204956055,
0.11197422444820404,
-0.8422694802284241,
-0.7161367535591125,
0.45721670985221863,
-0.0654105544090271,
0.122147612273... | |
Let's say I have 'myStoredProcedure' that takes in an Id as a parameter, and returns a table of information.
Is it possible to write a SQL statement similar to this?
```
SELECT
MyColumn
FROM
Table-ify('myStoredProcedure ' + @MyId) AS [MyTable]
```
I get the feeling that it's not, but it would be very benefic... | [
0.20247097313404083,
0.35393619537353516,
0.28094395995140076,
0.15662266314029694,
0.017371948808431625,
-0.299333393573761,
-0.21272817254066467,
0.190986767411232,
-0.2925797402858734,
-0.6112772822380066,
0.24474994838237762,
0.36361169815063477,
-0.24103648960590363,
0.166878476738929... | |
Is it possible to do CAD/CAM software without having to use C++? My company developed their software with c/C++ but that was more than 10 years ago. Today,there is a lot of legacy code that switching would force us to get rid of but i was wondering what the actual risks are. We have a lot of mathematical algorithms for... | [
0.5007616281509399,
0.2744303047657013,
0.06721420586109161,
0.503783643245697,
0.30240073800086975,
-0.14615406095981598,
0.007423396222293377,
0.128248393535614,
-0.11226915568113327,
-0.4671494960784912,
0.32589152455329895,
0.7906950116157532,
-0.1555536985397339,
0.025200234726071358,... | |
UI.
We are not talking about game development here (Halo 3 or Call Of Duty) so how much processing does CAD/CAM really need?
Can anybody enlighten me on this matter? Most of my colleagues are hardcore C++ programmers and although i program in c++ i love .NET but i am having a hard time selling .NET to them other than ... | [
0.7142161726951599,
0.12395104765892029,
0.19640016555786133,
0.2670685052871704,
-0.3907146453857422,
-0.4264828860759735,
-0.23843055963516235,
0.028306661173701286,
-0.061364755034446716,
-0.7463332414627075,
0.2462889850139618,
0.933099091053009,
-0.04111996293067932,
0.062947876751422... | |
business sense to switch to a different language. Even if there were gains to be had from using a different language (which is questionable), the cost of testing and debugging the new code would more than overcome them. You also have a development team that are experts in C++. There would be a big productivity drop whi... | [
0.33617809414863586,
0.1983773112297058,
-0.04660475626587868,
0.0900476723909378,
0.03401808440685272,
-0.1587238758802414,
0.376860111951828,
0.03170251101255417,
-0.2572375535964966,
-0.5542259812355042,
-0.005642329342663288,
0.8028391599655151,
-0.25717777013778687,
-0.076401501893997... | |
I have a View with an exposed form . I am trying to a few things on it. Ideally I would like to have a dropdown that fires the form with no button. If that is not possible then I would like to have the button text something different than apply.
I hacked it for now and change views\_form in views.module but that does ... | [
0.9733911752700806,
-0.03478937968611717,
0.467794269323349,
0.18094176054000854,
-0.021819090470671654,
-0.3565998077392578,
0.09168966859579086,
0.10742685198783875,
0.028596652671694756,
-0.7078412175178528,
0.29417404532432556,
0.7999075651168823,
-0.12993815541267395,
0.19913791120052... | |
same problem but no solutions so far. Not sure where the best place to get Drupal help is.
Here is the change I made so far:
```
function views_exposed_form(&$form_state) {
// Make sure that we validate because this form might be submitted
// multiple times per page.
$form_state['must_validate'] = TRUE;
$view... | [
0.3571024537086487,
-0.039631254971027374,
0.914138674736023,
-0.1778889000415802,
-0.11308731883764267,
-0.30901283025741577,
0.6094231605529785,
-0.5091068744659424,
0.11728686839342117,
-0.7257400155067444,
-0.2192019671201706,
0.5453487634658813,
-0.2447236329317093,
0.0368864983320236... | |
'#value' => $view->get_url(),
);
}
// Go through each filter and let it generate its info.
foreach ($view->filter as $id => $filter) {
$view->filter[$id]->exposed_form($form, $form_state);
if ($info = $view->filter[$id]->exposed_info()) {
$form['#info']['filter-' . $id] = $info;
}
}
// ... | [
0.17432081699371338,
-0.4646010994911194,
0.6056391596794128,
-0.3309905230998993,
-0.0773010179400444,
0.12339264154434204,
0.1964854598045349,
-0.5549407601356506,
0.12946321070194244,
-0.8287971615791321,
-0.08688649535179138,
0.6149283051490784,
-0.6726227402687073,
-0.0722916051745414... | |
'#value' => t('go'),
);
$form['#action'] = url($view->get_url());
$form['#theme'] = views_theme_functions('views_exposed_form', $view, $display);
$form['#id'] = views_css_safe('views_exposed_form-' . check_plain($view->name) . '-' . check_plain($display->id));
// $form['#attributes']['class'] = array('views-ex... | [
0.1879403293132782,
-0.008808768354356289,
0.6936007738113403,
-0.12788328528404236,
-0.17338243126869202,
0.027057457715272903,
0.19632305204868317,
-0.6702826619148254,
-0.0503791905939579,
-0.4444432258605957,
-0.26075509190559387,
0.8360726833343506,
-0.3965851068496704,
-0.16555641591... | |
button and submits the form on the onChange handler of the select drop-down. You want that submit button there for those 10% of users for whom the JS fails. | [
0.4431908428668976,
-0.2650299370288849,
0.47816160321235657,
0.12313874810934067,
0.07399582117795944,
-0.00525987334549427,
0.14479602873325348,
-0.09864126890897751,
-0.08591338247060776,
-0.5375933051109314,
-0.10650310665369034,
0.2467307299375534,
-0.19260187447071075,
-0.19439765810... | |
In MFC C++ (Visual Studio 6) I am used to using the TRACE macro for debugging. Is there an equivalent statement for plain win32?
\_RPTn works great, though not quite as convenient. [Here is some code](http://www.codeguru.com/cpp/v-s/debug/article.php/c4405) that recreates the MFC TRACE statement as a function allowing ... | [
0.08725191652774811,
-0.06212146580219269,
0.29461798071861267,
-0.21595460176467896,
0.23529987037181854,
0.06919697672128677,
0.21571533381938934,
-0.16522452235221863,
-0.1774677187204361,
-0.5362573266029358,
-0.06947030127048492,
0.7268930673599243,
-0.6003790497779846,
-0.23849815130... | |
source that I put into Trace.h. *Thanks to Thomas Rizos for the original*:
```
// TRACE macro for win32
#ifndef __TRACE_H__850CE873
#define __TRACE_H__850CE873
#include <crtdbg.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#ifdef _DEBUG
#define TRACEMAXSTRING 1024
char szBuffer[TRACEMAXSTRING];
inl... | [
0.12070390582084656,
-0.01082219835370779,
0.21885092556476593,
-0.1493353247642517,
0.37765058875083923,
0.02856769599020481,
0.3310071527957916,
-0.6330900192260742,
0.1375522017478943,
-0.8943424224853516,
0.07989324629306793,
0.7208827137947083,
-0.39851218461990356,
0.1386380791664123... | |
args);
va_end(args);
_RPT0(_CRT_WARN,szBuffer);
}
#define TRACEF _snprintf(szBuffer,TRACEMAXSTRING,"%s(%d): ", \
&strrchr(__FILE__,'\\')[1],__LINE__); \
_RPT0(_CRT_WARN,szBuffer); \
TRACE
#else
// Remove for release mode
#define TRACE ((void)0)
#define TRACEF ((... | [
0.0518576018512249,
0.0329604335129261,
0.7708379626274109,
-0.4050911068916321,
0.3334994316101074,
-0.06125129759311676,
0.4268689453601837,
-0.49029067158699036,
-0.2770736515522003,
-0.5351349115371704,
-0.3889271914958954,
0.6182819604873657,
-0.5750816464424133,
0.18241535127162933,
... | |
I'm developing a blog application using Django. Currently, the URL `/blog/` displays the front page of the blog (the first five posts). Visitors can then browse or "page through" the blog entries. This portion is mapped to `/blog/browse/{page}/`, where `page`, of course, is an integer that specifies which "page" of blo... | [
0.3173595368862152,
0.17974264919757843,
0.7208071947097778,
0.003591008484363556,
-0.11664263159036636,
-0.09252505749464035,
-0.00012337332009337842,
0.2641693353652954,
-0.10021968930959702,
-0.6903755068778992,
-0.10532786697149277,
0.2544671595096588,
-0.047320298850536346,
0.47472587... | |
*before* the post was added). This seems to be the way sites like Stack Overflow and Reddit do things. For example, when paging through questions on Stack Overflow, a ["page" attribute](https://stackoverflow.com/questions?page=2&sort=newest) is used; likewise, Reddit uses a ["count" attribute](http://www.reddit.com/?co... | [
0.2237488478422165,
-0.019339313730597496,
0.40006133913993835,
0.00458633853122592,
-0.3913716673851013,
-0.26291075348854065,
0.2869710624217987,
-0.057797178626060486,
-0.3448236286640167,
-0.4202549159526825,
-0.10188068449497223,
0.25758683681488037,
-0.304099440574646,
0.086586378514... | |
the GET URL parameter, as in URL?pg=#. It's very common and provides a standard visual clue to users about what is going on. If, for instance, I want to bookmark one of those pages or make an external link, I know without thinking that I can drop the pg parameter to point at the "latest" front-page index. With an embed... | [
0.22532297670841217,
-0.07023321837186813,
0.6749414205551147,
0.4135805070400238,
-0.3258155584335327,
-0.2194453328847885,
-0.08737577497959137,
0.4666516184806824,
-0.24181106686592102,
-0.2134915292263031,
-0.14349690079689026,
0.21381068229675293,
-0.024946607649326324,
0.290208727121... | |
sensible URL, since there's an acceptable default if the parameter is omitted and the parameter doesn't affect the base URL.
Also, while I can't prove it, it gives me the warm fuzzy feeling that Google has a better chance at figuring out the nature of that page's content (i.e. that it is a paginated index into further... | [
0.06778024882078171,
0.0010195812210440636,
0.6019623279571533,
0.3710893988609314,
-0.0005868134321644902,
-0.18752555549144745,
0.22913525998592377,
-0.026031194254755974,
0.26587241888046265,
-0.44226738810539246,
0.015376219525933266,
0.8297853469848633,
-0.07757756859064102,
-0.274475... | |
fits in better with your current way of doing things.
EDIT: Forgot to mention that my opinion is Django specific... I have a few Django apps so I'm relatively familiar with the way they build their URLs, and I still use a "pg" GET parameter with those apps rather than embedding it in the URL directly. | [
0.4917944073677063,
0.11705385893583298,
0.39470943808555603,
0.27783000469207764,
-0.35613754391670227,
-0.3044017553329468,
-0.1638205349445343,
0.3545938730239868,
-0.33023038506507874,
-0.06809799373149872,
0.16506733000278473,
0.4172019958496094,
0.11136027425527573,
-0.18368029594421... | |
What is the best way to determine if the flash ocx is installed in Innosetup (or any installer for that matter). I don't want to attempt to install it myself, I will simply force the user to go to the flash site and install, I just want to make sure that the flash.ocx (version 9+) is installed.
Is it enough to check f... | [
0.1179657056927681,
0.09829167276620865,
0.374125599861145,
-0.012813907116651535,
0.018936490640044212,
-0.1205289289355278,
0.081246018409729,
0.11151321977376938,
-0.07809532433748245,
-0.29996272921562195,
0.014082199893891811,
0.8732914924621582,
-0.2920715808868408,
-0.23856174945831... | |
V: Variant;
begin
try
V := CreateOleObject('ShockwaveFlash.ShockwaveFlash.9');
Result := True;
except
Result := False;
end;
end;
```
Check out the various examples in the Inno Setup package on how to use your own function to show a message box to the user, cancel the installation, open the Flash sit... | [
0.3050445318222046,
-0.38504549860954285,
0.3794509172439575,
-0.3348847031593323,
-0.12943048775196075,
-0.22739224135875702,
0.4693003296852112,
-0.039133068174123764,
-0.07836426794528961,
-0.5267013907432556,
-0.4598938822746277,
0.4759587049484253,
-0.3836956024169922,
-0.019520040601... | |
We're generally familiar with [code smells](https://stackoverflow.com/questions/114342/what-are-code-smells-what-is-the-best-way-to-correct-them) here, but just as damaging if not more so are when the business side of things - as much as it falls within our domain - is going wrong.
As examples, the inverse of anythin... | [
0.6479675769805908,
0.19913455843925476,
-0.04776952788233757,
0.15685667097568512,
-0.204037606716156,
-0.20388251543045044,
0.34353867173194885,
-0.07681167125701904,
0.06456705927848816,
-0.6549590826034546,
-0.11694198846817017,
0.38963621854782104,
-0.04194242134690285,
0.133290603756... | |
Writing code before you have a signed contract with the client
* Being asked for on-the-fly estimates (*"just a rough one will do"*) for anything which will take more than a day (a few hours?)
* Ancient cargo-cult wisdom prevails (personal example - VisStudio sourcesafe integration is banned)
* You've stopped having no... | [
0.864314615726471,
0.25169551372528076,
-0.16572731733322144,
0.17370569705963135,
-0.0851653516292572,
-0.20877517759799957,
0.31648141145706177,
0.02390596643090248,
0.10877761244773865,
-0.400078684091568,
0.13593848049640656,
0.3950332701206207,
-0.35600802302360535,
-0.114158906042575... | |
Portland Pattern Repository also has a page on Antipatterns, covering many of the same topics as the "Antipatterns" book. Visit <http://c2.com/cgi/wiki?AntiPatternsCatalog> and scroll down to "Management Antipatterns." A few examples:
* [Analysis Paralysis](http://c2.com/cgi/wiki?AnalysisParalysis) - a team of otherwi... | [
0.4507826864719391,
-0.24634745717048645,
0.11100749671459198,
0.25198015570640564,
0.03275977075099945,
-0.02229485660791397,
0.2399265021085739,
-0.2707469165325165,
-0.2042369693517685,
-0.4149627387523651,
0.27897438406944275,
0.15311914682388306,
-0.14433450996875763,
-0.1427848488092... | |
Project](http://c2.com/cgi/wiki?GroundHogDayProject) - meetings are held which seem to discuss the same things over and over and over again. At the end of said meetings, decisions are made that "something must be done."
* [Design By Committee](http://c2.com/cgi/wiki?DesignByCommittee) - Given a political environment in... | [
1.061000108718872,
-0.14046581089496613,
-0.05152319744229317,
0.3976772427558899,
0.06428308039903641,
0.006527128163725138,
-0.07668601721525192,
-0.3177964389324188,
-0.543811023235321,
-0.39987194538116455,
-0.2008904665708542,
0.09874635934829712,
0.15109948813915253,
0.24811063706874... | |
Can anyone tell me the best way to go about making an iPhone application support multiple languages? I am going to put separate versions for each language in the App Store, but what is the best way to represent this in Xcode?
Putting a separate app in the store for each language is NOT the way to go. The iPhone SDK han... | [
0.43462738394737244,
0.33616578578948975,
0.07248856127262115,
0.016756774857640266,
0.11672055721282959,
0.30904868245124817,
0.5982367396354675,
0.3167312443256378,
-0.3017077147960663,
-0.575009822845459,
-0.14861096441745758,
0.356273353099823,
-0.3251844644546509,
-0.16172882914543152... | |
I want to get the id of the clicked element and then show `div`s that match this id. I am using the following code, and it's not working. Please help.
```
$(function () {
var tabContainers = $('div.difContetform > div');
$('div#head-nav ul a').click(function (event) {
$('div#head-nav ul a').removeClass... | [
0.08211608976125717,
-0.07064412534236908,
0.559508740901947,
-0.41278812289237976,
0.1633945107460022,
0.07591535151004791,
0.3861512243747711,
-0.3374110758304596,
0.16686159372329712,
-0.5135927796363831,
-0.0436602458357811,
0.5860859751701355,
-0.6377369165420532,
0.23076143860816956,... | |
$(targeted:not).hide();
//
return false;
})
});
```
You want to use the right selector syntax to grab your divs by id, which is the string `#id`... Therefore:
```
$('#'+targeted).show();
$('something:not(#'+targeted+')').hide();
```
**EDIT**: Looking at this again (double-take), you ca... | [
0.6230780482292175,
-0.21672837436199188,
0.2545565068721771,
-0.23791101574897766,
-0.07140865921974182,
-0.08488518744707108,
0.3968437910079956,
-0.15620863437652588,
-0.08615247160196304,
-0.6059591174125671,
-0.3019787669181824,
0.4423631727695465,
-0.5163654685020447,
0.0713242217898... | |
in the example above). | [
-0.051306597888469696,
0.18393844366073608,
0.3453536927700043,
-0.10378361493349075,
0.1416689157485962,
0.180511012673378,
0.23772333562374115,
-0.21525795757770538,
-0.15417727828025818,
-0.23331326246261597,
-0.4498189687728882,
0.4134828746318817,
-0.07079681754112244,
0.1186536028981... | |
Suppose I have a large number of strings formatted something like:
```
<tag>blah blahXXXXXblah blah</tag>
```
I want to transform these strings into something like:
```
blah blahZZZZZblah blah
```
on a powershell command line. All instances of XXXXX get replaced by ZZZZZ in the transformation and the outer tags a... | [
0.4274829626083374,
0.16219840943813324,
0.13676176965236664,
0.0951676219701767,
0.07205327600240707,
-0.141201451420784,
-0.017521344125270844,
-0.05250632390379906,
-0.08515774458646774,
-0.792266309261322,
-0.11602774262428284,
0.38316208124160767,
-0.19285984337329865,
0.0641951784491... | |
of writing a .ps1 script to run.
It seems like something powershell would be good at, I just don't know how. :)
Well the simplest way that I can think of (assumes your list is held in $foo):
```
$foo | %{$_.Replace("XXXXX", "ZZZZZ")}
``` | [
0.2257591336965561,
0.05999014154076576,
0.28786903619766235,
-0.15355809032917023,
0.16988661885261536,
-0.22478322684764862,
0.36824139952659607,
0.056490812450647354,
-0.2784126102924347,
-0.32121604681015015,
0.04646270349621773,
0.7468235492706299,
-0.5132299661636353,
-0.172379598021... | |
Does anyone have any experience that indicates what kind of performance hit a developer could expect by choosing to use an ORM (in Django, RoR, SQLAlechemy, etc) over SQL and hand-designed databases? I imagine there are complicating issues, including whether specifying a database within the constraints of an ORM increa... | [
0.3764631152153015,
0.2916405498981476,
-0.17014667391777039,
0.2909521758556366,
0.012349553406238556,
-0.3375687897205353,
0.19052910804748535,
0.011247379705309868,
-0.3638559877872467,
-0.3365755081176758,
-0.001310954918153584,
0.618411123752594,
0.07067560404539108,
-0.08743570744991... | |
me.
My advice is not to worry about this until you need to - don't optimise prematurely. An ORM can provide many benefits to development speed, code readability and can remove a lot of code repetition. I would recommend using one if it will make your application easier to develop.
As you progress through the developme... | [
0.548522412776947,
0.21158763766288757,
0.18925735354423523,
0.27947142720222473,
0.2649694085121155,
-0.37847310304641724,
0.18813584744930267,
-0.14475442469120026,
-0.15555042028427124,
-0.8075324892997742,
-0.13244961202144623,
0.5657307505607605,
0.09947458654642105,
-0.13623745739459... | |
things) and then you can decide where manual queries are required. For the most part, the ORM performance will probably acceptable and the benefits of using it will far outweigh the performance cost. | [
0.38815659284591675,
0.015819471329450607,
0.724863588809967,
0.303750216960907,
0.3380643129348755,
-0.106825090944767,
0.3809584677219391,
-0.2784513235092163,
-0.1855720728635788,
-0.3665415644645691,
-0.22994154691696167,
0.9458723664283752,
0.3471928834915161,
-0.2133544534444809,
-... | |
I would like to show an XML file in my .NET 2.0 WinForms app just like IE does (where you can collapse the nodes, and everything is nicely colored). Is there a built-in way to do this?
You can host IE inside your application's form or you can display it in the WebBrowser control using the same XSL transform that IE use... | [
0.4185606837272644,
-0.24054443836212158,
0.5997876524925232,
-0.06878339499235153,
-0.20464593172073364,
-0.19753852486610413,
0.11336053907871246,
0.12589916586875916,
-0.006767010781913996,
-0.9499936699867249,
-0.02984333410859108,
0.489085853099823,
-0.21347081661224365,
0.08586735278... | |
I have a string like this:
```
string s = "This is my string";
```
I am creating a Telerik report and I need to define a `textbox` that is the width of my string. However the size property needs to be set to a Unit (Pixel, Point, Inch, etc). How can I convert my string length into, say a Pixel so I can set the width... | [
0.4315223693847656,
0.053605835884809494,
0.7095460891723633,
-0.09143457561731339,
-0.2204049825668335,
0.06237700581550598,
-0.1146383285522461,
-0.452665239572525,
-0.1967635303735733,
-0.8005116581916809,
0.08923128992319107,
0.42240530252456665,
-0.2647276520729065,
0.0747097805142402... | |
size = graphics.MeasureString("Hello there", new Font("Segoe UI", 11, FontStyle.Regular, GraphicsUnit.Point));
}
```
Or in VB.Net:
```
Using graphics As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(New Bitmap(1, 1))
Dim size As SizeF = graphics.MeasureString("Hello there", New Font("Segoe UI", 11,... | [
-0.1303897351026535,
-0.3138238787651062,
0.9155407547950745,
-0.18553340435028076,
-0.18734976649284363,
0.11012966930866241,
0.009230167604982853,
-0.34737107157707214,
-0.3584243357181549,
-0.577839195728302,
-0.4632844626903534,
0.4103250205516815,
-0.13244327902793884,
0.0436937883496... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.