text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
Color="#00000000" />
<GradientStop
Offset="1"
Color="Black" />
</LinearGradientBrush>
</Border.Background>
</Border>
``` | [
-0.18951906263828278,
-0.3219801187515259,
0.5809340476989746,
0.07081399857997894,
0.10934797674417496,
0.08170933276414871,
0.056036412715911865,
-0.2778451442718506,
-0.1848733276128769,
-0.5186445713043213,
0.14478667080402374,
0.26362717151641846,
-0.15903213620185852,
0.1040941998362... | |
I've been researching WADL and am wondering why it isn't more widely adopted?
With the rate at which REST usage seems to be growing, I'm surprised that more development efforts don't use it.
Is there are fundamental flaw in its design, is it not a good match for the culture that typically surrounds RESTful web servi... | [
0.444749653339386,
-0.22284087538719177,
0.35915690660476685,
0.13230326771736145,
-0.37451913952827454,
-0.3301421105861664,
0.2397775948047638,
-0.0020765073131769896,
-0.13687914609909058,
-0.8697139620780945,
0.12402123212814331,
0.45625823736190796,
-0.2254210263490677,
0.273523211479... | |
By following the RESTful way of using pure HTTP standards you get interoperability "for free". Once you need a document to describe the services, there will be different client frameworks (or different servers frameworks) that will interpret this document differently.
Once different frameworks auto-generate code from ... | [
0.40770652890205383,
-0.11237955093383789,
0.15671825408935547,
0.38161468505859375,
-0.26048743724823,
-0.505318284034729,
0.668826162815094,
-0.16032816469669342,
0.04209604859352112,
-0.8319527506828308,
-0.12316051870584488,
0.43178030848503113,
-0.29317715764045715,
-0.089178569614887... | |
I need to to tell which revision/SHA1 of a file was associated with one or more tags. In CVS it is possible to get an output similar to to this:
> **File**: abc.txt
>
> *Rev*: 1.0
>
> *Tags*: R1\_0, R1\_1
>
>
> *Rev*: 1.1
>
> *Tags*: R1\_2
How do you get a **tag history for a file** with git?
Edit:
I ... | [
0.6945860385894775,
0.025195863097906113,
0.41397935152053833,
-0.013111785054206848,
-0.1263297200202942,
-0.1170106753706932,
-0.06460428982973099,
-0.4490724802017212,
-0.4010407626628876,
-0.7329995036125183,
0.0678747370839119,
0.7378278374671936,
-0.22845956683158875,
0.1658354252576... | |
revision of a given file was tagged (and also which previous tags were associated to this file revision).
In my example above:
R1\_1 will be in production. Querying abc.txt, I can tell that rev1.0 for abc.txt was used for both R1\_0 and R1\_1. (Thus unlikely that a **new** bug in R1\_1 was caused by abc.txt because... | [
0.31235265731811523,
0.002501128474250436,
0.3845752775669098,
-0.13940724730491638,
0.16168813407421112,
-0.021909421309828758,
-0.07483840733766556,
-0.2830193340778351,
-0.48672011494636536,
-0.8225986361503601,
0.044499002397060394,
0.5563102960586548,
-0.4246078133583069,
0.3908064067... | |
it's changed, and how. Toss in a `-p` if you want to see the changes, too.
Less Helpful, but What You Asked For:
-------------------------------------
To do exactly what you're asking for (which I think is less useful), and assuming you're [tagging properly](http://www.rockstarprogrammer.org/post/2008/oct/16/git-tag-... | [
0.3623006045818329,
0.020845377817749977,
0.6706014275550842,
-0.07214057445526123,
0.3053586781024933,
-0.08297771960496902,
-0.046689100563526154,
-0.1831197589635849,
-0.2536246180534363,
-0.5119358897209167,
-0.07294479012489319,
0.4962119162082672,
-0.3529263138771057,
-0.055285170674... | |
I was glancing through some code I had written in my Perl class and I noticed this.
```
my ($string) = @_;
my @stringarray = split(//, $string);
```
I am wondering two things:
The first line where the variable is in parenthesis, this is something you do when declaring more than one variable and if I removed them it ... | [
0.42411646246910095,
0.011844335123896599,
0.0949845016002655,
-0.2761704623699188,
-0.0372333899140358,
-0.002540224464610219,
0.005002698861062527,
-0.06551776826381683,
-0.18658719956874847,
-0.2381262630224228,
0.07035933434963226,
0.6613799333572388,
-0.4777180254459381,
0.23743556439... | |
the `@_` array is assigned to `$string` in a scalar context, which means that `$string` would be equal to the number of parameters passed into the subroutine. For example:
```
sub foo {
my $bar = @_;
print $bar;
}
foo('bar');
```
The output here is 1--definitely not what you are expecting in this case.
Alterna... | [
0.04503384977579117,
-0.011758835054934025,
0.37207499146461487,
-0.34860122203826904,
-0.1672895848751068,
0.06055637076497078,
-0.018988054245710373,
-0.3443935215473175,
-0.14485356211662292,
-0.0981026440858841,
-0.25686442852020264,
0.7370744347572327,
-0.6268614530563354,
-0.08089549... | |
there a difference between Perl’s shift versus assignment from @_ for subroutine parameters?") if you are interested. | [
0.32012438774108887,
-0.396762490272522,
0.17926783859729767,
0.15310437977313995,
-0.1659674495458603,
0.056946076452732086,
0.16314831376075745,
0.28854477405548096,
-0.2914903461933136,
-0.2502380907535553,
-0.04780139401555061,
0.5089322328567505,
-0.20053838193416595,
-0.0321744903922... | |
I looking for something that I can either embed their uploader directly or send the video files to that will then encode the video and allow me to stream the video through a player on "my" website.
The services, I have found so far are:
* [Bits on the Run](http://www.bitsontherun.com/)
* [Bright Cove](http://www.brig... | [
1.0447832345962524,
-0.3547079265117645,
0.3982899785041809,
0.26756730675697327,
-0.007866385392844677,
0.09548159688711166,
0.14158707857131958,
0.40978118777275085,
-0.332893431186676,
-0.46409621834754944,
0.11881154775619507,
0.615379810333252,
0.2298521101474762,
0.255156010389328,
... | |
video.
**Edit:** From the number of responses, it looks like this isn't a very common task, although most websites you go to these days have video some where. A lot of that is YouTube, but there are quite a few sites that don't use YouTube either. What are these other sites use?
Another possible service that looks muc... | [
0.8789516687393188,
-0.0777105987071991,
0.47619470953941345,
0.366445928812027,
-0.3615577220916748,
0.07326943427324295,
0.10937212407588959,
0.1790953278541565,
-0.8353323936462402,
-0.23983018100261688,
0.19625239074230194,
0.6262144446372986,
-0.09061792492866516,
-0.22699056565761566... | |
Is it possible to have openGL in 2 windows? as in 2 different windows (lets say the first is 640x480 and the other is 1024x768) rendering different things (lets say one window is an editor and the other is the main/normal window display)
If you're using GLUT you can use the glutSetWindow() / glutGetWindow() calls to se... | [
-0.28435108065605164,
-0.28583964705467224,
0.5421279668807983,
0.08304920047521591,
-0.23670072853565216,
0.19832247495651245,
0.17137764394283295,
-0.03686214238405228,
-0.17744533717632294,
-1.056054949760437,
-0.15169362723827362,
0.7250737547874451,
-0.5302943587303162,
0.055677924305... | |
glXMakeCurrent().
Those functions activate the current OpenGL context to which you can render. Each platform specific library has it's own ways of creating a window and binding an OpenGL context to it.
On Windows, after you've acquired your HWND and HDC for a window (after a CreateWindow and GetDC call). You generall... | [
0.12227699905633926,
-0.2484077364206314,
0.9567280411720276,
-0.13745446503162384,
-0.16658960282802582,
0.04464832693338394,
-0.2536769509315491,
-0.13843119144439697,
-0.21543972194194794,
-0.8251442909240723,
-0.16822215914726257,
0.7291048169136047,
-0.47566771507263184,
0.10857023298... | |
0, 0, 0, 0, 0, 0, 0, 16, 0, 0, PFD_MAIN_PLANE, 0, 0, 0, 0};
if(!(l_PixelFormat = ChoosePixelFormat(m_hDC, &l_Pfd))){
throw std::runtime_error("No matching pixel format descriptor");
}
if(!SetPixelFormat(m_hDC, l_PixelFormat, &l_Pfd)){
throw std::runtime_error("Can't set the pixel format");
}
if(!(m_hRC = wgl... | [
-0.05474145710468292,
-0.09661262482404709,
0.6156086921691895,
-0.10759411752223969,
-0.16520817577838898,
0.12753549218177795,
0.18771766126155853,
-0.30923622846603394,
0.09648454934358597,
-0.9240954518318176,
-0.3156674802303314,
0.6501871347427368,
-0.4682014286518097,
0.086859740316... | |
between different contexts, however as per spec the data that you can share is pretty limited. However, most OSes allow you to share more data than specified in the specification. | [
0.5879164934158325,
0.024521898478269577,
0.11882895976305008,
0.34320101141929626,
0.062478311359882355,
-0.1877107322216034,
0.0561663880944252,
0.19907130300998688,
-0.2248949259519577,
-0.8158555626869202,
-0.13793793320655823,
0.5219972729682922,
0.06200491636991501,
0.022874830290675... | |
I get out of memory exception in my application, when the condition for IN or NOT IN is very large. I would like to know what is the limitation for that.
Perhaps you would be better off with another way to accomplish your query?
I suggest you load your match values into a single-column table, and then inner-join the c... | [
0.05128255859017372,
0.2541798949241638,
0.533935546875,
-0.011628950014710426,
-0.06173000857234001,
0.30831921100616455,
-0.007050009444355965,
-0.3468654453754425,
0.16490282118320465,
-0.8042126893997192,
0.010911406949162483,
0.5628480911254883,
-0.5018681287765503,
0.0152216963469982... | |
d3
```
```
SELECT a, b, c FROM t1
INNER JOIN temptbl ON t1.d = temptbl.dval
``` | [
-0.3735803961753845,
0.22909854352474213,
0.10701365768909454,
-0.3949124217033386,
-0.11159724742174149,
0.1082119569182396,
0.257362961769104,
-0.616716206073761,
0.0552038811147213,
-0.5165472626686096,
-0.6127971410751343,
0.41949668526649475,
-0.4331275224685669,
-0.012987025082111359... | |
If the locks make sure only one thread accesses the locked data at a time, then what controls access to the locking functions?
I thought that [boost::mutex::scoped\_lock](http://www.boost.org/doc/libs/1_37_0/doc/html/thread/synchronization.html#thread.synchronization.mutex_types.mutex) should be at the beginning of ea... | [
0.36238762736320496,
0.12039854377508163,
0.3739955723285675,
0.10911804437637329,
0.12615612149238586,
-0.037966519594192505,
0.22496573626995087,
-0.4787593483924866,
-0.3158004581928253,
-0.1646885871887207,
-0.013237745501101017,
0.7248077392578125,
-0.2956457734107971,
0.1419180482625... | |
guaranteeing that two processes don't get the lock at the same time. To do this, you need to use an atomic instruction - one that's guaranteed to complete without interruption. One such instruction is [test-and-set](http://en.wikipedia.org/wiki/Test-and-set), an operation that will get the state of a boolean variable, ... | [
0.5259033441543579,
-0.015460752882063389,
0.050093185156583786,
0.21486933529376984,
0.29444050788879395,
-0.28072673082351685,
0.3589337170124054,
-0.2722795605659485,
-0.16310402750968933,
-0.39310508966445923,
-0.12688937783241272,
0.5323470830917358,
-0.41916120052337646,
0.0935136377... | |
= 0; // set x to 0, allow another process into critical section
```
Since the other threads continually test the lock until they're let into the critical section, this is a very inefficient way of guaranteeing mutual exclusion. However, using this simple concept, you can build more complicated control structures like... | [
0.3158160150051117,
-0.1368946135044098,
0.08747877925634384,
-0.17964015901088715,
0.25866013765335083,
-0.20728570222854614,
0.31811580061912537,
-0.20311029255390167,
-0.3019999861717224,
-0.2774593234062195,
-0.0003195723402313888,
0.08299766480922699,
-0.6040859222412109,
0.4828332364... | |
In ASP.NET 3.5 (with IIS6), are AppDomains are created for every request? I know that all applications have their own AppDomain under w3wp.exe, but how exactly does the whole AppDomain work?
I was arguing today with a colleague who was trying to convince me that if an ASP.NET application has a static object (or Single... | [
-0.09179816395044327,
-0.12066082656383514,
0.381119966506958,
-0.05459805950522423,
-0.10927045345306396,
-0.018553631380200386,
0.3905411958694458,
-0.09981601685285568,
-0.3763250410556793,
-0.8627749085426331,
-0.2906872034072876,
0.4048830568790436,
-0.5950387120246887,
0.157444551587... | |
its own AppDomain, which is the scope of a singleton object. So a singleton in App1 is available to all requests to App1 (and could become a concurrency if not handled carefully), but requests in App2 would not be able to access the singleton in App1.
[ that this doesn't affect desktop browsers. It's mainl... | [
0.14710769057273865,
0.05636369436979294,
0.26898640394210815,
-0.029972238466143608,
-0.22825784981250763,
-0.2642372250556946,
0.7987725734710693,
0.12696585059165955,
-0.058225687593221664,
-0.6874182224273682,
-0.18711969256401062,
0.6058334112167358,
-0.15336212515830994,
-0.390231758... | |
be better off just using **`onchange`** or **`onblur`** instead of **`onkeydown`**.
---
---
An alternative to Dave's answer is waiting for the user to pause (e.g. for 5 seconds):
```
var textarea = document.getElementById('textarea');
function checkTextArea() {
if (textarea.value /* ... */) {
/* ... */
... | [
0.09911373257637024,
-0.10523603856563568,
0.8183056712150574,
-0.3956463932991028,
0.10817315429449081,
-0.051861077547073364,
0.5842887163162231,
-0.30696722865104675,
0.09917398542165756,
-0.6561449766159058,
-0.5730031132698059,
0.9455548524856567,
-0.15466327965259552,
-0.144312754273... | |
`setTimeout` the function's reference vs. its `return`.
---
You can also set this up in a function to make it easier to use for multiple elements:
```
function setPauseTimer(element, timeout, callback) {
var timer = null;
element.onkeydown = function () {
if (timer) clearTimeout(timer);
timer = setTimeou... | [
-0.26050853729248047,
-0.1258404701948166,
0.7660771012306213,
-0.27675265073776245,
0.021016567945480347,
0.1476922333240509,
0.10843206942081451,
-0.32098188996315,
-0.08387600630521774,
-0.650155782699585,
-0.3649284839630127,
0.6263867616653442,
-0.5611243844032288,
0.2572174668312073,... | |
I need some sort of node-graph editor, that hopefully works on both Mac and other platforms, to generate user created node collections with properties. The graph data will then be used in a data-driven application I'm working on, so kudos if the application can save the graphs in some easy to process format. So far I w... | [
0.8230301737785339,
0.0861532986164093,
0.6104477643966675,
0.09596401453018188,
-0.2282833606004715,
-0.06249433755874634,
0.021431826055049896,
0.05623844638466835,
-0.2020907700061798,
-0.8686975240707397,
0.013746190816164017,
0.241901233792305,
-0.13749343156814575,
0.1070742905139923... | |
on all output.
It comes with Mac OS binaries .. and you might be able to include ($$ required) the graphing engine it is based on into your project.
I've used it (with limited success) to [document enterprise data-flows](https://stackoverflow.com/questions/258554/how-would-you-display-layout-data-flow-between-enterp... | [
0.28968602418899536,
-0.0752360001206398,
0.4775802791118622,
0.0407027006149292,
0.18573424220085144,
-0.30022212862968445,
0.0037856325507164,
0.212226003408432,
-0.35258838534355164,
-0.6734361052513123,
-0.029560402035713196,
0.4263080358505249,
-0.19078980386257172,
-0.102538704872131... | |
I have a fairly simple UserControl that I have made (pardon my Xaml I am just learning WPF) and I want to slide the off the screen. To do so I am animating a translate transform (I also tried making the Panel the child of a canvas and animating the X position with the same results), but the panel moves very jerkily, ev... | [
-0.2019331306219101,
0.09759805351495743,
0.7795484066009521,
-0.16286654770374298,
-0.037736792117357254,
0.3246477544307709,
-0.08846631646156311,
-0.09180433303117752,
-0.21306926012039185,
-0.7043144106864929,
0.2765290439128876,
0.5121803879737854,
0.011195925995707512,
-0.22844105958... | |
so I didn't think it would be too much of a problem.
Here is the Xaml I am using, it runs fine in Kaxaml, but it is very jerky and slow (as well as being jerkly and slow when run compiled in a WPF app).
```
<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.micro... | [
-0.3591054677963257,
0.09040028601884842,
0.6628416180610657,
-0.23038354516029358,
-0.20010052621364594,
0.027783984318375587,
0.07615476101636887,
-0.12959645688533783,
-0.18473879992961884,
-0.36648768186569214,
-0.2542077898979187,
0.19647842645645142,
-0.270101934671402,
0.06509210914... | |
<Setter Property="Control.Margin" Value="10"/>
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid Name="backgroundGrid" Width="210" Height="210" Background="#00FFFFFF">
<Grid.BitmapEffect> | [
-0.09452400356531143,
-0.7062441110610962,
0.5419988632202148,
0.08863368630409241,
0.033656999468803406,
0.16661591827869415,
-0.2242891788482666,
-0.5554163455963135,
-0.316276490688324,
-0.640643298625946,
0.029736479744315147,
0.11901678144931793,
0.059128206223249435,
-0.0703462734818... | |
<BitmapEffectGroup>
<DropShadowBitmapEffect x:Name="buttonDropShadow" ShadowDepth="2"/>
<OuterGlowBitmapEffect x:Name="buttonGlow" GlowColor="#A0FEDF00" GlowSize="0"/> | [
-0.4138936698436737,
-0.6917126178741455,
0.495082825422287,
-0.12801498174667358,
-0.09230007976293564,
0.09221508353948593,
0.30378836393356323,
0.10886295884847641,
-0.24139182269573212,
-0.3913998603820801,
-0.3127411901950836,
0.5027432441711426,
-0.37178874015808105,
-0.2542836666107... | |
</BitmapEffectGroup>
</Grid.BitmapEffect>
<Border x:Name="background" Margin="1,1,1,1" CornerRadius="15">
<Border.Background> | [
-0.27594617009162903,
-0.3042919337749481,
0.5360559225082397,
0.13156935572624207,
-0.026450781151652336,
0.17586736381053925,
-0.39212626218795776,
0.061767805367708206,
-0.4589223265647888,
-0.4739139676094055,
-0.09077682346105576,
-0.0280953086912632,
-0.32935336232185364,
-0.02202467... | |
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<LinearGradientBrush.GradientStops>
<GradientStop Offset="0" Color="#FF0062B6"/> | [
-0.3689389228820801,
-0.5936881899833679,
0.8162645697593689,
-0.021916769444942474,
-0.06912790238857269,
0.44976112246513367,
0.004063606262207031,
-0.3248729407787323,
0.1781759113073349,
-0.35669323801994324,
0.3339138627052307,
0.356600821018219,
-0.1278681755065918,
0.004925271030515... | |
<GradientStop Offset="1" Color="#FF0089FE"/>
</LinearGradientBrush.GradientStops>
</LinearGradientBrush> | [
-0.4360462725162506,
-0.6889396905899048,
0.7351065278053284,
0.004209124017506838,
-0.07928238809108734,
0.3933265805244446,
-0.04697839915752411,
-0.4560719132423401,
0.057514738291502,
-0.465539813041687,
0.32223185896873474,
0.40235036611557007,
-0.20994354784488678,
-0.184721276164054... | |
</Border.Background>
</Border>
<Border Margin="1,1,1,0" BorderBrush="#FF000000" BorderThickness="1.5" CornerRadius="15"/>
<ContentPresenter HorizontalAlignment="Center" Margin="{TemplateBinding Control.Padding}" | [
-0.024638252332806587,
-0.2877959907054901,
0.9298526644706726,
0.31024834513664246,
0.21954676508903503,
-0.019771086052060127,
-0.14934469759464264,
-0.4126748740673065,
-0.292643666267395,
-0.5873485803604126,
-0.034252241253852844,
0.08829944580793381,
-0.03622950240969658,
0.124831177... | |
VerticalAlignment="Center" Content="{TemplateBinding ContentControl.Content}"
ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter> | [
-0.034747544676065445,
-0.5927770733833313,
0.7358204126358032,
0.14654658734798431,
0.1763797402381897,
0.19944889843463898,
-0.08476211130619049,
-0.2337074726819992,
-0.22259971499443054,
-0.6856807470321655,
-0.15112774074077606,
-0.04518618434667587,
-0.33589231967926025,
0.3665426969... | |
</Style>
</UserControl.Resources>
<Canvas>
<Grid x:Name="Panel1" Height="578" Canvas.Left="0" Canvas.Top="0">
<Grid.RenderTransform>
<TransformGroup>
<TranslateTransform x:Name="panelTranslate" X="0" Y="0"/>
</TransformGroup>
</Grid.Re... | [
-0.21423187851905823,
-0.46581992506980896,
0.4960480034351349,
-0.35299864411354065,
-0.5043103694915771,
0.39802542328834534,
0.051060307770967484,
-0.28372079133987427,
-0.12822918593883514,
-0.6321011185646057,
-0.1627168208360672,
0.4692615866661072,
0.0427490659058094,
-0.10982619225... | |
<Grid.RowDefinitions>
<RowDefinition Height="287"/>
<RowDefinition Height="287"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="Panel1Col1"/>
<ColumnDefinition x:Name="Panel1Col2"/> | [
-0.29121485352516174,
-0.15039299428462982,
0.3378208875656128,
-0.2071853131055832,
-0.12139280885457993,
0.17571336030960083,
-0.6640236973762512,
-0.08543239533901215,
-0.9378343224525452,
-0.6075487732887268,
0.11129112541675568,
0.3186298906803131,
-0.40624532103538513,
-0.48926380276... | |
<ColumnDefinition x:Name="Panel1Col3"/>
<ColumnDefinition x:Name="Panel1Col4"/>
<!-- Set width to 0 to hide a column-->
</Grid.ColumnDefinitions>
<Button x:Name="Panel1Product1" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center">
<... | [
-0.47129905223846436,
-0.5878329873085022,
0.4460994303226471,
-0.13236822187900543,
0.016982557252049446,
0.11320437490940094,
-0.227792426943779,
-0.26147446036338806,
-0.6790739297866821,
-0.3973533511161804,
-0.1942446082830429,
0.35688072443008423,
-0.2803134322166443,
-0.417982846498... | |
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation BeginTime="00:00:00.6" Duration="0:0:3" From="0" Storyboard.TargetName="panelTranslate" Storyboard.TargetProperty="X" To="-1000"/> | [
-0.02838648110628128,
-0.5804569721221924,
0.39021793007850647,
-0.03005608543753624,
0.10736726224422455,
0.06657809764146805,
0.21583247184753418,
-0.03911033272743225,
-0.3137151598930359,
-0.6851439476013184,
-0.13807997107505798,
0.4579090476036072,
0.1617843508720398,
-0.238125711679... | |
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Button.Triggers> | [
-0.2271004468202591,
-0.5998445749282837,
0.08892460912466049,
0.02340811863541603,
0.28936004638671875,
0.00616198405623436,
-0.1395653635263443,
-0.03401431813836098,
-0.4828920364379883,
-0.5751291513442993,
-0.3158852159976959,
0.25933748483657837,
0.10235439240932465,
-0.3156540989875... | |
</Button>
<Button x:Name="Panel1Product2" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Button x:Name="Panel1Product3" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Button x:Name="Panel1Product4" Grid.Co... | [
-0.7320024371147156,
-0.0016686397138983011,
0.4108123779296875,
-0.08133192360401154,
-0.06554990261793137,
0.5857040882110596,
-0.12897498905658722,
-0.33881744742393494,
-0.34254518151283264,
-0.7761602997779846,
-0.45499083399772644,
0.24899759888648987,
0.04410618543624878,
0.05056974... | |
<Button x:Name="Panel1Product7" Grid.Column="3" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<Button x:Name="Panel1Product8" Grid.Column="3" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Grid>
</Canvas>
</UserControl>
```
It looks like the ... | [
-0.19507570564746857,
-0.5259183049201965,
0.5738068222999573,
-0.14266711473464966,
-0.358210951089859,
0.517238199710846,
-0.07887651026248932,
-0.5311385989189148,
-0.6489004492759705,
-0.9683075547218323,
0.3255622088909149,
0.20521526038646698,
-0.021711966022849083,
-0.10927234590053... | |
For desktop based applications, what are best practices to perform auto updates? Currently, we download all files, then copy and register (if com dll) to their respective directories.
I looked at Google Chrome update method. It seems that it first downloads a zipped file into a directory, and then unzips all the file... | [
0.49462124705314636,
0.1772684007883072,
0.4948342442512512,
-0.06509628146886826,
-0.11222054064273834,
-0.21658802032470703,
-0.033169008791446686,
0.22114339470863342,
-0.41618838906288147,
-0.6850203275680542,
-0.13120435178279877,
0.6660100817680359,
-0.26083776354789734,
0.0020188856... | |
is done when you use MS's ClickOnce and I have no problem using applications with such update method so far, so I guess this classify as a "Best practice"... but that's just me.
1. Store each version in its own unique folder.
2. Use a "Launcher" to launch the most updated version available and...
3. Check for any new ... | [
0.6033041477203369,
0.01810527592897415,
0.6090500354766846,
0.1510169953107834,
-0.297097772359848,
-0.2604529857635498,
0.3606646955013275,
-0.050692882388830185,
-0.19344036281108856,
-0.6863653063774109,
-0.09866956621408463,
0.7987241744995117,
-0.1387406587600708,
-0.1205688640475273... | |
much the same.
Your user launch an application, if any new version is available, it's downloaded in the background. And then the next time the application starts, your user gets the new version automatically and (if possible) silently. | [
0.7170053124427795,
-0.0549902617931366,
0.293102502822876,
0.2262987643480301,
0.28151944279670715,
-0.33587512373924255,
-0.017749793827533722,
0.5429238677024841,
-0.2581181824207306,
-0.42969122529029846,
-0.39606162905693054,
0.6981385946273804,
0.11502031981945038,
0.0798061266541481... | |
In the ASP.NET [Page LifeCycle](http://msdn.microsoft.com/en-us/library/ms178472.aspx "MSDN Link") there is the Page.LoadComplete event.
The MSDN documentation says 'Use this event for tasks that require that all other controls on the page be loaded'. What exactly might this be? What would a 'best practice' say that L... | [
-0.01276359148323536,
-0.3945261538028717,
0.36824831366539,
0.17489273846149445,
-0.28810128569602966,
-0.4970741271972656,
0.04125933721661568,
-0.12075024098157883,
-0.5676168203353882,
-0.47579941153526306,
-0.3617386817932129,
0.4125516712665558,
-0.37245211005210876,
-0.1643612384796... | |
with your page class. When working with controls however, with the need to have some code running at Load time, you might want to make it run right before or right after what would normally happen in the Load event. Then you can use the PreLoad and LoadComplete methods.
As simon mentioned, the same pattern is followed... | [
0.11303619295358658,
-0.41807445883750916,
0.23223409056663513,
0.08533972501754761,
-0.3881717324256897,
-0.4191122055053711,
0.28522422909736633,
0.04225122183561325,
-0.42025890946388245,
-0.7017781734466553,
-0.3168385624885559,
0.5617480874061584,
-0.28868603706359863,
0.0138929057866... | |
I've found many posts where people try to work around the problem of `SelectedIndexChanged` not working when `EnableViewState='false'`.
Im a little confused why control state doesnt kick in and allow it to work, but thats bonus points if anyone can explain that too.
Some of the 'hacks' are pretty 'hacky'. Like setti... | [
0.4568242132663727,
0.08732021600008011,
0.22134093940258026,
0.4424493610858917,
-0.20010240375995636,
-0.21271684765815735,
0.3925630450248718,
0.08627017587423325,
0.08611376583576202,
-0.43160831928253174,
0.22928810119628906,
0.4321925938129425,
-0.20367425680160522,
-0.18088969588279... | |
derived control or something cleverer, but I want to make sure the solution is generic enough to be 'trustable' and not just a hack that only works for the specific page in question (which is common for such hacks!).
If you really want to know why and how this works, I'd suggest the following article:
[TRULY Understan... | [
0.28336700797080994,
-0.37128278613090515,
0.25756746530532837,
0.32860997319221497,
-0.04517320170998573,
-0.4874359965324402,
0.16448889672756195,
-0.1134110763669014,
0.20151489973068237,
-0.2910687029361725,
-0.06834790855646133,
0.596834123134613,
-0.10687248408794403,
0.0440191328525... | |
I have a small problem with the way the commands "backward-word" and "backward-kill-word" work. When I hit "backward-kill-word" on a line that is only white-spaces (for example, the first char of an indented line), the command will kill all the white-space, as well as the last word of the previous line.
This behavior ... | [
-0.027715900912880898,
0.16147024929523468,
-0.018273230642080307,
-0.107245072722435,
-0.3902149200439453,
0.25583428144454956,
0.3215034306049347,
0.04161137342453003,
0.10970105230808258,
-0.5833629369735718,
-0.022910989820957184,
0.6420539021492004,
0.04459622874855995,
-0.03053284995... | |
and only then will start killing words off the end of the line.
I'm pretty sure this behavior is the default in most applications (since it does seem to be more intuitive, which is probably because I'm used to it, but I'm not sure), so I'm wondering if there is a way to configure Emacs to have this behavior also. A fe... | [
0.20761720836162567,
-0.03596402704715729,
0.419760525226593,
0.24348236620426178,
-0.28192004561424255,
0.09426002204418182,
0.40891703963279724,
0.37330254912376404,
-0.1532994657754898,
-0.6455690264701843,
-0.01976383849978447,
0.5289262533187866,
-0.08408819884061813,
0.13013568520545... | |
was just some configurable flag in emacs to change the behavior, but it looks I'm just going to take these elisp functions and rebind the default movement and killing commands for these ones.
How about this:
```
(defun my-backward-kill-word ()
"Kill words backward my way."
(interactive)
(if (bolp)
(backwar... | [
0.10543447732925415,
0.004345810506492853,
0.484299898147583,
-0.13553814589977264,
0.14113041758537292,
0.07765701413154602,
0.5616613030433655,
-0.08411839604377747,
-0.021249784156680107,
-0.499921053647995,
-0.05574127286672592,
0.8588706851005554,
-0.3190358281135559,
-0.0692192390561... | |
Update
======
see [Using Blur Behind on Windows](http://labs.trolltech.com/blogs/2009/09/15/using-blur-behind-on-windows/) for an example of using Qt and [DWM](http://msdn.microsoft.com/en-us/library/aa969540(VS.85).aspx).[alt text http://labs.trolltech.com/blogs/wp-content/uploads/2009/09/blurbehind2.png](http://labs... | [
0.02004396729171276,
0.3024086654186249,
0.6660274267196655,
-0.1129448413848877,
-0.16064372658729553,
0.06696795672178268,
0.6336973905563354,
-0.2508738934993744,
-0.061131738126277924,
-0.6345101594924927,
-0.09836756438016891,
0.6320860385894775,
-0.2053750902414322,
0.214298874139785... | |
self.setLayout(QVBoxLayout())
self.layout().addWidget(QLabel("This is the text"))
# let the whole window be a glass
self.setAttribute(Qt.WA_NoSystemBackground)
from ctypes import windll, c_int, byref
windll.dwmapi.DwmExtendFrameIntoClientArea(c_int(self.winId()), byref(c_int(-1)... | [
0.2952039837837219,
-0.014323951676487923,
0.740186870098114,
-0.08175153285264969,
-0.23027949035167694,
0.04837636649608612,
0.4096973240375519,
-0.39548298716545105,
0.02980770543217659,
-0.9321545958518982,
-0.04176279902458191,
0.5635411739349365,
-0.33570539951324463,
0.0849582701921... | |
know how to paint itself with a while glow (like the title of the window). What I need is a general way to clean the "glass".
Just use:
```
QPainter p
p.setCompositionMode(QPainter::CompositionMode_DestinationIn);
p.fillRect(boundsRect, QColor(0, 0, 0, 0));
```
This discards the old contents and fills with transpar... | [
0.45215532183647156,
-0.19626465439796448,
0.9175191521644592,
-0.005791995208710432,
0.01918509043753147,
-0.13517418503761292,
0.23422466218471527,
-0.21363277733325958,
0.1608009934425354,
-0.9274399280548096,
-0.0012747275177389383,
0.662986159324646,
-0.05351708456873894,
-0.270637392... | |
There is this [DAL/BLL design suggestion](http://msdn.microsoft.com/en-us/library/bb288041.aspx) by Microsoft for ASP.NET (2.0) apps. I know some of the alternatives and I've read related questions here on SO. However I wonder if this proposed solution is worth implementing nowadays, is there a specific downside you kn... | [
0.36334189772605896,
-0.08935680985450745,
0.5832235217094421,
0.012495651841163635,
0.026456456631422043,
0.01431541983038187,
-0.6535175442695618,
-0.1745203137397766,
-0.37235864996910095,
-0.2490299642086029,
-0.19335255026817322,
-0.05085764825344086,
-0.21338807046413422,
-0.16149522... | |
logic. It's basically only a dumb layer that eases the CRUD operations a bit and allows databinding for controls.
Could someone, who has experience in this field, point me out the pro's and con's of this approach?
**pros:**
- simple approach and some of the data mapping is done for you with the datatable's.
- offer... | [
-0.024233823642134666,
0.09854494035243988,
0.15331082046031952,
0.47117698192596436,
-0.2039179503917694,
0.12001006305217743,
0.15723855793476105,
-0.29138731956481934,
-0.0008075413061305881,
-0.3505915701389313,
-0.08700067549943924,
0.8282731175422668,
-0.033578407019376755,
-0.252802... | |
be applied to the "business objects" this pattern would make things more difficult.
**cons:**
- large OO models will struggle in this pattern
- complex ER designs with many tables, complex relationships or OO object requirements will not fit this pattern. the datatables dont provide much assistance for in-code objec... | [
0.044850464910268784,
0.20070910453796387,
0.27982690930366516,
0.2535731792449951,
-0.322640597820282,
-0.24074487388134003,
0.18348102271556854,
-0.10942227393388748,
-0.0437299981713295,
-0.6936619877815247,
-0.02932608500123024,
0.673128068447113,
-0.36320382356643677,
-0.0653640478849... | |
also need to write from scratch).
**conclusion:**
it really depends on your requirements. if your implementation is small/simple then this might be a good idea. but growing on a small idea will be hard with this approach. a more OO approach will set you up much better for refactoring/expanding later.
this pattern is a... | [
0.16848565638065338,
-0.21142001450061798,
0.6196731925010681,
0.4279513657093048,
-0.1842058002948761,
-0.0925518199801445,
0.10008744150400162,
-0.17962691187858582,
-0.43989887833595276,
-0.6318212151527405,
0.005182167515158653,
0.5858771800994873,
0.018649684265255928,
0.0776112526655... | |
this will be a good start with handy patterns - <http://www.asp.net/learn/mvc-videos/video-350.aspx> | [
0.337595134973526,
-0.287910133600235,
0.5042168498039246,
0.31130093336105347,
-0.1128527820110321,
-0.22049033641815186,
0.35219642519950867,
-0.2919695973396301,
-0.6655750870704651,
-0.3463960587978363,
0.09398705512285233,
0.3940891921520233,
0.251751571893692,
-0.22027143836021423,
... | |
After reading quite some threads here at StackOverflow,
I have come to the conclusion that I should adopt to some form of
test driven development/unit test (or at least explore the area).
And since we are talking about c code under Linux,
I decided to give [check](http://check.sourceforge.net/doc/check.html/index.h... | [
0.6981139183044434,
0.20671722292900085,
-0.23138746619224548,
-0.10339339822530746,
-0.11692330986261368,
-0.466054767370224,
0.18232248723506927,
0.030232828110456467,
0.11007703840732574,
-0.5978996753692627,
0.21275833249092102,
0.5655374526977539,
-0.221725195646286,
0.085637934505939... | |
I was totally lost anyway and it felt like I was missing something).
This is what I have done so far, I created the following file:
* main.c, a main that only calls a function called my\_pow and prints the result.
* my\_pow.c, contains the function my\_pow.
* my\_pow.h
* my\_pow\_test.c, I figured that I should place... | [
0.13327094912528992,
0.16810517013072968,
-0.06632059812545776,
0.005917670205235481,
0.3472576141357422,
0.0027588093653321266,
0.33373621106147766,
-0.14548519253730774,
-0.09940652549266815,
-0.4844365119934082,
-0.250173956155777,
0.6152364611625671,
-0.11653311550617218,
-0.0263393539... | |
code */
}
END_TEST
//do I need some sort off main here that calls test_my_pow?
```
This is basically the same as in [the check manual](http://check.sourceforge.net/doc/check.html/index.html) chapter 3.1,
but still not....
Could someone please push me in the right direction?
Thanks
Johan
---
Update: No reason w... | [
0.6348488926887512,
0.518525242805481,
-0.22264356911182404,
0.07190527766942978,
-0.14042995870113373,
-0.2208370566368103,
0.6090602278709412,
-0.003645483171567321,
0.21979792416095734,
-0.717969536781311,
0.11476787179708481,
0.6347306370735168,
0.17858974635601044,
-0.0167268440127372... | |
check package.
In the Ubuntu case /usr/share/doc/check/example/tests/
Update: The code example was created so that you started out by looking at his first version,
then the second one etc etc. So that you could follow how he creates a very basic test case/code from nothing up to something that is useful in a traditio... | [
0.45354750752449036,
0.1939050853252411,
-0.14804524183273315,
-0.10182223469018936,
-0.052611351013183594,
-0.10478146374225616,
0.23443543910980225,
-0.42048269510269165,
0.21894609928131104,
-0.4205872416496277,
-0.045814137905836105,
0.6105587482452393,
-0.6367511749267578,
-0.23653610... | |
= pow(3,3);
fail_unless ( resultat == math,
"Error on 3^3 != %d (%d)",math, resultat);
}
```
However in the future I will not reproduce what is already in the stdlibs :-)
---
Related:
* [Unit Testing C Code](https://stackoverflow.com/questions/65820/unit-testing-c-code)
* [How to test C Code](https:... | [
0.3703177571296692,
0.19936352968215942,
0.0618206188082695,
0.13528989255428314,
0.13547302782535553,
-0.15727666020393372,
0.11114365607500076,
-0.4131069481372833,
0.02302166260778904,
-0.5703528523445129,
-0.36524698138237,
0.48977452516555786,
0.27301934361457825,
0.07313749194145203,... | |
compile [their example](http://libcheck.github.io/check/doc/check_html/check_3.html#Setting-Up-the-Money-Build-Using-CMake) first to validate your environment, although their documentation introduces new code via diff (source patch) which I do not find very convenient.
---
If ever you decide to try with another fram... | [
0.6714373230934143,
0.2066926807165146,
0.2413121908903122,
0.10731937736272812,
0.05269040912389755,
0.10382533073425293,
0.06630664318799973,
-0.0032208720222115517,
-0.13741044700145721,
-0.7073280811309814,
-0.006776831578463316,
0.6234530806541443,
0.29992520809173584,
-0.220439374446... | |
I'm new to web services and as an introduction I'm playing around with the Twitter API using the Twisted framework in python. I've read up on the different formats they offer, but it's still not clear to me which one I should use in my fairly simple project.
Specifically the practical difference between using JSON or X... | [
0.49291056394577026,
-0.11806143075227737,
0.19230324029922485,
-0.04009693115949631,
-0.21459601819515228,
-0.005396191496402025,
0.1035308912396431,
0.2763260304927826,
-0.08626040816307068,
-0.6782302856445312,
-0.08671200275421143,
0.5366033911705017,
-0.25678807497024536,
-0.167288780... | |
call to simplejson.loads(json\_string) and I have a native Python data structure (lists, dictionaries, strings etc) which I can start iterating over and processing. Anything that means writing a few less lines of code is usually a good idea in my opinion.
I often use JSON to move data structures between PHP, Python an... | [
0.3222934603691101,
-0.09469021111726761,
0.16316069662570953,
-0.04262194037437439,
-0.4289230704307556,
-0.27712658047676086,
0.16917678713798523,
-0.09012792259454727,
-0.43042290210723877,
-0.46183863282203674,
-0.0047760955058038235,
0.5938336849212646,
-0.43795862793922424,
-0.174515... | |
useful: <http://simonwillison.net/2006/Dec/20/json/> | [
-0.008136270567774773,
-0.04857157915830612,
-0.03848195821046829,
-0.16758446395397186,
-0.0828671082854271,
0.0592675656080246,
0.2514726519584656,
0.06040601432323456,
-0.15816929936408997,
-0.07963686436414719,
-0.5183544754981995,
0.2596363127231598,
0.020591767504811287,
-0.341076105... | |
What I want to achieve is very simple: I have a Windows Forms (.NET 3.5) application that uses a path for reading information. This path can be modified by the user, by using the options form I provide.
Now, I want to save the path value to a file for later use. This would be one of the many settings saved to this fil... | [
0.3268544375896454,
0.000701121287420392,
0.5515034794807434,
0.037627242505550385,
0.29246169328689575,
0.01802370510995388,
0.1474950760602951,
-0.2584405243396759,
-0.2242015302181244,
-1.0795831680297852,
0.025098949670791626,
0.6931203603744507,
-0.2922554314136505,
-0.009103447198867... | |
for the registry, I would like to get as far away from it as possible.
Does this mean that I should use a custom XML file to save configuration settings?
If so, I would like to see code example of that (C#).
I have seen other discussions on this subject, but it is still not clear to me.
If you work with Visual Studi... | [
0.33680787682533264,
-0.17418934404850006,
0.2866238057613373,
0.25386083126068115,
0.14116650819778442,
-0.10583830624818802,
0.27537405490875244,
0.06286482512950897,
-0.15375065803527832,
-1.0426249504089355,
0.03276161849498749,
0.8098377585411072,
-0.1538492739200592,
0.14088387787342... | |
Visual Studio creates the files `Settings.settings` and `Settings.Designer.settings` that contain the singleton class `Settings` inherited from [ApplicationSettingsBase](http://msdn.microsoft.com/en-us/library/system.configuration.applicationsettingsbase.aspx). You can access this class from your code to read/write app... | [
0.35595399141311646,
0.015681399032473564,
0.20384615659713745,
-0.15378740429878235,
-0.07216891646385193,
-0.05558712035417557,
0.18837390840053558,
-0.3040299117565155,
-0.17315274477005005,
-0.6800901293754578,
-0.34677523374557495,
0.7950805425643921,
-0.08398745208978653,
-0.02442280... | |
I am parsing some XML something like this:
```
<root>
<some_gunk/>
<dupe_node>
...
stuff I want
...
</dupe_node>
<bits_and_pieces/>
<other_gunk/>
<dupe_node>
...
stuff I don't want
...
</dupe_node>
<more_gunk/>
</root>
```
An XPath of `'... | [
0.41025957465171814,
0.2486015409231186,
0.27525436878204346,
0.051552239805459976,
-0.37245869636535645,
-0.030537929385900497,
-0.1292858123779297,
-0.07526649534702301,
-0.07847245037555695,
-0.6007701754570007,
0.10219331085681915,
0.576306939125061,
-0.3552181124687195,
-0.10838799178... | |
instances of `dupe_node` to play with. I only want to traverse the first. Can I do this with XPath?
```
/descendant::dupe_node[1]
```
`//dupe_node[1]` is generally wrong, although it produces an identical result in this particular case. [See docs](http://www.w3.org/TR/xpath#path-abbrev):
> The location path //para[1... | [
-0.3177976906299591,
-0.032465629279613495,
0.06659338623285294,
0.06671643257141113,
-0.06836105138063431,
0.1625608503818512,
0.11153309792280197,
-0.4238120913505554,
-0.06850536167621613,
-0.6987928748130798,
-0.24819423258304596,
0.02296890690922737,
-0.5055511593818665,
0.42548808455... | |
both bars are first children of their respective parents.
`/descendant::bar[1]` will give only one node, which is the first of all the bars in the document. | [
-0.3236352503299713,
0.22588373720645905,
0.39579060673713684,
-0.1647784560918808,
0.3589423894882202,
0.10527131706476212,
0.13713717460632324,
-0.17158526182174683,
0.22409819066524506,
-0.6755202412605286,
-0.7567667961120605,
-0.38647961616516113,
-0.3633367419242859,
0.27054819464683... | |
If i have an interface:
```
interface IFoo
{
int Offset {get;}
}
```
can i have this:
```
interface IBar: IFoo
{
int Offset {set;}
}
```
so consumers of IBar will be able to set or get?
No, you can't!
(I was about to write "Yes", but after reading Anthony's post, and trying out a few tweaks, I found t... | [
0.2027379274368286,
0.020614642649888992,
0.46192315220832825,
-0.03023979440331459,
-0.08865061402320862,
0.11067131161689758,
-0.003397552063688636,
-0.3714994192123413,
0.1578444391489029,
-0.6284993886947632,
-0.096977598965168,
0.7708290219306946,
-0.5058163404464722,
0.01578577421605... | |
last line will generate a compile error, since you have hidden IBar's Offset setter.
**EDIT:** Fixed the accesibillity modifier on the property in the class. Thx Anthony! | [
-0.019148360937833786,
-0.05353677645325661,
0.26095354557037354,
0.1263221949338913,
-0.01600428856909275,
0.05028030276298523,
0.2600795030593872,
-0.07031537592411041,
-0.3410024046897888,
-0.31802898645401,
-0.1744507998228073,
0.7616634368896484,
-0.37443700432777405,
-0.2132323831319... | |
My company does not follow any well defined process for software development. I want to implement a simple but effective process which will suit my company.
We have all sets of resources right from project managers to developers and testers.
Please provide some references or process templates that I can use.
You are... | [
0.5837724208831787,
0.41096264123916626,
-0.39080092310905457,
-0.3038128614425659,
-0.005559402517974377,
-0.134745791554451,
-0.018665999174118042,
0.2163677215576172,
-0.40117281675338745,
-0.34449028968811035,
0.11971577256917953,
0.3727562725543976,
0.07207853347063065,
0.063711903989... | |
I have a bit of PHP code which I need to return an even number of results from a MySQL database. I'm using the mysqli extension to execute my query.
My code is approximately this at the moment:
```
//assume we already have a database connection
$query = "SELECT id
FROM movies
WHERE publish =... | [
0.7819766402244568,
0.19707253575325012,
0.7275117635726929,
0.1360086351633072,
0.22191135585308075,
-0.2626623511314392,
-0.2015804797410965,
-0.1519724726676941,
-0.04222971946001053,
-0.39122408628463745,
0.2405185103416443,
0.478511780500412,
-0.05416784808039665,
0.21824756264686584,... | |
date DESC
LIMIT 6";
$result = $connection->query($query);
while ($row = $result->fetch_assoc()) {
//do some stuff
}
```
As you can see, I'm limiting the query to 6 rows, but in some conditions, fewer will be returned. If only 3 rows are returned, I want to throw away the last row and only keep 2.
Ho... | [
0.21086733043193817,
-0.3587888777256012,
0.8554786443710327,
-0.18373998999595642,
0.07545296102762222,
0.011541154235601425,
0.16030874848365784,
-0.2587898373603821,
-0.46994173526763916,
-0.5826205611228943,
-0.07176473736763,
0.5257197022438049,
-0.3481616675853729,
0.4592626392841339... | |
// OR if the current row can be divided by two
if (($result->num_rows - $counter) > 1 || ($counter % 2)) {
// result code for even rows
$counter++;
} else {
// break out of the loop
break;
}
}
``` | [
0.1356624960899353,
-0.008558816276490688,
0.1473572701215744,
-0.2259049266576767,
0.27231329679489136,
0.02095610462129116,
0.2546747028827667,
-0.4396461546421051,
-0.345630943775177,
-0.350093275308609,
-0.35220953822135925,
0.33438602089881897,
-0.3134877383708954,
0.23487015068531036... | |
I have nested xsl:for loops:
```
<xsl:for-each select="/Root/A">
<xsl:for-each select="/Root/B">
<!-- Code -->
</xsl:for>
</xsl:for>
```
**From within the inner loop, how can I access attributes from the current node in the outer loop?**
I keep finding myself writing code like this:
```
<xsl:for-ea... | [
0.20264174044132233,
0.1330246776342392,
0.14383147656917572,
-0.16141031682491302,
-0.19285652041435242,
-0.011469668708741665,
0.42630860209465027,
-0.1880674660205841,
-0.04819922894239426,
-0.8407847285270691,
0.2333345115184784,
0.25994497537612915,
-0.1990901678800583,
0.116864457726... | |
creating one variable for each piece. Is there an easier way?
You can store the entire /Root/A structure in a variable, and make reference to that variable rather than creating a new variable for every attribute and subelement you need to access.
```
<xsl:for-each select="/Root/A/">
<xsl:variable name="ROOT_A" sel... | [
0.16360923647880554,
-0.18440616130828857,
0.20267264544963837,
0.16853895783424377,
-0.31320491433143616,
0.07041264325380325,
0.0043268329463899136,
-0.1912357360124588,
-0.23693987727165222,
-0.517360508441925,
-0.1468917429447174,
0.156846821308136,
-0.27885696291923523,
0.138425275683... | |
I've got an entity Product like this:
```
[Class(0, Name = "Product", Table = "Products")]
public class Product
{
private readonly ISet<ProductPropertyValue> _productPropertyValues;
private readonly ISet<ProductImage> _productImages;
private readonly ISet<ProductComment> _productComments;
private reado... | [
0.3849250078201294,
0.00014952757919672877,
0.40470269322395325,
-0.267848938703537,
0.25297224521636963,
0.20441003143787384,
0.014495505020022392,
-0.22760887444019318,
0.04044882580637932,
-0.4159643054008484,
-0.32301872968673706,
0.42455920577049255,
-0.23419810831546783,
0.4746867716... | |
= new List<Category>();
_rates = new HashedSet<Rate>(); ;
}
[Id(0, Name = "ProductId", Type = "Int32", Column = "ProductID")]
[Generator(1, Class = "native")]
public virtual Int32 ProductId { get; set; }
[Property(0, Name = "Description", Column = "Description", Type = "string")]
publi... | [
0.183632031083107,
-0.32366907596588135,
0.31455937027931213,
-0.12866120040416718,
0.26184752583503723,
0.14338931441307068,
0.12168862670660019,
-0.4218757748603821,
-0.10546079277992249,
-0.639612078666687,
-0.5349155068397522,
0.6521883010864258,
-0.20385925471782684,
0.638609409332275... | |
[Property(0, Name = "ProductName", Column = "ProductName", Type = "string")]
public virtual String ProductName { get; set; }
[Property(0, Name = "UnitPrice", Column = "UnitPrice", Type = "double")]
public virtual double UnitPrice { get; set; }
[Property(0, Name = "UnitsInStock", Column = "UnitsInStock... | [
0.330510675907135,
-0.24591617286205292,
0.31499776244163513,
0.02397189848124981,
0.3882443606853485,
0.2234390527009964,
0.12270424515008926,
-0.4389752745628357,
-0.06389091908931732,
-0.5501536130905151,
-0.44318991899490356,
0.6513559222221375,
0.14406903088092804,
0.8219423890113831,... | |
"NumberOfSales", Column = "NumberOfSales", Type = "int")]
public virtual int NumberOfSales { get; set; }
[Property(0, Name = "NumberOfViews", Column = "NumberOfViews", Type = "int")]
public virtual int NumberOfViews { get; set; }
[Property(0, Name = "IsSpecial", Column = "IsSpecial", Type = "boolean")... | [
0.13801419734954834,
-0.15464571118354797,
0.7993158102035522,
0.08386946469545364,
0.08718865364789963,
0.37098070979118347,
0.1941070705652237,
-0.011760133318603039,
-0.2320646494626999,
-0.5880944132804871,
-0.4033321440219879,
0.5952292084693909,
0.1156972199678421,
0.1960848718881607... | |
= "boolean")]
public virtual bool Enabled { get; set; }
[Bag(0, Name = "Categories", Lazy = true, Table = "Products_Categories",
Access = "field.camelcase-underscore", Cascade = "none")]
[Key(1, Column = "ProductID")]
[ManyToMany(2, Class = "Category", Column = "CategoryID")]
public virtual... | [
-0.12576057016849518,
-0.35641947388648987,
0.6271142363548279,
0.04460008069872856,
-0.05685260519385338,
0.06996897608041763,
0.29070258140563965,
-0.09697473794221878,
-0.39341405034065247,
-0.43392422795295715,
-0.4684574604034424,
0.5555834770202637,
-0.346539169549942,
0.348679602146... | |
Cascade = "save-update", Inverse = true)]
[Key(1, Column = "ProductID")]
[OneToMany(2, Class = "ProductComment")]
public virtual ReadOnlyCollection<ProductComment> ProductComments
{
get { return new ReadOnlyCollection<ProductComment>(new List<ProductComment>(_productComments)); }
}
[Set... | [
0.06171401962637901,
-0.33463364839553833,
0.59132319688797,
0.07596071809530258,
0.3746732473373413,
0.22139084339141846,
0.15584465861320496,
-0.39786297082901,
-0.4337179660797119,
-0.6254087686538696,
-0.21609272062778473,
0.3244113624095917,
-0.33591264486312866,
0.44449684023857117,
... | |
{
get { return new ReadOnlyCollection<ProductImage>(new List<ProductImage>(_productImages)); }
}
[Set(0, Name = "ProductPropertyValues", Lazy = true, Access = "field.camelcase-underscore",
Cascade = "save-update")]
[Key(1, Column = "ProductID")]
[OneToMany(2, Class = "ProductPropertyVal... | [
-0.11132428795099258,
-0.3677115738391876,
0.513818621635437,
0.059730414301157,
0.3113941550254822,
0.42900627851486206,
0.07696154713630676,
-0.2784481644630432,
-0.22332119941711426,
-0.7632802128791809,
-0.3759390413761139,
0.8727516531944275,
-0.11129648983478546,
0.2588389217853546,
... | |
Cascade = "save-update")]
[Key(1, Column = "ProductID")]
[OneToMany(2, Class = "Rate")]
public virtual ReadOnlyCollection<Rate> Rates
{
get { return new ReadOnlyCollection<Rate>(new List<Rate>(_rates)); }
}
/// <summary>
/// Gets everage rate.
/// </summary>
/// <value>The e... | [
0.2714647054672241,
-0.6318193674087524,
0.65999835729599,
0.15243111550807953,
0.24663561582565308,
0.12995533645153046,
0.16596214473247528,
-0.28316986560821533,
-0.17605502903461456,
-0.6729593873023987,
0.21757292747497559,
0.39327025413513184,
-0.37201157212257385,
0.2153962850570678... | |
{
if (_rates.Count != 0)
{
return _rates.Average(x => x.Value);
}
return 0;
}
}
/// <summary>
/// Gets rounded average | [
0.22475431859493256,
-0.38488245010375977,
0.44257616996765137,
0.013325030915439129,
-0.020911524072289467,
0.13816292583942413,
0.07654239982366562,
-0.09656736254692078,
-0.1159377247095108,
-0.5862407088279724,
0.0667319968342781,
0.6623573303222656,
-0.02385888807475567,
0.19739469885... | |
rate.
/// </summary>
/// <value>The rounded average rate.</value>
public Int32 AverageRateRounded
{
get
{
return (int)Math.Round(AverageRate);
}
}
/// <summary>
/// Gets the number of votes.
/// </summary>
/// <value>The number of votes.</value>
... | [
-0.02350093051791191,
-0.48351290822029114,
0.29766106605529785,
0.007444241549819708,
-0.4144859313964844,
0.482578307390213,
-0.21746334433555603,
-0.26255208253860474,
-0.16282981634140015,
-0.5955830812454224,
0.15563757717609406,
0.3739286959171295,
-0.16838645935058594,
-0.3319868445... | |
{
get
{
return _rates.Count;
}
}
/// <summary>
/// Add new comment to current product
/// </summary>
/// <param name="commentToAdd">Comment to add</param>
public virtual void AddComment(ProductComment commentToAdd)
{
if (commentToAdd != null) | [
0.5919547080993652,
-0.1327051967382431,
0.42125403881073,
-0.13785941898822784,
0.03869171813130379,
0.47683650255203247,
-0.21967287361621857,
-0.45988377928733826,
-0.11718609184026718,
-0.41094860434532166,
-0.45206907391548157,
0.39878711104393005,
-0.23137646913528442,
0.221469551324... | |
{
if (!_productComments.Contains(commentToAdd))
{
_productComments.Add(commentToAdd);
}
}
}
/// <summary>
/// Delete comment from current product
/// </summary>
/// <param name="commentToDelete"></param>
public virtual void DeleteComm... | [
0.5127246379852295,
0.06125444173812866,
0.41371533274650574,
-0.2414214313030243,
0.23338676989078522,
0.47643694281578064,
-0.2188323438167572,
-0.49099934101104736,
-0.2995295822620392,
-0.3327205777168274,
-0.6430611610412598,
0.27927669882774353,
-0.37153202295303345,
0.43918624520301... | |
commentToDelete)
{
if (commentToDelete != null)
{
if (_productComments.Contains(commentToDelete))
{
_productComments.Remove(commentToDelete);
}
}
}
/// <summary>
/// Add image | [
0.4498283565044403,
-0.18474671244621277,
0.5686174035072327,
-0.223917156457901,
0.0024436982348561287,
0.12417211383581161,
-0.10608440637588501,
-0.27396878600120544,
-0.11204086989164352,
-0.7529218792915344,
-0.3628896474838257,
0.4759434163570404,
-0.6119840145111084,
0.0972829759120... | |
to current product
/// </summary>
/// <param name="imageToAdd">Image to add</param>
public virtual void AddImage(ProductImage imageToAdd)
{
if (imageToAdd != null)
{
if (!_productImages.Contains(imageToAdd))
{
_productImages.Add(imageToAdd); | [
0.22728444635868073,
-0.11824508756399155,
0.8600369691848755,
-0.3360360860824585,
0.18395200371742249,
0.3740685284137726,
-0.38731175661087036,
-0.5042797923088074,
-0.20085681974887848,
-0.6158223748207092,
-0.44076937437057495,
0.342174768447876,
-0.2715388238430023,
0.226095288991928... | |
}
}
}
/// <summary>
/// Delete image from current product
/// </summary>
/// <param name="imageToDelete">Image to delete</param>
public virtual void DeleteImage(ProductImage imageToDelete)
{
if (imageToDelete != null)
{
if (_productImages.Contains(imageTo... | [
0.1038222536444664,
-0.18804198503494263,
0.5436712503433228,
-0.19529345631599426,
0.09644327312707901,
0.44201764464378357,
0.061805471777915955,
-0.5018923282623291,
-0.3760194480419159,
-0.3575771450996399,
-0.2857586145401001,
0.38950636982917786,
-0.3761787414550781,
0.26200932264328... | |
_productImages.Remove(imageToDelete);
}
}
}
/// <summary>
/// Add property to current product
/// </summary>
/// <param name="valueToAdd">Value to add</param>
public virtual void AddProrerty(ProductPropertyValue valueToAdd)
{
if (valueToAdd != null)
{ | [
0.3303625285625458,
-0.0969381257891655,
0.668794572353363,
-0.22095328569412231,
0.1302207112312317,
0.3026309609413147,
-0.11036974936723709,
-0.6614612936973572,
-0.14816445112228394,
-0.4681178331375122,
-0.3206823766231537,
0.4183920621871948,
-0.23900917172431946,
0.3416098654270172,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.