qid
int64
1
74.6M
question
stringlengths
45
24.2k
date
stringlengths
10
10
metadata
stringlengths
101
178
response_j
stringlengths
32
23.2k
response_k
stringlengths
21
13.2k
30,707,256
I am implementing instamojo payment method into my website. Can I use a localhost URL as Webhook URL in order to test the process?
2015/06/08
['https://Stackoverflow.com/questions/30707256', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4290253/']
I'm from Instamojo. You can't use a local URL. This is because a webhook request is a POST request that is made from our server. Therefore, the only URLs that we can make these requests to would be URLs that are publicly available. For testing purposes, I would recommend using [RequestBin](https://requestbin.com/). Y...
We can't use localhost or as Webhook URL.If it is used the following error will show "Domain name should not be "localhost" or "127.0.0.1" ". So it must be a live URL.
30,707,256
I am implementing instamojo payment method into my website. Can I use a localhost URL as Webhook URL in order to test the process?
2015/06/08
['https://Stackoverflow.com/questions/30707256', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4290253/']
It is possible to forward Instamojo's webhooks to your local machine using tools like `localtunnel`. * `npm` is required to install localtunnel. [[How to install node and npm]](https://docs.npmjs.com/getting-started/installing-node) * Install [localtunnel](https://localtunnel.me/) Suppose you are running your local ...
We can't use localhost or as Webhook URL.If it is used the following error will show "Domain name should not be "localhost" or "127.0.0.1" ". So it must be a live URL.
30,707,256
I am implementing instamojo payment method into my website. Can I use a localhost URL as Webhook URL in order to test the process?
2015/06/08
['https://Stackoverflow.com/questions/30707256', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4290253/']
We can't use localhost or as Webhook URL.If it is used the following error will show "Domain name should not be "localhost" or "127.0.0.1" ". So it must be a live URL.
You cannot use the localhost URL as a webhook URL in order to test the process. But you can simply bypass it, open hosts file from `C:\Windows\System32\Drivers\etc\hosts` At the end of the line write ``` 127.0.0.1 yourname.com ``` And access localhost using yourname.com. Just change localhost/your-location url...
30,707,256
I am implementing instamojo payment method into my website. Can I use a localhost URL as Webhook URL in order to test the process?
2015/06/08
['https://Stackoverflow.com/questions/30707256', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4290253/']
I'm from Instamojo. You can't use a local URL. This is because a webhook request is a POST request that is made from our server. Therefore, the only URLs that we can make these requests to would be URLs that are publicly available. For testing purposes, I would recommend using [RequestBin](https://requestbin.com/). Y...
It is possible to forward Instamojo's webhooks to your local machine using tools like `localtunnel`. * `npm` is required to install localtunnel. [[How to install node and npm]](https://docs.npmjs.com/getting-started/installing-node) * Install [localtunnel](https://localtunnel.me/) Suppose you are running your local ...
30,707,256
I am implementing instamojo payment method into my website. Can I use a localhost URL as Webhook URL in order to test the process?
2015/06/08
['https://Stackoverflow.com/questions/30707256', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4290253/']
I'm from Instamojo. You can't use a local URL. This is because a webhook request is a POST request that is made from our server. Therefore, the only URLs that we can make these requests to would be URLs that are publicly available. For testing purposes, I would recommend using [RequestBin](https://requestbin.com/). Y...
You cannot use the localhost URL as a webhook URL in order to test the process. But you can simply bypass it, open hosts file from `C:\Windows\System32\Drivers\etc\hosts` At the end of the line write ``` 127.0.0.1 yourname.com ``` And access localhost using yourname.com. Just change localhost/your-location url...
30,707,256
I am implementing instamojo payment method into my website. Can I use a localhost URL as Webhook URL in order to test the process?
2015/06/08
['https://Stackoverflow.com/questions/30707256', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4290253/']
It is possible to forward Instamojo's webhooks to your local machine using tools like `localtunnel`. * `npm` is required to install localtunnel. [[How to install node and npm]](https://docs.npmjs.com/getting-started/installing-node) * Install [localtunnel](https://localtunnel.me/) Suppose you are running your local ...
You cannot use the localhost URL as a webhook URL in order to test the process. But you can simply bypass it, open hosts file from `C:\Windows\System32\Drivers\etc\hosts` At the end of the line write ``` 127.0.0.1 yourname.com ``` And access localhost using yourname.com. Just change localhost/your-location url...
6,624,921
Hi i have a question a tryaing to create Amount calculator in jQuery, AJAX and jQuery UI. But i have a problem, i get all importat values from slider, select box. Bud i really don't know how can a get this value to global. I get value only in each function but when i want get this value out of function this value in va...
2011/07/08
['https://Stackoverflow.com/questions/6624921', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/896953/']
declare the variable outside of your function. ex. ``` var amount; $(function... ```
AndyL's answer should be correct. If you declare the variables you need available in another function outside of your function, and then set their values in one function, they should be available with those values to another function. ``` // outside your function!! var amount, years, irate; // in your functi...
6,624,921
Hi i have a question a tryaing to create Amount calculator in jQuery, AJAX and jQuery UI. But i have a problem, i get all importat values from slider, select box. Bud i really don't know how can a get this value to global. I get value only in each function but when i want get this value out of function this value in va...
2011/07/08
['https://Stackoverflow.com/questions/6624921', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/896953/']
declare the variable outside of your function. ex. ``` var amount; $(function... ```
Try using jquery's data() object; ``` $(function(){ ... slide: function (e, ui) { $("#amount_show").val(ui.value); amount = ui.value; // Add to data() object here $('#amount').data('amount',amount); } // reference it elsewhere in your script like such: console.log($('#amount').data('amount')); ```
6,624,921
Hi i have a question a tryaing to create Amount calculator in jQuery, AJAX and jQuery UI. But i have a problem, i get all importat values from slider, select box. Bud i really don't know how can a get this value to global. I get value only in each function but when i want get this value out of function this value in va...
2011/07/08
['https://Stackoverflow.com/questions/6624921', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/896953/']
declare the variable outside of your function. ex. ``` var amount; $(function... ```
a global variable should work, however, Shouldn't you want to change your 'calculator' if they change the values of something? pretend this is the html for the calculated amount: ``` <input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" /> ``` then you will need something like this code ...
6,624,921
Hi i have a question a tryaing to create Amount calculator in jQuery, AJAX and jQuery UI. But i have a problem, i get all importat values from slider, select box. Bud i really don't know how can a get this value to global. I get value only in each function but when i want get this value out of function this value in va...
2011/07/08
['https://Stackoverflow.com/questions/6624921', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/896953/']
AndyL's answer should be correct. If you declare the variables you need available in another function outside of your function, and then set their values in one function, they should be available with those values to another function. ``` // outside your function!! var amount, years, irate; // in your functi...
Try using jquery's data() object; ``` $(function(){ ... slide: function (e, ui) { $("#amount_show").val(ui.value); amount = ui.value; // Add to data() object here $('#amount').data('amount',amount); } // reference it elsewhere in your script like such: console.log($('#amount').data('amount')); ```
6,624,921
Hi i have a question a tryaing to create Amount calculator in jQuery, AJAX and jQuery UI. But i have a problem, i get all importat values from slider, select box. Bud i really don't know how can a get this value to global. I get value only in each function but when i want get this value out of function this value in va...
2011/07/08
['https://Stackoverflow.com/questions/6624921', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/896953/']
AndyL's answer should be correct. If you declare the variables you need available in another function outside of your function, and then set their values in one function, they should be available with those values to another function. ``` // outside your function!! var amount, years, irate; // in your functi...
a global variable should work, however, Shouldn't you want to change your 'calculator' if they change the values of something? pretend this is the html for the calculated amount: ``` <input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" /> ``` then you will need something like this code ...
69,712,966
I have been struggling with creating a legend in my ggplot for some time now, and I cannot find any answer that works. This is the stripped down version of my ggplot: ``` ggplot() + geom_smooth(data = mydf1, aes(x, predicted, linetype = 1), method = "lm", linetype = 1, colour = "black") + geom_smooth(data = mydf...
2021/10/25
['https://Stackoverflow.com/questions/69712966', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/13339640/']
Bring the line linetype inside aes() and use lab() to give title for the legend. ``` ggplot() + geom_smooth(data = mydf1, aes(x, predicted, linetype = "Group 1"), method = "lm", colour = "black") + geom_smooth(data = mydf2, aes(x, predicted, linetype = "Group 2"), method = "lm", colour = "black") + geom_smooth(...
Here is an alternative way using `bind_rows`: ``` library(dplyr) library(ggplot2) bind_rows(mydf1, mydf2, mydf3) %>% mutate(group = as.integer(gl(n(), 11, n()))) %>% ggplot(aes(x, predicted, linetype=factor(group)))+ geom_smooth(color="black", method = "lm", se=F) + scale_linetype_discrete(name="group", ...
15,501,034
I try to load a codeigniter view in iframe as, `<iframe src="<?php $this->load->view('lists');?/>"></iframe>` But the page could not load. With out i frame its working. How do i load this view in iframe ?
2013/03/19
['https://Stackoverflow.com/questions/15501034', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1939388/']
You can't assign plain html to iframe elements src attribute. You should have a controller that render your html and then set src attribute to that controller. ``` <iframe src="<?php echo base_url( 'controller_that_render_list_html' ) ?>"></iframe> ```
This is because the iframe is on another page? you haven't specified the controller function on that page so it doesn't recognize the view. i think you have to put the controller date from your view into the function for the view you have your iframe in, so lik this. ``` function list_view() { //functions for your lis...
15,501,034
I try to load a codeigniter view in iframe as, `<iframe src="<?php $this->load->view('lists');?/>"></iframe>` But the page could not load. With out i frame its working. How do i load this view in iframe ?
2013/03/19
['https://Stackoverflow.com/questions/15501034', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1939388/']
create a function in your controller ``` //project.php function view_list() { $this->load->view('lists'); } ``` and call in the view page like this ``` <iframe src="<?php echo site_url('project/view_list');?>">> </iframe> ```
This is because the iframe is on another page? you haven't specified the controller function on that page so it doesn't recognize the view. i think you have to put the controller date from your view into the function for the view you have your iframe in, so lik this. ``` function list_view() { //functions for your lis...
15,501,034
I try to load a codeigniter view in iframe as, `<iframe src="<?php $this->load->view('lists');?/>"></iframe>` But the page could not load. With out i frame its working. How do i load this view in iframe ?
2013/03/19
['https://Stackoverflow.com/questions/15501034', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1939388/']
I wanted to tile a site with several views, each in their own iframe, this is what I did: The controller, **book.php** ``` <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Book extends CI_Controller { public function index(){ $this->shell(); } public function she...
This is because the iframe is on another page? you haven't specified the controller function on that page so it doesn't recognize the view. i think you have to put the controller date from your view into the function for the view you have your iframe in, so lik this. ``` function list_view() { //functions for your lis...
15,501,034
I try to load a codeigniter view in iframe as, `<iframe src="<?php $this->load->view('lists');?/>"></iframe>` But the page could not load. With out i frame its working. How do i load this view in iframe ?
2013/03/19
['https://Stackoverflow.com/questions/15501034', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1939388/']
create a function in your controller ``` //project.php function view_list() { $this->load->view('lists'); } ``` and call in the view page like this ``` <iframe src="<?php echo site_url('project/view_list');?>">> </iframe> ```
You can't assign plain html to iframe elements src attribute. You should have a controller that render your html and then set src attribute to that controller. ``` <iframe src="<?php echo base_url( 'controller_that_render_list_html' ) ?>"></iframe> ```
15,501,034
I try to load a codeigniter view in iframe as, `<iframe src="<?php $this->load->view('lists');?/>"></iframe>` But the page could not load. With out i frame its working. How do i load this view in iframe ?
2013/03/19
['https://Stackoverflow.com/questions/15501034', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1939388/']
create a function in your controller ``` //project.php function view_list() { $this->load->view('lists'); } ``` and call in the view page like this ``` <iframe src="<?php echo site_url('project/view_list');?>">> </iframe> ```
I wanted to tile a site with several views, each in their own iframe, this is what I did: The controller, **book.php** ``` <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Book extends CI_Controller { public function index(){ $this->shell(); } public function she...
4,381,225
I have a database called RankHistory that is populated daily with each user's username and rank for the day (rank as in 1,2,3,...). I keep logs going back 90 days for every user, but my user base has grown to the point that the MySQL database holding these logs is now in excess of 20 million rows. This data is recorde...
2010/12/07
['https://Stackoverflow.com/questions/4381225', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/115182/']
How great is the need for historic data in this case? My first thought would be to truncate data older than a certain threshold, or move it to an archive table that doesn't require as frequent or fast access as your current data. You also mention keeping 90 days of data per user, but the data is only used to show a gr...
Could you run an automated task like a cron job that checks the database every day or week and deletes entries that are more than 90 days old?
4,381,225
I have a database called RankHistory that is populated daily with each user's username and rank for the day (rank as in 1,2,3,...). I keep logs going back 90 days for every user, but my user base has grown to the point that the MySQL database holding these logs is now in excess of 20 million rows. This data is recorde...
2010/12/07
['https://Stackoverflow.com/questions/4381225', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/115182/']
How great is the need for historic data in this case? My first thought would be to truncate data older than a certain threshold, or move it to an archive table that doesn't require as frequent or fast access as your current data. You also mention keeping 90 days of data per user, but the data is only used to show a gr...
Another option, do can you create some "roll-up" aggregate per user based on whatever the criteria is... counts, sales, whatever and it is all stored based on employee + date of activity. Then you could have your pre-aggregated rollups in a much smaller table for however long in history you need. Triggers, or nightly p...
127,322
In the context of testing using hardhat... **The scenario:** My `token` is transfering from `owner` to `receiverContract`. I want to check that receiverContract emitted a `Received` event. The transaction looks like this and is initiated by the owner. ```js const tx = await token.transferFrom( owner.address, // <-...
2022/05/02
['https://ethereum.stackexchange.com/questions/127322', 'https://ethereum.stackexchange.com', 'https://ethereum.stackexchange.com/users/68369/']
I figured out how to do it. Each contract can be viewed via `console.log(receiverContract)`... so I eventually navigated to the event object inside the contract. Here is a snippet of the contract when logged... ```js { interface: Interface { fragments: [ [ConstructorFragment], [EventFragment], [FunctionFragment...
Since there's no interaction with the receiving contract, it will not emit anything. Transaction is sent to the token, which emits `Transfer` event once it changes records of its ledger. You can watch the token for `Transfer` event, or read the transaction receipt, decode the log and check for that event.
127,322
In the context of testing using hardhat... **The scenario:** My `token` is transfering from `owner` to `receiverContract`. I want to check that receiverContract emitted a `Received` event. The transaction looks like this and is initiated by the owner. ```js const tx = await token.transferFrom( owner.address, // <-...
2022/05/02
['https://ethereum.stackexchange.com/questions/127322', 'https://ethereum.stackexchange.com', 'https://ethereum.stackexchange.com/users/68369/']
I figured out how to do it. Each contract can be viewed via `console.log(receiverContract)`... so I eventually navigated to the event object inside the contract. Here is a snippet of the contract when logged... ```js { interface: Interface { fragments: [ [ConstructorFragment], [EventFragment], [FunctionFragment...
The ERC20 contract transaction is sent to the token contract itself, and not to the receiving contract, hence there cannot be any event emitted from the receiving contract. A receiving contract can emit any event only if it has been configured in either the `receive()` or `fallback()` method. That too, while sending `...
23,404
When widening a road, why does construction seem to inevitably include a "smoothing" out of the curves on the road, essentially making it more straight? I've seen this personally on roads where I travel, and you can even catch a glimpse on Google satellite imagery of roads that are in the widening process: Google ove...
2018/08/22
['https://engineering.stackexchange.com/questions/23404', 'https://engineering.stackexchange.com', 'https://engineering.stackexchange.com/users/17255/']
A wider road will have faster average traffic speeds, because faster vehicles will be hindered less by slow ones, with more lanes available for overtaking. So longer visibility distances are needed for safety, and hence more gradual curves and more gradual changes of gradient (no "hidden spots" over the brow of a hill...
I am familiar with this effect; with careful observation you can count at least three rounds of road-straightening on highway 17 between the cities of San Jose and Santa Cruz in California. The first road was built over 100 years ago and carried horse-drawn wagons. At the time, moving large volumes of earth and rock w...
4,627,682
This is an extremely elementary question but I want to make sure I understand this right. If someone adds two numbers in their mind and tells us the sum, it is impossible to prove mathematically what two numbers they chose (in most cases). The number of distinct ways to add two numbers to form say, an integer $n$, is ...
2023/01/28
['https://math.stackexchange.com/questions/4627682', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/990260/']
If you want 4, 1+3 and 2+2 to be separate elements of your collection, then you should also be able to involve these elements in sums separately. so 5+4, 5+(1+3), and 5+(2+2) should all be different elements of your structure as well. Consider the set of expressions built up out of base elements via binary sums, with ...
Multiplication of prime numbers is reversible, in the sense that any positive integer is expressible as a product of primes in just one way (not counting changing order...). (The computational difficulty of reversing the operation, that is, of *factoring* versus multiplying, is the basis of the RSA cryptosystem and ot...
21,922,305
I have read that the `role` attribute was added to [Bootstrap](http://getbootstrap.com/) for accessibility, and I would like to know how `<form role="form">` helps accessibility. See <http://getbootstrap.com/css/#forms-example> for an example of this specific usage. *I [searched Bootstrap's repo for "role"](https://gi...
2014/02/20
['https://Stackoverflow.com/questions/21922305', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/664833/']
If you add a `role="form"` to a form, a screen reader sees it as a region on a webpage. That means that a user can easily jump to the form with his/her region quick navigation keys (for example, in JAWS 15 you use *R* for this). And also, your user will be able to easily find where the form starts and ends because scre...
Semantically speaking, a form by default is, well, a form. However, not all accessibility applications(screen readers, etc) are designed the same and some can use elements (even the form element) with the `role=form` attribute differently even if they understand that the parent form element will have the same semantic ...
21,922,305
I have read that the `role` attribute was added to [Bootstrap](http://getbootstrap.com/) for accessibility, and I would like to know how `<form role="form">` helps accessibility. See <http://getbootstrap.com/css/#forms-example> for an example of this specific usage. *I [searched Bootstrap's repo for "role"](https://gi...
2014/02/20
['https://Stackoverflow.com/questions/21922305', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/664833/']
If you add a `role="form"` to a form, a screen reader sees it as a region on a webpage. That means that a user can easily jump to the form with his/her region quick navigation keys (for example, in JAWS 15 you use *R* for this). And also, your user will be able to easily find where the form starts and ends because scre...
I'd like to point out that the article @user664833 mentioned in a [comment](https://stackoverflow.com/questions/21922305/how-does-role-form-help-accessibility#comment33241849_21922985) states that **`role="form"` shouldn't go on `<form>` elements**, but rather on a `<div>` or some other element which does not semantica...
21,922,305
I have read that the `role` attribute was added to [Bootstrap](http://getbootstrap.com/) for accessibility, and I would like to know how `<form role="form">` helps accessibility. See <http://getbootstrap.com/css/#forms-example> for an example of this specific usage. *I [searched Bootstrap's repo for "role"](https://gi...
2014/02/20
['https://Stackoverflow.com/questions/21922305', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/664833/']
If you add a `role="form"` to a form, a screen reader sees it as a region on a webpage. That means that a user can easily jump to the form with his/her region quick navigation keys (for example, in JAWS 15 you use *R* for this). And also, your user will be able to easily find where the form starts and ends because scre...
In fact, the ARIA 1.1 W3C recommendation states clearly one should not change the host language semantics in section 1.4 ([source](https://www.w3.org/TR/wai-aria-1.1/#co-evolution)): > > "It is not appropriate to create objects with style and script when > the host language provides a semantic element for that type ...
21,922,305
I have read that the `role` attribute was added to [Bootstrap](http://getbootstrap.com/) for accessibility, and I would like to know how `<form role="form">` helps accessibility. See <http://getbootstrap.com/css/#forms-example> for an example of this specific usage. *I [searched Bootstrap's repo for "role"](https://gi...
2014/02/20
['https://Stackoverflow.com/questions/21922305', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/664833/']
I'd like to point out that the article @user664833 mentioned in a [comment](https://stackoverflow.com/questions/21922305/how-does-role-form-help-accessibility#comment33241849_21922985) states that **`role="form"` shouldn't go on `<form>` elements**, but rather on a `<div>` or some other element which does not semantica...
Semantically speaking, a form by default is, well, a form. However, not all accessibility applications(screen readers, etc) are designed the same and some can use elements (even the form element) with the `role=form` attribute differently even if they understand that the parent form element will have the same semantic ...
21,922,305
I have read that the `role` attribute was added to [Bootstrap](http://getbootstrap.com/) for accessibility, and I would like to know how `<form role="form">` helps accessibility. See <http://getbootstrap.com/css/#forms-example> for an example of this specific usage. *I [searched Bootstrap's repo for "role"](https://gi...
2014/02/20
['https://Stackoverflow.com/questions/21922305', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/664833/']
In fact, the ARIA 1.1 W3C recommendation states clearly one should not change the host language semantics in section 1.4 ([source](https://www.w3.org/TR/wai-aria-1.1/#co-evolution)): > > "It is not appropriate to create objects with style and script when > the host language provides a semantic element for that type ...
Semantically speaking, a form by default is, well, a form. However, not all accessibility applications(screen readers, etc) are designed the same and some can use elements (even the form element) with the `role=form` attribute differently even if they understand that the parent form element will have the same semantic ...
27,997
Suppose I have a tesselation, e.g. the Stanford bunny: ``` bunny = Import["http://graphics.stanford.edu/~mdfisher/Data/Meshes/bunny.obj", "OBJ"] ``` ![Stanford bunny](https://i.stack.imgur.com/lOysk.png) I'd like to be able to click on one of the vertices of the tessellation and either get its coordinates, or even ...
2013/07/03
['https://mathematica.stackexchange.com/questions/27997', 'https://mathematica.stackexchange.com', 'https://mathematica.stackexchange.com/users/1010/']
The following works pretty well, I think. The problem is choosing the point that is nearest the mouse click. `MousePosition["Graphics3DBoxIntercepts"]` returns the coordinates of the two points of the bounding box below the mouse click, which I think of as determining a line. The function `projCoords` converts the poin...
Perhaps you can use something like this: I took the points in the `GraphisComplex` and made an additional set of `Point`s representing the vertices in `Yellow`. The points are extracted and then put back by means of a replacement rule: ``` data = ExampleData[{"Geometry3D", "StanfordBunny"}, "VertexData"]; bunny = ...
68,397,282
Regardless of the JSON object structure (simple or complex) what would be the ideal method to extract all urls from the following object into an array to iterate over in Javascript? ``` { "url": "https://example.com:443/-/media/images/site/info", "data": [ { "id": "da56fac6-6907-4055-96...
2021/07/15
['https://Stackoverflow.com/questions/68397282', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/358649/']
I think the better and easier way is to stringfy given json into string and solve it by regex. But still if you need to solve it by recursive, try the codes below: ``` const obj = { url: "https://example.com:443/-/media/images/site/info", data: [ { id: "da56fac6-6907-4055-96b8-f8427d4c64fd", ...
i'd agree to use a JSON parser, but if you want to do it with a regular expression, you might try this ```js console.log(JSON.stringify({ "url": "https://example.com:443/-/media/images/site/info", "data": [{ "id": "da56fac6-6907-4055-96b8-f8427d4c64fd", "title": "AAAA 2021", "time": "", "dateStart"...
50,848,178
I tried to make a odd/even 'calculator' in python and it keeps popping up errors. Here's the code: ``` def odd_even(): print("Welcome to Odd/Even") num = input("Pick a number: ") num2 = num/2 if num2 == int: print("This number is even") else: print("This number is odd") ``` Id lik...
2018/06/14
['https://Stackoverflow.com/questions/50848178', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9394239/']
There is an error in the line: `num = input("Pick a number: ")` Because input method always returns a `String`,so you should convert it into int to performs the `integer` operation The currect code is: ``` num =int( input("Pick a number: ")) ```
you can't do math with strings convert it to int ``` try: num = int(input("Pick a number: ")) except ValueError: print('This is not a number!') return ```
52,041,232
Here is my problem, I would like to map a dictionary in a DataFrame but I cannot find a way to do that when the dictionary has several keys. Note that these keys are present in different columns in the DataFrame. Here is an example: this is the dataframe I have at the begining, df: ``` Index key 0 ...
2018/08/27
['https://Stackoverflow.com/questions/52041232', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10028348/']
It is explained in the [Java Language Specification](https://docs.oracle.com/javase/specs/jls/se10/html/jls-11.html#jls-11.2.3) (emphasis in bold): > > It is a compile-time error if a `catch` clause *can catch* checked exception class E1 and it is not the case that the `try` block corresponding to the `catch` clause ...
Exception extends from `RuntimeException` will considered as uncheched exception, so it's ok: ``` class MyException extends RuntimeException { } try { ... } catch (MyException e) { } ``` Your exception extends from `Throwable`, so it is cheched exception. Since the compiler noticed that it is never thrown, so ...
30,365,008
Hi guys i'm doing some automations scripts with Watir and trying to create a ruby class to make it better but i'm having this error: > > examen.rb:6:in 'enterEmail': undefined method 'text\_field' for # (NoMethodError) > > > This is part of my conflictive code: ``` require 'watir-webdriver' class LoginPage de...
2015/05/21
['https://Stackoverflow.com/questions/30365008', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3247357/']
`text_field` is an instance method of The `Watir::Browser` class. If you want to use it, you have to call it on an instance of that class. ``` class LoginPage def initialize() @b = Watir::Browser.new end def enterEmail (email) @b.text_field(:user, :id => 'user_email').set email end end ```
Indeed, your class does not have any `text_field` method. This method is a defined on `Watir::Browser` instance. In your example, haven't created one. ``` class LoginPage def initialize @browser = Watir::Browser.new @browser.goto "http://example.com" end def enterEmail (email) @browser.text_field(:...
30,365,008
Hi guys i'm doing some automations scripts with Watir and trying to create a ruby class to make it better but i'm having this error: > > examen.rb:6:in 'enterEmail': undefined method 'text\_field' for # (NoMethodError) > > > This is part of my conflictive code: ``` require 'watir-webdriver' class LoginPage de...
2015/05/21
['https://Stackoverflow.com/questions/30365008', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3247357/']
`text_field` is an instance method of The `Watir::Browser` class. If you want to use it, you have to call it on an instance of that class. ``` class LoginPage def initialize() @b = Watir::Browser.new end def enterEmail (email) @b.text_field(:user, :id => 'user_email').set email end end ```
Both Yossi and Martin have correct answers. But because you're defining a `LoginPage` class, you should probably look into the [page-object](http://github.com/cheezy/page-object) gem. This lets you define a `text_field` almost identical to the code you already have. Your class would look like: ``` class LoginPage in...
9,324,563
Consider the following registry export: ```none Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\WinSock2\Parameters\Protocol_Catalog9\Catalog_Entries\000000000001] ;... "ProtocolName"="@%SystemRoot%\\System32\\wshtcpip.dll,-60100" ``` The intention here appears to be for s...
2012/02/17
['https://Stackoverflow.com/questions/9324563', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/82320/']
[`RegLoadMUIString`](http://msdn.microsoft.com/en-us/library/windows/desktop/ms724890.aspx) will do the necessary for you. Note however, that it was introduced in Vista so won't help if you need to support XP. If you want to avoid code in the DLL running whilst you extract resources, use [`LoadLibraryEx`](http://msdn....
This is going to help: ``` HMODULE hModule = LoadLibrary(_T("wshtcpip.dll")); // LoadLibraryEx is even better TCHAR pszValue[1024] = { 0 }; INT nResult = LoadString(hModule, 60100, pszValue, _countof(pszValue)); ``` `LoadString` will take care of downloading resource from MUI, if needed. LoadString uses thread local...
8,609,546
I'm using maven and the maven-javadoc-plugin with the umlgraph-doclet to create javadoc for my project. The part from my pom: ``` <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <inherited>false</inherited> <configuration> ...
2011/12/22
['https://Stackoverflow.com/questions/8609546', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1094486/']
UmlGraphDoc version 5.4, altering javadocs Warning, could not find a line that matches the pattern '/H2' The HTML is simply different. Java7 JavaDocs START OF CLASS DATA h2 title="blah blah Java6 JavaDocs START OF CLASS DATA H2 You can decompile and modify UmlGraphDoc.java
I have the same problem. My guess is that it's this bug: <https://issues.jboss.org/browse/APIVIZ-10>
8,609,546
I'm using maven and the maven-javadoc-plugin with the umlgraph-doclet to create javadoc for my project. The part from my pom: ``` <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <inherited>false</inherited> <configuration> ...
2011/12/22
['https://Stackoverflow.com/questions/8609546', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1094486/']
I checked the possibilities, and the situation is following:. * relevant bug in the UmlGraph has been already fixed: <https://github.com/dspinellis/UMLGraph/pull/8> * problem is however that no stable version of UmlGraph has been released yet that would include the fix However good news is that there exists snapshot ...
I have the same problem. My guess is that it's this bug: <https://issues.jboss.org/browse/APIVIZ-10>
8,609,546
I'm using maven and the maven-javadoc-plugin with the umlgraph-doclet to create javadoc for my project. The part from my pom: ``` <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <inherited>false</inherited> <configuration> ...
2011/12/22
['https://Stackoverflow.com/questions/8609546', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1094486/']
Update: version 5.6.6 is now on maven central. I built with JDK 7 and diagrams look ok. ``` <plugin> <artifactId>maven-javadoc-plugin</artifactId> <version>2.7</version> <configuration> <aggregate>true</aggregate> <show>private</show> <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>...
I have the same problem. My guess is that it's this bug: <https://issues.jboss.org/browse/APIVIZ-10>
8,609,546
I'm using maven and the maven-javadoc-plugin with the umlgraph-doclet to create javadoc for my project. The part from my pom: ``` <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <inherited>false</inherited> <configuration> ...
2011/12/22
['https://Stackoverflow.com/questions/8609546', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1094486/']
I checked the possibilities, and the situation is following:. * relevant bug in the UmlGraph has been already fixed: <https://github.com/dspinellis/UMLGraph/pull/8> * problem is however that no stable version of UmlGraph has been released yet that would include the fix However good news is that there exists snapshot ...
UmlGraphDoc version 5.4, altering javadocs Warning, could not find a line that matches the pattern '/H2' The HTML is simply different. Java7 JavaDocs START OF CLASS DATA h2 title="blah blah Java6 JavaDocs START OF CLASS DATA H2 You can decompile and modify UmlGraphDoc.java
8,609,546
I'm using maven and the maven-javadoc-plugin with the umlgraph-doclet to create javadoc for my project. The part from my pom: ``` <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <inherited>false</inherited> <configuration> ...
2011/12/22
['https://Stackoverflow.com/questions/8609546', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1094486/']
Update: version 5.6.6 is now on maven central. I built with JDK 7 and diagrams look ok. ``` <plugin> <artifactId>maven-javadoc-plugin</artifactId> <version>2.7</version> <configuration> <aggregate>true</aggregate> <show>private</show> <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>...
UmlGraphDoc version 5.4, altering javadocs Warning, could not find a line that matches the pattern '/H2' The HTML is simply different. Java7 JavaDocs START OF CLASS DATA h2 title="blah blah Java6 JavaDocs START OF CLASS DATA H2 You can decompile and modify UmlGraphDoc.java
5,808,172
I am currently working on my final thesis.I have a small problem.I need to pass a HTML block which is a string block to a javascript function.I have to do this from code behind.I have tried it so much I doesnt seem as it is going to work.Here is the code in code-behind: ``` string htmlFlightDetailsJavaScript ; ``` I...
2011/04/27
['https://Stackoverflow.com/questions/5808172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/727788/']
You can use the [ClientScriptManager.RegisterStartupScript](http://msdn.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.registerstartupscript.aspx) method.
I'd take a step back and examine whether the entire HTML block is really so dynamic that it needs to be passed into the function as a parameter. The easier way would be to have the HTML element emitted as part of the page, then augment that from your function. ie. show or hide it. If your scenario still requires you...
5,808,172
I am currently working on my final thesis.I have a small problem.I need to pass a HTML block which is a string block to a javascript function.I have to do this from code behind.I have tried it so much I doesnt seem as it is going to work.Here is the code in code-behind: ``` string htmlFlightDetailsJavaScript ; ``` I...
2011/04/27
['https://Stackoverflow.com/questions/5808172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/727788/']
If the classes in `htmlFlightDetailsJavaScript` are in the form `div class="bla"` you likely have to escape the quotes in the string or use single quotes, e.g. `div class='bla'`.
I'd take a step back and examine whether the entire HTML block is really so dynamic that it needs to be passed into the function as a parameter. The easier way would be to have the HTML element emitted as part of the page, then augment that from your function. ie. show or hide it. If your scenario still requires you...
5,808,172
I am currently working on my final thesis.I have a small problem.I need to pass a HTML block which is a string block to a javascript function.I have to do this from code behind.I have tried it so much I doesnt seem as it is going to work.Here is the code in code-behind: ``` string htmlFlightDetailsJavaScript ; ``` I...
2011/04/27
['https://Stackoverflow.com/questions/5808172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/727788/']
**This sounds like invalid Javascript is being generated**. This hypothesis can be verified with inspecting the *actual* Javascript transmitted and verifying the entire result, in context, for correctness. That is, imagine that this invalid Javascript was generated: ``` alert("<div class="I just broke JS" ...>") ``...
I guess you can accomplish much faster if you use an ajax call and a partial control (user control) or write the content yourself. 1) The user control will render your html data. 2) The page code behind will receive the ajax call and call the method thal will render the partial control or write. 3) The method will wri...
5,808,172
I am currently working on my final thesis.I have a small problem.I need to pass a HTML block which is a string block to a javascript function.I have to do this from code behind.I have tried it so much I doesnt seem as it is going to work.Here is the code in code-behind: ``` string htmlFlightDetailsJavaScript ; ``` I...
2011/04/27
['https://Stackoverflow.com/questions/5808172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/727788/']
**This sounds like invalid Javascript is being generated**. This hypothesis can be verified with inspecting the *actual* Javascript transmitted and verifying the entire result, in context, for correctness. That is, imagine that this invalid Javascript was generated: ``` alert("<div class="I just broke JS" ...>") ``...
Use the RegisterClientScriptBlock() method and make sure to escape your quotes in your HTML. "<div class=\"blah\">"
5,808,172
I am currently working on my final thesis.I have a small problem.I need to pass a HTML block which is a string block to a javascript function.I have to do this from code behind.I have tried it so much I doesnt seem as it is going to work.Here is the code in code-behind: ``` string htmlFlightDetailsJavaScript ; ``` I...
2011/04/27
['https://Stackoverflow.com/questions/5808172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/727788/']
**This sounds like invalid Javascript is being generated**. This hypothesis can be verified with inspecting the *actual* Javascript transmitted and verifying the entire result, in context, for correctness. That is, imagine that this invalid Javascript was generated: ``` alert("<div class="I just broke JS" ...>") ``...
I'd take a step back and examine whether the entire HTML block is really so dynamic that it needs to be passed into the function as a parameter. The easier way would be to have the HTML element emitted as part of the page, then augment that from your function. ie. show or hide it. If your scenario still requires you...
5,808,172
I am currently working on my final thesis.I have a small problem.I need to pass a HTML block which is a string block to a javascript function.I have to do this from code behind.I have tried it so much I doesnt seem as it is going to work.Here is the code in code-behind: ``` string htmlFlightDetailsJavaScript ; ``` I...
2011/04/27
['https://Stackoverflow.com/questions/5808172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/727788/']
Use the RegisterClientScriptBlock() method and make sure to escape your quotes in your HTML. "<div class=\"blah\">"
I guess you can accomplish much faster if you use an ajax call and a partial control (user control) or write the content yourself. 1) The user control will render your html data. 2) The page code behind will receive the ajax call and call the method thal will render the partial control or write. 3) The method will wri...
5,808,172
I am currently working on my final thesis.I have a small problem.I need to pass a HTML block which is a string block to a javascript function.I have to do this from code behind.I have tried it so much I doesnt seem as it is going to work.Here is the code in code-behind: ``` string htmlFlightDetailsJavaScript ; ``` I...
2011/04/27
['https://Stackoverflow.com/questions/5808172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/727788/']
You can use the [ClientScriptManager.RegisterStartupScript](http://msdn.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.registerstartupscript.aspx) method.
I guess you can accomplish much faster if you use an ajax call and a partial control (user control) or write the content yourself. 1) The user control will render your html data. 2) The page code behind will receive the ajax call and call the method thal will render the partial control or write. 3) The method will wri...
5,808,172
I am currently working on my final thesis.I have a small problem.I need to pass a HTML block which is a string block to a javascript function.I have to do this from code behind.I have tried it so much I doesnt seem as it is going to work.Here is the code in code-behind: ``` string htmlFlightDetailsJavaScript ; ``` I...
2011/04/27
['https://Stackoverflow.com/questions/5808172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/727788/']
**This sounds like invalid Javascript is being generated**. This hypothesis can be verified with inspecting the *actual* Javascript transmitted and verifying the entire result, in context, for correctness. That is, imagine that this invalid Javascript was generated: ``` alert("<div class="I just broke JS" ...>") ``...
You can use the [ClientScriptManager.RegisterStartupScript](http://msdn.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.registerstartupscript.aspx) method.
5,808,172
I am currently working on my final thesis.I have a small problem.I need to pass a HTML block which is a string block to a javascript function.I have to do this from code behind.I have tried it so much I doesnt seem as it is going to work.Here is the code in code-behind: ``` string htmlFlightDetailsJavaScript ; ``` I...
2011/04/27
['https://Stackoverflow.com/questions/5808172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/727788/']
**This sounds like invalid Javascript is being generated**. This hypothesis can be verified with inspecting the *actual* Javascript transmitted and verifying the entire result, in context, for correctness. That is, imagine that this invalid Javascript was generated: ``` alert("<div class="I just broke JS" ...>") ``...
If the classes in `htmlFlightDetailsJavaScript` are in the form `div class="bla"` you likely have to escape the quotes in the string or use single quotes, e.g. `div class='bla'`.
5,808,172
I am currently working on my final thesis.I have a small problem.I need to pass a HTML block which is a string block to a javascript function.I have to do this from code behind.I have tried it so much I doesnt seem as it is going to work.Here is the code in code-behind: ``` string htmlFlightDetailsJavaScript ; ``` I...
2011/04/27
['https://Stackoverflow.com/questions/5808172', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/727788/']
If the classes in `htmlFlightDetailsJavaScript` are in the form `div class="bla"` you likely have to escape the quotes in the string or use single quotes, e.g. `div class='bla'`.
I guess you can accomplish much faster if you use an ajax call and a partial control (user control) or write the content yourself. 1) The user control will render your html data. 2) The page code behind will receive the ajax call and call the method thal will render the partial control or write. 3) The method will wri...
18,881,883
I need to take two parameters in my spring controller. <http://mydomain.com/myapp/getDetails?Id=13&subId=431> I have controller which will return Json for this request. ``` @RequestMapping(value = "/getDetails", method = RequestMethod.GET,params = "id,subId", produces="application/json") @ResponseBody public...
2013/09/18
['https://Stackoverflow.com/questions/18881883', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1322144/']
Try specifying which parameter in the query string should match the parameter in the method like so: ``` public MyBean getsubIds(@RequestParam("id") String id, @RequestParam("subId") String subId) { ``` If the code is being compiled without the parameter names, Spring can have trouble figuring out which is which.
As for me it works (by calling: <http://www.example.com/getDetails?id=10&subId=15>): ``` @RequestMapping(value = "/getDetails", method = RequestMethod.GET, produces="application/json") @ResponseBody public MyBean getsubIds(@RequestParam("id") String id, @RequestParam("subId") String subId) { return new MyBean(); }...
26,682
My band is working with a somewhat pricey mastering engineer and we are wanting to keep the price down. For a price we're comfortable with, he will either provide us with hi-res masters (24bit, 48khz - the recording quality), or with CD-quality masters + DDP file (16bit-44.1khz). My gut is to get the hi-res masters, b...
2014/01/31
['https://sound.stackexchange.com/questions/26682', 'https://sound.stackexchange.com', 'https://sound.stackexchange.com/users/7283/']
Dither, Noise Shaping, and Bit Quantization. These are the reasons for the separate mastering passes. All of which do not need to be considered when mixing/bouncing the audio in the native digital format it was converted to (24bit/48khz). Also, it sounds like he will provide you with individual "HiRes" native files O...
For going from 24 bit to 16 bit is relativity simple since it is evenly divisible, however you will still want to apply a dither to make up for the way the originally analog signal loses resolution. This allows simulating a wider set of distinct values than 16 bits would normally allow in exchange for some minimal nois...
168,731
I'm just starting WoW for the first time... My question: Is the storyline and quests that I'm doing the same as what players did when the game started (in 2002 or whatever)? Or have events happened in the game that have progressed the entire timeline/story of the game for new players?
2014/05/20
['https://gaming.stackexchange.com/questions/168731', 'https://gaming.stackexchange.com', 'https://gaming.stackexchange.com/users/76989/']
Each continent roughly corresponds to an expansion e.g. an arc in the timeline. * Outlands: Burning Crusade (2007). It is unmodified. * Northrend: Wrath of the Lich King (2008). It is unmodified. * Eastern Kingdoms and Kalimdor: Cataclysm (2010). This expansion completely replaces the quests and map from the classic v...
The whole world has changed into a cataclysmic world. It should be the same but with more quests and a higher level cap.
168,731
I'm just starting WoW for the first time... My question: Is the storyline and quests that I'm doing the same as what players did when the game started (in 2002 or whatever)? Or have events happened in the game that have progressed the entire timeline/story of the game for new players?
2014/05/20
['https://gaming.stackexchange.com/questions/168731', 'https://gaming.stackexchange.com', 'https://gaming.stackexchange.com/users/76989/']
With each expansion, in the World of Warcraft universe, the level cap of your character increases by 5-10 levels. There is a general "theme", and throughout the release and consequent patches, there are some significant events that take place in terms of storyline. Each expansion is catered predominantly for players w...
The whole world has changed into a cataclysmic world. It should be the same but with more quests and a higher level cap.
168,731
I'm just starting WoW for the first time... My question: Is the storyline and quests that I'm doing the same as what players did when the game started (in 2002 or whatever)? Or have events happened in the game that have progressed the entire timeline/story of the game for new players?
2014/05/20
['https://gaming.stackexchange.com/questions/168731', 'https://gaming.stackexchange.com', 'https://gaming.stackexchange.com/users/76989/']
Each continent roughly corresponds to an expansion e.g. an arc in the timeline. * Outlands: Burning Crusade (2007). It is unmodified. * Northrend: Wrath of the Lich King (2008). It is unmodified. * Eastern Kingdoms and Kalimdor: Cataclysm (2010). This expansion completely replaces the quests and map from the classic v...
With each expansion, in the World of Warcraft universe, the level cap of your character increases by 5-10 levels. There is a general "theme", and throughout the release and consequent patches, there are some significant events that take place in terms of storyline. Each expansion is catered predominantly for players w...
4,371,698
A money pouch contains a certain number of cents and only one dime. You and your friend are playing a game: They alternate turns and pick one coin at a time, which they put in their pockets. Whoever picks the dime wins. You are trying to decide whether it is better to play first or second: Initially you think that if y...
2022/02/01
['https://math.stackexchange.com/questions/4371698', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/594462/']
The first essential point is that *the dime has no preference for position*, thus its Pr of being at *any* position is $\frac{1}{n}$ The second essential point is that we don't know whether $n$ is odd or even, and if it is odd, we get one extra try if we go first Thus it is always preferable to go first
Suppose we extend the game as follows. We start off the same where we draw coins one at a time, but we number the draws and mark down which coin was drawn on which numbered draw. Once we reach the dime, we record the winner as usual, but we also continue drawing the remaining coins and marking the draw number of each. ...
2,331,476
How do you list your commits along with their SHA1 values in git?
2010/02/25
['https://Stackoverflow.com/questions/2331476', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/111674/']
Exactly what format do you want? For just the one line summary and the SHA1: ``` git log --pretty=oneline ``` See git log --help for more formating options.
I'm not sure what you mean. Listing a commit *is* listing its hash, and the easiest way to do it is with git rev-list. ``` $ git rev-list HEAD ``` will give the the reverse chronological list of all commits reachable from the current HEAD.
2,331,476
How do you list your commits along with their SHA1 values in git?
2010/02/25
['https://Stackoverflow.com/questions/2331476', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/111674/']
Exactly what format do you want? For just the one line summary and the SHA1: ``` git log --pretty=oneline ``` See git log --help for more formating options.
While P00ya's answer is correct, newer versions of git allow a simpler syntax: ``` git log --oneline ``` which is shorthand for `git log --pretty=oneline --abbrev-commit` used together.
11,641,563
I don't mean to be vague, but I'm skeptical of the idea of releasing code that is intentionally turned off, and I've not been able to find any good sources relating to the subject. This may truly be a "it depends" question, in which case please feel free to down vote and remove. My specific context is a web app that w...
2012/07/25
['https://Stackoverflow.com/questions/11641563', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/95546/']
It is called [feature toggles](http://martinfowler.com/bliki/FeatureToggle.html) I'd argue that it is no more risky that enabling/disabling features using role-based-authorizations. Your concerns regarding code clutter and increased configurations are valid but advocates of continuous delivery would argue that the alt...
The primary basis for doing this I've seen is to separate code pushes from configuration pushes. It's easier to determine whether you have a bad release or bad configuration if you can separate them. You can push a release with incomplete feature X off by default, continue to push releases that can be rolled back witho...
126,705
I'm following a course where the trainer recommends to identify all the vulnerabilities affecting a web application before trying to exploit them. While I understand the need to identify all the vulnerabilities, I don't understand why **I should wait before trying to exploit a vulnerability I just found (like a sql ...
2016/06/11
['https://security.stackexchange.com/questions/126705', 'https://security.stackexchange.com', 'https://security.stackexchange.com/users/70136/']
That sounds more like a course in how to hack someone else's site than to test yours. Following the suggested logic allows the perpetrator to better plan a quick attack that will let them gain control of the machine before anyone has time to notice the attempts. That provides no benefit for someone who is only test...
If you keep looking you may find an easier to exploit vulnerability or one that gives you more privilege. Of course, if you first find an easy to exploit remote code execution vulnerability there's really no need to look for more.
126,705
I'm following a course where the trainer recommends to identify all the vulnerabilities affecting a web application before trying to exploit them. While I understand the need to identify all the vulnerabilities, I don't understand why **I should wait before trying to exploit a vulnerability I just found (like a sql ...
2016/06/11
['https://security.stackexchange.com/questions/126705', 'https://security.stackexchange.com', 'https://security.stackexchange.com/users/70136/']
There's a chance that the result of exploiting a vulnerability early in the test could change the application. Either crashing it or just breaking certain functionality. Thus making the need to scan for additional vulnerabilities moot. Another reason for thoroughly identifying vulnerabilities is to give the person per...
That sounds more like a course in how to hack someone else's site than to test yours. Following the suggested logic allows the perpetrator to better plan a quick attack that will let them gain control of the machine before anyone has time to notice the attempts. That provides no benefit for someone who is only test...
126,705
I'm following a course where the trainer recommends to identify all the vulnerabilities affecting a web application before trying to exploit them. While I understand the need to identify all the vulnerabilities, I don't understand why **I should wait before trying to exploit a vulnerability I just found (like a sql ...
2016/06/11
['https://security.stackexchange.com/questions/126705', 'https://security.stackexchange.com', 'https://security.stackexchange.com/users/70136/']
There's a chance that the result of exploiting a vulnerability early in the test could change the application. Either crashing it or just breaking certain functionality. Thus making the need to scan for additional vulnerabilities moot. Another reason for thoroughly identifying vulnerabilities is to give the person per...
If you keep looking you may find an easier to exploit vulnerability or one that gives you more privilege. Of course, if you first find an easy to exploit remote code execution vulnerability there's really no need to look for more.
60,384,568
This is a question about Template Toolkit for perl. I render my templates with a little command-line utility that has the following option enabled ``` DEBUG => Template::Constants::DEBUG_UNDEF, ``` The syntax is `render <file.tt> var1 val1 var2 val2 ....` This is very convenient because the user gets prompts abo...
2020/02/24
['https://Stackoverflow.com/questions/60384568', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/12312873/']
To check if a variable is undefined or not you could check if its `size` method returns something greater than 0. Of course this case only aplies if the variable is not initialized or defined at all (`enable_networking = ''` has size = 1, the same with `enable_networking = 0`) To check if a variable is not false... we...
All scalar values in TT have a `.defined` vmethod. ``` [% IF hostname.defined %] hostname = [% hostname %][% ELSE %][% -- a comment, variable hostname not provided %][% END %] ``` This is discussed in [the manual](https://metacpan.org/pod/distribution/Template-Toolkit/lib/Template/Manual/VMethods.pod#defined).
267,534
I asked this question before, [Here](https://stackoverflow.com/questions/264441/does-a-native-php-5-function-exist-that-does-the-following-in-1-line) however I think I presented the problem poorly, and got quite a few replies that may have been useful to someone but did not address the actual question and so I pose the...
2008/11/06
['https://Stackoverflow.com/questions/267534', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/34561/']
There is no native PHP method of doing this. You could make a function like this: ``` function array_value($array, $key) { return $array[$key]; } ``` And then use it like this: ``` $places = "alabama,alaska,arizona .... zimbabway"; $random_place = array_value(explode(",", $places), rand(0, 1000)); ```
If it's memory concerns, there are other ways of going about this that don't split out into an array. But no, there is nothing builtin to handle this sort of situation. As an alternative, you might try: ``` $pos = 0; $num = 0; while(($pos = strpos($places, ',', $pos+1)) !== false) {$num++;} $which = rand(0, $num); $n...
267,534
I asked this question before, [Here](https://stackoverflow.com/questions/264441/does-a-native-php-5-function-exist-that-does-the-following-in-1-line) however I think I presented the problem poorly, and got quite a few replies that may have been useful to someone but did not address the actual question and so I pose the...
2008/11/06
['https://Stackoverflow.com/questions/267534', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/34561/']
There is no native PHP method of doing this. You could make a function like this: ``` function array_value($array, $key) { return $array[$key]; } ``` And then use it like this: ``` $places = "alabama,alaska,arizona .... zimbabway"; $random_place = array_value(explode(",", $places), rand(0, 1000)); ```
I spent a great deal of last year researching advanced CSV parsing for PHP and I admit it would be nice to randomly seek at will on a file. One of my semi-deadend's was to scan through a known file and make an index of the position of all known \n's that were not at the beginning of the line. ``` //Grab and load o...
267,534
I asked this question before, [Here](https://stackoverflow.com/questions/264441/does-a-native-php-5-function-exist-that-does-the-following-in-1-line) however I think I presented the problem poorly, and got quite a few replies that may have been useful to someone but did not address the actual question and so I pose the...
2008/11/06
['https://Stackoverflow.com/questions/267534', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/34561/']
**No, there is no way to do that natively.** You can, however: 1.- Store the unavoidable array instead of the string. Given PHP's limitation this is what makes most sense in my opinion. Also, don't forget you can [unset()](http://php.net/unset) 2.- Use strpos() and friends to parse the string into what you need, as...
If it's memory concerns, there are other ways of going about this that don't split out into an array. But no, there is nothing builtin to handle this sort of situation. As an alternative, you might try: ``` $pos = 0; $num = 0; while(($pos = strpos($places, ',', $pos+1)) !== false) {$num++;} $which = rand(0, $num); $n...
267,534
I asked this question before, [Here](https://stackoverflow.com/questions/264441/does-a-native-php-5-function-exist-that-does-the-following-in-1-line) however I think I presented the problem poorly, and got quite a few replies that may have been useful to someone but did not address the actual question and so I pose the...
2008/11/06
['https://Stackoverflow.com/questions/267534', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/34561/']
**No, there is no way to do that natively.** You can, however: 1.- Store the unavoidable array instead of the string. Given PHP's limitation this is what makes most sense in my opinion. Also, don't forget you can [unset()](http://php.net/unset) 2.- Use strpos() and friends to parse the string into what you need, as...
``` list($rand_place) = array_slice(explode(',', loadFile("csvOf20000places.txt")), array_rand(explode(',', loadFile("csvOf20000places.txt"))), 1); ``` **EDIT:** Ok, you're right. The question is *very* hard to understand but, I think this is it. The code above will pull random items from the csv file but, to just pu...
267,534
I asked this question before, [Here](https://stackoverflow.com/questions/264441/does-a-native-php-5-function-exist-that-does-the-following-in-1-line) however I think I presented the problem poorly, and got quite a few replies that may have been useful to someone but did not address the actual question and so I pose the...
2008/11/06
['https://Stackoverflow.com/questions/267534', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/34561/']
I know it's poor form to answer a question with a question, but why are you concerned about this? Is it a nitpick, or an optimization question? The Zend engine will optimize this away. However, I'd point out you don't have to create a temporary variable *necessarily*: ``` $rand_place = explode(",",loadFile("csvOf2000...
You can do this: ``` <?php function foo() { return new ArrayObject(explode(",", "zero,one,two")); } echo foo()->offsetGet(1); // "one" ?> ``` Sadly you **can't** do this: ``` echo (new ArrayObject(explode(",", "zero,one,two")))->offsetGet(2); ```
267,534
I asked this question before, [Here](https://stackoverflow.com/questions/264441/does-a-native-php-5-function-exist-that-does-the-following-in-1-line) however I think I presented the problem poorly, and got quite a few replies that may have been useful to someone but did not address the actual question and so I pose the...
2008/11/06
['https://Stackoverflow.com/questions/267534', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/34561/']
**No, there is no way to do that natively.** You can, however: 1.- Store the unavoidable array instead of the string. Given PHP's limitation this is what makes most sense in my opinion. Also, don't forget you can [unset()](http://php.net/unset) 2.- Use strpos() and friends to parse the string into what you need, as...
I spent a great deal of last year researching advanced CSV parsing for PHP and I admit it would be nice to randomly seek at will on a file. One of my semi-deadend's was to scan through a known file and make an index of the position of all known \n's that were not at the beginning of the line. ``` //Grab and load o...
267,534
I asked this question before, [Here](https://stackoverflow.com/questions/264441/does-a-native-php-5-function-exist-that-does-the-following-in-1-line) however I think I presented the problem poorly, and got quite a few replies that may have been useful to someone but did not address the actual question and so I pose the...
2008/11/06
['https://Stackoverflow.com/questions/267534', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/34561/']
``` list($rand_place) = array_slice(explode(',', loadFile("csvOf20000places.txt")), array_rand(explode(',', loadFile("csvOf20000places.txt"))), 1); ``` **EDIT:** Ok, you're right. The question is *very* hard to understand but, I think this is it. The code above will pull random items from the csv file but, to just pu...
I spent a great deal of last year researching advanced CSV parsing for PHP and I admit it would be nice to randomly seek at will on a file. One of my semi-deadend's was to scan through a known file and make an index of the position of all known \n's that were not at the beginning of the line. ``` //Grab and load o...
267,534
I asked this question before, [Here](https://stackoverflow.com/questions/264441/does-a-native-php-5-function-exist-that-does-the-following-in-1-line) however I think I presented the problem poorly, and got quite a few replies that may have been useful to someone but did not address the actual question and so I pose the...
2008/11/06
['https://Stackoverflow.com/questions/267534', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/34561/']
``` list($rand_place) = array_slice(explode(',', loadFile("csvOf20000places.txt")), array_rand(explode(',', loadFile("csvOf20000places.txt"))), 1); ``` **EDIT:** Ok, you're right. The question is *very* hard to understand but, I think this is it. The code above will pull random items from the csv file but, to just pu...
You can do this: ``` <?php function foo() { return new ArrayObject(explode(",", "zero,one,two")); } echo foo()->offsetGet(1); // "one" ?> ``` Sadly you **can't** do this: ``` echo (new ArrayObject(explode(",", "zero,one,two")))->offsetGet(2); ```
267,534
I asked this question before, [Here](https://stackoverflow.com/questions/264441/does-a-native-php-5-function-exist-that-does-the-following-in-1-line) however I think I presented the problem poorly, and got quite a few replies that may have been useful to someone but did not address the actual question and so I pose the...
2008/11/06
['https://Stackoverflow.com/questions/267534', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/34561/']
I know it's poor form to answer a question with a question, but why are you concerned about this? Is it a nitpick, or an optimization question? The Zend engine will optimize this away. However, I'd point out you don't have to create a temporary variable *necessarily*: ``` $rand_place = explode(",",loadFile("csvOf2000...
If it's memory concerns, there are other ways of going about this that don't split out into an array. But no, there is nothing builtin to handle this sort of situation. As an alternative, you might try: ``` $pos = 0; $num = 0; while(($pos = strpos($places, ',', $pos+1)) !== false) {$num++;} $which = rand(0, $num); $n...
267,534
I asked this question before, [Here](https://stackoverflow.com/questions/264441/does-a-native-php-5-function-exist-that-does-the-following-in-1-line) however I think I presented the problem poorly, and got quite a few replies that may have been useful to someone but did not address the actual question and so I pose the...
2008/11/06
['https://Stackoverflow.com/questions/267534', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/34561/']
``` list($rand_place) = array_slice(explode(',', loadFile("csvOf20000places.txt")), array_rand(explode(',', loadFile("csvOf20000places.txt"))), 1); ``` **EDIT:** Ok, you're right. The question is *very* hard to understand but, I think this is it. The code above will pull random items from the csv file but, to just pu...
If it's memory concerns, there are other ways of going about this that don't split out into an array. But no, there is nothing builtin to handle this sort of situation. As an alternative, you might try: ``` $pos = 0; $num = 0; while(($pos = strpos($places, ',', $pos+1)) !== false) {$num++;} $which = rand(0, $num); $n...
5,054,428
javascript noob trying to figure something out. I saw a script located here: [Using jQuery to open all external links in a new window](https://stackoverflow.com/questions/1871371/using-jquery-to-open-all-external-links-in-a-new-window) in which urls on a page are checked to see if they match the current page url. If ...
2011/02/20
['https://Stackoverflow.com/questions/5054428', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/611318/']
You have to change the `href` attribute using [`attr`](http://api.jquery.com/attr/), not `append` new child elements: ``` $('a[href^="http://"]').filter(function() { // no @ before the attribute name return this.hostname && this.hostname !== location.hostname; }).attr('href', function(i, value) { // takes care...
Instead of append, which modifies the inner HTML of the element, modify the href attribute: ``` $(document).ready(function() { var elements = $('a[@href^="http://"]').filter(function() { return this.hostname && this.hostname !== location.hostname; }); elements.each(function(index, value) { ...
5,054,428
javascript noob trying to figure something out. I saw a script located here: [Using jQuery to open all external links in a new window](https://stackoverflow.com/questions/1871371/using-jquery-to-open-all-external-links-in-a-new-window) in which urls on a page are checked to see if they match the current page url. If ...
2011/02/20
['https://Stackoverflow.com/questions/5054428', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/611318/']
You have to change the `href` attribute using [`attr`](http://api.jquery.com/attr/), not `append` new child elements: ``` $('a[href^="http://"]').filter(function() { // no @ before the attribute name return this.hostname && this.hostname !== location.hostname; }).attr('href', function(i, value) { // takes care...
Your use of the `append` method is incorrect. The following code shows how to achieve what you require, plus it takes into account a couple of additional factors that you need to bear in mind, namely: 1) What about links that use https rather than http? 2) What about links that already contains querystring paramete...
3,396,783
I'm playing with my favorite thing, xml (have the decency to kill me please) and the ultimate goal is save it in-house and use the data in a different manner (this is an export from another system). I've got goo that works, but meh, I think it can be a lot better. ``` public Position(XElement element) { ...
2010/08/03
['https://Stackoverflow.com/questions/3396783', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/202728/']
You can use the [`XmlSerializer`](http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx) class and markup your class properties with [attributes](http://msdn.microsoft.com/en-us/library/83y7df3e(VS.71).aspx) to control the serialization and deserialization of the objects. Here's a simple ...
The mechanism that you are suggesting already exists in the form of the [XmlSerializer](http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx) class and a set of custom attributes that you can use to control the serialisation process. In fact the .Net framework comes with a tool [xsd.exe]...
176,382
Introduction: ------------- I'm trying to make a Sorcerer subclass that has a Lovecraftian/Far Realm theme. I tried to balance it around Shadow, Divine Soul, Storm and the Abberant/Psionic Mind UA. (I realize that is probably over-tuned some) I'm hoping this isn't overly powerful though probably on the higher end of t...
2020/10/12
['https://rpg.stackexchange.com/questions/176382', 'https://rpg.stackexchange.com', 'https://rpg.stackexchange.com/users/59619/']
Most of this looks fine, so I'll mainly focus on the outliers. **And boy-oh-boy is the level 18 ability an outlier.** That said, I do want to preface this by saying that stepping outside the bounds of balance is the best part of homebrew. This criticism shouldn't distract from the fact that you've got a fun subclass o...
Balanced yes, though some changes may make the subclass more distinct ===================================================================== Sorcerer Homebrews are difficult to balance, because you always have to think about the sorcery point cost of abilities. What I've given below are estimates of what I think would ...
26,739,981
I'm new to Cake php. I have a problem using bake I set up a migration with user table ``` public $migration = array( 'up' => array( 'create_table' => array( 'users' => array( 'user_id' => array('type' => 'integer', 'null' => false, 'key' => 'primary'), ...
2014/11/04
['https://Stackoverflow.com/questions/26739981', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1097307/']
> > Today I have the need to allocate a vector with size 100000 in Matlab. > > > Now, as noted in the comments and such, the method you tried (`a=ones(100000);`) creates a 100000x100000 matrix, which is not what you want. I would suggest you try: ``` a = ones(1, 100000); ``` Since that creates a vector rather...
Well the first declaration tries to build a matrix of 1000000x1000000 ones. That would be **~931 GB**. The second tries to declare a matrix of 10000 x 10000. That would be **~95MB**. I assumed each one is stored on a byte. If they use floats, than the requested memory size will be 4 times larger.
26,739,981
I'm new to Cake php. I have a problem using bake I set up a migration with user table ``` public $migration = array( 'up' => array( 'create_table' => array( 'users' => array( 'user_id' => array('type' => 'integer', 'null' => false, 'key' => 'primary'), ...
2014/11/04
['https://Stackoverflow.com/questions/26739981', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1097307/']
> > Today I have the need to allocate a vector with size 100000 in Matlab. > > > Now, as noted in the comments and such, the method you tried (`a=ones(100000);`) creates a 100000x100000 matrix, which is not what you want. I would suggest you try: ``` a = ones(1, 100000); ``` Since that creates a vector rather...
Arguments Matter ================ Calling Matlab's `ones()` or `zeros()` or `magic()` with a single argument `n`, creates a *square* matrix with size `n-by-n`: ```matlab >> a = ones(5) a = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ``` Calling the same functions with 2 arguments...
107,330
We have an environment where we have blasted a prepped Windows image out to multiple machines. We now need to customize the networking settings on each image en masse. What tools exist to modify that image and customize the IP address/netmask/gateway post-imaging? I would also look at a commercial solution that is ab...
2010/01/28
['https://serverfault.com/questions/107330', 'https://serverfault.com', 'https://serverfault.com/users/2101/']
DHCP is the only choice (IMHO) when you get over 5 or 6 machines ( and even then ... ) In your case I would also setup dDNS so that your hosts register in DNS when they get a DHCP lease, so if you know the host name you know the ip address. As far as host needed a static IP address. The best way is to let them conf...
Here's your main issue (as stated): > > **"We don't have access to the DHCP server"** > > > Why don't you have access to your internal DHCP server? **(fix this!)**... Your number of clients concords with most environments using DHCP (recommended). Yes, static IPs would drive you nuts!
107,330
We have an environment where we have blasted a prepped Windows image out to multiple machines. We now need to customize the networking settings on each image en masse. What tools exist to modify that image and customize the IP address/netmask/gateway post-imaging? I would also look at a commercial solution that is ab...
2010/01/28
['https://serverfault.com/questions/107330', 'https://serverfault.com', 'https://serverfault.com/users/2101/']
Here's your main issue (as stated): > > **"We don't have access to the DHCP server"** > > > Why don't you have access to your internal DHCP server? **(fix this!)**... Your number of clients concords with most environments using DHCP (recommended). Yes, static IPs would drive you nuts!
Maintaining a static addressed network quickly becomes a hassle with more than 10-15 machines. You can set static addresses within the DHCP server's GUI. While these are only faux static addresses they ensure that no other device can get that address by requesting it from the DHCP server and when that particular device...
107,330
We have an environment where we have blasted a prepped Windows image out to multiple machines. We now need to customize the networking settings on each image en masse. What tools exist to modify that image and customize the IP address/netmask/gateway post-imaging? I would also look at a commercial solution that is ab...
2010/01/28
['https://serverfault.com/questions/107330', 'https://serverfault.com', 'https://serverfault.com/users/2101/']
DHCP is the only choice (IMHO) when you get over 5 or 6 machines ( and even then ... ) In your case I would also setup dDNS so that your hosts register in DNS when they get a DHCP lease, so if you know the host name you know the ip address. As far as host needed a static IP address. The best way is to let them conf...
Maintaining a static addressed network quickly becomes a hassle with more than 10-15 machines. You can set static addresses within the DHCP server's GUI. While these are only faux static addresses they ensure that no other device can get that address by requesting it from the DHCP server and when that particular device...
107,330
We have an environment where we have blasted a prepped Windows image out to multiple machines. We now need to customize the networking settings on each image en masse. What tools exist to modify that image and customize the IP address/netmask/gateway post-imaging? I would also look at a commercial solution that is ab...
2010/01/28
['https://serverfault.com/questions/107330', 'https://serverfault.com', 'https://serverfault.com/users/2101/']
DHCP is the only choice (IMHO) when you get over 5 or 6 machines ( and even then ... ) In your case I would also setup dDNS so that your hosts register in DNS when they get a DHCP lease, so if you know the host name you know the ip address. As far as host needed a static IP address. The best way is to let them conf...
If you're talking about servers you **should not** be using DHCP to configure their IP addresses. This creates all sorts of headaches long-term, and even Microsoft will tell you it's not a recommended practice. I relate the parable of the DHCP network that got moved to CoLocation and left the DHCP server behind: Need...
107,330
We have an environment where we have blasted a prepped Windows image out to multiple machines. We now need to customize the networking settings on each image en masse. What tools exist to modify that image and customize the IP address/netmask/gateway post-imaging? I would also look at a commercial solution that is ab...
2010/01/28
['https://serverfault.com/questions/107330', 'https://serverfault.com', 'https://serverfault.com/users/2101/']
DHCP is the only choice (IMHO) when you get over 5 or 6 machines ( and even then ... ) In your case I would also setup dDNS so that your hosts register in DNS when they get a DHCP lease, so if you know the host name you know the ip address. As far as host needed a static IP address. The best way is to let them conf...
Fixed IP addresses for servers - always. Printers and the like can be done either way but my preference is for fixed. Workstations, laptops and the like should always be DHCP. You should be able to solve your problems by using dynamically updated DNS. Then you don't need an IP address because you can just use the machi...
107,330
We have an environment where we have blasted a prepped Windows image out to multiple machines. We now need to customize the networking settings on each image en masse. What tools exist to modify that image and customize the IP address/netmask/gateway post-imaging? I would also look at a commercial solution that is ab...
2010/01/28
['https://serverfault.com/questions/107330', 'https://serverfault.com', 'https://serverfault.com/users/2101/']
If you're talking about servers you **should not** be using DHCP to configure their IP addresses. This creates all sorts of headaches long-term, and even Microsoft will tell you it's not a recommended practice. I relate the parable of the DHCP network that got moved to CoLocation and left the DHCP server behind: Need...
Maintaining a static addressed network quickly becomes a hassle with more than 10-15 machines. You can set static addresses within the DHCP server's GUI. While these are only faux static addresses they ensure that no other device can get that address by requesting it from the DHCP server and when that particular device...
107,330
We have an environment where we have blasted a prepped Windows image out to multiple machines. We now need to customize the networking settings on each image en masse. What tools exist to modify that image and customize the IP address/netmask/gateway post-imaging? I would also look at a commercial solution that is ab...
2010/01/28
['https://serverfault.com/questions/107330', 'https://serverfault.com', 'https://serverfault.com/users/2101/']
Fixed IP addresses for servers - always. Printers and the like can be done either way but my preference is for fixed. Workstations, laptops and the like should always be DHCP. You should be able to solve your problems by using dynamically updated DNS. Then you don't need an IP address because you can just use the machi...
Maintaining a static addressed network quickly becomes a hassle with more than 10-15 machines. You can set static addresses within the DHCP server's GUI. While these are only faux static addresses they ensure that no other device can get that address by requesting it from the DHCP server and when that particular device...
20,077,653
I am new to android. I am trying to zoom a series of images as I have 10 images in drawable. I have an image view in main xml and 2 buttons to change the images. I took the whole idea from a question in stackoverflow. The problem is that all the images are changing perfectly but I have no idea to zoom these images. I t...
2013/11/19
['https://Stackoverflow.com/questions/20077653', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3004150/']
Read this [tutorial](http://www.androidhive.info/2013/09/android-fullscreen-image-slider-with-swipe-and-pinch-zoom-gestures/). It is an awesome integration of all image view related possibilities.
You can use [this](https://github.com/chrisbanes/PhotoView) library. It is very easy to implement what you want using this.
16,819,394
I'm having the hardest time using the dropdown list side of Krypton Dropbuttons -- specifically, I don't know how to register that I've actually selected something within the dropdown list. In my project, I am using a dropbutton to apply a change over time, where simply clicking is immediate and the drop list has vari...
2013/05/29
['https://Stackoverflow.com/questions/16819394', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1672020/']
I know that this is late, but I've been dealing with something similar. For a `KryptonDropButton` you need to create a `KryptonContextMenu`, as @Roberto has stated. Then I went to add a listener to the manu items that I've added to the assigned `KryptonContextMenu` and found out that the designer does not support the...
**Update 2018:** the toolkit has been opensourced here: <https://github.com/ComponentFactory/Krypton> Component factory hasn't been actively worked on since 2011. ~~Its still closed source so that is an issue.~~ The Krypton Toolkit itself is a bit iffy in .net 4 and above. The KryptonContextMenu that you need with t...
16,819,394
I'm having the hardest time using the dropdown list side of Krypton Dropbuttons -- specifically, I don't know how to register that I've actually selected something within the dropdown list. In my project, I am using a dropbutton to apply a change over time, where simply clicking is immediate and the drop list has vari...
2013/05/29
['https://Stackoverflow.com/questions/16819394', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1672020/']
I'm about a year and a half late, but here's a radiobutton click event. Just select the control and event at the top of the IDE. ``` Public Sub KryptonContextMenuRadioButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles KryptonContextMenuRadioButton1.Click 'do something End Sub ```
**Update 2018:** the toolkit has been opensourced here: <https://github.com/ComponentFactory/Krypton> Component factory hasn't been actively worked on since 2011. ~~Its still closed source so that is an issue.~~ The Krypton Toolkit itself is a bit iffy in .net 4 and above. The KryptonContextMenu that you need with t...
16,819,394
I'm having the hardest time using the dropdown list side of Krypton Dropbuttons -- specifically, I don't know how to register that I've actually selected something within the dropdown list. In my project, I am using a dropbutton to apply a change over time, where simply clicking is immediate and the drop list has vari...
2013/05/29
['https://Stackoverflow.com/questions/16819394', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1672020/']
I know that this is late, but I've been dealing with something similar. For a `KryptonDropButton` you need to create a `KryptonContextMenu`, as @Roberto has stated. Then I went to add a listener to the manu items that I've added to the assigned `KryptonContextMenu` and found out that the designer does not support the...
I'm about a year and a half late, but here's a radiobutton click event. Just select the control and event at the top of the IDE. ``` Public Sub KryptonContextMenuRadioButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles KryptonContextMenuRadioButton1.Click 'do something End Sub ```
11,486,756
I am having issues creating a html table to display stats from a text file. I am sure there are 100 ways to do this better but here it is: **(The comments in the following script show the outputs)** ``` #!/bin/bash function getapistats () { curl -s http://api.example.com/stats > api-stats.txt awk {'print $1'...
2012/07/14
['https://Stackoverflow.com/questions/11486756', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1258484/']
This is reasonably simple to do in pure awk: ``` curl -s http://api.example.com/stats > api-stats.txt awk 'BEGIN { print "<table>" } { print "<tr><td>" $1 "</td><td>" $2 "</td></tr>" } END { print "</table>" }' api-stats.txt > api-stats.html ``` Awk is really made for this type of use.
this can be done w/ bash ;) ``` while read -u 3 a && read -u 4 b;do echo $a$b; done 3</etc/passwd 4</etc/services ``` but my experience is that usually it's a bad thing to do things like this in bash/awk/etc the feature i used in the code is **deeply** burried in the bash manual page... i would reco...
11,486,756
I am having issues creating a html table to display stats from a text file. I am sure there are 100 ways to do this better but here it is: **(The comments in the following script show the outputs)** ``` #!/bin/bash function getapistats () { curl -s http://api.example.com/stats > api-stats.txt awk {'print $1'...
2012/07/14
['https://Stackoverflow.com/questions/11486756', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1258484/']
You can do it with one awk at least. ``` curl -s http://api.example.com/stats | awk ' BEGIN{print "<table>"} {printf("<tr><td>%d</td><td>%s</td></tr>\n",$1,$2)} END{print "</table>"} ' ```
this can be done w/ bash ;) ``` while read -u 3 a && read -u 4 b;do echo $a$b; done 3</etc/passwd 4</etc/services ``` but my experience is that usually it's a bad thing to do things like this in bash/awk/etc the feature i used in the code is **deeply** burried in the bash manual page... i would reco...
11,486,756
I am having issues creating a html table to display stats from a text file. I am sure there are 100 ways to do this better but here it is: **(The comments in the following script show the outputs)** ``` #!/bin/bash function getapistats () { curl -s http://api.example.com/stats > api-stats.txt awk {'print $1'...
2012/07/14
['https://Stackoverflow.com/questions/11486756', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1258484/']
This is reasonably simple to do in pure awk: ``` curl -s http://api.example.com/stats > api-stats.txt awk 'BEGIN { print "<table>" } { print "<tr><td>" $1 "</td><td>" $2 "</td></tr>" } END { print "</table>" }' api-stats.txt > api-stats.html ``` Awk is really made for this type of use.
You can do it with one awk at least. ``` curl -s http://api.example.com/stats | awk ' BEGIN{print "<table>"} {printf("<tr><td>%d</td><td>%s</td></tr>\n",$1,$2)} END{print "</table>"} ' ```
78,346
just a quick question. Is the tissue fluid the same water potential as the cells it surrounds? I am a bit confused because if it was lower it would cause water to leave the cell and if it was higher water would enter the cell and both aren't really good for the cell. I believe tissue fluid is isotonic, am I correct?
2018/10/20
['https://biology.stackexchange.com/questions/78346', 'https://biology.stackexchange.com', 'https://biology.stackexchange.com/users/46295/']
Yes, cell membranes are highly permeable for water. While diffusion through the membrane is possible ([description](https://socratic.org/questions/how-can-water-pass-through-the-lipid-bilayer), [and some science](https://pubs.acs.org/doi/pdf/10.1021/j100066a040)), it is most effective through water channel proteins ([a...
Not necessarily- cells are surrounded by a *plasma membrane* that creates a waterproof seal from their surroundings. This membrane contains embedded proteins, called *transporters* and *channels*, that enable the selective passage of water, ions, and solutes to maintain a *membrane potential*, or concentration differen...
190,902
Let's say that a (recursively axiomatizable) set theory $T$ extending ZF is "ordinal-categorical" if, whenever $M$ and $N$ are standard models of $T$ sharing the same ordinals, one has $M = N$. For example, if $T$ proves $V = L$, then $T$ is ordinal-categorical. I think the same is true if $T$ proves $V = L(0^\sharp)$....
2014/12/16
['https://mathoverflow.net/questions/190902', 'https://mathoverflow.net', 'https://mathoverflow.net/users/17218/']
> > In this edit, the statement of Friedman's theorem is reformulated (the previous formulation was incorrectly stated). Thanks to Dmytro Taranovsky and Farmer Schultzenberg for pointing out the blooper. *See also Remark 2 for recent progress (January 2023) on this topic by Schultzenberg and Taranovsky.* > > > An ...
$\newcommand\Ord{\text{Ord}}\newcommand\Z{\mathbb{Z}}\newcommand\Q{\mathbb{Q}}$This is a nice question, and I don't have much to say about it, except that I did want to mention that it is important in your account that you are talking about standard models, which I take to mean well-founded or transitive models. If you...
190,902
Let's say that a (recursively axiomatizable) set theory $T$ extending ZF is "ordinal-categorical" if, whenever $M$ and $N$ are standard models of $T$ sharing the same ordinals, one has $M = N$. For example, if $T$ proves $V = L$, then $T$ is ordinal-categorical. I think the same is true if $T$ proves $V = L(0^\sharp)$....
2014/12/16
['https://mathoverflow.net/questions/190902', 'https://mathoverflow.net', 'https://mathoverflow.net/users/17218/']
> > In this edit, the statement of Friedman's theorem is reformulated (the previous formulation was incorrectly stated). Thanks to Dmytro Taranovsky and Farmer Schultzenberg for pointing out the blooper. *See also Remark 2 for recent progress (January 2023) on this topic by Schultzenberg and Taranovsky.* > > > An ...
For every c.e theory $T$ extending KP (Kripke-Platek) with a model $M$ of height $α<ω\_1$, the intersection of all such $M$ is a subset of $L\_{α^{+,\mathrm{CK}}}$. This holds since the existence of such $M$ is $Σ^1\_1(α)$. Every model $\text{ZF}+0^\#$ (or just $\text{KP}+0^\#$) of height $α$ includes a set outside of ...
33,750,465
I'm working on an app's user interface, and I'm doing it programmatically. I understand the idea behind retain cycles, and feel quite confident I could identify one, but Xcode is giving me warnings when I'm trying to avoid a retain cycle. Essentially, I'm creating a property called `titleLabel` which will have my titl...
2015/11/17
['https://Stackoverflow.com/questions/33750465', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3411191/']
Your understanding is flawed. If the label were to retain a reference to its view controller, you would have a retain cycle if the property were defined as `strong`. However, views do not retain references to their view controllers, so there is no cycle. Xcode is warning you correctly that your label reference will go ...
i think you can set property to strong which will retain its memory and when your view will disappear call then you can set this object to nil which will release its memory.
33,750,465
I'm working on an app's user interface, and I'm doing it programmatically. I understand the idea behind retain cycles, and feel quite confident I could identify one, but Xcode is giving me warnings when I'm trying to avoid a retain cycle. Essentially, I'm creating a property called `titleLabel` which will have my titl...
2015/11/17
['https://Stackoverflow.com/questions/33750465', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3411191/']
Your understanding is flawed. If the label were to retain a reference to its view controller, you would have a retain cycle if the property were defined as `strong`. However, views do not retain references to their view controllers, so there is no cycle. Xcode is warning you correctly that your label reference will go ...
When you create a UI element and add it as a subview to parent view. The Parent view keeps a strong reference to sub View. In your case, you could just create a UILabel variable within your function and add it to the parent. You could then declare a weak property that keeps a reference to this newly created label. Th...
51,943,181
Hey guys so i got this dummy data: ``` 115,IROM,1 125,FOLCOM,1 135,SE,1 111,ATLUZ,1 121,ATLUZ,2 121,ATLUZ,2 142,ATLUZ,2 142,ATLUZ,2 144,BLIZZARC,1 166,STEAD,3 166,STEAD,3 166,STEAD,3 168,BANDOI,1 179,FOX,1 199,C4,2 199,C4,2 ``` Desired output: ``` IROM,1 FOLCOM,1 SE,1 ATLUZ,3 BLIZZARC,1 STEAD,1 BANDOI,1 FOX,1 C4,1...
2018/08/21
['https://Stackoverflow.com/questions/51943181', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3646742/']
Before executing the `cut` command, do a `uniq`. This will remove the redundant lines and then you follow your command, i.e. apply `cut` to extract `2` field and do `uniq -c` to count character ``` uniq game.csv | cut -d',' -f 2 | uniq -c ```
Could you please try following too in a single `awk`. ``` awk -F, ' !a[$1,$2,$3]++{ b[$1,$2,$3]++ } !f[$2]++{ g[++count]=$2 } END{ for(i in b){ split(i,array,",") c[array[2]]++ } for(q=1;q<=count;q++){ print c[g[q]],g[q] } }' SUBSEP="," Input_file ``` It will give the order of output same as...
51,943,181
Hey guys so i got this dummy data: ``` 115,IROM,1 125,FOLCOM,1 135,SE,1 111,ATLUZ,1 121,ATLUZ,2 121,ATLUZ,2 142,ATLUZ,2 142,ATLUZ,2 144,BLIZZARC,1 166,STEAD,3 166,STEAD,3 166,STEAD,3 168,BANDOI,1 179,FOX,1 199,C4,2 199,C4,2 ``` Desired output: ``` IROM,1 FOLCOM,1 SE,1 ATLUZ,3 BLIZZARC,1 STEAD,1 BANDOI,1 FOX,1 C4,1...
2018/08/21
['https://Stackoverflow.com/questions/51943181', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3646742/']
Before executing the `cut` command, do a `uniq`. This will remove the redundant lines and then you follow your command, i.e. apply `cut` to extract `2` field and do `uniq -c` to count character ``` uniq game.csv | cut -d',' -f 2 | uniq -c ```
Less elegant, but you may use awk as well. If it is not granted that the same ID+NAME combos will always come consecutively, you have to count each by reading the whole file before output: ``` awk -F, '{c[$1,$2]+=1}END{for (ck in c){split(ck,ca,SUBSEP); print ca[2];g[ca[2]]+=1}for(gk in g){print gk,g[gk]}}' game.csv ...