qid
int64
10
74.7M
question
stringlengths
15
26.2k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
27
28.1k
response_k
stringlengths
23
26.8k
124,191
I'm on the academic job market this season for a position in a STEM field. I've had one on-campus interview and may receive an offer from this school within the next week or so. I've also had Skype interviews with a few other schools, but haven't received any on-campus invites from them. (The Skype interviews occurred ...
2019/02/01
[ "https://academia.stackexchange.com/questions/124191", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/103883/" ]
Don't make assumptions. Nearly everywhere will let you know when you are no longer under consideration. You may or may not be high on their list. You could be high and they are just dithering. But they would rather make it definite, just to avoid fruitless communication. But it is probably a mistake to tell them you'...
A general advice in any job search (academia or civilian world or NFL) is to let the other parties know when things have become competitive. It doesn't guarantee you get something done with the other parties. But it will often move things along. Especially if you are a good candidate and are likely to come off the mark...
52,926,235
I ran into this problem where I have h6s and when you hover over them, the background turns grey (opacity: 0.25;) and when you hover out, the background turns transparent again. Then, when you click on it, the background turns grey and stays that way. For some reason, when I hover over a different h6, the background do...
2018/10/22
[ "https://Stackoverflow.com/questions/52926235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8268036/" ]
The style you set in function override the style you set in css [![enter image description here](https://i.stack.imgur.com/9FTVn.png)](https://i.stack.imgur.com/9FTVn.png) To prevent override do not set color : `$("#" + topic_list[i].split(" ").join("_") + "_directory").css("background", "")` (It's better than use ...
Your code could use some touch-ups, but I used what you wrote. Try this: ``` $(".topics").click(function(e) { // Set an "active" class for an active state $(".topics").removeClass("active"); $(this).addClass("active"); for (var i in topic_list) { if (this.id == topic_list[i].split(" ").join(...
28,631
When i change any data into salesforce code using eclipse and trying to save that then eclipse takes too much time but when i am doing this thing in sandbox it will get saved , deployed and synchronized quickly . Is there any way to decrease the delay between saving , deploying and synchronizing the code to server usi...
2014/02/24
[ "https://salesforce.stackexchange.com/questions/28631", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/4895/" ]
If you are only changing client-side resources for VF development, remember, you can reference those from anywhere. You shouldn't be inlining your JS or CSS anyway, so while you're fine-tuning, why not stick them in your own content server, edit them there, and then the refresh is immediate. I've done this two ways. ...
Hurrey !!!! I got the solution to this problem. You can save the pages , components , css etc through salesforce enviornment. Here are the Steps --> 1. Go to login.salesforce.com 2. Type your creadentials and logged into the SF. 3.Click on the name top corner , right hand side and click setup option. 4.click devel...
7,664
I have worked out some poor code to achieve the goal of 3D Delauney triangulation(random points in E3), but the time consuming is huge, and when five points are exactly (or nearly due to the round-off error) on one sphere, my code can not handle this situation properly. I use the basic data-structure which is a list o...
2013/06/14
[ "https://scicomp.stackexchange.com/questions/7664", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/4557/" ]
This is implemented in qhull which is available from scipy (python). If you cannot use these implementations directly for some reason, the explanations of the data structures in the docs might be helpful. <http://www.qhull.org/> <http://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.Delaunay.html#scipy.sp...
The data structure in 3D is pure algebraic. What you need to have is the following arrays: * `Vertex` `V`: the vertices' coordinates for the mesh, a $(\# \text{ of vertices}) \times 3$ array, with each column being $x$-, $y$- and $z$-coordinates, and the row index corresponds to the index of that vertex. * `Element t...
39,031,893
I have a table that looks like this: ``` id name date 1 prabhat 22-12-1989 2 Ashok 20-12-1978 3 prabhat 22-12-1986 4 Ashok 20-12-1974 5 prabhat 22-12-1889 6 Ashok 20-12-1900 ``` And I want to change the name from prabhat --> Ashok and Ashok--> prabhat in a single query Thanks.
2016/08/19
[ "https://Stackoverflow.com/questions/39031893", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3505302/" ]
One clever trick here would be to self-join your table on the `name` columns matching the names `prabhat` on one table and `Ashok` on the other (or vice-versa). Then you can simply do a single `SET` to update the value. ``` UPDATE yourTable t1 INNER JOIN yourTable t2 ON (t1.name = 'prabhat' AND t2.name = 'Ashok') ...
If you do select, it is easy: ``` SELECT id, `date`, if (name = 'prabhat', 'Ashok', if (name = 'Ashok', 'prabhat', name)) AS name FROM tab ``` If you update, you need to use a temp-value (which does not exist in the tab.name) ``` -- check if temp name exists SELECT count(*) FROM tab WHERE name = 'NON-EXIST-temp-n...
34,085,616
I have a code for extracting date from a text (format = mm-dd-yyyy) using regular expressions. **Note**: The text is obtained using OCR on a bill image. So, the expected date format is mm-dd-yyyy but it can be any random text as it is obtained using OCR. ``` import re date_reg_exp = re.compile('\d{2}[-/.]\d{2}[-/.]\d...
2015/12/04
[ "https://Stackoverflow.com/questions/34085616", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5196647/" ]
There are several ways you could implement approximate matching with regular expressions. The most "theoretically straightforward" approach would most probably require you to perform an [edit-distance](https://en.wikipedia.org/wiki/Edit_distance)-like [dynamic programming](https://en.wikipedia.org/wiki/Dynamic_programm...
**This is not what the title demands** but might turn up useful for your scenario as you mentioned Levenshtein distance. ``` from dateutil.parser import parse s = 'This is o text xtractud fram OCR O9-11-201' parse(s, fuzzy=True) datetime.datetime(201, 9, 11, 0, 0) ``` Dateutil offers a fuzzy datetime parser. Thi...
173,302
I've got a 9G backup from a dead Solaris machine (SS20) that I'm trying to mount via lofi in Solaris. It won't mount the entire image file and I'm not sure how to discover the partition layout so as to split it again with dd. Am I better off just finding an appropriate sized thumb drive and going that route?
2010/08/22
[ "https://serverfault.com/questions/173302", "https://serverfault.com", "https://serverfault.com/users/51980/" ]
Are you currently running Solaris on a SPARC machine or an x86 based one ? In the latter case, there is no way to mount the filesystem on it as the format is architecture dependant.
I'm not sure about Solaris, but with Linux there's a `-o loop` option. Could you try that and see if it works? If it doesn't, then edit your question and tell us what error message it's giving.
42,639,269
I am so close. I am trying to create a form that will upload a file to my Dropbox, and I can get it to work using a file on the server with the code here: ``` $path = 'render.png'; $fp = fopen($path, 'rb'); ch = curl_init('https://content.dropboxapi.com/2/files/upload'); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);...
2017/03/07
[ "https://Stackoverflow.com/questions/42639269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7669770/" ]
You need to duplicate `@group.users`: ``` group_members = @group.users.dup ``` This way `group_members` won't point to the original object, which will later be destroyed. You can also wrap this in a transaction in case `@group` doesn't destroy: ``` group_members = @group.users.dup if @group.transaction do @gro...
You have different ways to do this, but a "Rails like way to accomplish this is by using callbacks. The before\_destroy callback occurs right after any validation and before the actual destroy happens. You could do this in your model (assuming you are using ActiveRecord): ``` class Group < ActiveRecord::Base # Add ...
2,022,936
This is an exercise in my Analysis book that I find difficult. Suppose that {$a\_n$} is the Fibonacci sequence, and $b\_n=\frac{a\_{n+1}}{a\_n}$. Prove that {$b\_n$} converges to the Golden Number. First, of course, one has to prove that {$b\_n$} does converge. I think since $a\_n$ is increasing, and $a\_{n+1}-a\_n>a\...
2016/11/20
[ "https://math.stackexchange.com/questions/2022936", "https://math.stackexchange.com", "https://math.stackexchange.com/users/378977/" ]
**Hint**. By setting $$ I=\int\frac{\cos(x)\:dx}{2\cos(x)+3 \sin(x)}\quad J=\int\frac{\sin(x)\:dx}{2\cos(x)+3 \sin(x)} $$ One may observe that $$\begin{cases} 2 I+3J=\displaystyle\int 1\:dx \\ 3 I-2J=\displaystyle \int\frac{(2\cos(x)+3 \sin(x))'}{2\cos(x)+3 \sin(x)}\:dx \end{cases} $$ Can you take it from here?
Hint: Let $$2\sin x+3\cos x=A(3\sin x+2\cos x)+B\cdot\dfrac{d(3\sin x+2\cos x)}{dx}$$
52,986,966
``` if (col.gameObject.tag == "Enemy"){ transform.position = new Vector3(-9.5f, -4f, 0f)};` ``` In this program whenever the player touches an object called "enemy" it is supposed to "die", before removing the semi-colon, it "died" to anything it touched, now I removed it dies to nothing. Anyone know how to to ...
2018/10/25
[ "https://Stackoverflow.com/questions/52986966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9492366/" ]
Formik author here... `setError` was [deprecated in v0.8.0](https://github.com/formium/formik/releases/tag/v0.8.0) and renamed to `setStatus`. You can use `setErrors(errors)` or `setStatus(whateverYouWant)` in your `handleSubmit` function to get the behavior you want here like so: ```js handleSubmit = async (values, ...
**This what you're looking** ``` setErrors({ username: 'This is a dummy procedure error' }); ```
2,347
I do `C-a` `C-k` `C-k` to kill the entire line point is on. If I want to *copy* the line instead of killing it, I can hit `C-/` `C-/` right after typing the sequence above. Alternatively, I can do `C-a` `C-SPC` `C-n` `M-w`. **Is there a faster way to kill or copy the entire line point is on?**
2014/10/19
[ "https://emacs.stackexchange.com/questions/2347", "https://emacs.stackexchange.com", "https://emacs.stackexchange.com/users/504/" ]
You can use `kill-whole-line` to kill the entire line point is on. Position of point does not matter. This command is bound to `C-S-DEL` by default. You can also instruct `kill-line` (bound to `C-k`) to kill the entire line by setting the *variable* `kill-whole-line` to a non-`nil` value: ```el (setq kill-whole-line ...
This is a modification of the answer by itsjeyd – currently the highest voted answer, and one I have used for years. However, it has issues: The adviced version of `kill-ring-save` would sometime fail because the mark is not set (typically in a new buffer), and even when it did work, the cursor did a strange dance afte...
2,981,512
I do not understand the process that is required in order to find the max and min values of $|z|$ in $|z-2-i|=1$. My textbook implies to use inspection which I find a bit confusing. I tried to sketch out the curve but I have little idea on where the minimum and maximum values are. [![enter image description here](ht...
2018/11/02
[ "https://math.stackexchange.com/questions/2981512", "https://math.stackexchange.com", "https://math.stackexchange.com/users/321912/" ]
The minimal value of $\lvert z\rvert$ is reached at the point $P$ of the circle which is closest to the origin and the maximal value of $\lvert z\rvert$ is reached at the point $Q$ of the circle which is furthest from the origin. These points are$$P=2-\frac2{\sqrt5}+\left(1-\frac1{\sqrt5}\right)i\text{ and }Q=2+\frac2{...
Regarding those 4 points, you can do a direct computation. $$|A|= \sqrt{1^2+1^2} = \sqrt2\approx 1.4\\ |B|= 2\\|C|=\sqrt{1^2+3^2}=\sqrt{10}\approx 3.16 \\|D|=| 2+i + e^{i\pi/4}| = \sqrt{\left (2 + \frac{1}{\sqrt2}\right )^2+ \left (1 + \frac{1}{\sqrt2}\right )^2} \approx 3.2$$
59,413,022
Experiencing an issue with a program that finds the greatest out of three numbers and displays it. I think that I don't link the two files properly. Can somebody point out what I'm doing wrong and why it doesn't work? Thanks in advance. The code is written in two separate files - .html and .js. The code: ```js let p...
2019/12/19
[ "https://Stackoverflow.com/questions/59413022", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12566049/" ]
You are using `getElementById` alone. You need to call it from `document`. So: `document.getElementById`. Also, in your `pressedKey.addEventListener` you are missing a comma. Finally, in your html, you are closing your `input` elements with `</input>`. `input` is a void element and does not need a closing tag. See this...
``` <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Greatest number of 3.</title> <div id="numberList"></div> </head> <body> <h1>Calculate the greatest of three numbers!</h1> <hr color="cyan"> <br> Enter number one: <input class='num' type...
64,478,268
For testing purposes we have PS script to deploy our ARM templates to testing Resource Group. ``` $ctx = New-AzStorageContext -StorageAccountName $storageAccountName -UseConnectedAccount $sasToken = New-AzStorageContainerSASToken -Context $ctx -Name $containerName -Permission r -ExpiryTime (Get-Date).AddHours(1) $to...
2020/10/22
[ "https://Stackoverflow.com/questions/64478268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/679340/" ]
wrap your ListView.builder with Container provide a height to it. like for your code- ``` child: Stack( children: [ Container( height: 100.0, child: ListView.builder( itemCount: tasks.length, shrinkWrap: true , itemBuild...
you can just wrap `ListView` with an `Expanded` widget ``` Stack( children: [ Expanded( child: ListView.builder( itemCount: tasks.length, shrinkWrap: true , itemBuilder: (context, index) => ListTile( title: Text(tasks[index].name), ), ), ), ) ```
42,460,667
I have a `command-line` program that its first argument `( = argv[ 1 ] )` is a regex pattern. `./program 's/one-or-more/anything/gi/digit-digit'` So I need a regex to check if the entered input from user **is correct or not**. This regex can be solve easily but since I use [c++](/questions/tagged/c%2b%2b "show quest...
2017/02/25
[ "https://Stackoverflow.com/questions/42460667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4643584/" ]
You have an extra newline between the command `echo` and the string that you are telling the shell to echo, which is what is causing your error message. But you are also sending interactive commands to `sfdisk`, which is not an interactive tool. Your code appears to be based on the top of [this article](http://xmodulo...
A newline terminates a command. If you want to pass a multiline argument to `echo`, you need to move your quote. For example: ``` for i in $hdd; do echo "n p 1 w " | sfdisk $i done ``` It would probably look better to write: ``` for i in $hdd; do printf 'n\np\n1\n\nw\n' | sfdisk $i; done ``` A third option i...
49,960,934
I need to count the number of dupes in an array, but I'm constrained to only using arrays, no HashSets or ArrayLists. Here are example inputs with their expected outputs: ``` numDuplicates(new double[] { }) --> 0 numDuplicates(new double[] { 11.0 }) --> 0 numDuplicates(new double[] { 11.0, 11.0, 11.0, 11.0 }) --> 3 n...
2018/04/21
[ "https://Stackoverflow.com/questions/49960934", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9680116/" ]
Simple fix: ``` public static int numDuplicates (double[] list) { int dupCount = 0; for (int i = 0; i < list.length; i++) { for (int j = i + 1; j < list.length; j++, i++) { // HERE it is if (list[i] == list[j]) { dupCount++; } } } return dupCoun...
You could use another array like so: ``` public static int numDuplicates(double[] list) { double[] duparray = new double[list.length]; int dupCount = 0; for (int i = 0; i < list.length; i++) { for (int j = i + 1; j < list.length; j++) { if (list[i] == list[j] && !(list[i] == duparray[i...
51,902,363
I added a progress bar to my screen. I want it to be centered horizontally in my container, but I want to move it to the bottom of my screen. How do I edit the third line to change its position? ``` func addControls() { progressView = UIProgressView(progressViewStyle: UIProgressViewStyle.Default) progressView...
2018/08/17
[ "https://Stackoverflow.com/questions/51902363", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10229471/" ]
It will only clear the element in the index *right after* the last element in the original list, so in the first example the list is empty, hence it nullifies the element at index zero (the first element which is `"1"`). In your last example, it just happens that the last element is the one right after the last elemen...
Code of toArray(T[] a) of (for instance) ArrayList is quite clear: ``` public <T> T[] toArray(T[] a) { if (a.length < size) // Make a new array of a's runtime type, but my contents: return (T[]) Arrays.copyOf(elementData, size, a.getClass()); System.arraycopy(elementData, 0, a, 0, size); if...
56,030,927
I am getting an array in PHP as: ``` Array ( [1] => 2019 [2] => 5 [3] => 7 [4] => 0 ) ``` where [1] is always the year, [2] is always the month and [3] is always the date. How can I convert this array to `date("Y-m-d")` format?
2019/05/07
[ "https://Stackoverflow.com/questions/56030927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/777505/" ]
Assuming this data input: ``` $data = [null, 2019, 5, 7, 0]; ``` Using DateTime ``` $dt = new DateTime(sprintf( "%04d-%02d-%02d", $data[1], $data[2], $data[3])); echo $dt->format('Y-m-d') . "\n"; ``` Using Sprintf ``` // use this if you really trust the data $dt = sprintf( "%04d-%02d-%02d", $data[0], $data[1], ...
You might simply use concat and join them into a string: ``` $arr = array( "1" => "2019", "2" => "5", "3" => "7", "4" => "0", ); $datetime_format = $arr["1"] . "-" . $arr["2"] . "-" . $arr["3"]; var_dump($datetime_format); ``` ### Output ``` string(8) "2019-5-7" ``` If you wish to have a 4-2-2 ...
71,127,608
I would like to repeat an API call which returns a Promise, conditionally using rxjs. The API method receives an id which will be changed on every call by adding a counter prefix to it. The calls will be repeated until the data met some condition or the counter reach to a specific number X. How it can be done using rx...
2022/02/15
[ "https://Stackoverflow.com/questions/71127608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18213593/" ]
You can use concatMap to ensure only one call is tried at a time. `range` gives the maximum number of calls because `takeWhile` will unsubscribe early (before the range is done) if a condition is/isn't met. That might look like this: ```ts // the data met some condition function metCondition(data){ if(data/*somethi...
I know you've specified using rxjs, however you've also specified that `fetchData()` returns a `promise` and not an `observable`. In this case I would suggest using `async` and `await` rather than rxjs. ```js async retryFetch() { let counter = 0; while (counter++ < 20 && !this.data) { this.data = await...
26,784,319
I want to split a large text file into single words as I need to shuffle the letters of each word. ``` ReadFile file = new ReadFile(file_name); String[] aryLines = file.OpenFile(); ``` This is show I read in the textfile with text and gives an output of: ``` [This is Line One. , This is Line Two. , This is Line th...
2014/11/06
[ "https://Stackoverflow.com/questions/26784319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3952463/" ]
I want to offer a more modern solution using `DispatchGroup`. Usage example 1: ``` var urlRequest = URLRequest(url: config.pullUpdatesURL) urlRequest.httpMethod = "GET" urlRequest.httpBody = requestData urlRequest.addValue("application/json", forHTTPHeaderField: "Content-Type") urlRequest.addValue("Bearer \(token)", ...
Be careful with synchronous requests because it can result in bad user experience but I know sometimes its necessary. For synchronous requests use NSURLConnection: ``` func synchronousRequest() -> NSDictionary { //creating the request let url: NSURL! = NSURL(string: "exampledomain/...") var re...
22,911
As an IT guy I cannot avoid the observation that the states "30-30" and "40-40", "deuce", have the same outgoing transitions in the state machine "tennis game": From both scores a two point difference is necessary to win the game, and the state machine degenerates to a machine with three states (advantage for either of...
2019/08/07
[ "https://sports.stackexchange.com/questions/22911", "https://sports.stackexchange.com", "https://sports.stackexchange.com/users/17828/" ]
Deuce connotes that both players have scored their maximum per game without winning the game. Calling 30-30 'deuce' does not reflect this. Similarly, using 'advantage' before true deuce has been attained does not indicate that both players have scored their game max without winning the game.
With regard to "40-40": in court tennis (aka real tennis), when the handicap system is used "40-all" is called instead of "deuce" because the next point will win the handicapped game. In non-handicap play, as in lawn tennis, one needs to win by two points, so "deuce" (derived from deux (two)) is called to indicate this...
427,707
What's the origin of the expression "peanut gallery"? When was it first used? I know there is a similar expression in Spanish "gallinero", I wonder if they are equivalent.
2018/01/23
[ "https://english.stackexchange.com/questions/427707", "https://english.stackexchange.com", "https://english.stackexchange.com/users/9625/" ]
According to the OED, "peanut gallery" is an informal American term that originally referred to a location in a theater: > > the top gallery in a theatre or cinema, usually the location of the cheapest seats and hence regarded as the most vocal or rowdy section of the audience > > > (I have never heard the term u...
Whatever it may be now, 'peanut gallery' seems to have started as a thin veneer laid over more overtly racist names for segregated seating. The earliest use I could find of the specific phrase exposes the agenda: > > It is useless for us to repeat our praises of Johnny Thompson, Billy Reeves, and others of the compa...
41,877,041
I am checking for a config value to be set, if it is I want to redirect to a child route. if not just display as usual. The code does update the URL as expected but then gets into an infinite loop. `index.js` ``` import React from 'react' import { render } from 'react-dom' import { Router, Route, browserHistory, Inde...
2017/01/26
[ "https://Stackoverflow.com/questions/41877041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/236989/" ]
I had a similar problem. The solution was to implement what Shubham Khatri, suggested. However, an important point I originally missed was to attach the onEnter callback to an IndexRoute. I'm using standard JavaScript objects to define my routes. This is what I needed to do: ```js { path: '/', indexRoute: { on...
You `browserHistory.push()` statement is making it to go in an endless loop since the route is nested insided your `map` route. You need to make use of `replace` function and `callback` like. ``` function checkDefaultFloor(nextState, replace, callback){ if (settings.floorUrl){ console.log( settings.floorUrl); ...
73,907,515
I'm trying to understand as what can be done in order to enable cross platform communication with Microsoft Teams. I've researched but there is nothing from Microsoft that talks on this subject or even didn't find anything on Google. However, this is what is possible with Facebook messenger. I've created an application...
2022/09/30
[ "https://Stackoverflow.com/questions/73907515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4776754/" ]
You have to use `concat_ws` ``` from pyspark.sql.functions import concat_ws df = df.withColumn('joined_column',concat_ws('',df.p1, df.p2, df.p3, df.p4)) ```
you can use below code. If you will check your schema, the data in those columns may not be integer. You need to convert p1 to p4 as integer type ``` from pyspark.sql.types import IntegerType df = df \ .withColumn("p1" , df["p1"].cast(IntegerType())) \ .withColumn("p2", df["p2"].cast(IntegerType())) \ .w...
2,540,109
I'm brand new to java, coming from a ruby world. One thing I love about ruby is the very terse syntax such as ||=. I realize of course that a compiled language is different, but I'm wondering if Java has anything similar. In particular, what I do all the time in ruby is something like: ``` someVar ||= SomeClass.new...
2010/03/29
[ "https://Stackoverflow.com/questions/2540109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74389/" ]
I think the best you could do is the ternary operator: ``` someVar = (someVar == null) ? new SomeClass() : someVar; ```
This looks like you could add a method to SomeClass similar to ``` public static someClass enforce(someClass x) { someClass r = x.clone(); if(r == null){ r = new SomeClass(); } return r; } ``` And call it like ``` someVar = SomeClass.enforce(someVar); ```
266,486
I am trying to write out a png file from a java.awt.image.BufferedImage. Everything works fine but the resulting png is a 32-bit file. Is there a way to make the png file be 8-bit? The image is grayscale, but I do need transparency as this is an overlay image. I am using java 6, and I would prefer to return an OutputS...
2008/11/05
[ "https://Stackoverflow.com/questions/266486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The build in imageio png writer will write 32bit png files on all the platforms I have used it on, no matter what the source image is. You should also be aware that many people have complained that the resulting compression is much lower than what is possible with the png format. There are several independent [png libr...
I found the answer as to how to convert RGBA to Indexed here: <http://www.eichberger.de/2007/07/transparent-gifs-in-java.html> However, the resulting 8-bit png file only has 100% or 0% transparency. You could probably tweak the IndexColorModel arrays, but we have decided to make the generated file (what was an overlay...
569,357
is it possible to clear all textboxes in HTML by calling a javascript function ?
2009/02/20
[ "https://Stackoverflow.com/questions/569357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/65415/" ]
I think ``` $("input:text").val(""); ``` Should work with jQuery.
Old post..but, with jquery for example: ``` $("input[type=text],textarea,input[type=email]").val(''); ```
37,150,417
I am using a tab bar controller and I wonder if there is a way to check which tab is being clicked? If the user clicks on the "account" tab and is not logged in I want to redirect to a full screen modal login screen instead of the account VC.
2016/05/10
[ "https://Stackoverflow.com/questions/37150417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2636197/" ]
You can do it in your custom UITabBarController or somewhere, and override the 'didSelectItem' function. ``` import UIKit class TabbarViewController: UITabBarController { override func viewDidLoad() { } override func tabBar(tabBar: UITabBar, didSelectItem item: UITabBarItem) { print("Selected Index :\(s...
UITabBarDelegate's didSelectItem
22,574,698
I am using below PHP function in Behat Mink to check the Email column values are in ascending or descending order.But the problem is its always fails.I just want to check if the subject or From of Email column in all rows are in ascending and descending order.Is there are any other way to do this? ``` public function ...
2014/03/22
[ "https://Stackoverflow.com/questions/22574698", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2212566/" ]
You can wrap the svg element with a div element, and set styles to the div element, then enlarge the svg size enough to render whole graphic. ``` <div style="overflow:visible; margin-left:121px; margin-top:39px; height:206px; width:327px;"> <svg height="206px" width="500px"> <path d=" M 244.3,102.7 A 82.3...
`document.getElementsByTagName("path")[0].getBBox()` will get the bounds of the path (x, y, width, height) you can use those to set the `<svg>` element width and height.
9,998,832
I'm creating an array of view controllers, adding them to a UINavigation Controller, and then presenting them modally. I cannot however set the text to the "back" button in each view to anything other than the word "back". This is the code: ``` //The View Controllers and Array VC1 *vc1 = [[VC1 alloc] initWithNibNa...
2012/04/03
[ "https://Stackoverflow.com/questions/9998832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1128354/" ]
You can't do anything view-wise in the init. You need to wait for viewDidLoad (or willAppear or didAppear), since nothing has been drawn in init (in the case of the nav controller, the previous item will be affected). Here is what I do (in viewDidLoad): ``` UIBarButtonItem *doneButon = [[UIBarButtonItem alloc] initWi...
The back button test is automatically set to the title attribute of the UIViewController that is on the top of the stack. So in the viewDidAppear or viewDidLoad of each view controller set self.title to the text you want to appear in the "Back" button when a new view is pushed onto the stack.
111,305
I have a phd student that is very smart. They had a small baby a few months before starting the PhD in a foreign country and then moved to do the PhD with their family in the UK. It has been 7 months now and the PhD student is not performing well. We have weekly meetings and I try hard to guide and help (more than I n...
2018/06/16
[ "https://academia.stackexchange.com/questions/111305", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/42952/" ]
Have you communicated with the student clearly about the situation? It's easy to softball negative news so they might not realize just how dire their situation is. Sit them down and straightforwardly tell them that their options are ask for help or get sent home soon, like you have in this post. Currently, since you (...
The previous answers are excellent, and so I'd like to only add that it is worthwhile putting things in text. In case you have an in-person "heart to heart" in which you lay out the options and have a discussion with the student, sit down later on and summarize the discussion in an email that you send to the student. I...
1,137
I've recently been trying to 'install' stuff a lot less on my Windows machine (I hate installers - I need to know where programs put stuff...), choosing to use portable or standalone versions of applications instead. I put them all in a 'Programs' dir on a drive separate from my Windows partition, so whenever I reinst...
2009/07/15
[ "https://superuser.com/questions/1137", "https://superuser.com", "https://superuser.com/users/551/" ]
[XCOPY deployment](http://en.wikipedia.org/wiki/XCOPY_deployment) was announced by Microsoft as *the* way of the future a couple years ago. Still nothing :) Meantime, you might be interested in PortableApps.com platform.
Great question, I asked a [related question](https://stackoverflow.com/questions/498598/self-installing-application-or-separate-installer) on Stack Overflow a while ago. The answer often seems to be "because that's how we've done it in the past". Sorry but that doesn't wash with me. A few others have said the main re...
5,200,758
I want to unit test a user component which use custom events. when doing this without using VS Unit test Framework debug.assert succeed, when doing the same thing with VS Unit Test Framework, assert fails this is illogical so I want to debug while doing Unit test with VS framework. But It seems I can't because code nev...
2011/03/05
[ "https://Stackoverflow.com/questions/5200758", "https://Stackoverflow.com", "https://Stackoverflow.com/users/310291/" ]
The answer by P. Campbell is not exactly right. If you start debugging a project (such as a WCF services site), it is impossible to start any unit tests, debug mode or not. The options to do so are simply grayed out in Visual Studio 2012. This means you simply cannot debug out-of-process code from a unit test. You can...
In VS2015, select: > > Test->Debug->All Tests > > > Or you can highlight a specific test in the editor and select > > Test->Debug->Selected Tests > > >
3,747
Often times I hear the argument that marriage is between a man and a woman, God made them male and female, (adam and eve not adam and steve ..etc). My question is for those who do not fit into the gender boxes we like people to fit into. In fact there are many variations of gender between the poles xmale, heterosexual,...
2011/10/02
[ "https://christianity.stackexchange.com/questions/3747", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/810/" ]
As with many of these questions, some of the answer is already in the question. You've termed occurrences like this "conditions" - in other words, deviations from the general norm. As with other medical conditions they are a result of The Fall. So the line you quote is correct, God created male and female, very clearly...
As for hermaphrodites, the Bible isn't clear. it's simply not addressed. My wife and I have discussed this a few times, and my personal answer is "I don't know. But I know they can be saved, just like anyone else. so I'm not going to focus on their sexuality, but rather on whether or not they've accepted Christ. Once s...
63,170,026
I got one text with two columns (via column-count property) and I'd like to target the second column only so I can apply a red color on it for example. How can I do it, in CSS or Javascript ? I know I could go through the creation of two containers instead so I would just have to manipulate the second div, but in my ca...
2020/07/30
[ "https://Stackoverflow.com/questions/63170026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13729628/" ]
Bad news - it is not possible, maybe someday. I understand you want to split the text colour, you have a reason and an idea... if any trick or workaround works - go ahead! Or maybe your intended goal can be achieved by changing the background? Different colour for each column? ``` .gradient{ background: linear-gradi...
You can do it like this, it not select directly the second line but it works : ```css .col:not(first-line) { color:green; } .col:first-line{ color:black; } ``` ```html <div class="col">Auxerunt haec vulgi sordidioris audaciam, quod cum ingravesceret penuria commeatuum, famis et furoris inpulsu Eubuli cuiusda...
1,280
Steven Pinker in "The Language Instinct" claims that there is strong psychological evidence for the existence of a sharp age cutoff for the ability to acquire a flawless foreign accent (I may dig up the exact reference, if needed). In other words, there is a fairly narrow age threshold (around 20-odd years) below which...
2012/01/14
[ "https://linguistics.stackexchange.com/questions/1280", "https://linguistics.stackexchange.com", "https://linguistics.stackexchange.com/users/673/" ]
One of the reasons the feral children data are difficult to assess is that the brains of these children are often underdeveloped or have developed differently because they weren't stimulated with language at a young age. (For a more scientific explanation of the how of this, see Curtiss et al 544-545+.) As I mentioned ...
I believe that the existance of a cut off period is imposible to measure due to the large number of factors affecting language accuisition. As an English language teacher and a person who has very near native competence in a foreign language, I believe that older people are less likely to achieve native competence in p...
18,540,987
I am developing my first Flask application (with sqlite as a database). It takes a single name from user as a query, and displays information about this name as a response. All working well, but I want to implement typeahead.js to make better user experience. Typeahead.js sends requests to server as user types, and su...
2013/08/30
[ "https://Stackoverflow.com/questions/18540987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2672932/" ]
Basically `show_double(value)` passes the `value` defined in the main function to `show_double(number)` function which is expecting a number to receive as an argument ``` def main(): value = 5 show_double(value) # Function Call # The show_double function accepts an argument # and displays double its value d...
main function calls the `show_double()` passing the argument value. Then value is doubled inside function and returned
6,575,975
Suppose I want www.example.com/profile to redirect a user to his or her profile page. So what I want to do is match "/profile" to "users#show" but also let the controller know who the current user is. Is there any way I can set params[:id] or params[:user\_id] to session[:user\_id] in the routes file? I know this might...
2011/07/04
[ "https://Stackoverflow.com/questions/6575975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/629474/" ]
Route '/profile' to 'users#show', then set the params value to the session value if it is not already set. You can't set this in your routes file, but you can do it in the controller. Routes: ``` match '/profile' => 'users#show ``` Controller: ``` class UserController < ApplicationController def show params...
If you want to accomplish this, you shouldn't let it appear in your routes at all. It should remain: ``` match "/profile" to "users#profile" ``` Because you have the information in session, you only have to fetch it in your controller. ``` User.find(session[:user_id]) ``` The best is to put a `before_filter` che...
8,073,427
I know I can use data in files to drive unit test, for example data inside a csv or xml file. For example: ``` [TestMethod] [DataSource( "Microsoft.VisualStudio.TestTools.DataSource.CSV", "Data.csv", "Data#csv", DataAccessMethod.Sequential)] public void TestData() {} ``` I would like to know if t...
2011/11/10
[ "https://Stackoverflow.com/questions/8073427", "https://Stackoverflow.com", "https://Stackoverflow.com/users/622363/" ]
If it's in memory, my preference would be to not use DataSource, but use a T4 template to auto generate your unit tests instead. This way, you will only write the test once, but in the results for the test run, you will see an entry for each of the input you tested. Add this .tt file to your test project. ``` <#@ temp...
I don't think you can do that with the `[DataSource]` attribute, but you can do a more or less the same thing manually. Load your data in a method decorated with `[AssemblyInitialize]` or `[ClassInitialize]`. Then rewrite your tests to loop over the data. Unfortunately this way you will end up with a single test inste...
29,897,685
I have spent a few days looking and have been unable to find a solution, most example deal with spring boot and gradle, I am only using spring mvc and maven. If I remove the springfox-swagger-ui dependency the app runs fine and the following return JSON as expected http:\\localhost:8080\restful\v2\api-docs?group=restf...
2015/04/27
[ "https://Stackoverflow.com/questions/29897685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4837799/" ]
Fixed by adding the following into the AppConfig. ``` @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry .addResourceHandler("swagger-ui.html") .addResourceLocations("classpath:/META-INF/resources/"); registry .addResourceHandler("/webjars/**") ...
I encountered this error because of a version mismatch between `springfox-swagger2` and `springfox-swagger-ui`, versions of the two dependencies have to be the same. ``` <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.6.1</version> </dependency> <dependen...
17,891,932
I'm shopping for an open-source framework for writing natural language grammar rules for pattern matching over annotations. You could think of it like regexps but matching at the token rather than character level. Such a framework should enable the match criteria to reference other attributes attached to the input toke...
2013/07/26
[ "https://Stackoverflow.com/questions/17891932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/317110/" ]
Your error is not the generics. They are workable. Your error is in: ``` itor.add(t); ``` You don't add objects to an iterator. You add them to the list. The iterator can only enumerate and iterate over them. Use ``` this.t.add(t); ``` I'd rename the list to `tList` and change the code to: ``` private List<T...
`Iterator<T>` does not have an `add<T>(T)` method. You probably meant to call `this.t.add(t);` instead of `itor.add(t);`.
9,871
I have a "basic statistics" concept question. As a student I would like to know if I'm thinking about this totally wrong and why, if so: Let's say I am hypothetically trying to look at the relationship between "anger management issues" and say divorce (yes/no) in a logistic regression and I have the option of using t...
2011/04/22
[ "https://stats.stackexchange.com/questions/9871", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/4054/" ]
A few quick points: * Variance can be arbitrarily increased or decreased by adopting a different scale for your variable. Multiplying a scale by a constant greater than one would increase the variance, but not change the predictive power of the variable. * You may be confusing variance with reliability. All else being...
A simple example helps us identify what is essential. Let $$Y = C + \gamma X\_1 + \varepsilon$$ where $C$ and $\gamma$ are parameters, $X\_1$ is the score on the first instrument (or independent variable), and $\varepsilon$ represents unbiased iid error. Let the score on the second instrument be related to the first...
9,705,810
If i set a sharedpreference in one activity, why does the other one has different preferences? context changed? (but i se use application context!) Here is my code ``` MyApp appState = ((MyApp)this.activity.getApplicationContext()); appState.setDittaSelezionata( (int) itemId); ``` .... ``` MyApp appState = ((MyApp...
2012/03/14
[ "https://Stackoverflow.com/questions/9705810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/579646/" ]
You can't. Create a new bitmap context. You can transfer the old one's contents to the new one by creating an image from it (`CGBitmapContextCreateImage`) and then drawing that image into the new context.
A Core Graphics context doesn't have “bounds”. It has a coordinate system, with essentially infinite extent. You can, for example, do `CGContextFillRect(gc, CGRectInfinite)`. A bitmap context has an underlying bitmap, and each pixel in the bitmap is mapped to a well-defined region in the context's coordinate system. (...
21,566,437
I have read a csv file using, ``` with open('test.csv', newline='') as csv_file: #restval = blank columns = - /// restkey = extra columns + d = csv.DictReader(csv_file, fieldnames=None, restkey='+', restval='-', delimiter=',', quotechar='"') ``` I would like to iterate through the created dictionary ...
2014/02/05
[ "https://Stackoverflow.com/questions/21566437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2242977/" ]
You have to first iterate over the dict getting each row, and then iterate over the items in each row: ``` for row in d: for k, v in row.items(): # Do stuff ```
We also can try: ``` with open('test.csv', newline='') as csv_file: #restval = blank columns = - /// restkey = extra columns + d = csv.DictReader(csv_file, fieldnames=None, restkey='+', restval='-', delimiter=',', quotechar='"') data = list(d) for row in data: for key,val in row.items(...
268,159
Is there any way to disable the `CTRL`+`Z` (Undo) shortcut in Windows Explorer? Alternatively, is there a way to have Windows Explorer "forget" its undo history? The reason I ask is that you may have done some file operations in Explorer (copying, renaming, etc.), and perhaps you don't reboot for days or longer (choos...
2011/04/08
[ "https://superuser.com/questions/268159", "https://superuser.com", "https://superuser.com/users/41575/" ]
I wrote a program in C to disable both the Undo and Redo shortcuts, since both can lead to accidents. The program can be found at <http://purl.org/net/dweundo> . It has an installer which, if you want, adds a shortcut in the Start Menu 'Startup' folder, so the program starts when you log on.
This AutoHotKey script catches Explorer windows, as in other answers, but also the Desktop: ``` #IfWinActive ahk_class CabinetWClass ; Explorer ^z:: #IfWinActive ahk_class ExploreWClass ; Explorer (legacy) ^z:: #IfWinActive ahk_class Progman ; Desktop ^z:: #IfWinActive ahk_class WorkerW ; Desktop shown by Win+D ^z:: ...
15,015,821
In iOS, is there a relationship between run loop and display refresh? If so how?
2013/02/22
[ "https://Stackoverflow.com/questions/15015821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/66814/" ]
Please note that your `echo $(( 22/7 )) | bc -l` actually makes bash calculate 22/7 and then send the result to bc. The integer output is therefore not the result of bc, but simply the input given to bc. Try `echo $(( 22/7 ))` without piping it to bc, and you'll see.
`scale` variable determines number of digits after decimal separator ``` $ bc $ scale=2 $ 3/4 $ .75 ```
114,330
[Steve Vai does vibrato by circling his finger around the note like he's giving it a massage.](https://www.youtube.com/watch?v=wuRS_hQLLRg). He says that this somehow makes the note go flat as well as sharp. I can't hear it. I try to do it on my guitar and can't hear it. Is this even possible? Unless you change incr...
2021/05/10
[ "https://music.stackexchange.com/questions/114330", "https://music.stackexchange.com", "https://music.stackexchange.com/users/37013/" ]
You *can* make the note go a little flat by pushing it forward, since you do decrease the tension on the speaking length of the string. Test it yourself with a tuner and see how flat you can get the notes. It's easier to push the notes flat on larger strings and on wound strings. Now, it can be quite difficult to do, a...
Using the same motion as classical guitarists the note becomes *slightly* sharper as the finger rolls to the back of the fret - closer to the guitar's nut. I'd argue that yes, the pitch changes, and does go flatter (minimally) when the finger is closest to the bridge, but that's semantics. Since the *correct* note ough...
12,432,060
Hi I have this Demo: <http://jsfiddle.net/SO_AMK/BcFVv/> I am trying to show only 1 Div at a time instead of all three. I want it so a certain div will only show when itss button is pressed. As you can see it shows all of the Divs at the start. The buttons work fine. QUESTION: How do I hide Divs 2 and 3 from the st...
2012/09/14
[ "https://Stackoverflow.com/questions/12432060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1486934/" ]
ID's should be named with a leading letter before the digit. "ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("\_"), colons (":"), and periods (".")." (W3C)
Try this: ``` $('#pages div').not('[id=1]').hide(); ``` jsFiddle: <http://jsfiddle.net/wqtT5/>
351,780
I am a team lead at an IT company with 5 years of experience. Recently, me and my team have reached a maturity level where we all realize that we do not give back enough to the community. We are starting to make contributions (issues, pull requests, improvements) to open source projects or libraries that we use. We (...
2017/07/06
[ "https://meta.stackoverflow.com/questions/351780", "https://meta.stackoverflow.com", "https://meta.stackoverflow.com/users/4239642/" ]
> > * What drives you to be active and not passive on Stack Overflow? > > > The growth opportunities. I've used Stack Overflow to learn and teach for about as long as I've been developing for iOS. My motivations have evolved over time, but they went something like this: 1. This is new and pretty cool. 2. This is...
I am using Stack Overflow for some time now. But just recently I understood that there are questions that I can also answer even though it may be a simple edit in an existing answer or a comment to improve an existing answer. While looking for answers I am now trying to share my knowledge and I am really enjoying it. T...
38,006
What does *for grins* mean in the following? > > If the web service says the values are valid, the underlying fields > are updated. If it says the values are invalid, it sets up error > messages for the fields. **For grins**, on an invalid return, it also > validates the level number itself. > > >
2011/08/15
[ "https://english.stackexchange.com/questions/38006", "https://english.stackexchange.com", "https://english.stackexchange.com/users/833/" ]
"For grins" is typically used as another way of saying "for amusement purposes".
A more common English expression is "for fun." Not for a serious purpose. Also, "for laughs," or "for kicks."
67,850,966
I have given a string consistent of only numbers . **Example** ``` let inputString = "1234"; ``` Question -------- I have to write a function which will return the string except first even number if any present **Example Output** ``` "134" ``` **Example Code** ``` let inputString = "1234"; function palindrom...
2021/06/05
[ "https://Stackoverflow.com/questions/67850966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16138106/" ]
Use a regular expression and match (only once) and remove any character that is `02468`. ```js const palindromeRearranging = inputString => inputString.replace( /[02468]/, '' ); console.log(palindromeRearranging("1234")); ```
Also, you can use [.find()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find) to get the first element which satisfies condition: ``` let inputString = "1234" function palindromeRearranging(inputString) { let arr = inputString.split(""); const found = arr.find(element =>...
854,762
So I am trying to use this formula here and is giving me some trouble. If I just substitute $6000$ into the formula, the answer is approximately $1500$. But the number of primes under $6000$ is clearly half that. How do you use this formula properly?
2014/07/02
[ "https://math.stackexchange.com/questions/854762", "https://math.stackexchange.com", "https://math.stackexchange.com/users/161346/" ]
$\pi(x)$ is the prime counting function, it gives the exact amount of primes below $x$ $$\pi(6000)=783$$ The formula provided is an approximation, so it gives: $$\frac{6000}{\log\_e 6000}=\frac{6000}{8.699514748}=689.69364083$$ While about $100$ from the actual answer, this is pretty accurate. It will increase in a...
I'm not sure that you used teh wrong base of logarithm, because when I treid it with base 10 log, I got 1588, which I would have rounded off to 1600. Whit the natural logarithm, the answer is 690, which is off by almost a hundred. I am reminded of the frivolous tehorem of arithmetic: "almost all integers are very larg...
5,992,929
I have a class that references a background image (and I don't want to upgrade to using imagebundles) so I need to print the "base module url" before my image url. How can I achieve this? ``` background: #BDE5F8 url("image/info.png") no-repeat 2px center; ```
2011/05/13
[ "https://Stackoverflow.com/questions/5992929", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43671/" ]
You could always add a static function somewhere: ``` public static String getBackgroundUrl(){ return com.google.gwt.core.client.GWT.getModuleName() + "/images/background.png"; } ``` And in your CSS ``` @eval BG_URL com.yourclass.getBackgroundUrl(); .myBackground { background-url:BG_URL; } ```
Including images in your ClientBundle really is the way to go. But then again, you've already mentioned that you're not going to do that. Instead, consider using a [value function](http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.html#Value_function) to get the value of `GWT.getModuleBaseURL()`: ``` ...
63,528,474
An example of simple nested for loop: ```js for (let i=0; i<=2; i++) { for (let j=0; j<=1; j++){ console.log("i is: " + i); console.log("j is: " + j); console.log("---"); } } ``` Nested for loop with delay: ```js for (let i=0; i<=2; i++) { for (let j=0; j<=1; j++){ task(i,j); } } function t...
2020/08/21
[ "https://Stackoverflow.com/questions/63528474", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9357872/" ]
You could use `Promise` and `async/await` to handle sequential call ```js function taski(i) { return new Promise(function (resolve) { setTimeout(function () { console.log("i is: " + i) resolve() }, 1000 * i) }) } function taskj(j) { return new Promise(function (resolve) { setTimeout(funct...
You could try to to an asynchronous approach with async/await: ```js function sleep(ms) { return new Promise(resolve => { setTimeout(resolve, ms); }); } (async function() { for (let i = 0; i <= 2; i++) { for (let j = 0; j <= 1; j++) { await taski(i); await taskj(j); } } }()) async fun...
25,647,752
I want DIR to loop through all the arguments (with space and ""). But this code do not recognize, "cd ef" as one. Dividing them into two. How can I do that? ``` #test.sh echo Number of arguments: $# if [ $# -eq 0 ] then echo "No arguments" DIR=. else DIR="$*" fi echo DIR =$DIR for arg in $DIR; do echo $a...
2014/09/03
[ "https://Stackoverflow.com/questions/25647752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312627/" ]
You need to use an *array*, not a regular scalar variable, for this purpose -- and `"$@"`, not `$*`: ``` if (( $# )); then dirs=( "$@" ) else dirs=( . ) fi for dir in "${dirs[@]}"; do ... done ``` See also [BashFAQ #5](http://mywiki.wooledge.org/BashFAQ/005).
If you don't actually need a variable `DIR`, you can use a form of parameter expansion: ``` echo "DIR=${@:-.}" for dir in "${@:-.}"; do ... done ```
3,384,917
Let $E \subseteq \mathbb R$ and $f : \mathbb R \rightarrow \mathbb R$. Show that $f(\overline{E}) \subseteq \overline{f(E)}$. I've seen similar questions on stackexchange, but answers are using metric spaces and topology concepts I have't learned. This is from a real analysis intro class. I'm thinking that given $g \...
2019/10/08
[ "https://math.stackexchange.com/questions/3384917", "https://math.stackexchange.com", "https://math.stackexchange.com/users/604375/" ]
You are confusing some terms. If $y\in f(\overline E)$, then there exists $x\in\overline E$ with $f(x)=y$. As $x\in\overline E$, there exists $\{x\_n\}\subset E$ with $x\_n\to x$. Using that $f$ is continuous, $$ f(y)=f(\lim x\_n)=\lim f(x\_n)\in\overline{f(E)}. $$
Let $e \in \overline{E}$, so $f(e)$ describes an arbitrary point of $f(\overline{E})$. You can write $e$ as the limit of some sequence. (Why?) Check the images of that sequence under $f$. How can you now conclude that $f(e) \in \overline{f(E)}$?
10,969,415
here is my code ``` <div class='content'> <div class='div1'>content</div> <div class='div2'>content</div> </div> ``` ```css .content { width:300px;} .div1 { float:left;width:200px;} .div2 { float:left;width:100px;} ``` in some case I need to set `display:none` for `div2`. is it possible to set `.div1` width t...
2012/06/10
[ "https://Stackoverflow.com/questions/10969415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/191220/" ]
So long as you only need to add or remove the second div, the easiest solution is to only make that second div a float, and place it within the first, non-floated div, like so: <http://jsfiddle.net/Tb89A/> . Just remove the comments on the display:none to see it in action.
Try to add class (for example, `hidden`) to `div2` when you set `display: none` and then set `fullwidth` do `div1` (in which you define `width: 300px`). Finally, you can go with jQuery and conditionals: ``` if($('.hidden').length()) { $('.div1').addClass('fullwidth'); } ``` Of course you may want to change those ...
1,591,836
I'm trying to store a shortened date (mm/dd/yyyy) into a DateTime object. The following code below is what I am currently trying to do; this includes the time (12:00:00 AM) which I do not want :( ``` DateTime goodDateHolder = Convert.ToDateTime(DateTime.Now.ToShortDateString()); ``` Result will be 10/19/2009 12:00:0...
2009/10/20
[ "https://Stackoverflow.com/questions/1591836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/175057/" ]
You only have two options in this situation. 1) Ignore the time part of the value. 2) Create a wrapper class. Personally, I am inclined to use option 1.
You'll always get the time portion in a DateTime type. ``` DateTime goodDateHolder = Convert.ToDateTime(DateTime.Now.ToShortDateString()); ``` will give you today's date but will always show the time to be midnight. If you're worried about formatting then you would try something like this ``` goodDateHolder.ToStr...
5,316,172
I basically have a `Money` value type, which consists of `Amount` and `Currency`. I need to map multiple `Money` values into a table, which has multiple fields for amount, but only one currency. In order words, I have the table: ``` Currency Amount1 Amount2 =============================== USD 20.00 ...
2011/03/15
[ "https://Stackoverflow.com/questions/5316172", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13627/" ]
What about changing your classes like this? ``` class Record { public MoneyCollection Money { get; set; } } class MoneyCollection { public MoneyCollection(string currency, params decimal[] amount1) { /*...*/ } public decimal[] Amount { get; private set; } public string Currency { get; private set; } ...
I know it is a few years late - but I have a solution. ``` private decimal _subTotal; private decimal _shipping; private CurrencyIsoCode _currency; public virtual Money SubTotal { get { return new Money(_subTotal, _currency); } set { _subTotal = value.Amount; _currency = value.CurrencyCode...
19,188
I wonder if Tolkien ever explained why Gandalf insisted that Bilbo should go with the dwarves on their journey to reclaim Erebor. Gandalf didn't know about the One Ring and Gollum at that time. Did Gandalf foresee something or was he just thinking that Bilbo would be crucial for defeating Smaug (which Bilbo in the end ...
2012/06/26
[ "https://scifi.stackexchange.com/questions/19188", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/7048/" ]
There is no explicit answer, but in the Hobbit, the following passage occurs: > > "Of course there is a mark," said Gandalf. "I put it there myself. For very good reasons. You asked me to find the fourteenth man for your expedition, and I chose Mr. Baggins. Just let any one say I chose the wrong man or the wrong hous...
Because Bilbo asked him to go (or at least Gandalf believed so)! > > "All the same I am pleased to find you remember something about me. > You seem to remember my fireworks kindly, at any rate, land that is > not without hope. Indeed for your old grand-father Took's sake, and > for the sake of poor Belladonna, I w...
34,431,249
I want to remove the "kibana" loading text from the iframe of kibana dashboards. Any pointers on which file i can change for this.
2015/12/23
[ "https://Stackoverflow.com/questions/34431249", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2089557/" ]
I think that using br tag is always a bad idea. Try using paragraphs, css padding, css margin, hr. Try avoiding br because it's not [semantic](https://en.wikipedia.org/wiki/Semantic_Web) and using the proper tag in your site "helps the search" engines to "understand your site"
Try using this where you want the blank space: ``` &nbsp; ``` If you want multiple blank spaces, then repeat the code successively like this: ``` &nbsp; &nbsp; ``` etc.
3,542,518
It is possible have a bunch of web apps running in one windows azure small compute instance? I am looking at using Azure as a place to sit a bunch of projects (web apps) that are in dev and non-production ready. Some are actually moth-balled, but I'd like to have an active instance of them somewhere. I don't want to p...
2010/08/22
[ "https://Stackoverflow.com/questions/3542518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135202/" ]
It depends on what you mean by Windows Azure instance. A single Azure Account can hold multiple services and deployments. Deployment (at the moment of writing) could hold multiple Worker and Web Roles (essentially projects). A single Web Role can be deployed in multiple deployment instances. Given all that, you can ...
Azure may not be the best for this use case - one VM allows only one app and all other options are somewhat complicated to implement (like having multiple apps in one web role or on-demand deploying and tearing down - also note that Azure charges for the clock hour, so I am not sure what happens if you bring up an inst...
1,405,245
How would I be able to track all changes to my database? I need a way to find out exactly what changes I made to the database so that I can make the same changes on another server. For example, if I added a new field in one of the tables, I would like to know what field that was so that I could add that same field to...
2009/09/10
[ "https://Stackoverflow.com/questions/1405245", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The steps people usually go through when facing these problems are: 1. Change the development db in whatever way is needed at the time. 2. Ready to deploy a new version of the application - realize the production database needs to be updated as well while retaining the data. 3. Dump the production and development sche...
A non-automated but useful way to keep track of changes to a db is with the [MySQL Query Browser](http://dev.mysql.com/downloads/gui-tools/5.0.html). It keeps a history of all operations you run while using it. This makes assembling a change script very straightforward. Obviously, this is not a solution if you're look...
18,878,163
I am plotting data as described in a previous Stackoverflow question: [gnuplot 2D polar plot with heatmap from 3D dataset - possible?](https://stackoverflow.com/questions/18792461/gnuplot-2d-polar-plot-with-heatmap-from-3d-dataset-possible) Mostly it is working well for me, and I am down to some small details. One of t...
2013/09/18
[ "https://Stackoverflow.com/questions/18878163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2719646/" ]
Here is how you can change the line properties of the contour lines. I can't explain why it is that way, I just found out by testing it. Unfortunately, there is no documentation about these details. The behaviour is as follows (tested with 4.6.3. and 4.7 (2013-07-25 and 2013-09-09), all show the same behaviour): Defa...
I had to refer back to this question when I was again doing some GNUplot plotting, this time in rectangular coordinates, and found that could not recall how to control the line type for contour lines. I found that the info above is now not quite correct, and I have discovered a way to explain how this works as of GNU...
1,657,409
This is from Gaughan Ch.2, problem 10. The function $f(x)$ is defined from $(0, 2)$ into $R$. Limit existence is **assumed**. The hint is to choose a subsequence $x\_n$ convergent to $0$ for which $f(x\_n)$ is 'convenient'. So far I have tried $x\_n=1/n$ and $x\_n=(1/2)^n$, with no luck in either case. Since the latte...
2016/02/15
[ "https://math.stackexchange.com/questions/1657409", "https://math.stackexchange.com", "https://math.stackexchange.com/users/314771/" ]
I'm not sure if you function is an injection, and it's quite an ugly function aswell. Consider this one: $$ f(x,y)=2^x\cdot 3^y $$ Use the uniqueness of the prime factorization to prove this is an injection. --- By the way, with your original argument, you weren't suppose to get that "$x+y=u+v$" but rather $x=u,y...
Here's a way of proving that result that's easier to understand: $$ \begin{array}{cccccccccc} 1,1 & & 1,2 & \rightarrow & 1,3 & & 1,4 & \rightarrow & 1,5 & & 1,6 & \rightarrow \\ \downarrow & \nearrow & & \swarrow & & \nearrow & & \swarrow & & \nearrow \\ 2,1 & & 1,1, & & 2,3 & & 2,4 & & 2,5 & & \cdots \\ & \swarrow & ...
6,473,249
I am trying to upload a movie onto a site and then automatically convert it into .mp4 format from the .mov iPhone format. Is there a php conversion library or tool that would help me do this? Thanks.
2011/06/24
[ "https://Stackoverflow.com/questions/6473249", "https://Stackoverflow.com", "https://Stackoverflow.com/users/766965/" ]
You could try the ffmpeg extension: <http://ffmpeg-php.sourceforge.net/> Edit: It turns out that the ffmpeg extension probably won't help you, but you could still use ffmpeg to do the conversion. You are probably better off having a cron job or something similar do the conversions in the background. Just let the user...
Try command : ``` ffmpeg -i movie.mov -vcodec copy -acodec copy out.mp4 ```
3,061,868
I try to integrate an existing database file into my Android project. I follow the instructions on this [blog](http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/). They write that I have to add a table `android_metadata` with a column called locale and put en\_US into it. I try t...
2010/06/17
[ "https://Stackoverflow.com/questions/3061868", "https://Stackoverflow.com", "https://Stackoverflow.com/users/114066/" ]
the metadata table will be generated automatically. if you have content of german try updating the metadata table 'de\_DE'.
The metadata table is required to hold (as its name suggests) meta information about the application. This table is auto-generated in some cases (since api 4 if i remember correctly) but you may want to add it yourself.
21,280,476
I'm trying to learn the Eigen C++ library, and was wondering if there is some nice shorthand for initializing dynamic vectors and matrices. It would be really nice to write something like you would using a `std::vector` ``` std::vector<int> myVec = {1,2,3,6,5,4,6}; ``` i.e. ``` VectorXi x = {1,2,3,4,7,5,7}; ``` T...
2014/01/22
[ "https://Stackoverflow.com/questions/21280476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/276193/" ]
Do like this.. ``` $yourstring = 'test-e2e4/test-e2e4/test-e2e4/6.png'; $val = array_pop(explode('/',$yourstring)); // 6.png ```
You don't need to use regex for this, you can use `substr()` to get a portion of the string, and `strrpos()` to specify which portion: ``` $full_path = "test-e2e4/test-e2e4/test-e2e4/6.png" $file = substr( $full_path, strrpos( $full_path, "/" ) + 1 ); ``` `substr()` returns a portion of the string, `strrpos()` ...
18,563
By signed request I mean something like this (simplified example): Client creates a sig in his request: `$sig = hash('sha256', $api_key.$data);` which generates `7409ur0k0asidjko2j` for example. He then sends this to his request: `example.com/api/7409ur0k0asidjko2j` Now, the receiving server then performs the exact p...
2012/08/12
[ "https://security.stackexchange.com/questions/18563", "https://security.stackexchange.com", "https://security.stackexchange.com/users/9317/" ]
If the signature covers the whole request, then integrity is guaranteed. **Request replay is still a potential threat (think: resource abuse).** With HTTP digest authentication, the request could be modified in transit. **You are at the mercy of a MITM (Man In The Middle) attack.** Anyway, you should really use TLS p...
Signing of the request might be better, but you should implement it correctly. The hash(key || data) construction is vulnerable to hash length extension attack and should never be used. Here you have good explanation of this subject: [Hash Length Extension Attacks](https://blog.whitehatsec.com/hash-length-extension-att...
53,498,240
I am trying to migrate a django application from one server to another. The application is working fine on the old server. On the new server, the application works fine when used using Django's runserver. To test the django application under uwsgi, I used ``` uwsgi --http :8000 --module mysite.wsgi ``` This open...
2018/11/27
[ "https://Stackoverflow.com/questions/53498240", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3395643/" ]
[Pyuwsgi](https://pypi.org/project/pyuwsgi/) can be used instead of building uWSGI from source. It is a wheel, but excludes the SSL plugin so it should workaround the incompatibility.
I have the same problem. It turns out to be caused by the Python package `grpcio (1.34.0)`. Downgrading to `grpcio==1.30.0` solved the problem. This solution is provided by <https://github.com/grpc/grpc/issues/23796> Using `pipenv` (should be the same with `pip`), my exact commands to fix it were: ``` $ pipenv uninst...
2,945,334
I have a webservice method FetchNumber() that fetches a number from a database and then returns it to the caller. But just before it returns the number to the caller, it needs to send this number to another service so instantiates and runs the BackgroundWorker whose job is to send this number to another service. ``` p...
2010/05/31
[ "https://Stackoverflow.com/questions/2945334", "https://Stackoverflow.com", "https://Stackoverflow.com/users/93770/" ]
I feel like testing inside the function is better. If you test outside of the function, you'll have to test everywhere that function could be called (and would cause a lot of duplicate code). It's nicer to have everything in one place then spread out everywhere.
In this case, I feel that the name of the function implies that something is going to happen to the URL in every case. Someone may want to call `FixURLCosmetics` on a non-GET page and expect something to happen. I would rename `FixURLCosmetics` to `FixGETURLCosmetics`. Then, throw an exception if it's called on a non-...
180,690
I'm working on a software which deals with lots (several millions) of RSA private keys. Keysize is 2048, I'm going to store them in database in PEM format. I want keys to be encrypted to mitigate risks of hostile access to database. Naturally, applying passphrase with PKCS#8 comes to mind. However, I'm not sure it is...
2018/02/28
[ "https://security.stackexchange.com/questions/180690", "https://security.stackexchange.com", "https://security.stackexchange.com/users/171761/" ]
Using a different passphrase for each key means you then have the problem of working out where to keep the passphrases. It is a little better in that the passphrase can be stored separately - and realising (compromising?) the asset requires compromise of both the passphrase and the protected key. The number of entries...
In the past I made something similar and we decided to add a field to the table that holds the keys in a token. That token was the key of other table, that was in a different database, that holds the passphares of the other. Probably there is a better way but this was enough for us.
801,201
I have an ASP.NET WebSite which restarts in every 1-2 hours in a day so sessions and other thing are gone and users are complaning about it, because they open a page and do something for 20 minutes and when they submit it, a nice "we are sorry" page is there. I don't do anything which restarts the application (changin...
2009/04/29
[ "https://Stackoverflow.com/questions/801201", "https://Stackoverflow.com", "https://Stackoverflow.com/users/89841/" ]
I guess this is [recycling](https://stackoverflow.com/questions/358384/asp-net-recycling-app-pools-indicative-of-larger-problem).
Sounds like the app is being recycled or process is failing. Check app pool settings <http://msdn.microsoft.com/en-us/library/aa720473(VS.71).aspx> and event viewer.
8,262,573
Im using a timer to call an ajax function that loads in a response from a seperate php page. I want to make it so the content fades out then fades in with the response ever so often. Here's my code - i can grab the content and make it change just the fading in part im at a loss with. ``` <script type="text/javascrip...
2011/11/24
[ "https://Stackoverflow.com/questions/8262573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1064660/" ]
You're going to want to do this: 1. Get new content 2. Fade out old content 3. Swap old content with new content 4. Fade in new content So you'll want to change your ready state handler to this: ``` // fade out old content $('#refreshRecords').fadeOut('slow', function (){ // now that it is gone, swap content ...
Try using jQuery's [.ajax](http://api.jquery.com/jQuery.ajax/) method. That way you could apply any jQuery effect just as you get the response (the PHP page you're opening). Should make your work much easier, and your code more readable. Using the old approach is fine if you want to stay with JS and not waste your reso...
223,125
What would one call a tablet which isn't swallowed? What verb would be used when taking it? Would the following phrase be correct? > > To suck the secretion of tablet... > > >
2019/09/05
[ "https://ell.stackexchange.com/questions/223125", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/92676/" ]
You "suck a *lozenge*" or a *pastille* (British). [Lexico](https://www.lexico.com/en/definition/lozenge) says > > **lozenge** > > NOUN > > > **1.1** A small medicinal tablet, originally in the shape of a lozenge, taken for sore throats and dissolved in the mouth. > > > *Sucking of lozenges and pastilles pro...
The medical term used in the UK is ***orodispersible.*** [![picture of a box of orodispersible tablets](https://i.stack.imgur.com/QTNpQs.jpg)](https://i.stack.imgur.com/QTNpQs.jpg) This was first introduced in Europe and is now adopted in the USA as well. Typically, these are uncoated tablets "dissolve" in the mouth...
57,214,540
I have a string like this: ``` myString <- "[0.15][4577896]blahblahblahblahwhatever" ``` I need to extract the number between second brackets. Currently I am trying to use this: ``` str_extract(myString, "\\]\\[(\\d+)") ``` But this gives me `][4577896` My desired result would be: `4577896` How could I achieve...
2019/07/26
[ "https://Stackoverflow.com/questions/57214540", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11333262/" ]
Here is another version with minimal or no regex ``` qdapRegex::ex_between_multiple(myString, "[", "]")[[2]] #[1] "4577896" ``` It extracts all the substring between `[` and `]` and we select the value between second bracket. You can convert it into numeric or integer if needed.
An option using `str_extract` ``` library(stringr) str_extract(myString, "(?<=.\\[)([0-9]+)") #[1] "4577896" ```
34,839,764
I have a java program (text-based no GUI) that I have written and compiled and uploaded to a server. I run it with `java -cp myjar.jar mypackage.MyClass` which starts it running processing a datafile with 20,000,000+ entries in it and printing output to `System.out`. I have calculated that it will take a very long tim...
2016/01/17
[ "https://Stackoverflow.com/questions/34839764", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5384498/" ]
When you have a template function like ``` template<typename T> void fun(T & param) ``` if the parameter that is passed is actually `const`, or `volatile`, then in the template instantiation, `T` will also be "cv-qualified" appropriately. When you put the cv-qualifier in the template function declaration, like so, ...
Since `cx` and `rx` exhibit the same behavior here, we will use only `cx`. `cx` is `const int`. * case of `fun`: `T&` matches against `const int` so `T` is deduced as `const int`, because `const` is not part of `T &`. The type of `param` is `const int&`. * case of `fun1`: `const T&` matches against `const int` so ...
56,604,387
I have string like this `2019-06-13 23:37:02.284175`. I would like to convert this string to unix time epoch. How can I convert this string to unix timestamp using python??
2019/06/14
[ "https://Stackoverflow.com/questions/56604387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9679298/" ]
No, [the syntax](https://en.cppreference.com/w/cpp/language/range-for) does not allow any more than an *init-statement* (since C++20). Technically, you can embed additional statements to be performed at the time of iterator comparison and/or incrementation inside *range\_expression*. This can be done by creating a gen...
With [range-v3](https://github.com/ericniebler/range-v3) (which should be part of C++20), you might do something like: ``` for (const auto& p : ranges::view::zip(container, ranges::view::ints)) { doStuff(p.first /* element*/ , p.second /*ID*/); } ``` [Demo](http://coliru.stacked-crooked.com/a/cfa4b468879eb256)
12,045,881
My setup currently looks like this ***application/controllers/register.php*** ``` class register_Controller extends Base_Controller { public $restful = true; public function get_index() { return View::make('main.register');; } } ``` ***routes.php*** ``` Route::controller(Controller::detect(...
2012/08/20
[ "https://Stackoverflow.com/questions/12045881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1361802/" ]
With mod\_rewrite on, try setting in apache configurations "AllowOverride All", it fixed it for me.
make sure mod\_rewrite is turned on in Apache (httpd.conf) Un-comment the following line ``` LoadModule rewrite_module modules/mod_rewrite.so ``` and restart httpd
1,875,411
Are there any proofs about Real numbers that have shorter equivalent proofs going through Complex numbers? Are there proofs about Integers going through Reals, with longer equivalent proofs using pure Integers?
2016/07/29
[ "https://math.stackexchange.com/questions/1875411", "https://math.stackexchange.com", "https://math.stackexchange.com/users/4399/" ]
Many many interesting definite integrals of functions whose indefinite integrals have no closed form are derived using contour integration in the complex plane. Some of these can, however, be derived by far messier work in the real line. Almost everything involving computational complexity in computer science ends up...
[Some time ago](https://math.stackexchange.com/q/1721832/26306) I had answered a nice simple question that turned out to be a good example for the Integers/Reals part (I couldn't find simpler discrete proof). **Problem:** > > Let $G = (U \uplus V, E)$ be a connected bipartite graph such that $n\_U = |U| < |V| = n\_V...
36,923,923
I have table **Eli** with 1 million records. When I query the following: ``` Select count(*) from Eli where userId ='my_user' ``` It is taking more than 10 mins to give results. I searched web and found better way to optimize the query from `http://dbatipster.blogspot.com/2009/08/get-row-counts-fast.html`. How do I...
2016/04/28
[ "https://Stackoverflow.com/questions/36923923", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2961127/" ]
Without touching on properly building a table, I would use something like this: ``` SELECT COUNT(userID) FROM Eli (NOLOCK) WHERE userId ='my_user' ``` The `(NOLOCK)` hint allows you to select from the table without other transactions against the Eli table being committed, meaning you're not waiting for other updates...
The easy fix to see improvement would be add an index on the table on the userID, if you intend to use the userID filter very often in your queries. Of course that if userID is the primary key of your table, the index would not be necessary and maybe other ways to improve needs to be checked. Now, the query you have pr...
20,545,881
I am trying something like this: ``` public function search() { $criteria = new CDbCriteria; $criteria->compare('user_details_id', $this->user_details_id); $criteria->compare('user_type_id', $this->user_type_id); $criteria->compare('customer_basics_id', $this->customer_basics_id); ...
2013/12/12
[ "https://Stackoverflow.com/questions/20545881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1197047/" ]
**The Main reason.** In your database table column(user\_city\_id), you have **Empty values** not **NULL values**. So your query is unable to operate "IS NULL" and "IS NOT NULL" on the corresponding column. ``` 1. NULL is Special Data Type. 2. Where as Empty means a string/value which is empty. ``` You ...
Maybe `$criteria->addCondition("user_city_id <> '' ");` solve the probleme because IS NOT NULL interpreted as true and NULL as false.
10,226,805
I have below query ``` Select RPAD(x.QUOTE_ID,20,' ') from csa_sli_all.T_CONV_XREF_CUST_QUOTE x , csa_sli_all.T_CONV_quote q where q.select_indicator is null and q.QUOTE_ID = X.QUOTE_ID and q.HOLD_CODE IN ('CAQ' , NULL ) ``` it doesnt give me required result. I changed last statement to ``` ...
2012/04/19
[ "https://Stackoverflow.com/questions/10226805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1323540/" ]
You cannot use `NULL` in `IN` statements, because `IN` applies the standard `=` operator. This one, of course, fails when comparing `NULL`s. It's like writing `SELECT NULL = NULL`. Returned value would be `NULL`.
Instead of using a subquery, you'll have to use a join. Say for argument's sake you're using SQL Server, do something like (obviously filling in your fields): ``` SELECT yourField, yourField2 FROM yourTable t1 INNER JOIN yourTable2 t2 ON t1.Id = t2.Id WHERE t1.field is null AND (t1.code = 'CAQ' OR t1.code IS NULL) `...
1,448,862
I'm creating RSS reader application. I need to get any linked rss old items. For example some web rss result count is too less. My application check time range is too long. Sometimes loss some news. How can I get rss old items? When scrolling down on the google reader,reader shown previous items.
2009/09/19
[ "https://Stackoverflow.com/questions/1448862", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60200/" ]
try this <http://www.google.com/reader/atom/feed/>{complete url to rssfeed without {} }?n=5000
Since Google Reader shut down about a year ago, I'd suggest you give a shot at [Superfeedr](http://superfeedr.com/users/) if you're looking for a replacement.
72,372,940
I'm using `sed` to obtain a specific string (`0x0296cc83474725ddca19a9feefb3aec3602d9073688a4db6885695320cd2a738`) from an output. This string comes next to `Contract address:` This is what I'm trying currently. **UPDATE:** out put has newlines. ``` $ echo $output ``` ``` Starknet plugin using the active environm...
2022/05/25
[ "https://Stackoverflow.com/questions/72372940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8842959/" ]
You can use a [parameter expansion](https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html) to trim the string up to just before the value you want, and then another one to trim from the next whitespace. ``` tail=${output#*Contract address: } # or Contact Hash: if that's what you actually m...
Using `sed` ``` $ address=$(sed -n '/^Contract address: \(.*\)/s//\1/p' <<< "$output") $ echo "Address: $address" Address: 0x0296cc83474725ddca19a9feefb3aec3602d9073688a4db6885695320cd2a738 ```
45,929,449
I understand that Python is an interpreted language, but the performance would be much higher if it was compiled. * What exactly is preventing python from being compiled? * Why was python designed as an interpreted language and not a compiled one in the first place? Note: I know about `.pyc` files, but those are byte...
2017/08/29
[ "https://Stackoverflow.com/questions/45929449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8292439/" ]
Python, the language, like any programming language, is not in itself compiled or interpreted. The standard Python implementation, called CPython, compiles Python source to bytecode automatically and executes that via a virtual machine, which is not what is usually meant by "interpreted". There are implementations of ...
I think python code can be compiled to some extent but we are unable to compile everything in python before hand. This is due to the loosely typed style of python where you can change variable type anywhere in the program. A modification of Python namely Rpython has much strict style and hence can be compiled completel...
51,546,329
My app creates different answers (radio buttons) to select based on what I have in arrays, but I can't figure out how to change the font of these answers. Usually I would just change the font in the layout.xml file, but I only have the radio group there, not the actual buttons. Here is my code: ``` private void c...
2018/07/26
[ "https://Stackoverflow.com/questions/51546329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8156899/" ]
You can do the following: ``` update x set d = t.d, e = t.e, f = t.f from ( values (0,0,0,0,0,0), (0,0,1,0,0,1), (0,0,2,0,0,8), (1,0,2,0,555,8) ) as t(a,b,c,d,e,f) where x.a = t.a and x.b = t.b and x.c = t.c ; ``` Online example: <http://rextester.com/APBVYG17890>
Personally, I recommend a completely different approach. If you created a table that allowed you to crosswalk the values, it would be re-usable, concise, and easy to maintain. Example: ``` CREATE TABLE t ( a INT , b INT , c INT , d INT , e INT , f INT ) INSERT INTO t (a,b,c,d,e,...
223,347
I feel the gdal WriteArray() is so tedious.First, `Create(file)`,then `prj`, last `WtriteArray(arr)`. Now the problem is how to write many rasters? Because it need to create file first and then write array. How to build a loop for variable `arr`? For example: now I got some array varaibe r1, r2, r3.... ``` driver=gda...
2017/01/05
[ "https://gis.stackexchange.com/questions/223347", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/87628/" ]
[Rasterio](https://mapbox.github.io/rasterio/) is great, and @sgillies answer is the one to follow if you want a modern python solution. This answer is for the case that you want to use GDAL without the modern wrapper. If the output images have the same dimensions and footprint, then the best idea might be to use the ...
You should loop over the arrays that you have in your memory. I have done this by storing multiple arrays in a dictionary and then looped over the keyes. for key in arrayDict: ...create rasters ...and write them with outRaster.WriteArray(key). Or have I missed the point of the question completely.
56,067,378
Please note, this question is not about the correctness of this style/convention, only about the use of Boolean operators. Just wanted to mention the style to give context. Microsoft's [C# Coding Conventions](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/inside-a-program/coding-conventions#implicit...
2019/05/09
[ "https://Stackoverflow.com/questions/56067378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3654488/" ]
Yes, it is possible for that to return something that is not a boolean *as long as it can be evaluated as a boolean*. This requires you to overload the `true` and `false` operators, take this strange type: ``` public class MyStrangeType { public static readonly MyStrangeType Strange1 = new MyStrangeType(0); ...
I could maybe misunderstood your question but this maybe could help to you or someone else. There is "is" operator. You can check a veriable is a type of something. For example; var z = x is bool && y is bool;
27,956,722
I am trying to call a webjob from asp.net c# page. When I check the log it shows that it run but nothing is in the log except. It should say "Dan's Phone Number is 5551212" ``` [01/15/2015 14:29:18 > 898371: SYS INFO] Status changed to Initializing [01/15/2015 14:29:20 > 898371: SYS INFO] Run script 'EncodeAsset.exe' ...
2015/01/15
[ "https://Stackoverflow.com/questions/27956722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1383668/" ]
With a continuous WebJob, the idea is to trigger the function based off an Azure storage queue or blob event, not to directly invoke the function from your client code. Here, you have a `QueueTrigger` annotation, which is listening for new messages on the `queuejobs` queue. To invoke the WebJob function, you need to en...
Here's a sample on MSDN which is pretty straightforward. Hope that will help you <https://code.msdn.microsoft.com/Simple-Azure-Website-with-b4391eeb>
4,258,623
I am displaying a dialog with an edittext view. However, the softkeyboard will open only if the user presses inside the editview. So I tried calling an InputMethodManager with the following code. ``` InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(dialogF...
2010/11/23
[ "https://Stackoverflow.com/questions/4258623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/447111/" ]
Awesome question, I was trying to do that too and found a solution. Using the dialog builder class `AlertDialog.Builder` you will have to invoke the dialog like this: ``` AlertDialog.Builder builder = new AlertDialog.Builder(); AlertDialog dialog; builder.set... dialog = builder.create(); dialog.getWindow().setSoft...
Kotlin ------ Here's the tested code. ``` val dialog = AlertDialog.Builder(requireContext()).apply { setTitle(…) setView(editText) setPositiveButton(…) setNegativeButton(…) } val window = dialog.show().window window?.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParam...
184,490
We onboarded a new senior guy recently for a project manager type of role. Based on his past experience and profile/portfolio of work, he is very good. He has handled complex jobs at large orgs in the past. During the interviews, he was not very "chatty" which is fine. He spoke in measured/considered sentences, and I ...
2022/04/29
[ "https://workplace.stackexchange.com/questions/184490", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/111205/" ]
The first thing you should do is to have a 1:1 with this person and explain what the problem is that you've noticed. Try to do it in as least an accusatory manner as you can. Don't be like "you're not performing well because..." or something like that. Something like "I've noticed you've been having difficulties, becau...
> > He hasn't yet spoken much in the couple of sessions he was on - because the project is new to him, and he was expected to mostly listen the first couple of meetings. > > > So you've made it clear to him that his role in the first few meetings was to listen and learn? *You're telling us you expect more from him...
58,736,319
I am trying to run react-d3-tree-demo following this README.md at <https://github.com/bkrem/react-d3-tree-demo> After following the other steps, I got stuck on the second step of trying to run the app locally. The command line returns an error: "'BROWSER' is not recognized as an internal or external command, operable...
2019/11/06
[ "https://Stackoverflow.com/questions/58736319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12322549/" ]
There are two fixes i found that works perfectly well first one : install cross-env (npm package)`npm install cross-env` then you change your dev script to > > "electron-dev": "concurrently \"cross-env BROWSER=none yarn start\" \"wait-on <http://localhost:3000> && electron .\"", > > > please note that you also...
i success using cross-env, so try this one: "dev": "concurrently -k "cross-env BROWSER=none npm start" "npm:electron"", "electron": "wait-on http://localhost:3000 && electron ."
27,068,645
I am trying to fade in three separate lines of text, each one delayed slightly later than the last. I have discovered how to fade a single line, and how to delay a single line, but whatever I try cannot combine the two. All the JS research is for .fadeIn('slow') for button selectors and whatever tried doesn't work with...
2014/11/21
[ "https://Stackoverflow.com/questions/27068645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3324665/" ]
If you think you'll be doing more with animation in your project I highly recommend using [Animate.css](https://github.com/daneden/animate.css). Then how about not using JavaScript at all for the delay, and keep it real simple with some CSS? ``` <h1 id="delayedText1" class="animated fadeIn delay-1">First line fades i...
Maybe this is what you are looking for: [**DEMO**](http://jsfiddle.net/5fd5zy9r/3) ``` $(document).ready(function () { $('h1').each(function (line) { $(this).delay((line++) * 1000).fadeIn(); }); }); ``` **UPDATE:** Note that this will work for any number of lines. You can change fade in speed and del...
7,151,016
I have the following HTML: ``` <div id="myDiv"> <table id="tbl0"> <tr id="tr0" style="display: none;"> <td> <label id="lbl0"></label> </td> </tr> <tr id="tr1" style="display: none;"> <td> <label id="lbl1"></label> </td> </tr> <tr id="tr2" style="display: no...
2011/08/22
[ "https://Stackoverflow.com/questions/7151016", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60758/" ]
The error is in this line: ``` var lbl = tr.find("#lbl" + i); ``` You forgot # sign, since you are looking up by ID.
I stumbled upon this thread and while it helped lead me in the right direction I was able to solve a little different way once I found my label by setting the `innerHTML` property on the label element. I was using jQuery. ``` var labels = document.getElementsByClassName('someclassname'); $(labels).each(function (inde...
5,656,056
MySQL runs pretty much all string comparisons under the default collation... except the `REPLACE` command. I have a case-insensitive collation and need to run a case-insensitive `REPLACE`. Is there any way to force `REPLACE` to use the current collation rather than always doing case-sensitive comparisons? I'm willing t...
2011/04/13
[ "https://Stackoverflow.com/questions/5656056", "https://Stackoverflow.com", "https://Stackoverflow.com/users/290213/" ]
This modification of Luist's answer allows one to replace the needle with a differently cased version of the needle (two lines change). ``` DELIMITER | CREATE FUNCTION case_insensitive_replace ( REPLACE_WHERE text, REPLACE_THIS text, REPLACE_WITH text ) RETURNS text DETERMINISTIC BEGIN DECLARE last_occurency int DE...
In case of 'special' characters there is unexpected behaviour: ``` SELECT case_insensitive_replace('A', 'Ã', 'a') ``` Gives ``` a ``` Which is unexpected... since we only want to replace the à not A What is even more weird: ``` SELECT LOCATE('Ã', 'A'); ``` gives ``` 0 ``` Which is the correct result... see...
41,541
I've used Savage Worlds Plot Point campaigns for successful campaigns (i.e., multiple connected sessions with some coherence to them, where something is accomplished), but don't have any idea how to plan out my own. What do you do when you are creating a campaign (assuming you're not doing some kind of sandbox)? I'm f...
2014/06/27
[ "https://rpg.stackexchange.com/questions/41541", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/3437/" ]
There are Many Approaches ========================= Ask any group of DMs, ever, and they will each have individual ways of making a campaign. I've listed just a few here. Other people here can and likely will post other methods. The important part between having a string of adventures featuring recurring individuals ...
Layering -------- Any plot that players have enjoyed enough to tell stories about later (my personal sign of success), involves **Layering**. I have no idea if this is the correct term for it, but i'm about to describe it, so no harm no foul. As I use it, Layering is simply creating multiple plots, foes, plans, enemi...
26,375,793
I am creating a directive in which I need three values- 1. scrollTop 2. offsetHeight 3. scrollHeight ``` projectModule.directive('scroller', function ($window) { return { restrict: 'A', link: function (scope, elem, attrs) { var rawElement = angular.element($window); angular.element($window).bind('scroll', fun...
2014/10/15
[ "https://Stackoverflow.com/questions/26375793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2587478/" ]
I would try to make use of `$document` service instead, since you actually need `document.body.scrollHeight` and `document.body.offsetHeight`. So ``` var offsetHeight = $document[0].body.offsetHeight; var scrollHeight = $document[0].body.scrollHeight; ```
Can you use getBoundingClientRect if $el is the actual DOM element? ``` var top = $el.getBoundingClientRect().top; ``` [JSFiddle](http://jsfiddle.net/sNLMe/1/) You could also try using ``` $el.prop('offsetTop') ```
40,376,627
I'm trying to display a UIAlertView after some time (like 5 minutes after doing something in the app). I'm already notifying the user if the app is closed or in a background. But I want to display a UIAlertView while the app is running. I don't want to refresh again and again. After three minutes I have to show some al...
2016/11/02
[ "https://Stackoverflow.com/questions/40376627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Use ``` self.perform(#selector(displayAlert), with: nil, afterDelay: 300) ``` where display alert is the function in which you display the alert.
I think there is an alternative best approach for UIAlertView with Custom Delay is You can schedule an local Notification with timeInterval whatever you want.
5,485,670
Why does this work? ``` #include <iostream> #include <string> using namespace std; int main(){ string s="a"; if((s=="cm")||(s=="in")||(s=="ft")||(s=="m")) cout<<s+" Is an illegal value"; else cout<<"I like "+s; return 0; } ``` <http://ideone.com/7pnYh> but then this doesnt ``` #include <io...
2011/03/30
[ "https://Stackoverflow.com/questions/5485670", "https://Stackoverflow.com", "https://Stackoverflow.com/users/655373/" ]
In your second case `s != "cm"` and of course the first `cout` is printed. To negate the check and the logic to remain the same, do it like this: ``` if((s!="cm")&&(s!="in")&&(s!="ft")&&(s!="m")) cout<<"I like "+s; else cout<<s+" Is an illegal value"; ```
Why should the second one output "I like a"? Every single one of your conditions in the statement in the second example is true, so it goes into the if branch. Even if only one would be true, it still would go into the if branch, because you are using OR.