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 |
|---|---|---|---|---|---|
20,500,203 | Hi Having a syntax issue - at least I think it is. I want a default date as part of a case statement inside a materialised view (MS SQL 2008 +):
```
, CASE
WHEN WithFirstDate = 0 THEN CONVERT(DATE,'1900-JAN-1', 101)
WHEN WithFirstDate = 1 THEN
Start1
ELSE --WithFirstDate = 2
Start2
EN... | 2013/12/10 | [
"https://Stackoverflow.com/questions/20500203",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2711068/"
] | Instead of:
```
CONVERT(DATE,'1900-JAN-1', 101)
```
Just do:
```
CONVERT(DATE,'1900-01-01')
```
However the issue may be with the other two columns, `Start1` and `Start2`. I am guessing these are not `DATE` columns. | The 101 code you are passing the CONVERT function does not match your format. Check the following link to find the correct code:
<http://msdn.microsoft.com/en-us/library/ms187928.aspx> |
20,500,203 | Hi Having a syntax issue - at least I think it is. I want a default date as part of a case statement inside a materialised view (MS SQL 2008 +):
```
, CASE
WHEN WithFirstDate = 0 THEN CONVERT(DATE,'1900-JAN-1', 101)
WHEN WithFirstDate = 1 THEN
Start1
ELSE --WithFirstDate = 2
Start2
EN... | 2013/12/10 | [
"https://Stackoverflow.com/questions/20500203",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2711068/"
] | The 101 code you are passing the CONVERT function does not match your format. Check the following link to find the correct code:
<http://msdn.microsoft.com/en-us/library/ms187928.aspx> | Ok well this forum has gone downhill IMHO, first my post get endless edited for grammar which doesn't change the meaning, then it gets voted down presumably because it was "to difficult" to answer. <https://stackoverflow.com/users/61305/aaron-bertrand> was on the right lines. Thanks Aaron. The problem was a computed co... |
20,500,203 | Hi Having a syntax issue - at least I think it is. I want a default date as part of a case statement inside a materialised view (MS SQL 2008 +):
```
, CASE
WHEN WithFirstDate = 0 THEN CONVERT(DATE,'1900-JAN-1', 101)
WHEN WithFirstDate = 1 THEN
Start1
ELSE --WithFirstDate = 2
Start2
EN... | 2013/12/10 | [
"https://Stackoverflow.com/questions/20500203",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2711068/"
] | Instead of:
```
CONVERT(DATE,'1900-JAN-1', 101)
```
Just do:
```
CONVERT(DATE,'1900-01-01')
```
However the issue may be with the other two columns, `Start1` and `Start2`. I am guessing these are not `DATE` columns. | Ok well this forum has gone downhill IMHO, first my post get endless edited for grammar which doesn't change the meaning, then it gets voted down presumably because it was "to difficult" to answer. <https://stackoverflow.com/users/61305/aaron-bertrand> was on the right lines. Thanks Aaron. The problem was a computed co... |
2,861,080 | I'm writing a RIM BlackBerry client app. BlackBerry uses a simplified version of Java (no generics, no annotations, limited collections support, etc.; roughly a Java 1.3 dialect). My client will be speaking JSON to a server. We have a bunch of JAXB-generated POJOs, but they're heavily annotated, and they use various cl... | 2010/05/18 | [
"https://Stackoverflow.com/questions/2861080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/344467/"
] | For the first part good luck but I really don't think you're going to find a better solution than to modify the code yourself. However, there is a good J2ME JSON library you can find a link to the mirror [here](https://stackoverflow.com/questions/2618075/blackberry-jde-json-parsing). | I ended up using [apt (annotation processing tool)](http://java.sun.com/j2se/1.5.0/docs/guide/apt/GettingStarted.html) to run over the 1.5 sources and emit new 1.3-friendly source. Actually turned out to be a pretty nice solution!
I still haven't figured out an elegant way to do the actual JSON marshalling, but the ap... |
33,445,914 | I'm in a place I get to too often with AWS. I'm figuring out how to use the worker app in Elastic Beanstalk. I have an express app set up to listen to a post. I put a message into my SQL queue. I get something in node, as I can trigger a message. But I have not idea how to get at the payload. As usual, I seem to be lef... | 2015/10/30 | [
"https://Stackoverflow.com/questions/33445914",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1598603/"
] | Setup and configure the body-parser module:
`var bodyParser = require('body-parser');
app.use(bodyParser.json());`
then your payload will be available within your function:
`var payload = request.body;` | ```
var bodyParser = require('body-parser');
app.use(bodyParser.json());
``` |
26,779,284 | I need to set validation for number of alphabets in the text box without including white space can anyone suggest me with a regular expression | 2014/11/06 | [
"https://Stackoverflow.com/questions/26779284",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4222812/"
] | This is a shot in the dark, but assuming you want to allow only letters and whitespace in your textbox, and the total number of letters must not exceed 10, then use
```
^\s*(?:[a-z]\s*){0,10}$
```
Test it [live on regex101.com](http://regex101.com/r/bX2qH0/1).
**Explanation:**
```none
^ # Start of string
\s*... | Simple and sweet answer :) . (assuming s is the string).
```
System.out.println(s.split("\\s+").length);
```
this will printout the number of all the words(including if sentence contains numbers)
a quick way of gettin the total number of Alphabet here is a quick and dirty way.(doesn't use Reg Ex)
```
int counter=0... |
26,779,284 | I need to set validation for number of alphabets in the text box without including white space can anyone suggest me with a regular expression | 2014/11/06 | [
"https://Stackoverflow.com/questions/26779284",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4222812/"
] | This is a shot in the dark, but assuming you want to allow only letters and whitespace in your textbox, and the total number of letters must not exceed 10, then use
```
^\s*(?:[a-z]\s*){0,10}$
```
Test it [live on regex101.com](http://regex101.com/r/bX2qH0/1).
**Explanation:**
```none
^ # Start of string
\s*... | ```
var str = 'mlsqkf qsq merzo';
var n = str.replace(/[^a-z]/gi,'').length;
```
[demo](http://jsfiddle.net/e8y2na1s/1/) |
48,835,617 | I have a data set of hospital visits and I need to tally utilization of emergency room visits that happened in a certain time frame. The code below mimics what my dataset looks like. The hospital account is a unique number for that encounter and the MRN number is unique to the patient. One patient can have many hospita... | 2018/02/16 | [
"https://Stackoverflow.com/questions/48835617",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8837764/"
] | The `-Confirm` switch is set to false by default so you omit it. You may see the confirmation dialog due to an existing file. You can bypass it by adding the `-force` switch.
---
Okay, So since you don't want to overwrite the files you could do something like this:
```
$existingFiles = Get-childitem $officeFolder | ... | The confirm flag is what you are looking for [here](https://learn.microsoft.com/en-us/powershell/module/azure.storage/get-azurestorageblobcontent?view=azurermps-5.3.0)
It defaults to false, but you are probably confusing it by over |
16,130 | I found many readings on `Non rigid registration`, also saw some videos but didn't find a clear explanation anywhere.
What I understood is the following
**Rigid Registration:** It is the alignment of two point clouds without changing the shape (ie only by rotation and translation). ICP algorithm is used. The closest ... | 2014/05/09 | [
"https://dsp.stackexchange.com/questions/16130",
"https://dsp.stackexchange.com",
"https://dsp.stackexchange.com/users/8849/"
] | I have found this survey paper very useful:
<http://ralph.cs.cf.ac.uk/papers/Geometry/Registration.pdf>
It gives a categorized overview of the field. I think section 3 and 4 are the most relevant ones for you. | Registration is the recovery of a spatial transform that applies one data set (can be a point cloud) onto another. The spatial transform can include rigid motion (no deformation) and deformation; in the case of piecewise rigid deformation, the system is a mechanism, i.e. a number of rigid parts having different motions... |
12,488,198 | >
> **Possible Duplicate:**
>
> [Headers already sent by PHP](https://stackoverflow.com/questions/8028957/headers-already-sent-by-php)
>
>
>
I'm having issues with a login form for my website. At the top of the `login.php` form I have this
```
<?php
if (isset($_SESSION['username'])){
header("Location: http:/... | 2012/09/19 | [
"https://Stackoverflow.com/questions/12488198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1681948/"
] | If header.php has your session\_start() call, it needs to be right at the top of the file. As it is, I expect that you're getting the "Headers already sent" message because there's a linebreak in your code, after the dbconnect include.
When you use session\_start, it's best to put it right at the top of every file tha... | try placing this at the top of your page:
```
<? ob_start(); ?>
```
then at the bottom of the page place this line of code:
```
<? ob_flush(); ?>
``` |
20,351 | I want to define epics for the following project: "a mobile application which makes you discover a city through a detective game".
The game basically needs to display your position on a map to get you from one key point to another; when you arrive at a key point, you have to solve some kind of riddle to unlock the nex... | 2016/10/19 | [
"https://pm.stackexchange.com/questions/20351",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/26307/"
] | Since you've marked your question as Scrum, my advice to you is to have your Product Owner *talk to the stakeholders*. Both the ones sponsoring the project (in your case, the teacher), and the ones who (hypothetically or otherwise) would actually *use* the system. If you don't have any users, go out and find some! Inte... | I'm yet to see a clear standard on what epics are. However, in real-life situations, epics are often used to define a macro requirement that is too big to fit into a sprint and delivered as a single user story.
From this standpoint, your four entries look good. For example, the *As a user, I want to be able to know wh... |
20,351 | I want to define epics for the following project: "a mobile application which makes you discover a city through a detective game".
The game basically needs to display your position on a map to get you from one key point to another; when you arrive at a key point, you have to solve some kind of riddle to unlock the nex... | 2016/10/19 | [
"https://pm.stackexchange.com/questions/20351",
"https://pm.stackexchange.com",
"https://pm.stackexchange.com/users/26307/"
] | Since you've marked your question as Scrum, my advice to you is to have your Product Owner *talk to the stakeholders*. Both the ones sponsoring the project (in your case, the teacher), and the ones who (hypothetically or otherwise) would actually *use* the system. If you don't have any users, go out and find some! Inte... | **How do you interpret the term *epic*?**
As others have mentioned, you don't have epics, you have user stories. It's all in the name: *user story*, which quite literally means the *story* of the *user*. You can think of an epic, on the other hand, as a collection of user stories under a particular context. The Scrum ... |
18,679,694 | I was trying to do a simple chronometer, while Excel was doing some procedures.
Something to the user get looking, showing that excel was working.
I tried to use Time, Date and Timer functions. But the three options made Excel stop responding after 10 seconds. I use 2010 version .
Some code like this:
```
Sub Stop... | 2013/09/08 | [
"https://Stackoverflow.com/questions/18679694",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2743942/"
] | One of your log says:
```
2013-09-08T01:15:34.427477+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
```
To solve this, use the following for port number:
```
var port_number = server.listen(process.env.PORT || 3000);
app.listen(port_number);
```
He... | Maybe your wrong listen port?
Check your app port,look up if there is set to `process.env.PORT || 3000`. |
18,679,694 | I was trying to do a simple chronometer, while Excel was doing some procedures.
Something to the user get looking, showing that excel was working.
I tried to use Time, Date and Timer functions. But the three options made Excel stop responding after 10 seconds. I use 2010 version .
Some code like this:
```
Sub Stop... | 2013/09/08 | [
"https://Stackoverflow.com/questions/18679694",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2743942/"
] | Maybe your wrong listen port?
Check your app port,look up if there is set to `process.env.PORT || 3000`. | Listening to 127.0.0.1 leads to the **code=H20 desc="App boot timeout"** problem for us. Changing the **listening address to 0.0.0.0** solves the problem.
Also, don't use your own port, but instead **use the environment variable PORT** , which is passed to your app environment variables by heroku. Otherwise, you'll al... |
18,679,694 | I was trying to do a simple chronometer, while Excel was doing some procedures.
Something to the user get looking, showing that excel was working.
I tried to use Time, Date and Timer functions. But the three options made Excel stop responding after 10 seconds. I use 2010 version .
Some code like this:
```
Sub Stop... | 2013/09/08 | [
"https://Stackoverflow.com/questions/18679694",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2743942/"
] | One of your log says:
```
2013-09-08T01:15:34.427477+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
```
To solve this, use the following for port number:
```
var port_number = server.listen(process.env.PORT || 3000);
app.listen(port_number);
```
He... | I get this error when i write wrong command in the package.json :
i wrote :
```
"scripts" : {
"start": "index.js"
}
```
instead of :
```
"scripts" : {
"start": "node index.js"
}
```
when i wrote node index.js I'm all set. |
18,679,694 | I was trying to do a simple chronometer, while Excel was doing some procedures.
Something to the user get looking, showing that excel was working.
I tried to use Time, Date and Timer functions. But the three options made Excel stop responding after 10 seconds. I use 2010 version .
Some code like this:
```
Sub Stop... | 2013/09/08 | [
"https://Stackoverflow.com/questions/18679694",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2743942/"
] | One of your log says:
```
2013-09-08T01:15:34.427477+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
```
To solve this, use the following for port number:
```
var port_number = server.listen(process.env.PORT || 3000);
app.listen(port_number);
```
He... | Listening to 127.0.0.1 leads to the **code=H20 desc="App boot timeout"** problem for us. Changing the **listening address to 0.0.0.0** solves the problem.
Also, don't use your own port, but instead **use the environment variable PORT** , which is passed to your app environment variables by heroku. Otherwise, you'll al... |
18,679,694 | I was trying to do a simple chronometer, while Excel was doing some procedures.
Something to the user get looking, showing that excel was working.
I tried to use Time, Date and Timer functions. But the three options made Excel stop responding after 10 seconds. I use 2010 version .
Some code like this:
```
Sub Stop... | 2013/09/08 | [
"https://Stackoverflow.com/questions/18679694",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2743942/"
] | I get this error when i write wrong command in the package.json :
i wrote :
```
"scripts" : {
"start": "index.js"
}
```
instead of :
```
"scripts" : {
"start": "node index.js"
}
```
when i wrote node index.js I'm all set. | Listening to 127.0.0.1 leads to the **code=H20 desc="App boot timeout"** problem for us. Changing the **listening address to 0.0.0.0** solves the problem.
Also, don't use your own port, but instead **use the environment variable PORT** , which is passed to your app environment variables by heroku. Otherwise, you'll al... |
66,163,805 | A mysterious message comes up in the following scenario:
Cannot locate resource 'styles/buttonstyles.xaml'
This message only appears in design mode, and cannot be get ridden of. If I rebuild the solution the error message disappears, until I open the ApplicationWindow.xaml.
The environment is the following:
MainWind... | 2021/02/11 | [
"https://Stackoverflow.com/questions/66163805",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6649526/"
] | >
> I'd be curious to know if there's a way to define a lens that points to more than one value.
>
>
>
The intuition we should have for a "lens" is that it "focuses" on a particular part of a data structure. So really, no. A lens is all about working with something specific. (But see the update below that demonstr... | What I've Learned So Far
------------------------
This is probably not a geat idea. The problem is that lenses need to have certain properties to work. One of those properties is this:
>
> **view(lens, set(lens, a, store)) ≡ a** — If you set a value into the store, and immediately view the value through the lens, yo... |
11,138,534 | I am using the Runtime class to execute a piece of installation of a software. However, its not working, meaning that, after I fire the job (which is created using the Runtime class), after sometime (which is very soon) the installation job just exits. I think the problem is that the main thread must be finishing up an... | 2012/06/21 | [
"https://Stackoverflow.com/questions/11138534",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/530340/"
] | You might want to check out the java.lang.Process class. You probably want something like this:
```
Process process = Runtime.getRuntime().exec(cmd);
process.waitFor();
```
The subprocess may be receiving a SIGHUP and exiting.
EDIT:
In context, something like this, I would think:
```
try
{... | This is just a wild guess, but I think to program quit's because you have a error in your code(logical) maybe a while loop that exits to soon,
try to look good at the code that the Runtime executes.
The process is probably in a deadlock. The solution is in the comments, with a sample. |
11,138,534 | I am using the Runtime class to execute a piece of installation of a software. However, its not working, meaning that, after I fire the job (which is created using the Runtime class), after sometime (which is very soon) the installation job just exits. I think the problem is that the main thread must be finishing up an... | 2012/06/21 | [
"https://Stackoverflow.com/questions/11138534",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/530340/"
] | The process created is a *child* process for the main thread. If the main thread finishes, the process will be killed, similar to if you executed a command manually and pressed `ctrl``c` or closed the window. | This is just a wild guess, but I think to program quit's because you have a error in your code(logical) maybe a while loop that exits to soon,
try to look good at the code that the Runtime executes.
The process is probably in a deadlock. The solution is in the comments, with a sample. |
11,138,534 | I am using the Runtime class to execute a piece of installation of a software. However, its not working, meaning that, after I fire the job (which is created using the Runtime class), after sometime (which is very soon) the installation job just exits. I think the problem is that the main thread must be finishing up an... | 2012/06/21 | [
"https://Stackoverflow.com/questions/11138534",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/530340/"
] | You might want to check out the java.lang.Process class. You probably want something like this:
```
Process process = Runtime.getRuntime().exec(cmd);
process.waitFor();
```
The subprocess may be receiving a SIGHUP and exiting.
EDIT:
In context, something like this, I would think:
```
try
{... | The process created is a *child* process for the main thread. If the main thread finishes, the process will be killed, similar to if you executed a command manually and pressed `ctrl``c` or closed the window. |
35,290,716 | This route works fine:
```
router.post('/addlog', multipartMiddleware, function(req,res){
controller.postLog(req,res);
});
```
but if I change the call like this:
```
router.post('/addlog', multipartMiddleware, controller.postLog(req,res));
```
node complains about `ReferenceError: req is not defined`. The con... | 2016/02/09 | [
"https://Stackoverflow.com/questions/35290716",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/433670/"
] | Using base R:
```
> sub("\\D*(\\d+)to.*", "\\1", x) # start values
#[1] "10" "13" "16" "19"
> sub(".*to(\\d+).*", "\\1", x) # end values
#[1] "14" "17" "20" "24"
```
Sample input:
```
x <- c("Fr. 10to14 - data.csv", "Fr. 13to17 - data.csv", "Fr. 16to20 - data.csv", "Fr. 19to24 - data.csv")
```
This approach ... | We can use `str_extract_all`
```
library(stringr)
lst <- lapply(str_extract_all(filenames, '\\d+'), as.numeric)
do.call(rbind, lst)
# [,1] [,2]
#[1,] 10 14
#[2,] 13 17
#[3,] 16 20
#[4,] 19 24
```
The first column would be 'start' and the second 'end'
If we want it to be more specific i.e. even ... |
62,299,229 | * I am curently trying to implement a test for push notifications but I am facing some troubles with the handling system.
My e2e test looks like this:
```
```
it('Init from push notification', async () => {
await device.launchApp({newInstance: true, userNotification: userNotificationPushTrigger});
await expec... | 2020/06/10 | [
"https://Stackoverflow.com/questions/62299229",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11889689/"
] | You need to connect the native part of your application to send notifications to RN. On the iOS example, we don't handle notifications in RN at all. You can see this here: <https://github.com/wix/Detox/blob/c8f4b28599358e465fb326810453a28bb4509a22/detox/test/ios/example/AppDelegate.m#L203>
You can implement a similar ... | I think the detox documentation could do with some clarity around what information is required in the various fields - e.g. category and action-identifier
I'm trying to test an app which works with real notifications. The system notification is being triggered but it doesn't link to the RN app. The RN app does have di... |
25,903,354 | The task is:
>
> The output should look like this (it is a good idea to echo back the input): You entered 500,000 seconds, which is 5 days, 18 hours, 53 minutes and 20 seconds. (5 days 18:53:20 hours)
>
>
>
How should I do it? What is the easiest way to understand and do it?
Also the instructor said "no hard cod... | 2014/09/18 | [
"https://Stackoverflow.com/questions/25903354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4052677/"
] | With basic Java arithmetic calculations:
First consider the following values:
```none
1 minute = 60 seconds
1 hour = 3600 seconds (60 * 60)
1 day = 86400 second (24 * 3600)
```
1. First divide the input by 86400. If you you can get a number greater than 0, this is the number of days.
2. Again divide the remained nu... | Have a look at the class:
```
org.joda.time.DateTime
```
This allows you to do things like:
```
old = new DateTime();
new = old.plusSeconds(500000);
System.out.println("Hours: " + (new.Hours() - old.Hours()));
```
However, your solution probably can be simpler:
You need to work out how many seconds in a day, div... |
25,903,354 | The task is:
>
> The output should look like this (it is a good idea to echo back the input): You entered 500,000 seconds, which is 5 days, 18 hours, 53 minutes and 20 seconds. (5 days 18:53:20 hours)
>
>
>
How should I do it? What is the easiest way to understand and do it?
Also the instructor said "no hard cod... | 2014/09/18 | [
"https://Stackoverflow.com/questions/25903354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4052677/"
] | With basic Java arithmetic calculations:
First consider the following values:
```none
1 minute = 60 seconds
1 hour = 3600 seconds (60 * 60)
1 day = 86400 second (24 * 3600)
```
1. First divide the input by 86400. If you you can get a number greater than 0, this is the number of days.
2. Again divide the remained nu... | You can use the Java enum [`TimeUnit`](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/TimeUnit.html) to perform your math and avoid any hard-coded values. Then we can use [`String.format(String, Object...)`](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#format%28java.lang.String,%20java.... |
25,903,354 | The task is:
>
> The output should look like this (it is a good idea to echo back the input): You entered 500,000 seconds, which is 5 days, 18 hours, 53 minutes and 20 seconds. (5 days 18:53:20 hours)
>
>
>
How should I do it? What is the easiest way to understand and do it?
Also the instructor said "no hard cod... | 2014/09/18 | [
"https://Stackoverflow.com/questions/25903354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4052677/"
] | An example using the built-in `[TimeUnit](https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/TimeUnit.html)`.
```
long uptime = System.currentTimeMillis();
long days = TimeUnit.MILLISECONDS
.toDays(uptime);
uptime -= TimeUnit.DAYS.toMillis(days);
long hours = TimeUnit.MILLISECONDS
.toHours(uptime... | With basic Java arithmetic calculations:
First consider the following values:
```none
1 minute = 60 seconds
1 hour = 3600 seconds (60 * 60)
1 day = 86400 second (24 * 3600)
```
1. First divide the input by 86400. If you you can get a number greater than 0, this is the number of days.
2. Again divide the remained nu... |
25,903,354 | The task is:
>
> The output should look like this (it is a good idea to echo back the input): You entered 500,000 seconds, which is 5 days, 18 hours, 53 minutes and 20 seconds. (5 days 18:53:20 hours)
>
>
>
How should I do it? What is the easiest way to understand and do it?
Also the instructor said "no hard cod... | 2014/09/18 | [
"https://Stackoverflow.com/questions/25903354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4052677/"
] | An example using the built-in `[TimeUnit](https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/TimeUnit.html)`.
```
long uptime = System.currentTimeMillis();
long days = TimeUnit.MILLISECONDS
.toDays(uptime);
uptime -= TimeUnit.DAYS.toMillis(days);
long hours = TimeUnit.MILLISECONDS
.toHours(uptime... | It should be like:
```
public static void calculateTime(long seconds) {
int day = (int)TimeUnit.SECONDS.toDays(seconds);
long hours = TimeUnit.SECONDS.toHours(seconds) - (day *24);
long minute = TimeUnit.SECONDS.toMinutes(seconds) -
(TimeUnit.SECONDS.toHours(seconds)* 60);
long seco... |
25,903,354 | The task is:
>
> The output should look like this (it is a good idea to echo back the input): You entered 500,000 seconds, which is 5 days, 18 hours, 53 minutes and 20 seconds. (5 days 18:53:20 hours)
>
>
>
How should I do it? What is the easiest way to understand and do it?
Also the instructor said "no hard cod... | 2014/09/18 | [
"https://Stackoverflow.com/questions/25903354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4052677/"
] | With basic Java arithmetic calculations:
First consider the following values:
```none
1 minute = 60 seconds
1 hour = 3600 seconds (60 * 60)
1 day = 86400 second (24 * 3600)
```
1. First divide the input by 86400. If you you can get a number greater than 0, this is the number of days.
2. Again divide the remained nu... | You should try this
```
import java.util.Scanner;
public class Time_converter {
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
int seconds;
int minutes;
int hours;
System.out.print("Enter the number of seconds: ");
seconds = inpu... |
25,903,354 | The task is:
>
> The output should look like this (it is a good idea to echo back the input): You entered 500,000 seconds, which is 5 days, 18 hours, 53 minutes and 20 seconds. (5 days 18:53:20 hours)
>
>
>
How should I do it? What is the easiest way to understand and do it?
Also the instructor said "no hard cod... | 2014/09/18 | [
"https://Stackoverflow.com/questions/25903354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4052677/"
] | An example using the built-in `[TimeUnit](https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/TimeUnit.html)`.
```
long uptime = System.currentTimeMillis();
long days = TimeUnit.MILLISECONDS
.toDays(uptime);
uptime -= TimeUnit.DAYS.toMillis(days);
long hours = TimeUnit.MILLISECONDS
.toHours(uptime... | You should try this
```
import java.util.Scanner;
public class Time_converter {
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
int seconds;
int minutes;
int hours;
System.out.print("Enter the number of seconds: ");
seconds = inpu... |
25,903,354 | The task is:
>
> The output should look like this (it is a good idea to echo back the input): You entered 500,000 seconds, which is 5 days, 18 hours, 53 minutes and 20 seconds. (5 days 18:53:20 hours)
>
>
>
How should I do it? What is the easiest way to understand and do it?
Also the instructor said "no hard cod... | 2014/09/18 | [
"https://Stackoverflow.com/questions/25903354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4052677/"
] | The simplest way:
```
Scanner in = new Scanner(System.in);
System.out.println("Enter seconds ");
int s = in.nextInt();
int sec = s % 60;
int min = (s / 60) % 60;
int hours = (s / 60) / 60;
System.out.println(hours + ":" + min + ":" + sec);
``` | You can use the Java enum [`TimeUnit`](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/TimeUnit.html) to perform your math and avoid any hard-coded values. Then we can use [`String.format(String, Object...)`](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#format%28java.lang.String,%20java.... |
25,903,354 | The task is:
>
> The output should look like this (it is a good idea to echo back the input): You entered 500,000 seconds, which is 5 days, 18 hours, 53 minutes and 20 seconds. (5 days 18:53:20 hours)
>
>
>
How should I do it? What is the easiest way to understand and do it?
Also the instructor said "no hard cod... | 2014/09/18 | [
"https://Stackoverflow.com/questions/25903354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4052677/"
] | Have a look at the class:
```
org.joda.time.DateTime
```
This allows you to do things like:
```
old = new DateTime();
new = old.plusSeconds(500000);
System.out.println("Hours: " + (new.Hours() - old.Hours()));
```
However, your solution probably can be simpler:
You need to work out how many seconds in a day, div... | I started doing some pseudocode and came up with this:
```
import java.util.Scanner;
public class Project {
public static void main(String[] args) {
// Variable declaration
Scanner scan = new Scanner(System.in);
final int MIN = 60, HRS = 3600, DYS = 84600;
int input, days, second... |
25,903,354 | The task is:
>
> The output should look like this (it is a good idea to echo back the input): You entered 500,000 seconds, which is 5 days, 18 hours, 53 minutes and 20 seconds. (5 days 18:53:20 hours)
>
>
>
How should I do it? What is the easiest way to understand and do it?
Also the instructor said "no hard cod... | 2014/09/18 | [
"https://Stackoverflow.com/questions/25903354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4052677/"
] | Have a look at the class:
```
org.joda.time.DateTime
```
This allows you to do things like:
```
old = new DateTime();
new = old.plusSeconds(500000);
System.out.println("Hours: " + (new.Hours() - old.Hours()));
```
However, your solution probably can be simpler:
You need to work out how many seconds in a day, div... | You can use the Java enum [`TimeUnit`](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/TimeUnit.html) to perform your math and avoid any hard-coded values. Then we can use [`String.format(String, Object...)`](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#format%28java.lang.String,%20java.... |
25,903,354 | The task is:
>
> The output should look like this (it is a good idea to echo back the input): You entered 500,000 seconds, which is 5 days, 18 hours, 53 minutes and 20 seconds. (5 days 18:53:20 hours)
>
>
>
How should I do it? What is the easiest way to understand and do it?
Also the instructor said "no hard cod... | 2014/09/18 | [
"https://Stackoverflow.com/questions/25903354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4052677/"
] | You should try this
```
import java.util.Scanner;
public class Time_converter {
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
int seconds;
int minutes;
int hours;
System.out.print("Enter the number of seconds: ");
seconds = inpu... | I started doing some pseudocode and came up with this:
```
import java.util.Scanner;
public class Project {
public static void main(String[] args) {
// Variable declaration
Scanner scan = new Scanner(System.in);
final int MIN = 60, HRS = 3600, DYS = 84600;
int input, days, second... |
23,345 | Back home, the phylum Cnidaria (jellyfish, coral, anemone) and the class Amphibia are two of the most ancient groups of animals on the planet.
But let's say that, on an alternate Earth, many millions of years ago, the global climate became so hot and so dry (preferably from a volcanic eruption on the lines of the Sibe... | 2015/08/25 | [
"https://worldbuilding.stackexchange.com/questions/23345",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/10274/"
] | First, let's analyse the roles these creatures play. Both are a lesser type of predator, and heavily connected to water. Interesting choice. I assume from "so hot and so dry" that the reduction in available water is key.
>
> All adult amphibians are meat-eating predators. Their prey includes insects, slugs, worms, an... | 1. What you are stating is an extinction level event. Hence it is safe to assume that acidic oceans will be cause of extinction of more then just the jellyfish and frogs.
but it is believed there are organisms which have are still surviving in highly acidic environment check: <https://en.wikipedia.org/wiki/Acidophile>... |
39,008,926 | I'd like to enable/disabled 'CheckBox' element according to which 'ComboBoxItem' is selected. I don't know how to implement this function by using WPF binding.
More specifically, here is my xaml code.
```
<ComboBox x:Name="typeComboBox" SelectedValuePath="Tag">
<ComboBoxItem Content="type1" Tag="1"></ComboBoxItem... | 2016/08/18 | [
"https://Stackoverflow.com/questions/39008926",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5345050/"
] | This should work:
```
<ComboBox x:Name="typeComboBox" SelectedValuePath="Tag">
<ComboBoxItem x:Name="box1" Content="type1" Tag="1"/>
<ComboBoxItem x:Name="box2" Content="type2" Tag="2" IsSelected="True"/>
</ComboBox>
<CheckBox x:Name="mode" Content="Mode" IsEnabled="{Binding ElementName=box2, Path=IsSelected}"/>... | Try this:
```
<ComboBox x:Name="combo">
<ComboBoxItem x:Name="type1" Content="type1" IsSelected="True"></ComboBoxItem>
<ComboBoxItem x:Name="type2" Content="type2"></ComboBoxItem>
</ComboBox>
<CheckBox>
<CheckBox.Style>
<Style>
<Style.Triggers>
<DataTrigger Binding="{Bi... |
14,966,980 | I've been scouring the 1000's of NullPointerException posts on stackoverflow and cannot for the life of me figure why this is happening; aside from the obvious (that it is null). Can someone help me understand what it is that I am not understanding about Generic Singly LinkedList that is causing me to get this run time... | 2013/02/19 | [
"https://Stackoverflow.com/questions/14966980",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1072681/"
] | Since you are using the default constructor, for which you haven't given an implementation
```
GList<InnerList> list = new GList<InnerList>();
```
None of its fields are being initialized and so
```
list.cursor == null
```
Java stops execution here, but your other fields are also null. Take the time to revisit y... | On this line `list.cursor.next.data.setName(ln);` you are attempting to reference properties of objects that were never initialized.
Where you declare cursor, next, and data you set no value. In your main method you never set the value of head or cursor, so they are still null. Then you attempt to reference them and g... |
68,051,711 | I updated my Flutter app to Flutter 2, and now when I try to get the snapshot.error in my StreamBuider I get this [](https://i.stack.imgur.com/Cuxns.png)
These are validators with Streams.
```
class LoginStreams with Validators {
dispose() {
_... | 2021/06/20 | [
"https://Stackoverflow.com/questions/68051711",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14975194/"
] | I cannot speak to the numeric implementations used in particular versions of gawk or awk. This answer speaks to floating-point generally, particularly IEEE-754 binary formats.
Computing 299 for `2**99` and 2230 for `2**230` are simply normal operations for floating-point arithmetic. Each is represented with a signific... | UPDATE : statement on powers of 10 in 754 double :
>
> anectodally, even w/o bigint add-ons, if you're just looking for powers of 10 standalone, or using them to `mod ( % )` against powers of 2, it appears u can go up to 10^22.
>
>
>
```
jot 25 | gawk -be '$++NF = sprintf("%.f", 10^$1)' # same for mawk+nawk
{ … ... |
68,051,711 | I updated my Flutter app to Flutter 2, and now when I try to get the snapshot.error in my StreamBuider I get this [](https://i.stack.imgur.com/Cuxns.png)
These are validators with Streams.
```
class LoginStreams with Validators {
dispose() {
_... | 2021/06/20 | [
"https://Stackoverflow.com/questions/68051711",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14975194/"
] | UPDATE : statement on powers of 10 in 754 double :
>
> anectodally, even w/o bigint add-ons, if you're just looking for powers of 10 standalone, or using them to `mod ( % )` against powers of 2, it appears u can go up to 10^22.
>
>
>
```
jot 25 | gawk -be '$++NF = sprintf("%.f", 10^$1)' # same for mawk+nawk
{ … ... | one special case about powers of two -
if you want just 2^N-1 for powers up to 1023, a very clean sub() wil do the trick without having to physically go figure out what the last digit is :
```
sub(/[2468]$/, index("1:2:0:3", bits % 4), pow2str)
```
the last digit for positive integer powers of 2 have this repeat a... |
68,051,711 | I updated my Flutter app to Flutter 2, and now when I try to get the snapshot.error in my StreamBuider I get this [](https://i.stack.imgur.com/Cuxns.png)
These are validators with Streams.
```
class LoginStreams with Validators {
dispose() {
_... | 2021/06/20 | [
"https://Stackoverflow.com/questions/68051711",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14975194/"
] | I cannot speak to the numeric implementations used in particular versions of gawk or awk. This answer speaks to floating-point generally, particularly IEEE-754 binary formats.
Computing 299 for `2**99` and 2230 for `2**230` are simply normal operations for floating-point arithmetic. Each is represented with a signific... | one special case about powers of two -
if you want just 2^N-1 for powers up to 1023, a very clean sub() wil do the trick without having to physically go figure out what the last digit is :
```
sub(/[2468]$/, index("1:2:0:3", bits % 4), pow2str)
```
the last digit for positive integer powers of 2 have this repeat a... |
51,079,255 | I want to make 2 http post calls, and show an error if both calls fail, if one of the calls return data, then I don't want to show the error.
```
this.http.post<any[]>(URL, jsonBody1, postJson) //returns an Observable
this.http.post<any[]>(URL, jsonBody2, postJson) //returns an Observable
```
Can I do this with by ... | 2018/06/28 | [
"https://Stackoverflow.com/questions/51079255",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5051564/"
] | You may do it only using `Observable` without changing it to `Promise`:
```
forkJoin(
this.http.post<any[]>(URL, jsonBody1, postJson),
this.http.post<any[]>(URL, jsonBody2, postJson)).subscribe (
x => console.log(x),
error => console.log(error)
() => console.log('completed'))
```
The above approach may b... | you could use Promise.all()
```
Promise.all(
this.http.post<any[]>(URL, jsonBody1, postJson).toPromise(),
this.http.post<any[]>(URL, jsonBody2, postJson).toPromise()
).then(response => {
let [ response1, response2 ] = response
}).catch(err => {
console.log({err})
})
``` |
51,079,255 | I want to make 2 http post calls, and show an error if both calls fail, if one of the calls return data, then I don't want to show the error.
```
this.http.post<any[]>(URL, jsonBody1, postJson) //returns an Observable
this.http.post<any[]>(URL, jsonBody2, postJson) //returns an Observable
```
Can I do this with by ... | 2018/06/28 | [
"https://Stackoverflow.com/questions/51079255",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5051564/"
] | You may do it only using `Observable` without changing it to `Promise`:
```
forkJoin(
this.http.post<any[]>(URL, jsonBody1, postJson),
this.http.post<any[]>(URL, jsonBody2, postJson)).subscribe (
x => console.log(x),
error => console.log(error)
() => console.log('completed'))
```
The above approach may b... | With RxJS 6 you can do this with combination of `forkJoin`, `catchError` and `map` operators:
```
import { forkJoin, of, throwError } from 'rxjs';
import { catchError, map } from 'rxjs/operators';
const a$ = of(1);
// const a$ = throwError(new Error('Error in $a'));
// const b$ = of('a');
const b$ = throwError(new Er... |
51,079,255 | I want to make 2 http post calls, and show an error if both calls fail, if one of the calls return data, then I don't want to show the error.
```
this.http.post<any[]>(URL, jsonBody1, postJson) //returns an Observable
this.http.post<any[]>(URL, jsonBody2, postJson) //returns an Observable
```
Can I do this with by ... | 2018/06/28 | [
"https://Stackoverflow.com/questions/51079255",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5051564/"
] | You may do it only using `Observable` without changing it to `Promise`:
```
forkJoin(
this.http.post<any[]>(URL, jsonBody1, postJson),
this.http.post<any[]>(URL, jsonBody2, postJson)).subscribe (
x => console.log(x),
error => console.log(error)
() => console.log('completed'))
```
The above approach may b... | Simple way
```
this.http.post<any[]>(URL, jsonBody1, postJson).subscribe(
data => {
this.http.post<any[]>(URL2, jsonBody2, postJson).subscribe(
data2 => {
// both calls succeeded
}
error => {
// set error variable to true
}
)
}
error => {
// set... |
22,634,794 | I have a Locations with given lat/lon coordinates (from Google Maps).
Now I want to span a rectangle with a given distance (f.e. 150 meters) to all 4 sky directions (north, south, west, east) an calculate their coordinates as lat/lon.
How can I do this in C#? | 2014/03/25 | [
"https://Stackoverflow.com/questions/22634794",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3445510/"
] | Please check this [**PDF**](http://www.arubin.org/files/geo_search.pdf) file, I think it should be very help full find rectangle span. **Most see slide no 11**. | That depends on how precise it needs to be. You can use a spherical model.
```
void pointAtDistace(double lat1, double lon1, double brng, ref double lat2, ref double lon2)
{
lat2 = Math.Asin( Math.Sin(lat1)*Math.Cos(d/R) + Math.Cos(lat1)*Math.Sin(d/R)*Math.Cos(brng) );
lon2 = lon1 + Math.Atan2(Math.Sin(brng)... |
49,715,490 | node red is a gui tool, using which we can wire hardware devices, APIs online,services together. I have a node red instance running, which is an mqtt client that accepts messages from broker which are published from various sensors. All the data is being stored in monogodb. Now, i want to implement some kind of analysi... | 2018/04/08 | [
"https://Stackoverflow.com/questions/49715490",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5777188/"
] | To avoid long waiting times, you can use the Mojolicious non-blocking operations. Instead of running a synchronous request to an external system, use non-blocking methods that instead run some callback upon completion. E.g. to avoid a `sleep`, we would use `Mojo::IOLoop->timer(...)`.
Here is a variant of your code tha... | **Concurrent vs Parallel**
In order for two events to occur simultaneously ( in parallel ) you require multiple processing units.
For instance, with a single CPU you are only able to carry out a single mathematical operation at any single time so they will have to run in series regardless of the **concurrent** themes... |
31,518,734 | I have situation like this:
```
<span ng-repeat="personNum in unit.PricePerson">
{{personNum}}
<select ng-model="personNum"
ng-options="o as o for o in unit.PricePerson track by $index"></select>
</span>
```
`unit.Price` are numbers array,something like [5,6,7,8,9] but each select has val... | 2015/07/20 | [
"https://Stackoverflow.com/questions/31518734",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1104820/"
] | Part of your problem might be the track by $index in your select... Have a look at the plunker below. Also, use ng-init to set a default value.
<http://plnkr.co/edit/2ZN1J61PD1Ev2OK1tezg>
The code:
```
<span ng-repeat="personNum in unit.PricePerson">
<select ng-init="select[$index]=personNum" ng-model="select[$in... | Try to use different ng-model inside select, than in ng-repeat and initiate it to have desired value:
```
<span ng-repeat="personNum in unit.PricePerson">
{{personNum}}
<select ng-init="personNum1 = personNum" ng-model="personNum1"
ng-options="o as o for o in unit.PricePerson track by $ind... |
31,518,734 | I have situation like this:
```
<span ng-repeat="personNum in unit.PricePerson">
{{personNum}}
<select ng-model="personNum"
ng-options="o as o for o in unit.PricePerson track by $index"></select>
</span>
```
`unit.Price` are numbers array,something like [5,6,7,8,9] but each select has val... | 2015/07/20 | [
"https://Stackoverflow.com/questions/31518734",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1104820/"
] | Your question a little unclear, but it looks like you are having issues with your ng-options configuration.
It's generally not recommended to use *select as* with *track by*, as they are not designed to work together and can have unexpected results. Also, you are using the `unit.PricePerson` reference inside your ng-... | Try to use different ng-model inside select, than in ng-repeat and initiate it to have desired value:
```
<span ng-repeat="personNum in unit.PricePerson">
{{personNum}}
<select ng-init="personNum1 = personNum" ng-model="personNum1"
ng-options="o as o for o in unit.PricePerson track by $ind... |
31,518,734 | I have situation like this:
```
<span ng-repeat="personNum in unit.PricePerson">
{{personNum}}
<select ng-model="personNum"
ng-options="o as o for o in unit.PricePerson track by $index"></select>
</span>
```
`unit.Price` are numbers array,something like [5,6,7,8,9] but each select has val... | 2015/07/20 | [
"https://Stackoverflow.com/questions/31518734",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1104820/"
] | Part of your problem might be the track by $index in your select... Have a look at the plunker below. Also, use ng-init to set a default value.
<http://plnkr.co/edit/2ZN1J61PD1Ev2OK1tezg>
The code:
```
<span ng-repeat="personNum in unit.PricePerson">
<select ng-init="select[$index]=personNum" ng-model="select[$in... | Your question a little unclear, but it looks like you are having issues with your ng-options configuration.
It's generally not recommended to use *select as* with *track by*, as they are not designed to work together and can have unexpected results. Also, you are using the `unit.PricePerson` reference inside your ng-... |
33,002,800 | I have a text file which has all the information I need in lines and this needs to be converted into a .csv file.
Example:
```
abbccccdeffffiiiiiiiiiiiiiijjkkkkkkkkkkkllmmmmmmnnooo
abbccccdeffffiiiiiiiiiiiiiijjkkkkkkkkkkkllmmmmmmnnooo
abbccccdeffffiiiiiiiiiiiiiijjkkkkkkkkkkkllmmmmmmnnooo
abbccccdeffffiiiiiiiiiiiiiijj... | 2015/10/07 | [
"https://Stackoverflow.com/questions/33002800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3786693/"
] | You are aware of the `length` of value for each column, you can use the `substring` method of String.
```
string.substring(start, start+length);
```
where `start` is the start index for a column and `length` is the length of the colume value.
Use `StringBuilder` for converting them into `csv` format. AS you calcula... | Maybe you can use `indexOf`, `lastIndexOf` and `substring` method from String? Then you can find the places where you can put your delimiter.
```
String myString = "abbcccdee";
int lastCharIndex = 0;
while (true) {
if(lastCharIndex == myString.length()){
break;
}
//find char
char nextChar = my... |
33,002,800 | I have a text file which has all the information I need in lines and this needs to be converted into a .csv file.
Example:
```
abbccccdeffffiiiiiiiiiiiiiijjkkkkkkkkkkkllmmmmmmnnooo
abbccccdeffffiiiiiiiiiiiiiijjkkkkkkkkkkkllmmmmmmnnooo
abbccccdeffffiiiiiiiiiiiiiijjkkkkkkkkkkkllmmmmmmnnooo
abbccccdeffffiiiiiiiiiiiiiijj... | 2015/10/07 | [
"https://Stackoverflow.com/questions/33002800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3786693/"
] | You are aware of the `length` of value for each column, you can use the `substring` method of String.
```
string.substring(start, start+length);
```
where `start` is the start index for a column and `length` is the length of the colume value.
Use `StringBuilder` for converting them into `csv` format. AS you calcula... | * So is the string of fixed length or variable length?
* If you want the java application to be more generic or reusable, you
can use xml/xsd to define the template, something like
```html
<fileMessage class="MessageParser">
<field name="column1" type="java.lang.String" length="1" variable="id"/>
<field name="column... |
33,002,800 | I have a text file which has all the information I need in lines and this needs to be converted into a .csv file.
Example:
```
abbccccdeffffiiiiiiiiiiiiiijjkkkkkkkkkkkllmmmmmmnnooo
abbccccdeffffiiiiiiiiiiiiiijjkkkkkkkkkkkllmmmmmmnnooo
abbccccdeffffiiiiiiiiiiiiiijjkkkkkkkkkkkllmmmmmmnnooo
abbccccdeffffiiiiiiiiiiiiiijj... | 2015/10/07 | [
"https://Stackoverflow.com/questions/33002800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3786693/"
] | You are aware of the `length` of value for each column, you can use the `substring` method of String.
```
string.substring(start, start+length);
```
where `start` is the start index for a column and `length` is the length of the colume value.
Use `StringBuilder` for converting them into `csv` format. AS you calcula... | Use [univocity-parsers](http://www.univocity.com/pages/parsers-tutorial) `FixedWidthParser` and `FixedWidthWriter`.
Here's an example:
```
// creates the sequence of field lengths you need
FixedWidthFieldLengths lengths = new FixedWidthFieldLengths(1, 2, 4, 1, 1, 4);
// creates the default settings for a fixed width... |
684,786 | So I'm currently learning thermodynamics from the Openstax AP Physics book but a statement has arisen that I'm confused about. As you can see in the picture, I've highlighted the text that, to me, doesn't make sense with what the rest of the chapter says.
Does temperature affect the mass of a substance? I personally w... | 2021/12/22 | [
"https://physics.stackexchange.com/questions/684786",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/-1/"
] | Temperature does not affect mass. But it can affect mass per volume (density), which is what this seems to be saying. If your fuel gauge, which measures volume, reports x liters in the tank, but it is hot, you have less mass of gas than if it was cold and the fuel gauge reported the same volume | That's easy to understand from the giving some numbers. Suppose the tank has a volume of 1 liter in the winter. Then You can fill up one-liter gasoline in it in winter. Now, Once you fill up the tank in winter and let the time pass, In summer since tank and gasoline going to have thermal expansion. So let that tank goe... |
684,786 | So I'm currently learning thermodynamics from the Openstax AP Physics book but a statement has arisen that I'm confused about. As you can see in the picture, I've highlighted the text that, to me, doesn't make sense with what the rest of the chapter says.
Does temperature affect the mass of a substance? I personally w... | 2021/12/22 | [
"https://physics.stackexchange.com/questions/684786",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/-1/"
] | Temperature does not affect mass. But it can affect mass per volume (density), which is what this seems to be saying. If your fuel gauge, which measures volume, reports x liters in the tank, but it is hot, you have less mass of gas than if it was cold and the fuel gauge reported the same volume | **Conservation of mass**
There is a fundamental law of [conservation of mass](https://en.wikipedia.org/wiki/Conservation_of_mass), which is usually mentioned in basic texts on physics or chemistry, but is usually quickly forgotten, since it seems very obvious.
In a bit more advanced texts it appears in the form of ... |
684,786 | So I'm currently learning thermodynamics from the Openstax AP Physics book but a statement has arisen that I'm confused about. As you can see in the picture, I've highlighted the text that, to me, doesn't make sense with what the rest of the chapter says.
Does temperature affect the mass of a substance? I personally w... | 2021/12/22 | [
"https://physics.stackexchange.com/questions/684786",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/-1/"
] | That's easy to understand from the giving some numbers. Suppose the tank has a volume of 1 liter in the winter. Then You can fill up one-liter gasoline in it in winter. Now, Once you fill up the tank in winter and let the time pass, In summer since tank and gasoline going to have thermal expansion. So let that tank goe... | **Conservation of mass**
There is a fundamental law of [conservation of mass](https://en.wikipedia.org/wiki/Conservation_of_mass), which is usually mentioned in basic texts on physics or chemistry, but is usually quickly forgotten, since it seems very obvious.
In a bit more advanced texts it appears in the form of ... |
13,405,376 | I am trying to save my form data into a wordpress database before submitting it. Please help. Heres my code and the php code to insert into database:
```
<form method="post" action="https://app.icontact.com/icp/signup.php" name="icpsignup"
id="icpsignup1030" accept-charset="UTF-8" onsubmit="return verifyRequired1030... | 2012/11/15 | [
"https://Stackoverflow.com/questions/13405376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1827773/"
] | "Submitting" is the only way to transfer it to the server, whether you submit the form via AJAX or traditional methods - no difference.
Remember, this is a client-server model. The form is on the client, the DB is on the server. | I would recommend using Contact Form 7 (WP plugin). There is a PHP hook built in that you can use to do this called `wpcf7_before_send_mail`. It will pass an object with all of the contact form data to your custom function(s) which you can use to write to the database or do other server side stuff. Here's a (really) sh... |
13,405,376 | I am trying to save my form data into a wordpress database before submitting it. Please help. Heres my code and the php code to insert into database:
```
<form method="post" action="https://app.icontact.com/icp/signup.php" name="icpsignup"
id="icpsignup1030" accept-charset="UTF-8" onsubmit="return verifyRequired1030... | 2012/11/15 | [
"https://Stackoverflow.com/questions/13405376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1827773/"
] | "Submitting" is the only way to transfer it to the server, whether you submit the form via AJAX or traditional methods - no difference.
Remember, this is a client-server model. The form is on the client, the DB is on the server. | I think the solution is simple : submit your form to a PHP page that will : 1) save it in your database and 2) send it wherever you want. By far the simplest and most used solution in your case! |
13,405,376 | I am trying to save my form data into a wordpress database before submitting it. Please help. Heres my code and the php code to insert into database:
```
<form method="post" action="https://app.icontact.com/icp/signup.php" name="icpsignup"
id="icpsignup1030" accept-charset="UTF-8" onsubmit="return verifyRequired1030... | 2012/11/15 | [
"https://Stackoverflow.com/questions/13405376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1827773/"
] | I can INFER from your question that you really mean: I am trying to save this form to a database before I submit it to ANOTHER SITE which I don't control. Meaning you want to save it to your own database before you submit the data to a 3rd party.
If that's the case here's what I recommend:
Use the form's onSubmit eve... | I would recommend using Contact Form 7 (WP plugin). There is a PHP hook built in that you can use to do this called `wpcf7_before_send_mail`. It will pass an object with all of the contact form data to your custom function(s) which you can use to write to the database or do other server side stuff. Here's a (really) sh... |
13,405,376 | I am trying to save my form data into a wordpress database before submitting it. Please help. Heres my code and the php code to insert into database:
```
<form method="post" action="https://app.icontact.com/icp/signup.php" name="icpsignup"
id="icpsignup1030" accept-charset="UTF-8" onsubmit="return verifyRequired1030... | 2012/11/15 | [
"https://Stackoverflow.com/questions/13405376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1827773/"
] | I can INFER from your question that you really mean: I am trying to save this form to a database before I submit it to ANOTHER SITE which I don't control. Meaning you want to save it to your own database before you submit the data to a 3rd party.
If that's the case here's what I recommend:
Use the form's onSubmit eve... | I think the solution is simple : submit your form to a PHP page that will : 1) save it in your database and 2) send it wherever you want. By far the simplest and most used solution in your case! |
2,940,858 | I'm trying to kill a process (specifically iChat). On the command line, I use these commands:
```
ps -A | grep iChat
```
Then:
```
kill -9 PID
```
However, I'm not exactly sure how to translate these commands over to Python. | 2010/05/31 | [
"https://Stackoverflow.com/questions/2940858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/353064/"
] | [psutil](https://github.com/giampaolo/psutil) can find process by name and kill it:
```
import psutil
PROCNAME = "python.exe"
for proc in psutil.process_iter():
# check whether the process name matches
if proc.name() == PROCNAME:
proc.kill()
``` | ```
import os, signal
def check_kill_process(pstring):
for line in os.popen("ps ax | grep " + pstring + " | grep -v grep"):
fields = line.split()
pid = fields[0]
os.kill(int(pid), signal.SIGKILL)
``` |
2,940,858 | I'm trying to kill a process (specifically iChat). On the command line, I use these commands:
```
ps -A | grep iChat
```
Then:
```
kill -9 PID
```
However, I'm not exactly sure how to translate these commands over to Python. | 2010/05/31 | [
"https://Stackoverflow.com/questions/2940858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/353064/"
] | You can try this.
but before you need to install [psutil](https://psutil.readthedocs.io/en/latest/) using `sudo pip install psutil`
```
import psutil
for proc in psutil.process_iter(attrs=['pid', 'name']):
if 'ichat' in proc.info['name']:
proc.kill()
``` | For me the only thing that worked is been:
For example
```
import subprocess
proc = subprocess.Popen(["pkill", "-f", "scriptName.py"], stdout=subprocess.PIPE)
proc.wait()
``` |
2,940,858 | I'm trying to kill a process (specifically iChat). On the command line, I use these commands:
```
ps -A | grep iChat
```
Then:
```
kill -9 PID
```
However, I'm not exactly sure how to translate these commands over to Python. | 2010/05/31 | [
"https://Stackoverflow.com/questions/2940858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/353064/"
] | If you have killall:
```
os.system("killall -9 iChat");
```
Or:
```
os.system("ps -C iChat -o pid=|xargs kill -9")
``` | The below code will kill all iChat oriented programs:
```
p = subprocess.Popen(['pgrep', '-l' , 'iChat'], stdout=subprocess.PIPE)
out, err = p.communicate()
for line in out.splitlines():
line = bytes.decode(line)
pid = int(line.split(None, 1)[0])
os.kill(pid, signal.SIGKILL)
``` |
2,940,858 | I'm trying to kill a process (specifically iChat). On the command line, I use these commands:
```
ps -A | grep iChat
```
Then:
```
kill -9 PID
```
However, I'm not exactly sure how to translate these commands over to Python. | 2010/05/31 | [
"https://Stackoverflow.com/questions/2940858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/353064/"
] | If you have to consider the Windows case in order to be cross-platform, then try the following:
```
os.system('taskkill /f /im exampleProcess.exe')
``` | you can use WMI module to do this on windows, though it's a lot clunkier than you unix folks are used to; `import WMI` takes a long time and there's intermediate pain to get at the process. |
2,940,858 | I'm trying to kill a process (specifically iChat). On the command line, I use these commands:
```
ps -A | grep iChat
```
Then:
```
kill -9 PID
```
However, I'm not exactly sure how to translate these commands over to Python. | 2010/05/31 | [
"https://Stackoverflow.com/questions/2940858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/353064/"
] | Assuming you're on a Unix-like platform (so that `ps -A` exists),
```
>>> import subprocess, signal
>>> import os
>>> p = subprocess.Popen(['ps', '-A'], stdout=subprocess.PIPE)
>>> out, err = p.communicate()
```
gives you `ps -A`'s output in the `out` variable (a string). You can break it down into lines and loop on... | The below code will kill all iChat oriented programs:
```
p = subprocess.Popen(['pgrep', '-l' , 'iChat'], stdout=subprocess.PIPE)
out, err = p.communicate()
for line in out.splitlines():
line = bytes.decode(line)
pid = int(line.split(None, 1)[0])
os.kill(pid, signal.SIGKILL)
``` |
2,940,858 | I'm trying to kill a process (specifically iChat). On the command line, I use these commands:
```
ps -A | grep iChat
```
Then:
```
kill -9 PID
```
However, I'm not exactly sure how to translate these commands over to Python. | 2010/05/31 | [
"https://Stackoverflow.com/questions/2940858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/353064/"
] | Assuming you're on a Unix-like platform (so that `ps -A` exists),
```
>>> import subprocess, signal
>>> import os
>>> p = subprocess.Popen(['ps', '-A'], stdout=subprocess.PIPE)
>>> out, err = p.communicate()
```
gives you `ps -A`'s output in the `out` variable (a string). You can break it down into lines and loop on... | ```
import psutil
pid_list=psutil.get_pid_list()
print pid_list
p = psutil.Process(1052)
print p.name
for i in pid_list:
p = psutil.Process(i)
p_name=p.name
print str(i)+" "+str(p.name)
if p_name=="PerfExp.exe":
print "*"*20+" mam ho "+"*"*20
p.kill()
``` |
2,940,858 | I'm trying to kill a process (specifically iChat). On the command line, I use these commands:
```
ps -A | grep iChat
```
Then:
```
kill -9 PID
```
However, I'm not exactly sure how to translate these commands over to Python. | 2010/05/31 | [
"https://Stackoverflow.com/questions/2940858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/353064/"
] | [psutil](https://github.com/giampaolo/psutil) can find process by name and kill it:
```
import psutil
PROCNAME = "python.exe"
for proc in psutil.process_iter():
# check whether the process name matches
if proc.name() == PROCNAME:
proc.kill()
``` | You can use `pkill <process_name>` in a unix system to kill process by name.
Then the python code will be:
```
>>> import os
>>> process_name=iChat
>>> os.system('pkill '+process_name)
``` |
2,940,858 | I'm trying to kill a process (specifically iChat). On the command line, I use these commands:
```
ps -A | grep iChat
```
Then:
```
kill -9 PID
```
However, I'm not exactly sure how to translate these commands over to Python. | 2010/05/31 | [
"https://Stackoverflow.com/questions/2940858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/353064/"
] | this worked for me in windows 7
```
import subprocess
subprocess.call("taskkill /IM geckodriver.exe")
``` | You can use the `psutil` module to kill a process using it's name. For the most part, this should be cross platform.
```py
import traceback
import psutil
def kill(process_name):
"""Kill Running Process by using it's name
- Generate list of processes currently running
- Iterate through each process
... |
2,940,858 | I'm trying to kill a process (specifically iChat). On the command line, I use these commands:
```
ps -A | grep iChat
```
Then:
```
kill -9 PID
```
However, I'm not exactly sure how to translate these commands over to Python. | 2010/05/31 | [
"https://Stackoverflow.com/questions/2940858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/353064/"
] | Get the process object using the `Process`.
```
>>> import psutil
>>> p = psutil.Process(23442)
>>> p
psutil.Process(pid=23442, name='python3.6', started='09:24:16')
>>> p.kill()
>>>
``` | The Alex Martelli answer won't work in Python 3 because `out` will be a bytes object and thus result in a `TypeError: a bytes-like object is required, not 'str'` when testing `if 'iChat' in line:`.
Quoting from subprocess [documentation](https://docs.python.org/3/library/subprocess.html#popen-objects):
>
> communic... |
2,940,858 | I'm trying to kill a process (specifically iChat). On the command line, I use these commands:
```
ps -A | grep iChat
```
Then:
```
kill -9 PID
```
However, I'm not exactly sure how to translate these commands over to Python. | 2010/05/31 | [
"https://Stackoverflow.com/questions/2940858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/353064/"
] | If you have to consider the Windows case in order to be cross-platform, then try the following:
```
os.system('taskkill /f /im exampleProcess.exe')
``` | In the same style as Giampaolo Rodolà' answer but as one liner, case insensitive and without having to match the whole process name, in windows you would have to include the `.exe` suffix.
```
[x.kill() for x in psutil.process_iter() if 'ichat' in x.name().lower()]
``` |
10,693,800 | it is such that I must also have build up that it will upload a picture to server, but it appears with the error that makes it not possible to proceed or what to say? hmm
activate.php **her**
```
<input type="file" name="file" />
```
activate\_updater.php **her**
```
<?php include ("include/database/db.php");
ini_... | 2012/05/21 | [
"https://Stackoverflow.com/questions/10693800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1205141/"
] | **If you want to parse URL as string:**
```
$str = 'http://localhost:8888/App.php#?ID=1S';
$temp = explode( "?", $str );
$result = explode( "=", $temp['1'] );
echo $result['1'];
```
* [Demo](http://codepad.org/erwiNASf)
---
**If you want to get it on server side:**
Hash value is not sent to server side. So it imp... | ```
echo parse_url('http://localhost:8888/App.php#?ID=1S', PHP_URL_FRAGMENT);
```
OR
```
echo parse_url($_SERVER['QUERY_STRING'], PHP_URL_FRAGMENT);
```
If you need to parse it further:
```
$x = parse_url($_SERVER['QUERY_STRING'], PHP_URL_FRAGMENT);
parse_str($x, $arr);
echo $arr['ID']
``` |
10,693,800 | it is such that I must also have build up that it will upload a picture to server, but it appears with the error that makes it not possible to proceed or what to say? hmm
activate.php **her**
```
<input type="file" name="file" />
```
activate\_updater.php **her**
```
<?php include ("include/database/db.php");
ini_... | 2012/05/21 | [
"https://Stackoverflow.com/questions/10693800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1205141/"
] | **If you want to parse URL as string:**
```
$str = 'http://localhost:8888/App.php#?ID=1S';
$temp = explode( "?", $str );
$result = explode( "=", $temp['1'] );
echo $result['1'];
```
* [Demo](http://codepad.org/erwiNASf)
---
**If you want to get it on server side:**
Hash value is not sent to server side. So it imp... | ```
$url = "http://localhost:8888/App.php#?ID=1S&another=3";
$a = parse_url($url);
parse_str($a["fragment"],$arr);
print_r($arr);
```
outputs:
```
Array (
[?ID] => 1S
[another] => 3
);
```
if you can live accessing the first parameter with "?ID" |
10,693,800 | it is such that I must also have build up that it will upload a picture to server, but it appears with the error that makes it not possible to proceed or what to say? hmm
activate.php **her**
```
<input type="file" name="file" />
```
activate\_updater.php **her**
```
<?php include ("include/database/db.php");
ini_... | 2012/05/21 | [
"https://Stackoverflow.com/questions/10693800",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1205141/"
] | **If you want to parse URL as string:**
```
$str = 'http://localhost:8888/App.php#?ID=1S';
$temp = explode( "?", $str );
$result = explode( "=", $temp['1'] );
echo $result['1'];
```
* [Demo](http://codepad.org/erwiNASf)
---
**If you want to get it on server side:**
Hash value is not sent to server side. So it imp... | I guess that the only way to do this is by an AJAX request, here is a simplified example:
the index page
```
<!doctype html>
<html>
<head>
<title>Website</title>
<script type="text/javascript">
var url = document.location;
url = url.toString();
var getVal = url.split("#");
var ... |
35,188,719 | When attempting to validate a `schema.org/Article` against Google's [Structured Data Testing Tool](https://developers.google.com/structured-data/testing-tool/), I noticed that it gives an error if you specify an SVG image:
>
> The value provided for *logo* must be a valid URL.
>
>
> **Required by:**
>
>
> AMP Art... | 2016/02/03 | [
"https://Stackoverflow.com/questions/35188719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/467354/"
] | From one of the links you gave: <https://developers.google.com/structured-data/rich-snippets/articles>
>
> Images should be in .jpg, .png, or. gif format.
>
>
>
Why? Who knows. Perhaps because SVGs still have some support issues in some browsers (particularly older ones). | Update: 2022 - after reading the google documentation, it seems they do now accept svgs. <https://developers.google.com/search/docs/appearance/structured-data/logo#structured-data-type-definitions> |
35,188,719 | When attempting to validate a `schema.org/Article` against Google's [Structured Data Testing Tool](https://developers.google.com/structured-data/testing-tool/), I noticed that it gives an error if you specify an SVG image:
>
> The value provided for *logo* must be a valid URL.
>
>
> **Required by:**
>
>
> AMP Art... | 2016/02/03 | [
"https://Stackoverflow.com/questions/35188719",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/467354/"
] | Google has updated the [documentation](https://developers.google.com/structured-data/carousels/top-stories#logo_guidelines) and specifically mentioned svg.
Logo image files should be raster (for example, .jpg, .png, .gif), not vector (for example, .svg), with no animation. | Update: 2022 - after reading the google documentation, it seems they do now accept svgs. <https://developers.google.com/search/docs/appearance/structured-data/logo#structured-data-type-definitions> |
3,826,241 | I have a question which I tried solving for a few hours.
My only solid direction so far is trying using Cauchy.
Let $(f\_n(x))$ be a series of continuous functions in $[0,1]$.
Prove; If $ \sum\_{n=1}^{ \infty } f\_n(x) $ converges uniformly at $[0,1)$, then $ \sum\_{n=1}^{ \infty } f\_n(1) $ converges.
Thank yo... | 2020/09/14 | [
"https://math.stackexchange.com/questions/3826241",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/825122/"
] | *Maybe not the most elegant, but a detailed way to get it by "splitting $\varepsilon$."*
Let $S\_n\colon[0,1]\to\mathbb{R}$ be the function defined by
$S\_n(x) = \sum\_{k=1}^n f\_k(x)$, for $n\geq 1$ and $x\in[0,1]$. Since the $f\_n$'s are continuous on a compact set, they are *uniformly* continuous, so is $S\_n$. Mor... | If $f(x)=\sum\_{n=1}^\infty f\_n(x)$ converges uniformly on $(0,1)$, then $\forall \epsilon>0$ there exists $N$ s.t. $$\left|\sum\_{n=N}^\infty f\_n(x) \right| < \epsilon$$ for all $x\in (0,1)$. Furthermore $\sum\_{n=N}^\infty f\_n(x)$ is uniformly continuous on $(0,1)$ (and can therefore be continued to $[0,1]$) since... |
35,839,282 | I am a beginner learning Java on my own via online sources. I have come across this exercise.
>
> Write a program that simulates a dice roll by picking a random number from 1-6 and then picking a second random number from 1-6. Add the two values together, and display the total. Modify your dice game so that it keeps ... | 2016/03/07 | [
"https://Stackoverflow.com/questions/35839282",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You have to roll the dice again it their values are not same.
Using `do-while` is good in this case.
```
int firstRoll, secondRoll;
do {
firstRoll = 1 + (int) (Math.random() * 6);
secondRoll = 1 + (int) (Math.random() * 6);
System.out.println("Roll #1: " + firstRoll);
System.out.println("Roll #2: " + ... | You need to do the roll again at each iteration:
```
while (firstRoll != secondRoll) {
System.out.println("Roll #1: " + firstRoll);
System.out.println("Roll #2: " + secondRoll);
int total = firstRoll + secondRoll;
System.out.println("The total is " + total);
firstRoll = 1 + (int) (Math.random() * 6... |
35,839,282 | I am a beginner learning Java on my own via online sources. I have come across this exercise.
>
> Write a program that simulates a dice roll by picking a random number from 1-6 and then picking a second random number from 1-6. Add the two values together, and display the total. Modify your dice game so that it keeps ... | 2016/03/07 | [
"https://Stackoverflow.com/questions/35839282",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You have to roll the dice again it their values are not same.
Using `do-while` is good in this case.
```
int firstRoll, secondRoll;
do {
firstRoll = 1 + (int) (Math.random() * 6);
secondRoll = 1 + (int) (Math.random() * 6);
System.out.println("Roll #1: " + firstRoll);
System.out.println("Roll #2: " + ... | Write a method `public int roll()` and put there logic for calculating random number between 1-6. You are just OUTPUTTING the result of firstRoll and secondRoll instead of calculating it again in a method.
Example:
```
public class Dice() {
public int roll() {
return 1 + (int) (Math.random() * 6)... |
2,612 | As we all know, some people are lazy when they wake up in the morning.
Is there any term in English expressing *"laziness in mornings"*, maybe like *"hangover without alcohol"*? | 2013/02/15 | [
"https://ell.stackexchange.com/questions/2612",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/256/"
] | The term *"morning person"* can be used to describe someone who is *not* lazy in the morning. *"Not a morning person"* refers to the opposite: being lazy in the morning.
There's also the term *lark* and *night owl*, referring to people who get up early and go to bed late respectively. | The term *[slugabed](http://en.wiktionary.org/wiki/slugabed)* denotes “One who indulges in lying late in bed; a [sluggard](http://en.wiktionary.org/wiki/sluggard)”. |
2,612 | As we all know, some people are lazy when they wake up in the morning.
Is there any term in English expressing *"laziness in mornings"*, maybe like *"hangover without alcohol"*? | 2013/02/15 | [
"https://ell.stackexchange.com/questions/2612",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/256/"
] | The term *"morning person"* can be used to describe someone who is *not* lazy in the morning. *"Not a morning person"* refers to the opposite: being lazy in the morning.
There's also the term *lark* and *night owl*, referring to people who get up early and go to bed late respectively. | Although perhaps not a direct answer to the question, I'd just like to throw in the following phrase that specifically relates to feeling sluggish with perhaps a slight lazy or melancholy connotation, specifically relating to Mondays:
>
> Don't talk to Jeff at the moment. He's got a bad case of the **Monday blues**
>... |
2,612 | As we all know, some people are lazy when they wake up in the morning.
Is there any term in English expressing *"laziness in mornings"*, maybe like *"hangover without alcohol"*? | 2013/02/15 | [
"https://ell.stackexchange.com/questions/2612",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/256/"
] | The term *"morning person"* can be used to describe someone who is *not* lazy in the morning. *"Not a morning person"* refers to the opposite: being lazy in the morning.
There's also the term *lark* and *night owl*, referring to people who get up early and go to bed late respectively. | There's also the phrase "rolling out of bed in the morning" which specifically means that it was difficult to wake up and get out of bed, but is commonly used to describe any type of morning laziness or slow start to a morning.
It's usually used in the past tense such as "I rolled out of the bed this morning" or "I wa... |
2,612 | As we all know, some people are lazy when they wake up in the morning.
Is there any term in English expressing *"laziness in mornings"*, maybe like *"hangover without alcohol"*? | 2013/02/15 | [
"https://ell.stackexchange.com/questions/2612",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/256/"
] | The term *"morning person"* can be used to describe someone who is *not* lazy in the morning. *"Not a morning person"* refers to the opposite: being lazy in the morning.
There's also the term *lark* and *night owl*, referring to people who get up early and go to bed late respectively. | The term **[Sleep Inertia](http://www.huffingtonpost.com/van-winkles/what-is-sleep-inertia-and_b_7764850.html)** describes reduced abilities immediately after waking up. However this is a somewhat technical term that may not be very widely known. |
2,612 | As we all know, some people are lazy when they wake up in the morning.
Is there any term in English expressing *"laziness in mornings"*, maybe like *"hangover without alcohol"*? | 2013/02/15 | [
"https://ell.stackexchange.com/questions/2612",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/256/"
] | The term *[slugabed](http://en.wiktionary.org/wiki/slugabed)* denotes “One who indulges in lying late in bed; a [sluggard](http://en.wiktionary.org/wiki/sluggard)”. | There's also the phrase "rolling out of bed in the morning" which specifically means that it was difficult to wake up and get out of bed, but is commonly used to describe any type of morning laziness or slow start to a morning.
It's usually used in the past tense such as "I rolled out of the bed this morning" or "I wa... |
2,612 | As we all know, some people are lazy when they wake up in the morning.
Is there any term in English expressing *"laziness in mornings"*, maybe like *"hangover without alcohol"*? | 2013/02/15 | [
"https://ell.stackexchange.com/questions/2612",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/256/"
] | The term *[slugabed](http://en.wiktionary.org/wiki/slugabed)* denotes “One who indulges in lying late in bed; a [sluggard](http://en.wiktionary.org/wiki/sluggard)”. | The term **[Sleep Inertia](http://www.huffingtonpost.com/van-winkles/what-is-sleep-inertia-and_b_7764850.html)** describes reduced abilities immediately after waking up. However this is a somewhat technical term that may not be very widely known. |
2,612 | As we all know, some people are lazy when they wake up in the morning.
Is there any term in English expressing *"laziness in mornings"*, maybe like *"hangover without alcohol"*? | 2013/02/15 | [
"https://ell.stackexchange.com/questions/2612",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/256/"
] | Although perhaps not a direct answer to the question, I'd just like to throw in the following phrase that specifically relates to feeling sluggish with perhaps a slight lazy or melancholy connotation, specifically relating to Mondays:
>
> Don't talk to Jeff at the moment. He's got a bad case of the **Monday blues**
>... | There's also the phrase "rolling out of bed in the morning" which specifically means that it was difficult to wake up and get out of bed, but is commonly used to describe any type of morning laziness or slow start to a morning.
It's usually used in the past tense such as "I rolled out of the bed this morning" or "I wa... |
2,612 | As we all know, some people are lazy when they wake up in the morning.
Is there any term in English expressing *"laziness in mornings"*, maybe like *"hangover without alcohol"*? | 2013/02/15 | [
"https://ell.stackexchange.com/questions/2612",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/256/"
] | Although perhaps not a direct answer to the question, I'd just like to throw in the following phrase that specifically relates to feeling sluggish with perhaps a slight lazy or melancholy connotation, specifically relating to Mondays:
>
> Don't talk to Jeff at the moment. He's got a bad case of the **Monday blues**
>... | The term **[Sleep Inertia](http://www.huffingtonpost.com/van-winkles/what-is-sleep-inertia-and_b_7764850.html)** describes reduced abilities immediately after waking up. However this is a somewhat technical term that may not be very widely known. |
27,915,868 | ```
word='p'
versions=['down','up','up+']
```
I was trying for the below output can any one help me please
```
pdown
pup
pup+
```
Please any one can suggest how to do ? | 2015/01/13 | [
"https://Stackoverflow.com/questions/27915868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1705143/"
] | try like this:
```
" ".join("{}{}".format(word,x) for x in versions)
pdown pup pup+
```
you want in new line:
```
print "\n".join("{}{}".format(word,x) for x in versions)
pdown
pup
pup+
``` | ```
' '.join([word + v for v in versions])
```
**EDIT:**
Since your edit now shows output words on different lines you can try:
```
for v in versions:
print word + v
``` |
27,915,868 | ```
word='p'
versions=['down','up','up+']
```
I was trying for the below output can any one help me please
```
pdown
pup
pup+
```
Please any one can suggest how to do ? | 2015/01/13 | [
"https://Stackoverflow.com/questions/27915868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1705143/"
] | try like this:
```
" ".join("{}{}".format(word,x) for x in versions)
pdown pup pup+
```
you want in new line:
```
print "\n".join("{}{}".format(word,x) for x in versions)
pdown
pup
pup+
``` | ```
word='p'
versions=['down','up','up+']
for x in versions:
print (word+x)
```
Output:
```
>>>
pdown
pup
pup+
>>>
``` |
27,915,868 | ```
word='p'
versions=['down','up','up+']
```
I was trying for the below output can any one help me please
```
pdown
pup
pup+
```
Please any one can suggest how to do ? | 2015/01/13 | [
"https://Stackoverflow.com/questions/27915868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1705143/"
] | try like this:
```
" ".join("{}{}".format(word,x) for x in versions)
pdown pup pup+
```
you want in new line:
```
print "\n".join("{}{}".format(word,x) for x in versions)
pdown
pup
pup+
``` | You can use map
```
word='p'
versions=['down','up','up+']
word_versions = map(lambda x:word+x,versions)
print word_versions
```
This way you will have a list named word\_versions containing what you want,you can print it or use it. |
37,809,268 | please can someone explain the 'GS v 0' command? I want to print some Bitmap on my thermal printer. I can't understand the parameters xL xH yL ...
The following is in the programming guide, but until now I can't see solution.
ASCII: Gs v 0
Decimal: 29 118 48 m xL xH yL yH [d]k
Hexadecimal: 1D 76 30 m xL xH yL yH [d]k... | 2016/06/14 | [
"https://Stackoverflow.com/questions/37809268",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6463926/"
] | First let me say that I know the question is old and this command is considered obsolete, but there is still a huge market out there with thermal printers that accept this command.
Don't have enough points on this account to write a comment on @Fewl 's answer.
He is right about yL and yH, but not about xL and xH.
> ... | As mentioned, the command **GS v 0** is obsolete, in place you should try **ESC \*** or **GS ( L / GS 8 L**.
### But, just to answer the question...
**xL, xH** refers to the width of the bitmap image, and **yL, yH** the height, as you know.
You said that those values must be between 0 and 255, and to achieve then yo... |
37,809,268 | please can someone explain the 'GS v 0' command? I want to print some Bitmap on my thermal printer. I can't understand the parameters xL xH yL ...
The following is in the programming guide, but until now I can't see solution.
ASCII: Gs v 0
Decimal: 29 118 48 m xL xH yL yH [d]k
Hexadecimal: 1D 76 30 m xL xH yL yH [d]k... | 2016/06/14 | [
"https://Stackoverflow.com/questions/37809268",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6463926/"
] | As mentioned, the command **GS v 0** is obsolete, in place you should try **ESC \*** or **GS ( L / GS 8 L**.
### But, just to answer the question...
**xL, xH** refers to the width of the bitmap image, and **yL, yH** the height, as you know.
You said that those values must be between 0 and 255, and to achieve then yo... | Using the Hex command, you have: 1D 76 30 m 2C 01 C8 00 [d]k, where m is the mode and [d]k is 60.000 **bites** image data or 937 bytes (8x8). |
37,809,268 | please can someone explain the 'GS v 0' command? I want to print some Bitmap on my thermal printer. I can't understand the parameters xL xH yL ...
The following is in the programming guide, but until now I can't see solution.
ASCII: Gs v 0
Decimal: 29 118 48 m xL xH yL yH [d]k
Hexadecimal: 1D 76 30 m xL xH yL yH [d]k... | 2016/06/14 | [
"https://Stackoverflow.com/questions/37809268",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6463926/"
] | First let me say that I know the question is old and this command is considered obsolete, but there is still a huge market out there with thermal printers that accept this command.
Don't have enough points on this account to write a comment on @Fewl 's answer.
He is right about yL and yH, but not about xL and xH.
> ... | Using the Hex command, you have: 1D 76 30 m 2C 01 C8 00 [d]k, where m is the mode and [d]k is 60.000 **bites** image data or 937 bytes (8x8). |
627,840 | In my company we're facing connectivity problems due to our not very professional network infrastructure. We're growing now, and we expect to be 40 people at the office by the end of the year.
I'm considering to set up a wired network with a structured cabling (Rack, Patch Panel, Switch, etc) but the shape of the offic... | 2014/09/11 | [
"https://serverfault.com/questions/627840",
"https://serverfault.com",
"https://serverfault.com/users/241944/"
] | How crowded the spectrum is in your area is going to be the biggest factor influencing your success. In environments where 802.11 has already been deployed densely your radios will be fighting for bandwidth with everyone else's radios. This will radically diminish the effective range of your access points. If you're se... | Efficiency of Wireless connections depends, like wired connections, on the traffic that goes on. but the problem with the first one is that the "air" is shared between every wireless device.
So having a good (strong) WiFi signal can really help not to lose connectivity in a file transfer between 2 machines. you also n... |
627,840 | In my company we're facing connectivity problems due to our not very professional network infrastructure. We're growing now, and we expect to be 40 people at the office by the end of the year.
I'm considering to set up a wired network with a structured cabling (Rack, Patch Panel, Switch, etc) but the shape of the offic... | 2014/09/11 | [
"https://serverfault.com/questions/627840",
"https://serverfault.com",
"https://serverfault.com/users/241944/"
] | It might be possible, but here is a number of reasons why you do not want to rely on wireless only, and why you really want to roll out a structured wired network, at least as a fallback. Take this answer with a grain of salt, my experience is from the pre-N-era and might be outdated.
In a nutshell, wireless sucks. Th... | Efficiency of Wireless connections depends, like wired connections, on the traffic that goes on. but the problem with the first one is that the "air" is shared between every wireless device.
So having a good (strong) WiFi signal can really help not to lose connectivity in a file transfer between 2 machines. you also n... |
627,840 | In my company we're facing connectivity problems due to our not very professional network infrastructure. We're growing now, and we expect to be 40 people at the office by the end of the year.
I'm considering to set up a wired network with a structured cabling (Rack, Patch Panel, Switch, etc) but the shape of the offic... | 2014/09/11 | [
"https://serverfault.com/questions/627840",
"https://serverfault.com",
"https://serverfault.com/users/241944/"
] | It might be possible, but here is a number of reasons why you do not want to rely on wireless only, and why you really want to roll out a structured wired network, at least as a fallback. Take this answer with a grain of salt, my experience is from the pre-N-era and might be outdated.
In a nutshell, wireless sucks. Th... | How crowded the spectrum is in your area is going to be the biggest factor influencing your success. In environments where 802.11 has already been deployed densely your radios will be fighting for bandwidth with everyone else's radios. This will radically diminish the effective range of your access points. If you're se... |
7,567,097 | I have a collection class that implements IEnumerable and I am having trouble deserializing a serialized version of the same. I am using Json.net v 4.0.2.13623
Here is a simplier version of my collection class that illustrates my issue
```
public class MyType
{
public int Number { get; private set; }
public MyTyp... | 2011/09/27 | [
"https://Stackoverflow.com/questions/7567097",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/257788/"
] | As of Json.NET 6.0 Release 3 and later (I tested on 8.0.3), this works automatically as long as the custom class implementing `IEnumerable<MyType>` has a constructor that takes an `IEnumerable<MyType>` input argument. From the [release notes](http://james.newtonking.com/archive/2014/04/30/json-net-6-0-release-3-seriali... | I believe JSON .NET depends on having a parameterless constructor for the types it deserializes to. From a deserialization point of view it has no idea what to provide to the constrcutor.
As for your collection, again how is it supposed to know how to populate an implementation of `IEnumerable<T>` which only defines h... |
28,448 | Is there a good web-based option for back-testing of equity options trading strategies. | 2016/08/02 | [
"https://quant.stackexchange.com/questions/28448",
"https://quant.stackexchange.com",
"https://quant.stackexchange.com/users/22836/"
] | [GetVolatility](https://www.getvolatility.com) features a pretty robust backtest capability. But be aware, it's paid and somehow expensive, since it focus on professional traders. | Thinkorswim brokerage platform has some backtesting capability. Not sure how good it is. |
28,448 | Is there a good web-based option for back-testing of equity options trading strategies. | 2016/08/02 | [
"https://quant.stackexchange.com/questions/28448",
"https://quant.stackexchange.com",
"https://quant.stackexchange.com/users/22836/"
] | See [this](https://www.quantopian.com/posts/options-trading-quick-simple-question-im-a-newbee) workaround suggestion for [Quantopian](https://www.quantopian.com/home):
>
> As of now Quantopian only offers equity trading. However, I think it would be fairly easy to hack something together for the sake of backtesting.
... | Thinkorswim brokerage platform has some backtesting capability. Not sure how good it is. |
28,448 | Is there a good web-based option for back-testing of equity options trading strategies. | 2016/08/02 | [
"https://quant.stackexchange.com/questions/28448",
"https://quant.stackexchange.com",
"https://quant.stackexchange.com/users/22836/"
] | [GetVolatility](https://www.getvolatility.com) features a pretty robust backtest capability. But be aware, it's paid and somehow expensive, since it focus on professional traders. | See [this](https://www.quantopian.com/posts/options-trading-quick-simple-question-im-a-newbee) workaround suggestion for [Quantopian](https://www.quantopian.com/home):
>
> As of now Quantopian only offers equity trading. However, I think it would be fairly easy to hack something together for the sake of backtesting.
... |
28,448 | Is there a good web-based option for back-testing of equity options trading strategies. | 2016/08/02 | [
"https://quant.stackexchange.com/questions/28448",
"https://quant.stackexchange.com",
"https://quant.stackexchange.com/users/22836/"
] | [GetVolatility](https://www.getvolatility.com) features a pretty robust backtest capability. But be aware, it's paid and somehow expensive, since it focus on professional traders. | [Optionsprofitcalculator](http://www.optionsprofitcalculator.com/)
primarily lets users get an overview of option position prices in regard to underlying price at expiration. But you can also fiddle around with certain fields if you know the backdated options values. You just have to expand "manual entry options." |
28,448 | Is there a good web-based option for back-testing of equity options trading strategies. | 2016/08/02 | [
"https://quant.stackexchange.com/questions/28448",
"https://quant.stackexchange.com",
"https://quant.stackexchange.com/users/22836/"
] | See [this](https://www.quantopian.com/posts/options-trading-quick-simple-question-im-a-newbee) workaround suggestion for [Quantopian](https://www.quantopian.com/home):
>
> As of now Quantopian only offers equity trading. However, I think it would be fairly easy to hack something together for the sake of backtesting.
... | [Optionsprofitcalculator](http://www.optionsprofitcalculator.com/)
primarily lets users get an overview of option position prices in regard to underlying price at expiration. But you can also fiddle around with certain fields if you know the backdated options values. You just have to expand "manual entry options." |
39,552,784 | How can I in my project settings.py override a setting from an apps settings.py?
I tried importing it like this:
```
import app.settings
EXTENSIONS = {
'Folder': [''],
'Image': ['.jpg', '.jpeg', '.gif', '.png', '.tif', '.tiff', '.svg'],
}
```
**But I get an error:**
>
> django.core.exceptions.ImproperlyCo... | 2016/09/17 | [
"https://Stackoverflow.com/questions/39552784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6757025/"
] | Your SECRET\_KEY is empty or missing in settings.py file.
Add random generated SECRET\_KEY to settings file.
For example:
```
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '=6x$7smkllimrwa@j+d7(tr%i=3cax!bz+0vyje%$!gj+*dvd4'
``` | I think what you're looking for is:
```
from app.settings import *
```
The goal is to import the settings into the module namespace. |
13,096,557 | I have the following code to convert PNG to JPG using Ruby RMagick and the converted image always have a border around it. Anyway to avoid it?
* Mac OS X 10.8.2
* ruby 1.9.3p286 (2012-10-12 revision 37165) [x86\_64-darwin12]
* rmagick (2.13.1)
* MacPorts 2.1.2
* ImageMagick @6.8.0-2\_0+q8+wmf (active)
Here is my code... | 2012/10/27 | [
"https://Stackoverflow.com/questions/13096557",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1313917/"
] | The original png image has a transparency channel (the transparent border around the window). Jpg-images do not support transparency. Hence ImageMagick has to do something to the transparency when converting to jpg. In your case it converts the alpha channel to black.
To change the default background color you can do ... | JPG files do not have an alpha channel, therefore cannot have any pixels that are transparent or semi-transparent. The border is just that fading black regular border, turned opaque by the file transition. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.