qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
77,341
I would like to know with the restrictions of GAE listed below, is it even possible to build a great social app (like Facebook) by hosting that app on GAE? In other words is GAE an infrastructure capable of hosting an app used by 600 million active users? Restrictions I've dugged out from a couple of forums / blogs (...
2011/05/17
[ "https://softwareengineering.stackexchange.com/questions/77341", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/24257/" ]
No, App Engine is not appropriate for an app with 600 million active users. Realistically, apps this large run on highly customized infrastructure out of their own datacenters. It's probably possible to host such an app with Google, but you would work directly with their sales team to design a solution; the sandbox re...
If you come up with an idea that will attract even 100, let alone 600, million users you'll have any venture capital and any tech team to develop and run it on any infrastructure. And you'll also want to protect your intellectual property in that case, which GAE won't provide because Google wants to have access to sou...
77,341
I would like to know with the restrictions of GAE listed below, is it even possible to build a great social app (like Facebook) by hosting that app on GAE? In other words is GAE an infrastructure capable of hosting an app used by 600 million active users? Restrictions I've dugged out from a couple of forums / blogs (...
2011/05/17
[ "https://softwareengineering.stackexchange.com/questions/77341", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/24257/" ]
I think what annoys me about this question is that you've phrased it and loaded it with "facts" in an attempt to gather a definitive no. The truth is that you could develop an App Engine app that replicates the features of Facebook, Twitter, or Tumblr. And assuming the app was well written, it would scale to support ...
I think the points in that FAQ fall into a couple of main areas. First of all, there's the points which are actually to the *benefit* of scalability, rather than the detriment. In a highly scalable application, one of the things you strive for is making sure every request is largely independent of the others and also ...
77,341
I would like to know with the restrictions of GAE listed below, is it even possible to build a great social app (like Facebook) by hosting that app on GAE? In other words is GAE an infrastructure capable of hosting an app used by 600 million active users? Restrictions I've dugged out from a couple of forums / blogs (...
2011/05/17
[ "https://softwareengineering.stackexchange.com/questions/77341", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/24257/" ]
I think the points in that FAQ fall into a couple of main areas. First of all, there's the points which are actually to the *benefit* of scalability, rather than the detriment. In a highly scalable application, one of the things you strive for is making sure every request is largely independent of the others and also ...
If you come up with an idea that will attract even 100, let alone 600, million users you'll have any venture capital and any tech team to develop and run it on any infrastructure. And you'll also want to protect your intellectual property in that case, which GAE won't provide because Google wants to have access to sou...
77,341
I would like to know with the restrictions of GAE listed below, is it even possible to build a great social app (like Facebook) by hosting that app on GAE? In other words is GAE an infrastructure capable of hosting an app used by 600 million active users? Restrictions I've dugged out from a couple of forums / blogs (...
2011/05/17
[ "https://softwareengineering.stackexchange.com/questions/77341", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/24257/" ]
I think what annoys me about this question is that you've phrased it and loaded it with "facts" in an attempt to gather a definitive no. The truth is that you could develop an App Engine app that replicates the features of Facebook, Twitter, or Tumblr. And assuming the app was well written, it would scale to support ...
If you come up with an idea that will attract even 100, let alone 600, million users you'll have any venture capital and any tech team to develop and run it on any infrastructure. And you'll also want to protect your intellectual property in that case, which GAE won't provide because Google wants to have access to sou...
67,298,980
Can I make the code below work **without copying** the object b? ``` #include <iostream> using namespace std; class A{ public: A() = default; A(const A& a) { cout << "copy ctor\n"; } A(A&& a) { cout << "move ctor\n"; } A& operator=(const A& a) { c...
2021/04/28
[ "https://Stackoverflow.com/questions/67298980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9828740/" ]
The overall type of your conditional operator is *not* a reference type, because the 'false' branch is not a reference. Thus, even in the 'true' branch, the `b` object has to be copied, in order to match the type of the `Gen()` call. The assignment makes a reference to that copied object. In your case, you can avoid t...
When using the ternary operator, `b` is handled as *glvalue*. That will cause a copy constructor call. If you want to avoid that, write `std::move(b)` which provides you with *rvalue* reference. In that case move constructor will be called. More info can be found [here](https://stackoverflow.com/questions/54688464/why...
55,859,599
I'm new to React. The function `clickOnTableRow()` is used by a click event (It's to change a table row color when clicked and back to what it was originally when another row clicked), and I'd like to make it automatically, so I set a Bootstrap switch. By toggling it, the table row color would be changed row by row aut...
2019/04/26
[ "https://Stackoverflow.com/questions/55859599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11392803/" ]
This is how you can get reference to current instance and use `addContent` method to add new gallery item: ``` $.fancybox.getInstance().addContent({ 'type' : 'image', 'src' : '/path/to/your/image.jpg' }); ``` btw, If you are wondering why this method is not documented, then this method originally was planned t...
Did you manage to implement a solution for this? I'm having the exact issue. Here's what I have so far: ``` // Fancybox $().fancybox({ selector: '[data-fancybox="images"]', loop: false, beforeShow: function(instance, current) { // When we reach the last item in current Fancybox instance, load more im...
21,816,323
It annoys me that the resizing of windows in Windows is not as "smooth" as it I'd like it to be (this is the case with Windows programs in general, not just my own. Visual Studio is a good example). It makes the OS and its programs feel "flimsy" and "cheap" (yes, I care about how programs and user interfaces *feel*, in...
2014/02/16
[ "https://Stackoverflow.com/questions/21816323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/478267/" ]
There is a way to prevent the needless BitBlt mentioned in step 4 above. Until Windows 8 it could be done either by creating your own custom implementation of `WM_NCCALCSIZE` to tell Windows to blit nothing (or to blit one pixel on top of itself), or alternately you could intercept `WM_WINDOWPOSCHANGING` (first passin...
When calling `CreateSwapChainForHwnd`, ensure that you have set the swap chain description `Scaling` property to `DXGI_SCALING_NONE`. This is only supported on Windows 7 with the Platform Update, so you may need to fall back to the default `DXGI_SCALING_STRETCH` (the latter is what is causing the flickering).
21,816,323
It annoys me that the resizing of windows in Windows is not as "smooth" as it I'd like it to be (this is the case with Windows programs in general, not just my own. Visual Studio is a good example). It makes the OS and its programs feel "flimsy" and "cheap" (yes, I care about how programs and user interfaces *feel*, in...
2014/02/16
[ "https://Stackoverflow.com/questions/21816323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/478267/" ]
When calling `CreateSwapChainForHwnd`, ensure that you have set the swap chain description `Scaling` property to `DXGI_SCALING_NONE`. This is only supported on Windows 7 with the Platform Update, so you may need to fall back to the default `DXGI_SCALING_STRETCH` (the latter is what is causing the flickering).
Set WM\_SETREDRAW to FALSE, do your resizing, then reenable drawing, invalidate the window and the OS will blit it. I've done this for button enabling and disabling buttons when selecting different items from a list, never for an entire window.
21,816,323
It annoys me that the resizing of windows in Windows is not as "smooth" as it I'd like it to be (this is the case with Windows programs in general, not just my own. Visual Studio is a good example). It makes the OS and its programs feel "flimsy" and "cheap" (yes, I care about how programs and user interfaces *feel*, in...
2014/02/16
[ "https://Stackoverflow.com/questions/21816323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/478267/" ]
There is a way to prevent the needless BitBlt mentioned in step 4 above. Until Windows 8 it could be done either by creating your own custom implementation of `WM_NCCALCSIZE` to tell Windows to blit nothing (or to blit one pixel on top of itself), or alternately you could intercept `WM_WINDOWPOSCHANGING` (first passin...
What if you have a borderless childwindow (the type that only renders inside the parent) at a fixed size (same as fullscreen resolution), you should get a lot smoother results because there is no memory reallocation (which i think is what causes the jitterieness). If it's still not perfect, look into both WM\_SIZE and...
21,816,323
It annoys me that the resizing of windows in Windows is not as "smooth" as it I'd like it to be (this is the case with Windows programs in general, not just my own. Visual Studio is a good example). It makes the OS and its programs feel "flimsy" and "cheap" (yes, I care about how programs and user interfaces *feel*, in...
2014/02/16
[ "https://Stackoverflow.com/questions/21816323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/478267/" ]
What if you have a borderless childwindow (the type that only renders inside the parent) at a fixed size (same as fullscreen resolution), you should get a lot smoother results because there is no memory reallocation (which i think is what causes the jitterieness). If it's still not perfect, look into both WM\_SIZE and...
This is the best I've come up with and resizes great although the backbuffer blitting causes some edge flickering, haven't tested with DX or OGL yet but it should work even better with hardware acceleration. It's a bit bulky but will do as a proof of concept. If the canvas could be clipped without using MDI that would...
21,816,323
It annoys me that the resizing of windows in Windows is not as "smooth" as it I'd like it to be (this is the case with Windows programs in general, not just my own. Visual Studio is a good example). It makes the OS and its programs feel "flimsy" and "cheap" (yes, I care about how programs and user interfaces *feel*, in...
2014/02/16
[ "https://Stackoverflow.com/questions/21816323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/478267/" ]
When calling `CreateSwapChainForHwnd`, ensure that you have set the swap chain description `Scaling` property to `DXGI_SCALING_NONE`. This is only supported on Windows 7 with the Platform Update, so you may need to fall back to the default `DXGI_SCALING_STRETCH` (the latter is what is causing the flickering).
This is the best I've come up with and resizes great although the backbuffer blitting causes some edge flickering, haven't tested with DX or OGL yet but it should work even better with hardware acceleration. It's a bit bulky but will do as a proof of concept. If the canvas could be clipped without using MDI that would...
21,816,323
It annoys me that the resizing of windows in Windows is not as "smooth" as it I'd like it to be (this is the case with Windows programs in general, not just my own. Visual Studio is a good example). It makes the OS and its programs feel "flimsy" and "cheap" (yes, I care about how programs and user interfaces *feel*, in...
2014/02/16
[ "https://Stackoverflow.com/questions/21816323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/478267/" ]
This is the best I've come up with and resizes great although the backbuffer blitting causes some edge flickering, haven't tested with DX or OGL yet but it should work even better with hardware acceleration. It's a bit bulky but will do as a proof of concept. If the canvas could be clipped without using MDI that would...
While your aim is laudable, I suspect that any attempt to do this will just end up as a fight between you and Windows - which you will not win (though you might manage to fight your way to an honourable draw). Sorry to be negative.
21,816,323
It annoys me that the resizing of windows in Windows is not as "smooth" as it I'd like it to be (this is the case with Windows programs in general, not just my own. Visual Studio is a good example). It makes the OS and its programs feel "flimsy" and "cheap" (yes, I care about how programs and user interfaces *feel*, in...
2014/02/16
[ "https://Stackoverflow.com/questions/21816323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/478267/" ]
There is a way to prevent the needless BitBlt mentioned in step 4 above. Until Windows 8 it could be done either by creating your own custom implementation of `WM_NCCALCSIZE` to tell Windows to blit nothing (or to blit one pixel on top of itself), or alternately you could intercept `WM_WINDOWPOSCHANGING` (first passin...
This is the best I've come up with and resizes great although the backbuffer blitting causes some edge flickering, haven't tested with DX or OGL yet but it should work even better with hardware acceleration. It's a bit bulky but will do as a proof of concept. If the canvas could be clipped without using MDI that would...
21,816,323
It annoys me that the resizing of windows in Windows is not as "smooth" as it I'd like it to be (this is the case with Windows programs in general, not just my own. Visual Studio is a good example). It makes the OS and its programs feel "flimsy" and "cheap" (yes, I care about how programs and user interfaces *feel*, in...
2014/02/16
[ "https://Stackoverflow.com/questions/21816323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/478267/" ]
Set WM\_SETREDRAW to FALSE, do your resizing, then reenable drawing, invalidate the window and the OS will blit it. I've done this for button enabling and disabling buttons when selecting different items from a list, never for an entire window.
While your aim is laudable, I suspect that any attempt to do this will just end up as a fight between you and Windows - which you will not win (though you might manage to fight your way to an honourable draw). Sorry to be negative.
21,816,323
It annoys me that the resizing of windows in Windows is not as "smooth" as it I'd like it to be (this is the case with Windows programs in general, not just my own. Visual Studio is a good example). It makes the OS and its programs feel "flimsy" and "cheap" (yes, I care about how programs and user interfaces *feel*, in...
2014/02/16
[ "https://Stackoverflow.com/questions/21816323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/478267/" ]
What if you have a borderless childwindow (the type that only renders inside the parent) at a fixed size (same as fullscreen resolution), you should get a lot smoother results because there is no memory reallocation (which i think is what causes the jitterieness). If it's still not perfect, look into both WM\_SIZE and...
Set WM\_SETREDRAW to FALSE, do your resizing, then reenable drawing, invalidate the window and the OS will blit it. I've done this for button enabling and disabling buttons when selecting different items from a list, never for an entire window.
21,816,323
It annoys me that the resizing of windows in Windows is not as "smooth" as it I'd like it to be (this is the case with Windows programs in general, not just my own. Visual Studio is a good example). It makes the OS and its programs feel "flimsy" and "cheap" (yes, I care about how programs and user interfaces *feel*, in...
2014/02/16
[ "https://Stackoverflow.com/questions/21816323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/478267/" ]
There is a way to prevent the needless BitBlt mentioned in step 4 above. Until Windows 8 it could be done either by creating your own custom implementation of `WM_NCCALCSIZE` to tell Windows to blit nothing (or to blit one pixel on top of itself), or alternately you could intercept `WM_WINDOWPOSCHANGING` (first passin...
Set WM\_SETREDRAW to FALSE, do your resizing, then reenable drawing, invalidate the window and the OS will blit it. I've done this for button enabling and disabling buttons when selecting different items from a list, never for an entire window.
22,936
[![enter image description here](https://i.stack.imgur.com/oEORE.jpg)](https://i.stack.imgur.com/oEORE.jpg) The picture above is 1 example. Are there other variations of symbols that resemble TJ?
2017/03/02
[ "https://chinese.stackexchange.com/questions/22936", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/16584/" ]
The whole thing is a [行](http://www.zdic.net/z/23/js/884C.htm) character. pronunciation: háng  ㄏㄤˊ or xíng  ㄒㄧㄥˊ háng xíng: to sail, to fly, to navigate.
行,读作xíng或者háng如果偏旁写得离得太远的话会变成彳chì 亍chù
43,538,566
I need a nested array, but I've got a array with nested objects. What i have: ``` [ { id: 1, title: 'title', value: 'test data'} { id: 2, title: 'title', value: 'test data'} ] ``` But i need: ``` [ [ 1, 'title', 'test data'] [ 2, 'title', 'test data'] ] ```
2017/04/21
[ "https://Stackoverflow.com/questions/43538566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6927035/" ]
You can perform a `.map(x => Object.values(x))` on it. Live example: ```js let src = [ { id: 1, title: 'title', value: 'test data'}, { id: 2, title: 'title', value: 'test data'} ]; let result = src.map(x => Object.values(x)); console.log(result); ```
using `forEach` loop: ```js var obj = [ { id: 1, title: 'title', value: 'test data'}, { id: 2, title: 'title', value: 'test data'} ]; var arr = []; obj.forEach(function(o, k) { arr.push([o.id, o.title, o.value]); }); console.log(arr); ```
43,538,566
I need a nested array, but I've got a array with nested objects. What i have: ``` [ { id: 1, title: 'title', value: 'test data'} { id: 2, title: 'title', value: 'test data'} ] ``` But i need: ``` [ [ 1, 'title', 'test data'] [ 2, 'title', 'test data'] ] ```
2017/04/21
[ "https://Stackoverflow.com/questions/43538566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6927035/" ]
You can perform a `.map(x => Object.values(x))` on it. Live example: ```js let src = [ { id: 1, title: 'title', value: 'test data'}, { id: 2, title: 'title', value: 'test data'} ]; let result = src.map(x => Object.values(x)); console.log(result); ```
You could use [`Object.values`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values) direct as callback. ```js var data = [{ id: 1, title: 'title', value: 'test data' }, { id: 2, title: 'title', value: 'test data'}], result = data.map(Object.values); console.log(result...
43,538,566
I need a nested array, but I've got a array with nested objects. What i have: ``` [ { id: 1, title: 'title', value: 'test data'} { id: 2, title: 'title', value: 'test data'} ] ``` But i need: ``` [ [ 1, 'title', 'test data'] [ 2, 'title', 'test data'] ] ```
2017/04/21
[ "https://Stackoverflow.com/questions/43538566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6927035/" ]
You can perform a `.map(x => Object.values(x))` on it. Live example: ```js let src = [ { id: 1, title: 'title', value: 'test data'}, { id: 2, title: 'title', value: 'test data'} ]; let result = src.map(x => Object.values(x)); console.log(result); ```
you could try like this using [`Array#map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map?v=example) and [**`object.values()`**](https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0ahUKEwiFxY6wnLXTAhXDQo8KHWHGAokQFgglMAE&url=https%3A%2F%2Fde...
43,538,566
I need a nested array, but I've got a array with nested objects. What i have: ``` [ { id: 1, title: 'title', value: 'test data'} { id: 2, title: 'title', value: 'test data'} ] ``` But i need: ``` [ [ 1, 'title', 'test data'] [ 2, 'title', 'test data'] ] ```
2017/04/21
[ "https://Stackoverflow.com/questions/43538566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6927035/" ]
You can perform a `.map(x => Object.values(x))` on it. Live example: ```js let src = [ { id: 1, title: 'title', value: 'test data'}, { id: 2, title: 'title', value: 'test data'} ]; let result = src.map(x => Object.values(x)); console.log(result); ```
You just need to use [**Array.proptotype.map()**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map?v=example) method along with [**Object.values()**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values) to loop your array and return th...
43,538,566
I need a nested array, but I've got a array with nested objects. What i have: ``` [ { id: 1, title: 'title', value: 'test data'} { id: 2, title: 'title', value: 'test data'} ] ``` But i need: ``` [ [ 1, 'title', 'test data'] [ 2, 'title', 'test data'] ] ```
2017/04/21
[ "https://Stackoverflow.com/questions/43538566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6927035/" ]
You could use [`Object.values`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values) direct as callback. ```js var data = [{ id: 1, title: 'title', value: 'test data' }, { id: 2, title: 'title', value: 'test data'}], result = data.map(Object.values); console.log(result...
using `forEach` loop: ```js var obj = [ { id: 1, title: 'title', value: 'test data'}, { id: 2, title: 'title', value: 'test data'} ]; var arr = []; obj.forEach(function(o, k) { arr.push([o.id, o.title, o.value]); }); console.log(arr); ```
43,538,566
I need a nested array, but I've got a array with nested objects. What i have: ``` [ { id: 1, title: 'title', value: 'test data'} { id: 2, title: 'title', value: 'test data'} ] ``` But i need: ``` [ [ 1, 'title', 'test data'] [ 2, 'title', 'test data'] ] ```
2017/04/21
[ "https://Stackoverflow.com/questions/43538566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6927035/" ]
using `forEach` loop: ```js var obj = [ { id: 1, title: 'title', value: 'test data'}, { id: 2, title: 'title', value: 'test data'} ]; var arr = []; obj.forEach(function(o, k) { arr.push([o.id, o.title, o.value]); }); console.log(arr); ```
you could try like this using [`Array#map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map?v=example) and [**`object.values()`**](https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0ahUKEwiFxY6wnLXTAhXDQo8KHWHGAokQFgglMAE&url=https%3A%2F%2Fde...
43,538,566
I need a nested array, but I've got a array with nested objects. What i have: ``` [ { id: 1, title: 'title', value: 'test data'} { id: 2, title: 'title', value: 'test data'} ] ``` But i need: ``` [ [ 1, 'title', 'test data'] [ 2, 'title', 'test data'] ] ```
2017/04/21
[ "https://Stackoverflow.com/questions/43538566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6927035/" ]
using `forEach` loop: ```js var obj = [ { id: 1, title: 'title', value: 'test data'}, { id: 2, title: 'title', value: 'test data'} ]; var arr = []; obj.forEach(function(o, k) { arr.push([o.id, o.title, o.value]); }); console.log(arr); ```
You just need to use [**Array.proptotype.map()**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map?v=example) method along with [**Object.values()**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values) to loop your array and return th...
43,538,566
I need a nested array, but I've got a array with nested objects. What i have: ``` [ { id: 1, title: 'title', value: 'test data'} { id: 2, title: 'title', value: 'test data'} ] ``` But i need: ``` [ [ 1, 'title', 'test data'] [ 2, 'title', 'test data'] ] ```
2017/04/21
[ "https://Stackoverflow.com/questions/43538566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6927035/" ]
You could use [`Object.values`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values) direct as callback. ```js var data = [{ id: 1, title: 'title', value: 'test data' }, { id: 2, title: 'title', value: 'test data'}], result = data.map(Object.values); console.log(result...
you could try like this using [`Array#map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map?v=example) and [**`object.values()`**](https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0ahUKEwiFxY6wnLXTAhXDQo8KHWHGAokQFgglMAE&url=https%3A%2F%2Fde...
43,538,566
I need a nested array, but I've got a array with nested objects. What i have: ``` [ { id: 1, title: 'title', value: 'test data'} { id: 2, title: 'title', value: 'test data'} ] ``` But i need: ``` [ [ 1, 'title', 'test data'] [ 2, 'title', 'test data'] ] ```
2017/04/21
[ "https://Stackoverflow.com/questions/43538566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6927035/" ]
You could use [`Object.values`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values) direct as callback. ```js var data = [{ id: 1, title: 'title', value: 'test data' }, { id: 2, title: 'title', value: 'test data'}], result = data.map(Object.values); console.log(result...
You just need to use [**Array.proptotype.map()**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map?v=example) method along with [**Object.values()**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/values) to loop your array and return th...
41,521,699
I am streaming HTML 5 video with Express using `fs.createReadStream(path).pipe(res);` which eventually causes the error `Error: EMFILE: too many open files` if I refresh the page too many times (in the thousands). I assume I need to perform some kind of cleanup and close the file to prevent this but am unsure what need...
2017/01/07
[ "https://Stackoverflow.com/questions/41521699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2248702/" ]
It turns out the stream only gets destroyed and the file closed when the end is reached - which rarely happens as you would have to load the entire file without seeking or closing the browser. To fix this you have to listen for the close event of the response and destroy the stream: ``` res.on('close', function() { ...
On Linux/Unix `EMFILE` issues are resolved by `ulimit`. I'm not sure on windows. Google `Windows ulimit EMFILE` gets to this Stack Overflow <https://stackoverflow.com/a/729204/683017> Its saying 2048 file descriptors per process is limit on Windows. This would fit with what your saying > > "in the thousands" > > ...
46,210,146
I'm trying to findIndex of an object in an array containing multiple objects. I've been struggling with this for a while and have simplified it to what you see and still cannot get it. Please let me know what will work so that I can get the "input" object's string from `matchBetween("string1");` ``` matchBetween("stri...
2017/09/14
[ "https://Stackoverflow.com/questions/46210146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8430249/" ]
`Object.is(result, x)` is wrong. Run `params.findIndex (x => {console.log(x); return false;});` to see what each x looks like ``` {param: "string1", input: "inputstring1"} {param: "string2", input: "inputstring2"} ``` So you can use `Object.is(result, x.param)` as Jean mentioned, or `result === x.param`, or simply ...
Try this sample: ```js matchBetween = function (result) { let params = [ { param: "string1", input: "inputstring1"}, { param: "string2", input: "inputstring2"} ]; console.log(result, params, params[0].param ); //Output: "string1", (2)[{...}, {...x=>x.param == result let locati...
9,451,644
I have the following stream mms://77.238.11.5:8080, you can access it using Windows Mediaplayer. I don't find any solution to view it on Android devices using MediaPlayer or VideoView, so my idea is to convert is using VLC or FFMPEG to a different format like MP4 or else.
2012/02/26
[ "https://Stackoverflow.com/questions/9451644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/702328/" ]
You can use ffmpeg to convert the stream to a file: ``` ffmpeg -i "mmsh://77.238.11.5:8080/" output.mp4 ``` Option `-t duration` limits the length of the video, if needed.
They say that [VPlayer](https://market.android.com/details?id=me.abitno.vplayer.t) can play such streams.
21,540,527
I get this error while running this Java/JDBC code. Any ideas how to get around it? Seems like it's complaining about the parameter in date\_trunc function? **org.postgresql.util.PSQLException: ERROR: syntax error at or near "$1"** Position: 100 ``` at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorRes...
2014/02/04
[ "https://Stackoverflow.com/questions/21540527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1119716/" ]
When using the `type 'string'` syntax as in `timestamp '2014-11-11 -05:00:00'`, the value provided must be a constant, not a parameter. It's interpreted and converted to an internal timestamp representation by the SQL engine at the parse stage, before actual execution takes place and before the values for the parameter...
I have seen such an error when either of the jdbc connection url components are null. E.g. connection url components such as DB host name, dbname, user or password are null. Please check out there and you should find a clue.
13,973,099
i have this sample string and i want to explode the day,month,hour,minutes,(am/pm) wih regex: ``` SunDec 16 00:00am ``` Using this: ``` (\w+)\s+(\w+)\s+(\d+)\:(\d+)(..) ``` But it gives me: ``` Array ( [0] => SunDec 16 00:00am [1] => SunDec [2] => 16 [3] => 00 [4] => 00 [5] => am ) ``` ...
2012/12/20
[ "https://Stackoverflow.com/questions/13973099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1878073/" ]
You could try this: ``` $str = 'SunDec 16 00:00am'; preg_match('/([A-Z]{1}\w+)([A-Z]{1}\w+)\s+(\w+)\s+(\d+):(\d+)(..)/', $str, $ret); print_r($ret); ```
If your string is always going to follow that example you can use this: ``` $string = 'SunDec 16 00:00am'; $pattern = '!([a-zA-Z]{3})([a-zA-Z]{3})\s+(\w+)\s+(\d+)\:(\d+)(..)!'; preg_match($pattern, $string, $chunks); print_r($chunks); ``` Which outputs: ``` Array ( [0] => SunDec 16 00:00am [1] => Sun [2...
13,973,099
i have this sample string and i want to explode the day,month,hour,minutes,(am/pm) wih regex: ``` SunDec 16 00:00am ``` Using this: ``` (\w+)\s+(\w+)\s+(\d+)\:(\d+)(..) ``` But it gives me: ``` Array ( [0] => SunDec 16 00:00am [1] => SunDec [2] => 16 [3] => 00 [4] => 00 [5] => am ) ``` ...
2012/12/20
[ "https://Stackoverflow.com/questions/13973099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1878073/" ]
You could try this: ``` $str = 'SunDec 16 00:00am'; preg_match('/([A-Z]{1}\w+)([A-Z]{1}\w+)\s+(\w+)\s+(\d+):(\d+)(..)/', $str, $ret); print_r($ret); ```
You can try this Regular Expression, This might help you ``` ([A-Z][a-z]+)+\s(\d+)?\s?(\d+)\:(\d+)([a-z]+) ```
3,939,200
I have a datafile that looks like this: ``` 1 1.0 0 2 1.5 0 3 0.0 1 4 1.2 2 5 1.0 1 6 1.1 1 ``` where the first column is my X value, the second column is my Y value, and the third column is a color. I'd like for each line segment to be colored according to the third column. So the first two line segments would be "...
2010/10/15
[ "https://Stackoverflow.com/questions/3939200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146446/" ]
This following works for me (gnuplot 4.4) ``` plot "./file.dat" u 1:2:3 with lines palette ``` Hope this helps. When I ran your code gnuplot couldn't pass the "rgb" part. For an example of using the variable tag see the similar question: [GNUPLOT: dot plot with data depending dot size](https://stackoverflow.com/...
``` plot 'foo.dat' with lines linecolor variable ``` or abbreviated: ``` plot 'foo.dat' w l lc var ```
3,939,200
I have a datafile that looks like this: ``` 1 1.0 0 2 1.5 0 3 0.0 1 4 1.2 2 5 1.0 1 6 1.1 1 ``` where the first column is my X value, the second column is my Y value, and the third column is a color. I'd like for each line segment to be colored according to the third column. So the first two line segments would be "...
2010/10/15
[ "https://Stackoverflow.com/questions/3939200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/146446/" ]
This following works for me (gnuplot 4.4) ``` plot "./file.dat" u 1:2:3 with lines palette ``` Hope this helps. When I ran your code gnuplot couldn't pass the "rgb" part. For an example of using the variable tag see the similar question: [GNUPLOT: dot plot with data depending dot size](https://stackoverflow.com/...
This has been asked long ago, but i just had the same question. And the most suitable way to also get legend/title for "variable" colors, was: ``` # set this to the range of your variable which you want to color-encode # or leave it out set cbrange [0:1] # define the palette to your liking set palette defined ( 0 "#B...
19,899,567
I am trying to build a file upload browser client using javascript and HTML 5. From file input form (input type "file") in webpage, browser provides a file handle with the html 5 File Object (<http://www.w3.org/TR/FileAPI/>) . Upload is done using this file object. But I want a file upload to be resumed if the upload i...
2013/11/11
[ "https://Stackoverflow.com/questions/19899567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2473731/" ]
Data stored in `locastorage` needs to be of primitive data types and you need to serialize any data before saving it here. As `File` object is not one of primitive data type so you can not save it to your `localstorage`. Not to forget that their is a limit(5MB) on maximum data that can be saved in `localstorage` and fo...
It is easily possible to store a file in indexedDB. indexedDB is useful for big databases and such, but it would still work even if you are just putting in one file. I know @Gaurav said something about indexedDB, but I'll give you an example of how to store it: ``` var indexedDB=window.indexedDB||window.webkitIndexedD...
68,413
I know I can have at least 2 classes, but can I have more? This is of course at the discretion of my GM whether he allows me to have 20 classes if I'd wish. But are there any set rules for this?
2015/09/11
[ "https://rpg.stackexchange.com/questions/68413", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/24838/" ]
This combination would not be any more viable then a regular sized projectile ----------------------------------------------------------------------------- From the text on [Shrink Item](http://paizo.com/pathfinderRPG/prd/spells/shrinkItem.html) > > Objects changed by a shrink item spell can be returned to normal co...
Projectile weapons won't work like this RAW, thrown weapons might depending on how your DM handles the unshrinking on impacting a solid surface i.e. your target. It's noteworthy though, that while the command word can only be used by the caster, that caster need not be the thrower and might have readied an action befor...
53,919,553
For some reason I'm drawing a blank right now. I want to make a list that represents all the possible outcomes for the last week of football (16 total games). There should be 2^16 (65536) outcomes excluding tie scenarios. I know I could just make 16 nested for loops with a range length of 2 in each loop, but there has...
2018/12/25
[ "https://Stackoverflow.com/questions/53919553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5030117/" ]
``` var albums = { "Please Please Me": 1963, "With the Beatles": 1963, "A Hard Day's Night ": 1964, "Beatles for Sale ": 1964, "Twist and Shout ": 1964, "Help ": 1963, "Rubber Soul ": 1965, "Revolver": 1966, "Sgt. Pepper's Lonely Hearts Club Band": 1967, "Magical Mystery Tour ": ...
You could create a new data structure from your starting one, having the year as key, and then as value the array of the albums. Then you can loop over your new data stracture, and get the max number of albums and the key (year) corresponding to that max: ```js var x = { "Please Please Me": 1963, "With the Beatl...
53,919,553
For some reason I'm drawing a blank right now. I want to make a list that represents all the possible outcomes for the last week of football (16 total games). There should be 2^16 (65536) outcomes excluding tie scenarios. I know I could just make 16 nested for loops with a range length of 2 in each loop, but there has...
2018/12/25
[ "https://Stackoverflow.com/questions/53919553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5030117/" ]
You could create a new data structure from your starting one, having the year as key, and then as value the array of the albums. Then you can loop over your new data stracture, and get the max number of albums and the key (year) corresponding to that max: ```js var x = { "Please Please Me": 1963, "With the Beatl...
You can create an array of objects. Each object can have a year, an array of movies and the number of movies. Then on sorting the array will give the object which have highest movies ```js let data = { "Please Please Me": 1963, "With the Beatles": 1963, "A Hard Day's Night": 1964, "Beatles for Sale": 1964...
53,919,553
For some reason I'm drawing a blank right now. I want to make a list that represents all the possible outcomes for the last week of football (16 total games). There should be 2^16 (65536) outcomes excluding tie scenarios. I know I could just make 16 nested for loops with a range length of 2 in each loop, but there has...
2018/12/25
[ "https://Stackoverflow.com/questions/53919553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5030117/" ]
``` var albums = { "Please Please Me": 1963, "With the Beatles": 1963, "A Hard Day's Night ": 1964, "Beatles for Sale ": 1964, "Twist and Shout ": 1964, "Help ": 1963, "Rubber Soul ": 1965, "Revolver": 1966, "Sgt. Pepper's Lonely Hearts Club Band": 1967, "Magical Mystery Tour ": ...
You can create an array of objects. Each object can have a year, an array of movies and the number of movies. Then on sorting the array will give the object which have highest movies ```js let data = { "Please Please Me": 1963, "With the Beatles": 1963, "A Hard Day's Night": 1964, "Beatles for Sale": 1964...
53,690
What are all the ways to increase the readiness factor for the war with the Reapers?
2012/03/06
[ "https://gaming.stackexchange.com/questions/53690", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/3917/" ]
Readiness is managed via the [Galaxy at War](http://masseffect.wikia.com/wiki/Mass_Effect_3:_Galaxy_at_War) system and I'll go into the specific ways to earn readiness below: Single Player ============= [**War Assets**](http://masseffect.wikia.com/wiki/War_Assets) are the part of Galaxy at War you collect in Single P...
As far as I can tell so far, the only ways to increase galactic readiness is through multi-player or either of the iOS Mass Effect 3 games. You should be able to acquire enough military strength in game to where the readiness doesn't matter.
53,690
What are all the ways to increase the readiness factor for the war with the Reapers?
2012/03/06
[ "https://gaming.stackexchange.com/questions/53690", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/3917/" ]
As far as I can tell so far, the only ways to increase galactic readiness is through multi-player or either of the iOS Mass Effect 3 games. You should be able to acquire enough military strength in game to where the readiness doesn't matter.
In multiplayer, play bronze and win to get about 4% added on to your readiness. You get much less if you die. As for singleplayer, talk to people and do side missions.
53,690
What are all the ways to increase the readiness factor for the war with the Reapers?
2012/03/06
[ "https://gaming.stackexchange.com/questions/53690", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/3917/" ]
As far as I can tell so far, the only ways to increase galactic readiness is through multi-player or either of the iOS Mass Effect 3 games. You should be able to acquire enough military strength in game to where the readiness doesn't matter.
The only two ways of increasing readiness is by participating in Multiplayer, and by trading in Intel from MEI (Mass Effect: Infiltrator). MED (Mass Effect: Datapad) is a FREE app which allows you to view your Galaxy at War. Which in turn is split into 2 things, Strength and Readiness. I have explained readiness. St...
53,690
What are all the ways to increase the readiness factor for the war with the Reapers?
2012/03/06
[ "https://gaming.stackexchange.com/questions/53690", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/3917/" ]
Readiness is managed via the [Galaxy at War](http://masseffect.wikia.com/wiki/Mass_Effect_3:_Galaxy_at_War) system and I'll go into the specific ways to earn readiness below: Single Player ============= [**War Assets**](http://masseffect.wikia.com/wiki/War_Assets) are the part of Galaxy at War you collect in Single P...
In multiplayer, play bronze and win to get about 4% added on to your readiness. You get much less if you die. As for singleplayer, talk to people and do side missions.
53,690
What are all the ways to increase the readiness factor for the war with the Reapers?
2012/03/06
[ "https://gaming.stackexchange.com/questions/53690", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/3917/" ]
Readiness is managed via the [Galaxy at War](http://masseffect.wikia.com/wiki/Mass_Effect_3:_Galaxy_at_War) system and I'll go into the specific ways to earn readiness below: Single Player ============= [**War Assets**](http://masseffect.wikia.com/wiki/War_Assets) are the part of Galaxy at War you collect in Single P...
The only two ways of increasing readiness is by participating in Multiplayer, and by trading in Intel from MEI (Mass Effect: Infiltrator). MED (Mass Effect: Datapad) is a FREE app which allows you to view your Galaxy at War. Which in turn is split into 2 things, Strength and Readiness. I have explained readiness. St...
53,690
What are all the ways to increase the readiness factor for the war with the Reapers?
2012/03/06
[ "https://gaming.stackexchange.com/questions/53690", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/3917/" ]
The only two ways of increasing readiness is by participating in Multiplayer, and by trading in Intel from MEI (Mass Effect: Infiltrator). MED (Mass Effect: Datapad) is a FREE app which allows you to view your Galaxy at War. Which in turn is split into 2 things, Strength and Readiness. I have explained readiness. St...
In multiplayer, play bronze and win to get about 4% added on to your readiness. You get much less if you die. As for singleplayer, talk to people and do side missions.
16,067,925
I need to convert this program to java. I can handle everything else but the destructor. Now I've already read all over about the GC(garbage collector) and it unreliability. I am thinking why put a destructor for me to convert anyways if there wasn't a way or something. ``` #include<iostream> using namespace std; cl...
2013/04/17
[ "https://Stackoverflow.com/questions/16067925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2292121/" ]
C++ needs destructors to release resources held by an object. The most frequent need is to dispose of dynamically allocated memory. In Java, dynamically allocated memory is disposed automatically by garbage collection. For this, a destructor is not necessary. Other resources can be disposed of in via an explicit met...
You can either use try-with-resources or use the `PreDestroy` annotation.
16,067,925
I need to convert this program to java. I can handle everything else but the destructor. Now I've already read all over about the GC(garbage collector) and it unreliability. I am thinking why put a destructor for me to convert anyways if there wasn't a way or something. ``` #include<iostream> using namespace std; cl...
2013/04/17
[ "https://Stackoverflow.com/questions/16067925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2292121/" ]
You might want to look at this post on [StackOverflow](https://stackoverflow.com/questions/2506488/java-finalize-method-call) - read it carefully though, as `finalize()` is not the same as C++ destructors!! You cannot make assumptions about whether it's called, what objects are still available, etc. I'm not sure if Ja...
You can either use try-with-resources or use the `PreDestroy` annotation.
1,203,624
While i was creating stress data for a table i found the following files are generated. ``` -rw-rw---- 1 mysql mysql 8858 Jul 28 06:47 card.frm -rw-rw---- 1 mysql mysql 7951695624 Jul 29 20:48 card.MYD -rw-rw---- 1 mysql mysql 51360768 Jul 29 20:57 card.MYI ``` Actually I inserted 1985968 number of records i...
2009/07/29
[ "https://Stackoverflow.com/questions/1203624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Please note that .MYI is your index, and .MYD is your data. The only way to reduce the size of your .MYD is to delete rows or alter your column sizes. 50MB for an index on 2 million rows is not large. Let's look at the size breakdown of your table: * **company\_id** - 4 Bytes * **emp\_number** - 101 Bytes * **card\_...
A lot depends on how big that time\_entry text field can be. I'm going to assume it's small, less than 100 bytes. Then you have roughly 4 + 100 + 10 + 100 + 15 + 15 + 8 + 8 = roughly 300 bytes of data per record. You have 2 million records. I'd expect the database to be 600 megabytes. In fact you are showing 8000 megab...
24,247,349
Hi I encounter some trouble when trying to save php variable to mysql database from shell\_exec result. I want to get my local ip system in ubuntu, so I use ``` <?php $ip = shell_exec("/sbin/ifconfig eth0 | grep 'inet addr:'| cut -d: -f2 | awk '{ print $1}' | tr -d ' '"); ?> ``` I insert the $ip variable to my...
2014/06/16
[ "https://Stackoverflow.com/questions/24247349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3064401/" ]
`str_replace` only replaces the exact strings you pass it. It's not spaces that are causing the problem here; it's newlines. And you're not replacing those. You could say something like ``` $ip = str_replace(["\n", "\r"], "", $ip); ``` to get rid of them before putting them in the database. But really, since an IP ...
`trim()` will replace all whitespace characters at the beginning and end of the string. If you want to replace all whitespace characters, regardless of where they are in the string, you can use preg\_replace like so: ``` $string = preg_replace('/\s+/', '', $string); ```
24,247,349
Hi I encounter some trouble when trying to save php variable to mysql database from shell\_exec result. I want to get my local ip system in ubuntu, so I use ``` <?php $ip = shell_exec("/sbin/ifconfig eth0 | grep 'inet addr:'| cut -d: -f2 | awk '{ print $1}' | tr -d ' '"); ?> ``` I insert the $ip variable to my...
2014/06/16
[ "https://Stackoverflow.com/questions/24247349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3064401/" ]
Try using the PHP function [trim](http://www.php.net//manual/en/function.trim.php). What it does: > > Strip whitespace (or other characters) from the beginning and end of a > string. > > >
`trim()` will replace all whitespace characters at the beginning and end of the string. If you want to replace all whitespace characters, regardless of where they are in the string, you can use preg\_replace like so: ``` $string = preg_replace('/\s+/', '', $string); ```
12,434,099
I have in one C++ class a definition of static variable: ``` static SomeType MyClass::StaticVariable; ``` In another class I want to use this variable without MyClass prefix. Can I do that? How?
2012/09/15
[ "https://Stackoverflow.com/questions/12434099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1594394/" ]
You could use a reference: ``` class MyOtherClass { static SomeType &StaticVariable = MyClass::StaticVariable; // ... } ``` You will have to ensure that you don't try to reference `MyOtherClass::StaticVariable` before `MyClass::StaticVariable` has been constructed (at program startup).
You can do that only if that "another class" is derived from `MyClass` and `StaticVariable` has either public or protected visibility. Alternatively, you can move that member variable to some other scope or declare a reference/pointer and point it to that variable so that later you have to do less typing.
272,054
This code implements a simple wrapper, intended to be used with range-for to manipulate items of a container as overlapping pairs, ie. 3 items will give 2 pairs. Code review focus: Is `pair_range` good modern C++? Any easily avoidable performance issues, like unnecessary copies? ``` #include <iostream> #include <type...
2021/12/16
[ "https://codereview.stackexchange.com/questions/272054", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/18442/" ]
``` std::cout << "&-constructor, type=" << ti.name() << std::endl; ``` For this debugging output, consider using `__PRETTY_FUNCTION__` (MSVC calls it `__FUNCSIG__`) instead of `std::type_info`. On GCC, your way prints ``` &-constructor, type=10pair_rangeIiSt6vectorE &&-constructor, type=10pair_rangeIiSt6vectorE ```...
I thought this exact feature was in Eric's Ranges v3 library, but I don't see it in the C++20 docs. You might look at the original library to find it. (It *might* be `adjecent_view` noted for C++23, but cppreference doesn't explain it) --- I always use Boost's iterator facade and iterator adaptor helpers to do anythi...
29,079,102
Trying to load Session library in Codeigniter. It seems to be clearly right but actully don't work. Here's a part of config file: ``` $config['sess_driver'] = 'database'; $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 7200; $config['sess_save_path'] = NULL; $config['sess_match_ip'] = FALSE; $...
2015/03/16
[ "https://Stackoverflow.com/questions/29079102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2534629/" ]
It is permission related issue.You should update web.config identity tag with valid username/password Or change group policy. Please see below links for more details. [http://forums.asp.net/t/1686842.aspx?Access+2007+Not+a+valid+password](http://forums.asp.net/t/1686842.aspx?Access%202007%20Not%20a%20valid%20password...
I was getting the same error message when my form load executed this command ``` Me.LPInfoTableAdapter.Fill(Me.EduBaseDataSetLID.LPInfo) ``` Then I added this line of code: - ``` Me.LPInfoTableAdapter.Connection.ConnectionString = dbProvider & dbSource ``` This is my full code at form load event: - ``` ...
26,194,223
I have a table with 782,856 records. There is a column PEOPLE\_TYPE in this table that is varchar(20). I don't think table schema matters but if it does I will gladly post it. It has these distinct values (parens is a count of each type): ``` NULL (782,101) ANONYMOUS (1) BOARD (530) USER (224) ``` So why does this ...
2014/10/04
[ "https://Stackoverflow.com/questions/26194223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1278561/" ]
NULL is a strange thing. Any comparison with NULL is false: NULL = NULL is false NULL != anything is false NULL != NULL is also false. You have to say things like column is null, or column is not null. Your query would need ``` select * from people where PEOPLE_TYPE != 'BOARD' or PEOPLE_TYPE is null ```
You can read this for details on why records with NULL are not being returned: <http://msdn.microsoft.com/en-us/library/ms188048.aspx> If you want records with NULL to be returned you need to write the query like this: ``` select * from people where ISNULL(PEOPLE_TYPE, '0') != 'BOARD' ``` Or this: ``` select * fro...
26,194,223
I have a table with 782,856 records. There is a column PEOPLE\_TYPE in this table that is varchar(20). I don't think table schema matters but if it does I will gladly post it. It has these distinct values (parens is a count of each type): ``` NULL (782,101) ANONYMOUS (1) BOARD (530) USER (224) ``` So why does this ...
2014/10/04
[ "https://Stackoverflow.com/questions/26194223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1278561/" ]
NULL is a strange thing. Any comparison with NULL is false: NULL = NULL is false NULL != anything is false NULL != NULL is also false. You have to say things like column is null, or column is not null. Your query would need ``` select * from people where PEOPLE_TYPE != 'BOARD' or PEOPLE_TYPE is null ```
There is another thing called COALESCE, <http://msdn.microsoft.com/en-us/library/ms190349.aspx> I use quite often, ``` SELECT * FROM People WHERE COALESCE(PEOPLE_TYPE, '') != 'BOARD' ```
26,194,223
I have a table with 782,856 records. There is a column PEOPLE\_TYPE in this table that is varchar(20). I don't think table schema matters but if it does I will gladly post it. It has these distinct values (parens is a count of each type): ``` NULL (782,101) ANONYMOUS (1) BOARD (530) USER (224) ``` So why does this ...
2014/10/04
[ "https://Stackoverflow.com/questions/26194223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1278561/" ]
You can read this for details on why records with NULL are not being returned: <http://msdn.microsoft.com/en-us/library/ms188048.aspx> If you want records with NULL to be returned you need to write the query like this: ``` select * from people where ISNULL(PEOPLE_TYPE, '0') != 'BOARD' ``` Or this: ``` select * fro...
There is another thing called COALESCE, <http://msdn.microsoft.com/en-us/library/ms190349.aspx> I use quite often, ``` SELECT * FROM People WHERE COALESCE(PEOPLE_TYPE, '') != 'BOARD' ```
73,860,800
to clarify I'm using React and Material UI. I have strings in the format of : `CAD - Canadian Dollar` and I would like to use regex to create a string that would be equivalent to `Canadian Dollar`. Essentially the everything before the `-` would need to removed, and the one blank space in front of it would need to be r...
2022/09/26
[ "https://Stackoverflow.com/questions/73860800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19981305/" ]
There is no need to make an array for HIGHEST since there is only one variable that you would put into that array. In that case just use the variable directly instead of trying to access it indirectly via an array reference. First let's make an actual SAS dataset out of the listing you provided. ``` data have; inpu...
Your code from [this question](https://communities.sas.com/t5/SAS-Programming/doubt-in-arrays/m-p/835339#M330254) was close, you just had the assignment backwards. Note that an array method will assign the last date in the case of duplicate high results and WHICHN will report the first date so the answers are not iden...
27,475,801
I am attempting to use a custom handler for JMS Serializer Bundle ``` class CustomHandler implements SubscribingHandlerInterface { public static function getSubscribingMethods() { return array( array( 'direction' => GraphNavigator::DIRECTION_SERIALIZATION, 'f...
2014/12/15
[ "https://Stackoverflow.com/questions/27475801", "https://Stackoverflow.com", "https://Stackoverflow.com/users/119737/" ]
You need to create a service for this handler: ``` custom_jms_handler: class: MyBundle\Serializer\CustomHandler tags: - { name: jms_serializer.subscribing_handler } ``` Then make sure you use the registered JMS serializer service ``` $json = $this->get('jms_serializer')->serialize($obj, 'json'); ``...
I have this which works ``` $serializer = SerializerBuilder::create() ->configureListeners(function(EventDispatcher $dispatcher) { $dispatcher->addSubscriber(new ProjectSubscriber($this->container)); $dispatcher->addSubscriber(new UserSubscriber($this->container)); }) ...
64,313,935
I'm trying create Audio sync with text. That's what I thought, but then I'm getting this error "Cannot read property `audioPlayer` of `undefined`". I would like to know how I can get this working. [Error message](https://i.stack.imgur.com/4v4VT.jpg) ``` <audio #audiofile src="/assets/song/test2f.mp3" controls></audio...
2020/10/12
[ "https://Stackoverflow.com/questions/64313935", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11930403/" ]
In your `createSubtitle()` function you use `syncData.forEach()` Try converting you function declaration in the `forEach` callback to an arrow function
That's because you are using the `function` keyword to create a callback function, and not the arrow function. You are losing the `this` context this way. There are plenty of questions about this, but very difficult to look for, because everybody experience this problem in a different way. Basically, never use the `fun...
55,717,966
I'm new to scheme and working on a problem defined as follows: Write a function named longer-list that takes two list arguments and returns the longer list of the two inputs. If the two lists are equal in length, the function returns #t, and if one of the arguments is not a list, the function should return #f. Note:...
2019/04/16
[ "https://Stackoverflow.com/questions/55717966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5457542/" ]
Your solution is fine, of course. The errors in the original code were caused by an incorrect use of `if`, please read the [docs](https://docs.racket-lang.org/reference/if.html). The code you found online is simply traversing both lists at the same time, and if one ends before the other it's because it's shorter. A be...
this appears to have worked ``` #lang racket (define (longer-list lst1 lst2) (and (list? lst1) (list? lst2) (let comp ((x lst1) (y lst2)) (cond ((and (null? x) (null? y)) #t) ((null? x) lst2) ((null? y) lst1) (else (comp (cdr x) (cdr y))))))) ```
60,499,757
I am scraping images from a website, but the xpath varies for the element. I read [this post](https://stackoverflow.com/questions/44759907/find-element-by-class-name-for-multiple-classes) that an or function can be used by doing find\_elements\_by\_xpath. However, when I tried replicating the example, I could no long...
2020/03/03
[ "https://Stackoverflow.com/questions/60499757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12916320/" ]
You can try with CASE statement to achieve your required output. Check this below logic- ``` SELECT CASE WHEN SCHEDULE_STATUS = 'SCHEDULED' THEN SCHEDULED_ON ELSE NULL END FROM your_table ``` As per your clarification, you can use a simple select statement with WHERE condition as below- ``` SELECT * FRO...
This is one of many ways to achieve what you desire: 1. `*` selects all columns data from the table, if you don't want to show that last column then just select the first two columns, 2. t1 is your current table, 3. Query the table to only retrieve data where the `Schedule_Status` is `NOT_SCHEDULED`. ``` SELECT Name,...
46,512,102
when I fetch data from table "like date from 01/09/2017 to 30/09/2017" then it's okey.. BUT When I am trying to fetch data from date 01/09/2017 to 01/10/2017 then its only showing the data of DATE 01/10/2017(not previous month data i.e 01/09/2017) I am using MySQL Database. ``` SELECT * FROM `tablename` where date b...
2017/10/01
[ "https://Stackoverflow.com/questions/46512102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4676659/" ]
If you are saving the value as `DATE` format it should work. If not (you are saving the data as `VARCHAR` you can convert it to date and get the correct results. ``` STR_TO_DATE('01/09/2017', '%m/%d/%Y') ```
According to your example you have stored date as `text` so you need to apply `STR_TO_DATE()` to perform date operations Try below query: ``` SELECT * FROM `tablename` where STR_TO_DATE(date,'%d/%m/%Y')between STR_TO_DATE('01/09/2017','%d/%m/%Y') AND STR_TO_DATE('01/10/2017','%d/%m/%Y'); ```
46,512,102
when I fetch data from table "like date from 01/09/2017 to 30/09/2017" then it's okey.. BUT When I am trying to fetch data from date 01/09/2017 to 01/10/2017 then its only showing the data of DATE 01/10/2017(not previous month data i.e 01/09/2017) I am using MySQL Database. ``` SELECT * FROM `tablename` where date b...
2017/10/01
[ "https://Stackoverflow.com/questions/46512102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4676659/" ]
If you are saving the value as `DATE` format it should work. If not (you are saving the data as `VARCHAR` you can convert it to date and get the correct results. ``` STR_TO_DATE('01/09/2017', '%m/%d/%Y') ```
You need to store dates as DATE type not VARCHAR or TEXT. Also DB dates are in the format YYYY-MM-DD usually so you will need to adjust your query accordingly. Due to speed trying to use `STR_TO_DATE` is a terrible idea, better to convert once and then use MySQL as intended. **Backup your data first** and then I (th...
591
I'm trying to create a very simple controller from a "foo plugin", but it seems there is something i did not understand because i can't make it work. (404 error) I looked at contactForm plugin as an example; except i'm trying to respond to a "GET" http request. My plugin is enable and OK. My plugin is "foo". Here is ...
2014/06/29
[ "https://craftcms.stackexchange.com/questions/591", "https://craftcms.stackexchange.com", "https://craftcms.stackexchange.com/users/433/" ]
I solved the problem using Pascal Case for naming all my files and classes. I was using camel Case... So all works fine with those filenames for my "foo" plugin : * FooPlugin.php * controllers/FooController.php I used Pascal Case for the classes name too, mainly for consistency reason; but i noticed that : * using ...
**Typo:** Depending on your plugin-handle you may have a typo in your action routes. It's important to note that this routes are 'Camel' case-sensitive. [Read this answer by Lindsey for more info](https://craftcms.stackexchange.com/a/470/177). **Access:** You need to add your action to `$allowAnonymous`, otherwise o...
70,277,789
I have one 2-dimensional numpy array and another 3D-dimensional array. For each number in the first array I would like to count how often this value or an extremer one appears in the second array (taking the 3rd dimension as comparison vector for each element in the first array). For 0 values the function should return...
2021/12/08
[ "https://Stackoverflow.com/questions/70277789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8792159/" ]
For all these operations, you will want to transfrom `a` into a 3D array to utilize [broadcasting](https://numpy.org/doc/stable/user/basics.broadcasting.html): ``` a3 = a[..., None] ``` You can use [`np.sign`](https://numpy.org/doc/stable/reference/generated/numpy.sign.html) to normalize the direction of the extrema...
Try using np.count() This functiom should return what you want.
95,288
Suppose $C\_g$ is a smooth compact complex curve (of genus $g$), and let $J$ be its *Jacobian*. Recall that the Jacobian $J$ of a curve $C\_g$ is a complex torus that can by obtained by contractions of all rational curves on the $g$-th symmetric power of $C\_g$, e.i., $Sym^g(C\_g)$. Recall also that there is a *theta d...
2012/04/26
[ "https://mathoverflow.net/questions/95288", "https://mathoverflow.net", "https://mathoverflow.net/users/13441/" ]
Since my comment was too cryptic, I will spell it out as an answer. A polarization on an abelian variety $A$ is an ample divisor $D$ (modulo linear equivalence). A polarization is principal if the self-intersection $D^g$ is equal to $g!$, where $g = \dim A$. It is well-known that the theta divisor is a principal pola...
There also exist a Riemann surface approach to this question, as explained for example in Narasimhan's bok on compact Riemann surfaces, or also Griffiths-Harris: By Riemann's theorem, 'your' theta divisor is (up to translation) the same as the divisor of a holomorphic section in a bundle given by factor's of automorphy...
95,288
Suppose $C\_g$ is a smooth compact complex curve (of genus $g$), and let $J$ be its *Jacobian*. Recall that the Jacobian $J$ of a curve $C\_g$ is a complex torus that can by obtained by contractions of all rational curves on the $g$-th symmetric power of $C\_g$, e.i., $Sym^g(C\_g)$. Recall also that there is a *theta d...
2012/04/26
[ "https://mathoverflow.net/questions/95288", "https://mathoverflow.net", "https://mathoverflow.net/users/13441/" ]
Since my comment was too cryptic, I will spell it out as an answer. A polarization on an abelian variety $A$ is an ample divisor $D$ (modulo linear equivalence). A polarization is principal if the self-intersection $D^g$ is equal to $g!$, where $g = \dim A$. It is well-known that the theta divisor is a principal pola...
In general, let $L$ be a line bundle on a complex torus $X=V/ \Lambda$ of dimension $g$ and let $H$ be the hermitian form corresponding to the first Chern class $c\_1(L)$. The imaginary part $E:= \textrm{Im}(H)$ is an alternating form which is integer-valued on the lattice $\Lambda$. By elementary linear algebra ther...
95,288
Suppose $C\_g$ is a smooth compact complex curve (of genus $g$), and let $J$ be its *Jacobian*. Recall that the Jacobian $J$ of a curve $C\_g$ is a complex torus that can by obtained by contractions of all rational curves on the $g$-th symmetric power of $C\_g$, e.i., $Sym^g(C\_g)$. Recall also that there is a *theta d...
2012/04/26
[ "https://mathoverflow.net/questions/95288", "https://mathoverflow.net", "https://mathoverflow.net/users/13441/" ]
Since my comment was too cryptic, I will spell it out as an answer. A polarization on an abelian variety $A$ is an ample divisor $D$ (modulo linear equivalence). A polarization is principal if the self-intersection $D^g$ is equal to $g!$, where $g = \dim A$. It is well-known that the theta divisor is a principal pola...
This can also be done in a purely algebraic fashion. Take the given description of $\Theta$ as the locus of effective classes on $X=Jac^{g-1}C$. Put $Y=Jac^gC$. Pick a point $D$ on $Y$ with $h^0(C,D)=1$; Abel's theorem (that $C^{(g)}\to Y$ is birational) ensures that this holds for all $D$ outside some locus of codimen...
73,772,012
``` ID Status OfferID 1 Processed 456 1 Processed 123 2 Pending 999 3 Processed 678 3 Pending 789 ``` Based on ID, 1. if ID=1 and having same status then output column(CTSDate) should be max of offerID 2. IF ID=2 and having only one status then output is offerID associated with it 3. I...
2022/09/19
[ "https://Stackoverflow.com/questions/73772012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20032446/" ]
We can use `ROW_NUMBER()` here with appropriate sorting levels: ```sql WITH cte AS ( SELECT t.*, ROW_NUMBER() OVER (PARTITION BY ID ORDER BY Status DESC, OfferID DESC) rn FROM yourTable t ) SELECT ID, Status, OfferID FROM cte WHERE rn = 1 ORDER BY ID; ```
I would calculate the max offer id for IDs with processed status and those with no processed status separately and later append them together. ```sql with tmp1 AS ( /* cases with processed status */ SELECT ID, max(OfferID) AS OfferID FROM tbl WHERE status = 'Processed' GROUP BY ID ), tmp2 AS ( /* ...
3,564,306
I had a problem with my svn server so I had to get all the data back from backup. However the backup was old (a couple of odays ago) and since then I had a few new commits to svn. that means my local svn had newer revisions than the repository I currently have. For me that is ok no problem, I will just use the older re...
2010/08/25
[ "https://Stackoverflow.com/questions/3564306", "https://Stackoverflow.com", "https://Stackoverflow.com/users/345859/" ]
Clear the log cache: Settings-dialog->saved data->log messages (show log dialog).
If you back your repository on the server to an older state you need to do a clean checkout on the client to get back in sync.
583,813
Is there a data type in [eVC++](http://www.google.com/search?q=embedded+visual+c%2B%2B) that is the equivalent of [`__int64`](http://msdn.microsoft.com/en-us/library/s3f49ktz(VS.80).aspx)? None of the aliases compile. And I cannot find any of the long types in `Math.h`. A third party library would also be acceptable.
2009/02/24
[ "https://Stackoverflow.com/questions/583813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3619/" ]
Assuming you are using EVC++ 4.0... You'll first need to make sure you have the Pocket PC 2003 SDK installed. If you are on win mobile 5.0 and up and are still attempting to use EVC++4.0 I will fight you (Ron Burgundy). The PPC 2003 SDK can be found [here](http://www.microsoft.com/downloadS/details.aspx?familyid=9996B...
Do you have access to the [LargeInt](http://doc.ddart.net/msdn/header/include/largeint.h.html) library in eVC++? IIRC this was a standard lib bundled with VC 6.0. VC 6.0 did not support `__int64` natively.
583,813
Is there a data type in [eVC++](http://www.google.com/search?q=embedded+visual+c%2B%2B) that is the equivalent of [`__int64`](http://msdn.microsoft.com/en-us/library/s3f49ktz(VS.80).aspx)? None of the aliases compile. And I cannot find any of the long types in `Math.h`. A third party library would also be acceptable.
2009/02/24
[ "https://Stackoverflow.com/questions/583813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3619/" ]
Assuming you are using EVC++ 4.0... You'll first need to make sure you have the Pocket PC 2003 SDK installed. If you are on win mobile 5.0 and up and are still attempting to use EVC++4.0 I will fight you (Ron Burgundy). The PPC 2003 SDK can be found [here](http://www.microsoft.com/downloadS/details.aspx?familyid=9996B...
"long long" is a synonym for "\_\_int64" in VC++... maybe that works?
17,844,781
I have a question. Assuming I dump a file and do a grep for foo and comes out the result like this: ``` Foo-bar-120:'foo name 1' Foo-bar-130:'foo name 2' Foo-bar-1222:'foo name 3' ``` Etc. All I want is trying to extract the foo name with largest number. For instance in this case, largest number is 1222 and the re...
2013/07/24
[ "https://Stackoverflow.com/questions/17844781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2608898/" ]
Code for [awk](/questions/tagged/awk "show questions tagged 'awk'"): ``` awk -F[-:] '$3>a {a=$3; b=$4} END {print b}' file ``` --- ``` $ cat file Foo-bar-120:'foo name 1' Foo-bar-130:'foo name 2' Foo-bar-1222:'foo name 3' $ awk -F[-:] '$3>a {a=$3; b=$4} END {print b}' file 'foo name 3' ```
Assuming the line format is as shown with 2 hyphens before "the number": ``` cut -d- -f3- | sort -rn | sed '1{s/^[0-9]\+://; q}' ```
17,844,781
I have a question. Assuming I dump a file and do a grep for foo and comes out the result like this: ``` Foo-bar-120:'foo name 1' Foo-bar-130:'foo name 2' Foo-bar-1222:'foo name 3' ``` Etc. All I want is trying to extract the foo name with largest number. For instance in this case, largest number is 1222 and the re...
2013/07/24
[ "https://Stackoverflow.com/questions/17844781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2608898/" ]
Here's how I would do it. I just tested this in Cygwin. Hopefully it works under Linux as well. Put this into a file, such as `mycommand`: ``` #!/usr/bin/awk -f BEGIN { FS="-"; max = 0; maxString = ""; } { num = $3 + 0; # convert string to int if (num > max) { ...
is this ok for you? ``` awk -F'[:-]' '{n=$(NF-1);if(n>m){v=$NF;m=n}}END{print v}' ``` with your data: ``` kent$ echo "Foo-bar-120:’foo name 1’ Foo-bar-130:’foo name 2’ Foo-bar-1222:’foo name 3’"|awk -F'[:-]' '{n=$(NF-1);if(n>m){v=$NF;m=n}}END{print v}' ’foo name 3’ ``` P.S. I like the Field separator `[:-]`
17,844,781
I have a question. Assuming I dump a file and do a grep for foo and comes out the result like this: ``` Foo-bar-120:'foo name 1' Foo-bar-130:'foo name 2' Foo-bar-1222:'foo name 3' ``` Etc. All I want is trying to extract the foo name with largest number. For instance in this case, largest number is 1222 and the re...
2013/07/24
[ "https://Stackoverflow.com/questions/17844781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2608898/" ]
Assuming the line format is as shown with 2 hyphens before "the number": ``` cut -d- -f3- | sort -rn | sed '1{s/^[0-9]\+://; q}' ```
You don't need to use `grep`. you can use `awk` directly on your file as: ``` awk -F"[-:]" '/Foo/ && $3>prev{val=$NF;prev=$3}END{print val}' file ```
17,844,781
I have a question. Assuming I dump a file and do a grep for foo and comes out the result like this: ``` Foo-bar-120:'foo name 1' Foo-bar-130:'foo name 2' Foo-bar-1222:'foo name 3' ``` Etc. All I want is trying to extract the foo name with largest number. For instance in this case, largest number is 1222 and the re...
2013/07/24
[ "https://Stackoverflow.com/questions/17844781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2608898/" ]
Here's how I would do it. I just tested this in Cygwin. Hopefully it works under Linux as well. Put this into a file, such as `mycommand`: ``` #!/usr/bin/awk -f BEGIN { FS="-"; max = 0; maxString = ""; } { num = $3 + 0; # convert string to int if (num > max) { ...
``` $ awk '{gsub(/.*:.|.$/,"")} (NR==1)||($NF>max){max=$NF; val=$0} END{print val}' file foo name 3 ```
17,844,781
I have a question. Assuming I dump a file and do a grep for foo and comes out the result like this: ``` Foo-bar-120:'foo name 1' Foo-bar-130:'foo name 2' Foo-bar-1222:'foo name 3' ``` Etc. All I want is trying to extract the foo name with largest number. For instance in this case, largest number is 1222 and the re...
2013/07/24
[ "https://Stackoverflow.com/questions/17844781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2608898/" ]
``` $ awk '{gsub(/.*:.|.$/,"")} (NR==1)||($NF>max){max=$NF; val=$0} END{print val}' file foo name 3 ```
You don't need to use `grep`. you can use `awk` directly on your file as: ``` awk -F"[-:]" '/Foo/ && $3>prev{val=$NF;prev=$3}END{print val}' file ```
17,844,781
I have a question. Assuming I dump a file and do a grep for foo and comes out the result like this: ``` Foo-bar-120:'foo name 1' Foo-bar-130:'foo name 2' Foo-bar-1222:'foo name 3' ``` Etc. All I want is trying to extract the foo name with largest number. For instance in this case, largest number is 1222 and the re...
2013/07/24
[ "https://Stackoverflow.com/questions/17844781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2608898/" ]
Code for [awk](/questions/tagged/awk "show questions tagged 'awk'"): ``` awk -F[-:] '$3>a {a=$3; b=$4} END {print b}' file ``` --- ``` $ cat file Foo-bar-120:'foo name 1' Foo-bar-130:'foo name 2' Foo-bar-1222:'foo name 3' $ awk -F[-:] '$3>a {a=$3; b=$4} END {print b}' file 'foo name 3' ```
``` $ awk '{gsub(/.*:.|.$/,"")} (NR==1)||($NF>max){max=$NF; val=$0} END{print val}' file foo name 3 ```
17,844,781
I have a question. Assuming I dump a file and do a grep for foo and comes out the result like this: ``` Foo-bar-120:'foo name 1' Foo-bar-130:'foo name 2' Foo-bar-1222:'foo name 3' ``` Etc. All I want is trying to extract the foo name with largest number. For instance in this case, largest number is 1222 and the re...
2013/07/24
[ "https://Stackoverflow.com/questions/17844781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2608898/" ]
Here's how I would do it. I just tested this in Cygwin. Hopefully it works under Linux as well. Put this into a file, such as `mycommand`: ``` #!/usr/bin/awk -f BEGIN { FS="-"; max = 0; maxString = ""; } { num = $3 + 0; # convert string to int if (num > max) { ...
You don't need to use `grep`. you can use `awk` directly on your file as: ``` awk -F"[-:]" '/Foo/ && $3>prev{val=$NF;prev=$3}END{print val}' file ```
17,844,781
I have a question. Assuming I dump a file and do a grep for foo and comes out the result like this: ``` Foo-bar-120:'foo name 1' Foo-bar-130:'foo name 2' Foo-bar-1222:'foo name 3' ``` Etc. All I want is trying to extract the foo name with largest number. For instance in this case, largest number is 1222 and the re...
2013/07/24
[ "https://Stackoverflow.com/questions/17844781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2608898/" ]
is this ok for you? ``` awk -F'[:-]' '{n=$(NF-1);if(n>m){v=$NF;m=n}}END{print v}' ``` with your data: ``` kent$ echo "Foo-bar-120:’foo name 1’ Foo-bar-130:’foo name 2’ Foo-bar-1222:’foo name 3’"|awk -F'[:-]' '{n=$(NF-1);if(n>m){v=$NF;m=n}}END{print v}' ’foo name 3’ ``` P.S. I like the Field separator `[:-]`
You don't need to use `grep`. you can use `awk` directly on your file as: ``` awk -F"[-:]" '/Foo/ && $3>prev{val=$NF;prev=$3}END{print val}' file ```
17,844,781
I have a question. Assuming I dump a file and do a grep for foo and comes out the result like this: ``` Foo-bar-120:'foo name 1' Foo-bar-130:'foo name 2' Foo-bar-1222:'foo name 3' ``` Etc. All I want is trying to extract the foo name with largest number. For instance in this case, largest number is 1222 and the re...
2013/07/24
[ "https://Stackoverflow.com/questions/17844781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2608898/" ]
Code for [awk](/questions/tagged/awk "show questions tagged 'awk'"): ``` awk -F[-:] '$3>a {a=$3; b=$4} END {print b}' file ``` --- ``` $ cat file Foo-bar-120:'foo name 1' Foo-bar-130:'foo name 2' Foo-bar-1222:'foo name 3' $ awk -F[-:] '$3>a {a=$3; b=$4} END {print b}' file 'foo name 3' ```
You don't need to use `grep`. you can use `awk` directly on your file as: ``` awk -F"[-:]" '/Foo/ && $3>prev{val=$NF;prev=$3}END{print val}' file ```
17,844,781
I have a question. Assuming I dump a file and do a grep for foo and comes out the result like this: ``` Foo-bar-120:'foo name 1' Foo-bar-130:'foo name 2' Foo-bar-1222:'foo name 3' ``` Etc. All I want is trying to extract the foo name with largest number. For instance in this case, largest number is 1222 and the re...
2013/07/24
[ "https://Stackoverflow.com/questions/17844781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2608898/" ]
Here's how I would do it. I just tested this in Cygwin. Hopefully it works under Linux as well. Put this into a file, such as `mycommand`: ``` #!/usr/bin/awk -f BEGIN { FS="-"; max = 0; maxString = ""; } { num = $3 + 0; # convert string to int if (num > max) { ...
Assuming the line format is as shown with 2 hyphens before "the number": ``` cut -d- -f3- | sort -rn | sed '1{s/^[0-9]\+://; q}' ```
6,669,395
I've been using php 5.2 and Apache 2.2 and memcached 1.2.6 for a long time, with client-side sharding across a number of hosts. This has worked fine AFAICT. Recently, I've started upgrading memcached clients to php 5.3. This comes from ubuntu server 10.04 LTS. However, I'm starting to see a weird bug, where the value ...
2011/07/12
[ "https://Stackoverflow.com/questions/6669395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/89233/" ]
Probably because you have a semicolon `;` after your `attr("title").substring(5,7)`?
Title in the header is not an attribute. right now you are telling it change this. ``` <div class="div-cell" title="what you are changing is going here"></div> ``` If you are actually trying to change the header title you need to do this. ``` document.title = 'blah'; ``` Also lxa is right, you have a semicolon in...
6,669,395
I've been using php 5.2 and Apache 2.2 and memcached 1.2.6 for a long time, with client-side sharding across a number of hosts. This has worked fine AFAICT. Recently, I've started upgrading memcached clients to php 5.3. This comes from ubuntu server 10.04 LTS. However, I'm starting to see a weird bug, where the value ...
2011/07/12
[ "https://Stackoverflow.com/questions/6669395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/89233/" ]
I found my error: I changed `"title"` to `"id"`. My mistake was that in the tap function, I was calling another div that didn't contain the `"id"` tag. ``` $('.div-cell').tap(function() { var i; var myDate2; for ...
Title in the header is not an attribute. right now you are telling it change this. ``` <div class="div-cell" title="what you are changing is going here"></div> ``` If you are actually trying to change the header title you need to do this. ``` document.title = 'blah'; ``` Also lxa is right, you have a semicolon in...
67,206,928
I am trying to create an object with modified keys after `map()` function (the data is from API), here is my code: ``` const getData = mySchedule.schedules.map((data) => ({ [data.id]: false, })); setCheckId(getData); ``` This code return: [![enter image description here](https://i.stack.imgur.com/...
2021/04/22
[ "https://Stackoverflow.com/questions/67206928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15660210/" ]
I found the hint in what looks like the original [feature description](https://codereview.qt-project.org/c/pyside/pyside-setup/+/304274): > > The decision depends of the following setting at the beginning of > a module after PySide2 import: > > > > ``` > from __feature__ import snake_case > > ``` > > The key t...
One important point is that for popper IDE auto-completion support one has to re-generate the python stubs files to reflect the selected notation. This is done simply by calling: ``` pyside6-genpyi all --feature snake_case true_property ``` Then one needs to add the `__feature__` tag after importing PySide as: ``` ...
322,757
I dragged an image(tried both jpg and tiff) to a GIF file and Preview just opens up two documents in one window, instead of adding the image to the first document (GIF). I have Preview 10.0. [![Picture of what Preview looks like when I try to add 'computer screen' to the file 'happy girl on desk'.](https://i.stack.img...
2018/04/16
[ "https://apple.stackexchange.com/questions/322757", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/285725/" ]
Preview is **not** an image editor. It's a *viewer*. To create images, you need something that allows you to do this. You can get paid applications to do this and there are FOSS (Free Open Source) tools available. Some of the more popular ones are: * [Adobe Illustrator](https://www.adobe.com/products/illustrator.html...
Preview is simple but powerful, and you can add images, remove parts of images, and if you need to edit slides in animated gifs you can. Click on view and show markup tool bar for the tools to appear. You can do a lot more editing in Preview than you can do in word. Even Apple says ya can. <https://support.apple....
9,870,960
In my application, I've `ellipsize`d my `TextView` so that if the text is too large, it'll show `...` at the end using `android:ellipsize="end"`. e.g.Text `ABCDEFGHIJKLMNOPQRSTUVWXYZ` is shown as `ABCDEFGHIJ...`. But when the text is small, like `ABCDEF` it still shows `...` at the end making the text look like `AB......
2012/03/26
[ "https://Stackoverflow.com/questions/9870960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/840669/" ]
//In your textview add the below attributes also ``` android:maxEms="8" android:singleLine="true" ``` **NOTE:** you can adjust the ems size to how many chars you want to show.
``` txtvw.setText("The Indian economy is the world's eleventh-largest by nominal GDP and third-largest by purchasing power parity (PPP). " + " Following market-based economic reforms in 1991, India became one of the fastest-growing major economies; " + " it is considered a new...
32,499,073
I have problem configuring the hibernate 5.0.1 with MySQL, I saw some questions here stating there is a bug in the version 4, I am not sure weather this is the same bug or I am doing something wrong. Here is my configuration file hibernate.cfg.xml ``` <hibernate-configuration xmlns="http://www.hibernate.org/x...
2015/09/10
[ "https://Stackoverflow.com/questions/32499073", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1841880/" ]
So here is the solution. Replace ``` <hibernate-configuration xmlns="http://www.hibernate.org/xsd/hibernate-configuration" xsi:schemaLocation="http://www.hibernate.org/xsd/hibernate-configuration hibernate-configuration-4.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> ``` with...
Try to insert the following at the beginning of the hibernate.cfg.xml: ``` <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> ```
32,044,734
``` if($band == "something"){ $que = "BETWEEN '1000' and '2000'"; } if($band == "somethingelse"){ $que = "BETWEEN '2000' and '5000'"; } if($band == "somethingelseelse"){ $que = "BETWEEN '5000' and '10000'"; } if($band == "againsomethingelse"){ $que = "BETWEEN '10000' and '30000'"; } $query = mys...
2015/08/17
[ "https://Stackoverflow.com/questions/32044734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5234167/" ]
Relational data is stored in tables. You don't say whether the interior dicts always have the same structure, so for the purposes of this answer I assume they have. In these circumstances it would be simplest to define a table with three colummns, which I call `name`, `age` and `sex`. The definition would look somethi...
You need two tables. First for exmpl Persons: ``` id name 1 Prem 2 Sameer ... ``` Second stored value: ``` id fk_persons age sex 1 1 23 male 2 2 22 male ``` usualy structure is table for dictionary.
32,044,734
``` if($band == "something"){ $que = "BETWEEN '1000' and '2000'"; } if($band == "somethingelse"){ $que = "BETWEEN '2000' and '5000'"; } if($band == "somethingelseelse"){ $que = "BETWEEN '5000' and '10000'"; } if($band == "againsomethingelse"){ $que = "BETWEEN '10000' and '30000'"; } $query = mys...
2015/08/17
[ "https://Stackoverflow.com/questions/32044734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5234167/" ]
You could save the dictionary as type `TEXT`, so it would be saved as: ``` "{ 'Prem': { 'age' : '23' , 'sex': 'male' } , 'Sameer' : { 'age' : '22' , 'sex' : 'male'} }" ``` You can save this in the database like this: ``` ogdict = { 'Prem': { 'age' : '23' , 'sex': 'male' } , 'Sameer' : { 'age' : '22' , 'sex' : 'male...
You need two tables. First for exmpl Persons: ``` id name 1 Prem 2 Sameer ... ``` Second stored value: ``` id fk_persons age sex 1 1 23 male 2 2 22 male ``` usualy structure is table for dictionary.
32,044,734
``` if($band == "something"){ $que = "BETWEEN '1000' and '2000'"; } if($band == "somethingelse"){ $que = "BETWEEN '2000' and '5000'"; } if($band == "somethingelseelse"){ $que = "BETWEEN '5000' and '10000'"; } if($band == "againsomethingelse"){ $que = "BETWEEN '10000' and '30000'"; } $query = mys...
2015/08/17
[ "https://Stackoverflow.com/questions/32044734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5234167/" ]
Relational data is stored in tables. You don't say whether the interior dicts always have the same structure, so for the purposes of this answer I assume they have. In these circumstances it would be simplest to define a table with three colummns, which I call `name`, `age` and `sex`. The definition would look somethi...
You could save the dictionary as type `TEXT`, so it would be saved as: ``` "{ 'Prem': { 'age' : '23' , 'sex': 'male' } , 'Sameer' : { 'age' : '22' , 'sex' : 'male'} }" ``` You can save this in the database like this: ``` ogdict = { 'Prem': { 'age' : '23' , 'sex': 'male' } , 'Sameer' : { 'age' : '22' , 'sex' : 'male...
133,097
[![enter image description here](https://i.stack.imgur.com/ouWUy.jpg)](https://i.stack.imgur.com/ouWUy.jpg)I have an old brass Schlage unkeyed door knob/latch set. I would like to install it in a door, but can't figure out how to take it apart. The rosettes thread on, but I can't figure out how to get a knob off. There...
2018/02/17
[ "https://diy.stackexchange.com/questions/133097", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/81686/" ]
A pin in the small hole starts it. Pull on the handle as you push the pin in the hole. An ice pick or small nail will be strong enough to do what you need. After the knob is off, you may be able to remove the rosettes as you suggest, but a lot of the rosettes are removed by prying of the rosette by setting a flat screw...
So I have the same lock, I bend a fork to use as the push pin, wiggle it with some force and got it to come off.
133,097
[![enter image description here](https://i.stack.imgur.com/ouWUy.jpg)](https://i.stack.imgur.com/ouWUy.jpg)I have an old brass Schlage unkeyed door knob/latch set. I would like to install it in a door, but can't figure out how to take it apart. The rosettes thread on, but I can't figure out how to get a knob off. There...
2018/02/17
[ "https://diy.stackexchange.com/questions/133097", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/81686/" ]
A pin in the small hole starts it. Pull on the handle as you push the pin in the hole. An ice pick or small nail will be strong enough to do what you need. After the knob is off, you may be able to remove the rosettes as you suggest, but a lot of the rosettes are removed by prying of the rosette by setting a flat screw...
You have to turn the inner handle until you see a small depression of metal. That is what you push into and pull the handle.
137,428
I have a page which has a [jquery tab function](https://jqueryui.com/tabs/) to output the list of pages that are the children of this page (Bio, Archives, Contact). However I am trying to make a conditional in the foreach loop to no avail. ``` <?php // get_posts function: http://codex.wordpress.org/Template_Tags/ge...
2014/03/10
[ "https://wordpress.stackexchange.com/questions/137428", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/32287/" ]
After inspecting your theme, this is what I came up with. I've taken the liberty to include Ruben's solution as well to make this answer as complete as possible. There are several problems here: Number 1. `load_theme_textdomain( 'transparent', get_template_directory_uri() .'/languages' );` should be: ``` funct...
Don't use **get\_template\_directory\_uri()**. Use **get\_template\_directory()** instead. Your code should look like this: ``` load_theme_textdomain( 'transparent', get_template_directory() . '/languages' ); $locale = get_locale(); $locale_file = get_template_directory() . "/languages/$locale.php"; ...
137,428
I have a page which has a [jquery tab function](https://jqueryui.com/tabs/) to output the list of pages that are the children of this page (Bio, Archives, Contact). However I am trying to make a conditional in the foreach loop to no avail. ``` <?php // get_posts function: http://codex.wordpress.org/Template_Tags/ge...
2014/03/10
[ "https://wordpress.stackexchange.com/questions/137428", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/32287/" ]
Don't use **get\_template\_directory\_uri()**. Use **get\_template\_directory()** instead. Your code should look like this: ``` load_theme_textdomain( 'transparent', get_template_directory() . '/languages' ); $locale = get_locale(); $locale_file = get_template_directory() . "/languages/$locale.php"; ...
When using `load_theme_textdomain` your language filename must be named based on the locale exactly. Name it ***en\_US.mo*** instead of ***transparent-en\_US.mo*** Read the instructions carefully at: <https://codex.wordpress.org/Function_Reference/load_theme_textdomain>
137,428
I have a page which has a [jquery tab function](https://jqueryui.com/tabs/) to output the list of pages that are the children of this page (Bio, Archives, Contact). However I am trying to make a conditional in the foreach loop to no avail. ``` <?php // get_posts function: http://codex.wordpress.org/Template_Tags/ge...
2014/03/10
[ "https://wordpress.stackexchange.com/questions/137428", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/32287/" ]
After inspecting your theme, this is what I came up with. I've taken the liberty to include Ruben's solution as well to make this answer as complete as possible. There are several problems here: Number 1. `load_theme_textdomain( 'transparent', get_template_directory_uri() .'/languages' );` should be: ``` funct...
When using `load_theme_textdomain` your language filename must be named based on the locale exactly. Name it ***en\_US.mo*** instead of ***transparent-en\_US.mo*** Read the instructions carefully at: <https://codex.wordpress.org/Function_Reference/load_theme_textdomain>
29,319,123
It appears that `CWInterface` is deprecated in 10.10 Yosemite, and it has been replaced with `CWWiFiClient`. In `CWInterface` I would normally use the `setPower` method to disable WiFi, but I do not know of a similar method in `CWWiFiClient`. Does anyone know how to disable WiFi with `CWWiFiClient`? Thanks.
2015/03/28
[ "https://Stackoverflow.com/questions/29319123", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2730985/" ]
Get CWInterface instance like this: ``` let _en: CWInterface! = CWWiFiClient.sharedWiFiClient().interface() ``` and now you can use the `setPower` method to disable WiFi again!
According to Apple CWInterface and setPower is still current in 10.10, but has just been modified. <https://developer.apple.com/library/mac/documentation/General/Reference/APIDiffsMacOSX10_10SeedDiff/frameworks/CoreWLAN.html>
19,265,626
I'm new in Android dev. I read some books about it. And all authors strongly recommend to use anonymous classes instead of class redefinition. They say that ``` TextView txtTitle; ... txtTitle.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { } }); ``` better than ``` ...
2013/10/09
[ "https://Stackoverflow.com/questions/19265626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1991579/" ]
Anonymous class will have access to the final outer variables, so it might be more convienient to use this. For instance: ``` final String x = "123"; Button button = (Button) findViewById(R.id.button); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { // Y...
why not to implement OnClickListener in your Activity class? ``` class MyActivity extends Activity implements OnClickListener ```
64,623,139
I've been having troubles with the Control + S button, I would like to remap the Control + S button to something else instead of the save page as window. \*\* I know that its not possible to disable it\*\* I want the functionality like what <https://www.hastebin.com/> has, where if you control + s it does an action. I...
2020/10/31
[ "https://Stackoverflow.com/questions/64623139", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11752216/" ]
Use `keydown` rather than `keypress`: ```js $(window).on("keydown", (e) => { if (e.key === "s" && e.ctrlKey) { console.log("Ctrl+S"); e.preventDefault(); } }); ``` ```html <div>Click here, then press Ctrl+S</div> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"><...
CTRL+S fires keydown event, not keypress event AFAIK. ``` $(window).on("keydown", (e) => { if (e.key === "s" && e.ctrlKey) e.preventDefault(); }); ```
12,820,884
For a framework I'm writing I would like to measure how much a piece of (bash) code takes to execute and then print the elapsed time in seconds. For measuring, I do the following: ``` start=$(date +%s%N) # do something here elapsed_time=$(($(date +%s%N) - start)) ``` This gives me the elapsed seconds concatenated...
2012/10/10
[ "https://Stackoverflow.com/questions/12820884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1178669/" ]
You can use `bc` command: ``` elapsed_time_in_ms=$(echo "scale=3;$elapsed_time/1000000" | bc) ``` The `scale` basically sets the number of digits you want after the `.`
This can also be done using shell parameter expansion or via `printf`. For example, running the following two sequences one after the other printed out `1349883230.715` and `1349883230.721` in one run, and `1349884003.025` and `1349884003.032` in another. (The `%N` date format fills with leading zeroes.) ``` s=$(dat...