qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
235,943
In space, normal weapons are so easy to dodge because by the time you see an enemy ship and fire at it, it's already moved out of the way. Now imagine a weapon that travels backwards in time as it flies though space so that when it arrives at its target, it converges with the exact time and location that you saw the ta...
2022/09/22
[ "https://worldbuilding.stackexchange.com/questions/235943", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/57832/" ]
**What paradox?** All ships are 100% automatic (it doesn't matter if it they are or not, it's just easier for the explanation). The moment my ship detects the enemy ship, it fires the weapon. The very moment the circuits activate the weapon, my enemy is hit. Ditto for my enemy, which did the same to me. Where's the ...
I think the paradox can be resolved by adding a necessary delay: mass prevents time travel. The mass of the firing ship means the weapon needs to travel a bit before it can start traveling backwards, and the mass of the target ship likewise causes the weapon to reenter normal time a short distance away. Just tune the e...
235,943
In space, normal weapons are so easy to dodge because by the time you see an enemy ship and fire at it, it's already moved out of the way. Now imagine a weapon that travels backwards in time as it flies though space so that when it arrives at its target, it converges with the exact time and location that you saw the ta...
2022/09/22
[ "https://worldbuilding.stackexchange.com/questions/235943", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/57832/" ]
Suppose that [Novikov's self-consistency principle](https://en.wikipedia.org/wiki/Novikov_self-consistency_principle) applies. In this scenario, there are two outcomes that are each self-consistent: ship A destroys ship B before ship B fires, or ship B destroys ship A before ship A fires. Which of these outcomes actual...
The flight time of the weapon is instantaneous, in effect. It's just as if the two ships were literally touching nose-to-nose. It is asked about what happens if "the ships fired at the same time." Same thing happens as would happen were they nose to nose, I suppose. Either "the same time" really means plus or minus a...
235,943
In space, normal weapons are so easy to dodge because by the time you see an enemy ship and fire at it, it's already moved out of the way. Now imagine a weapon that travels backwards in time as it flies though space so that when it arrives at its target, it converges with the exact time and location that you saw the ta...
2022/09/22
[ "https://worldbuilding.stackexchange.com/questions/235943", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/57832/" ]
**there is no Paradox** As written in the question > > Then your shot travels back in time 5 minutes as it closes the distance > > > the shot doesn't begin its trajectory 5 min back and then travels to the enemy. Instead it travels back in time by moving toward the enemy. So i agree with ivo's comment and mostl...
Whoever hits first gets to control the timeline. ================================================ If ship A hits ship B first, then ship B can't fire at ship A. Therefore, their temporal projectile vanishes, and they do no harm. Example. 1. Ship A's projectile goes back in time and Ship A and B fly unaware. 2. Ship ...
235,943
In space, normal weapons are so easy to dodge because by the time you see an enemy ship and fire at it, it's already moved out of the way. Now imagine a weapon that travels backwards in time as it flies though space so that when it arrives at its target, it converges with the exact time and location that you saw the ta...
2022/09/22
[ "https://worldbuilding.stackexchange.com/questions/235943", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/57832/" ]
**there is no Paradox** As written in the question > > Then your shot travels back in time 5 minutes as it closes the distance > > > the shot doesn't begin its trajectory 5 min back and then travels to the enemy. Instead it travels back in time by moving toward the enemy. So i agree with ivo's comment and mostl...
Seems to ME that it's really contingent on the mechanic by which you decide time "actually" functions. Even Einstein and Hawking kinda "settled" into the whole infinite parallel universe thing for lack of better means to reconcile these sort of incongruities. Fact is, for you to have cause and effect, action/reaction,...
235,943
In space, normal weapons are so easy to dodge because by the time you see an enemy ship and fire at it, it's already moved out of the way. Now imagine a weapon that travels backwards in time as it flies though space so that when it arrives at its target, it converges with the exact time and location that you saw the ta...
2022/09/22
[ "https://worldbuilding.stackexchange.com/questions/235943", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/57832/" ]
Frame challenge --------------- A time-travel paradox is by definition an inconsistency that cannot be resolved. This is why people think it's so important to avoid them: because it is logically impossible to resolve a paradox if one arises. Thus, there is no "logically consistent" way for this to happen. You are goi...
The flight time of the weapon is instantaneous, in effect. It's just as if the two ships were literally touching nose-to-nose. It is asked about what happens if "the ships fired at the same time." Same thing happens as would happen were they nose to nose, I suppose. Either "the same time" really means plus or minus a...
235,943
In space, normal weapons are so easy to dodge because by the time you see an enemy ship and fire at it, it's already moved out of the way. Now imagine a weapon that travels backwards in time as it flies though space so that when it arrives at its target, it converges with the exact time and location that you saw the ta...
2022/09/22
[ "https://worldbuilding.stackexchange.com/questions/235943", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/57832/" ]
Frame challenge --------------- A time-travel paradox is by definition an inconsistency that cannot be resolved. This is why people think it's so important to avoid them: because it is logically impossible to resolve a paradox if one arises. Thus, there is no "logically consistent" way for this to happen. You are goi...
I think the paradox can be resolved by adding a necessary delay: mass prevents time travel. The mass of the firing ship means the weapon needs to travel a bit before it can start traveling backwards, and the mass of the target ship likewise causes the weapon to reenter normal time a short distance away. Just tune the e...
235,943
In space, normal weapons are so easy to dodge because by the time you see an enemy ship and fire at it, it's already moved out of the way. Now imagine a weapon that travels backwards in time as it flies though space so that when it arrives at its target, it converges with the exact time and location that you saw the ta...
2022/09/22
[ "https://worldbuilding.stackexchange.com/questions/235943", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/57832/" ]
Whoever hits first gets to control the timeline. ================================================ If ship A hits ship B first, then ship B can't fire at ship A. Therefore, their temporal projectile vanishes, and they do no harm. Example. 1. Ship A's projectile goes back in time and Ship A and B fly unaware. 2. Ship ...
Seems to ME that it's really contingent on the mechanic by which you decide time "actually" functions. Even Einstein and Hawking kinda "settled" into the whole infinite parallel universe thing for lack of better means to reconcile these sort of incongruities. Fact is, for you to have cause and effect, action/reaction,...
31,887,289
I have a database with 150,000 records and I need to match its FULL column value or records, with some parts of the string. \*\* > > As i want to check if the **STRING** contains the **COLUMN** records and NOT! > if the COLUMN contains the string > > > \*\* *(Example below)* For testing purposes Lets say the ...
2015/08/07
[ "https://Stackoverflow.com/questions/31887289", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1276429/" ]
``` SELECT * from TABLE where LOCATE(COLUMN, @STRING)>0; ``` LOCATE(a,b) returns a number giving the character location of a in b, or returns 0. See [Mysql LOCATE()](https://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_locate) The docs discuss that LOCATE() is only case sensitive when one of the s...
The dynamic like syntax for mysql is ``` SELECT * from TABLE where @STRING like CONCAT('%',COLUMN,'%') ```
5,492,987
I have a deep recursive process that outputs a list when it finds a solution to the problem, but this list is created very deep recursively. This is the code: ``` (define (dfs start target) (define (dfs-helper start target path new-links final-path) (display final-path) (newline) (if (null? final-path) ...
2011/03/30
[ "https://Stackoverflow.com/questions/5492987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/668750/" ]
Oog... this code can be a bunch simpler. Let me make some suggestions. First, defining the helper inside of the parent function is not helping you; it makes it impossible to test independently; move it outside. Next, it's not clear to me why you have two arguments, "path" and "final-path"; a one-line purpose stateme...
rather than displaying `final-path` with a newline as a print-out where you can't get to it, create a list as a member of your `dfs` object. Then append onto that list member, and process that list on the return of `dfs`. For instance: ``` (define (dfs start target) (define return-list '()) ;;add a return list here ...
50,241,866
I am trying to load test a HTTP URL(Dynamic) using Locust.io. I already have the python scripts that will make a GET call to the URL. The challenge i am facing is, the urls and the number of users are dynamic and are read from a CSV file. For example, Here is how the input of the load testing will look like: Input.cs...
2018/05/08
[ "https://Stackoverflow.com/questions/50241866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6447078/" ]
Apparently, there is already someone who has done it. The library is on GitHub: <https://github.com/mhr3/gcp-container-builder-node> and available via npm: <https://www.npmjs.com/package/gcp-container-builder> The usage was not clear to me at first, but this is how I am using it now: ``` var build = Object.create(nul...
The procedure you propose require three different steps: Google Cloud Storage → Cloud Functions → API call. According to the requirements you exposed, could be better to use [Container Builder’s Build Triggers](https://cloud.google.com/container-builder/docs/running-builds/automate-builds). You upload the files to...
50,853,528
I'm using Guzzle for HTTP Requests/Responses in my PHP project. I'm sending the following request : ``` GET https://graph.microsoft.com/v1.0/me/events('[some_id]') ``` which, in Postman, returns something that looks like this : ``` { "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('...')/ev...
2018/06/14
[ "https://Stackoverflow.com/questions/50853528", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7600807/" ]
You have to extract the body of from the response. Try this, ``` $client = new Client(); $header = array( "Authorization" => "Bearer ".$token ); $url = "https://graph.microsoft.com/v1.0/me/events('" .$idEvent. "')"; $request = new Request("GET", $url, $header, ""); try { $eventInfos = $client-...
Also, you can use `getContents()` to get the response. ``` $request->getBody()->getContents() ```
29,030,762
I am looking to do a comparison of a string to and enumeration. I have written a sample code of what I am attempting. Since a String and and Enumerated type are different, how do I go about doing this properly in Ada? ``` WITH Ada.Text_IO; USE Ada.Text_IO; PROCEDURE ColorTest IS TYPE StopLightColor IS (red, yello...
2015/03/13
[ "https://Stackoverflow.com/questions/29030762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2297683/" ]
First instantiate [`Enumeration_IO`](http://www.ada-auth.org/standards/12rm/html/RM-A-10-10.html) for `StopLightColor`: ``` package Color_IO is new Ada.Text_IO.Enumeration_IO(StopLightColor); ``` Then you can do either of the following: * Use `Color_IO.Get` to read the value, catching any `Data_Error` that arises, ...
Another possibility: ``` Get_Line (response, N); declare Color : StopLightColor; begin Color := StopLightColor'Value(response(1..N)); -- if you get here, the string is a valid color Put_Line ("The stoplight is " & response(1..N)); exception when Constraint_Error => -- if you get here, the s...
29,030,762
I am looking to do a comparison of a string to and enumeration. I have written a sample code of what I am attempting. Since a String and and Enumerated type are different, how do I go about doing this properly in Ada? ``` WITH Ada.Text_IO; USE Ada.Text_IO; PROCEDURE ColorTest IS TYPE StopLightColor IS (red, yello...
2015/03/13
[ "https://Stackoverflow.com/questions/29030762", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2297683/" ]
First instantiate [`Enumeration_IO`](http://www.ada-auth.org/standards/12rm/html/RM-A-10-10.html) for `StopLightColor`: ``` package Color_IO is new Ada.Text_IO.Enumeration_IO(StopLightColor); ``` Then you can do either of the following: * Use `Color_IO.Get` to read the value, catching any `Data_Error` that arises, ...
Answering your actual question: Ada doesn't allow you to compare values of different types directly, but luckily there is a way to convert an enumerated type to a string, which always works. For any enumerated type `T` there exists a function: ``` function T'Image (Item : in T) return String; ``` which returns a s...
56,323,044
I got the filter in Vue. Template: ``` <b-button v-if="filterFilled()" @click="clearFilter"> Clear </b-button> ``` Data: ``` data () { return { filter: { price_from: '', price_to: '', surface_from: '', surface_to: '', floor: '', type: '...
2019/05/27
[ "https://Stackoverflow.com/questions/56323044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10867656/" ]
I've tracked the problem down to something in swatch-renderer.js. The V2.3 version has the following line at 517: ``` value = optionConfig[id].hasOwnProperty('value') ? optionConfig[id].value : ''; ``` The version V2.3.1 has changed this to the following: ``` value = optionConfig[id].hasOwnProperty('value') ? $('<i...
1. Stores > Attributes > Product > Edit and save the text swatch values 2. php bin/magento indexer:reindex
56,323,044
I got the filter in Vue. Template: ``` <b-button v-if="filterFilled()" @click="clearFilter"> Clear </b-button> ``` Data: ``` data () { return { filter: { price_from: '', price_to: '', surface_from: '', surface_to: '', floor: '', type: '...
2019/05/27
[ "https://Stackoverflow.com/questions/56323044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10867656/" ]
I've tracked the problem down to something in swatch-renderer.js. The V2.3 version has the following line at 517: ``` value = optionConfig[id].hasOwnProperty('value') ? optionConfig[id].value : ''; ``` The version V2.3.1 has changed this to the following: ``` value = optionConfig[id].hasOwnProperty('value') ? $('<i...
Please update Product Attribute "Admin" Columns From Backend. Then perform Reindexing. [![Product Attribute - Edit ](https://i.stack.imgur.com/qPrGk.png)](https://i.stack.imgur.com/qPrGk.png)
56,323,044
I got the filter in Vue. Template: ``` <b-button v-if="filterFilled()" @click="clearFilter"> Clear </b-button> ``` Data: ``` data () { return { filter: { price_from: '', price_to: '', surface_from: '', surface_to: '', floor: '', type: '...
2019/05/27
[ "https://Stackoverflow.com/questions/56323044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10867656/" ]
Please update Product Attribute "Admin" Columns From Backend. Then perform Reindexing. [![Product Attribute - Edit ](https://i.stack.imgur.com/qPrGk.png)](https://i.stack.imgur.com/qPrGk.png)
1. Stores > Attributes > Product > Edit and save the text swatch values 2. php bin/magento indexer:reindex
17,866,723
Suppose I have a file (newlines marked as ^n): ``` aaaa^n bbbb^n cccc^n ``` Is there a simple command to backfill whitespace to the rightmost portion of the block (probably using a visual selection); I often see questions about removing leading whitespace, but in this case I want leading whit...
2013/07/25
[ "https://Stackoverflow.com/questions/17866723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/992834/" ]
Probaly the easiest way would be to do ``` set virtualedit=all ``` Go to the top left of the block you want to select. Use a Blockwise visual selection (`<C-V>`) and select the the lines you want. Then hit `$` to extend the visual block to the end of the line. Then yank the selection with `y` Then type `gvp` to p...
You can do it in a single `:substitute`, although it does get a little involved: ``` :'<,'>s/$/\=repeat(' ', max(map(getline(line("'<"),line("'>")),'strdisplaywidth(v:val)'))-strdisplaywidth(getline('.')))/ ``` This command applies to the Visual selection. If you need more control over the range, consider wrapping t...
57,260,045
So I have 2 dataframes, from different sizes, `df1 = (578, 81)` and `df2 = (1500, 59)`, all lines on `df1 exists in df2`, and all columns in `df2 exists in df1`, my problem is, I have a value that i want to update in df1 based on `6 conditions`, so to update the `column X`, the values at columns `X1, X2, Y1, Y2, Z1 and...
2019/07/29
[ "https://Stackoverflow.com/questions/57260045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2366113/" ]
You can easily use `numpy.where`. And i think it should work best in this case too. Let's say you have the following DataFrames ``` import pandas as pd df1=pd.DataFrame({'X':[1,3,4,6,5], 'X1':[2,3,4,6,3], 'Y1':[4,2,1,51,3], 'Z1':[2,3,4,1,5]}) df2=pd.DataFrame({'...
Do the 6 columns make a row unique? If so, I would use merge: ``` columns_join= ['col1', 'col2', 'col3', 'col4', 'col5', 'col6'] columns_update= ['upd1', 'upd2', 'upd3'] df_merged= df_to_update[columns_join].merge(df_source[columns_join + columns_update], on=columns_join, how='left', suffixes=['', '_src'], indicator...
7,733,581
What is the fastest way to lookup the index of a value in sorted vector in MATLAB? That is, is there a fast `find(vector == myNumber, 1, 'first')` for when vector is sorted? I have a large matrix (200,000 x 4) of locations each with a unique integer ID recorded in the first column. I want to find the right the locatio...
2011/10/11
[ "https://Stackoverflow.com/questions/7733581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4670/" ]
If you use ismembc2, the loc output should give you what you need. See this for more details: <http://www.mathworks.com/support/solutions/en/data/1-9NIE1N/index.html?product=ML&solution=1-9NIE1N>
I do not know if it is faster but you may want to try ``` result=vector(vector(:,1)==myNumber,:) ``` `result` will contain the 4 elements row for which vector `first column == myNumber`
7,733,581
What is the fastest way to lookup the index of a value in sorted vector in MATLAB? That is, is there a fast `find(vector == myNumber, 1, 'first')` for when vector is sorted? I have a large matrix (200,000 x 4) of locations each with a unique integer ID recorded in the first column. I want to find the right the locatio...
2011/10/11
[ "https://Stackoverflow.com/questions/7733581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4670/" ]
If you use ismembc2, the loc output should give you what you need. See this for more details: <http://www.mathworks.com/support/solutions/en/data/1-9NIE1N/index.html?product=ML&solution=1-9NIE1N>
There are a number of submissions for this on FEX: <http://www.mathworks.com/matlabcentral/fileexchange/?term=binary+search+vector>
7,733,581
What is the fastest way to lookup the index of a value in sorted vector in MATLAB? That is, is there a fast `find(vector == myNumber, 1, 'first')` for when vector is sorted? I have a large matrix (200,000 x 4) of locations each with a unique integer ID recorded in the first column. I want to find the right the locatio...
2011/10/11
[ "https://Stackoverflow.com/questions/7733581", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4670/" ]
There are a number of submissions for this on FEX: <http://www.mathworks.com/matlabcentral/fileexchange/?term=binary+search+vector>
I do not know if it is faster but you may want to try ``` result=vector(vector(:,1)==myNumber,:) ``` `result` will contain the 4 elements row for which vector `first column == myNumber`
23,875,849
I need to create a reorderable ListView in a Windows Phone 8.1 app created using WinRT. The XAML is the following (it binds to an ObservableDictionary in the codebehind): ``` <Grid Margin="24"> <ListView x:Name="MainListView" CanDragItems="True" CanReorderItems="True" AllowDrop="True" VerticalAlignment="Stretc...
2014/05/26
[ "https://Stackoverflow.com/questions/23875849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/404764/" ]
For WP you need to set [ListViewBase.ReorderMode](http://msdn.microsoft.com/elibrary/windows/apps/windows.ui.xaml.controls.listviewbase.reordermode.aspx) This is what works for me - no idea which properties are really necessary; ReorderMode is set in code behind: ``` <ListView x:Name="fooListView" ItemsSou...
It appears that the property `CanReorderItems` is not supported on Windows Phone 8.1. (I tried a simple example, and it does not work, and I could not find any combination that made it work as it does on Windows 8.1.)
112,819
I'm somewhat new to meta, but I figured I would report this. When I voted down, it went down by 2 (from 3 to 1). Then it reverted itself back because it didn't allow the downvote because of a cap or something.
2011/11/18
[ "https://meta.stackexchange.com/questions/112819", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/171024/" ]
Had you previously voted the same post up? It's not uncommon for people to: 1. vote up 2. later realize the answer is wrong 3. try to cancel the upvote by pressing the downvote button 4. see the vote count flicker while the vote is being processed 5. find that the vote is "locked in" because the original vote was cast...
When you vote, an updated score is returned by the ajax post. It's possible someone voted in between the time you loaded the page and the time you voted, and I think JavaScript will revert the number back to what it was rather than using the updated score. Not positive on that last part though.
66,242
In [Bereshit 13:1](http://www.chabad.org/library/bible_cdo/aid/8208#showrashi=true), Negev is meant to mean the *south of the Land of Israel* (according to Rashi), because Abraham was going from Egypt to Israel and otherwise wouldn't make sense. > > וַיַּעַל אַבְרָם מִמִּצְרַיִם הוּא וְאִשְׁתּוֹ וְכָל אֲשֶׁר לוֹ וְלו...
2015/12/13
[ "https://judaism.stackexchange.com/questions/66242", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/11052/" ]
It does not change meanings. A word is used in context. In English for example, we speak of "the South" to mean the southern portion of the eastern United States even though someone may be in Mexico when using the term. Similarly here we speak of the "South" relative to Yerushalayim when speaking about different parts ...
Negev actually means "the dry area" (NGV root means "dry")which is in the southern part of Eretz Yisrael. "Negbah" means "to the dry area," not a cardinal direction. "Minegev" in the later verse means "from the dry area." (In any event, it is not switching meanings. In the first instance the "heh" at the end of the no...
32,984,482
I have 3 SQL tables as below: Table 1 ``` ItemId Name ---------- A aa B bb ``` Table 2 ``` ItemId Category ---------- A 1 A 2 A 3 B 1 ``` Table 3 ``` ItemId Dep ---------- A D1 B D2 B D3 ``` I need result as this ``` ItemId Name Category Dep --------------...
2015/10/07
[ "https://Stackoverflow.com/questions/32984482", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745066/" ]
You can first `JOIN` the tables on `ItemId` and then use `ROW_NUMBER` and `RANK` for formatting. *I suggest you do the display format in the client side* [**SQL Fiddle**](http://sqlfiddle.com/#!6/a1105/2/0) ``` WITH CTE AS( SELECT t1.ItemId, t1.Name, t2.Category, t3.Dep, Rn_Cat = ROW_NUMBER() OV...
May be Using `UNION` [Fiddle Here](http://sqlfiddle.com/#!6/a1105/11) ``` WITH CTE AS( SELECT t2.ItemId,t1.Name,t2.Category,t3.Dep, Rank() over(Partition by t1.ItemId,t1.Name order by t2.Category,t3.Dep) as rn from Table1 t1 join Table2 t2 on t1.ItemId=t2.ItemId join Table3 t3 on t1.ItemId=t3.ItemId ...
32,984,482
I have 3 SQL tables as below: Table 1 ``` ItemId Name ---------- A aa B bb ``` Table 2 ``` ItemId Category ---------- A 1 A 2 A 3 B 1 ``` Table 3 ``` ItemId Dep ---------- A D1 B D2 B D3 ``` I need result as this ``` ItemId Name Category Dep --------------...
2015/10/07
[ "https://Stackoverflow.com/questions/32984482", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745066/" ]
You can first `JOIN` the tables on `ItemId` and then use `ROW_NUMBER` and `RANK` for formatting. *I suggest you do the display format in the client side* [**SQL Fiddle**](http://sqlfiddle.com/#!6/a1105/2/0) ``` WITH CTE AS( SELECT t1.ItemId, t1.Name, t2.Category, t3.Dep, Rn_Cat = ROW_NUMBER() OV...
this will probably work: ``` ;with cte_t1 as ( select 'A' as ItemId, 'aa' as Name union select 'B' as ItemId, 'bb' as Name ), cte_t2 as ( select 'A' AS ItemId, 1 as Category union select 'A' AS ItemId, 2 as Category union select 'A' AS ItemId, 3 as Category union select 'B' AS ItemId, 1 as Category ), cte_t3 as ( se...
32,984,482
I have 3 SQL tables as below: Table 1 ``` ItemId Name ---------- A aa B bb ``` Table 2 ``` ItemId Category ---------- A 1 A 2 A 3 B 1 ``` Table 3 ``` ItemId Dep ---------- A D1 B D2 B D3 ``` I need result as this ``` ItemId Name Category Dep --------------...
2015/10/07
[ "https://Stackoverflow.com/questions/32984482", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745066/" ]
You can first `JOIN` the tables on `ItemId` and then use `ROW_NUMBER` and `RANK` for formatting. *I suggest you do the display format in the client side* [**SQL Fiddle**](http://sqlfiddle.com/#!6/a1105/2/0) ``` WITH CTE AS( SELECT t1.ItemId, t1.Name, t2.Category, t3.Dep, Rn_Cat = ROW_NUMBER() OV...
Using this code - ``` SELECT table1.ItemID, table1.Name, table2.Category, table3.Dep FROM table1, table2, table3 WHERE table1.ItemID = table2.ItemID AND table1.ItemID = table3.ItemID; ``` produces this output - ``` +--------+------+----------+-----+ | ItemID | Name | Category | Dep | +--------+...
7,574,303
I have problems localizing a django-nonrel project, which is deployed to GAE. Because of GAE I have to put everything into my project folder, so it looks like something like this ``` project + django + dbindexer + registration + myapp ... + locale + templates ``` I have strings to localize in `template...
2011/09/27
[ "https://Stackoverflow.com/questions/7574303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/686223/" ]
**./manage.py help makemessages** ``` -i PATTERN, --ignore=PATTERN Ignore files or directories matching this glob-style pattern. Use multiple times to ignore more. ``` I have just tested it, and this command successfully ignored my application: ./manage.py makemessage...
The problem is with the pattern - maybe the shell was expanding it for you. In general - it is good to avoid path separators (whether / or \) in the pattern. If you need to always pass specific options to the `makemessages` command, you could consider your own wrapper, like this one, which I use myself: ``` from dja...
48,645,435
I'm working on my first app with a facebook login, and am unable to get a segue to trigger once I'm logged in. The facebook login triggers just fine and logs me in, then I'm dumped back to the login VC. Here's where I'm triggering the segue: ``` func loginButtonDidCompleteLogin(_ loginButton: LoginButton, result: Log...
2018/02/06
[ "https://Stackoverflow.com/questions/48645435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7771253/" ]
You should call [performSegue](https://developer.apple.com/documentation/uikit/uiviewcontroller/1621413-performsegue) method in `FBSDKGraphRequest` completion. ``` func getFBUserData(){ if((FBSDKAccessToken.current()) != nil){ FBSDKGraphRequest(graphPath: "me", parameters: ["fields": "id, name, email"]).st...
The project was bugged. I had another segue that wasn't executing code as well as a few other miscellaneous blocks here and there. Deleting my `LoginVC` file and recreating it solved all issues
26,880,867
I am having a problem with adding homes with HMHomeManager. I can call the function `add` well, but HMHomeManager does not return ``` func homeManager(manager: HMHomeManager!, didAddHome home: HMHome!) { println("\(__FUNCTION__)") } ``` I am sure I already assigned the delegate of homeManager. Below is my code:...
2014/11/12
[ "https://Stackoverflow.com/questions/26880867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3463682/" ]
Did you remember to enable HomeKit in Capabilities? ![enter image description here](https://i.stack.imgur.com/ZTsCj.png)
I get the same error. As a workaround, I am getting the homeManagerDidUpdatePrimaryHome callback. I filed a bug for this during the beta, which was closed as a duplicate, but I guess it needs to be refiled. homeManagerDidUpdatePrimaryHome is working, but that really only helps with the first home. I re-reported this ...
26,880,867
I am having a problem with adding homes with HMHomeManager. I can call the function `add` well, but HMHomeManager does not return ``` func homeManager(manager: HMHomeManager!, didAddHome home: HMHome!) { println("\(__FUNCTION__)") } ``` I am sure I already assigned the delegate of homeManager. Below is my code:...
2014/11/12
[ "https://Stackoverflow.com/questions/26880867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3463682/" ]
Quoting from Apple Dev Forum discussions: This is not a bug but yeah, it should be better documented. All HomeKit's delegates will only get invoked when there are changes in HomeKit database that are not caused by the app or doesn't have a direct connection to your completion handler (Like Synced from iCloud, another...
I get the same error. As a workaround, I am getting the homeManagerDidUpdatePrimaryHome callback. I filed a bug for this during the beta, which was closed as a duplicate, but I guess it needs to be refiled. homeManagerDidUpdatePrimaryHome is working, but that really only helps with the first home. I re-reported this ...
26,880,867
I am having a problem with adding homes with HMHomeManager. I can call the function `add` well, but HMHomeManager does not return ``` func homeManager(manager: HMHomeManager!, didAddHome home: HMHome!) { println("\(__FUNCTION__)") } ``` I am sure I already assigned the delegate of homeManager. Below is my code:...
2014/11/12
[ "https://Stackoverflow.com/questions/26880867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3463682/" ]
Did you remember to enable HomeKit in Capabilities? ![enter image description here](https://i.stack.imgur.com/ZTsCj.png)
This is an iOS bug (tested with 8.3). 21097472 HomeKit API - HMHomeManagerDelegate didAddHome is not called
26,880,867
I am having a problem with adding homes with HMHomeManager. I can call the function `add` well, but HMHomeManager does not return ``` func homeManager(manager: HMHomeManager!, didAddHome home: HMHome!) { println("\(__FUNCTION__)") } ``` I am sure I already assigned the delegate of homeManager. Below is my code:...
2014/11/12
[ "https://Stackoverflow.com/questions/26880867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3463682/" ]
Quoting from Apple Dev Forum discussions: This is not a bug but yeah, it should be better documented. All HomeKit's delegates will only get invoked when there are changes in HomeKit database that are not caused by the app or doesn't have a direct connection to your completion handler (Like Synced from iCloud, another...
This is an iOS bug (tested with 8.3). 21097472 HomeKit API - HMHomeManagerDelegate didAddHome is not called
8,500,229
I'm using VS 2010 + latest VsVim. Looks like Vim `Ctrl`+`R` does not work in VsVim. Is that true? VS handled `Ctrl`+`R`, saying: `(Ctrl+R) was pressed. Waiting for second key of chord...` Is there any way to make this work?
2011/12/14
[ "https://Stackoverflow.com/questions/8500229", "https://Stackoverflow.com", "https://Stackoverflow.com/users/351950/" ]
VsVim allows you to control whether `Ctrl`+`r` is handled by Visual Studio or VsVim itself. At the bottom of a source file (e.g. \*.cs) you should see the VsVim command line and an Options button. Clicking the Options button will give you a menu that lists various keyboard shortcuts and allows you to choose which appl...
Yes. There is an Option button in after the VsVim command line. But even if I choose to VsVim to handle Ctrl+R, VS is still handling Ctrl+R and complains: '(Ctrl+R) was pressed. Waiting for second key of chord...' I just tried to change this setting and let VS handle Ctrl+R, then change it back to VsVim. But still can'...
64,176,646
I am receiving Pandas DataFrame from an upstream component that has a large number of columns (~20000), all of them have dtypes `float64` and most of the entries are `NaN` (this is *bag of words* encoded document). Example: ``` 1 2.0 NaN 1.0 NaN NaN NaN 1.0 NaN NaN NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN 2 ...
2020/10/02
[ "https://Stackoverflow.com/questions/64176646", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9518890/" ]
You seem to have a limit on the memory. In which case, try not to chain the operation. That is: ``` df = df.fillna(0) df = df.astype('int8') ``` Or use `apply` on the rows if you have less rows than columns: ``` df = df.apply(lambda x: x.fillna(0).astype('int8'), axis=1) ``` However, Since most of the cells in th...
Do the conversion in blocks instead of all at once * start with heavy dataframe A * create a new dataframe B * copy range from A to new dataframe C (choose block size to not overrun memory) * convert range in C to desired type (can be combined with former step) * delete old range in A * join C to A * repeat until all ...
24,903,112
Hi i have been developing simple school project, in that i want send the mail to startmark entry if the enrolments of the student get completed. i have tables allotment ``` *section_id *user_id ``` user ``` *user_id *email ``` enrolment controller ``` def update unless params[:students] && params[:section_id] ...
2014/07/23
[ "https://Stackoverflow.com/questions/24903112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3733950/" ]
I hope this is what you expect: In enrolment controller, ``` def update unless params[:students] && params[:section_id] && !params[:is_academic].nil? send_back GlobalUtils.false_response_hash and return end Mailers.mark_entry_notification(params[:section_id]).deliver send_back( response_hash, :...
mail(:to => **array\_user\_mail** :subject => student enrollment is completed) Note down the bolded text. Need not to use quotes for a ruby variable. You can send mails to multiple users in this way. I wonder why you have written this many lines of code just to fetch the email ids of User model. ``` array_user_mail ...
21,286,822
When a user accesses **test.domain.co.uk**, I would like to show them the page at **channels/index.php?url=test** where **test** can be anything. I have this working with the following code: ``` RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.domain\.co\.uk$ RewriteCond %{HTTP_HOST} ^.+\.domain\.co\.uk$ RewriteRule ...
2014/01/22
[ "https://Stackoverflow.com/questions/21286822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420051/" ]
This is a bit tricky, but for all the people interested in reversing an array without creating new predicate functions and/or modifying the array etc... ``` ng-repeat="feed in feeds | orderBy:'':true" ``` or ``` ng-repeat="feed in feeds | orderBy:'-'" ``` **EXPLANATION** if you leave the second parameter a bla...
What is the structure of a single feed? It seems you can use the built-in filter from angular to order it the way you want. For example, if the field "id" is what provides "order" in the array, you would do this: ``` data-ng-repeat='feed in feeds | orderBy:id' ``` If you want that reversed, you just do: ``` data...
21,286,822
When a user accesses **test.domain.co.uk**, I would like to show them the page at **channels/index.php?url=test** where **test** can be anything. I have this working with the following code: ``` RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.domain\.co\.uk$ RewriteCond %{HTTP_HOST} ^.+\.domain\.co\.uk$ RewriteRule ...
2014/01/22
[ "https://Stackoverflow.com/questions/21286822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420051/" ]
Please use directly Java-script slice function with reverse like this: ``` data-ng-repeat="item in items.slice().reverse()" ```
What is the structure of a single feed? It seems you can use the built-in filter from angular to order it the way you want. For example, if the field "id" is what provides "order" in the array, you would do this: ``` data-ng-repeat='feed in feeds | orderBy:id' ``` If you want that reversed, you just do: ``` data...
21,286,822
When a user accesses **test.domain.co.uk**, I would like to show them the page at **channels/index.php?url=test** where **test** can be anything. I have this working with the following code: ``` RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.domain\.co\.uk$ RewriteCond %{HTTP_HOST} ^.+\.domain\.co\.uk$ RewriteRule ...
2014/01/22
[ "https://Stackoverflow.com/questions/21286822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420051/" ]
To make the array render in reverse and ordered by 'id', this should work: ``` data-ng-repeat="feed in feeds | orderBy:'id':true" ``` Let me know if that works for you. For your reference: <http://jsfiddle.net/byizzy/pgPVU/3/>
a solution which doesn't sort the array, but only copies and reverses it: `ng-repeat="item in items | orderBy : '[]': true"`
21,286,822
When a user accesses **test.domain.co.uk**, I would like to show them the page at **channels/index.php?url=test** where **test** can be anything. I have this working with the following code: ``` RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.domain\.co\.uk$ RewriteCond %{HTTP_HOST} ^.+\.domain\.co\.uk$ RewriteRule ...
2014/01/22
[ "https://Stackoverflow.com/questions/21286822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420051/" ]
This is a bit tricky, but for all the people interested in reversing an array without creating new predicate functions and/or modifying the array etc... ``` ng-repeat="feed in feeds | orderBy:'':true" ``` or ``` ng-repeat="feed in feeds | orderBy:'-'" ``` **EXPLANATION** if you leave the second parameter a bla...
Please use directly Java-script slice function with reverse like this: ``` data-ng-repeat="item in items.slice().reverse()" ```
21,286,822
When a user accesses **test.domain.co.uk**, I would like to show them the page at **channels/index.php?url=test** where **test** can be anything. I have this working with the following code: ``` RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.domain\.co\.uk$ RewriteCond %{HTTP_HOST} ^.+\.domain\.co\.uk$ RewriteRule ...
2014/01/22
[ "https://Stackoverflow.com/questions/21286822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420051/" ]
Please use directly Java-script slice function with reverse like this: ``` data-ng-repeat="item in items.slice().reverse()" ```
Hope this will solve your problem ``` data-ng-repeat='feed in feeds.reverse()' ```
21,286,822
When a user accesses **test.domain.co.uk**, I would like to show them the page at **channels/index.php?url=test** where **test** can be anything. I have this working with the following code: ``` RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.domain\.co\.uk$ RewriteCond %{HTTP_HOST} ^.+\.domain\.co\.uk$ RewriteRule ...
2014/01/22
[ "https://Stackoverflow.com/questions/21286822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420051/" ]
To make the array render in reverse and ordered by 'id', this should work: ``` data-ng-repeat="feed in feeds | orderBy:'id':true" ``` Let me know if that works for you. For your reference: <http://jsfiddle.net/byizzy/pgPVU/3/>
Hope this will solve your problem ``` data-ng-repeat='feed in feeds.reverse()' ```
21,286,822
When a user accesses **test.domain.co.uk**, I would like to show them the page at **channels/index.php?url=test** where **test** can be anything. I have this working with the following code: ``` RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.domain\.co\.uk$ RewriteCond %{HTTP_HOST} ^.+\.domain\.co\.uk$ RewriteRule ...
2014/01/22
[ "https://Stackoverflow.com/questions/21286822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420051/" ]
This is a bit tricky, but for all the people interested in reversing an array without creating new predicate functions and/or modifying the array etc... ``` ng-repeat="feed in feeds | orderBy:'':true" ``` or ``` ng-repeat="feed in feeds | orderBy:'-'" ``` **EXPLANATION** if you leave the second parameter a bla...
Another Alternative Way to Achieve the AngularJs Reverse is ``` <div ng-repeat="item in items | orderBy:'$index':true"> <code>{{item.id}} - {{item.name}}</code> </div> ```
21,286,822
When a user accesses **test.domain.co.uk**, I would like to show them the page at **channels/index.php?url=test** where **test** can be anything. I have this working with the following code: ``` RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.domain\.co\.uk$ RewriteCond %{HTTP_HOST} ^.+\.domain\.co\.uk$ RewriteRule ...
2014/01/22
[ "https://Stackoverflow.com/questions/21286822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420051/" ]
This is a bit tricky, but for all the people interested in reversing an array without creating new predicate functions and/or modifying the array etc... ``` ng-repeat="feed in feeds | orderBy:'':true" ``` or ``` ng-repeat="feed in feeds | orderBy:'-'" ``` **EXPLANATION** if you leave the second parameter a bla...
Hope this will solve your problem ``` data-ng-repeat='feed in feeds.reverse()' ```
21,286,822
When a user accesses **test.domain.co.uk**, I would like to show them the page at **channels/index.php?url=test** where **test** can be anything. I have this working with the following code: ``` RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.domain\.co\.uk$ RewriteCond %{HTTP_HOST} ^.+\.domain\.co\.uk$ RewriteRule ...
2014/01/22
[ "https://Stackoverflow.com/questions/21286822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420051/" ]
Please use directly Java-script slice function with reverse like this: ``` data-ng-repeat="item in items.slice().reverse()" ```
a solution which doesn't sort the array, but only copies and reverses it: `ng-repeat="item in items | orderBy : '[]': true"`
21,286,822
When a user accesses **test.domain.co.uk**, I would like to show them the page at **channels/index.php?url=test** where **test** can be anything. I have this working with the following code: ``` RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.domain\.co\.uk$ RewriteCond %{HTTP_HOST} ^.+\.domain\.co\.uk$ RewriteRule ...
2014/01/22
[ "https://Stackoverflow.com/questions/21286822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2420051/" ]
What is the structure of a single feed? It seems you can use the built-in filter from angular to order it the way you want. For example, if the field "id" is what provides "order" in the array, you would do this: ``` data-ng-repeat='feed in feeds | orderBy:id' ``` If you want that reversed, you just do: ``` data...
Another Alternative Way to Achieve the AngularJs Reverse is ``` <div ng-repeat="item in items | orderBy:'$index':true"> <code>{{item.id}} - {{item.name}}</code> </div> ```
1,134,182
I'm unable to turn off backlight of my keyboard. I've tried every solutions available on the internet including **xset**, etc. But nothing seem to work on AsusFX503. I've Ubuntu 18.04 installed. Please help.
2019/04/15
[ "https://askubuntu.com/questions/1134182", "https://askubuntu.com", "https://askubuntu.com/users/800858/" ]
`cp -a ../somedir/.` is wrong. The general syntax is ``` cp source target ``` You only specified one argument. To copy something to current directory, you can run ``` cp ../somedir . ``` Note the space before the dot. `.` is shorthand for current directory. `..` is shorthand for parent directory.
You can say: `cp -a ../somedir .` if you want to copy the folder it self with its content Or you can say `cp -a ../somedir/* .` If you want to copy the content of the folder. the `-a` option will try to clone the same file structure with the same file tree to the new location
13,848,493
I basically have a table that holds counts for every date. I want to create a query that gives me the total # of counts over the entire table, as well as the total for yesterday. But when I try to join the table twice, the aggregates are off. Below is how you can replicate the results. ``` CREATE TABLE a (id int prima...
2012/12/12
[ "https://Stackoverflow.com/questions/13848493", "https://Stackoverflow.com", "https://Stackoverflow.com/users/706441/" ]
No, it's not a bug in MySQL. Your JOIN conditions are generating "duplicate" rows. (Remove the aggregate functions and the GROUP BY, and you'll see what's happening. That row from table "a" is matching four rows from table "b". That's all fine and good. But when you add the join to the third table ("y"), each row ret...
``` SELECT A.id,b_count AS total_count,y_count as y FROM a AS A LEFT JOIN (select a_id,SUM(B.Count) b_count from b group by B.A_id) AS B1 ON (B1.a_id=A.id) LEFT JOIN (select a_id,SUM(Count) y_count from b where date=UTC_DATE()-1 group by B.A_id) AS Y ON (Y.a_id=A.id) ``` [...
64,886,259
this source code is use comprehension in python ``` hidden_layer = [{'weights':[random() for i in range (3)]} for i in range(1)] ``` so i transform to don't use comprehension expression and below is my source code to transform that ```py import random for i in range(3): for i in range (1): hidden_l...
2020/11/18
[ "https://Stackoverflow.com/questions/64886259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13353248/" ]
```py pd.DataFrame({'col': ['AA_XX', 'AAA_BB_XX', 'AA_BB_XYX', 'AA_A_B_YXX']})['col'].apply(lambda r: '_'.join(r.split('_')[:-1])) ``` Explaination: ```py df = pd.DataFrame({'col': ['AA_XX', 'AAA_BB_XX', 'AA_BB_XYX', 'AA_A_B_YXX']}) ``` Creates ```py col 0 AA_XX 1 AAA_BB_XX 2 AA_BB_XYX 3 AA_A_B_YXX `...
Here is another way of going about it. ``` import pandas as pd data = {'s': ['AA_XX', 'AAA_BB_XX', 'AA_BB_XYX', 'AA_A_B_YXX']} df = pd.DataFrame(data) def cond1(s): temp_s = s.split('_') temp_len = len(temp_s) if len(temp_s) == 1: return temp_s else: return temp_s[:len(temp_s)-1] df['r...
64,886,259
this source code is use comprehension in python ``` hidden_layer = [{'weights':[random() for i in range (3)]} for i in range(1)] ``` so i transform to don't use comprehension expression and below is my source code to transform that ```py import random for i in range(3): for i in range (1): hidden_l...
2020/11/18
[ "https://Stackoverflow.com/questions/64886259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13353248/" ]
You can do this simply using [`Series.str.split`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.split.html) and [`Series.str.join`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.join.html): ``` In [2381]: df Out[2381]: col1 0 AA_XX 1 AAA_B...
Here is another way of going about it. ``` import pandas as pd data = {'s': ['AA_XX', 'AAA_BB_XX', 'AA_BB_XYX', 'AA_A_B_YXX']} df = pd.DataFrame(data) def cond1(s): temp_s = s.split('_') temp_len = len(temp_s) if len(temp_s) == 1: return temp_s else: return temp_s[:len(temp_s)-1] df['r...
36,330,203
I have a JsonResponse which looks like this: ``` [{"pk": 1, "fields": {"email": "info@spott.com", "locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", "locations": [1, 2], "group_id": "spottalle", "group_name": "spott alle"}, "model": ...
2016/03/31
[ "https://Stackoverflow.com/questions/36330203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2270231/" ]
In fact this is an array, so you can simply loop it using a classic for loop, this is an exmaple snippet: ``` var data = [{"pk": 1, "fields": {"email": "info@spott.com", "locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", ...
Here you go.. ``` <script> var object = [{"pk": 1, "fields": {"email": "info@spott.com", "locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", "locations": [1, 2], "group_id": "spottalle", "group_name": "spott alle"}, "model": "grouping"}]...
36,330,203
I have a JsonResponse which looks like this: ``` [{"pk": 1, "fields": {"email": "info@spott.com", "locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", "locations": [1, 2], "group_id": "spottalle", "group_name": "spott alle"}, "model": ...
2016/03/31
[ "https://Stackoverflow.com/questions/36330203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2270231/" ]
Try using $.each instead of for loop : Try this : ``` var object = [{"pk": 1, "fields": {"email": "info@spott.com","locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", "locations": [1, 2], "group_id": "spottalle", "group_name": "spott all...
Here you go.. ``` <script> var object = [{"pk": 1, "fields": {"email": "info@spott.com", "locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", "locations": [1, 2], "group_id": "spottalle", "group_name": "spott alle"}, "model": "grouping"}]...
36,330,203
I have a JsonResponse which looks like this: ``` [{"pk": 1, "fields": {"email": "info@spott.com", "locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", "locations": [1, 2], "group_id": "spottalle", "group_name": "spott alle"}, "model": ...
2016/03/31
[ "https://Stackoverflow.com/questions/36330203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2270231/" ]
In fact this is an array, so you can simply loop it using a classic for loop, this is an exmaple snippet: ``` var data = [{"pk": 1, "fields": {"email": "info@spott.com", "locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", ...
response is in encoded manner,for access you want to decode response. ``` var x=[{"pk": 1, "fields": {"email": "info@spott.com", "locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"},{"pk": 2, "fields": {"email": "info@spott.com", "locations": [1, 2], "group_id": "spottalle", "group_name"...
36,330,203
I have a JsonResponse which looks like this: ``` [{"pk": 1, "fields": {"email": "info@spott.com", "locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", "locations": [1, 2], "group_id": "spottalle", "group_name": "spott alle"}, "model": ...
2016/03/31
[ "https://Stackoverflow.com/questions/36330203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2270231/" ]
In fact this is an array, so you can simply loop it using a classic for loop, this is an exmaple snippet: ``` var data = [{"pk": 1, "fields": {"email": "info@spott.com", "locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", ...
you can try the bellow simple instruction : ``` var array=[{"pk": 1, "fields": {"email": "info@spott.com", "locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", "locations": [1, 2], "group_id": "spottalle", "group_name": "spott alle"}, "mo...
36,330,203
I have a JsonResponse which looks like this: ``` [{"pk": 1, "fields": {"email": "info@spott.com", "locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", "locations": [1, 2], "group_id": "spottalle", "group_name": "spott alle"}, "model": ...
2016/03/31
[ "https://Stackoverflow.com/questions/36330203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2270231/" ]
In fact this is an array, so you can simply loop it using a classic for loop, this is an exmaple snippet: ``` var data = [{"pk": 1, "fields": {"email": "info@spott.com", "locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", ...
Try using $.each instead of for loop : Try this : ``` var object = [{"pk": 1, "fields": {"email": "info@spott.com","locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", "locations": [1, 2], "group_id": "spottalle", "group_name": "spott all...
36,330,203
I have a JsonResponse which looks like this: ``` [{"pk": 1, "fields": {"email": "info@spott.com", "locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", "locations": [1, 2], "group_id": "spottalle", "group_name": "spott alle"}, "model": ...
2016/03/31
[ "https://Stackoverflow.com/questions/36330203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2270231/" ]
Try using $.each instead of for loop : Try this : ``` var object = [{"pk": 1, "fields": {"email": "info@spott.com","locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", "locations": [1, 2], "group_id": "spottalle", "group_name": "spott all...
response is in encoded manner,for access you want to decode response. ``` var x=[{"pk": 1, "fields": {"email": "info@spott.com", "locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"},{"pk": 2, "fields": {"email": "info@spott.com", "locations": [1, 2], "group_id": "spottalle", "group_name"...
36,330,203
I have a JsonResponse which looks like this: ``` [{"pk": 1, "fields": {"email": "info@spott.com", "locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", "locations": [1, 2], "group_id": "spottalle", "group_name": "spott alle"}, "model": ...
2016/03/31
[ "https://Stackoverflow.com/questions/36330203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2270231/" ]
Try using $.each instead of for loop : Try this : ``` var object = [{"pk": 1, "fields": {"email": "info@spott.com","locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", "locations": [1, 2], "group_id": "spottalle", "group_name": "spott all...
you can try the bellow simple instruction : ``` var array=[{"pk": 1, "fields": {"email": "info@spott.com", "locations": [1], "group_id": "spott", "group_name": "spott"}, "model": "grouping"}, {"pk": 2, "fields": {"email": "info@spott.com", "locations": [1, 2], "group_id": "spottalle", "group_name": "spott alle"}, "mo...
1,589,680
I have a Main window build with Qt Designer and I also have a widget built with Qt designer (both in a separate ui file). How can I instantiate my widget into my mainwindow at runtime?
2009/10/19
[ "https://Stackoverflow.com/questions/1589680", "https://Stackoverflow.com", "https://Stackoverflow.com/users/131981/" ]
The easiest way (using Designer) is to open your main window, drag a `QWidget` into it, and position/name the `QWidget` like you would your custom widget. Once that is done, right-click on the `QWidget`, and select **Promote to...**. A dialog will show up with the widgets it can be promoted to. At the bottom of that di...
Can't you use [QMainWindow::setCentralWidget](http://qt.nokia.com/doc/4.5/qmainwindow.html#setCentralWidget) function?
74,137,405
I'm trying to reshape a data frame in a certain way. This is the data frame I have, | col\_1 | col\_2 | | --- | --- | | One | *Roxanne* | | Two | *Ghina* | | *Roxanne* | *Leila* | | *Ghina* | *George* | | Three | *Rock* | | Four | *Rock* | I'd like to reshape the dataframe such that it looks like this: | col\_3 | |...
2022/10/20
[ "https://Stackoverflow.com/questions/74137405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18641543/" ]
**Taking into account @OldBill 's comment & answer:** I corrected the code so that it gives an answer taking into account both of Op's problem. The counting of the trailing zero is @OldBill 's code and not mine. With ``` list = input("Enter the number: ") p = print("Trailing zeroes = ") print(p, list.count("0")) `...
Here is a working example of the code: ``` i = input("Enter the number: ") p = "Trailing zeroes = " + str(i.count("0")) print(p) ``` Output: ``` Enter the number: 1000 Trailing zeroes = 3 ```
74,137,405
I'm trying to reshape a data frame in a certain way. This is the data frame I have, | col\_1 | col\_2 | | --- | --- | | One | *Roxanne* | | Two | *Ghina* | | *Roxanne* | *Leila* | | *Ghina* | *George* | | Three | *Rock* | | Four | *Rock* | I'd like to reshape the dataframe such that it looks like this: | col\_3 | |...
2022/10/20
[ "https://Stackoverflow.com/questions/74137405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18641543/" ]
To count **trailing** zeroes you could do this: ``` num = input('Enter number: ') ntz = len(s)-len(s.rstrip('0')) print(f'Your input has {ntz} trailing zeroes') ```
Here is a working example of the code: ``` i = input("Enter the number: ") p = "Trailing zeroes = " + str(i.count("0")) print(p) ``` Output: ``` Enter the number: 1000 Trailing zeroes = 3 ```
74,137,405
I'm trying to reshape a data frame in a certain way. This is the data frame I have, | col\_1 | col\_2 | | --- | --- | | One | *Roxanne* | | Two | *Ghina* | | *Roxanne* | *Leila* | | *Ghina* | *George* | | Three | *Rock* | | Four | *Rock* | I'd like to reshape the dataframe such that it looks like this: | col\_3 | |...
2022/10/20
[ "https://Stackoverflow.com/questions/74137405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18641543/" ]
**Taking into account @OldBill 's comment & answer:** I corrected the code so that it gives an answer taking into account both of Op's problem. The counting of the trailing zero is @OldBill 's code and not mine. With ``` list = input("Enter the number: ") p = print("Trailing zeroes = ") print(p, list.count("0")) `...
Another way to do this: **NB1**: the *input* is a `string` not a `list`. **NB2**: This will count all zeroes - not just trailing – (*By @OldBill*) ``` text= input("Enter the number: ") print("Trailing zeroes = ", text.count("0")) ```
74,137,405
I'm trying to reshape a data frame in a certain way. This is the data frame I have, | col\_1 | col\_2 | | --- | --- | | One | *Roxanne* | | Two | *Ghina* | | *Roxanne* | *Leila* | | *Ghina* | *George* | | Three | *Rock* | | Four | *Rock* | I'd like to reshape the dataframe such that it looks like this: | col\_3 | |...
2022/10/20
[ "https://Stackoverflow.com/questions/74137405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18641543/" ]
To count **trailing** zeroes you could do this: ``` num = input('Enter number: ') ntz = len(s)-len(s.rstrip('0')) print(f'Your input has {ntz} trailing zeroes') ```
Another way to do this: **NB1**: the *input* is a `string` not a `list`. **NB2**: This will count all zeroes - not just trailing – (*By @OldBill*) ``` text= input("Enter the number: ") print("Trailing zeroes = ", text.count("0")) ```
443,390
Take the topology on $\Bbb R$, the real line, which is, $\tau=\{A\subseteq\Bbb R\mid\Bbb R\setminus A\text{ is countable}\}\cup \{\varnothing\}$. Can one find a convergence sequence in this topology? Because, Take a sequence $\{a\_n\}$, And suppose $a=\lim a\_n$. Take now the set $\Bbb R\setminus\{a\_n\}$. Then this is...
2013/07/14
[ "https://math.stackexchange.com/questions/443390", "https://math.stackexchange.com", "https://math.stackexchange.com/users/60164/" ]
Be careful, if $a=a\_n$ for some $n\in\Bbb N$, then the set $\Bbb R-\{a\_n\mid n\in\Bbb N\}$ won't contain $a$ itself. But you can still take $(\Bbb R-\{a\_n\mid n\in\Bbb N\})\cup\{a\}$. This is always a neighborhood of $a$, and if the sequence isn't eventually constant, then it is not eventually in this neighborhood, ...
Stefan's answer is great. Here's an exercise relevant to your question which I think is worth thinking about: ***Exercise 1***: Let $\{a\_n\}\_{n\geq 1}$ be a sequence in the finite complement topology on $\mathbb{R}$. Under what conditions does $\{a\_n\}\_{n\geq 1}$ converge and how many limits does it have? The sit...
19,129,456
Which way is more idiomatic to use Nullable<'a> or to use Option<'a> for representing a nullable int?
2013/10/02
[ "https://Stackoverflow.com/questions/19129456", "https://Stackoverflow.com", "https://Stackoverflow.com/users/139667/" ]
EMR does a lot of things for you that you won't find on standard Hadoop on EC2. Some particularly important ones include * Copying Hadoop logs from your machines to S3. This is very useful for debugging errors after the cluster has been shut down. * Running job flows of multiple MapReduce, Pig, or Hive jobs * Setting ...
You are correct that EMR uses instance-store backed EC2 instances, rather than EBS. However, there's nothing stopping you from creating an instance-store based instance, packing an AMI and using it for your Hadoop cluster. Using EBS also might not represent a lot of additional costs, depending on your workload and freq...
43,771,830
We're using a `PUSH/PULL` Scalable Formal Communication Pattern in ZeroMQ. The sender application sends a total of 30,000 messages, 10kB each. There's a lot of data loss and hence we set the following on sender's side: ``` zmq_socket = context.socket(zmq.PUSH) zmq_socket.setsockopt(zmq.SNDBUF, 10240) zmq_socket.setsoc...
2017/05/03
[ "https://Stackoverflow.com/questions/43771830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6656192/" ]
Remarks on ZeroMQ: *based just on what has been posted above so far in an MVCE* -------------------------------------------------------------------------------- **Never** pre-maturely optimise resources allocations: all quasi-optimisation decisions introduced in code before the code runtime operations meet all functi...
Use the `ZMQ_IMMEDIATE` flag to prevent any loss in messages that got queued to pipes which don't have a completed connection. From <http://api.zeromq.org/4-2:zmq-setsockopt#toc21> > > **`ZMQ_IMMEDIATE`: Queue messages only to completed connections** > > > By default queues will fill on outgoing connections even ...
55,004,829
``` clean_offset = len(malware) tuple_clean = [] tuple_malware = [] for i in malware: tuple_malware.append([malware.index(i), 0]) print(malware.index(i)) print(tuple_malware) for j in clean: tuple_clean.append([(clean_offset + clean.index(j)), 1]) print(clean.index(j)) print(tuple_clean) i...
2019/03/05
[ "https://Stackoverflow.com/questions/55004829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8271065/" ]
There is a logical error on `clean.index(j)`. Array.index will return the first matched index in that array. So if there are some equal variables there will be some error You can inspect with below code. ``` malware = [1,2,3,4,5,6,7,8,8,8,8,8,2] clean = [1,2,3,4,4,4,4,4,4,2,4,4,4,4] clean_offset = len(malware) tup...
``` for a in something ``` a is what is contained in something, not the index for example: ``` for n in [1, 10, 9, 3]: print(n) ``` gives ``` 1 10 9 3 ```
55,004,829
``` clean_offset = len(malware) tuple_clean = [] tuple_malware = [] for i in malware: tuple_malware.append([malware.index(i), 0]) print(malware.index(i)) print(tuple_malware) for j in clean: tuple_clean.append([(clean_offset + clean.index(j)), 1]) print(clean.index(j)) print(tuple_clean) i...
2019/03/05
[ "https://Stackoverflow.com/questions/55004829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8271065/" ]
``` for a in something ``` a is what is contained in something, not the index for example: ``` for n in [1, 10, 9, 3]: print(n) ``` gives ``` 1 10 9 3 ```
op has already figured the question, but in case anyone is wondering or needs a TL;DR of Barkin's comment, its just a small correction, replace ``` for i in malware ``` ``` for j in clean ``` with ``` for i in range(len(malware)) ``` ``` for j in range(len(clean)) ``` and at the end remove the .index() funct...
55,004,829
``` clean_offset = len(malware) tuple_clean = [] tuple_malware = [] for i in malware: tuple_malware.append([malware.index(i), 0]) print(malware.index(i)) print(tuple_malware) for j in clean: tuple_clean.append([(clean_offset + clean.index(j)), 1]) print(clean.index(j)) print(tuple_clean) i...
2019/03/05
[ "https://Stackoverflow.com/questions/55004829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8271065/" ]
There is a logical error on `clean.index(j)`. Array.index will return the first matched index in that array. So if there are some equal variables there will be some error You can inspect with below code. ``` malware = [1,2,3,4,5,6,7,8,8,8,8,8,2] clean = [1,2,3,4,4,4,4,4,4,2,4,4,4,4] clean_offset = len(malware) tup...
You either want ``` for i in range(len(malware)) ``` or ``` for i, element in enumerate(malware) ``` at which point the i is the count and the element in the malware.index(i) The last one is considered best practice when needing both the index and the element at that index in the loop.
55,004,829
``` clean_offset = len(malware) tuple_clean = [] tuple_malware = [] for i in malware: tuple_malware.append([malware.index(i), 0]) print(malware.index(i)) print(tuple_malware) for j in clean: tuple_clean.append([(clean_offset + clean.index(j)), 1]) print(clean.index(j)) print(tuple_clean) i...
2019/03/05
[ "https://Stackoverflow.com/questions/55004829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8271065/" ]
You either want ``` for i in range(len(malware)) ``` or ``` for i, element in enumerate(malware) ``` at which point the i is the count and the element in the malware.index(i) The last one is considered best practice when needing both the index and the element at that index in the loop.
op has already figured the question, but in case anyone is wondering or needs a TL;DR of Barkin's comment, its just a small correction, replace ``` for i in malware ``` ``` for j in clean ``` with ``` for i in range(len(malware)) ``` ``` for j in range(len(clean)) ``` and at the end remove the .index() funct...
55,004,829
``` clean_offset = len(malware) tuple_clean = [] tuple_malware = [] for i in malware: tuple_malware.append([malware.index(i), 0]) print(malware.index(i)) print(tuple_malware) for j in clean: tuple_clean.append([(clean_offset + clean.index(j)), 1]) print(clean.index(j)) print(tuple_clean) i...
2019/03/05
[ "https://Stackoverflow.com/questions/55004829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8271065/" ]
There is a logical error on `clean.index(j)`. Array.index will return the first matched index in that array. So if there are some equal variables there will be some error You can inspect with below code. ``` malware = [1,2,3,4,5,6,7,8,8,8,8,8,2] clean = [1,2,3,4,4,4,4,4,4,2,4,4,4,4] clean_offset = len(malware) tup...
op has already figured the question, but in case anyone is wondering or needs a TL;DR of Barkin's comment, its just a small correction, replace ``` for i in malware ``` ``` for j in clean ``` with ``` for i in range(len(malware)) ``` ``` for j in range(len(clean)) ``` and at the end remove the .index() funct...
3,763
I have a gift for learning languages, but I haven't made much use of it. There's people younger than me that know more languages than I do. The only one I've ever learned was German, and that was because I was listening to NDH metal at the time, which I don't do anymore. I'm sick of my talent going to waste. I used to...
2018/08/26
[ "https://languagelearning.stackexchange.com/questions/3763", "https://languagelearning.stackexchange.com", "https://languagelearning.stackexchange.com/users/-1/" ]
Start using the languages ========================= The internet is full of content in different languages. Take something that is interesting to you and start reading or listening. I enjoy roleplaying games, so I read some roleplaying blogs and material in the languages I am learning or know too poorly. I also set my...
Here's a reason: While learning another language, you also absorb some foreign culture and a different way of thinking and more importantly of perceiving the world around you. It opens doors to experiences, as if you were travelling far places, except these ones could be waiting only a block away from where you live. ...
3,763
I have a gift for learning languages, but I haven't made much use of it. There's people younger than me that know more languages than I do. The only one I've ever learned was German, and that was because I was listening to NDH metal at the time, which I don't do anymore. I'm sick of my talent going to waste. I used to...
2018/08/26
[ "https://languagelearning.stackexchange.com/questions/3763", "https://languagelearning.stackexchange.com", "https://languagelearning.stackexchange.com/users/-1/" ]
Start using the languages ========================= The internet is full of content in different languages. Take something that is interesting to you and start reading or listening. I enjoy roleplaying games, so I read some roleplaying blogs and material in the languages I am learning or know too poorly. I also set my...
Well, then. You probably will use a language. ***Possibilities*** - An Indian using offensive language at you (I've had an experience of this on an Internet text chat, never knew or heard of "maderchod" before, it means motherfucker). - A tourist asking for directions. - A hacker has installed ransomware on to you...
3,763
I have a gift for learning languages, but I haven't made much use of it. There's people younger than me that know more languages than I do. The only one I've ever learned was German, and that was because I was listening to NDH metal at the time, which I don't do anymore. I'm sick of my talent going to waste. I used to...
2018/08/26
[ "https://languagelearning.stackexchange.com/questions/3763", "https://languagelearning.stackexchange.com", "https://languagelearning.stackexchange.com/users/-1/" ]
If you don't plan to use a language actively (i.e. speaking and writing), you can still learn it out of sheer fascination with its (linguistic) features, or with the literature and culture associated with it. This fascination provides a source of motivation. For example, some people are interested in the diversity of g...
Here's a reason: While learning another language, you also absorb some foreign culture and a different way of thinking and more importantly of perceiving the world around you. It opens doors to experiences, as if you were travelling far places, except these ones could be waiting only a block away from where you live. ...
3,763
I have a gift for learning languages, but I haven't made much use of it. There's people younger than me that know more languages than I do. The only one I've ever learned was German, and that was because I was listening to NDH metal at the time, which I don't do anymore. I'm sick of my talent going to waste. I used to...
2018/08/26
[ "https://languagelearning.stackexchange.com/questions/3763", "https://languagelearning.stackexchange.com", "https://languagelearning.stackexchange.com/users/-1/" ]
If you don't plan to use a language actively (i.e. speaking and writing), you can still learn it out of sheer fascination with its (linguistic) features, or with the literature and culture associated with it. This fascination provides a source of motivation. For example, some people are interested in the diversity of g...
Well, then. You probably will use a language. ***Possibilities*** - An Indian using offensive language at you (I've had an experience of this on an Internet text chat, never knew or heard of "maderchod" before, it means motherfucker). - A tourist asking for directions. - A hacker has installed ransomware on to you...
3,763
I have a gift for learning languages, but I haven't made much use of it. There's people younger than me that know more languages than I do. The only one I've ever learned was German, and that was because I was listening to NDH metal at the time, which I don't do anymore. I'm sick of my talent going to waste. I used to...
2018/08/26
[ "https://languagelearning.stackexchange.com/questions/3763", "https://languagelearning.stackexchange.com", "https://languagelearning.stackexchange.com/users/-1/" ]
Here's a reason: While learning another language, you also absorb some foreign culture and a different way of thinking and more importantly of perceiving the world around you. It opens doors to experiences, as if you were travelling far places, except these ones could be waiting only a block away from where you live. ...
Well, then. You probably will use a language. ***Possibilities*** - An Indian using offensive language at you (I've had an experience of this on an Internet text chat, never knew or heard of "maderchod" before, it means motherfucker). - A tourist asking for directions. - A hacker has installed ransomware on to you...
5,421,018
I have a jQuery tooltip plugin that displays a tooltip when I hover over a anchor tag. I have modified my jCarousel so that my images are contained in anchor tags. When I hover over the first batch of images the tooltip hover function gets called. However, when the next batch of images come into view, the tooltip func...
2011/03/24
[ "https://Stackoverflow.com/questions/5421018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/446677/" ]
You made a function that requires a parameter, and when you called the function, you didn't bring the parameter! ``` itemLastInCallback: { onAfterAnimation: afterAnimationLastInCallback($(this)) } ``` instead of: ``` itemLastInCallback: { onAfterAnimation: afterAnimationLastInCallback } ``` Fixed it for y...
I managed to fix this issue by using a different javascript tooltip. So that on mouseover and mouseout elements on my image would either show or hide the tooltip.
53,082
Most people use TeX and its many varieties to create printed documents, such as reports, books, flyer's, etc. Occasionally, I have found software that uses TeX markup for other purposes, for e.g., the flashcard software, [Anki](http://ankisrs.net/) can use TeX to render on-screen flash cards. * Beyond producing typica...
2012/04/24
[ "https://tex.stackexchange.com/questions/53082", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/8918/" ]
Some people don't realize that TeX can do math. I read years ago (maybe 2007?) on comp.text.tex that someone was using TeX for the business end of a billing system. I can't find that post though. Does anyone else remember it?
My most unusual use cases: * measuring all the ads for a national phonebook and forcing those which are w/in a reasonable tolerance to the exact size per their database entry, outputting a colour-coded PDF which lists those which are not and their size deviations * as the back-end for an ad re-sizing system which allo...
53,082
Most people use TeX and its many varieties to create printed documents, such as reports, books, flyer's, etc. Occasionally, I have found software that uses TeX markup for other purposes, for e.g., the flashcard software, [Anki](http://ankisrs.net/) can use TeX to render on-screen flash cards. * Beyond producing typica...
2012/04/24
[ "https://tex.stackexchange.com/questions/53082", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/8918/" ]
The `docstrip` program distributed with LaTeX does not typeset anything, it is used to extract source code (while evaluating boolean guards) from documented sources, and to optionally install them in specified locations. Another such program distributed with LaTeX is `latexbug`. `latex latexbug` interacts with the use...
Back in the day, it used to be the #1 means to provide math formulas for PowerPoint presentations. I don't know what the math capabilities of PowerPoint are nowadays.
53,082
Most people use TeX and its many varieties to create printed documents, such as reports, books, flyer's, etc. Occasionally, I have found software that uses TeX markup for other purposes, for e.g., the flashcard software, [Anki](http://ankisrs.net/) can use TeX to render on-screen flash cards. * Beyond producing typica...
2012/04/24
[ "https://tex.stackexchange.com/questions/53082", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/8918/" ]
The `sudokubundle` provides three packages related to Sudoku: 1. `printsudoko` which prints a given puzzle; 2. `solvesudoku` which attempts to solve a given puzzle; 3. `createsudoku` which (randomly) creates and prints a puzzle that `solvesudoku` can solve. There are other packages for playing other games, such as Br...
Some people don't realize that TeX can do math. I read years ago (maybe 2007?) on comp.text.tex that someone was using TeX for the business end of a billing system. I can't find that post though. Does anyone else remember it?
53,082
Most people use TeX and its many varieties to create printed documents, such as reports, books, flyer's, etc. Occasionally, I have found software that uses TeX markup for other purposes, for e.g., the flashcard software, [Anki](http://ankisrs.net/) can use TeX to render on-screen flash cards. * Beyond producing typica...
2012/04/24
[ "https://tex.stackexchange.com/questions/53082", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/8918/" ]
Let's not forget the amazing [`reverxii.tex`](http://ctan.org/tex-archive/macros/plain/contrib/reverxii) from our great friend [Bruno Le Floch](https://tex.stackexchange.com/users/2707). From the documentation: --- **reverxii - Playing Reversi, in the spirit of [xii.tex](http://www.ctan.org/pkg/xii)** The file `reve...
Back in the day, it used to be the #1 means to provide math formulas for PowerPoint presentations. I don't know what the math capabilities of PowerPoint are nowadays.
53,082
Most people use TeX and its many varieties to create printed documents, such as reports, books, flyer's, etc. Occasionally, I have found software that uses TeX markup for other purposes, for e.g., the flashcard software, [Anki](http://ankisrs.net/) can use TeX to render on-screen flash cards. * Beyond producing typica...
2012/04/24
[ "https://tex.stackexchange.com/questions/53082", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/8918/" ]
The `sudokubundle` provides three packages related to Sudoku: 1. `printsudoko` which prints a given puzzle; 2. `solvesudoku` which attempts to solve a given puzzle; 3. `createsudoku` which (randomly) creates and prints a puzzle that `solvesudoku` can solve. There are other packages for playing other games, such as Br...
With the `beamer` and `impressive` packages, it's used for presentations, as I've [learned](https://tex.stackexchange.com/questions/41116/advantage-of-latex-presentations) :)
53,082
Most people use TeX and its many varieties to create printed documents, such as reports, books, flyer's, etc. Occasionally, I have found software that uses TeX markup for other purposes, for e.g., the flashcard software, [Anki](http://ankisrs.net/) can use TeX to render on-screen flash cards. * Beyond producing typica...
2012/04/24
[ "https://tex.stackexchange.com/questions/53082", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/8918/" ]
One, very incredible solution to an ICFP contest was created by Steve Hicks. He did an amazing job by coding a Mars rover guidance *bot*. See: <http://sdh33b.blogspot.com/2008/07/icfp-contest-2008.html> He has shared his code and written about it in the above link. This clearly shows that `TeX` is not just for ty...
Some people don't realize that TeX can do math. I read years ago (maybe 2007?) on comp.text.tex that someone was using TeX for the business end of a billing system. I can't find that post though. Does anyone else remember it?
53,082
Most people use TeX and its many varieties to create printed documents, such as reports, books, flyer's, etc. Occasionally, I have found software that uses TeX markup for other purposes, for e.g., the flashcard software, [Anki](http://ankisrs.net/) can use TeX to render on-screen flash cards. * Beyond producing typica...
2012/04/24
[ "https://tex.stackexchange.com/questions/53082", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/8918/" ]
The `docstrip` program distributed with LaTeX does not typeset anything, it is used to extract source code (while evaluating boolean guards) from documented sources, and to optionally install them in specified locations. Another such program distributed with LaTeX is `latexbug`. `latex latexbug` interacts with the use...
Some people don't realize that TeX can do math. I read years ago (maybe 2007?) on comp.text.tex that someone was using TeX for the business end of a billing system. I can't find that post though. Does anyone else remember it?
53,082
Most people use TeX and its many varieties to create printed documents, such as reports, books, flyer's, etc. Occasionally, I have found software that uses TeX markup for other purposes, for e.g., the flashcard software, [Anki](http://ankisrs.net/) can use TeX to render on-screen flash cards. * Beyond producing typica...
2012/04/24
[ "https://tex.stackexchange.com/questions/53082", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/8918/" ]
One, very incredible solution to an ICFP contest was created by Steve Hicks. He did an amazing job by coding a Mars rover guidance *bot*. See: <http://sdh33b.blogspot.com/2008/07/icfp-contest-2008.html> He has shared his code and written about it in the above link. This clearly shows that `TeX` is not just for ty...
Let's not forget the amazing [`reverxii.tex`](http://ctan.org/tex-archive/macros/plain/contrib/reverxii) from our great friend [Bruno Le Floch](https://tex.stackexchange.com/users/2707). From the documentation: --- **reverxii - Playing Reversi, in the spirit of [xii.tex](http://www.ctan.org/pkg/xii)** The file `reve...
53,082
Most people use TeX and its many varieties to create printed documents, such as reports, books, flyer's, etc. Occasionally, I have found software that uses TeX markup for other purposes, for e.g., the flashcard software, [Anki](http://ankisrs.net/) can use TeX to render on-screen flash cards. * Beyond producing typica...
2012/04/24
[ "https://tex.stackexchange.com/questions/53082", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/8918/" ]
Some "crazy" people use TeX as a afm file parser and converter to "virtual fonts". Really impressive. It's called [fontinst](http://www.ctan.org/pkg/fontinst). > > The reason fontinst is so portable is simply that it is written in TEX, exploiting those features of the language which does other things than typesetting...
With the `beamer` and `impressive` packages, it's used for presentations, as I've [learned](https://tex.stackexchange.com/questions/41116/advantage-of-latex-presentations) :)
53,082
Most people use TeX and its many varieties to create printed documents, such as reports, books, flyer's, etc. Occasionally, I have found software that uses TeX markup for other purposes, for e.g., the flashcard software, [Anki](http://ankisrs.net/) can use TeX to render on-screen flash cards. * Beyond producing typica...
2012/04/24
[ "https://tex.stackexchange.com/questions/53082", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/8918/" ]
The `docstrip` program distributed with LaTeX does not typeset anything, it is used to extract source code (while evaluating boolean guards) from documented sources, and to optionally install them in specified locations. Another such program distributed with LaTeX is `latexbug`. `latex latexbug` interacts with the use...
The `sudokubundle` provides three packages related to Sudoku: 1. `printsudoko` which prints a given puzzle; 2. `solvesudoku` which attempts to solve a given puzzle; 3. `createsudoku` which (randomly) creates and prints a puzzle that `solvesudoku` can solve. There are other packages for playing other games, such as Br...
11,688,689
I want some variables to be saved, when I shut down my app and to load them after opening the app (for statistics in a game) How can I do this? EDIT: Here my code: ``` TextView test1; String punkte = "15"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setCon...
2012/07/27
[ "https://Stackoverflow.com/questions/11688689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1557131/" ]
You should be using `SharedPrefences`. They are quite simple to use and will store the variables in the application data. As long as the user never hits "Clear Data" in the settings for your application, they will always be there. Here is a code sample. To access variables: ``` SharedPreferences mPrefs = getSharedPr...
Use `SharedPreference`, this is a better option. To see [this](http://samir-mangroliya.blogspot.in/p/android-shared-preferences.html) tutorial.
11,688,689
I want some variables to be saved, when I shut down my app and to load them after opening the app (for statistics in a game) How can I do this? EDIT: Here my code: ``` TextView test1; String punkte = "15"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setCon...
2012/07/27
[ "https://Stackoverflow.com/questions/11688689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1557131/" ]
Use `SharedPreference`, this is a better option. To see [this](http://samir-mangroliya.blogspot.in/p/android-shared-preferences.html) tutorial.
sample code: save: ``` SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences.Editor editor = settings.edit(); editor.putString("statepara1", ts); editor.commit(); ``` get: ``` SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context); St...
11,688,689
I want some variables to be saved, when I shut down my app and to load them after opening the app (for statistics in a game) How can I do this? EDIT: Here my code: ``` TextView test1; String punkte = "15"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setCon...
2012/07/27
[ "https://Stackoverflow.com/questions/11688689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1557131/" ]
You should be using `SharedPrefences`. They are quite simple to use and will store the variables in the application data. As long as the user never hits "Clear Data" in the settings for your application, they will always be there. Here is a code sample. To access variables: ``` SharedPreferences mPrefs = getSharedPr...
sample code: save: ``` SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences.Editor editor = settings.edit(); editor.putString("statepara1", ts); editor.commit(); ``` get: ``` SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context); St...
50,603,723
I'm trying to use dynamic pivot to have a column containing dates to be the column names. I want this table: ``` App Date Count Excel 2018-05-01 1 Excel 2018-05-02 1 Excel 2018-05-03 2 Word 2018-05-02 3 Word 2018-05-07 5 Word 2018-05-12 2 Paint 2018-05-07 6 ``` to look lik...
2018/05/30
[ "https://Stackoverflow.com/questions/50603723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9771609/" ]
Ok. so your case is preflight request. when client tries to send a custom header, server needs to verify that it accepts that header. so in that case, a preflight options request is sent with header Access-Control-Request-Headers. if server responds that it will accept the custom header. then actual request will be s...
Your axios request is correct. You need to allow your custom headers on server side. If you have your api in php then this code will work for you. ``` header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Methods: GET, POST, OPTIONS, HEAD"); header("Access-Control-Allow-Headers: Content-Type, Custo...
5,478,733
I am just writing a class implementing the ServiceLocator pattern. ``` public class ServiceFactory : IServiceFactory { private IDictionary<Type, object> instantiatedServices; public ServiceFactory() { instantiatedServices = new Dictionary<Type, object>(); } ...
2011/03/29
[ "https://Stackoverflow.com/questions/5478733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/252289/" ]
The fourth question is the easiest to answer: **no,** you shouldn't go for Service Locator at all because [it's an anti-pattern](http://blog.ploeh.dk/2010/02/03/ServiceLocatorIsAnAntiPattern.aspx). So what is the alternative? Use the [Register Resolve Release pattern](http://blog.ploeh.dk/2010/09/29/TheRegisterResolve...
1. You would call this whenever you need an instance of a service `T`. You would need more robust code to handle the cases where you don't have any logic to handle where `T` is unknown or unable to be handled by your service locator. 2. This varies from application to application, but most typically, registration of se...
6,508,519
I want a user to be able to access objects (could be JSON or XML) using a restful syntax rather than having to use query strings. So instead of `http://mywebsite.com/objects/get=obj1&get=obj2&get=someotherobject/` they could do something like `http://mywebsite.com/objects/obj1/obj2/` and the xml/JSON would be returned...
2011/06/28
[ "https://Stackoverflow.com/questions/6508519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277140/" ]
You need to install [Microsoft SQL Server Compact 4.0](http://www.microsoft.com/download/en/details.aspx?id=17876).
I had a server. It ran windows updates. And a message waiting for restart was open. After restart it worked again.
6,508,519
I want a user to be able to access objects (could be JSON or XML) using a restful syntax rather than having to use query strings. So instead of `http://mywebsite.com/objects/get=obj1&get=obj2&get=someotherobject/` they could do something like `http://mywebsite.com/objects/obj1/obj2/` and the xml/JSON would be returned...
2011/06/28
[ "https://Stackoverflow.com/questions/6508519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277140/" ]
If you look at the config you'll see that installing SQL Server was a red herring; ``` <add name="MovieDBContext" connectionString="Data Source=|DataDirectory|Movies.sdf" providerName="System.Data.SqlServerCe.4.0"/> ``` SqlServerCE is not, I'm afraid, full blown SQL Server, it's [SQL Server Compact Edition](http:/...
This worked for me, hope it helps ``` <add name="MovieDBContext" connectionString="Data Source=(local);Initial Catalog=Movies; Integrated Security=true;" providerName="System.Data.SqlClient" /> </connectionStrings> ```
6,508,519
I want a user to be able to access objects (could be JSON or XML) using a restful syntax rather than having to use query strings. So instead of `http://mywebsite.com/objects/get=obj1&get=obj2&get=someotherobject/` they could do something like `http://mywebsite.com/objects/obj1/obj2/` and the xml/JSON would be returned...
2011/06/28
[ "https://Stackoverflow.com/questions/6508519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277140/" ]
I was having the same problem so I replaced ``` <add name="MovieDBContext" connectionString="Data Source=|DataDirectory|Movies.sdf" providerName="System.Data.SqlServerCe.4.0"/> ``` with the following ``` <add name="MovieDBContext" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;databas...
You need to install [Microsoft SQL Server Compact 4.0](http://www.microsoft.com/download/en/details.aspx?id=17876).
6,508,519
I want a user to be able to access objects (could be JSON or XML) using a restful syntax rather than having to use query strings. So instead of `http://mywebsite.com/objects/get=obj1&get=obj2&get=someotherobject/` they could do something like `http://mywebsite.com/objects/obj1/obj2/` and the xml/JSON would be returned...
2011/06/28
[ "https://Stackoverflow.com/questions/6508519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277140/" ]
You need to install [Microsoft SQL Server Compact 4.0](http://www.microsoft.com/download/en/details.aspx?id=17876).
Rebuilding the project wont catch config errors in the DBContext section... the build process does not walk through connections, so you can build all day and still bomb out. As suggested above, fix the config so the connection string matches MachineName/SQLInstanceName/DBName with the correct SQL config. Worked just fi...
6,508,519
I want a user to be able to access objects (could be JSON or XML) using a restful syntax rather than having to use query strings. So instead of `http://mywebsite.com/objects/get=obj1&get=obj2&get=someotherobject/` they could do something like `http://mywebsite.com/objects/obj1/obj2/` and the xml/JSON would be returned...
2011/06/28
[ "https://Stackoverflow.com/questions/6508519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277140/" ]
<http://forums.asp.net/t/1679349.aspx/1> CypressBender Re: Unable to retrieve metadata for \* Unable to find the requested .Net Framework Data Provider.... Aug 08, 2011 07:44 PM|LINK I installed Microsoft SQL Server Compact 4.0, and that fixed the problem for me. <http://www.microsoft.com/download/en/details.aspx?id=...
1. Make sure that you build prior to adding the controller. If that doesn't work... 2. Create a new project, create a new sql server database manually and see if you can connect to it. If not, then the problem is indeed in your sql server config on your machine. You can try going to postgres just be sure that the provi...
6,508,519
I want a user to be able to access objects (could be JSON or XML) using a restful syntax rather than having to use query strings. So instead of `http://mywebsite.com/objects/get=obj1&get=obj2&get=someotherobject/` they could do something like `http://mywebsite.com/objects/obj1/obj2/` and the xml/JSON would be returned...
2011/06/28
[ "https://Stackoverflow.com/questions/6508519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277140/" ]
If you look at the config you'll see that installing SQL Server was a red herring; ``` <add name="MovieDBContext" connectionString="Data Source=|DataDirectory|Movies.sdf" providerName="System.Data.SqlServerCe.4.0"/> ``` SqlServerCE is not, I'm afraid, full blown SQL Server, it's [SQL Server Compact Edition](http:/...
1. Make sure that you build prior to adding the controller. If that doesn't work... 2. Create a new project, create a new sql server database manually and see if you can connect to it. If not, then the problem is indeed in your sql server config on your machine. You can try going to postgres just be sure that the provi...
6,508,519
I want a user to be able to access objects (could be JSON or XML) using a restful syntax rather than having to use query strings. So instead of `http://mywebsite.com/objects/get=obj1&get=obj2&get=someotherobject/` they could do something like `http://mywebsite.com/objects/obj1/obj2/` and the xml/JSON would be returned...
2011/06/28
[ "https://Stackoverflow.com/questions/6508519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277140/" ]
If you look at the config you'll see that installing SQL Server was a red herring; ``` <add name="MovieDBContext" connectionString="Data Source=|DataDirectory|Movies.sdf" providerName="System.Data.SqlServerCe.4.0"/> ``` SqlServerCE is not, I'm afraid, full blown SQL Server, it's [SQL Server Compact Edition](http:/...
I changed my SQL providerName="System.Data.SqlClient" in web.config , since I have SQL client as well as SQL compact installed on my system.
6,508,519
I want a user to be able to access objects (could be JSON or XML) using a restful syntax rather than having to use query strings. So instead of `http://mywebsite.com/objects/get=obj1&get=obj2&get=someotherobject/` they could do something like `http://mywebsite.com/objects/obj1/obj2/` and the xml/JSON would be returned...
2011/06/28
[ "https://Stackoverflow.com/questions/6508519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277140/" ]
<http://forums.asp.net/t/1679349.aspx/1> CypressBender Re: Unable to retrieve metadata for \* Unable to find the requested .Net Framework Data Provider.... Aug 08, 2011 07:44 PM|LINK I installed Microsoft SQL Server Compact 4.0, and that fixed the problem for me. <http://www.microsoft.com/download/en/details.aspx?id=...
What I did was in order to overcome the first problem I put in Web.config the code: ``` <add name="MovieDBContext" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Movies.sdf;Integrated Security=True" providerName="System.Data.SqlClient"/> ``` Notice I am creating SQL CE 4 databas...
6,508,519
I want a user to be able to access objects (could be JSON or XML) using a restful syntax rather than having to use query strings. So instead of `http://mywebsite.com/objects/get=obj1&get=obj2&get=someotherobject/` they could do something like `http://mywebsite.com/objects/obj1/obj2/` and the xml/JSON would be returned...
2011/06/28
[ "https://Stackoverflow.com/questions/6508519", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277140/" ]
I was having the same problem so I replaced ``` <add name="MovieDBContext" connectionString="Data Source=|DataDirectory|Movies.sdf" providerName="System.Data.SqlServerCe.4.0"/> ``` with the following ``` <add name="MovieDBContext" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;databas...
<http://forums.asp.net/t/1679349.aspx/1> CypressBender Re: Unable to retrieve metadata for \* Unable to find the requested .Net Framework Data Provider.... Aug 08, 2011 07:44 PM|LINK I installed Microsoft SQL Server Compact 4.0, and that fixed the problem for me. <http://www.microsoft.com/download/en/details.aspx?id=...