qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
71,781,549
I have the following project structure: ``` stages --Transform ----__init__.py ----Transformer.py ----PDFTransformer.py core.py ``` I would like to import PDFTransformer like this: ``` from stages.Transform import PDFTransformer ``` Therefore I have created `stages/Transform/__init__.py` with the following conten...
2022/04/07
[ "https://Stackoverflow.com/questions/71781549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14818627/" ]
If you ask Python to `import Transformer` from `PDFTransformer.py`, but when `PDFTransformer.py` is imported from `core.py` - i.e. when `core.py` is the `__main__` file - then the `import Transformer` is relative to `core.py` In other words it is as if you wrote `import Transformer` in `core.py`. That obviously wouldn...
add `__all__ =['Transformer', 'PDFTransformer']` in `stages/Transform/__init__.py` file. so this `__init__.py` file would be like ``` from .Transformer import Transformer from .PDFTransformer import PDFTransformer __all__ =['Transformer', 'PDFTransformer'] ``` this tell the python to load these function when you do...
32,813,710
In my wamp server I have a script that updaing csv file every second. I want to remove lines from the csv file, I have this code (from here: [How To Delete The Top 100 Rows From a CSV File With PHP](https://stackoverflow.com/questions/19095320/how-to-delete-the-top-100-rows-from-a-csv-file-with-php)): ``` $input = exp...
2015/09/27
[ "https://Stackoverflow.com/questions/32813710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5369541/" ]
It's not what you asked. But in my opinion your existing scheme is faulty. And then you are looking for a silly solution to fix it. You have multi-task issues and it is not a fast process. You will also probably lose a few lines every time you do this. The proper way to do this is to have a folder say **LOGS**. Then ...
> > > ``` > $input = explode("\n", file_get_contents("file.csv")); > foreach ($input as $line) { > // process all lines. > } > > // This function removes first 100 elements. > // More info: > // http://php.net/manual/en/function.array-slice.php > $output = array_slice($input, 100); > file_put_contents("out.csv", im...
260,180
When should you use `add_action` to enqueue or register a script, vs just using `wp_register_script` and/or `wp_enqueue_script`? In other words, both `example 1` and `example 2` below seem to accomplish the same thing when in `functions.php`, so why do so many resources say that `example 1` is the correct way of loadin...
2017/03/15
[ "https://wordpress.stackexchange.com/questions/260180", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/3811/" ]
Well it works the same *in the case where you tested it*. The answer could actually be somewhat complex, but mainly having it inside an action callback only registers them when needed, just putting it inside the `functions.php` it happens always when the theme is active. First of all this can be a waste of performanc...
The short answer to your question is time. `wp_enqueue_scripts` makes sure that scripts are available when needed. > > wp\_enqueue\_scripts is the proper hook to use when enqueuing items that > are meant to appear on the front end. > > >
27,887,521
I want to achieve the following: ![enter image description here](https://i.stack.imgur.com/7xasp.jpg) Where there is a background image, and a text over it (text position is bootstrap offset-6 col-6) And for it to be responsive. The thing is, that unlike conventional background, I do care how the background image ...
2015/01/11
[ "https://Stackoverflow.com/questions/27887521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/429249/" ]
Solution with JavaScript ------------------------ I know this is not a CSS-only solution a I use JavaScript, but it could help as a temporary solution while we look for a CSS thing. The HTML would be the same as you posted: ``` <div id="hungry"> <div class="col-xs-offset-6 col-xl-offset-6 col-xs-6 col-xl-6"> ...
you could try tweaking the jumbotron class in Bootstrap 3 just like i did for my website. ``` .jumbotron { background: url('background-photo.jpg') no-repeat center center; } ``` you could change the dimension of the jumbotron depending on the dimensions you want. ``` <div row jumbotron> <div class="col-md...
68,030,568
[![enter image description here](https://i.stack.imgur.com/fhOFm.png)](https://i.stack.imgur.com/fhOFm.png) ``` def convert(string): li = list(string. Split(" ")) return li str1 = input("insert string: ") x = convert(str1) print(x) if x[0] == "Is": print("unchanged string : " + str1) else: a = "Is" y...
2021/06/18
[ "https://Stackoverflow.com/questions/68030568", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16258264/" ]
Pandas parses the first row as a header, so that's correct to have 59 rows in your case. You can disable this using `header=None` parameter. Regarding the columns. Your csv file probably has non-standard delimiter like `\t`. Pandas assumes comma by default. Open the file in a simple text editor , check your delimiter ...
Is this truly a .csv file or an .excel / .xlsx file? If not, you should open it with *read\_excel* rather than *read\_csv*.
28,330,115
I currently have 2 client server models. In both, I'm passing a large amount of data from the server to the client. I would like to time how long it takes before the data gets serialized on the server side til when all the data gets received by the client; ultimately, I would like to see how much faster 1 model is than...
2015/02/04
[ "https://Stackoverflow.com/questions/28330115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2850809/" ]
I'm just guessing here because I can't see your code, but I'm reasonably sure I'm correct. When you start a new project, you have to enable migrations. How this works is that it inspects your project for objects derived from `DbContext` and then creates a `Migrations` folder with a `Configuration.cs` file inside. This ...
Annoyingly small changes: no throwIfV1Schema: false ``` public class MyContext: IdentityDbContext<ApplicationUser> { public MyContext() : base("MyContext") { } public static MyContextCreate() { return new MyContext(); } public System.Data.Entit...
370,898
I am not a native English speaker, but I am interested in learning a certain grammar rule. I did come across many sentences where the subject and the verb switched their positions. For example, I can say that I don't like apples nor does my friend. Here, the modal verb `does` comes before the subject `my friend`. Ano...
2017/01/29
[ "https://english.stackexchange.com/questions/370898", "https://english.stackexchange.com", "https://english.stackexchange.com/users/190684/" ]
English has quite a strong tendency to have the verb second in the sentence (not necessarily the second word, but the second constituent) Normally the subject is the first constituent that precedes it; but there are a number of other items which may serve that function, and in those cases the subject moves after the ve...
There is an archaic mode of speech where the subject can come after the verb in the interrogative, as in this excerpt from John Bunyan's ["The Pilgrim's Progress"](https://books.google.com/books?id=wPliAAAAcAAJ&pg=PA95-IA1&lpg=PA95-IA1&dq=the%20pilgrim%27s%20progress%20see%20you%20yon%20tree&source=bl&ots=RZ_pWpf2KR&si...
40,305,851
I have strings which have a JSON-like format, including: ``` ..."id":"500", ..., "id":"600", ... ``` I need to parse the **second** `id` out of the column. I found lots of answers using `substring_index`, however, I need to get the string *after* the 2nd (of potentially n) occurrences and not the string *before* to ...
2016/10/28
[ "https://Stackoverflow.com/questions/40305851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1400869/" ]
For now I have: ``` SELECT substring_index( substr(col, locate('"id":"', col, locate('"id":"', col) + 6) + 6), '"', 1) FROM table ``` Would love to see a "nicer" answer :-)
In Snowflake, this can be done as follows: ``` select , split_part([field_name], '{separator}', {n-counter}) from [table] ``` Note: {separator} and {n-counter} are inputs provided by the user. Snowflake requires apostrophes around {separator}.
40,305,851
I have strings which have a JSON-like format, including: ``` ..."id":"500", ..., "id":"600", ... ``` I need to parse the **second** `id` out of the column. I found lots of answers using `substring_index`, however, I need to get the string *after* the 2nd (of potentially n) occurrences and not the string *before* to ...
2016/10/28
[ "https://Stackoverflow.com/questions/40305851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1400869/" ]
To find the substring of a column "some\_column" occurring after the nth occurrence of a target string, ``` SELECT SUBSTRING(some_column, CHAR_LENGTH(SUBSTRING_INDEX(some_column, <target_string>, <n>)) + <length of target string + 1>) FROM some_table -- or if you want to limit the length of your returned substring...
In Snowflake, this can be done as follows: ``` select , split_part([field_name], '{separator}', {n-counter}) from [table] ``` Note: {separator} and {n-counter} are inputs provided by the user. Snowflake requires apostrophes around {separator}.
200,313
There is a reaction to the gravity of the earth on us but the earth does not move due to its huge mass. But what if I combine the weight of all humans and other things on Earth? Is it not enough to move the earth from its position(even a bit)? What if (imagine) the bio population suddenly increases? I think that we are...
2015/08/14
[ "https://physics.stackexchange.com/questions/200313", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/82564/" ]
According to Google the mass of the earth is around $5.972 \times 10^{24}$ kg (presumably that figure includes its 7 billion human inhabitants plus everything else were meant to be sharing with). If we take the average weight for a human as given by WolframAlpha as 62 kg this gives humanity a combined weight of $4.34 \...
> > Is it not enough to move the earth from its position (even a bit)? > > > For all practical purposes, nope. Think of it in the following manner: The (Earth + All the Humans) can be viewed as one *system*, and in this case, the gravitational force exchanged between any one person (e.g. you), and the Earth, is a...
18,674,336
I hope you can help me with the following, i have a php method to scan a directory with pictures: ``` <?php $dirname = "images/"; $images = scandir($dirname); $ignore = Array(".", ".."); foreach($images as $curimg){ ...
2013/09/07
[ "https://Stackoverflow.com/questions/18674336", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2757164/" ]
I ended up creating my own wrapper: ``` using System; using System.Collections.Generic; using System.Linq; using System.Runtime.CompilerServices; public sealed class ConditionalHashSet<T> where T : class { private readonly object locker = new object(); private readonly List<WeakReference> weakList = new List<...
In some recent framework version, the `ConditionalWeakTable<TKey,TValue>` now implements `IEnumerator` interface. Check out [Microsoft Docs](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.conditionalweaktable-2.system-collections-ienumerable-getenumerator?view=netcore-3.1). This applies t...
18,674,336
I hope you can help me with the following, i have a php method to scan a directory with pictures: ``` <?php $dirname = "images/"; $images = scandir($dirname); $ignore = Array(".", ".."); foreach($images as $curimg){ ...
2013/09/07
[ "https://Stackoverflow.com/questions/18674336", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2757164/" ]
I ended up creating my own wrapper: ``` using System; using System.Collections.Generic; using System.Linq; using System.Runtime.CompilerServices; public sealed class ConditionalHashSet<T> where T : class { private readonly object locker = new object(); private readonly List<WeakReference> weakList = new List<...
This will work without the performance problems. The key to the problem is to use a "holder" object as a value in the ConditionalWeakTable, so that when the key gets dropped, the holder's finalizer will trigger, which removes the key from the "active list" of keys. I tested this and it works. ``` using System; using...
12,261,898
Here is the markup. I want to add a vertical line between the two tables. I don't want to use images here. I need a pure html solution for this. ``` <div> <table width="50%" style="float:left"> <tr> <td><p class="dotted">row 1, cell 1</p></td> <td><p class="dotted">row 1, cell 2</p...
2012/09/04
[ "https://Stackoverflow.com/questions/12261898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1083596/" ]
Check this fiddle [here](http://jsfiddle.net/RmMUa/). Hope it helps. **CSS** ``` .parentTable{ width: 100%; border: 1px solid #b4b4b4; } .parentTable tr td{ padding: 5px 30px; } .parentTable tr td.header{ background: #265ca5; } .parentTable tr td.spec{ width: 1px; padding: 0; border: none;...
How about setting the left border of one of the tables to 1px? Updated: Based on your image, try this... (This may not be the best way to do this but it works for me...) <http://jsfiddle.net/jreljac/SvHqR/3/> ``` <table width="45%" style="float:left" class="tdDotted"> <tr> <td ><p class=" entityHeader">S...
11,712,539
I've noticed in many examples/tutorials that people use the brace operator "()" for matrix access, which is confusing for me in some cases. The question is: Let's assume we have a n\*m matrix (3x4, for example) named M. What elements will be returned by accessing it via "M(0)", or "M(1)", or any other singular paramet...
2012/07/29
[ "https://Stackoverflow.com/questions/11712539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1561468/" ]
What you see there is **linear index access** - namely directly accessing the memory in a linear way. In a matrix, all elements are stored in one big block of memory, each row following after the previous one. This is why, if you want to access an element at the position `(i, j)` you write somethink like ``` elem = m...
This is from OpenCV 2.4.2 ``` template<typename _Tp> inline _Tp& Mat_<_Tp>::operator ()(int i0, int i1) { return ((_Tp*)(data + step.p[0]*i0))[i1]; } template<typename _Tp> inline _Tp& Mat_<_Tp>::operator ()(int i0) { return this->at<_Tp>(i0); } template<typename _Tp> inline _Tp& Mat_<_Tp>::operator ()(int i0,...
28,312,975
Maven is transitively pulling in version 16 of guava, even though I have a <dependencyManagement> section which specifies version 18. The quick summary: * `gwizard-example` depends on `gwizard-config` * `gwizard-config` has a parent pom, `gwizard-parent` * `gwizard-parent` has <dependencyManagement> which specifies v...
2015/02/04
[ "https://Stackoverflow.com/questions/28312975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/635982/" ]
There is a simple thing. A `dependencyManagement` does not declare a dependency which is **really used** it's only defining versions etc. which **can** be used. If you define something like this it will not result in a change. ```xml <properties> <guava.version>18.0</guava.version> </properties> <dependencyManag...
Maven doesn't resolve the version transitive dependency issue in this case. This issue can be used by using maven bom concept. Check the maven documentation for bom in the below link <http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Management> Here is another blog wh...
20,426,280
I have a text file with ~ as delimiter. The first field is the Account Number. I want to return a list of Account Numbers in the file. Currently I know only how to return all content excluding the header line: ``` get-content $dest\$FPP.txt | select -Skip 1 ``` How can I amend this to return everything left of the f...
2013/12/06
[ "https://Stackoverflow.com/questions/20426280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2725402/" ]
Try to import it as csv: ``` Import-Csv $dest\$FPP.txt -Delimiter '~' | Foreach-Object {$_.'Account Number'} ```
I think what you're looking for is the SubString method. By using SubString you can pick out a string out of your text file by indicating the start and ending position. For Example: PS > "Hello\_World".substring(0,5) Hello
37,729
I am looking at a datasheet where they show a graph: $V\_{RMS}/\sqrt{Hz}$ as a function of frequency = VSD (voltage spectral density). The question is: how can a spectral density be in RMS? The root mean square is averaged over time or frequencies (Parseval's theorem)
2017/02/19
[ "https://dsp.stackexchange.com/questions/37729", "https://dsp.stackexchange.com", "https://dsp.stackexchange.com/users/18856/" ]
I think you are thinking of Power Spectral Density specifically. This is a common detonation for the spectral density for voltage sources (low source impedance). The actual power across the load will depend on the load applied, which is $V\_{rms}^2/R$, assuming the load is significantly larger than the source impedance...
The power spectral density gives the time-averaged average power as a function of frequency, therefore the voltage spectral density $V(f)$ should give the RMS voltage *of the harmonic component at frequency $f$*. (RMS voltage is derived such that power computation formulae are the same as their DC equivalents, so it ...
27,718,887
Im getting a single line entry in my log that just says 'GET 500 27' and the browser is showing a 500 error as well naturally. If the log is not giving me anything useful, then how can I go about troubleshooting this to see where the error is happening in Django? EDIT: I should add that my dev environment is working j...
2014/12/31
[ "https://Stackoverflow.com/questions/27718887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4400804/" ]
Make sure you have 'EMAIL\_BACKEND, EMAIL\_HOST, etc' set in the settings.py and set your `ADMINS = (('Your Name', 'youremail@email.com'),)` in there as well. that way errors should get sent to you via email.
I think the 500 error belongs to these settings on settings.py: ``` DEBUG = os.environ.get('DEBUG') == 'True'` ``` Resolved by replacing with - ``` DEBUG = True if os.environ.get('DEBUG') is not None: DEBUG = os.environ.get('DEBUG') == 'True' ```
27,718,887
Im getting a single line entry in my log that just says 'GET 500 27' and the browser is showing a 500 error as well naturally. If the log is not giving me anything useful, then how can I go about troubleshooting this to see where the error is happening in Django? EDIT: I should add that my dev environment is working j...
2014/12/31
[ "https://Stackoverflow.com/questions/27718887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4400804/" ]
Ok so the traceback started showing again (I had to: CHROME: right click > Inspect element > network > preserve log) and then I found out that my problem was that I unknowingly deleted the MySQL database because I thought I wasn't using it. I had to then remove the SQLite db from gitignore and then re-push everything...
I think the 500 error belongs to these settings on settings.py: ``` DEBUG = os.environ.get('DEBUG') == 'True'` ``` Resolved by replacing with - ``` DEBUG = True if os.environ.get('DEBUG') is not None: DEBUG = os.environ.get('DEBUG') == 'True' ```
49,186
In the data structure field, what is the (best) term used to identify (designate) a subtree covering a subset of contiguous leaves?
2015/11/07
[ "https://cs.stackexchange.com/questions/49186", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/8767/" ]
You seem to mean a subtree obtained by taking a certain node and all its successors. In data structures, the implicit assumption usually is that we consider *rooted* (and often *ordered*) trees. Therefore, "subtree" is usually taken to mean what you intend; "subtree" as in graph-theoretic "subgraph" is rarely used (in...
It is the subtree rooted at the *least common ancestor* of the set of leaves (the fact that the leaves are continuous makes no difference). I'm not sure there is any shorter term.
62,936,827
I've the following graph, ``` ed_ls = [(0, 1), (0, 63), (1, 2), (1, 3), (54, 0)] ed_w = [1, 2, 3, 4, 5] G = nx.Graph() G.add_edges_from(ed_ls) edge_w = OrderedDict(zip(G.edges, ed_w)) nx.set_edge_attributes(G, edge_w, 'weight') print(G.edges) print(nx.get_edge_attributes(G, 'weight')) ``` Output obtained: ``` {(0,...
2020/07/16
[ "https://Stackoverflow.com/questions/62936827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8281509/" ]
Pods (even in the same namespace) are not able to talk **directly** to each other by default. You need to create a `Service` in order to allow a pod to receive connections from another pod. In general, one pod connects to another pod via the latter's service, as I illustrated below: [![enter image description here](ht...
For communication between pods `localhost` or `127.0.0.1` does not work. Get the IP of any pod using ``` kubectl describe podname ``` Use that IP in the other pod to communicate with above pod. Since Pod IPs changes if the pod is recreated you should ideally use [kubernetes service](https://kubernetes.io/docs/conc...
62,936,827
I've the following graph, ``` ed_ls = [(0, 1), (0, 63), (1, 2), (1, 3), (54, 0)] ed_w = [1, 2, 3, 4, 5] G = nx.Graph() G.add_edges_from(ed_ls) edge_w = OrderedDict(zip(G.edges, ed_w)) nx.set_edge_attributes(G, edge_w, 'weight') print(G.edges) print(nx.get_edge_attributes(G, 'weight')) ``` Output obtained: ``` {(0,...
2020/07/16
[ "https://Stackoverflow.com/questions/62936827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8281509/" ]
Pods (even in the same namespace) are not able to talk **directly** to each other by default. You need to create a `Service` in order to allow a pod to receive connections from another pod. In general, one pod connects to another pod via the latter's service, as I illustrated below: [![enter image description here](ht...
Well for me it looks like you didn't configure the sentry correctly means you are not providing credential to sentry pod to connect to PostgreSQL pod and redis pod. ``` env: - name: SENTRY_SECRET_KEY valueFrom: secretKeyRef: name: sentry-sentry key: sentry-secret - name: SENTR...
62,936,827
I've the following graph, ``` ed_ls = [(0, 1), (0, 63), (1, 2), (1, 3), (54, 0)] ed_w = [1, 2, 3, 4, 5] G = nx.Graph() G.add_edges_from(ed_ls) edge_w = OrderedDict(zip(G.edges, ed_w)) nx.set_edge_attributes(G, edge_w, 'weight') print(G.edges) print(nx.get_edge_attributes(G, 'weight')) ``` Output obtained: ``` {(0,...
2020/07/16
[ "https://Stackoverflow.com/questions/62936827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8281509/" ]
Well for me it looks like you didn't configure the sentry correctly means you are not providing credential to sentry pod to connect to PostgreSQL pod and redis pod. ``` env: - name: SENTRY_SECRET_KEY valueFrom: secretKeyRef: name: sentry-sentry key: sentry-secret - name: SENTR...
For communication between pods `localhost` or `127.0.0.1` does not work. Get the IP of any pod using ``` kubectl describe podname ``` Use that IP in the other pod to communicate with above pod. Since Pod IPs changes if the pod is recreated you should ideally use [kubernetes service](https://kubernetes.io/docs/conc...
13,905,941
I am trying to count events that happen in a day, which in itself is easy: ``` SELECT date(time),COUNT(DISTINCT comment) FROM data GROUP BY date(time) ``` But I need a day end to be set at 4pm. So all comments before 4pm is day N, and news after 4pm are day N+1. This isnt a global thing, so I'd rather not change tim...
2012/12/16
[ "https://Stackoverflow.com/questions/13905941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1575088/" ]
> > There are already great methods already mentioned on this page, however it does seem a little obscure as to which to use. So I have added some mesurements so you can more easily decide for yourself: > > > --- *A large number has been used (for overhead) `1111111111111122222222222222222333333333333333333333`* ...
By looping it can be done the following way :) ``` num1= int(input('Enter the number')) sum1 = num1 #making a alt int to store the value of the orginal so it wont be affected y = [] #making a list while True: if(sum1==0):#checking if the number is not zero so it can break if it is break d = sum1%10 #l...
13,905,941
I am trying to count events that happen in a day, which in itself is easy: ``` SELECT date(time),COUNT(DISTINCT comment) FROM data GROUP BY date(time) ``` But I need a day end to be set at 4pm. So all comments before 4pm is day N, and news after 4pm are day N+1. This isnt a global thing, so I'd rather not change tim...
2012/12/16
[ "https://Stackoverflow.com/questions/13905941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1575088/" ]
By looping it can be done the following way :) ``` num1= int(input('Enter the number')) sum1 = num1 #making a alt int to store the value of the orginal so it wont be affected y = [] #making a list while True: if(sum1==0):#checking if the number is not zero so it can break if it is break d = sum1%10 #l...
Takes an integer as input and converts it into list of digits. code: ```py num = int(input()) print(list(str(num))) ``` output using 156789: ```py >>> ['1', '5', '6', '7', '8', '9'] ```
13,905,941
I am trying to count events that happen in a day, which in itself is easy: ``` SELECT date(time),COUNT(DISTINCT comment) FROM data GROUP BY date(time) ``` But I need a day end to be set at 4pm. So all comments before 4pm is day N, and news after 4pm are day N+1. This isnt a global thing, so I'd rather not change tim...
2012/12/16
[ "https://Stackoverflow.com/questions/13905941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1575088/" ]
### you can use: First convert the value in a string to iterate it, Them each value can be convert to a Integer `value = 12345` `l = [ int(item) for item in str(value) ]`
Takes an integer as input and converts it into list of digits. code: ```py num = int(input()) print(list(str(num))) ``` output using 156789: ```py >>> ['1', '5', '6', '7', '8', '9'] ```
13,905,941
I am trying to count events that happen in a day, which in itself is easy: ``` SELECT date(time),COUNT(DISTINCT comment) FROM data GROUP BY date(time) ``` But I need a day end to be set at 4pm. So all comments before 4pm is day N, and news after 4pm are day N+1. This isnt a global thing, so I'd rather not change tim...
2012/12/16
[ "https://Stackoverflow.com/questions/13905941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1575088/" ]
If you have a string like this: '123456' and you want a list of integers like this: [1,2,3,4,5,6], use this: ``` >>>s = '123456' >>>list1 = [int(i) for i in list(s)] >>>print(list1) [1,2,3,4,5,6] ``` or if you want a list of strings like this: ['1','2','3','4','5','6'], use this: ``` >>>s = '123456' >>>lis...
``` num = list(str(100)) index = len(num) while index > 0: index -= 1 num[index] = int(num[index]) print(num) ``` It prints `[1, 0, 0]` object.
13,905,941
I am trying to count events that happen in a day, which in itself is easy: ``` SELECT date(time),COUNT(DISTINCT comment) FROM data GROUP BY date(time) ``` But I need a day end to be set at 4pm. So all comments before 4pm is day N, and news after 4pm are day N+1. This isnt a global thing, so I'd rather not change tim...
2012/12/16
[ "https://Stackoverflow.com/questions/13905941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1575088/" ]
``` n = int(raw_input("n= ")) def int_to_list(n): l = [] while n != 0: l = [n % 10] + l n = n // 10 return l print int_to_list(n) ```
By looping it can be done the following way :) ``` num1= int(input('Enter the number')) sum1 = num1 #making a alt int to store the value of the orginal so it wont be affected y = [] #making a list while True: if(sum1==0):#checking if the number is not zero so it can break if it is break d = sum1%10 #l...
13,905,941
I am trying to count events that happen in a day, which in itself is easy: ``` SELECT date(time),COUNT(DISTINCT comment) FROM data GROUP BY date(time) ``` But I need a day end to be set at 4pm. So all comments before 4pm is day N, and news after 4pm are day N+1. This isnt a global thing, so I'd rather not change tim...
2012/12/16
[ "https://Stackoverflow.com/questions/13905941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1575088/" ]
Use `list` on a number converted to string: ``` In [1]: [int(x) for x in list(str(123))] Out[2]: [1, 2, 3] ```
### you can use: First convert the value in a string to iterate it, Them each value can be convert to a Integer `value = 12345` `l = [ int(item) for item in str(value) ]`
13,905,941
I am trying to count events that happen in a day, which in itself is easy: ``` SELECT date(time),COUNT(DISTINCT comment) FROM data GROUP BY date(time) ``` But I need a day end to be set at 4pm. So all comments before 4pm is day N, and news after 4pm are day N+1. This isnt a global thing, so I'd rather not change tim...
2012/12/16
[ "https://Stackoverflow.com/questions/13905941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1575088/" ]
> > There are already great methods already mentioned on this page, however it does seem a little obscure as to which to use. So I have added some mesurements so you can more easily decide for yourself: > > > --- *A large number has been used (for overhead) `1111111111111122222222222222222333333333333333333333`* ...
If you have a string like this: '123456' and you want a list of integers like this: [1,2,3,4,5,6], use this: ``` >>>s = '123456' >>>list1 = [int(i) for i in list(s)] >>>print(list1) [1,2,3,4,5,6] ``` or if you want a list of strings like this: ['1','2','3','4','5','6'], use this: ``` >>>s = '123456' >>>lis...
13,905,941
I am trying to count events that happen in a day, which in itself is easy: ``` SELECT date(time),COUNT(DISTINCT comment) FROM data GROUP BY date(time) ``` But I need a day end to be set at 4pm. So all comments before 4pm is day N, and news after 4pm are day N+1. This isnt a global thing, so I'd rather not change tim...
2012/12/16
[ "https://Stackoverflow.com/questions/13905941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1575088/" ]
> > There are already great methods already mentioned on this page, however it does seem a little obscure as to which to use. So I have added some mesurements so you can more easily decide for yourself: > > > --- *A large number has been used (for overhead) `1111111111111122222222222222222333333333333333333333`* ...
### you can use: First convert the value in a string to iterate it, Them each value can be convert to a Integer `value = 12345` `l = [ int(item) for item in str(value) ]`
13,905,941
I am trying to count events that happen in a day, which in itself is easy: ``` SELECT date(time),COUNT(DISTINCT comment) FROM data GROUP BY date(time) ``` But I need a day end to be set at 4pm. So all comments before 4pm is day N, and news after 4pm are day N+1. This isnt a global thing, so I'd rather not change tim...
2012/12/16
[ "https://Stackoverflow.com/questions/13905941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1575088/" ]
If you have a string like this: '123456' and you want a list of integers like this: [1,2,3,4,5,6], use this: ``` >>>s = '123456' >>>list1 = [int(i) for i in list(s)] >>>print(list1) [1,2,3,4,5,6] ``` or if you want a list of strings like this: ['1','2','3','4','5','6'], use this: ``` >>>s = '123456' >>>lis...
```python num = 123 print(num) num = list(str(num)) num = [int(i) for i in num] print(num) ```
13,905,941
I am trying to count events that happen in a day, which in itself is easy: ``` SELECT date(time),COUNT(DISTINCT comment) FROM data GROUP BY date(time) ``` But I need a day end to be set at 4pm. So all comments before 4pm is day N, and news after 4pm are day N+1. This isnt a global thing, so I'd rather not change tim...
2012/12/16
[ "https://Stackoverflow.com/questions/13905941", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1575088/" ]
Convert the integer to string first, and then use `map` to apply `int` on it: ``` >>> num = 132 >>> map(int, str(num)) #note, This will return a map object in python 3. [1, 3, 2] ``` or using a list comprehension: ``` >>> [int(x) for x in str(num)] [1, 3, 2] ```
```python num = 123 print(num) num = list(str(num)) num = [int(i) for i in num] print(num) ```
38,738,566
I am trying to hide the title, "City", when someone clicks on a div. For ex. if a click on Victoria div, then title, "City", is hidden for that div only, other divs remain unaffected. If you click on Toronto div, its title "City" is hidden and title of Victoria div is shown. It's similar to my previous question, "How t...
2016/08/03
[ "https://Stackoverflow.com/questions/38738566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6654264/" ]
Do you want following behavior: ```js $(document).ready(function() { $(".cityContainer > div").click(function() { $(".cityContainer").find(".active").removeClass("active"); $(this).addClass("active"); }); }); ``` ```css .active .CityTitle { display: none; } ``` ```html <script src="https://ajax....
I think below solution may be helpfull to you , create a click event of the div , and find the class 'CityTitle' which you right in you code and hide using the class. Try this code: ``` $('document').on('click','div',function(){ $(this).find('.CityTitle').hide(); }) ``` I hope this will help to you.
38,738,566
I am trying to hide the title, "City", when someone clicks on a div. For ex. if a click on Victoria div, then title, "City", is hidden for that div only, other divs remain unaffected. If you click on Toronto div, its title "City" is hidden and title of Victoria div is shown. It's similar to my previous question, "How t...
2016/08/03
[ "https://Stackoverflow.com/questions/38738566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6654264/" ]
Do you want following behavior: ```js $(document).ready(function() { $(".cityContainer > div").click(function() { $(".cityContainer").find(".active").removeClass("active"); $(this).addClass("active"); }); }); ``` ```css .active .CityTitle { display: none; } ``` ```html <script src="https://ajax....
```js $('.cityName').click(function(){ $(this).parent().find('.cityHeading').hide(); }) ``` ```css .cityBorder{border:1px solid #000; padding:10px; margin-bottom:10px} .cityHeading{display:block} ``` ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="cit...
38,738,566
I am trying to hide the title, "City", when someone clicks on a div. For ex. if a click on Victoria div, then title, "City", is hidden for that div only, other divs remain unaffected. If you click on Toronto div, its title "City" is hidden and title of Victoria div is shown. It's similar to my previous question, "How t...
2016/08/03
[ "https://Stackoverflow.com/questions/38738566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6654264/" ]
I think below solution may be helpfull to you , create a click event of the div , and find the class 'CityTitle' which you right in you code and hide using the class. Try this code: ``` $('document').on('click','div',function(){ $(this).find('.CityTitle').hide(); }) ``` I hope this will help to you.
```js $('.cityName').click(function(){ $(this).parent().find('.cityHeading').hide(); }) ``` ```css .cityBorder{border:1px solid #000; padding:10px; margin-bottom:10px} .cityHeading{display:block} ``` ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="cit...
12,983,497
Anyone know a good way to see if the user is online/offline? When I use public static bool IsConnectedToNetwork(); and see if it's false/true it seems to always be true, even when I shut down my internet to test it... Am I missing something? ``` public static bool nets() { bool go = System.Net.NetworkInf...
2012/10/19
[ "https://Stackoverflow.com/questions/12983497", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1667125/" ]
I use ``` public static bool IsConnectedToInternet() { ConnectionProfile connectionProfile = NetworkInformation.GetInternetConnectionProfile(); return (connectionProfile!=null && connectionProfile.GetNetworkConnectivityLevel() == NetworkConnectivityLevel.InternetAccess); } ```
You could ping one of the few well known URLs to see if you get responses.
12,983,497
Anyone know a good way to see if the user is online/offline? When I use public static bool IsConnectedToNetwork(); and see if it's false/true it seems to always be true, even when I shut down my internet to test it... Am I missing something? ``` public static bool nets() { bool go = System.Net.NetworkInf...
2012/10/19
[ "https://Stackoverflow.com/questions/12983497", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1667125/" ]
I use ``` public static bool IsConnectedToInternet() { ConnectionProfile connectionProfile = NetworkInformation.GetInternetConnectionProfile(); return (connectionProfile!=null && connectionProfile.GetNetworkConnectivityLevel() == NetworkConnectivityLevel.InternetAccess); } ```
I have a way that seems to work pretty decent, especially noticing sometimes Ethernet could appear to be in use even when its not in Windows 8 RTM... That's why nothing seems to work! However, doing the following is a good choice for me to test... ``` var profile = Windows.Networking.Connectivity.NetworkInformati...
44,049,052
I have dataframe in this form: ``` Ticker P/E P/S P/B P/FCF Dividend No. 1 YELP 20.0 28.0 20.0 7.0 3.0 2 JRJC 19.0 6.0 1.0 21.0 3.0 3 BCOR 18.0 20.0 14.0 21.0 3.0 4 TTGT 17.0 24.0 15.0 9.0 2.0 5 WEB 16...
2017/05/18
[ "https://Stackoverflow.com/questions/44049052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6653602/" ]
You can use [`DataFrame.iloc`](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.iloc.html) for select all columns without first with [`DataFrame.div`](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.div.html) and [`DataFrame.max`](http://pandas.pydata.org/pandas-docs/stable/...
Try [pandas.DataFrame.max](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.max.html) .It should work fine just loop for all your columns
21,300,877
I'm fairly new to Jade and am wanting to display some outputted data as the `value` value of a text `input`. Like this: ``` input(type="text", name="date", value="THISRIGHTHURR") ``` But only the value needs to be `viewpost.date`. I've tried multiple ways and none seem to work: ``` input(type="text", name="date", v...
2014/01/23
[ "https://Stackoverflow.com/questions/21300877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1363827/" ]
You can try enclosing the variable in `#{}` to output it: `input(type="text", name="date", value="#{viewpost.date}")`
I realize this is old news, but I found that neither of these worked, and ended up doing it like this, for anyone stumped like I was: ``` input(type="text", placeholder=data.string) ``` and then in a script: ``` $(document).on('focus', 'input', function(){ var text = $(this).attr('placeholder'); $(this).va...
21,300,877
I'm fairly new to Jade and am wanting to display some outputted data as the `value` value of a text `input`. Like this: ``` input(type="text", name="date", value="THISRIGHTHURR") ``` But only the value needs to be `viewpost.date`. I've tried multiple ways and none seem to work: ``` input(type="text", name="date", v...
2014/01/23
[ "https://Stackoverflow.com/questions/21300877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1363827/" ]
Pug 0.1.0 (Jade 2.x) removed support for interpolation in attributes, so this works now: ``` input(type="text", name="date", value=viewpost.date) ``` See <https://github.com/pugjs/pug/issues/2305>
I realize this is old news, but I found that neither of these worked, and ended up doing it like this, for anyone stumped like I was: ``` input(type="text", placeholder=data.string) ``` and then in a script: ``` $(document).on('focus', 'input', function(){ var text = $(this).attr('placeholder'); $(this).va...
1,916,619
I find in Wikipedia that a matrix $A\in\mathbb{M}^{N\times n}$ has rank one if it can be written as the following tensor product $$A=a\otimes b,$$ with $b\in \mathbb{R}^N$ and $a\in\mathbb{R}^n$. I know that a matrix has rank one if one is the maximum number of linearly independent colums of the matrix. Why a rank o...
2016/09/06
[ "https://math.stackexchange.com/questions/1916619", "https://math.stackexchange.com", "https://math.stackexchange.com/users/175279/" ]
For example $$\begin{pmatrix}1&1&1\\2&2&2\\3&3&3\end{pmatrix}$$ has rank one and is $(1,1,1)\otimes (1,2,3)$
Look at the first non-zero column of $A$. That is $b$. Then every other column of $A$ is a multiple $b$, since the rank of $A$ is $1$. $a$ consists of these proportionality constants, in order.
1,916,619
I find in Wikipedia that a matrix $A\in\mathbb{M}^{N\times n}$ has rank one if it can be written as the following tensor product $$A=a\otimes b,$$ with $b\in \mathbb{R}^N$ and $a\in\mathbb{R}^n$. I know that a matrix has rank one if one is the maximum number of linearly independent colums of the matrix. Why a rank o...
2016/09/06
[ "https://math.stackexchange.com/questions/1916619", "https://math.stackexchange.com", "https://math.stackexchange.com/users/175279/" ]
Let a matrix $A$ have columns $\vec{a}\_i$, $i = 1, \dots, N$. A rank one matrix is characterised by the fact that all columns $\vec{a}\_i$ are linearly dependent, that is $$ \vec{a}\_i = b\_i \vec{a} $$ for some vector $\vec{a}$ and scalars $b\_i$. Thus, the matrix $A$ takes the form $$ A = (b\_1 \vec{a}, \dots, b\_N ...
For example $$\begin{pmatrix}1&1&1\\2&2&2\\3&3&3\end{pmatrix}$$ has rank one and is $(1,1,1)\otimes (1,2,3)$
1,916,619
I find in Wikipedia that a matrix $A\in\mathbb{M}^{N\times n}$ has rank one if it can be written as the following tensor product $$A=a\otimes b,$$ with $b\in \mathbb{R}^N$ and $a\in\mathbb{R}^n$. I know that a matrix has rank one if one is the maximum number of linearly independent colums of the matrix. Why a rank o...
2016/09/06
[ "https://math.stackexchange.com/questions/1916619", "https://math.stackexchange.com", "https://math.stackexchange.com/users/175279/" ]
Let a matrix $A$ have columns $\vec{a}\_i$, $i = 1, \dots, N$. A rank one matrix is characterised by the fact that all columns $\vec{a}\_i$ are linearly dependent, that is $$ \vec{a}\_i = b\_i \vec{a} $$ for some vector $\vec{a}$ and scalars $b\_i$. Thus, the matrix $A$ takes the form $$ A = (b\_1 \vec{a}, \dots, b\_N ...
Look at the first non-zero column of $A$. That is $b$. Then every other column of $A$ is a multiple $b$, since the rank of $A$ is $1$. $a$ consists of these proportionality constants, in order.
1,916,619
I find in Wikipedia that a matrix $A\in\mathbb{M}^{N\times n}$ has rank one if it can be written as the following tensor product $$A=a\otimes b,$$ with $b\in \mathbb{R}^N$ and $a\in\mathbb{R}^n$. I know that a matrix has rank one if one is the maximum number of linearly independent colums of the matrix. Why a rank o...
2016/09/06
[ "https://math.stackexchange.com/questions/1916619", "https://math.stackexchange.com", "https://math.stackexchange.com/users/175279/" ]
The matrix $A$ is matrix of some linear map $\mathcal{A} \in \{\mathbb R^n \to \mathbb R^N\}$. Having rank $1$ means that in some bases $\{a\_1,a\_2,...,a\_n\}$ and $\{b\_1,b\_2,...,b\_N\}$ of respective spaces its matrix is $$\pmatrix{ 1 & 0 & ... & 0 \\ 0 & 0 &... & 0 \\ ... & ... & ... & ... \\ 0 & 0 & ... & 0 }$$ a...
Look at the first non-zero column of $A$. That is $b$. Then every other column of $A$ is a multiple $b$, since the rank of $A$ is $1$. $a$ consists of these proportionality constants, in order.
1,916,619
I find in Wikipedia that a matrix $A\in\mathbb{M}^{N\times n}$ has rank one if it can be written as the following tensor product $$A=a\otimes b,$$ with $b\in \mathbb{R}^N$ and $a\in\mathbb{R}^n$. I know that a matrix has rank one if one is the maximum number of linearly independent colums of the matrix. Why a rank o...
2016/09/06
[ "https://math.stackexchange.com/questions/1916619", "https://math.stackexchange.com", "https://math.stackexchange.com/users/175279/" ]
Let a matrix $A$ have columns $\vec{a}\_i$, $i = 1, \dots, N$. A rank one matrix is characterised by the fact that all columns $\vec{a}\_i$ are linearly dependent, that is $$ \vec{a}\_i = b\_i \vec{a} $$ for some vector $\vec{a}$ and scalars $b\_i$. Thus, the matrix $A$ takes the form $$ A = (b\_1 \vec{a}, \dots, b\_N ...
The matrix $A$ is matrix of some linear map $\mathcal{A} \in \{\mathbb R^n \to \mathbb R^N\}$. Having rank $1$ means that in some bases $\{a\_1,a\_2,...,a\_n\}$ and $\{b\_1,b\_2,...,b\_N\}$ of respective spaces its matrix is $$\pmatrix{ 1 & 0 & ... & 0 \\ 0 & 0 &... & 0 \\ ... & ... & ... & ... \\ 0 & 0 & ... & 0 }$$ a...
47,414,819
I was new to Machine Learning and stuck with this. When I was trying to implement polynomial regression in Linear model, like using several degree of polynomials range(1,10) and get different MSE. I actually use `GridsearchCV` method to find the best parameters for polynomial. ``` from sklearn.model_selection import ...
2017/11/21
[ "https://Stackoverflow.com/questions/47414819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8792187/" ]
Try this: ```html <div style="display:flex;"> <img src="https://i.imgur.com/hHzrRsf.jpg" style="width:160px;align-self: center;"> </div> ``` By default, `align-self` is set to `stretch` and remove the original height of your image.
```html <div style="display:flex;"> <img src="https://i.imgur.com/hHzrRsf.jpg" style="width:160px; height:100%;"></div> </div> ``` You can use Hight 100% that will be easy for you to understand
6,020,674
I am decoding some text using Base64. I have tried three different libraries (commons `Base64`, `Java.misc.`, and also java.mail) in Java and all of them produce same result for the following text, which is not right. However when I use Ruby to decode the below string I get different output. I get the right result...
2011/05/16
[ "https://Stackoverflow.com/questions/6020674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/449987/" ]
The result of decoding base64 is *binary* data. You shouldn't really try to print it as if it were text. Without knowing Ruby, I'd expect the result of calling `Base64.decode64` to be some sort of byte array... and that could be converted into text in any number of ways. Look at the *bytes* of what's returned to find...
Are you trying to print out into Text? that won't work, try using a ByteArray to store the decoded string. Example: ``` BASE64Decoder decoder = new BASE64Decoder(); byte[] decodedBytes = decoder.decodeBuffer(encodedBytes); ```
6,020,674
I am decoding some text using Base64. I have tried three different libraries (commons `Base64`, `Java.misc.`, and also java.mail) in Java and all of them produce same result for the following text, which is not right. However when I use Ruby to decode the below string I get different output. I get the right result...
2011/05/16
[ "https://Stackoverflow.com/questions/6020674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/449987/" ]
The result of decoding base64 is *binary* data. You shouldn't really try to print it as if it were text. Without knowing Ruby, I'd expect the result of calling `Base64.decode64` to be some sort of byte array... and that could be converted into text in any number of ways. Look at the *bytes* of what's returned to find...
The decoded string actually starts with 'FLV': ``` require 'base64' Base64.decode64('RkxWAQEAAAAJAAAAABIAAK4AAAAAAAAAAgAKb25NZXRhRGF0YQgAAAAHAAV3aWR0aABAdAAAAAAA AAAGaGVpZ2h0AEB0AAAAAAAAAAlmcmFtZXJhdGUAQBAAAAAAAAAADHZpZGVvY29kZWNpZABACAAA AAAAAAAMY2FuU2Vla1RvRW5kAQEAD21ldGFkYXRhY3JlYXRvcgIAKVNpbXBsZUZMVldyaXRlci5h cyB...
6,020,674
I am decoding some text using Base64. I have tried three different libraries (commons `Base64`, `Java.misc.`, and also java.mail) in Java and all of them produce same result for the following text, which is not right. However when I use Ruby to decode the below string I get different output. I get the right result...
2011/05/16
[ "https://Stackoverflow.com/questions/6020674", "https://Stackoverflow.com", "https://Stackoverflow.com/users/449987/" ]
Are you trying to print out into Text? that won't work, try using a ByteArray to store the decoded string. Example: ``` BASE64Decoder decoder = new BASE64Decoder(); byte[] decodedBytes = decoder.decodeBuffer(encodedBytes); ```
The decoded string actually starts with 'FLV': ``` require 'base64' Base64.decode64('RkxWAQEAAAAJAAAAABIAAK4AAAAAAAAAAgAKb25NZXRhRGF0YQgAAAAHAAV3aWR0aABAdAAAAAAA AAAGaGVpZ2h0AEB0AAAAAAAAAAlmcmFtZXJhdGUAQBAAAAAAAAAADHZpZGVvY29kZWNpZABACAAA AAAAAAAMY2FuU2Vla1RvRW5kAQEAD21ldGFkYXRhY3JlYXRvcgIAKVNpbXBsZUZMVldyaXRlci5h cyB...
30,861,786
i'm try to apply actionbar in my android, i copied a menu xml from another app to current app (/res/layout/menu/actionbarmenu.xml) here is the code: ``` <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/media_play" android:ico...
2015/06/16
[ "https://Stackoverflow.com/questions/30861786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/925552/" ]
You should use app namespace for menu which is part of appcompat. ``` <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res/auto"> <item android:id="@+id/media_play" android:icon="@android:drawable/ic_media_...
The `android:showAsAction` has been added in API 11 and your app has probably lower minimum API level. You can use the AppCompat library which will provide this parameter and its desired behavior, however, to reffer the AppCompat parameter you have to call it within the right XML namespace. The namespace is included b...
23,820
I was down by Boston's Charles River Esplanade yesterday, and it was picture-postcard pretty. I took a break from my usual practice of taking pictures of my kids to take a picture of the view from the Longfellow Bridge: ![The Charles River and Back Bay neighborhood as seen from the Longfellow Bridge](https://i.stack.i...
2012/05/28
[ "https://photo.stackexchange.com/questions/23820", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/1943/" ]
Ask yourself the following before you press the shutter: 1 - **Is it a good location?** I'm quite familiar with that location so I'll mention some specifics: the Longfellow bridge is a beautiful view in person, but there are 2 flaws that make it tough to produce a compelling photo. (1) It's a narrow bridge, roughly a...
Some possibilities are to look for stand-out items or different perspectives or elements which look different. (OK - why not just summarise that as striking and/or different?). Many landscapes tend to not have much detail, so getting something to stand out can be difficult. So involving the foreground which is clos...
23,820
I was down by Boston's Charles River Esplanade yesterday, and it was picture-postcard pretty. I took a break from my usual practice of taking pictures of my kids to take a picture of the view from the Longfellow Bridge: ![The Charles River and Back Bay neighborhood as seen from the Longfellow Bridge](https://i.stack.i...
2012/05/28
[ "https://photo.stackexchange.com/questions/23820", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/1943/" ]
Ask yourself the following before you press the shutter: 1 - **Is it a good location?** I'm quite familiar with that location so I'll mention some specifics: the Longfellow bridge is a beautiful view in person, but there are 2 flaws that make it tough to produce a compelling photo. (1) It's a narrow bridge, roughly a...
My 5 cents: Some nature's effects will be a good (or maybe the best) option on this photo. **Clouds**: before weather change, for example before storm, or big clouds of interested forms. **Fog**: in the morning before, or just during sunrise. **Time**: sunrise or sunset or eclipse of the sun! :) (I don't that place...
23,820
I was down by Boston's Charles River Esplanade yesterday, and it was picture-postcard pretty. I took a break from my usual practice of taking pictures of my kids to take a picture of the view from the Longfellow Bridge: ![The Charles River and Back Bay neighborhood as seen from the Longfellow Bridge](https://i.stack.i...
2012/05/28
[ "https://photo.stackexchange.com/questions/23820", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/1943/" ]
Ask yourself the following before you press the shutter: 1 - **Is it a good location?** I'm quite familiar with that location so I'll mention some specifics: the Longfellow bridge is a beautiful view in person, but there are 2 flaws that make it tough to produce a compelling photo. (1) It's a narrow bridge, roughly a...
@DHall gave a good, complete answer. To give you a concrete example (and I have not stood on the same bridge as you did so I don't have an apples-to-apples image), I shot this: ![enter image description here](https://i.stack.imgur.com/EmeRt.jpg) The differences between the two image (in my mind) are: * In your image...
23,820
I was down by Boston's Charles River Esplanade yesterday, and it was picture-postcard pretty. I took a break from my usual practice of taking pictures of my kids to take a picture of the view from the Longfellow Bridge: ![The Charles River and Back Bay neighborhood as seen from the Longfellow Bridge](https://i.stack.i...
2012/05/28
[ "https://photo.stackexchange.com/questions/23820", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/1943/" ]
My 5 cents: Some nature's effects will be a good (or maybe the best) option on this photo. **Clouds**: before weather change, for example before storm, or big clouds of interested forms. **Fog**: in the morning before, or just during sunrise. **Time**: sunrise or sunset or eclipse of the sun! :) (I don't that place...
Some possibilities are to look for stand-out items or different perspectives or elements which look different. (OK - why not just summarise that as striking and/or different?). Many landscapes tend to not have much detail, so getting something to stand out can be difficult. So involving the foreground which is clos...
23,820
I was down by Boston's Charles River Esplanade yesterday, and it was picture-postcard pretty. I took a break from my usual practice of taking pictures of my kids to take a picture of the view from the Longfellow Bridge: ![The Charles River and Back Bay neighborhood as seen from the Longfellow Bridge](https://i.stack.i...
2012/05/28
[ "https://photo.stackexchange.com/questions/23820", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/1943/" ]
@DHall gave a good, complete answer. To give you a concrete example (and I have not stood on the same bridge as you did so I don't have an apples-to-apples image), I shot this: ![enter image description here](https://i.stack.imgur.com/EmeRt.jpg) The differences between the two image (in my mind) are: * In your image...
Some possibilities are to look for stand-out items or different perspectives or elements which look different. (OK - why not just summarise that as striking and/or different?). Many landscapes tend to not have much detail, so getting something to stand out can be difficult. So involving the foreground which is clos...
23,820
I was down by Boston's Charles River Esplanade yesterday, and it was picture-postcard pretty. I took a break from my usual practice of taking pictures of my kids to take a picture of the view from the Longfellow Bridge: ![The Charles River and Back Bay neighborhood as seen from the Longfellow Bridge](https://i.stack.i...
2012/05/28
[ "https://photo.stackexchange.com/questions/23820", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/1943/" ]
@DHall gave a good, complete answer. To give you a concrete example (and I have not stood on the same bridge as you did so I don't have an apples-to-apples image), I shot this: ![enter image description here](https://i.stack.imgur.com/EmeRt.jpg) The differences between the two image (in my mind) are: * In your image...
My 5 cents: Some nature's effects will be a good (or maybe the best) option on this photo. **Clouds**: before weather change, for example before storm, or big clouds of interested forms. **Fog**: in the morning before, or just during sunrise. **Time**: sunrise or sunset or eclipse of the sun! :) (I don't that place...
645,113
I was wondering if anyone could tell me a little more about this: > > For the tests in Module 3 you need a clock generator that supplies single clock pulses with a well-defined positive (rising) and negative (falling) edge. This can be built using the 74HC14 hex Schmitt trigger (or a 74HC132 quad NAND Schmitt trigger...
2022/12/05
[ "https://electronics.stackexchange.com/questions/645113", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/326152/" ]
> > For the tests in Module 3 you need a clock generator that supplies single clock pulses with a well-defined positive (rising) and negative (falling) edge. > > > What this means, in this context, is that your clock should have edges that rise and fall sharply. In addition, the clock should not "chatter" (i.e. gi...
The first circuit is designed to debounce the switch. As shown it should work provided the time constant of R2 and C are significantly longer than the expected bounce time of the switch (typically a few milliseconds). Virtually any Schmitt trigger IC will do the job, you only appear to have the 74HC14 available. And ye...
67,991,462
I'm wondering what the idiomatic way in Scala would be to convert a `Seq` of `Option[A]` to an `Option[Seq[A]]`, where the result is `None` if any of the input options were `None`.
2021/06/15
[ "https://Stackoverflow.com/questions/67991462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3907602/" ]
AFAIK, CAN-based systems are usually not designed to be plug-and-play, so the ID collusion does not happen in real world. The systems are static, all the nodes are known in advance, in the design phase, with all the frames needed to achieve the wanted functions. In Automotive world, the OEM will create a document with...
Take a look at this post <https://os.mbed.com/forum/electronics/topic/28241/?page=1#comment-59250> maybe could answer your question. > > you have likely learned that a CAN message has an identifier, and up > to 8-bytes of data (ignoring some of the other bits in the stream). It > is essential that no two nodes send t...
40,133,018
I have an one table as below a picture which indicates some duplicated rows.I can find the duplicated rows but I could not able to delete it because of there is no any unique ID that I can distinguish. There were lots of duplicated rows like that in same table I just screenshot a piece of that. As a result,according t...
2016/10/19
[ "https://Stackoverflow.com/questions/40133018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6880851/" ]
I think you can use [`merge_ordered`](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.merge_ordered.html): ``` #first convert columns to datetime df1.Quarter_End = pd.to_datetime(df1.Quarter_End) df2.Date = pd.to_datetime(df2.Date) df = pd.merge_ordered(df1, df2, ...
* `set_index` * `pd.concat` to align indices * `groupby` with `agg` --- ``` prd_df = period_df.set_index(['Company', 'Quarter_End']) prc_df = price_df.set_index(['Company', 'Date'], drop=False) df = pd.concat([prd_df, prc_df], axis=1) df.groupby([df.index.get_level_values(0), df.Period.bfill()]) \ .agg(dict(Dat...
21,136,056
Now i am able to apply pixel of another image to source image pixel of pg to m. but problem is that i m loosing gradient or fading effect. ``` public static void main(String[] args){ try { BufferedImage image = ImageIO.read(new File("c:\\m.png")); BufferedImage patt = ImageIO.read...
2014/01/15
[ "https://Stackoverflow.com/questions/21136056", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2857029/" ]
`0xff000000` is opaque black, `0x00000000` is completely transparent. What is `0` (the colour you chose)? Yes, it's transparent. Try `0xff000000` or even better: `argb ^ 0xff000000`, which just changes the transparency, instead. ``` if(((argb>>24) & 0xff) == 0) { bff.setR...
For `BufferedImage.setRGB(int x, int y, int rgb)` the `rgb` value is made up as follows: ``` 11111111 11111111 11111111 11111111 Alpha Red Green Blue ``` In your code you test the following: ``` if (((argb >> 24) & 0xff) == 0) ``` which tests for an Alpha value of 0, thus completely transparent. When y...
117,893
How can I pass a series of parameters to an unbound drop down from a lookup object? Would I run a SOQL query and populate a List? Or is there another method to populate a dropdown with a values from a lookup table (and not a pick list) Here is the VisualForce page where I'd like the unbound control ``` <apex:outpu...
2016/04/13
[ "https://salesforce.stackexchange.com/questions/117893", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/26241/" ]
**Note that this is an answer to an earlier version of the question.** You are making the field describe call on: ``` ... Business_Unit__c.name ... ``` which is not a picklist field and so will return a zero length array of `PicklistEntry` which in turn will result in no select list options. Use the API name of yo...
This is what I did. Big ups to Keith C for pointing me in the right direction Controller ``` public List<SelectOption> getUnits() { List<SelectOption> options = new List<SelectOption>(); List<Business_Unit__c> units = new List<Business_Unit__c>(); units = [SELECT Name FROM Business_Unit__c...
88,069
I need help with the connotation of the phrase *flip flop*. Let me explain – I am working on a small project that is meant to promote travelling and education through travelling and getting to know other cultures. I have to come up with a catchy name for it. “Flip-flop nation” came to mind but I was wondering if used i...
2012/10/25
[ "https://english.stackexchange.com/questions/88069", "https://english.stackexchange.com", "https://english.stackexchange.com/users/28948/" ]
As far as our subjective opinions are concerned, the primary use of flip-flop for me is a set of logic gates that comprise a single bit of memory. But that's just me and I don't think this would have any impact. The secondary meaning is a person (politician) who changes allegiances (and opinions) to be always "with th...
*Flip-flops*, as you probably know, are a kind of footwear worn without socks and of which one part passes between the big toe and the adjacent toe. The name comes from the way in which the sole oscillates between the ground and the sole of the foot. They are known in some places as thongs. Some British politicians hav...
88,069
I need help with the connotation of the phrase *flip flop*. Let me explain – I am working on a small project that is meant to promote travelling and education through travelling and getting to know other cultures. I have to come up with a catchy name for it. “Flip-flop nation” came to mind but I was wondering if used i...
2012/10/25
[ "https://english.stackexchange.com/questions/88069", "https://english.stackexchange.com", "https://english.stackexchange.com/users/28948/" ]
I would associate the phrase *Flip-flop nation* with the sort of poverty illustrated here... ![Poverty in the Congo](https://i.stack.imgur.com/fSzIA.jpg) ...where it's implied that the entire nation is only shod in flip-flops, if that. I suppose that this depend on the understanding of *flip-flop,* which I take to be...
*Flip-flops*, as you probably know, are a kind of footwear worn without socks and of which one part passes between the big toe and the adjacent toe. The name comes from the way in which the sole oscillates between the ground and the sole of the foot. They are known in some places as thongs. Some British politicians hav...
88,069
I need help with the connotation of the phrase *flip flop*. Let me explain – I am working on a small project that is meant to promote travelling and education through travelling and getting to know other cultures. I have to come up with a catchy name for it. “Flip-flop nation” came to mind but I was wondering if used i...
2012/10/25
[ "https://english.stackexchange.com/questions/88069", "https://english.stackexchange.com", "https://english.stackexchange.com/users/28948/" ]
As far as our subjective opinions are concerned, the primary use of flip-flop for me is a set of logic gates that comprise a single bit of memory. But that's just me and I don't think this would have any impact. The secondary meaning is a person (politician) who changes allegiances (and opinions) to be always "with th...
I'm having a hard time making the jump from *flip flop* to travel and multicultural experiences. Perhaps *to and fro* carries the connotation that you're trying to convey? From NOAD: > > **to and fro** *noun* constant movement backward and forward > >                                     • constant change in ac...
88,069
I need help with the connotation of the phrase *flip flop*. Let me explain – I am working on a small project that is meant to promote travelling and education through travelling and getting to know other cultures. I have to come up with a catchy name for it. “Flip-flop nation” came to mind but I was wondering if used i...
2012/10/25
[ "https://english.stackexchange.com/questions/88069", "https://english.stackexchange.com", "https://english.stackexchange.com/users/28948/" ]
As far as our subjective opinions are concerned, the primary use of flip-flop for me is a set of logic gates that comprise a single bit of memory. But that's just me and I don't think this would have any impact. The secondary meaning is a person (politician) who changes allegiances (and opinions) to be always "with th...
I'll agree with others that "flip-flop" probably does not convey the idea you want. Yes, if I heard "Flip-Flop Nation", my first thought would be, "country of people who change their minds constantly". Next thought would be "country of people who wear sandals". If told neither of these were correct, I might think of SF...
88,069
I need help with the connotation of the phrase *flip flop*. Let me explain – I am working on a small project that is meant to promote travelling and education through travelling and getting to know other cultures. I have to come up with a catchy name for it. “Flip-flop nation” came to mind but I was wondering if used i...
2012/10/25
[ "https://english.stackexchange.com/questions/88069", "https://english.stackexchange.com", "https://english.stackexchange.com/users/28948/" ]
I would associate the phrase *Flip-flop nation* with the sort of poverty illustrated here... ![Poverty in the Congo](https://i.stack.imgur.com/fSzIA.jpg) ...where it's implied that the entire nation is only shod in flip-flops, if that. I suppose that this depend on the understanding of *flip-flop,* which I take to be...
I'm having a hard time making the jump from *flip flop* to travel and multicultural experiences. Perhaps *to and fro* carries the connotation that you're trying to convey? From NOAD: > > **to and fro** *noun* constant movement backward and forward > >                                     • constant change in ac...
88,069
I need help with the connotation of the phrase *flip flop*. Let me explain – I am working on a small project that is meant to promote travelling and education through travelling and getting to know other cultures. I have to come up with a catchy name for it. “Flip-flop nation” came to mind but I was wondering if used i...
2012/10/25
[ "https://english.stackexchange.com/questions/88069", "https://english.stackexchange.com", "https://english.stackexchange.com/users/28948/" ]
I would associate the phrase *Flip-flop nation* with the sort of poverty illustrated here... ![Poverty in the Congo](https://i.stack.imgur.com/fSzIA.jpg) ...where it's implied that the entire nation is only shod in flip-flops, if that. I suppose that this depend on the understanding of *flip-flop,* which I take to be...
I'll agree with others that "flip-flop" probably does not convey the idea you want. Yes, if I heard "Flip-Flop Nation", my first thought would be, "country of people who change their minds constantly". Next thought would be "country of people who wear sandals". If told neither of these were correct, I might think of SF...
16,586,116
We accept the accented characters such as `Ḿấxiḿứś` from a html form, when using hibernate saves it into the database the string becomes `??xi???` Then I did a SQL update, trying to write the accented words directly into the database, the same result happened. The desired behavior is to set into the dabase as what it...
2013/05/16
[ "https://Stackoverflow.com/questions/16586116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/719278/" ]
Only one of these works: nvarchar datatype and N prefix for unicode constants. ``` DECLARE @foo1 varchar(10) = 'Ḿấxiḿứś', @foo2 varchar(10) = N'Ḿấxiḿứś', @fooN1 nvarchar(10) = 'Ḿấxiḿứś', @fooN2 nvarchar(10) = N'Ḿấxiḿứś'; SELECT @foo1, @foo2, @fooN1, @fooN2; ``` You have to ensure that all dataty...
``` ALTER TABLE "tablename" Alter COLUMN "columnname" nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS ```
16,586,116
We accept the accented characters such as `Ḿấxiḿứś` from a html form, when using hibernate saves it into the database the string becomes `??xi???` Then I did a SQL update, trying to write the accented words directly into the database, the same result happened. The desired behavior is to set into the dabase as what it...
2013/05/16
[ "https://Stackoverflow.com/questions/16586116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/719278/" ]
Only one of these works: nvarchar datatype and N prefix for unicode constants. ``` DECLARE @foo1 varchar(10) = 'Ḿấxiḿứś', @foo2 varchar(10) = N'Ḿấxiḿứś', @fooN1 nvarchar(10) = 'Ḿấxiḿứś', @fooN2 nvarchar(10) = N'Ḿấxiḿứś'; SELECT @foo1, @foo2, @fooN1, @fooN2; ``` You have to ensure that all dataty...
``` ALTER TABLE table_name ALTER COLUMN coloumn_name NVARCHAR(40) null ``` if you are using hibernate that's all you need. I have attempted to change the table collation but it didn't work, maybe you have to backup your data, create a fresh database with the new collation then pop back the data. my database settin...
16,586,116
We accept the accented characters such as `Ḿấxiḿứś` from a html form, when using hibernate saves it into the database the string becomes `??xi???` Then I did a SQL update, trying to write the accented words directly into the database, the same result happened. The desired behavior is to set into the dabase as what it...
2013/05/16
[ "https://Stackoverflow.com/questions/16586116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/719278/" ]
``` ALTER TABLE table_name ALTER COLUMN coloumn_name NVARCHAR(40) null ``` if you are using hibernate that's all you need. I have attempted to change the table collation but it didn't work, maybe you have to backup your data, create a fresh database with the new collation then pop back the data. my database settin...
``` ALTER TABLE "tablename" Alter COLUMN "columnname" nvarchar(64) COLLATE SQL_Latin1_General_CP1_CI_AS ```
10,225,435
In [Book](https://rads.stackoverflow.com/amzn/click/com/143023024X) I found a sentence that tells me that ARC releases only Object from Foundation. Is this true? So if i have: ``` MySimpleClass *objectFromMySimpleClass = [MySimpleClass alloc] init]; ``` I should release objectFromMySimpleClass? How can i do that? Wh...
2012/04/19
[ "https://Stackoverflow.com/questions/10225435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1317394/" ]
`MySimpleClass` inherits `NSObject`, hence it is a Foundation Object, so it can be managed by ARC.
Yes,ARC Work for all object and you cant use release and retain at runtime.
307,061
Equivalently, is $X$ the pushout of the $X\_i$ over their intersection?
2013/02/18
[ "https://math.stackexchange.com/questions/307061", "https://math.stackexchange.com", "https://math.stackexchange.com/users/62807/" ]
If $X$ has a finite closed cover of subspaces $X\_1$ and $X\_2$ then $F \subset X$ is closed iff $F \cap X\_1$ is closed in $X\_1$ and $F \cap X\_2$ is closed in $X\_2$. One direction uses the definition of the subspace topology (left to right) and right to left uses 2 facts: firstly, a subset $A$ that is closed (in th...
The union of two open sets is open...
62,833,007
As it said in the [PHP manual](https://www.php.net/manual/en/function.array-unshift.php) about `array_unshift()` function: > > 7.3.0 This function can now be called with only one parameter. Formerly, at least two parameters have been required. > > > I didn't get it. How to use such function with only one paramete...
2020/07/10
[ "https://Stackoverflow.com/questions/62833007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5497749/" ]
An async function returns the incomplete task to the caller at its first incomplete `await`. After that the `await` on the calling side will await that task to become complete. Without the `await Task.Delay(1)`, `Calc()` does not have any awaits of its own, so will only return to the caller when it runs to the end. At...
By using an async/await pattern, you intend for your `Calc` method to run as a task: ```cs Task<int> a = Calc(18000); ``` We need to establish that tasks are generally *asynchronous* in their nature, but not *parallel* - parallelism is a feature of threads. However, under the hood, *some* thread will be used to exec...
62,833,007
As it said in the [PHP manual](https://www.php.net/manual/en/function.array-unshift.php) about `array_unshift()` function: > > 7.3.0 This function can now be called with only one parameter. Formerly, at least two parameters have been required. > > > I didn't get it. How to use such function with only one paramete...
2020/07/10
[ "https://Stackoverflow.com/questions/62833007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5497749/" ]
It's important to understand how `async` methods work. First, they start running synchronously, on the same thread, just like every other method. Without that `await Task.Delay(1)` line, the compiler will have warned you that the method would be completely synchronous. The `async` keyword doesn't, by itself, make your...
An async function returns the incomplete task to the caller at its first incomplete `await`. After that the `await` on the calling side will await that task to become complete. Without the `await Task.Delay(1)`, `Calc()` does not have any awaits of its own, so will only return to the caller when it runs to the end. At...
62,833,007
As it said in the [PHP manual](https://www.php.net/manual/en/function.array-unshift.php) about `array_unshift()` function: > > 7.3.0 This function can now be called with only one parameter. Formerly, at least two parameters have been required. > > > I didn't get it. How to use such function with only one paramete...
2020/07/10
[ "https://Stackoverflow.com/questions/62833007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5497749/" ]
layman's version.... nothing in the process is yielding CPU time back **without** 'delay' and so it doesn't give anything else CPU time, you are confusing this with multiple threaded code. "async and await" is **not** about multiple threaded but about using the CPU (thread/threads) when its doing **non** CPU work" aka...
By using an async/await pattern, you intend for your `Calc` method to run as a task: ```cs Task<int> a = Calc(18000); ``` We need to establish that tasks are generally *asynchronous* in their nature, but not *parallel* - parallelism is a feature of threads. However, under the hood, *some* thread will be used to exec...
62,833,007
As it said in the [PHP manual](https://www.php.net/manual/en/function.array-unshift.php) about `array_unshift()` function: > > 7.3.0 This function can now be called with only one parameter. Formerly, at least two parameters have been required. > > > I didn't get it. How to use such function with only one paramete...
2020/07/10
[ "https://Stackoverflow.com/questions/62833007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5497749/" ]
It's important to understand how `async` methods work. First, they start running synchronously, on the same thread, just like every other method. Without that `await Task.Delay(1)` line, the compiler will have warned you that the method would be completely synchronous. The `async` keyword doesn't, by itself, make your...
By using an async/await pattern, you intend for your `Calc` method to run as a task: ```cs Task<int> a = Calc(18000); ``` We need to establish that tasks are generally *asynchronous* in their nature, but not *parallel* - parallelism is a feature of threads. However, under the hood, *some* thread will be used to exec...
62,833,007
As it said in the [PHP manual](https://www.php.net/manual/en/function.array-unshift.php) about `array_unshift()` function: > > 7.3.0 This function can now be called with only one parameter. Formerly, at least two parameters have been required. > > > I didn't get it. How to use such function with only one paramete...
2020/07/10
[ "https://Stackoverflow.com/questions/62833007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5497749/" ]
It's important to understand how `async` methods work. First, they start running synchronously, on the same thread, just like every other method. Without that `await Task.Delay(1)` line, the compiler will have warned you that the method would be completely synchronous. The `async` keyword doesn't, by itself, make your...
layman's version.... nothing in the process is yielding CPU time back **without** 'delay' and so it doesn't give anything else CPU time, you are confusing this with multiple threaded code. "async and await" is **not** about multiple threaded but about using the CPU (thread/threads) when its doing **non** CPU work" aka...
65,071,742
[enter image description here](https://i.stack.imgur.com/C6Y1W.jpg) I am Facing **ios version** issue in objective c. **Navigationbar image shadow** is not working in **ios 14 version**. and ios **< 14** working fine. i upload image so here is my code --- ``` if ([[[UIDevice currentDevice] systemVersion] floatValu...
2020/11/30
[ "https://Stackoverflow.com/questions/65071742", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14215143/" ]
I resolved issue below is my code: ``` if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 14.0) { [[UINavigationBar appearance] setBackgroundImage: [UIImage new] forBarMetrics: UIBarMetricsDefault]; self.navigationController.navigationBar.shadowImage = [UIImage ...
In objective - c ``` [[UINavigationBar appearance] setBackgroundImage: [UIImage new] forBarMetrics: UIBarMetricsDefault]; self.navigationController.navigationBar.translucent = YES; self.navigationController.navigationBar.shadowImage = [UIImage new]; [UINavigationBar appearance].tintC...
446,708
I have the following command set used to update all my WordPress sites in my CentOs shared-hosting partition on my hosting provider's platform (via daily cron). The `wp` commands inside the `pushd-popd` set, are of the [WP-CLI](https://wp-cli.org/) program, which is a Bash extension used for various shell-level action...
2018/05/29
[ "https://unix.stackexchange.com/questions/446708", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/273994/" ]
The `> file` operator opens the `file` for writing but truncates it initially. That means that each new `> file` causes the content of the file to be replaced. If you'd want the `myErrors.txt` to contain the error of all the commands, you'd need either to open that file only once, or use `>` the first time and `>>` th...
You can use curly braces to [*group*](https://www.gnu.org/software/bash/manual/html_node/Command-Grouping.html) a block and redirect all the output: ``` for dir in public_html/*/; do if pushd "$dir"; then { wp plugin update --all wp core update wp language core update ...
30,564,442
Suppose you have a PHP script that (for whatever reason) takes several minutes to run. If the user closes the browser while the script is running, does the script stop running, or does it execute instructions up to the end of the script?
2015/06/01
[ "https://Stackoverflow.com/questions/30564442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2644137/" ]
PHP is a server-side language. All processing is done on the server, not in the client. Once the request is sent to the server, the client loses control over it. This means that the server's configuration on timing out will come into effect on such long queries, but closing your browser will have no effect. If you ha...
There's not a reliable way for the server to know that the client no longer cares about the request. In general, it will keep running until something stops it.
37,567,293
I am getting the following error. Getting the error at `SELECT CASE` statement. > > PLS-00428: an INTO clause is expected in this SELECT statement > > > ``` FOR REMS IN cur_names LOOP SELECT CASE WHEN EXISTS (SELECT 1 FROM SupplyTable WHERE FirstName = REMS....
2016/06/01
[ "https://Stackoverflow.com/questions/37567293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2281858/" ]
you can´t have a random select inside your pl sql code. It must be in a loop, cursor, with an into clause. Just include an into clause here. ``` declare v_value varchar2(1); begin ... FOR REMS IN cur_names LOOP SELECT CASE WHEN EXISTS (SELECT 1 FROM SupplyTable ...
You need to store the output somewhere , like a variable. `REC_EXISTS` is a column, so right after the select it no longer exists. Try this: ``` declare rec_exists varchar2(1);; FOR REMS IN cur_names LOOP SELECT CASE WHEN EXISTS (SELECT 1 FROM SupplyTable WHERE F...
51,708,193
We have an ASP.NET core startup class. In the constructor we perform a back-end database call with some initialization. If this fails and an exception is thrown the ASP.NET core application gives the message 'An exception has occured while starting the application'. We would like the system to perform the startup agai...
2018/08/06
[ "https://Stackoverflow.com/questions/51708193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2174621/" ]
You shouldn’t do any logic inside of the `Startup` constructor. If you want to perform some action at the beginning of your application, before the server actually starts, then you should do that at the `WebHost` level. By default, the `Main` in `Program.cs` looks like this: ``` CreateWebHostBuilder(args).Build().Run...
For running code `per request`, you could place these code in `Middleware` which will run on every request. ``` app.Use(async (context,next) => { using (var serviceScope = app.ApplicationServices.CreateScope()) { if (true) //add your own logic to decide whether to run t...
207,325
> > There are no items for you to review, matching the filter "[vba] > [excel-vba]" > > > I know all I have been reviewing lately have had a filter on it but I didn't expect to run out after a few days of reviewing :O The last questions I was reviewing were about 2 years old. Where does that >90K come from then...
2013/11/14
[ "https://meta.stackexchange.com/questions/207325", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/-1/" ]
When you run out of posts to review for your chosen tags, then I'd filter on 'Too broad' and 'Primarily opinion based'. Most questions already flagged for those reasons are very easy to recognize as close candidates. Skip any that are unclear to you, but those two reasons should easily exhaust your daily review votes ...
Start by removing the tags that you have and see what comes up. In cases where you are unfamiliar with the subject matter and don't want to make a judgement you can just press 'skip'. After you do that for a bunch of posts, you get an idea about which tags don't have enough reviews.
31,916,582
I am trying to fetch images tags from a specific div in a web page. Here is the web page link [page link](http://www.aliexpress.com/item/Free-Shipping-Luxury-New-Fashion-Anna-su-3D-Blink-Diamond-Crystal-Pearl-Flowers-For-iPhone-4G/1951144778.html?spm=2114.11010108.13.4.uQlqFV) I have used this code: ``` var webGet = ...
2015/08/10
[ "https://Stackoverflow.com/questions/31916582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2238821/" ]
Check your compliance settings in: > > Preferences > Java > Compiler > > > Make sure the default is set to 1.7 as it may have defaulted to 1.8 after the initial install/run. Also check project-specific compliance settings in: > > (Project) Properties > Java Compiler > > >
I have similar issue with Mars on Pydev environment. Seems that Mars want java jre 1.7.0, so for me was work by copy inside(create if not avaiable) eclipse\jre\ folder and copy the 1.7.0 version of jre inside
31,916,582
I am trying to fetch images tags from a specific div in a web page. Here is the web page link [page link](http://www.aliexpress.com/item/Free-Shipping-Luxury-New-Fashion-Anna-su-3D-Blink-Diamond-Crystal-Pearl-Flowers-For-iPhone-4G/1951144778.html?spm=2114.11010108.13.4.uQlqFV) I have used this code: ``` var webGet = ...
2015/08/10
[ "https://Stackoverflow.com/questions/31916582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2238821/" ]
If you already changed all settings to 1.7 (both in the eclipse preferences and the project properties) check your project's build path. How? Easy, after you've imported your project, right-button click it and select Build path > Configure Build Path. Then, check if you have your JRE system library correctly set. If e...
I have similar issue with Mars on Pydev environment. Seems that Mars want java jre 1.7.0, so for me was work by copy inside(create if not avaiable) eclipse\jre\ folder and copy the 1.7.0 version of jre inside
31,916,582
I am trying to fetch images tags from a specific div in a web page. Here is the web page link [page link](http://www.aliexpress.com/item/Free-Shipping-Luxury-New-Fashion-Anna-su-3D-Blink-Diamond-Crystal-Pearl-Flowers-For-iPhone-4G/1951144778.html?spm=2114.11010108.13.4.uQlqFV) I have used this code: ``` var webGet = ...
2015/08/10
[ "https://Stackoverflow.com/questions/31916582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2238821/" ]
I changed Windows ->Preference->Java->Installed JREs to jdk1.7.0\_79 and right clicked the project, Properties ->Java Build Path, made sure that under Libraries tab, it is JRE System Library[JavaSE-1.7]. Clicked Project ->Clean. Right clicked the project again, Properties ->Java Compiler, checked Use compliance from ex...
I have similar issue with Mars on Pydev environment. Seems that Mars want java jre 1.7.0, so for me was work by copy inside(create if not avaiable) eclipse\jre\ folder and copy the 1.7.0 version of jre inside
31,916,582
I am trying to fetch images tags from a specific div in a web page. Here is the web page link [page link](http://www.aliexpress.com/item/Free-Shipping-Luxury-New-Fashion-Anna-su-3D-Blink-Diamond-Crystal-Pearl-Flowers-For-iPhone-4G/1951144778.html?spm=2114.11010108.13.4.uQlqFV) I have used this code: ``` var webGet = ...
2015/08/10
[ "https://Stackoverflow.com/questions/31916582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2238821/" ]
1. Go to Windows >> Preferences>>Compiler >> Unselect default compliance settings >> select the compiler compliance level to 1.8 2. This should reflect in generated .class files compatibility as 1.8 and source compatibility as 1.8 Step Step 3. Apply it Step 4. now click on apply and close 5. clean and build the project...
I have similar issue with Mars on Pydev environment. Seems that Mars want java jre 1.7.0, so for me was work by copy inside(create if not avaiable) eclipse\jre\ folder and copy the 1.7.0 version of jre inside
31,916,582
I am trying to fetch images tags from a specific div in a web page. Here is the web page link [page link](http://www.aliexpress.com/item/Free-Shipping-Luxury-New-Fashion-Anna-su-3D-Blink-Diamond-Crystal-Pearl-Flowers-For-iPhone-4G/1951144778.html?spm=2114.11010108.13.4.uQlqFV) I have used this code: ``` var webGet = ...
2015/08/10
[ "https://Stackoverflow.com/questions/31916582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2238821/" ]
Check your compliance settings in: > > Preferences > Java > Compiler > > > Make sure the default is set to 1.7 as it may have defaulted to 1.8 after the initial install/run. Also check project-specific compliance settings in: > > (Project) Properties > Java Compiler > > >
If you already changed all settings to 1.7 (both in the eclipse preferences and the project properties) check your project's build path. How? Easy, after you've imported your project, right-button click it and select Build path > Configure Build Path. Then, check if you have your JRE system library correctly set. If e...
31,916,582
I am trying to fetch images tags from a specific div in a web page. Here is the web page link [page link](http://www.aliexpress.com/item/Free-Shipping-Luxury-New-Fashion-Anna-su-3D-Blink-Diamond-Crystal-Pearl-Flowers-For-iPhone-4G/1951144778.html?spm=2114.11010108.13.4.uQlqFV) I have used this code: ``` var webGet = ...
2015/08/10
[ "https://Stackoverflow.com/questions/31916582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2238821/" ]
Check your compliance settings in: > > Preferences > Java > Compiler > > > Make sure the default is set to 1.7 as it may have defaulted to 1.8 after the initial install/run. Also check project-specific compliance settings in: > > (Project) Properties > Java Compiler > > >
I changed Windows ->Preference->Java->Installed JREs to jdk1.7.0\_79 and right clicked the project, Properties ->Java Build Path, made sure that under Libraries tab, it is JRE System Library[JavaSE-1.7]. Clicked Project ->Clean. Right clicked the project again, Properties ->Java Compiler, checked Use compliance from ex...
31,916,582
I am trying to fetch images tags from a specific div in a web page. Here is the web page link [page link](http://www.aliexpress.com/item/Free-Shipping-Luxury-New-Fashion-Anna-su-3D-Blink-Diamond-Crystal-Pearl-Flowers-For-iPhone-4G/1951144778.html?spm=2114.11010108.13.4.uQlqFV) I have used this code: ``` var webGet = ...
2015/08/10
[ "https://Stackoverflow.com/questions/31916582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2238821/" ]
Check your compliance settings in: > > Preferences > Java > Compiler > > > Make sure the default is set to 1.7 as it may have defaulted to 1.8 after the initial install/run. Also check project-specific compliance settings in: > > (Project) Properties > Java Compiler > > >
1. Go to Windows >> Preferences>>Compiler >> Unselect default compliance settings >> select the compiler compliance level to 1.8 2. This should reflect in generated .class files compatibility as 1.8 and source compatibility as 1.8 Step Step 3. Apply it Step 4. now click on apply and close 5. clean and build the project...
31,916,582
I am trying to fetch images tags from a specific div in a web page. Here is the web page link [page link](http://www.aliexpress.com/item/Free-Shipping-Luxury-New-Fashion-Anna-su-3D-Blink-Diamond-Crystal-Pearl-Flowers-For-iPhone-4G/1951144778.html?spm=2114.11010108.13.4.uQlqFV) I have used this code: ``` var webGet = ...
2015/08/10
[ "https://Stackoverflow.com/questions/31916582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2238821/" ]
I changed Windows ->Preference->Java->Installed JREs to jdk1.7.0\_79 and right clicked the project, Properties ->Java Build Path, made sure that under Libraries tab, it is JRE System Library[JavaSE-1.7]. Clicked Project ->Clean. Right clicked the project again, Properties ->Java Compiler, checked Use compliance from ex...
If you already changed all settings to 1.7 (both in the eclipse preferences and the project properties) check your project's build path. How? Easy, after you've imported your project, right-button click it and select Build path > Configure Build Path. Then, check if you have your JRE system library correctly set. If e...
31,916,582
I am trying to fetch images tags from a specific div in a web page. Here is the web page link [page link](http://www.aliexpress.com/item/Free-Shipping-Luxury-New-Fashion-Anna-su-3D-Blink-Diamond-Crystal-Pearl-Flowers-For-iPhone-4G/1951144778.html?spm=2114.11010108.13.4.uQlqFV) I have used this code: ``` var webGet = ...
2015/08/10
[ "https://Stackoverflow.com/questions/31916582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2238821/" ]
I changed Windows ->Preference->Java->Installed JREs to jdk1.7.0\_79 and right clicked the project, Properties ->Java Build Path, made sure that under Libraries tab, it is JRE System Library[JavaSE-1.7]. Clicked Project ->Clean. Right clicked the project again, Properties ->Java Compiler, checked Use compliance from ex...
1. Go to Windows >> Preferences>>Compiler >> Unselect default compliance settings >> select the compiler compliance level to 1.8 2. This should reflect in generated .class files compatibility as 1.8 and source compatibility as 1.8 Step Step 3. Apply it Step 4. now click on apply and close 5. clean and build the project...
2,713,869
``` public static void main(String[] args) { int [][]shatner = new int[1][1]; int []rat = new int[4]; shatner[0] = rat; System.out.println(shatner[0][3]); } ``` surprised, The output is 0, why Java doesn't check this kind of indexOutOfBound error?
2010/04/26
[ "https://Stackoverflow.com/questions/2713869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/304910/" ]
There is no index out of bounds error. shatner is an array of arrays. You replaced the first array of length one with a new one of length four. So now shatner[0][3] is a perfectly legit place in memory.
Arrays need not be rectangular in Java. This is a jagged array and is perfectly fine.
2,713,869
``` public static void main(String[] args) { int [][]shatner = new int[1][1]; int []rat = new int[4]; shatner[0] = rat; System.out.println(shatner[0][3]); } ``` surprised, The output is 0, why Java doesn't check this kind of indexOutOfBound error?
2010/04/26
[ "https://Stackoverflow.com/questions/2713869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/304910/" ]
There is nothing going out of bounds. The 0th row in the `shatner` array gets reinitialized to `int[4]`.
I'm thinking it's because java's arrays are working a bit differently than expected. You initialize `shatner` to [1][1], meaning something like, `{{0},{0}}` in memory. However, you then assign an integer to the first element, turning it into `{{0,0,0,0},{0}}` in memory, so Java is addressing the newly assigned index.
2,713,869
``` public static void main(String[] args) { int [][]shatner = new int[1][1]; int []rat = new int[4]; shatner[0] = rat; System.out.println(shatner[0][3]); } ``` surprised, The output is 0, why Java doesn't check this kind of indexOutOfBound error?
2010/04/26
[ "https://Stackoverflow.com/questions/2713869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/304910/" ]
It's not that Java doesn't check the IndexOutOfBoundsException. It's that the answer SHOULD be zero. The key line is ``` shatner[0] = rat; ``` Since that means that the 0th index of `shatner` is pointing to an array of length 4, `shatner[0][4]` is totally valid.
Arrays need not be rectangular in Java. This is a jagged array and is perfectly fine.
2,713,869
``` public static void main(String[] args) { int [][]shatner = new int[1][1]; int []rat = new int[4]; shatner[0] = rat; System.out.println(shatner[0][3]); } ``` surprised, The output is 0, why Java doesn't check this kind of indexOutOfBound error?
2010/04/26
[ "https://Stackoverflow.com/questions/2713869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/304910/" ]
Where do you see an "indexOutOfBound error"? The code does the following: * Initalize an array (size 1) of `int` arrays (size 1), i.e. a 2D array, contents are intialized with 0 * Initalize a array of `int`, size 4, content is intialized with 0 * set the single element of the 2D array to the size 4 1D array * access t...
There is nothing going out of bounds. The 0th row in the `shatner` array gets reinitialized to `int[4]`.
2,713,869
``` public static void main(String[] args) { int [][]shatner = new int[1][1]; int []rat = new int[4]; shatner[0] = rat; System.out.println(shatner[0][3]); } ``` surprised, The output is 0, why Java doesn't check this kind of indexOutOfBound error?
2010/04/26
[ "https://Stackoverflow.com/questions/2713869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/304910/" ]
There is no index out of bounds error. shatner is an array of arrays. You replaced the first array of length one with a new one of length four. So now shatner[0][3] is a perfectly legit place in memory.
I'm thinking it's because java's arrays are working a bit differently than expected. You initialize `shatner` to [1][1], meaning something like, `{{0},{0}}` in memory. However, you then assign an integer to the first element, turning it into `{{0,0,0,0},{0}}` in memory, so Java is addressing the newly assigned index.
2,713,869
``` public static void main(String[] args) { int [][]shatner = new int[1][1]; int []rat = new int[4]; shatner[0] = rat; System.out.println(shatner[0][3]); } ``` surprised, The output is 0, why Java doesn't check this kind of indexOutOfBound error?
2010/04/26
[ "https://Stackoverflow.com/questions/2713869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/304910/" ]
Where do you see an "indexOutOfBound error"? The code does the following: * Initalize an array (size 1) of `int` arrays (size 1), i.e. a 2D array, contents are intialized with 0 * Initalize a array of `int`, size 4, content is intialized with 0 * set the single element of the 2D array to the size 4 1D array * access t...
I'm thinking it's because java's arrays are working a bit differently than expected. You initialize `shatner` to [1][1], meaning something like, `{{0},{0}}` in memory. However, you then assign an integer to the first element, turning it into `{{0,0,0,0},{0}}` in memory, so Java is addressing the newly assigned index.
2,713,869
``` public static void main(String[] args) { int [][]shatner = new int[1][1]; int []rat = new int[4]; shatner[0] = rat; System.out.println(shatner[0][3]); } ``` surprised, The output is 0, why Java doesn't check this kind of indexOutOfBound error?
2010/04/26
[ "https://Stackoverflow.com/questions/2713869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/304910/" ]
Don't be surprised. shatner[0] is an array (rat) and happens to be of length 4. So shartner[0][3] is rat[3] which happens to be 0..
There is no index out of bounds error. shatner is an array of arrays. You replaced the first array of length one with a new one of length four. So now shatner[0][3] is a perfectly legit place in memory.