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 |
|---|---|---|---|---|---|
64,923,873 | So to give a little context im using expo-firebase-analytics (latest version) on Expo (27) and im trying to activate setDebugModeEnabled so that i can use the debugView on firebase analytics.
The problem is that when running it i get the following warning
>
> The method or property expo-firebase-analytics.setDebugMo... | 2020/11/20 | [
"https://Stackoverflow.com/questions/64923873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11710240/"
] | Ok so i tried to reproduce the issue.It seems ("even though it seemed obvious") that its not available for a reason on ios. but it is in android. if you use an android device it shoudl work seamlesly | if you check on the exports is the function there? |
380,289 | I want to build a digital terrain model from nautical charts. I need to capture the points where depth is indicated in the chart, and for each point, I must attribute the depth value. One by one, to be sure I capture all points and give the right value. And left a marker on the points to indicate which was already digi... | 2020/11/26 | [
"https://gis.stackexchange.com/questions/380289",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/171036/"
] | So you created a points layer and already set a few points, right? As I guess from your question, you have not yet defined any attribute fields. So you should add a field for the values you want to enter (depth). Right click your layer > open attribute table field calculator: [](https://i.stack.imgur.com/H790q.png)
Make sure to select Points for Geometry type and fill in Depth or something similar as name ... |
380,289 | I want to build a digital terrain model from nautical charts. I need to capture the points where depth is indicated in the chart, and for each point, I must attribute the depth value. One by one, to be sure I capture all points and give the right value. And left a marker on the points to indicate which was already digi... | 2020/11/26 | [
"https://gis.stackexchange.com/questions/380289",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/171036/"
] | So you created a points layer and already set a few points, right? As I guess from your question, you have not yet defined any attribute fields. So you should add a field for the values you want to enter (depth). Right click your layer > open attribute table field calculator: [ right way...
a) with a layer, create a new shapefile layer
b) using the Field Calculator, create a new field... get some points
c) export the shapefile as CSV with geometry AS\_XY
d) done!
But this is not working! When I do this, I got only the fi... |
380,289 | I want to build a digital terrain model from nautical charts. I need to capture the points where depth is indicated in the chart, and for each point, I must attribute the depth value. One by one, to be sure I capture all points and give the right value. And left a marker on the points to indicate which was already digi... | 2020/11/26 | [
"https://gis.stackexchange.com/questions/380289",
"https://gis.stackexchange.com",
"https://gis.stackexchange.com/users/171036/"
] | In case you haven't got your vector file yet:
First create a new layer. You want a vector file, shapefiles are most commonly used.
[](https://i.stack.imgur.com/H790q.png)
Make sure to select Points for Geometry type and fill in Depth or something similar as name ... | I got it!
But, maybe I found a bug.
Part 1 - The (expected) right way...
a) with a layer, create a new shapefile layer
b) using the Field Calculator, create a new field... get some points
c) export the shapefile as CSV with geometry AS\_XY
d) done!
But this is not working! When I do this, I got only the fi... |
70,384,470 | I already have SUMO, OMNET++ and Veins running on my machine, but I am new to Veins. I would like to run Python scripts using Veins framework.
Let us say in the Python script we are given two objects `object_A` and `object_B` that contain data about the corresponding cars `car_A` and `car_B`. I would like to enable so... | 2021/12/16 | [
"https://Stackoverflow.com/questions/70384470",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15452880/"
] | I would use [Jackson](https://github.com/FasterXML/jackson) for that job:
```
private static final ObjectMapper MAPPER = new ObjectMapper();
public static String getFirstId(String json) throws JsonProcessingException {
return MAPPER.readTree(json).get("accommodations").get(0).get("id").asText();
}
```
Then you ... | I would recommend using circe to parse the JsonString and there are two ways to do this:
1. requires you to add the following packages to your sbt build:
```
val core = "io.circe" %% "circe-core" % circeVersion
val generic = "io.circe" %% "circe-generic" % circeVersion
val parser = "io.circe" %% "circe-parser" % circ... |
70,384,470 | I already have SUMO, OMNET++ and Veins running on my machine, but I am new to Veins. I would like to run Python scripts using Veins framework.
Let us say in the Python script we are given two objects `object_A` and `object_B` that contain data about the corresponding cars `car_A` and `car_B`. I would like to enable so... | 2021/12/16 | [
"https://Stackoverflow.com/questions/70384470",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15452880/"
] | If your JSON is embedded inside HTML, you have 2 possibilities:
1. Use a `css` check like you've done so far to extract the JSON from the HTML and then use [`transform`](https://gatling.io/docs/gatling/reference/current/core/check/#transform) to parse the JSON and extract the desired value, eg with Jackson as suggeste... | I would recommend using circe to parse the JsonString and there are two ways to do this:
1. requires you to add the following packages to your sbt build:
```
val core = "io.circe" %% "circe-core" % circeVersion
val generic = "io.circe" %% "circe-generic" % circeVersion
val parser = "io.circe" %% "circe-parser" % circ... |
70,384,470 | I already have SUMO, OMNET++ and Veins running on my machine, but I am new to Veins. I would like to run Python scripts using Veins framework.
Let us say in the Python script we are given two objects `object_A` and `object_B` that contain data about the corresponding cars `car_A` and `car_B`. I would like to enable so... | 2021/12/16 | [
"https://Stackoverflow.com/questions/70384470",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15452880/"
] | This can be done in a few steps.
1. At the first need to extract only json and change response body.
2. And then you can use simple `jsonPath` and work with json
For change - use `transformResponse` where extract json string and remove break lines and set as new response body
```
http("...")
.get("...")
.tra... | I would recommend using circe to parse the JsonString and there are two ways to do this:
1. requires you to add the following packages to your sbt build:
```
val core = "io.circe" %% "circe-core" % circeVersion
val generic = "io.circe" %% "circe-generic" % circeVersion
val parser = "io.circe" %% "circe-parser" % circ... |
26,346,700 | Rather than an Excel formula of this kind:
```
=IF(AVERAGE(A1:A4)<4,"POOR",IF(AVERAGE(A1:A4)<5,"Meet Expectation",IF(AVERAGE(A1:A4)<7,"Good",IF(AVERAGE(A1:A4)<8,"Excellent","Outstanding"))))
```
how might I achieve similar results with a lookup table? | 2014/10/13 | [
"https://Stackoverflow.com/questions/26346700",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4138688/"
] | With a lookup table (and without requiring an exact match):

Where an exacct match is not found it defaults to the next lower matching value. `9` can not be found but `8` can be, hence `Outstanding`. You have not been specific about the breakpoints... | Formula:
========
`=IF(A1<4,"POOR",IF(AND(A1>=4,A1<5),"Meets Expectations",IF(AND(A1>=5,A1<7),"Good",IF(AND(A1>=7,A1<8),"Excellent","Outstanding"))))` |
5,884,670 | I have a WPF projet that uses the WPFMediaKit and I have realised that it runs the camera and even the MessageBox.Show() code when in visual studio editing. That wouldn't be a problem if it was only the camera that it was trying to run its doing some other stuff that crash the instant i go into design view.
Why is thi... | 2011/05/04 | [
"https://Stackoverflow.com/questions/5884670",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/68438/"
] | You can't stop it, it's made so user controls can draw themselves and react smartly to the user at design time.
You can however check for the `DesignMode` property inside your control and not do the camera operations (or anything at all if you wish). | Sounds like a problem with WPFMediaKit itself. It should have been written to take the IsDesignMode property into account as Blindy pointed out... |
6,396,477 | Can anyone advise me on how I can add a "plus" button in a UITableView Cell like what you see in the screen shot below?
 | 2011/06/18 | [
"https://Stackoverflow.com/questions/6396477",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/683898/"
] | You can customize your cell by getting the `contentView` property of your `UITableViewCell` and adding the `UIImage` of the plus button as a subview. | That's not a built-in control. It's probably a custom-style UIButton with that image in its .image property. |
6,396,477 | Can anyone advise me on how I can add a "plus" button in a UITableView Cell like what you see in the screen shot below?
 | 2011/06/18 | [
"https://Stackoverflow.com/questions/6396477",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/683898/"
] | The simple way: get an image of the plus, set it for the `cell.imageView.image`. | That's not a built-in control. It's probably a custom-style UIButton with that image in its .image property. |
6,396,477 | Can anyone advise me on how I can add a "plus" button in a UITableView Cell like what you see in the screen shot below?
 | 2011/06/18 | [
"https://Stackoverflow.com/questions/6396477",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/683898/"
] | You can also put the table view into editing mode, implement `editingStyleForRowAtIndexPath:` and return `UITableViewCellEditingStyleInsert` (which puts a green circle with a plus sign).
For example...
```
- (IBAction)editButtonPressed
{
//toggle editing on/off...
[tableView setEditing:(!tableView.editing) an... | That's not a built-in control. It's probably a custom-style UIButton with that image in its .image property. |
6,396,477 | Can anyone advise me on how I can add a "plus" button in a UITableView Cell like what you see in the screen shot below?
 | 2011/06/18 | [
"https://Stackoverflow.com/questions/6396477",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/683898/"
] | The simple way: get an image of the plus, set it for the `cell.imageView.image`. | You can customize your cell by getting the `contentView` property of your `UITableViewCell` and adding the `UIImage` of the plus button as a subview. |
6,396,477 | Can anyone advise me on how I can add a "plus" button in a UITableView Cell like what you see in the screen shot below?
 | 2011/06/18 | [
"https://Stackoverflow.com/questions/6396477",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/683898/"
] | You can also put the table view into editing mode, implement `editingStyleForRowAtIndexPath:` and return `UITableViewCellEditingStyleInsert` (which puts a green circle with a plus sign).
For example...
```
- (IBAction)editButtonPressed
{
//toggle editing on/off...
[tableView setEditing:(!tableView.editing) an... | You can customize your cell by getting the `contentView` property of your `UITableViewCell` and adding the `UIImage` of the plus button as a subview. |
6,396,477 | Can anyone advise me on how I can add a "plus" button in a UITableView Cell like what you see in the screen shot below?
 | 2011/06/18 | [
"https://Stackoverflow.com/questions/6396477",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/683898/"
] | You can also put the table view into editing mode, implement `editingStyleForRowAtIndexPath:` and return `UITableViewCellEditingStyleInsert` (which puts a green circle with a plus sign).
For example...
```
- (IBAction)editButtonPressed
{
//toggle editing on/off...
[tableView setEditing:(!tableView.editing) an... | The simple way: get an image of the plus, set it for the `cell.imageView.image`. |
50,357,180 | I am working on page, that gives you (based on range input) random string from array. It works by form with post method, that goes to same website, where is that form. But I ran into problems. Mostly it gives same string, as it gave before, so I would like to somehow save key from array, and compare it to new randomly ... | 2018/05/15 | [
"https://Stackoverflow.com/questions/50357180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6483765/"
] | You only add `x` to sum once and that's after you print it out. Move adding `x` to `sum` into the loop.
You also need to make sure you don't add the `-1` which likely acts only as a condition ending the loop and not a term you want to add. | If you want to find the sum of numbers you should add them in while loop.
So your line of code
```
sum = sum+x;
```
Should be places in do while
```
do
{
scanf("%d",&x);
sum = sum+x;
}while(x!=-1);
```
But now you added -1 in your sum and i doubt you want that, so you should add 1 to sum after do wh... |
50,357,180 | I am working on page, that gives you (based on range input) random string from array. It works by form with post method, that goes to same website, where is that form. But I ran into problems. Mostly it gives same string, as it gave before, so I would like to somehow save key from array, and compare it to new randomly ... | 2018/05/15 | [
"https://Stackoverflow.com/questions/50357180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6483765/"
] | You only add `x` to sum once and that's after you print it out. Move adding `x` to `sum` into the loop.
You also need to make sure you don't add the `-1` which likely acts only as a condition ending the loop and not a term you want to add. | Building on the answer by Jacek, here is the detail to get an efficient summing without the final adding of -1 and without additional `if`:
```
int x=0;
int s=0;
/* ... */
do
{
sum = x + sum; /* first time x==0, no effect */
s=scanf_s("%d", &x); /* note scan success */
} while ((x != -1) && (s==1)); /* also qu... |
50,357,180 | I am working on page, that gives you (based on range input) random string from array. It works by form with post method, that goes to same website, where is that form. But I ran into problems. Mostly it gives same string, as it gave before, so I would like to somehow save key from array, and compare it to new randomly ... | 2018/05/15 | [
"https://Stackoverflow.com/questions/50357180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6483765/"
] | If you want to find the sum of numbers you should add them in while loop.
So your line of code
```
sum = sum+x;
```
Should be places in do while
```
do
{
scanf("%d",&x);
sum = sum+x;
}while(x!=-1);
```
But now you added -1 in your sum and i doubt you want that, so you should add 1 to sum after do wh... | Building on the answer by Jacek, here is the detail to get an efficient summing without the final adding of -1 and without additional `if`:
```
int x=0;
int s=0;
/* ... */
do
{
sum = x + sum; /* first time x==0, no effect */
s=scanf_s("%d", &x); /* note scan success */
} while ((x != -1) && (s==1)); /* also qu... |
281,167 | I've got a particular SQL statement which takes about 30 seconds to perform, and I'm wondering if anyone can see a problem with it, or where I need additional indexing.
The code is on a subform in Access, which shows results dependent on the content of five fields in the master form. There are nearly 5000 records in t... | 2008/11/11 | [
"https://Stackoverflow.com/questions/281167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30140/"
] | At first, try compacting and repairing the .mdb file.
Then, simplify your WHERE clause:
```
WHERE
[drawername] Like Nz(Forms!FrmSearchCompany!SearchName, "") & "*"
And
[Drawerpostcode] Like Nz(Forms!FrmSearchCompany!Searchpostcode, "") & "*"
And
[drawersortcode] Like Nz(Forms!FrmSearchCompany!Searchsortco... | How many rows are in QryAllTransactons?
If your result returns 0 rows then Access may be able to see that immediately and stop, but if it returns even a single row then it needs to pull in the entire resultset of QryAllTransactons so that it can do the join internally. That would be my first guess as to what is happen... |
281,167 | I've got a particular SQL statement which takes about 30 seconds to perform, and I'm wondering if anyone can see a problem with it, or where I need additional indexing.
The code is on a subform in Access, which shows results dependent on the content of five fields in the master form. There are nearly 5000 records in t... | 2008/11/11 | [
"https://Stackoverflow.com/questions/281167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30140/"
] | At first, try compacting and repairing the .mdb file.
Then, simplify your WHERE clause:
```
WHERE
[drawername] Like Nz(Forms!FrmSearchCompany!SearchName, "") & "*"
And
[Drawerpostcode] Like Nz(Forms!FrmSearchCompany!Searchpostcode, "") & "*"
And
[drawersortcode] Like Nz(Forms!FrmSearchCompany!Searchsortco... | Have you tried running each of the subqueries in the union? Usually optimizers don't spend much time trying to inspect efficiencies between union elements - each one runs on its own merits.
Given that fact, you could also put the "IF" logic into the procedural code and run each of the tests in some likely order of dis... |
281,167 | I've got a particular SQL statement which takes about 30 seconds to perform, and I'm wondering if anyone can see a problem with it, or where I need additional indexing.
The code is on a subform in Access, which shows results dependent on the content of five fields in the master form. There are nearly 5000 records in t... | 2008/11/11 | [
"https://Stackoverflow.com/questions/281167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30140/"
] | At first, try compacting and repairing the .mdb file.
Then, simplify your WHERE clause:
```
WHERE
[drawername] Like Nz(Forms!FrmSearchCompany!SearchName, "") & "*"
And
[Drawerpostcode] Like Nz(Forms!FrmSearchCompany!Searchpostcode, "") & "*"
And
[drawersortcode] Like Nz(Forms!FrmSearchCompany!Searchsortco... | Get rid of those like operators.
In your case you don't need them. Just check if the field starts with a given value which you can achive whith something like this:
```
Left([field], Len(value)) = value
```
This method applied to your query would look like this (did some reformatting for better readability):
```
S... |
281,167 | I've got a particular SQL statement which takes about 30 seconds to perform, and I'm wondering if anyone can see a problem with it, or where I need additional indexing.
The code is on a subform in Access, which shows results dependent on the content of five fields in the master form. There are nearly 5000 records in t... | 2008/11/11 | [
"https://Stackoverflow.com/questions/281167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30140/"
] | Two things. Since this is an Access database with a SQL Server backend, you may find a considerable speed improvement by converting this to a stored proc.
Second, do you really need to return all those fields, especially in the tabCustomers table? Never return more fields than you actually intend to use and you will i... | At first, try compacting and repairing the .mdb file.
Then, simplify your WHERE clause:
```
WHERE
[drawername] Like Nz(Forms!FrmSearchCompany!SearchName, "") & "*"
And
[Drawerpostcode] Like Nz(Forms!FrmSearchCompany!Searchpostcode, "") & "*"
And
[drawersortcode] Like Nz(Forms!FrmSearchCompany!Searchsortco... |
281,167 | I've got a particular SQL statement which takes about 30 seconds to perform, and I'm wondering if anyone can see a problem with it, or where I need additional indexing.
The code is on a subform in Access, which shows results dependent on the content of five fields in the master form. There are nearly 5000 records in t... | 2008/11/11 | [
"https://Stackoverflow.com/questions/281167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30140/"
] | At first, try compacting and repairing the .mdb file.
Then, simplify your WHERE clause:
```
WHERE
[drawername] Like Nz(Forms!FrmSearchCompany!SearchName, "") & "*"
And
[Drawerpostcode] Like Nz(Forms!FrmSearchCompany!Searchpostcode, "") & "*"
And
[drawersortcode] Like Nz(Forms!FrmSearchCompany!Searchsortco... | When you upsized did you make sure the tables were properly indexed? Indexes will speed queries tremendously if used properly (note they may also slow down inserts/updates/deletes, so choose carefully what to index) |
281,167 | I've got a particular SQL statement which takes about 30 seconds to perform, and I'm wondering if anyone can see a problem with it, or where I need additional indexing.
The code is on a subform in Access, which shows results dependent on the content of five fields in the master form. There are nearly 5000 records in t... | 2008/11/11 | [
"https://Stackoverflow.com/questions/281167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30140/"
] | Two things. Since this is an Access database with a SQL Server backend, you may find a considerable speed improvement by converting this to a stored proc.
Second, do you really need to return all those fields, especially in the tabCustomers table? Never return more fields than you actually intend to use and you will i... | How many rows are in QryAllTransactons?
If your result returns 0 rows then Access may be able to see that immediately and stop, but if it returns even a single row then it needs to pull in the entire resultset of QryAllTransactons so that it can do the join internally. That would be my first guess as to what is happen... |
281,167 | I've got a particular SQL statement which takes about 30 seconds to perform, and I'm wondering if anyone can see a problem with it, or where I need additional indexing.
The code is on a subform in Access, which shows results dependent on the content of five fields in the master form. There are nearly 5000 records in t... | 2008/11/11 | [
"https://Stackoverflow.com/questions/281167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30140/"
] | Two things. Since this is an Access database with a SQL Server backend, you may find a considerable speed improvement by converting this to a stored proc.
Second, do you really need to return all those fields, especially in the tabCustomers table? Never return more fields than you actually intend to use and you will i... | Have you tried running each of the subqueries in the union? Usually optimizers don't spend much time trying to inspect efficiencies between union elements - each one runs on its own merits.
Given that fact, you could also put the "IF" logic into the procedural code and run each of the tests in some likely order of dis... |
281,167 | I've got a particular SQL statement which takes about 30 seconds to perform, and I'm wondering if anyone can see a problem with it, or where I need additional indexing.
The code is on a subform in Access, which shows results dependent on the content of five fields in the master form. There are nearly 5000 records in t... | 2008/11/11 | [
"https://Stackoverflow.com/questions/281167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30140/"
] | Two things. Since this is an Access database with a SQL Server backend, you may find a considerable speed improvement by converting this to a stored proc.
Second, do you really need to return all those fields, especially in the tabCustomers table? Never return more fields than you actually intend to use and you will i... | Get rid of those like operators.
In your case you don't need them. Just check if the field starts with a given value which you can achive whith something like this:
```
Left([field], Len(value)) = value
```
This method applied to your query would look like this (did some reformatting for better readability):
```
S... |
281,167 | I've got a particular SQL statement which takes about 30 seconds to perform, and I'm wondering if anyone can see a problem with it, or where I need additional indexing.
The code is on a subform in Access, which shows results dependent on the content of five fields in the master form. There are nearly 5000 records in t... | 2008/11/11 | [
"https://Stackoverflow.com/questions/281167",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/30140/"
] | Two things. Since this is an Access database with a SQL Server backend, you may find a considerable speed improvement by converting this to a stored proc.
Second, do you really need to return all those fields, especially in the tabCustomers table? Never return more fields than you actually intend to use and you will i... | When you upsized did you make sure the tables were properly indexed? Indexes will speed queries tremendously if used properly (note they may also slow down inserts/updates/deletes, so choose carefully what to index) |
221,897 | Well, the title says what I'd like to achieve: I'd like some workstations connect through my 1st internet account and some through my second one.
1. The workstations are in a workgroup. They're not in a domain. So They don't have a server. One workstation has the internet connection and shares the internet through th... | 2010/12/14 | [
"https://superuser.com/questions/221897",
"https://superuser.com",
"https://superuser.com/users/51559/"
] | That's one approach...but it doesn't solve other protocols.
if you just want to load balance over the two networks it's as simple as making sure the route cost is the same...route /? for help i think.
The other possibility is to run a linux router in a VM and bridge network connections to the VM so you have a fully... | Please also refer to @aking1012's answer.
If you are not familiar with routing setups, you can consider dual-WAN routers like the infamous [Cisco RV042 Dual WAN VPN Router](http://www.cisco.com/en/US/products/ps9925/index.html). These offer reasonable performance at ~$150.
Similar products exist from other brands, an... |
221,897 | Well, the title says what I'd like to achieve: I'd like some workstations connect through my 1st internet account and some through my second one.
1. The workstations are in a workgroup. They're not in a domain. So They don't have a server. One workstation has the internet connection and shares the internet through th... | 2010/12/14 | [
"https://superuser.com/questions/221897",
"https://superuser.com",
"https://superuser.com/users/51559/"
] | That's one approach...but it doesn't solve other protocols.
if you just want to load balance over the two networks it's as simple as making sure the route cost is the same...route /? for help i think.
The other possibility is to run a linux router in a VM and bridge network connections to the VM so you have a fully... | Connect each router to your switch and make sure they have different IPs in the same subnet. To define which internet connection is used by a particular machine, set its [default gateway](http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ras_config_incoming_tcpip_defaultgw.mspx?mfr=true) va... |
327,284 | Can someone explain which will be better, laptop with core i3 processor, 4GB RAM OR core i5 processor, 2GB RAM ? | 2011/08/24 | [
"https://superuser.com/questions/327284",
"https://superuser.com",
"https://superuser.com/users/95076/"
] | It depends really on *which* generation processors, and what you use it for - do you need a specific extension that's in one and not the other (for example VT). I generally tend to find that, except in exceptional circumstances, i'm not actually using all my processor power, so the processor i use is less critical.
On... | Based on the information given, this is unanswerable.
However, if we were to assume a modern OS running under a standard workload, 4GB of memory would be better. |
327,284 | Can someone explain which will be better, laptop with core i3 processor, 4GB RAM OR core i5 processor, 2GB RAM ? | 2011/08/24 | [
"https://superuser.com/questions/327284",
"https://superuser.com",
"https://superuser.com/users/95076/"
] | It depends really on *which* generation processors, and what you use it for - do you need a specific extension that's in one and not the other (for example VT). I generally tend to find that, except in exceptional circumstances, i'm not actually using all my processor power, so the processor i use is less critical.
On... | Does the i5 laptop have empty memory banks or support a larger memory module? If yes, I'd go with that one since memory can be upgraded but CPUs can't. Otherwise, 2GB is quite minimal for Win7, and too small for Vista. Other OSs can survive with 2GB but the more applications you run simultaneously, the slower it gets. |
327,284 | Can someone explain which will be better, laptop with core i3 processor, 4GB RAM OR core i5 processor, 2GB RAM ? | 2011/08/24 | [
"https://superuser.com/questions/327284",
"https://superuser.com",
"https://superuser.com/users/95076/"
] | It depends really on *which* generation processors, and what you use it for - do you need a specific extension that's in one and not the other (for example VT). I generally tend to find that, except in exceptional circumstances, i'm not actually using all my processor power, so the processor i use is less critical.
On... | Going with the i5 cpu would be a better choice it's a faster cpu. On a laptop you can't upgrade or change the cpu you however with the ram you can. So if you went with the i3 you're some what downgrading your option. Ram is super cheap nowadays so it's really not a big deal also it comes down to what you're planning to... |
327,284 | Can someone explain which will be better, laptop with core i3 processor, 4GB RAM OR core i5 processor, 2GB RAM ? | 2011/08/24 | [
"https://superuser.com/questions/327284",
"https://superuser.com",
"https://superuser.com/users/95076/"
] | It depends really on *which* generation processors, and what you use it for - do you need a specific extension that's in one and not the other (for example VT). I generally tend to find that, except in exceptional circumstances, i'm not actually using all my processor power, so the processor i use is less critical.
On... | Memory is a cheaper (and easier) upgrade than processor.
While I agree with the theory most of the other answers get into, I would purchase the i5 system and plan on upgrading the memory down the road if I find it is necessary.
It is highly unlikely that you are purchasing the computer for a static set of tasks. Rath... |
327,284 | Can someone explain which will be better, laptop with core i3 processor, 4GB RAM OR core i5 processor, 2GB RAM ? | 2011/08/24 | [
"https://superuser.com/questions/327284",
"https://superuser.com",
"https://superuser.com/users/95076/"
] | Memory is a cheaper (and easier) upgrade than processor.
While I agree with the theory most of the other answers get into, I would purchase the i5 system and plan on upgrading the memory down the road if I find it is necessary.
It is highly unlikely that you are purchasing the computer for a static set of tasks. Rath... | Based on the information given, this is unanswerable.
However, if we were to assume a modern OS running under a standard workload, 4GB of memory would be better. |
327,284 | Can someone explain which will be better, laptop with core i3 processor, 4GB RAM OR core i5 processor, 2GB RAM ? | 2011/08/24 | [
"https://superuser.com/questions/327284",
"https://superuser.com",
"https://superuser.com/users/95076/"
] | Memory is a cheaper (and easier) upgrade than processor.
While I agree with the theory most of the other answers get into, I would purchase the i5 system and plan on upgrading the memory down the road if I find it is necessary.
It is highly unlikely that you are purchasing the computer for a static set of tasks. Rath... | Does the i5 laptop have empty memory banks or support a larger memory module? If yes, I'd go with that one since memory can be upgraded but CPUs can't. Otherwise, 2GB is quite minimal for Win7, and too small for Vista. Other OSs can survive with 2GB but the more applications you run simultaneously, the slower it gets. |
327,284 | Can someone explain which will be better, laptop with core i3 processor, 4GB RAM OR core i5 processor, 2GB RAM ? | 2011/08/24 | [
"https://superuser.com/questions/327284",
"https://superuser.com",
"https://superuser.com/users/95076/"
] | Memory is a cheaper (and easier) upgrade than processor.
While I agree with the theory most of the other answers get into, I would purchase the i5 system and plan on upgrading the memory down the road if I find it is necessary.
It is highly unlikely that you are purchasing the computer for a static set of tasks. Rath... | Going with the i5 cpu would be a better choice it's a faster cpu. On a laptop you can't upgrade or change the cpu you however with the ram you can. So if you went with the i3 you're some what downgrading your option. Ram is super cheap nowadays so it's really not a big deal also it comes down to what you're planning to... |
461,503 | So, I was installing some packages via Synaptic. They were for my fan and hot keys. It froze durning installation, so I rebooted it, only to get stuck at the splash screen. I'm guessing it's just not loading the login panel. Any help?
I'm using a Dell Vostro 3450, Ubuntu 14.??
Pressing Crtl - Alt - F1 does nothing at... | 2014/05/06 | [
"https://askubuntu.com/questions/461503",
"https://askubuntu.com",
"https://askubuntu.com/users/278012/"
] | Just gone through this myself.
I had to try several different USB sticks before I found one that worked.
I also found that it only worked if I created the installation disk from within an existing Ubuntu installation. | * Did you try to install connected to internet ?
* Did you try to install from USB Stick ? I think its much more stable than usual DVD Driver, especially on old or heavy used computers
Sorry my newbie help, im new but these things solved my problems once. |
461,503 | So, I was installing some packages via Synaptic. They were for my fan and hot keys. It froze durning installation, so I rebooted it, only to get stuck at the splash screen. I'm guessing it's just not loading the login panel. Any help?
I'm using a Dell Vostro 3450, Ubuntu 14.??
Pressing Crtl - Alt - F1 does nothing at... | 2014/05/06 | [
"https://askubuntu.com/questions/461503",
"https://askubuntu.com",
"https://askubuntu.com/users/278012/"
] | I've found that unetbootin doesn't wipe the USB drive before installing and it gets confused. On my Windows 7 machine, I open a Command Prompt window with Admin privileges. Type in the following commands:
```
diskpart
list disk
select disk ##
```
(Make sure you select the number from the above list that represents ... | * Did you try to install connected to internet ?
* Did you try to install from USB Stick ? I think its much more stable than usual DVD Driver, especially on old or heavy used computers
Sorry my newbie help, im new but these things solved my problems once. |
37,700,883 | I am making a program that converts a number from decimal to binary for my college.
I have written the script and functions in Swift with Xcode and it works very good. But now it works with a calculate button.
I want to remove the button code and return the result on the specific label while the users enters the numbe... | 2016/06/08 | [
"https://Stackoverflow.com/questions/37700883",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4752617/"
] | If you are using NSTextField for input then set its delegate to self and use [NSTextFieldDelegate](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/NSTextFieldDelegate_Protocol/index.html#//apple_ref/swift/intf/c:objc(pl)NSTextFieldDelegate)'s **controlTextDidChange** delegate.
In this delegate yo... | I'm assuming you are using an NSTextField. For this you have to use the and its method `textDidChange:`. In this method just call your functions and set the value to label.
Reference from: [NSTextField value changed](https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSTextFie... |
39,799,104 | I was trying to Transfer my Access Table Data over to SQL server but I am getting an error which says
>
> Object Variable or With block variable not set
>
>
>
I've already connected my Access database with SQL server but now facing problem transferring data to SQL server with VBA code.
Can you please help me wi... | 2016/09/30 | [
"https://Stackoverflow.com/questions/39799104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6523744/"
] | It seems you are attempting an ad hoc distributed query. If server permits it, consider executing this statement after your ADO connection. No need for calling Access objects.
```
ADOConn.Execute "INSERT INTO dbo.SFTransfersDB ([ID], [TO])" _
" SELECT [ID], [TO] FROM OPENDATASOURCE('Microsoft.ACE.OLEDB.12.0... | You declare two Database variables, but don't initialize them (you don't set them to anything):
```
Dim db As Database
Dim Discrepancy As Database
```
So this
```
Set db = Discrepancy
```
is the same as
```
Set db = Nothing
```
and so when you try to use `db`, you get the error that `db` is not set, which it... |
39,799,104 | I was trying to Transfer my Access Table Data over to SQL server but I am getting an error which says
>
> Object Variable or With block variable not set
>
>
>
I've already connected my Access database with SQL server but now facing problem transferring data to SQL server with VBA code.
Can you please help me wi... | 2016/09/30 | [
"https://Stackoverflow.com/questions/39799104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6523744/"
] | You declare two Database variables, but don't initialize them (you don't set them to anything):
```
Dim db As Database
Dim Discrepancy As Database
```
So this
```
Set db = Discrepancy
```
is the same as
```
Set db = Nothing
```
and so when you try to use `db`, you get the error that `db` is not set, which it... | Thanks for your suggestions.
I got it correct after all.
I used "Set db = CurrentDb" and it worked perfect. |
39,799,104 | I was trying to Transfer my Access Table Data over to SQL server but I am getting an error which says
>
> Object Variable or With block variable not set
>
>
>
I've already connected my Access database with SQL server but now facing problem transferring data to SQL server with VBA code.
Can you please help me wi... | 2016/09/30 | [
"https://Stackoverflow.com/questions/39799104",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6523744/"
] | It seems you are attempting an ad hoc distributed query. If server permits it, consider executing this statement after your ADO connection. No need for calling Access objects.
```
ADOConn.Execute "INSERT INTO dbo.SFTransfersDB ([ID], [TO])" _
" SELECT [ID], [TO] FROM OPENDATASOURCE('Microsoft.ACE.OLEDB.12.0... | Thanks for your suggestions.
I got it correct after all.
I used "Set db = CurrentDb" and it worked perfect. |
4,500,134 | Hello I am a big fan of Git and Hg and have to use them both on many projects. I currently use Posh-Hg, which is a powershell plugin that places the current branch and outstanding commit right in your powershell. Posh-Git operates in a similar manner except for Git. Has anyone successfully gotten the two powershell scr... | 2010/12/21 | [
"https://Stackoverflow.com/questions/4500134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86411/"
] | Try this one in your profile script:
```
function isCurrentDirectoryARepository($type) {
if ((Test-Path $type) -eq $TRUE) {
return $TRUE
}
# Test within parent dirs
$checkIn = (Get-Item .).parent
while ($checkIn -ne $NULL) {
$pathToTest = $checkIn.fullname + '/' + $type;
i... | Please note, that issue is now fixed. Assuming that you have last versions of the Posh-Hg and Posh-Git, your profile should include only.
```
# Posh-Hg and Posh-git prompt
. $ProfileRoot\Modules\posh-hg\profile.example.ps1
. $ProfileRoot\Modules\posh-git\profile.example.ps1
``` |
4,500,134 | Hello I am a big fan of Git and Hg and have to use them both on many projects. I currently use Posh-Hg, which is a powershell plugin that places the current branch and outstanding commit right in your powershell. Posh-Git operates in a similar manner except for Git. Has anyone successfully gotten the two powershell scr... | 2010/12/21 | [
"https://Stackoverflow.com/questions/4500134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86411/"
] | Try this one in your profile script:
```
function isCurrentDirectoryARepository($type) {
if ((Test-Path $type) -eq $TRUE) {
return $TRUE
}
# Test within parent dirs
$checkIn = (Get-Item .).parent
while ($checkIn -ne $NULL) {
$pathToTest = $checkIn.fullname + '/' + $type;
i... | FYI - there's a sweet Chocolatey package called [Posh-GIT-HG](http://chocolatey.org/packages/Posh-GIT-HG) that does exactly what the [answer](https://stackoverflow.com/questions/4500134/posh-git-and-posh-hg-together/4845935#4845935) above suggests, but has the added benefit of potentially staying in sync with the lates... |
4,500,134 | Hello I am a big fan of Git and Hg and have to use them both on many projects. I currently use Posh-Hg, which is a powershell plugin that places the current branch and outstanding commit right in your powershell. Posh-Git operates in a similar manner except for Git. Has anyone successfully gotten the two powershell scr... | 2010/12/21 | [
"https://Stackoverflow.com/questions/4500134",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/86411/"
] | Please note, that issue is now fixed. Assuming that you have last versions of the Posh-Hg and Posh-Git, your profile should include only.
```
# Posh-Hg and Posh-git prompt
. $ProfileRoot\Modules\posh-hg\profile.example.ps1
. $ProfileRoot\Modules\posh-git\profile.example.ps1
``` | FYI - there's a sweet Chocolatey package called [Posh-GIT-HG](http://chocolatey.org/packages/Posh-GIT-HG) that does exactly what the [answer](https://stackoverflow.com/questions/4500134/posh-git-and-posh-hg-together/4845935#4845935) above suggests, but has the added benefit of potentially staying in sync with the lates... |
64,589,956 | I'm trying to malloc/realloc memory for an array of trace\_t structs.
```
typedef struct {
step_t *head; // pointer to the step in the head of the trace
step_t *tail; // pointer to the step in the tail of the trace
} trace_t;
```
The code runs fine (i think) but my compiler outputted a "dereference o... | 2020/10/29 | [
"https://Stackoverflow.com/questions/64589956",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13238932/"
] | It means that the pointer produced by this expression
```
trace_arr[i]
```
has indeterminate value.
That is you did not initialized the dynamically allocated array pointed to by the pointer `trace_arr`.
In for loops like for example this
```
for (i=0; i<limit; i++) {
trace_arr[i]->head = trace_arr[i]... | Assigning a value to `trace_arr` does not assign any value to `trace_arr[i]` but you use `trace_arr[i]` in `trace_arr[i]->head = …` |
64,589,956 | I'm trying to malloc/realloc memory for an array of trace\_t structs.
```
typedef struct {
step_t *head; // pointer to the step in the head of the trace
step_t *tail; // pointer to the step in the tail of the trace
} trace_t;
```
The code runs fine (i think) but my compiler outputted a "dereference o... | 2020/10/29 | [
"https://Stackoverflow.com/questions/64589956",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13238932/"
] | You want an array of structs, but you handle it like an array of pointers.
You need to get rid of one level of indirection.
This could look as follows (not compiled):
```
trace_t*
make_trace_array(trace_t** trace_arr, int request, int limit) {
int i;
assert(trace_arr != NULL);
if (request==MALLOC) {
... | Assigning a value to `trace_arr` does not assign any value to `trace_arr[i]` but you use `trace_arr[i]` in `trace_arr[i]->head = …` |
5,400,060 | I am in the process of creating an [AICC](http://www.aicc.org) (Aviation Industry CBT Committee) compliant LMS using Classic ASP. Does anyone have any experience with this? | 2011/03/23 | [
"https://Stackoverflow.com/questions/5400060",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/264852/"
] | I haven't used `glPolygonOffset`, but I just read up on it in the [official FAQ](http://www.opengl.org/resources/faq/technical/polygonoffset.htm) -- required reading if you haven't already seen this. There is also the [man page](http://www.opengl.org/sdk/docs/man/xhtml/glPolygonOffset.xml).
According to that reference... | You can try to set one polygon offset positive one offset negative, I bet that will work.
glPolygonOffset(0,1) and glPolygonOffset(0,-1) |
458,153 | I am using a **Conda** *Python* installation and **Jupyter** to work with a script producing a LaTeX file I want to compile. These are the relevant code lines:
```
import subprocess
xelatex= "/usr/local/texlive/2018/bin/x86_64-darwin/xelatex"
subprocess.check_call([xelatex, '-shell-escape', '-file-line-error', '-inter... | 2018/11/03 | [
"https://tex.stackexchange.com/questions/458153",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/75937/"
] | Welcome to TeX.SE.! As far as I know, a `.pdf` or `.dvi` file can not have such a functionality (for whole pages). But it can have it for comments... something that I suppose is not enough for you. If you open any pdf (or dvi) by using any viewer of your system, you will see that all the pages are visible. So, the I do... | As other answers pointed out there is no way to do what you ask exactly.
As an alternative, you could have some "optional" sections in your resume, and compile both a long and a short version (with/without the optional sections). This way you can choose which version to send depending on who you send it to, or send bo... |
458,153 | I am using a **Conda** *Python* installation and **Jupyter** to work with a script producing a LaTeX file I want to compile. These are the relevant code lines:
```
import subprocess
xelatex= "/usr/local/texlive/2018/bin/x86_64-darwin/xelatex"
subprocess.check_call([xelatex, '-shell-escape', '-file-line-error', '-inter... | 2018/11/03 | [
"https://tex.stackexchange.com/questions/458153",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/75937/"
] | One solution could be `xr-hyper`:
[](https://i.stack.imgur.com/c0pVV.png)
curriculum.tex:
```
\documentclass[twocolumn]{article}
\usepackage{xr-hyper}
\usepackage[colorlinks,allcolors=blue]{hyperref}
\externaldocument{001}
\externaldocument{002}
\usepackage{nameref}
\parin... | As other answers pointed out there is no way to do what you ask exactly.
As an alternative, you could have some "optional" sections in your resume, and compile both a long and a short version (with/without the optional sections). This way you can choose which version to send depending on who you send it to, or send bo... |
56,466,566 | I am trying to scrape a website for deals, specifically when a product is 100% off.
How can I find all span tags within this page, if any, that have a value of -100%, for example `<span>-100%</span>`.
If one of these is found how can I get the parent a tag that it is nested in.
I am using python 3.x and beautiful ... | 2019/06/05 | [
"https://Stackoverflow.com/questions/56466566",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8142205/"
] | Perhaps you should be using destSheet rather than Activesheet, since Activesheet isn't defined. Otherwise, you should prefix Activesheet with objExcelApp, thus:
```
objExcelApp.Activesheet
``` | Since you're running this in Word, VBA only "knows" things that belong to the Word *object model* unless the code specifically indicates a different object model is the source. Word knows nothing about "Sheets" - only Excel knows what `ActiveSheet` is.
Even though the code you show us doesn't call the procedure `Prin... |
39,465,354 | I've just create a new table in my sqlserver name exporttable
now I'm trying to push out using cmd bcp but om getting this following error:
>
> SQLState = S1000, NativeError = 0 Error = [Microsoft][ODBC Driver 13
> for SQL Server]Unable to open BCP host data-file
>
>
>
Here is my path:
```
C:\Users\Serge>BCP ... | 2016/09/13 | [
"https://Stackoverflow.com/questions/39465354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5998444/"
] | From the error I take, that the data file cannot be opened:
```
C:\Users\Serge>BCP Testing.bdo.Exporttable out "C:\Users\Serge\Desktop\MyFile.txt" -C -T
```
I think, you have to add a filename behind the `\Desktop`. *Desktop* is an existing directory and cannot be opened as file ...
And - btw - it might be necessar... | I know this is old, but you also appear to have the schema spelled wrong.
C:\Users\Serge>BCP Testing.**bdo**.Exporttable out "C:\Users\Serge\Desktop" -C -T
s/b
C:\Users\Serge>BCP Testing.**dbo**.Exporttable out "C:\Users\Serge\Desktop" -C -T |
39,465,354 | I've just create a new table in my sqlserver name exporttable
now I'm trying to push out using cmd bcp but om getting this following error:
>
> SQLState = S1000, NativeError = 0 Error = [Microsoft][ODBC Driver 13
> for SQL Server]Unable to open BCP host data-file
>
>
>
Here is my path:
```
C:\Users\Serge>BCP ... | 2016/09/13 | [
"https://Stackoverflow.com/questions/39465354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5998444/"
] | If you are running BCP through xp\_cmdshell, run the following-->
xp\_cmdshell 'whoami';
GO
--Make sure whatever user value you get back has full access to the file in question | I know this is old, but you also appear to have the schema spelled wrong.
C:\Users\Serge>BCP Testing.**bdo**.Exporttable out "C:\Users\Serge\Desktop" -C -T
s/b
C:\Users\Serge>BCP Testing.**dbo**.Exporttable out "C:\Users\Serge\Desktop" -C -T |
39,465,354 | I've just create a new table in my sqlserver name exporttable
now I'm trying to push out using cmd bcp but om getting this following error:
>
> SQLState = S1000, NativeError = 0 Error = [Microsoft][ODBC Driver 13
> for SQL Server]Unable to open BCP host data-file
>
>
>
Here is my path:
```
C:\Users\Serge>BCP ... | 2016/09/13 | [
"https://Stackoverflow.com/questions/39465354",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5998444/"
] | Run: EXEC master..xp\_cmdshell 'DIR C:\Users\Serge\Desktop', this will show if you have access to the path.
Remember if you are accessing SQL remotely or over a network, the output ie. "C:\Users\Serge\Desktop" will be the C drive on the SQL Server, not your remote PC you are working on. | I know this is old, but you also appear to have the schema spelled wrong.
C:\Users\Serge>BCP Testing.**bdo**.Exporttable out "C:\Users\Serge\Desktop" -C -T
s/b
C:\Users\Serge>BCP Testing.**dbo**.Exporttable out "C:\Users\Serge\Desktop" -C -T |
29,642,560 | I usually do a project and deploy it on the client machine, but all the Ruby/WATIR scripts are clearly visible to everyone. Is there any way to hide my code? Or is there any way I can secure my code? Or Is there any way to lock a folder through Ruby? | 2015/04/15 | [
"https://Stackoverflow.com/questions/29642560",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4091011/"
] | You could use jRuby and create a JAR using [Warbler](https://github.com/jruby/warbler) but that will only stop non-geek users. [Here](https://sqa.stackexchange.com/questions/5364/watir-webdriver-in-conjunction-with-java) a link about using watir in jRuby
Converting the script to an executable file like with [Ocra](ht... | Code obfuscation is one option. You can use tools like [RubyScript2Exe](http://www.erikveen.dds.nl/rubyscript2exe/) or [AllInOneRuby](http://www.erikveen.dds.nl/allinoneruby/index.html) to obfuscate your code or make them difficult to understand. However these tools have their own flaws which are nicely discussed [here... |
20,694,959 | I'm facing a problem with my Async task. I have some normal operations to accomplish in the background and view results after it completes however the UI freezes although my code inside the doinbackground block. Please help me!
Hereunder my code.
```
class DownloadFileFromURL extends AsyncTask<String, Void, String> {... | 2013/12/20 | [
"https://Stackoverflow.com/questions/20694959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1332606/"
] | **Do not do not do not** do this in `AsyncTask`
```
runOnUiThread(new Runnable() {
public void run() {
```
every method in `AsyncTask` runs on the `UI Thread` except for `doInBackground()`. Do your work in `doInBackground()` (your calculations, network operations, and such) then get a result from that and up... | This is where you are doing it wrong.
```
runOnUiThread(new Runnable() {
public void run() {
Calculate();
}
});
```
Here you are calling the `Calculate()` method in the UI thread again. That's why your app freezes. Just call `Calculate()` inside `doInBackground()`. |
20,694,959 | I'm facing a problem with my Async task. I have some normal operations to accomplish in the background and view results after it completes however the UI freezes although my code inside the doinbackground block. Please help me!
Hereunder my code.
```
class DownloadFileFromURL extends AsyncTask<String, Void, String> {... | 2013/12/20 | [
"https://Stackoverflow.com/questions/20694959",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1332606/"
] | **Do not do not do not** do this in `AsyncTask`
```
runOnUiThread(new Runnable() {
public void run() {
```
every method in `AsyncTask` runs on the `UI Thread` except for `doInBackground()`. Do your work in `doInBackground()` (your calculations, network operations, and such) then get a result from that and up... | You are calling Calculate() on UI thread.Which will definitely freezes the UI .
Remove all the Ui stuff from calculate() and call it directly inside Async. |
12,287,189 | This sounds very backwards, but I want to take existing CSS classes and make them inline in the element itself (The css styles and the html elements are in the same file). There is a reason for this, for which I will not go into detail.
Example:
```
<html>
<style type="text/css">
.p1 { height: 10px; }
</style>
<b... | 2012/09/05 | [
"https://Stackoverflow.com/questions/12287189",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/175057/"
] | You are looking for [Premailer](http://premailer.dialect.ca/) ([The source available as well](https://github.com/alexdunae/premailer/)) - it is a Ruby library that does just that (inlines CSS for HTML email - but the output isn't specific to HTML email - it should work just fine with your PDF document generator as well... | MailChimp has a page for this in their labs, the CSS Inliner -
<http://beaker.mailchimp.com/inline-css>
It does leave the class, however. |
62,456,117 | Trying to do Fermat's Little Theorem and noticed it wasn't working in C so I tried it in Python and it worked fine.
**Fermat's Little Theorem**
>
> <https://mathworld.wolfram.com/FermatsLittleTheorem.html>
>
>
>
The answer is supposed to give me a 1 but I'm getting 13.
**Python exponent(working)**
```
prime_nu... | 2020/06/18 | [
"https://Stackoverflow.com/questions/62456117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13770686/"
] | In C the pow() function takes and returns double precision floating point values which are approximations.
In Python the \*\* operator does the operation using Python integers, grow in size (memory used to hold the value). If you forced the numbers to be floating points before the operation you'd probably get the same... | The problem was I should've been using `powl()` which returns a long double instead of a double and I also should've been using `fmodl()` which returns the remainder that has a long double type.
C code working
```
long double prime_num = powl(13,17-1);
>665416609183179841
fmodl(primen_num,17);
>1
``` |
62,456,117 | Trying to do Fermat's Little Theorem and noticed it wasn't working in C so I tried it in Python and it worked fine.
**Fermat's Little Theorem**
>
> <https://mathworld.wolfram.com/FermatsLittleTheorem.html>
>
>
>
The answer is supposed to give me a 1 but I'm getting 13.
**Python exponent(working)**
```
prime_nu... | 2020/06/18 | [
"https://Stackoverflow.com/questions/62456117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13770686/"
] | You need to use long long if you want the precision. The problem is there is no pow so it is down to simple multiplication.
```
long long n, val;
int ii;
n = 13LL;
val = n;
for (ii = 2; ii < 17; ++ii)
val *= n;
printf("%lld\n", val);
printf("%lld\n", val % 17LL);
``` | The problem was I should've been using `powl()` which returns a long double instead of a double and I also should've been using `fmodl()` which returns the remainder that has a long double type.
C code working
```
long double prime_num = powl(13,17-1);
>665416609183179841
fmodl(primen_num,17);
>1
``` |
49,910,180 | I just learned about pointers in c++, and my instructor told to create a doubly linked list with a for loop. However, the only example I was given was
```
Node *n1 = new Node(1);
Node *n2 = new Node(2);
Node *n3 = new Node(3);
Node *n4 = new Node(4);
Node *n5 = new Node(5);
DL_List mylist;
... | 2018/04/18 | [
"https://Stackoverflow.com/questions/49910180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9666782/"
] | I would just put the class and its input in a tuple:
```
input_data = {...}
my_list = [
{"a": (Class1, input_data)},
{"b": (Class2, input_data)},
{"c": (Class3, input_data)}
]
```
Then when I want to instantiate:
```
tup = my_list[0]["a"]
instantiated_class = tup[0](tup[1])
``` | I feel that you are looking for a dictionary with multiple items, not a list of single-item dictionaries.
You can initialize the dictionary with class constructors rather than class objects and create objects later:
```
input_data = {...}
my_dict = {
"a": Class1,
"b": Class2,
"c": Class3
}
def get_item(d... |
49,910,180 | I just learned about pointers in c++, and my instructor told to create a doubly linked list with a for loop. However, the only example I was given was
```
Node *n1 = new Node(1);
Node *n2 = new Node(2);
Node *n3 = new Node(3);
Node *n4 = new Node(4);
Node *n5 = new Node(5);
DL_List mylist;
... | 2018/04/18 | [
"https://Stackoverflow.com/questions/49910180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9666782/"
] | I would just put the class and its input in a tuple:
```
input_data = {...}
my_list = [
{"a": (Class1, input_data)},
{"b": (Class2, input_data)},
{"c": (Class3, input_data)}
]
```
Then when I want to instantiate:
```
tup = my_list[0]["a"]
instantiated_class = tup[0](tup[1])
``` | It sounds like you need a generator. A generator creates each element as needed when you're iterating over it (the downside is, you can't iterate over the generator again; once you've "used" an element, it's gone). `range` in Python is a (somewhat special) example of a generator. I'm not sure how you're going to pull o... |
49,910,180 | I just learned about pointers in c++, and my instructor told to create a doubly linked list with a for loop. However, the only example I was given was
```
Node *n1 = new Node(1);
Node *n2 = new Node(2);
Node *n3 = new Node(3);
Node *n4 = new Node(4);
Node *n5 = new Node(5);
DL_List mylist;
... | 2018/04/18 | [
"https://Stackoverflow.com/questions/49910180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9666782/"
] | I would just put the class and its input in a tuple:
```
input_data = {...}
my_list = [
{"a": (Class1, input_data)},
{"b": (Class2, input_data)},
{"c": (Class3, input_data)}
]
```
Then when I want to instantiate:
```
tup = my_list[0]["a"]
instantiated_class = tup[0](tup[1])
``` | You can turn them into functions that return the desired object and which you only evaluate as needed.
```
my_list = [
{"a": lambda: Class1(input_data)},
{"b": lambda: Class2(input_data)},
{"c": lambda: Class3(input_data)}
]
c1 = my_list[0]["a"]()
``` |
49,910,180 | I just learned about pointers in c++, and my instructor told to create a doubly linked list with a for loop. However, the only example I was given was
```
Node *n1 = new Node(1);
Node *n2 = new Node(2);
Node *n3 = new Node(3);
Node *n4 = new Node(4);
Node *n5 = new Node(5);
DL_List mylist;
... | 2018/04/18 | [
"https://Stackoverflow.com/questions/49910180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9666782/"
] | I would just put the class and its input in a tuple:
```
input_data = {...}
my_list = [
{"a": (Class1, input_data)},
{"b": (Class2, input_data)},
{"c": (Class3, input_data)}
]
```
Then when I want to instantiate:
```
tup = my_list[0]["a"]
instantiated_class = tup[0](tup[1])
``` | You could subclass `dict` along the lines (bare minimum, you may have to override more methods for a smooth experience):
```
>>> class delayed_dict(dict):
... def __init__(self, backstore):
... super().__init__()
... self._backstore=backstore
... def __getitem__(self, key):
... if not k... |
49,910,180 | I just learned about pointers in c++, and my instructor told to create a doubly linked list with a for loop. However, the only example I was given was
```
Node *n1 = new Node(1);
Node *n2 = new Node(2);
Node *n3 = new Node(3);
Node *n4 = new Node(4);
Node *n5 = new Node(5);
DL_List mylist;
... | 2018/04/18 | [
"https://Stackoverflow.com/questions/49910180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9666782/"
] | I feel that you are looking for a dictionary with multiple items, not a list of single-item dictionaries.
You can initialize the dictionary with class constructors rather than class objects and create objects later:
```
input_data = {...}
my_dict = {
"a": Class1,
"b": Class2,
"c": Class3
}
def get_item(d... | It sounds like you need a generator. A generator creates each element as needed when you're iterating over it (the downside is, you can't iterate over the generator again; once you've "used" an element, it's gone). `range` in Python is a (somewhat special) example of a generator. I'm not sure how you're going to pull o... |
49,910,180 | I just learned about pointers in c++, and my instructor told to create a doubly linked list with a for loop. However, the only example I was given was
```
Node *n1 = new Node(1);
Node *n2 = new Node(2);
Node *n3 = new Node(3);
Node *n4 = new Node(4);
Node *n5 = new Node(5);
DL_List mylist;
... | 2018/04/18 | [
"https://Stackoverflow.com/questions/49910180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9666782/"
] | I feel that you are looking for a dictionary with multiple items, not a list of single-item dictionaries.
You can initialize the dictionary with class constructors rather than class objects and create objects later:
```
input_data = {...}
my_dict = {
"a": Class1,
"b": Class2,
"c": Class3
}
def get_item(d... | You can turn them into functions that return the desired object and which you only evaluate as needed.
```
my_list = [
{"a": lambda: Class1(input_data)},
{"b": lambda: Class2(input_data)},
{"c": lambda: Class3(input_data)}
]
c1 = my_list[0]["a"]()
``` |
49,910,180 | I just learned about pointers in c++, and my instructor told to create a doubly linked list with a for loop. However, the only example I was given was
```
Node *n1 = new Node(1);
Node *n2 = new Node(2);
Node *n3 = new Node(3);
Node *n4 = new Node(4);
Node *n5 = new Node(5);
DL_List mylist;
... | 2018/04/18 | [
"https://Stackoverflow.com/questions/49910180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9666782/"
] | I feel that you are looking for a dictionary with multiple items, not a list of single-item dictionaries.
You can initialize the dictionary with class constructors rather than class objects and create objects later:
```
input_data = {...}
my_dict = {
"a": Class1,
"b": Class2,
"c": Class3
}
def get_item(d... | You could subclass `dict` along the lines (bare minimum, you may have to override more methods for a smooth experience):
```
>>> class delayed_dict(dict):
... def __init__(self, backstore):
... super().__init__()
... self._backstore=backstore
... def __getitem__(self, key):
... if not k... |
49,910,180 | I just learned about pointers in c++, and my instructor told to create a doubly linked list with a for loop. However, the only example I was given was
```
Node *n1 = new Node(1);
Node *n2 = new Node(2);
Node *n3 = new Node(3);
Node *n4 = new Node(4);
Node *n5 = new Node(5);
DL_List mylist;
... | 2018/04/18 | [
"https://Stackoverflow.com/questions/49910180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9666782/"
] | You can turn them into functions that return the desired object and which you only evaluate as needed.
```
my_list = [
{"a": lambda: Class1(input_data)},
{"b": lambda: Class2(input_data)},
{"c": lambda: Class3(input_data)}
]
c1 = my_list[0]["a"]()
``` | It sounds like you need a generator. A generator creates each element as needed when you're iterating over it (the downside is, you can't iterate over the generator again; once you've "used" an element, it's gone). `range` in Python is a (somewhat special) example of a generator. I'm not sure how you're going to pull o... |
49,910,180 | I just learned about pointers in c++, and my instructor told to create a doubly linked list with a for loop. However, the only example I was given was
```
Node *n1 = new Node(1);
Node *n2 = new Node(2);
Node *n3 = new Node(3);
Node *n4 = new Node(4);
Node *n5 = new Node(5);
DL_List mylist;
... | 2018/04/18 | [
"https://Stackoverflow.com/questions/49910180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9666782/"
] | You could subclass `dict` along the lines (bare minimum, you may have to override more methods for a smooth experience):
```
>>> class delayed_dict(dict):
... def __init__(self, backstore):
... super().__init__()
... self._backstore=backstore
... def __getitem__(self, key):
... if not k... | It sounds like you need a generator. A generator creates each element as needed when you're iterating over it (the downside is, you can't iterate over the generator again; once you've "used" an element, it's gone). `range` in Python is a (somewhat special) example of a generator. I'm not sure how you're going to pull o... |
63,419,283 | I UnmarshalXML xml, but I can't get the same result when MarshalXML (see the example below). As you can see the **xs:simpleType** is transformed into a **simpleType** and other differences. How can I make a complete identity? I need to convert arbitrary xml according to certain rules, so I can't use specific tags.
You... | 2020/08/14 | [
"https://Stackoverflow.com/questions/63419283",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3398921/"
] | You don't need custom marshaling or unmarshaling logic, and you can force this behavior if before marshaling you concatenate the namespace and tag name:
```
n.XMLName.Local = n.XMLName.Space + ":" + n.XMLName.Local
n.XMLName.Space = ""
```
Example input matches output (try it on the [Go Playground](https://play.gola... | In our team we have been using for a few months a fantastic module that expresses XML inspired by Python etrees.
<https://github.com/beevik/etree>
It's simple but very powerful to interpret and manipulate XMLs. |
115,798 | this is my `hook_form_alter` function for set the placeholder attribute and other stuff:
```
function mysubtheme_form_alter(&$form, &$form_state, $form_id) {
switch ($form_id) {
case 'contact_site_form':
$form['tel'] = array(
'#title' => t('Tél'),
'#type' => 'te... | 2014/05/30 | [
"https://drupal.stackexchange.com/questions/115798",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/29100/"
] | You probably need to do something like this:
```
$protocol = (!empty($_SERVER['HTTPS'])) ? 'https' : 'http';
$base_url = $protocol . '://mysite.com';
```
...so that Drupal knows which protocol to use depending on how the site was accessed. | I have had luck with:
```
$base_url = '//mysite.com';
```
Also, to maintain the session cookie, I usually add:
```
$conf['https'] = TRUE;
```
which allows for mixed mode. |
115,798 | this is my `hook_form_alter` function for set the placeholder attribute and other stuff:
```
function mysubtheme_form_alter(&$form, &$form_state, $form_id) {
switch ($form_id) {
case 'contact_site_form':
$form['tel'] = array(
'#title' => t('Tél'),
'#type' => 'te... | 2014/05/30 | [
"https://drupal.stackexchange.com/questions/115798",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/29100/"
] | You probably need to do something like this:
```
$protocol = (!empty($_SERVER['HTTPS'])) ? 'https' : 'http';
$base_url = $protocol . '://mysite.com';
```
...so that Drupal knows which protocol to use depending on how the site was accessed. | Unfortunately the problem with setting the protocol relative to the accessed URL is that the site only references that when building the cached files and therefore creates all references to files and resources based on what protocol is used when rebuilding the site cache.
So, if you rebuild the cache from https, then ... |
115,798 | this is my `hook_form_alter` function for set the placeholder attribute and other stuff:
```
function mysubtheme_form_alter(&$form, &$form_state, $form_id) {
switch ($form_id) {
case 'contact_site_form':
$form['tel'] = array(
'#title' => t('Tél'),
'#type' => 'te... | 2014/05/30 | [
"https://drupal.stackexchange.com/questions/115798",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/29100/"
] | You probably need to do something like this:
```
$protocol = (!empty($_SERVER['HTTPS'])) ? 'https' : 'http';
$base_url = $protocol . '://mysite.com';
```
...so that Drupal knows which protocol to use depending on how the site was accessed. | This works well for me with several domains on the same Drupal install over CloudFlare:
```
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
$base_url = $_SERVER["HTTP_X_FORWARDED_PROTO"] . '://' . $_SERVER['HTTP_HOST'];
} else {
$base_url = 'http://' . $_SERVER['HTTP_HOST'];
}
```
Like this it also works well w... |
115,798 | this is my `hook_form_alter` function for set the placeholder attribute and other stuff:
```
function mysubtheme_form_alter(&$form, &$form_state, $form_id) {
switch ($form_id) {
case 'contact_site_form':
$form['tel'] = array(
'#title' => t('Tél'),
'#type' => 'te... | 2014/05/30 | [
"https://drupal.stackexchange.com/questions/115798",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/29100/"
] | I have had luck with:
```
$base_url = '//mysite.com';
```
Also, to maintain the session cookie, I usually add:
```
$conf['https'] = TRUE;
```
which allows for mixed mode. | Unfortunately the problem with setting the protocol relative to the accessed URL is that the site only references that when building the cached files and therefore creates all references to files and resources based on what protocol is used when rebuilding the site cache.
So, if you rebuild the cache from https, then ... |
115,798 | this is my `hook_form_alter` function for set the placeholder attribute and other stuff:
```
function mysubtheme_form_alter(&$form, &$form_state, $form_id) {
switch ($form_id) {
case 'contact_site_form':
$form['tel'] = array(
'#title' => t('Tél'),
'#type' => 'te... | 2014/05/30 | [
"https://drupal.stackexchange.com/questions/115798",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/29100/"
] | This works well for me with several domains on the same Drupal install over CloudFlare:
```
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) {
$base_url = $_SERVER["HTTP_X_FORWARDED_PROTO"] . '://' . $_SERVER['HTTP_HOST'];
} else {
$base_url = 'http://' . $_SERVER['HTTP_HOST'];
}
```
Like this it also works well w... | Unfortunately the problem with setting the protocol relative to the accessed URL is that the site only references that when building the cached files and therefore creates all references to files and resources based on what protocol is used when rebuilding the site cache.
So, if you rebuild the cache from https, then ... |
29,484,916 | If I want to print out array of string like:
```
char juices_A[][12] = { "dragonfruit", "waterberry", "sharonfruit", };
```
I can simply use `juices_A[0]`,`juices_A[1]`,`juices_A[3]`, respectively as a pointer to string `"dragonfruit"`, `"waterberry"`, `"sharonfruit"`, and print them out.
But what if I want to prin... | 2015/04/07 | [
"https://Stackoverflow.com/questions/29484916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4740734/"
] | You can use access arrays like pointers and vice versa.
Here's the output from the program below:
```
dragonfruit;waterberry;sharonfruit;
{ { 1, 2, 3, }, { 4, 5, 6, }, { 7, 8, 9, }, }
```
Here's a modification to your code:
```
#include <stdio.h>
#define ROW_WIDTH 3
#define TABLE_HEIGHT 3
int main(void) {
cha... | **Strings:**
```
-------------------------
|h | e | l | l | o | \0 |
-------------------------
|w | o | r | l | d | \0 |
------------------------
```
As you see this array can be stored in a 2D char array
```
char a[2][6];
```
Now `a[i]` gives the starting address of each row and `%s` prints out a string until a ... |
29,484,916 | If I want to print out array of string like:
```
char juices_A[][12] = { "dragonfruit", "waterberry", "sharonfruit", };
```
I can simply use `juices_A[0]`,`juices_A[1]`,`juices_A[3]`, respectively as a pointer to string `"dragonfruit"`, `"waterberry"`, `"sharonfruit"`, and print them out.
But what if I want to prin... | 2015/04/07 | [
"https://Stackoverflow.com/questions/29484916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4740734/"
] | **Strings:**
```
-------------------------
|h | e | l | l | o | \0 |
-------------------------
|w | o | r | l | d | \0 |
------------------------
```
As you see this array can be stored in a 2D char array
```
char a[2][6];
```
Now `a[i]` gives the starting address of each row and `%s` prints out a string until a ... | ```
#include <stdio.h>
int main()
{
int data[3][3] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };
int *ptr;
int lines = 3;
int columns = 3;
int i;
ptr = &data[0][0];
while (lines-- > 0) {
i = columns;
while (i-- > 0) {
printf("%d ", *ptr);
ptr += 1;
... |
29,484,916 | If I want to print out array of string like:
```
char juices_A[][12] = { "dragonfruit", "waterberry", "sharonfruit", };
```
I can simply use `juices_A[0]`,`juices_A[1]`,`juices_A[3]`, respectively as a pointer to string `"dragonfruit"`, `"waterberry"`, `"sharonfruit"`, and print them out.
But what if I want to prin... | 2015/04/07 | [
"https://Stackoverflow.com/questions/29484916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4740734/"
] | You can use access arrays like pointers and vice versa.
Here's the output from the program below:
```
dragonfruit;waterberry;sharonfruit;
{ { 1, 2, 3, }, { 4, 5, 6, }, { 7, 8, 9, }, }
```
Here's a modification to your code:
```
#include <stdio.h>
#define ROW_WIDTH 3
#define TABLE_HEIGHT 3
int main(void) {
cha... | The `char juices_A[][12] = { "dragonfruit", "waterberry", "sharonfruit" };` whenever the data is accessed it prints till `\0` is reached, as strings are considered only till `\0`. So when we use `juices_A[0]` it points to start of first data till `\0` is reached.But to get an individual char we need to mention both the... |
29,484,916 | If I want to print out array of string like:
```
char juices_A[][12] = { "dragonfruit", "waterberry", "sharonfruit", };
```
I can simply use `juices_A[0]`,`juices_A[1]`,`juices_A[3]`, respectively as a pointer to string `"dragonfruit"`, `"waterberry"`, `"sharonfruit"`, and print them out.
But what if I want to prin... | 2015/04/07 | [
"https://Stackoverflow.com/questions/29484916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4740734/"
] | The `char juices_A[][12] = { "dragonfruit", "waterberry", "sharonfruit" };` whenever the data is accessed it prints till `\0` is reached, as strings are considered only till `\0`. So when we use `juices_A[0]` it points to start of first data till `\0` is reached.But to get an individual char we need to mention both the... | ```
#include <stdio.h>
int main()
{
int data[3][3] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };
int *ptr;
int lines = 3;
int columns = 3;
int i;
ptr = &data[0][0];
while (lines-- > 0) {
i = columns;
while (i-- > 0) {
printf("%d ", *ptr);
ptr += 1;
... |
29,484,916 | If I want to print out array of string like:
```
char juices_A[][12] = { "dragonfruit", "waterberry", "sharonfruit", };
```
I can simply use `juices_A[0]`,`juices_A[1]`,`juices_A[3]`, respectively as a pointer to string `"dragonfruit"`, `"waterberry"`, `"sharonfruit"`, and print them out.
But what if I want to prin... | 2015/04/07 | [
"https://Stackoverflow.com/questions/29484916",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4740734/"
] | You can use access arrays like pointers and vice versa.
Here's the output from the program below:
```
dragonfruit;waterberry;sharonfruit;
{ { 1, 2, 3, }, { 4, 5, 6, }, { 7, 8, 9, }, }
```
Here's a modification to your code:
```
#include <stdio.h>
#define ROW_WIDTH 3
#define TABLE_HEIGHT 3
int main(void) {
cha... | ```
#include <stdio.h>
int main()
{
int data[3][3] = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };
int *ptr;
int lines = 3;
int columns = 3;
int i;
ptr = &data[0][0];
while (lines-- > 0) {
i = columns;
while (i-- > 0) {
printf("%d ", *ptr);
ptr += 1;
... |
7,157,731 | I'm using the following code to show in-app sms. My app don't have a status bar. (I'm using 320x480 pixels screen in portrait view)
```
if ([MFMessageComposeViewController canSendText])
{
MFMessageComposeViewController* msgController = [[MFMessageComposeViewController alloc] init];
msgController.r... | 2011/08/23 | [
"https://Stackoverflow.com/questions/7157731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/265341/"
] | I found the answer. We've to set in view controller's viewDidLoad method:
```
self.wantsFullScreenLayout = YES;
``` | The issue is in portrait view. From what I am seeing if the MFMessageComposeViewController loads in landscape the space isn't there. Then if the orientation changes to portrait the layout is corrected and the space isn't present in portrait.
Note When in landscape the MFMessageComposeViewController is presented by sl... |
7,157,731 | I'm using the following code to show in-app sms. My app don't have a status bar. (I'm using 320x480 pixels screen in portrait view)
```
if ([MFMessageComposeViewController canSendText])
{
MFMessageComposeViewController* msgController = [[MFMessageComposeViewController alloc] init];
msgController.r... | 2011/08/23 | [
"https://Stackoverflow.com/questions/7157731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/265341/"
] | I found the answer. We've to set in view controller's viewDidLoad method:
```
self.wantsFullScreenLayout = YES;
``` | ```
MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];
if([MFMessageComposeViewController canSendText]){
controller.body = @"MessageText!!!";
controller.recipients = [NSArray arrayWithObjects:@"123"];
controller.messageComposeD... |
7,157,731 | I'm using the following code to show in-app sms. My app don't have a status bar. (I'm using 320x480 pixels screen in portrait view)
```
if ([MFMessageComposeViewController canSendText])
{
MFMessageComposeViewController* msgController = [[MFMessageComposeViewController alloc] init];
msgController.r... | 2011/08/23 | [
"https://Stackoverflow.com/questions/7157731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/265341/"
] | Hide the status bar after you modal presented the message controller. Something like this:
```
controller.wantsFullScreenLayout = NO;
[self presentModalViewController:controller animated:YES];
[[UIApplication sharedApplication] setStatusBarHidden:YES];
```
Also Answered here: [MFMessageComposeViewController not prop... | The issue is in portrait view. From what I am seeing if the MFMessageComposeViewController loads in landscape the space isn't there. Then if the orientation changes to portrait the layout is corrected and the space isn't present in portrait.
Note When in landscape the MFMessageComposeViewController is presented by sl... |
7,157,731 | I'm using the following code to show in-app sms. My app don't have a status bar. (I'm using 320x480 pixels screen in portrait view)
```
if ([MFMessageComposeViewController canSendText])
{
MFMessageComposeViewController* msgController = [[MFMessageComposeViewController alloc] init];
msgController.r... | 2011/08/23 | [
"https://Stackoverflow.com/questions/7157731",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/265341/"
] | Hide the status bar after you modal presented the message controller. Something like this:
```
controller.wantsFullScreenLayout = NO;
[self presentModalViewController:controller animated:YES];
[[UIApplication sharedApplication] setStatusBarHidden:YES];
```
Also Answered here: [MFMessageComposeViewController not prop... | ```
MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];
if([MFMessageComposeViewController canSendText]){
controller.body = @"MessageText!!!";
controller.recipients = [NSArray arrayWithObjects:@"123"];
controller.messageComposeD... |
553,980 | In a book-length document with `memoir`, I'm getting the following *peculiar output* from this code for the beginning of the index:
```
\renewcommand{\indexname}{Index}
\renewcommand{\preindexhook}{%
\emph{%
For $d$\emph{-ball}, $d$\emph{-bounded set}, $d$\emph{-open set}, $(d,d')$\emph{-continuous map},
etc., see ... | 2020/07/17 | [
"https://tex.stackexchange.com/questions/553980",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/13492/"
] | It is a bug in embrac, in one place it uses `#4` instead of `#3`. Try this and notify the author:
```
\usepackage{embrac}
\ExplSyntaxOn
\cs_set_protected:Npn \__embrac_replace:Nnnnn #1#2#3#4#5
{
\tl_replace_all:Nnn #1 {#3}
{
\mode_if_math:TF
{#3} %<---instead of #4
{
... | This is not an answer to the problem, but rather a short write up of the actual problem. It is not related to `memoir` or `\preindexhook`, it boils down to a problem with the `embrac` package that @murray loads deep deep down in their many setup files.
Here is a super short MWE that displays the problem.
```
\documen... |
17,137,171 | Here's one I've come close to figuring out, but never really did.
The code listed below is supposed to draw a green circle as soon as it sees its first click. It doesn't. Subsequent clicks draw lines that connect the current clicked point with the previous one, in red. The code fails for the first click and works on a... | 2013/06/16 | [
"https://Stackoverflow.com/questions/17137171",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1333380/"
] | remove the following lines from `demolines()`
```
Graphics g = canvas.getGraphics();
if (g == null) {
System.out.println("No graphics for canvas!");
} else {
canvas.revalidate(); // This didn't help.
paintComponent(g, (oldX + oldX / 2), (oldY + oldY / 2));
}
```
and add `canvas.addMouseListener(this);` in the ... | You should always call `super.paintComponent()` as the first line when you override `paintComponent()`. |
17,137,171 | Here's one I've come close to figuring out, but never really did.
The code listed below is supposed to draw a green circle as soon as it sees its first click. It doesn't. Subsequent clicks draw lines that connect the current clicked point with the previous one, in red. The code fails for the first click and works on a... | 2013/06/16 | [
"https://Stackoverflow.com/questions/17137171",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1333380/"
] | >
> What am I doing wrong?
>
>
>
You're using `getGraphics` for custom painting. Any previous painting will be lost when a `repaint` is called. Instead move all the custom painting functionality to a new class based on `JComponent` or `JPanel` and override [paintComponent](http://docs.oracle.com/javase/7/docs/api/... | You should always call `super.paintComponent()` as the first line when you override `paintComponent()`. |
17,137,171 | Here's one I've come close to figuring out, but never really did.
The code listed below is supposed to draw a green circle as soon as it sees its first click. It doesn't. Subsequent clicks draw lines that connect the current clicked point with the previous one, in red. The code fails for the first click and works on a... | 2013/06/16 | [
"https://Stackoverflow.com/questions/17137171",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1333380/"
] | There were a multitude of problems with that code. I fixed them but neglected to document every change. Look closely over this code and ask questions if you do not understand (from reading the relevant documentation/tutorial) why I made the change.

... | You should always call `super.paintComponent()` as the first line when you override `paintComponent()`. |
129,565 | I recently came out of an introductory interview for a startup-like company and felt that the interview went well. Not perfect, as I was not invited for a second interview (I did not really fit the position anyway). I think what knocked me out of consideration was that I did not have a good answer to a question like "W... | 2019/02/19 | [
"https://workplace.stackexchange.com/questions/129565",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/100111/"
] | "I've switched career paths three times, but I'm a diligent worker, honest!" ...will never work, and it sounds like you're taking that approach.
>
> I think what knocked me out of consideration was that I did not have a good answer to a question like "What do you want to do with your life?" The job was a manager role... | >
> I think what knocked me out of consideration was that I did not have a good answer to a question like "What do you want to do with your life?" The job was a manager role for a marketing firm, but my degree is in biochemistry and my work history is manufacturing (more recently materials management). So marketing is... |
129,565 | I recently came out of an introductory interview for a startup-like company and felt that the interview went well. Not perfect, as I was not invited for a second interview (I did not really fit the position anyway). I think what knocked me out of consideration was that I did not have a good answer to a question like "W... | 2019/02/19 | [
"https://workplace.stackexchange.com/questions/129565",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/100111/"
] | "I've switched career paths three times, but I'm a diligent worker, honest!" ...will never work, and it sounds like you're taking that approach.
>
> I think what knocked me out of consideration was that I did not have a good answer to a question like "What do you want to do with your life?" The job was a manager role... | For someone changing fields, "what do you want to do with your life?" is a reasonable question. From the hiring manager's point of view, they want to see commitment to the path their job puts you on. If they were rude, they might ask "Why leave behind all your specific scientific training to do THIS job? Are you going ... |
129,565 | I recently came out of an introductory interview for a startup-like company and felt that the interview went well. Not perfect, as I was not invited for a second interview (I did not really fit the position anyway). I think what knocked me out of consideration was that I did not have a good answer to a question like "W... | 2019/02/19 | [
"https://workplace.stackexchange.com/questions/129565",
"https://workplace.stackexchange.com",
"https://workplace.stackexchange.com/users/100111/"
] | "I've switched career paths three times, but I'm a diligent worker, honest!" ...will never work, and it sounds like you're taking that approach.
>
> I think what knocked me out of consideration was that I did not have a good answer to a question like "What do you want to do with your life?" The job was a manager role... | >
> "What do you want to do with your life?"
>
>
>
I don't want to claim to know the best, objective answer to the question, but I have an approach. So when we're saddled with a difficult question, one of the things we (people) do is wrongly try to tackle the whole problem at the same time. As complexity increases... |
12,292,932 | I have some kernel threads in Linux kernel, inside my KLM.
I have a server thread, that listens to the channel, Once it sees there is an incoming connection, it creates an accept socket, accepts the connection and spawns a child thread. It also passes the accepted socket to the child kernel thread as the (void \*) a... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12292932",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1251211/"
] | From the Javadoc for [`Class.getResourceAsStream()`](http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#getResourceAsStream%28java.lang.String%29):
>
> This method delegates to this object's class loader.
> Before delegation, an absolute resource name is constructed from the given resource name using this... | From the `Class.getClassLoader()` [documentation](http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#getClassLoader%28%29):
>
> Returns the class loader for the class. Some implementations may use
> null to represent the bootstrap class loader. This method will return
> null in such implementations if th... |
12,292,932 | I have some kernel threads in Linux kernel, inside my KLM.
I have a server thread, that listens to the channel, Once it sees there is an incoming connection, it creates an accept socket, accepts the connection and spawns a child thread. It also passes the accepted socket to the child kernel thread as the (void \*) a... | 2012/09/06 | [
"https://Stackoverflow.com/questions/12292932",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1251211/"
] | From the Javadoc for [`Class.getResourceAsStream()`](http://docs.oracle.com/javase/7/docs/api/java/lang/Class.html#getResourceAsStream%28java.lang.String%29):
>
> This method delegates to this object's class loader.
> Before delegation, an absolute resource name is constructed from the given resource name using this... | The main practical difference is that you can use relative paths when you go through the class. So if your properties are in the same package as MyClass, you can do
```
MyClass.class.getResourceAsStream("properties");
``` |
61,912,017 | the problem i am facing is that my result set is only returning one row value while there are three.
and i could not found where the problem is:
```
public void eventInfo() throws SQLException
{
openConnection();
PreparedStatement ps1=null;
String query1="select * from events";
try {
p... | 2020/05/20 | [
"https://Stackoverflow.com/questions/61912017",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12210788/"
] | It should not surprise you that
```
if(s.next())
```
is not a loop but rather a condition. If you want to continuously access the result set you have to use a loop
```
while (s.next())
``` | ```
while (s.next()) {...}
```
...should do it for you. This will iterate through all rows. |
63,456,649 | The only documentation I can find is [here](https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer?tabs=csharp) but it doesn't really explain the properties on the TimerInfo class. Some questions I have
* Does the function extension use the azure storage to save the last time the function tri... | 2020/08/17 | [
"https://Stackoverflow.com/questions/63456649",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5395257/"
] | After doing some testing and reading the source code this is my summary of what it does. I'll explain what it does when `UseMonitor` is set to true.
When the function host starts it checks the azure storage for the last time the trigger executed. If it has never executed it waits for the next scheduled occurrence base... | >
> Does the function extension use the azure storage to save the last
> time the function triggered and compare that to the current execution
> time to see if it missed an execution and set IsPastDue to true?
>
>
>
The default value of the IsPastDue is false.
```
public TimerInfo(TimerSchedule schedule, Schedule... |
20,689,302 | I have a project that has a MainActivity which hosts a fragment that hosts two other fragments via a Viewpager. It looks fine on first start up, but when I rotate, the two fragments in the Viewpager are lost. I've tried changing getFragmentManager to getChildFragmentManager but I would then get a Illegal state exceptio... | 2013/12/19 | [
"https://Stackoverflow.com/questions/20689302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3120224/"
] | Probably, if u wish to retain the fragment instance, you can try using this,
```
ViewPager pager = (ViewPager) findViewById(R.id.viewPager);
pager.setOffscreenPageLimit(2); // No of fragments to be preserved
```
Cheers!! | Search for the original fragment first before you create a new one. You can search by the id that you gave the fragment or by a tag. Here is an example.
```
WorkOutsContainerFrag fragment = (WorkOutsContainerFrag) getFragmentManager().findFragmentById(R.id.workout_frag_id);
if(fragment == null) {
fragment = new Wor... |
20,689,302 | I have a project that has a MainActivity which hosts a fragment that hosts two other fragments via a Viewpager. It looks fine on first start up, but when I rotate, the two fragments in the Viewpager are lost. I've tried changing getFragmentManager to getChildFragmentManager but I would then get a Illegal state exceptio... | 2013/12/19 | [
"https://Stackoverflow.com/questions/20689302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3120224/"
] | The answer is actually super simple, it was to replace FragmentPagerAdapter with FragmentStatePagerAdapter | Search for the original fragment first before you create a new one. You can search by the id that you gave the fragment or by a tag. Here is an example.
```
WorkOutsContainerFrag fragment = (WorkOutsContainerFrag) getFragmentManager().findFragmentById(R.id.workout_frag_id);
if(fragment == null) {
fragment = new Wor... |
20,689,302 | I have a project that has a MainActivity which hosts a fragment that hosts two other fragments via a Viewpager. It looks fine on first start up, but when I rotate, the two fragments in the Viewpager are lost. I've tried changing getFragmentManager to getChildFragmentManager but I would then get a Illegal state exceptio... | 2013/12/19 | [
"https://Stackoverflow.com/questions/20689302",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3120224/"
] | The answer is actually super simple, it was to replace FragmentPagerAdapter with FragmentStatePagerAdapter | Probably, if u wish to retain the fragment instance, you can try using this,
```
ViewPager pager = (ViewPager) findViewById(R.id.viewPager);
pager.setOffscreenPageLimit(2); // No of fragments to be preserved
```
Cheers!! |
97,913 | I have views of ubercart products which are displayed in a table by standard drupal view standards.
How can i theme individual product fields ?
views-view-field.tpl is having the complete product listed inside $output variable..
I want to solve this in a template file where all fields are available individually .. | 2013/12/20 | [
"https://drupal.stackexchange.com/questions/97913",
"https://drupal.stackexchange.com",
"https://drupal.stackexchange.com/users/20004/"
] | As far as your question title says "Execution Order", rules have weight which you can set in the settings tab which you will find on rule manage page.
>
> Order rules that react on the same event. Rules with a higher weight
> are evaluated after rules with less weight.
>
>
>
As far as your query concern, it seem... | As a variation to the prior answer, you could also try to combine the three rules in a single rule, by using the [Conditional Rules](https://www.drupal.org/project/rules_conditional) module, which allows to include the equivalent of a Rules Condition within a Rules Action. Have a look at part 2 of the answer to "[How t... |
58,711 | I'm trying to do a logo for myself, just to put it in my apps.
I just drawn (by hand) my Surname-Name, flipped the name vertically, added a background as you can see.
I know that usually there is a "theory" about colors and shapes. I have some doubts: for example, what changes into the watcher's eye if the text would ... | 2015/08/26 | [
"https://graphicdesign.stackexchange.com/questions/58711",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/-1/"
] | Two **very** basic benchmarks for a logo:
* If it has text, can you read it?
* If it made of shapes, can you draw
it from memory?
The problem with your logo really is that it has no unique shape that makes it distinguishable other than handwritten text, which we can't read. So you you are killing off your own benefi... | Few questions you can think over:
* The logo is using brush or handmade?
* Text used inside is signature of anyone?
* Is this readable?
The Logo:
* Logo is represents company brands or corporate identities in market.
* Logo should be simple and creative.
* Easy to read, relevant text can be added.
Solution you can... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.