qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
18,265
**TL;DR:** I drive to work at my own expense. My friend gets a free ride from me, saving her money and time. I say "don't be late" sometimes, and she freaks out. --- So I live in a metropolitan area and have a vehicle. I have a friend/coworker who ditched her car when she moved here so she takes the metro by default....
2018/09/06
[ "https://interpersonal.stackexchange.com/questions/18265", "https://interpersonal.stackexchange.com", "https://interpersonal.stackexchange.com/users/21520/" ]
I have been in a similar situation with carpooling but we were always 3-4 people going together. The system that we used was quite simple. If you were not where you are supposed to be on time you got left behind as it is not fair for 3 other people to be late if you can't make it. At the end of the day you are the o...
If you want your colleague to be on time ---------------------------------------- First off, **try to always be on time yourself**. It's much easier to demand other people to be on time if you set an example. Second, stop calling it "carpooling". What you do is not really a case of car sharing, instead **you give her...
54,672,959
I have the following data structure: ``` this.state = { active_menu: 2018, info: [ { key: 11, title: 'A', opened: false, content: [] }, { key: 10, ...
2019/02/13
[ "https://Stackoverflow.com/questions/54672959", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10825834/" ]
Maybe try appending a key and add the rest of the elements to the object before returning from the map. ```js var myObject = {"Timer13":{"Arm":0,"Mode":0},"Timer14":{"Arm":1,"Mode":1}} var result = Object.keys(myObject).map(elem => { return {timer: elem, ...myObject[elem]} }) console.log(result) ```
You can use [reduce](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Array/reduce) to achieve that playing with Current Value `(curr)` an Accumulator `(all)` also destructing your array can be helpful for a cleaner code. `[timer,obj]` timer : `curr[0]` and the obj is `curr[1]` ```js obj =...
54,672,959
I have the following data structure: ``` this.state = { active_menu: 2018, info: [ { key: 11, title: 'A', opened: false, content: [] }, { key: 10, ...
2019/02/13
[ "https://Stackoverflow.com/questions/54672959", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10825834/" ]
You could get the entries and map new objects by assigning the parts. ```js var object = { Timer13: { Arm: 0, Mode: 0 }, Timer14: { Arm: 1, Mode: 1 } }, array = Object .entries(object) .map(([timer, values]) => Object.assign({ timer }, values)); console.log(array); ``` ```css .as-console-wrap...
You can use [reduce](https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/Array/reduce) to achieve that playing with Current Value `(curr)` an Accumulator `(all)` also destructing your array can be helpful for a cleaner code. `[timer,obj]` timer : `curr[0]` and the obj is `curr[1]` ```js obj =...
54,672,959
I have the following data structure: ``` this.state = { active_menu: 2018, info: [ { key: 11, title: 'A', opened: false, content: [] }, { key: 10, ...
2019/02/13
[ "https://Stackoverflow.com/questions/54672959", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10825834/" ]
Maybe try appending a key and add the rest of the elements to the object before returning from the map. ```js var myObject = {"Timer13":{"Arm":0,"Mode":0},"Timer14":{"Arm":1,"Mode":1}} var result = Object.keys(myObject).map(elem => { return {timer: elem, ...myObject[elem]} }) console.log(result) ```
You could get the entries and map new objects by assigning the parts. ```js var object = { Timer13: { Arm: 0, Mode: 0 }, Timer14: { Arm: 1, Mode: 1 } }, array = Object .entries(object) .map(([timer, values]) => Object.assign({ timer }, values)); console.log(array); ``` ```css .as-console-wrap...
26,713,354
I got a problem.I have multiple callback functions . Function within function within a loop I want to execute very first function fully first . Then I want to move further. Currenlty no function is working fine: ``` function recurring_end() { var diffbot = new Diffbot('ddddd'); var sql= "SELECT `bookmarks`.`id`,`...
2014/11/03
[ "https://Stackoverflow.com/questions/26713354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2904107/" ]
Try replacing the loop with a recursive code like this.. ``` function recurring_end() { var diffbot = new Diffbot('ddddd'); var sql= "SELECT `bookmarks`.`id`,`bookmarks`.`bookmark_url` as url FROM bookmarks LIMIT 0, 10"; connection.query(sql, function(err,bookmarks) { console.log(JSON.parse(JSON.stringify(bookma...
Use [async.js](https://github.com/caolan/async) to manage your code flow If you have multiple functions, func\_1, func\_2, func\_3, that need to run in sequence, the code is ``` var async = require('async'); var functionList = [func_1, func_2, func_3]; async.series(functionList, function(err, result){ // result...
7,366,287
I have a block of code: ``` passwordEditText.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_ENTER) { launch.performClick(); return true; ...
2011/09/09
[ "https://Stackoverflow.com/questions/7366287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/706836/" ]
What you are seeing is the OnKey is fired twice, the first time for key down, and the second time for key up, so you have to filter it with ``` if (event.getAction()!=KeyEvent.ACTION_DOWN) { return true; } switch (keyCode) { case KeyEvent.KEYCODE_1 : //do something ...
What you describe is not possible. The code you posted looks correct, so I wonder if there's an error that's not in the snippet you posted. That said, some coding mistakes could lead a programmer to believe that both "if" and "else" blocks are being executed. E.g. ``` if(condition) { // do something } else; // not...
7,366,287
I have a block of code: ``` passwordEditText.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_ENTER) { launch.performClick(); return true; ...
2011/09/09
[ "https://Stackoverflow.com/questions/7366287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/706836/" ]
The debugger can be misleading when a conditional outcome just leads to a return statement. Put in a useless 'int x variable' and have it assign x = 2 (say) before the return true and x = 3 (say) before the return false. Step through again in the debugger, I'll bet you see it entering only one of the blocks
What you describe is not possible. The code you posted looks correct, so I wonder if there's an error that's not in the snippet you posted. That said, some coding mistakes could lead a programmer to believe that both "if" and "else" blocks are being executed. E.g. ``` if(condition) { // do something } else; // not...
7,366,287
I have a block of code: ``` passwordEditText.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_ENTER) { launch.performClick(); return true; ...
2011/09/09
[ "https://Stackoverflow.com/questions/7366287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/706836/" ]
try with this code... passwordEditText.setOnKeyListener(new OnKeyListener() { ``` public boolean onKey(View v, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_ENTER) { launch.performClick(); return true; } return false; } }); ```
What you describe is not possible. The code you posted looks correct, so I wonder if there's an error that's not in the snippet you posted. That said, some coding mistakes could lead a programmer to believe that both "if" and "else" blocks are being executed. E.g. ``` if(condition) { // do something } else; // not...
7,366,287
I have a block of code: ``` passwordEditText.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_ENTER) { launch.performClick(); return true; ...
2011/09/09
[ "https://Stackoverflow.com/questions/7366287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/706836/" ]
What you are seeing is the OnKey is fired twice, the first time for key down, and the second time for key up, so you have to filter it with ``` if (event.getAction()!=KeyEvent.ACTION_DOWN) { return true; } switch (keyCode) { case KeyEvent.KEYCODE_1 : //do something ...
Multiple events are fired when a key is pressed (or held, or released). Specifically for a press and release the following are fired: ACTION\_DOWN ACTION\_DOWN (if held, with non-zero repeatCount, event possibly repeated multiple times) ACTION\_UP (possibly with the FLAG\_CANCELED set if the event was canceled) Yo...
7,366,287
I have a block of code: ``` passwordEditText.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_ENTER) { launch.performClick(); return true; ...
2011/09/09
[ "https://Stackoverflow.com/questions/7366287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/706836/" ]
What you are seeing is the OnKey is fired twice, the first time for key down, and the second time for key up, so you have to filter it with ``` if (event.getAction()!=KeyEvent.ACTION_DOWN) { return true; } switch (keyCode) { case KeyEvent.KEYCODE_1 : //do something ...
The debugger can be misleading when a conditional outcome just leads to a return statement. Put in a useless 'int x variable' and have it assign x = 2 (say) before the return true and x = 3 (say) before the return false. Step through again in the debugger, I'll bet you see it entering only one of the blocks
7,366,287
I have a block of code: ``` passwordEditText.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_ENTER) { launch.performClick(); return true; ...
2011/09/09
[ "https://Stackoverflow.com/questions/7366287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/706836/" ]
What you are seeing is the OnKey is fired twice, the first time for key down, and the second time for key up, so you have to filter it with ``` if (event.getAction()!=KeyEvent.ACTION_DOWN) { return true; } switch (keyCode) { case KeyEvent.KEYCODE_1 : //do something ...
try with this code... passwordEditText.setOnKeyListener(new OnKeyListener() { ``` public boolean onKey(View v, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_ENTER) { launch.performClick(); return true; } return false; } }); ```
7,366,287
I have a block of code: ``` passwordEditText.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_ENTER) { launch.performClick(); return true; ...
2011/09/09
[ "https://Stackoverflow.com/questions/7366287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/706836/" ]
The debugger can be misleading when a conditional outcome just leads to a return statement. Put in a useless 'int x variable' and have it assign x = 2 (say) before the return true and x = 3 (say) before the return false. Step through again in the debugger, I'll bet you see it entering only one of the blocks
Multiple events are fired when a key is pressed (or held, or released). Specifically for a press and release the following are fired: ACTION\_DOWN ACTION\_DOWN (if held, with non-zero repeatCount, event possibly repeated multiple times) ACTION\_UP (possibly with the FLAG\_CANCELED set if the event was canceled) Yo...
7,366,287
I have a block of code: ``` passwordEditText.setOnKeyListener(new OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_ENTER) { launch.performClick(); return true; ...
2011/09/09
[ "https://Stackoverflow.com/questions/7366287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/706836/" ]
try with this code... passwordEditText.setOnKeyListener(new OnKeyListener() { ``` public boolean onKey(View v, int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_ENTER) { launch.performClick(); return true; } return false; } }); ```
Multiple events are fired when a key is pressed (or held, or released). Specifically for a press and release the following are fired: ACTION\_DOWN ACTION\_DOWN (if held, with non-zero repeatCount, event possibly repeated multiple times) ACTION\_UP (possibly with the FLAG\_CANCELED set if the event was canceled) Yo...
728,710
How would I go about replacing a defective hard drive in a RAID 5 array while keeping the data intact? I have a Highpoint Rocketraid 2720SGL RAID card.
2014/03/13
[ "https://superuser.com/questions/728710", "https://superuser.com", "https://superuser.com/users/307532/" ]
General answer: Normally, in RAID 5, you pull the broken drive. Then you insert a new drive in its place. Sometimes you have to tell the software to resync after that, but most hardware RAID cards do that just fine on their own. For your specific card: see page 12 [of the manual](http://www.highpoint-tech.com/PDF/rr...
I have not used that particular model, but other RAID controller cards from Highpoint. It should be as simple as removing the bad drive and inserting the new one and from the Rocketraid software telling the array to rebuild. If you do not have the software installed, or is incompatible with your OS (I know there were ...
43,699,936
Created an AWS AMI instance. I can telnet from the instance itself telnet [Pv4 Public IP] 9200 But not from my pc. This is my security group [![enter image description here](https://i.stack.imgur.com/MT6Z1.png)](https://i.stack.imgur.com/MT6Z1.png) What am I doing wrong?
2017/04/29
[ "https://Stackoverflow.com/questions/43699936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/450602/" ]
You can check your Network ACL configurations. It looks like there is some other firewall in between your PC and server which is blocking you on 9200.
You said: "This is my SG", but...which way? Inbound or outbound? It can simply be that your host can't reply to your PC. Try to add a rule which adds **outbound** TCP ranging from ports 32768 to 65535 (ephemeral ports), so that the telnet server response packets can travel back to your PC. Otherwise, like the others s...
43,699,936
Created an AWS AMI instance. I can telnet from the instance itself telnet [Pv4 Public IP] 9200 But not from my pc. This is my security group [![enter image description here](https://i.stack.imgur.com/MT6Z1.png)](https://i.stack.imgur.com/MT6Z1.png) What am I doing wrong?
2017/04/29
[ "https://Stackoverflow.com/questions/43699936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/450602/" ]
You might have your acceptor process running on `127.0.0.1:9000` which means only local clients can connect. This is not related to your Security Group which could be wide open. Run `lsof -i:9000` if on unix. If you see something like this under `NAME` then host IP used to start your acceptor will needs to change fro...
Need to ensure your SSH key you generated via IAM and attached to the EC2 at launch is added to the login: ``` ssh-add -K <yourkeyname>.pem ssh ubuntu@<yourdns or ip>.com == or == ssh ec2-user@<yourdns or ip> ```
43,699,936
Created an AWS AMI instance. I can telnet from the instance itself telnet [Pv4 Public IP] 9200 But not from my pc. This is my security group [![enter image description here](https://i.stack.imgur.com/MT6Z1.png)](https://i.stack.imgur.com/MT6Z1.png) What am I doing wrong?
2017/04/29
[ "https://Stackoverflow.com/questions/43699936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/450602/" ]
You can check your Network ACL configurations. It looks like there is some other firewall in between your PC and server which is blocking you on 9200.
You can have a look at this [telnet-to a cloud instance from outside](https://stackoverflow.com/questions/15022448/telnet-to-a-cloud-instance-from-outside) The solution to problem was "Open the services and make the telnet manual and right click on it and chose start" As well make sure that the instance is residing i...
43,699,936
Created an AWS AMI instance. I can telnet from the instance itself telnet [Pv4 Public IP] 9200 But not from my pc. This is my security group [![enter image description here](https://i.stack.imgur.com/MT6Z1.png)](https://i.stack.imgur.com/MT6Z1.png) What am I doing wrong?
2017/04/29
[ "https://Stackoverflow.com/questions/43699936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/450602/" ]
You might have your acceptor process running on `127.0.0.1:9000` which means only local clients can connect. This is not related to your Security Group which could be wide open. Run `lsof -i:9000` if on unix. If you see something like this under `NAME` then host IP used to start your acceptor will needs to change fro...
A Telnet service is not installed by default on an Amazon Linux AMI. If you wish to use it, you will need to install it yourself, eg: [Install and Setup Telnet on EC2 Amazon Linux or CentOS](http://codingsteps.com/install-and-setup-telnet-on-ec2-amazon-linux-or-centos/). However, these days it is recommended to use `...
43,699,936
Created an AWS AMI instance. I can telnet from the instance itself telnet [Pv4 Public IP] 9200 But not from my pc. This is my security group [![enter image description here](https://i.stack.imgur.com/MT6Z1.png)](https://i.stack.imgur.com/MT6Z1.png) What am I doing wrong?
2017/04/29
[ "https://Stackoverflow.com/questions/43699936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/450602/" ]
If you can access port 80 via telnet or you're able to SSH in it's likely you have a [network ACL](https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) in place. If you can not access port 80 via telnet but you can via a browser it's like a local config - maybe AV or a firewall. EC2 instances use secu...
A Telnet service is not installed by default on an Amazon Linux AMI. If you wish to use it, you will need to install it yourself, eg: [Install and Setup Telnet on EC2 Amazon Linux or CentOS](http://codingsteps.com/install-and-setup-telnet-on-ec2-amazon-linux-or-centos/). However, these days it is recommended to use `...
43,699,936
Created an AWS AMI instance. I can telnet from the instance itself telnet [Pv4 Public IP] 9200 But not from my pc. This is my security group [![enter image description here](https://i.stack.imgur.com/MT6Z1.png)](https://i.stack.imgur.com/MT6Z1.png) What am I doing wrong?
2017/04/29
[ "https://Stackoverflow.com/questions/43699936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/450602/" ]
You can check your Network ACL configurations. It looks like there is some other firewall in between your PC and server which is blocking you on 9200.
Based on what you've described, there isn't really much else to work with. Your ability to telnet the public IP from the instance implies the server is listening on the external interface and your security group is already set to have the port open to all incoming connections. Aside from the trivial overlooking of not...
43,699,936
Created an AWS AMI instance. I can telnet from the instance itself telnet [Pv4 Public IP] 9200 But not from my pc. This is my security group [![enter image description here](https://i.stack.imgur.com/MT6Z1.png)](https://i.stack.imgur.com/MT6Z1.png) What am I doing wrong?
2017/04/29
[ "https://Stackoverflow.com/questions/43699936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/450602/" ]
You can have a look at this [telnet-to a cloud instance from outside](https://stackoverflow.com/questions/15022448/telnet-to-a-cloud-instance-from-outside) The solution to problem was "Open the services and make the telnet manual and right click on it and chose start" As well make sure that the instance is residing i...
You might have your acceptor process running on `127.0.0.1:9000` which means only local clients can connect. This is not related to your Security Group which could be wide open. Run `lsof -i:9000` if on unix. If you see something like this under `NAME` then host IP used to start your acceptor will needs to change fro...
43,699,936
Created an AWS AMI instance. I can telnet from the instance itself telnet [Pv4 Public IP] 9200 But not from my pc. This is my security group [![enter image description here](https://i.stack.imgur.com/MT6Z1.png)](https://i.stack.imgur.com/MT6Z1.png) What am I doing wrong?
2017/04/29
[ "https://Stackoverflow.com/questions/43699936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/450602/" ]
If you can access port 80 via telnet or you're able to SSH in it's likely you have a [network ACL](https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html) in place. If you can not access port 80 via telnet but you can via a browser it's like a local config - maybe AV or a firewall. EC2 instances use secu...
You can have a look at this [telnet-to a cloud instance from outside](https://stackoverflow.com/questions/15022448/telnet-to-a-cloud-instance-from-outside) The solution to problem was "Open the services and make the telnet manual and right click on it and chose start" As well make sure that the instance is residing i...
43,699,936
Created an AWS AMI instance. I can telnet from the instance itself telnet [Pv4 Public IP] 9200 But not from my pc. This is my security group [![enter image description here](https://i.stack.imgur.com/MT6Z1.png)](https://i.stack.imgur.com/MT6Z1.png) What am I doing wrong?
2017/04/29
[ "https://Stackoverflow.com/questions/43699936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/450602/" ]
You can check your Network ACL configurations. It looks like there is some other firewall in between your PC and server which is blocking you on 9200.
A Telnet service is not installed by default on an Amazon Linux AMI. If you wish to use it, you will need to install it yourself, eg: [Install and Setup Telnet on EC2 Amazon Linux or CentOS](http://codingsteps.com/install-and-setup-telnet-on-ec2-amazon-linux-or-centos/). However, these days it is recommended to use `...
43,699,936
Created an AWS AMI instance. I can telnet from the instance itself telnet [Pv4 Public IP] 9200 But not from my pc. This is my security group [![enter image description here](https://i.stack.imgur.com/MT6Z1.png)](https://i.stack.imgur.com/MT6Z1.png) What am I doing wrong?
2017/04/29
[ "https://Stackoverflow.com/questions/43699936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/450602/" ]
You can have a look at this [telnet-to a cloud instance from outside](https://stackoverflow.com/questions/15022448/telnet-to-a-cloud-instance-from-outside) The solution to problem was "Open the services and make the telnet manual and right click on it and chose start" As well make sure that the instance is residing i...
Need to ensure your SSH key you generated via IAM and attached to the EC2 at launch is added to the login: ``` ssh-add -K <yourkeyname>.pem ssh ubuntu@<yourdns or ip>.com == or == ssh ec2-user@<yourdns or ip> ```
211,885
When a script runs under Apache, I insert `$_SERVER['SERVER_NAME']` value into an error reporting e-mail message. However, if a Web script forks a "worker" job with `nohup php ...`, `$_SERVER['SERVER_NAME']` appears to be empty there. Thus, if an error occurs, it's reported without a host name. Can I reliably get the...
2008/10/17
[ "https://Stackoverflow.com/questions/211885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6430/" ]
[php\_uname("n")](http://uk.php.net/manual/en/function.php-uname.php) > > (PHP 4 >= 4.0.2, PHP 5) > > php\_uname — Returns information about the > operating system PHP is running on > > > php\_uname() returns a description of the operating system PHP is > running on. This is the same string you see at the ver...
You can use `_GLOBALS['MACHINENAME']` to obtain the information straight from the `globals` `array`.
211,885
When a script runs under Apache, I insert `$_SERVER['SERVER_NAME']` value into an error reporting e-mail message. However, if a Web script forks a "worker" job with `nohup php ...`, `$_SERVER['SERVER_NAME']` appears to be empty there. Thus, if an error occurs, it's reported without a host name. Can I reliably get the...
2008/10/17
[ "https://Stackoverflow.com/questions/211885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6430/" ]
[php\_uname("n")](http://uk.php.net/manual/en/function.php-uname.php) > > (PHP 4 >= 4.0.2, PHP 5) > > php\_uname — Returns information about the > operating system PHP is running on > > > php\_uname() returns a description of the operating system PHP is > running on. This is the same string you see at the ver...
For [PHP >= 5.3.0 use this](http://www.php.net/manual/en/function.gethostname.php): `$hostname = gethostname();` For [PHP < 5.3.0 but >= 4.2.0 use this](http://www.php.net/manual/en/function.php-uname.php): `$hostname = php_uname('n');` For PHP < 4.2.0 you can try one of these: ``` $hostname = getenv('HOSTNAME'); ...
211,885
When a script runs under Apache, I insert `$_SERVER['SERVER_NAME']` value into an error reporting e-mail message. However, if a Web script forks a "worker" job with `nohup php ...`, `$_SERVER['SERVER_NAME']` appears to be empty there. Thus, if an error occurs, it's reported without a host name. Can I reliably get the...
2008/10/17
[ "https://Stackoverflow.com/questions/211885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6430/" ]
For [PHP >= 5.3.0 use this](http://www.php.net/manual/en/function.gethostname.php): `$hostname = gethostname();` For [PHP < 5.3.0 but >= 4.2.0 use this](http://www.php.net/manual/en/function.php-uname.php): `$hostname = php_uname('n');` For PHP < 4.2.0 you can try one of these: ``` $hostname = getenv('HOSTNAME'); ...
You can use `_GLOBALS['MACHINENAME']` to obtain the information straight from the `globals` `array`.
19,626,238
I am trying to create a data visualisation for some student related data (sample record below) but when d3 renders it, it goes through the data twice and overwrites it, leaving only the results for the second time through only on the screen. I am using a row counter here to so I have a way to set the y coord of each re...
2013/10/28
[ "https://Stackoverflow.com/questions/19626238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2926478/" ]
Change ``` System.out.print(i); ``` to ``` System.out.print(list.get(i)); ```
it is because you are print the int not the contents of the list, try changing the 3 line of the function printList to: ``` System.out.print(list.get(i)); ```
508,530
Have you seen or heard of the groups $\mathcal{A}(n)$ or $A(n)$ (for any integer $n$) described below? *This is the well-known construction*: Let $A$ be an abelian group. Then $A(p)$ is a subgroup which is the set of all elements $x\in A$ such that $ord(x) = p^k \ $ for some $k\in \mathbb{N}$. This, for prime $p$ ...
2013/09/29
[ "https://math.stackexchange.com/questions/508530", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26327/" ]
Answer in not just $ -xe^{-\lambda x} $. Correct answer with limits is $ [-xe^{-\lambda x}]^{\infty} \_0$ + ${\int^{\infty}\_0e^{-\lambda x}dx}$ which turns out to be $1/\lambda.$ Explanation:Applying integration by parts (the correct way) $${\int{x\lambda}e^{-\lambda x}dx} = {}\lambda x {\int e^{-\lambda x}dx} - {\l...
How to integrate: $$\int\_0^\infty x \, \lambda e^{-\lambda x} \, dx \Longrightarrow -\frac{1}{\lambda}\int\_0^\infty u\, e^{u} \, \Longrightarrow (-\frac{1}{\lambda})e^u(u + 1) + C \Longrightarrow -\frac{1}{\lambda}(e^{-\lambda x}(\lambda x - 1) + C)$$ 1) Choose $u = -\lambda x$. $-du = \lambda dx$. No need for inte...
508,530
Have you seen or heard of the groups $\mathcal{A}(n)$ or $A(n)$ (for any integer $n$) described below? *This is the well-known construction*: Let $A$ be an abelian group. Then $A(p)$ is a subgroup which is the set of all elements $x\in A$ such that $ord(x) = p^k \ $ for some $k\in \mathbb{N}$. This, for prime $p$ ...
2013/09/29
[ "https://math.stackexchange.com/questions/508530", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26327/" ]
How to integrate: $$\int\_0^\infty x \, \lambda e^{-\lambda x} \, dx \Longrightarrow -\frac{1}{\lambda}\int\_0^\infty u\, e^{u} \, \Longrightarrow (-\frac{1}{\lambda})e^u(u + 1) + C \Longrightarrow -\frac{1}{\lambda}(e^{-\lambda x}(\lambda x - 1) + C)$$ 1) Choose $u = -\lambda x$. $-du = \lambda dx$. No need for inte...
Of course, $\lambda > 0$ must be assumed. Another way: $$ \lambda x e^{-\lambda x} = - \lambda \dfrac{\partial}{\partial\lambda} e^{-\lambda x}$$ $$ \eqalign{\int\_0^R \lambda x e^{-\lambda x} \; dx &= - \lambda \dfrac{d}{d\lambda} \int\_0^R e^{-\lambda x}\; dx = -\lambda \dfrac{d}{d\lambda} \left(\dfrac{1}{\lambda...
508,530
Have you seen or heard of the groups $\mathcal{A}(n)$ or $A(n)$ (for any integer $n$) described below? *This is the well-known construction*: Let $A$ be an abelian group. Then $A(p)$ is a subgroup which is the set of all elements $x\in A$ such that $ord(x) = p^k \ $ for some $k\in \mathbb{N}$. This, for prime $p$ ...
2013/09/29
[ "https://math.stackexchange.com/questions/508530", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26327/" ]
Answer in not just $ -xe^{-\lambda x} $. Correct answer with limits is $ [-xe^{-\lambda x}]^{\infty} \_0$ + ${\int^{\infty}\_0e^{-\lambda x}dx}$ which turns out to be $1/\lambda.$ Explanation:Applying integration by parts (the correct way) $${\int{x\lambda}e^{-\lambda x}dx} = {}\lambda x {\int e^{-\lambda x}dx} - {\l...
Of course, $\lambda > 0$ must be assumed. Another way: $$ \lambda x e^{-\lambda x} = - \lambda \dfrac{\partial}{\partial\lambda} e^{-\lambda x}$$ $$ \eqalign{\int\_0^R \lambda x e^{-\lambda x} \; dx &= - \lambda \dfrac{d}{d\lambda} \int\_0^R e^{-\lambda x}\; dx = -\lambda \dfrac{d}{d\lambda} \left(\dfrac{1}{\lambda...
30,051,455
I am producing a report of a subset of our products. Each of these products has an A4 page of details presented in a dashboard using excel. I have a number of stored procedures that excel uses to connect to my database and return the data. This data is then read by the dashboard which automatically updates. I need to...
2015/05/05
[ "https://Stackoverflow.com/questions/30051455", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4741952/" ]
There is no 'a' or 'h' in the input, so it will always call `return str.substring(0, 1) + FN(str.substring(1));` until the length is 0 : ``` FN("ello") = "e" + FN("llo") = "e" + "l" + FN("lo") = .... = "ello" ```
Your recursion each time takes the first letter of the remaining string: ``` "e" + FN("llo") = "e" + "l" + FN("lo") = "e" + "l" + "l" + FN("o") = "ello" ```
30,051,455
I am producing a report of a subset of our products. Each of these products has an A4 page of details presented in a dashboard using excel. I have a number of stored procedures that excel uses to connect to my database and return the data. This data is then read by the dashboard which automatically updates. I need to...
2015/05/05
[ "https://Stackoverflow.com/questions/30051455", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4741952/" ]
There is no 'a' or 'h' in the input, so it will always call `return str.substring(0, 1) + FN(str.substring(1));` until the length is 0 : ``` FN("ello") = "e" + FN("llo") = "e" + "l" + FN("lo") = .... = "ello" ```
Use ``` str.substring(0, 2)// instead of str.substring(0, 1) ```
73,450,293
I have this question on a form that needs to be validated, which I'm trying to do below: ``` <div class="question"> <div class="row"> <h5>1. Requestors Name (Your name or JHED ID)</h5><p class="required">*</p> </div> <input type="text" class="form-control" id="requestorName" name="reque...
2022/08/22
[ "https://Stackoverflow.com/questions/73450293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14108804/" ]
Try `requesterName?.errors?.required`
You're using two different variables: **requesterName** and **requestorName** ``` <input type="text" class="form-control" id="requestorName" name="requestorName" required minlength="2" [(ngModel)]="model.requestorName" #requesterName="ngModel"/> ```
69,230
Under Natty I had a lovely .icc calibration file for my laptop's screen. It's awful without it. Under Oneiric, when I go to 'Color' in the settings manager only my webcam is listed in the devices that can be colour managed. So I can't install my .icc profile. I've installed all the gcm/argyl stuff but that hasn't got...
2011/10/19
[ "https://askubuntu.com/questions/69230", "https://askubuntu.com", "https://askubuntu.com/users/28930/" ]
Until this bug is fixed, you can load your colour profile manually with ``` dispwin your_colour_profile.icc ``` (so you can put that in a script in your your autostart folder)
Go to System Settings > Color Select your monitor click add profile use the drop down list to select other navigate to a compatible .icc profile and then click import then click add
69,230
Under Natty I had a lovely .icc calibration file for my laptop's screen. It's awful without it. Under Oneiric, when I go to 'Color' in the settings manager only my webcam is listed in the devices that can be colour managed. So I can't install my .icc profile. I've installed all the gcm/argyl stuff but that hasn't got...
2011/10/19
[ "https://askubuntu.com/questions/69230", "https://askubuntu.com", "https://askubuntu.com/users/28930/" ]
I am having a similar issue in Ubuntu Gnome 15.10 (Gnome 3.18). NOTE: I already had an .icc file for my display. I was able to manually apply it to my unlisted display with the following command: ``` # dispwin -d 2 ./Dell_3007WFP-5000.icm ``` -d 2 specified the 2nd display (1st was my laptop built-in display) H...
Go to System Settings > Color Select your monitor click add profile use the drop down list to select other navigate to a compatible .icc profile and then click import then click add
69,230
Under Natty I had a lovely .icc calibration file for my laptop's screen. It's awful without it. Under Oneiric, when I go to 'Color' in the settings manager only my webcam is listed in the devices that can be colour managed. So I can't install my .icc profile. I've installed all the gcm/argyl stuff but that hasn't got...
2011/10/19
[ "https://askubuntu.com/questions/69230", "https://askubuntu.com", "https://askubuntu.com/users/28930/" ]
Until this bug is fixed, you can load your colour profile manually with ``` dispwin your_colour_profile.icc ``` (so you can put that in a script in your your autostart folder)
I am having a similar issue in Ubuntu Gnome 15.10 (Gnome 3.18). NOTE: I already had an .icc file for my display. I was able to manually apply it to my unlisted display with the following command: ``` # dispwin -d 2 ./Dell_3007WFP-5000.icm ``` -d 2 specified the 2nd display (1st was my laptop built-in display) H...
573,071
I am looking to see if there is an application for reading kindle books on this system.
2015/01/13
[ "https://askubuntu.com/questions/573071", "https://askubuntu.com", "https://askubuntu.com/users/368161/" ]
You can use the [Kindle Cloud Reader for Chrome](https://chrome.google.com/webstore/detail/kindle-cloud-reader/icdipabjmbhpdkjaihfjoikhjjeneebd?utm_source=chrome-app-launcher-info-dialog).
[Calibre](https://apps.ubuntu.com/cat/applications/calibre) [![Install Calibre](https://hostmar.co/software-small)](https://apps.ubuntu.com/cat/applications/calibre) has a reader in it and can also convert between formats.
24,909,466
How can i assign the javascript variable in to php. ``` $("button").click(function() { var val = (this.id); $.ajax ({ url: "date.php", //data: { val : val }, data:'q=' + val, type: "GET", success: function(result) { if(result==1) ...
2014/07/23
[ "https://Stackoverflow.com/questions/24909466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3864156/" ]
Yes it does, all you have to do is add this line on your config.xml file : ``` <access origin="http://example.com" /> ``` You can also do this : ``` <access origin="*" /> ``` But it's safer to specify the domain you're sending requests to. If you need more information check this [page](http://docs.phonegap.com...
I changed the tomcat filter in my server. I modified the Origin header of the request inside my custom filter and it works. I dont know wether this is the right way to do things but I this is the only thing to get it working.
24,909,466
How can i assign the javascript variable in to php. ``` $("button").click(function() { var val = (this.id); $.ajax ({ url: "date.php", //data: { val : val }, data:'q=' + val, type: "GET", success: function(result) { if(result==1) ...
2014/07/23
[ "https://Stackoverflow.com/questions/24909466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3864156/" ]
Yes it does, all you have to do is add this line on your config.xml file : ``` <access origin="http://example.com" /> ``` You can also do this : ``` <access origin="*" /> ``` But it's safer to specify the domain you're sending requests to. If you need more information check this [page](http://docs.phonegap.com...
Given below is the code in Tomcat CORS filter, so new URI with Origin as "file://" throws `URISyntaxException` which results in 403 `protected static boolean isValidOrigin(String origin) { URI originURI; try { originURI = new URI(origin); } catch (URISyntaxException e) { return false; } return originURI.getSc...
24,909,466
How can i assign the javascript variable in to php. ``` $("button").click(function() { var val = (this.id); $.ajax ({ url: "date.php", //data: { val : val }, data:'q=' + val, type: "GET", success: function(result) { if(result==1) ...
2014/07/23
[ "https://Stackoverflow.com/questions/24909466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3864156/" ]
Yes it does, all you have to do is add this line on your config.xml file : ``` <access origin="http://example.com" /> ``` You can also do this : ``` <access origin="*" /> ``` But it's safer to specify the domain you're sending requests to. If you need more information check this [page](http://docs.phonegap.com...
The solution of Taher solved my problem with PhoneGap+jQuery accessing a tomcat web-service. Just included the referenced java code (<https://github.com/sebastienblanc/cors-filter/blob/master/src/main/java/org/ebaysf/web/cors/CORSFilter.java#L825>) in my project and added the next lines to the web.xml of the project. R...
24,909,466
How can i assign the javascript variable in to php. ``` $("button").click(function() { var val = (this.id); $.ajax ({ url: "date.php", //data: { val : val }, data:'q=' + val, type: "GET", success: function(result) { if(result==1) ...
2014/07/23
[ "https://Stackoverflow.com/questions/24909466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3864156/" ]
The solution of Taher solved my problem with PhoneGap+jQuery accessing a tomcat web-service. Just included the referenced java code (<https://github.com/sebastienblanc/cors-filter/blob/master/src/main/java/org/ebaysf/web/cors/CORSFilter.java#L825>) in my project and added the next lines to the web.xml of the project. R...
I changed the tomcat filter in my server. I modified the Origin header of the request inside my custom filter and it works. I dont know wether this is the right way to do things but I this is the only thing to get it working.
24,909,466
How can i assign the javascript variable in to php. ``` $("button").click(function() { var val = (this.id); $.ajax ({ url: "date.php", //data: { val : val }, data:'q=' + val, type: "GET", success: function(result) { if(result==1) ...
2014/07/23
[ "https://Stackoverflow.com/questions/24909466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3864156/" ]
The solution of Taher solved my problem with PhoneGap+jQuery accessing a tomcat web-service. Just included the referenced java code (<https://github.com/sebastienblanc/cors-filter/blob/master/src/main/java/org/ebaysf/web/cors/CORSFilter.java#L825>) in my project and added the next lines to the web.xml of the project. R...
Given below is the code in Tomcat CORS filter, so new URI with Origin as "file://" throws `URISyntaxException` which results in 403 `protected static boolean isValidOrigin(String origin) { URI originURI; try { originURI = new URI(origin); } catch (URISyntaxException e) { return false; } return originURI.getSc...
453,116
If $\eta$ is a Grassmann variable, due to invariance under translations we get that, $$\int d\eta\ \eta = 1 \tag1$$ Nevertheless, for being Grassmann's, $\eta$ satisfies $\eta^2 = 0$. Differentiating this condition you get, $$d(\eta^2) = 2\eta d\eta \equiv 0 \Rightarrow \int d\eta\ \eta = 0 \tag2$$ So, Eq. (2) obta...
2019/01/09
[ "https://physics.stackexchange.com/questions/453116", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/195138/" ]
I am not sure that $d(\eta^2)$ is defined at all. But if it is, then, in my opinion, you should write it in this way $$ d(\eta^2) = d(\eta\eta) = d\eta\ \eta + \eta\ d\eta $$ So you get not $\eta\ d\eta = 0$, but natural anticommutation of $\eta$ and $d\eta$: $d\eta\ \eta + \eta\ d\eta = 0$. I think the latter equality...
1. For Grassmann-odd [Berezin integration](https://en.wikipedia.org/wiki/Berezin_integral), the integration measure $d\theta$ (called an *integration form* in Ref. 1) is *not$^1$* a [1-form/differential form](https://en.wikipedia.org/wiki/Exterior_derivative) $\mathrm{d}\theta$! 2. For Grassmann-odd Berezin integration...
38,488,295
I recently bought [Moltran](http://moltran.coderthemes.com/green/index.html) which is fine but has a big disadvantage: The notification menu disappears on mobile devices, which is not suiteable for me. So I learned that that this can be done removing the *hidden-xs* class of the li notification element. This will turn ...
2016/07/20
[ "https://Stackoverflow.com/questions/38488295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3276634/" ]
Well. If I understand correctly you should set overflow to your navigation bar. And it should do the trick. ``` .topbar{ height: 100%; background: transparent; overflow-y: auto; } ``` EDIT: This will set height of your topbar to 100%. Because of this it will overlap all elements on the screen. As an alt...
Just give a fixed height to ur notification area with media query on small device and set overflow-y:auto. Height should be in px only. For example let notification\_area is your div class.. ``` @media (max-width:600px){ .notification_area{ overflow-y:auto; height:300px; } } ```
38,488,295
I recently bought [Moltran](http://moltran.coderthemes.com/green/index.html) which is fine but has a big disadvantage: The notification menu disappears on mobile devices, which is not suiteable for me. So I learned that that this can be done removing the *hidden-xs* class of the li notification element. This will turn ...
2016/07/20
[ "https://Stackoverflow.com/questions/38488295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3276634/" ]
Well. If I understand correctly you should set overflow to your navigation bar. And it should do the trick. ``` .topbar{ height: 100%; background: transparent; overflow-y: auto; } ``` EDIT: This will set height of your topbar to 100%. Because of this it will overlap all elements on the screen. As an alt...
You can make the notification panel scrollable: ``` .navbar-nav .open .dropdown-menu { background-color: #ffffff; box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26); left: auto; position: absolute; right: 0; z-index: 100; // Extra code required overflow-y: auto; -webkit-overflow-scrolling: touch; /* lets ...
38,488,295
I recently bought [Moltran](http://moltran.coderthemes.com/green/index.html) which is fine but has a big disadvantage: The notification menu disappears on mobile devices, which is not suiteable for me. So I learned that that this can be done removing the *hidden-xs* class of the li notification element. This will turn ...
2016/07/20
[ "https://Stackoverflow.com/questions/38488295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3276634/" ]
You can make the notification panel scrollable: ``` .navbar-nav .open .dropdown-menu { background-color: #ffffff; box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26); left: auto; position: absolute; right: 0; z-index: 100; // Extra code required overflow-y: auto; -webkit-overflow-scrolling: touch; /* lets ...
Just give a fixed height to ur notification area with media query on small device and set overflow-y:auto. Height should be in px only. For example let notification\_area is your div class.. ``` @media (max-width:600px){ .notification_area{ overflow-y:auto; height:300px; } } ```
18,719,799
I am trying to write a backup script for cloudfiles (using Rackspace) , which will only copy the files that are modified since the last backup time. Is there a way to query for a list files that are modified since a specific time ? (Using PHP ) Note: using [php-opencloud](https://github.com/rackspace/php-opencloud) l...
2013/09/10
[ "https://Stackoverflow.com/questions/18719799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/378737/" ]
Currently, I haven't found a way to query/filter based on the last modified date. What you can do is look at the metadata for each object in a container. At a low level, this requires just a HEAD operation on each object. While this probably requires you to check each object, you're only grabbing the headers and not d...
Try using [glob()](http://php.net/manual/en/function.glob.php) and [filemtime()](http://php.net/manual/en/function.filemtime.php). Example: ``` $lastBackupTime = 1234567890; //You'll have to figure out how to store and retrieve this $modified = array(); // Change the input of glob() to use the directory and file ext...
1,817,044
I have the following task: "Determine the homomorphism between two cyclic groups. Which are injective, surjective or bijective?" I already found this for the cyclic group of integers: <http://users.math.yale.edu/~auel/courses/370f06/docs/solutions3.pdf> page 2, 4.4. But what about the cyclic groups of Integers modulo...
2016/06/07
[ "https://math.stackexchange.com/questions/1817044", "https://math.stackexchange.com", "https://math.stackexchange.com/users/346222/" ]
We can suppose the cyclic groups are $\mathbf Z/m\mathbf Z$ and $\mathbf Z/n\mathbf Z$ respectively. A homomorphism from the first to the second is determined by the choice of the image $\bar x$ of $\bar 1$, subject to the condition $m \bar x=0$, i.e. $$\DeclareMathOperator\Hom{Hom}\Hom(\mathbf Z/m\mathbf Z,\mathbf Z/n...
Property: let $f: G \rightarrow H$ a finite group morphism then for all $ x\in G$ the order of $f(x)$ divides both, order of $ x$ and order of $H$. So, if $n$ and $m$ are coprime, then there is no nonzero morphism groups from $\Bbb{Z}/n\Bbb{Z}$ to $\Bbb{Z}/m\Bbb{Z}$. else $n=1$ or $m=1$ this last three cases are evide...
35,413,139
we want to load css and javascript files dynamically for the pages in our magento system. By reason of growing js and css file we want to split them in seperate files and load them for the current page. We use the CMS [Advanced content manager](http://www.advancedcontentmanager.com/) for managing our page content. Caus...
2016/02/15
[ "https://Stackoverflow.com/questions/35413139", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1648661/" ]
Have you tried using XML to load JS or CSS on particular content pages? Here is an example of loading CSS & JS file. *Content Page => Design Tab => Custom Layout Update XML.* ``` <reference name="head"> <action method="addItem"><type>skin_css</type><name>css/your_css.css</name></action> <action method="addIt...
You could create an extension that observes the 'layout load before' event. With some request params you could identify the pages where you want to include some css or js. For Example: `app/code/local/Foo/Bar/etc/config.xml` ``` <?xml version="1.0" encoding="UTF-8"?> <config> <modules> <Foo_Bar> ...
35,413,139
we want to load css and javascript files dynamically for the pages in our magento system. By reason of growing js and css file we want to split them in seperate files and load them for the current page. We use the CMS [Advanced content manager](http://www.advancedcontentmanager.com/) for managing our page content. Caus...
2016/02/15
[ "https://Stackoverflow.com/questions/35413139", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1648661/" ]
Have you tried using XML to load JS or CSS on particular content pages? Here is an example of loading CSS & JS file. *Content Page => Design Tab => Custom Layout Update XML.* ``` <reference name="head"> <action method="addItem"><type>skin_css</type><name>css/your_css.css</name></action> <action method="addIt...
Just check out the module documentation, a dynamic layout is implemented. So you can add a specific layout for a certain content type: acm for magento 1.x: (end of page) <https://www.advancedcontentmanager.com/documentation/content/php-helper-methods-render-methods> acm for magento 2.x: <https://www.advancedcontentma...
39,601,787
I'm unable to find method to close path open in windows explorer. Lets say I would like to close opened window, "c:\program files". Code should look like ``` #::j close window "c:\program files" return ``` Thank you.
2016/09/20
[ "https://Stackoverflow.com/questions/39601787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1926221/" ]
You will want to look here: <https://autohotkey.com/docs/commands/WinClose.htm> which specifies: `WinClose [, WinTitle, WinText, SecondsToWait, ExcludeTitle, ExcludeText]` and then: ``` #j:: ; Win Key + j WinClose, C:\Program Files ; close Program Files window return ``` Alternatively, to close any explo...
Updated Code and here is a [video stepping through the code](http://sendvid.com/a8v4jrd4): ``` path := "C:\Program Files" shell := ComObjCreate("Shell.Application") shell.open("file:///c:/") shell.open("file:///" . path) #If WinExist("ahk_class CabinetWClass") ; explorer F1:: for window in ComObjCreate("Sh...
29,164,779
I'm working on a project that has many view controllers. Suppose that they are: A -> B -> C -> D -> E ->F ->G -> H. Each of them has a back and a next button to switch to another view and has many text fields. I typed text into every textfield. From H view, I can go back to previous views by popviewcontroller and revi...
2015/03/20
[ "https://Stackoverflow.com/questions/29164779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4693597/" ]
Create a Singleton class. Give in Singleton class a property like `Form *form;` If you start your first ViewController create a new Form ``` [Singleton sharedInstance].form = [[Form alloc] init]; ``` On leave first ViewController set property from TextField ``` [Singleton sharedInstance].form.name = textField.text...
What about using a NSMutableDictionary to keep the models for each view controller as a key value pair. And Each View Controller initialized with this NSMutableDictionary ``` - (id) initWithDataDictionary:(NSMutableDictionary *)aDataDictionary { self = [super init]; _myDataModel = (MyDataModel*)[aDictionary valu...
29,164,779
I'm working on a project that has many view controllers. Suppose that they are: A -> B -> C -> D -> E ->F ->G -> H. Each of them has a back and a next button to switch to another view and has many text fields. I typed text into every textfield. From H view, I can go back to previous views by popviewcontroller and revi...
2015/03/20
[ "https://Stackoverflow.com/questions/29164779", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4693597/" ]
Create a Singleton class. Give in Singleton class a property like `Form *form;` If you start your first ViewController create a new Form ``` [Singleton sharedInstance].form = [[Form alloc] init]; ``` On leave first ViewController set property from TextField ``` [Singleton sharedInstance].form.name = textField.text...
I see two options here: * If you use storyboards [unwind](http://spin.atomicobject.com/2014/10/25/ios-unwind-segues/) segues are very good option. * Else you can create own [delegate](http://www.idev101.com/code/Objective-C/delegate.html).
46,036,140
I upload a blob using the SDK and add some metadata e.g: ``` blob.Metadata["fileLoadId"] = "5"; ``` I then have a logic app that is triggered by this new blob, but I want to be able to access this 'fileLoadId' within the logic app so I can pass it to functions. In the logic app the blob has the following metadata: ...
2017/09/04
[ "https://Stackoverflow.com/questions/46036140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/592192/" ]
To generate URL's for assets like CSS/JS/images/etc., in Laravel, use the helper function `asset`, instead of specifying the relative URL: ``` <link rel="stylesheet" href="{{ asset('css/style.css') }}"> ``` [See the documentation](https://laravel.com/docs/5.4/helpers#method-asset)
The right solution is the following one: ``` <link rel="stylesheet" href="/css/style.css"> ``` Don't forget to add the `/` before the `css/style.css` or it wont load.
46,036,140
I upload a blob using the SDK and add some metadata e.g: ``` blob.Metadata["fileLoadId"] = "5"; ``` I then have a logic app that is triggered by this new blob, but I want to be able to access this 'fileLoadId' within the logic app so I can pass it to functions. In the logic app the blob has the following metadata: ...
2017/09/04
[ "https://Stackoverflow.com/questions/46036140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/592192/" ]
``` <link rel="stylesheet" href="{{ asset('public/css/style.css') }} "> ``` or ``` <link rel="stylesheet" href="{{ asset('css/style.css') }} "> ```
The right solution is the following one: ``` <link rel="stylesheet" href="/css/style.css"> ``` Don't forget to add the `/` before the `css/style.css` or it wont load.
46,036,140
I upload a blob using the SDK and add some metadata e.g: ``` blob.Metadata["fileLoadId"] = "5"; ``` I then have a logic app that is triggered by this new blob, but I want to be able to access this 'fileLoadId' within the logic app so I can pass it to functions. In the logic app the blob has the following metadata: ...
2017/09/04
[ "https://Stackoverflow.com/questions/46036140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/592192/" ]
Use absolute paths like this (starting from the end of 'public'): ``` <link rel="stylesheet" href="/css/style.css">, ```
The right solution is the following one: ``` <link rel="stylesheet" href="/css/style.css"> ``` Don't forget to add the `/` before the `css/style.css` or it wont load.
63,729,967
Here is some code I've written to save a UrlEntity : ``` public UrlEntity saveUrlEntity(String longUrl, LocalDate dateAdded) { int urlLength = longUrl.length(); if (urlLength >= Constants.MAX_LONG_URL_LENGTH) { throw new LongUrlLengthExceededException("URL with length " + urlLength + " exceeds the max...
2020/09/03
[ "https://Stackoverflow.com/questions/63729967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/470184/" ]
This is very subjective, but... Since most of your `if` statements are guard/short-circuit clauses, which `throw` or `return`, there is no need to use `else`. I think this simple change makes the code much more readable. ``` public UrlEntity saveUrlEntity(String longUrl, LocalDate dateAdded) { final int urlLength...
If you use `throw new` or `return` you do not need the else condition because the method ends like ``` public UrlEntity saveUrlEntity(String longUrl, LocalDate dateAdded) { int urlLength = longUrl.length(); if (urlLength >= Constants.MAX_LONG_URL_LENGTH) { throw new LongUrlLengthExceededException("URL...
62,222,463
I'm trying to change, with CSS, the size and color of an SVG element that's being rendered with `<use>`. The SVG in question: ``` <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"> <path fill="#000000" fill-rule="evenodd" d="<all the actual svg path info>" clip-rule="ev...
2020/06/05
[ "https://Stackoverflow.com/questions/62222463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11719027/" ]
For the size it's easy if you correctly set the viewBox and then you adjust the width/height. For the coloration you can rely on blending mode since the color of the SVG is black. ```css .icon { display: inline-block; background: #fff; position: relative; } .icon::after { content:""; position:absolu...
Save svg as a image with svg format then add the color and width or whatever you want to your img then add this to the html file as a img tag and display: none the svg code. If you can't reach the html code then you can't do anything.
416,977
Let $B$ be a paracompact space with the property that any (topological) vector bundle $E \to B$ is trivial. What are some non-trivial examples of such spaces, and are there any interesting properties that characterize them? For simple known examples we of course have contractible spaces, as well as the 3-sphere $S^3$....
2022/02/25
[ "https://mathoverflow.net/questions/416977", "https://mathoverflow.net", "https://mathoverflow.net/users/143629/" ]
Let $B$ be a closed manifold with such that every vector bundle is trivial. Then $H^1(B; \mathbb{Z}\_2) = 0$, otherwise there would be a non-trivial line bundle. Therefore every bundle over $B$ is orientable and $B$ itself is orientable. Orientable rank two bundles over $B$ are classified by $H^2(B; \mathbb{Z})$, so we...
Here is one constraint, which seems relevant in light of Michael Albanese's answer: **Claim:** Let $B$ be a closed orientable odd-dimensional manifold with no stably nontrivial complex vector bundles. Then $B$ is a rational homology sphere (of odd dimension). **Proof:** 1. By Bott periodicity, $\widetilde{KU}^\ast(B...
416,977
Let $B$ be a paracompact space with the property that any (topological) vector bundle $E \to B$ is trivial. What are some non-trivial examples of such spaces, and are there any interesting properties that characterize them? For simple known examples we of course have contractible spaces, as well as the 3-sphere $S^3$....
2022/02/25
[ "https://mathoverflow.net/questions/416977", "https://mathoverflow.net", "https://mathoverflow.net/users/143629/" ]
Let $B$ be a closed manifold with such that every vector bundle is trivial. Then $H^1(B; \mathbb{Z}\_2) = 0$, otherwise there would be a non-trivial line bundle. Therefore every bundle over $B$ is orientable and $B$ itself is orientable. Orientable rank two bundles over $B$ are classified by $H^2(B; \mathbb{Z})$, so we...
Here is another obstruction. > > Suppose $M^n$ is a closed simply connected manifold which admits only trivial vector bundles. Then $M$ cannot be a $\mathbb{Z}/2\mathbb{Z}$-homology sphere, unless $n=3$. > > > I'm not sure if the hypothesis that $M$ is simply connected is necessary, but it's certainly necessary i...
416,977
Let $B$ be a paracompact space with the property that any (topological) vector bundle $E \to B$ is trivial. What are some non-trivial examples of such spaces, and are there any interesting properties that characterize them? For simple known examples we of course have contractible spaces, as well as the 3-sphere $S^3$....
2022/02/25
[ "https://mathoverflow.net/questions/416977", "https://mathoverflow.net", "https://mathoverflow.net/users/143629/" ]
Here is one constraint, which seems relevant in light of Michael Albanese's answer: **Claim:** Let $B$ be a closed orientable odd-dimensional manifold with no stably nontrivial complex vector bundles. Then $B$ is a rational homology sphere (of odd dimension). **Proof:** 1. By Bott periodicity, $\widetilde{KU}^\ast(B...
Here is another obstruction. > > Suppose $M^n$ is a closed simply connected manifold which admits only trivial vector bundles. Then $M$ cannot be a $\mathbb{Z}/2\mathbb{Z}$-homology sphere, unless $n=3$. > > > I'm not sure if the hypothesis that $M$ is simply connected is necessary, but it's certainly necessary i...
43,502,432
I am writing tests for a simple REST service in GoLang. But, because I am using [julienschmidt/httprouter](https://github.com/julienschmidt/httprouter) as the routing library. I am struggling on how to write test. main.go ``` package main func main() { router := httprouter.New() bookController := controllers.N...
2017/04/19
[ "https://Stackoverflow.com/questions/43502432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4490615/" ]
Just spin up a new router for each test and then register the handler under test, then pass the test request to the router, not the handler, so that the router can parse the path parameters and pass them to the handler. ``` func TestGetBook(t *testing.T) { handler := controllers.NewBookController() router := h...
You need to wrap your handler so that it can be accessed as an `http.HandlerFunc`: ``` func TestGetBook(t *testing.T) { req, _ := http.NewRequest("GET", "/book/sampleid", nil) rr := httptest.NewRecorder() handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { controllers.NewBook...
43,502,432
I am writing tests for a simple REST service in GoLang. But, because I am using [julienschmidt/httprouter](https://github.com/julienschmidt/httprouter) as the routing library. I am struggling on how to write test. main.go ``` package main func main() { router := httprouter.New() bookController := controllers.N...
2017/04/19
[ "https://Stackoverflow.com/questions/43502432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4490615/" ]
Just spin up a new router for each test and then register the handler under test, then pass the test request to the router, not the handler, so that the router can parse the path parameters and pass them to the handler. ``` func TestGetBook(t *testing.T) { handler := controllers.NewBookController() router := h...
here is one more good blog and corresponding working code for this: > > <https://medium.com/@gauravsingharoy/build-your-first-api-server-with-httprouter-in-golang-732b7b01f6ab> > > > <https://github.com/gsingharoy/httprouter-tutorial/blob/master/part4/handlers_test.go> > > >
43,502,432
I am writing tests for a simple REST service in GoLang. But, because I am using [julienschmidt/httprouter](https://github.com/julienschmidt/httprouter) as the routing library. I am struggling on how to write test. main.go ``` package main func main() { router := httprouter.New() bookController := controllers.N...
2017/04/19
[ "https://Stackoverflow.com/questions/43502432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4490615/" ]
Just spin up a new router for each test and then register the handler under test, then pass the test request to the router, not the handler, so that the router can parse the path parameters and pass them to the handler. ``` func TestGetBook(t *testing.T) { handler := controllers.NewBookController() router := h...
u can try this without `ServeHTTP` ``` func TestGetBook(t *testing.T) { req := httptest.NewRequest("GET", "http://example.com/foo", nil) w := httptest.NewRecorder() controllers.NewBookController().GetBook(w, req, []httprouter.Param{{Key: "id", Value: "101"}}) resp := w.Result() body, _ := ioutil....
43,502,432
I am writing tests for a simple REST service in GoLang. But, because I am using [julienschmidt/httprouter](https://github.com/julienschmidt/httprouter) as the routing library. I am struggling on how to write test. main.go ``` package main func main() { router := httprouter.New() bookController := controllers.N...
2017/04/19
[ "https://Stackoverflow.com/questions/43502432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4490615/" ]
You need to wrap your handler so that it can be accessed as an `http.HandlerFunc`: ``` func TestGetBook(t *testing.T) { req, _ := http.NewRequest("GET", "/book/sampleid", nil) rr := httptest.NewRecorder() handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { controllers.NewBook...
here is one more good blog and corresponding working code for this: > > <https://medium.com/@gauravsingharoy/build-your-first-api-server-with-httprouter-in-golang-732b7b01f6ab> > > > <https://github.com/gsingharoy/httprouter-tutorial/blob/master/part4/handlers_test.go> > > >
43,502,432
I am writing tests for a simple REST service in GoLang. But, because I am using [julienschmidt/httprouter](https://github.com/julienschmidt/httprouter) as the routing library. I am struggling on how to write test. main.go ``` package main func main() { router := httprouter.New() bookController := controllers.N...
2017/04/19
[ "https://Stackoverflow.com/questions/43502432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4490615/" ]
You need to wrap your handler so that it can be accessed as an `http.HandlerFunc`: ``` func TestGetBook(t *testing.T) { req, _ := http.NewRequest("GET", "/book/sampleid", nil) rr := httptest.NewRecorder() handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { controllers.NewBook...
u can try this without `ServeHTTP` ``` func TestGetBook(t *testing.T) { req := httptest.NewRequest("GET", "http://example.com/foo", nil) w := httptest.NewRecorder() controllers.NewBookController().GetBook(w, req, []httprouter.Param{{Key: "id", Value: "101"}}) resp := w.Result() body, _ := ioutil....
43,502,432
I am writing tests for a simple REST service in GoLang. But, because I am using [julienschmidt/httprouter](https://github.com/julienschmidt/httprouter) as the routing library. I am struggling on how to write test. main.go ``` package main func main() { router := httprouter.New() bookController := controllers.N...
2017/04/19
[ "https://Stackoverflow.com/questions/43502432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4490615/" ]
u can try this without `ServeHTTP` ``` func TestGetBook(t *testing.T) { req := httptest.NewRequest("GET", "http://example.com/foo", nil) w := httptest.NewRecorder() controllers.NewBookController().GetBook(w, req, []httprouter.Param{{Key: "id", Value: "101"}}) resp := w.Result() body, _ := ioutil....
here is one more good blog and corresponding working code for this: > > <https://medium.com/@gauravsingharoy/build-your-first-api-server-with-httprouter-in-golang-732b7b01f6ab> > > > <https://github.com/gsingharoy/httprouter-tutorial/blob/master/part4/handlers_test.go> > > >
128,186
I would like to calculate the Riemann sum of $\sin(x)$. Fun starts here: $$R = \frac{\pi}{n} \sum\_{j=1}^n \sin\left(\frac{\pi}{n}\cdot j\right)$$ What would be the simplest way to calculate the sum of $\sin\left(\frac{\pi}{n}\cdot j\right)$, so that one could proceed to evaluating the limit and thus getting the valu...
2012/04/05
[ "https://math.stackexchange.com/questions/128186", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
There's a way to find an expression for the sum $$\sum\_{j = 1}^{n} \sin{(j \theta)}$$ by considering instead the geometric sum $$1 + z + z^2 + \cdots + z^n = \frac{z^{n+ 1} - 1}{z - 1} \quad \text{for $z \neq 1$}$$ in combination with Euler's formula by taking $ z = e^{i\theta} = \cos{\theta} + i \sin{\theta}$ and ...
Use $$ 2 \sin\left(\frac{\pi}{2 n} \right) \sin\left(\frac{\pi}{n} \cdot j \right) = \cos\left( \frac{\pi}{2n} (2j-1) \right) - \cos\left( \frac{\pi}{2n} (2j+1) \right) $$ Thus the sum telescopes $\sum\_{j=1}^n \left(g(j) - g(j+1) \right) = g(1) - g(n+1) $: $$ R\_n =\frac{\pi}{n} \sum\_{j=1}^n \sin\left(\frac{\pi}...
771,864
I have a laptop (with Windows 8 pre-installed) that has been through numerous dual-boot configurations. At one point, I had removed everything and ran Linux Mint as the only OS. Eventually, I decided to remove that and reinstall Windows 8. Upon doing so, I had a number of drivers to install/update in order to restore ...
2014/06/22
[ "https://superuser.com/questions/771864", "https://superuser.com", "https://superuser.com/users/293349/" ]
Windows (and many other operating systems) **requires** GPT to be able to boot on UEFI systems. And some UEFI systems automatically boot on legacy BIOS mode if it detects the HDD as "legacy" MBR (although technically it's a buggy implementation). So you must convert the disk to GPT. But gparted is very slow on disk op...
> > Since reinstalling Win8, I cannot boot into UEFI mode. Which is > ultimately, I think, affecting my wishes to dual-boot Ubuntu alongside > Windows again. > > > Any ideas as to how to fix this? > > > I had the same problem on an ASUS Q500A laptop. I was attempting to multi-boot Windows 8, Debian, Fedora and...
4,841,219
Is there a way to only print part of a string? For example, if I have ``` char *str = "hello there"; ``` Is there a way to just print `"hello"`, keeping in mind that the substring I want to print is variable length, not always 5 chars? I know that I could use a `for` loop and `putchar` or that I could copy the arr...
2011/01/30
[ "https://Stackoverflow.com/questions/4841219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/525814/" ]
Try this: ``` int length = 5; printf("%*.*s", length, length, "hello there"); ```
You can use [`strncpy`](http://www.opengroup.org/onlinepubs/000095399/functions/strncpy.html) to duplicate the part of your string you want to print, but you'd have to take care to add a null terminator, as `strncpy` won't do that if it doesn't encounter one in the source string. A better solution, as Jerry Coffin poin...
4,841,219
Is there a way to only print part of a string? For example, if I have ``` char *str = "hello there"; ``` Is there a way to just print `"hello"`, keeping in mind that the substring I want to print is variable length, not always 5 chars? I know that I could use a `for` loop and `putchar` or that I could copy the arr...
2011/01/30
[ "https://Stackoverflow.com/questions/4841219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/525814/" ]
Try this: ``` int length = 5; printf("%*.*s", length, length, "hello there"); ```
*printf* and friends work well when that's all you want to do with the partial string, but for a more general solution: ``` char *s2 = s + offset; char c = s2[length]; // Temporarily save character... s2[length] = '\0'; // ...that will be replaced by a NULL f(s2); // Now do whatever you want with the temporarily tr...
4,841,219
Is there a way to only print part of a string? For example, if I have ``` char *str = "hello there"; ``` Is there a way to just print `"hello"`, keeping in mind that the substring I want to print is variable length, not always 5 chars? I know that I could use a `for` loop and `putchar` or that I could copy the arr...
2011/01/30
[ "https://Stackoverflow.com/questions/4841219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/525814/" ]
This will work too: ``` fwrite(str, 1, len, stdout); ``` It will not have the overhead of parsing the format specifier. Obviously, to adjust the beginning of the substring, you can simply add the index to the pointer.
You can use [`strncpy`](http://www.opengroup.org/onlinepubs/000095399/functions/strncpy.html) to duplicate the part of your string you want to print, but you'd have to take care to add a null terminator, as `strncpy` won't do that if it doesn't encounter one in the source string. A better solution, as Jerry Coffin poin...
4,841,219
Is there a way to only print part of a string? For example, if I have ``` char *str = "hello there"; ``` Is there a way to just print `"hello"`, keeping in mind that the substring I want to print is variable length, not always 5 chars? I know that I could use a `for` loop and `putchar` or that I could copy the arr...
2011/01/30
[ "https://Stackoverflow.com/questions/4841219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/525814/" ]
This will work too: ``` fwrite(str, 1, len, stdout); ``` It will not have the overhead of parsing the format specifier. Obviously, to adjust the beginning of the substring, you can simply add the index to the pointer.
*printf* and friends work well when that's all you want to do with the partial string, but for a more general solution: ``` char *s2 = s + offset; char c = s2[length]; // Temporarily save character... s2[length] = '\0'; // ...that will be replaced by a NULL f(s2); // Now do whatever you want with the temporarily tr...
4,841,219
Is there a way to only print part of a string? For example, if I have ``` char *str = "hello there"; ``` Is there a way to just print `"hello"`, keeping in mind that the substring I want to print is variable length, not always 5 chars? I know that I could use a `for` loop and `putchar` or that I could copy the arr...
2011/01/30
[ "https://Stackoverflow.com/questions/4841219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/525814/" ]
You can use [`strncpy`](http://www.opengroup.org/onlinepubs/000095399/functions/strncpy.html) to duplicate the part of your string you want to print, but you'd have to take care to add a null terminator, as `strncpy` won't do that if it doesn't encounter one in the source string. A better solution, as Jerry Coffin poin...
*printf* and friends work well when that's all you want to do with the partial string, but for a more general solution: ``` char *s2 = s + offset; char c = s2[length]; // Temporarily save character... s2[length] = '\0'; // ...that will be replaced by a NULL f(s2); // Now do whatever you want with the temporarily tr...
117,902
Does anybody have experience creating languages for the world they are creating? I am world building for a comic, and I am by no means a linguist. If I could avoid making an entirely new language I would, but because the story is visually communicated through the pages of a comic book, readers will have to see writing ...
2018/07/11
[ "https://worldbuilding.stackexchange.com/questions/117902", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/50265/" ]
There are a number of paths you can take, some of which may be easier than others while others may not get you where you want to go. **Create Your Own Full Fledged Language!** Obviously, this is the way of worldbuilder cum glossopoet. Channel your inner Tolkien and make your own fully functional language complete with...
If you're not planning on using the language in the narrative, just in the background, you don't need to make a language, just design a few signs and labels. There's plenty of videogames and anime that do that. [![Ni No Kuni - Wrath of the White Witch](https://i.stack.imgur.com/YSQHn.jpg)](https://i.stack.imgur.com/YS...
117,902
Does anybody have experience creating languages for the world they are creating? I am world building for a comic, and I am by no means a linguist. If I could avoid making an entirely new language I would, but because the story is visually communicated through the pages of a comic book, readers will have to see writing ...
2018/07/11
[ "https://worldbuilding.stackexchange.com/questions/117902", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/50265/" ]
There are a number of paths you can take, some of which may be easier than others while others may not get you where you want to go. **Create Your Own Full Fledged Language!** Obviously, this is the way of worldbuilder cum glossopoet. Channel your inner Tolkien and make your own fully functional language complete with...
I've just started developing my own proto-languages to base my story's language development on. So take what I say with a pinch of salt. If all you want is a different looking alphabet but you don't want to create actual new words and meanings etc, AND you want some sort of consistency other than just squiggles. I wou...
117,902
Does anybody have experience creating languages for the world they are creating? I am world building for a comic, and I am by no means a linguist. If I could avoid making an entirely new language I would, but because the story is visually communicated through the pages of a comic book, readers will have to see writing ...
2018/07/11
[ "https://worldbuilding.stackexchange.com/questions/117902", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/50265/" ]
There are a number of paths you can take, some of which may be easier than others while others may not get you where you want to go. **Create Your Own Full Fledged Language!** Obviously, this is the way of worldbuilder cum glossopoet. Channel your inner Tolkien and make your own fully functional language complete with...
You could use **Amharic**. Benefits: 1: Region appropriate; supposedly Amharic is ancestral to Arabic and Hebrew. In an alternate timeline maybe it stayed. 2: Alphabet is unfamiliar looking to Western readers and I bet Arabic / Hebrew readers also. 3: It is in Google Translate which helps as regards making stuff up...
6,390,960
``` class Bus<T> { static Bus() { foreach(FieldInfo fi in typeof(T).GetFields()) { if(fi.FieldType == typeof(Argument)) { fi.SetValue(typeof(T), new Argument("busyname", "busyvalue")); } } } } class Buss : Bus<Buss> { public sta...
2011/06/17
[ "https://Stackoverflow.com/questions/6390960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/269061/" ]
The fact that this matters to you probably means that you are using static constructors wrong. With that in mind, you could make a static constructor in `Buss` that manually invokes the static constructor in `Bus`. Note that it's not possible to run a static constructor more than once.
[MSDN says](http://msdn.microsoft.com/en-us/library/aa645612%28v=vs.71%29.aspx) that 'Static constructors are not inherited'. I guess this is similar to static fields which are not inherited either.
6,390,960
``` class Bus<T> { static Bus() { foreach(FieldInfo fi in typeof(T).GetFields()) { if(fi.FieldType == typeof(Argument)) { fi.SetValue(typeof(T), new Argument("busyname", "busyvalue")); } } } } class Buss : Bus<Buss> { public sta...
2011/06/17
[ "https://Stackoverflow.com/questions/6390960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/269061/" ]
The fact that this matters to you probably means that you are using static constructors wrong. With that in mind, you could make a static constructor in `Buss` that manually invokes the static constructor in `Bus`. Note that it's not possible to run a static constructor more than once.
The static constructor of a generic type is invoked exactly once per `Type`, when that type is referenced. Calling `Buss x = new Buss()` will invoke the static constructor of `Bus<Buss>`. Calling `Bus<Buss> x = new Bus<Buss>()` will also invoke the static constructor of `Bus<Buss>`, but it will do so for it's type ar...
6,390,960
``` class Bus<T> { static Bus() { foreach(FieldInfo fi in typeof(T).GetFields()) { if(fi.FieldType == typeof(Argument)) { fi.SetValue(typeof(T), new Argument("busyname", "busyvalue")); } } } } class Buss : Bus<Buss> { public sta...
2011/06/17
[ "https://Stackoverflow.com/questions/6390960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/269061/" ]
The static constructor of a generic type is invoked exactly once per `Type`, when that type is referenced. Calling `Buss x = new Buss()` will invoke the static constructor of `Bus<Buss>`. Calling `Bus<Buss> x = new Bus<Buss>()` will also invoke the static constructor of `Bus<Buss>`, but it will do so for it's type ar...
[MSDN says](http://msdn.microsoft.com/en-us/library/aa645612%28v=vs.71%29.aspx) that 'Static constructors are not inherited'. I guess this is similar to static fields which are not inherited either.
28,781,377
I want to remove the subdomain from root path. I tried adding `:subdomain => false` to the `root` command in `routes.rb` file without success: when I enter manually a subdomain in the URL, the subdomain stays and will not be removed. Example: ``` my root is => lvh.me:3000 enter subdomain manually => xyz.lvh.me:3000 ...
2015/02/28
[ "https://Stackoverflow.com/questions/28781377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3831672/" ]
Use [Visual Studio Online](http://visualstudioonline.com) to manage your Project, it is free for up to 5 users and you can use Git as your version control. Then you just create a new Project and add your code. AFter this it is easy to commit and sync your work on both computers.
Either use the VS community version; there is also a cloud version, or it could be shared with dropbox or onedrive and many others.
28,781,377
I want to remove the subdomain from root path. I tried adding `:subdomain => false` to the `root` command in `routes.rb` file without success: when I enter manually a subdomain in the URL, the subdomain stays and will not be removed. Example: ``` my root is => lvh.me:3000 enter subdomain manually => xyz.lvh.me:3000 ...
2015/02/28
[ "https://Stackoverflow.com/questions/28781377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3831672/" ]
The best way is using version controlling system like Git
Either use the VS community version; there is also a cloud version, or it could be shared with dropbox or onedrive and many others.
28,781,377
I want to remove the subdomain from root path. I tried adding `:subdomain => false` to the `root` command in `routes.rb` file without success: when I enter manually a subdomain in the URL, the subdomain stays and will not be removed. Example: ``` my root is => lvh.me:3000 enter subdomain manually => xyz.lvh.me:3000 ...
2015/02/28
[ "https://Stackoverflow.com/questions/28781377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3831672/" ]
The best way is using version controlling system like Git
Use [Visual Studio Online](http://visualstudioonline.com) to manage your Project, it is free for up to 5 users and you can use Git as your version control. Then you just create a new Project and add your code. AFter this it is easy to commit and sync your work on both computers.
164,479
I am writing a simple program with a producer and a few consumers: the producer pushes to a queue some integers, and the consumers pop elements from the queue and print them (order doesn't matter). The queue code can be found below (the implementation is based on [this](https://juanchopanzacpp.wordpress.com/2013/02/26/...
2017/05/29
[ "https://codereview.stackexchange.com/questions/164479", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/139924/" ]
Let's start with `pop`. As many have noted, a `pop` that returns the value being removed from the collection can (will) cause problems unless copying (or moving) the value is guaranteed to be exception free. Unfortunately, the design used by the standard containers (use `front()` to retrieve the item, then `pop` to re...
There is no need to manually `unlock`. ``` void push(const T& item) { unique_lock<mutex> mlock(_mutex); _queue.push(item); mlock.unlock(); // This is not needed. _cv.notify_one(); } ``` Your pop is fine (apart from the `unlock()` as before). There are reason that most c++ queues separate...
164,479
I am writing a simple program with a producer and a few consumers: the producer pushes to a queue some integers, and the consumers pop elements from the queue and print them (order doesn't matter). The queue code can be found below (the implementation is based on [this](https://juanchopanzacpp.wordpress.com/2013/02/26/...
2017/05/29
[ "https://codereview.stackexchange.com/questions/164479", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/139924/" ]
The thing to remember is that C++ (as of C++11) has an "official" memory model, which defines what operations are legal and illegal according to the official spec. In particular, a program which contains a *data race* is not legal according to the official memory model. A *data race* is any occasion on which two differ...
There is no need to manually `unlock`. ``` void push(const T& item) { unique_lock<mutex> mlock(_mutex); _queue.push(item); mlock.unlock(); // This is not needed. _cv.notify_one(); } ``` Your pop is fine (apart from the `unlock()` as before). There are reason that most c++ queues separate...
164,479
I am writing a simple program with a producer and a few consumers: the producer pushes to a queue some integers, and the consumers pop elements from the queue and print them (order doesn't matter). The queue code can be found below (the implementation is based on [this](https://juanchopanzacpp.wordpress.com/2013/02/26/...
2017/05/29
[ "https://codereview.stackexchange.com/questions/164479", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/139924/" ]
Let's start with `pop`. As many have noted, a `pop` that returns the value being removed from the collection can (will) cause problems unless copying (or moving) the value is guaranteed to be exception free. Unfortunately, the design used by the standard containers (use `front()` to retrieve the item, then `pop` to re...
The thing to remember is that C++ (as of C++11) has an "official" memory model, which defines what operations are legal and illegal according to the official spec. In particular, a program which contains a *data race* is not legal according to the official memory model. A *data race* is any occasion on which two differ...
29,391,450
I recently had a comment in a code review: > > it's better to enumerate the fields explicitly. "select \*" doesn't > guarantee an order > > > Is that true in this case with a query like `select * from (select a,b,c ...)`? I can't imagine a database engine that would re-order the columns in the result, but then m...
2015/04/01
[ "https://Stackoverflow.com/questions/29391450", "https://Stackoverflow.com", "https://Stackoverflow.com/users/152580/" ]
The advice against `select *` is mainly for when you're querying tables directly. In some databases it's possible to insert a new column partway through a table, such that table `t (a, b)` becomes table `t (a, c, b)`. PostgreSQL does not (yet) support this, but it can still append columns, and it can drop columns from...
The columns are always in the order defined in the table. However the rows aren't always fetched in the same order if no order by clause is included.
71,873,058
I am calling an API from external source and want to do the registration based on given API. I have few problem: I would like to get the data and pass it to my view registration, but I am getting Undefined index:country. i know where I did wrong but I couldnt find the solution. in this method, I should declare my $cou...
2022/04/14
[ "https://Stackoverflow.com/questions/71873058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10438190/" ]
I would convert everything to a string and then use some built-in methods: ``` def check(lst, n): lst = ''.join(map(str, lst)) n = str(n) pos = 0 for ch in lst: if pos < len(n) and ch == n[pos]: pos += 1 return pos == len(n) ``` Another very smart option using iterators: ``` ...
You could convert the integer to a string, then to a list. Then for each element in the new list, check if it is in the number list. If it is, remove the element from both lists, removing just the element in the input number, and removing the element and every element before it on the list. Repeat for every element in ...
71,873,058
I am calling an API from external source and want to do the registration based on given API. I have few problem: I would like to get the data and pass it to my view registration, but I am getting Undefined index:country. i know where I did wrong but I couldnt find the solution. in this method, I should declare my $cou...
2022/04/14
[ "https://Stackoverflow.com/questions/71873058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10438190/" ]
I would convert everything to a string and then use some built-in methods: ``` def check(lst, n): lst = ''.join(map(str, lst)) n = str(n) pos = 0 for ch in lst: if pos < len(n) and ch == n[pos]: pos += 1 return pos == len(n) ``` Another very smart option using iterators: ``` ...
How about taking your input value (num), and converting it into a list of digits? For example, making the number '123' into an array, [1,2,3]. Then check the first member of the array, 1, to see if its in your list '1st'? If it isn't, you fail. If it is, you take note of where in the list '1st' the number one is found,...
71,873,058
I am calling an API from external source and want to do the registration based on given API. I have few problem: I would like to get the data and pass it to my view registration, but I am getting Undefined index:country. i know where I did wrong but I couldnt find the solution. in this method, I should declare my $cou...
2022/04/14
[ "https://Stackoverflow.com/questions/71873058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10438190/" ]
I would convert everything to a string and then use some built-in methods: ``` def check(lst, n): lst = ''.join(map(str, lst)) n = str(n) pos = 0 for ch in lst: if pos < len(n) and ch == n[pos]: pos += 1 return pos == len(n) ``` Another very smart option using iterators: ``` ...
I think this code helps you. ```py lst = [1,2,3,1,5,7,8,8,0] def check(num): try: letter_index = [lst.index(int(a)) for a in str(num)] except ValueError: # if value not in list return False return False result = False greater = letter_index[0] for i in letter_index: if i>=gr...
71,873,058
I am calling an API from external source and want to do the registration based on given API. I have few problem: I would like to get the data and pass it to my view registration, but I am getting Undefined index:country. i know where I did wrong but I couldnt find the solution. in this method, I should declare my $cou...
2022/04/14
[ "https://Stackoverflow.com/questions/71873058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10438190/" ]
I would convert everything to a string and then use some built-in methods: ``` def check(lst, n): lst = ''.join(map(str, lst)) n = str(n) pos = 0 for ch in lst: if pos < len(n) and ch == n[pos]: pos += 1 return pos == len(n) ``` Another very smart option using iterators: ``` ...
You can convert your list into string then find substring in that string like that: ```py lst = [1,2,3,1,5,7,8,8,0] list_as_string = ''.join(str(e) for e in lst) lst_lenght = len(lst) num1 = 0 num2 = 0 index = 0 max_index = 0 flag = True while (flag == True): num = int(input('\nEnter Positive integer (0 to stop):...
71,873,058
I am calling an API from external source and want to do the registration based on given API. I have few problem: I would like to get the data and pass it to my view registration, but I am getting Undefined index:country. i know where I did wrong but I couldnt find the solution. in this method, I should declare my $cou...
2022/04/14
[ "https://Stackoverflow.com/questions/71873058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10438190/" ]
I would convert everything to a string and then use some built-in methods: ``` def check(lst, n): lst = ''.join(map(str, lst)) n = str(n) pos = 0 for ch in lst: if pos < len(n) and ch == n[pos]: pos += 1 return pos == len(n) ``` Another very smart option using iterators: ``` ...
A couple of other options (besides the already great answers): --- Compare lists: You convert your string number to a list and then check if it's in your starting list of numbers. As they are found, you pop the value from the starting list into a new list. Then check your new list at the end to see if it matches you...
38,361,940
I need to get typescript to stop complaining about my code. It runs fine in the browser but fullscreen api are not official yet so typescript definitions aren't up to date. I am calling document.documentElement.msRequestFullscreen. This causes type error: ``` Property 'msRequestFullscreen' does not exist on type 'HTM...
2016/07/13
[ "https://Stackoverflow.com/questions/38361940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5376813/" ]
I'm using newer version of Typescript and I faced the same problem. I tried the solution above and it didn't work - it seemed that I was masking the existing interface. To be able to extend correctly both interfaces, I had to use a declare global: ``` declare global { interface Document { msExitFullscre...
You can't override existing properties of an existing interface, only add new ones. Based on the MDN [Using fullscreen mode](https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API) and [Element documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element) you need to have: ``` Element.requestFulls...
50,287,558
I want to use join with 3 dataframe, but there are some columns we don't need or have some duplicate name with other dataframes, so I want to drop some columns like below: ```py result_df = (aa_df.join(bb_df, 'id', 'left') .join(cc_df, 'id', 'left') .withColumnRenamed(bb_df.status, 'user_status')) ``` Please not...
2018/05/11
[ "https://Stackoverflow.com/questions/50287558", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9172344/" ]
If you are trying to rename the `status` column of `bb_df` dataframe then you can do so while joining as ``` result_df = aa_df.join(bb_df.withColumnRenamed('status', 'user_status'),'id', 'left').join(cc_df, 'id', 'left') ```
Please see the docs : [withColumnRenamed()](http://spark.apache.org/docs/2.2.0/api/python/pyspark.sql.html#pyspark.sql.DataFrame.withColumnRenamed) You need to pass the name of the existing column and the new name to the function. Both of these should be strings. ``` result_df = aa_df.join(bb_df,'id', 'left').join(cc_...
50,287,558
I want to use join with 3 dataframe, but there are some columns we don't need or have some duplicate name with other dataframes, so I want to drop some columns like below: ```py result_df = (aa_df.join(bb_df, 'id', 'left') .join(cc_df, 'id', 'left') .withColumnRenamed(bb_df.status, 'user_status')) ``` Please not...
2018/05/11
[ "https://Stackoverflow.com/questions/50287558", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9172344/" ]
> > I want to use join with 3 dataframe, but there are some columns we don't need or have some duplicate name with other dataframes > > > That's a fine use case for aliasing a Dataset using `alias` or `as` operators. > > **alias(alias: String): Dataset[T]** or **alias(alias: Symbol): Dataset[T]** > Returns a new...
Please see the docs : [withColumnRenamed()](http://spark.apache.org/docs/2.2.0/api/python/pyspark.sql.html#pyspark.sql.DataFrame.withColumnRenamed) You need to pass the name of the existing column and the new name to the function. Both of these should be strings. ``` result_df = aa_df.join(bb_df,'id', 'left').join(cc_...
50,287,558
I want to use join with 3 dataframe, but there are some columns we don't need or have some duplicate name with other dataframes, so I want to drop some columns like below: ```py result_df = (aa_df.join(bb_df, 'id', 'left') .join(cc_df, 'id', 'left') .withColumnRenamed(bb_df.status, 'user_status')) ``` Please not...
2018/05/11
[ "https://Stackoverflow.com/questions/50287558", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9172344/" ]
If you are trying to rename the `status` column of `bb_df` dataframe then you can do so while joining as ``` result_df = aa_df.join(bb_df.withColumnRenamed('status', 'user_status'),'id', 'left').join(cc_df, 'id', 'left') ```
> > I want to use join with 3 dataframe, but there are some columns we don't need or have some duplicate name with other dataframes > > > That's a fine use case for aliasing a Dataset using `alias` or `as` operators. > > **alias(alias: String): Dataset[T]** or **alias(alias: Symbol): Dataset[T]** > Returns a new...
48,214,751
Intro ===== I'm currently using the UPS Rate API to create a shipping plugin for a client to get an estimate on shipping charges for customers during checkout (among other things). I've briefly used Nodejs in the past, however this would be my first time using it in a production environment, and I want to ensure I'm ...
2018/01/11
[ "https://Stackoverflow.com/questions/48214751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3026356/" ]
Don't overthink this with unnecessary programming paradigms. According to your comment this is a simple creation of an object whose structure never changes. Treat it as such. If your task is to create a Javascript Object from values and send it in a POST request, simply create a Javascript Object with the short notat...
The first thing to use best practice is to use object literals instead of polluting global namespace ``` `const anyObject = { // your object }` ``` the second thing is to use functional programming techniques ``` `function( anyObject, argsToDo) { // do what every you want to anyObject with other functions // anyObj...
31,547,439
How can i prevent slidedown and slide up of a sub menu at the same time?My navigation has a menu and one of the menus has sub menu.When i click On the menu which has sub menu , The sub menu opens,closes about 2 times and finally closes but there was only one click.It happens in mobile devices.SO take a look at my codes...
2015/07/21
[ "https://Stackoverflow.com/questions/31547439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4740633/" ]
Output is null because `getNodeValue` is not applicable here. `getTextContent` would give you the text between the start and end tags, e.g. FOOBAR in this example: ``` <Product pantone="100" blue="7.4" red="35" green="24">FOOBAR</Product>`. ``` However if you want to print all attribute values for your resultset: `...
I'm no expert with xpath (literally learned about it today) so I am not 100% certain about this, but you have `/inventory/product/pantone/text(@=100)`, instead try this: ``` /inventory/Product[@pantone='100'] ``` As I understand it, this will match the `Product` with the attribute `pantone` that equals `"100"`. As ...
47,331
We had a party at my former school canteen yesterday night. While I was enjoying the food, I could feel that someone had been staring at me. Later, when he tried to get close to me, I said "Go away". I don't know him, but thinking that he might be a student of my former school, so I just politely kept telling ...
2015/01/20
[ "https://ell.stackexchange.com/questions/47331", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/13998/" ]
> > "Please excuse me, I would like to be left alone." > > > It's polite, firm, and if he responds "why?" you could say: > > "I don't feel comfortable around you. Please leave." > > >
The polite thing would be to make an excuse to not be in the persons company and if it got really out of hand to ask them to leave because they are bothering you. If "Go away" is your starting point then you can pretty much say anything that isn't outright nasty and its a step in the right direction. With a stalker th...