text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="contentPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
... | [
-0.13828632235527039,
-0.21211212873458862,
0.9637171626091003,
0.3337577283382416,
0.05815950408577919,
0.23104286193847656,
0.02804710529744625,
-0.2814268171787262,
-0.13293761014938354,
-0.4995175898075104,
-0.2882133424282074,
0.6147758364677429,
0.07770242542028427,
-0.12363053858280... | |
</Grid>
</ControlTemplate>
</Setter.Value> | [
0.03045685961842537,
-0.36852845549583435,
0.27962735295295715,
0.31527605652809143,
0.009698414243757725,
-0.015623207204043865,
-0.5178399682044983,
-0.3273177444934845,
-0.12070218473672867,
-0.6926102638244629,
0.031841278076171875,
0.29157885909080505,
-0.3654003441333771,
0.166913792... | |
</Setter>
</Style>
</Grid.Resources>
<VisualStateManager.VisualStateGroups> | [
0.5203129649162292,
-0.44767841696739197,
0.3108993470668793,
0.24154523015022278,
-0.39323773980140686,
0.25373268127441406,
-0.34079432487487793,
0.0029607899487018585,
-0.28058362007141113,
-0.9106536507606506,
-0.034484364092350006,
0.10468562692403793,
-0.18654002249240875,
-0.0887174... | |
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="00:00:00.1"/>
</VisualStateGroup.Transitions> | [
0.17027269303798676,
-0.3987463414669037,
0.46666058897972107,
0.31173405051231384,
-0.33999818563461304,
0.08288220316171646,
-0.0382222943007946,
-0.04106238856911659,
-0.24261677265167236,
-0.8395267724990845,
-0.2967154383659363,
0.30342185497283936,
-0.22753167152404785,
-0.0567522048... | |
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver"/>
<VisualState x:Name="Disabled"> | [
0.22473514080047607,
-0.5201901197433472,
0.29765409231185913,
0.24597516655921936,
-0.2912856340408325,
0.2749260663986206,
0.07303133606910706,
0.37023237347602844,
0.07375793159008026,
-0.5580887794494629,
-0.029030833393335342,
0.5977128148078918,
-0.4986053705215454,
0.025249499827623... | |
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="(UIElement.Opacity)">
<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/> | [
0.006167841609567404,
-0.3241976797580719,
0.21749064326286316,
0.1269230842590332,
0.07251611351966858,
0.28933748602867126,
0.2592145800590515,
-0.050020962953567505,
-0.3627551794052124,
-0.7785407304763794,
-0.018691740930080414,
0.26316434144973755,
-0.15487268567085266,
0.04121397063... | |
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState> | [
0.6499449014663696,
-0.3791276216506958,
-0.023928912356495857,
0.28033873438835144,
-0.1895633339881897,
0.3337365984916687,
0.2686459422111511,
-0.07453574985265732,
-0.28832873702049255,
-0.8235291838645935,
0.08536943048238754,
0.22769057750701904,
-0.05297132954001427,
-0.115852415561... | |
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard/> | [
0.7787162065505981,
-0.577174723148346,
0.21381373703479767,
0.2529721260070801,
-0.17146997153759003,
0.04408550262451172,
-0.2526169419288635,
0.555362343788147,
-0.08993948251008987,
-0.6833499670028687,
-0.1873178333044052,
0.45953336358070374,
0.055473655462265015,
-0.3246293067932129... | |
</VisualState>
<VisualState x:Name="Unfocused"/>
<VisualState x:Name="FocusedDropDown"> | [
0.5216754078865051,
-0.8460682034492493,
0.6231305003166199,
0.3015923798084259,
-0.6519532203674316,
-0.2246163934469223,
0.09952597320079803,
0.24267606437206268,
-0.15015660226345062,
-0.3444509208202362,
-0.2694076895713806,
0.5791186094284058,
-0.5014936327934265,
-0.00621357792988419... | |
<Storyboard>
<ObjectAnimationUsingKeyFrames Duration="00:00:00" Storyboard.TargetName="PopupBorder" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="00:00:00"> | [
0.0516885370016098,
-0.44640424847602844,
0.44991010427474976,
0.10325761884450912,
-0.016771411523222923,
-0.09969469904899597,
0.41293197870254517,
0.11658500880002975,
-0.17194385826587677,
-0.6662375926971436,
-0.15997502207756042,
0.29312431812286377,
0.16266241669654846,
0.0023664946... | |
<DiscreteObjectKeyFrame.Value>
<Visibility>Visible</Visibility> | [
0.040479887276887894,
-0.10346519947052002,
-0.15266053378582,
0.14699548482894897,
-0.11944849789142609,
0.05977589264512062,
0.1785595417022705,
0.15616677701473236,
-0.22762447595596313,
-0.7983095645904541,
0.018936164677143097,
0.13804620504379272,
-0.13567078113555908,
-0.09583383798... | |
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame> | [
-0.22043919563293457,
0.027076056227087975,
-0.11622653156518936,
0.20539015531539917,
-0.028013968840241432,
0.09292332082986832,
-0.09786370396614075,
0.09806107729673386,
-0.08457466214895248,
-0.5759154558181763,
0.007173091173171997,
0.16834858059883118,
-0.21795177459716797,
-0.00454... | |
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup> | [
0.26624661684036255,
-0.2592344284057617,
0.2644074559211731,
0.15830451250076294,
-0.39074158668518066,
0.2570711672306061,
0.14806663990020752,
0.0858568623661995,
-0.15202797949314117,
-0.6449444890022278,
-0.06268052011728287,
0.36350882053375244,
0.09866071492433548,
-0.02793963067233... | |
</VisualStateManager.VisualStateGroups>
<Border x:Name="ContentPresenterBorder">
<Grid>
<ToggleButton BorderThickness="{TemplateBinding BorderThickness}" HorizontalContentAlignment="Right" HorizontalAlignment="Stretch" Margin="-1" x:Name="DropDownT... | [
0.07984859496355057,
-0.49800997972488403,
0.8366498947143555,
0.20918306708335876,
0.11825022101402283,
0.27630969882011414,
-0.2864937484264374,
-0.45111456513404846,
-0.1624513417482376,
-0.5684207081794739,
0.1159023642539978,
0.41217726469039917,
-0.11416209489107132,
0.13577429950237... | |
TemplatedParent}}" ClickMode="Press">
<Path Height="4" HorizontalAlignment="Right" Margin="0,0,6,0" x:Name="BtnArrow" Width="8" Stretch="Uniform" Data="F1 M 301.14,-189.041L 311.57,-189.041L 306.355,-182.942L 301.14,-189.041 Z " Fill="{StaticResource GlossyBlack_GreyStateBackground}"/>
... | [
0.2841540277004242,
-0.42842015624046326,
0.6611063480377197,
0.1307830810546875,
0.09027118235826492,
0.20578505098819733,
-0.055825959891080856,
-0.495530366897583,
-0.1698111742734909,
-0.40271079540252686,
0.019494568929076195,
0.4340862035751343,
-0.24958381056785583,
0.03038171492516... | |
<ContentPresenter HorizontalAlignment="Left" Margin="3,3,23,3" x:Name="ContentSite" VerticalAlignment="Center" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" IsHitTestVisible="False"/>
... | [
-0.22819112241268158,
-0.2578432559967041,
0.6786999106407166,
0.2621920108795166,
-0.013114580884575844,
0.12672914564609528,
0.041470810770988464,
-0.38277751207351685,
-0.15755552053451538,
-0.44803735613822937,
-0.14813239872455597,
0.11037354171276093,
-0.017674461007118225,
0.3395385... | |
<Popup IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" x:Name="Popup" Focusable="False" AllowsTransparency="True" PopupAnimation="Slide">
<Grid MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="DropDown" SnapsToDevicePixels="True">
... | [
-0.006876292638480663,
-0.5172727704048157,
0.9708729982376099,
0.39132261276245117,
0.03759487345814705,
0.0872475728392601,
-0.25920096039772034,
-0.3022916316986084,
-0.24441751837730408,
-0.42965131998062134,
-0.2180403769016266,
0.5645483732223511,
0.012338566593825817,
-0.13860425353... | |
<ScrollViewer BorderThickness="0" Padding="1" Foreground="{StaticResource GlossyBlack_Selected}" BorderBrush="{x:Null}" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
<ItemsPresenter/>
... | [
-0.13100554049015045,
-0.3629470765590668,
1.0208534002304077,
0.33323928713798523,
-0.0748937651515007,
0.029314137995243073,
0.11707331240177155,
-0.5225262641906738,
-0.14573760330677032,
-0.3887059688568115,
0.13135041296482086,
0.6161782741546631,
-0.14938655495643616,
-0.057958908379... | |
</Border>
</Grid>
</Popup>
</Grid>
</ControlTemplate>
</Setter.Value> | [
-0.03411906585097313,
-0.341166228055954,
0.4908703863620758,
0.42590415477752686,
0.1352108120918274,
-0.06471548229455948,
-0.3138674795627594,
-0.3936791718006134,
-0.1772550344467163,
-0.7422286868095398,
-0.1589674949645996,
0.08163819462060928,
-0.31490981578826904,
0.107939437031745... | |
</Setter>
</Style>
```
I tried a few things, the problem was the Path.
```
<Path Height="Auto" HorizontalAlignment="Stretch" Margin="0,0,0,6" VerticalAlignment="Stretch" Stretch="Fill" Data="M100,12.903966 C59.117226,15.115555 23.108757,29.203354 -1.2437163E-14,60 L-3.2684966E-13,0 C12,-2.8610229E-06 100,0 100,0" x:... | [
-0.18838657438755035,
0.05836734175682068,
0.791719377040863,
0.1096281111240387,
-0.07393170893192291,
0.2981690466403961,
0.10753339529037476,
-0.16554111242294312,
-0.06310082972049713,
-0.4969927966594696,
-0.05749654024839401,
0.6597080230712891,
0.009301183745265007,
-0.2905267477035... | |
I'm a C# developer, and I'm trying to grasp what's the role of WinAPI on Windows development. My perception is that it is the sole exposition of the kernel itself, and that, before .NET, it was also the "Windows development" itself (not counting non-Microsoft technologies), but I'm not sure of none of these statements.... | [
0.1724943071603775,
0.13008098304271698,
-0.2522723972797394,
0.006782488897442818,
-0.4365640878677368,
-0.09356354922056198,
-0.006877301260828972,
0.4087482988834381,
-0.019974419847130775,
-0.35689297318458557,
-0.17331275343894958,
0.9221060872077942,
-0.18458448350429535,
0.078430831... | |
role of each on Windows development (in any area, like web, business, software products, etc) nowadays?
* Are there more WinAPI (C/C++) developers than .NET developers nowadays?
* Where do WinRT enters?
The Windows API is (more or less) the substrate that underlies .NET, yes.
No, it is not the lowest level of developm... | [
0.019882498309016228,
0.04582845792174339,
0.12996245920658112,
0.07833530753850937,
-0.23602816462516785,
-0.006226894445717335,
-0.07620998471975327,
0.08598672598600388,
-0.17258237302303314,
-0.47788599133491516,
-0.13094466924667358,
0.6538028120994568,
-0.2666476368904114,
0.19183534... | |
well.
The next step "below" that would probably be device driver code, but it's enough different that it's open to question whether it really counts. You don't normally use it to write applications at all, but (obviously enough) device drivers.
WinRT is basically a new API that sits (more or less) alongside the exist... | [
0.285711407661438,
0.08755068480968475,
0.21282684803009033,
0.13420796394348145,
0.07104802131652832,
-0.019917955622076988,
-0.22251556813716888,
0.1606806367635727,
-0.0794139876961708,
-0.567677915096283,
0.1417853832244873,
0.9948092103004456,
-0.05860700085759163,
0.04276165738701820... | |
I want to use the "Restore last session" function in firefox, on my own customized homepage.
I just can't find any information on how to use the function, if it is even possible.
so:
1. Is it possible to use the restore last session on a webpage?
2. if it is, how? javascript, php, html?
Firefox's feature it is not... | [
0.31617850065231323,
0.06443418562412262,
0.4200073182582855,
0.02381974086165428,
-0.04713398590683937,
-0.28246015310287476,
0.41138026118278503,
0.05509771779179573,
-0.18690884113311768,
-0.8307254314422607,
-0.05558471754193306,
0.8225853443145752,
-0.10749758034944534,
-0.07637140899... | |
I have a Django Queryset object called `data` containing string keys and float values.
I want to convert all floats to 2 decimal places.
If I do this:
```
>>> param1_values = [d[param1] for d in data]
>>> param1_values[:5]
[26.1, 24.6, 26.2444444444444, 27.3103448275862, 26.7576923076923]
```
...which is fine but ... | [
-0.07198049873113632,
0.5574920177459717,
0.24905461072921753,
-0.10915768146514893,
-0.27779826521873474,
0.12070229649543762,
0.15684635937213898,
-0.5361163020133972,
-0.4549594521522522,
-0.1616179347038269,
0.16944730281829834,
0.16076698899269104,
-0.3423653841018677,
-0.132396057248... | |
d in data]
```
> Note: The behavior of round() for floats can be surprising: for
> example, round(2.675, 2) gives 2.67 instead of the expected 2.68. This
> is not a bug: it’s a result of the fact that most decimal fractions
> can’t be represented exactly as a float. See [Floating Point
> Arithmetic: Issues and Li... | [
0.05566146597266197,
-0.10415060818195343,
0.3749706745147705,
0.13590821623802185,
-0.5069273114204407,
0.1996118128299713,
-0.21138349175453186,
-0.5766971707344055,
-0.1382598727941513,
-0.2822518050670624,
-0.12216705828905106,
0.21233715116977692,
-0.02129092998802662,
0.0971022620797... | |
I'm facing an awkward problem using the subprocess.call operator in python for a script.
I have to run a pipeline program (*bowtie*) multiple times and then use the output in different ways. For that purpose, I'm using the subprocess.call.
Problem is that bowtie takes in input 2 files, an index and a text file, and I ... | [
0.15138965845108032,
0.0704912543296814,
0.2545272409915924,
-0.15441441535949707,
0.039747629314661026,
0.23250722885131836,
0.2567152976989746,
-0.14387346804141998,
-0.019099468365311623,
-0.6249439716339111,
0.3300210237503052,
0.5329777598381042,
-0.49049466848373413,
0.35880336165428... | |
way to avoid this problem?
Here's part of the code i'm working on (very raw):
```
inpath = "/media/2tbhd/workdata/nanocage_noadapt/zf/fasta/zf_ad_c_r2.fasta"
ind_path = "indexes/zf_gen_topl"
for elem in plist:
cmd = subprocess.call(["bowtie","-f","-v 3", "--best" "--suppress 6,7" "-p 6"], shell = True, stdin... | [
0.052200380712747574,
-0.04458931088447571,
0.4776710867881775,
0.012253220193088055,
0.17556311190128326,
-0.10832378268241882,
0.2829073965549469,
-0.46417897939682007,
-0.3748667240142822,
-0.7335634827613831,
-0.0023964594583958387,
0.46349790692329407,
-0.12034628540277481,
0.02762523... | |
I'm new to mySQL and as such am just looking for a very simple COUNT query which I haven't found explained online with any real clarity.
What I'm looking to do is
COUNT the number of rows in my PASSENGER table where groupID = 0, and then be able to echo the numerical value that the count will return, how can I do thi... | [
-0.1499367505311966,
0.10231870412826538,
0.5281075239181519,
-0.16455185413360596,
-0.19944992661476135,
0.17975962162017822,
0.05167315527796745,
-0.26426854729652405,
-0.3590075373649597,
-0.419053852558136,
0.30522826313972473,
0.35390955209732056,
-0.3259666860103607,
0.06981199234724... | |
*Disclaimer:* This question is strictly academic. The example I'm about to give is probably bad style.
Suppose in C I write a subroutine of this form:
```
char *foo(int x)
{
static char bar[9];
if(x == 0)
strcpy(bar, "zero");
else
strcpy(bar, "not zero"),
return bar;
}
```
Then, el... | [
0.02361461892724037,
0.34465038776397705,
0.350789874792099,
-0.3476589322090149,
-0.03717271238565445,
0.02745898813009262,
0.2449597865343094,
-0.05181999132037163,
0.06053459271788597,
-0.2971935272216797,
-0.3105628192424774,
0.6539425849914551,
-0.32429176568984985,
-0.002174257533624... | |
this actually required by the C standard, or am I in nasal demon territory?
To make things even worse, what about something like
```
strcpy(foo(5), "five");
```
My mental model says this should "work" unless it's explicitly illegal, though it's somewhat pointless since it doesn't affect the output of `foo`. But aga... | [
0.5949835181236267,
0.12404609471559525,
0.36322611570358276,
-0.2875891625881195,
-0.11619509011507034,
-0.3156568109989166,
0.556178629398346,
-0.05298123508691788,
-0.41868412494659424,
-0.13613905012607574,
-0.3084266781806946,
0.7970265746116638,
-0.27746012806892395,
-0.1138971522450... | |
out of bounds memory access and so no undefined behaviour. The `static` data in the function is there throughout the program's lifetime, containing the last value that was written to it.
There could be problems if you try:
```
printf("%i is %s but %i is %s\n", 5, foo(5), 0, foo(0));
```
You will get the wrong answe... | [
-0.2549653649330139,
-0.09291412681341171,
0.3270757496356964,
-0.018692055717110634,
0.30406278371810913,
0.04304319992661476,
0.1646101176738739,
-0.047251515090465546,
-0.11440359055995941,
-0.0818302258849144,
-0.42347079515457153,
0.37480562925338745,
-0.2927052974700928,
0.1985308676... | |
I need my application run in multiple screen resolutions.
Currently I have specified all the dimensions in percentage (%) instead of pixels (px) so that it will automatically re-size with the screen.
Which would be the more reliable unit of measurement for specifying dimensions on my webpage: Pixels (or EM) or Percent... | [
0.20098139345645905,
0.15208615362644196,
0.8147103190422058,
0.19160833954811096,
-0.34351617097854614,
0.2126888930797577,
0.2018667310476303,
-0.2700290381908417,
-0.26792407035827637,
-0.9570062160491943,
0.12453928589820862,
0.5622705221176147,
0.06292925029993057,
0.1704736053943634,... | |
but can be much more difficult to ensure you're layout is not junked by each level of resolution. | [
0.13979996740818024,
0.27298086881637573,
0.30066362023353577,
0.1867378056049347,
0.3434777557849884,
-0.11199202388525009,
0.14214712381362915,
-0.13942334055900574,
-0.40562108159065247,
-0.6166390776634216,
-0.16283228993415833,
0.36987942457199097,
0.19515778124332428,
-0.041766874492... | |
I'm writing a LabVIEW VI to move a Zaber linear actuator, and I want to record the device's position every few milliseconds as it moves.
I've installed [Zaber's LabVIEW driver](http://www.zaber.com/wiki/Software/Labview_Driver) and used its examples to get my actuator moving, but how can I read the position during tho... | [
0.29510384798049927,
-0.26821544766426086,
0.9060245752334595,
0.10452278703451157,
-0.11442442983388901,
0.3268594443798065,
0.04487285017967224,
-0.4443281292915344,
-0.01972895860671997,
-0.7414652705192566,
0.3504863679409027,
0.5495222210884094,
-0.15309755504131317,
0.080827228724956... | |
from [our web site](http://www.zaber.com/software/LabVIEWTrackPosition.zip).
The easiest method is to just interpolate the position based on where the motion started and stopped. If your acceleration is reasonably high, then this makes a good first attempt. Sources of error are the acceleration and deceleration at the... | [
0.2321680337190628,
-0.22067683935165405,
0.6903434991836548,
0.01975649781525135,
0.2813674807548523,
0.13781540095806122,
0.18599042296409607,
0.03523416072130203,
-0.1337738335132599,
-0.5355201363563538,
0.15119332075119019,
0.33111438155174255,
0.18928757309913635,
-0.0469937399029731... | |
query the position. Theoretically, you can get down to about 12 ms, but 15 ms would give you a bit of breathing room.

The last option is to turn on a device mode that sends a position update every 250 ms. The advantage is that the timing is slightly... | [
-0.2603882849216461,
-0.3861224949359894,
0.8079972863197327,
0.12582071125507355,
0.08967552334070206,
0.07084968686103821,
0.3787822425365448,
0.03477019444108009,
-0.44099757075309753,
-0.7119483947753906,
-0.18426790833473206,
0.5236204862594604,
0.12706199288368225,
-0.130493462085723... | |
We're trying to add a unique constraint to our postgres table in a way that deletes the duplicates rather than throwing an error. The unique constraint spans two columns, and there is no primary key. For example:
```
i_id | term | date_created
1 | 'mako' | 123456789
1 | 'mako' | 123451234
1 | 'tele' | 21345... | [
0.15182308852672577,
0.10893851518630981,
0.1940193921327591,
0.19222566485404968,
0.28660041093826294,
0.09653191268444061,
0.09972945600748062,
-0.2672770321369171,
-0.10791227221488953,
-0.574221134185791,
-0.10142208635807037,
0.1339520663022995,
-0.3087797164916992,
0.6810287833213806... | |
distinct thrown in, but we don't have any distinguishing key for the rows. Specifically, the unique key would be over the columns [i\_id, term].
(WTF didn't we have a unique constraint from the start? Go figure.)
I'm thinking a delete statement would be the best, but I can't simply write
```
delete from table where ... | [
-0.6783651113510132,
0.0617465041577816,
0.09806209802627563,
0.09652720391750336,
-0.2705911695957184,
-0.05496136099100113,
0.12122009694576263,
-0.032931480556726456,
-0.13851675391197205,
-0.5023507475852966,
-0.1952039748430252,
0.20470108091831207,
-0.18686702847480774,
0.56242460012... | |
distinct on (i_id, term)
ctid
from table
order by i_id, term
);
```
Thanks guys!
```
DELETE FROM the_table
WHERE ctid NOT IN (SELECT min(b.ctid)
FROM the_table b
GROUP BY b.i_id, b.term)
``` | [
-0.6525912880897522,
0.1216544583439827,
0.5912426114082336,
-0.05983380600810051,
-0.23297171294689178,
0.26815706491470337,
0.0742531567811966,
-0.030955281108617783,
-0.16140525043010712,
-0.6416754722595215,
-0.4541165828704834,
0.4171653389930725,
0.11667082458734512,
0.17962861061096... | |
I am using Stateless to implement FSM's in multiple classes. (<http://code.google.com/p/stateless/>)
I want to use a base class for firing triggers and logging, etc..
I also want to enforce that any class inheriting my baseFSM class implements a StateMachine with their own local States and Triggers.
However my proble... | [
0.37154629826545715,
-0.15253831446170807,
0.029711630195379257,
-0.00613716384395957,
0.01503065787255764,
-0.1464514583349228,
0.33040550351142883,
-0.1971988081932068,
-0.3206397294998169,
-0.41767966747283936,
0.05364575982093811,
0.4098409414291382,
-0.4793957471847534,
0.171678081154... | |
the same way).
BaseFSM class:
```
public abstract class BaseFSM : IStateMachine
{
#region Implementation of IStateMachine
public ICall LocalCall { get; set; }
#endregion
internal abstract enum State {}
internal abstract enum Trigger {}
internal abstract StateMachine<State, Trigger> fsm { g... | [
-0.14442963898181915,
-0.35365861654281616,
0.5702899694442749,
-0.11821886152029037,
0.345770925283432,
0.0349900983273983,
0.18940231204032898,
-0.31005385518074036,
-0.1399415135383606,
-0.6670990586280823,
-0.3395470380783081,
0.3489134907722473,
-0.37664011120796204,
0.313465625047683... | |
CallNeverConnected,
CheckForCustomIntro,
PlayIntro,
PlayPleaseEnterPin,
ReadLanguageSettings,
ChooseLanguage,
ValidatePIN,
PINWasInvalid,
IdentifyUser
}
private enum Trigger
{
Yes, | [
-0.23512575030326843,
-0.444117933511734,
0.432245671749115,
0.1315130740404129,
0.2995271682739258,
0.08306173980236053,
0.10961947590112686,
-0.15972909331321716,
0.07724437117576599,
-0.38158077001571655,
-0.10226321220397949,
0.6150537133216858,
-0.48526373505592346,
0.1888416707515716... | |
No,
DigitPressed,
PromptDonePlaying,
PromptTimerElapse,
Done
}
public Incoming_Initial(ICall call)
{
LocalCall = call;
fsm = new StateMachine<this.State, this.Trigger>(State.WaitForCallToBeAnswered);
....
```
OR I would even take something like this... | [
-0.1847306340932846,
-0.2608092427253723,
0.409440279006958,
-0.17767007648944855,
0.5325424671173096,
0.19674769043922424,
0.34796833992004395,
0.08736870437860489,
-0.1588386595249176,
-0.5189918875694275,
-0.1506062000989914,
0.6577296853065491,
-0.18753547966480255,
0.49071404337882996... | |
private StateMachine<State, Trigger> stateMachine;
public myStateMachine (Enum _states, Enum _triggers, Enum _startState)
{
State = _states;
Trigger = _triggers;
stateMachine = new StateMachine<State, Trigger>(_startState);
}
}
```
Any insight on how I can go about implementing t... | [
-0.10142304003238678,
-0.055048514157533646,
0.4945793151855469,
0.11981969326734543,
0.15200819075107574,
0.17459511756896973,
0.4704653024673462,
-0.260383278131485,
-0.023482654243707657,
-0.6728092432022095,
-0.2383551150560379,
0.7395768761634827,
-0.39077332615852356,
0.2286900132894... | |
with the system. I already have a demo state machine working, but the States and Triggers are local to that class.
I am just trying to see if I can pull the state machine out to a base class so I don't have to pass the state machine to helper functions.
If I can put the state machine in a base class, I think I coul... | [
0.10739458352327347,
-0.3559837341308594,
0.09268101304769516,
0.4359011948108673,
0.18513067066669464,
0.08306124806404114,
0.1559421271085739,
-0.09617172181606293,
-0.29887935519218445,
-0.5907700061798096,
0.01751757599413395,
0.7218910455703735,
-0.257068395614624,
0.04148160666227341... | |
this) thanks to @phoog:
```
public abstract class BaseFSM <TState> : IStateMachine
{
#region Implementation of IStateMachine
public ICall LocalCall { get; set; }
#endregion
public enum Triggers
{
Yes = 0,
No, | [
-0.025686532258987427,
-0.7127271890640259,
0.5403681993484497,
0.09946320205926895,
0.4249374568462372,
-0.2804386019706726,
0.2857472598552704,
-0.06360253691673279,
-0.003115225350484252,
-0.7643780708312988,
-0.36600610613822937,
0.2082645744085312,
-0.26677456498146057,
0.270060420036... | |
DigitPressed,
PromptDonePlaying,
PromptTimerElapse,
Done
}
protected IList<TState> States { get; set; }
protected StateMachine<TState, Triggers> fsm { get; set; }
...
class Incoming_Initial : BaseFSM<Incoming_Initial.State>
{ | [
-0.3695486783981323,
-0.5319007039070129,
0.3031338155269623,
-0.06637440621852875,
0.26462724804878235,
0.3773508369922638,
0.12330617755651474,
-0.1665508896112442,
-0.24270744621753693,
-0.7115545868873596,
-0.14741075038909912,
0.3160005211830139,
-0.2849782705307007,
0.169240951538085... | |
internal enum State
{
WaitForCallToBeAnswered,
CallConnected,
CallNeverConnected,
CheckForCustomIntro,
PlayIntro,
PlayPleaseEnterPin, | [
-0.2624417841434479,
-0.4673480689525604,
0.33770951628685,
0.060423608869314194,
0.4374712407588959,
0.4689822196960449,
0.1281600296497345,
0.011920272372663021,
0.008176474831998348,
-0.45051708817481995,
-0.041494403034448624,
0.467801570892334,
-0.35928329825401306,
0.2244920283555984... | |
ReadLanguageSettings,
ChooseLanguage,
ValidatePIN,
PINWasInvalid,
IdentifyUser
}
public Incoming_Initial(ICall call)
{
LocalCall = call; | [
-0.5691520571708679,
-0.3787825405597687,
0.27761104702949524,
-0.0784059464931488,
0.353351354598999,
0.02345791459083557,
0.11852240562438965,
0.08788968622684479,
-0.15502291917800903,
-0.5608106255531311,
-0.13240548968315125,
0.6058505177497864,
-0.36020806431770325,
0.457323700189590... | |
LocalCall.CallEventHandler += new CallEventHandler(LocalCall_CallEventHandler);
States = (State[]) Enum.GetValues(typeof (State));
fsm = new StateMachine<State, Triggers>(State.WaitForCallToBeAnswered);
```
Note that the `Enum` type represents a reference to a boxed value of an enum; it doesn... | [
0.1556539237499237,
-0.22024618089199066,
0.4876515567302704,
-0.2047189623117447,
0.20915617048740387,
0.07712151855230331,
0.4632125794887543,
-0.2069714218378067,
-0.15870548784732819,
-0.49070724844932556,
-0.3201594352722168,
0.5112447738647461,
-0.34389132261276245,
0.637605905532836... | |
that in mind, your code could be made to work with some modifications:
```
public abstract class BaseFSM<TState, TTrigger> : IStateMachine
{
#region Implementation of IStateMachine
public ICall LocalCall { get; set; }
#endregion
protected IList<TState> States { get; set; }
protected IList<TTri... | [
0.1582207828760147,
-0.38567399978637695,
0.5074089169502258,
-0.07870043069124222,
0.26856690645217896,
-0.05134657025337219,
0.19075989723205566,
-0.32071471214294434,
-0.16774514317512512,
-0.8704330921173096,
-0.3024131655693054,
0.2621886134147644,
-0.4029172360897064,
0.2557504177093... | |
{
WaitForCallToBeAnswered,
CallConnected,
CallNeverConnected,
CheckForCustomIntro,
PlayIntro,
PlayPleaseEnterPin,
ReadLanguageSettings,
ChooseLanguage,
ValidatePIN,
PINWasInvalid, | [
-0.15784092247486115,
-0.695297122001648,
0.4112280607223511,
0.2197839617729187,
0.253803014755249,
0.3179534375667572,
-0.06173058599233627,
0.08431945741176605,
-0.16321836411952972,
-0.5140740275382996,
0.06298279762268066,
0.40589994192123413,
-0.47700512409210205,
0.222373828291893,
... | |
IdentifyUser
}
public enum Trigger
{
Yes,
No,
DigitPressed,
PromptDonePlaying,
PromptTimerElapse,
Done
}
public Incoming_Initial(ICall call)
{
States = (State[])Enum.GetValues(typeof(State)); | [
-0.401418536901474,
-0.129754438996315,
0.252346396446228,
-0.371684730052948,
0.4833201467990875,
0.13947047293186188,
0.38013404607772827,
-0.25880908966064453,
0.13761655986309052,
-0.5371606349945068,
-0.1684529185295105,
0.35908645391464233,
-0.3619266152381897,
0.4576195478439331,
... | |
Triggers = (Trigger[])Enum.GetValues(typeof(Trigger));
LocalCall = call;
fsm = new StateMachine<State, Trigger>(State.WaitForCallToBeAnswered);
....
``` | [
0.15366050601005554,
-0.3794737160205841,
0.5408428907394409,
-0.29299914836883545,
0.3566182255744934,
0.08856000006198883,
0.4767730236053467,
-0.46403029561042786,
-0.33938175439834595,
-0.25644227862358093,
-0.3320595324039459,
0.6195269823074341,
-0.3061252534389496,
0.420366406440734... | |
I got another problem, this time with tables and their borders in HTML (4.01, 5.0)
Notice: All codes are from w3schools.com
When using this code:
```
<h4>One row and three columns:</h4>
<table border="1">
<tr>
<td>100</td>
<td>200</td>
<td>300</td>
</tr>
</table>
```
Everything is drawn correctly in the brow... | [
0.04267018660902977,
0.22767344117164612,
0.8681217432022095,
-0.11437041312456131,
0.07212788611650467,
-0.1974131017923355,
0.39100876450538635,
-0.5315905213356018,
-0.41986730694770813,
-0.8074018359184265,
-0.1490507423877716,
0.2427978366613388,
-0.2797093689441681,
-0.09693705290555... | |
`border` and `style`:
`http://www.free imagehosting.net/pyk3e << border="1"`
`http://www.free imagehosting.net/cw98o << style="border: 1px solid black;" for cells too`
You may need `border: 1px solid;`. Having the pixels alone isn't enough, you have to tell the browser what to do with them. :)
**But remember** that ... | [
0.3331465423107147,
-0.10024137794971466,
0.6227462887763977,
0.05270317569375038,
-0.10980585962533951,
-0.10106654465198517,
-0.043162714689970016,
-0.4234119653701782,
-0.34904614090919495,
-0.8832857012748718,
-0.14192955195903778,
0.17651335895061493,
-0.3697810769081116,
-0.036839410... | |
a class, then use that in your stylesheet, so you don't affect other innocent bystander tables. | [
0.2880381941795349,
-0.37196311354637146,
-0.1089734435081482,
0.2842942178249359,
-0.24098780751228333,
-0.2625702917575836,
0.20907089114189148,
0.1753508448600769,
-0.01624576933681965,
-0.46234652400016785,
0.03153659775853157,
0.38026705384254456,
0.2724408507347107,
-0.38197550177574... | |
All I want to do is grab an image from the web (Succeess!) and display it at whatever resolution it is origionaly, withing a scrollview. however, when i addView to the scrollview, the image gets resized, (as opposed to when if I called setContentView on teh activity itself, where as I get the result i'm looking for.
`... | [
0.27516070008277893,
-0.1886676847934723,
1.0074517726898193,
-0.07892487198114395,
-0.2155127376317978,
-0.053328584879636765,
0.27541494369506836,
-0.5017105340957642,
-0.055069319903850555,
-0.8125370740890503,
-0.17423796653747559,
0.6590820550918579,
-0.09452489018440247,
0.2554801404... | |
on the screen. What is going on?
EDIT: addContentView(sv) comes before sv.addView(d); Is this problematic? I do this because... i'm actually lazy-loading the drawable in reality, passing
I have also tried the following as a test :
```
{
ScrollView sv = new ScrollView(this);
ImageView iv = new ImageView(this);... | [
0.017517678439617157,
-0.17569521069526672,
1.1919121742248535,
-0.19833731651306152,
-0.17964720726013184,
0.05407469719648361,
0.16325512528419495,
-0.3233872354030609,
-0.17833907902240753,
-0.8214595913887024,
-0.12120524793863297,
0.761568009853363,
-0.17256635427474976,
0.13636960089... | |
enough, you have to tell the browser what to do with them. :)
**But remember** that if you use `<table style="border: 1px solid">`, that will create a border around the *TABLE*, not the *cells within the table*.
You'll need to specify a border for the cells too.
You should probably just specify a stylesheet:
```
<s... | [
0.3491896986961365,
-0.026166947558522224,
0.46135374903678894,
0.0718364268541336,
-0.1839418262243271,
-0.19162368774414062,
0.052000585943460464,
-0.3507155179977417,
-0.3728615939617157,
-0.8531126976013184,
-0.16251248121261597,
0.2644987404346466,
-0.21398328244686127,
-0.09580628573... | |
I have a UIWebView containing html-formatted text. In the text some words are links. When clicked on they should push another view on to the stack. How should I write the html link and corresponding objective-c code to make this work?
Set up delegate for UIWebView, then you can handle link action clicked:
```
-(BOOL) ... | [
0.207978755235672,
0.12354308366775513,
0.96274733543396,
-0.1453799605369568,
-0.17446646094322205,
-0.08380629122257233,
0.5700581669807434,
-0.49005791544914246,
0.13954943418502808,
-1.0722439289093018,
0.060179468244314194,
0.4963475167751312,
-0.1419239193201065,
0.23465782403945923,... | |
I want to use an SDK in android, but I don't want that SDK to have any access to permissions that I haven't explicitly given it. On top of that, if the SDK throws an uncaught exception, I don't want it to bring down my entire application.
In C# there is the concept of an AppDomain where you can treat the code running ... | [
0.14145301282405853,
0.2711476981639862,
0.11722415685653687,
0.0064443121664226055,
0.08359106630086899,
-0.09577813744544983,
0.10508272051811218,
0.01035865768790245,
-0.32464656233787537,
-0.5951728224754333,
-0.18203219771385193,
0.5394354462623596,
-0.45045891404151917,
-0.0026179451... | |
The first one deals with handling exceptions in a piece of untrusted code; a carefully written try/catch block should take care of that, as long as the untrusted piece is pure Java. If native code is allowed, then nothing short of process level isolation would help. For running code in a separate process, read up on An... | [
0.034213896840810776,
-0.12333322316408157,
-0.19439998269081116,
-0.0313497819006443,
-0.00526450015604496,
-0.02244117669761181,
0.261667937040329,
-0.2031581997871399,
-0.3286167085170746,
-0.5887076258659363,
-0.2961684465408325,
0.5180858969688416,
-0.5309709906578064,
-0.225585535168... | |
my knowledge, there's no way to lower the permission set within an app. Even a surrogate process won't help. If you ship a whole *application* (in the Android sense of the word) for wrapping and running custom code, that might help. But the logistics of app installation would get tricky. Google Market does not readily ... | [
0.5282179713249207,
0.1579863280057907,
0.045432575047016144,
0.24714960157871246,
0.14854669570922852,
0.18736828863620758,
0.3479185700416565,
-0.21597909927368164,
-0.16734692454338074,
-0.46510156989097595,
-0.252013236284256,
0.45074695348739624,
-0.27933213114738464,
0.01603262312710... | |
I have two different list types. I need to remove the elements from list1 that is not there in list2 and list2 element satisfies certain criteria.
Here is what I tried, seems to work but each element is listed twice.
```
var filteredTracks =
from mtrack in mTracks
join ftra... | [
-0.05638233199715614,
-0.2922624945640564,
0.29139262437820435,
-0.14927268028259277,
0.04578535258769989,
-0.06347460299730301,
0.3188413679599762,
-0.32942643761634827,
-0.4845716953277588,
-0.5146268606185913,
0.2650410532951355,
0.5336978435516357,
-0.43108251690864563,
-0.222971305251... | |
where mtrack.id == ftrack.Id && ftrack.status == "ONDISK" && ftrack.content_type_id == 234
select mtrack;
```
Ideally I don't want to create a new copy of the filteredTracks, is it possible modify mTracks in place?
If you're getting duplicates, it's because your `id` fields are not unique in one o... | [
0.19796888530254364,
-0.040595028549432755,
0.21441079676151276,
-0.05210137739777565,
0.3470756411552429,
-0.08019118756055832,
0.3400734066963196,
-0.3294176459312439,
-0.4022086560726166,
-0.3842264711856842,
-0.11761496216058731,
0.42703914642333984,
-0.634663462638855,
-0.013062366284... | |
be met for the join to succeed.
I would probably use loops here, but if you are dead set on LINQ, you may need to group `tracksFileStatus` by its `Id` field. It's hard to tell by what you posted.
As far as "modifying `mTracks` in place", this is probably not possible or worthwhile (I'm assuming that `mTracks` is some... | [
0.6237204074859619,
0.014947541989386082,
-0.0021233144216239452,
0.3966400921344757,
0.19857662916183472,
-0.4520643651485443,
0.44198378920555115,
-0.03178219124674797,
-0.19509564340114594,
-0.5563535690307617,
-0.09452977776527405,
0.6351375579833984,
-0.37932655215263367,
-0.330017566... | |
So I'm having a little trouble with the final part of my assignment on recursion. The method needs to use recursion to return a string that is formed from "weaving" together two strings taken in as parameters. For example:
```
weave("aaaa", "bbbb") // should return the string "abababab"
weave("hello", "world") // shou... | [
0.09697400033473969,
0.2976663410663605,
0.18879936635494232,
-0.3392206132411957,
-0.12919528782367706,
0.25491878390312195,
0.6052727699279785,
-0.29814791679382324,
-0.2599777281284332,
-0.49221667647361755,
0.02595120295882225,
0.24701516330242157,
-0.4399210810661316,
0.24230681359767... | |
thus far:
```
public static String weave(String str1, String str2)
{
String word = str1 + str2;
if(str1 == null || str1.equals("") || str2 == null || str2.equals(""))
{
return word;
}
String word1 = weave(str1.substring(0, str1.length() - 1), str2.substring(0, str2.length() - ... | [
-0.07485714554786682,
0.10302647203207016,
0.7379146814346313,
-0.4979269206523895,
-0.23108048737049103,
0.5492549538612366,
0.6898673176765442,
-0.22794052958488464,
-0.2588328421115875,
-0.79481041431427,
-0.1405680626630783,
-0.042015623301267624,
-0.185542494058609,
0.5161756277084351... | |
do! Also, as stated above, the method should do not printing. I just added in the `println` statement as a test to see where my program was at.
I think something like the following might work.
```
public String weave(String str1, String str2)
{
if(str1.isEmpty() || str2.isEmpty()) {
return str1 + str2;
}
ret... | [
0.4694642722606659,
0.06433524191379547,
0.39790499210357666,
-0.43458500504493713,
-0.029634857550263405,
0.04499993845820427,
0.449004590511322,
-0.6252971887588501,
-0.3526955842971802,
-0.37063682079315186,
-0.21691836416721344,
0.20501412451267242,
-0.4124108552932739,
0.0061237416230... | |
of the input strings is empty in such case you should merely return the non-empty string.
```
weave("abcdef", "12"): "a" + "1" + weave("bcdef", "2")
|
+- weave("bcdef", "2"): "b" + "2" + weave("cdef", "")
|
+- weave("cdef", ""): "cdef"
```
Resulting in:
```
weave("abcdef", "12"): "a" + "1" + "b" +... | [
0.1643621027469635,
0.1808391958475113,
0.5016713738441467,
-0.23763716220855713,
-0.46382707357406616,
0.326297789812088,
0.40447869896888733,
-0.5908965468406677,
-0.4434627592563629,
-0.321168452501297,
-0.6177313923835754,
0.34189748764038086,
-0.6223906874656677,
0.023081889376044273,... | |
I have interface Foo
```
public interface Foo {
public void test();
}
```
Class FooChild implements interface Foo.
```
public class FooChild implements Foo {
@Override
public void test() {...}
public void test2() {...}
}
```
I have to call function test2 in somewhere in the code.
```
Foo f = ne... | [
0.25708067417144775,
0.24915744364261627,
0.323262482881546,
-0.16050994396209717,
-0.37000513076782227,
0.1327223777770996,
0.44681572914123535,
-0.5582178235054016,
0.4540979266166687,
-1.0243399143218994,
0.2257915735244751,
0.539630651473999,
-0.548905074596405,
0.15285082161426544,
... | |
public void test2() {...}
}
```
Now I call test2() with casting to an interface, not a class.
```
Foo f = new FooChild();
((Bar) f).test2();
```
I may add function test2 to the interface Foo,
but there are too many classes that implement Foo.
If I add the function, I have to add codes to all the classes that impl... | [
0.47645410895347595,
0.14191888272762299,
-0.0061033680103719234,
-0.22488239407539368,
-0.1948556900024414,
-0.12867867946624756,
0.5515061616897583,
-0.2754031717777252,
0.20429179072380066,
-0.6934444308280945,
0.07403772324323654,
0.7415766716003418,
-0.546786904335022,
0.0462990850210... | |
you know that the variable value really *has* to be of type `FooChild`, just declare it that way:
```
FooChild f = new FooChild();
f.test2();
```
If there's some reason why that won't work for you, it's something you haven't told us...
EDIT: Okay, so apparently it's really a method parameter:
```
public void doSom... | [
0.5803771615028381,
0.1086881160736084,
0.08244875818490982,
-0.13502109050750732,
0.11526638269424438,
-0.3560240566730499,
0.4772106409072876,
-0.21792759001255035,
0.011107309721410275,
-0.30170050263404846,
-0.08330071717500687,
0.6873518228530884,
-0.29167911410331726,
0.3289147913455... | |
any implementation of `Foo`." Casts are *the* way of expressing that, if you can't change the parameter. | [
0.6243740916252136,
0.42703956365585327,
-0.05655188113451004,
-0.05246242880821228,
-0.0769544392824173,
-0.2064092457294464,
0.4412265717983246,
0.13988423347473145,
0.009600984863936901,
-0.46245911717414856,
-0.17390446364879608,
0.4777175188064575,
-0.5645103454589844,
-0.179054856300... | |
I just got started on a renderer for my cross platform framework (iOS and Android) using opengl es. When I got to the viewport stuff (which is needed for splitscreen stuff) and noticed there is a difference between iOS and Android. Here are two images.
**Android**
There is actually another glitch. IT seems to wrap.
!... | [
0.10495877265930176,
-0.1044980064034462,
0.6429473161697388,
-0.03792973607778549,
-0.370188444852829,
0.34405285120010376,
0.3001660406589508,
-0.2567894160747528,
-0.06732895225286484,
-0.9953420758247375,
0.2147197276353836,
0.7370161414146423,
-0.12901684641838074,
0.06983035802841187... | |
1.0f); //Black Background
glClearDepthf(1.0f); //Depth Buffer Setup
glEnable(GL_DEPTH_TEST); //Enables Depth Testing
glDepthFunc(GL_LEQUAL); //The Type Of Depth Testing To Do
//Really Nice Perspective Calculations
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
```
Viewp... | [
0.17346583306789398,
-0.28007248044013977,
0.9522771835327148,
-0.15850459039211273,
0.04492732509970665,
0.18230482935905457,
0.1044931560754776,
-0.47692617774009705,
0.09417653828859329,
-0.6527906656265259,
0.1490900069475174,
0.8502377271652222,
-0.0045665050856769085,
-0.040406461805... | |
100.f);
glScalef(widthH, heightH, 1.f);
```
Maybe Android or iOS has something set by default? I am clueless.
Answering my own question for those who have the same issue.
I use GLKView which apparently calls the glViewport on each render call, resetting what I just did in the previous frame. So if you use GLKView m... | [
0.34443777799606323,
-0.0030349106527864933,
1.0197595357894897,
-0.10928574949502945,
-0.18316514790058136,
-0.014051913283765316,
0.08283605426549911,
0.07193668186664581,
-0.095149464905262,
-0.6852035522460938,
-0.07377834618091583,
0.9550262689590454,
-0.26711657643318176,
-0.22058807... | |
I would like to be able to call save() on a backbone model and have the backend return the entire collection of this model instead of only the changed attributes of the model. I would then like backbone to update the entire returned collection. The use case for this is the following:
A user has multiple addresses and ... | [
0.37078291177749634,
-0.19040188193321228,
0.011305714957416058,
0.16192719340324402,
0.06269390881061554,
0.06354495882987976,
-0.05505993962287903,
0.002659054473042488,
-0.4684107005596161,
-0.8098062872886658,
-0.04565221443772316,
0.31062647700309753,
-0.005686245393007994,
0.38703787... | |
of only the changed model.
Is this somehow possible in backbone.js?
Thanks a lot in advance!
models that are bound to collections, contain their collection parent as a property. Also, since your returning a list of models, we can assume that it is always in a list.
```
mymodel = Backbone.Model.extend({
parse: fun... | [
0.2278916984796524,
-0.43818458914756775,
0.5733932256698608,
0.10197792947292328,
0.15777850151062012,
-0.061523206532001495,
0.13127325475215912,
-0.18499547243118286,
-0.6989628672599792,
-0.7374048829078674,
-0.21837425231933594,
0.5887942910194397,
-0.2736230790615082,
0.3397173285484... | |
I want to make a tiny script that deleted ALL the files in my Symfony project that **mercuaril** gives me as unwanted files.
For example:
```
hg status:
...
? web/images/lightwindow/._arrow-up.gif
? web/images/lightwindow/._black-70.png
? web/images/lightwindow/._black.png
? web/images/lightwindow/._nextlabel.gif
?... | [
0.20853428542613983,
-0.09916809946298599,
0.32436510920524597,
0.1559455692768097,
0.03805948421359062,
-0.035538364201784134,
-0.08672607690095901,
-0.09561396390199661,
-0.3159118592739105,
-0.573405921459198,
0.13994340598583221,
0.15812915563583374,
-0.2657056450843811,
0.325058102607... | |
a list of models, we can assume that it is always in a list.
```
mymodel = Backbone.Model.extend({
parse: function (data) {
if(this.collection && typeof(data) === 'array') {
this.collection.reset(data);
}
return data;
}
});
``` | [
0.23351551592350006,
-0.15717075765132904,
0.5932821035385132,
0.01470882911235094,
0.20591434836387634,
-0.00948729831725359,
0.0711798369884491,
-0.29479435086250305,
-0.6051745414733887,
-0.6229619979858398,
-0.26655271649360657,
0.6818719506263733,
-0.35542505979537964,
0.2251828312873... | |
I am trying to make a simple application that turns a character to look at a vector relative to it's current position.
The rotation value ranges from 0 - 180 and -180 - 0.
Math is not my strong point and I'd appreciate it if C# code examples could be explained, I need a value to set into the rotation variable in the ... | [
0.23782794177532196,
-0.225258007645607,
0.44377222657203674,
-0.319372296333313,
-0.2504107356071472,
0.605632483959198,
-0.2947717010974884,
-0.200923353433609,
0.1352301836013794,
-0.5658484697341919,
0.2753821015357971,
0.8029904365539551,
-0.4110693633556366,
-0.09850163012742996,
0... | |
double angle=Math.Atan2(dy, dx)*180/Math.PI;
``` | [
0.17773520946502686,
0.09551289677619934,
0.3262399137020111,
-0.30230414867401123,
-0.10074689984321594,
0.1932283639907837,
0.20258426666259766,
-0.388117253780365,
0.02995346300303936,
-0.40306657552719116,
-0.076532281935215,
0.6063157916069031,
-0.3665677607059479,
0.04702569544315338... | |
Again I'm moving from Xcode 3 to 4 and finding that some things are different. I'm writing a splitview iPad app and working from all the code that was generated for me. In the master view I want to customize the `UITableViewCell` to use the `UITableViewCellStyleSubtitle` style. In the past that was simple and I knew it... | [
0.4376339912414551,
0.050444282591342926,
0.6441460251808167,
-0.23099954426288605,
-0.32047590613365173,
-0.1042214035987854,
0.24216854572296143,
-0.23579049110412598,
-0.12383953481912613,
-0.7694778442382812,
0.037932612001895905,
0.5703885555267334,
-0.4009132981300354,
0.128796070814... | |
property there either.
In short, I can't find where the UITableViewCells are alloc/init'ed so that I can make my change. Where is this done in Xcode 4?
If you're using the storyboard-based template, the cell is created by the storyboard, so you need to configure it in the storyboard in IB. If you haven't found that, ... | [
0.2661464810371399,
0.026637276634573936,
0.511506974697113,
0.182357057929039,
0.1744934469461441,
-0.1622346043586731,
-0.022294944152235985,
-0.34720051288604736,
-0.19359168410301208,
-0.8002411723136902,
-0.09345494955778122,
0.45641589164733887,
-0.11407356709241867,
0.12929114699363... | |
and `detailTextLabel` and set accessory styles like you would have before in `tableView:cellForRowAtIndexPath:`.) | [
0.0310247503221035,
-0.3206542134284973,
0.49221131205558777,
0.31230616569519043,
0.25984054803848267,
-0.1616635024547577,
0.035056550055742264,
-0.018242454156279564,
-0.02113860659301281,
-0.7847010493278503,
-0.3065125346183777,
0.5093089938163757,
-0.20861846208572388,
-0.12815739214... | |
Here is the situation:
* You have one long-running calculation running in a background thread.
* This calculation is sending out a signal to, for example, refresh a GUI element, every 100 msec.
* Let's say it sends out 100 such signals.
* The widget being redrawn takes more than 100 msec to redraw; let's say 1 second... | [
0.10963623225688934,
-0.4821687638759613,
0.31599172949790955,
0.012513551861047745,
-0.06690533459186554,
-0.05245386064052582,
0.24684135615825653,
-0.004499718081206083,
-0.6712196469306946,
-0.4785502254962921,
-0.11080680042505264,
0.25226035714149475,
-0.0977582037448883,
-0.00403272... | |
will grow until you run out of memory and your program will crash. It's worth noting, though, that QTimer will skip timeout events if the system is under heavy load. To some extent, that may help regulate your throughput.
You could also consider sending feedback from one thread to the other (an acknowledgement, perhap... | [
0.36953869462013245,
-0.3336049020290375,
0.12580899894237518,
0.26990512013435364,
-0.007696114480495453,
0.05064748600125313,
0.15753135085105896,
0.1938513219356537,
-0.23257529735565186,
-0.4105087220668793,
0.1635894924402237,
0.3859471082687378,
-0.0550413653254509,
0.413657337427139... | |
I am trying to create an app that calculates the time difference and the amount is multiplied by an amount in money. It is targeted to calculate in R$ (brazilian real) the amount that someone will have to pay for using a service during the time calculated by the app.
Here´s is my code:
```
- (IBAction)encerrar:(id)se... | [
0.43041589856147766,
0.005903772544115782,
0.8360717296600342,
0.12242615967988968,
0.3003000319004059,
0.38319411873817444,
-0.030885271728038788,
-0.45711225271224976,
-0.13218818604946136,
-0.4137035012245178,
0.4052656590938568,
0.5221959948539734,
0.0684795156121254,
0.060176167637109... | |
timeIntervalSinceDate:then];
NSString *ext = [dateFormatter stringFromDate:now];
fim.text = ext;
NSDate *timerDate = [NSDate dateWithTimeIntervalSince1970:timeInterval];
[dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0.0]];
NSString *timeString = [dateFormatter stringFromDate:timer... | [
-0.04891572520136833,
-0.5311694145202637,
0.9964261651039124,
-0.31463250517845154,
0.2304447442293167,
0.1012357696890831,
0.5632755160331726,
-0.43197548389434814,
-0.4242943227291107,
-0.7033828496932983,
-0.235571026802063,
0.6148337125778198,
0.09536469727754593,
0.16586752235889435,... | |
to 1h it gives me the correct amount which is R$ 5,00. But when the duration is equal to 30mins or other value different from exact 1h, it gives the wrong amount.
I.E.: 1h should be R$ 5,00; while 1:30h should be R$ 7,50, but shows me R$ 6,50.
So, anyone could help me on this???
Thanks in advance!!!
`timeInterval` i... | [
0.32597190141677856,
0.124602772295475,
0.4738140404224396,
-0.05627942457795143,
0.0006196841131895781,
0.20464037358760834,
0.16931000351905823,
-0.42066216468811035,
0.021593140438199043,
-0.6388676762580872,
0.019138244912028313,
0.9212163686752319,
0.1593446135520935,
-0.1518872678279... | |
create a button with "iniciar" (start) as the title. When they press that button, I would store the current time and change the title to "encerrar" (stop). (I hope that my translations are correct, lol) Then the button action would look something like this:
```
// self.startTime is a NSDate.
- (IBAction)iniciar_encerr... | [
-0.04484572634100914,
-0.08709004521369934,
0.9076777100563049,
-0.13618658483028412,
0.04205812141299248,
-0.10592048615217209,
-0.11508728563785553,
0.02986687608063221,
0.0406237468123436,
-0.6053584218025208,
-0.25603508949279785,
0.5730888247489929,
0.2222604751586914,
0.2608994245529... | |
}
self.startTime = [NSDate date];
[sender setTitle:@"encerrar" forState:UIControlStateNormal];
} else {
// We are stopping the time
NSDate *currentTime = [NSDate date];
NSTimeInterval elapsedTimeInSeconds = [currentTime timeIntervalSinceDate:self.startTime];
double c... | [
0.0689307227730751,
-0.09902927279472351,
0.8362199068069458,
-0.13517434895038605,
0.38418641686439514,
0.20188473165035248,
0.6024529933929443,
-0.4080445170402527,
-0.20809254050254822,
-0.671177089214325,
-0.030323263257741928,
0.7713066935539246,
-0.0009196583996526897,
0.153945416212... | |
the button
self.startTime = nil;
[sender setTitle:@"iniciar" forState:UIControlStateNormal];
}
}
```
**startTime is declared as follows:**
In your .h file, along with the other declared properties, add:
```
@property (strong, nonatomic) NSDate *startTime;
```
In your .m file, add this at the ... | [
-0.18878291547298431,
-0.3069654703140259,
0.7071235775947571,
-0.30504992604255676,
0.20128805935382843,
-0.11730972677469254,
0.13285039365291595,
-0.12935222685337067,
-0.10929163545370102,
-0.933635413646698,
-0.1686239093542099,
0.8181496262550354,
-0.1862994283437729,
0.1258628070354... | |
I'm working with NHibernate. My A class have a bag of B objects. so when i try:
```
var A = new A();
var B = new B();
A.Bs.Add(B); // Here NHibernate insert in database
```
The Nhibernate automatically insert in relationship table on database. But i want to NHibernate insert when i save or update the A object:
``... | [
0.0740031823515892,
0.3625234365463257,
0.1461431235074997,
-0.3583793640136719,
-0.3854573667049408,
0.033381808549165726,
0.19876311719417572,
-0.28555941581726074,
-0.09553971886634827,
-0.5429577231407166,
0.20950640738010406,
0.5173162221908569,
-0.5833239555358887,
0.2814027667045593... | |
can accomplish this by replacing the `-` with `,` and using [`FIND_IN_SET()`](http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_find-in-set). This is necessary because `FIND_IN_SET()` expects a comma-separated list of values. This can only be reasonably managed with a handful of languages though, si... | [
-0.174167662858963,
0.0013444627402350307,
0.31312936544418335,
-0.0446779690682888,
0.004810428246855736,
-0.09292960166931152,
0.2758440673351288,
-0.2909943163394928,
-0.08901870995759964,
-0.5948907136917114,
-0.6439891457557678,
0.6453790664672852,
-0.37954652309417725,
-0.48369222879... | |
I have two separate sets of tables in the same database that model the exact same data but in different states. One is a live state, and the other is a staging state (not test). I am trying to create a model that will allow me to choose which datasource/datacontext to use at runtime, but they must both have the same mo... | [
0.3835737407207489,
-0.045419685542583466,
-0.2401389479637146,
0.28073447942733765,
0.2702668011188507,
0.12172307819128036,
0.3305451571941376,
-0.2584882974624634,
0.3055402338504791,
-0.6890267133712769,
-0.07106457650661469,
0.5339633226394653,
-0.38390737771987915,
0.2163309007883072... | |
where test.TestNumber == testNum
select test).FirstOrDefault();
return t;
}
```
Obviously, based on the code above, if the Environment is Staging, I pull from a set of tables. If the Environment is Live, then I pull from a different set of tables.
So, normally with EF, I will get two sep... | [
0.543900191783905,
-0.31048616766929626,
-0.14861594140529633,
-0.2933028042316437,
0.3260608911514282,
0.12393990159034729,
0.2692476809024811,
-0.4054989218711853,
0.10051227360963821,
-0.7558569312095642,
0.10541068762540817,
0.5454488396644592,
-0.4187638759613037,
0.15440739691257477,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.