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
408,546
I recently gifted myself a new dedicated server and I am trying to squeeze maximum performance out of it, for fun and learning. I am trying to achieve maximum possible requests per second this server can handle and aiming for 500K requests/sec as mentioned here - <http://lowlatencyweb.wordpress.com/2012/03/20/500000-r...
2012/07/17
[ "https://serverfault.com/questions/408546", "https://serverfault.com", "https://serverfault.com/users/11502/" ]
First of all, you should write a new benchmarking tool. You're actually benchmarking `ab` not `nginx`.
if you are just after the numbers [eg there's no real use case behind this test] - make ab use the keep alive feature of http - execute number of requests over already open TCP connection.
408,546
I recently gifted myself a new dedicated server and I am trying to squeeze maximum performance out of it, for fun and learning. I am trying to achieve maximum possible requests per second this server can handle and aiming for 500K requests/sec as mentioned here - <http://lowlatencyweb.wordpress.com/2012/03/20/500000-r...
2012/07/17
[ "https://serverfault.com/questions/408546", "https://serverfault.com", "https://serverfault.com/users/11502/" ]
First of all, you should write a new benchmarking tool. You're actually benchmarking `ab` not `nginx`.
Let's identify the bottleneck. Since you're on the same machine, we can assume it's either CPU or disk activity. For the one text file, it shouldn't be disk activity, but at 35k connections, you may be generating 35MB of logging every second as well. The examples you're showing don't run access logging, only errors. Y...
27,396,578
I have this CSS code: ``` .wrap div { border: 1px solid #f36f25; width: 30%; float: left; margin:10px; padding:5px; } .clear:after { content: ""; display: table; clear: both; } @media all and (max-width: 800px) { div.wrap div { width: 100%; float: none; } } ``` wh...
2014/12/10
[ "https://Stackoverflow.com/questions/27396578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2710234/" ]
demo - <http://jsfiddle.net/a8k16vts/4/> use `display:inline-block` instead of `float` ```css * { margin: 0; padding: 0; box-sizing: border-box; } .wrap { text-align: center; } div.wrap div { border: 1px solid #f36f25; width: 29%; display: inline-block; margin: 0 5px 0 5px; padding: 10p...
You want them to be in 3 columns when its in large screen? if so, then your margin is causing it to drop underneath. drop down the margin by 5px. ``` .wrap div { border: 1px solid #f36f25; width: 30%; float: left; margin:5px; padding:5px; } ``` <http://jsfiddle.net/a8k16vts/1/>
3,423,317
Let $I$ be an arbitrary Indexset and let $(X\_i,\mathcal{T}\_i) \: (i \in I)\:$ be Topological spaces and $X:=\prod\limits\_{i \in I} X\_i$ the product space equipped with the product topology. In a version of the proof of Thychonoffs Theorem there will be shown that for each $i \in I$ there exist $x\_i \in X\_i \set...
2019/11/05
[ "https://math.stackexchange.com/questions/3423317", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
The answer is YES, **unless** the situation is specific enough that you can *build* a "choice function", that is, by saying "let $x$ be defined by picking, for every $i$, the one $x\_i$ such that...". In general there is no way to do that, and this is the reason why you need the axiom of choice to prove that $X$ is no...
Yes! In fact, the axiom of choice is equivalent to the following: > > If all $X\_i$ are non-empty, then the product $\prod\_{i \in I} X\_i$ is non-empty. > > >
22,110,276
I have a vey simple query (or so I thought) using NotORM: ``` $query = $db-> irregular ->select('id','name','starttime','endtime') ->where('customer_id',$_SESSION['user']['customer_id']) ->where("startdate > ? ", new NotORM_Literal("NOW()")) ); ``` The "?" doesn't get replaced in the above instance. The ...
2014/03/01
[ "https://Stackoverflow.com/questions/22110276", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2217508/" ]
Assign the value of now() to a variable and use it in where clause ``` $now =new NotORM_Literal("NOW()"); $query = $db-> irregular() ->select('id','name','starttime','endtime') ->where('customer_id',$_SESSION['user']['customer_id']) ->where("startdate > $now")->fetch(); ``` or ``` $query = $db-> irregular(array('c...
Use something like this: ```js $jobs = $this->db->jobs->where(array("deleted" => 1, "id" => $id)) ->select('id', 'startDate') ->where('startDate < ?',$maxStartDate) ->where('startDate > ?',$minStartDate) ->order("id desc"); ```
33,436,140
I would like to be able to have my map centered at a pre-entered location. For example: Page 1: user submits a location and gets redirect to page 2 Page 2: takes input from page 1 and centers map based off of the location Assuming input from page 1 is saved into variable 'location', I've tried: ``` <script src="/st...
2015/10/30
[ "https://Stackoverflow.com/questions/33436140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5332483/" ]
DevOps services isn't currently working in dedicated, but it's high on our priority list (backlog). If your interested in giving us some feedback on what we're thinking reach out to me and we can share what's going on behind the scenes. * Offering Manager for DevOps Services
The next evolution of Bluemix DevOps Services will allow to go dedicated. Read more at <https://developer.ibm.com/devops-services/2016/06/16/open-toolchain-with-ibm-bluemix-devops-services/>. It is available already in Bluemix public US-South as an experiment.
7,854,962
My model has me getting data from a TCP connection and then sending a command to an NServiceBus "Hub" service. (That Hub will publish the data to all subscribers.) The TCP connection needs an ACK (acknowledgment) that I got the message (or it will re-send it). Before I ACK the TCP message, I would like to know that NS...
2011/10/21
[ "https://Stackoverflow.com/questions/7854962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16241/" ]
You can manually add a central database (accessible from both clients) and maintain the status of the messages. Say like if u send message from one client, just add a row in the central database. Then on receiving the message at second client, update that row to acknowledge that the message has been received.
If you use transactional NServiceBus you can pretty much know that the message will be successfully delivered. This is the case even if the hub service is offline, as the messages will queue up in a durable fashion waiting to be delivered. For this reason, waiting some kind of ACK from the service can actually be cou...
1,309,431
I have a badly scratched CD whose content cannot be copied to the hard disk. My OS is Windows 7 Ultimate x64. Windows can’t copy the 750 MB video file. It can be played by VLC Media Player, but when I try to copy it, it copies to 6% and then just stops. How I can copy my file?
2018/03/30
[ "https://superuser.com/questions/1309431", "https://superuser.com", "https://superuser.com/users/889476/" ]
If you can play it on VLC - you can use it to dump out the contents. It's slightly well hidden, but go to media, then convert/save. [![enter image description here](https://i.stack.imgur.com/tS7D6m.png)](https://i.stack.imgur.com/tS7D6m.png) You need to pick the file with this menu *or* use the disk option if it's a ...
If the top of the CD is scratched, it’s done for. If not, the cheapest thing you can try is to get some plain white toothpaste and rub it on the underside of the CD from the center out towards the edge. Do this around the CD a few times until the CD is coated. Let it dry and rinse it off. If it is really badly scratche...
11,335,547
I have two Scenes in my Storyboard that are nearly identical. Both are UITableViewControllers. Both have header and footer views. The header views have a UISearchBar and the footer views have a UIView that contains a UITextField. Each have only one prototype cell. One is prototyped as a "Basic" cell and the other is pr...
2012/07/04
[ "https://Stackoverflow.com/questions/11335547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/177962/" ]
I thought this problem was caused by copy-and-pasting from one view to another, but I had the same problem once I'd (in theory) fixed it. The answer for me turned out to be simple: I hadn't called `[super viewWillAppear:animated]` in my UITableViewController subclass' `viewWillAppear:` implementation. Make sure you've...
I am guessing the frame of the tableview is not being resized to the smaller size in the second case. Print out the frame and content sizes in both the cases once its loaded, that should help you see if there is an issue.
48,284
In the United States, what is the common way junior faculty address senior faculty in the same department or different department? 1. Hi First or Last name 2. Hi Dr \_\_\_ 3. Dear Dr \_\_ 4. Dear Doctor \_\_\_ 5. Dear Prof. \_\_\_ 6. Dear Professor \_\_\_ 7. No greetings, start the topic directly.
2015/07/04
[ "https://academia.stackexchange.com/questions/48284", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/24823/" ]
In my experience in the United States, most professors invite even their graduate students to call them by their given (first) name. Junior faculty would be no less invited to familiar address. Whether you say "Hi, Name" or just dive into communication is often a matter of personal style and communication medium---for ...
You would have to clarify what *types of addressing* you're talking about: conversational (casual and official), written (casual and official) or both. This is, because I believe that there are significant differences in addressing, based on this factor. There are most likely *other potential factors*, including geogra...
48,284
In the United States, what is the common way junior faculty address senior faculty in the same department or different department? 1. Hi First or Last name 2. Hi Dr \_\_\_ 3. Dear Dr \_\_ 4. Dear Doctor \_\_\_ 5. Dear Prof. \_\_\_ 6. Dear Professor \_\_\_ 7. No greetings, start the topic directly.
2015/07/04
[ "https://academia.stackexchange.com/questions/48284", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/24823/" ]
An advice and manners column I once read suggested you start (as in, you have no real history with this person, and you've had little communication before this point) written communications off formally—the Professor title is superior to, and trumps, the doctor title, for the record— and then from there address them in...
You would have to clarify what *types of addressing* you're talking about: conversational (casual and official), written (casual and official) or both. This is, because I believe that there are significant differences in addressing, based on this factor. There are most likely *other potential factors*, including geogra...
48,284
In the United States, what is the common way junior faculty address senior faculty in the same department or different department? 1. Hi First or Last name 2. Hi Dr \_\_\_ 3. Dear Dr \_\_ 4. Dear Doctor \_\_\_ 5. Dear Prof. \_\_\_ 6. Dear Professor \_\_\_ 7. No greetings, start the topic directly.
2015/07/04
[ "https://academia.stackexchange.com/questions/48284", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/24823/" ]
In my experience in the United States, most professors invite even their graduate students to call them by their given (first) name. Junior faculty would be no less invited to familiar address. Whether you say "Hi, Name" or just dive into communication is often a matter of personal style and communication medium---for ...
If I'm asking the Chair what she's bringing to the department potluck, it's "Dear Jane" but if I'm asking for additional research funds or trying to get out of committee duty, it's "Dear Prof. Doe" or "Dear Chair Doe" depending on how much I'm trying to suck up. The more interesting question is how you address the pro...
48,284
In the United States, what is the common way junior faculty address senior faculty in the same department or different department? 1. Hi First or Last name 2. Hi Dr \_\_\_ 3. Dear Dr \_\_ 4. Dear Doctor \_\_\_ 5. Dear Prof. \_\_\_ 6. Dear Professor \_\_\_ 7. No greetings, start the topic directly.
2015/07/04
[ "https://academia.stackexchange.com/questions/48284", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/24823/" ]
In my experience in the United States, most professors invite even their graduate students to call them by their given (first) name. Junior faculty would be no less invited to familiar address. Whether you say "Hi, Name" or just dive into communication is often a matter of personal style and communication medium---for ...
An advice and manners column I once read suggested you start (as in, you have no real history with this person, and you've had little communication before this point) written communications off formally—the Professor title is superior to, and trumps, the doctor title, for the record— and then from there address them in...
48,284
In the United States, what is the common way junior faculty address senior faculty in the same department or different department? 1. Hi First or Last name 2. Hi Dr \_\_\_ 3. Dear Dr \_\_ 4. Dear Doctor \_\_\_ 5. Dear Prof. \_\_\_ 6. Dear Professor \_\_\_ 7. No greetings, start the topic directly.
2015/07/04
[ "https://academia.stackexchange.com/questions/48284", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/24823/" ]
An advice and manners column I once read suggested you start (as in, you have no real history with this person, and you've had little communication before this point) written communications off formally—the Professor title is superior to, and trumps, the doctor title, for the record— and then from there address them in...
If I'm asking the Chair what she's bringing to the department potluck, it's "Dear Jane" but if I'm asking for additional research funds or trying to get out of committee duty, it's "Dear Prof. Doe" or "Dear Chair Doe" depending on how much I'm trying to suck up. The more interesting question is how you address the pro...
53,032,397
The array oldData [] holds 6 values. (integer values fetched from api). All I want to do is put these values in 1 localStorage key called 'olddata'. I've searched everywhere and didn't find anything that make this work. Could please someone help me with a simple solution? The way I'm trying now: ``` let oldD...
2018/10/28
[ "https://Stackoverflow.com/questions/53032397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10530603/" ]
`localStorage` only stores strings. Use `JSON.stringify()` to set an array as string and `JSON.parse()` to parse that same string back to array when you retrieve the data ``` localStorage.setItem('olddata', JSON.stringify(oldData)); ```
``` let url = 'https://datatank.stad.gent/4/mobiliteit/bezettingparkingsrealtime.json#'; let percent; let mainDiv = document.getElementById('mainDiv'); function fetchParkingData() { fetch(url) .then((resp) => resp.json()) .then(function(data) { mainDiv.innerHTML = ""; for(let i = 0; i < data.length; i++) { ...
53,032,397
The array oldData [] holds 6 values. (integer values fetched from api). All I want to do is put these values in 1 localStorage key called 'olddata'. I've searched everywhere and didn't find anything that make this work. Could please someone help me with a simple solution? The way I'm trying now: ``` let oldD...
2018/10/28
[ "https://Stackoverflow.com/questions/53032397", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10530603/" ]
`localStorage` only stores strings. Use `JSON.stringify()` to set an array as string and `JSON.parse()` to parse that same string back to array when you retrieve the data ``` localStorage.setItem('olddata', JSON.stringify(oldData)); ```
Browser console commands and output here: ``` >let oldData = []; undefined >oldData.push('1st Value'); 1 >oldData.push('2nd Value'); 2 >oldData.push('3rd Value'); 3 >console.log(oldData); (3) ["1st Value", "2nd Value", "3rd Value"] undefined >localStorage.setItem('oldData', JSON.stringify(oldData)); undefined >JSON.pa...
13,064,057
How to identify the running Internet Explorer Versions which is IE7,IE8 or IE9. According to this, I need to call the css styles using the java script function. Please write that javascript code. Help me
2012/10/25
[ "https://Stackoverflow.com/questions/13064057", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1407662/" ]
If your objective is purely to include specific stylesheets for specific versions of Internet Explorer, you want to use conditional includes: **HTML** ``` <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="ie8.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="ie7.css"> <...
Usually detecting features is the best thing, but a fairly good point in this special case is detecting the existence of conditional comments, which are supported by IE only. Here's what I usually do: ``` var div = document.createElement("div"), IE; div.innerHTML = "<!--[if IE 5]>5<![endif]--><!--[if IE 5.0]>5.0<![en...
40,575,108
My Task is a simple Boolean Calculator -------------------------------------- I want to make a simple boolean calculator, which uses OR, AND, NAND and XOR. This is what it has to do: If the user enters a string starting with `q` (like `quit`) at any time, the program should immediately exit. If the user enters a stri...
2016/11/13
[ "https://Stackoverflow.com/questions/40575108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7153148/" ]
This is because, you're supplying *syntactical nonsense* to the compiler, so it is free to do whatever it wants. Related reading, [undefined behavior](https://en.wikipedia.org/wiki/Undefined_behavior). Compile your code with warnings enabled and it will tell you something like > > warning: unknown conversion type ch...
In complement of [Sourav Ghosh's answer](https://stackoverflow.com/a/40575199/841108); an important notion is that of [**undefined behavior**](https://en.wikipedia.org/wiki/Undefined_behavior), which is tricky. Be sure to read Lattner's blog: [*What Every C Programmer Should Know About Undefined Behavior*](http://blog....
40,575,108
My Task is a simple Boolean Calculator -------------------------------------- I want to make a simple boolean calculator, which uses OR, AND, NAND and XOR. This is what it has to do: If the user enters a string starting with `q` (like `quit`) at any time, the program should immediately exit. If the user enters a stri...
2016/11/13
[ "https://Stackoverflow.com/questions/40575108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7153148/" ]
This is because, you're supplying *syntactical nonsense* to the compiler, so it is free to do whatever it wants. Related reading, [undefined behavior](https://en.wikipedia.org/wiki/Undefined_behavior). Compile your code with warnings enabled and it will tell you something like > > warning: unknown conversion type ch...
Your `printf` format is incorrect: the flags must precede the width specifier. After it handles `*` as the width specifier, `printf` expects either a `.` or a length modifier or a conversion specifier, `0` being none of these, the behavior is undefined. Your library's implementation of `printf` does something bizarr...
51,165,653
I'm using `Xampp` server to access my video file and then play it on my website. I'm using a `XMLHttpRequest` to obtain the video file and then put it as the source of the video player. But I'm getting an error. I have tried to solve the problem by inserting `Header set Access-Control-Allow-Origin "*"` but I'm still no...
2018/07/04
[ "https://Stackoverflow.com/questions/51165653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9661373/" ]
First of all, if you are using `withCredentials` then wildcard `*` can not be used as a value for `Access-Control-Allow-Origin`. You must set the host address of your website instead of `*`. Second reason is `Origin` being null, which means the web page is not served by actual server as mentioned in comments by Jaramon...
Use attribute in video element crossorigin and set its value to anonymous: ``` document.getElementById("videoPlayer").setAttribute("crossorigin", "anonymous"); ```
51,165,653
I'm using `Xampp` server to access my video file and then play it on my website. I'm using a `XMLHttpRequest` to obtain the video file and then put it as the source of the video player. But I'm getting an error. I have tried to solve the problem by inserting `Header set Access-Control-Allow-Origin "*"` but I'm still no...
2018/07/04
[ "https://Stackoverflow.com/questions/51165653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9661373/" ]
First of all, if you are using `withCredentials` then wildcard `*` can not be used as a value for `Access-Control-Allow-Origin`. You must set the host address of your website instead of `*`. Second reason is `Origin` being null, which means the web page is not served by actual server as mentioned in comments by Jaramon...
Try to enable it by php ``` header("Access-Control-Allow-Origin: *"); ```
51,165,653
I'm using `Xampp` server to access my video file and then play it on my website. I'm using a `XMLHttpRequest` to obtain the video file and then put it as the source of the video player. But I'm getting an error. I have tried to solve the problem by inserting `Header set Access-Control-Allow-Origin "*"` but I'm still no...
2018/07/04
[ "https://Stackoverflow.com/questions/51165653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9661373/" ]
First of all, if you are using `withCredentials` then wildcard `*` can not be used as a value for `Access-Control-Allow-Origin`. You must set the host address of your website instead of `*`. Second reason is `Origin` being null, which means the web page is not served by actual server as mentioned in comments by Jaramon...
create blob url from arraybuffer like this window.URL = window.URL || window.webkitURL request\_xhr(url, function (buffer) { video\_player.src = window.URL.createObjectURL(new Blob([new Uint8Array(buffer)])); });
255,223
I made 6 different sensors , unfortunately they are separate designs, and it cots more for production as well. I tested the prototypes and everything is working perfectly. So i dont want to change the component locations and traces. Is there any simple way to put all those PCB files to one design as single PCB? I tr...
2016/08/31
[ "https://electronics.stackexchange.com/questions/255223", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/120301/" ]
You can combine designs onto a single board. In the board editor, you can create a new board without an attached schematic -- and then copy all the separate layouts into this combined board. It is *not* necessary to copy all the schematics into a single schematic file. One problem that occurs is that EAGLE will chang...
Export gerbers for the individual boards, then use gerbmerge to generate a combined set of Gerber files.
7,044,836
Is possible to order on Linq according to a specific order? something like ``` List<bbHeader> bb = new List<bbHeader>(); bb.OrderBy(x => x.Country.CompareTo(new string[]{"AR","CL","PY","UY","AUP"})); ``` The idea is that the Country field is ordered according to the specific order of the string
2011/08/12
[ "https://Stackoverflow.com/questions/7044836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/561915/" ]
There's a very direct way in your example: ``` var sequence = new [] { "AR", "CL", "PY", "UY", "AUP" }; List<bbHeader> bb = new List<bbHeadher>(); // fill bb // takes the item, checks the index of the country in the array var result = bb.OrderBy(x => Array.IndexOf(sequence, x.Country)); ``` In this way, you are o...
well you can pass in your own delegate to orderby function and the comparison logic in that case can be defined by you.
8,665,899
In Wicket 1.4, I had a custom AbstractResourceStreamWriter (used in a custom kind of Link for streaming a file that gets generated on the fly): ``` private AbstractResourceStreamWriter resourceStreamWriter() { return new AbstractResourceStreamWriter() { @Override public void write(OutputStream outp...
2011/12/29
[ "https://Stackoverflow.com/questions/8665899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/56285/" ]
What about ``` ByteArrayOutputStream baos = new ByteArrayOutputStream(); reportService.generateReport(baos, report); response.write(baos.toByteArray()); ``` or something similar?
There is a org.apache.wicket.request.Response#getOutputStream(). But again I'm not sure this is the same as in 1.4.x. In 1.5 this will buffer what you write in the output stream. Where the javadoc says it shouldn't be buffered.
119,448
I am working on a hot topic of research in a subfield, and I am possibly going to cooperate with a senior research scientist who is interested in this topic specifically. However, during our discussion, he mentioned that all research that has been done up to this point are rubbish, which, to be honest, may be correct. ...
2018/11/02
[ "https://academia.stackexchange.com/questions/119448", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/100144/" ]
Dismissal of previous research in the field is not problematic in itself. As you concede in the question, you may even share this assessment. The possible problem, which you can't really assess from one general comment like this, is whether the researcher lets that opinion drive his research in inappropriate ways. I'd ...
Like others, I would say it's just a single data point. Also look at if the guy is a hype scientist or domineering with advisees. Ask his students how he is and ask a few students outside his group but at his department. If he's a bad guy, you will find more smoke. You might also see how you click with the guy. I like...
316,105
When doing some installations I change the 'HISTFILE' variable to a different file to record the commands used. Now I want to use the `history` command to display them just like with the `history` command which defaults to using the `.bash_history` file. What option should be passed to the `history` command? When I tr...
2016/10/13
[ "https://unix.stackexchange.com/questions/316105", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/26026/" ]
The [`history`](https://www.gnu.org/software/bash/manual/bashref.html#index-history) command never operates on a file, only on its in-memory history list. You can only read (`r`), write (`-w`), and append (`-a`) that list to or from a file, and then access or manipulate the in-memory list. Reading from a file will repl...
The current `history` for your current shell is stored in memory, it is only written to the HISTFILE once the shell is exited. You can cause this to happen before you exit the shell with `history -a`. There are also arguments to read the contents of a file into the current history etc. Essentially it's a RTFM :-) So ...
61,129,917
A strange behavior prevents me from setting white color for an HTML input element's background color (background property) in Mozilla Firefox (it switches to a yellow color). Other colors works fine (black, green). Does anybody know why? [![enter image description here](https://i.stack.imgur.com/oXJFk.png)](https://i.s...
2020/04/09
[ "https://Stackoverflow.com/questions/61129917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9343948/" ]
In your example the background in perfectly white. I think, there is some other code, that affects your input. Try to make it more specific using the ID **#username**. Or, you can use !important rule. **UPDATED** Added the third way. It may be an autocomplete background of browther. Try the code below. ```css inpu...
UPDATE ------ > > the code listed bellow is not necessary as mentioned in the comments. however refreshing cache helped as the problem came of autocomplete. > > > OLD --- **Use `background-color: white;`** and not `Background: white;` ``` input[type=text] { width: 100%; padding: 12px 20px; margi...
60,671,984
I have a data frame similar to this: ``` > var1<-c("01","01","01","02","02","02","03","03","03","04","04","04") > var2<-c("0","4","6","8","3","2","5","5","7","7","8","9") > var3<-c("07","41","60","81","38","22","51","53","71","72","84","97") > var4<-c("107","241","360","181","238","222","351","453","171","372","684","...
2020/03/13
[ "https://Stackoverflow.com/questions/60671984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9370570/" ]
This happens because the Vert.x's event loop is blocked for more than 2 seconds, which is configurable. You can change this using following parameter: `quarkus.vertx.max-event-loop-execute-time`
Your long-running file upload blocks the event loop (at the core of Quarkus) and you should not block the event-loop thread. You can follow [this guide](https://quarkus.io/guides/rest-client-multipart) to use multipart-form file uploads and then, on your REST resource, implement something as follows: ``` @POST @C...
14,782,545
Please I have to made a small calculus using mysqli and php, and to return a float or a double value, so I've tried : ``` $notes = mysclass_sql::query("SELECT SUM(commentsNote) / COUNT(*) as c FROM comments ")->fetch_object()->c; return round( $notes , 2) ; ``` But this returns me a value li...
2013/02/08
[ "https://Stackoverflow.com/questions/14782545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1559716/" ]
As tesdal already said in the comments, the development server is single threaded. That means that it can only handle one request at a time. So if you launch a request to a script, and that script urlfetches a page at your own server,, you're basically in a deadlock, because your original request is waiting for your ur...
You can set a deadline for a request, the most amount of time the service will wait for a response. By default, the deadline for a fetch is 5 seconds. The maximum deadline is 60 seconds for HTTP requests and 60 seconds for task queue and cron job requests. ``` result = urlfetch( url=http://localdomain:8080/static/tabc...
32,557,771
folks, my set(T f) has to change the current `this.element` of the my 2D Arraylist but it's not doing this. For example, if I have this: ``` Board<Object> board = new Board<Object>(3,9,2,6,"??"); System.out.println(board.toString()); board.setFillElem("."); System.out.println(board); ``` The outputs are: ``` | ...
2015/09/14
[ "https://Stackoverflow.com/questions/32557771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
It thinks that the braces are part of the parameter substitution since it follows a dollar sign, and "$1..3" is an invalid variable name. Try "${@:1:3}" instead.
[Ignacio's answer](https://stackoverflow.com/a/32557798/12274) is the right way to do, but here's a bit more detail about how to make it work the way you started it. You'd have liked `${1..3}` to expand to `$1 $2 $3`. We can't concatenate `$` and `{1..3}` and have it work, or bash will interpret it as a parameter expa...
6,791,184
I have an XML File that looks like this: ``` <?xml version='1.0' encoding='UTF-8' standalone='yes' ?> <allinfo> <filepath>/mnt/sdcard/Audio_Recorder/</filepath> <filename>newxml35500.3gp</filename> <annotation> <file>newxml35500.3gp</file> <timestamp>0:05</timestamp> <note>uuuouou</note> </annotati...
2011/07/22
[ "https://Stackoverflow.com/questions/6791184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/817559/" ]
This works: ``` final DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); final Document document = documentBuilder.parse(new ByteArrayInputStream("<foo><bar/></foo>".getBytes("UTF-8"))); final Element documentElement = document.getDocumentElement(); documentEle...
Load the file contents into a String and use Regex and String operations to perform the insertion. ``` String xml = "<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>" + "<allinfo>" + "<filepath>/mnt/sdcard/Audio_Recorder/</filepath>" + "..."; // String xml = loadFromFile(); Pattern p = Pattern.com...
33,036
I've fitted a lognormal model using R with a set of data. The resulting parameters were: ``` meanlog = 4.2991610 sdlog = 0.5511349 ``` I'd like to transfer this model to Scipy, which I've never used before. Using Scipy, I was able to get a shape and scale of 1 and 3.1626716539637488e+90 -- very different numbers. I...
2012/07/25
[ "https://stats.stackexchange.com/questions/33036", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/9560/" ]
Scipy lognormal fit returns shape, location, and scale. I just ran the following on an array of sample price data: ``` shape, loc, scale = st.lognorm.fit(d_in["price"]) ``` This gives me reasonable estimates 1.0, 0.09, 0.86, and when you plot it, you should take into account all three parameters. The shape paramete...
Seems like the distribution in Scipy for the lognormal is not the same as in R, or generally, not the same as the distribution I am familiar with. John D Cook has touched on this: <http://www.johndcook.com/blog/2010/02/03/statistical-distributions-in-scipy/> http://www.johndcook.com/distributions\_scipy.html However, ...
33,036
I've fitted a lognormal model using R with a set of data. The resulting parameters were: ``` meanlog = 4.2991610 sdlog = 0.5511349 ``` I'd like to transfer this model to Scipy, which I've never used before. Using Scipy, I was able to get a shape and scale of 1 and 3.1626716539637488e+90 -- very different numbers. I...
2012/07/25
[ "https://stats.stackexchange.com/questions/33036", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/9560/" ]
I fought my way through the source code, to arrive at the following interpretation of the scipy lognormal routine. $\frac{x-\text{loc}}{\text{scale}} \sim \text{Lognormal}(\sigma)$ where $\sigma$ is the "shape" parameter. The equivalence between scipy parameters and R parameter is as follows: loc - No equivalent, t...
Scipy lognormal fit returns shape, location, and scale. I just ran the following on an array of sample price data: ``` shape, loc, scale = st.lognorm.fit(d_in["price"]) ``` This gives me reasonable estimates 1.0, 0.09, 0.86, and when you plot it, you should take into account all three parameters. The shape paramete...
33,036
I've fitted a lognormal model using R with a set of data. The resulting parameters were: ``` meanlog = 4.2991610 sdlog = 0.5511349 ``` I'd like to transfer this model to Scipy, which I've never used before. Using Scipy, I was able to get a shape and scale of 1 and 3.1626716539637488e+90 -- very different numbers. I...
2012/07/25
[ "https://stats.stackexchange.com/questions/33036", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/9560/" ]
The lognormal distribution in SciPy fits in to the general framework for *all* distributions in SciPy. They all have a scale and location keyword (which default to 0 and 1 if not explicitly provided). This allows all distributions to be shifted and scaled from their normalized specification with clear implications to t...
Scipy lognormal fit returns shape, location, and scale. I just ran the following on an array of sample price data: ``` shape, loc, scale = st.lognorm.fit(d_in["price"]) ``` This gives me reasonable estimates 1.0, 0.09, 0.86, and when you plot it, you should take into account all three parameters. The shape paramete...
33,036
I've fitted a lognormal model using R with a set of data. The resulting parameters were: ``` meanlog = 4.2991610 sdlog = 0.5511349 ``` I'd like to transfer this model to Scipy, which I've never used before. Using Scipy, I was able to get a shape and scale of 1 and 3.1626716539637488e+90 -- very different numbers. I...
2012/07/25
[ "https://stats.stackexchange.com/questions/33036", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/9560/" ]
I fought my way through the source code, to arrive at the following interpretation of the scipy lognormal routine. $\frac{x-\text{loc}}{\text{scale}} \sim \text{Lognormal}(\sigma)$ where $\sigma$ is the "shape" parameter. The equivalence between scipy parameters and R parameter is as follows: loc - No equivalent, t...
Seems like the distribution in Scipy for the lognormal is not the same as in R, or generally, not the same as the distribution I am familiar with. John D Cook has touched on this: <http://www.johndcook.com/blog/2010/02/03/statistical-distributions-in-scipy/> http://www.johndcook.com/distributions\_scipy.html However, ...
33,036
I've fitted a lognormal model using R with a set of data. The resulting parameters were: ``` meanlog = 4.2991610 sdlog = 0.5511349 ``` I'd like to transfer this model to Scipy, which I've never used before. Using Scipy, I was able to get a shape and scale of 1 and 3.1626716539637488e+90 -- very different numbers. I...
2012/07/25
[ "https://stats.stackexchange.com/questions/33036", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/9560/" ]
The lognormal distribution in SciPy fits in to the general framework for *all* distributions in SciPy. They all have a scale and location keyword (which default to 0 and 1 if not explicitly provided). This allows all distributions to be shifted and scaled from their normalized specification with clear implications to t...
Seems like the distribution in Scipy for the lognormal is not the same as in R, or generally, not the same as the distribution I am familiar with. John D Cook has touched on this: <http://www.johndcook.com/blog/2010/02/03/statistical-distributions-in-scipy/> http://www.johndcook.com/distributions\_scipy.html However, ...
33,036
I've fitted a lognormal model using R with a set of data. The resulting parameters were: ``` meanlog = 4.2991610 sdlog = 0.5511349 ``` I'd like to transfer this model to Scipy, which I've never used before. Using Scipy, I was able to get a shape and scale of 1 and 3.1626716539637488e+90 -- very different numbers. I...
2012/07/25
[ "https://stats.stackexchange.com/questions/33036", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/9560/" ]
I fought my way through the source code, to arrive at the following interpretation of the scipy lognormal routine. $\frac{x-\text{loc}}{\text{scale}} \sim \text{Lognormal}(\sigma)$ where $\sigma$ is the "shape" parameter. The equivalence between scipy parameters and R parameter is as follows: loc - No equivalent, t...
The lognormal distribution in SciPy fits in to the general framework for *all* distributions in SciPy. They all have a scale and location keyword (which default to 0 and 1 if not explicitly provided). This allows all distributions to be shifted and scaled from their normalized specification with clear implications to t...
56,530,298
I am trying to emulate a terminal in html/css/javascript in a Vuejs app. For that I am using a textarea. The user is not supposed to click on a previous line and update or delete the text. So is it possible to prevent user click in the textarea and only allow keyboard actions ?
2019/06/10
[ "https://Stackoverflow.com/questions/56530298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10053839/" ]
[Codepen](https://codepen.io/ya3ya6/pen/gNYyGZ) You can just prevent default onmousedown event on textarea: ``` document.getElementById('textarea').onmousedown = function(e){ e.preventDefault(); } ```
you can simply use the css-only solution: ``` <textarea unselectable="on" id="my_textarea"></textarea> ``` ``` *.unselectable { -webkit-user-select: none; } ```
56,530,298
I am trying to emulate a terminal in html/css/javascript in a Vuejs app. For that I am using a textarea. The user is not supposed to click on a previous line and update or delete the text. So is it possible to prevent user click in the textarea and only allow keyboard actions ?
2019/06/10
[ "https://Stackoverflow.com/questions/56530298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10053839/" ]
[Codepen](https://codepen.io/ya3ya6/pen/gNYyGZ) You can just prevent default onmousedown event on textarea: ``` document.getElementById('textarea').onmousedown = function(e){ e.preventDefault(); } ```
Add the [`disabled`](https://www.w3schools.com/tags/att_disabled.asp) attribute to your `<textarea>` tag, like this: ``` <textarea disabled="disabled"></textarea> ```
56,530,298
I am trying to emulate a terminal in html/css/javascript in a Vuejs app. For that I am using a textarea. The user is not supposed to click on a previous line and update or delete the text. So is it possible to prevent user click in the textarea and only allow keyboard actions ?
2019/06/10
[ "https://Stackoverflow.com/questions/56530298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10053839/" ]
[Codepen](https://codepen.io/ya3ya6/pen/gNYyGZ) You can just prevent default onmousedown event on textarea: ``` document.getElementById('textarea').onmousedown = function(e){ e.preventDefault(); } ```
Yes It is Possible u can disable the textarea and u can set readonly also **Textarea with disabled** ```html <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <h1>This is textarea with disabled</h1> <textarea rows="10" cols="50" disabled> dsdkiensdsndsjdnjnjdndjsndajndasjdnasjd </text...
56,530,298
I am trying to emulate a terminal in html/css/javascript in a Vuejs app. For that I am using a textarea. The user is not supposed to click on a previous line and update or delete the text. So is it possible to prevent user click in the textarea and only allow keyboard actions ?
2019/06/10
[ "https://Stackoverflow.com/questions/56530298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10053839/" ]
[Codepen](https://codepen.io/ya3ya6/pen/gNYyGZ) You can just prevent default onmousedown event on textarea: ``` document.getElementById('textarea').onmousedown = function(e){ e.preventDefault(); } ```
You can use the `readonly` attribute in your HTML markup. **Working Example:** ```html <textarea readonly> Here is some sample text. </textarea> ```
56,530,298
I am trying to emulate a terminal in html/css/javascript in a Vuejs app. For that I am using a textarea. The user is not supposed to click on a previous line and update or delete the text. So is it possible to prevent user click in the textarea and only allow keyboard actions ?
2019/06/10
[ "https://Stackoverflow.com/questions/56530298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10053839/" ]
Add the [`disabled`](https://www.w3schools.com/tags/att_disabled.asp) attribute to your `<textarea>` tag, like this: ``` <textarea disabled="disabled"></textarea> ```
you can simply use the css-only solution: ``` <textarea unselectable="on" id="my_textarea"></textarea> ``` ``` *.unselectable { -webkit-user-select: none; } ```
56,530,298
I am trying to emulate a terminal in html/css/javascript in a Vuejs app. For that I am using a textarea. The user is not supposed to click on a previous line and update or delete the text. So is it possible to prevent user click in the textarea and only allow keyboard actions ?
2019/06/10
[ "https://Stackoverflow.com/questions/56530298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10053839/" ]
Yes It is Possible u can disable the textarea and u can set readonly also **Textarea with disabled** ```html <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <h1>This is textarea with disabled</h1> <textarea rows="10" cols="50" disabled> dsdkiensdsndsjdnjnjdndjsndajndasjdnasjd </text...
you can simply use the css-only solution: ``` <textarea unselectable="on" id="my_textarea"></textarea> ``` ``` *.unselectable { -webkit-user-select: none; } ```
56,530,298
I am trying to emulate a terminal in html/css/javascript in a Vuejs app. For that I am using a textarea. The user is not supposed to click on a previous line and update or delete the text. So is it possible to prevent user click in the textarea and only allow keyboard actions ?
2019/06/10
[ "https://Stackoverflow.com/questions/56530298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10053839/" ]
Add the [`disabled`](https://www.w3schools.com/tags/att_disabled.asp) attribute to your `<textarea>` tag, like this: ``` <textarea disabled="disabled"></textarea> ```
You can use the `readonly` attribute in your HTML markup. **Working Example:** ```html <textarea readonly> Here is some sample text. </textarea> ```
56,530,298
I am trying to emulate a terminal in html/css/javascript in a Vuejs app. For that I am using a textarea. The user is not supposed to click on a previous line and update or delete the text. So is it possible to prevent user click in the textarea and only allow keyboard actions ?
2019/06/10
[ "https://Stackoverflow.com/questions/56530298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10053839/" ]
Yes It is Possible u can disable the textarea and u can set readonly also **Textarea with disabled** ```html <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <h1>This is textarea with disabled</h1> <textarea rows="10" cols="50" disabled> dsdkiensdsndsjdnjnjdndjsndajndasjdnasjd </text...
You can use the `readonly` attribute in your HTML markup. **Working Example:** ```html <textarea readonly> Here is some sample text. </textarea> ```
44,156,527
I m just creating the random number using below code ``` var number = Math.floor(Math.random()*90)+100; ``` But this gives me the two numbers has same numbers in between execution of this code. Is there any way that i can generate unique random number where `no two numbers will be the same` . Any ideas Please . Tha...
2017/05/24
[ "https://Stackoverflow.com/questions/44156527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5367683/" ]
To flat out answer your question, you can use: ``` while(randomLetters.length > 0){ ``` Then when you use a letter from randomLetters, you delete the letter and the length is now 1 less.
This will be enough for you: ```js const randomLetters = "ljhgfdza"; const returnRandom = (randomString) => { const arrString = [...randomString].sort((a, b) =>{ return 0.5 - Math.random() }).join(""); console.log(typeof arrString,arrString); } returnRandom(randomLetters); ``` but... in this case `so...
312,842
I recently acquired [Frost](http://elderscrolls.wikia.com/wiki/Frost_(Horse)) after: > > Successfully persuading Louis Letrush at the end of [Promises to Keep](http://elderscrolls.wikia.com/wiki/Promises_to_Keep). > > > This is my first horse, and it got me wondering about what exactly the benefits are to keeping...
2017/07/10
[ "https://gaming.stackexchange.com/questions/312842", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/82710/" ]
Your linked answer has almost all of the benefits, but it is missing one that I recently discovered. If you dismount the horse while in deep water, and re-mount, your horse can run across the water at full speed. It's great for crossing large bodies of water. There is simply no other way to get this kind of speed.
Because of the way Skyrim physics works, horses are able to climb mountains like they're nothing, which makes travelling much easier. However, other than that, they provide little benefit. You cannot sell them, your companion can't ride them, and they're not useful in battle either.
20,266,200
I'm having trouble getting a custom, non-websafe font to work in Firefox. I have it working in Chrome, Opera and Safari using the following code: ``` @import url(http://fonts.googleapis.com/css?family=Antic+Slab); @font-face { font-family: 'BadgerFont'; src: url('http://www.vectorthatfox.co.uk/badgerandkingdom/fonts...
2013/11/28
[ "https://Stackoverflow.com/questions/20266200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1636130/" ]
By default, Firefox will only accept relative links. Firefox (which supports `@font-face` from v3.5) does not allow cross-domain fonts by default. This means the font must be served up from the same domain (and sub-domain) unless you can add an “Access-Control-Allow-Origin” header to the font. Or, just load the font s...
You should learn to use your developer tools in Firefox. Fifth console message is this: `[08:28:41.886] Unrecognized at-rule or error parsing at-rule '@import'. @ http://cdn.bigcartel.com/theme_stylesheets/19013562/2771282761/theme.css:474` From [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/@import): > >...
18,211,462
I try this: ``` $path = $_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI']; $image = imagecreatefromstring(file_get_contents($path)); $w = imagesx($image); $h = imagesy($image); $centerX=round($w/4); $centerY=round($h/2); $watermark = imagecreatefrompng('lool-face.png'); $ww = imagesx($watermark); $wh = imagesy($wat...
2013/08/13
[ "https://Stackoverflow.com/questions/18211462", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2641125/" ]
Here is command I used initially: ``` nunit-console /framework:net-4.0 /run:NUnit_Application.Test.TestClass.AddTest C:~\NUnit_Application\NUnit_Application\NUnit_Application.Test\bin\Debug\NUnit_Application.Test.dll /include:"MathA" ``` I noticed if I just call TestClass and not the individual test case, it works:...
I think it's because you have the whole class with the attribute : ``` [Category("MathS")] ``` So it skips over it.
29,671,070
I am using `DrawerLayout` which has `Listview` When I click on the `Listview` item , it does not responds to the click ( not launching another activity ) ``` protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); //requestWindowFeature(...
2015/04/16
[ "https://Stackoverflow.com/questions/29671070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4432176/" ]
The better approach is to first compress your image using [Image Compress Library Here](https://github.com/IcaliaLabs/UIImage-ImageCompress) and then upload it using and Networking library Liek AF Networking or you can also send it using NSUrlConnection. AFNetworking is easy to use. You can visit [this page](https://gi...
The easiest way for you from my point of view would be to use [AFNetworking](https://github.com/AFNetworking/AFNetworking). It'll send the image to a php page, then on the server, you build and save the image with the data sent. [Here's](http://samwize.com/2014/05/10/tutorial-on-using-afnetworking-2-dot-0/) a basic t...
29,671,070
I am using `DrawerLayout` which has `Listview` When I click on the `Listview` item , it does not responds to the click ( not launching another activity ) ``` protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); //requestWindowFeature(...
2015/04/16
[ "https://Stackoverflow.com/questions/29671070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4432176/" ]
The better approach is to first compress your image using [Image Compress Library Here](https://github.com/IcaliaLabs/UIImage-ImageCompress) and then upload it using and Networking library Liek AF Networking or you can also send it using NSUrlConnection. AFNetworking is easy to use. You can visit [this page](https://gi...
For this you can do something like this by using [ASIHTTPRequest](https://github.com/pokeb/asi-http-request) ``` NSURL *strUrl = [NSURL URLWithString:[NSString stringWithFormat:@"%@?action=youraction",serverUrl]]; ASIFormDataRequest *request; request = [[[ASIFormDataRequest alloc] initWithURL:strUrl] autorelease]; [re...
29,671,070
I am using `DrawerLayout` which has `Listview` When I click on the `Listview` item , it does not responds to the click ( not launching another activity ) ``` protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); //requestWindowFeature(...
2015/04/16
[ "https://Stackoverflow.com/questions/29671070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4432176/" ]
The better approach is to first compress your image using [Image Compress Library Here](https://github.com/IcaliaLabs/UIImage-ImageCompress) and then upload it using and Networking library Liek AF Networking or you can also send it using NSUrlConnection. AFNetworking is easy to use. You can visit [this page](https://gi...
Use NSURLConnection, make sure that you convert images to NSData user\_id and key there are parameters. ``` NSURL *URL = [NSURL URLWithString:constFileUploadURL]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL]; [request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData]; [request setHTTP...
46,885
I've got a laptop with 2 USB 2.0 and 1 USB 3.0 ports and I would like to know how many USB hard drives I could plug into it. Is there a hard limit in the Linux kernel? On the performance side, what is the speed shared across the drives plugged into the port?
2011/06/04
[ "https://askubuntu.com/questions/46885", "https://askubuntu.com", "https://askubuntu.com/users/17702/" ]
Theoretically you can have up to 127 devices connected to one host PC but there are practical power and data bandwidth limitations that would prevent that. These 127 devices can be arranged in a tiered network of hubs up to seven levels, counting the PC host as level 1 and the farthest device as level 7. The PC supplie...
So, you will find out that with USB3 chipsets, you will actually hit a limit at 30 devices or so, due to a hard 32 device limit (really 96 endpoint limit) on USB3 chipsets. I dealt with this problem too and it took me a while to find the real problem and solutions. I wrote [a blog post about it](https://web.archive.or...
15,937,208
I am a bit new to Javascript. I have a html form with multiple input types but with the same names occurring multiple types. I need to validate the form before inserting the data in the form into the database. I am able to update and insert into the database without JS validation but am unable to perform the validation...
2013/04/10
[ "https://Stackoverflow.com/questions/15937208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/935108/" ]
An example to solve: ``` perl -pe 's/^\[..:..:..](.*)(\[..:..:..]) (.*)/$2$1$3/' <<EOT [AA:BB:CC] <Person1> [re:al:ts] BLAH BLAH BLAH [AA:BB:CC] <Person2> [an:ot:he] BLAH BLAH BLAH [AA:BB:CC] <Person3> [rr:ea:lt] BLAH BLAH BLAH [AA:BB:CC] <Person4> [im:es:tp] BLAH BLAH BLAH EOT ``` Output: ``` [re:al:ts] <Person1> ...
If you don't use multi-line matching, try this regex: ``` /\[.*?]( <.*?> )\[(.*?)]/g ``` and you would replace by: ``` "[$2]$1" ```
15,937,208
I am a bit new to Javascript. I have a html form with multiple input types but with the same names occurring multiple types. I need to validate the form before inserting the data in the form into the database. I am able to update and insert into the database without JS validation but am unable to perform the validation...
2013/04/10
[ "https://Stackoverflow.com/questions/15937208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/935108/" ]
An example to solve: ``` perl -pe 's/^\[..:..:..](.*)(\[..:..:..]) (.*)/$2$1$3/' <<EOT [AA:BB:CC] <Person1> [re:al:ts] BLAH BLAH BLAH [AA:BB:CC] <Person2> [an:ot:he] BLAH BLAH BLAH [AA:BB:CC] <Person3> [rr:ea:lt] BLAH BLAH BLAH [AA:BB:CC] <Person4> [im:es:tp] BLAH BLAH BLAH EOT ``` Output: ``` [re:al:ts] <Person1> ...
Lets make a few assumptions first. 1. Timestamps in of the form [hh:mm:ss], seconds/minutes under 10 are expressed as 01 etc. 2. The person string does not contain a "[" Then the following regex will work: ``` ^\[\d{2}:\d{2}:\d{2}\]([^\[]++)(\[\d{2}:\d{2}:\d{2}\])(.*)$ ``` Here is a test case written in Java: ```...
8,881,708
Version 1.0 of my project builds in Visual Studio 2008 successfully, But when I upgrade Visual Studio to version 2010, building my project failed (for some reasons). My project changed and new release is ready (Version 2.0). It builds on Visual Studio 2010 successfully. Now, if I want to access "my-project-version-1....
2012/01/16
[ "https://Stackoverflow.com/questions/8881708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/309798/" ]
Putting non-source files under version control is generally not a good idea. If you insist, you can add it in one commit, and remove it in the next one, and tag that commit. What you can do however, is to keep the executables separately. For example if you use github, you can upload files so that you can download them...
You should have continuous integration set up so when you have a stable version there will always be an artifact published (executables, documentation etc) for it. For more info look for [**jenkins**](http://jenkins-ci.org/). Just a note: the repository is just for source code and all the other files that can be used...
8,881,708
Version 1.0 of my project builds in Visual Studio 2008 successfully, But when I upgrade Visual Studio to version 2010, building my project failed (for some reasons). My project changed and new release is ready (Version 2.0). It builds on Visual Studio 2010 successfully. Now, if I want to access "my-project-version-1....
2012/01/16
[ "https://Stackoverflow.com/questions/8881708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/309798/" ]
You should have continuous integration set up so when you have a stable version there will always be an artifact published (executables, documentation etc) for it. For more info look for [**jenkins**](http://jenkins-ci.org/). Just a note: the repository is just for source code and all the other files that can be used...
We put binaries under version control. They are in a separate directory from the code, and we have our cmake scripts copy the binaries to/from the directories they are output to. The /src/ directory has an external link to /bin/, so anyone checking out /src/ automatically gets the binaries. The cmake scripts then copy...
8,881,708
Version 1.0 of my project builds in Visual Studio 2008 successfully, But when I upgrade Visual Studio to version 2010, building my project failed (for some reasons). My project changed and new release is ready (Version 2.0). It builds on Visual Studio 2010 successfully. Now, if I want to access "my-project-version-1....
2012/01/16
[ "https://Stackoverflow.com/questions/8881708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/309798/" ]
Putting non-source files under version control is generally not a good idea. If you insist, you can add it in one commit, and remove it in the next one, and tag that commit. What you can do however, is to keep the executables separately. For example if you use github, you can upload files so that you can download them...
The best idea would be to make it work in Visual Studio 2010. I personally, and in all professional contexts I work in, prefer to keep compiled files out of the repository. Binary diff just doesn't make sense. Instead keep a backup of all versions outside the repository (or in another repo), so your source code is ke...
8,881,708
Version 1.0 of my project builds in Visual Studio 2008 successfully, But when I upgrade Visual Studio to version 2010, building my project failed (for some reasons). My project changed and new release is ready (Version 2.0). It builds on Visual Studio 2010 successfully. Now, if I want to access "my-project-version-1....
2012/01/16
[ "https://Stackoverflow.com/questions/8881708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/309798/" ]
The best idea would be to make it work in Visual Studio 2010. I personally, and in all professional contexts I work in, prefer to keep compiled files out of the repository. Binary diff just doesn't make sense. Instead keep a backup of all versions outside the repository (or in another repo), so your source code is ke...
We put binaries under version control. They are in a separate directory from the code, and we have our cmake scripts copy the binaries to/from the directories they are output to. The /src/ directory has an external link to /bin/, so anyone checking out /src/ automatically gets the binaries. The cmake scripts then copy...
8,881,708
Version 1.0 of my project builds in Visual Studio 2008 successfully, But when I upgrade Visual Studio to version 2010, building my project failed (for some reasons). My project changed and new release is ready (Version 2.0). It builds on Visual Studio 2010 successfully. Now, if I want to access "my-project-version-1....
2012/01/16
[ "https://Stackoverflow.com/questions/8881708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/309798/" ]
Putting non-source files under version control is generally not a good idea. If you insist, you can add it in one commit, and remove it in the next one, and tag that commit. What you can do however, is to keep the executables separately. For example if you use github, you can upload files so that you can download them...
We put binaries under version control. They are in a separate directory from the code, and we have our cmake scripts copy the binaries to/from the directories they are output to. The /src/ directory has an external link to /bin/, so anyone checking out /src/ automatically gets the binaries. The cmake scripts then copy...
91,847
I have been playing some flight sims and have noticed that in some of them you get wing flex during hard landings. Is it realistic? Can wings flex upon a hard landing?
2022/02/17
[ "https://aviation.stackexchange.com/questions/91847", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/62315/" ]
Yup. While flying, the wings are supporting the aircraft's full weight. After touchdown this weight transfers to the wheels, preferably smoothly and rapidly. So of course the wings will flex. However some flight sim designers turn this effect up to 11 ;)
Are you talking about bouncing up and down or "remaining sagged"? For the first one, oftentimes upon (hard) touchdowns, there is some bouncing. For the second one, the wings remain "sagged" while producing lift. If there is still noticeable airspeed, the wing will still be producing lift, so there will be some "sa...
91,847
I have been playing some flight sims and have noticed that in some of them you get wing flex during hard landings. Is it realistic? Can wings flex upon a hard landing?
2022/02/17
[ "https://aviation.stackexchange.com/questions/91847", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/62315/" ]
Yes, when the wheels touch down the wings still have a negative vertical velocity component and they sag down *dynamically*, and then rebound back up again to a constant value of "static" sag that reflects the weight of the wing and its stiffness. In the C-5 heavy transport, the touchdown sag was sufficient to "eat up...
Yup. While flying, the wings are supporting the aircraft's full weight. After touchdown this weight transfers to the wheels, preferably smoothly and rapidly. So of course the wings will flex. However some flight sim designers turn this effect up to 11 ;)
91,847
I have been playing some flight sims and have noticed that in some of them you get wing flex during hard landings. Is it realistic? Can wings flex upon a hard landing?
2022/02/17
[ "https://aviation.stackexchange.com/questions/91847", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/62315/" ]
Yup. While flying, the wings are supporting the aircraft's full weight. After touchdown this weight transfers to the wheels, preferably smoothly and rapidly. So of course the wings will flex. However some flight sim designers turn this effect up to 11 ;)
Structures like aircraft wings and even bridges are quite rigid, but not totally. There is always some strain in response to stress (stretching in tension or compressing in, well, compression). Bending loads are basically just tension on one side and compression on the other, so bending loads result in, well, bending. ...
91,847
I have been playing some flight sims and have noticed that in some of them you get wing flex during hard landings. Is it realistic? Can wings flex upon a hard landing?
2022/02/17
[ "https://aviation.stackexchange.com/questions/91847", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/62315/" ]
Yup. While flying, the wings are supporting the aircraft's full weight. After touchdown this weight transfers to the wheels, preferably smoothly and rapidly. So of course the wings will flex. However some flight sim designers turn this effect up to 11 ;)
If you get many chances to fly on an airliner, sometimes sit behind the wings, and enjoy looking out the window, you will quickly learn that the wings flex all the time. They are long and fairly thin, and all materials have some give. During turbulence the flexing can be quite visible. I think you can see it during lan...
91,847
I have been playing some flight sims and have noticed that in some of them you get wing flex during hard landings. Is it realistic? Can wings flex upon a hard landing?
2022/02/17
[ "https://aviation.stackexchange.com/questions/91847", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/62315/" ]
Yup. While flying, the wings are supporting the aircraft's full weight. After touchdown this weight transfers to the wheels, preferably smoothly and rapidly. So of course the wings will flex. However some flight sim designers turn this effect up to 11 ;)
The sag of the wings is particularly apparent, if you sit in a window seat near the wings. The following pictures were taken from the lower deck of an A-380 in-flight during the approach and later post-flight on the ground. Notive, that in-flight, the root of the wing-tip is visible, while post-flight, only a portion...
91,847
I have been playing some flight sims and have noticed that in some of them you get wing flex during hard landings. Is it realistic? Can wings flex upon a hard landing?
2022/02/17
[ "https://aviation.stackexchange.com/questions/91847", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/62315/" ]
Yes, when the wheels touch down the wings still have a negative vertical velocity component and they sag down *dynamically*, and then rebound back up again to a constant value of "static" sag that reflects the weight of the wing and its stiffness. In the C-5 heavy transport, the touchdown sag was sufficient to "eat up...
Are you talking about bouncing up and down or "remaining sagged"? For the first one, oftentimes upon (hard) touchdowns, there is some bouncing. For the second one, the wings remain "sagged" while producing lift. If there is still noticeable airspeed, the wing will still be producing lift, so there will be some "sa...
91,847
I have been playing some flight sims and have noticed that in some of them you get wing flex during hard landings. Is it realistic? Can wings flex upon a hard landing?
2022/02/17
[ "https://aviation.stackexchange.com/questions/91847", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/62315/" ]
Yes, when the wheels touch down the wings still have a negative vertical velocity component and they sag down *dynamically*, and then rebound back up again to a constant value of "static" sag that reflects the weight of the wing and its stiffness. In the C-5 heavy transport, the touchdown sag was sufficient to "eat up...
Structures like aircraft wings and even bridges are quite rigid, but not totally. There is always some strain in response to stress (stretching in tension or compressing in, well, compression). Bending loads are basically just tension on one side and compression on the other, so bending loads result in, well, bending. ...
91,847
I have been playing some flight sims and have noticed that in some of them you get wing flex during hard landings. Is it realistic? Can wings flex upon a hard landing?
2022/02/17
[ "https://aviation.stackexchange.com/questions/91847", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/62315/" ]
Yes, when the wheels touch down the wings still have a negative vertical velocity component and they sag down *dynamically*, and then rebound back up again to a constant value of "static" sag that reflects the weight of the wing and its stiffness. In the C-5 heavy transport, the touchdown sag was sufficient to "eat up...
If you get many chances to fly on an airliner, sometimes sit behind the wings, and enjoy looking out the window, you will quickly learn that the wings flex all the time. They are long and fairly thin, and all materials have some give. During turbulence the flexing can be quite visible. I think you can see it during lan...
91,847
I have been playing some flight sims and have noticed that in some of them you get wing flex during hard landings. Is it realistic? Can wings flex upon a hard landing?
2022/02/17
[ "https://aviation.stackexchange.com/questions/91847", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/62315/" ]
Yes, when the wheels touch down the wings still have a negative vertical velocity component and they sag down *dynamically*, and then rebound back up again to a constant value of "static" sag that reflects the weight of the wing and its stiffness. In the C-5 heavy transport, the touchdown sag was sufficient to "eat up...
The sag of the wings is particularly apparent, if you sit in a window seat near the wings. The following pictures were taken from the lower deck of an A-380 in-flight during the approach and later post-flight on the ground. Notive, that in-flight, the root of the wing-tip is visible, while post-flight, only a portion...
16,723,361
This is how a register the control on the page: ``` <%@ Register TagPrefix="uc" TagName="Pcp" Src="../../Controls/ClientPayement.ascx" %> ``` And this is how I use it: ``` <uc1:Pcp ID = "pcpClient1"></uc1:Pcp> ``` I don't know why uc1 has a green underline warning. **When I hover over it, it says: "Unrecognized ...
2013/05/23
[ "https://Stackoverflow.com/questions/16723361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/202382/" ]
You are specifying a `uc` prefix in `<%@ Register TagPrefix="uc" ..` so that's the one you should use: ``` <uc:Pcp ID = "pcpClient1"></uc:Pcp> ``` Or you could change the declared prefix: ``` <%@ Register TagPrefix="uc1" TagName="Pcp" Src="../../Controls/ClientPayement.ascx" %> ``` And use the control as you pos...
In addition to Juan's answer, you are also missing `runat="server"`.
23,960,479
I've got a regex "[\r\n\f]+" to find the number of lines contained in a String. My code is like this: ``` pattern = Pattern.compile("[\\r\\n\\f]+") String[] lines = pattern.split(texts); ``` In my unit test I've got sample strings like these: ``` "\t\t\t \r\n \n" "\r\n" ``` The result of parsing the first...
2014/05/30
[ "https://Stackoverflow.com/questions/23960479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1209101/" ]
From [the documentation for `Pattern.split(CharSequence)`](http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#split%28java.lang.CharSequence%29): > > This method works as if by invoking the two-argument split method with the given input sequence and a limit argument of zero. Trailing empty strings ...
What counts as a line really depends on your environment. quote from [wikipedia](http://en.wikipedia.org/wiki/Newline): > > LF: Multics, Unix and Unix-like systems (GNU/Linux, OS X, FreeBSD, > AIX, Xenix, etc.), BeOS, Amiga, RISC OS and others. > > > CR: Commodore 8-bit machines, Acorn BBC, ZX Spectrum, TRS-80, Ap...
31,419,813
[This project](https://github.com/getSizeOf) at a hackathon was just simply ingenious. And as a curious noob, I want to check it out. They don't have it on PlayStore, nor did they have an APK, but I want to see how it works. So how would I run this on Android? It's also important to note that this is *not a typical An...
2015/07/15
[ "https://Stackoverflow.com/questions/31419813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
1. Navigate to terminal/cmd git it by the URL: `git clone https://github.com/getSizeOf/sizeOf-Droid.git` 2. Open Android Studio click on import project, click import project [![enter image description here](https://i.stack.imgur.com/s3sxt.png)](https://i.stack.imgur.com/s3sxt.png) 3. Click on build.gradle on the proje...
Try opening the project with 'project' being the root folder. I just opened it in Android Studio 1.2.2 (latest) and it works fine. Sometimes, when you open an existing project, you have to expand to show the project structure by clicking on "1. Project" and then select "Project" from the drop-down menu (person prefere...
59,091,550
While benchmarking my application, I noticed accessing arrays items by index in relatively expensive in Python, making `for v in lst: v` signicantly faster than `for i in range(len(lst): lst[i]`: ``` from array import array a_ = array('f', range(1000)) def f1(): a = a_ acc = 0 for v in a: acc += ...
2019/11/28
[ "https://Stackoverflow.com/questions/59091550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2363712/" ]
For full loops, you can split the difference with [`enumerate`](https://docs.python.org/3/library/functions.html#enumerate), using indexed access for setting a value, and the name for reading it: ``` for i, value in enumerate(mysequence): mysequence[i] = do_stuff_with(value) ``` You can't avoid the indexed reass...
As a complement to @ShadowRunner's answer, I've done some extra benchmarking to compare the different solutions to modify an array in place. Even for relatively large arrays, it's cheaper to build a new array from a comprehension list, then overwriting the original array, rather than trying to modify in its turn the i...
59,091,550
While benchmarking my application, I noticed accessing arrays items by index in relatively expensive in Python, making `for v in lst: v` signicantly faster than `for i in range(len(lst): lst[i]`: ``` from array import array a_ = array('f', range(1000)) def f1(): a = a_ acc = 0 for v in a: acc += ...
2019/11/28
[ "https://Stackoverflow.com/questions/59091550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2363712/" ]
For full loops, you can split the difference with [`enumerate`](https://docs.python.org/3/library/functions.html#enumerate), using indexed access for setting a value, and the name for reading it: ``` for i, value in enumerate(mysequence): mysequence[i] = do_stuff_with(value) ``` You can't avoid the indexed reass...
Here are some timeit results for the different methods: ``` #for v in a #for i in range(len(a)) #for i,v in enumerate(a) [[0.47590930000296794, 0.8639191000038409, 0.7616558000008808], [0.43640120000054594, 0.832395199999155, 0.7896779000002425], [0.44416509999427944, 0.8366088000038872, ...
59,091,550
While benchmarking my application, I noticed accessing arrays items by index in relatively expensive in Python, making `for v in lst: v` signicantly faster than `for i in range(len(lst): lst[i]`: ``` from array import array a_ = array('f', range(1000)) def f1(): a = a_ acc = 0 for v in a: acc += ...
2019/11/28
[ "https://Stackoverflow.com/questions/59091550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2363712/" ]
Here are some timeit results for the different methods: ``` #for v in a #for i in range(len(a)) #for i,v in enumerate(a) [[0.47590930000296794, 0.8639191000038409, 0.7616558000008808], [0.43640120000054594, 0.832395199999155, 0.7896779000002425], [0.44416509999427944, 0.8366088000038872, ...
As a complement to @ShadowRunner's answer, I've done some extra benchmarking to compare the different solutions to modify an array in place. Even for relatively large arrays, it's cheaper to build a new array from a comprehension list, then overwriting the original array, rather than trying to modify in its turn the i...
67,171,011
I'm trying to make something that can detect when there is a mention, and that part works, and sending it does too, somewhat. For some reason, **I cannot fetch or get the channel (833856168668561409) in any way.** The bot can view the channel and send messages to it, but it can't seem to find it. I'm not sure what's ha...
2021/04/20
[ "https://Stackoverflow.com/questions/67171011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14916741/" ]
They're just different things. Reading from right to left might be helpful. ``` int array[5][5] -> array of array of int, could decay to pointer to array of int int (*array)[5] -> pointer to array of int, could be converted from the above int **array -> pointer to pointer to int int *(*array) -> same as abo...
Also, in the ***"C++"*** language, it is strongly advisable to use one of the very-many *"container classes"* for this purpose. Or perhaps a `class` of your own devising. "A simple pointer" has no way to convey that it is pointing to "a 2D array," nor what its dimensions are. The extent of its job-description is that ...
67,171,011
I'm trying to make something that can detect when there is a mention, and that part works, and sending it does too, somewhat. For some reason, **I cannot fetch or get the channel (833856168668561409) in any way.** The bot can view the channel and send messages to it, but it can't seem to find it. I'm not sure what's ha...
2021/04/20
[ "https://Stackoverflow.com/questions/67171011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14916741/" ]
They're just different things. Reading from right to left might be helpful. ``` int array[5][5] -> array of array of int, could decay to pointer to array of int int (*array)[5] -> pointer to array of int, could be converted from the above int **array -> pointer to pointer to int int *(*array) -> same as abo...
Versions 1,3, and 4 are all the same. Version 2 is also the same as 1,3, and 4, because when passing an array to a function the array decays to a pointer. Version 2 can also be written ``` void passArr(int* array[5]) ``` Which probably shows the association of the asterisk with the type more clearly: it is an array...
67,171,011
I'm trying to make something that can detect when there is a mention, and that part works, and sending it does too, somewhat. For some reason, **I cannot fetch or get the channel (833856168668561409) in any way.** The bot can view the channel and send messages to it, but it can't seem to find it. I'm not sure what's ha...
2021/04/20
[ "https://Stackoverflow.com/questions/67171011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14916741/" ]
In C and C++, a 2D array is an *Array-of-Arrays*. The first element of a 2D array is the first 1D array it contains. The conversion is specified in [C++ Standard - Array-to-pointer Conversion [conv.array]](http://eel.is/c++draft/conv.array) When you declared a *plain-old* 2D array as: ``` int array[5][5] ``` You ha...
Also, in the ***"C++"*** language, it is strongly advisable to use one of the very-many *"container classes"* for this purpose. Or perhaps a `class` of your own devising. "A simple pointer" has no way to convey that it is pointing to "a 2D array," nor what its dimensions are. The extent of its job-description is that ...
67,171,011
I'm trying to make something that can detect when there is a mention, and that part works, and sending it does too, somewhat. For some reason, **I cannot fetch or get the channel (833856168668561409) in any way.** The bot can view the channel and send messages to it, but it can't seem to find it. I'm not sure what's ha...
2021/04/20
[ "https://Stackoverflow.com/questions/67171011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14916741/" ]
In C and C++, a 2D array is an *Array-of-Arrays*. The first element of a 2D array is the first 1D array it contains. The conversion is specified in [C++ Standard - Array-to-pointer Conversion [conv.array]](http://eel.is/c++draft/conv.array) When you declared a *plain-old* 2D array as: ``` int array[5][5] ``` You ha...
Versions 1,3, and 4 are all the same. Version 2 is also the same as 1,3, and 4, because when passing an array to a function the array decays to a pointer. Version 2 can also be written ``` void passArr(int* array[5]) ``` Which probably shows the association of the asterisk with the type more clearly: it is an array...
53,443,566
I want to apply CSS to my child components that are called from a parent component using the trick it works fine **Encapsulation: ViewEncapsulation.None** But when i Navigate to other routes or pages it picks the style of the component whose Encapsulation is none weird behaiour i.e when I hit route <http://localhost...
2018/11/23
[ "https://Stackoverflow.com/questions/53443566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4281964/" ]
**View encapsulation** defines whether the template and styles defined within the component can affect the whole application or vice versa. For ViewEncapsulation **None** - styles from the component propagate back to the main HTML and therefore are visible to all components on the page. Be careful with apps that have ...
simple old css hack Add a unique class like `.app-component` to the top most element of your component, and make sure all other styles are child of this class. Better yet if you are using any kind of css preprocessors. Info: When using ***ViewEncapsulation.None***, the defined styles are added to the html page us...
107,801
A circle touches two sides of a triangle and two of its medians. Prove that the triangle is isosceles. [![Figure](https://i.stack.imgur.com/l3rUE.png)](https://i.stack.imgur.com/l3rUE.png) This problem came from the Mathematical Digest issue 62 (Jan 1986) which in turn cited a Russian mag called KVANT (meaning "Quant...
2021/03/13
[ "https://puzzling.stackexchange.com/questions/107801", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/15942/" ]
> > As the triangles ADC and BEC have the same incircle and their areas are equal (half that of ABC), [so are their perimeters](https://en.wikipedia.org/wiki/Semiperimeter#Formulas_invoking_the_semiperimeter) > > DC+DA+AC = EC+EB+BC > > or, subtracting from both sides CD+CE+DA+EB > > AE-EB = BD-DA. > ...
Alternative Proof > > By [Pitot Theorem](https://en.wikipedia.org/wiki/Pitot_theorem) we have $|CE|+|MD| = |CD|+|ME|$ and since the centroid divides each median in the ratio 2:1, this means that $$\frac{1}{2}|AC| + \frac{1}{3}|AD| = \frac{1}{2}|BC|+\frac{1}{3}|BE|$$ Now let $|AB| = c, |BC| = a, |CA|=b, |AD|=m\_a, |B...
107,801
A circle touches two sides of a triangle and two of its medians. Prove that the triangle is isosceles. [![Figure](https://i.stack.imgur.com/l3rUE.png)](https://i.stack.imgur.com/l3rUE.png) This problem came from the Mathematical Digest issue 62 (Jan 1986) which in turn cited a Russian mag called KVANT (meaning "Quant...
2021/03/13
[ "https://puzzling.stackexchange.com/questions/107801", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/15942/" ]
> > As the triangles ADC and BEC have the same incircle and their areas are equal (half that of ABC), [so are their perimeters](https://en.wikipedia.org/wiki/Semiperimeter#Formulas_invoking_the_semiperimeter) > > DC+DA+AC = EC+EB+BC > > or, subtracting from both sides CD+CE+DA+EB > > AE-EB = BD-DA. > ...
@loopwalt and @hexomino both gave excellent answers. I wanted to share the answer from the Mathematical Digest, because it's also elegant in its own way: It starts the same way as @hexomino's proof (I didn't know it was called Pitot's Theorem!): > > Since $CEMD$ circumscribes a circle, $CE+MD = CD + ME$ (Pitot's Th...
71,221
I am dealing with code thatt i received that relies heavily on timer interrupts. i am using arduino Mega (Funduino) More specifically, when a signal arrives in a pin, an interrupt is run that starts a timer. A different interrupt is run from inside the 1st interrupt, when the timer overflows. The interrupts measure t...
2019/12/26
[ "https://arduino.stackexchange.com/questions/71221", "https://arduino.stackexchange.com", "https://arduino.stackexchange.com/users/1499/" ]
The regulator on an Arduino is likely analog. On [this Arduino Uno](https://store.arduino.cc/usa/arduino-uno-rev3) the regulator is an analog [NCP1117ST50T3G](https://www.onsemi.com/pub/Collateral/NCP1117-D.PDF) as seen in [this schematic](https://www.arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf). On page ...
See if arduino works with strips disconnected Assuming that you are connecting your 12V to the breadboard Do not try to use Arduinos voltage regulator to supply something this massive as LED strip (if you did, then arduinos voltage regulator would be burned by now) If arduino works with strips disconnected If it does:...
59,005,629
I have a string of digits, how can I format this as a mobile number? I am trying to create a python def that takes a string and normalizes them into a format I can use. I am trying to remove all symbols, spaces and if input digit start with 0 and just leave the numbers. As well as add +98 to the beginning ``` Some tr...
2019/11/23
[ "https://Stackoverflow.com/questions/59005629", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11982318/" ]
You can use replace like below: ``` str = (str.replace(" ","")) str = '+98'+str[-10:] ```
You can use the regular expression in this case , you can eliminate everything except numbers from the input. here below is the demonstration with the input you provided. ``` import re inputNumnerList = ['+98 912 999 88 77 ','09375554433 ','916 222 3344 '] for data in inputNumnerList: if data.starts...
23,435,010
Alright, so while I know I am missing something super easy, I have no idea what it is. I have looked through every related question looking for an answer to mine, and all that I can determine is that Im somewhere going out of scope I think. I have no pointers or anything. My problem came up today, as I am trying to m...
2014/05/02
[ "https://Stackoverflow.com/questions/23435010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3597319/" ]
`short deckCoutner = 40;` - the last element in your array is 39, not 40. Also, only call `srand()` once at the beginning of your program. If you keep calling it then you'll get the same random number back because the resolution of `time()` is low enough that it will return the same value each time, so you'll keep see...
``` short deckCoutner = 40; srand (unsigned int(time (NULL))); short randCard = rand() % (deckCoutner); Hand [i] [0] = Deck [deckCoutner] [0]; Hand [i] [1] = Deck [deckCoutner] [1]; Hand [i] [2] = Deck [deckCoutner] [2]; Hand [i] [3] = Deck [deckCoutner] [3]; ``` 40 is too large of an inde...
1,689,095
I am accessing the SHDocVw.InternetExplorer from the SHDocVw.ShellWindowsClass(). I can see the page that the browser instance is currently on (the LocationURL property), but what I really need is the last get request that was done for the browser. My specific need is that my application was just launched to handle a f...
2009/11/06
[ "https://Stackoverflow.com/questions/1689095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1965047/" ]
Since you can't get the url from Internet Explorer's history using ***IUrlHistoryStg::EnumUrls*** <http://msdn.microsoft.com/en-us/library/aa767720%28VS.85%29.aspx> try making sure the file association is setup one the box and that your app can take a file path from the command line to start up. I added these keys to...
Sink [DWebbrowserEvents2::OnBeforeNavigate2](http://msdn.microsoft.com/en-us/library/aa768280(VS.85).aspx).
29,314,839
Using v8.2 simulator, `Cmd+D` always show the following error message ``` [RCTLog][tid:0x7fcc2bf4cb90][RCTRootView.m:68]>WebSocket debugger is not available. Did you forget to include RCTWebSocketExecutor? ```
2015/03/28
[ "https://Stackoverflow.com/questions/29314839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2802074/" ]
Finally, I found the root cause after I tried many different way to solve this problem. For using Chrome DevTool to debug, iOS project need to import libraries `RCTWebSocketDebugger.xcodeproj` and `libicucore.dylib`. In react-native examples, `2048`, `Movies`, `TicTacToe` doesn't import these two libraries. That's wh...
Possibly similar to this issue: <https://github.com/facebook/react-native/issues/311> And also mentioned here: <https://github.com/facebook/react-native/issues/297> Looks like it's probably a poor error message for the fact that React Native is unable to connect to the Chrome Debugger. The first link has a possible...
4,667,597
From MongoDB The Definitive Guide: > > Documents larger than 4MB (when converted to BSON) cannot be > saved to the database. This is a somewhat arbitrary limit (and may be > raised in the future); it is mostly to prevent bad schema design and ensure > consistent performance. > > > I don't understand this limit...
2011/01/12
[ "https://Stackoverflow.com/questions/4667597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/88447/" ]
First off, this actually is being raised in the next version to `8MB` or `16MB` ... but I think to put this into perspective, Eliot from 10gen (who developed MongoDB) puts it best: **EDIT:** *The size has been [officially](http://docs.mongodb.org/manual/reference/limits/) 'raised' to `16MB`* > > So, on your blog exa...
I have not yet seen a problem with the limit that did not involve large files stored within the document itself. There are already a variety of databases which are very efficient at storing/retrieving large files; they are called operating systems. The database exists as a layer over the operating system. If you are us...
4,667,597
From MongoDB The Definitive Guide: > > Documents larger than 4MB (when converted to BSON) cannot be > saved to the database. This is a somewhat arbitrary limit (and may be > raised in the future); it is mostly to prevent bad schema design and ensure > consistent performance. > > > I don't understand this limit...
2011/01/12
[ "https://Stackoverflow.com/questions/4667597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/88447/" ]
To post a clarification answer here for those who get directed here by Google. The document size includes everything in the document including the subdocuments, nested objects etc. So a document of: ```json { "_id": {}, "na": [1, 2, 3], "naa": [ { "w": 1, "v": 2, "b": [1, 2, 3] }, { "w": 5, "b": 2, "h"...
I have not yet seen a problem with the limit that did not involve large files stored within the document itself. There are already a variety of databases which are very efficient at storing/retrieving large files; they are called operating systems. The database exists as a layer over the operating system. If you are us...
4,667,597
From MongoDB The Definitive Guide: > > Documents larger than 4MB (when converted to BSON) cannot be > saved to the database. This is a somewhat arbitrary limit (and may be > raised in the future); it is mostly to prevent bad schema design and ensure > consistent performance. > > > I don't understand this limit...
2011/01/12
[ "https://Stackoverflow.com/questions/4667597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/88447/" ]
First off, this actually is being raised in the next version to `8MB` or `16MB` ... but I think to put this into perspective, Eliot from 10gen (who developed MongoDB) puts it best: **EDIT:** *The size has been [officially](http://docs.mongodb.org/manual/reference/limits/) 'raised' to `16MB`* > > So, on your blog exa...
**Nested Depth for BSON Documents:** MongoDB supports no more than 100 levels of nesting for BSON documents. [More more info vist](https://docs.mongodb.org/manual/reference/limits/)
4,667,597
From MongoDB The Definitive Guide: > > Documents larger than 4MB (when converted to BSON) cannot be > saved to the database. This is a somewhat arbitrary limit (and may be > raised in the future); it is mostly to prevent bad schema design and ensure > consistent performance. > > > I don't understand this limit...
2011/01/12
[ "https://Stackoverflow.com/questions/4667597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/88447/" ]
First off, this actually is being raised in the next version to `8MB` or `16MB` ... but I think to put this into perspective, Eliot from 10gen (who developed MongoDB) puts it best: **EDIT:** *The size has been [officially](http://docs.mongodb.org/manual/reference/limits/) 'raised' to `16MB`* > > So, on your blog exa...
According to <https://www.mongodb.com/blog/post/6-rules-of-thumb-for-mongodb-schema-design-part-1> If you expect that a blog post may exceed the 16Mb document limit, you should extract the comments into a separate collection and reference the blog post from the comment and do an application-level join. ``` // posts [...
4,667,597
From MongoDB The Definitive Guide: > > Documents larger than 4MB (when converted to BSON) cannot be > saved to the database. This is a somewhat arbitrary limit (and may be > raised in the future); it is mostly to prevent bad schema design and ensure > consistent performance. > > > I don't understand this limit...
2011/01/12
[ "https://Stackoverflow.com/questions/4667597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/88447/" ]
Many in the community would prefer no limit with warnings about performance, see this comment for a well reasoned argument: <https://jira.mongodb.org/browse/SERVER-431?focusedCommentId=22283&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-22283> My take, the lead developers are stubborn a...
Perhaps storing a blog post -> comments **relation** in a non-relational database is not really the best design. You should probably store comments in a separate collection to blog posts anyway. [edit] See comments below for further discussion.
4,667,597
From MongoDB The Definitive Guide: > > Documents larger than 4MB (when converted to BSON) cannot be > saved to the database. This is a somewhat arbitrary limit (and may be > raised in the future); it is mostly to prevent bad schema design and ensure > consistent performance. > > > I don't understand this limit...
2011/01/12
[ "https://Stackoverflow.com/questions/4667597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/88447/" ]
To post a clarification answer here for those who get directed here by Google. The document size includes everything in the document including the subdocuments, nested objects etc. So a document of: ```json { "_id": {}, "na": [1, 2, 3], "naa": [ { "w": 1, "v": 2, "b": [1, 2, 3] }, { "w": 5, "b": 2, "h"...
**Nested Depth for BSON Documents:** MongoDB supports no more than 100 levels of nesting for BSON documents. [More more info vist](https://docs.mongodb.org/manual/reference/limits/)
4,667,597
From MongoDB The Definitive Guide: > > Documents larger than 4MB (when converted to BSON) cannot be > saved to the database. This is a somewhat arbitrary limit (and may be > raised in the future); it is mostly to prevent bad schema design and ensure > consistent performance. > > > I don't understand this limit...
2011/01/12
[ "https://Stackoverflow.com/questions/4667597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/88447/" ]
I have not yet seen a problem with the limit that did not involve large files stored within the document itself. There are already a variety of databases which are very efficient at storing/retrieving large files; they are called operating systems. The database exists as a layer over the operating system. If you are us...
According to <https://www.mongodb.com/blog/post/6-rules-of-thumb-for-mongodb-schema-design-part-1> If you expect that a blog post may exceed the 16Mb document limit, you should extract the comments into a separate collection and reference the blog post from the comment and do an application-level join. ``` // posts [...
4,667,597
From MongoDB The Definitive Guide: > > Documents larger than 4MB (when converted to BSON) cannot be > saved to the database. This is a somewhat arbitrary limit (and may be > raised in the future); it is mostly to prevent bad schema design and ensure > consistent performance. > > > I don't understand this limit...
2011/01/12
[ "https://Stackoverflow.com/questions/4667597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/88447/" ]
Many in the community would prefer no limit with warnings about performance, see this comment for a well reasoned argument: <https://jira.mongodb.org/browse/SERVER-431?focusedCommentId=22283&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-22283> My take, the lead developers are stubborn a...
**Nested Depth for BSON Documents:** MongoDB supports no more than 100 levels of nesting for BSON documents. [More more info vist](https://docs.mongodb.org/manual/reference/limits/)
4,667,597
From MongoDB The Definitive Guide: > > Documents larger than 4MB (when converted to BSON) cannot be > saved to the database. This is a somewhat arbitrary limit (and may be > raised in the future); it is mostly to prevent bad schema design and ensure > consistent performance. > > > I don't understand this limit...
2011/01/12
[ "https://Stackoverflow.com/questions/4667597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/88447/" ]
**Nested Depth for BSON Documents:** MongoDB supports no more than 100 levels of nesting for BSON documents. [More more info vist](https://docs.mongodb.org/manual/reference/limits/)
According to <https://www.mongodb.com/blog/post/6-rules-of-thumb-for-mongodb-schema-design-part-1> If you expect that a blog post may exceed the 16Mb document limit, you should extract the comments into a separate collection and reference the blog post from the comment and do an application-level join. ``` // posts [...
4,667,597
From MongoDB The Definitive Guide: > > Documents larger than 4MB (when converted to BSON) cannot be > saved to the database. This is a somewhat arbitrary limit (and may be > raised in the future); it is mostly to prevent bad schema design and ensure > consistent performance. > > > I don't understand this limit...
2011/01/12
[ "https://Stackoverflow.com/questions/4667597", "https://Stackoverflow.com", "https://Stackoverflow.com/users/88447/" ]
According to <https://www.mongodb.com/blog/post/6-rules-of-thumb-for-mongodb-schema-design-part-1> If you expect that a blog post may exceed the 16Mb document limit, you should extract the comments into a separate collection and reference the blog post from the comment and do an application-level join. ``` // posts [...
Perhaps storing a blog post -> comments **relation** in a non-relational database is not really the best design. You should probably store comments in a separate collection to blog posts anyway. [edit] See comments below for further discussion.
28,501,976
I can embed in golang with pointer and value. By pointer ``` type Bitmap struct{ data [4][4]bool } type Renderer struct{ *Bitmap on uint8 off uint8 } ``` By value ``` type Bitmap struct{ data [4][4]bool } type Renderer struct{ Bitmap on uint8 off uint8 } ``` What is more prefer ...
2015/02/13
[ "https://Stackoverflow.com/questions/28501976", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1743843/" ]
It depends. There are several possibilities here. * If Renderer is passed around by value and the methods you need on Bitmap are defined on \*Bitmap, then you'll need to embed \*Bitmap. * If Renderer is passed around as a pointer, then you can embed Bitmap as a value without any problem (pointer methods will still be ...
By embedding a type you usually want to benefit from call-forwarding. `*Bitmap`'s [method set](https://golang.org/ref/spec#Method_sets) is a super set of `Bitmap`'s [method set](https://golang.org/ref/spec#Method_sets). So in most cases you'll want to embed `*Bitmap`, unless all its methods have a receiver of type `Bit...
28,501,976
I can embed in golang with pointer and value. By pointer ``` type Bitmap struct{ data [4][4]bool } type Renderer struct{ *Bitmap on uint8 off uint8 } ``` By value ``` type Bitmap struct{ data [4][4]bool } type Renderer struct{ Bitmap on uint8 off uint8 } ``` What is more prefer ...
2015/02/13
[ "https://Stackoverflow.com/questions/28501976", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1743843/" ]
By embedding a type you usually want to benefit from call-forwarding. `*Bitmap`'s [method set](https://golang.org/ref/spec#Method_sets) is a super set of `Bitmap`'s [method set](https://golang.org/ref/spec#Method_sets). So in most cases you'll want to embed `*Bitmap`, unless all its methods have a receiver of type `Bit...
I've also found it useful when you have multiple structs all with the same embedded base type, and you want to use a helper function which modifies the values of the base struct. For example, given the following structs: ``` type Base struct { F1 int } type A struct { *Base Fa int } type B struct { *...