qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
53,670,223
So I know that you should declare char arrays to be one element bigger than the word you want to put there because of the `\0` that has to be at the end, but what about char arrays that I don't want to use as words? I'm currently writing a program in which i store an array of keyboard letters that have some function a...
2018/12/07
[ "https://Stackoverflow.com/questions/53670223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5900271/" ]
That is probably not necessary. A null terminator is not a requirement for arrays of `char`; it is a requirement for "C-strings", things that you intend to use as unitary blobs of data, particularly if you intend to pass them to C API functions. It's the conventional way that the "length" of the string is determined. ...
`\0` will certainly make it easier when wanting to use functions like `strlen`, `strcmp`, `strcat`and the like, but is not required. An aside - We have an entire enterprise code base built upon strings (char arrays) with no null terminators in the database. Works just fine.
53,670,223
So I know that you should declare char arrays to be one element bigger than the word you want to put there because of the `\0` that has to be at the end, but what about char arrays that I don't want to use as words? I'm currently writing a program in which i store an array of keyboard letters that have some function a...
2018/12/07
[ "https://Stackoverflow.com/questions/53670223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5900271/" ]
If you're using C++, you should probably just use `std::string` or `std::vector<char>` or even `std::array<char>` and not worry about terminators.
`\0` will certainly make it easier when wanting to use functions like `strlen`, `strcmp`, `strcat`and the like, but is not required. An aside - We have an entire enterprise code base built upon strings (char arrays) with no null terminators in the database. Works just fine.
53,670,223
So I know that you should declare char arrays to be one element bigger than the word you want to put there because of the `\0` that has to be at the end, but what about char arrays that I don't want to use as words? I'm currently writing a program in which i store an array of keyboard letters that have some function a...
2018/12/07
[ "https://Stackoverflow.com/questions/53670223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5900271/" ]
That is probably not necessary. A null terminator is not a requirement for arrays of `char`; it is a requirement for "C-strings", things that you intend to use as unitary blobs of data, particularly if you intend to pass them to C API functions. It's the conventional way that the "length" of the string is determined. ...
It depends on what you are trying to do, if you are trying to define a *C-style string then, you need the terminator since the C-library won't be able to calculate the size of the string and other things if you don't*... In C++, though, the size of the string is already stored inside the `std::string` class along with...
53,670,223
So I know that you should declare char arrays to be one element bigger than the word you want to put there because of the `\0` that has to be at the end, but what about char arrays that I don't want to use as words? I'm currently writing a program in which i store an array of keyboard letters that have some function a...
2018/12/07
[ "https://Stackoverflow.com/questions/53670223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5900271/" ]
If you're using C++, you should probably just use `std::string` or `std::vector<char>` or even `std::array<char>` and not worry about terminators.
It depends on what you are trying to do, if you are trying to define a *C-style string then, you need the terminator since the C-library won't be able to calculate the size of the string and other things if you don't*... In C++, though, the size of the string is already stored inside the `std::string` class along with...
53,670,223
So I know that you should declare char arrays to be one element bigger than the word you want to put there because of the `\0` that has to be at the end, but what about char arrays that I don't want to use as words? I'm currently writing a program in which i store an array of keyboard letters that have some function a...
2018/12/07
[ "https://Stackoverflow.com/questions/53670223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5900271/" ]
The array should have, at least, the same number of elements as the data you will put there. So, if: * you don't need the '\0' * you won't place it there * you won't use routines that will depend on an '\0' to tell you the array size ... you are good with not using the trailing '\0'
If you're using C++, you should probably just use `std::string` or `std::vector<char>` or even `std::array<char>` and not worry about terminators.
53,670,223
So I know that you should declare char arrays to be one element bigger than the word you want to put there because of the `\0` that has to be at the end, but what about char arrays that I don't want to use as words? I'm currently writing a program in which i store an array of keyboard letters that have some function a...
2018/12/07
[ "https://Stackoverflow.com/questions/53670223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5900271/" ]
That is probably not necessary. A null terminator is not a requirement for arrays of `char`; it is a requirement for "C-strings", things that you intend to use as unitary blobs of data, particularly if you intend to pass them to C API functions. It's the conventional way that the "length" of the string is determined. ...
The array should have, at least, the same number of elements as the data you will put there. So, if: * you don't need the '\0' * you won't place it there * you won't use routines that will depend on an '\0' to tell you the array size ... you are good with not using the trailing '\0'
53,670,223
So I know that you should declare char arrays to be one element bigger than the word you want to put there because of the `\0` that has to be at the end, but what about char arrays that I don't want to use as words? I'm currently writing a program in which i store an array of keyboard letters that have some function a...
2018/12/07
[ "https://Stackoverflow.com/questions/53670223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5900271/" ]
It depends on what you are trying to do, if you are trying to define a *C-style string then, you need the terminator since the C-library won't be able to calculate the size of the string and other things if you don't*... In C++, though, the size of the string is already stored inside the `std::string` class along with...
`\0` will certainly make it easier when wanting to use functions like `strlen`, `strcmp`, `strcat`and the like, but is not required. An aside - We have an entire enterprise code base built upon strings (char arrays) with no null terminators in the database. Works just fine.
53,670,223
So I know that you should declare char arrays to be one element bigger than the word you want to put there because of the `\0` that has to be at the end, but what about char arrays that I don't want to use as words? I'm currently writing a program in which i store an array of keyboard letters that have some function a...
2018/12/07
[ "https://Stackoverflow.com/questions/53670223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5900271/" ]
It depends on usage. If you want to use it not as just byte array, but as c-string with probably usage of some standard string algorithms (`strcmp` and so on), or output to the stream - your array should ends with `\0`.
It depends on what you are trying to do, if you are trying to define a *C-style string then, you need the terminator since the C-library won't be able to calculate the size of the string and other things if you don't*... In C++, though, the size of the string is already stored inside the `std::string` class along with...
53,670,223
So I know that you should declare char arrays to be one element bigger than the word you want to put there because of the `\0` that has to be at the end, but what about char arrays that I don't want to use as words? I'm currently writing a program in which i store an array of keyboard letters that have some function a...
2018/12/07
[ "https://Stackoverflow.com/questions/53670223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5900271/" ]
The array should have, at least, the same number of elements as the data you will put there. So, if: * you don't need the '\0' * you won't place it there * you won't use routines that will depend on an '\0' to tell you the array size ... you are good with not using the trailing '\0'
It depends on usage. If you want to use it not as just byte array, but as c-string with probably usage of some standard string algorithms (`strcmp` and so on), or output to the stream - your array should ends with `\0`.
53,670,223
So I know that you should declare char arrays to be one element bigger than the word you want to put there because of the `\0` that has to be at the end, but what about char arrays that I don't want to use as words? I'm currently writing a program in which i store an array of keyboard letters that have some function a...
2018/12/07
[ "https://Stackoverflow.com/questions/53670223", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5900271/" ]
That is probably not necessary. A null terminator is not a requirement for arrays of `char`; it is a requirement for "C-strings", things that you intend to use as unitary blobs of data, particularly if you intend to pass them to C API functions. It's the conventional way that the "length" of the string is determined. ...
If you're using C++, you should probably just use `std::string` or `std::vector<char>` or even `std::array<char>` and not worry about terminators.
80,265
I recently changed the radial blur center to a corner and I would like to set it back to default (in the center). Is there any keyboard shortcut? [![enter image description here](https://i.stack.imgur.com/Q7vPn.jpg)](https://i.stack.imgur.com/Q7vPn.jpg)
2016/11/15
[ "https://graphicdesign.stackexchange.com/questions/80265", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/281/" ]
Hold down `⌘` and the Cancel button will change to Default. [![enter image description here](https://i.stack.imgur.com/zWX5R.png)](https://i.stack.imgur.com/zWX5R.png) [![enter image description here](https://i.stack.imgur.com/MDX4r.png)](https://i.stack.imgur.com/MDX4r.png) Click Default [![enter image description...
Restarting Ps will reset to default (If you know another method, please answer and i'll mark your answer)
8,569,303
I am trying to minify a third-party JavaScript library using Google Closure Compiler, but it errors out at below line: ``` inBlock.package = package = name ``` The error is > > ERROR - Parse error. missing name after . operator\*\* > > > `name` above is a local variable inside a function and `inBlock` is an in...
2011/12/20
[ "https://Stackoverflow.com/questions/8569303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/325192/" ]
You're right, `package` is a reserved word in JavaScript (but only in strict mode, which will be why the code works in some places). `package` is future-reserved, which means it's not used for anything, but you can't use it to name variables. However (if you really must), you can use it to name keys in objects like th...
`package` is a keyword (from Java) reserved for possible later use in JavaScript. The solution? Name your variable something else :) If you can't change the name of `inBlock.package`, access it using the bracket notation instead: ``` inBlock['package'] ```
8,569,303
I am trying to minify a third-party JavaScript library using Google Closure Compiler, but it errors out at below line: ``` inBlock.package = package = name ``` The error is > > ERROR - Parse error. missing name after . operator\*\* > > > `name` above is a local variable inside a function and `inBlock` is an in...
2011/12/20
[ "https://Stackoverflow.com/questions/8569303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/325192/" ]
You're right, `package` is a reserved word in JavaScript (but only in strict mode, which will be why the code works in some places). `package` is future-reserved, which means it's not used for anything, but you can't use it to name variables. However (if you really must), you can use it to name keys in objects like th...
According to [MDN](https://developer.mozilla.org/en/JavaScript/Reference/Reserved_Words#Words_reserved_for_possible_future_use), `package` is in the "reserved for the future" category. Depending on which version of which browser you are using and whether your code is in strict mode you may or may not be able to use tho...
8,569,303
I am trying to minify a third-party JavaScript library using Google Closure Compiler, but it errors out at below line: ``` inBlock.package = package = name ``` The error is > > ERROR - Parse error. missing name after . operator\*\* > > > `name` above is a local variable inside a function and `inBlock` is an in...
2011/12/20
[ "https://Stackoverflow.com/questions/8569303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/325192/" ]
You're right, `package` is a reserved word in JavaScript (but only in strict mode, which will be why the code works in some places). `package` is future-reserved, which means it's not used for anything, but you can't use it to name variables. However (if you really must), you can use it to name keys in objects like th...
"package" is a reserved word in ecmascript 3. ecmascript 5 reduced the reserved word set making this availables to browser that implemented it, and introduced it again in ecmascript 5 "strict" mode (which is to be the basis of future emcascript revisions). Ecmascript 5 also changed the restrictions placed on reserved ...
67,802,543
how to get proxy randomly? and get only one? I've made the code as below but I don't know how to get the proxy randomly, and I want to get the proxy also based on the page, anyone know how? ``` import requests from bs4 import BeautifulSoup url = 'https://hidemy.name/en/proxy-list/?anon=34#list' r = requests.get(url...
2021/06/02
[ "https://Stackoverflow.com/questions/67802543", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15193861/" ]
Expressed in formal language, the annotation translates to: `for all 'a, 'a≤'x and 'a≤'y implies 'a≤'r` With `'x`, `'y` and `'r` the lifetimes of `x`, `y`, and the return value respectively. This links the lifetime of the return value to the lifetimes of the parameters because for that relation to hold *for all 'a*,...
We can consider the case from your example code with a slight scope modification ```rust fn main() { let string1 = String::from("abcd"); { let string2 = "xyz"; let result = longest(string1.as_str(), string2); println!("The longest string is {}", result); } } fn longest<'a>(x: &'a ...
37,219,103
Thanks in advance for your help. I am having a hard time keeping my codebase clean. I want to avoid intermixing PHP, HTML, and CSS. Currently, my main site is broken down into numerous smaller tabs. The PHP code for these tabs is dynamically included after an ajax call is made. ``` elseif (file_exists('templates/cus...
2016/05/13
[ "https://Stackoverflow.com/questions/37219103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6301661/" ]
Just `print` the `<script>` tag to include it: ``` print '<script src="templates/custom/'.$center.'/'.$section.'/'.$tab.'.js'" type="text/javascript"></script>'; ```
Javascript files cannot be included by php function. Use the below code ``` elseif (file_exists('templates/custom/'.$center."/".$section."/".$tab.".php")) { include 'templates/custom/'.$center."/".$section."/".$tab.".php"; $file_path = "javascript external file path"; // replace with correct file path ?> <script l...
37,219,103
Thanks in advance for your help. I am having a hard time keeping my codebase clean. I want to avoid intermixing PHP, HTML, and CSS. Currently, my main site is broken down into numerous smaller tabs. The PHP code for these tabs is dynamically included after an ajax call is made. ``` elseif (file_exists('templates/cus...
2016/05/13
[ "https://Stackoverflow.com/questions/37219103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6301661/" ]
Javascript files cannot be included by php function. Use the below code ``` elseif (file_exists('templates/custom/'.$center."/".$section."/".$tab.".php")) { include 'templates/custom/'.$center."/".$section."/".$tab.".php"; $file_path = "javascript external file path"; // replace with correct file path ?> <script l...
hi in my case i use module base template that seprated to smaller parts.i have 3 main UI part in my site 1.public site js for all templates jquery,bootstrap ,... that use in all templates must put here 2.each style or template has a js folder that all public js file of this templates must be there 3.each module in te...
37,219,103
Thanks in advance for your help. I am having a hard time keeping my codebase clean. I want to avoid intermixing PHP, HTML, and CSS. Currently, my main site is broken down into numerous smaller tabs. The PHP code for these tabs is dynamically included after an ajax call is made. ``` elseif (file_exists('templates/cus...
2016/05/13
[ "https://Stackoverflow.com/questions/37219103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6301661/" ]
Javascript files cannot be included by php function. Use the below code ``` elseif (file_exists('templates/custom/'.$center."/".$section."/".$tab.".php")) { include 'templates/custom/'.$center."/".$section."/".$tab.".php"; $file_path = "javascript external file path"; // replace with correct file path ?> <script l...
PHP include()'s are server-side. JavaScript is client-side. Therefore, you cannot use include() on a JavaScript. However, if you would like to load a JavaScript with a URL that you want, use this: `$url = "JAVASCRIPT URL HERE"; echo('<script src="'. $url .'"></script>');`
37,219,103
Thanks in advance for your help. I am having a hard time keeping my codebase clean. I want to avoid intermixing PHP, HTML, and CSS. Currently, my main site is broken down into numerous smaller tabs. The PHP code for these tabs is dynamically included after an ajax call is made. ``` elseif (file_exists('templates/cus...
2016/05/13
[ "https://Stackoverflow.com/questions/37219103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6301661/" ]
Just `print` the `<script>` tag to include it: ``` print '<script src="templates/custom/'.$center.'/'.$section.'/'.$tab.'.js'" type="text/javascript"></script>'; ```
hi in my case i use module base template that seprated to smaller parts.i have 3 main UI part in my site 1.public site js for all templates jquery,bootstrap ,... that use in all templates must put here 2.each style or template has a js folder that all public js file of this templates must be there 3.each module in te...
37,219,103
Thanks in advance for your help. I am having a hard time keeping my codebase clean. I want to avoid intermixing PHP, HTML, and CSS. Currently, my main site is broken down into numerous smaller tabs. The PHP code for these tabs is dynamically included after an ajax call is made. ``` elseif (file_exists('templates/cus...
2016/05/13
[ "https://Stackoverflow.com/questions/37219103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6301661/" ]
Just `print` the `<script>` tag to include it: ``` print '<script src="templates/custom/'.$center.'/'.$section.'/'.$tab.'.js'" type="text/javascript"></script>'; ```
PHP include()'s are server-side. JavaScript is client-side. Therefore, you cannot use include() on a JavaScript. However, if you would like to load a JavaScript with a URL that you want, use this: `$url = "JAVASCRIPT URL HERE"; echo('<script src="'. $url .'"></script>');`
121,149
I made a New York-style pizza using recipes from the Elements of Pizza book by Ken Forkish, and some of the cheese and pepperoni slid off in the oven while baking. This was my first time using these recipes and a baking steel. I believe I followed the recipes pretty faithfully, measured everything by weight, etc. The ...
2022/07/25
[ "https://cooking.stackexchange.com/questions/121149", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/100134/" ]
It likely comes down to how you've formed the crust. The "normal" method involves pushing the gas out of the middle of the crust, ideally shifting it to the outer edge. So the middle of the crust ends up fairly thin and dense, and the outer edge has more remaining bubbles. If you pull out the crust more gently, and don...
I see two possibilities, the first is that the toppings slid off when you slid the pie off the peel, the other is that the pizza puffed up when baking and the toppings slid off then. If the pizza base sticks to the peel the tendency is to tip it up and try and shove it off, which can send your toppings flying. The tri...
121,149
I made a New York-style pizza using recipes from the Elements of Pizza book by Ken Forkish, and some of the cheese and pepperoni slid off in the oven while baking. This was my first time using these recipes and a baking steel. I believe I followed the recipes pretty faithfully, measured everything by weight, etc. The ...
2022/07/25
[ "https://cooking.stackexchange.com/questions/121149", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/100134/" ]
I see two possibilities, the first is that the toppings slid off when you slid the pie off the peel, the other is that the pizza puffed up when baking and the toppings slid off then. If the pizza base sticks to the peel the tendency is to tip it up and try and shove it off, which can send your toppings flying. The tri...
It doesn't look like dough/crust bubbles to me, because those usually don't deflate without obvious signs. Cheese usually falls off of crust bubbles. The pepperonis aren't the only thing that moved; the cheese also spread. It looks to me like the cheese just carried the pepperonis with it. Examples of crust bubbles: ...
121,149
I made a New York-style pizza using recipes from the Elements of Pizza book by Ken Forkish, and some of the cheese and pepperoni slid off in the oven while baking. This was my first time using these recipes and a baking steel. I believe I followed the recipes pretty faithfully, measured everything by weight, etc. The ...
2022/07/25
[ "https://cooking.stackexchange.com/questions/121149", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/100134/" ]
I see two possibilities, the first is that the toppings slid off when you slid the pie off the peel, the other is that the pizza puffed up when baking and the toppings slid off then. If the pizza base sticks to the peel the tendency is to tip it up and try and shove it off, which can send your toppings flying. The tri...
Maybe a bit of folded newspaper under one of the legs of the oven might help.
121,149
I made a New York-style pizza using recipes from the Elements of Pizza book by Ken Forkish, and some of the cheese and pepperoni slid off in the oven while baking. This was my first time using these recipes and a baking steel. I believe I followed the recipes pretty faithfully, measured everything by weight, etc. The ...
2022/07/25
[ "https://cooking.stackexchange.com/questions/121149", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/100134/" ]
It likely comes down to how you've formed the crust. The "normal" method involves pushing the gas out of the middle of the crust, ideally shifting it to the outer edge. So the middle of the crust ends up fairly thin and dense, and the outer edge has more remaining bubbles. If you pull out the crust more gently, and don...
I think it's probably bubbles, as mentioned in other answers. Since you have a relatively thin crust you can try [docking](https://www.pmq.com/dough-docking/) your dough. Docking means pressing dots into the dough so that small bubbles form instead of large ones (like crackers that have a pattern of dots). They make sp...
121,149
I made a New York-style pizza using recipes from the Elements of Pizza book by Ken Forkish, and some of the cheese and pepperoni slid off in the oven while baking. This was my first time using these recipes and a baking steel. I believe I followed the recipes pretty faithfully, measured everything by weight, etc. The ...
2022/07/25
[ "https://cooking.stackexchange.com/questions/121149", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/100134/" ]
It likely comes down to how you've formed the crust. The "normal" method involves pushing the gas out of the middle of the crust, ideally shifting it to the outer edge. So the middle of the crust ends up fairly thin and dense, and the outer edge has more remaining bubbles. If you pull out the crust more gently, and don...
It doesn't look like dough/crust bubbles to me, because those usually don't deflate without obvious signs. Cheese usually falls off of crust bubbles. The pepperonis aren't the only thing that moved; the cheese also spread. It looks to me like the cheese just carried the pepperonis with it. Examples of crust bubbles: ...
121,149
I made a New York-style pizza using recipes from the Elements of Pizza book by Ken Forkish, and some of the cheese and pepperoni slid off in the oven while baking. This was my first time using these recipes and a baking steel. I believe I followed the recipes pretty faithfully, measured everything by weight, etc. The ...
2022/07/25
[ "https://cooking.stackexchange.com/questions/121149", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/100134/" ]
It likely comes down to how you've formed the crust. The "normal" method involves pushing the gas out of the middle of the crust, ideally shifting it to the outer edge. So the middle of the crust ends up fairly thin and dense, and the outer edge has more remaining bubbles. If you pull out the crust more gently, and don...
Maybe a bit of folded newspaper under one of the legs of the oven might help.
121,149
I made a New York-style pizza using recipes from the Elements of Pizza book by Ken Forkish, and some of the cheese and pepperoni slid off in the oven while baking. This was my first time using these recipes and a baking steel. I believe I followed the recipes pretty faithfully, measured everything by weight, etc. The ...
2022/07/25
[ "https://cooking.stackexchange.com/questions/121149", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/100134/" ]
I think it's probably bubbles, as mentioned in other answers. Since you have a relatively thin crust you can try [docking](https://www.pmq.com/dough-docking/) your dough. Docking means pressing dots into the dough so that small bubbles form instead of large ones (like crackers that have a pattern of dots). They make sp...
It doesn't look like dough/crust bubbles to me, because those usually don't deflate without obvious signs. Cheese usually falls off of crust bubbles. The pepperonis aren't the only thing that moved; the cheese also spread. It looks to me like the cheese just carried the pepperonis with it. Examples of crust bubbles: ...
121,149
I made a New York-style pizza using recipes from the Elements of Pizza book by Ken Forkish, and some of the cheese and pepperoni slid off in the oven while baking. This was my first time using these recipes and a baking steel. I believe I followed the recipes pretty faithfully, measured everything by weight, etc. The ...
2022/07/25
[ "https://cooking.stackexchange.com/questions/121149", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/100134/" ]
I think it's probably bubbles, as mentioned in other answers. Since you have a relatively thin crust you can try [docking](https://www.pmq.com/dough-docking/) your dough. Docking means pressing dots into the dough so that small bubbles form instead of large ones (like crackers that have a pattern of dots). They make sp...
Maybe a bit of folded newspaper under one of the legs of the oven might help.
5,352,175
I've got a image... and if the image's height is greater than maxHeight, or the width is greater than maxWidth, I'd like to proportionally resize the image so that it fits in maxWidth X maxHeight.
2011/03/18
[ "https://Stackoverflow.com/questions/5352175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/574078/" ]
While this can be done, what happens when the user's screen is much bigger than the native size of the image? Do you stretch it to the point of it degrading into pixels? What happens with people with smaller screens - do they have to waste time and bandwidth downloading an image that is much larger than they're capabl...
You can set the attributes of the image tag using JavaScript. The properties you may like to set are height, width.
10,421,613
Either with PHP or a RegExp (or both), how do I match a range of IP addresses? Sample Incoming IPs ------------------- ``` 10.210.12.12 10.253.12.12 10.210.12.254 10.210.12.95 10.210.12.60 ``` Sample Ranges ------------- ``` 10.210.12.0/24 10.210.12.0/16 10.210.*.* 10.*.*.* ``` I know that I can do this: ``` ?:...
2012/05/02
[ "https://Stackoverflow.com/questions/10421613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/105539/" ]
Convert to 32 bit unsigned and use boolean/bitwise operations. For example, convert 192.168.25.1 to 0xC0A81901. Then, you can see if it matches the mask 192.168.25/24 by converting the dotted-decimal portion of the mask, i.e., 0xC0A81900, and creating a 24 bit mask, i.e., 0xFFFFFF00. Perform a bitwise AND between th...
Use strpos to match them as strings. ``` <?php $ips = array(); $ips[0] = "10.210.12.12"; $ips[1] = "10.253.12.12"; $ips[2] = "10.210.12.254"; $ips[3] = "10.210.12.95"; $ips[4] = "10.210.12.60"; $matches = array(); foreach($ips as $ip){ if(strpos($ip, "10.253.") === 0){ $matches[] = $ip; } } print_r(...
10,421,613
Either with PHP or a RegExp (or both), how do I match a range of IP addresses? Sample Incoming IPs ------------------- ``` 10.210.12.12 10.253.12.12 10.210.12.254 10.210.12.95 10.210.12.60 ``` Sample Ranges ------------- ``` 10.210.12.0/24 10.210.12.0/16 10.210.*.* 10.*.*.* ``` I know that I can do this: ``` ?:...
2012/05/02
[ "https://Stackoverflow.com/questions/10421613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/105539/" ]
Use this library: <https://github.com/S1lentium/IPTools> ``` //Check if IP is within Range: echo Range::parse('192.168.1.1-192.168.1.254')->contains(new IP('192.168.1.5')); // true echo Range::parse('::1-::ffff')->contains(new IP('::1234')); // true ```
Use strpos to match them as strings. ``` <?php $ips = array(); $ips[0] = "10.210.12.12"; $ips[1] = "10.253.12.12"; $ips[2] = "10.210.12.254"; $ips[3] = "10.210.12.95"; $ips[4] = "10.210.12.60"; $matches = array(); foreach($ips as $ip){ if(strpos($ip, "10.253.") === 0){ $matches[] = $ip; } } print_r(...
10,421,613
Either with PHP or a RegExp (or both), how do I match a range of IP addresses? Sample Incoming IPs ------------------- ``` 10.210.12.12 10.253.12.12 10.210.12.254 10.210.12.95 10.210.12.60 ``` Sample Ranges ------------- ``` 10.210.12.0/24 10.210.12.0/16 10.210.*.* 10.*.*.* ``` I know that I can do this: ``` ?:...
2012/05/02
[ "https://Stackoverflow.com/questions/10421613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/105539/" ]
I adapted an answer from php.net and made it better. ``` function netMatch($network, $ip) { $network=trim($network); $orig_network = $network; $ip = trim($ip); if ($ip == $network) { echo "used network ($network) for ($ip)\n"; return TRUE; } $network = str_replace(' ', '', $netw...
Convert to 32 bit unsigned and use boolean/bitwise operations. For example, convert 192.168.25.1 to 0xC0A81901. Then, you can see if it matches the mask 192.168.25/24 by converting the dotted-decimal portion of the mask, i.e., 0xC0A81900, and creating a 24 bit mask, i.e., 0xFFFFFF00. Perform a bitwise AND between th...
10,421,613
Either with PHP or a RegExp (or both), how do I match a range of IP addresses? Sample Incoming IPs ------------------- ``` 10.210.12.12 10.253.12.12 10.210.12.254 10.210.12.95 10.210.12.60 ``` Sample Ranges ------------- ``` 10.210.12.0/24 10.210.12.0/16 10.210.*.* 10.*.*.* ``` I know that I can do this: ``` ?:...
2012/05/02
[ "https://Stackoverflow.com/questions/10421613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/105539/" ]
Use this library: <https://github.com/S1lentium/IPTools> ``` //Check if IP is within Range: echo Range::parse('192.168.1.1-192.168.1.254')->contains(new IP('192.168.1.5')); // true echo Range::parse('::1-::ffff')->contains(new IP('::1234')); // true ```
Regex really doesn't sound like the right tool to deal with subnet masks (at least not in decimal). It can be done, but it will be ugly. I strongly suggest parsing the string into 4 integers, combining to a 32-bit int, and then using standard bitwise operations (basically a bitwise-AND, and then a comparison).
10,421,613
Either with PHP or a RegExp (or both), how do I match a range of IP addresses? Sample Incoming IPs ------------------- ``` 10.210.12.12 10.253.12.12 10.210.12.254 10.210.12.95 10.210.12.60 ``` Sample Ranges ------------- ``` 10.210.12.0/24 10.210.12.0/16 10.210.*.* 10.*.*.* ``` I know that I can do this: ``` ?:...
2012/05/02
[ "https://Stackoverflow.com/questions/10421613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/105539/" ]
I've improved on the above example (I have a netmask with /29 so it doesn't work). ``` function check_netmask($mask, $ip) { @list($net, $bits) = explode('/', $mask); $bits = isset($bits) ? $bits : 32; $bitmask = -pow(2, 32-$bits) & 0x00000000FFFFFFFF; $netmask = ip2long($net) & $bitmask; $ip_bits =...
Regex really doesn't sound like the right tool to deal with subnet masks (at least not in decimal). It can be done, but it will be ugly. I strongly suggest parsing the string into 4 integers, combining to a 32-bit int, and then using standard bitwise operations (basically a bitwise-AND, and then a comparison).
10,421,613
Either with PHP or a RegExp (or both), how do I match a range of IP addresses? Sample Incoming IPs ------------------- ``` 10.210.12.12 10.253.12.12 10.210.12.254 10.210.12.95 10.210.12.60 ``` Sample Ranges ------------- ``` 10.210.12.0/24 10.210.12.0/16 10.210.*.* 10.*.*.* ``` I know that I can do this: ``` ?:...
2012/05/02
[ "https://Stackoverflow.com/questions/10421613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/105539/" ]
I adapted an answer from php.net and made it better. ``` function netMatch($network, $ip) { $network=trim($network); $orig_network = $network; $ip = trim($ip); if ($ip == $network) { echo "used network ($network) for ($ip)\n"; return TRUE; } $network = str_replace(' ', '', $netw...
Regex really doesn't sound like the right tool to deal with subnet masks (at least not in decimal). It can be done, but it will be ugly. I strongly suggest parsing the string into 4 integers, combining to a 32-bit int, and then using standard bitwise operations (basically a bitwise-AND, and then a comparison).
10,421,613
Either with PHP or a RegExp (or both), how do I match a range of IP addresses? Sample Incoming IPs ------------------- ``` 10.210.12.12 10.253.12.12 10.210.12.254 10.210.12.95 10.210.12.60 ``` Sample Ranges ------------- ``` 10.210.12.0/24 10.210.12.0/16 10.210.*.* 10.*.*.* ``` I know that I can do this: ``` ?:...
2012/05/02
[ "https://Stackoverflow.com/questions/10421613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/105539/" ]
I adapted an answer from php.net and made it better. ``` function netMatch($network, $ip) { $network=trim($network); $orig_network = $network; $ip = trim($ip); if ($ip == $network) { echo "used network ($network) for ($ip)\n"; return TRUE; } $network = str_replace(' ', '', $netw...
Use strpos to match them as strings. ``` <?php $ips = array(); $ips[0] = "10.210.12.12"; $ips[1] = "10.253.12.12"; $ips[2] = "10.210.12.254"; $ips[3] = "10.210.12.95"; $ips[4] = "10.210.12.60"; $matches = array(); foreach($ips as $ip){ if(strpos($ip, "10.253.") === 0){ $matches[] = $ip; } } print_r(...
10,421,613
Either with PHP or a RegExp (or both), how do I match a range of IP addresses? Sample Incoming IPs ------------------- ``` 10.210.12.12 10.253.12.12 10.210.12.254 10.210.12.95 10.210.12.60 ``` Sample Ranges ------------- ``` 10.210.12.0/24 10.210.12.0/16 10.210.*.* 10.*.*.* ``` I know that I can do this: ``` ?:...
2012/05/02
[ "https://Stackoverflow.com/questions/10421613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/105539/" ]
I've improved on the above example (I have a netmask with /29 so it doesn't work). ``` function check_netmask($mask, $ip) { @list($net, $bits) = explode('/', $mask); $bits = isset($bits) ? $bits : 32; $bitmask = -pow(2, 32-$bits) & 0x00000000FFFFFFFF; $netmask = ip2long($net) & $bitmask; $ip_bits =...
Use strpos to match them as strings. ``` <?php $ips = array(); $ips[0] = "10.210.12.12"; $ips[1] = "10.253.12.12"; $ips[2] = "10.210.12.254"; $ips[3] = "10.210.12.95"; $ips[4] = "10.210.12.60"; $matches = array(); foreach($ips as $ip){ if(strpos($ip, "10.253.") === 0){ $matches[] = $ip; } } print_r(...
10,421,613
Either with PHP or a RegExp (or both), how do I match a range of IP addresses? Sample Incoming IPs ------------------- ``` 10.210.12.12 10.253.12.12 10.210.12.254 10.210.12.95 10.210.12.60 ``` Sample Ranges ------------- ``` 10.210.12.0/24 10.210.12.0/16 10.210.*.* 10.*.*.* ``` I know that I can do this: ``` ?:...
2012/05/02
[ "https://Stackoverflow.com/questions/10421613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/105539/" ]
I've improved on the above example (I have a netmask with /29 so it doesn't work). ``` function check_netmask($mask, $ip) { @list($net, $bits) = explode('/', $mask); $bits = isset($bits) ? $bits : 32; $bitmask = -pow(2, 32-$bits) & 0x00000000FFFFFFFF; $netmask = ip2long($net) & $bitmask; $ip_bits =...
Convert to 32 bit unsigned and use boolean/bitwise operations. For example, convert 192.168.25.1 to 0xC0A81901. Then, you can see if it matches the mask 192.168.25/24 by converting the dotted-decimal portion of the mask, i.e., 0xC0A81900, and creating a 24 bit mask, i.e., 0xFFFFFF00. Perform a bitwise AND between th...
10,421,613
Either with PHP or a RegExp (or both), how do I match a range of IP addresses? Sample Incoming IPs ------------------- ``` 10.210.12.12 10.253.12.12 10.210.12.254 10.210.12.95 10.210.12.60 ``` Sample Ranges ------------- ``` 10.210.12.0/24 10.210.12.0/16 10.210.*.* 10.*.*.* ``` I know that I can do this: ``` ?:...
2012/05/02
[ "https://Stackoverflow.com/questions/10421613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/105539/" ]
Use this library: <https://github.com/S1lentium/IPTools> ``` //Check if IP is within Range: echo Range::parse('192.168.1.1-192.168.1.254')->contains(new IP('192.168.1.5')); // true echo Range::parse('::1-::ffff')->contains(new IP('::1234')); // true ```
Convert to 32 bit unsigned and use boolean/bitwise operations. For example, convert 192.168.25.1 to 0xC0A81901. Then, you can see if it matches the mask 192.168.25/24 by converting the dotted-decimal portion of the mask, i.e., 0xC0A81900, and creating a 24 bit mask, i.e., 0xFFFFFF00. Perform a bitwise AND between th...
16,092,982
Sorry for my bad english, I'm creating a form that takes some values specifying reporting options in my codeigniter project. I want to show error messages created in my callback functions. I have 3 callback functions as "**checkStartDate()**, **checkFinishDate()** and **checkIssueExists()**" If validation part handles...
2013/04/18
[ "https://Stackoverflow.com/questions/16092982", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2156268/" ]
You should extend CI\_Form\_validation instead of using callbacks ``` class MY_Form_validation extends CI_Form_validation { public function checkIssueExists ( $modelIssue ) { // $ci =& get_instance(); //uses __get magic function instead //$modelIssue field is automatically passed as param, no ...
I've solved the problem myself, but I've figured out what happens while i'm changing my code according to @Philip's answer. In my old code, I had callback functions, then I changed them as @Philip's answer. But I was still getting no error messages i want to show. I just realized that I can't set error message when i c...
2,941,251
I've been searching for quite a while now to find a way to limit wordpress tags by date and order them by the amount of times they appeared in the selected timeframe. But I've been rather unsuccesful. What I'm trying to achieve is something like the trending topics on Twitter. But in this case, 'trending tags'. By de...
2010/05/31
[ "https://Stackoverflow.com/questions/2941251", "https://Stackoverflow.com", "https://Stackoverflow.com/users/354279/" ]
Okay, so what I think you probably want is to do this for say, the last 50 posts. Loop over the last `n` posts, extract the `term_id` of each tag for each post, then pass that string into the `include` argument of [`wp_tag_cloud()`](http://codex.wordpress.org/Template_Tags/wp_tag_cloud); ``` $how_many_posts = 50; $a...
I'm pretty sure that Tags does not have timestamps - perhaps you could do a search for posts with specific tags for a certain timeperiod?
2,941,251
I've been searching for quite a while now to find a way to limit wordpress tags by date and order them by the amount of times they appeared in the selected timeframe. But I've been rather unsuccesful. What I'm trying to achieve is something like the trending topics on Twitter. But in this case, 'trending tags'. By de...
2010/05/31
[ "https://Stackoverflow.com/questions/2941251", "https://Stackoverflow.com", "https://Stackoverflow.com/users/354279/" ]
Okay, so what I think you probably want is to do this for say, the last 50 posts. Loop over the last `n` posts, extract the `term_id` of each tag for each post, then pass that string into the `include` argument of [`wp_tag_cloud()`](http://codex.wordpress.org/Template_Tags/wp_tag_cloud); ``` $how_many_posts = 50; $a...
I think you can look at some of the plugins and see if your have a plugin like what you need
2,941,251
I've been searching for quite a while now to find a way to limit wordpress tags by date and order them by the amount of times they appeared in the selected timeframe. But I've been rather unsuccesful. What I'm trying to achieve is something like the trending topics on Twitter. But in this case, 'trending tags'. By de...
2010/05/31
[ "https://Stackoverflow.com/questions/2941251", "https://Stackoverflow.com", "https://Stackoverflow.com/users/354279/" ]
Okay, so what I think you probably want is to do this for say, the last 50 posts. Loop over the last `n` posts, extract the `term_id` of each tag for each post, then pass that string into the `include` argument of [`wp_tag_cloud()`](http://codex.wordpress.org/Template_Tags/wp_tag_cloud); ``` $how_many_posts = 50; $a...
Yo can get the tag list with a query so you don't have to make a loop throw the last X post. ``` <ul id="footer-tags"> <?php $wpdb->show_errors(); ?> <?php global $wpdb; $term_ids = $wpdb->get_col(" SELECT term_id FROM $wpdb->term_taxonomy INNER JOIN $wpdb->term_relationships ON $wpdb->term_taxonomy.term_tax...
36,354,423
I am running docker-container on Amazon EC2. Currently I have added AWS Credentials to Dockerfile. Could you please let me know the best way to do this?
2016/04/01
[ "https://Stackoverflow.com/questions/36354423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5730257/" ]
The best way is to use IAM Role and do not deal with credentials at all. (see <http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html> ) Credentials could be retrieved from `http://169.254.169.254.....` Since this is a private ip address, it could be accessible only from EC2 instances. All ...
Volume mounting is noted in this thread but as of `docker-compose v3.2 +` you can Bind Mount. For example, if you have a file named `.aws_creds` in the root of your project: In your service for the compose file do this for volumes: ``` volumes: # normal volume mount, already shown in thread - ./.aws_creds:/ro...
36,354,423
I am running docker-container on Amazon EC2. Currently I have added AWS Credentials to Dockerfile. Could you please let me know the best way to do this?
2016/04/01
[ "https://Stackoverflow.com/questions/36354423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5730257/" ]
Another approach is to pass the keys from the host machine to the docker container. You may add the following lines to the `docker-compose` file. ```yaml services: web: build: . environment: - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} - AWS_DEFA...
Volume mounting is noted in this thread but as of `docker-compose v3.2 +` you can Bind Mount. For example, if you have a file named `.aws_creds` in the root of your project: In your service for the compose file do this for volumes: ``` volumes: # normal volume mount, already shown in thread - ./.aws_creds:/ro...
36,354,423
I am running docker-container on Amazon EC2. Currently I have added AWS Credentials to Dockerfile. Could you please let me know the best way to do this?
2016/04/01
[ "https://Stackoverflow.com/questions/36354423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5730257/" ]
The best way is to use IAM Role and do not deal with credentials at all. (see <http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html> ) Credentials could be retrieved from `http://169.254.169.254.....` Since this is a private ip address, it could be accessible only from EC2 instances. All ...
If someone still face the same issue after following the instructions mentioned in accepted answer then make sure that you are not passing environment variables from two different sources. In my case I was passing environment variables to `docker run` via a file and as parameters which was causing the variables passed ...
36,354,423
I am running docker-container on Amazon EC2. Currently I have added AWS Credentials to Dockerfile. Could you please let me know the best way to do this?
2016/04/01
[ "https://Stackoverflow.com/questions/36354423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5730257/" ]
A lot has changed in Docker since this question was asked, so here's an attempt at an updated answer. First, specifically with AWS credentials on containers already running inside of the cloud, using IAM roles as [Vor suggests](https://stackoverflow.com/a/36357388/596285) is a really good option. If you can do that, t...
Volume mounting is noted in this thread but as of `docker-compose v3.2 +` you can Bind Mount. For example, if you have a file named `.aws_creds` in the root of your project: In your service for the compose file do this for volumes: ``` volumes: # normal volume mount, already shown in thread - ./.aws_creds:/ro...
36,354,423
I am running docker-container on Amazon EC2. Currently I have added AWS Credentials to Dockerfile. Could you please let me know the best way to do this?
2016/04/01
[ "https://Stackoverflow.com/questions/36354423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5730257/" ]
A lot has changed in Docker since this question was asked, so here's an attempt at an updated answer. First, specifically with AWS credentials on containers already running inside of the cloud, using IAM roles as [Vor suggests](https://stackoverflow.com/a/36357388/596285) is a really good option. If you can do that, t...
If someone still face the same issue after following the instructions mentioned in accepted answer then make sure that you are not passing environment variables from two different sources. In my case I was passing environment variables to `docker run` via a file and as parameters which was causing the variables passed ...
36,354,423
I am running docker-container on Amazon EC2. Currently I have added AWS Credentials to Dockerfile. Could you please let me know the best way to do this?
2016/04/01
[ "https://Stackoverflow.com/questions/36354423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5730257/" ]
Another approach is to pass the keys from the host machine to the docker container. You may add the following lines to the `docker-compose` file. ```yaml services: web: build: . environment: - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} - AWS_DEFA...
If someone still face the same issue after following the instructions mentioned in accepted answer then make sure that you are not passing environment variables from two different sources. In my case I was passing environment variables to `docker run` via a file and as parameters which was causing the variables passed ...
36,354,423
I am running docker-container on Amazon EC2. Currently I have added AWS Credentials to Dockerfile. Could you please let me know the best way to do this?
2016/04/01
[ "https://Stackoverflow.com/questions/36354423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5730257/" ]
The best way is to use IAM Role and do not deal with credentials at all. (see <http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html> ) Credentials could be retrieved from `http://169.254.169.254.....` Since this is a private ip address, it could be accessible only from EC2 instances. All ...
The following one-liner works for me even when my credentials are set up by [aws-okta](https://github.com/segmentio/aws-okta) or [saml2aws](https://github.com/Versent/saml2aws): ``` $ docker run -v$HOME/.aws:/root/.aws:ro \ -e AWS_ACCESS_KEY_ID \ -e AWS_CA_BUNDLE \ -e AWS_CLI_FILE_E...
36,354,423
I am running docker-container on Amazon EC2. Currently I have added AWS Credentials to Dockerfile. Could you please let me know the best way to do this?
2016/04/01
[ "https://Stackoverflow.com/questions/36354423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5730257/" ]
The best way is to use IAM Role and do not deal with credentials at all. (see <http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html> ) Credentials could be retrieved from `http://169.254.169.254.....` Since this is a private ip address, it could be accessible only from EC2 instances. All ...
Yet another approach is to create temporary read-only volume in docker-compose.yaml. AWS CLI and SDK (like boto3 or AWS SDK for Java etc.) are looking for `default` profile in `~/.aws/credentials` file. If you want to use other profiles, you just need also to export AWS\_PROFILE variable before running `docker-compose...
36,354,423
I am running docker-container on Amazon EC2. Currently I have added AWS Credentials to Dockerfile. Could you please let me know the best way to do this?
2016/04/01
[ "https://Stackoverflow.com/questions/36354423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5730257/" ]
Yet another approach is to create temporary read-only volume in docker-compose.yaml. AWS CLI and SDK (like boto3 or AWS SDK for Java etc.) are looking for `default` profile in `~/.aws/credentials` file. If you want to use other profiles, you just need also to export AWS\_PROFILE variable before running `docker-compose...
You could create `~/aws_env_creds` containing: ```bash touch ~/aws_env_creds chmod 777 ~/aws_env_creds vi ~/aws_env_creds ``` Add these value (replace the key of yours): ``` AWS_ACCESS_KEY_ID=AK_FAKE_KEY_88RD3PNY AWS_SECRET_ACCESS_KEY=BividQsWW_FAKE_KEY_MuB5VAAsQNJtSxQQyDY2C ``` Press "esc" to save the file. Run...
36,354,423
I am running docker-container on Amazon EC2. Currently I have added AWS Credentials to Dockerfile. Could you please let me know the best way to do this?
2016/04/01
[ "https://Stackoverflow.com/questions/36354423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5730257/" ]
Another approach is to pass the keys from the host machine to the docker container. You may add the following lines to the `docker-compose` file. ```yaml services: web: build: . environment: - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} - AWS_DEFA...
The following one-liner works for me even when my credentials are set up by [aws-okta](https://github.com/segmentio/aws-okta) or [saml2aws](https://github.com/Versent/saml2aws): ``` $ docker run -v$HOME/.aws:/root/.aws:ro \ -e AWS_ACCESS_KEY_ID \ -e AWS_CA_BUNDLE \ -e AWS_CLI_FILE_E...
10,868,380
I have a list of buffer in vim, how can I turn all of them into tab page like ones in, say Notepad++? I know I can use `:tabe` or something to open new file in tab view, but what if I have opened several buffers in single vim and I want to turn all of them into tab pages?
2012/06/03
[ "https://Stackoverflow.com/questions/10868380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/587547/" ]
You can type this command: ``` :tab ball ``` It will display all buffers in tabs.
If I understood, you have several buffers in splits and wish every one of them in a separate tab. `<Ctrl-w>T` will open a buffer in a new *tab page* removing it from the split. But *tab pages* are really not what they are in Notepad++ - separate files. In Vim they're more of a placeholders for splits, so my guess is y...
10,868,380
I have a list of buffer in vim, how can I turn all of them into tab page like ones in, say Notepad++? I know I can use `:tabe` or something to open new file in tab view, but what if I have opened several buffers in single vim and I want to turn all of them into tab pages?
2012/06/03
[ "https://Stackoverflow.com/questions/10868380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/587547/" ]
If I understood, you have several buffers in splits and wish every one of them in a separate tab. `<Ctrl-w>T` will open a buffer in a new *tab page* removing it from the split. But *tab pages* are really not what they are in Notepad++ - separate files. In Vim they're more of a placeholders for splits, so my guess is y...
I don't know your motivations of to turn `all` buffers into tab pages. Usually, we have many buffers when doing one job, but for tabs, I think it don't have enough spaces to display the tabbars, especially in laptop. Imaging if there were 20 tabs on the top... So if you want to turn the current buffer into tab page, y...
10,868,380
I have a list of buffer in vim, how can I turn all of them into tab page like ones in, say Notepad++? I know I can use `:tabe` or something to open new file in tab view, but what if I have opened several buffers in single vim and I want to turn all of them into tab pages?
2012/06/03
[ "https://Stackoverflow.com/questions/10868380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/587547/" ]
You can type this command: ``` :tab ball ``` It will display all buffers in tabs.
I don't know your motivations of to turn `all` buffers into tab pages. Usually, we have many buffers when doing one job, but for tabs, I think it don't have enough spaces to display the tabbars, especially in laptop. Imaging if there were 20 tabs on the top... So if you want to turn the current buffer into tab page, y...
15,211,538
Tracks for "The Hives" claims to be streamable, but are returning 404s. Here's the JSON response for Civilization's Dying id 3644317 (<http://api.soundcloud.com/tracks/3644317.json?client_id=>): ``` { "kind": "track", "id": 3644317, … "sharing": "public", "streamable": true, "embeddable_by": "...
2013/03/04
[ "https://Stackoverflow.com/questions/15211538", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2133450/" ]
There's currently a bug affecting some artists whose tracks are not actually streamable any more, but the API response not showing that fact. This should be fixed very shortly.
Make sure this song has "sharing" set to "public" in the returned track get request. If not, you will need to authenticate with Soundcloud. <http://developers.soundcloud.com/docs#authentication>
15,211,538
Tracks for "The Hives" claims to be streamable, but are returning 404s. Here's the JSON response for Civilization's Dying id 3644317 (<http://api.soundcloud.com/tracks/3644317.json?client_id=>): ``` { "kind": "track", "id": 3644317, … "sharing": "public", "streamable": true, "embeddable_by": "...
2013/03/04
[ "https://Stackoverflow.com/questions/15211538", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2133450/" ]
Make sure this song has "sharing" set to "public" in the returned track get request. If not, you will need to authenticate with Soundcloud. <http://developers.soundcloud.com/docs#authentication>
I encountered this issue as well when I tried to stream Lorde's (Royals) tracks. (Soundcloud userid: 27622444) After examining the track properties returned from the API I noticed that the `streamable` property had been set to `false` **API return data:** ``` (...) sharing: "public" state: "finished" streamable: fal...
15,211,538
Tracks for "The Hives" claims to be streamable, but are returning 404s. Here's the JSON response for Civilization's Dying id 3644317 (<http://api.soundcloud.com/tracks/3644317.json?client_id=>): ``` { "kind": "track", "id": 3644317, … "sharing": "public", "streamable": true, "embeddable_by": "...
2013/03/04
[ "https://Stackoverflow.com/questions/15211538", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2133450/" ]
There's currently a bug affecting some artists whose tracks are not actually streamable any more, but the API response not showing that fact. This should be fixed very shortly.
I encountered this issue as well when I tried to stream Lorde's (Royals) tracks. (Soundcloud userid: 27622444) After examining the track properties returned from the API I noticed that the `streamable` property had been set to `false` **API return data:** ``` (...) sharing: "public" state: "finished" streamable: fal...
481,576
I have been staring at this for an hour. How would you reduce such a matrix? \begin{bmatrix} p & 0 & a \\ b & 0 & 0 \\ q & c & r \end{bmatrix} $abc\neq0$
2013/09/01
[ "https://math.stackexchange.com/questions/481576", "https://math.stackexchange.com", "https://math.stackexchange.com/users/90855/" ]
Because $a,b,c \ne 0$ then $$ \left( {\begin{array}{\*{20}{c}} p & 0 & a \\ b & 0 & 0 \\ q & c & r \\ \end{array}} \right) \to \left( {\begin{array}{\*{20}{c}} b & 0 & 0 \\ q & c & r \\ p & 0 & a \\ \end{array}} \right)\mathop \to \limits\_{ - \frac{p}{b}{\rho \_1} + {\rho \_3}}^{ - \frac{q}{b}{\rho \_1} + {\rho...
If $abc\neq 0$, then $a,b,c\neq 0$. Divide the three rows by $a,b,c$ respectively and continue with other elementary row operations.
481,576
I have been staring at this for an hour. How would you reduce such a matrix? \begin{bmatrix} p & 0 & a \\ b & 0 & 0 \\ q & c & r \end{bmatrix} $abc\neq0$
2013/09/01
[ "https://math.stackexchange.com/questions/481576", "https://math.stackexchange.com", "https://math.stackexchange.com/users/90855/" ]
Because $a,b,c \ne 0$ then $$ \left( {\begin{array}{\*{20}{c}} p & 0 & a \\ b & 0 & 0 \\ q & c & r \\ \end{array}} \right) \to \left( {\begin{array}{\*{20}{c}} b & 0 & 0 \\ q & c & r \\ p & 0 & a \\ \end{array}} \right)\mathop \to \limits\_{ - \frac{p}{b}{\rho \_1} + {\rho \_3}}^{ - \frac{q}{b}{\rho \_1} + {\rho...
First you want a non-zero entry in the $(1, 1)$ position. There is only one element of the first column which you know is non-zero, so do a row swap to make sure that it is in the $(1, 1)$ position. Once in place, use this non-zero entry to eliminate the other entries in the first column using row operations of the for...
481,576
I have been staring at this for an hour. How would you reduce such a matrix? \begin{bmatrix} p & 0 & a \\ b & 0 & 0 \\ q & c & r \end{bmatrix} $abc\neq0$
2013/09/01
[ "https://math.stackexchange.com/questions/481576", "https://math.stackexchange.com", "https://math.stackexchange.com/users/90855/" ]
Because $a,b,c \ne 0$ then $$ \left( {\begin{array}{\*{20}{c}} p & 0 & a \\ b & 0 & 0 \\ q & c & r \\ \end{array}} \right) \to \left( {\begin{array}{\*{20}{c}} b & 0 & 0 \\ q & c & r \\ p & 0 & a \\ \end{array}} \right)\mathop \to \limits\_{ - \frac{p}{b}{\rho \_1} + {\rho \_3}}^{ - \frac{q}{b}{\rho \_1} + {\rho...
Perhaps this is "cheating", but $$\det \begin{bmatrix} p & 0 & a \\ b & 0 & 0 \\ q & c & r \end{bmatrix} =abc \neq 0.$$ Since the determinant is non-zero, its reduced row echelon form is the identity matrix.
23,448,128
I am using the base64\_encode for sending the numeric id to url, `base64_encode($list_post['id']);` up to 99 its working fine, but after 99 its produce wrong encoded string. the last character in encoded string is = (equal sign), but when the number more than 99, for example 100 it don't show = (equal sign) at the end...
2014/05/03
[ "https://Stackoverflow.com/questions/23448128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1716293/" ]
Take a look at how padding in base64 works: <http://en.wikipedia.org/wiki/Base64#Padding> The padding (the "=" character) is not always needed and in some implementations is not even mandatory. **EDIT:** ok from your comments I see that you are using the base64 encoded string in a URL like this: ``` http://example.c...
it seems working fine for me Can you please test with following code ``` echo base64_encode(101); echo base64_decode(base64_encode(101)); ``` **[DEMO](http://codepad.org/RYvM7IU6)** > > Base64-encoded data takes about 33% more space than the original data. > > > So these numbers shouldnt be a problem
3,534,453
Can someone help me construct the SQL that I need to query the Projects\_dim table using the Linked Server "idwd"? To test the connection, I ran a sample query using the linked server name. To access the tables on the linked server, I used a four-part naming syntax: linked\_server\_name.catalog\_ name.schema\_name.t...
2010/08/20
[ "https://Stackoverflow.com/questions/3534453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/109676/" ]
You missed to google. <http://android-er.blogspot.com/2010/05/android-surfaceview.html> <http://www.droidnova.com/playing-with-graphics-in-android-part-v,188.html>
The solution is very simple. ``` //get surface view and surface holder mySurfaceView = (SurfaceView) findViewById(R.id.surfaceView); surfaceHolder = mySurfaceView.getHolder(); //place surface view holder on top of the surface view mySurfaceView.setZOrderOnTop(true); //set pixels of the surface holder to transparen...
540
In various sub-castes, people used to practice untouchability i.e., some of the people who were considered lower castes, for example, sweepers, cleaners, etc. were ignored, and there were rules such as others were not allowed to touch them, if they did, they were ignored by the community. So why they used to do that?
2014/06/27
[ "https://hinduism.stackexchange.com/questions/540", "https://hinduism.stackexchange.com", "https://hinduism.stackexchange.com/users/130/" ]
This question has more to do with human nature than Hinduism. When people were divided into castes based upon their work, some castes declared themselves superior and called others inferior. Worshiping Gods was considered superior and noble work, so that caste became superior. Cleaning, washing etc. were considered inf...
It has it's origin in practicing cleanliness when contagious diseases were in abundance, which had no cure. So the people having professions related to 'unclean' things like wastes, leather etc were prohibited from touching, accessing public places and common water supplies like lakes and wells. In course of time this ...
540
In various sub-castes, people used to practice untouchability i.e., some of the people who were considered lower castes, for example, sweepers, cleaners, etc. were ignored, and there were rules such as others were not allowed to touch them, if they did, they were ignored by the community. So why they used to do that?
2014/06/27
[ "https://hinduism.stackexchange.com/questions/540", "https://hinduism.stackexchange.com", "https://hinduism.stackexchange.com/users/130/" ]
This question has more to do with human nature than Hinduism. When people were divided into castes based upon their work, some castes declared themselves superior and called others inferior. Worshiping Gods was considered superior and noble work, so that caste became superior. Cleaning, washing etc. were considered inf...
Caste hierarchy and discrimination is not sanctioned by the Vedas. I mentioning an excerpt from an article by Swami Venkatraman: > > First, caste refers to jati, not varna. Jatis are the thousands of > indigenous social- occupational groups, while varna refers to the four > individualized societal functions describ...
540
In various sub-castes, people used to practice untouchability i.e., some of the people who were considered lower castes, for example, sweepers, cleaners, etc. were ignored, and there were rules such as others were not allowed to touch them, if they did, they were ignored by the community. So why they used to do that?
2014/06/27
[ "https://hinduism.stackexchange.com/questions/540", "https://hinduism.stackexchange.com", "https://hinduism.stackexchange.com/users/130/" ]
For your question 'So why they used to do that?' : Quoting from Dr.Koenraad Elst's 1994 Essay "Caste: The view from Belgium": > > Untouchability originates in the belief that evil spirits surround > dead and dying substances. People who work with corpses, body > excretions or animal skins had an aura of danger and...
It has it's origin in practicing cleanliness when contagious diseases were in abundance, which had no cure. So the people having professions related to 'unclean' things like wastes, leather etc were prohibited from touching, accessing public places and common water supplies like lakes and wells. In course of time this ...
540
In various sub-castes, people used to practice untouchability i.e., some of the people who were considered lower castes, for example, sweepers, cleaners, etc. were ignored, and there were rules such as others were not allowed to touch them, if they did, they were ignored by the community. So why they used to do that?
2014/06/27
[ "https://hinduism.stackexchange.com/questions/540", "https://hinduism.stackexchange.com", "https://hinduism.stackexchange.com/users/130/" ]
For your question 'So why they used to do that?' : Quoting from Dr.Koenraad Elst's 1994 Essay "Caste: The view from Belgium": > > Untouchability originates in the belief that evil spirits surround > dead and dying substances. People who work with corpses, body > excretions or animal skins had an aura of danger and...
Caste hierarchy and discrimination is not sanctioned by the Vedas. I mentioning an excerpt from an article by Swami Venkatraman: > > First, caste refers to jati, not varna. Jatis are the thousands of > indigenous social- occupational groups, while varna refers to the four > individualized societal functions describ...
221,747
I need a way to change history so that Taiwan, in 2015, be using weapons manufactured and sold by mainland China as well as some US equipments--sort of like how Pakistan uses both Chinese and US weapons. There are some restrictions as presented by my world: 1. China is still runned by the Party, though it could be a m...
2022/01/08
[ "https://worldbuilding.stackexchange.com/questions/221747", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37911/" ]
**They are Friends** Taiwan is officially part of China (according to China that is). Unofficially the countries are separate but allied. The motivation behind China not conquering Taiwan is (a) We can do it whenever we want because we are much bigger and stronger than them. There is no need to conquer now and we'd r...
Okay, much of this has to rely on a lot of speculative/semi-conspiracy theories of the time (but what "what-if" scenario doesn't). The most challenging parameters you have set are: 1. Taiwan is de-facto independent, but de-jure part of China, just like today. 2. Taiwan has sufficiently amicable relations with China t...
221,747
I need a way to change history so that Taiwan, in 2015, be using weapons manufactured and sold by mainland China as well as some US equipments--sort of like how Pakistan uses both Chinese and US weapons. There are some restrictions as presented by my world: 1. China is still runned by the Party, though it could be a m...
2022/01/08
[ "https://worldbuilding.stackexchange.com/questions/221747", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37911/" ]
You've already made enough change to make it happen. In our timeline, Ma Ying-jeou of the KMT was the leader of Taiwan from 2008-2016. Cross-straits relations improved greatly during his time in office. If you add in an ongoing major global terrorism threat against China, the US, and more, the focus would shift away ...
Okay, much of this has to rely on a lot of speculative/semi-conspiracy theories of the time (but what "what-if" scenario doesn't). The most challenging parameters you have set are: 1. Taiwan is de-facto independent, but de-jure part of China, just like today. 2. Taiwan has sufficiently amicable relations with China t...
221,747
I need a way to change history so that Taiwan, in 2015, be using weapons manufactured and sold by mainland China as well as some US equipments--sort of like how Pakistan uses both Chinese and US weapons. There are some restrictions as presented by my world: 1. China is still runned by the Party, though it could be a m...
2022/01/08
[ "https://worldbuilding.stackexchange.com/questions/221747", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37911/" ]
**America First.** [![map minus the us](https://i.stack.imgur.com/fVWbw.png)](https://i.stack.imgur.com/fVWbw.png) <https://dabrownstein.com/2016/12/05/mapping-the-new-isolationism/> > > The very America First doctrine that catapulted Trump to the White > House stands, for all its championing of national self-inter...
Okay, much of this has to rely on a lot of speculative/semi-conspiracy theories of the time (but what "what-if" scenario doesn't). The most challenging parameters you have set are: 1. Taiwan is de-facto independent, but de-jure part of China, just like today. 2. Taiwan has sufficiently amicable relations with China t...
221,747
I need a way to change history so that Taiwan, in 2015, be using weapons manufactured and sold by mainland China as well as some US equipments--sort of like how Pakistan uses both Chinese and US weapons. There are some restrictions as presented by my world: 1. China is still runned by the Party, though it could be a m...
2022/01/08
[ "https://worldbuilding.stackexchange.com/questions/221747", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37911/" ]
**They are Friends** Taiwan is officially part of China (according to China that is). Unofficially the countries are separate but allied. The motivation behind China not conquering Taiwan is (a) We can do it whenever we want because we are much bigger and stronger than them. There is no need to conquer now and we'd r...
You've already made enough change to make it happen. In our timeline, Ma Ying-jeou of the KMT was the leader of Taiwan from 2008-2016. Cross-straits relations improved greatly during his time in office. If you add in an ongoing major global terrorism threat against China, the US, and more, the focus would shift away ...
221,747
I need a way to change history so that Taiwan, in 2015, be using weapons manufactured and sold by mainland China as well as some US equipments--sort of like how Pakistan uses both Chinese and US weapons. There are some restrictions as presented by my world: 1. China is still runned by the Party, though it could be a m...
2022/01/08
[ "https://worldbuilding.stackexchange.com/questions/221747", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37911/" ]
**They are Friends** Taiwan is officially part of China (according to China that is). Unofficially the countries are separate but allied. The motivation behind China not conquering Taiwan is (a) We can do it whenever we want because we are much bigger and stronger than them. There is no need to conquer now and we'd r...
[Li](https://en.wikipedia.org/wiki/Li_Keqiang) became the ruler of China in 2012, not Xi. ----------------------------------------------------------------------------------------- Li is an economics minded communist who wants to improve internal production and economics. He wants to improve production in China, gain i...
221,747
I need a way to change history so that Taiwan, in 2015, be using weapons manufactured and sold by mainland China as well as some US equipments--sort of like how Pakistan uses both Chinese and US weapons. There are some restrictions as presented by my world: 1. China is still runned by the Party, though it could be a m...
2022/01/08
[ "https://worldbuilding.stackexchange.com/questions/221747", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37911/" ]
**America First.** [![map minus the us](https://i.stack.imgur.com/fVWbw.png)](https://i.stack.imgur.com/fVWbw.png) <https://dabrownstein.com/2016/12/05/mapping-the-new-isolationism/> > > The very America First doctrine that catapulted Trump to the White > House stands, for all its championing of national self-inter...
**They are Friends** Taiwan is officially part of China (according to China that is). Unofficially the countries are separate but allied. The motivation behind China not conquering Taiwan is (a) We can do it whenever we want because we are much bigger and stronger than them. There is no need to conquer now and we'd r...
221,747
I need a way to change history so that Taiwan, in 2015, be using weapons manufactured and sold by mainland China as well as some US equipments--sort of like how Pakistan uses both Chinese and US weapons. There are some restrictions as presented by my world: 1. China is still runned by the Party, though it could be a m...
2022/01/08
[ "https://worldbuilding.stackexchange.com/questions/221747", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37911/" ]
You've already made enough change to make it happen. In our timeline, Ma Ying-jeou of the KMT was the leader of Taiwan from 2008-2016. Cross-straits relations improved greatly during his time in office. If you add in an ongoing major global terrorism threat against China, the US, and more, the focus would shift away ...
[Li](https://en.wikipedia.org/wiki/Li_Keqiang) became the ruler of China in 2012, not Xi. ----------------------------------------------------------------------------------------- Li is an economics minded communist who wants to improve internal production and economics. He wants to improve production in China, gain i...
221,747
I need a way to change history so that Taiwan, in 2015, be using weapons manufactured and sold by mainland China as well as some US equipments--sort of like how Pakistan uses both Chinese and US weapons. There are some restrictions as presented by my world: 1. China is still runned by the Party, though it could be a m...
2022/01/08
[ "https://worldbuilding.stackexchange.com/questions/221747", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37911/" ]
**America First.** [![map minus the us](https://i.stack.imgur.com/fVWbw.png)](https://i.stack.imgur.com/fVWbw.png) <https://dabrownstein.com/2016/12/05/mapping-the-new-isolationism/> > > The very America First doctrine that catapulted Trump to the White > House stands, for all its championing of national self-inter...
You've already made enough change to make it happen. In our timeline, Ma Ying-jeou of the KMT was the leader of Taiwan from 2008-2016. Cross-straits relations improved greatly during his time in office. If you add in an ongoing major global terrorism threat against China, the US, and more, the focus would shift away ...
221,747
I need a way to change history so that Taiwan, in 2015, be using weapons manufactured and sold by mainland China as well as some US equipments--sort of like how Pakistan uses both Chinese and US weapons. There are some restrictions as presented by my world: 1. China is still runned by the Party, though it could be a m...
2022/01/08
[ "https://worldbuilding.stackexchange.com/questions/221747", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/37911/" ]
**America First.** [![map minus the us](https://i.stack.imgur.com/fVWbw.png)](https://i.stack.imgur.com/fVWbw.png) <https://dabrownstein.com/2016/12/05/mapping-the-new-isolationism/> > > The very America First doctrine that catapulted Trump to the White > House stands, for all its championing of national self-inter...
[Li](https://en.wikipedia.org/wiki/Li_Keqiang) became the ruler of China in 2012, not Xi. ----------------------------------------------------------------------------------------- Li is an economics minded communist who wants to improve internal production and economics. He wants to improve production in China, gain i...
22,464
I just finished making cookies. The dough was enough to make multiple batches. I only have one baking sheet. Every time a batch was ready, I used new parchment paper on the baking sheet. Is this necessary or could I just re-use the same piece of paper till all my cookies are baked?
2012/03/21
[ "https://cooking.stackexchange.com/questions/22464", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/4580/" ]
You can reuse parchment paper several times for your cookies (it also works for other dry dishes), depending on cooking time and temperature, with no problem. Change the paper when it gets dirty, dark and/or brittle as it may crumble beyond this point. I always do so with no difference in the results, saving both on mo...
Please do reuse the baking paper. It is non-biodegradable and non-recyclable because of the silicone so if you MUST use it, make it go several rounds for the sake of the environment. We always used to use butter paper (before it came in plastic containers) or plain unwaxed paper lunch wrap, greased if necessary. But fo...
38,487,323
**Problem** I am trying to push a returning variables value into an array. This is my code, however I'm returning an empty array and am not sure what's wrong. **JavaScript** ``` var my_arr = []; function foo() { var unitValue = parseFloat($('#unitVal1').val()); var percentFiner = parseFloat($('#percent1').val(...
2016/07/20
[ "https://Stackoverflow.com/questions/38487323", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6415924/" ]
for checking if specific files exists on a path use File.Exists(path), which will return a boolean indicating whether the file at path exists. In your case ``` if(File.Exists(@"D:\work\int\retail\store\export\one.txt")) { //do this } ``` In your example you are missing the filename. If you want to fetch the la...
You need to mention your text file name in the path, if your txt file is called x.txt for example, you need to write the path as var FilePath = @"D:\work\int\retail\store\export\x.txt";
48,032,907
Consider this code: ``` template <typename T> class A { T x; // A bunch of functions }; std::size_t s = sizeof(A<double>); ``` Assume the `sizeof` operator is the only place where an instantiation of `A<double>` is required. Is it possible that the compiled program does **not** contain relevant code for `A<...
2017/12/30
[ "https://Stackoverflow.com/questions/48032907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5958455/" ]
> > Is it possible that the compiled program does not contain relevant code for `A<double>` (e.g. `A<double>::~A()`)? > > > Sure that's possible. ``` std::size_t s = sizeof(A<double>); ``` is just a compile time operation, and doesn't need any runtime instance of `A<double>`, so there's no need for constructor...
Yes, sizeof() does not need the member functions and so they may well not be generated. All sizeof needs are the data members.
48,032,907
Consider this code: ``` template <typename T> class A { T x; // A bunch of functions }; std::size_t s = sizeof(A<double>); ``` Assume the `sizeof` operator is the only place where an instantiation of `A<double>` is required. Is it possible that the compiled program does **not** contain relevant code for `A<...
2017/12/30
[ "https://Stackoverflow.com/questions/48032907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5958455/" ]
The class will be instantiated, but the compiler must not instantiate any member function definition, [temp.inst]/1: > > [...] the class template specialization is **implicitly instantiated when** the specialization is referenced in a context that **requires a completely-defined object type**[...] > > > [temp.ins...
> > Is it possible that the compiled program does not contain relevant code for `A<double>` (e.g. `A<double>::~A()`)? > > > Sure that's possible. ``` std::size_t s = sizeof(A<double>); ``` is just a compile time operation, and doesn't need any runtime instance of `A<double>`, so there's no need for constructor...
48,032,907
Consider this code: ``` template <typename T> class A { T x; // A bunch of functions }; std::size_t s = sizeof(A<double>); ``` Assume the `sizeof` operator is the only place where an instantiation of `A<double>` is required. Is it possible that the compiled program does **not** contain relevant code for `A<...
2017/12/30
[ "https://Stackoverflow.com/questions/48032907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5958455/" ]
> > Is it possible that the compiled program does not contain relevant code for `A<double>` (e.g. `A<double>::~A()`)? > > > Sure that's possible. ``` std::size_t s = sizeof(A<double>); ``` is just a compile time operation, and doesn't need any runtime instance of `A<double>`, so there's no need for constructor...
I have built this code: ``` #include <cstddef> template <typename T> class A { T x; // A bunch of functions }; int main(const int argc, const char* argv[]) { std::size_t s = sizeof(A<double>); } ``` And launching objdump I get this output: ``` $ objdump -t a.out a.out: file format Mach-O 64-bit x86...
48,032,907
Consider this code: ``` template <typename T> class A { T x; // A bunch of functions }; std::size_t s = sizeof(A<double>); ``` Assume the `sizeof` operator is the only place where an instantiation of `A<double>` is required. Is it possible that the compiled program does **not** contain relevant code for `A<...
2017/12/30
[ "https://Stackoverflow.com/questions/48032907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5958455/" ]
The class will be instantiated, but the compiler must not instantiate any member function definition, [temp.inst]/1: > > [...] the class template specialization is **implicitly instantiated when** the specialization is referenced in a context that **requires a completely-defined object type**[...] > > > [temp.ins...
Yes, sizeof() does not need the member functions and so they may well not be generated. All sizeof needs are the data members.
48,032,907
Consider this code: ``` template <typename T> class A { T x; // A bunch of functions }; std::size_t s = sizeof(A<double>); ``` Assume the `sizeof` operator is the only place where an instantiation of `A<double>` is required. Is it possible that the compiled program does **not** contain relevant code for `A<...
2017/12/30
[ "https://Stackoverflow.com/questions/48032907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5958455/" ]
The class will be instantiated, but the compiler must not instantiate any member function definition, [temp.inst]/1: > > [...] the class template specialization is **implicitly instantiated when** the specialization is referenced in a context that **requires a completely-defined object type**[...] > > > [temp.ins...
I have built this code: ``` #include <cstddef> template <typename T> class A { T x; // A bunch of functions }; int main(const int argc, const char* argv[]) { std::size_t s = sizeof(A<double>); } ``` And launching objdump I get this output: ``` $ objdump -t a.out a.out: file format Mach-O 64-bit x86...
1,391,953
I am working with a collection of cards. On each card is written a set of numbers $1\le n\le N$ in ascending order. When I arrange the cards in lexicographic order on the table, no two adjacent cards share a number. The cards are designed so that when I pick a number $r$, select all the cards containing $r$, and sum ...
2015/08/10
[ "https://math.stackexchange.com/questions/1391953", "https://math.stackexchange.com", "https://math.stackexchange.com/users/261079/" ]
Do you mean like this: With four cards the sets $\{1,4,6\}; \{2,7\}; \{3,4\}; \{5,6,7\}$ allow you to distinguish between the integers $1\le n \le 7$ (and you get zero as a bonus). With five cards I get $\{1,4,6,9,12\}; \{2,7,10\}; \{3,4,11,12\}; \{5,6,7\};\{8,9,10,11,12\}$ which get me to $12$ - that seems better th...
I think the answer is ``` For 13 to 20 The answer is 6 10 11 and 12 (1,4,6,9,12) (2,7,2) (3,4,11,12) (5,6,7) (8,9,2,11,12) 5 9 (1,4,6,9) (2,7) (3,4) (5,6,7) (8,9) 5 8 (1,4,6) (2,7) (3,4) (5,6,7) (8) 5 7 (1,4,6) (2,7) (3,4) (5,6,7) 4 6 (1,4...
1,391,953
I am working with a collection of cards. On each card is written a set of numbers $1\le n\le N$ in ascending order. When I arrange the cards in lexicographic order on the table, no two adjacent cards share a number. The cards are designed so that when I pick a number $r$, select all the cards containing $r$, and sum ...
2015/08/10
[ "https://math.stackexchange.com/questions/1391953", "https://math.stackexchange.com", "https://math.stackexchange.com/users/261079/" ]
Do you mean like this: With four cards the sets $\{1,4,6\}; \{2,7\}; \{3,4\}; \{5,6,7\}$ allow you to distinguish between the integers $1\le n \le 7$ (and you get zero as a bonus). With five cards I get $\{1,4,6,9,12\}; \{2,7,10\}; \{3,4,11,12\}; \{5,6,7\};\{8,9,10,11,12\}$ which get me to $12$ - that seems better th...
Suppose with $r$ cards I can reach a total $N\_r$. With $1$ card I can reach $1$ and with no cards I can reach $0$. I add another card. If I want the total $N\_r+1$, I have to include it on card $r+1$. I can get $N\_r+2$ by writing it on card $r+1$ and on the cards containing $1$. I can get $N\_r+k$ on card $r+1$ (t...
58,659,537
We are getting "Operation was cancelled" exception while Azure Indexer is running for larger records (around 2M+). Here are the log details - "The operation was canceled. Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request. Th...
2019/11/01
[ "https://Stackoverflow.com/questions/58659537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11903910/" ]
Use [`numpy.tile`](https://docs.scipy.org/doc/numpy/reference/generated/numpy.tile.html): ``` cols = dataset.columns length = dataset_ts.shape[0] df_new = pd.DataFrame({'new': np.tile(cols, length)}) print (df_new) new 0 a 1 b 2 c 3 d 4 a 5 b 6 c 7 d 8 a 9 b 10 c ....
You could use [itertools.cycle](https://docs.python.org/3/library/itertools.html#itertools.cycle) + [itertools.islice](https://docs.python.org/3/library/itertools.html#itertools.islice): ``` import pandas as pd from itertools import cycle, islice length = 1942 data = ['a', 'b', 'c', 'd'] result = pd.DataFrame({'new...
50,175,053
I have something like : ``` #define NBR 42 #define THE_ANS_IS theAnsIsNBR ``` Currently the second macro is expand as 'theAnsIsNBR' as expected, but i want it to be expand as 'theAnsIs42' i am not sure if it is even possible !?
2018/05/04
[ "https://Stackoverflow.com/questions/50175053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7758765/" ]
``` #define Paste(x, y) x##y #define Expand(x, y) Paste(x, y) #define NBR 42 #define THE_ANS_IS Expand(theAnsIs, NBR) ```
``` #define _CONCAT(x,y) x ## y #define CONCAT(x,y) _CONCAT(x,y) #define NBR 42 #define THE_ANS_IS CONCAT(theAnsIs, NBR) ``` This works because `##` concatenates two tokens. The problem is, they aren't expanded first. But calling another macro on them expands them, therefore you need to nest two function-like macros...
18,622
I would like to build 3d applications that are targeted at old PCs for education. Which 3d engine do you recommend to use? What technology should I use or approach? I would like to avoid Unity3d or any other non-free frameworks, as this work I'm doing is voluntarily. It's main idea is to make learning fun, using 3d si...
2011/10/17
[ "https://gamedev.stackexchange.com/questions/18622", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/3689/" ]
Check out the [Unity engine](http://unity3d.com/unity/engine/rendering). They've done a lot of work on making their tech work with a very wide range of hardware, and have nice tools like graphics emulation so you can see what an older machine would be drawing while on a newer machine. It's relatively cheap and has a re...
There are many solutions. You have to make sure you know the following * What are your skills with programming languages? * What license is acceptable? * Which OS(s) do you target? (Unix, Linux, Windows, Mac OS...) * What 3D software will you use to create the assets? * How will you manage your assets? * What kind of ...
18,622
I would like to build 3d applications that are targeted at old PCs for education. Which 3d engine do you recommend to use? What technology should I use or approach? I would like to avoid Unity3d or any other non-free frameworks, as this work I'm doing is voluntarily. It's main idea is to make learning fun, using 3d si...
2011/10/17
[ "https://gamedev.stackexchange.com/questions/18622", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/3689/" ]
Check out the [Unity engine](http://unity3d.com/unity/engine/rendering). They've done a lot of work on making their tech work with a very wide range of hardware, and have nice tools like graphics emulation so you can see what an older machine would be drawing while on a newer machine. It's relatively cheap and has a re...
You might check out Ogre3D (<http://www.ogre3d.org/>) as a starting point. Ogre3D isn't necessarily a full game development engine, but it is a solid 3D rendering system. There are various demos you can down Also, check out <http://www.ogre3d.org/tikiwiki/Projects+Using+OGRE> where a number of game engines listed that...
18,622
I would like to build 3d applications that are targeted at old PCs for education. Which 3d engine do you recommend to use? What technology should I use or approach? I would like to avoid Unity3d or any other non-free frameworks, as this work I'm doing is voluntarily. It's main idea is to make learning fun, using 3d si...
2011/10/17
[ "https://gamedev.stackexchange.com/questions/18622", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/3689/" ]
You might check out Ogre3D (<http://www.ogre3d.org/>) as a starting point. Ogre3D isn't necessarily a full game development engine, but it is a solid 3D rendering system. There are various demos you can down Also, check out <http://www.ogre3d.org/tikiwiki/Projects+Using+OGRE> where a number of game engines listed that...
There are many solutions. You have to make sure you know the following * What are your skills with programming languages? * What license is acceptable? * Which OS(s) do you target? (Unix, Linux, Windows, Mac OS...) * What 3D software will you use to create the assets? * How will you manage your assets? * What kind of ...
139,663
I have noticed that as soon as I save an interaction in Journey Builder, SFMC automatically adds SubscriberKey and EmailAddress fields to the Event Source DE (even when I already have an email address field) Am I supposed to use these auto generated fields then? Or Can I just ignore these? Is there a way to stop this ...
2016/09/06
[ "https://salesforce.stackexchange.com/questions/139663", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/26216/" ]
These fields are reserved for system use. I would not recommend removing them or populating values into these fields as this may result in unexpected behavior. I'm not exactly sure what they are used for as there is no documentation on this. Also note that when creating Event Source Data Extensions, you should avoid c...
This is a confirmed bug. The downside is if you have a separate email address field (from salesforce for example) the addition of these fields by the triggered send in the journey will break the ability to use the data extension for sending test emails. No idea if it will be fixed?
10,764,160
How can I draw a simple BAR? Like this: ![simple bar](https://i.stack.imgur.com/xTL6d.png) Thank you.
2012/05/26
[ "https://Stackoverflow.com/questions/10764160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/962508/" ]
Use MySQL's [`STR_TO_DATE()`](http://dev.mysql.com/doc/en/date-and-time-functions.html#function_str-to-date) function: ``` INSERT INTO my_table VALUES (STR_TO_DATE('26/5/12', '%e/%c/%y')) ```
$date = date('d/m/Y'); $date = strtotime($date); //in unix time stamp format
10,764,160
How can I draw a simple BAR? Like this: ![simple bar](https://i.stack.imgur.com/xTL6d.png) Thank you.
2012/05/26
[ "https://Stackoverflow.com/questions/10764160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/962508/" ]
You need to use php's `date()` function along with `strtotime()` to convert date to any format you want. MySQL database stores the date in `YY-MM-DD` format for datetime datatype, so if for example you have a date ``` $date = '26/05/2012'; ``` You can convert it by using [date()](http://in.php.net/manual/en/functi...
Basically american date format is `MM/DD/YYYY` and you are providing `DD/MM/YYYY` so thats why `startotime()` returns you a null values on this input; and i prefer you must follow standard date format of american `(MM/DD/YYYY)` because if you are using mentioned format of date that will create more problems as well in ...
10,764,160
How can I draw a simple BAR? Like this: ![simple bar](https://i.stack.imgur.com/xTL6d.png) Thank you.
2012/05/26
[ "https://Stackoverflow.com/questions/10764160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/962508/" ]
Use MySQL's [`STR_TO_DATE()`](http://dev.mysql.com/doc/en/date-and-time-functions.html#function_str-to-date) function: ``` INSERT INTO my_table VALUES (STR_TO_DATE('26/5/12', '%e/%c/%y')) ```
you could change your DATE column into a String Column and insert the data when ever you want 2 check if the date is right you can use a regular expression to do so
10,764,160
How can I draw a simple BAR? Like this: ![simple bar](https://i.stack.imgur.com/xTL6d.png) Thank you.
2012/05/26
[ "https://Stackoverflow.com/questions/10764160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/962508/" ]
Try this: ``` $mysqldate = date("m/d/y g:i A", $datetime); ```
you could change your DATE column into a String Column and insert the data when ever you want 2 check if the date is right you can use a regular expression to do so
10,764,160
How can I draw a simple BAR? Like this: ![simple bar](https://i.stack.imgur.com/xTL6d.png) Thank you.
2012/05/26
[ "https://Stackoverflow.com/questions/10764160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/962508/" ]
Try this: ``` $mysqldate = date("m/d/y g:i A", $datetime); ```
Basically american date format is `MM/DD/YYYY` and you are providing `DD/MM/YYYY` so thats why `startotime()` returns you a null values on this input; and i prefer you must follow standard date format of american `(MM/DD/YYYY)` because if you are using mentioned format of date that will create more problems as well in ...
10,764,160
How can I draw a simple BAR? Like this: ![simple bar](https://i.stack.imgur.com/xTL6d.png) Thank you.
2012/05/26
[ "https://Stackoverflow.com/questions/10764160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/962508/" ]
$date = date('d/m/Y'); $date = strtotime($date); //in unix time stamp format
you could change your DATE column into a String Column and insert the data when ever you want 2 check if the date is right you can use a regular expression to do so
10,764,160
How can I draw a simple BAR? Like this: ![simple bar](https://i.stack.imgur.com/xTL6d.png) Thank you.
2012/05/26
[ "https://Stackoverflow.com/questions/10764160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/962508/" ]
You need to use php's `date()` function along with `strtotime()` to convert date to any format you want. MySQL database stores the date in `YY-MM-DD` format for datetime datatype, so if for example you have a date ``` $date = '26/05/2012'; ``` You can convert it by using [date()](http://in.php.net/manual/en/functi...
you could change your DATE column into a String Column and insert the data when ever you want 2 check if the date is right you can use a regular expression to do so
10,764,160
How can I draw a simple BAR? Like this: ![simple bar](https://i.stack.imgur.com/xTL6d.png) Thank you.
2012/05/26
[ "https://Stackoverflow.com/questions/10764160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/962508/" ]
You need to use php's `date()` function along with `strtotime()` to convert date to any format you want. MySQL database stores the date in `YY-MM-DD` format for datetime datatype, so if for example you have a date ``` $date = '26/05/2012'; ``` You can convert it by using [date()](http://in.php.net/manual/en/functi...
Try this: ``` $mysqldate = date("m/d/y g:i A", $datetime); ```