qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
68,610,235
I want something like this: ``` ************************************************************************** * * div2 * * * * * ...
2021/08/01
[ "https://Stackoverflow.com/questions/68610235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5626375/" ]
You can pass `gok` as a parameter to avoid global variables. The problem is: When you take the input again: `int(input("try again. type your guess and press enter."))`, you don't assign the value to anything. So `gok` remains the same and it is always bigger or smaller ``` import random print("this is a game made b...
You could use this. It keeps asking until you type the correct number. ``` import random print("this is a game made by Sven") print("you're supposed to guess the right number. it is between 0 & 101.") print("lucky for you, you're getting hints.") print("succes!") rightnumber = random.randint(1, 100) print(rightnumbe...
13,519,205
let us assume, * I have a vector t with the times in seconds of my samples. (These samples are not equally distributed on the time domain. * Also I have a vector data containing the samplevalues at the time t. * t and data have the same length. If I plot the graph some sort of periodical signal is obtained. now I c...
2012/11/22
[ "https://Stackoverflow.com/questions/13519205", "https://Stackoverflow.com", "https://Stackoverflow.com/users/506617/" ]
You can resample or interpolate your sample points to get another set of sample points that are equally spaced in t. The chosen spacing or sample rate of the second set of equally spaced sample points will allow you to infer frequencies to the result of an FFT of that second set. The results may be noisy or include al...
**[Not the OP's intention]**: FFT will give you the spectrum (global) for any number of input data points. You cannot have a specific data point (in time) associated with parts (or the full) spectrum. What you can do instead is use [spectrogram](http://www.mathworks.com/help/signal/ref/spectrogram.html) and obtain the...
63,212,178
I am using this program to modify every vowel in text.txt to become the hashtag ('#') ``` #include <fstream> #include <iostream> int main() { std::fstream iofile{ "text.txt", std::ios::in | std::ios::out }; char chChar; while (iofile.get(chChar)) { switch (chChar) { case 'a':...
2020/08/02
[ "https://Stackoverflow.com/questions/63212178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12715123/" ]
Design the packet so that it includes the length of the strings before the string contents. Then you know where that string ends in your packet and the next piece of data begins. You can study for example how [.torrent files for BitTorrent](https://fileformats.fandom.com/wiki/Torrent_file) are formatted. Designing a s...
Replace any instances of `\` in the user's message with `\\`. Then replace `)` with `\)`. When you check for the `)` make sure that there isn't a `\` before it. When displaying the message to the user remove all `\`s that aren't processed by another `\`.
63,212,178
I am using this program to modify every vowel in text.txt to become the hashtag ('#') ``` #include <fstream> #include <iostream> int main() { std::fstream iofile{ "text.txt", std::ios::in | std::ios::out }; char chChar; while (iofile.get(chChar)) { switch (chChar) { case 'a':...
2020/08/02
[ "https://Stackoverflow.com/questions/63212178", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12715123/" ]
Design the packet so that it includes the length of the strings before the string contents. Then you know where that string ends in your packet and the next piece of data begins. You can study for example how [.torrent files for BitTorrent](https://fileformats.fandom.com/wiki/Torrent_file) are formatted. Designing a s...
I think client-side must send byte[] instead of String. And Packet must by POJO which must be serialized/deserialized in process of communication.
16,530,467
I am working on a script with tkinter, but something weird is happening. I have two radioButtons: ``` way=False RadioButton0=Radiobutton(root,text="From",variable=way,value=False) RadioButton1=Radiobutton(root,text="To",variable=way,value=True) RadioButton0.grid(column=0,row=2) RadioButton1.grid(column=1,row=2) ``` ...
2013/05/13
[ "https://Stackoverflow.com/questions/16530467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1901114/" ]
you can use a command to call a method and set the value. Please refer attached code. ``` def sel(): selection = "You selected the option " + str(var.get()) label.config(text = selection) root = Tk() frame = Frame(root) frame.pack() labelframe = LabelFrame(frame, text="This is a LabelFrame") labelframe.pack(f...
`variable` and `textvariable` should be both different [variable objects](http://effbot.org/tkinterbook/variable.htm), not just built-in data types: ``` way=BooleanVar(root) way.set(False) # ... entryValue=StringVar(root) entryValue.set("0") ```
456,775
In Vim, with ``` C-W = ``` the windows are auto resized to the same height. In tmux, with ``` :resize-pane -U 10 ``` I can increment the height of tmux pane in 10. How I can auto resize the panes to the same height?
2012/08/02
[ "https://superuser.com/questions/456775", "https://superuser.com", "https://superuser.com/users/30535/" ]
I suggest resizing multiple panes with one of the five tmux presets: ``` C-b M-1 # vertical split, all panes same width C-b M-2 # horizontal split, all panes same height C-b M-3 # horizontal split, main pane on top, other panes on bottom, vertically split, all ...
`PREFIX Space` is shortcut for :next-layout
8,903,313
I have an html page with divs that have **id**(s) of the form **s1**, **s2** and so on. ``` <div id="sections"> <div id="s1">...</div> <div id="s2">...</div> ... </div> ``` I want to apply a css property to a subset of these sections/divs (depending upon the id). However, every time I add a **div**, I have...
2012/01/17
[ "https://Stackoverflow.com/questions/8903313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/752920/" ]
As complement of [this answer](https://stackoverflow.com/a/8903451/6484286) you can use `$` to get the end matches and `*` to get matches anywhere in the value name. Matches anywhere: `.col-md`, `.left-col`, `.col`, `.tricolor`, etc. ``` [class*="col"] ``` Matches at the beginning: `.col-md`, `.col-sm-6`, etc. ```...
An ID is meant to identify the element *uniquely*. Any styles applied to it should also be unique to that element. If you have styles you want to apply to *many* elements, you should add a class to them all, rather than relying on ID selectors... ``` <div id="sections"> <div id="s1" class="sec">...</div> <div id...
8,903,313
I have an html page with divs that have **id**(s) of the form **s1**, **s2** and so on. ``` <div id="sections"> <div id="s1">...</div> <div id="s2">...</div> ... </div> ``` I want to apply a css property to a subset of these sections/divs (depending upon the id). However, every time I add a **div**, I have...
2012/01/17
[ "https://Stackoverflow.com/questions/8903313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/752920/" ]
You can' just add a class to each of your DIVs and apply the rule to the class in this way: HTML: ``` <div class="myclass" id="s1">...</div> <div class="myclass" id="s2">...</div> ``` CSS: ``` //css .myclass { ... } ```
I usually use `*` when I want to get all the strings that contain the wanted characters. `*` used in regex, replaces all characters. Used in SASS or CSS would be something like `[id*="s"]` and it will get all DOM elements with id "s......". ``` /* add red color to all div with id s .... elements */ div[id^="s"] {...
8,903,313
I have an html page with divs that have **id**(s) of the form **s1**, **s2** and so on. ``` <div id="sections"> <div id="s1">...</div> <div id="s2">...</div> ... </div> ``` I want to apply a css property to a subset of these sections/divs (depending upon the id). However, every time I add a **div**, I have...
2012/01/17
[ "https://Stackoverflow.com/questions/8903313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/752920/" ]
As complement of [this answer](https://stackoverflow.com/a/8903451/6484286) you can use `$` to get the end matches and `*` to get matches anywhere in the value name. Matches anywhere: `.col-md`, `.left-col`, `.col`, `.tricolor`, etc. ``` [class*="col"] ``` Matches at the beginning: `.col-md`, `.col-sm-6`, etc. ```...
First of all, there are many, many ways of matching items within a HTML document. Start with this reference to see some of the available selectors/patterns which you can use to apply a style rule to an element(s). <http://www.w3.org/TR/selectors/> Match all `div`s which are direct descendants of `#main`. ``` #main >...
8,903,313
I have an html page with divs that have **id**(s) of the form **s1**, **s2** and so on. ``` <div id="sections"> <div id="s1">...</div> <div id="s2">...</div> ... </div> ``` I want to apply a css property to a subset of these sections/divs (depending upon the id). However, every time I add a **div**, I have...
2012/01/17
[ "https://Stackoverflow.com/questions/8903313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/752920/" ]
You can manage selecting those elements without any form of regex as the previous answers show, but to answer the question directly, yes you can use a form of regex in selectors: ```css #sections div[id^='s'] { color: red; } ``` ```html <div id="sections"> <div id="s1">one</div> <div id="s2">two</div> <div id...
I usually use `*` when I want to get all the strings that contain the wanted characters. `*` used in regex, replaces all characters. Used in SASS or CSS would be something like `[id*="s"]` and it will get all DOM elements with id "s......". ``` /* add red color to all div with id s .... elements */ div[id^="s"] {...
8,903,313
I have an html page with divs that have **id**(s) of the form **s1**, **s2** and so on. ``` <div id="sections"> <div id="s1">...</div> <div id="s2">...</div> ... </div> ``` I want to apply a css property to a subset of these sections/divs (depending upon the id). However, every time I add a **div**, I have...
2012/01/17
[ "https://Stackoverflow.com/questions/8903313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/752920/" ]
As complement of [this answer](https://stackoverflow.com/a/8903451/6484286) you can use `$` to get the end matches and `*` to get matches anywhere in the value name. Matches anywhere: `.col-md`, `.left-col`, `.col`, `.tricolor`, etc. ``` [class*="col"] ``` Matches at the beginning: `.col-md`, `.col-sm-6`, etc. ```...
You can' just add a class to each of your DIVs and apply the rule to the class in this way: HTML: ``` <div class="myclass" id="s1">...</div> <div class="myclass" id="s2">...</div> ``` CSS: ``` //css .myclass { ... } ```
8,903,313
I have an html page with divs that have **id**(s) of the form **s1**, **s2** and so on. ``` <div id="sections"> <div id="s1">...</div> <div id="s2">...</div> ... </div> ``` I want to apply a css property to a subset of these sections/divs (depending upon the id). However, every time I add a **div**, I have...
2012/01/17
[ "https://Stackoverflow.com/questions/8903313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/752920/" ]
An ID is meant to identify the element *uniquely*. Any styles applied to it should also be unique to that element. If you have styles you want to apply to *many* elements, you should add a class to them all, rather than relying on ID selectors... ``` <div id="sections"> <div id="s1" class="sec">...</div> <div id...
I usually use `*` when I want to get all the strings that contain the wanted characters. `*` used in regex, replaces all characters. Used in SASS or CSS would be something like `[id*="s"]` and it will get all DOM elements with id "s......". ``` /* add red color to all div with id s .... elements */ div[id^="s"] {...
8,903,313
I have an html page with divs that have **id**(s) of the form **s1**, **s2** and so on. ``` <div id="sections"> <div id="s1">...</div> <div id="s2">...</div> ... </div> ``` I want to apply a css property to a subset of these sections/divs (depending upon the id). However, every time I add a **div**, I have...
2012/01/17
[ "https://Stackoverflow.com/questions/8903313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/752920/" ]
You can manage selecting those elements without any form of regex as the previous answers show, but to answer the question directly, yes you can use a form of regex in selectors: ```css #sections div[id^='s'] { color: red; } ``` ```html <div id="sections"> <div id="s1">one</div> <div id="s2">two</div> <div id...
First of all, there are many, many ways of matching items within a HTML document. Start with this reference to see some of the available selectors/patterns which you can use to apply a style rule to an element(s). <http://www.w3.org/TR/selectors/> Match all `div`s which are direct descendants of `#main`. ``` #main >...
8,903,313
I have an html page with divs that have **id**(s) of the form **s1**, **s2** and so on. ``` <div id="sections"> <div id="s1">...</div> <div id="s2">...</div> ... </div> ``` I want to apply a css property to a subset of these sections/divs (depending upon the id). However, every time I add a **div**, I have...
2012/01/17
[ "https://Stackoverflow.com/questions/8903313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/752920/" ]
An ID is meant to identify the element *uniquely*. Any styles applied to it should also be unique to that element. If you have styles you want to apply to *many* elements, you should add a class to them all, rather than relying on ID selectors... ``` <div id="sections"> <div id="s1" class="sec">...</div> <div id...
First of all, there are many, many ways of matching items within a HTML document. Start with this reference to see some of the available selectors/patterns which you can use to apply a style rule to an element(s). <http://www.w3.org/TR/selectors/> Match all `div`s which are direct descendants of `#main`. ``` #main >...
8,903,313
I have an html page with divs that have **id**(s) of the form **s1**, **s2** and so on. ``` <div id="sections"> <div id="s1">...</div> <div id="s2">...</div> ... </div> ``` I want to apply a css property to a subset of these sections/divs (depending upon the id). However, every time I add a **div**, I have...
2012/01/17
[ "https://Stackoverflow.com/questions/8903313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/752920/" ]
You can manage selecting those elements without any form of regex as the previous answers show, but to answer the question directly, yes you can use a form of regex in selectors: ```css #sections div[id^='s'] { color: red; } ``` ```html <div id="sections"> <div id="s1">one</div> <div id="s2">two</div> <div id...
You can' just add a class to each of your DIVs and apply the rule to the class in this way: HTML: ``` <div class="myclass" id="s1">...</div> <div class="myclass" id="s2">...</div> ``` CSS: ``` //css .myclass { ... } ```
8,903,313
I have an html page with divs that have **id**(s) of the form **s1**, **s2** and so on. ``` <div id="sections"> <div id="s1">...</div> <div id="s2">...</div> ... </div> ``` I want to apply a css property to a subset of these sections/divs (depending upon the id). However, every time I add a **div**, I have...
2012/01/17
[ "https://Stackoverflow.com/questions/8903313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/752920/" ]
You can manage selecting those elements without any form of regex as the previous answers show, but to answer the question directly, yes you can use a form of regex in selectors: ```css #sections div[id^='s'] { color: red; } ``` ```html <div id="sections"> <div id="s1">one</div> <div id="s2">two</div> <div id...
As complement of [this answer](https://stackoverflow.com/a/8903451/6484286) you can use `$` to get the end matches and `*` to get matches anywhere in the value name. Matches anywhere: `.col-md`, `.left-col`, `.col`, `.tricolor`, etc. ``` [class*="col"] ``` Matches at the beginning: `.col-md`, `.col-sm-6`, etc. ```...
1,637,764
Let $P(A) = 0.4$ and $P(B) = 0.7$. Show that $P(A\cap B)$ is such that $0.1 <P(A\cap B) < 0.4$. However, we have to do this without making any more assumptions about $A$ or $B$. I'm not sure how to bound the probability without assuming anything new.
2016/02/02
[ "https://math.stackexchange.com/questions/1637764", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Hints: $1\ge P(A\cup B)=P(A)+P(B)-P(A\cap B)$. $P(A\cap B)\le P(A)$
Hint 1: The measure of the *intersection* of two events cannot be greater than the measure of the smallest event. > > $$\mathsf P(A\cap B) \;\leq\; \min\{\mathsf P(A), \mathsf P(B)\}$$ > > > Hint 2: The measure of their *union* cannot be greater than one. > > $$\mathsf P(A)+\mathsf P(B)-\mathsf P(A\cap B)\;\leq...
1,637,764
Let $P(A) = 0.4$ and $P(B) = 0.7$. Show that $P(A\cap B)$ is such that $0.1 <P(A\cap B) < 0.4$. However, we have to do this without making any more assumptions about $A$ or $B$. I'm not sure how to bound the probability without assuming anything new.
2016/02/02
[ "https://math.stackexchange.com/questions/1637764", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
**Hint** $$A\cap B\subset A$$ and $$1\geq p(A\cup B)=p(A)+p(B)-p(A\cap B)$$
Hint 1: The measure of the *intersection* of two events cannot be greater than the measure of the smallest event. > > $$\mathsf P(A\cap B) \;\leq\; \min\{\mathsf P(A), \mathsf P(B)\}$$ > > > Hint 2: The measure of their *union* cannot be greater than one. > > $$\mathsf P(A)+\mathsf P(B)-\mathsf P(A\cap B)\;\leq...
47,252,703
Adding crud forms manually is very painful for me. Is laravel a good way to do this?
2017/11/12
[ "https://Stackoverflow.com/questions/47252703", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4699606/" ]
Add `@EnableJPARepositories` to your `Application`
try commenting out the *@Transactional* annotation ``` //@Transactional public interface PaymentDao extends CrudRepository<Payment, Long> { } ```
47,252,703
Adding crud forms manually is very painful for me. Is laravel a good way to do this?
2017/11/12
[ "https://Stackoverflow.com/questions/47252703", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4699606/" ]
Add `@EnableJPARepositories` to your `Application`
This is the application.property file infomation ``` spring.mysql.datasource.url=jdbc:mysql://localhost:3306/testDB spring.mysql.datasource.username=test spring.mysql.datasource.password=test spring.mysql.datasource.driver-class-name=com.mysql.jdbc.Driver ``` This is the java based configuration ``...
47,252,703
Adding crud forms manually is very painful for me. Is laravel a good way to do this?
2017/11/12
[ "https://Stackoverflow.com/questions/47252703", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4699606/" ]
try commenting out the *@Transactional* annotation ``` //@Transactional public interface PaymentDao extends CrudRepository<Payment, Long> { } ```
This is the application.property file infomation ``` spring.mysql.datasource.url=jdbc:mysql://localhost:3306/testDB spring.mysql.datasource.username=test spring.mysql.datasource.password=test spring.mysql.datasource.driver-class-name=com.mysql.jdbc.Driver ``` This is the java based configuration ``...
12,171,252
I want to show hidden span when button is click. My html looks like: ``` <ul> <li> <span class="sfFormlabel" style="display:none" >show</span> <div id="div1"> <input type="button" value="show" class="show"> </div> </li> <li> <span class="sfFormlabel" style="dis...
2012/08/29
[ "https://Stackoverflow.com/questions/12171252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/965146/" ]
You need to use `.parents` or `.closest` instead of `.parent`. ``` $(this).parents('li').children('span').show(); ``` Or ``` $(this).closest('li').children('span').show(); ``` ***PS:*** `.live` is is deprecated, use `.on` instead.
Here's an easy solution: ``` $(document).ready(function() { $("#about").css("background-color","#222222"); $('.show').live("click", function () { alert('test'); $('.sfFormlabel').show(); }); }); ```
50,957,861
``` import requests import re from bs4 import BeautifulSoup #The website I like to get, converts the contents of the web page to lxml format base_url = "https://festivalfans.nl/event/dominator-festival" url = requests.get(base_url) soup = BeautifulSoup(url.content, "lxml") #Modifies the given string to look visually ...
2018/06/20
[ "https://Stackoverflow.com/questions/50957861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8885661/" ]
You forgot to return the value in the `remove_char()` function. That's it!
Neither of your functions has a `return` statement, and so return `None` by default. `remove_char()` should end with `return string` for example.
50,957,861
``` import requests import re from bs4 import BeautifulSoup #The website I like to get, converts the contents of the web page to lxml format base_url = "https://festivalfans.nl/event/dominator-festival" url = requests.get(base_url) soup = BeautifulSoup(url.content, "lxml") #Modifies the given string to look visually ...
2018/06/20
[ "https://Stackoverflow.com/questions/50957861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8885661/" ]
You forgot to return the value in the `remove_char()` function. That's it!
``` import requests from bs4 import BeautifulSoup base_url = "https://festivalfans.nl/event/dominator-festival" url = requests.get(base_url) soup = BeautifulSoup(url.content , "html.parser") def get_date_info(): for link in soup.find_all("div", {"class": "event-single-data"}): day = link.find('div', {"c...
18,692,536
In the Node docs, [http servers appear to have a close event](http://nodejs.org/api/http.html#http_event_close): > > Event: 'close' > -------------- > > > `function () { }` > > > Emitted when the server closes. > > > But I can't figure out how to trigger it: ``` // server.js var http = require('http'); var ...
2013/09/09
[ "https://Stackoverflow.com/questions/18692536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/824377/" ]
Killing the server with `Ctrl+C` doesn't allow the server to close itself; you have to do this yourself. Something like this should do the trick (on UNIX-like systems): ``` var http = require('http'); var server = http.createServer(); server.on('close', function() { console.log(' Stopping ...'); }); process.on('SIG...
You added an event handler for `close`. Use `server.close();` to trigger the server event.
18,692,536
In the Node docs, [http servers appear to have a close event](http://nodejs.org/api/http.html#http_event_close): > > Event: 'close' > -------------- > > > `function () { }` > > > Emitted when the server closes. > > > But I can't figure out how to trigger it: ``` // server.js var http = require('http'); var ...
2013/09/09
[ "https://Stackoverflow.com/questions/18692536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/824377/" ]
Killing the server with `Ctrl+C` doesn't allow the server to close itself; you have to do this yourself. Something like this should do the trick (on UNIX-like systems): ``` var http = require('http'); var server = http.createServer(); server.on('close', function() { console.log(' Stopping ...'); }); process.on('SIG...
Below is the snapshot , notice that i am closing the server after 2 seconds at last, so the event 'close' listener will perform callback function soon after. [![enter image description here](https://i.stack.imgur.com/63B60.png)](https://i.stack.imgur.com/63B60.png) **Incase you want code snippet:** ``` const http = r...
18,692,536
In the Node docs, [http servers appear to have a close event](http://nodejs.org/api/http.html#http_event_close): > > Event: 'close' > -------------- > > > `function () { }` > > > Emitted when the server closes. > > > But I can't figure out how to trigger it: ``` // server.js var http = require('http'); var ...
2013/09/09
[ "https://Stackoverflow.com/questions/18692536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/824377/" ]
Killing the server with `Ctrl+C` doesn't allow the server to close itself; you have to do this yourself. Something like this should do the trick (on UNIX-like systems): ``` var http = require('http'); var server = http.createServer(); server.on('close', function() { console.log(' Stopping ...'); }); process.on('SIG...
The server doesn't seem to fire any kind of `close`/`finish`/`terminate` event despite what is claimed in the doc. The workaround I found is to listen to the termination of the node process. ``` let wasCleanedUp = false; const runBeforeExiting = (fun: Function) => { const exitSignals = ['exit', 'SIGINT', 'SIGUSR1',...
18,692,536
In the Node docs, [http servers appear to have a close event](http://nodejs.org/api/http.html#http_event_close): > > Event: 'close' > -------------- > > > `function () { }` > > > Emitted when the server closes. > > > But I can't figure out how to trigger it: ``` // server.js var http = require('http'); var ...
2013/09/09
[ "https://Stackoverflow.com/questions/18692536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/824377/" ]
You added an event handler for `close`. Use `server.close();` to trigger the server event.
Below is the snapshot , notice that i am closing the server after 2 seconds at last, so the event 'close' listener will perform callback function soon after. [![enter image description here](https://i.stack.imgur.com/63B60.png)](https://i.stack.imgur.com/63B60.png) **Incase you want code snippet:** ``` const http = r...
18,692,536
In the Node docs, [http servers appear to have a close event](http://nodejs.org/api/http.html#http_event_close): > > Event: 'close' > -------------- > > > `function () { }` > > > Emitted when the server closes. > > > But I can't figure out how to trigger it: ``` // server.js var http = require('http'); var ...
2013/09/09
[ "https://Stackoverflow.com/questions/18692536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/824377/" ]
You added an event handler for `close`. Use `server.close();` to trigger the server event.
The server doesn't seem to fire any kind of `close`/`finish`/`terminate` event despite what is claimed in the doc. The workaround I found is to listen to the termination of the node process. ``` let wasCleanedUp = false; const runBeforeExiting = (fun: Function) => { const exitSignals = ['exit', 'SIGINT', 'SIGUSR1',...
19,281,327
I'm new to programing and I was playing with python what I've so far learnt form the tutorial that was where I encounter with an Error. I'd like to know what it means by the **syntax Error: can't assign to literal** and how to understand/ read the message so that the next time I can solve it myself. It's not that I don...
2013/10/09
[ "https://Stackoverflow.com/questions/19281327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2856873/" ]
This means that you're trying to assign a value to a literal (colloquially, something other than a variable). For example: ``` x = 1 # This is fine, x is a variable 1 = 1 # This fails, as 1 is a value, not a variable "abcd" = 1 # This also fails, as "abcd" is a string literal ```
A string is a literal; so are numbers. You can assign values to a variable (give them a name), but you can't change the value of a string, e. g.: ``` >>> a = "Hello" # OK >>> "Hello" = a # Not OK File "<stdin>", line 1 SyntaxError: can't assign to literal >>> 1 = 0 File "<stdin>", line 1 SyntaxError: can't ass...
19,281,327
I'm new to programing and I was playing with python what I've so far learnt form the tutorial that was where I encounter with an Error. I'd like to know what it means by the **syntax Error: can't assign to literal** and how to understand/ read the message so that the next time I can solve it myself. It's not that I don...
2013/10/09
[ "https://Stackoverflow.com/questions/19281327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2856873/" ]
That error is generated when you try to make a variable out of a literal. See examples below: ``` >>> 1 = 'a' File "<stdin>", line 1 SyntaxError: can't assign to literal >>> 'a' = 'a' File "<stdin>", line 1 SyntaxError: can't assign to literal >>> 1.0 = 'a' File "<stdin>", line 1 SyntaxError: can't assign to lit...
A string is a literal; so are numbers. You can assign values to a variable (give them a name), but you can't change the value of a string, e. g.: ``` >>> a = "Hello" # OK >>> "Hello" = a # Not OK File "<stdin>", line 1 SyntaxError: can't assign to literal >>> 1 = 0 File "<stdin>", line 1 SyntaxError: can't ass...
19,281,327
I'm new to programing and I was playing with python what I've so far learnt form the tutorial that was where I encounter with an Error. I'd like to know what it means by the **syntax Error: can't assign to literal** and how to understand/ read the message so that the next time I can solve it myself. It's not that I don...
2013/10/09
[ "https://Stackoverflow.com/questions/19281327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2856873/" ]
You probably meant "==", which compares for equality. ``` >>> 1==1 True ``` A single equal sign means assignment, which roughly means to *change* what's to the left of the sign to match what's to the right. Trying to change a constant returns an error.
A string is a literal; so are numbers. You can assign values to a variable (give them a name), but you can't change the value of a string, e. g.: ``` >>> a = "Hello" # OK >>> "Hello" = a # Not OK File "<stdin>", line 1 SyntaxError: can't assign to literal >>> 1 = 0 File "<stdin>", line 1 SyntaxError: can't ass...
19,281,327
I'm new to programing and I was playing with python what I've so far learnt form the tutorial that was where I encounter with an Error. I'd like to know what it means by the **syntax Error: can't assign to literal** and how to understand/ read the message so that the next time I can solve it myself. It's not that I don...
2013/10/09
[ "https://Stackoverflow.com/questions/19281327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2856873/" ]
That error is generated when you try to make a variable out of a literal. See examples below: ``` >>> 1 = 'a' File "<stdin>", line 1 SyntaxError: can't assign to literal >>> 'a' = 'a' File "<stdin>", line 1 SyntaxError: can't assign to literal >>> 1.0 = 'a' File "<stdin>", line 1 SyntaxError: can't assign to lit...
This means that you're trying to assign a value to a literal (colloquially, something other than a variable). For example: ``` x = 1 # This is fine, x is a variable 1 = 1 # This fails, as 1 is a value, not a variable "abcd" = 1 # This also fails, as "abcd" is a string literal ```
19,281,327
I'm new to programing and I was playing with python what I've so far learnt form the tutorial that was where I encounter with an Error. I'd like to know what it means by the **syntax Error: can't assign to literal** and how to understand/ read the message so that the next time I can solve it myself. It's not that I don...
2013/10/09
[ "https://Stackoverflow.com/questions/19281327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2856873/" ]
You probably meant "==", which compares for equality. ``` >>> 1==1 True ``` A single equal sign means assignment, which roughly means to *change* what's to the left of the sign to match what's to the right. Trying to change a constant returns an error.
This means that you're trying to assign a value to a literal (colloquially, something other than a variable). For example: ``` x = 1 # This is fine, x is a variable 1 = 1 # This fails, as 1 is a value, not a variable "abcd" = 1 # This also fails, as "abcd" is a string literal ```
19,281,327
I'm new to programing and I was playing with python what I've so far learnt form the tutorial that was where I encounter with an Error. I'd like to know what it means by the **syntax Error: can't assign to literal** and how to understand/ read the message so that the next time I can solve it myself. It's not that I don...
2013/10/09
[ "https://Stackoverflow.com/questions/19281327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2856873/" ]
You probably meant "==", which compares for equality. ``` >>> 1==1 True ``` A single equal sign means assignment, which roughly means to *change* what's to the left of the sign to match what's to the right. Trying to change a constant returns an error.
That error is generated when you try to make a variable out of a literal. See examples below: ``` >>> 1 = 'a' File "<stdin>", line 1 SyntaxError: can't assign to literal >>> 'a' = 'a' File "<stdin>", line 1 SyntaxError: can't assign to literal >>> 1.0 = 'a' File "<stdin>", line 1 SyntaxError: can't assign to lit...
27,929,246
I'm working on a project that will need an Save/load function. I'm looking at two possible ways: * Make my own functions that do the saving/loading => making my 'own' filestructure to keep everything in place (much much work) * use serialization of some kind In my current test project I implemented serialization, but...
2015/01/13
[ "https://Stackoverflow.com/questions/27929246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4253336/" ]
The simplest method I've had reasonable long-term results with is to enforce (now and forever) your own contract that every class has at least a Version property, which when combined with the type gives you a unique identifier to later tell you how to deserialize to an object. You may also want to create objects from d...
You need to develop your Data Access you receive xml from your stored procedures and stream into your objects through your DAL. Then take your stored procedure xml data and serializes it into the object. Dim obj as New YourObjectType obj = ConvertFromXml(xml.ToString(), GetType(YourObjectType) ,System.Text.Encoding.U...
67,141,890
``` electron-forge make results in Error: Could not find any make targets configured for the "win32" platform. with command: PS E:\VStudio\20210417> npm run make2 > 20210417@1.0.0 make2 > electron-forge make ✔ Checking your system ✔ Resolving Forge Config We need to package your application before we can make it ✔ P...
2021/04/17
[ "https://Stackoverflow.com/questions/67141890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15104613/" ]
It worked for me by removing and reinstalling the dependencies ``` npm install --save-dev @electron-forge/cli npx electron-forge import ```
In my case, the problem was due to missing the `makers` configuration in my `forge.config.js` since I opted for using that instead of another property in the package.json. When you run the `electron-forge import` command, it ends up configuring a bunch of makers: ``` makers: [ { name: "@electron-forge/mak...
7,930,447
I have used [this question](https://stackoverflow.com/questions/32404/can-i-run-a-python-script-as-a-service-in-windows-how) to learn install my python script as a service with ActivePython. I am able to install my script and remove it, as I would expect, but my problem is that once I start the script running, I then l...
2011/10/28
[ "https://Stackoverflow.com/questions/7930447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/702948/" ]
Of course you can't stop it, you're stuck in an infinite loop. Replace: ``` time.sleep(5) ``` with this: ``` if win32event.WaitForSingleObject(self.hWaitStop, 5000) == win32event.WAIT_OBJECT_0: break ``` Should do the trick.
"Checking a flag" means having the script (inside the while True loop) look for something, almost anything, as a signal to break out of the loop. It could check for the existence of a file with a particular name and exit when the file is created. As long as you can manually or through a control application create the s...
67,715,749
I am new to VB.NET. My questions is I have a textbox and input data to database ```html <asp:TextBox ID="txt_hello" runat="server" Width="130px"></asp:TextBox></td> ``` and then I can connect to database but when I input the 'hello' in column and submit, it will pop up the errror message: > > 'txt\_hello' is not...
2021/05/27
[ "https://Stackoverflow.com/questions/67715749", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15776192/" ]
Never concatenate strings to build sql strings. Always use parematers. The `Using...End Using` block assures that the connection is closed and disposed and the command is disposed. ``` Dim sql As String If Condition1 Then sql = "UPDATE SomeTableName SET Hello= @Hello;" ElseIf Condition2 Then ...
You have to use : ``` txt_hello.Text ``` `txt_hello` is a control (TextBox), not a string. Its `Text` property is string.
654,433
This is the message that **Putty/Kitty** yields when connecting via **SSH** to my old Buffalo WHR-HP-G54N router: > > The first key-exchange algorithm supported by the server is > [Whatever]`, which is below the configured warning > threshold. Do you want to continue with this connection? > > > I know how to conf...
2021/06/15
[ "https://unix.stackexchange.com/questions/654433", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/57439/" ]
Depending on the exact situation there are two ways to tackle this. That said: comfort comes at the expense of security, obviously. But with a router like that you have limited options anyway. The package `openssh-client-ssh1` allows to connect to the deprecated SSH v1 protocol. But obviously you have to use `ssh1` in...
There's no functionality in OpenSSH to ask the user interactively like this. Your best alternative is to write a stanza in `~/.ssh/config` matching the hosts you want to use this key-exchange with, and update it each time you find a server that needs to be added. That would be something like ``` Host old-machine-1 o...
6,787,100
My application have 10 activities. Every activity contains one button.if you click on that button then all activities will be finished(it means like Logout in gmail). Here i am using 2 steps. But it's not working. 1. Clear the stack using intent.addFlags(Intent.FLAG\_ACTIVITY\_CLEAR\_TOP) for every activity calling. 2....
2011/07/22
[ "https://Stackoverflow.com/questions/6787100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/840090/" ]
If you don't need to be back when pressing the back button,you can call finish() right after calling the intent to go another activity.So current activity is finished.So you have to finish only the last activity where you are in. If you call welcome form login like ``` startActivity(login.this,welcome.class); finish(...
use FLAG\_ACTIVITY\_CLEAR\_TOP intent flag while calling each new activity.. so what it does is it clears all the top activities and starts this new activity...now if you'll close the current activity using finish()..it'll get closed and because of FLAG\_ACTIVITY\_CLEAR\_TOP all the others have been already closed... ...
25,340
So, this race of Wussname are a peaceful people. Each and everyone of them possess this weird ability of sympathy that allows them synchronize their emotions and share their knowledge with other each within a short range of a hundred meters or so. Their warriors are not as numerous as mine. At their best, I still outnu...
2015/09/09
[ "https://worldbuilding.stackexchange.com/questions/25340", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/10003/" ]
Using the right tactical approach, this shouldn't be much of a problem, if you are superior to them in numbers and military supplies. **Method 1** Attack them on 3 sides at once! You are dividing their already-less-than-half forces into three. Now, here is the trick. You attack them with 1/6th of your entire force f...
How evil are you ? ------------------ Genocide can be a hassle, as the population is rarely cooperative, and the gains are never enough to cover the expenses of such vast project. Fortunately, the human cruelty is nearly infinite, and this hasn't stopped many powerful leaders and sharp mind to spend countless time and...
25,340
So, this race of Wussname are a peaceful people. Each and everyone of them possess this weird ability of sympathy that allows them synchronize their emotions and share their knowledge with other each within a short range of a hundred meters or so. Their warriors are not as numerous as mine. At their best, I still outnu...
2015/09/09
[ "https://worldbuilding.stackexchange.com/questions/25340", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/10003/" ]
The question states that "their warriors are significantly more skilled since they could share fighting experience. I estimated that one of them could potentially kill 2.7 of mine.". However in battle I'm not sure that would actually work to their advantage. One battle has joined, a psychic range of 100 meters will me...
Many armies have Buglers and Drummers to sound maneuvers. You can use the wailing of torture victims! Since the send/receive telepathy of these guys is really on shared within their own race, you need them broadcasting the most horrific stuff during a battle. Step one, capture some. You need about 1 captured for eve...
25,340
So, this race of Wussname are a peaceful people. Each and everyone of them possess this weird ability of sympathy that allows them synchronize their emotions and share their knowledge with other each within a short range of a hundred meters or so. Their warriors are not as numerous as mine. At their best, I still outnu...
2015/09/09
[ "https://worldbuilding.stackexchange.com/questions/25340", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/10003/" ]
**Unpredictable actions** Their psychic power is indeed a great power, and should help them to organize quickly to any form of conventional strategies. But if you launch different undersized and oversized assault, it is possible to make even the greatest leader to doubt. You have dragons, you don't want to use them, s...
Well, first thing's first, I wouldn't do this while you have another war going on unless absolutely necessary. One of Hitler's biggest blunders was declaring war on Russia (who prior to the war, saw Britian as a bigger threat than Germany and was content to not help the British and had treaties to avoid conflict with G...
25,340
So, this race of Wussname are a peaceful people. Each and everyone of them possess this weird ability of sympathy that allows them synchronize their emotions and share their knowledge with other each within a short range of a hundred meters or so. Their warriors are not as numerous as mine. At their best, I still outnu...
2015/09/09
[ "https://worldbuilding.stackexchange.com/questions/25340", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/10003/" ]
The question states that "their warriors are significantly more skilled since they could share fighting experience. I estimated that one of them could potentially kill 2.7 of mine.". However in battle I'm not sure that would actually work to their advantage. One battle has joined, a psychic range of 100 meters will me...
Assuming that they are unable to turn their "sympathy field" off, a less subtle torture tactic becomes possible. Stage a few raids to capture as many prisoners as possible, and then build whatever equipment is necessary for your torturers to be able to perform their duties while on the move. The idea being that any of ...
25,340
So, this race of Wussname are a peaceful people. Each and everyone of them possess this weird ability of sympathy that allows them synchronize their emotions and share their knowledge with other each within a short range of a hundred meters or so. Their warriors are not as numerous as mine. At their best, I still outnu...
2015/09/09
[ "https://worldbuilding.stackexchange.com/questions/25340", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/10003/" ]
I don't know what the terrain is like but since you're so evil why don't you just [burn them out](https://en.wikipedia.org/wiki/Scorched_earth)? You can start fires across the front and burn everything that can burn to the ground. You don't even need real soldiers for this. A couple soldiers can supervise a group of sl...
Well, first thing's first, I wouldn't do this while you have another war going on unless absolutely necessary. One of Hitler's biggest blunders was declaring war on Russia (who prior to the war, saw Britian as a bigger threat than Germany and was content to not help the British and had treaties to avoid conflict with G...
25,340
So, this race of Wussname are a peaceful people. Each and everyone of them possess this weird ability of sympathy that allows them synchronize their emotions and share their knowledge with other each within a short range of a hundred meters or so. Their warriors are not as numerous as mine. At their best, I still outnu...
2015/09/09
[ "https://worldbuilding.stackexchange.com/questions/25340", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/10003/" ]
I don't know what the terrain is like but since you're so evil why don't you just [burn them out](https://en.wikipedia.org/wiki/Scorched_earth)? You can start fires across the front and burn everything that can burn to the ground. You don't even need real soldiers for this. A couple soldiers can supervise a group of sl...
Assuming that they are unable to turn their "sympathy field" off, a less subtle torture tactic becomes possible. Stage a few raids to capture as many prisoners as possible, and then build whatever equipment is necessary for your torturers to be able to perform their duties while on the move. The idea being that any of ...
25,340
So, this race of Wussname are a peaceful people. Each and everyone of them possess this weird ability of sympathy that allows them synchronize their emotions and share their knowledge with other each within a short range of a hundred meters or so. Their warriors are not as numerous as mine. At their best, I still outnu...
2015/09/09
[ "https://worldbuilding.stackexchange.com/questions/25340", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/10003/" ]
**Physical Death** If you outnumber them four to one, just walk in and do whatever you want. Unless there's some kind of brilliant victory by General Wussname, you'll be able to just roll over them. Even if they manage to kill 2 of your troops for everyone one of theirs, you still have double the required troops to an...
Well, first thing's first, I wouldn't do this while you have another war going on unless absolutely necessary. One of Hitler's biggest blunders was declaring war on Russia (who prior to the war, saw Britian as a bigger threat than Germany and was content to not help the British and had treaties to avoid conflict with G...
25,340
So, this race of Wussname are a peaceful people. Each and everyone of them possess this weird ability of sympathy that allows them synchronize their emotions and share their knowledge with other each within a short range of a hundred meters or so. Their warriors are not as numerous as mine. At their best, I still outnu...
2015/09/09
[ "https://worldbuilding.stackexchange.com/questions/25340", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/10003/" ]
How evil are you ? ------------------ Genocide can be a hassle, as the population is rarely cooperative, and the gains are never enough to cover the expenses of such vast project. Fortunately, the human cruelty is nearly infinite, and this hasn't stopped many powerful leaders and sharp mind to spend countless time and...
Other answers have focused on how you might turn the psychic powers of your proposed race against them, but your edit suggests that torture is largely ineffective. My suggestion is to **work around their powers**, not try to make them backfire. The range of the psychic powers is about 100 meters. If you can separate ...
25,340
So, this race of Wussname are a peaceful people. Each and everyone of them possess this weird ability of sympathy that allows them synchronize their emotions and share their knowledge with other each within a short range of a hundred meters or so. Their warriors are not as numerous as mine. At their best, I still outnu...
2015/09/09
[ "https://worldbuilding.stackexchange.com/questions/25340", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/10003/" ]
How evil are you ? ------------------ Genocide can be a hassle, as the population is rarely cooperative, and the gains are never enough to cover the expenses of such vast project. Fortunately, the human cruelty is nearly infinite, and this hasn't stopped many powerful leaders and sharp mind to spend countless time and...
**Unpredictable actions** Their psychic power is indeed a great power, and should help them to organize quickly to any form of conventional strategies. But if you launch different undersized and oversized assault, it is possible to make even the greatest leader to doubt. You have dragons, you don't want to use them, s...
25,340
So, this race of Wussname are a peaceful people. Each and everyone of them possess this weird ability of sympathy that allows them synchronize their emotions and share their knowledge with other each within a short range of a hundred meters or so. Their warriors are not as numerous as mine. At their best, I still outnu...
2015/09/09
[ "https://worldbuilding.stackexchange.com/questions/25340", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/10003/" ]
How evil are you ? ------------------ Genocide can be a hassle, as the population is rarely cooperative, and the gains are never enough to cover the expenses of such vast project. Fortunately, the human cruelty is nearly infinite, and this hasn't stopped many powerful leaders and sharp mind to spend countless time and...
Assuming that they are unable to turn their "sympathy field" off, a less subtle torture tactic becomes possible. Stage a few raids to capture as many prisoners as possible, and then build whatever equipment is necessary for your torturers to be able to perform their duties while on the move. The idea being that any of ...
9,228,893
A div has a tilable background. The height of this div will depend on its content. I need the div to stretch by a multiple of the background image's size. For instance, the background is a 64x64 image. So, if the div's height is to increase, I want to do so by steps of 64px. Is this possible with CSS? I've not found ...
2012/02/10
[ "https://Stackoverflow.com/questions/9228893", "https://Stackoverflow.com", "https://Stackoverflow.com/users/987818/" ]
To my knowledge this cannot be done in CSS, but you could probably solve it with some javascript. If you have access to jQuery: ``` $(function() { $div = $('#the_div_id'); var remainder = $div.height() % 64; var newHeight = $div.height() + (64-remainder); $div.css('height', newHeight); }); ```
What is the content of the div? It sounds like rather than setting the size of the div to the correct value, you need to pay attention to the content - [this post](http://24ways.org/2006/compose-to-a-vertical-rhythm) details some pretty simple techniques to implement vertical rhythm, which should work (ie. by using a l...
9,228,893
A div has a tilable background. The height of this div will depend on its content. I need the div to stretch by a multiple of the background image's size. For instance, the background is a 64x64 image. So, if the div's height is to increase, I want to do so by steps of 64px. Is this possible with CSS? I've not found ...
2012/02/10
[ "https://Stackoverflow.com/questions/9228893", "https://Stackoverflow.com", "https://Stackoverflow.com/users/987818/" ]
To my knowledge this cannot be done in CSS, but you could probably solve it with some javascript. If you have access to jQuery: ``` $(function() { $div = $('#the_div_id'); var remainder = $div.height() % 64; var newHeight = $div.height() + (64-remainder); $div.css('height', newHeight); }); ```
One solution (depending on your specific case) could be to use the new `background-size` CSS property. I've left the declarations separate for clarity: ``` div.yourDiv { background-image: url('yourImage.jpg'); background-repeat: repeat; background-size: contain; } ``` Then, whatever the size of you `div`...
9,228,893
A div has a tilable background. The height of this div will depend on its content. I need the div to stretch by a multiple of the background image's size. For instance, the background is a 64x64 image. So, if the div's height is to increase, I want to do so by steps of 64px. Is this possible with CSS? I've not found ...
2012/02/10
[ "https://Stackoverflow.com/questions/9228893", "https://Stackoverflow.com", "https://Stackoverflow.com/users/987818/" ]
One solution (depending on your specific case) could be to use the new `background-size` CSS property. I've left the declarations separate for clarity: ``` div.yourDiv { background-image: url('yourImage.jpg'); background-repeat: repeat; background-size: contain; } ``` Then, whatever the size of you `div`...
What is the content of the div? It sounds like rather than setting the size of the div to the correct value, you need to pay attention to the content - [this post](http://24ways.org/2006/compose-to-a-vertical-rhythm) details some pretty simple techniques to implement vertical rhythm, which should work (ie. by using a l...
714,675
This is a situation I run into now and then: For an embedded system which does not use virtual addressing, I have an executable file that was compiled from C or C++ code with debugging information included. It's usually in COFF or ELF/DWARF (I get those two mixed up) format. At runtime, on a PC, I would like to deter...
2009/04/03
[ "https://Stackoverflow.com/questions/714675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44330/" ]
Does gdb support your target CPU? If yes, your program that implements the debugging protocol and talks to the target could also implement the [GDB Remote Serial Protocol](http://sourceware.org/gdb/current/onlinedocs/gdb_34.html#SEC721) and provide a TCP socket for gdb to communicate with. The arrangement would be so...
You could build a JNI interface to [GNU binutils](http://www.gnu.org/software/binutils/) compiled for your platform. However, if the GPL conflicts with your software's license, then this will not be a viable solution.
21,968,621
I have a problem. I add some png files to my project, in my root folder. I have a tabbar controller. On each view, I changed the title and the picture of each items. In my storyboard, images and title are well displayed. But when I launched the app on the simulator, titles and images are not set... I tried to clean /...
2014/02/23
[ "https://Stackoverflow.com/questions/21968621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3091955/" ]
I found the solution ! If it could be useful for someone... In the "copy bundle Ressources", the Main.storyboard wasn't here. I just added it, rebuild, run again, and all works !
I faced the same issue in my app, i replaced default tabbar buttons with custom buttons and gave background image to that with more easy customisation.
21,968,621
I have a problem. I add some png files to my project, in my root folder. I have a tabbar controller. On each view, I changed the title and the picture of each items. In my storyboard, images and title are well displayed. But when I launched the app on the simulator, titles and images are not set... I tried to clean /...
2014/02/23
[ "https://Stackoverflow.com/questions/21968621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3091955/" ]
I actually did not add images under Assests.xcassets. After I relocated images from other location in the project to Assests.xcassets, images are displayed correctly.
I faced the same issue in my app, i replaced default tabbar buttons with custom buttons and gave background image to that with more easy customisation.
21,968,621
I have a problem. I add some png files to my project, in my root folder. I have a tabbar controller. On each view, I changed the title and the picture of each items. In my storyboard, images and title are well displayed. But when I launched the app on the simulator, titles and images are not set... I tried to clean /...
2014/02/23
[ "https://Stackoverflow.com/questions/21968621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3091955/" ]
I found the solution ! If it could be useful for someone... In the "copy bundle Ressources", the Main.storyboard wasn't here. I just added it, rebuild, run again, and all works !
I actually did not add images under Assests.xcassets. After I relocated images from other location in the project to Assests.xcassets, images are displayed correctly.
4,898,167
I didn't find any answer in the API Documentation and also not in the SDK. If I use "/me/home" for example, I will get my news feed. The news feed contains entries from users, pages, apps, etc. But how do I know wheather an entry is from a user, page or app? In the output there is no information about the type. All en...
2011/02/04
[ "https://Stackoverflow.com/questions/4898167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/603167/" ]
I'd look at an NSOperationQueue first. I'm guessing that your background task is really a small task repeated again and again. Make this into an NSOperation subclass and just add them onto an NSOperationQueue. That way you can control the background tasks more easily. You also get the advantage with an NSOperationQue...
Sounds like a bad idea, but it's very simple. ``` [self performSelectorInBackground:@selector(theMethod:) withObject:nil]; ``` Just have a while(YES) in theMethod: and it will never stop executing. **EDIT:** Luckily for you it's just as simple to do something once every 20 seconds. ``` [NSTimer scheduledTimerWith...
4,898,167
I didn't find any answer in the API Documentation and also not in the SDK. If I use "/me/home" for example, I will get my news feed. The news feed contains entries from users, pages, apps, etc. But how do I know wheather an entry is from a user, page or app? In the output there is no information about the type. All en...
2011/02/04
[ "https://Stackoverflow.com/questions/4898167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/603167/" ]
Sounds like a bad idea, but it's very simple. ``` [self performSelectorInBackground:@selector(theMethod:) withObject:nil]; ``` Just have a while(YES) in theMethod: and it will never stop executing. **EDIT:** Luckily for you it's just as simple to do something once every 20 seconds. ``` [NSTimer scheduledTimerWith...
you'll want to interact with the thread's run loop. if it's an NSThread, it is created automatically. thus, you are given access to the CF/NS-RunLoop - typically by calling `+ [NSThread currentRunLoop]` from the secondary thread. in that case, you add a CF/NS-Timer to the run loop, and let it run and repeat until your...
4,898,167
I didn't find any answer in the API Documentation and also not in the SDK. If I use "/me/home" for example, I will get my news feed. The news feed contains entries from users, pages, apps, etc. But how do I know wheather an entry is from a user, page or app? In the output there is no information about the type. All en...
2011/02/04
[ "https://Stackoverflow.com/questions/4898167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/603167/" ]
I'd look at an NSOperationQueue first. I'm guessing that your background task is really a small task repeated again and again. Make this into an NSOperation subclass and just add them onto an NSOperationQueue. That way you can control the background tasks more easily. You also get the advantage with an NSOperationQue...
you'll want to interact with the thread's run loop. if it's an NSThread, it is created automatically. thus, you are given access to the CF/NS-RunLoop - typically by calling `+ [NSThread currentRunLoop]` from the secondary thread. in that case, you add a CF/NS-Timer to the run loop, and let it run and repeat until your...
52,026,540
I am a beginner in Java I'm trying to learn by practice and I found this exercise that has as a purpose to partition a list to sublists of n size the method partition take in argument (ArrayList, size) For example: `partition([1,2,3,4,],2)` will return `([1,2],[3,4])` `partition([1,2,3,4,],3)` will return `([1,...
2018/08/26
[ "https://Stackoverflow.com/questions/52026540", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10075125/" ]
It is likely that at least 1 column for every row has an NA, resulting in no data being returned. If you use `complete.cases()` you can see a row-wise NA check. ``` # Example Data test <- diag(rep(NA,4)) test[1,1] <- 0 test # [,1] [,2] [,3] [,4] #[1,] 0 0 0 0 #[2,] 0 NA 0 0 #[3,] 0 0 ...
If you mean that `View(out_time)` gives you the column headers and nothing else, it is because there are no data present in the data frame, leaving just the headings. Basically, you deleted everything in the data frame because `na.omit(out_time)` removes any rows that have a single `NA` present.
6,318,733
**Hello All**, I am trying to use **preg\_match** to identify if a single word found within a string of text. This word needs to be picked up if there are multiple instances of each character within the word (in the correct order). To make life hard for myself I also want to pick up on the word even if the client has ...
2011/06/11
[ "https://Stackoverflow.com/questions/6318733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/774811/" ]
I'm guessing you're on Windows and suffering from the evils of Windows' text mode. Add `"b"` to the flags you pass to `fopen`, i.e. ``` pSrcFile = fopen ( "test.txt" , "rb" ); pDstFile = fopen ( "result1.txt", "a+b"); ```
It seems you are reading from `Dest` file ``` bytesRead = fread (Dstc , 1, len, pSrcFile); ``` and writing to source ``` bytesWritten = fwrite( Src , 1 , len , pDstFile ); ``` Probably, you have to change `Dest` to `Src`.
61,819,675
I am trying to create a new virtual environment for a tutorial. I have installed `virtualenv` and `virtualenvwrapper` multiple times but every time I try creating a new virtual environment my terminal displays - `mkvirtualenv: command not found`. When I try finding out the version of `virtualenv` it shows `virtualenv: ...
2020/05/15
[ "https://Stackoverflow.com/questions/61819675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8709495/" ]
Instead your solution use [`GroupBy.agg`](http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.GroupBy.agg.html) and then [`DataFrame.rename_axis`](http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.rename_axis.html): So change: ``` datasize = Reducedset['estimate'].gr...
You can try this. ``` df.columns = ['size', 'sum', 'mean', 'std'] ``` To add name to index using [**`df.rename_axis`**](http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.rename_axis.html) ``` df.rename_axis('Continent') ``` Output: ``` size sum mean ...
61,819,675
I am trying to create a new virtual environment for a tutorial. I have installed `virtualenv` and `virtualenvwrapper` multiple times but every time I try creating a new virtual environment my terminal displays - `mkvirtualenv: command not found`. When I try finding out the version of `virtualenv` it shows `virtualenv: ...
2020/05/15
[ "https://Stackoverflow.com/questions/61819675", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8709495/" ]
Instead your solution use [`GroupBy.agg`](http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.GroupBy.agg.html) and then [`DataFrame.rename_axis`](http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.rename_axis.html): So change: ``` datasize = Reducedset['estimate'].gr...
Try this: for index column title: ``` df.index.name='Continent' ``` for column names: ``` df.columns = ['size', 'sum', 'mean', 'std'] ``` Hope it helps..
4,749,364
I get that error when I attempt to use the btn connected to it: ``` private void btnAccel_Click(object sender, EventArgs e) { pStatus.Text = plane.speed.ToString(); plane.speed = double.Parse(txtSpeed.Text); plane.Accelerate(); pStatus.Text =...
2011/01/20
[ "https://Stackoverflow.com/questions/4749364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/583144/" ]
Then `PlanePosition` is clearly `null`. You are probably missing a ``` PlanePosition = new Position(); // or whatever the type of PlanePosition is ``` in your constructor for `Airplane` or ``` private PlanePosition = new Position(); ``` to initialize the field or analogously if it's a property. I see you left t...
Generally speaking, the error will occur when you try to use an object that you haven't instantiated. So PlanePosition is the the name of the class, you'll want to instantiate the class and then use the method with the object. ``` PlanePosition myPlane = new PlanePosition(); myPlane.speed < ... ``` But I don't thin...
4,749,364
I get that error when I attempt to use the btn connected to it: ``` private void btnAccel_Click(object sender, EventArgs e) { pStatus.Text = plane.speed.ToString(); plane.speed = double.Parse(txtSpeed.Text); plane.Accelerate(); pStatus.Text =...
2011/01/20
[ "https://Stackoverflow.com/questions/4749364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/583144/" ]
Then `PlanePosition` is clearly `null`. You are probably missing a ``` PlanePosition = new Position(); // or whatever the type of PlanePosition is ``` in your constructor for `Airplane` or ``` private PlanePosition = new Position(); ``` to initialize the field or analogously if it's a property. I see you left t...
`PlanePosition` isn't being initialized. You need to make sure an object is assigned to PlanePosition before calling `Accelerate`
12,049,772
This question is kind of general and not very specific. We have a java project that uses Oracle database. We are currently using SoapUI tool for the QA tests. Each test needs some data to exist on the database before it is run. Our current way of running the tests is as follows: 1. Before each test we run a `.sql` fil...
2012/08/21
[ "https://Stackoverflow.com/questions/12049772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/599912/" ]
You could integrate a [SQL data generator](https://stackoverflow.com/questions/591892/tools-for-generating-mock-data) into your testing loop. A suitable data generator takes the schema and additional constraints as input and produces data that is consistent with the current schema. This way, every time the schema chan...
You can include [Databene Generator](http://databene.org/databene-benerator/) in your toolchain. It can generate sql files or talk directly to database. You have just create xml file with data generation scheme.
54,584,424
When I set the flex-direction value of .main-header the children of .main-nav are in a row not a column. So I was wondering if the children of flex-containers that are in flex-containers never get affected by the flex-container declarations of the parent container of their parent container. ``` <header class="main-he...
2019/02/08
[ "https://Stackoverflow.com/questions/54584424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
flex-direction will only apply to the children of .main-header, not to any other descendants. If you add flex-direction to: .main-header, .main-nav { display: flex;} instead, then it will apply to the children of both .main-header and .main-nav.
You can inherit it by flex-direction: inherit;
54,584,424
When I set the flex-direction value of .main-header the children of .main-nav are in a row not a column. So I was wondering if the children of flex-containers that are in flex-containers never get affected by the flex-container declarations of the parent container of their parent container. ``` <header class="main-he...
2019/02/08
[ "https://Stackoverflow.com/questions/54584424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
```css @media (max-width: 969px) { .main-header,.main-nav { display: flex; flex-direction: column; align-items: center;} } ``` ```html <header class="main-header"> <h1 class="name"><a href="#">Best City Guide</a></h1> <ul class="main-nav"> <li><a href="#">ice cream</a></l...
You can inherit it by flex-direction: inherit;
54,584,424
When I set the flex-direction value of .main-header the children of .main-nav are in a row not a column. So I was wondering if the children of flex-containers that are in flex-containers never get affected by the flex-container declarations of the parent container of their parent container. ``` <header class="main-he...
2019/02/08
[ "https://Stackoverflow.com/questions/54584424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
No, it is not an inherited property so it won't pass down to children. You can check to see if a property is inherited through some sites like [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction) or [W3School](https://www.w3schools.com/cssref/css3_pr_flex-direction.asp). If you want the child flex-co...
You can inherit it by flex-direction: inherit;
54,584,424
When I set the flex-direction value of .main-header the children of .main-nav are in a row not a column. So I was wondering if the children of flex-containers that are in flex-containers never get affected by the flex-container declarations of the parent container of their parent container. ``` <header class="main-he...
2019/02/08
[ "https://Stackoverflow.com/questions/54584424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
flex-direction will only apply to the children of .main-header, not to any other descendants. If you add flex-direction to: .main-header, .main-nav { display: flex;} instead, then it will apply to the children of both .main-header and .main-nav.
```css @media (max-width: 969px) { .main-header,.main-nav { display: flex; flex-direction: column; align-items: center;} } ``` ```html <header class="main-header"> <h1 class="name"><a href="#">Best City Guide</a></h1> <ul class="main-nav"> <li><a href="#">ice cream</a></l...
54,584,424
When I set the flex-direction value of .main-header the children of .main-nav are in a row not a column. So I was wondering if the children of flex-containers that are in flex-containers never get affected by the flex-container declarations of the parent container of their parent container. ``` <header class="main-he...
2019/02/08
[ "https://Stackoverflow.com/questions/54584424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
flex-direction will only apply to the children of .main-header, not to any other descendants. If you add flex-direction to: .main-header, .main-nav { display: flex;} instead, then it will apply to the children of both .main-header and .main-nav.
No, it is not an inherited property so it won't pass down to children. You can check to see if a property is inherited through some sites like [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction) or [W3School](https://www.w3schools.com/cssref/css3_pr_flex-direction.asp). If you want the child flex-co...
382,766
I wonder if it is possible to type out the Chinese quotation marks "「 」" within a math environment?
2017/07/22
[ "https://tex.stackexchange.com/questions/382766", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/60213/" ]
Maybe you're looking for `\ulcorner` and `\lrcorner`: ``` \documentclass{article} \usepackage{amssymb} \begin{document} $\ulcorner x\lrcorner$ \end{document} ``` [![enter image description here](https://i.stack.imgur.com/risNP.png)](https://i.stack.imgur.com/risNP.png)
Looks more like `\lceil`, `\rfloor`. I'd probably redefine them as left and right chinese quotes and i'd make a macro; ``` \newcommand{\lchquote}{\lceil} \newcommand{\rchquote}{\rfloor} \newcommand{\chquote}[1]{\ensuremath{\left\lchquote\, #1 \,\right\rchquote}} ``` so that, for example it would render as[![chquotes...
23,705,032
Suppose that I developed a library and published it as a project. What makes my library a "standard" library for Java and be in next JDK version?
2014/05/16
[ "https://Stackoverflow.com/questions/23705032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3403689/" ]
From what I've witnessed, this happens when your framework helps the Java community so much that it can be moved into a specification in form of JSR. Then, a set of interfaces is developed and, usually, your library becomes the first implementation, or the implementation is added directly into the JDK. Notorious examp...
Some libraries which are more or less known in Java community are not parts of JDK. There is such thing as [Apache Maven](http://maven.apache.org/) which is using huge repositories full of different libraries. As soon as your library is really popular (and published in a repository available for everyone, although not ...
54,184
I play soprano cornet in a UK brass band. Although I think I play in tune, it's often pointed out to me that I don't. Soprano cornet is notorious in this respect - some notes are in tune, others aren't, needing adjustment with alternate fingerings, or throwing first or third valve slides. Although we'll use a visual e...
2017/03/08
[ "https://music.stackexchange.com/questions/54184", "https://music.stackexchange.com", "https://music.stackexchange.com/users/9426/" ]
I've done a little bit of work with junior bands, and I play sax in a concert band, so this is based on my experience there. The first step to playing in tune is to know when you are out of tune. A tuner is one way to get this information. But it's not ideal for a couple of reasons. For a start, most tuners that I ha...
> So I'd like some suggestions for how my personal practice sessions (on my own) can strengthen my ability to play in tune, but I have to be able to do this using my ears - it's no help using my eyes on a tuning meter to tell me whether I'm in tune or not, as I can't use that technique with the band. Come again? Of *...
54,184
I play soprano cornet in a UK brass band. Although I think I play in tune, it's often pointed out to me that I don't. Soprano cornet is notorious in this respect - some notes are in tune, others aren't, needing adjustment with alternate fingerings, or throwing first or third valve slides. Although we'll use a visual e...
2017/03/08
[ "https://music.stackexchange.com/questions/54184", "https://music.stackexchange.com", "https://music.stackexchange.com/users/9426/" ]
I've done a little bit of work with junior bands, and I play sax in a concert band, so this is based on my experience there. The first step to playing in tune is to know when you are out of tune. A tuner is one way to get this information. But it's not ideal for a couple of reasons. For a start, most tuners that I ha...
I used the audio software Audacity to produce slow in-tune scales and thirds (the wave generator function) for intonation practice on the violin. The tones are slow enough that there is time to re-practice the jump to the next note to reinforce the proper pitch. I burned it to a CD for playback. You can also find pre-...
54,184
I play soprano cornet in a UK brass band. Although I think I play in tune, it's often pointed out to me that I don't. Soprano cornet is notorious in this respect - some notes are in tune, others aren't, needing adjustment with alternate fingerings, or throwing first or third valve slides. Although we'll use a visual e...
2017/03/08
[ "https://music.stackexchange.com/questions/54184", "https://music.stackexchange.com", "https://music.stackexchange.com/users/9426/" ]
I've done a little bit of work with junior bands, and I play sax in a concert band, so this is based on my experience there. The first step to playing in tune is to know when you are out of tune. A tuner is one way to get this information. But it's not ideal for a couple of reasons. For a start, most tuners that I ha...
I think you've answered your own question. Practice without a tuner. Use your ears. No visuals. Forget visuals. Eliminate visuals. In general, a good practice for ear-training is the following (courtesy of my uni professor, this is first-hand advice): Take a tuning fork. The metal one. 1 Strike it and listen to the ...
54,184
I play soprano cornet in a UK brass band. Although I think I play in tune, it's often pointed out to me that I don't. Soprano cornet is notorious in this respect - some notes are in tune, others aren't, needing adjustment with alternate fingerings, or throwing first or third valve slides. Although we'll use a visual e...
2017/03/08
[ "https://music.stackexchange.com/questions/54184", "https://music.stackexchange.com", "https://music.stackexchange.com/users/9426/" ]
I've done a little bit of work with junior bands, and I play sax in a concert band, so this is based on my experience there. The first step to playing in tune is to know when you are out of tune. A tuner is one way to get this information. But it's not ideal for a couple of reasons. For a start, most tuners that I ha...
Prepare some reference tracks using a DAW or a synth/organ keyboard. Slow scales, slow melodies etc. And I MEAN slow. Practice with them, matching the tuning. 'Get your ear in'with correct tuning. We can argue over temperament etc. But, if you have noticable tuning problems, the synth will be a lot nearer 'right' than...
52,235,255
The text input should be converted to the XML output using XSLT 1.0. The list is of variable length with the delimiter being `|`. Input: ``` name=IMON_EVENT;next_state=SET_IMON;is_enabled=true; | name=MAIN_BATCH;next_state=BATCH01;is_enabled=false;priority=9; ``` Expected output: ``` <time-triggers> <trigger> ...
2018/09/08
[ "https://Stackoverflow.com/questions/52235255", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7300321/" ]
I think your biggest problem is that you are creating new scales & axes on each update, whereas you should just be feeding the scales the updated data via their respective domains and calling them again on each axis. Also, while you *are* positioning new bars on `.enter` (x, y, width & height attrs), you are doing not...
Just remove the X,Y scales and axes out of update function and use `remove()` `exit()` inside the update. ``` ///////////////////////////// Update function function doUpdate(gdata){ var rand = Math.floor(Math.random()*data.length)+2 var newData = data.slice(0, rand); update(newData) } //////////////////...
2,582,304
Could someone give me just one suggestion to solve this problem? > > Let $z\_{1}, \ldots z\_{n} \in \mathbb{C}$, with $z\_{1}\neq 0$. Prove that if > $\vert{z\_{1}+ \cdots + z\_{n}}\vert$ = > $\vert{z\_{1}}\vert + \cdots + \vert{z\_{n}}\vert$ then $z\_{j} = c\_{j}z\_{1}$, where > $c\_{j}\geqslant 0 $, $j=1,\ldo...
2017/12/27
[ "https://math.stackexchange.com/questions/2582304", "https://math.stackexchange.com", "https://math.stackexchange.com/users/502390/" ]
Using $|z|^2 = z z^\*$ we have $$ \vert{z\_{1}+ \cdots + z\_{n}}\vert^2 = (z\_{1}+ \cdots + z\_{n})(z\_{1}^\*+ \cdots + z\_{n}^\*) \\ = \sum\_{i} |z\_{i}|^2 + \sum\_{i > j} (z\_i z\_j^\* +z\_j z\_i^\* )\\ = \sum\_{i} |z\_{i}|^2 + 2 \sum\_{i > j} \Re (z\_i z\_j^\*) = \sum\_{i} |z\_{i}|^2 + 2 \sum\_{i > j} |z\_i||z\_j|...
Here's the base case. If $|(a+bi)+(c+di)| =|a+bi|+|c+di| $ then, $\sqrt{(a+c)^2+(b+d)^2} =\sqrt{a^2+b^2}+\sqrt{c^2+d^2} $. Squaring, $(a+c)^2+(b+d)^2 =a^2+b^2+c^2+d^2+2\sqrt{(a^2+b^2)(c^2+d^2)} $ or $2ac+2bd =2\sqrt{(a^2+b^2)(c^2+d^2)} $. Dividing by 2 and squaring again, $a^2c^2+2abcd+b^2d^2 =a^2c^2+a^2d^2+b^2c^2+b...
2,582,304
Could someone give me just one suggestion to solve this problem? > > Let $z\_{1}, \ldots z\_{n} \in \mathbb{C}$, with $z\_{1}\neq 0$. Prove that if > $\vert{z\_{1}+ \cdots + z\_{n}}\vert$ = > $\vert{z\_{1}}\vert + \cdots + \vert{z\_{n}}\vert$ then $z\_{j} = c\_{j}z\_{1}$, where > $c\_{j}\geqslant 0 $, $j=1,\ldo...
2017/12/27
[ "https://math.stackexchange.com/questions/2582304", "https://math.stackexchange.com", "https://math.stackexchange.com/users/502390/" ]
Using $|z|^2 = z z^\*$ we have $$ \vert{z\_{1}+ \cdots + z\_{n}}\vert^2 = (z\_{1}+ \cdots + z\_{n})(z\_{1}^\*+ \cdots + z\_{n}^\*) \\ = \sum\_{i} |z\_{i}|^2 + \sum\_{i > j} (z\_i z\_j^\* +z\_j z\_i^\* )\\ = \sum\_{i} |z\_{i}|^2 + 2 \sum\_{i > j} \Re (z\_i z\_j^\*) = \sum\_{i} |z\_{i}|^2 + 2 \sum\_{i > j} |z\_i||z\_j|...
Let $P(n)$ mean that the result if true for $\le n$ variables. $P(1)$ is clear. It is straightforward to show that $|1+w| = 1+|w|$ **iff** $w\ge 0$. For $P(2)$, if $z\_1 \neq 0$ then $|1+ {z\_2 \over z\_1}| = 1+ | {z\_2 \over z\_1}|$ and hence $P(2)$ is true by the preceding remark. Suppose $P(n)$ is true and $|z\_1...
27,911,401
I just started to learn Swift. I created a class that manages an REST API call and the method takes 3 parameters, data, successCallback and failCallback. All good, I get the data, I parse the JSON, etc. My problem is that I can't do anything related to IBOutlets inside the successCallback that is passed to the API me...
2015/01/12
[ "https://Stackoverflow.com/questions/27911401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1442680/" ]
That's because you're working in a callback function, which executes outside the UI thread. You should wrap your UI changing code with `dispatch_async`. For example: ``` dispatch_async(dispatch_get_main_queue(), { self.labelOutlet.text = "Text" }) ```
You can only modify UI Elements in the Main thread. To access it, use: ``` dispatch_async(dispatch_get_main_queue()) { /* your Code */ } ```
46,119,720
can i use replacing clause and let below codes base on IBM cobol fieldcpy: `01 field-define 03 :aaa:-field-1 03 :aaa:-field-2` i'd like to remove the prefix of **:aaa:-** and have this: `01 field-define 03 field-1 03 field-2` i tried below statement but it does work: `copy fieldcopy replacing ==:aaa:-== wit...
2017/09/08
[ "https://Stackoverflow.com/questions/46119720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8578738/" ]
If you install the [Laroute](https://github.com/aaronlord/laroute) helper functions, you can include URLs to routes easily in Javascript: ``` $('#button').click(function () { var url = laroute.url('/ajax/get_discount_code'); // laroute.action('SomeController@some_method'); will also work $.get( url , function(...
Use laravel url() function to make complete url like ``` var url = "{{ url('/ajax/get_discount_code') }}"; ```
46,119,720
can i use replacing clause and let below codes base on IBM cobol fieldcpy: `01 field-define 03 :aaa:-field-1 03 :aaa:-field-2` i'd like to remove the prefix of **:aaa:-** and have this: `01 field-define 03 field-1 03 field-2` i tried below statement but it does work: `copy fieldcopy replacing ==:aaa:-== wit...
2017/09/08
[ "https://Stackoverflow.com/questions/46119720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8578738/" ]
If you install the [Laroute](https://github.com/aaronlord/laroute) helper functions, you can include URLs to routes easily in Javascript: ``` $('#button').click(function () { var url = laroute.url('/ajax/get_discount_code'); // laroute.action('SomeController@some_method'); will also work $.get( url , function(...
You can add a global variable in the head of your main blade file where you can store the value of the baseURL like: ``` <head> ... <script type="text/javascript"> var base_url = '{!! url('/') !!}'; </script> //the rest of ur scripts </head> ``` And in your script you can call the variable `base_url` and...
46,119,720
can i use replacing clause and let below codes base on IBM cobol fieldcpy: `01 field-define 03 :aaa:-field-1 03 :aaa:-field-2` i'd like to remove the prefix of **:aaa:-** and have this: `01 field-define 03 field-1 03 field-2` i tried below statement but it does work: `copy fieldcopy replacing ==:aaa:-== wit...
2017/09/08
[ "https://Stackoverflow.com/questions/46119720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8578738/" ]
If you install the [Laroute](https://github.com/aaronlord/laroute) helper functions, you can include URLs to routes easily in Javascript: ``` $('#button').click(function () { var url = laroute.url('/ajax/get_discount_code'); // laroute.action('SomeController@some_method'); will also work $.get( url , function(...
You need to set-up a virtual host to resolve this. The reason it's giving a 404 error is because localhost doesn't point to the Laravel installation so you can't reference the root URL. You need to do something like this to set-up the vHost assuming you are using apache: ``` <VirtualHost *:80> ServerAdmin webma...
46,819,590
I have a versioned bucket and would like to delete the object (and all of its versions) from the bucket. However, when I try to delete the object from the console, S3 simply adds a delete marker but does not perform a hard delete. Is it possible to delete all versions of the object (hard delete) with a particular key...
2017/10/18
[ "https://Stackoverflow.com/questions/46819590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7938494/" ]
The [documentation](http://docs.aws.amazon.com/AmazonS3/latest/dev/DeletingObjectVersions.html) is helpful here: 1. When versioning is enabled in an S3 bucket, a simple DeleteObject request cannot permanently delete an object from that bucket. Instead, Amazon S3 inserts a delete marker (which is effectively a new vers...
This post was super helpful without this we would have spent tremendous amount of time cleaning up our S3 folders. We had a requirement to clean up specific folders only. So I tried the following code and it worked like a charm. Also note that I am iterating through the 10 times to delete more than 1000 objects limit...
46,819,590
I have a versioned bucket and would like to delete the object (and all of its versions) from the bucket. However, when I try to delete the object from the console, S3 simply adds a delete marker but does not perform a hard delete. Is it possible to delete all versions of the object (hard delete) with a particular key...
2017/10/18
[ "https://Stackoverflow.com/questions/46819590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7938494/" ]
The [documentation](http://docs.aws.amazon.com/AmazonS3/latest/dev/DeletingObjectVersions.html) is helpful here: 1. When versioning is enabled in an S3 bucket, a simple DeleteObject request cannot permanently delete an object from that bucket. Instead, Amazon S3 inserts a delete marker (which is effectively a new vers...
To delete all versions of an object or objects under a prefix: Pass the object key `/folder/filename` or prefix `/folder/subfolder/` to the `Prefix` ```py import boto3 s3 = boto3.resource('s3') bucket = s3.Bucket("my-bucket-name") bucket.object_versions.filter(Prefix="folder/subfolder/").delete() ```
46,819,590
I have a versioned bucket and would like to delete the object (and all of its versions) from the bucket. However, when I try to delete the object from the console, S3 simply adds a delete marker but does not perform a hard delete. Is it possible to delete all versions of the object (hard delete) with a particular key...
2017/10/18
[ "https://Stackoverflow.com/questions/46819590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7938494/" ]
To delete all versions of an object or objects under a prefix: Pass the object key `/folder/filename` or prefix `/folder/subfolder/` to the `Prefix` ```py import boto3 s3 = boto3.resource('s3') bucket = s3.Bucket("my-bucket-name") bucket.object_versions.filter(Prefix="folder/subfolder/").delete() ```
The rest of the answers all miss something. Either using the Prefix parameter, or deleting delete markers, or handling errors... ``` s3 = boto3.client('s3') response = s3.list_object_versions(Bucket=bucket_name, Prefix=key) objects_to_delete = [] # Note that we do not use pagination because we assume the file has les...
46,819,590
I have a versioned bucket and would like to delete the object (and all of its versions) from the bucket. However, when I try to delete the object from the console, S3 simply adds a delete marker but does not perform a hard delete. Is it possible to delete all versions of the object (hard delete) with a particular key...
2017/10/18
[ "https://Stackoverflow.com/questions/46819590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7938494/" ]
To delete all versions of an object or objects under a prefix: Pass the object key `/folder/filename` or prefix `/folder/subfolder/` to the `Prefix` ```py import boto3 s3 = boto3.resource('s3') bucket = s3.Bucket("my-bucket-name") bucket.object_versions.filter(Prefix="folder/subfolder/").delete() ```
this script will delete all version of all object with prefix - ``` s3 = boto3.resource("s3") client = boto3.client("s3") s3_bucket = s3.Bucket(bucket_name) for obj in s3_bucket.objects.filter(Prefix=""): response = client.list_object_versions(Bucket=bucket_name, Prefix=obj.key) while "Versions" in response...
46,819,590
I have a versioned bucket and would like to delete the object (and all of its versions) from the bucket. However, when I try to delete the object from the console, S3 simply adds a delete marker but does not perform a hard delete. Is it possible to delete all versions of the object (hard delete) with a particular key...
2017/10/18
[ "https://Stackoverflow.com/questions/46819590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7938494/" ]
To delete all versions of an object or objects under a prefix: Pass the object key `/folder/filename` or prefix `/folder/subfolder/` to the `Prefix` ```py import boto3 s3 = boto3.resource('s3') bucket = s3.Bucket("my-bucket-name") bucket.object_versions.filter(Prefix="folder/subfolder/").delete() ```
Easiest way: ```py import boto3 bucket = boto3.resource("s3").Bucket("mybucket") bucket.object_versions.all().delete() ```
46,819,590
I have a versioned bucket and would like to delete the object (and all of its versions) from the bucket. However, when I try to delete the object from the console, S3 simply adds a delete marker but does not perform a hard delete. Is it possible to delete all versions of the object (hard delete) with a particular key...
2017/10/18
[ "https://Stackoverflow.com/questions/46819590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7938494/" ]
The other answers delete objects individually. It is more efficient to use the **delete\_objects** boto3 call and batch process your delete. See the code below for a function which collects all objects and deletes in batches of 1000: ``` bucket = 'bucket-name' s3_client = boto3.client('s3') object_response_paginator =...
To delete all versions of an object or objects under a prefix: Pass the object key `/folder/filename` or prefix `/folder/subfolder/` to the `Prefix` ```py import boto3 s3 = boto3.resource('s3') bucket = s3.Bucket("my-bucket-name") bucket.object_versions.filter(Prefix="folder/subfolder/").delete() ```
46,819,590
I have a versioned bucket and would like to delete the object (and all of its versions) from the bucket. However, when I try to delete the object from the console, S3 simply adds a delete marker but does not perform a hard delete. Is it possible to delete all versions of the object (hard delete) with a particular key...
2017/10/18
[ "https://Stackoverflow.com/questions/46819590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7938494/" ]
As a supplement to [@jarmod](https://stackoverflow.com/users/271415/jarmod)'s answer, here is a way I developed a workaround to "hard deleting" an object (with delete markered objects included); ``` def get_all_versions(bucket, filename): s3 = boto3.client('s3') keys = ["Versions", "DeleteMarkers"] results...
this script will delete all version of all object with prefix - ``` s3 = boto3.resource("s3") client = boto3.client("s3") s3_bucket = s3.Bucket(bucket_name) for obj in s3_bucket.objects.filter(Prefix=""): response = client.list_object_versions(Bucket=bucket_name, Prefix=obj.key) while "Versions" in response...
46,819,590
I have a versioned bucket and would like to delete the object (and all of its versions) from the bucket. However, when I try to delete the object from the console, S3 simply adds a delete marker but does not perform a hard delete. Is it possible to delete all versions of the object (hard delete) with a particular key...
2017/10/18
[ "https://Stackoverflow.com/questions/46819590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7938494/" ]
This post was super helpful without this we would have spent tremendous amount of time cleaning up our S3 folders. We had a requirement to clean up specific folders only. So I tried the following code and it worked like a charm. Also note that I am iterating through the 10 times to delete more than 1000 objects limit...
Easiest way: ```py import boto3 bucket = boto3.resource("s3").Bucket("mybucket") bucket.object_versions.all().delete() ```
46,819,590
I have a versioned bucket and would like to delete the object (and all of its versions) from the bucket. However, when I try to delete the object from the console, S3 simply adds a delete marker but does not perform a hard delete. Is it possible to delete all versions of the object (hard delete) with a particular key...
2017/10/18
[ "https://Stackoverflow.com/questions/46819590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7938494/" ]
The [documentation](http://docs.aws.amazon.com/AmazonS3/latest/dev/DeletingObjectVersions.html) is helpful here: 1. When versioning is enabled in an S3 bucket, a simple DeleteObject request cannot permanently delete an object from that bucket. Instead, Amazon S3 inserts a delete marker (which is effectively a new vers...
Easiest way: ```py import boto3 bucket = boto3.resource("s3").Bucket("mybucket") bucket.object_versions.all().delete() ```
46,819,590
I have a versioned bucket and would like to delete the object (and all of its versions) from the bucket. However, when I try to delete the object from the console, S3 simply adds a delete marker but does not perform a hard delete. Is it possible to delete all versions of the object (hard delete) with a particular key...
2017/10/18
[ "https://Stackoverflow.com/questions/46819590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7938494/" ]
As a supplement to [@jarmod](https://stackoverflow.com/users/271415/jarmod)'s answer, here is a way I developed a workaround to "hard deleting" an object (with delete markered objects included); ``` def get_all_versions(bucket, filename): s3 = boto3.client('s3') keys = ["Versions", "DeleteMarkers"] results...
Fewer line solution. ``` import boto3 def delete_versions(bucket, objects=None): # `objects` is either list of str or None bucket = boto3.resource('s3').Bucket(bucket) if objects: # delete specified objects [version.delete() for version in bucket.object_versions.all() if version.object_key in objects] else:...
12,780
I am designing a simple programmable LED screen system as an exercise, and I need a non-standard type of SRAM (16x5) so I am designing the memory circuits. I have looked everywhere (Digikey, TI, National Semiconductor, etc.) for a chip that is just a sense amplifier for SRAM and I haven't found anything. I called TI an...
2011/04/09
[ "https://electronics.stackexchange.com/questions/12780", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/3782/" ]
Unless you're trying to use the smallest transistors you can get away with to hold data, I'm not clear why you would need sense amplifiers. Wouldn't the data latches and passgates themselves provide enough strength to drive a normal logic input? Actually, I would expect that the simplest way to get a 16x5 RAM would be...
If you are not shooting for top speed(>1Mhz), you don't need any sense amplifiers. Standard 2T trigger (plus some Ts for accessing the data) would give you close to 0 and VCC voltages.
12,780
I am designing a simple programmable LED screen system as an exercise, and I need a non-standard type of SRAM (16x5) so I am designing the memory circuits. I have looked everywhere (Digikey, TI, National Semiconductor, etc.) for a chip that is just a sense amplifier for SRAM and I haven't found anything. I called TI an...
2011/04/09
[ "https://electronics.stackexchange.com/questions/12780", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/3782/" ]
Unless you're trying to use the smallest transistors you can get away with to hold data, I'm not clear why you would need sense amplifiers. Wouldn't the data latches and passgates themselves provide enough strength to drive a normal logic input? Actually, I would expect that the simplest way to get a 16x5 RAM would be...
(a) Are you using an off-the-shelf SRAM IC chip? If so, it already includes the [sense amplifier](http://en.wikipedia.org/wiki/Register_file) -- the bitlines cannot be accessed from the outside, even if you wanted to. (b) Are you not using an SRAM IC chip? I.e., are you storing a few bits in a D latch or a shift regis...
12,780
I am designing a simple programmable LED screen system as an exercise, and I need a non-standard type of SRAM (16x5) so I am designing the memory circuits. I have looked everywhere (Digikey, TI, National Semiconductor, etc.) for a chip that is just a sense amplifier for SRAM and I haven't found anything. I called TI an...
2011/04/09
[ "https://electronics.stackexchange.com/questions/12780", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/3782/" ]
To answer your question, yes you can use a LM339 as a sense amp, and all you need to do is wire the + input to the non-inverting bit-line, and the - input to the inverting bit-line. BUT... Since we're talking about reading a SRAM, the basic sequence of events during a READ is: 1. Pre-charge both bit-lines to VDD. 2....
Unless you're trying to use the smallest transistors you can get away with to hold data, I'm not clear why you would need sense amplifiers. Wouldn't the data latches and passgates themselves provide enough strength to drive a normal logic input? Actually, I would expect that the simplest way to get a 16x5 RAM would be...
12,780
I am designing a simple programmable LED screen system as an exercise, and I need a non-standard type of SRAM (16x5) so I am designing the memory circuits. I have looked everywhere (Digikey, TI, National Semiconductor, etc.) for a chip that is just a sense amplifier for SRAM and I haven't found anything. I called TI an...
2011/04/09
[ "https://electronics.stackexchange.com/questions/12780", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/3782/" ]
To answer your question, yes you can use a LM339 as a sense amp, and all you need to do is wire the + input to the non-inverting bit-line, and the - input to the inverting bit-line. BUT... Since we're talking about reading a SRAM, the basic sequence of events during a READ is: 1. Pre-charge both bit-lines to VDD. 2....
If you are not shooting for top speed(>1Mhz), you don't need any sense amplifiers. Standard 2T trigger (plus some Ts for accessing the data) would give you close to 0 and VCC voltages.