qid
int64
1
74.7M
question
stringlengths
116
3.44k
date
stringdate
2008-08-06 00:00:00
2023-03-03 00:00:00
metadata
listlengths
3
3
response_j
stringlengths
19
76k
response_k
stringlengths
21
41.5k
1,853,542
Why should $b$ groups of $a$ apples be the same as $a$ groups of $b$ apples? We where taught this so it seems rather trivial but the more I think about it the more I feel that it is not. I'm trying to avoid an argument that uses the fact that multiplication is commutative. Because I see that I am trying to PROVE tha...
2016/07/08
[ "https://math.stackexchange.com/questions/1853542", "https://math.stackexchange.com", "https://math.stackexchange.com/users/229023/" ]
The usual way of proving it is by induction. First, define multiplication recursively: $$a\cdot 1 = a\\a\cdot(b+1)=a\cdot b + a$$ Next, show, by induction on $b$ that $1\cdot b=b\cdot 1$. That's relatively easy to do. Next, prove by induction on $b$ that that $(a+1)\cdot b = a\cdot b + b$ by induction on $b$. Final...
Label each apple with a pair of numbers $(x,y)$ such that $x$ is the number of the group the apple was originally in (1 through $b$) and $y$ is the number of the apple within the original group (1 through $a$). Every apple gets a unique label this way. Now, change every label to reverse the two numbers: $(x,y) \rightar...
14,120
When I tried to practice tuning my wheels, I found my spokes turn with the nipples. I tried to drop some lubricant on on the nipples, but I had the bike for two years now and there are a lot of dust clog in it. So the lubricant doesn't help too much. What can I do in this situation?
2013/01/20
[ "https://bicycles.stackexchange.com/questions/14120", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/5947/" ]
Have you removed the tire,tube and rim tape then applied the the penetrating lube to the open end of the nipple?
Give it all a good clean then try some of this [this](https://en.wikipedia.org/wiki/Penetrating_oil)
160,135
I have been working at place A for 2 years, after that the company A was merged with another company and formed a new company named B. How should I mention them in my CV so that recruiters does not mistake that for a job/workplace change?
2020/07/07
[ "https://workplace.stackexchange.com/questions/160135", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/119456/" ]
Software Engineer for 4 years at B (known as A before merge in 2018)
To present the things as close to the reality, I would use the following: > > * from (date1) to (date2) : company A > * from (date2) to (date3) : company B (as a result of company A being bought by / merged to company B) > > >
73,758,225
I want to build an mobile app with flutter that gets payment when event is done. for example, i call a taxi from an app and app is calculates payment from distance, time etc.when finish driving button tapped, app is gonna take payment from saved credit card immediately no 3d secure or anything. my question is what is...
2022/09/17
[ "https://Stackoverflow.com/questions/73758225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7172665/" ]
The error message at `f({ ...a, bar: 'bar' })` says ``` /* Argument of type 'Omit<A, "bar"> & { bar: string; }' is not assignable to parameter of type 'A & { bar: string; }'. */ ``` because the value `{ ...a, bar: "bar" }` is inferred to be `Omit<A, "bar"> & { bar: string }`, but you've got the `f()` function annot...
The problem here is that the parameter type `A extends { bar: string }` could be instantiated for example by type `{ bar: 'not bar' }`. If it is then trying to pass the argument `{ ...a, bar: 'bar' }` the function `f` will throw an error. To illustrate this this is an example: ``` type E = typeof a<{ bar: 'not bar' },...
26,836,807
![http://i.stack.imgur.com/LcdEF.png](https://i.stack.imgur.com/LcdEF.png) From tables I need to get all available columns from table "car\_type" event if 1. It have car(s) in table "car", 2. It is not 'in use' in table "approval" (if it's using it will show 0 in field car\_return) 3. car.car\_status is not 0 (if it ...
2014/11/10
[ "https://Stackoverflow.com/questions/26836807", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2960983/" ]
While the answer from @Kumar hints in the correct direction (but don't use a text field from the default schema.xml for this, as it will process any input both when querying and indexing), the explanation is that you might need a new field to do wild card queries against, unless you can transform your query into an act...
see [this](https://stackoverflow.com/a/11057309/3496666) answer. You have to add a directive link in your schema.xml in {solr\_home}/example/solr/**your\_collection**/conf/schema.xml as shown in that answer. Copy all your fields to make it searchable for wildcard query.
8,867,014
I am displaying and determining the selected language in my website by using URLs in this format : ``` /{languageCode}/Area/Controller/Action ``` And in my C# when I need to find the language Code I am using this syntax : ``` RouteData.Values["languageCode"] ``` However, when I need to call an action using JQuery...
2012/01/15
[ "https://Stackoverflow.com/questions/8867014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/517406/" ]
Since your URL has the language code. How about using ``` window.location ``` <https://developer.mozilla.org/en/DOM/window.location> And then extract the language from the url. Maybe something like: ``` var url = "example.com/en-us/Area/Controller/Action"; //or window.location: var lang = url.split("/")[1]; ``` ...
You could emit it, server-side, e.g.: ``` var url = '@Url.Action("Action", routeValues)'; ```
191,668
I use `AccuBattery` and `Kaspersky Battery Life` to measure energy consumption. `Kaspersky Battery Life` shows, that all the tasks use minimal energy. `AccuBattery Pro` shows, that phone uses 5-10 mAh. This is a fairly new, 3000 mAh battery. Phone is a `THL T9 Pro`, `Android 6.0` is installed on it. UPDATE: I deleted ...
2018/03/02
[ "https://android.stackexchange.com/questions/191668", "https://android.stackexchange.com", "https://android.stackexchange.com/users/71279/" ]
How to nail **Phone Idle** battery drain is the question, but being unrooted device, it calls for some efforts. Finding the culprit apps isn't as easy as it is on rooted devices but is possible using [adb](/questions/tagged/adb "show questions tagged 'adb'") commands to enable higher privileges 1 (At the time of writi...
if you want to just use adb to tune Doze without extra Apps. you might be interested in <https://github.com/easz/doze-tweak> and if you don't want to install extra Apps, you can profile your battery with `adb bugreport` and analyze it with Battery Historian (e.g. <https://bathist.ef.lc/>). After identifying bad Apps,...
5,248,993
I observed the following and would be thankful for an explanation. ``` $amount = 4.56; echo ($amount * 100) % 5; ``` outputs : 0 However, ``` $amount = 456; echo $amount % 5; ``` outputs : 1 I tried this code on two separate PHP installations, with the same result. Thanks for your help!
2011/03/09
[ "https://Stackoverflow.com/questions/5248993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/449460/" ]
I *strongly* suspect this is because 4.56 can't be exactly represented as a binary floating point number, so a value very close to it is used instead. When multiplied by 100, that comes to 455.999(something), and then the modulo operator truncates down to 455 before performing the operation. I don't know the exact det...
Use `fmod` to avoid this problem.
19,621,383
I have a list whose contents show up just fine in my dataGrid with this code: ``` dataGridView1.DataSource = lstExample; ``` This tells me my List is fine, and when I view the dataGrid it has all the data I need. But when I try to output the same List to a text file with this code: ``` string output = @"C:\output.t...
2013/10/27
[ "https://Stackoverflow.com/questions/19621383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/867420/" ]
In "classic" CUDA compilation you *must* define all code and symbols (textures, constant memory, device functions) and any host API calls which access them (including kernel launches, binding to textures, copying to symbols) within the *same translation unit*. This means, effectively, in the same file (or via multiple ...
Below is a "minimum-sized" example showing the use of `__constant__` symbols. You do not need to pass any pointer to the `__global__` function. ``` #include <cuda.h> #include <cuda_runtime.h> #include <stdio.h> __constant__ float test_const; __global__ void test_kernel(float* d_test_array) { d_test_array[threadI...
62,073,660
I initialized git and I did `git push -u origin master` but when I'm trying to push files to my github repository I get these logs in my terminal ``` Enumerating objects: 118, done. Counting objects: 100% (118/118), done. Delta compression using up to 4 threads Compressing objects: 100% (118/118), done. Writing objec...
2020/05/28
[ "https://Stackoverflow.com/questions/62073660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13628101/" ]
I solved the error by building my project again and git init and other steps again and finally it worked
Hello I am Chetan(I am student from Pune) from India. According to me this error is coming because of internet connection issue or might your network slow/unstable. You can fix this error by reconnecting your network or upgrading your internet speed. Than push your code again.
12,433,300
I was following this example <http://cubiq.org/create-fixed-size-thumbnails-with-imagemagick>, and it's exactly what I want to do with the image, with the exception of having the background leftovers (i.e. the white borders). Is there a way to do this, and possibly crop the white background out? Is there another way to...
2012/09/14
[ "https://Stackoverflow.com/questions/12433300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/486863/" ]
The example you link to uses this command: ``` mogrify \ -resize 80x80 \ -background white \ -gravity center \ -extent 80x80 \ -format jpg \ -quality 75 \ -path thumbs \ *.jpg ``` First, `mogrify` is a bit dangerous. It manipulates your originals inline, and it...
I know this is an old thread, but by using the -write flag with the -set flag, one can write to files in the same directory without overwriting the original files: ``` mogrify -resize 80x80 \ -set filename:name "%t_small.%e" \ -write "%[filename:name]" \ *.jpg ``` As noted at <http://imagemagick.org/script/escape.ph...
61,199
I can imagine that this is true, but is it actually legally spelled out and motivated? Or is it just what tends to typically happen, for "other reasons"? I've never been married and thus not divorced, so I'm just going by what I've perceived as well as a text I just read which was talking about the economics of moving...
2021/02/15
[ "https://law.stackexchange.com/questions/61199", "https://law.stackexchange.com", "https://law.stackexchange.com/users/36767/" ]
[united-states](/questions/tagged/united-states "show questions tagged 'united-states'") In the United States, divorce is a matter of state law, and each of the 50 states has slightly different laws. But in general, it is not true as a matter of law that divorced women are awarded everything but "a mattress and a TV"....
> > I can imagine that this is true, but is it actually legally spelled > out and motivated? Or is it just what tends to typically happen, for > "other reasons"? . . . Is this actually a legal thing? Something which is in a > legally binding "marriage contract" (I don't know if that even > exists)? If so, what's the r...
51,179,069
I have prepared tag input control in Vue with tag grouping. Templates includes: ``` <script type="text/x-template" id="tem_vtags"> <div class="v-tags"> <ul> <li v-for="(item, index) in model.items" :key="index" :data-group="getGroupName(item)"><div :data-value="item"><span v-if="typeof model.tagRenderer != 'func...
2018/07/04
[ "https://Stackoverflow.com/questions/51179069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6670846/" ]
You can use `awk`: ``` awk '/I want following/{p=1;next}!/^X/{p=0;next}p{print NR}' file ``` Explanation in multiline version: ``` #!/usr/bin/awk /I want following/{ # Just set a flag and move on with the next line p=1 next } !/^X/ { # On all other lines that doesn't start with a X # reset the...
Following may help you here. ``` awk '!/X[0-9]+/{flag=""} /I want following letters:/{flag=1} flag' Input_file ``` Above will print the lines which have `I want following letters:` too in case you don't want these then use following. ``` awk '!/X[0-9]+/{flag=""} /I want following letters:/{flag=1;next} flag' Input...
42,192,074
I am trying to get the textbox value with a button click (without form submission) and assign it to a php variable within the same php file. I tried AJAX, but, I don't know where I am making mistake. Sample code: File name: trialTester.php ``` <?php if(!empty($_POST)) echo "Hello ".$_POST["text"]; ?> <html> <hea...
2017/02/12
[ "https://Stackoverflow.com/questions/42192074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2329961/" ]
``` **You just need to take sidebar out of navbar like below** <nav class="navbar navbar-default navbar-fixed-top" role="navigation" style="width: 100%;"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse...
Add position:relative to the style of the new navbar: ``` <nav class="navbar navbar-default navbar-static-top navbar-fixed-top" role="navigation" style="margin-bottom: 0;position:relative"> ``` It will return the scrolling behaviour and as far as I can see, it won't mess with the design.
11,378,004
That is, can you send ``` { "registration_ids": ["whatever", ...], "data": { "foo": { "bar": { "baz": [42] } } } } ``` or is the "data" member of the GCM request restricted to one level of key-value pairs? I ask b/c that limitation is suggested by the wording in Google's doc[1], whe...
2012/07/07
[ "https://Stackoverflow.com/questions/11378004", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1105015/" ]
Just did a test myself and confirmed my conjecture. Send a GCM to myself with this payload: ``` { "registration_ids": ["whatever", ...], "data": { "message": { "bar": { "baz": [42] } } } } ``` And my client received it and parse the 'message' intent extra as this: ``` han...
Although it appears to work (see other answers and comments), without a clear statement from Google, i would not recommend relying on it as their documentation consistently refers to the top-level members of the json as "key-value pairs". The server-side helper jar they provide [1] also reinforces this idea, as it mode...
47,323,579
can you please take a look at this code and let me know how I can add `.click()` to the `a` link with specific data attribute of `HD`? ```js if ($(a).data("quality") == "HD") { $(this).click(); } ``` ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <ul class="strea...
2017/11/16
[ "https://Stackoverflow.com/questions/47323579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1106951/" ]
Use an [Attribute Selector](https://api.jquery.com/attribute-equals-selector/) ```js $("a[data-quality=HD]").click(); ``` ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <ul class="stream"> <li><a data-quality="L">Low</a></li> <li><a data-quality="M">Med</a></li...
you can make use of [Attribute Selectors](https://api.jquery.com/attribute-equals-selector): ``` $('a[data-quality="HD"]').click(function() { //do something }); ```
3,697,329
Sorry if this is explicitly answered somewhere, but I'm a little confused by the boost documentation and articles I've read online. I see that I can use the reset() function to release the memory within a shared\_ptr (assuming the reference count goes to zero), e.g., ``` shared_ptr<int> x(new int(0)); x.reset(new int...
2010/09/13
[ "https://Stackoverflow.com/questions/3697329", "https://Stackoverflow.com", "https://Stackoverflow.com/users/152737/" ]
The documentation is fairly clear: > > `shared_ptr & operator=(shared_ptr const & r); // never throws` > > > Effects: Equivalent to `shared_ptr(r).swap(*this)`. > > > So it just swaps ownership with the temporary object you create. The temporary then expires, decreasing the reference count. (And deallocating i...
You have not leaked memory. The memory for the first int object will be deleted.
3,831,763
$\blacksquare$ **Problem:** Let $\mathbb{P}$ be the set of all prime numbers. Find all functions $f:\mathbb{P}\rightarrow\mathbb{P}$ such that: $$f(p)^{f(q)}+q^p=f(q)^{f(p)}+p^q$$holds for all $p,q\in\mathbb{P}$. --- Note: ----- The immediate solution that comes to mind is $f(p) = p~\forall~p \in \mathbb{P}$. But we...
2020/09/18
[ "https://math.stackexchange.com/questions/3831763", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I thought it would be helpful to readers to have a condensed solution whose structure is easy to see in one go. But everything in this answer is part of [Ralph Clausen's solution](https://math.stackexchange.com/a/3831777/16078). First, we show that **$f$ is injective**. If $f(p)=f(q)$, then the functional equation imp...
$\DeclareMathOperator{\cA}{\mathcal{A}} \DeclareMathOperator{\cB}{\mathcal{B}} \DeclareMathOperator{\cC}{\mathcal{C}} \DeclareMathOperator{\cD}{\mathcal{D}} \DeclareMathOperator{\cE}{\mathcal{E}} \DeclareMathOperator{\cF}{\mathcal{F}} \DeclareMathOperator{\cG}{\mathcal{G}} \DeclareMathOperator{\cH}{\mathcal{H}} \Declar...
2,376,282
I have heard that there is a function $f(x)$ whose Maclaurin expansion is zero but f(x) is not identical to zero. In other words, there exists a function $f(x)$ that satisfies $f^{(n)}(0)$ is zero for every whole number $n$ and $f(x)\neq0$. Could you show me one of such functions? (I've heard it exists but I've never...
2017/07/30
[ "https://math.stackexchange.com/questions/2376282", "https://math.stackexchange.com", "https://math.stackexchange.com/users/468204/" ]
If we take $f(x) = \frac{P(x)}{Q(x)}e^{-1/x^2}$ for $x \neq 0$, then we have (for $x \neq 0$) $$f'(x) = \frac{P'(x)Q(x) - P(x)Q'(x)}{Q(x)^2}e^{-1/x^2} + \frac{2P(x)}{x^3Q(x)}e^{-1/x^2}$$ which assures us that $f'(x)$ will be of the same form (namely, a rational function times $e^{-1/x^2}$). Meanwhile, we know that $f'(...
Yes you appear to be talking about *bump functions*. Contrast the complex case, where differentiable (holomorphic) implies (complex) analytic. The bump function, on the other hand, doesn't equal its Taylor series at O (MacLaurin series ), though it's smooth. If it did it would be zero. ..
3,289,430
Consider the natural numbers that are sum of a perfect square plus the product of consectutive natural numbers. For example, $97 = 5^{2} + 8\cdot 9$. What is the smallest multiple of 2019 that is not as described above? Someone can help me? Thank you in advance.
2019/07/11
[ "https://math.stackexchange.com/questions/3289430", "https://math.stackexchange.com", "https://math.stackexchange.com/users/622509/" ]
Starting from the [Stirling approximation](https://en.wikipedia.org/wiki/Stirling's_approximation) $$ \ln n!\sim n\ln n-n+{\tfrac {1}{2}}\ln(2\pi n)+{\frac {1}{12n}}-{\frac {1}{360n^{3}}}+{\frac {1}{1260n^{5}}}-{\frac {1}{1680n^{7}}}+\cdots $$ we get by simple manipulation of truncated Taylor series \begin{align} &\ln...
@luzl thanks for your help i know this but i need to find this differenceby this way by taylor to find T\_2 usch that i find $k1,k\_2,T\_1$ as in this seq ,not but $T\_2$ not get as it's value in the top seq (n>1)i used (n from 0 to 7) \begin{eqnarray\*} \frac{1}{n} \log[1 + n] -1 -\frac{1}{6} \log[ 8 (\frac{1}{n...
32,361,050
Just like the questions states, is there a hard limit to either the number of files or characters that can go in a file input in Internet Explorer? Here's the test code: ``` <html><input id="files" type="file" name="files[]" webkitdirectory directory multiple></html> ``` I've been able to reach a point where files ...
2015/09/02
[ "https://Stackoverflow.com/questions/32361050", "https://Stackoverflow.com", "https://Stackoverflow.com/users/981120/" ]
This solution is for Swift 1.2 ``` for (index, number) in enumerate(person.phoneNumbers!.map { $0.value }) { println("Phone \(index): \(number)") } ``` And since I am scared by this `!` I would go with the following version ``` if let numbers = person.phoneNumbers { for (index, number) in enumerate(numbers....
You can do it like this. ``` for number in person.phoneNumbers!.map( {$0.value} ) { println(number) } ```
33,512
Mostly sparked by debates regarding evolution, I have become curious what epistemological positions exist in orthodox schools of the major Islamic sects. I understand the doctrinal priority of Quran and Sunnah, so from an Islamic point of view they take precedence over scientific ideas in case they clash. My questio...
2016/07/18
[ "https://islam.stackexchange.com/questions/33512", "https://islam.stackexchange.com", "https://islam.stackexchange.com/users/17702/" ]
Finally the answer I promised is ready. Excuse the long delay. I had little free time to compose this and needed to brush up on some sources for greater accuracy and inclusiveness. Although not too unexpected, the outcome turned out quite like an introductory essay. So I also suspect this might not make for an appropri...
Your question is such that you will probably receive multiple takes, as theology is widely still discussed by the Muslim Scholars. In order to understand the method I'll define the core Islamic Sources: Quran - The revelation from God Sunnah - The practices of the Prophet Muhammad It is the belief of Muslims that Al...
16,320,362
I have built this SQL Query which searches for all policy numbers and returns a sum of all multiple PPOLNO's currency values : ``` SELECT PPOLNO, SUM(PPRMPD) AS SUM FROM PFNTLPYMTH WHERE SUM(PPRMPD) >= 5000 AND ((PYEAR=2012 AND PMONTH >=3 AND PDAY >=27) OR (PYEAR=2013 AND PYEAR <=3 AND PDAY<=27)) GROUP BY ...
2013/05/01
[ "https://Stackoverflow.com/questions/16320362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1122185/" ]
Whenever you need to do a "WHERE" clause on an aggregate (which `SUM` is), you need to use the `HAVING` clause. ``` SELECT PPOLNO, SUM(PPRMPD) AS SUM FROM PFNTLPYMTH WHERE ((PYEAR=2012 AND PMONTH >=3 AND PDAY >=27) OR (PYEAR=2013 AND PYEAR <=3 AND PDAY<=27)) GROUP BY PPOLNO HAVING SUM(PPRMPD) >= 5000 ```
Predicates in the `Where` clause are applied *before* aggregation, To apply a predicate (filter) *after* aggregation, use a `Having` clause... try ``` SELECT PPOLNO, SUM(PPRMPD) AS SUM FROM PFNTLPYMTH WHERE ((PYEAR=2012 AND PMONTH >=3 AND PDAY >=27) OR (PYEAR=2013 AND PYEAR <=3 AND PDAY<=27)) GROUP BY PPOLNO...
3,798
My Jenkins is affected by a known Jenkins [bug](https://issues.jenkins-ci.org/browse/JENKINS-39615%20bug) where it will trigger jobs that have an SCM poll set if a change to the shared library happens. I can't have this, so I thought I would get the trigger info from inside the job and if the URL was from the library r...
2018/04/03
[ "https://devops.stackexchange.com/questions/3798", "https://devops.stackexchange.com", "https://devops.stackexchange.com/users/4427/" ]
Recently, I used this code snippet (that's part of a regular groovy script located inside the 'vars/' directory) to get the project URL as set in the pipeline project config. Hope this helps. ``` scm.getUserRemoteConfigs()[0].getUrl() ``` FYI, it does not expect to have any SCM operation to have taken place. For mo...
Unfortunately I had to [disable the Groovy sandbox](https://wiki.jenkins.io/display/JENKINS/Permissive+Script+Security+Plugin) because I ran into so many situations where methods I wanted to use in my jobs did not appear available for whitelist on the script security page. Instead of adding a bunch of individual method...
116,718
Each programming language has its own quirks, and often there emerges *code patterns* in the community which is collectively founded on an enormous amount of experience. Many of these patterns are highly counter-intuitive to someone new to the language (For example, [quoting in Bash](http://mywiki.wooledge.org/Idiot))....
2011/12/21
[ "https://meta.stackexchange.com/questions/116718", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/130301/" ]
**Never modify the code in the question.** Even if it's just to "improve" the readability. The code is what the OP has that isn't working. What ever is wrong with the code could well be the source of the problem. Editing the code could remove the source of the error and thus invalidate the question and any existing a...
A canonical example of when we point out things that aren't strictly in the question but are very clearly a problem if the asker continues along that path are vulnerabilities for SQL Injection. When the user is appending input into a SQL statement, we are often compelled to point out the vulnerability and perhaps send ...
60,313,736
I know that this probably not the right forum to ask this question as this is not about any particular code issue but does anyone have any idea regarding how we can send messages to and receive them from a particular Consumer Group in Azure Event Hub using .Net SDK or Rest API(I have already created a custom consumer g...
2020/02/20
[ "https://Stackoverflow.com/questions/60313736", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10204642/" ]
"Consumer Groups" is a receiver side concept as its name already suggests. Senders can send to an eventhub or to a specific partition of an eventhub however senders cannot target a particular consumer group. Basically, senders are consumer group agnostic entities. Here you can find some code snippets on consuming even...
You also may want to look through the [samples](https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/eventhub/Azure.Messaging.EventHubs/samples) area of the repository. Each of the listed samples is focused on one scenario and attempts to break down what is being done and why inline with the code. For reading ev...
200,096
I am currently using the [Legrand Orange Book](http://www.latextemplates.com/template/the-legrand-orange-book) template. Is there any way to create multiple indexes for the template? I tried to use [`multind.sty`](http://www.ctan.org/pkg/multind) but seems it doesn't create anything.
2014/09/08
[ "https://tex.stackexchange.com/questions/200096", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/62072/" ]
(Unfortunately, the template is not a package/class file, so it's necessary to manipulate the `main.tex` file containing the template (download link provided below) I suggest the usage of `imakeidx` package Idendify the lines `\usepackage{makeindex}` and replace it by ``` \usepackage[makeindex]{imakeidx} % Required ...
Complement from [makeindex style](https://tex.stackexchange.com/questions/249128/makeindex-style) 1) create MyStyle.ist: ``` delim_0 "\\dotfill\ " delim_1 "\\dotfill\ " headings_flag 1 heading_prefix "\\vspace*{0.5cm}\\nopagebreak\n\\tikz\\node at (0pt,0pt) [rounded corners=5pt,draw=ocre,fill=ocre!10,line width=1pt,i...
1,741,565
I have a problem with opening CF.NET forms using VSTS 2008. It uses the regular windows forms designer instead of the smart device one. Everything was fine under VS2008 Pro, but after installing VSTS this seems broken. Is it possible to modify this behaviour somewhere in the settings or should I blame this on a broke...
2009/11/16
[ "https://Stackoverflow.com/questions/1741565", "https://Stackoverflow.com", "https://Stackoverflow.com/users/200872/" ]
Your code will call `System.IO.Path.CheckInvalidPathChars`, which in turn checks for the the following: 1. double quote (") 2. left angle bracket (<) 3. right angle bracket (>) 4. veritical bar (|) and for control characters less than 32 decimal (space). So Make sure your path doesn't contain them. **Edit:** [comme...
Nice Stacktrace, but the invalid path would be more helpful. In my oponion, the path provided to OpenBay.Utils.XPathUtils.GetNodes(string, string) has some invalid arguments. Use System.IO.Path.CheckInvalidPathChars() to check which characters are invalid and maybe contained in the argument provided to the method abo...
5,043,935
A friend of mine has sent me some obfuscated code. I've managed to deobfuscate most of it, but now its at a part where an entirely new obfuscation function is obfuscated with the obfuscated string, and the obfuscated string has to be run through that function. I've deobfuscated the function, but the string doesn't see...
2011/02/18
[ "https://Stackoverflow.com/questions/5043935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/266542/" ]
I know it's not the specific question you asked, but it's clearly what you wanted :) Take a look at some of this, which you have to deal with as you get further to the truth! ``` fvnciron dcrodb_0a(in) | in=srob_spli(in,1.); ros=''; froroach (in AS wal) | =rorod(wal)-1.; =(<0)B?+2:; ros1.=chro(); ~ wal (ros); ~ dcrod...
Based on your explanation in the comments that you (if I understand) want to capture the function parameters, I think this is what you're looking for: ``` /function(\s+[^(\s]+)?\s*\((?:([^),]+),?)+\)/ ``` Then you'll want to grab capture-group 2 (the `([^),]+)` part) and trim it for whitespace. The function name, if...
36,710
U.S. Senator Bernie Sanders recently [tweeted](https://twitter.com/SenSanders/status/819590552576491520): > > As Republicans try to repeal the Affordable Care Act, they should be reminded every day that **36,000 people will die yearly as a result**. > > > (emphasis mine). How accurate is this statement? Where is ...
2017/01/12
[ "https://skeptics.stackexchange.com/questions/36710", "https://skeptics.stackexchange.com", "https://skeptics.stackexchange.com/users/4933/" ]
My **TL;DR** summary is: there is too much uncertainty at this stage to know what the specific effect of an ACA repeal would be. The rest of this answer explains in more detail that: * On the effect of health care reform and expanded coverage on mortality rates, + Two studies involving four states that increased i...
**TL;DR**: There is no evidence that Obamacare reduces mortality; if anything, it increases it. ### Raw data > > If extending taxpayer-sponsored insurance to 15 million people since 2013 has resulted in 21,000 fewer annual deaths, then the mean death rate should decrease from 310.4 to approximately 300. > > > Ret...
67,153
Say you had a runway for light aircraft, but only 700 meters or so of runway. Wouldn't it help to end the runway with a ramp that is ~40 meters above ground and slightly facing the sky at a gradient of 5%. Imagine the runway below was 700 meters long: [![a RAMP](https://i.stack.imgur.com/0pAV3.png)](https://i.stack.img...
2019/07/31
[ "https://aviation.stackexchange.com/questions/67153", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/17755/" ]
This is a smart but unfortunately not very good idea. It seems quite reasonable to use a ramp at the end of a runway to help launch a plane into the air, and matches everyday experience when we are doing things with say skateboards or kites: an upward kick or movement is what they need to get them aloft. The other an...
One other consideration: this [paper](https://apps.dtic.mil/dtic/tr/fulltext/u2/a237265.pdf) contains experimental results on the use of ramps, and one thing it makes clear is that the length of the run-up to the ramp, for any given airplane, is highly dependent on the gross weight. In a conventional take-off, you can ...
520,045
So, I want to route certain traffic via a VPN connection and the rest via my normal Internet connection. I want to run several different programs and most of them don't support binding to a specific network interface (`tun0` in my case). I've managed to send a specific user's traffic via the VPN following the answers ...
2013/07/01
[ "https://serverfault.com/questions/520045", "https://serverfault.com", "https://serverfault.com/users/179925/" ]
first add a firewall rules: ``` iptables -t mangle -A OUTPUT -m owner --uid USER -j MARK --set-mark 1 iptables -t nat -A POSTROUTING -m mark --mark 1 -j MASQUERADE ``` then add a routing rule: ``` ip rule add fwmark 0x1 table 100 ``` and then add routes to your new routing table: ``` ip route add SOMEROUTE via S...
You have to set up a static route for the network that is on the other side of the VPN. Usually everything gets routed over the default route unless you specify an explicit route. Say for example the network behind the VPN would be 10.10.42.0/24 then you add an static route with ``` ip route add 10.10.42.0/24 dev tun...
34,820,267
What would be the most efficient (fast and reliable enough) way in JavaScript to determine the type of line breaks used in a text - Unix vs Windows. In my Node app I have to read in large utf-8 text files and then process them based on whether they use Unix or Windows line breaks. When the type of line breaks comes u...
2016/01/15
[ "https://Stackoverflow.com/questions/34820267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1102051/" ]
You would want to look first for an LF. like `source.indexOf('\n')` and then see if the character behind it is a CR like `source[source.indexOf('\n')-1] === '\r'`. This way, you just find the first example of a newline and match to it. In summary, ``` function whichLineEnding(source) { var temp = source.indexOf('...
This is how we detect line endings in JavaScript files using ESLint rule. Source means the actual file content. Note: Sometimes you can have files with mixed line-endings also. <https://github.com/eslint/eslint/blob/master/lib/rules/linebreak-style.js>
13,646,164
I have to download zip file from ftp using c# code. i have used the following code. ``` Uri url = new Uri("ftp://ftpurl"); if (url.Scheme == Uri.UriSchemeFtp) { FtpWebRequest objRequest = (FtpWebRequest)FtpWebRequest.Create(url); //Set credentials if required else comm...
2012/11/30
[ "https://Stackoverflow.com/questions/13646164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1852537/" ]
Set the Visibility of all the contents of the list view to GONE and then set the visibility of the View to Gone.... this will hide the row without occupying space..... it worked for me even i have been searching for this but after a research i found this.... **EDIT 1 :** Setting the visibility of the View to GONE is ...
By modifying getCount() and also the position in getView() with your logic you can make it work for sample Check <http://www.sherif.mobi/2012/01/listview-with-ability-to-hide-rows.html> by @sherif-elkhatib
1,064,635
The following combinatorial identity have been verified via maple, but I can not prove it. Who can prove it without WZ mehtod? $$\sum\_{k=0}^s{s\choose k}{m\choose k}{k\choose m-s}={2s\choose s}{s\choose m-s}$$.
2014/12/12
[ "https://math.stackexchange.com/questions/1064635", "https://math.stackexchange.com", "https://math.stackexchange.com/users/196094/" ]
Use subset-of-a-subset\*\*, isolate non-index term, and then use Vandermonde\*\*\* to arrive at the result. $$\begin{align} \sum\_{k=0}^s \color{blue}{\binom sk}\binom mk \color{blue}{\binom k{m-s}} &=\sum\_{k=0}^{s}\color{blue}{\binom sk{\binom k{m-s}}} \binom mk \\ &=\sum\_{k=0}^{s}\color{blue}{\binom s{m-s}\binom{2s...
Let $n=m-s$; we may assume that $0\le n\le s$, as otherwise both sides are zero. The righthand side is the number of ordered pairs $\langle A,B\rangle$ such that $A$ is an $s$-subset of $[2s]$ and $B$ is an $m$-subset of $[s]$. So is the lefthand side, though this is less obvious. Note that the $k$ term is zero unles...
46,105,567
I have declared 4 unsigned variables: ``` uint32_t empty_bucket; uint32_t base_bucket; uint32_t hop_size; uint32_t ht_size; ``` I want to perform a signed conditional check: ``` if (empty_bucket < base_bucket + (hop_size - 1) - ht_size) ``` Knowing that `base_bucket + (hop_size - 1) - ht_size` could be a negative...
2017/09/07
[ "https://Stackoverflow.com/questions/46105567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6531241/" ]
Since you're using `stdint` include, you could convert the operands to 64 bit signed values, and compare that, no risk that any of the terms to the right become negative, and we have to cast the left operand to signed integer to avoid undefined/implementation behaviour when comparing signed/unsigned: ``` if ((int64_t)...
``` if (base_bucket + hop_size > ht_size + 1 && empty_bucket < base_bucket + (hop_size - 1) - ht_size) ``` The first line checks if the right side of the comparison we want to perform is indeed a positive integer. It is done by checking that all the positive values (`base_bucket` and `hop_size`) are greater than ...
7,378,177
I don't really know how to explain what I want to do. I will try to explain what I am doing. I built a website in ASP.NET 4 (WebForms) and I want that my brother will be able to click on a button, choose a file from his computer and it will be uploaded to my server. I have no idea how to do it. It sounds very hard ...
2011/09/11
[ "https://Stackoverflow.com/questions/7378177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/796862/" ]
There's an ASP.NET control made just for that, [the `FileUpload` control](http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.aspx). Here's a [handy example](http://asp.net-tutorials.com/controls/file-upload-control/). Note that it's notoriously difficult to style if you want to apply CSS and ...
you have 2 options really.. use a traditional fileupload control (from the toolbox) or use the Ajax AsyncFileupload control. either way it will allow your brother to upload a file from his computer to your server.
1,981,713
Prove that $\nu(mn) \le \nu(m)\nu(n)$ I think it is sufficient to prove this inequality for powers of prime numbers so that you can use the formula for $\nu$, but I'm not sure how the inequality is factored in
2016/10/23
[ "https://math.stackexchange.com/questions/1981713", "https://math.stackexchange.com", "https://math.stackexchange.com/users/366102/" ]
Firstly I should warn you that I am just learning about sheaves and presheaves for the first time at the time of writing this answer. With that out of the way, lets start off with a couple of definitions : > > **Definition** (presheaf) For $X$ a topological space, a *presheaf* (of groups) $\mathcal{F}$ on $X$ is fun...
Consider the space $\mathbb R$ and the sheaf of sets $F$ such that for each open set $U$ the set $F(U)$ is the set of constant functions whose integral is at most $1$. Is it a sheaf?
4,488,230
I was trying to understand a ramified coverings of a puntured sphere and came to the book "Graphs on Surfaces and Their Applications" S. Lando, A. Zvonkin. In the first chapter they define a *constellation* as > > A sequence $[ g\_1, g\_2, ...,g\_k ]$, where $g\_i \in S\_n$, is called a constellation (or a $k$-conste...
2022/07/07
[ "https://math.stackexchange.com/questions/4488230", "https://math.stackexchange.com", "https://math.stackexchange.com/users/870755/" ]
A transitive action just means that any point can go to any other point. This can happen when $G$ is much smaller than $S\_n$, for example, if $G$ is a group of order $n$ generated by the $n$-cycle $(1,2,3,\ldots,n)$. If $G=S\_n$ then all the points $\{1,2,\ldots\,n\}$ can go to any permutation of the $n$ points, which...
By the orbit-stabilizer theorem, every subgroup $G$ of $S\_n$, all whose pointwise stabilizers have order $a$ such that $n=\frac{|G|}{a}$, acts transitively on $\{1,\dots,n\}$. @Ted's answer provides a minimal example, with $|G|=n$ and $a=1$.
400,914
I have a few questions I hope you can help me answer. First, I'll introduce myself. I'm a finance undergraduate student in Australia, but I'm originally from Norway. Throughout school I always loved math, but I ended up studying finance. The last year or so I have started to realise that I should have done Computer S...
2013/05/24
[ "https://math.stackexchange.com/questions/400914", "https://math.stackexchange.com", "https://math.stackexchange.com/users/79235/" ]
I'd recommend you check out the Mathematics section [here](http://www.openculture.com/freeonlinecourses) for free online video courses offered by some of the top institutions.
Many of these answers seem inappropriate since you see yourself in a quant after you graduate. I would suggest that you build your resume towards getting the job you want, and then learn the mathematics necessary for the job that you get *after you get it*. And for building your resume for a quant job, I would suggest ...
69,427
Sometimes PLSS section corners do not align ![enter image description here](https://i.stack.imgur.com/rIvIR.jpg) How could I automate the detection of these corners and generate a new shapefile showing where this occurs? I have a shapefile of 147k section polygons that I would like to analyze. I am on ArcGIS 10.1 a...
2013/08/22
[ "https://gis.stackexchange.com/questions/69427", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/6580/" ]
With a bit of programming, you can identify points where the number of lines that intersect the point is not 4. You don't mention what version of arcgis, but with the lowest level (Basic, ArcView, or whatever Esri is calling it this week) you should be able to build a MapTopology. The code in [this answer](https://gi...
**A "misaligned" corner borders three rather than four polygons.** Although not all such corners will be misaligned--such things can happen around the perimeter of the PLSS system and along natural boundaries--finding these places will provide an efficient screen that picks up all misaligned corners with very few false...
1,394,801
I'm working through Oystein Ore's *Number Theory and its History*. On p. 109, I'm stuck on #2. > > The question asks the reader to verify the following identity [Note: $(x,y)=\gcd(x,y)$]: > > > $$(ab,cd)=(a,c)(b,d)\left(\frac{a}{(a,c)},\frac{d}{(b,d)}\right)\left(\frac{c}{(a,c)},\frac{b}{(b,d)}\right)$$ > > > I...
2015/08/12
[ "https://math.stackexchange.com/questions/1394801", "https://math.stackexchange.com", "https://math.stackexchange.com/users/192092/" ]
**Theorem 1.** Let $x$ and $y$ be two integers. Then, there exist integers $p$ and $q$ such that $px+qy=\gcd\left( x,y\right) $. Theorem 1 is Bezout's theorem, and we assume it to be known. Notice that the integers $x$ and $y$ are allowed to be $0$ (even both of them, in which case we use the convention $\gcd\left( 0,...
After being away from the problem for more than a year, Leox's comment reminded me of the problem, so I looked at it again. I think I solved it! (EDIT: Per the comments, this answer is incomplete and has an error.) I use just the basic GCD (a,b) and LCM [a,b] identities presented in the book to that point: $$ab=(a,b)[a...
38,969,397
Suppose I have the following actor: ``` class A extends Actor { def receive = { case Unlock => sender ! UnlockResponse (Boolean_code) case Read => sender ! ReadResponse (somedata) case Lock => sender ! LockResponse (Boolean_code) } } ``` I would like to write.a helper method where I can ca...
2016/08/16
[ "https://Stackoverflow.com/questions/38969397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/141516/" ]
You have `std::lower_bound` to find the lowest item which doesn't meet your search value. ``` auto it = mymap.lower_bound( value ); ``` From [cplusplus map::lower\_bound](http://www.cplusplus.com/reference/map/map/lower_bound/) > > A similar member function, upper\_bound, has the same behavior as lower\_bound, exc...
*upper\_bound* looks for the key *greater than* (**>**) supplied key or stops at the end of the map. *lower\_bound* looks for the key *greater than or equal to* (**>=**) supplied key or stops at the end of the map Given below is the code to find the closest range of input number: [Demo](http://ideone.com/S3dkGi) ``...
1,134,350
My default browser is Chrome. When I run my web applications within VS 2008 IDE, it uses chrome. I want to use IE for this. Is there an option in VS 2008 to make IE the browser to load the web applications? I just want this when using VS 2008 - I don't want to change my default browser each time otherwise. EDIT: wh...
2009/07/15
[ "https://Stackoverflow.com/questions/1134350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/108685/" ]
Right click on .aspx file in your solution tree, and click Browse With... then specify your default browser. ---
You could create a post-build event that runs FireFox.exe, pointing to the url of your website. You can edit post-build events by right-clicking on your Web Application, going to Compile, and clicking the Build Events button. Your post-build command could be something like "C:\Program Files\Mozilla Firefox\firefox.exe"...
152,813
Is there a way to determine the width of the first column in a `tabular` enviroment? I've thought about using a `savebox` but that would only give me the size of the text (and in one cell only), not the actual column width. Or should I use `longtable` (or another package) to do that?
2014/01/07
[ "https://tex.stackexchange.com/questions/152813", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/36821/" ]
This answers provides several possible solutions: the first one uses indices via the `imakeidx` package to produce the different divisions by topics; the second and third options use ToC-like mechanisms: the second one uses `\@starttoc` to produce multiple ToCs (one for each topic), and the third one shows how to use t...
To create two TOCs in a single document use the [`titletoc`](http://www.ctan.org/pkg/titletoc) package. Here is a minimum example : ``` \documentclass{book} \usepackage{titletoc} \begin{document} \begin{titlepage} This is the Title page. \end{titlepage} \startlist{toc} \printlist{toc}{}{\section*{My toc}} ...
1,065,294
I found some old questions about this, yet not for 18.04. We're deploying desktops via PXE/Preseed installations, and I'd like to change the default wallpaper. I found how to change the login screen wallpaper, but not yet how to change the default wallpaper for new users. Any hint about this would be appreciated.
2018/08/14
[ "https://askubuntu.com/questions/1065294", "https://askubuntu.com", "https://askubuntu.com/users/144980/" ]
The default wallpaper in Ubuntu 18.04 is **warty-final-ubuntu.png**, and the most easy approach to change it would be to convert (if necessary) your wallpaper to `png` format, rename it to warty-final-ubuntu.png, then rename the original default wallpaper and copy your wallpaper to the default location. ``` sudo mv /u...
Posting as it took me some time to find a solution for **Ubuntu 20.04**, even though this is an old question, it might help others looking for this. This is where I found the method: <https://help.gnome.org/admin/system-admin-guide/stable/dconf-custom-defaults.html.en> What I tried and didn't work: I tried to edit th...
5,852,945
I have this schema: ``` Hotel (**hotelNo**, hotelName, city) Room (**roomNo, hotelNo**, type, price) Booking (**hotelNo, guestNo, dateFrom**, dateTo, roomNo) Guest (**guestNo**, guestName, guestAddress) ** denotes primary keys ``` I have to complete this query: * Display each hotel and its most common room. I hav...
2011/05/02
[ "https://Stackoverflow.com/questions/5852945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/604114/" ]
If you are looking for popularity, you would need to take into account the Booking table. Add the Booking table to your FROM statement, link on hotelNo and roomNo and do a count on the Booking table. This should give you the counts you want. Edit: Here is some sample code for you (tested): ``` SELECT TOP (100) PERCEN...
I think you're going to have to use an inner query to get this one working: ``` SELECT dbo.Hotel.hotelName, pop.type, pop.Count FROM dbo.Hotel INNER JOIN ( SELECT TOP 1 dbo.Hotel.hotelNo, dbo.Room.type, COUNT(*) AS Count FROM dbo.Hotel INNER JOIN dbo.Room ON dbo.Room.hotelNo = dbo.Hotel...
23,603,666
I need to map SCIM core schema to LDAP to be used by UnboundId for operations in LDAP. Is there a better approach to convert these schema?? e.g. In schema given [here](https://datatracker.ietf.org/doc/html/draft-hunt-scim-directory-00#section-2.2.3.4) I need to map: `userName` to `uid` `name.formatted` to `cn` `na...
2014/05/12
[ "https://Stackoverflow.com/questions/23603666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/420613/" ]
Take a look at the [Apache eSCIMo](http://svn.apache.org/repos/asf/directory/escimo/trunk/) project, it uses XML based mapping file to map SCIM attributes to LDAP and vice versa. This is compliant with SCIM v2.0 schema, but some of the recent schema changes weren't added yet.
I have several different ways of doing this, depending on the requirements. * Create a simple `Enum` and map all values from either side * Use a `Properties` file with keys like `schema.scim.userName = uid` * Create an XML file with `<app-name>` and `<ldap-name>` elements The last two options I usually parse into a ...
2,152,743
> > We have $\alpha=(1+i)^7$ and $\beta=16$ in the ring $R=\mathbb Z[i]$. How can we prove that $\beta R\subseteq\alpha R$? > > > My try: $\beta R=\{a+bi:a,b\in 16\mathbb Z\}$ and $\alpha =(1+i)^7\in\mathbb Z$. I am clueless.
2017/02/20
[ "https://math.stackexchange.com/questions/2152743", "https://math.stackexchange.com", "https://math.stackexchange.com/users/397530/" ]
You already got a sufficient condition for realness (matrix being hermetian) but a condition for distint-ness is not that easy. You could use [Gerschgorin-circles](https://math.stackexchange.com/questions/2102931/gerschgorins-theorem-round-1) for a start. This theorem gives you circles in the complex plane with midp...
For the eigenvalues to be real matrix has to be Hermitian $v^{\dagger}Aw=w^{\dagger}A^{\dagger}v$ For any $v, w\in\mathbb{C}$. And here $F^{\dagger}=\bar{F}^{T}$. Don't know what to say about them being distinct.
8,379,574
I am using a Bean Shell interpreter in a for loop like this ``` for(int i = 0; i <functionSize; i++){ interpreter.set("x", i); yvalues[i] = (Integer) interpreter.eval(functionString); } ``` The problem I am having is that when I do the function 2^x I get really strange output. The list of t...
2011/12/04
[ "https://Stackoverflow.com/questions/8379574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/546427/" ]
The expression `2^x` represents bitwise XOR, not exponentiation. Use [`Math.pow(2,x)`](http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html#pow%28double,%20double%29) if you like, but realize that it operates on doubles, not ints, so will give you a floating-point answer that will probably cause an exception wh...
Ended up editing to: ``` double y = Double.parseDouble(interpreter.eval(functionString).toString()); yvalues[i] = (int) y; ``` And using `Math.pow(a, b)` as my input. Doesn't look pretty, but its working.
21,621,357
I am new to python and trying to parse the json file and fetch the required field based on condition. eg., if status = true, then print name Json file: ``` [ { "id": "12345", "name": "London", "active": true, "status": "true", "version": "1.0", "tags": [ ] }, { "id": "12457", ...
2014/02/07
[ "https://Stackoverflow.com/questions/21621357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2919768/" ]
``` >>> import json >>> obj = json.loads('[ { "id": "12345", "name": "London", "active": true, "status": "true", "version": "1.0", "tags": [ ] }, { "id": "12457", "name": "Newyork", "active": true, "status": "false", "version": "1.1", "tags": [ ] } ]') >>> print "Names:", ",".join(x["name"] for x in obj if x["status"] ...
You can get all info about json parsing here. <http://docs.python.org/3.3/library/json.html>
31,250,501
how can I ignore or filter parts of the result of centreon\_plugins.pl using a regexp ? practical example : I'm trying to monitor inodes on all my linux servers (RHEL 6) so I use the following command: ``` perl centreon_plugins.pl --plugin=os::linux::snmp::plugin --mode=inodes --hostname=servname --snmp-version=2c ...
2015/07/06
[ "https://Stackoverflow.com/questions/31250501", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4338008/" ]
Use DefaultSliderView class instead of TextSliderView class. see example below : ``` DefaultSliderView defaultSliderView = new DefaultSliderView(this); defaultSliderView.image(file_maps.get(images)); // adding images here mDemoSlider.addSlider(defaultSliderView); ``` hope it helps ...
I solved this issue by writing my a custom ImageSlider, as specified [here](https://github.com/daimajia/AndroidImageSlider/wiki/Slider-view) I love this library!
128,818
Why do the two pieces of code below yield rather different results? The only difference is that in the first one the function definition is in the same line as the `Remove` command while in the second one the two commands are in different lines. ``` Remove[f]; f[x_] := 1; ?? f (* Information: Symbol f not found *) ``...
2016/10/16
[ "https://mathematica.stackexchange.com/questions/128818", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/22021/" ]
Executing `Trace` on an expression reveals what is actually happening: ``` Trace[Remove@x; x = 1] (*{Remove[Removed[x]];Removed[x]=1,{Remove[Removed[x]],Null},{Removed[x]=1,1},1}*) ``` "the Wolfram Language always reads in a **complete** input expression, and interprets the names in it, **before** it executes any pa...
*I use the word internal symbol rather than just symbol, to make it easier to distinguish between the name of a symbol and the internal representation of the symbol inside the kernel. I felt I should clarify this as I have not seen this terminology used elsewhere (and WRI may not agree this is a useful concept).* The ...
12,026,065
I've always thought that appending a list to another one meant copying the objects from the first list and then pointing to the appended list as described for example [here](http://diditwith.net/2008/03/03/WhyILoveFListsTheBasics.aspx). However, in [this](http://fsharpnews.blogspot.se/2007/02/avoiding-copying-in-functi...
2012/08/19
[ "https://Stackoverflow.com/questions/12026065", "https://Stackoverflow.com", "https://Stackoverflow.com/users/360674/" ]
> > In the functional world, lists are immutable. This means that node sharing is possible because the original lists will never change. Because the first list ends with the empty list, its nodes must be copied in order to point its last node to the second list. > > > If you mean this statement then the answer is ...
F# lists hold references (not to be confused with F#'s `ref`) to their elements; list operations copy those references (pointers), but not the elements themselves. There are two ways you might append items to an existing list, which is why there seems to be a discrepancy between the articles (though they both look to ...
16,164,620
> > I am working on a program that needs to convert a 32-bit number into a decimal number. > > > The number that I get from input is a 32 bit number represented as floating point. The first bit is the sign, the next 8 bits are the exponent, and the other 23 bits are mantissa. I am working the program in C. In inp...
2013/04/23
[ "https://Stackoverflow.com/questions/16164620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Which part of the below code was hard to get right given all the formulas and sample numbers and a calculator? ``` #include <stdio.h> #include <limits.h> #if UINT_MAX >= 0xFFFFFFFF typedef unsigned uint32; #else typedef unsigned long uint32; #endif #define C_ASSERT(expr) extern char CAssertExtern[(expr)?1:-1] // En...
After scouring the internet and being unable to find similar functions, I wrote these floating point Conversion functions. ``` //NOTE memcpy is a more efficient way to do this //These instructions are presented for reference only //I Zackery Sobin created these functions //and I release them into the public domain //t...
41,287,378
so I have this two models: ``` class Patient(models.Model): patientID = models.CharField(max_length=200 , default='Enter PatientID') age = models.IntegerField(default='-') gender = models.CharField(max_length=200,choices=Gender_Choice, default='UNDEFINED') class RiskFactor(models.Model): patient = mod...
2016/12/22
[ "https://Stackoverflow.com/questions/41287378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7317000/" ]
Currently `javafx.scene.robot.Robot` is available, which can take screen captures. I don’t know if it was when the question was originally asked. The method is: ```java javafx.scene.robot.Robot robot = new Robot(); WritableImage imgReturn = robot.getScreenCapture(imgOut, new Rectangle2D()); ``` The optional rectangl...
This is the main mechanism I have used: A transparent `Stage` with Transparent `Canvas` which has a `BorderPane` with Opacity `0.1` Here is the simple example (it is just for selecting areas...): **WHEN YOU START THE APP THE ONLY WAY TO CLOSE IT IS USING ESCAPE** [![enter image description here](https://i.stack.imgu...
72,073,779
I want to offset a range if the numerical part of a range's address can be divided by 11. (A11, A22, A33, and so forth). Take a range in a given sheet, for example Range("A2"). Could I do ... ``` Dim isRng as Range Dim rngAddress as String Dim tstAddress as Integer, nsnAddress as Integer ...
2022/05/01
[ "https://Stackoverflow.com/questions/72073779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19005072/" ]
```java while(true){ System.out.println("Who are you looking for ? "); String contact = scan.nextLine(); bool isFound = false; for(int i = 0; i < names.length; i++){ if(names[i].equals(contact)){ System.out.println("They are in aisle " + i); isFound = true; br...
If you want it to print not here only when you have not found the element at all you should put it after the for loop. So you would loop through the whole array if you find the name say that you found it and then if you didn't u can print not here so something like that : ``` while(true){ System.out.print...
20,788,075
I know there are question have been asked around resembling to this one, but still I am not getting proper concept of this. I am currently loading an iframe through javascript in following manner: ``` jQuery('.out-div-login').html("<iframe id='parent' frameBorder='0' width='320' height='500' src='"+_url+"'></iframe>"...
2013/12/26
[ "https://Stackoverflow.com/questions/20788075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3137239/" ]
You should use `location.href` inside the iframe. That should work. set location.href in the iframe to your new location.
The url query string (?xxx) should also be kept in the new url, so the whole solution should be: ``` location.href = "new_link_url" + location.search; ```
311,905
Using Windows 7. I have a Windows Explorer icon pinned to my taskbar. When no Explorer window is open, clicking it takes me to “Libraries”, a folder that I never use. **Is there a way to set a default folder to show here?** I already followed the steps in the vaguely-related question “[Is there a way to set up a def...
2011/07/18
[ "https://superuser.com/questions/311905", "https://superuser.com", "https://superuser.com/users/8562/" ]
All of these solutions result in an extra instance of the explorer.exe process each time the modified shortcut is used, and they accumulate until you logoff. A simpler and better solution is simply to replace all of the "Windows Explorer.lnk" shortcuts throughout the system with an ordinary folder shortcut named "Wind...
Do the steps in this thread require **admin** privs? On our corporate W7 Pro machines users do not have admin so right-clicking Explorer in the task bar shows no menu. (Security wise, you should run with a non-privileged user account and when requested in a UAC (User Auth Control) enter the admin password.) Instead, *...
1,633,567
I am working in a bash script where I need to analyze the output of an FTP session. But I encountered a problem with SUSE Linux FTP client when connecting to an AIX ftp server. The problem is that the output from the FTP command is beign shown on the screen, but is not being send to a pipe if a do a "| grep" or "| awk...
2009/10/27
[ "https://Stackoverflow.com/questions/1633567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5425/" ]
It is working now. I was missing the -v parameter for FTP. The documentation is confusing because it states that the -v parameter is the dafault, and it was working as if it was activated (showing all the output in the terminal), but it was not printing it in stdout. When I activated it, the pipes and file redirect ...
You need to redirect stderr AFTER stdout, as in: ``` ftp -n servername > ftplog.log 2>&1 ``` NOT ``` ftp -n servername 2>&1 > ftplog.log [wrong!] ```
1,396,022
Suppose $M$ is a $(2k+1)$-dimensional manifold on which a 1-form $\alpha$ is defined. $M$ is termed as a *contact manifold* if the distribution arising from $\alpha$ is nowhere integrable, i.e. if: $$\xi\_q=\{v\in T\_qM:\alpha(v)=0\}$$ is a distribution that admits no integral manifolds whatever point you look for an i...
2015/08/13
[ "https://math.stackexchange.com/questions/1396022", "https://math.stackexchange.com", "https://math.stackexchange.com/users/135592/" ]
This is false. The contact condition is often known as being *maximally* non-integrable. Given an integrable distribution $\xi$ defined by a 1-form $\alpha$, use that $$d\alpha(X,Y) = Y\alpha(X) - X\alpha(Y) - \alpha([X,Y]).$$ So if $X,Y \in \xi$, then $d\alpha(X,Y) = 0$. So in particular $\alpha \wedge d\alpha = 0$ ...
Posting this to sum up all the stuff that came out in the huge comment discussion under Mike's answer, a discussion which needs 4 screenshots, [1](https://i.stack.imgur.com/6VeG4.png) [2](https://i.stack.imgur.com/RQSTU.png) [3](https://i.stack.imgur.com/Ccb5L.png) and [4](https://i.stack.imgur.com/YdpPG.png), to fit i...
90,101
I am an undergraduate studying quantum physics with the book of Griffiths. in 1-D problems, it said a free particle has un-normalizable states but normalizable states can be obtained by sum up the solutions to independent Schrodinger equations. in my view the book also suggests that a scattering state with E>V(infinity...
2013/12/13
[ "https://physics.stackexchange.com/questions/90101", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/35767/" ]
Neuneck's answer is the pithiest description of *how* you get normalisable states as superpositions of non-normalisable states, but the following is more of a "why" these states happen. Hopefully, you should see that this discussion is independent of the number of dimensions. Practically speaking, the reason why there...
The scattered states are indeed non-normalizable. This is because a plane wave is an unphscial state (which you can for example see by trying to calculate the Heisenberg uncertainty, which will read $\Delta x \cdot \Delta p = \infty \cdot 0 = ??$). In order to create a physical state, you need to specify boundary cond...
19,601,036
I'm using Django along with Bootstrap and I have a page where there are two inputs and a submit button: ``` <div class="col-lg-5"> <form id="search_form" align="right" action="/comparison/" class="form-inline" method ="get" role="form"> <input id="navPersonSearch" class="input form-control" type="te...
2013/10/25
[ "https://Stackoverflow.com/questions/19601036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2027556/" ]
You can use: ``` <div ng-repeat="item in items | filter:{visible: true} | limitTo: 50"> <p>{{item.id}}</p> </div> ``` `filter:{visible: true}` will return a list of all visible items You can take a look at the angularjs docu for more information on the filter filter. <http://docs.angularjs.org/api/ng.filter:fil...
There are a couple of approaches, maybe the most reusable is for you to create your own 'visible' custom filter which looks for visible attribute on your items. Then you could chain them. ``` <div ng-repeat="item in items | visible | limitTo: 50"> ``` [Here's a SO link to create custom filters](https://stackoverflo...
65,179,829
Every user getting registered to the Sandbox gets added to the Platform as an Identity. How can I get the Identity ID of my user when I log in to the [Sandbox environment](https://world-sandbox.oftrust.net/)? I need this user ID for creating links between identities as is exemplified [in this guide](https://developer.o...
2020/12/07
[ "https://Stackoverflow.com/questions/65179829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14575832/" ]
Your problem is trying to update the state after component unmount. The onAuthUIStateChange function seems to have been designed with the subscribe-unsubscribe architecture. It returns the unsubscribe function of this function itself. source code: <https://github.com/aws-amplify/amplify-js/blob/master/packages/amplify-...
Try this: ``` import React from "react"; import Amplify from "aws-amplify"; import { AmplifyAuthenticator, AmplifySignOut, withAuthenticator, } from "@aws-amplify/ui-react"; import { AuthState, onAuthUIStateChange } from "@aws-amplify/ui-components"; Amplify.configure({ Auth: { region: "...", userPool...
52,239,344
I have a django app running on cpanel (I'm not sure if is a problem of my django app or cpanel server), when the debug mode is set up `True`. I can see all the media files, like profiles pictures or pdf files, etc. But when the debug mode is set up `False`, you can't see the media files on the app. This is my configu...
2018/09/08
[ "https://Stackoverflow.com/questions/52239344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8041911/" ]
To deploy a production server, you need to set 3 things 1. deactivate the DEBUG configuration: > > DEBUG = False > > > This disable all extra function for development. 2. define a static root directory in the settings file: > > STATIC\_ROOT = '/this/is/a/path/to/statics' > > > This, indicate where all the...
I don't actually solve it yet but you can do as below to solve your issue: 1 - Setup your media and static root: ``` STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static') MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, "media") ``` 2 - Activate your virtual enviroment on cpanel then run ...
36,359,857
I'm currently looking into server-side validation of a GoogleIDToken for Google Sign-in (Android & iOS). [Documentation here](https://developers.google.com/identity/sign-in/android/backend-auth#send-the-id-token-to-your-server) In the example, the "sub" field in the object returned by the Google API endpoint is read a...
2016/04/01
[ "https://Stackoverflow.com/questions/36359857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3345143/" ]
A possible top-level algorithm to solve this puzzle is to repeat the following until there is only one color on the whole board: * Find all contiguous color regions. Treat the region at (0,0) as primary, all others as secondary. * Pick the largest (by count of tiles) secondary region with a color that is different to ...
There's a bunch of things I don't understand in your code so instead of trying to fix them I'll create a new function and you can compare the two. ``` // this function is called when the user inputs the x and y values // the colors vector will be modified in place by reference void change_color(int x, int y, vec_2d& c...
36,559,254
In Python sklearn ensemble library, I want to train my data using some boosting method (say Adaboost). As I would like to know the optimal number of estimators, I plan to do a cv with different number of estimators each time. However, it seems doing it the following way is redundant: ``` for n in [50,100,150,200,250,...
2016/04/11
[ "https://Stackoverflow.com/questions/36559254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3457417/" ]
It is possible to use inheritance to make a "hack" of `AdaBoostClassifier` that doesn't retrain estimators and is compatible with many cross-validation functions in `sklearn` (must be cross-validation that doesn't shuffle data). If you look at the source code in `sklearn.ensemble.weight_boosting.py`, you can see that ...
You can fit all 300 estimators and then use `AdaBoostClassifier.staged_predict()` to track how the error rate depends on the number of estimators. However, you will have to do the cross-validation splits yourself; I don't think it is compatible with cross\_val\_score(). For example, ``` from sklearn.ensemble import ...
32,425,974
I am making a twitch chat bot with c# and I would like to know how I can purge/timeout users that are spamming or using banned words. I have searched everywhere i can to find a solution for this, but I can not find an answer anywhere.
2015/09/06
[ "https://Stackoverflow.com/questions/32425974", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4789832/" ]
I also encountered this problem some time ago. The **real** solution would be solve the challenge the cloudflare websites gives you (you need to compute a correct answer using javascript, send it back, and then you receive a cookie / your token with which you can continue to view the website). So all you would get norm...
Use `WebClient` to get html of the page, I wrote following class which handles cookies too, Just pass `CookieContainer` instance in constructor. ``` using System; using System.Collections.Generic; using System.Configuration; using System.Linq; using System.Net; using System.Text; namespace NitinJS { publi...
2,725,434
In his book programming in scala (Chapter 5 Section 5.9 Pg 93) Odersky mentioned this expression "`bills !*&^%~ code!`" In the footnote on same page: "By now you should be able to figure out that given this code,the Scala compiler would invoke `(bills.!*&^%~(code)).!()."` That's a bit to cryptic for me, could som...
2010/04/27
[ "https://Stackoverflow.com/questions/2725434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/241590/" ]
What Odersky means to say is that it would be possible to have valid code looking like that. For instance, the code below: ``` class BadCode(whose: String, source: String) { def ! = println(whose+", what the hell do you mean by '"+source+"'???") } class Programmer(who: String) { def !*&^%~(source: String) = new B...
I'm not sure if the book provides method signatures but I assume it's just a comment on Scala's syntactic sugar so it assumes if you type: ``` bill add monkey ``` where there is an object bill which has a method add which takes a parameter then it automatically interprets it as: ``` bill.add(monkey) ``` Being a l...
48,377,300
So I'm building a website with Drupal as its backend and an Angular frontend. I'm creating all kinds of content-types in Drupal and then I'm exposing those the content through a JSON view (or in other words a RESTful API). However, Drupal also still exposes an HTML view for all content. I wish to disable that, because ...
2018/01/22
[ "https://Stackoverflow.com/questions/48377300", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1498652/" ]
If you got conda environment also. Just use bellow command . ``` pip install --user awscli --upgrade ``` This works for me .
For anyone attempting to install AWS CLI on Mac AND running Python 3.6, use pip3.6 instead of pip in your command-line. Example: ``` $ python --version Python 3.6.4 $ sudo pip3.6 install --upgrade awscli ... You are using pip version 9.0.1, however version 18.1 is available. You should consider upgrading via the 'pip...
616,524
Recently I just built my own computer. However the temperature of my processor becomes very high and my CPU fan is not able to cool it off when I run multiple programs. MY CPU temperature can go as high as 85 degrees celsius and it is definitely not good. My CPU fan speed can go as high as 2419rpm only at 100%. I beli...
2013/07/07
[ "https://superuser.com/questions/616524", "https://superuser.com", "https://superuser.com/users/236274/" ]
I don't use that board but the logic is that, you need to extract the compressed image (.xz) by ``` unxz image_file.img.xz ``` The image file should contain all you need (Linux File system, Kernel, ....) Then locate your SD card by `fdisk -l`. If you are using micro-sd adapter, then it could be linked as `/dev/mmcb...
Use `xz` to extract the .img file, then use `dd` to write it directly to the card.
383,367
Final goal ========== * Create a copy of all files one external hard drive to another external hard drive, both formatted as HFS+. * Preserve the *folder* creation date. * Preserve finder colour label. * During the copy I want to see some kind of progress indicator. Using `cp` ---------- If I copy using ``` cp -a ...
2020/03/01
[ "https://apple.stackexchange.com/questions/383367", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/24324/" ]
Just after I posted this question I found a solution. I noticed that the `rsync: get_xattr_names` errors all had one thing in common: the files that raised the error where always `._` files. I read that `._` files are [used to store information that would go into a HFS+ extended attribute](https://apple.stackexchang...
In your answer, you write, "I read that .\_ files are used to store information that would go into a HFS+ extended attribute. As I'm copying between HFS+ drives I figured I don't need these files." I would not make this assumption without further testing. **It is not necessary that the resource fork information captur...
43,269,816
The js script below correctly disables the remaining two checkboxes when I select the large checkbox and re-enables when unchecked. However, with this logic, I'd need to code for each specific case. Instead of manually labeling each checked box with specific id's and coding disabling logic for each case, is there a wa...
2017/04/07
[ "https://Stackoverflow.com/questions/43269816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2134003/" ]
You can disable all the checkboxes inside the div `sizes` except the current one as below: **HTML:** ``` <div class="checkbox" id="sizes"> <label><input id="a" type="checkbox" name="large" value="1">Large</label> <label><input id="b" type="checkbox" name="medium"value="1">Medium</label> <label><input id="c" typ...
I think this can be useful ```js $(document).ready(function(){ $('.checkbox input[type=checkbox]').change(function(){ $('input[id=a]').attr('disabled',true); $('input[id=b]').attr('disabled',true); $('input[id=c]').attr('disabled',true); if($(this).is(':checked')){ ...
59,414,367
Currently, you can set rules that will work once the user changes the value of the input. For example: Template part ``` <v-text-field v-model="title" label="Title" ></v-text-field> ``` Logic ``` export default { data () { return { title: '', email: '', rules: { r...
2019/12/19
[ "https://Stackoverflow.com/questions/59414367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5526445/" ]
You could do the following: Create a [v-form](https://vuetifyjs.com/en/components/forms) and place your `textfields` inside the form. Don't forget to give your v-form a v-model and a ref too. On mounted you can access the v-form via this.$refs and call .validate() just as Jesper described in his answer. In the `cod...
You should change your validation a little bit to achieve this. ``` <ValidationProvider rules="required" v-slot="{ errors }" ref="title"> <v-text-field v-model="title" label="Title" ></v-text-field> </ValidationProvider> ``` And then you should call `this.$refs.title.validate()` If you trigger t...
1,824,506
Let $A$ be an $m \times n$ real matrix and $b \in \mathbb{R^m}.$ Suppose $Ax$ and $Ay$ both minimize distance to $b,$ i.e. $||Ax-b|| = ||Ay-b||.$ Prove that $x-y \in \ker(A).$ Seems like there should be a straightforward proof, but I have not been able to provide one. Any suggestions would be appreciated, thanks in ad...
2016/06/13
[ "https://math.stackexchange.com/questions/1824506", "https://math.stackexchange.com", "https://math.stackexchange.com/users/141708/" ]
This is a classic Basic Exam question, and one common approach is to use the parallelogram identity. Fix $b \in \mathbb{R}^{m}$, and let $u, v \in \mathbb{R}^{m}$ simultaneously minimize $D(x) = ||A(x)-b||$. Put $\alpha = A(u)-b, \beta = A(v)-b$, and let $k = ||\alpha|| = ||\beta||$. Then by the parallelogram identity,...
First of all, I think your "i.e." should be followed by "$= \min\_{z \in \mathbb R^n} \|Az -b\|$". That is, you should use the fact that $x$ and $y$ minimize the distance from $\operatorname{ran} A$ to $b$. Then a hint: observe that $\|Ax - Ay\| \leq \|Ax - \lambda b\| + \|Ay - \lambda b\|$ for any $\lambda$.
6,831,572
I have a listBox whose items are to be shown in a textbox format, like so:- ``` <ListBox ItemsSource="{Binding movieList}" Name="innerList"> <ListBox.ItemTemplate > <DataTemplate > <TextBox Text="-------" TextChanged="TextBox_TextChanged_1"/> </DataTemplate> </ListBox.Item...
2011/07/26
[ "https://Stackoverflow.com/questions/6831572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/807246/" ]
``` var $cBoxes = $('#1,#2,#3'); $cBoxes.change(function(){ // check if all are checked based on if the number of checkboxes total // is equal to the number of checkboxes checked if ($cBoxes.length == $cBoxes.filter(':checked').length){ $('#checked2').show(); $('#checked1').hide(); }else{ $('#check...
You cannot have ids starting or just the number. Try this ``` <input id="chk1" type="checkbox" /> <input id="chk2" type="checkbox" /> <input id="chk3" type="checkbox" /> var chkBoxes = $('#chk1,#chk2,#chk3'); chkBoxes .change(function(){ if (chkBoxes.filter(':checked').length == chkBoxes.length)...
9,685
I currently have a web driven application set that I would like to roll out on the Raspberry Pi for our production floor. I have a couple of questions regarding the Raspberry PI as a viable replacement for the desktops in our organization. 1. How is the Raspberry PI performance for [MVVM](http://en.wikipedia.org/wiki/...
2013/09/20
[ "https://raspberrypi.stackexchange.com/questions/9685", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/9622/" ]
1. Unless the app is written carefully it will probably be really slow (like 300MHz pentium slow) 2. Only to a degree. The user has physical access, so hard to stop a determined individual. Usually it's better to block it at the firewall. 3. Obviously an OS is more than a web browser. Technically you could run a web br...
I agree in general with gnibbler. It will work but it will very noticeably under-perform a desktop. For what it actually costs (< 10% of a cheap cheap box), it's great, but keep in mind it doesn't cost much. Vis, doing things with the OS (browser kiosk, etc), linux is extremely (and easily) malleable -- hence stuff l...
29,810,116
Not sure what I'm doing wrong here... On one page, I start a session close to the beginning of the start of the code, like this: ``` session_name('raprec'); session_start(); ``` And then I collect the session variables throughout the code by assigning session variables to the PHP variables I need to reuse, as follo...
2015/04/22
[ "https://Stackoverflow.com/questions/29810116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/585315/" ]
I've tested your code on my server and I had the exact same results as you, nothing... then, on the **`second page`**, I've changed: ``` session_start(); session_name('raprec'); ``` to ``` session_name('raprec'); session_start(); ``` The session `raprec` now works as intended. --- [NOTE:](http://php.net/manual...
per this documentation, <http://php.net/manual/en/function.session-name.php> you need to call session\_start after you call session\_name. edit @maztch sorry, i updated. thanks for pointing that out. i had it backwards, but thats what i meant, i was trying to point out that the doc has a specific order... thanks. and ...
54,408,510
I try to hand over a pointer to a function: This is the pointer that I want to hand over: ``` content_t *encc = malloc(sizeof(*encc)); ``` The pointer is type of this struct ``` typedef struct _content { int length; char **lines; } content_t; ``` This is where I hand the pointer over to the funct...
2019/01/28
[ "https://Stackoverflow.com/questions/54408510", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10971140/" ]
`encc` is already of type `content_t *`. By adding `&` it gives you an expression of type `content_t **`, which doesn't match what the function expects. The address-of operator is not needed here, so remove it. ``` write_content("enc-file.txt", encc); ```
change ``` write_content("enc-file.txt", &encc); ``` to ``` write_content("enc-file.txt", encc); ```
13,921,676
i am trying to write a very simple function in haskell to change a value in a list depending on an input as follows ``` update_game :: [Int] -> Int -> Int -> [Int] update_game (x:xs) row take_amnt | row == 1 = x - take_amnt:xs | row == 2 = x : head(xs) - take_amnt : tail(xs) ...
2012/12/17
[ "https://Stackoverflow.com/questions/13921676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1911079/" ]
`getPathInfo()` according to the doc: > > Returns any extra path information associated with the URL the client > sent when it made this request. The extra path information follows the > servlet path but precedes the query string and will start with a "/" > character. > > > so in your example it will return `/...
The path info in Spring MVC may imply for the info sent via a URL. In a Spring MVC Controller you can easily set a request mapping which include a variable value place holder which is bound to an argument with `@PathVariable` annotation in the method signature - related to the request mapping. For eaxmple: ``` @Req...
150,917
If $a$, $b$, $c$ and $d$ are the four sides of a quadrilateral, the problem is to show that $ab^2(b-c)+bc^2(c-d)+cd^2(d-a)+da^2(a-b)\ge 0$. I've verified it to be true for quite a large number of values, but can't seem to come up with a proof for it. Does anyone have any ideas, perhaps some inequality results that can ...
2013/12/05
[ "https://mathoverflow.net/questions/150917", "https://mathoverflow.net", "https://mathoverflow.net/users/23202/" ]
Assuming the contrary, we get that the minimal value of $$ f(a,b,c,d)=ab^2(b−c)+bc^2(c−d)+cd^2(d−a)+da^2(a−b) $$ on the set $$ M=\{(a,b,c,d)\colon a,b,c,d\geq 0, a+b+c+d\leq 1, a+b+c\geq d,\dots\} $$ is negative. By the homogeneity, this value is achieved on $a+b+c+d=1$. Later we will check that $f$ is nonnegative ...
Let $T$ be the function in question: $$ T(a,b,c,d) = a b^2(b-c) + b c^2 (c-d) + c d^2 (d-a) + d a^2 (a - b). $$ We wish to show $T(a,b,c,d)\ge 0$ if $a,b,c,d$ are the sides of a quadrilateral. (Presumably, $a$ is the side opposite $c$ and $b$ is opposite $d$, but it actually doesn't matter to the proof.) **Terminology...
6,421,127
Say I have a table or 2 that contains data that will never or rarely change, is there any point of trying to cache those data? Or will the EF context cache that data for me when I load them the first time? I was thinking of loading all the data from those tables and use a static list or something to keep that data in m...
2011/06/21
[ "https://Stackoverflow.com/questions/6421127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/327622/" ]
The EF context will cache "per instance". That is, each instance of the `DbContext` keeps it's own independent cache of objects. You can store the resulting list of objects in a static list and query it all you like without returning to the database. To be safe, make sure you abandon the `DbContext` *after* you execute...
you'll have to roll your own for any ef4 linq queries, as they are always resolved to sql, and thus will always hit the db. a simple cache for your couple tables probably wouldn't be hard to write. if you're going to be querying by id though, you can use the [`ObjectContext.GetObjectByKey` method](http://msdn.microso...
650,843
I'm trying to fix the check button lights on the side of a IDX V-mount battery. The LED lights won't light when the button is pressed. I stumbled upon a white "H2" component that I measured as open circuit and it was supposed to be closed. I can't ID the component. Please help. [![enter image description here](https:...
2023/01/20
[ "https://electronics.stackexchange.com/questions/650843", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/331008/" ]
I think it's a fuse (one-time type) as available from Littelfuse and others. However H is the code usually used for a 1A fuse and 2 is perhaps associated with 2A so it's hard to be sure what to replace it with. Also, there's a decent chance something else is fried in order to take out the fuse. If you don't get a bet...
Looking at the component color and silkscreen text "FR1", it seems like a resettable fuse. I doesn't blow up mostly. When a current higher than trip current, it turns into high-resistance state, that is non-conducting mode. If the high current was caused by one-time event, e.g. wrong wiring during experiment, it will ...
2,844,837
it gives me this error: ``` Exception in thread Thread-163: Traceback (most recent call last): File "C:\Python26\lib\threading.py", line 532, in __bootstrap_inner self.run() File "C:\Python26\lib\threading.py", line 736, in run self.function(*self.args, **self.kwargs) File "C:\Users\Public\SoundLog\Code\...
2010/05/16
[ "https://Stackoverflow.com/questions/2844837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/187730/" ]
The normal advice, as per the other answers, would be to avoid using `iteritems` (use `items` instead). That of course is **not** an option in your case, since the `iteritems` call is being done on your behalf deep in the bowels of a system call. Therefore, what I would suggest, assuming `Auxiliar.DataCollection.getIn...
Sounds like your are adding or removing something from the dictionary you are trying to iterate over. This is not allowed in most languages.
21,024,664
I have url: /profile/profileBase/index where "profile" is module, "profileBase" is controller and "index" is action. I want to url manager would accept route like: /profile/read/index where "read" could be alias of controller. Is there any way to do this using url manager rules? Thanks
2014/01/09
[ "https://Stackoverflow.com/questions/21024664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1495724/" ]
``` 'urlManager' => array( 'urlFormat' => 'path', 'showScriptName' => false, 'rules' => array( 'profile/read/index '=>'profile/profileBase/index' ), ), ```
You should simply add the following rule in `urlManager` config : ``` 'profile/read/index'=>'profile/profileBase/index', ```
36,334,376
I'm trying to do something similar to what is done [here](https://docs.angularjs.org/api/ng/filter/orderBy), i.e. ordering an array of objects in the view by using the filter `orderBy` (you can find the plunker [here](http://plnkr.co/edit/ExSjseOhSKFCiXNz5x8V?p=preview)). My code is working well but when I add the `ord...
2016/03/31
[ "https://Stackoverflow.com/questions/36334376", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6014171/" ]
line 6 in your script replace : ``` var myArray = [], myObject = {}; ``` by : ``` var myArray = [], myObject = []; ```
The answer of Patrick Ferreira is totally right, just for the explanation if somebody wonders.. The [orderBy](https://docs.angularjs.org/api/ng/filter/orderBy) filter of AngularJS just orders arrays: > > Orders a specified *array* by the *expression* predicate > > > and array-like values: > > Array-like values...
49,411
This is a follow up to the "[Create a 3 inch measurement](https://puzzling.stackexchange.com/questions/49253)" puzzle, which got a lot of innovative solutions. Using the standard 8.5 x 11 inch paper, can you create a 1 inch measurement only by folding? Again no marking allowed. No ruler either. One more thing. **I re...
2017/02/23
[ "https://puzzling.stackexchange.com/questions/49411", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/34419/" ]
A solution in 4 folds: > > 1. Fold one corner down to the opposite side. We now have a triangle that is 8.5" by 8.5", and a flap below it that is 2.5" by 8". > > 2. Fold the flap up, and call this Flap A. Now unfold the paper and turn it upside down. > > 3-4. Repeat the same steps to get a Flap B. > > N...
A solution in 3 folds: > > 1. Fold diagonally to get triangle of side length 8.5, leaving 2.5 inches on the 11 inch side uncovered > > 2. Fold the 2.5 inch flap up, leaving 6 inches on the 11 inch side uncovered > > 3. Create a fold at the 6 inch mark on the 11 inch side using the covered part > > > Un...
20,443,391
I have to deal with a lot of files with a well defined syntax and semantic, for example: * the first line it's an header with special info * the other lines are containing a key value at the start of the line that are telling you how to parse and deal with the content of that line * if there is a comment it starts wit...
2013/12/07
[ "https://Stackoverflow.com/questions/20443391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2485710/" ]
Okay, a starting point for a Spirit grammar ``` _Name = "newmtl" >> lexeme [ +graph ]; _Ns = "Ns" >> double_; _Ka = "Ka" >> double_ >> double_ >> double_; _Kd = "Kd" >> double_ >> double_ >> double_; _Ks = "Ks" >> double_ >> double_ >> double_; _d = "d" >> double_; _il...
It's most likely possible, but not necessarily convenient. If you want to parse anything you want to use parser - whether you use existing one or write one yourself depends on what you are parsing. If there is no way to parse your format with any existing tool then just write your own parser. You can use lex/flex/flex...
1,073,851
If there is a point (a,b) on the hyperbola $x^2-y^2=4$ that is closest to the point (0,1), then what is this point? I prefer this problem to be solved with the knowledge of the the maximum and minimum using the derivatives and so on. I am a bit confused I said that I will take the square distance between the point $...
2014/12/18
[ "https://math.stackexchange.com/questions/1073851", "https://math.stackexchange.com", "https://math.stackexchange.com/users/145527/" ]
It's probably easier to take $x=\pm\sqrt{y^2+4}$, since this is true for all $y$, while looking at the question in terms of $x$ requires the condition that $|x|\geq 4$. Also, $x^2+(y-1)^2 = y^2+4 +(y-1)^2$ is much easier to minimize, and doesn't depend on the sign of $x$.
here is one way to compute the closes distance. let the foot of the perpendicular from $(0,1)$ to $x^2-y^2 = 4$ be $(a,b)$ the slope of the line is $b - 1 \over a$ and the slope of hyperbola is $a \over b,$ so $a, b$ satisfy:${(b-1) \over a}{ a \over b} = -1$ this gives $$a = 0, b = { 1 \over 2}.$$ $a = 0$ is not in th...
54,986,372
I am trying to use the LIKE operator along with wildcards to check for similar matches in 2 columns in each of the [Food] and [Drinks] table. The below is my solution, but it will not run. Code below: (I have left a gap in the middle for reading purposes). ``` " SELECT DISTINCT r.restname" + " FROM restaurants r"...
2019/03/04
[ "https://Stackoverflow.com/questions/54986372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10966913/" ]
Add your words to ' ? ' and check. ``` SELECT DISTINCT r.restname FROM restaurants r JOIN food f ON f.restid = r.restid JOIN drinks d ON d.restid = r.restid WHERE (f.foodcategory LIKE CONCAT('%', ?, '%')" OR f.foodname LIKE CONCAT('%', ?, '%')) AND (d.drinkname LIKE CONCAT('%', ?, '%') O...
You should be using `exists` instead -- as I suggested in an earlier question. But your problem is the lack of parentheses: ``` WHERE (f.foodcategory LIKE CONCAT('%', ?, '%')" OR f.foodname LIKE CONCAT('%', ?, '%') ) AND (d.drinkname LIKE CONCAT('%', ?, '%') OR d.drinkvariety LIKE CONCAT('%'...
27,922,408
i am making an app where i need 3d joystick image so that user can swipe on it and image will bend in swipped direction. For swipe down or for swipe up events what css or animation effect i should give to make image moving downside or upside ?? I don't know the best way to do it. I am trying this code :- ``` <div s...
2015/01/13
[ "https://Stackoverflow.com/questions/27922408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2300237/" ]
I would suggest you to use CSS `transform` and `perspective` to do this. In the example below, I've demonstrated this using buttons for swipeLeft, swipeRight, swipeUp and swipeDown events. ```js $(".tilt").click(function() { $('#joystick').removeAttr('class'); $('#joystick').addClass($(this).attr('id')); }); `...
Something like this? (although this is a very crude design, and not fully implemented) ```js $('#left').click(function(){ $('.stick').removeClass("right").toggleClass("left"); }); $('#right').click(function(){ $('.stick').removeClass("left").toggleClass("right"); }); ``` ```css .wrapper{ width:300px; h...
28,458,814
This is my .htaccess file, everything works so far but I can't manage to remove .php extension from files, every code that I tried from other answers just threw 500 or 404 error. Please advise where and what to add. Structure of the folders is localhost/myfolder/somefile.php Just to be clear - localhost/myfolder/ is a...
2015/02/11
[ "https://Stackoverflow.com/questions/28458814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4103960/" ]
This snippet will allow you to rewrite to remove `php` extensions: ``` RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L] ``` If you want your URL to have a trailing `/`, you can use this snippet: ``` RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+)/$ ...
Removing extension, say; php or html in browser will let browser find it a little bit more effort to find the source file. if you need it so, this follows may help you: UPDATED: **PHP:** ``` RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)/$ /$1.php ``` ...
47,315,287
I'm trying to filter an azure search edm.collection to return results if any of multiple strings are in the collection. I can only get it working when querying for one item, which isn't good enough for my use case. I can't find syntax for querying multiple parameters. ``` filter += "FirmTypes / any (x: x eq 'Big 4')";...
2017/11/15
[ "https://Stackoverflow.com/questions/47315287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6130346/" ]
The best way to filter over multiple values is to use the new `search.in` function: ``` FirmTypes/any(x: search.in(x, 'Big 4|Industry', '|')) ``` For large numbers of values, `search.in` is significantly faster than using a combination of `or` and `eq`, and it can handle a much larger number of values without hittin...
Got it as soon as I posted. If anybody else has same issue ``` "FirmTypes / any (x: x eq 'Big 4') or FirmTypes / any (x: x eq 'Industry')" ```
46,671,916
I have additional settings that I need to pass to Karate when running via Maven that will be available in karate-config.js. Currently I can pass in a string using the karate.env property - is it necessary to encode my parameters as a JSON object and pass them in via this one property or can I do something like: ``` mv...
2017/10/10
[ "https://Stackoverflow.com/questions/46671916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2452580/" ]
Yes ! Refer to the [documentation](https://github.com/intuit/karate#the-karate-object) for `karate.properties['karate.clientid']`.
I've found a way, but I didn't use examples. What I've done: * In Gradle: ``` task api(type:Test) { systemProperty "karate.clientId", System.properties.getProperty("karate.clientId")... } ``` * In `karate-config.js` (in `var config`): ``` clientId: karate.properties['karate.clientId'] || 'xyz' ``` * In the com...
549,526
In a comment on the question [Is there any rule regarding when not to use the pattern "noun phrase + of + possessive pronoun"?](https://english.stackexchange.com/questions/549521), such as "a friend of his", John Lawler writes > > First rule is: Don't do it with *its.* > > > Using *its,* for example "I really lik...
2020/10/18
[ "https://english.stackexchange.com/questions/549526", "https://english.stackexchange.com", "https://english.stackexchange.com/users/18696/" ]
In [CGEL](https://rads.stackoverflow.com/amzn/click/com/0521431468)'s terminology, we are talking about the **oblique genitive** construction (pp. 468-469). According to CGEL, compared to the non-oblique genitive, 'the range of semantic relations between subordinate and matrix NPs [is] considerably narrower in the obli...
This pattern is a colloquial use of possessive pronouns, and typically refers to people in a non-specific sense. John Lawler has a good point here: *its* as a possessive pronoun in this pattern lacks specificity. The less specific the the possessive pronoun is, the less clear the sentence becomes, and the more meaning...
163,464
So, I was just trying to watch some video online in Chrome, and when I get to the page I'm told I "need to install Quicktime to play the video". This is odd because I clearly have Quicktime in my applications on my Mac. It seems to be a Chrome problem, but I've read I should go to chrome:plugins and make sure it's on t...
2014/12/25
[ "https://apple.stackexchange.com/questions/163464", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/106057/" ]
Since version 39 Chrome is now 64 bit only but there is only a 32 bit version of the QuickTime plug in. I do not think a workaround currently exists other than using another browser, Safari being your best bet for compatibility. Source - <https://discussions.apple.com/thread/6510828>
Chrome has disabled many plug-ins including QuickTime in its latest release. Actually, I believe this is due to the fact that Chrome 39+ is 64-bit and the QuickTime player plugin is 32-bit.
23,934,628
I have a table which has the following. ``` fieldmapid | fieldid ------------+--------- 2010 | 180 2012 | 90 2012 | 92 2020 | 90 2020 | 92 2020 | 95 20005 | 90 20005 | 92 ``` I want to write a query which first gets the f...
2014/05/29
[ "https://Stackoverflow.com/questions/23934628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3488109/" ]
Try this.May be it will help you. ``` select f.fieldmapid from Field f LEFT JOIN Field f1 on f1.fieldid=f.fieldid and (f1.fieldmapid=2012) group by f.fieldmapid having count(f.fieldmapid)=count(f1.fieldmapid); ``` Demo link : <http://sqlfiddle.com/#!2/b72e05/3>
This is an example of a "set-within-sets" subquery. You can solve it by doing: ``` select t.fieldmapids from table t left outer join (select fieldid from table t2 where fieldmapid = 2012 ) f2012 on f2012.fieldmapid = t.fieldmapid group by t.fieldmapids having count(*) = count(f2012.fieldmapi...
2,970,083
It's complicated to explain what the transformation I'm dealing with is but basically it is a transformation that takes a 3D model and maps it to the surface of one polygon on another model. The issue is that I'd prefer to not have to recompute the normal vectors of the post-transformation model at construction time (w...
2018/10/25
[ "https://math.stackexchange.com/questions/2970083", "https://math.stackexchange.com", "https://math.stackexchange.com/users/289789/" ]
Another way to look at OP's problem, is to consider it a transformation from one triangular prism to another, or between triangular prism coordinates $(u, v, w)$ and Cartesian coordinates $(x, y, z)$: ![two triangular prisms](https://www.nominal-animal.net/answers/prism-interpolation.svg) Each prism is defined by the b...
If you understood exactly what OP asked about -- in particular, noticed that $\Omega$ denotes a (nonlinear) transformation rather than a matrix --, skip this section. We have a vector $\vec{v} = \left [ \begin{matrix} x \\ y \\ z \end{matrix} \right ]$ in some odd coordinate system to transform to ordinary 3D coordina...
4,623,615
I would like to solve this problem just with an elementary geometric approach. I already solved with trigonometry, e.g. using the Bretschneider formula, finding that the angle $ x = 15° $. Any idea? I edited showing how I computed the $ x $ value using the Bretschneider formula for the area of the quadrilateral $ ABDE...
2023/01/22
[ "https://math.stackexchange.com/questions/4623615", "https://math.stackexchange.com", "https://math.stackexchange.com/users/967210/" ]
Hint: Draw a circle on diameter $AD$. Extend $AE$ to meet the circle at $H$. Connect $D$ to $H$; we have: $\overset{\frown} {DH}=60^o$ Draw diameter $HJ$ ($J$ is where diameter starting from $H$ and passing the center of circle $O$ meets the circle). Draw a perpendicular from $D$ on $HJ$ to meet the circle at $I$, we...
Here I report the original figure, to which I added the segments $DH$ bisecting the angle $\widehat{FDG}$ and $EK$ orthogonal to $AD$. [![enter image description here](https://i.stack.imgur.com/s97hL.png)](https://i.stack.imgur.com/s97hL.png) Let's define $$ d = AB, \qquad e = EF. $$ We have, by Pythagorean theorem,...
11,304,645
> > **Possible Duplicate:** > > [How to detect textbox change event from javascript](https://stackoverflow.com/questions/5786799/how-to-detect-textbox-change-event-from-javascript) > > > How I can detect inserted value to text field immediately after inserting? `change` event rises only after focus lost, `keyP...
2012/07/03
[ "https://Stackoverflow.com/questions/11304645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/921193/" ]
You can use the `oninput` event. It will trigger whenever an input is made in the field. For more information, I'll get a quote from this blog: <http://whattheheadsaid.com/2010/09/effectively-detecting-user-input-in-javascript> (written by [@AndyE](https://stackoverflow.com/users/94197/andy-e)) > > *Talking about on...
You mean this <http://jsfiddle.net/SP69J/10/> The function ``` $(document).ready(check); var previousvalue=""; function check(){ var val=$("#inputcontrol").val(); var interval; interval = window.clearInterval(interval); if(val!=previousvalue){ alert("value changed"); previousvalue=$("#inputcontro...