qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
49,316,374
I had this working without jquery, but the problem was that the tooltip was appearing on the whole div rather than just the PNG. The mouseover function worked well with jquery so I decided to switch to that, however I do not know how to trigger the CSS animation when the mouseover function runs. ```js $('#cookie')....
2018/03/16
[ "https://Stackoverflow.com/questions/49316374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9488393/" ]
When adding and removing class do not use the `.` before the classname...as it will add a class with the name `.class` instead of `class`. You can make your code a little bit cleaner and use ES6 variable declaration ( as a bonus :) ). If your html markup is like in your example ( tooltip exactly after the image ), you...
You don't need a `mouseover` event handler. Instead, you can handle the `opacity` toggle using pure CSS with a combination of [`:hover`](https://developer.mozilla.org/en-US/docs/Web/CSS/:hover) and [`+`](https://developer.mozilla.org/en-US/docs/Web/CSS/Adjacent_sibling_selectors) : ```css #cookie:hover+.cookieToolTip...
49,316,374
I had this working without jquery, but the problem was that the tooltip was appearing on the whole div rather than just the PNG. The mouseover function worked well with jquery so I decided to switch to that, however I do not know how to trigger the CSS animation when the mouseover function runs. ```js $('#cookie')....
2018/03/16
[ "https://Stackoverflow.com/questions/49316374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9488393/" ]
You can change the CSS - you may want to hide (display:none) instead of using visibility since moving the mouse to the edge of the screen will add scrollbars now ```js $('#cookie').mouseover(function() { $('#tooltip').css({"opacity":1, "visibility": "visible"}) }); $('#cookie').mouseout(function() { $('#toolti...
when you add a class you don't need the dot before the class name because it's a declaration, not a selector ``` Wrong: $('#cookie').addClass('.cookieToolTipHovered'); Correct: $('#cookie').addClass('cookieToolTipHovered'); ``` Then, you need to remove the class when you're out, if you don't the class will keep app...
49,316,374
I had this working without jquery, but the problem was that the tooltip was appearing on the whole div rather than just the PNG. The mouseover function worked well with jquery so I decided to switch to that, however I do not know how to trigger the CSS animation when the mouseover function runs. ```js $('#cookie')....
2018/03/16
[ "https://Stackoverflow.com/questions/49316374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9488393/" ]
You can change the CSS - you may want to hide (display:none) instead of using visibility since moving the mouse to the edge of the screen will add scrollbars now ```js $('#cookie').mouseover(function() { $('#tooltip').css({"opacity":1, "visibility": "visible"}) }); $('#cookie').mouseout(function() { $('#toolti...
You don't need a `mouseover` event handler. Instead, you can handle the `opacity` toggle using pure CSS with a combination of [`:hover`](https://developer.mozilla.org/en-US/docs/Web/CSS/:hover) and [`+`](https://developer.mozilla.org/en-US/docs/Web/CSS/Adjacent_sibling_selectors) : ```css #cookie:hover+.cookieToolTip...
38,842,853
For example, I have the following Java code: ``` public class Main { public static void main(String[] args) { System.out.println(maker(Employee::new)); } private static Employee maker(Supplier<Employee> fx) { return fx.get(); } } class Employee { @Override public String toString() { return "A...
2016/08/09
[ "https://Stackoverflow.com/questions/38842853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6670353/" ]
Supplier is a function taking no arguments and returning some type: you can represent that with [std::function](http://en.cppreference.com/w/cpp/utility/functional/function): ``` #include <iostream> #include <functional> #include <memory> // the class Employee with a "print" operator class Employee { friend std:...
You can use C++ template class to achieve the goal: ``` template<typename TR> class Supplier { private: TR (*calcFuncPtr)(); public: Supplier(TR(*F)()) { calcFuncPtr = F; } TR get() const { return calcFuncPtr(); } }; ``` Usage sample: ``` #include <string> #include <ios...
15,410,849
I am trying to get 100 newest photos, like ``` client.tag_recent_media("cat", count: 100) ``` but it always return around 40 photos (sometimes 36, sometimes 38 and sometimes 40). I am working with [this gem](https://github.com/Instagram/instagram-ruby-gem). Is there any wat to fetch 100 photos or 40 is the limit? ...
2013/03/14
[ "https://Stackoverflow.com/questions/15410849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/984621/" ]
This will do the job: ``` def search_method result = [] next_id=nil while result.length < 100 data = client.tag_recent_media("cat", max_id: next_id) if a.length == 0 next_id = data.pagination.next_max_id result.concat(data) end end ```
You should try something like this ``` client.tag_recent_media(1907035, {count: 60}) ``` Unfortunately I think 60 is the maximum amount of photos.
23,023,677
After creating a PDF from HTML, I need to add a Footer to each page. The Footer is going to be a single-row, three-column table, with the left cell being an external reference ID, the center being a "Page X of Y", and the right being a date stamp. I have no experience with iTextSharp, but after reading various posts I ...
2014/04/11
[ "https://Stackoverflow.com/questions/23023677", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3200810/" ]
Try this, its working for me: ``` FooterTable.WriteSelectedRows(0, -1, document.LeftMargin, FooterTable.TotalHeight, cb); ``` Check this post [Header, footer and large tables with iTextSharp](https://stackoverflow.com/questions/9864525/header-footer-and-large-tables-with-itextsharp)
You wrote: ``` FooterTable.WriteSelectedRows(0, 0, document.LeftMargin, document.RightMargin, cb); ``` However, the method is: ``` FooterTable.WriteSelectedRows(rowStart, rowEnd, x, y, cb); ``` Which means that you're asking to write a selection of rows starting with row 0 and ending with row 0, or: you're asking...
39,734,440
I am looking at using SecurionPay to take payments online. However I am finding problems with quite a simple task setting the amount and currency. It seems to keep defaulting. I am trying to implement the system via JavaScript on and ASP.NET project. <https://securionpay.com/docs/checkout#custom-integration> On the ...
2016/09/27
[ "https://Stackoverflow.com/questions/39734440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5830746/" ]
Signed CheckoutRequest can be created in two ways: 1. Use dedicated SDK. In your case it would be <https://github.com/securionpay/securionpay-net>. You should look for SecurionPayGateway.SignCheckoutRequest method. 2. <https://securionpay.com/docs/checkout-request-generator>
I found out that it is the checkoutRequest was my issue: Basically adjust this string to set a charge and currency. **checkout-request-generator** <https://securionpay.com/docs/checkout-request-generator>
38,694,540
I have created a graph in python but I now need to take a section of the graph and expand this by using a small range of the original data, but I don't know how to find the row number of the results that form the range or how I can create a graph using just these results form the file. This is the code I have for the g...
2016/08/01
[ "https://Stackoverflow.com/questions/38694540", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6648633/" ]
If you're comparing two dates/values, I would recommend using a [bar chart](https://www.zingchart.com/docs/chart-types/bar-charts/). (If you're comparing values over months or years, I would suggest using a [line](https://www.zingchart.com/docs/chart-types/line-charts/) or [area](https://www.zingchart.com/docs/chart-ty...
A simple bar chart with data labels to indicate the respective values would be helpful to show users there is a very small change in value. See the code snippet below. I modified one of the basic Highcharts demos for a bar chart with your example values. I hope this is helpful for you! ```js $(function () { $('...
409,120
I am learning statistics and come across this calculation for Maximum-Likelihood estimator for the Binomial distribution. I don't understand the step from second to third row where they took the derivative, ![calculation](https://i.stack.imgur.com/KF9Cd.png) my attempt gave me only $\log \left(π\right)$ as result. ...
2013/06/02
[ "https://math.stackexchange.com/questions/409120", "https://math.stackexchange.com", "https://math.stackexchange.com/users/32885/" ]
Note that in this case, $\pi$ is the variable, not $x$
The derivative was done with respect to $\pi$ (a wrong choice of the parameter, indeed, as $\pi$ is a *standard constant*--a well known real number). Write $p$ instead of $\pi$ and differentiate with respect to $p$ to get the result.
7,564,664
I'm writing an application for Android which let users browse a list of files and download them. For every download, I created a thread and I download the file with an HttpURLConnection instance (by reading from the connection in a while loop). This method works fine with one active download. But when user starts more...
2011/09/27
[ "https://Stackoverflow.com/questions/7564664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/80845/" ]
Alas, i don't know of a way to throttle certain connections. However, a practical approach would be to implement a queue of downloads to control the number of simultaneous downloads. In your case, you would probably want to only let 1 thing download at a time. This can be implemented a few different ways. Here's a way...
You might want to check out the `DownloadManager` class in the android SDK.. Its only available above or equal api level 2.3 though. <http://developer.android.com/reference/android/app/DownloadManager.html> Some tutorials you might want to see.. <http://jaxenter.com/downloading-files-in-android.1-35572.html> <http...
259,546
I will be telling my employers that I am moving which could complicate life for them but it is a great step for me; a leap in fact. I am searching for a word that will help me deliver some news that is good for me but bad, or not so good, for the party receiving the news.
2015/07/14
[ "https://english.stackexchange.com/questions/259546", "https://english.stackexchange.com", "https://english.stackexchange.com/users/129224/" ]
Bittersweet? > > both pleasant and painful or regretful > > > <http://dictionary.reference.com/browse/bittersweet> E.g. a bittersweet goodbye
Tell them that you are pursuing a once in a lifetime opportunity; that you cannot afford to pass this up. You may feel sorry for the effects onto others of taking advantage of a good-for-you situation, but it has to be done.
259,546
I will be telling my employers that I am moving which could complicate life for them but it is a great step for me; a leap in fact. I am searching for a word that will help me deliver some news that is good for me but bad, or not so good, for the party receiving the news.
2015/07/14
[ "https://english.stackexchange.com/questions/259546", "https://english.stackexchange.com", "https://english.stackexchange.com/users/129224/" ]
Bittersweet? > > both pleasant and painful or regretful > > > <http://dictionary.reference.com/browse/bittersweet> E.g. a bittersweet goodbye
If they were wonderful employers who treated you really well, be polite and professional. Say something like "I am truly sorry; it was a pleasure to work for you, but I cannot pass up this opportunity." They'll be happy for the kind words, but probably place some importance on your happiness, and will understand. If t...
52,083,460
I am a newbie in python and I am working on a function that I expect to pass a string like `abcd` and it outputs something like `A-Bb-Ccc-Dddd`. I have created the following. ` ``` def mumbler(s): chars = list(s) mumbled = [] result = [] for char in chars: caps = char.upper() num = ...
2018/08/29
[ "https://Stackoverflow.com/questions/52083460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8274613/" ]
You can do it in a much simpler way using list comprehension and `enumerate` ``` >>> s = 'abcd' >>> '-'.join([c.upper() + c.lower()*i for i,c in enumerate(s)]) 'A-Bb-Ccc-Dddd' ```
Go for a simple *1-liner* - `next()` on `count` for maintaining the times to repeat and `title()` for title-casing: ``` from itertools import count s = 'Abcda' i = count(1) print('-'.join([(x * next(i)).title() for x in s])) # A-Bb-Ccc-Dddd-Aaaaa ```
52,083,460
I am a newbie in python and I am working on a function that I expect to pass a string like `abcd` and it outputs something like `A-Bb-Ccc-Dddd`. I have created the following. ` ``` def mumbler(s): chars = list(s) mumbled = [] result = [] for char in chars: caps = char.upper() num = ...
2018/08/29
[ "https://Stackoverflow.com/questions/52083460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8274613/" ]
You can do it in a much simpler way using list comprehension and `enumerate` ``` >>> s = 'abcd' >>> '-'.join([c.upper() + c.lower()*i for i,c in enumerate(s)]) 'A-Bb-Ccc-Dddd' ```
If you want to make your own code work, you'll just need to convert the `result` list to string outside your second for-loop: ``` def mumbler(s): chars = list(s) mumbled = [] result = [] for char in chars: caps = char.upper() num = chars.index(char) low = char.lower() mu...
8,753,182
I am trying to insert js files programmatically, using jquery and something like this: ``` var script = document.createElement( 'script' ); script.type = 'text/javascript'; script.src = 'http://someurl/test.js'; $('body').append(script); ``` It works fine, if test.js contains an `alert` or some simple code it works ...
2012/01/06
[ "https://Stackoverflow.com/questions/8753182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1042784/" ]
use `innerHTML` instead of using `document,write`. and use following code to register script, ``` (function() { var jq = document.createElement('script'); jq.type = 'text/javascript'; jq.async = true; jq.src = 'http://someurl/test.js'; var s = document.body.getElementsByTagName('script')[0]; s...
Document.write is ONLY for synchronous tasks when the html is loaded (for the very first time), never for asynchronous tasks like the one you are trying to do.
8,753,182
I am trying to insert js files programmatically, using jquery and something like this: ``` var script = document.createElement( 'script' ); script.type = 'text/javascript'; script.src = 'http://someurl/test.js'; $('body').append(script); ``` It works fine, if test.js contains an `alert` or some simple code it works ...
2012/01/06
[ "https://Stackoverflow.com/questions/8753182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1042784/" ]
Document.write is ONLY for synchronous tasks when the html is loaded (for the very first time), never for asynchronous tasks like the one you are trying to do.
There isn't anything wrong with your approach to inserting JavaScript. `document.write` just sucks a little bit. It is only for synchronous tasks, so putting a `document.write` in a separate script file is asking for trouble. People do it anyway. The solution I've seen most often for this is to override `document.write...
8,753,182
I am trying to insert js files programmatically, using jquery and something like this: ``` var script = document.createElement( 'script' ); script.type = 'text/javascript'; script.src = 'http://someurl/test.js'; $('body').append(script); ``` It works fine, if test.js contains an `alert` or some simple code it works ...
2012/01/06
[ "https://Stackoverflow.com/questions/8753182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1042784/" ]
use `innerHTML` instead of using `document,write`. and use following code to register script, ``` (function() { var jq = document.createElement('script'); jq.type = 'text/javascript'; jq.async = true; jq.src = 'http://someurl/test.js'; var s = document.body.getElementsByTagName('script')[0]; s...
There isn't anything wrong with your approach to inserting JavaScript. `document.write` just sucks a little bit. It is only for synchronous tasks, so putting a `document.write` in a separate script file is asking for trouble. People do it anyway. The solution I've seen most often for this is to override `document.write...
8,753,182
I am trying to insert js files programmatically, using jquery and something like this: ``` var script = document.createElement( 'script' ); script.type = 'text/javascript'; script.src = 'http://someurl/test.js'; $('body').append(script); ``` It works fine, if test.js contains an `alert` or some simple code it works ...
2012/01/06
[ "https://Stackoverflow.com/questions/8753182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1042784/" ]
use `innerHTML` instead of using `document,write`. and use following code to register script, ``` (function() { var jq = document.createElement('script'); jq.type = 'text/javascript'; jq.async = true; jq.src = 'http://someurl/test.js'; var s = document.body.getElementsByTagName('script')[0]; s...
What you want to do is dynamically insert a `<script>` DOM element into the HEAD element. I had this script sitting around. As an example, it's a race condition, but you get the idea. Call `load_js` with the URL. This is done for many modern APIs, and it's your best friend for cross-domain JavaScript. ``` <html> <...
8,753,182
I am trying to insert js files programmatically, using jquery and something like this: ``` var script = document.createElement( 'script' ); script.type = 'text/javascript'; script.src = 'http://someurl/test.js'; $('body').append(script); ``` It works fine, if test.js contains an `alert` or some simple code it works ...
2012/01/06
[ "https://Stackoverflow.com/questions/8753182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1042784/" ]
What you want to do is dynamically insert a `<script>` DOM element into the HEAD element. I had this script sitting around. As an example, it's a race condition, but you get the idea. Call `load_js` with the URL. This is done for many modern APIs, and it's your best friend for cross-domain JavaScript. ``` <html> <...
There isn't anything wrong with your approach to inserting JavaScript. `document.write` just sucks a little bit. It is only for synchronous tasks, so putting a `document.write` in a separate script file is asking for trouble. People do it anyway. The solution I've seen most often for this is to override `document.write...
405,189
My initial prompt is as follows: > > For $F\_{0}=1$, $F\_{1}=1$, and for $n\geq 1$, $F\_{n+1}=F\_{n}+F\_{n-1}$. > Prove for all $n\in \mathbb{N}$: > > > $$F\_{n-1}=\frac{1}{\sqrt{5}}\left(\left(\frac{1+\sqrt5}{2}\right)^n-\left(\frac{1-\sqrt5}{2}\right)^n\right)$$ > > > Which, to my understanding, is Binet's F...
2013/05/28
[ "https://math.stackexchange.com/questions/405189", "https://math.stackexchange.com", "https://math.stackexchange.com/users/74134/" ]
The problem that you’ve been given uses a less-standard indexing of the Fibonacci numbers. The usual definition has initial values $F\_0=0$ and $F\_1=1$; your $F\_n$ is the usual $F\_{n+1}$, and the usual $F\_n$ is your $F\_{n-1}$. Thus, where your link has $$\varphi^a=F(a)\varphi+F(a-1)\;,$$ you’ll need to write $$\va...
It's impossible to tell without reading your proof, but induction (as a principle) will work regardless of whether you consider $n$ or $n-1$. The only difference is the indexing of the base case, but with the shift $n \mapsto n-1$ you needn't worry about introducing a "gap" at all.
833,438
I am using ACL to set specific permissions in a directory: `setfacl -R -m u:wordpress:wrx /var/www/html/wp` As that user, I am able to create a subdirectory within the directory with `mkdir test`, but if I then want to change the ownership with `chown apache:apache test`, I get an `operation not permitted` error. Is...
2014/10/29
[ "https://superuser.com/questions/833438", "https://superuser.com", "https://superuser.com/users/194934/" ]
``` ssh user@host "ls --color=auto" ``` `ls` only outputs colors when it is writing to a terminal. When you specify a command for `ssh` to run on the remote host, ssh doesn't allocate a TTY (terminal interface) by default. So, when you run the above command, ssh doesn't allocate a terminal on the remote system, ls se...
I'd suggest to use `--color=always` in case of ls, to force color. And to have colors in other apps, thatt support coloring, but do not support for `--color=value`, you can also try to `ssh <host> -t "TERM=${TERM} <command>"`
39,130,681
``` class MainProgram { static NotifyIcon _notifyIcon; public static void Main() { _notifyIcon = new NotifyIcon(); _notifyIcon.Icon = new Icon("icon.ico"); _notifyIcon.Click += NotifyIconInteracted; _notifyIcon.Visible = true; while(true) { Threa...
2016/08/24
[ "https://Stackoverflow.com/questions/39130681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2872388/" ]
Why not use a timer instead of a while loop if you're only doing a periodic check? Using a timer will not lock up the program like a while() loop. ``` using System; using System.Timers; using System.Windows.Forms; namespace SONotify { class Program { private static System.Timers.Timer _timer; ...
That while(true) locks the main thread. Try to replace the while(true) block with ``` Application.Run(); ```
40,146,881
Using `bash` I'm trying to extract only the numbers before a string. For example: ``` 7prob542334 ``` Expected output : ``` 7 ``` But I run into an error when I have ``` 27prob542334 ``` Expected output : ``` 27 ``` instead I get `2` This the code I have so far : ``` max=$(ls -LR $ARCHIVE | grep ^prob ...
2016/10/20
[ "https://Stackoverflow.com/questions/40146881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6919830/" ]
In awk: ``` $ echo 127prob542334|awk 'sub(/[^0-9].*/,"") || 1' 127 ``` Bash: ``` $ i=127prob542334 $ echo ${i%%[^0-9]*} 127 ```
``` echo '27prob542334' |grep -Po '^\d+' ```
40,146,881
Using `bash` I'm trying to extract only the numbers before a string. For example: ``` 7prob542334 ``` Expected output : ``` 7 ``` But I run into an error when I have ``` 27prob542334 ``` Expected output : ``` 27 ``` instead I get `2` This the code I have so far : ``` max=$(ls -LR $ARCHIVE | grep ^prob ...
2016/10/20
[ "https://Stackoverflow.com/questions/40146881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6919830/" ]
``` echo 127prob542334 |grep -o '^[0-9]*' 127 echo 17prob542334 |grep -oP '^\d*' 17 ```
With `awk`, you can make use of the `printf` command which will only take the decimal part of the string given in argument: ``` echo "127prob542334" | awk '{printf "%d\n",$1}' ```
40,146,881
Using `bash` I'm trying to extract only the numbers before a string. For example: ``` 7prob542334 ``` Expected output : ``` 7 ``` But I run into an error when I have ``` 27prob542334 ``` Expected output : ``` 27 ``` instead I get `2` This the code I have so far : ``` max=$(ls -LR $ARCHIVE | grep ^prob ...
2016/10/20
[ "https://Stackoverflow.com/questions/40146881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6919830/" ]
Using `bash`'s own `regex` matching, with `([[:digit:]]+)(.*)` ``` $ string="7prob542334" $ [[ $string =~ ([[:digit:]]+)(.*) ]] && num=${BASH_REMATCH[1]} $ printf "%s\n" "$num" 7 $ string="27prob542334" $ [[ $string =~ ([[:digit:]]+)(.*) ]] && num=${BASH_REMATCH[1]} $ printf "%s\n" "$num" 27 ```
If Perl is an option: `echo 27prob542334 | perl -lne 'print $1 if /^(\d+)/'` outputs: `27`
40,146,881
Using `bash` I'm trying to extract only the numbers before a string. For example: ``` 7prob542334 ``` Expected output : ``` 7 ``` But I run into an error when I have ``` 27prob542334 ``` Expected output : ``` 27 ``` instead I get `2` This the code I have so far : ``` max=$(ls -LR $ARCHIVE | grep ^prob ...
2016/10/20
[ "https://Stackoverflow.com/questions/40146881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6919830/" ]
``` echo 127prob542334 | grep -o -E '[0-9]+' | head -1 | sed -e 's/^0\+//' ``` OR ``` echo 127prob542334 | grep -o '^[0-9]*' ```
``` echo '27prob542334' |grep -Po '^\d+' ```
40,146,881
Using `bash` I'm trying to extract only the numbers before a string. For example: ``` 7prob542334 ``` Expected output : ``` 7 ``` But I run into an error when I have ``` 27prob542334 ``` Expected output : ``` 27 ``` instead I get `2` This the code I have so far : ``` max=$(ls -LR $ARCHIVE | grep ^prob ...
2016/10/20
[ "https://Stackoverflow.com/questions/40146881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6919830/" ]
Using `bash`'s own `regex` matching, with `([[:digit:]]+)(.*)` ``` $ string="7prob542334" $ [[ $string =~ ([[:digit:]]+)(.*) ]] && num=${BASH_REMATCH[1]} $ printf "%s\n" "$num" 7 $ string="27prob542334" $ [[ $string =~ ([[:digit:]]+)(.*) ]] && num=${BASH_REMATCH[1]} $ printf "%s\n" "$num" 27 ```
With `awk`, you can make use of the `printf` command which will only take the decimal part of the string given in argument: ``` echo "127prob542334" | awk '{printf "%d\n",$1}' ```
40,146,881
Using `bash` I'm trying to extract only the numbers before a string. For example: ``` 7prob542334 ``` Expected output : ``` 7 ``` But I run into an error when I have ``` 27prob542334 ``` Expected output : ``` 27 ``` instead I get `2` This the code I have so far : ``` max=$(ls -LR $ARCHIVE | grep ^prob ...
2016/10/20
[ "https://Stackoverflow.com/questions/40146881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6919830/" ]
``` echo 127prob542334 |grep -o '^[0-9]*' 127 echo 17prob542334 |grep -oP '^\d*' 17 ```
``` echo '27prob542334' |grep -Po '^\d+' ```
40,146,881
Using `bash` I'm trying to extract only the numbers before a string. For example: ``` 7prob542334 ``` Expected output : ``` 7 ``` But I run into an error when I have ``` 27prob542334 ``` Expected output : ``` 27 ``` instead I get `2` This the code I have so far : ``` max=$(ls -LR $ARCHIVE | grep ^prob ...
2016/10/20
[ "https://Stackoverflow.com/questions/40146881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6919830/" ]
``` echo 127prob542334 | grep -o -E '[0-9]+' | head -1 | sed -e 's/^0\+//' ``` OR ``` echo 127prob542334 | grep -o '^[0-9]*' ```
With `awk`, you can make use of the `printf` command which will only take the decimal part of the string given in argument: ``` echo "127prob542334" | awk '{printf "%d\n",$1}' ```
40,146,881
Using `bash` I'm trying to extract only the numbers before a string. For example: ``` 7prob542334 ``` Expected output : ``` 7 ``` But I run into an error when I have ``` 27prob542334 ``` Expected output : ``` 27 ``` instead I get `2` This the code I have so far : ``` max=$(ls -LR $ARCHIVE | grep ^prob ...
2016/10/20
[ "https://Stackoverflow.com/questions/40146881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6919830/" ]
With `bash` parameter expansion: ``` ${var%%[[:alpha:]]*} ``` * We are greedily removing substring from right (`%%`), from end to the first alphabetic (`[[:alpha:]]*`) character (from left). **Example:** ``` $ var='7prob542334' $ echo "${var%%[[:alpha:]]*}" 7 $ var='27prob542334' $ echo "${var%%[[:alpha:]]*}" 2...
With `awk`, you can make use of the `printf` command which will only take the decimal part of the string given in argument: ``` echo "127prob542334" | awk '{printf "%d\n",$1}' ```
40,146,881
Using `bash` I'm trying to extract only the numbers before a string. For example: ``` 7prob542334 ``` Expected output : ``` 7 ``` But I run into an error when I have ``` 27prob542334 ``` Expected output : ``` 27 ``` instead I get `2` This the code I have so far : ``` max=$(ls -LR $ARCHIVE | grep ^prob ...
2016/10/20
[ "https://Stackoverflow.com/questions/40146881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6919830/" ]
With `awk`, you can make use of the `printf` command which will only take the decimal part of the string given in argument: ``` echo "127prob542334" | awk '{printf "%d\n",$1}' ```
``` echo '27prob542334' |grep -Po '^\d+' ```
40,146,881
Using `bash` I'm trying to extract only the numbers before a string. For example: ``` 7prob542334 ``` Expected output : ``` 7 ``` But I run into an error when I have ``` 27prob542334 ``` Expected output : ``` 27 ``` instead I get `2` This the code I have so far : ``` max=$(ls -LR $ARCHIVE | grep ^prob ...
2016/10/20
[ "https://Stackoverflow.com/questions/40146881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6919830/" ]
Using `bash`'s own `regex` matching, with `([[:digit:]]+)(.*)` ``` $ string="7prob542334" $ [[ $string =~ ([[:digit:]]+)(.*) ]] && num=${BASH_REMATCH[1]} $ printf "%s\n" "$num" 7 $ string="27prob542334" $ [[ $string =~ ([[:digit:]]+)(.*) ]] && num=${BASH_REMATCH[1]} $ printf "%s\n" "$num" 27 ```
In awk: ``` $ echo 127prob542334|awk 'sub(/[^0-9].*/,"") || 1' 127 ``` Bash: ``` $ i=127prob542334 $ echo ${i%%[^0-9]*} 127 ```
60,385,545
I have a database where I have MenuItem, Item, Item\_Details, and Item\_Category tables. I would like to get an Item which is most frequently used in Menu. ``` SELECT ItemName, Category, ItemPrice FROM restuarant.Menu_Item, restuarant.Item, restuarant.Item_Details, restuarant.Item_Type WHERE ItemI...
2020/02/24
[ "https://Stackoverflow.com/questions/60385545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11238626/" ]
Example 1: ``` select aic.County, count(*) from Address_Information_County aic group by aic.County having count(*) = (select top 1 count(*) from Address_Information_County group by County order by count(*) desc); ``` Example 2: ``` select aic.County, count(*) from Address_Information_County aic group by aic.County ...
You could use "Group By" aggregate function to achieve this. ``` SELECT ItemID, count(*) as cnt FROM restaurant r GROUP BY r.ItemID ORDER BY cnt desc LIMIT 1; ``` In case, there are multiple entries that have count same as MaxCount, the following query would work. ``` SELECT ItemID, count(*) as cnt FROM restaurant ...
60,385,545
I have a database where I have MenuItem, Item, Item\_Details, and Item\_Category tables. I would like to get an Item which is most frequently used in Menu. ``` SELECT ItemName, Category, ItemPrice FROM restuarant.Menu_Item, restuarant.Item, restuarant.Item_Details, restuarant.Item_Type WHERE ItemI...
2020/02/24
[ "https://Stackoverflow.com/questions/60385545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11238626/" ]
How about the following: ``` SELECT TOP (1) ItemId, COUNT(ItemId) AS MCOUNT FROM Menu_Item GROUP BY ItemId ORDER BY COUNT(ItemId) DESC ```
You could use "Group By" aggregate function to achieve this. ``` SELECT ItemID, count(*) as cnt FROM restaurant r GROUP BY r.ItemID ORDER BY cnt desc LIMIT 1; ``` In case, there are multiple entries that have count same as MaxCount, the following query would work. ``` SELECT ItemID, count(*) as cnt FROM restaurant ...
60,385,545
I have a database where I have MenuItem, Item, Item\_Details, and Item\_Category tables. I would like to get an Item which is most frequently used in Menu. ``` SELECT ItemName, Category, ItemPrice FROM restuarant.Menu_Item, restuarant.Item, restuarant.Item_Details, restuarant.Item_Type WHERE ItemI...
2020/02/24
[ "https://Stackoverflow.com/questions/60385545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11238626/" ]
How about the following: ``` SELECT TOP (1) ItemId, COUNT(ItemId) AS MCOUNT FROM Menu_Item GROUP BY ItemId ORDER BY COUNT(ItemId) DESC ```
Example 1: ``` select aic.County, count(*) from Address_Information_County aic group by aic.County having count(*) = (select top 1 count(*) from Address_Information_County group by County order by count(*) desc); ``` Example 2: ``` select aic.County, count(*) from Address_Information_County aic group by aic.County ...
308,197
I'm not sure about the proper subject verb agreement in the following sentences. A boy and a girl make/makes a couple. 5 and 5 make/makes 10. 75 and 25 make/makes a hundred. Can you help? ETA: I understand that compound subjects usually take plural verbs, unless they form a collective idea- in which case it takes ...
2016/02/18
[ "https://english.stackexchange.com/questions/308197", "https://english.stackexchange.com", "https://english.stackexchange.com/users/62315/" ]
I think the right answer would be the following. 1. `A boy and a girl make a couple`, because ***they*** make. 2. `5 and 5 makes 10`, because I understand you're trying to convey sum, and that would be *5 plus 5*, or ***it*** makes. 3. `75 and 25 makes 10`, because I understand you're trying to convey sum, and that wo...
Answers 1] A boy and a girl make a couple. 2] 5 and 5 make 10. 75 and 25 make a hundred. Reasons: 1] 1 boy + 1 girl= 2.( More than 1) 2] 5 + 5 = 10.( More than 1) 3] 75 + 25 = 100 ( More than 1). Hope you understand the logic.
398,070
I'm quite new to Linux so forgive my ignorance. I have a regular text file with plain text. I would like to know if it's possible to convert all the spaces within the file to periods/full stops. For example, "The rain is relentless" to "The.rain.is.relentless" The text file is quite large so it would be remiss of m...
2017/10/14
[ "https://unix.stackexchange.com/questions/398070", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/255587/" ]
Try this: ```sh sed -i 'y/ /./' file ``` With '-i' the file is overwritten with the new replacements. Without '-i' the file is not changed, the replacements are printed to the terminal.
Many tools can do that, e.g. `sed`: ``` sed 's/ /./g' file ``` or `tr`: ``` tr ' ' . <file ```
16,030
I'm working on my thesis and a part of it has to do with adaptive mesh refinement. As a computer science major, I'm not too familiar with this field. The best way I can put my knowledge of AMR is: I understand the purpose and programming part, but I don't understand what it is. Sorry, I'm having difficulty wording it c...
2014/10/30
[ "https://scicomp.stackexchange.com/questions/16030", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/5415/" ]
1. Every major class of discretization is "open-ended" in the sense that there are decisions with no obviously/provably correct answer in the general case, so some decisions are made based on how they perform for the target problem. Additionally, each major class has active research on new extensions. AMR has more choi...
Since you are a computer science major, let me posit the following analogy: "adaptive mesh refinement" is a set of techniques for solving partial differential equations in mathematics; this is in the same spirit as "image processing" is a set of techniques to transform and improve images. Both fields have many differen...
87,710
Suppose a business does the following: 1. claims one of their brands is an unregistered trademark 2. gives away 100,000 **free** T-Shirts to random entities using the brand mentioned in Step1 above 3. accepts a $1 **donation** from a random entity to thank the business for **free** T-Shirts that were received Does th...
2022/12/31
[ "https://law.stackexchange.com/questions/87710", "https://law.stackexchange.com", "https://law.stackexchange.com/users/44354/" ]
### There must be a use in commerce Assuming there are no other barriers to trademark protection, you are asking what amounts to a "use in commerce" that is sufficient to warrant trademark protection (I'm assuming in United States law). In the United States, the protection comes from the *Lanham Act*, and protection ...
**That can't be answered without tons of exclusions for real world senarios.** You haven't proven your image doesn't infringe on an existing trademark at that point. Maybe it does. Some images can't be trademarked. Maybe the court rules yours is one. **However, let's say your image would be able to be trademarked. T...
71,745,525
I have a default component *Collection* which uses a sub-component called *RenderCollectionPieces* to display UI elements. I can't figure out why I am able to see the data for `image.name` in the console but **not able to see the UI elements display**. Additional information: * There are no errors in the console * If...
2022/04/05
[ "https://Stackoverflow.com/questions/71745525", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2218297/" ]
@ContentChildren is only scoped to the components direct `<ng-content></ngcontent>` tag, and will not look up the layout tree to see if the specified content children also live in a parents `<ng-content></ng-content>` tag. Meaning, the @ContentChildren tag will only capture content children within its directly scoped ...
Are you looking something like [this](https://stackoverflow.com/a/71631374/10428247)? Find out the sample code [here](https://github.com/jitesh-geitpl/ng-code-samples). Clone it and run the `reusable-ng-content` project by using `ng serve --project=reusable-ng-content`. Hope it may helpful.
109,431
In *Donnie Brasco* (1997), Lefty says to Donnie: > > I'm always right. A wise guy's always right. **Even when he's wrong, > he's right**. > > > This line is strangely close to this [Scarface line](https://movies.stackexchange.com/questions/62081)
2020/06/04
[ "https://movies.stackexchange.com/questions/109431", "https://movies.stackexchange.com", "https://movies.stackexchange.com/users/81639/" ]
This type of phrase or line is a bastardization of the phrase of two rules of the king. The first rule is that the king is always right. The second rule is that if the king is wrong, follow rule number one. You do not argue with someone who could kill you. You just do what they say to do.
It just means "You don't argue with a wise guy". ------------------------------------------------ This is a pretty common expression, it merely states that whatever you might say there is no point in getting into a discussion about the subject. The "wise guy" either won't listen, will not entertain the idea that he's...
43,555,829
I've been trying for more than a week to communicate from raspberry pi (QT C++) to Arduino (Arduino IDE c++) through a serial port but i keep failing. I did some searching on google, read the example... and still i didn't succeeded. Ok so the basic thing is that i need to communicate continuously the serial port sent ...
2017/04/22
[ "https://Stackoverflow.com/questions/43555829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6721865/" ]
I would suggest you to read about how Qt event system works. All Qt IODevice derived classes work asynchronously. You need to use QApplication in order to host its object system. After that, you need to change your code so that it's not blocking io thread of QSerialPort. I usually use readyRead singal or I use waitFor...
The answer to your question is in the following code: ``` QByteArray ba("J"); serial.write(ba); serial.flush(); qDebug() << "data has been send" << endl; serial.close(); ``` After you make `serial.flush ()`, you immediately close the port. It is necessary to wait until the data is really sent. For example, using `bo...
39,420,682
I downloaded a web site template from this [link](http://www.free-css.com/free-css-templates/page202/boss). How can I change the icon's style in the navigation menu of the index.html page? ``` <i class="fa fa-home" style="color:black; font-size:48px"></i><a href="index.html">Home</a> ``` This didnt work So I introd...
2016/09/09
[ "https://Stackoverflow.com/questions/39420682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4699738/" ]
Don't use the modified class use the original class that is fa-home and apply external css which is `.fa-home { color:black; font-size:80px; }` If this does not works then you will have to give the refrence of the parent class
``` <i class="fa fa-home" style="color:black; font-size:48px"></i><a href="index.html">Home</a> ``` I want to say that the problem is coming from the inline-style reference, there is a missing semi-colon ;
39,420,682
I downloaded a web site template from this [link](http://www.free-css.com/free-css-templates/page202/boss). How can I change the icon's style in the navigation menu of the index.html page? ``` <i class="fa fa-home" style="color:black; font-size:48px"></i><a href="index.html">Home</a> ``` This didnt work So I introd...
2016/09/09
[ "https://Stackoverflow.com/questions/39420682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4699738/" ]
Don't use the modified class use the original class that is fa-home and apply external css which is `.fa-home { color:black; font-size:80px; }` If this does not works then you will have to give the refrence of the parent class
I found the solution. I added "color" property to following piece of code ``` #hornav li [class^="fa-"]:before, #hornav li [class*=" fa-"]:before { ... color:#ffd602; } ```
30,341,985
I'm currently working on migrating my clojure app(with korma) to Datomic framework and been in a loop while I was translating the queries. I realise the queries are not completely flexible(compared to korma), for example i would like to evaluate conditional clauses around different variables. Considering a korma quer...
2015/05/20
[ "https://Stackoverflow.com/questions/30341985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1436610/" ]
Your query should work. All of your clauses *do* use the same variable: `?u` ``` (d/q '[:find ?u :where (or (and [?u :user/first-name "user"] [?u :user/last-name "sample"]) [?u :user/email "user.sample@email.com"])] [[1 :user/first-name "user"] [1 :user/last-name "s...
This is very similar to this question: [SQL LIKE operator in datomic](https://stackoverflow.com/questions/24745383/sql-like-operator-in-datomic/24753310#24753310) You need to check out query *rules*. <http://docs.datomic.com/query.html> Your query would look *something* like this (untested!) ``` (let [rules '[[(f...
427,348
I would like to print the contents of a web request, similar as "cat" command does for local files. I tried lynx but it does not simply prints to unix shell.
2018/02/23
[ "https://unix.stackexchange.com/questions/427348", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/278329/" ]
Ok, i figured it out, figured I would post the answer. pythons keyboard module, docs and source [here](https://pypi.org/project/keyboard/) as stated in the "Known Limitations" section, (even though I don't think this is a limitation!) "To avoid depending on X, the Linux parts reads raw device files (/dev/input/input...
*I am currently working on a similar problem. I got an idea how to solve this. But did not try it yet. Not sure if I should put this into a new question.* * set up a virtual console that automatically logs in a user * this console does not show an interactive shell (bash) but just a process that listens for key-presse...
1,631,033
I don't make anything particular. I use Safari, and when I use `<strong>blabla</strong>` it doesn't work, but `<b>blbla</b>` does. any idea about what can be the reason? Regards... I use Yahoo Reset.css, if it may cause the problem. --- sample code: ``` <p><strong>Address:</strong> bla bla bla blaabllb</p> ```
2009/10/27
[ "https://Stackoverflow.com/questions/1631033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150225/" ]
Yes, the Yahoo! CSS reset removes formatting from STRONG tags (as well as all other tags). You'll need to explicitly declare the formatting as noted in the other answers... ``` strong { font-weight: bold; } ``` The Firefox plugin Firebug will let you right-click on an element and say "Inspect Element", which among ...
Well it all depends on what the CSS is doing. ``` strong { font-weight:bold; } ``` will make it appear bold. Some browsers will have that set as a default CSS rule, others might not. Have you set anything that says explicitly that strong or `<b>` will result in bold text? Generally you shouldn't rely on the br...
1,631,033
I don't make anything particular. I use Safari, and when I use `<strong>blabla</strong>` it doesn't work, but `<b>blbla</b>` does. any idea about what can be the reason? Regards... I use Yahoo Reset.css, if it may cause the problem. --- sample code: ``` <p><strong>Address:</strong> bla bla bla blaabllb</p> ```
2009/10/27
[ "https://Stackoverflow.com/questions/1631033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150225/" ]
Yahoo's reset.css has this: ``` address,caption,cite,code,dfn,em,strong,th,var { font-style:normal; font-weight:normal; } ``` This indeed means that it won't be bold.
It can be that the browser has somehow lost default settings for the "strong" element. Try to make it "recall" by specifying it explicitly in your CSS: ``` strong { font-weight: bold; } ```
1,631,033
I don't make anything particular. I use Safari, and when I use `<strong>blabla</strong>` it doesn't work, but `<b>blbla</b>` does. any idea about what can be the reason? Regards... I use Yahoo Reset.css, if it may cause the problem. --- sample code: ``` <p><strong>Address:</strong> bla bla bla blaabllb</p> ```
2009/10/27
[ "https://Stackoverflow.com/questions/1631033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150225/" ]
You shouldn't use the tags "strong" and "b" to achieve just bold text. Instead use stylesheets to make text appear bold and only use strong if you want to emphasize something. You can also use stylesheets to make strong appear bold in safari.
`<strong>` is a semantic element used to emphasize the enclosed text, while `<b>` (though "deprecated") is more of a typographic convention. ``` strong {font-weight:bold} ```
1,631,033
I don't make anything particular. I use Safari, and when I use `<strong>blabla</strong>` it doesn't work, but `<b>blbla</b>` does. any idea about what can be the reason? Regards... I use Yahoo Reset.css, if it may cause the problem. --- sample code: ``` <p><strong>Address:</strong> bla bla bla blaabllb</p> ```
2009/10/27
[ "https://Stackoverflow.com/questions/1631033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150225/" ]
You shouldn't use the tags "strong" and "b" to achieve just bold text. Instead use stylesheets to make text appear bold and only use strong if you want to emphasize something. You can also use stylesheets to make strong appear bold in safari.
Well it all depends on what the CSS is doing. ``` strong { font-weight:bold; } ``` will make it appear bold. Some browsers will have that set as a default CSS rule, others might not. Have you set anything that says explicitly that strong or `<b>` will result in bold text? Generally you shouldn't rely on the br...
1,631,033
I don't make anything particular. I use Safari, and when I use `<strong>blabla</strong>` it doesn't work, but `<b>blbla</b>` does. any idea about what can be the reason? Regards... I use Yahoo Reset.css, if it may cause the problem. --- sample code: ``` <p><strong>Address:</strong> bla bla bla blaabllb</p> ```
2009/10/27
[ "https://Stackoverflow.com/questions/1631033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150225/" ]
It can be that the browser has somehow lost default settings for the "strong" element. Try to make it "recall" by specifying it explicitly in your CSS: ``` strong { font-weight: bold; } ```
`<strong>` is a semantic element used to emphasize the enclosed text, while `<b>` (though "deprecated") is more of a typographic convention. ``` strong {font-weight:bold} ```
1,631,033
I don't make anything particular. I use Safari, and when I use `<strong>blabla</strong>` it doesn't work, but `<b>blbla</b>` does. any idea about what can be the reason? Regards... I use Yahoo Reset.css, if it may cause the problem. --- sample code: ``` <p><strong>Address:</strong> bla bla bla blaabllb</p> ```
2009/10/27
[ "https://Stackoverflow.com/questions/1631033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150225/" ]
It can be that the browser has somehow lost default settings for the "strong" element. Try to make it "recall" by specifying it explicitly in your CSS: ``` strong { font-weight: bold; } ```
Do you have strong declared in your css file? if you have a declaration: ``` strong{} ``` then nothing will happen. You need to have: ``` strong{ font-weight:bold; font-style: italic; } ```
1,631,033
I don't make anything particular. I use Safari, and when I use `<strong>blabla</strong>` it doesn't work, but `<b>blbla</b>` does. any idea about what can be the reason? Regards... I use Yahoo Reset.css, if it may cause the problem. --- sample code: ``` <p><strong>Address:</strong> bla bla bla blaabllb</p> ```
2009/10/27
[ "https://Stackoverflow.com/questions/1631033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150225/" ]
Yes, the Yahoo! CSS reset removes formatting from STRONG tags (as well as all other tags). You'll need to explicitly declare the formatting as noted in the other answers... ``` strong { font-weight: bold; } ``` The Firefox plugin Firebug will let you right-click on an element and say "Inspect Element", which among ...
It can be that the browser has somehow lost default settings for the "strong" element. Try to make it "recall" by specifying it explicitly in your CSS: ``` strong { font-weight: bold; } ```
1,631,033
I don't make anything particular. I use Safari, and when I use `<strong>blabla</strong>` it doesn't work, but `<b>blbla</b>` does. any idea about what can be the reason? Regards... I use Yahoo Reset.css, if it may cause the problem. --- sample code: ``` <p><strong>Address:</strong> bla bla bla blaabllb</p> ```
2009/10/27
[ "https://Stackoverflow.com/questions/1631033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150225/" ]
Yes, the Yahoo! CSS reset removes formatting from STRONG tags (as well as all other tags). You'll need to explicitly declare the formatting as noted in the other answers... ``` strong { font-weight: bold; } ``` The Firefox plugin Firebug will let you right-click on an element and say "Inspect Element", which among ...
Yahoo's reset.css has this: ``` address,caption,cite,code,dfn,em,strong,th,var { font-style:normal; font-weight:normal; } ``` This indeed means that it won't be bold.
1,631,033
I don't make anything particular. I use Safari, and when I use `<strong>blabla</strong>` it doesn't work, but `<b>blbla</b>` does. any idea about what can be the reason? Regards... I use Yahoo Reset.css, if it may cause the problem. --- sample code: ``` <p><strong>Address:</strong> bla bla bla blaabllb</p> ```
2009/10/27
[ "https://Stackoverflow.com/questions/1631033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150225/" ]
Yahoo's reset.css has this: ``` address,caption,cite,code,dfn,em,strong,th,var { font-style:normal; font-weight:normal; } ``` This indeed means that it won't be bold.
Well it all depends on what the CSS is doing. ``` strong { font-weight:bold; } ``` will make it appear bold. Some browsers will have that set as a default CSS rule, others might not. Have you set anything that says explicitly that strong or `<b>` will result in bold text? Generally you shouldn't rely on the br...
1,631,033
I don't make anything particular. I use Safari, and when I use `<strong>blabla</strong>` it doesn't work, but `<b>blbla</b>` does. any idea about what can be the reason? Regards... I use Yahoo Reset.css, if it may cause the problem. --- sample code: ``` <p><strong>Address:</strong> bla bla bla blaabllb</p> ```
2009/10/27
[ "https://Stackoverflow.com/questions/1631033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/150225/" ]
Yahoo's reset.css has this: ``` address,caption,cite,code,dfn,em,strong,th,var { font-style:normal; font-weight:normal; } ``` This indeed means that it won't be bold.
Do you have strong declared in your css file? if you have a declaration: ``` strong{} ``` then nothing will happen. You need to have: ``` strong{ font-weight:bold; font-style: italic; } ```
2,176,017
Please check my proof Consider the condition of open set it must contain all of collection of intersection and union . in this case set of integers must contain all of collection of intersection and union form real number But it is imposible since set does not contain collection of union and intersection from irrati...
2017/03/07
[ "https://math.stackexchange.com/questions/2176017", "https://math.stackexchange.com", "https://math.stackexchange.com/users/353503/" ]
Let us recall the following definition. **Definition.** Let $A\subset \Bbb R$. We say that $A$ is *open* if for every $x\in A$ there exists an open interval $I$ that contains $x$ such that $I\subset A$. Equivalently, we get **Definition.** Let $A\subset \Bbb R$. We say that $A$ is *not open* if there exists $x\in ...
I would have to say that the original poster simply does not know what "open set" means. I think he was trying to use the fact that a "topology" for a set (the collection of all open sets) is closed under unions and finite intersections but he seems to think that must be true of any single open set- which is not the ca...
36,700,213
I am using Android Studio 2.0 on Windows 7. When building my Android project, I get the following error: ``` :app:transformResourcesWithMergeJavaResForDebug FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. > com.android.bu...
2016/04/18
[ "https://Stackoverflow.com/questions/36700213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4746898/" ]
To complete @dsh's answer: In your dependency tree there are 2 jar files containing the same file named `sep_approx_spanish.txt` , this is not allowed. To resolve your problem you have to track down which of your gradle dependencies has the two jars named `appengine-api-1.0-sdk-1.9.28.jar` and `appengine-endpoints-1....
The error tells you that building your APK would result in two files named com/google/appengine/repackaged/org/apache/commons/codec/language/bm/sep\_approx\_spanish.txt. This is a failure because the APK can only contain one file at any given path. This is probably caused by two different jar files in your classpath th...
36,700,213
I am using Android Studio 2.0 on Windows 7. When building my Android project, I get the following error: ``` :app:transformResourcesWithMergeJavaResForDebug FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. > com.android.bu...
2016/04/18
[ "https://Stackoverflow.com/questions/36700213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4746898/" ]
The error tells you that building your APK would result in two files named com/google/appengine/repackaged/org/apache/commons/codec/language/bm/sep\_approx\_spanish.txt. This is a failure because the APK can only contain one file at any given path. This is probably caused by two different jar files in your classpath th...
Completing @Apperside answer. I fixed the error by adding the following lines to my build.gradle file of my app module: ``` android{ packagingOptions { exclude 'com/google/appengine/repackaged/org/apache/commons/codec/language/bm/*' exclude 'com/google/appengine/repackaged/org/codehaus/ja...
36,700,213
I am using Android Studio 2.0 on Windows 7. When building my Android project, I get the following error: ``` :app:transformResourcesWithMergeJavaResForDebug FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. > com.android.bu...
2016/04/18
[ "https://Stackoverflow.com/questions/36700213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4746898/" ]
To complete @dsh's answer: In your dependency tree there are 2 jar files containing the same file named `sep_approx_spanish.txt` , this is not allowed. To resolve your problem you have to track down which of your gradle dependencies has the two jars named `appengine-api-1.0-sdk-1.9.28.jar` and `appengine-endpoints-1....
Completing @Apperside answer. I fixed the error by adding the following lines to my build.gradle file of my app module: ``` android{ packagingOptions { exclude 'com/google/appengine/repackaged/org/apache/commons/codec/language/bm/*' exclude 'com/google/appengine/repackaged/org/codehaus/ja...
55,152,825
Input XML: ``` <testng-results> <suite> <test> <class> <test-method status="PASS" description="Test_ID:123,Test_Name:Test ABC,Product:Product ABC"></test-method> <test-method status="PASS" description="Test_ID:456,Test_Name:Test XYZ,Product:Product XYZ"></test-method> </clas...
2019/03/13
[ "https://Stackoverflow.com/questions/55152825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5414637/" ]
How about this, using the buttons extension. We define a custom button that calls the javascript function `page.len(-1)`, where `-1` means all rows: ``` shinyApp( ui = navbarPage( title = 'DataTable', tabPanel('Display length', DT::dataTableOutput('ex2')) ), server = function(input, output, session...
``` library(dplyr) library(shiny) library(DT) shinyApp( ui = navbarPage( title = 'DataTable', tabPanel('Display length', DT::dataTableOutput('ex2')) ), server = function(input, output, session) { output$ex2 <- DT::renderDataTable( DT::datatable( iris, extensions = 'Butto...
55,152,825
Input XML: ``` <testng-results> <suite> <test> <class> <test-method status="PASS" description="Test_ID:123,Test_Name:Test ABC,Product:Product ABC"></test-method> <test-method status="PASS" description="Test_ID:456,Test_Name:Test XYZ,Product:Product XYZ"></test-method> </clas...
2019/03/13
[ "https://Stackoverflow.com/questions/55152825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5414637/" ]
How about this, using the buttons extension. We define a custom button that calls the javascript function `page.len(-1)`, where `-1` means all rows: ``` shinyApp( ui = navbarPage( title = 'DataTable', tabPanel('Display length', DT::dataTableOutput('ex2')) ), server = function(input, output, session...
Set the `dom = "ft"` in the options of `renderDataTable`. [Here](https://datatables.net/reference/option/dom) are all the dom options. Basically this is only enabling "f - filtering" and "t - table". The "p-pagination" is missing. Then set the `pageLength` to be displayed to something really big (`10000` rows in this e...
48,209,441
I am creating script zipping files from an array. ``` /* creates a compressed zip file */ function create_zip($files = array(),$destination = '',$overwrite = false) { //if the zip file already exists and overwrite is false, return false if(file_exists($destination) && !$overwrite) { return false; } //vars ...
2018/01/11
[ "https://Stackoverflow.com/questions/48209441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9154952/" ]
The second argument to the [`addFile()`](http://php.net/manual/en/ziparchive.addfile.php) method is the name of the file inside the zip. You're doing this: ``` $zip->addFile($file, $file); ``` So you're getting something like: ``` $zip->addFile('/path/to/some/file', '/path/to/some/file'); ``` Which just copies th...
Check the docs on [addFile](https://secure.php.net/manual/en/ziparchive.addfile.php) method of Zip extension. You can specify local name as second argument. Example from the documentation ``` <?php $zip = new ZipArchive; if ($zip->open('test.zip') === TRUE) { $zip->addFile('/path/to/index.txt', 'newname.txt'); ...
31,111,618
I have a txt file and I want to replace a random number from a string with a specific number that I have choosen. For example: ``` txt[15] = "\t<!-- number=31 -->" ``` I want substitute the number after "=" with "15", but keeping all the structure and the s...
2015/06/29
[ "https://Stackoverflow.com/questions/31111618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3637646/" ]
You can try with `sub` ``` sub('\\d+', '15', str1) #[1] "\t<!-- number=15 -->" ``` To be exact ``` sub('(?<=[=])\\d+', '15', str1, perl=TRUE) #[1] "\t<!-- number=15 -->" ``` Or ``` sub('([^=...
Use sub ``` sub("=\\d+", "=15", s) ```
49,723,739
I've disabled SSL Certificate Validation under General Settings because my WordPress site is using http. But I am still still getting "Failed to connect to api.twilio.com port 443: Connection refused" on live and test credentials." I've also purge caches on the browser. I am using the guide from <https://www.twilio.com...
2018/04/08
[ "https://Stackoverflow.com/questions/49723739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6910513/" ]
Answered by Twilio support "All connections to the Twilio API endpoints must use HTTPS and so if you have no SSL Cert for your Wordpress website it will refuse the request. You will need to get an SSL Certificate for your website in order to call the API endpoints from your Wordpress site/domain. Disabling SSL Certific...
I am also facing the same challenge while doing a POC to send SMS using twilio. This is the exception that I am getting. ``` Exception in thread "main" com.twilio.exception.ApiException: Connect to api.twilio.com:443 [api.twilio.com/54.209.184.12, api.twilio.com/52.45.186.111, api.twilio.com/52.4.111.215, api.twilio.c...
7,132,803
I'm writing a Facebook application which fetches some info about the user and does some manipulations on it. I get the user permissions like this: ``` $facebook = new Facebook(array( 'appId' => APPID, 'secret' => 'APPSECRET', )); $logoutUrl = $facebook->getLogoutUrl(); ``` (The default permission is for use...
2011/08/20
[ "https://Stackoverflow.com/questions/7132803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/536912/" ]
Grep and find can do it but I think they're no the best tool for it. You'd be better off using ctags: <http://ctags.sourceforge.net/>. Do this from the top level directory of your project: ``` $ ctags -R * $ vi -t MonoReflectionType ``` I hope you're familiar with vi though ;)
You should probably be using **[CTags](http://en.wikipedia.org/wiki/Ctags)** because that is more easier. I hope your purpose is to find the definition while examining code and analyzing, with CTags you will find it very easy.
58,926,738
I want to when user enters an img, show that img on web page. My code: ```html <input type="text" placeholder="Enter an image URL." id="myinput"> <button onclick="myFunc()">Submit Image</button> <script> function myFunc () { const inp = document.getElementById ('myinput') const img = document.createElement ...
2019/11/19
[ "https://Stackoverflow.com/questions/58926738", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12054524/" ]
You're using [`document.getElementById`](https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementById) to get the body, instead you can use [`document.querySelector`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector) with selector as `'body'` or assign `id` to your body tag: ```html ...
Try setting you src attribute using setAttribute method and body is itself a dom element you dont need to use querySelector for body. Try this: ``` img.setAttribute("src", inp.value); document.body.appendChild(img); ```
58,926,738
I want to when user enters an img, show that img on web page. My code: ```html <input type="text" placeholder="Enter an image URL." id="myinput"> <button onclick="myFunc()">Submit Image</button> <script> function myFunc () { const inp = document.getElementById ('myinput') const img = document.createElement ...
2019/11/19
[ "https://Stackoverflow.com/questions/58926738", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12054524/" ]
You're using [`document.getElementById`](https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementById) to get the body, instead you can use [`document.querySelector`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector) with selector as `'body'` or assign `id` to your body tag: ```html ...
``` <body> <input type="text" placeholder="Enter an image URL."id="myinput"> <button onclick="myFunc()">Submit Image</button> <img id="image-display" class="width:100px; height:100px"></img> <script> function myFunc() { const inp = document.getElementById('myinput').value; document.getElementById('...
9,436,959
I have a list of dictionaries such as: ``` l =[{country:'Italy',sales:100,cost:50}{country:'Italy',sales:130,cost:60} {country:'Germany',sales:110,cost:50}] ``` I want a python function that takes a spreadsheet-like input **string** (please, read comments from @lott below) formula like: ``` margin = (sale...
2012/02/24
[ "https://Stackoverflow.com/questions/9436959", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1018110/" ]
The problem with `json` is that you can't omit the `pk` field since it will be required upon loading of the fixture data again. If not existing, json will fail with ``` $ python manage.py loaddata some_data.json [...] File ".../django/core/serializers/python.py", line 85, in Deserializer data = {Model._meta.pk.attname...
Override the `Serializer` class in a separate module: ``` from django.core.serializers.json import Serializer as JsonSerializer class Serializer(JsonSerializer): def end_object(self, obj): self.objects.append({ "model" : smart_unicode(obj._meta), "fields" : self._current, ...
9,436,959
I have a list of dictionaries such as: ``` l =[{country:'Italy',sales:100,cost:50}{country:'Italy',sales:130,cost:60} {country:'Germany',sales:110,cost:50}] ``` I want a python function that takes a spreadsheet-like input **string** (please, read comments from @lott below) formula like: ``` margin = (sale...
2012/02/24
[ "https://Stackoverflow.com/questions/9436959", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1018110/" ]
Updating the answer for anyone coming across this in 2018 and beyond. There is a way to omit the primary key through the use of natural keys and unique\_together method. Taken from the [Django documentation on serialization](https://docs.djangoproject.com/en/1.11/topics/serialization/#natural-keys): You can use this ...
Override the `Serializer` class in a separate module: ``` from django.core.serializers.json import Serializer as JsonSerializer class Serializer(JsonSerializer): def end_object(self, obj): self.objects.append({ "model" : smart_unicode(obj._meta), "fields" : self._current, ...
4,319,922
How do I proxy the ruby logger and keep performance? So, we have an requirement at work, quite reasonable. When a program is sent the signal HUP the log is flushed and restarted. ``` class LocalObject attr_accessor :logger def initialize context # one less method call! Yea! performance++ @logger = cont...
2010/11/30
[ "https://Stackoverflow.com/questions/4319922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/200394/" ]
First: your question smells like you're optimizing prematurely. You should only optimize if you *know* your code is too slow. (And your benchmark show only a tiny difference) That said, you could make the Context notify every proxy if logger is ever updated: ``` class ProxyLogger attr_accessor :logger def initia...
Instead of resetting the logger itself, flush and reopen its output: ``` logfile = File.open 'my_file.log', 'w+' context.logger = Logger.new logfile Signal.trap('HUP') { logfile.flush logfile.reopen 'my_file.log', 'w+' } ```
9,674,566
I have a strange problem. I have an UITextField in which the user should write the amount of something, so the field is called "amountField". Everything looks fine, when the user starts editing the textfield the text is in the vertical and horizontal center - that's great. However, when the user ends editing the text...
2012/03/12
[ "https://Stackoverflow.com/questions/9674566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001803/" ]
So... After many hours of trying many things - I have found the problem. In my case the problem is the font. I really don't know why, but the author of the font made the font weird (leading etc.), it has a blank space on the bottom. I don't know why, but when you are editing the text all of the text properties are ign...
I had similar issues with a `UITextfield` embedded in a `UITableViewCell`. Where exactly is this code located in your project? What I believe is happening is that after you've finished editing a particular textfield, it sends itself `-setNeedsDisplay` and its `drawRect:` is subsequently called. This might explain the s...
9,674,566
I have a strange problem. I have an UITextField in which the user should write the amount of something, so the field is called "amountField". Everything looks fine, when the user starts editing the textfield the text is in the vertical and horizontal center - that's great. However, when the user ends editing the text...
2012/03/12
[ "https://Stackoverflow.com/questions/9674566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001803/" ]
I had a similar issue that started happening on **iOS 9**. Basically I have a UITextField in a collection view cell. Sometimes when the user is done typing and editing ends, the text "bounces" up then down again into its correct position. Very strange and annoying glitch. Simply making this tweak fixed the issue on iOS...
There is a glitch on iOS 8.1 and below, I do not know if they will fix it later but at that time there is not an unique solution which fixes all cases, because the bug and the solutions are font's type, size dependent. One of this solution or a combination of these solutions below can fix your problem: * **Changing t...
9,674,566
I have a strange problem. I have an UITextField in which the user should write the amount of something, so the field is called "amountField". Everything looks fine, when the user starts editing the textfield the text is in the vertical and horizontal center - that's great. However, when the user ends editing the text...
2012/03/12
[ "https://Stackoverflow.com/questions/9674566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001803/" ]
Disabling ClipsToBounds for the TextField solved it for me.
I had similar issues with a `UITextfield` embedded in a `UITableViewCell`. Where exactly is this code located in your project? What I believe is happening is that after you've finished editing a particular textfield, it sends itself `-setNeedsDisplay` and its `drawRect:` is subsequently called. This might explain the s...
9,674,566
I have a strange problem. I have an UITextField in which the user should write the amount of something, so the field is called "amountField". Everything looks fine, when the user starts editing the textfield the text is in the vertical and horizontal center - that's great. However, when the user ends editing the text...
2012/03/12
[ "https://Stackoverflow.com/questions/9674566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001803/" ]
Disabling ClipsToBounds for the TextField solved it for me.
There is a glitch on iOS 8.1 and below, I do not know if they will fix it later but at that time there is not an unique solution which fixes all cases, because the bug and the solutions are font's type, size dependent. One of this solution or a combination of these solutions below can fix your problem: * **Changing t...
9,674,566
I have a strange problem. I have an UITextField in which the user should write the amount of something, so the field is called "amountField". Everything looks fine, when the user starts editing the textfield the text is in the vertical and horizontal center - that's great. However, when the user ends editing the text...
2012/03/12
[ "https://Stackoverflow.com/questions/9674566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001803/" ]
I fixed this by adding height constraints to my UITextFields.
These solution above doesn't work for me.My solution is subclass UITextField and override setText: ``` - (void) setText:(NSString *)text { [super setText:text]; [self layoutIfNeeded]; } ```
9,674,566
I have a strange problem. I have an UITextField in which the user should write the amount of something, so the field is called "amountField". Everything looks fine, when the user starts editing the textfield the text is in the vertical and horizontal center - that's great. However, when the user ends editing the text...
2012/03/12
[ "https://Stackoverflow.com/questions/9674566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001803/" ]
I'm struggling with this issue almost every time when the design of app is with custom font. One option is to fix the font (but this is too much work – at least for me :) ). The second option I'm using is subclassing the UITextField and overriding the editingRectForBounds: and placeholderRectForBounds: methods and corr...
I had similar issues with a `UITextfield` embedded in a `UITableViewCell`. Where exactly is this code located in your project? What I believe is happening is that after you've finished editing a particular textfield, it sends itself `-setNeedsDisplay` and its `drawRect:` is subsequently called. This might explain the s...
9,674,566
I have a strange problem. I have an UITextField in which the user should write the amount of something, so the field is called "amountField". Everything looks fine, when the user starts editing the textfield the text is in the vertical and horizontal center - that's great. However, when the user ends editing the text...
2012/03/12
[ "https://Stackoverflow.com/questions/9674566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001803/" ]
I'm struggling with this issue almost every time when the design of app is with custom font. One option is to fix the font (but this is too much work – at least for me :) ). The second option I'm using is subclassing the UITextField and overriding the editingRectForBounds: and placeholderRectForBounds: methods and corr...
There is a glitch on iOS 8.1 and below, I do not know if they will fix it later but at that time there is not an unique solution which fixes all cases, because the bug and the solutions are font's type, size dependent. One of this solution or a combination of these solutions below can fix your problem: * **Changing t...
9,674,566
I have a strange problem. I have an UITextField in which the user should write the amount of something, so the field is called "amountField". Everything looks fine, when the user starts editing the textfield the text is in the vertical and horizontal center - that's great. However, when the user ends editing the text...
2012/03/12
[ "https://Stackoverflow.com/questions/9674566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001803/" ]
Disabling ClipsToBounds for the TextField solved it for me.
These solution above doesn't work for me.My solution is subclass UITextField and override setText: ``` - (void) setText:(NSString *)text { [super setText:text]; [self layoutIfNeeded]; } ```
9,674,566
I have a strange problem. I have an UITextField in which the user should write the amount of something, so the field is called "amountField". Everything looks fine, when the user starts editing the textfield the text is in the vertical and horizontal center - that's great. However, when the user ends editing the text...
2012/03/12
[ "https://Stackoverflow.com/questions/9674566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001803/" ]
Disabling ClipsToBounds for the TextField solved it for me.
I wasn't able to change the font file, so when I solved this I saved the original UITextField's frame in a property and applied the following code: ``` - (void)textFieldDidBeginEditing:(UITextField *)textField { textField.frame = self.usernameFrame; } - (void)textFieldDidEndEditing:(UITextField *)textField { ...
9,674,566
I have a strange problem. I have an UITextField in which the user should write the amount of something, so the field is called "amountField". Everything looks fine, when the user starts editing the textfield the text is in the vertical and horizontal center - that's great. However, when the user ends editing the text...
2012/03/12
[ "https://Stackoverflow.com/questions/9674566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001803/" ]
This bug happened to me when I set text & became the first responder in `viewDidLoad` or `viewWillAppear`. When I moved the `becomeFirstResponder` code to `viewDidAppear` the bug went away.
I had similar issues with a `UITextfield` embedded in a `UITableViewCell`. Where exactly is this code located in your project? What I believe is happening is that after you've finished editing a particular textfield, it sends itself `-setNeedsDisplay` and its `drawRect:` is subsequently called. This might explain the s...
46,034,741
I need to convert the `CUSER1` column I am pulling from a `VARCHAR2` to a `NUMBER`. Below is the current SQL I am using to see if I can get his to work: ``` SELECT V_PDAYPROD_CRW1.MFGCELL , V_PDAYPROD_CRW1.MFG_TYPE , V_PDAYPROD_CRW1.PROD_DATE, V_PDAYPROD_CRW1.EQNO, V_PDAYPROD_CRW1.SHIFT, V_PDAYP...
2017/09/04
[ "https://Stackoverflow.com/questions/46034741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8338776/" ]
The conversion may fail at the point. 0.33 is not a valid number in all languages. You can explicitly specify the point as decimal separator: ``` to_number(cuser1, '99999.999') ``` And maybe you'd even have to trim blanks: ``` to_number(trim(cuser1), '99999.999') ``` But still there may be values that violate th...
``` NVL(AVG( TO_NUMBER(NVL(V_PDAYPROD_CRW1.CUSER1,'0'),'9999.99') ),0) CUSER1 ``` try this..
14,708,732
This is more of a stylistic question than anything else. Given the following piece of code: ``` case e1 of (* datatype type_of_e1 = p1 | p2 *) p1 => case e11 of (* datatype type_of_e11 = NONE | SOME int *) NONE => expr11 | SOME v => expr12 v | p2 => case e21 ...
2013/02/05
[ "https://Stackoverflow.com/questions/14708732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1051489/" ]
No. The syntactic rules in the Definition of Standard ML state that the match arms of a case expression attempt to maximally consume potential clauses. And since there's no "end case" or similar marker in the language, the parser will merrily eat each of the "| pat => exp" clauses that you feed it until it sees somethi...
Plain and short answer: no. But what's wrong with parentheses? (Of course, you can also bracket in other ways, e.g. with a 'let', or by factoring into auxiliary functions, but parentheses are the canonical solution.)
14,708,732
This is more of a stylistic question than anything else. Given the following piece of code: ``` case e1 of (* datatype type_of_e1 = p1 | p2 *) p1 => case e11 of (* datatype type_of_e11 = NONE | SOME int *) NONE => expr11 | SOME v => expr12 v | p2 => case e21 ...
2013/02/05
[ "https://Stackoverflow.com/questions/14708732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1051489/" ]
The answer is "(" and ")". My example: ``` case e1 of p1 => ( case e11 of NONE => expr11 | SOME v => expr12 v ) | p2 => ( case e21 of NONE => expr21 | SOME v => expr22 v ) ``` This really works! Cool :) You can try...
Plain and short answer: no. But what's wrong with parentheses? (Of course, you can also bracket in other ways, e.g. with a 'let', or by factoring into auxiliary functions, but parentheses are the canonical solution.)
25,684,206
As part of the website I am working on, I need to be able to post directly to the wall of my clients Facebook Page. I have created an App and am successfully posting to my own dummy profile by simply using: ``` $request = new FacebookRequest( $session, 'POST', '/me/feed', array( 'link' => 'my_url', 'm...
2014/09/05
[ "https://Stackoverflow.com/questions/25684206", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4011442/" ]
What you need is to implement a [nested set model](http://en.wikipedia.org/wiki/Nested_set_model), you can do it using your database server (PostgreSQL, MySQL...) or implement it in code. For Laravel there are some package options to help you with this: <https://github.com/etrepat/baum> <https://github.com/lazychaser...
Ended up without using any 3rd party packages. Used native Eloquent for that.
1,951,229
Write $n!=2^ab$ where $b,n\in \mathbb{N}$ and $a\in \mathbb{N} \cup \{0\}$. Prove that $a<n$. The value $a$ is the maximum value that satisfies the equality, consequently this means that $b$ is odd.
2016/10/02
[ "https://math.stackexchange.com/questions/1951229", "https://math.stackexchange.com", "https://math.stackexchange.com/users/288949/" ]
By Legendre's formula, the exponent $\alpha$ of $2$ in $n!$ is $\alpha=\sum\_{k=1}^\infty\lfloor{n/2^k}\rfloor\leqslant n\sum\_{k=1}^\infty1/2^k=n,$ and as $\alpha\geqslant a$ then $a\leqslant n$ (the strict inequality occurs only when $b$ is even).
HINT: Show that the number of factors of $2$ in $n!$ is $$\sum\_{k\ge 1}\left\lfloor\frac{n}{2^k}\right\rfloor\;.$$
11,225,092
I'm creating an SSAS cube (SQL 2012), one of the purposes of which is to expose data to a .NET UI which contains a number of filters/search features, allowing users to query the data. In the existing SQL Server DB, we make use of Full Text Search to help with text-based filters/searches. I've looked around for more in...
2012/06/27
[ "https://Stackoverflow.com/questions/11225092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/185650/" ]
To make .ipa file read this [Creating .ipa file](http://www.codepo.st/2012/04/18/how-to-create-ipa.html). You need to have Apple's developer account, which will cost you 99$. Then you will be able to make certificates and use them to check the app on your mobile. How to make certificates, [read here](http://www.idev...
You will need to purchase a license from apple, then follow the tutorial they have on their website and everything should go just fine Without the license, certificates and keys, you will not be able to run the application on your iPhone/iPad [iOS developer program](https://developer.apple.com/programs/ios/)
11,225,092
I'm creating an SSAS cube (SQL 2012), one of the purposes of which is to expose data to a .NET UI which contains a number of filters/search features, allowing users to query the data. In the existing SQL Server DB, we make use of Full Text Search to help with text-based filters/searches. I've looked around for more in...
2012/06/27
[ "https://Stackoverflow.com/questions/11225092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/185650/" ]
You will need to purchase a license from apple, then follow the tutorial they have on their website and everything should go just fine Without the license, certificates and keys, you will not be able to run the application on your iPhone/iPad [iOS developer program](https://developer.apple.com/programs/ios/)
For enabling archive button in product menu select iOS device instead of iOS simulator in scheme.
11,225,092
I'm creating an SSAS cube (SQL 2012), one of the purposes of which is to expose data to a .NET UI which contains a number of filters/search features, allowing users to query the data. In the existing SQL Server DB, we make use of Full Text Search to help with text-based filters/searches. I've looked around for more in...
2012/06/27
[ "https://Stackoverflow.com/questions/11225092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/185650/" ]
To make .ipa file read this [Creating .ipa file](http://www.codepo.st/2012/04/18/how-to-create-ipa.html). You need to have Apple's developer account, which will cost you 99$. Then you will be able to make certificates and use them to check the app on your mobile. How to make certificates, [read here](http://www.idev...
For enabling archive button in product menu select iOS device instead of iOS simulator in scheme.
68,957,010
When I use `hexdump -C` on the command line to examine this MIDI file, we can see that some bytes of this binary file are ASCII letters that are meant to be human readable text. ``` 00000000 4d 54 68 64 00 00 00 06 00 01 00 08 00 78 4d 54 |MThd.........xMT| 000024f0 2f 00 4d 54 72 6b 00 00 00 19 00 ff 21 01 00 00...
2021/08/27
[ "https://Stackoverflow.com/questions/68957010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/159795/" ]
There is no formatting spec like `std::ascii` but there is a `string` constructor you can use: ``` std::string int2str((char*)&n32Bits, 4); std::cout << "n32Bits: " << int2str << std::endl; ``` This constructor takes a `char` buffer and length.
``` int a = 0x4d546864; // swap_bytes(a); int b[] = {a, 0}; cout << (char*)b <<endl; ```
68,957,010
When I use `hexdump -C` on the command line to examine this MIDI file, we can see that some bytes of this binary file are ASCII letters that are meant to be human readable text. ``` 00000000 4d 54 68 64 00 00 00 06 00 01 00 08 00 78 4d 54 |MThd.........xMT| 000024f0 2f 00 4d 54 72 6b 00 00 00 19 00 ff 21 01 00 00...
2021/08/27
[ "https://Stackoverflow.com/questions/68957010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/159795/" ]
There is no formatting spec like `std::ascii` but there is a `string` constructor you can use: ``` std::string int2str((char*)&n32Bits, 4); std::cout << "n32Bits: " << int2str << std::endl; ``` This constructor takes a `char` buffer and length.
There is no built-in function to print raw bytes as an ASCII string the way a hex dump does. You will have to do that yourself manually, eg: ```cpp #include <algorithm> #include <iterator> #include <cctype> #include <cstring> char buffer[sizeof(n32Bits)]; std::memcpy(buffer, &n32Bits, sizeof(n32Bits)); std::transfor...
68,957,010
When I use `hexdump -C` on the command line to examine this MIDI file, we can see that some bytes of this binary file are ASCII letters that are meant to be human readable text. ``` 00000000 4d 54 68 64 00 00 00 06 00 01 00 08 00 78 4d 54 |MThd.........xMT| 000024f0 2f 00 4d 54 72 6b 00 00 00 19 00 ff 21 01 00 00...
2021/08/27
[ "https://Stackoverflow.com/questions/68957010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/159795/" ]
There is no built-in function to print raw bytes as an ASCII string the way a hex dump does. You will have to do that yourself manually, eg: ```cpp #include <algorithm> #include <iterator> #include <cctype> #include <cstring> char buffer[sizeof(n32Bits)]; std::memcpy(buffer, &n32Bits, sizeof(n32Bits)); std::transfor...
``` int a = 0x4d546864; // swap_bytes(a); int b[] = {a, 0}; cout << (char*)b <<endl; ```
2,654,354
> > Prove without induction that $\forall n \in\mathbb Z$, $15\mid4^{2n}-1$. > > > $4^{2n} = (4^2)^n = 16^n$. If $n=1,$ then $(4^2)^n-1=15$, and for $n=2$, it is $255$, which is divisible by $15$. Using the congruence arithmetic, any $n$ in $4^{2n}-1$ can be expressed as a product of prime factors. Also, the...
2018/02/17
[ "https://math.stackexchange.com/questions/2654354", "https://math.stackexchange.com", "https://math.stackexchange.com/users/513178/" ]
$$4^{2n}-1=16^n-1=(16-1)(16^{n-1}+16^{n-2}+\dots+1)$$
note that $$4^{2n}-1=(2^n-1)(2^n+1)(2^{2n}+1)$$ also possible: $$4^{2n}=16^n$$ and $$16\equiv 1 \mod 15$$ so $$16^n\equiv 1^n\equiv 1 \mod 15$$therefore $$16^n-1\equiv 0 \mod 15$$ so no factorization needed
2,654,354
> > Prove without induction that $\forall n \in\mathbb Z$, $15\mid4^{2n}-1$. > > > $4^{2n} = (4^2)^n = 16^n$. If $n=1,$ then $(4^2)^n-1=15$, and for $n=2$, it is $255$, which is divisible by $15$. Using the congruence arithmetic, any $n$ in $4^{2n}-1$ can be expressed as a product of prime factors. Also, the...
2018/02/17
[ "https://math.stackexchange.com/questions/2654354", "https://math.stackexchange.com", "https://math.stackexchange.com/users/513178/" ]
$$4^{2n}-1=16^n-1=(16-1)(16^{n-1}+16^{n-2}+\dots+1)$$
It is $4^{2n}=16^n.$ Note: $$16\equiv 1 \ \ (\mod 3) \Rightarrow 16^n-1\equiv 0 \ \ (\mod 3);$$ $$16\equiv 1 \ \ (\mod 5) \Rightarrow 16^n-1\equiv 0 \ \ (\mod 5).$$ Since it is divisible by both $3$ and $5$, it is also divisible by $15$.
2,654,354
> > Prove without induction that $\forall n \in\mathbb Z$, $15\mid4^{2n}-1$. > > > $4^{2n} = (4^2)^n = 16^n$. If $n=1,$ then $(4^2)^n-1=15$, and for $n=2$, it is $255$, which is divisible by $15$. Using the congruence arithmetic, any $n$ in $4^{2n}-1$ can be expressed as a product of prime factors. Also, the...
2018/02/17
[ "https://math.stackexchange.com/questions/2654354", "https://math.stackexchange.com", "https://math.stackexchange.com/users/513178/" ]
$$4^{2n}-1=16^n-1=(16-1)(16^{n-1}+16^{n-2}+\dots+1)$$
$4 \equiv 1 \mod 3$. So $4^k - 1\equiv 1-1 \equiv 0 \mod 5$ for all $k$. So all $4^k-1$ and all $4^{2n} -1$ are divisible by $3$. $4 \equiv -1 \mod 5$. So $4^{2n} -1 \equiv (-1^n)^2 - 1 \equiv 1 - 1\equiv 0 \mod 5$ for all even $2n$ so all $4^{2n} -1$ are divisible by $5$. So $4^{2n} -1$ is divisible by $3\*5=15$.
2,654,354
> > Prove without induction that $\forall n \in\mathbb Z$, $15\mid4^{2n}-1$. > > > $4^{2n} = (4^2)^n = 16^n$. If $n=1,$ then $(4^2)^n-1=15$, and for $n=2$, it is $255$, which is divisible by $15$. Using the congruence arithmetic, any $n$ in $4^{2n}-1$ can be expressed as a product of prime factors. Also, the...
2018/02/17
[ "https://math.stackexchange.com/questions/2654354", "https://math.stackexchange.com", "https://math.stackexchange.com/users/513178/" ]
It is $4^{2n}=16^n.$ Note: $$16\equiv 1 \ \ (\mod 3) \Rightarrow 16^n-1\equiv 0 \ \ (\mod 3);$$ $$16\equiv 1 \ \ (\mod 5) \Rightarrow 16^n-1\equiv 0 \ \ (\mod 5).$$ Since it is divisible by both $3$ and $5$, it is also divisible by $15$.
note that $$4^{2n}-1=(2^n-1)(2^n+1)(2^{2n}+1)$$ also possible: $$4^{2n}=16^n$$ and $$16\equiv 1 \mod 15$$ so $$16^n\equiv 1^n\equiv 1 \mod 15$$therefore $$16^n-1\equiv 0 \mod 15$$ so no factorization needed
2,654,354
> > Prove without induction that $\forall n \in\mathbb Z$, $15\mid4^{2n}-1$. > > > $4^{2n} = (4^2)^n = 16^n$. If $n=1,$ then $(4^2)^n-1=15$, and for $n=2$, it is $255$, which is divisible by $15$. Using the congruence arithmetic, any $n$ in $4^{2n}-1$ can be expressed as a product of prime factors. Also, the...
2018/02/17
[ "https://math.stackexchange.com/questions/2654354", "https://math.stackexchange.com", "https://math.stackexchange.com/users/513178/" ]
$4 \equiv 1 \mod 3$. So $4^k - 1\equiv 1-1 \equiv 0 \mod 5$ for all $k$. So all $4^k-1$ and all $4^{2n} -1$ are divisible by $3$. $4 \equiv -1 \mod 5$. So $4^{2n} -1 \equiv (-1^n)^2 - 1 \equiv 1 - 1\equiv 0 \mod 5$ for all even $2n$ so all $4^{2n} -1$ are divisible by $5$. So $4^{2n} -1$ is divisible by $3\*5=15$.
note that $$4^{2n}-1=(2^n-1)(2^n+1)(2^{2n}+1)$$ also possible: $$4^{2n}=16^n$$ and $$16\equiv 1 \mod 15$$ so $$16^n\equiv 1^n\equiv 1 \mod 15$$therefore $$16^n-1\equiv 0 \mod 15$$ so no factorization needed
65,804,700
When I accidentally run VBA code to copy/paste data from one Workbook to the target Workbook multiple times, it will create multiple rows with same data in the target Worksheet. [![enter image description here](https://i.stack.imgur.com/4Ktva.png)](https://i.stack.imgur.com/4Ktva.png) I want the VBA code to recogni...
2021/01/20
[ "https://Stackoverflow.com/questions/65804700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15002748/" ]
**Task:** copy from main workbook and paste in target workbook without duplicating data. This should do it. Adjust the config section of the code before trying it. ``` Sub TransferData() Dim main_wb As Workbook, target_wb As Workbook, main_sheet As String Dim r As String, target_sheet As String, first_col As Byte, c...
Go "Developer Tab" then press "Record macro" or at Excel bottom left side there is small button "Record macro". Then you press it it will create automatically code for every your click, press and etc., so go copy and paste only values, stop recording macro. And you will have Module1 with code how to "paste values".
65,804,700
When I accidentally run VBA code to copy/paste data from one Workbook to the target Workbook multiple times, it will create multiple rows with same data in the target Worksheet. [![enter image description here](https://i.stack.imgur.com/4Ktva.png)](https://i.stack.imgur.com/4Ktva.png) I want the VBA code to recogni...
2021/01/20
[ "https://Stackoverflow.com/questions/65804700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15002748/" ]
**Task:** copy from main workbook and paste in target workbook without duplicating data. This should do it. Adjust the config section of the code before trying it. ``` Sub TransferData() Dim main_wb As Workbook, target_wb As Workbook, main_sheet As String Dim r As String, target_sheet As String, first_col As Byte, c...
For `PasteSpecial` function, copying and pasting are defined as different operations (so as to say, no `Destination` option should be used for `Copy`): ``` Sheet4.Range("B6:F6").Copy wsDest.Range("C" & lDestLastRow).PasteSpecial _ Paste:=xlPasteValues ``` If you want your to code to run once, add a variable somew...
13,450,794
What could be the reasons for Redis slow work/response? i.e. I found on Stackoverflow that storing large files or data in Redis makes it slow. What's else?
2012/11/19
[ "https://Stackoverflow.com/questions/13450794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1262525/" ]
There is no simple answer to this question. With all NoSQL or SQL based storage solutions, there are plenty of conditions that could result in high latency or slowness of the storage engine. Redis is no exception. I would suggest to start by reading: * [How fast is Redis?](http://redis.io/topics/benchmarks) * [Redis ...
As was mentioned `new connections`, > 200 per minute could cause slownesses. A Possible solution is to add a proxy that keeps constant number of connections: * [twemproxy](https://github.com/twitter/twemproxy) * [envoy](https://github.com/envoyproxy/envoy)