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 |
|---|---|---|---|---|---|
16,086,851 | In spreadsheet cell B1, the value is -1200.
I want cell B2 to copy the value of B1 and limit (validate?) it to no less than -800.
I'm using google docs but can also use excel if those functions are not available in google docs.
Edit:
If B1 has the value of 2000, B2 should have the value of 2000.
If B1 has the valu... | 2013/04/18 | [
"https://Stackoverflow.com/questions/16086851",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2295658/"
] | Excel & Google Spreadsheets
```
=Max(B1,-800)
``` | You don't need any maths here. I'm using Excel but I think it is pretty similar in Google.
Suppose that B3 holds floor, no constants in formulae :-)
B2 => =if( b1 > $b$3; b1; $b$3)
b3 position is fixed so you can copy the expression |
7,553,865 | Good day, i have mongodb database filled with some data, i ensured that data stored in correct charset, to fetch data i use following snippet:
```
{-# LANGUAGE OverloadedStrings #-}
import Network.Wai
import Network.Wai.Handler.Warp (run)
import Data.Enumerator (Iteratee (..))
import Data.Either (either)
import Contro... | 2011/09/26 | [
"https://Stackoverflow.com/questions/7553865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/250944/"
] | Your frined is `ABAddressBook`: <http://developer.apple.com/library/mac/#documentation/UserExperience/Reference/AddressBook/Classes/ABAddressBook_Class/Reference/Reference.html>
It has `(NSArray *)people` that returns you all contacts.
You can use that as the source for your table.
I do not have complete sample code av... | [**Here**](https://stackoverflow.com/questions/7118772/how-to-get-contacts-detail-of-iphone-and-make-csv-file-of-that-contact/7119251#7119251) is the solution that you are looking for. In that, you will get required data from the method **-(void)collectContacts**. |
7,553,865 | Good day, i have mongodb database filled with some data, i ensured that data stored in correct charset, to fetch data i use following snippet:
```
{-# LANGUAGE OverloadedStrings #-}
import Network.Wai
import Network.Wai.Handler.Warp (run)
import Data.Enumerator (Iteratee (..))
import Data.Either (either)
import Contro... | 2011/09/26 | [
"https://Stackoverflow.com/questions/7553865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/250944/"
] | Your frined is `ABAddressBook`: <http://developer.apple.com/library/mac/#documentation/UserExperience/Reference/AddressBook/Classes/ABAddressBook_Class/Reference/Reference.html>
It has `(NSArray *)people` that returns you all contacts.
You can use that as the source for your table.
I do not have complete sample code av... | Yeah, I got the solution...
Use this code
```
// creating the picker
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
// place the delegate of the picker to the controll
picker.peoplePickerDelegate = self;
// showing the picker
[self presentModalViewController:picker an... |
7,553,865 | Good day, i have mongodb database filled with some data, i ensured that data stored in correct charset, to fetch data i use following snippet:
```
{-# LANGUAGE OverloadedStrings #-}
import Network.Wai
import Network.Wai.Handler.Warp (run)
import Data.Enumerator (Iteratee (..))
import Data.Either (either)
import Contro... | 2011/09/26 | [
"https://Stackoverflow.com/questions/7553865",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/250944/"
] | [**Here**](https://stackoverflow.com/questions/7118772/how-to-get-contacts-detail-of-iphone-and-make-csv-file-of-that-contact/7119251#7119251) is the solution that you are looking for. In that, you will get required data from the method **-(void)collectContacts**. | Yeah, I got the solution...
Use this code
```
// creating the picker
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
// place the delegate of the picker to the controll
picker.peoplePickerDelegate = self;
// showing the picker
[self presentModalViewController:picker an... |
73,567,318 | I have a problem with some Observable and error handling.
I have to make a call to an API for deleting a resource, but if this resource is used from some other element the DB send an error back.
I've used the try-catch statement too, but it doesn't work.
That's the function:
```
try {
this.itemServ... | 2022/09/01 | [
"https://Stackoverflow.com/questions/73567318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/785053/"
] | If you want to use the catch() of the Observable you need to use Observable.throw() method before delegating the error response to a method
```js
import { Injectable } from '@angular/core';
import { Headers, Http, ResponseOptions} from '@angular/http';
import { AuthHttp } from 'angular2-jwt';
import { MEAT_API } from... | try catch block won't work here, unless there is a system exception. Try to use pipe and catchError operator from rxjs.
Or you could use tap operator from rxjs to debug the error.
Also, check if you are using http interceptor in the application, which might be intercepting the delete request and handling the error |
73,567,318 | I have a problem with some Observable and error handling.
I have to make a call to an API for deleting a resource, but if this resource is used from some other element the DB send an error back.
I've used the try-catch statement too, but it doesn't work.
That's the function:
```
try {
this.itemServ... | 2022/09/01 | [
"https://Stackoverflow.com/questions/73567318",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/785053/"
] | You are not throwing error from your API, You are sending Ok({YourObject}).
You need to send 404/error from your API or need cast your response object and manually check the error information like.
```
`this.yourservice.delete(this.item).subscribe(
res => {
if(res.statusCode==400){
// h... | try catch block won't work here, unless there is a system exception. Try to use pipe and catchError operator from rxjs.
Or you could use tap operator from rxjs to debug the error.
Also, check if you are using http interceptor in the application, which might be intercepting the delete request and handling the error |
2,291,249 | I am trying to understand the history of my codebase, which resides in TFS 2005, and I encountered a changeset where all changes were marked as both branch and merge.
```
Name Change Folder
------------------------------------------------
A.cs merge, branch $/Root/Solution/Project
```
I am unabl... | 2010/02/18 | [
"https://Stackoverflow.com/questions/2291249",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/252344/"
] | Merge can be combined with anything except Add. On its own, Merge just means that (1) whatever happened is the result of invoking the Merge command (2) when you checkin, TFS will record the appropriate merge history metadata in addition to the changes themselves. The remaining operation(s) in the list of changetypes te... | This might make sense if the file were created during a branch operation and changes from the source branch were then merged into the new branch without having checked in at any point. |
2,546,868 | I have a pool of MySQL connections for a web-based data service. When it starts to service a request, it takes a connection from the pool to use. The problem is that if there has been a significant pause since that particular connection has been used, the server may have timed it out and closed its end. I'd like to be ... | 2010/03/30 | [
"https://Stackoverflow.com/questions/2546868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/138311/"
] | You **will not know the real state of the connection without going over the wire**, and `SELECT 1` is a good enough candidate (arguably you could come up with a shorter command which takes less time to parse, but compared to network or even loopback latency those savings would be insignificant.)
This being said, I wou... | "Connection" in this case has multiple meanings. MySQL listens on a socket- that's the network-level "connection." MySQL maintains "database connections," which include a context for query execution and other overhead.
If you just want to know if the service is listening, you should be able to execute a network-level... |
2,546,868 | I have a pool of MySQL connections for a web-based data service. When it starts to service a request, it takes a connection from the pool to use. The problem is that if there has been a significant pause since that particular connection has been used, the server may have timed it out and closed its end. I'd like to be ... | 2010/03/30 | [
"https://Stackoverflow.com/questions/2546868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/138311/"
] | I'm not sure what API you are currently using (or what language), but for Java, there is a special trick the JDBC driver can do.
The standard test query is:
```
select 1
```
as you've indicated. If you modify it to:
```
/* ping */ select 1
```
the JDBC driver will notice this, and send only a single packet to t... | "Connection" in this case has multiple meanings. MySQL listens on a socket- that's the network-level "connection." MySQL maintains "database connections," which include a context for query execution and other overhead.
If you just want to know if the service is listening, you should be able to execute a network-level... |
2,546,868 | I have a pool of MySQL connections for a web-based data service. When it starts to service a request, it takes a connection from the pool to use. The problem is that if there has been a significant pause since that particular connection has been used, the server may have timed it out and closed its end. I'd like to be ... | 2010/03/30 | [
"https://Stackoverflow.com/questions/2546868",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/138311/"
] | You **will not know the real state of the connection without going over the wire**, and `SELECT 1` is a good enough candidate (arguably you could come up with a shorter command which takes less time to parse, but compared to network or even loopback latency those savings would be insignificant.)
This being said, I wou... | I'm not sure what API you are currently using (or what language), but for Java, there is a special trick the JDBC driver can do.
The standard test query is:
```
select 1
```
as you've indicated. If you modify it to:
```
/* ping */ select 1
```
the JDBC driver will notice this, and send only a single packet to t... |
60,162,164 | In my **PostgreSQL** database I have table with such structure:
```
| organization_id | organization_name | parent_organization_id | tree_organization_id |
|-----------------|-------------------|------------------------|----------------------|
| 1 | Alphabet | | ... | 2020/02/11 | [
"https://Stackoverflow.com/questions/60162164",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4332480/"
] | Use [Common Table Expression(CTE)](https://www.postgresql.org/docs/current/queries-with.html) to list all the parent or children relationship. With the help of CTE, you can eliminate the tree\_organization\_id column.
The [link](https://dzone.com/articles/understanding-recursive-queries-in-postgres) provides a very go... | it's either way you can follow, i would prefer to recursively iterate over `parent_organisation_id`.
here is the Query Below.
```
select * from company where
organization_id in( select parent_organization_id
from company where parent_organization_id is not null);
```
you can find the
[wo... |
44,736,006 | I'm working on a application using node.js and I'm wondering whether I should add it to the npm registry so that it's easy to install. It's not a module that you would be able to use, which is what the majority of packages on npm are.
If npm isn't the right place to publish it, is there another place I can publish it... | 2017/06/24 | [
"https://Stackoverflow.com/questions/44736006",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | One way to publish your application is to create a website and store your releases on it. Fortunately github offers a way to create a website out of your github repository. For more information you can go to this [link](https://pages.github.com/)
Forcing users to download your application through `npm` is not a good i... | I do that all the time (publish to npmjs), but I put it under an organization.
Check out [NPM org](https://www.npmjs.com/features)
You can make your code available in the path by setting the [bin](https://docs.npmjs.com/files/package.json#bin) section of `package.json`.
All the user now needs to do to use your appli... |
2,069,832 | i want to restrict certain emails to my website.
an example would be that i only want people with gmail accounts to register to my website.
```
{
/* Check if valid email address */
$regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*"
."@[a-z0-9-]+(\.[a-z0-9-]{1,})*"
."\.([a-z]{2,}){1}$";
... | 2010/01/15 | [
"https://Stackoverflow.com/questions/2069832",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Don't use a single regex for checking the entire address. Use strrpos() split the address to local part and domain name, check them separately. Domain is easy to check, the local part is almost impossible (and you shouldn't even care about it). | I suggest you keep an array of regex patterns that you would like the email address to match against. then write a loop to iterate over the array and check the address. whenever a check failed, set some validation flag to false. after the loop, by checking the validation flag you can make sure that the email address is... |
2,069,832 | i want to restrict certain emails to my website.
an example would be that i only want people with gmail accounts to register to my website.
```
{
/* Check if valid email address */
$regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*"
."@[a-z0-9-]+(\.[a-z0-9-]{1,})*"
."\.([a-z]{2,}){1}$";
... | 2010/01/15 | [
"https://Stackoverflow.com/questions/2069832",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Don't use a single regex for checking the entire address. Use strrpos() split the address to local part and domain name, check them separately. Domain is easy to check, the local part is almost impossible (and you shouldn't even care about it). | How about doing something like:
```
list(,$domain) = explode('@',$email);
if ($domain != 'gmail.com')
echo 'not possible to register';
else
echo 'Will register';
```
If you want to validate the email use the filter functions |
58,468,493 | Is this valid: <https://godbolt.org/z/_i9dwf>
```
#include <typeinfo>
#include <iostream>
template<typename T>
struct Container
{
};
void fn()
{
return;
}
template<typename T, typename...type_pack>
void fn(const Container<T>& head, const Container<type_pack>&... args)
{
std::cout << "I am an " << typeid(T).... | 2019/10/19 | [
"https://Stackoverflow.com/questions/58468493",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2448032/"
] | In order to avoid this kind of behaviour I suggest you to put all your code in a main function, so that everything is loaded when you need it
E.G.
```
#!/bin/bash
main() {
if [[ $adapter == "1" ]]; then
usepreferredadapter
elif [[ $adapter == "2" ]]; then
...
fi
}
function usepreferredadapter(){
...
... | Try shifting the function definition before the line where the function is called, i.e. shift your function definition at line #89 to some place before line #66. |
21,320,108 | Ok, I have wrote this RandomNumberGenerator.java class and I am getting an error. Logically it looks like it would work but it is not. I need to have a random number between the two input's that the user input's. Would someone take a look at my code and see where I am going wrong. Here is my code:
```
import java.util... | 2014/01/23 | [
"https://Stackoverflow.com/questions/21320108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1252911/"
] | Your code structure is incorrect. The getRandom(..) method is defined inside your main method. You also have scoping issues (you're defining the 'r' variable inside one method and attempting to use it in another).
Try starting small and concentrate on getting your indentation right, then these kinds of errors will bec... | Your method,
```
public static int genRandom(int mod){
Random r = new Random();
}
```
is inside of your main method. You can't declare one method inside of another just like that. You should declare it outside of your main method. Also, you've declared it to return an int, which means you actually have to make i... |
21,320,108 | Ok, I have wrote this RandomNumberGenerator.java class and I am getting an error. Logically it looks like it would work but it is not. I need to have a random number between the two input's that the user input's. Would someone take a look at my code and see where I am going wrong. Here is my code:
```
import java.util... | 2014/01/23 | [
"https://Stackoverflow.com/questions/21320108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1252911/"
] | Your code structure is incorrect. The getRandom(..) method is defined inside your main method. You also have scoping issues (you're defining the 'r' variable inside one method and attempting to use it in another).
Try starting small and concentrate on getting your indentation right, then these kinds of errors will bec... | try this
```
public class RandomRange {
public static void main(String[] args) {
int min = 50;
int max = 100;
for (int i = 0; i < 10; i++) {
int rnd = (int) ((Math.random() * (max + 1 - min))) + min;
System.out.println(rnd);
}
}
}
``` |
21,320,108 | Ok, I have wrote this RandomNumberGenerator.java class and I am getting an error. Logically it looks like it would work but it is not. I need to have a random number between the two input's that the user input's. Would someone take a look at my code and see where I am going wrong. Here is my code:
```
import java.util... | 2014/01/23 | [
"https://Stackoverflow.com/questions/21320108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1252911/"
] | Your code structure is incorrect. The getRandom(..) method is defined inside your main method. You also have scoping issues (you're defining the 'r' variable inside one method and attempting to use it in another).
Try starting small and concentrate on getting your indentation right, then these kinds of errors will bec... | Following Code Will Work. Basically you have a non final method inside main method.
```
import java.util.Random;
import java.util.Scanner;
public class NumberGenerator {
// Begin
static Random r = new Random();
public static void main(String[] args) {
Scanner input;
int max, min, range... |
21,320,108 | Ok, I have wrote this RandomNumberGenerator.java class and I am getting an error. Logically it looks like it would work but it is not. I need to have a random number between the two input's that the user input's. Would someone take a look at my code and see where I am going wrong. Here is my code:
```
import java.util... | 2014/01/23 | [
"https://Stackoverflow.com/questions/21320108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1252911/"
] | Your code structure is incorrect. The getRandom(..) method is defined inside your main method. You also have scoping issues (you're defining the 'r' variable inside one method and attempting to use it in another).
Try starting small and concentrate on getting your indentation right, then these kinds of errors will bec... | You declare an object:
```
Random gen;
```
Then you create a method called `genRandom(int mod)` which instantiates a new Random object '`r`'. Which is INSIDE your main method. Which isn't correct.
Then when you go to call a method to get a random number you choose to use '`r`' which is not in the scope of the state... |
21,320,108 | Ok, I have wrote this RandomNumberGenerator.java class and I am getting an error. Logically it looks like it would work but it is not. I need to have a random number between the two input's that the user input's. Would someone take a look at my code and see where I am going wrong. Here is my code:
```
import java.util... | 2014/01/23 | [
"https://Stackoverflow.com/questions/21320108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1252911/"
] | Your method,
```
public static int genRandom(int mod){
Random r = new Random();
}
```
is inside of your main method. You can't declare one method inside of another just like that. You should declare it outside of your main method. Also, you've declared it to return an int, which means you actually have to make i... | try this
```
public class RandomRange {
public static void main(String[] args) {
int min = 50;
int max = 100;
for (int i = 0; i < 10; i++) {
int rnd = (int) ((Math.random() * (max + 1 - min))) + min;
System.out.println(rnd);
}
}
}
``` |
21,320,108 | Ok, I have wrote this RandomNumberGenerator.java class and I am getting an error. Logically it looks like it would work but it is not. I need to have a random number between the two input's that the user input's. Would someone take a look at my code and see where I am going wrong. Here is my code:
```
import java.util... | 2014/01/23 | [
"https://Stackoverflow.com/questions/21320108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1252911/"
] | Your method,
```
public static int genRandom(int mod){
Random r = new Random();
}
```
is inside of your main method. You can't declare one method inside of another just like that. You should declare it outside of your main method. Also, you've declared it to return an int, which means you actually have to make i... | You declare an object:
```
Random gen;
```
Then you create a method called `genRandom(int mod)` which instantiates a new Random object '`r`'. Which is INSIDE your main method. Which isn't correct.
Then when you go to call a method to get a random number you choose to use '`r`' which is not in the scope of the state... |
21,320,108 | Ok, I have wrote this RandomNumberGenerator.java class and I am getting an error. Logically it looks like it would work but it is not. I need to have a random number between the two input's that the user input's. Would someone take a look at my code and see where I am going wrong. Here is my code:
```
import java.util... | 2014/01/23 | [
"https://Stackoverflow.com/questions/21320108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1252911/"
] | Following Code Will Work. Basically you have a non final method inside main method.
```
import java.util.Random;
import java.util.Scanner;
public class NumberGenerator {
// Begin
static Random r = new Random();
public static void main(String[] args) {
Scanner input;
int max, min, range... | try this
```
public class RandomRange {
public static void main(String[] args) {
int min = 50;
int max = 100;
for (int i = 0; i < 10; i++) {
int rnd = (int) ((Math.random() * (max + 1 - min))) + min;
System.out.println(rnd);
}
}
}
``` |
21,320,108 | Ok, I have wrote this RandomNumberGenerator.java class and I am getting an error. Logically it looks like it would work but it is not. I need to have a random number between the two input's that the user input's. Would someone take a look at my code and see where I am going wrong. Here is my code:
```
import java.util... | 2014/01/23 | [
"https://Stackoverflow.com/questions/21320108",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1252911/"
] | Following Code Will Work. Basically you have a non final method inside main method.
```
import java.util.Random;
import java.util.Scanner;
public class NumberGenerator {
// Begin
static Random r = new Random();
public static void main(String[] args) {
Scanner input;
int max, min, range... | You declare an object:
```
Random gen;
```
Then you create a method called `genRandom(int mod)` which instantiates a new Random object '`r`'. Which is INSIDE your main method. Which isn't correct.
Then when you go to call a method to get a random number you choose to use '`r`' which is not in the scope of the state... |
67,354 | Bismillah.
Dear brothers of faith, may peace be upon you all.
I am recent convert to Islam and got some worries about cremation rituals for my non Muslim family. My old religion encourages burning cremation ceremony and as I am elder one I would need to step up to light the fire. What is the ruling on this.
Is it fo... | 2021/04/08 | [
"https://islam.stackexchange.com/questions/67354",
"https://islam.stackexchange.com",
"https://islam.stackexchange.com/users/43533/"
] | It is required for you to bury the bodies of those who have departed from this world. God has provided us in the Holy Quran on what to do with the corpse, with the example of a crow scratching in the ground, as seen in the following verse within the Holy Quran,
*Thereupon Allah sent forth a raven who began to scratch ... | It is clear that Islam prescribes burial, not cremation.
You may to opt for burial, if this is not encouraged but permitted in the religion of your relatives (you did not say what other religion you mean).
If this is excluded, you might also assist cremation. The following Hadit implies that Allah may forgive you in ... |
67,354 | Bismillah.
Dear brothers of faith, may peace be upon you all.
I am recent convert to Islam and got some worries about cremation rituals for my non Muslim family. My old religion encourages burning cremation ceremony and as I am elder one I would need to step up to light the fire. What is the ruling on this.
Is it fo... | 2021/04/08 | [
"https://islam.stackexchange.com/questions/67354",
"https://islam.stackexchange.com",
"https://islam.stackexchange.com/users/43533/"
] | It is not allowed for you to assist in cremation. That is a tradition of Hinduism and not allowed in Islam. If the funeral were up to you, you would simply bury him.
A fatwa on this topic:
>
> Q. Can a Muslim male (only boy to his parents) perform funeral rites for his Hindu father? There may be no one else to do it... | It is clear that Islam prescribes burial, not cremation.
You may to opt for burial, if this is not encouraged but permitted in the religion of your relatives (you did not say what other religion you mean).
If this is excluded, you might also assist cremation. The following Hadit implies that Allah may forgive you in ... |
19,893,249 | How do I get the customer group id from a sales/order\_item collection? I realise I may need to traverse back up the sales tree but don't know how to do this?
Thanks in advance!
**EDIT**
I realise I was pretty vague with this question. What I need to do is get the total sales for a product, but only where purchased ... | 2013/11/10 | [
"https://Stackoverflow.com/questions/19893249",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/509607/"
] | If the collection you have is of type `Mage_Sales_Model_Resource_Order_Item_Collection` then you can do the following. Assuming that your collection is `$orderItems`.
```
$order = $orderItems->getSalesOrder();
$customerGroupId = $order->getCustomerGroupId();
``` | I have got it working. I add the join after the initial "build" of the query like so:
```
$collection = Mage::getModel('sales/order_item')->getCollection()
->addExpressionFieldToSelect('ordered','SUM({{qty_ordered}})' , array('qty_ordered'=>'qty_ordered'))
->addAttributeToFilter('main_table.product_id', $produ... |
19,893,249 | How do I get the customer group id from a sales/order\_item collection? I realise I may need to traverse back up the sales tree but don't know how to do this?
Thanks in advance!
**EDIT**
I realise I was pretty vague with this question. What I need to do is get the total sales for a product, but only where purchased ... | 2013/11/10 | [
"https://Stackoverflow.com/questions/19893249",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/509607/"
] | If the collection you have is of type `Mage_Sales_Model_Resource_Order_Item_Collection` then you can do the following. Assuming that your collection is `$orderItems`.
```
$order = $orderItems->getSalesOrder();
$customerGroupId = $order->getCustomerGroupId();
``` | Instead of using, `$collection->getTable('sales/order')`
use, `'sales_flat_order'`.
So your line would be,
`array('orders_table' => 'sales_flat_order'),` |
57,666 | I'm writing some documentation for a web-based application that will run on Android tablets at the factory at which I am employed.
I am having trouble wording the steps where the users must interact with the onscreen buttons via touch.
For example "1. Enter or scan your clock number and then"... "click the button", "... | 2014/05/21 | [
"https://ux.stackexchange.com/questions/57666",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/45745/"
] | The Android setup screen used to instruct the user to **touch** the Android to begin, but I personally use **tap** for everything touch-related, as it's smaller, thus making instructions as simplistic as possible.
It is worth noting that if your buttons merely say **Tap here** then you should consider changing the tex... | Personally I would think that 'tap' is the preferred description, as this also infers a touch of a short duration. If asked to touch something, a user could reasonably continue touching the thing for a significant period of time. Many UIs interpret a touch-and-hold as an alternate gesture (e.g. iOS).
'Click', 'push' a... |
57,666 | I'm writing some documentation for a web-based application that will run on Android tablets at the factory at which I am employed.
I am having trouble wording the steps where the users must interact with the onscreen buttons via touch.
For example "1. Enter or scan your clock number and then"... "click the button", "... | 2014/05/21 | [
"https://ux.stackexchange.com/questions/57666",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/45745/"
] | As you will be using Android, perhaps refer to their own [Design Principles documentation](https://developer.apple.com/library/ios/documentation/userexperience/conceptual/MobileHIG/InteractivityInput.html#//apple_ref/doc/uid/TP40006556-CH55-SW1)? They use 'touch';
>
> Access the entire collection of apps and widgets... | **Click** implies the pressing of a physical switch which then creates a 'click' *sound* - typically on devices with input devices attached (such as a mouse)
**Push** implies moving something out of its original position, typical of a physical button, again similar to a mouse (or moreso key) input
**Press** implies ... |
57,666 | I'm writing some documentation for a web-based application that will run on Android tablets at the factory at which I am employed.
I am having trouble wording the steps where the users must interact with the onscreen buttons via touch.
For example "1. Enter or scan your clock number and then"... "click the button", "... | 2014/05/21 | [
"https://ux.stackexchange.com/questions/57666",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/45745/"
] | As you will be using Android, perhaps refer to their own [Design Principles documentation](https://developer.apple.com/library/ios/documentation/userexperience/conceptual/MobileHIG/InteractivityInput.html#//apple_ref/doc/uid/TP40006556-CH55-SW1)? They use 'touch';
>
> Access the entire collection of apps and widgets... | The Android setup screen used to instruct the user to **touch** the Android to begin, but I personally use **tap** for everything touch-related, as it's smaller, thus making instructions as simplistic as possible.
It is worth noting that if your buttons merely say **Tap here** then you should consider changing the tex... |
57,666 | I'm writing some documentation for a web-based application that will run on Android tablets at the factory at which I am employed.
I am having trouble wording the steps where the users must interact with the onscreen buttons via touch.
For example "1. Enter or scan your clock number and then"... "click the button", "... | 2014/05/21 | [
"https://ux.stackexchange.com/questions/57666",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/45745/"
] | As you will be using Android, perhaps refer to their own [Design Principles documentation](https://developer.apple.com/library/ios/documentation/userexperience/conceptual/MobileHIG/InteractivityInput.html#//apple_ref/doc/uid/TP40006556-CH55-SW1)? They use 'touch';
>
> Access the entire collection of apps and widgets... | Personally I would think that 'tap' is the preferred description, as this also infers a touch of a short duration. If asked to touch something, a user could reasonably continue touching the thing for a significant period of time. Many UIs interpret a touch-and-hold as an alternate gesture (e.g. iOS).
'Click', 'push' a... |
57,666 | I'm writing some documentation for a web-based application that will run on Android tablets at the factory at which I am employed.
I am having trouble wording the steps where the users must interact with the onscreen buttons via touch.
For example "1. Enter or scan your clock number and then"... "click the button", "... | 2014/05/21 | [
"https://ux.stackexchange.com/questions/57666",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/45745/"
] | The Android setup screen used to instruct the user to **touch** the Android to begin, but I personally use **tap** for everything touch-related, as it's smaller, thus making instructions as simplistic as possible.
It is worth noting that if your buttons merely say **Tap here** then you should consider changing the tex... | I would go with "select", since in fact many touchscreen applications are now touch-to-highlight/drag-to-choose/lift-to-commit. That interaction sequence deals with initially erroneous touches, and calibration issues, MUCH more smoothly than anything else. You *can* tap with that system, but you get better accuracy if ... |
57,666 | I'm writing some documentation for a web-based application that will run on Android tablets at the factory at which I am employed.
I am having trouble wording the steps where the users must interact with the onscreen buttons via touch.
For example "1. Enter or scan your clock number and then"... "click the button", "... | 2014/05/21 | [
"https://ux.stackexchange.com/questions/57666",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/45745/"
] | As you will be using Android, perhaps refer to their own [Design Principles documentation](https://developer.apple.com/library/ios/documentation/userexperience/conceptual/MobileHIG/InteractivityInput.html#//apple_ref/doc/uid/TP40006556-CH55-SW1)? They use 'touch';
>
> Access the entire collection of apps and widgets... | A button (that will trigger some action) is **pressed**, **pushed** or **activated**.
To do so in a web form, you can either point your mouse at it and **click** it (on a desktop PC) or **tap** at the element (on a touch device).
I would not use the term "select", that sounds as if you were choosing one from a set of... |
57,666 | I'm writing some documentation for a web-based application that will run on Android tablets at the factory at which I am employed.
I am having trouble wording the steps where the users must interact with the onscreen buttons via touch.
For example "1. Enter or scan your clock number and then"... "click the button", "... | 2014/05/21 | [
"https://ux.stackexchange.com/questions/57666",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/45745/"
] | There's no 'right' answer here. What is more important is that you are consistent within your own documentation.
Regarding touch interfaces, the typical interaction is 'tap'.
Regarding desktops, the typical interaction is 'click'.
In both cases, it's not the ONLY interaction, however, as both touch devices and desk... | A button (that will trigger some action) is **pressed**, **pushed** or **activated**.
To do so in a web form, you can either point your mouse at it and **click** it (on a desktop PC) or **tap** at the element (on a touch device).
I would not use the term "select", that sounds as if you were choosing one from a set of... |
57,666 | I'm writing some documentation for a web-based application that will run on Android tablets at the factory at which I am employed.
I am having trouble wording the steps where the users must interact with the onscreen buttons via touch.
For example "1. Enter or scan your clock number and then"... "click the button", "... | 2014/05/21 | [
"https://ux.stackexchange.com/questions/57666",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/45745/"
] | A button (that will trigger some action) is **pressed**, **pushed** or **activated**.
To do so in a web form, you can either point your mouse at it and **click** it (on a desktop PC) or **tap** at the element (on a touch device).
I would not use the term "select", that sounds as if you were choosing one from a set of... | I would go with "select", since in fact many touchscreen applications are now touch-to-highlight/drag-to-choose/lift-to-commit. That interaction sequence deals with initially erroneous touches, and calibration issues, MUCH more smoothly than anything else. You *can* tap with that system, but you get better accuracy if ... |
57,666 | I'm writing some documentation for a web-based application that will run on Android tablets at the factory at which I am employed.
I am having trouble wording the steps where the users must interact with the onscreen buttons via touch.
For example "1. Enter or scan your clock number and then"... "click the button", "... | 2014/05/21 | [
"https://ux.stackexchange.com/questions/57666",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/45745/"
] | As you will be using Android, perhaps refer to their own [Design Principles documentation](https://developer.apple.com/library/ios/documentation/userexperience/conceptual/MobileHIG/InteractivityInput.html#//apple_ref/doc/uid/TP40006556-CH55-SW1)? They use 'touch';
>
> Access the entire collection of apps and widgets... | I would go with "select", since in fact many touchscreen applications are now touch-to-highlight/drag-to-choose/lift-to-commit. That interaction sequence deals with initially erroneous touches, and calibration issues, MUCH more smoothly than anything else. You *can* tap with that system, but you get better accuracy if ... |
57,666 | I'm writing some documentation for a web-based application that will run on Android tablets at the factory at which I am employed.
I am having trouble wording the steps where the users must interact with the onscreen buttons via touch.
For example "1. Enter or scan your clock number and then"... "click the button", "... | 2014/05/21 | [
"https://ux.stackexchange.com/questions/57666",
"https://ux.stackexchange.com",
"https://ux.stackexchange.com/users/45745/"
] | On a mobile device you use gestural movements, in this case it would be TAP. You can use the word click but it will be read as being out of date or out of touch. | I would go with "select", since in fact many touchscreen applications are now touch-to-highlight/drag-to-choose/lift-to-commit. That interaction sequence deals with initially erroneous touches, and calibration issues, MUCH more smoothly than anything else. You *can* tap with that system, but you get better accuracy if ... |
71,931,690 | I need help making the following query only display one result, the one with the `MAX Procurement Rate`.
Currently the query works, but displays all results not just the one with the output of the `MAX` function
```
SELECT SalesPeople.SalesPersonID, FirstName, LastName, Region, SalesRevenueYear1, ProcurementCost
FROM... | 2022/04/19 | [
"https://Stackoverflow.com/questions/71931690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18864860/"
] | If you add a LIMIT 1 clause at the end of your SQL, then only the first record will be shown. If you add an ORDER BY `column_name`, then the results will be ordered by that column. Using these two together is a quick way to get the max or min without having to worry about aggregate functions.
<https://www.w3schools.com... | As mentioned, you need to correlate the subquery to outer query. Be sure to use aliases between same named columns and exercise good practice in qualifying all columns with table names or aliases especially in `JOIN` queries:
```sql
SELECT sp.SalesPersonID, sp.FirstName, sp.LastName, sp.Region, sp.SalesRevenueYear1,
... |
32,649,085 | My String is
>
> "Success Entries and Failed Entries: {FAILED\_ENTRIES={},
> SUCCESS\_ENTRIES={123=1509170142065114105}}"
>
>
>
Here i want to filter out only **1509170142065114105** this string here 123 can be anything.
how can I do it ? | 2015/09/18 | [
"https://Stackoverflow.com/questions/32649085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1941853/"
] | You can use regex `.*(?:\\D|^)(\\d+).*` to get last number in the `String`.
**USE:**
```
public static void main(String[] args) {
String s = "{FAILED_ENTRIES={}, SUCCESS_ENTRIES={123=1509170142065114105}}";
System.out.println(s.replaceAll(".*(?:\\D|^)(\\d+).*", "$1"));
}
```
**OUTPUT:**
```
150917014206511... | A regex will work for you.
```
public static void main(String args[]) {
String s = "{FAILED_ENTRIES={}, SUCCESS_ENTRIES={123=1509170142065114105}}";
System.out.println(s.replaceAll(".*=(\\d+).*", "$1"));
}
```
O/P :
```
1509170142065114105
``` |
32,649,085 | My String is
>
> "Success Entries and Failed Entries: {FAILED\_ENTRIES={},
> SUCCESS\_ENTRIES={123=1509170142065114105}}"
>
>
>
Here i want to filter out only **1509170142065114105** this string here 123 can be anything.
how can I do it ? | 2015/09/18 | [
"https://Stackoverflow.com/questions/32649085",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1941853/"
] | You can use regex `.*(?:\\D|^)(\\d+).*` to get last number in the `String`.
**USE:**
```
public static void main(String[] args) {
String s = "{FAILED_ENTRIES={}, SUCCESS_ENTRIES={123=1509170142065114105}}";
System.out.println(s.replaceAll(".*(?:\\D|^)(\\d+).*", "$1"));
}
```
**OUTPUT:**
```
150917014206511... | If all your strings are of same format then you can use `lastIndexOf` and `substring`.
```
String s = "{FAILED_ENTRIES={}, SUCCESS_ENTRIES={123=1509170142065114105}}";
int lastEqualIndex = s.lastIndexOf("=");
String lastNumber = s.substring(lastEqualIndex + 1, s.length() - 2);
System.out.println(lastN... |
988,083 | **Definition:** Let $(X,d)$ be a metric space.
A collection $\{v\_n\}$ of subsets is said to be a base for $X$ if for every $x \in X$ and every open set $G \subset X$, such that $x \in G$ we have $x \in \{V\_n\} \subset G$ for some $N$.
>
> The notation is what is giving me a hard time here. I just don't understand ... | 2014/10/23 | [
"https://math.stackexchange.com/questions/988083",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/186785/"
] | Take an open set $O$, and $x\in O$. By definition, there exists $V=V\_x$ in your base such that $x\in V\subseteq O$. This means that $O=\bigcup \{x:x\in O\}\subseteq \bigcup V\_x\subseteq O$; so $O=\bigcup V\_x$ is a union of open basic sets. | "Every open set in X is the union of a subcollection of $\{V\_n\}$" means that any open set $U$ can be written as
$$U=\bigcup V\_i,$$
where $V\_i$ belong to the base for any $i$. E.g. in $\mathbb{R}$ with Euclidean topology, a base could be
$$\{B(x,r):x,r\in \mathbb{Q}\}.$$ |
47,337,926 | I want to read and store the DataKeyNames value for the corresponding row that is selected from the GridView so that I can pass that value as a condition in my UPDATE query.
I have a GridView in which I am displaying the following:
```
<asp:GridView ID="GridViewSavingsTracker" AutoGenerateColumns="false"
runat="ser... | 2017/11/16 | [
"https://Stackoverflow.com/questions/47337926",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Troubleshoot QMHSNDPM: Before calling QMHRMVPM' and after calling QMHSNDPM look at the messages for the interactive job (system request 3 then option 10 then f10 then f18) if you don't see your message something is wrong with the program sending the message. If you do see the message press f1 with cursor on the message... | Keeping track of the current stack level can be tricky.
Keep in mind that when you're inside of a procedure the stack level is increased by 1. So if your current stack level is 1 and you call a procedure, the stack level inside of the procedure is 2.
In my apps I declare a global variable that's initialized to 1. Upo... |
47,337,926 | I want to read and store the DataKeyNames value for the corresponding row that is selected from the GridView so that I can pass that value as a condition in my UPDATE query.
I have a GridView in which I am displaying the following:
```
<asp:GridView ID="GridViewSavingsTracker" AutoGenerateColumns="false"
runat="ser... | 2017/11/16 | [
"https://Stackoverflow.com/questions/47337926",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Troubleshoot QMHSNDPM: Before calling QMHRMVPM' and after calling QMHSNDPM look at the messages for the interactive job (system request 3 then option 10 then f10 then f18) if you don't see your message something is wrong with the program sending the message. If you do see the message press f1 with cursor on the message... | >
> // The MSGQ parameter is from the PSDS \*PROC
>
> // I tried having this defined in the view where the DDS file
>
> // is defined, and I have tried with it defined in the main CNTRL program
>
>
>
So on the program stack, each stack entry has a message queue. You are stating that the message queue that ... |
108,091 | Is it possible to Compare two sets namely set A and set B while both contains set of ids.
I need to check if set A contains ids which is present in set B.
**If it is present then i need to remove from set B.**
Example:
```
set<id> SetA= new set<id>{'00524000001IFbNAAW','00524000001IFbVAAW','00524000001IFrHAAW','0... | 2016/02/05 | [
"https://salesforce.stackexchange.com/questions/108091",
"https://salesforce.stackexchange.com",
"https://salesforce.stackexchange.com/users/25061/"
] | You can use "containsAll" and "removeAll" method of set.
list:
```
Boolean containsAll = satb.containsAll(setA);
```
This "ContainsAll" method will store true if all the elements are present in setB.
Check this article
<https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_s... | You can try like this way
```
Set<Id> setAIds = new set<Id>{'0039000001pJpRH', '0069000000K8YjG'};
Set<Id> setBIds = new set<Id>{'0039000001pJpRH'};
system.debug('====setAIds==='+setAIds);
system.debug('====setBIds==='+setBIds);
for(Id objId: setAIds){
if(setBIds.contains(objId))
setBIds.remove(objId);
}... |
385,852 | When I was looking for some information how to convert unbalanced audio signal to balanced, it was hard to find info other than "use transformer" or "buy X device to do this".
Then I found this circuit:[](https://i.stack.imgur.com/nPi5g.gif)
source: <http://www... | 2018/07/15 | [
"https://electronics.stackexchange.com/questions/385852",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/193597/"
] | I see quite a few misstatements and possible misconceptions both in the answers and in the question, so let’s break down what is meant by “noise.”
1. Analog noise within the same bandwidth as the signal.
2. Analog noise outside of the bandwidth of the signal.
3. Quantization noise introduced by the ADC.
*I interprete... | The SNR would be better, firstly because noise mostly being a higher frequency component would have a lesser chance of being aliased of 1Hz when sampled at 1kHz than at 100Hz
Secondly SNR is directly proportional to bandwidth or just look at Hartley shannon’s law
C = Blog\_2 (1+SNR)
Where C is the digital bandwidth ... |
385,852 | When I was looking for some information how to convert unbalanced audio signal to balanced, it was hard to find info other than "use transformer" or "buy X device to do this".
Then I found this circuit:[](https://i.stack.imgur.com/nPi5g.gif)
source: <http://www... | 2018/07/15 | [
"https://electronics.stackexchange.com/questions/385852",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/193597/"
] | I see quite a few misstatements and possible misconceptions both in the answers and in the question, so let’s break down what is meant by “noise.”
1. Analog noise within the same bandwidth as the signal.
2. Analog noise outside of the bandwidth of the signal.
3. Quantization noise introduced by the ADC.
*I interprete... | You have a 1Hz signal, with superimposed noise out to high frequencies.
Now impose a 4-pole filter, lowpass filter, at 10Hz. Thus energy at 100 Hz is down 80dB. Or about 12 bits.
At 30Hz, the noise energy is only down 40dB, or 7 bits. If the antialias filter is only 4-poles.
Thus the ability of more samples to be us... |
385,852 | When I was looking for some information how to convert unbalanced audio signal to balanced, it was hard to find info other than "use transformer" or "buy X device to do this".
Then I found this circuit:[](https://i.stack.imgur.com/nPi5g.gif)
source: <http://www... | 2018/07/15 | [
"https://electronics.stackexchange.com/questions/385852",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/193597/"
] | I see quite a few misstatements and possible misconceptions both in the answers and in the question, so let’s break down what is meant by “noise.”
1. Analog noise within the same bandwidth as the signal.
2. Analog noise outside of the bandwidth of the signal.
3. Quantization noise introduced by the ADC.
*I interprete... | Oversampling can give you a chance to run an additional high-pass filter digitally. This can reduce out-of-band noise, and you can then reduce your sampling rate.
If you don't do that, it still gives an advantage ***if the noise is not correlated with the signal.*** Your signal adds coherently, giving you 6dB of gain ... |
9,447,216 | I just saw Bret Victors Keynote called "Inventing on Principle". At around 3:34 Minutes he uses a code editor that - after a change he makes - immediately shows consequences of it. As he types there are instant results.
This is the video I am talking about:
<http://vimeo.com/36579366>
Another example is this [real-ti... | 2012/02/25 | [
"https://Stackoverflow.com/questions/9447216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/875153/"
] | [Brackets](http://blog.brackets.io/2012/06/25/brackets-open-source-code-editor/) looks nice, but still on development. | <http://www.youtube.com/watch?v=TBUC-7D1LIc>
this guy already came up with a similar open source program like the one in the video. He also is going to be putting up the source on Github soon. |
9,447,216 | I just saw Bret Victors Keynote called "Inventing on Principle". At around 3:34 Minutes he uses a code editor that - after a change he makes - immediately shows consequences of it. As he types there are instant results.
This is the video I am talking about:
<http://vimeo.com/36579366>
Another example is this [real-ti... | 2012/02/25 | [
"https://Stackoverflow.com/questions/9447216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/875153/"
] | [Brackets](http://blog.brackets.io/2012/06/25/brackets-open-source-code-editor/) looks nice, but still on development. | If you're still looking for an *offline* editor, you could always check out Notepad++. It has a live html preview, but doesn't show most of the newer stuff; just basic layouts as well as basic CSS.
[Notepad++ Website](http://notepad-plus-plus.org/) |
9,447,216 | I just saw Bret Victors Keynote called "Inventing on Principle". At around 3:34 Minutes he uses a code editor that - after a change he makes - immediately shows consequences of it. As he types there are instant results.
This is the video I am talking about:
<http://vimeo.com/36579366>
Another example is this [real-ti... | 2012/02/25 | [
"https://Stackoverflow.com/questions/9447216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/875153/"
] | I don't know if there are any free ones, but [TextMate](http://macromates.com) has a live preview window. Just don't download the version 2 beta — I don't think it's been implemented there yet. You can also check out [Coda](http://panic.com/coda/) and [BBEdit](http://www.barebones.com/products/bbedit/). | If you're still looking for an *offline* editor, you could always check out Notepad++. It has a live html preview, but doesn't show most of the newer stuff; just basic layouts as well as basic CSS.
[Notepad++ Website](http://notepad-plus-plus.org/) |
9,447,216 | I just saw Bret Victors Keynote called "Inventing on Principle". At around 3:34 Minutes he uses a code editor that - after a change he makes - immediately shows consequences of it. As he types there are instant results.
This is the video I am talking about:
<http://vimeo.com/36579366>
Another example is this [real-ti... | 2012/02/25 | [
"https://Stackoverflow.com/questions/9447216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/875153/"
] | [Brackets](http://blog.brackets.io/2012/06/25/brackets-open-source-code-editor/) looks nice, but still on development. | Espresso updates the preview window as you type in the editor but it's for mac only |
9,447,216 | I just saw Bret Victors Keynote called "Inventing on Principle". At around 3:34 Minutes he uses a code editor that - after a change he makes - immediately shows consequences of it. As he types there are instant results.
This is the video I am talking about:
<http://vimeo.com/36579366>
Another example is this [real-ti... | 2012/02/25 | [
"https://Stackoverflow.com/questions/9447216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/875153/"
] | I don't know if there are any free ones, but [TextMate](http://macromates.com) has a live preview window. Just don't download the version 2 beta — I don't think it's been implemented there yet. You can also check out [Coda](http://panic.com/coda/) and [BBEdit](http://www.barebones.com/products/bbedit/). | CoffeeCup has a [Web Editor in beta](http://www.coffeecup.com/osx/web-editor/) that uses live preview and includes the code-preview connection you see in the video. Select an element in the preview and the corresponding HTML/CSS is selected, or select HTML code and see which element it applies to in the preview. |
9,447,216 | I just saw Bret Victors Keynote called "Inventing on Principle". At around 3:34 Minutes he uses a code editor that - after a change he makes - immediately shows consequences of it. As he types there are instant results.
This is the video I am talking about:
<http://vimeo.com/36579366>
Another example is this [real-ti... | 2012/02/25 | [
"https://Stackoverflow.com/questions/9447216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/875153/"
] | CoffeeCup has a [Web Editor in beta](http://www.coffeecup.com/osx/web-editor/) that uses live preview and includes the code-preview connection you see in the video. Select an element in the preview and the corresponding HTML/CSS is selected, or select HTML code and see which element it applies to in the preview. | If you're still looking for an *offline* editor, you could always check out Notepad++. It has a live html preview, but doesn't show most of the newer stuff; just basic layouts as well as basic CSS.
[Notepad++ Website](http://notepad-plus-plus.org/) |
9,447,216 | I just saw Bret Victors Keynote called "Inventing on Principle". At around 3:34 Minutes he uses a code editor that - after a change he makes - immediately shows consequences of it. As he types there are instant results.
This is the video I am talking about:
<http://vimeo.com/36579366>
Another example is this [real-ti... | 2012/02/25 | [
"https://Stackoverflow.com/questions/9447216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/875153/"
] | CoffeeCup has a [Web Editor in beta](http://www.coffeecup.com/osx/web-editor/) that uses live preview and includes the code-preview connection you see in the video. Select an element in the preview and the corresponding HTML/CSS is selected, or select HTML code and see which element it applies to in the preview. | Espresso updates the preview window as you type in the editor but it's for mac only |
9,447,216 | I just saw Bret Victors Keynote called "Inventing on Principle". At around 3:34 Minutes he uses a code editor that - after a change he makes - immediately shows consequences of it. As he types there are instant results.
This is the video I am talking about:
<http://vimeo.com/36579366>
Another example is this [real-ti... | 2012/02/25 | [
"https://Stackoverflow.com/questions/9447216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/875153/"
] | I don't know if there are any free ones, but [TextMate](http://macromates.com) has a live preview window. Just don't download the version 2 beta — I don't think it's been implemented there yet. You can also check out [Coda](http://panic.com/coda/) and [BBEdit](http://www.barebones.com/products/bbedit/). | Espresso updates the preview window as you type in the editor but it's for mac only |
9,447,216 | I just saw Bret Victors Keynote called "Inventing on Principle". At around 3:34 Minutes he uses a code editor that - after a change he makes - immediately shows consequences of it. As he types there are instant results.
This is the video I am talking about:
<http://vimeo.com/36579366>
Another example is this [real-ti... | 2012/02/25 | [
"https://Stackoverflow.com/questions/9447216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/875153/"
] | [Brackets](http://blog.brackets.io/2012/06/25/brackets-open-source-code-editor/) looks nice, but still on development. | CoffeeCup has a [Web Editor in beta](http://www.coffeecup.com/osx/web-editor/) that uses live preview and includes the code-preview connection you see in the video. Select an element in the preview and the corresponding HTML/CSS is selected, or select HTML code and see which element it applies to in the preview. |
9,447,216 | I just saw Bret Victors Keynote called "Inventing on Principle". At around 3:34 Minutes he uses a code editor that - after a change he makes - immediately shows consequences of it. As he types there are instant results.
This is the video I am talking about:
<http://vimeo.com/36579366>
Another example is this [real-ti... | 2012/02/25 | [
"https://Stackoverflow.com/questions/9447216",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/875153/"
] | I don't know if there are any free ones, but [TextMate](http://macromates.com) has a live preview window. Just don't download the version 2 beta — I don't think it's been implemented there yet. You can also check out [Coda](http://panic.com/coda/) and [BBEdit](http://www.barebones.com/products/bbedit/). | <http://www.youtube.com/watch?v=TBUC-7D1LIc>
this guy already came up with a similar open source program like the one in the video. He also is going to be putting up the source on Github soon. |
12,699,351 | I've developed an iPad web app that uses the appcache. It's not intended to be a fully offline app but I use the appcache to store large image files so that they're not sent over 3G. Problem is when the manifest is updated the appcache updates whether the iPad is on wifi or 3G, which could be expensive.
Is it possible... | 2012/10/02 | [
"https://Stackoverflow.com/questions/12699351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/76121/"
] | **Connection Type: Theory & Future**
There is a [draft spec of Network Information API on W3C](http://www.w3.org/TR/netinfo-api/) that provides the information of the connection type (ethernet wifi 2g 3g 4g etc.), but it hasn't been implemented on any browser yet apart from:
* the stock Android browser on Android 2.2... | I don't know what the status of indexedDB is on the iPad, but this could be an alternative solution.
In short: Indexeddb is a clientside database. Data is stored in object stores which are key/value pairs. The maximum storage capacity is in theory the maximum of your disk space. For more information about indexeddb:
... |
12,699,351 | I've developed an iPad web app that uses the appcache. It's not intended to be a fully offline app but I use the appcache to store large image files so that they're not sent over 3G. Problem is when the manifest is updated the appcache updates whether the iPad is on wifi or 3G, which could be expensive.
Is it possible... | 2012/10/02 | [
"https://Stackoverflow.com/questions/12699351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/76121/"
] | **Connection Type: Theory & Future**
There is a [draft spec of Network Information API on W3C](http://www.w3.org/TR/netinfo-api/) that provides the information of the connection type (ethernet wifi 2g 3g 4g etc.), but it hasn't been implemented on any browser yet apart from:
* the stock Android browser on Android 2.2... | I have 'invented' a working solution developing a webapp on the iPad (iOS 6.0.x) that may answer your question.
The idea is first to check if a localstorage variable is set/defined or not yet (I use the title of the page, thus the webapp name.)
If this localstorage variable exists, then assume (in webapp sandbox cont... |
12,699,351 | I've developed an iPad web app that uses the appcache. It's not intended to be a fully offline app but I use the appcache to store large image files so that they're not sent over 3G. Problem is when the manifest is updated the appcache updates whether the iPad is on wifi or 3G, which could be expensive.
Is it possible... | 2012/10/02 | [
"https://Stackoverflow.com/questions/12699351",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/76121/"
] | I don't know what the status of indexedDB is on the iPad, but this could be an alternative solution.
In short: Indexeddb is a clientside database. Data is stored in object stores which are key/value pairs. The maximum storage capacity is in theory the maximum of your disk space. For more information about indexeddb:
... | I have 'invented' a working solution developing a webapp on the iPad (iOS 6.0.x) that may answer your question.
The idea is first to check if a localstorage variable is set/defined or not yet (I use the title of the page, thus the webapp name.)
If this localstorage variable exists, then assume (in webapp sandbox cont... |
34,531,045 | I've heard it's a sin to use try-catch for anything that might be expected to happen in normal program flow, and that one should use if-else instead.
But, what about the case where we want to use it for initialization (an event that happens once and once only). You may want this when you initialization depends on the... | 2015/12/30 | [
"https://Stackoverflow.com/questions/34531045",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/851699/"
] | It's bad practice to use exception handling for implementing your business logic. Exception handling is for handling exceptional cases.
In your specific example it is even clearer that using exception handling is wrong, since your are duplicating your code in the exception handler.
BTW, your method has another potent... | Runtime exceptions like `NullPointerException` or `ArrayIndexOutOfBoundsException` are an indicator of a bug in your program because you as the developer screwed up. Not the user or some external factor but *your* code.
You should never try to catch them, you have to make sure they simply cannot occur. If they occur, ... |
57,776 | I've got a service that I need to start as a different user to 'Local System'
There is a user specific PATH I need to add to the default path in order for the service to work correctly.
The default PATH is A;B;C;
I've setup the users PATH X; so that when the user logs on interactively the effective PATH is A;B;C;X; T... | 2009/08/24 | [
"https://serverfault.com/questions/57776",
"https://serverfault.com",
"https://serverfault.com/users/5063/"
] | MS has a [program that runs any program as a service](http://support.microsoft.com/kb/137890). One of the parameters is `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<name>\Parameters\AppDirectory`, although this may only apply to these wrapped services. | It's Windows Server 2003 specific, but all the same I think this may answer your question: <http://support.microsoft.com/kb/887693> |
57,776 | I've got a service that I need to start as a different user to 'Local System'
There is a user specific PATH I need to add to the default path in order for the service to work correctly.
The default PATH is A;B;C;
I've setup the users PATH X; so that when the user logs on interactively the effective PATH is A;B;C;X; T... | 2009/08/24 | [
"https://serverfault.com/questions/57776",
"https://serverfault.com",
"https://serverfault.com/users/5063/"
] | Just to close this out.
I wrote this in a generic format as I suspected I was dealing with a generic Windows service issue.
However it turns out that this is an issue with the service executeables themselves.
It appears that the reading of the system path and the user path is somehow depandant on the service executab... | It's Windows Server 2003 specific, but all the same I think this may answer your question: <http://support.microsoft.com/kb/887693> |
57,776 | I've got a service that I need to start as a different user to 'Local System'
There is a user specific PATH I need to add to the default path in order for the service to work correctly.
The default PATH is A;B;C;
I've setup the users PATH X; so that when the user logs on interactively the effective PATH is A;B;C;X; T... | 2009/08/24 | [
"https://serverfault.com/questions/57776",
"https://serverfault.com",
"https://serverfault.com/users/5063/"
] | MS has a [program that runs any program as a service](http://support.microsoft.com/kb/137890). One of the parameters is `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<name>\Parameters\AppDirectory`, although this may only apply to these wrapped services. | Have you tried using SRVANY turn a script such as a batch file into a service and set the environment there before calling out to your desired app? Note: you may concede service stop/start/restart control if the script backgrounds subsequent processes and exits, since the service controller will be checking to see if t... |
57,776 | I've got a service that I need to start as a different user to 'Local System'
There is a user specific PATH I need to add to the default path in order for the service to work correctly.
The default PATH is A;B;C;
I've setup the users PATH X; so that when the user logs on interactively the effective PATH is A;B;C;X; T... | 2009/08/24 | [
"https://serverfault.com/questions/57776",
"https://serverfault.com",
"https://serverfault.com/users/5063/"
] | MS has a [program that runs any program as a service](http://support.microsoft.com/kb/137890). One of the parameters is `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<name>\Parameters\AppDirectory`, although this may only apply to these wrapped services. | Just to close this out.
I wrote this in a generic format as I suspected I was dealing with a generic Windows service issue.
However it turns out that this is an issue with the service executeables themselves.
It appears that the reading of the system path and the user path is somehow depandant on the service executab... |
57,776 | I've got a service that I need to start as a different user to 'Local System'
There is a user specific PATH I need to add to the default path in order for the service to work correctly.
The default PATH is A;B;C;
I've setup the users PATH X; so that when the user logs on interactively the effective PATH is A;B;C;X; T... | 2009/08/24 | [
"https://serverfault.com/questions/57776",
"https://serverfault.com",
"https://serverfault.com/users/5063/"
] | Just to close this out.
I wrote this in a generic format as I suspected I was dealing with a generic Windows service issue.
However it turns out that this is an issue with the service executeables themselves.
It appears that the reading of the system path and the user path is somehow depandant on the service executab... | Have you tried using SRVANY turn a script such as a batch file into a service and set the environment there before calling out to your desired app? Note: you may concede service stop/start/restart control if the script backgrounds subsequent processes and exits, since the service controller will be checking to see if t... |
41,774,784 | I would like to change the PayPal Login button font size, as I noticed it is enough to make the whole button smaller, but it seems that it generates a CSS at the bottom of the head, which will override mines. The button is generated by a script (which I suppose is the one that adds the CSS as well).
```
<li><span ... | 2017/01/21 | [
"https://Stackoverflow.com/questions/41774784",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1587275/"
] | use `iloc` and slice appropriately
```
df.iloc[::-1]
0
7 0
6 11
5 22
4 33
```
---
In order to preserve the index
***use `iloc`***
```
df.iloc[:] = df.iloc[::-1].values
```
***use `numpy`***
```
pd.DataFrame(df.values[::-1], df.index, df.columns)
```
---
Both yield
```
0
4 33
5 22
6 11
7 ... | You can also set your index into a temporary variable and then reapply index.
```
df = pd.DataFrame(index=range(4,8), data=[33,22,11,00])
idx=df.index.values
df.sort_values([0],inplace=True)
df.index=idx
```
Not as clever but easy to understand |
2,750,644 | I have a fictional class:
```
template<typename T> class demonstration
{
public:
demonstration(){}
...
T *m_data;
}
```
At some point in the program's execution, I want to set `m_data` to a big block of allocated memory and construct an object `T` there.
At the moment, I've been using this code:
... | 2010/05/01 | [
"https://Stackoverflow.com/questions/2750644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/293011/"
] | Use placement `new`:
```
new (m_data) T();
```
Placement `new` is really just an overload of the `operator new` function that accepts an additional parameter – the memory location where the object should be constructed at. This precisely matches your use-case.
In particular, this is how `allocator`s usually impleme... | Placement `new` operator is what would suit your situation. |
10,435,266 | In this JsFiddle : <http://jsfiddle.net/maxl/mCXND/>
(copied and modified from <http://jsfiddle.net/ud3323/XMgwV/>)
I try to create an Ember DatePicker based on JQuery's.
The first problem I run into is this line :
```
var ui = jQuery.ui[this.get('uiType')](options, this.get('element'));
```
jQuery.ui[this.get('u... | 2012/05/03 | [
"https://Stackoverflow.com/questions/10435266",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/535782/"
] | If you look at the jqueryui code, you see that some of them are invoked as a function, others not. You can solve it using this:
```
var ui;
if (typeof jQuery.ui[this.get('uiType')] === 'function') {
ui = jQuery.ui[this.get('uiType')](options, this.get('element'));
} else {
ui = this.$()[this.get('uiType')](opti... | One more thing about jQuery UI's datepicker widget as a EmberJS Mixin.
If you want to supply a callback function to handle the beforeShowDay event, you will raise this error:
```
Uncaught TypeError: Cannot read property '0' of undefined
```
even if your callback function (in your ember view) return an array, like it... |
8,123,032 | I have a static page `/story` that has a button that says "make your choice" which is handled by `/choice`. In `/choice` I have this script in the header
```
var count = 0;
function writeToStorage()
{
var user = "user" + count;
count++;
localStorage.setItem("chooser", user);
document.getElementById("form_ch... | 2011/11/14 | [
"https://Stackoverflow.com/questions/8123032",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/215094/"
] | Smth along these lines:
```
var count = localStorage.getItem("count") || 0;
function writeToStorage() {
count++;
localStorage.setItem("count", count);
document.getElementById("form_chooser").value = "user" + count;
};
```
So, first line gets the current local storage count or 0 if it's undefined (... | ```
function storage (){
var canStore = true;
if (typeof(localStorage) == 'undefined' ) {
canStore = false;
}
return canStore;
};
function getStorageVal(key){
if (storage()) {
return localStorage.getItem(key);
}
}
var count = getStorageVal('chooser');
count++;
var user = "us... |
7,940 | I override a block class `Mage_Catalog_Block_Navigation` ([link to signature](http://docs.magentocommerce.com/Mage_Catalog/Mage_Catalog_Block_Navigation.html "link to source")) to create a custom menu which displays only subcategories of current category.
Inside method `renderCategoriesMenuHtml` ([link to signature](h... | 2013/09/12 | [
"https://magento.stackexchange.com/questions/7940",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/764/"
] | ```
$_category = Mage::getModel('catalog/category')->load(CATEGORY-ID);
$_categories = $_category
->getCollection()
->addAttributeToSelect(array('name', 'image', 'description'))
->addIdFilter($_category->getChildren());
foreach ($_categories as $_... | ```
<?php
$parentCategoryId = 107;
$cat = Mage::getModel('catalog/category')->load($parentCategoryId);
$subcats = $cat->getChildren();
?>
// Get 1 Level sub category of Parent category.
<?php
foreach(explode(',',$subcats) as $subCatid)
{
$_category = Mage::getModel('catalog/category'... |
11,036,663 | I am building a small download module for a larger project I am currently working on, and have run into a bit of an issue. Although it works perfectly for small files, when the browser (any browser) begins downloading a larger file, it simply loads like any page would, and then in the last few seconds "downloads" the w... | 2012/06/14 | [
"https://Stackoverflow.com/questions/11036663",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1456632/"
] | Use "\*", since you're looking for files. | Try something like:
```
Folder = "C:\"
Set fso = CreateObject("Scripting.FileSystemObject")
Set fold = fso.GetFolder(folder)
For Each file in fold.Files
If Instr(file, "June") >0 Then
Response.Write file.name & " got it in filename!"
End if
Next
Set fold = Nothing
Set fso = Nothing
``` |
65,180,818 | I'm trying to get my Django app work with the current user time zone but I'm not getting any results...
In my settings.py file I set:
`TIME_ZONE = 'UTC'`
and in my `views.py` I set at the top of the code:
`activate(settings.TIME_ZONE)`
But this is not working, while creating a post, is getting my last time zone tha... | 2020/12/07 | [
"https://Stackoverflow.com/questions/65180818",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13577511/"
] | here is the source of this [django timezone](https://docs.djangoproject.com/en/3.1/topics/i18n/timezones/)
Add the following middleware to MIDDLEWARE:
```
import pytz
from django.utils import timezone
class TimezoneMiddleware:
def __init__(self, get_response):
self.get_response = get_response
def _... | From <https://docs.djangoproject.com/en/3.1/topics/i18n/timezones/>
```
from django.utils import timezone
now = timezone.now()
``` |
65,180,818 | I'm trying to get my Django app work with the current user time zone but I'm not getting any results...
In my settings.py file I set:
`TIME_ZONE = 'UTC'`
and in my `views.py` I set at the top of the code:
`activate(settings.TIME_ZONE)`
But this is not working, while creating a post, is getting my last time zone tha... | 2020/12/07 | [
"https://Stackoverflow.com/questions/65180818",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13577511/"
] | I hope this can help someone. Since Django can't automatically detect what the user's timezone is, I had the idea of saving the user's timezone in a cookie with JS on the landing page.
Place in base.html
```
<script>
// Timezone settings
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; // e.... | From <https://docs.djangoproject.com/en/3.1/topics/i18n/timezones/>
```
from django.utils import timezone
now = timezone.now()
``` |
60,588,683 | What I want is this:
```
Dic = {'name':{'id':[1,2,3]}}
```
I have seen answers of how to do this but the ones I saw required the list to be known when they are inserting. the problem I have is I don't know when I'll have to insert in `Dic['name']['id']`.
Is there a way to make something like this `Dic['name']['id']... | 2020/03/08 | [
"https://Stackoverflow.com/questions/60588683",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10667989/"
] | You can use a `defaultdict` to get what you want, for example:
```py
from collections import defaultdict
d = {'name': defaultdict(list)}
d['name']['id'].append(0)
d['name']['id'].append(1)
d['name']['id'].append(2)
print(d)
>>> {'name': defaultdict(<class 'list'>, {'id': [0, 1, 2]})}
``` | ```
Dic = {}
Dic['name'] = {}
Dic['name']['id'] = []
Dic['name']['id'].append(0)
print(Dic)
```
This code segment gives the following output
```
{'name': {'id': [0]}}
```
I think this is the output you need |
3,686,629 | Using Visual Studio 2008 C++, how can I create a folder using code. For some reason, a simple CreateDirectory isn't working. | 2010/09/10 | [
"https://Stackoverflow.com/questions/3686629",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/436316/"
] | >
> remains in tree-conflict
>
>
>
means that the directory has been merged and svn has found the directory is missing (or added) when it thinks it should/ shouldn't be. In short, its telling you that something is a big wrong and that you need to sort it out (resolve it) before continuing.
You have to `svn resol... | To delete a directory under MARKT:
```
> cd MARKT
> svn delete <dir1>
> svn delete <dir2>
> svn commit
```
To create a new directory under MARKT:
```
> mkdir <dir1>
> mkdir <dir2>
> svn add <dir1>
> svn add <dir2>
> svn commit
``` |
56,338,146 | I came across a problem that in selecting the date for current desired month and year. I tried the 2 statements shown below but failed to execute the query
```
select to_char(sysdate, 'Month') from income
select * from income where to_char(sysdate,month) = 'feb'
```
**Update**
But after researching and learning... | 2019/05/28 | [
"https://Stackoverflow.com/questions/56338146",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2805507/"
] | Are you after something like:
```
select *
from income
where <date_column> >= to_date('01/05/2019', 'dd/mm/yyyy')
and <date_column> < to_date('01/06/2019', 'dd/mm/yyyy')
```
(replacing `<date_column>` with the name of the date column in your income table that you want to filter on)? | I think you can use the following query:
```
select *
from income
where to_char(<date_column>,'MON-RRRR') = 'MAY-2019';
``` |
56,338,146 | I came across a problem that in selecting the date for current desired month and year. I tried the 2 statements shown below but failed to execute the query
```
select to_char(sysdate, 'Month') from income
select * from income where to_char(sysdate,month) = 'feb'
```
**Update**
But after researching and learning... | 2019/05/28 | [
"https://Stackoverflow.com/questions/56338146",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2805507/"
] | Are you after something like:
```
select *
from income
where <date_column> >= to_date('01/05/2019', 'dd/mm/yyyy')
and <date_column> < to_date('01/06/2019', 'dd/mm/yyyy')
```
(replacing `<date_column>` with the name of the date column in your income table that you want to filter on)? | If you want to pass in a string like `'May 2012'`, then I would recommend:
```
select i.*
from income i
where i.datecol >= to_date('May 2012', 'Mon YYYY') and
i.datecol < to_date('May 2012', 'Mon YYYY') + interval '1' month;
```
That said, I think your application should turn the string value into a date range... |
39,829,518 | I'm implementing a dynamic viewpager using an adapter that extends FragmentStatePagerAdapter.
Every time my app goes to the background it crashes. with IndexOutOfBounds on ViewPager:
Here's Adapter Code:
```
/**
* Created by root on 3/11/15.
*/
public class FragmentAdapter extends FragmentStatePagerAdapter {
... | 2016/10/03 | [
"https://Stackoverflow.com/questions/39829518",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3500742/"
] | Ok i found out the solution, basically the issue was not in the adapter at all, i was putting my viewPager inside of a fragment,for which adapter needs refrence of getChildfragmentManager() instead of getFragmentManager();
I changed the
```
mFragmentAdapter = new FragmentAdapter(getFragmentManager(), mFragList, mFrag... | Try to use Android debugger to get know at which line it gets crash when app go to background and then let us know . Try to do something in onPause() |
197,536 | Set 50 years in the future.
A supermax or super maximum security prison is a lockup facility to hold dangerous criminals, most of them are being sentenced for at least 1000 years of life imprisonment without parole. Recently in the news there is a plan to convert our moon into a supermax by converting it into a hollow... | 2021/03/10 | [
"https://worldbuilding.stackexchange.com/questions/197536",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/8400/"
] | **Spin doesn't work for me**
Spin creates artificial gravity, true. But the complexity is a mess. To keep every cell at 1G...
* The floor of every cell must be oriented away the axis of rotation, which I'll assume is the lunar polar axis. Remember that the moon does rotate, it just rotates to keep the same face towar... | ### Spin them.
You want to spin their cells around such that the moons gravity (down) plus the spin centrifugal force (outwards) adds up to one G (diagonally down and outwards ish).
Yes this results in a tilted cell cell if gravity needs to be normal to the floor. We can build ramps so this should be a non issue.
Yo... |
197,536 | Set 50 years in the future.
A supermax or super maximum security prison is a lockup facility to hold dangerous criminals, most of them are being sentenced for at least 1000 years of life imprisonment without parole. Recently in the news there is a plan to convert our moon into a supermax by converting it into a hollow... | 2021/03/10 | [
"https://worldbuilding.stackexchange.com/questions/197536",
"https://worldbuilding.stackexchange.com",
"https://worldbuilding.stackexchange.com/users/8400/"
] | **Spin doesn't work for me**
Spin creates artificial gravity, true. But the complexity is a mess. To keep every cell at 1G...
* The floor of every cell must be oriented away the axis of rotation, which I'll assume is the lunar polar axis. Remember that the moon does rotate, it just rotates to keep the same face towar... | Use lead garments. Each inmate will wear 5 times his/her/their own weight and you will claim the problem solved. After all, it does provide some excercise and is not like they will ever return. And the human rights organizations will be satisfied, since they do not *really* care, as the other conditions pretty much equ... |
32,873,276 | I have an SQL database that I have to store date and time in the records. I am making a project on Visual Studio and I'm using 2 datetime picker controls to prompt for date and time respectively.
I want to know what kind of variable (or class) I should use to store the time and date so that I can store it in the sing... | 2015/09/30 | [
"https://Stackoverflow.com/questions/32873276",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5394481/"
] | C# has the DateTime type and TimeSpan for this. TimeSpan is not always the best choice and in many cases its better to just use a DateTime and ignore the date part.
The DateTime Class in C# has a .Date for extracting just the date component and a .Time For the Time part (returning a TimeSpan class)
In SQL you can use... | Try this :
```
DateTime myDateTime = DateTime.Now;
string sqlFormattedDate = myDateTime.ToString("yyyy-MM-dd HH:mm:ss");
```
Or for more details : [Similar StackOverFlow Question](https://stackoverflow.com/questions/17418258/datetime-format-to-sql-format-using-c-sharp) with a very good solution or [Click here](http... |
7,382,466 | I have data stored in a session with **Zend\_Session\_Namespace**, Is it possible to recover this session data from another host using an id or something like that. If not, is it possible to recover the data in a **$\_SESSION** from another host? | 2011/09/12 | [
"https://Stackoverflow.com/questions/7382466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/598932/"
] | Here you have your code modified and working.
It is not optimal, it does not take into account the presence of more or less comments in the header and there is not exception handling but it is a start.
```
import sys
import numpy as np
RGBS = range(16, 255, 16)
CHARS = [' ', '.', ',', ':', ';', '+', '=', 'o',
... | I wrote one of these in C# a while ago and I calculated the character to use with this formula:
```
index_into_array = (int)(r_g_b_value * (chars_array_length / (255.0)));
```
As for the width and height, you could average every two lines of vertical pixels to halve the height.
Edit 1: in response to comment:
The b... |
7,382,466 | I have data stored in a session with **Zend\_Session\_Namespace**, Is it possible to recover this session data from another host using an id or something like that. If not, is it possible to recover the data in a **$\_SESSION** from another host? | 2011/09/12 | [
"https://Stackoverflow.com/questions/7382466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/598932/"
] | You can use [`image-to-ansi.py`](https://gist.github.com/1687427) for the conversion.
First, download `image-to-ansi.py`:
```
wget https://gist.githubusercontent.com/klange/1687427/raw/image-to-ansi.py
```
Save this script as `ppmimage.py`:
```
# Parses a PPM file and loads it into image-to-ansi.py
import re, ite... | I wrote one of these in C# a while ago and I calculated the character to use with this formula:
```
index_into_array = (int)(r_g_b_value * (chars_array_length / (255.0)));
```
As for the width and height, you could average every two lines of vertical pixels to halve the height.
Edit 1: in response to comment:
The b... |
7,382,466 | I have data stored in a session with **Zend\_Session\_Namespace**, Is it possible to recover this session data from another host using an id or something like that. If not, is it possible to recover the data in a **$\_SESSION** from another host? | 2011/09/12 | [
"https://Stackoverflow.com/questions/7382466",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/598932/"
] | You can use [`image-to-ansi.py`](https://gist.github.com/1687427) for the conversion.
First, download `image-to-ansi.py`:
```
wget https://gist.githubusercontent.com/klange/1687427/raw/image-to-ansi.py
```
Save this script as `ppmimage.py`:
```
# Parses a PPM file and loads it into image-to-ansi.py
import re, ite... | Here you have your code modified and working.
It is not optimal, it does not take into account the presence of more or less comments in the header and there is not exception handling but it is a start.
```
import sys
import numpy as np
RGBS = range(16, 255, 16)
CHARS = [' ', '.', ',', ':', ';', '+', '=', 'o',
... |
8,418,628 | I have a .txt file with lines (in my situation 2). I need to read lines and convert each to a different Array. Ex:
1 line - A,B,C
2 line - D,E,F,G, etc.
and convert this to:
[A,B,C]
[D,E,F,G]
I'm doing this with String.split(", ")
```
ArrayList<String> al_1 = new ArrayList<String>();
ArrayList<Strin... | 2011/12/07 | [
"https://Stackoverflow.com/questions/8418628",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1078381/"
] | Maybe you must use
```
ArrayList<ArrayList<String>> al = new ArrayList<ArrayList<String>>();
```
instead of
```
ArrayList<String> al_1 = new ArrayList<String>();
ArrayList<String> al_2 = new ArrayList<String>();
```
and fullfill this list with **al.add()** | IMO easier to keep a list of lists.
```
List<List<String>> lineLists = new ArrayList<List<String>>();
while (true) {
List<String> lineList = new ArrayList<String>();
String[] line = rbuff.readLine().split(",");
for (String i : line) {
lineList.add(i);
}
lineLists.add(lineList);
if (lin... |
8,418,628 | I have a .txt file with lines (in my situation 2). I need to read lines and convert each to a different Array. Ex:
1 line - A,B,C
2 line - D,E,F,G, etc.
and convert this to:
[A,B,C]
[D,E,F,G]
I'm doing this with String.split(", ")
```
ArrayList<String> al_1 = new ArrayList<String>();
ArrayList<Strin... | 2011/12/07 | [
"https://Stackoverflow.com/questions/8418628",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1078381/"
] | Maybe you must use
```
ArrayList<ArrayList<String>> al = new ArrayList<ArrayList<String>>();
```
instead of
```
ArrayList<String> al_1 = new ArrayList<String>();
ArrayList<String> al_2 = new ArrayList<String>();
```
and fullfill this list with **al.add()** | This solution will allow you to add a new ArrayList to the myArrayList for each row your read of your file:
```
List<List<String>> myArrayList = new ArrayList<List<String>>();
List<String> myStrings;
while (true) {
myStrings = new ArrayList<String>();
... |
8,418,628 | I have a .txt file with lines (in my situation 2). I need to read lines and convert each to a different Array. Ex:
1 line - A,B,C
2 line - D,E,F,G, etc.
and convert this to:
[A,B,C]
[D,E,F,G]
I'm doing this with String.split(", ")
```
ArrayList<String> al_1 = new ArrayList<String>();
ArrayList<Strin... | 2011/12/07 | [
"https://Stackoverflow.com/questions/8418628",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1078381/"
] | Maybe you must use
```
ArrayList<ArrayList<String>> al = new ArrayList<ArrayList<String>>();
```
instead of
```
ArrayList<String> al_1 = new ArrayList<String>();
ArrayList<String> al_2 = new ArrayList<String>();
```
and fullfill this list with **al.add()** | Well that's pretty much what I'd do, but with the mention that if you don't need your lines to inside ArrayList objects, you can use array Strings (String[]). Here's an example:
```
private static String s1 = "A,B,C",s2="D,E,F";
private static List<String> lines = new ArrayList<String>(){{add(s1);add(s2);}};
... |
8,418,628 | I have a .txt file with lines (in my situation 2). I need to read lines and convert each to a different Array. Ex:
1 line - A,B,C
2 line - D,E,F,G, etc.
and convert this to:
[A,B,C]
[D,E,F,G]
I'm doing this with String.split(", ")
```
ArrayList<String> al_1 = new ArrayList<String>();
ArrayList<Strin... | 2011/12/07 | [
"https://Stackoverflow.com/questions/8418628",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1078381/"
] | IMO easier to keep a list of lists.
```
List<List<String>> lineLists = new ArrayList<List<String>>();
while (true) {
List<String> lineList = new ArrayList<String>();
String[] line = rbuff.readLine().split(",");
for (String i : line) {
lineList.add(i);
}
lineLists.add(lineList);
if (lin... | This solution will allow you to add a new ArrayList to the myArrayList for each row your read of your file:
```
List<List<String>> myArrayList = new ArrayList<List<String>>();
List<String> myStrings;
while (true) {
myStrings = new ArrayList<String>();
... |
8,418,628 | I have a .txt file with lines (in my situation 2). I need to read lines and convert each to a different Array. Ex:
1 line - A,B,C
2 line - D,E,F,G, etc.
and convert this to:
[A,B,C]
[D,E,F,G]
I'm doing this with String.split(", ")
```
ArrayList<String> al_1 = new ArrayList<String>();
ArrayList<Strin... | 2011/12/07 | [
"https://Stackoverflow.com/questions/8418628",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1078381/"
] | IMO easier to keep a list of lists.
```
List<List<String>> lineLists = new ArrayList<List<String>>();
while (true) {
List<String> lineList = new ArrayList<String>();
String[] line = rbuff.readLine().split(",");
for (String i : line) {
lineList.add(i);
}
lineLists.add(lineList);
if (lin... | Well that's pretty much what I'd do, but with the mention that if you don't need your lines to inside ArrayList objects, you can use array Strings (String[]). Here's an example:
```
private static String s1 = "A,B,C",s2="D,E,F";
private static List<String> lines = new ArrayList<String>(){{add(s1);add(s2);}};
... |
11,865,042 | maybe you guys can help me figure this out: I have a Dictionary and an ItemsControl that is binded to that dictionary. The Key of each entry determines the content of each Item in the ItemsControl and the Value determines the width of each Item. The big problem with this: The width is a percentage value, so it tells me... | 2012/08/08 | [
"https://Stackoverflow.com/questions/11865042",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1421550/"
] | ~~You can implement `IValueConverter`~~.
**UPDATE**.
`MultiBinding` will help you. Here's the sample:
1) xaml:
```
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local... | You might try putting a `Grid` in the `ItemTemplate`. This `Grid` would have 2 columns: 1 for the actual content and one for the empty space. You should be able to bind the width of these columns using your dictionary's `Value`, possibly with the aid of an `IValueConverter`.
If the content needs to be centered, you'd ... |
11,865,042 | maybe you guys can help me figure this out: I have a Dictionary and an ItemsControl that is binded to that dictionary. The Key of each entry determines the content of each Item in the ItemsControl and the Value determines the width of each Item. The big problem with this: The width is a percentage value, so it tells me... | 2012/08/08 | [
"https://Stackoverflow.com/questions/11865042",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1421550/"
] | ~~You can implement `IValueConverter`~~.
**UPDATE**.
`MultiBinding` will help you. Here's the sample:
1) xaml:
```
<Window x:Class="WpfApplication1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local... | I had a required that couldn't use the Grids.
I created a ContentControl that allows me wrap content to add a dynamic percentage width/height.
```
/// <summary>
/// This control has a dynamic/percentage width/height
/// </summary>
public class FluentPanel : ContentControl, IValueConverter
{
#region Dependencie Pr... |
2,800,910 | >
> A small course has 3 students, $B$, $C$ and $D$. Based on the previous
> testscores of these students we know that $B$ usually scores $80$%
> correct on the exam questions, $C$ scores $60$% and $D$ scores $40$%.
> The anonymous test that is now corrected has $4$ correct answers out
> of $8$. What is the condit... | 2018/05/29 | [
"https://math.stackexchange.com/questions/2800910",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/114097/"
] | $P(X=4|A) = {8\choose 4} 0.8^4(1-0.8)^4\\
P(X=4|B) = {8\choose 4} 0.6^4(1-0.6)^4$
etc.
$P(B|X = 4) = \frac {P(X=4|B)}{P(X=4|A) + P(X=4|B) + P(X=4|C)}$ | Based on the information provided, it is not possible to give an answer. You are given B, C and D's mean (or, depending on interpretation of "usual", median or mode), but that is not directly relevant. You need to know not what A$\_i$'s "usual" score is, but what the percentage of the exams they get 50% is. The only ap... |
30,043,245 | How can I develop a Android App or Iphone app from Visual Studio
Preferably the community edition of VS.
Language of choice C#
What costs are involved and how would I go about getting this onto my phone?
Can I avoid putting it into the public app store? | 2015/05/05 | [
"https://Stackoverflow.com/questions/30043245",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4019642/"
] | The obvious answer to that is <http://xamarin.com/>
You'll still need to have a Mac to debug iOS apps, but otherwise can code in Visual Studio on Windows.
With Android you can distribute very easily, for example via email. For iOS you would have to sign up for the enterprise app program, which means you *can't* sell ... | for android development i think eclipse is better choose. or you can use android studio. there are some plugins for visual studio that lets you write programs but it is not very efficient. eclipse is a standard environment for developing android apps. |
3,439,090 | There's [http://www.amazon.com/gp/product/0321278542/](https://rads.stackoverflow.com/amzn/click/com/0321278542) but it looks a bit dated. Specificaly, it talks about bits that are no longer in use (powerpc bootloader for example) on modern machines.
So, my question really is: is there any other book, as comprehensive... | 2010/08/09 | [
"https://Stackoverflow.com/questions/3439090",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/121182/"
] | No, but it's still a great book. The internal hasn't changed that much; once you get the broad idea by reading that book, you can directly go to <http://opensource.apple.com/> and read the latest kernel source code without problems. | There is also a new book coming out "OS X Internals", the designated sequel to Amit Singh's book:
<http://blog.darkrainfall.org/2013/01/os-x-internals/>
At the moment it is still in development, but hopefully the "late 2014" deadline will not be pushed back (too much) further! |
8,638 | Ok, if I want to buy something that is $8 in American dollars and use a Bitcoin that is worth an odd value in American dollars...like $17 for instance. Then what happens? I end up with a deciminal point version of a Bitcoin? How does an individual keep track of Bitcoin money when it translates into too many decimal poi... | 2013/03/23 | [
"https://bitcoin.stackexchange.com/questions/8638",
"https://bitcoin.stackexchange.com",
"https://bitcoin.stackexchange.com/users/3534/"
] | Bitcoin can be split into smaller units which I believe are called "Satoshi's" but in practice things are not denominated in satoshi's but are instead just fractional amounts bitcoins.
You can have (and send) bitcoins in fractional values with no consequence. | Yes, there is decimal values. For example, today:
1 BTC = $ 87.64
So
0.1 BTC = $ 8.76 ////
0.01 BTC = $ 0.87 ////
0.001 BTC = $ 0.08 ////
And so on.
The minimum value is called "Satoshi" and it is: 0.00000001 |
8,638 | Ok, if I want to buy something that is $8 in American dollars and use a Bitcoin that is worth an odd value in American dollars...like $17 for instance. Then what happens? I end up with a deciminal point version of a Bitcoin? How does an individual keep track of Bitcoin money when it translates into too many decimal poi... | 2013/03/23 | [
"https://bitcoin.stackexchange.com/questions/8638",
"https://bitcoin.stackexchange.com",
"https://bitcoin.stackexchange.com/users/3534/"
] | One Bitcoin is actually `10 000 000` units in a transaction record, meaning that a Bitcoin is divisible down to eight decimal places. `1` unit is called a **satoshi**, named for the creator of Bitcoin.
Most world currencies don't go below two decimal places in daily usage, and only in financial systems do they go belo... | Bitcoin can be split into smaller units which I believe are called "Satoshi's" but in practice things are not denominated in satoshi's but are instead just fractional amounts bitcoins.
You can have (and send) bitcoins in fractional values with no consequence. |
8,638 | Ok, if I want to buy something that is $8 in American dollars and use a Bitcoin that is worth an odd value in American dollars...like $17 for instance. Then what happens? I end up with a deciminal point version of a Bitcoin? How does an individual keep track of Bitcoin money when it translates into too many decimal poi... | 2013/03/23 | [
"https://bitcoin.stackexchange.com/questions/8638",
"https://bitcoin.stackexchange.com",
"https://bitcoin.stackexchange.com/users/3534/"
] | One Bitcoin is actually `10 000 000` units in a transaction record, meaning that a Bitcoin is divisible down to eight decimal places. `1` unit is called a **satoshi**, named for the creator of Bitcoin.
Most world currencies don't go below two decimal places in daily usage, and only in financial systems do they go belo... | Yes, there is decimal values. For example, today:
1 BTC = $ 87.64
So
0.1 BTC = $ 8.76 ////
0.01 BTC = $ 0.87 ////
0.001 BTC = $ 0.08 ////
And so on.
The minimum value is called "Satoshi" and it is: 0.00000001 |
216,432 | I have tried hard to look for a solution to my problems, but I can't manage to find it on this site or with Google. I have tried: `minipage`, `multicol`, `longtable`, `tabu`. I've read the documentation on `glossaries` and I can not make head or tails from it.
I've got a glossary, with linguistic gloss abbreviations i... | 2014/12/10 | [
"https://tex.stackexchange.com/questions/216432",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/10367/"
] | something like this?

```
\documentclass[openright,12pt,dutch]{report}
\usepackage{multicol}
\usepackage[nomain,nonumberlist,nogroupskip,nostyles]{glossaries} % voor de lijst met glossen.
\usepackage{glossary-super}
\usepackage{leipzig} % voor glo... | Here is a way of using `multicol` with `\parbox` commands to format the glossary. The `section=section` package option is used to prevent a page break before the glossary by altering the sectioning level from the default chapter to section (which doesn't start a new page).
```
\documentclass[openright,12pt,dutch]{repo... |
216,432 | I have tried hard to look for a solution to my problems, but I can't manage to find it on this site or with Google. I have tried: `minipage`, `multicol`, `longtable`, `tabu`. I've read the documentation on `glossaries` and I can not make head or tails from it.
I've got a glossary, with linguistic gloss abbreviations i... | 2014/12/10 | [
"https://tex.stackexchange.com/questions/216432",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/10367/"
] | something like this?

```
\documentclass[openright,12pt,dutch]{report}
\usepackage{multicol}
\usepackage[nomain,nonumberlist,nogroupskip,nostyles]{glossaries} % voor de lijst met glossen.
\usepackage{glossary-super}
\usepackage{leipzig} % voor glo... | I'll add an answer for leipzig 2.0 (which has just been added to CTAN, 2017-06-16). It's too late for your thesis, but might help someone else.
I have included a pre-defined multicolumn glossary style in this version of leipzig. After a lot of experimentation, I ultimately decided that any style based on a tabular for... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.