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 |
|---|---|---|---|---|---|
33,740 | We've started doing waves in our physics class, but we're doing things very quickly and the teacher doesn't explain anything. And I don't understand why waves work.
I was thinking that when I fill a bowl with water, and wait until it's still, and then I put a finger in it, then my finger needs some space where the wa... | 2012/08/08 | [
"https://physics.stackexchange.com/questions/33740",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/11174/"
] | When you first put your finger into the water, the situation is pretty much as you describe; the water is not solid and so the molecules *can* move, unlike those of your finger or the bowl, so they *must* move (no two atoms can be in exactly the same place at exactly the same time). Liquids are classically defined as i... | I think you are really asking why waves move - i.e. why the waves move away from your finger, as opposed to just staying in one place, or disappearing, or maybe going away and them coming back.
One way to think about it is, imagine holding one end of a long rope.
If you suddenly shake the rope to one side, you start a... |
40,381,342 | ```
x = raw_input()
words = x.split()
words.sort()
for word in words:
print(word.lower())
```
this is a piece of code which inputs a sentence and sorts it's word to dictionary order. In the output I also want to print the number of unique words in that sentence. How am I supposed to do that? | 2016/11/02 | [
"https://Stackoverflow.com/questions/40381342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Try
```
x = raw_input()
words = x.split()
words.sort()
for word in words:
print(word.lower())
print(len(set(words)))
```
As was so pleasantly pointed out in the comments there is no explanation, so here it goes. the `set()` method generates a set from the list. Sets can only have unique entries, therefore the `... | If you don't want to import any external modules. You can use 'set()', precisely:
`unique_num = len(set(words))
print unique_num` |
40,381,342 | ```
x = raw_input()
words = x.split()
words.sort()
for word in words:
print(word.lower())
```
this is a piece of code which inputs a sentence and sorts it's word to dictionary order. In the output I also want to print the number of unique words in that sentence. How am I supposed to do that? | 2016/11/02 | [
"https://Stackoverflow.com/questions/40381342",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can use [Counter](https://docs.python.org/2/library/collections.html#counter-objects)
```
from collections import Counter
words = ["foo", "bar", "bar"]
counts = Counter(words)
print counts
# Counter({"foo": 1, "bar": 2})
unique_words = [word for word in counts if counts[word] == 1]
print unique_words
# ["foo"]
`... | If you don't want to import any external modules. You can use 'set()', precisely:
`unique_num = len(set(words))
print unique_num` |
597,060 | I need an RS422 multipoint connection. When I tried connecting it as shown in the image the communication didn't work, but when I connected all the devices' pins T+, R+, T-, and R- i.e T+ of one device to T+ of another device, the communication worked. Why is this?
[ have tri-state control of their transmitters so that only one client (at most) can transmit at any time.
Typically yo... | RS-422 is point to point only in the sense of duplex communication, two transmitters cannot be connected on the same wire. Transmitter is always enabled, and should be at the end of cable, not in the middle, due to requirement for single cable termination. There is no support in RS-422 for full duplex multi-node connec... |
14,010 | Malwarebytes antimalware has detected the file ...\Tor Browser\browser\firefox.exe with virus spyware.lokibot. I even made a new installation of Tor Browser from its official site, but upon finishing the installation, the firefox.exe file was detected as malware. The file is then moved to quarantene, and I am unable to... | 2017/02/11 | [
"https://tor.stackexchange.com/questions/14010",
"https://tor.stackexchange.com",
"https://tor.stackexchange.com/users/16233/"
] | It can be sounding funny, but the very name of the program describes it's quality - it's a *malware* bytes by itself :) But speaking seriously, after my experience in IT security, I can give you some advice in **not** using these so-called "anti-malware" crapware :
* **Kaspersky Internet Security**/**Kaspersky Crystal... | The only way I can open tor browser is to exit Malwarebytes, re-download tor browser and run firefox.exe, simple work around but not what I should be doing. |
58,645,194 | I am trying to get familiar with pygame so am starting with a simple program that draws a rectangle and moves it around with the mouse. The rectangle draws fine however it does not move with the mouse position and I cannot think why.
I found one other with this problem however this fix didnt work for me and was much m... | 2019/10/31 | [
"https://Stackoverflow.com/questions/58645194",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9974108/"
] | `4` is not an event type. An event type is `MOUSEMOTION` (see [`pygame.event`](https://www.pygame.org/docs/ref/event.html)).
Create a [`pygame.Rect`](https://www.pygame.org/docs/ref/rect.html) object:
```py
newrect = pygame.Rect(playerstartposX, playerstartposY, playerwidth, playerheight)
```
Change its position wh... | First, the event type you need to check against is `pygame.MOUSEMOTION` (I believe it's 1024?) and you are checking with 4.
Then you have to redraw the rect on every iteration of the main loop to reflect the updated position |
50,376,528 | I have a basic question regarding working with arrays:
```
a= ([ c b a a b b c a a b b c a a b a c b])
b= ([ 0 1 0 1 0 0 0 0 2 0 1 0 2 0 0 1 0 1])
```
I) Is there a short way, to count the number of time `'c'` in `a` corresponds to 0, 1, and 2 in `b` and `'b'` in `a` corresponds to 0, 1, 2 and so on
II) How do I ... | 2018/05/16 | [
"https://Stackoverflow.com/questions/50376528",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9457956/"
] | ```
In [10]: p = ['a', 'b', 'c', 'a', 'c', 'a']
In [11]: q = [1, 2, 1, 3, 3, 1]
In [12]: z = zip(p, q)
In [13]: z
Out[13]: [('a', 1), ('b', 2), ('c', 1), ('a', 3), ('c', 3), ('a', 1)]
In [14]: counts = {}
In [15]: for pair in z:
...: if pair in counts.keys():
...: counts[pair] += 1
...... | The questions are a bit vague but here's a quick method (some would call it dirty) using `Pandas` though I think something written without recourse to `Pandas` should be preferred.
```
import pandas as pd
#create OP's lists
a= [ 'c', 'b', 'a', 'a', 'b', 'b', 'c', 'a', 'a', 'b', 'b', 'c', 'a', 'a', 'b', 'a', 'c', 'b... |
50,376,528 | I have a basic question regarding working with arrays:
```
a= ([ c b a a b b c a a b b c a a b a c b])
b= ([ 0 1 0 1 0 0 0 0 2 0 1 0 2 0 0 1 0 1])
```
I) Is there a short way, to count the number of time `'c'` in `a` corresponds to 0, 1, and 2 in `b` and `'b'` in `a` corresponds to 0, 1, 2 and so on
II) How do I ... | 2018/05/16 | [
"https://Stackoverflow.com/questions/50376528",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9457956/"
] | ```
In [10]: p = ['a', 'b', 'c', 'a', 'c', 'a']
In [11]: q = [1, 2, 1, 3, 3, 1]
In [12]: z = zip(p, q)
In [13]: z
Out[13]: [('a', 1), ('b', 2), ('c', 1), ('a', 3), ('c', 3), ('a', 1)]
In [14]: counts = {}
In [15]: for pair in z:
...: if pair in counts.keys():
...: counts[pair] += 1
...... | Python List : <https://www.tutorialspoint.com/python/python_lists.htm> has a count method.
I suggest you to first zip both lists, as said in comments, and then count occurances of tuple c, 1 and occurances of tuple c, 0 and sum them up, thats what you need for (I), basically.
For (II), if I understood you correctly, ... |
27,353,690 | I have a page [www.redpeppermedia.in/tc24\_beta/](http://www.redpeppermedia.in/tc24_beta/) it works fine over `980px` resolution but as you bring it down to `768px`, the CSS and media queries change the layout of it, but once you are in the `768px` and you refresh the page, everything becomes as I want, the layouts fix... | 2014/12/08 | [
"https://Stackoverflow.com/questions/27353690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1916375/"
] | Turns out, digitalocean had blocked sending emails for new users. Contacted them and now it's working. Hope this helps someone. | please go through <http://aldrin.aquisap.info/2012/08/26/wp-mail-smtp-in-wordpress-hosted-by-bluehost/> or [SMTP ERROR: Failed to connect to server: Connection timed out (110) with PHPMailer and Outlook SMTP](https://stackoverflow.com/questions/23782689/smtp-error-failed-to-connect-to-server-connection-timed-out-110-wi... |
27,353,690 | I have a page [www.redpeppermedia.in/tc24\_beta/](http://www.redpeppermedia.in/tc24_beta/) it works fine over `980px` resolution but as you bring it down to `768px`, the CSS and media queries change the layout of it, but once you are in the `768px` and you refresh the page, everything becomes as I want, the layouts fix... | 2014/12/08 | [
"https://Stackoverflow.com/questions/27353690",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1916375/"
] | Turns out, digitalocean had blocked sending emails for new users. Contacted them and now it's working. Hope this helps someone. | Google's SMTP server requires authentication, so here's how to set it up:
-------------------------------------------------------------------------
1. SMTP server (i.e., outgoing mail): **[smtp.gmail.com](http://smtp.gmail.com)**
2. SMTP username: **Your full Gmail or Google Apps email address** (e.g. example@gmail.co... |
12,571,615 | I have a hangman-app which I fetch a random word from Db i created, then I save it to `randomedWord` and then i make another String for holding `randomedWord` but replaced with only "\_". This `hiddenWord` is displayed so the user knows how many chars there is.
When a user hits Enter a `onlicklistener` fires `guess()`... | 2012/09/24 | [
"https://Stackoverflow.com/questions/12571615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1691015/"
] | I think the error is on this line:
```
DetailVC.favoriteColorLabel=@"Bonjour";
```
It is most likely you actually want to set the **`text`** attribute of your label like this:
```
DetailVC.favoriteColorLabel.text=@"Bonjour";
```
This is because the `text` attribute is the text displayed by the label onscreen. You... | You are setting Text to a label Thats why you are getting error in your code.
You need to do it as like this:
```
labelname.text = @"String";
```
Then your issue will resolve.
Hope it works. |
12,571,615 | I have a hangman-app which I fetch a random word from Db i created, then I save it to `randomedWord` and then i make another String for holding `randomedWord` but replaced with only "\_". This `hiddenWord` is displayed so the user knows how many chars there is.
When a user hits Enter a `onlicklistener` fires `guess()`... | 2012/09/24 | [
"https://Stackoverflow.com/questions/12571615",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1691015/"
] | I think the error is on this line:
```
DetailVC.favoriteColorLabel=@"Bonjour";
```
It is most likely you actually want to set the **`text`** attribute of your label like this:
```
DetailVC.favoriteColorLabel.text=@"Bonjour";
```
This is because the `text` attribute is the text displayed by the label onscreen. You... | I would consider setting a label in the second view from a method in the first bad design and error prone.
What I would do, is give your detail view controller a `property` that is an `NSString *`. After you create the detail view controller from your first controller, you pass the text `@"Bonjour"` to that property (... |
73,962,929 | I have the following dataframe:
```
id location method
1 456 Phone
1 456 OS
6 456 OS
6 943 Specialist
```
What I'm trying to do, is to implement the following logic:
* If there's only one record (consider the combination of location + method), I'll just do nothin... | 2022/10/05 | [
"https://Stackoverflow.com/questions/73962929",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13376641/"
] | A possible solution:
```
(df.sort_values(by='id')
.groupby(['location', 'method']).first()
.reset_index().sort_index(axis=1))
```
Output:
```
id location method
0 1 456 OS
1 1 456 Phone
2 6 943 Specialist
``` | Firstly, you can use `groupby` on multiple columns (location and method). Then on the "grouped" dataframes, you can select one of the rows as you need (here I sort by "id", and select the first one).
```
# generate the dataframe
df = pd.DataFrame(
[
[1, 456, "Phone"],
[1, 456, "OS... |
45,482,339 | I am trying to display a time using timestamp. An example is below:
```
t = Time.at(1500999892331)
#=> 49534-10-18 04:02:11 +0530
t.to_date
#=> Thu, 18 Oct 49534
```
I am getting a wrong output. Please help me solve this issue. | 2017/08/03 | [
"https://Stackoverflow.com/questions/45482339",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/703997/"
] | You can do it the nasty long way for all overloads. By casting:
```
using sig1 = void (Func::*)(int);
using sig2 = void (Func::*)(int, int);
std::bind(static_cast<sig1>(&Func::operator()), &f, std::placeholders::_1);
```
Alternatively, you could recognize the `std::bind` isn't all that useful if you have lambdas:
... | Func is a function object. Rather than taking the member-function pointer, just hand the the entire object to bind, and let it resolve when you use the bind, or in this case when you add it to the `std::function`.
```
Func f;
std::function<void(int)> func = std::bind(f, std::placeholders::_1);
```
or even better, ju... |
19,368,746 | I come from Ruby and I'm getting used to the "explicit over implicit" philosophy that Python follows, but I was confused earlier about how I actually make class methods. Now, I want verification that I am indeed correct in the following:
Every method in a class is essentially a class method in Python.
For example:
`... | 2013/10/14 | [
"https://Stackoverflow.com/questions/19368746",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2328259/"
] | No, you're not quite right. For something to be a class method rather than an instance method, you have to use the `classmethod` decorator. And that method still takes a parameter, but that param is the class, not the instance. So:
```
@classmethod
def get_employee_count(cls):
return cls.employeeCount
```
Classe... | True. Functions that deal with objects' instances should have `self` in its parameters. Otherwise, they are considered class methods.
*EDIT*
*Class methods* doesn't mean *static methods*! They're not static methods unless you add the decorator `@staticmethod` before the `def`inition of the class function |
101,395 | When I search for flights from A to B flying on X and returning from B to A on Y, often the date of departure and date of arrival differs due to distance and time of flight. Therefore, lots of results have the +1 on them.
For example, when I say search for flights from A to B on X, it must depart A on date X and reach... | 2017/09/03 | [
"https://travel.stackexchange.com/questions/101395",
"https://travel.stackexchange.com",
"https://travel.stackexchange.com/users/40874/"
] | A number of flight search engines allow you to filter search results by arrival time. You can use this to filter out all flights that arrive later than you desired date. This is usually a filter you apply after the search, rather than one you set before performing the search. For example, Hipmunk has the time bar at th... | I don't know of any such option. When I have such a need, in Expedia I calculate the latest time of departure possible, and select the time slots that work out. For example:
[](https://i.stack.imgur.com/7ItzZ.png)
In this HKG-RGN flight, if I leave in the evenin... |
48,682,575 | I am trying to use pt-online-schema-change to alter the schema of some tables on my database. The programs crashs with the MySQL error below.
I need to not throws this kind of errors.
I already tried to put disable-partition-engine-check on the startup of MySQL server.
I am using MySQL version 5.7.21
Error:
```
Leve... | 2018/02/08 | [
"https://Stackoverflow.com/questions/48682575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3806586/"
] | The steps which worked for me are
=================================
>
> It removes old **php** and installs **php72**
>
>
>
I followed the same article and stuck on the same issue.
`sudo yum -y remove php*`
`sudo yum install epel-release`
`rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm`
`su... | You have to install php72-php. This adds php binary, httpd config and php.ini files
for solve "php -v" you should install php-cli
>
> yum install php72-php php-cli
>
>
> |
48,682,575 | I am trying to use pt-online-schema-change to alter the schema of some tables on my database. The programs crashs with the MySQL error below.
I need to not throws this kind of errors.
I already tried to put disable-partition-engine-check on the startup of MySQL server.
I am using MySQL version 5.7.21
Error:
```
Leve... | 2018/02/08 | [
"https://Stackoverflow.com/questions/48682575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3806586/"
] | The steps which worked for me are
=================================
>
> It removes old **php** and installs **php72**
>
>
>
I followed the same article and stuck on the same issue.
`sudo yum -y remove php*`
`sudo yum install epel-release`
`rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm`
`su... | yum install php72w-cli , CLI is the command line interface so you need to install it, check for compatible version. |
48,682,575 | I am trying to use pt-online-schema-change to alter the schema of some tables on my database. The programs crashs with the MySQL error below.
I need to not throws this kind of errors.
I already tried to put disable-partition-engine-check on the startup of MySQL server.
I am using MySQL version 5.7.21
Error:
```
Leve... | 2018/02/08 | [
"https://Stackoverflow.com/questions/48682575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3806586/"
] | I am not sure what is the cause but this is what you can do
```
whereis php72
```
It will give the path. Something like:
php: /usr/bin/php72
Then you can do:
```
ln -s /usr/bin/php72 /usr/bin/php
``` | yum install php72w-cli , CLI is the command line interface so you need to install it, check for compatible version. |
48,682,575 | I am trying to use pt-online-schema-change to alter the schema of some tables on my database. The programs crashs with the MySQL error below.
I need to not throws this kind of errors.
I already tried to put disable-partition-engine-check on the startup of MySQL server.
I am using MySQL version 5.7.21
Error:
```
Leve... | 2018/02/08 | [
"https://Stackoverflow.com/questions/48682575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3806586/"
] | You have to install php72-php. This adds php binary, httpd config and php.ini files
for solve "php -v" you should install php-cli
>
> yum install php72-php php-cli
>
>
> | yum install php72w-cli , CLI is the command line interface so you need to install it, check for compatible version. |
48,682,575 | I am trying to use pt-online-schema-change to alter the schema of some tables on my database. The programs crashs with the MySQL error below.
I need to not throws this kind of errors.
I already tried to put disable-partition-engine-check on the startup of MySQL server.
I am using MySQL version 5.7.21
Error:
```
Leve... | 2018/02/08 | [
"https://Stackoverflow.com/questions/48682575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3806586/"
] | I am not sure what is the cause but this is what you can do
```
whereis php72
```
It will give the path. Something like:
php: /usr/bin/php72
Then you can do:
```
ln -s /usr/bin/php72 /usr/bin/php
``` | You have to install php72-php. This adds php binary, httpd config and php.ini files
for solve "php -v" you should install php-cli
>
> yum install php72-php php-cli
>
>
> |
48,682,575 | I am trying to use pt-online-schema-change to alter the schema of some tables on my database. The programs crashs with the MySQL error below.
I need to not throws this kind of errors.
I already tried to put disable-partition-engine-check on the startup of MySQL server.
I am using MySQL version 5.7.21
Error:
```
Leve... | 2018/02/08 | [
"https://Stackoverflow.com/questions/48682575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3806586/"
] | I am not sure what is the cause but this is what you can do
```
whereis php72
```
It will give the path. Something like:
php: /usr/bin/php72
Then you can do:
```
ln -s /usr/bin/php72 /usr/bin/php
``` | The steps which worked for me are
=================================
>
> It removes old **php** and installs **php72**
>
>
>
I followed the same article and stuck on the same issue.
`sudo yum -y remove php*`
`sudo yum install epel-release`
`rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm`
`su... |
48,682,575 | I am trying to use pt-online-schema-change to alter the schema of some tables on my database. The programs crashs with the MySQL error below.
I need to not throws this kind of errors.
I already tried to put disable-partition-engine-check on the startup of MySQL server.
I am using MySQL version 5.7.21
Error:
```
Leve... | 2018/02/08 | [
"https://Stackoverflow.com/questions/48682575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3806586/"
] | The steps which worked for me are
=================================
>
> It removes old **php** and installs **php72**
>
>
>
I followed the same article and stuck on the same issue.
`sudo yum -y remove php*`
`sudo yum install epel-release`
`rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm`
`su... | I think it would be better to rely on a "standard" solution such as, e.g., the `alternatives` system. To this end, you might do:
```
sudo alternatives --install /usr/local/bin/php php /usr/bin/php72 1
```
This will create a symlink in `/usr/local/bin` which is wired via the alternatives system to `/usr/bin/php72`. T... |
48,682,575 | I am trying to use pt-online-schema-change to alter the schema of some tables on my database. The programs crashs with the MySQL error below.
I need to not throws this kind of errors.
I already tried to put disable-partition-engine-check on the startup of MySQL server.
I am using MySQL version 5.7.21
Error:
```
Leve... | 2018/02/08 | [
"https://Stackoverflow.com/questions/48682575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3806586/"
] | Please read the [Wizard instructions](https://rpms.remirepo.net/wizard/)
If you need a single version, using remi-php72 repository, and the **php-\*** packages, the command will be **php**.
```
# yum-config-manager --enable remi-php72
# yum update
# yum install php-cli
# php -v
```
If you need multiples versions, t... | I think it would be better to rely on a "standard" solution such as, e.g., the `alternatives` system. To this end, you might do:
```
sudo alternatives --install /usr/local/bin/php php /usr/bin/php72 1
```
This will create a symlink in `/usr/local/bin` which is wired via the alternatives system to `/usr/bin/php72`. T... |
48,682,575 | I am trying to use pt-online-schema-change to alter the schema of some tables on my database. The programs crashs with the MySQL error below.
I need to not throws this kind of errors.
I already tried to put disable-partition-engine-check on the startup of MySQL server.
I am using MySQL version 5.7.21
Error:
```
Leve... | 2018/02/08 | [
"https://Stackoverflow.com/questions/48682575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3806586/"
] | Please read the [Wizard instructions](https://rpms.remirepo.net/wizard/)
If you need a single version, using remi-php72 repository, and the **php-\*** packages, the command will be **php**.
```
# yum-config-manager --enable remi-php72
# yum update
# yum install php-cli
# php -v
```
If you need multiples versions, t... | yum install php72w-cli , CLI is the command line interface so you need to install it, check for compatible version. |
48,682,575 | I am trying to use pt-online-schema-change to alter the schema of some tables on my database. The programs crashs with the MySQL error below.
I need to not throws this kind of errors.
I already tried to put disable-partition-engine-check on the startup of MySQL server.
I am using MySQL version 5.7.21
Error:
```
Leve... | 2018/02/08 | [
"https://Stackoverflow.com/questions/48682575",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3806586/"
] | Please read the [Wizard instructions](https://rpms.remirepo.net/wizard/)
If you need a single version, using remi-php72 repository, and the **php-\*** packages, the command will be **php**.
```
# yum-config-manager --enable remi-php72
# yum update
# yum install php-cli
# php -v
```
If you need multiples versions, t... | You have to install php72-php. This adds php binary, httpd config and php.ini files
for solve "php -v" you should install php-cli
>
> yum install php72-php php-cli
>
>
> |
53,005,020 | I want to enable the button in the viewcontroller when I fill in the textfield in the tableviewcell.
I don't know how to solve the problem.
Sorry. I am immature in English.
1. button(viewController) isEnable = false
2. fill textfields(inside tableviewcell)
3. button(viewController) isEnable = true
[![enter image d... | 2018/10/26 | [
"https://Stackoverflow.com/questions/53005020",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10561926/"
] | As the table view contains only one cell why do you use a table view at all?
And if you really need to use a table view why don't you use a **static** cell?
---
A simple solution is to move the target/action code from `viewDidLoad` into the `didSet` property observer of the cell
```
var cell: CustomTableViewCell!... | One option is to use delegate.
```
protocol CustomTableViewCellDelegate {
func editingChanged(_ String: yourString)
}
```
In table view cell
```
class TableViewCell: UITaleViewCell {
// declare the delegate
var delegate: CustomTableViewCellDelegate?
// and pass it like this from where you... |
121,845 | Angular momentum causes the [event horizon of a black hole](http://en.wikipedia.org/wiki/Event_horizon) to recede. At maximum angular momentum, $J=GM^2/c$, the [Schwarzschild radius](http://en.wikipedia.org/wiki/Schwarzschild_radius) is half of what it would be if the black hole wasn't spinning.
Can someone explain w... | 2014/06/26 | [
"https://physics.stackexchange.com/questions/121845",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/51836/"
] | To the first question: Newton's third law states that every force has an equal and opposite force. Thus, the force that Earth exerts on you with gravity (a big mass causing a huge acceleration on a small mass) is countered exactly by the normal force of the ground (again, a big mass causeing a huge acceleration on a sm... | >
> If small rocket(with small mass) pressure against bigger rock with
> greater mass the rocket should have greater acceleration towards
> direction opposite to its flying path so how the rocket can actually
> move the rock(towards left at picture where rock acceleration is
> small) and not the opposite(rocket ac... |
121,845 | Angular momentum causes the [event horizon of a black hole](http://en.wikipedia.org/wiki/Event_horizon) to recede. At maximum angular momentum, $J=GM^2/c$, the [Schwarzschild radius](http://en.wikipedia.org/wiki/Schwarzschild_radius) is half of what it would be if the black hole wasn't spinning.
Can someone explain w... | 2014/06/26 | [
"https://physics.stackexchange.com/questions/121845",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/51836/"
] | Assume the rocket has enough fuel to power it for an extended period of time.
The rocket pushes against the rock with a force (as long as it has fuel).
Let's call it $F\_{thrust}$ and it will have direction "forward".
The rock pushes back with equal force (Newton's 3rd Law). In the question you specify that the ro... | >
> If small rocket(with small mass) pressure against bigger rock with
> greater mass the rocket should have greater acceleration towards
> direction opposite to its flying path so how the rocket can actually
> move the rock(towards left at picture where rock acceleration is
> small) and not the opposite(rocket ac... |
121,845 | Angular momentum causes the [event horizon of a black hole](http://en.wikipedia.org/wiki/Event_horizon) to recede. At maximum angular momentum, $J=GM^2/c$, the [Schwarzschild radius](http://en.wikipedia.org/wiki/Schwarzschild_radius) is half of what it would be if the black hole wasn't spinning.
Can someone explain w... | 2014/06/26 | [
"https://physics.stackexchange.com/questions/121845",
"https://physics.stackexchange.com",
"https://physics.stackexchange.com/users/51836/"
] | OP's first question has been answered by @jhobbie. Specifically, we sometimes do fly (jump)! This is when the normal force does exceed our weight - gravitational force of attraction towards Earth.
Regarding second question:
The force on rock is NOT always equal to $F\_{Thrust}$. The diagram should look like this:
$N... | >
> If small rocket(with small mass) pressure against bigger rock with
> greater mass the rocket should have greater acceleration towards
> direction opposite to its flying path so how the rocket can actually
> move the rock(towards left at picture where rock acceleration is
> small) and not the opposite(rocket ac... |
24,973,577 | I'm trying to migrate to a new completely different model in my project. The changes are way too much for a lightweight migration and I think the best way is to iterate through the top level objects and set all the attributes and relationships myself.
How can I set up the migration process to be completely manual like... | 2014/07/26 | [
"https://Stackoverflow.com/questions/24973577",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/754604/"
] | If your model changes are such that you at least have an source and destination entity level mapping (For example you had a `Vehicle` entity in your old model and now you want to migrate that data to `Car`) then you can use a custom mapping model with a migration policy.
The process is fairly straightforward, in Xcode... | Check out [CDWrangler](https://github.com/RigilCorp/CDWrangler "CDWrangler"). It's an open source Core Data controller that can handle lightweight and manual migration progressively.
After you create your mapping model, and any custom policies you need you just need to do this
```
// Migration
if ([[CDWrangler shared... |
24,540 | Is there any Firefox addon to convert a bit of selected text (in text fields), to "UPPER CASE", "lower case", "Proper Case", and "Sentence case"?
This is useful when writing email. | 2009/08/18 | [
"https://superuser.com/questions/24540",
"https://superuser.com",
"https://superuser.com/users/2550/"
] | Yes, [Leet Key](https://addons.mozilla.org/en-US/firefox/addon/770) does that. | How about [Casey Case Converter](https://addons.mozilla.org/en-US/firefox/addon/9920)?
The author of the add-on hasn't updated all descriptions, but from the release notes:
>
> Version 1.4 — June 29, 2009 — 6 KB
>
>
> * Proper case improved to support sentences with !?. and larger chunks of text.
> * UPPERcase add... |
24,540 | Is there any Firefox addon to convert a bit of selected text (in text fields), to "UPPER CASE", "lower case", "Proper Case", and "Sentence case"?
This is useful when writing email. | 2009/08/18 | [
"https://superuser.com/questions/24540",
"https://superuser.com",
"https://superuser.com/users/2550/"
] | Try [TitleCase](https://addons.mozilla.org/en-US/firefox/addon/titlecase/); this will do sentence (proper) case as well as title case, upper case, and lower case.
>
> Transform strings into Title Case, Proper Case, Start Case, Camel
> Case, Upper Case, and Lower Case. You have 2 ways to change text.
> Either by rig... | How about [Casey Case Converter](https://addons.mozilla.org/en-US/firefox/addon/9920)?
The author of the add-on hasn't updated all descriptions, but from the release notes:
>
> Version 1.4 — June 29, 2009 — 6 KB
>
>
> * Proper case improved to support sentences with !?. and larger chunks of text.
> * UPPERcase add... |
24,540 | Is there any Firefox addon to convert a bit of selected text (in text fields), to "UPPER CASE", "lower case", "Proper Case", and "Sentence case"?
This is useful when writing email. | 2009/08/18 | [
"https://superuser.com/questions/24540",
"https://superuser.com",
"https://superuser.com/users/2550/"
] | Yes, [Leet Key](https://addons.mozilla.org/en-US/firefox/addon/770) does that. | [decaps](https://addons.mozilla.org/en-US/firefox/addon/9439) should fit your bill of selecting text and switching between upper, lower and sentence case.
Problem with it currently is that it hasn't been updated for Firefox versions later than 3.0.\* |
24,540 | Is there any Firefox addon to convert a bit of selected text (in text fields), to "UPPER CASE", "lower case", "Proper Case", and "Sentence case"?
This is useful when writing email. | 2009/08/18 | [
"https://superuser.com/questions/24540",
"https://superuser.com",
"https://superuser.com/users/2550/"
] | Try [TitleCase](https://addons.mozilla.org/en-US/firefox/addon/titlecase/); this will do sentence (proper) case as well as title case, upper case, and lower case.
>
> Transform strings into Title Case, Proper Case, Start Case, Camel
> Case, Upper Case, and Lower Case. You have 2 ways to change text.
> Either by rig... | [decaps](https://addons.mozilla.org/en-US/firefox/addon/9439) should fit your bill of selecting text and switching between upper, lower and sentence case.
Problem with it currently is that it hasn't been updated for Firefox versions later than 3.0.\* |
24,540 | Is there any Firefox addon to convert a bit of selected text (in text fields), to "UPPER CASE", "lower case", "Proper Case", and "Sentence case"?
This is useful when writing email. | 2009/08/18 | [
"https://superuser.com/questions/24540",
"https://superuser.com",
"https://superuser.com/users/2550/"
] | Yes, [Leet Key](https://addons.mozilla.org/en-US/firefox/addon/770) does that. | Try [TitleCase](https://addons.mozilla.org/en-US/firefox/addon/titlecase/); this will do sentence (proper) case as well as title case, upper case, and lower case.
>
> Transform strings into Title Case, Proper Case, Start Case, Camel
> Case, Upper Case, and Lower Case. You have 2 ways to change text.
> Either by rig... |
65,767,273 | I have a function that has two arguments that are both lists as shown below
```
def myfunc(arg1, arg2):
return arg1*arg2
arg1 = [1,2,3,4]
arg2 = [10,9,8]
```
I want to return a list of each possible PERMUTATION of the two arguments.
So the result should be something like:
```
[10,9,8,20,18,16.......]
```
I ... | 2021/01/18 | [
"https://Stackoverflow.com/questions/65767273",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13955949/"
] | I highly recommend you to use a css-grid or a flexbox for modern approach. In this case a css-grid is the better approach as it can be controlled in height and width simultaniosly.
For that I wrapped your 2 boxes in another div with the class: `grid-wrapper`.
I changed that box to a grid system by using: `display: gri... | My solution is using **flex**.
And this solution is **responsive mobile devices**, without the use of media queries. Run the snippet and resize the browser window. The blocks will adapt to the size of the window.
Also, never use the `id` attribute multiple times. `id` is a unique attribute. Use `class` for many eleme... |
33,678,319 | I have a java application "with history" and it uses WeakReferences for caching. I made several heapdumps and saw that all of them contains a lot of objects with weak references (10%-15% of heap size, ~1.2GB).
* Does it mean that weak references produce memory pressure on JVM?
* And forces a FullGC with stop-the-world... | 2015/11/12 | [
"https://Stackoverflow.com/questions/33678319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/868947/"
] | The problem is casting to a `List<string>`
If casting to an object is acceptable, you could do it like this:
```
string json = "{\"A\":[\"a\",\"b\",\"c\",\"d\"],\"B\":[\"a\"],\"C\":[]}";
var serializer = new JavaScriptSerializer();
var deserializedValues = (Dictionary<string, object>)serializer.Deserialize(json, typeo... | Create a Type based on the JSON structure and then use the Type in the Serialization or DeSerialization like this.
I create the RootObject from the JSON using functionality found in the Web Essentials Visual Studio Extension.
```
public class JSONSerializer
{
public void RunIt()
{
string json = "{\"A... |
33,678,319 | I have a java application "with history" and it uses WeakReferences for caching. I made several heapdumps and saw that all of them contains a lot of objects with weak references (10%-15% of heap size, ~1.2GB).
* Does it mean that weak references produce memory pressure on JVM?
* And forces a FullGC with stop-the-world... | 2015/11/12 | [
"https://Stackoverflow.com/questions/33678319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/868947/"
] | Instead of using the `DeserializeObject` method, use the generic `Deserialize<T>` method and specify `Dictionary<string, List<string>>` as the type argument. Then it will work correctly:
```
string json = @"{""A"":[""a"",""b"",""c"",""d""],""B"":[""a""],""C"":[]}";
JavaScriptSerializer serializer = new JavaScriptSeri... | Create a Type based on the JSON structure and then use the Type in the Serialization or DeSerialization like this.
I create the RootObject from the JSON using functionality found in the Web Essentials Visual Studio Extension.
```
public class JSONSerializer
{
public void RunIt()
{
string json = "{\"A... |
33,678,319 | I have a java application "with history" and it uses WeakReferences for caching. I made several heapdumps and saw that all of them contains a lot of objects with weak references (10%-15% of heap size, ~1.2GB).
* Does it mean that weak references produce memory pressure on JVM?
* And forces a FullGC with stop-the-world... | 2015/11/12 | [
"https://Stackoverflow.com/questions/33678319",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/868947/"
] | Instead of using the `DeserializeObject` method, use the generic `Deserialize<T>` method and specify `Dictionary<string, List<string>>` as the type argument. Then it will work correctly:
```
string json = @"{""A"":[""a"",""b"",""c"",""d""],""B"":[""a""],""C"":[]}";
JavaScriptSerializer serializer = new JavaScriptSeri... | The problem is casting to a `List<string>`
If casting to an object is acceptable, you could do it like this:
```
string json = "{\"A\":[\"a\",\"b\",\"c\",\"d\"],\"B\":[\"a\"],\"C\":[]}";
var serializer = new JavaScriptSerializer();
var deserializedValues = (Dictionary<string, object>)serializer.Deserialize(json, typeo... |
58,399,957 | I've seen <https://datatables.net/reference/option/ajax.data> and other examples on how to send custom HTTP variables to the server. But I'm having trouble understanding how to send the object as an parameter. I want to be able to view all the parameters the DataTable sends to the server as an object rather than indivi... | 2019/10/15 | [
"https://Stackoverflow.com/questions/58399957",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10610593/"
] | I had the same question, and could only find this which says the object isn't public:
<https://datatables.net/forums/discussion/25470>
However, you can mimic the functionality, the below was written for DataTables 1.10.18:
```
//This function returns the ajax post object datatables generates automatically on refresh
... | When you set server-side option true, i recommend you add "contentType: 'application/json'" in ajax and the data option in ajax should be a function with a parameter data.
```
$("#example").DataTable({
autoWidth: true,
processing: true,
serverSide: true,
ajax: {
url: "xxx",
... |
63,483,793 | I'm trying to grab the location tag on each job to filter them based on location as this option isn't available from
[Seek Work From Home](https://www.seek.com.au/jobs?where=Work%20from%20home) and have been using python with selenium.
```
from selenium import webdriver
from selenium.webdriver.support.ui import WebDri... | 2020/08/19 | [
"https://Stackoverflow.com/questions/63483793",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/14064959/"
] | Its look like there is issue in your xPath. As i have used below code and it printed all location for all 20 jobs on page:
```
driver.get("https://www.seek.com.au/jobs?where=Work%20from%20home")
assert "SEEK" in driver.title
location = WebDriverWait(driver, 20).until(EC.visibility_of_all_elements_located((By.XPATH, "/... | Whenever this kind of operation you are doing the locator should be selected carefully and here the xpaths used is not working. Using the xpath in the way `//*[text()='location:']` will solve your issue. |
211,501 | I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fashion rather than how to actually use it in produc... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18676/"
] | AFAIK an SQLITE database is just a file.
To check if the database exists, check for file existence.
When you open a SQLITE database it will automatically create one if the file that backs it up is not in place.
If you try and open a file as a sqlite3 database that is NOT a database, you will get this:
"sqlite3.Datab... | SQLite automatically creates the database file the first time you try to use it. The SQL statements for creating tables can use `IF NOT EXISTS` to make the commands only take effect if the table has not been created This way you don't need to check for the database's existence beforehand: SQLite can take care of that f... |
211,501 | I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fashion rather than how to actually use it in produc... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18676/"
] | Don't make this more complex than it needs to be. The big, independent databases have complex setup and configuration requirements. SQLite is just a file you access with SQL, it's much simpler.
Do the following.
1. Add a table to your database for "Components" or "Versions" or "Configuration" or "Release" or somethin... | Yes, I was nuking out the problem. All I needed to do was check for the file and catch the IOError if it didn't exist.
Thanks for all the other answers. They may come in handy in the future. |
211,501 | I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fashion rather than how to actually use it in produc... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18676/"
] | As @diciu pointed out, the database file will be created by [sqlite3.connect](http://docs.python.org/library/sqlite3.html#module-sqlite3).
If you want to take a special action when the file is not there, you'll have to explicitly check for existance:
```
import os
import sqlite3
if not os.path.exists(mydb_path):
#... | Doing SQL in overall is horrible in any language I've picked up. SQLalchemy has shown to be easiest from them to use because actual query and committing with it is so clean and absent from troubles.
Here's some basic steps on actually using sqlalchemy in your app, better details can be found from the documentation.
*... |
211,501 | I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fashion rather than how to actually use it in produc... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18676/"
] | AFAIK an SQLITE database is just a file.
To check if the database exists, check for file existence.
When you open a SQLITE database it will automatically create one if the file that backs it up is not in place.
If you try and open a file as a sqlite3 database that is NOT a database, you will get this:
"sqlite3.Datab... | Yes, I was nuking out the problem. All I needed to do was check for the file and catch the IOError if it didn't exist.
Thanks for all the other answers. They may come in handy in the future. |
211,501 | I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fashion rather than how to actually use it in produc... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18676/"
] | As @diciu pointed out, the database file will be created by [sqlite3.connect](http://docs.python.org/library/sqlite3.html#module-sqlite3).
If you want to take a special action when the file is not there, you'll have to explicitly check for existance:
```
import os
import sqlite3
if not os.path.exists(mydb_path):
#... | See this solution at SourceForge which covers your question in a tutorial manner, with instructive source code :
y\_serial.py module :: warehouse Python objects with SQLite
"Serialization + persistance :: in a few lines of code, compress and annotate Python objects into SQLite; then later retrieve them chronologicall... |
211,501 | I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fashion rather than how to actually use it in produc... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18676/"
] | Doing SQL in overall is horrible in any language I've picked up. SQLalchemy has shown to be easiest from them to use because actual query and committing with it is so clean and absent from troubles.
Here's some basic steps on actually using sqlalchemy in your app, better details can be found from the documentation.
*... | Yes, I was nuking out the problem. All I needed to do was check for the file and catch the IOError if it didn't exist.
Thanks for all the other answers. They may come in handy in the future. |
211,501 | I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fashion rather than how to actually use it in produc... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18676/"
] | * Sqlite doesn't throw an exception if you create a new database with the same name, it will just connect to it. Since sqlite is a file based database, I suggest you just check for the existence of the file.
* About your second problem, to check if a table has been already created, just catch the exception. An exceptio... | Yes, I was nuking out the problem. All I needed to do was check for the file and catch the IOError if it didn't exist.
Thanks for all the other answers. They may come in handy in the future. |
211,501 | I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fashion rather than how to actually use it in produc... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18676/"
] | As @diciu pointed out, the database file will be created by [sqlite3.connect](http://docs.python.org/library/sqlite3.html#module-sqlite3).
If you want to take a special action when the file is not there, you'll have to explicitly check for existance:
```
import os
import sqlite3
if not os.path.exists(mydb_path):
#... | * Sqlite doesn't throw an exception if you create a new database with the same name, it will just connect to it. Since sqlite is a file based database, I suggest you just check for the existence of the file.
* About your second problem, to check if a table has been already created, just catch the exception. An exceptio... |
211,501 | I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fashion rather than how to actually use it in produc... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18676/"
] | Don't make this more complex than it needs to be. The big, independent databases have complex setup and configuration requirements. SQLite is just a file you access with SQL, it's much simpler.
Do the following.
1. Add a table to your database for "Components" or "Versions" or "Configuration" or "Release" or somethin... | SQLite automatically creates the database file the first time you try to use it. The SQL statements for creating tables can use `IF NOT EXISTS` to make the commands only take effect if the table has not been created This way you don't need to check for the database's existence beforehand: SQLite can take care of that f... |
211,501 | I have created a Python module that creates and populates several SQLite tables. Now, I want to use it in a program but I don't really know how to call it properly. All the tutorials I've found are essentially "inline", i.e. they walk through using SQLite in a linear fashion rather than how to actually use it in produc... | 2008/10/17 | [
"https://Stackoverflow.com/questions/211501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/18676/"
] | Don't make this more complex than it needs to be. The big, independent databases have complex setup and configuration requirements. SQLite is just a file you access with SQL, it's much simpler.
Do the following.
1. Add a table to your database for "Components" or "Versions" or "Configuration" or "Release" or somethin... | * Sqlite doesn't throw an exception if you create a new database with the same name, it will just connect to it. Since sqlite is a file based database, I suggest you just check for the existence of the file.
* About your second problem, to check if a table has been already created, just catch the exception. An exceptio... |
1,477,072 | I have an object that reads from a socket continuously like below:
```
void CSocketReader::ReadComplete ( )
{
messageProcessor->ResponseReceived ( response );
read ();
}
void CSocketReader::read()
{
socket.read(response);
}
```
My problem is, depending on the response and on the protocol that I am executing the ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1477072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6488/"
] | What the value of the `this` pointer is after the object has been destructed is undefined in the C++ standard, so it should not be a surprise that `this` isn't `NULL` - C++ is not required to set it to `NULL` for you.
If the `messageProcessor` object destructs the `CSocketReader` object that has called it, then the de... | after deleting a pointer, it will not go automatically on null. You should set it explicitly to null if you want this.
when a method callsinto a class which doesn't exists anymore, nothing happens unless you use one of it's properties or fields. So code could potentially still run without problem.
So as the first few... |
1,477,072 | I have an object that reads from a socket continuously like below:
```
void CSocketReader::ReadComplete ( )
{
messageProcessor->ResponseReceived ( response );
read ();
}
void CSocketReader::read()
{
socket.read(response);
}
```
My problem is, depending on the response and on the protocol that I am executing the ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1477072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6488/"
] | Deleting an object does not change pointers to that object. Implementing that would require that each object "knew" about all pointers to it, so it could set them all to NULL in its destructor. This would be a performance and memory nightmare, if it's even possible to implement. It would certainly cost a great deal of ... | after deleting a pointer, it will not go automatically on null. You should set it explicitly to null if you want this.
when a method callsinto a class which doesn't exists anymore, nothing happens unless you use one of it's properties or fields. So code could potentially still run without problem.
So as the first few... |
1,477,072 | I have an object that reads from a socket continuously like below:
```
void CSocketReader::ReadComplete ( )
{
messageProcessor->ResponseReceived ( response );
read ();
}
void CSocketReader::read()
{
socket.read(response);
}
```
My problem is, depending on the response and on the protocol that I am executing the ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1477072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6488/"
] | What the value of the `this` pointer is after the object has been destructed is undefined in the C++ standard, so it should not be a surprise that `this` isn't `NULL` - C++ is not required to set it to `NULL` for you.
If the `messageProcessor` object destructs the `CSocketReader` object that has called it, then the de... | You can not. There is no way to know that you are working on a deleted object. Whenever you try to access a member variable of that deleted object the behavior is undefined. |
1,477,072 | I have an object that reads from a socket continuously like below:
```
void CSocketReader::ReadComplete ( )
{
messageProcessor->ResponseReceived ( response );
read ();
}
void CSocketReader::read()
{
socket.read(response);
}
```
My problem is, depending on the response and on the protocol that I am executing the ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1477072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6488/"
] | Deleting an object does not change pointers to that object. Implementing that would require that each object "knew" about all pointers to it, so it could set them all to NULL in its destructor. This would be a performance and memory nightmare, if it's even possible to implement. It would certainly cost a great deal of ... | You can not. There is no way to know that you are working on a deleted object. Whenever you try to access a member variable of that deleted object the behavior is undefined. |
1,477,072 | I have an object that reads from a socket continuously like below:
```
void CSocketReader::ReadComplete ( )
{
messageProcessor->ResponseReceived ( response );
read ();
}
void CSocketReader::read()
{
socket.read(response);
}
```
My problem is, depending on the response and on the protocol that I am executing the ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1477072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6488/"
] | What the value of the `this` pointer is after the object has been destructed is undefined in the C++ standard, so it should not be a surprise that `this` isn't `NULL` - C++ is not required to set it to `NULL` for you.
If the `messageProcessor` object destructs the `CSocketReader` object that has called it, then the de... | Deleting an object does not change pointers to that object. Implementing that would require that each object "knew" about all pointers to it, so it could set them all to NULL in its destructor. This would be a performance and memory nightmare, if it's even possible to implement. It would certainly cost a great deal of ... |
1,477,072 | I have an object that reads from a socket continuously like below:
```
void CSocketReader::ReadComplete ( )
{
messageProcessor->ResponseReceived ( response );
read ();
}
void CSocketReader::read()
{
socket.read(response);
}
```
My problem is, depending on the response and on the protocol that I am executing the ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1477072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6488/"
] | >
> How can I reliably detect that the method that's been executing on an object has been deleted.
>
>
>
You can't set a 'bool amDeleted' flag inside the object itself (because after it's deleted that flag/memory may be reused/overwritten by something else).
The only reliable way to do it (that I can think of) wo... | after deleting a pointer, it will not go automatically on null. You should set it explicitly to null if you want this.
when a method callsinto a class which doesn't exists anymore, nothing happens unless you use one of it's properties or fields. So code could potentially still run without problem.
So as the first few... |
1,477,072 | I have an object that reads from a socket continuously like below:
```
void CSocketReader::ReadComplete ( )
{
messageProcessor->ResponseReceived ( response );
read ();
}
void CSocketReader::read()
{
socket.read(response);
}
```
My problem is, depending on the response and on the protocol that I am executing the ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1477072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6488/"
] | >
> How can I reliably detect that the method that's been executing on an object has been deleted.
>
>
>
You can't set a 'bool amDeleted' flag inside the object itself (because after it's deleted that flag/memory may be reused/overwritten by something else).
The only reliable way to do it (that I can think of) wo... | You can not. There is no way to know that you are working on a deleted object. Whenever you try to access a member variable of that deleted object the behavior is undefined. |
1,477,072 | I have an object that reads from a socket continuously like below:
```
void CSocketReader::ReadComplete ( )
{
messageProcessor->ResponseReceived ( response );
read ();
}
void CSocketReader::read()
{
socket.read(response);
}
```
My problem is, depending on the response and on the protocol that I am executing the ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1477072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6488/"
] | >
> How can I reliably detect that the method that's been executing on an object has been deleted.
>
>
>
You can't set a 'bool amDeleted' flag inside the object itself (because after it's deleted that flag/memory may be reused/overwritten by something else).
The only reliable way to do it (that I can think of) wo... | delete'ing an object does not set its value to zero - it just runs the destructor(s), and frees the memory. If messageProcessor->ResponseReceived ( response ); function might delete the instance of the object that's calling that function, then you're in trouble - the value of the this pointer upon return will be unchan... |
1,477,072 | I have an object that reads from a socket continuously like below:
```
void CSocketReader::ReadComplete ( )
{
messageProcessor->ResponseReceived ( response );
read ();
}
void CSocketReader::read()
{
socket.read(response);
}
```
My problem is, depending on the response and on the protocol that I am executing the ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1477072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6488/"
] | What the value of the `this` pointer is after the object has been destructed is undefined in the C++ standard, so it should not be a surprise that `this` isn't `NULL` - C++ is not required to set it to `NULL` for you.
If the `messageProcessor` object destructs the `CSocketReader` object that has called it, then the de... | delete'ing an object does not set its value to zero - it just runs the destructor(s), and frees the memory. If messageProcessor->ResponseReceived ( response ); function might delete the instance of the object that's calling that function, then you're in trouble - the value of the this pointer upon return will be unchan... |
1,477,072 | I have an object that reads from a socket continuously like below:
```
void CSocketReader::ReadComplete ( )
{
messageProcessor->ResponseReceived ( response );
read ();
}
void CSocketReader::read()
{
socket.read(response);
}
```
My problem is, depending on the response and on the protocol that I am executing the ... | 2009/09/25 | [
"https://Stackoverflow.com/questions/1477072",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6488/"
] | Deleting an object does not change pointers to that object. Implementing that would require that each object "knew" about all pointers to it, so it could set them all to NULL in its destructor. This would be a performance and memory nightmare, if it's even possible to implement. It would certainly cost a great deal of ... | delete'ing an object does not set its value to zero - it just runs the destructor(s), and frees the memory. If messageProcessor->ResponseReceived ( response ); function might delete the instance of the object that's calling that function, then you're in trouble - the value of the this pointer upon return will be unchan... |
62,732,061 | I'm trying to get results from a join of 2 tables. Typically, not an issue, but I'm banging my head on this one. Basically, table1 (sales\_dealers) is joined with table2 (sales\_dealerEvents). Normally, easy-peasy. The problem is that I want to only get records from table2 if there are only 2 events (why I added the HA... | 2020/07/04 | [
"https://Stackoverflow.com/questions/62732061",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1133156/"
] | Hope the below query helps and you can see the demo here: <http://sqlfiddle.com/#!9/ef6f2c/37/0>
```
SELECT
EventAction,
DealerID,
AgentID,
DealerName,
Email,
FirstName,
State,
EventID
from
(
SELECT
e.EventAction,
d.DealerID,
d.AgentID,
d.DealerName... | This sounds like you want window functions:
```
select . . .
from sales_dealers d join
(select e.*,
row_number() over (partition by e.DealerID order by e.EventDateTime) as seqnum
from sales_dealerEvents e
) e
on e.DealerID = d.DealerID and e.seqnum = 2
where . . .
```
Note this gets... |
27,812,548 | If I have a docker container that I started a while back, what is the best way to set an environment variable in that running container? I set an environment variable initially when I ran the run command.
```
$ docker run --name my-wordpress -e VIRTUAL_HOST=domain.example --link my-mysql:mysql -d spencercooley/wordpre... | 2015/01/07 | [
"https://Stackoverflow.com/questions/27812548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/550221/"
] | Docker doesn't offer this feature.
There is an issue: "[How to set an enviroment variable on an existing container? #8838](https://github.com/docker/docker/issues/8838)"
Also from "[Allow `docker start` to take environment variables #7561](https://github.com/docker/docker/issues/7561)":
>
> Right now Docker can't c... | If you are running the container as a `service` using `docker swarm`, you can do:
`docker service update --env-add <you environment variable> <service_name>`
Also remove using `--env-rm`
To make sure it's addedd as you wanted, just run:
`docker exec -it <container id> env` |
27,812,548 | If I have a docker container that I started a while back, what is the best way to set an environment variable in that running container? I set an environment variable initially when I ran the run command.
```
$ docker run --name my-wordpress -e VIRTUAL_HOST=domain.example --link my-mysql:mysql -d spencercooley/wordpre... | 2015/01/07 | [
"https://Stackoverflow.com/questions/27812548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/550221/"
] | For a somewhat narrow use case, [docker issue 8838](https://github.com/docker/docker/issues/8838#issuecomment-117284347) mentions this sort-of-hack:
>
> You just stop docker daemon and change container config in /var/lib/docker/containers/[container-id]/config.json (sic)
>
>
>
This solution updates the environmen... | Hack with editing docker inner configs and then restarting docker daemon was unsuitable for my case.
**There is a way to recreate container with new environment settings** and use it for some time.
**1.** Create new image from runnning container:
```
docker commit my-service
a1b2c3d4e5f6032165497
```
Docker create... |
27,812,548 | If I have a docker container that I started a while back, what is the best way to set an environment variable in that running container? I set an environment variable initially when I ran the run command.
```
$ docker run --name my-wordpress -e VIRTUAL_HOST=domain.example --link my-mysql:mysql -d spencercooley/wordpre... | 2015/01/07 | [
"https://Stackoverflow.com/questions/27812548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/550221/"
] | Here's how you can modify a running container to update its environment variables. This assumes you're running on Linux. I tested it with Docker 19.03.8
### Live Restore
First, ensure that your Docker daemon is set to leave containers running when it's shut down. Edit your `/etc/docker/daemon.json`, and add `"live-re... | Hack with editing docker inner configs and then restarting docker daemon was unsuitable for my case.
**There is a way to recreate container with new environment settings** and use it for some time.
**1.** Create new image from runnning container:
```
docker commit my-service
a1b2c3d4e5f6032165497
```
Docker create... |
27,812,548 | If I have a docker container that I started a while back, what is the best way to set an environment variable in that running container? I set an environment variable initially when I ran the run command.
```
$ docker run --name my-wordpress -e VIRTUAL_HOST=domain.example --link my-mysql:mysql -d spencercooley/wordpre... | 2015/01/07 | [
"https://Stackoverflow.com/questions/27812548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/550221/"
] | You wrote that you do not want to *migrate the old volumes*. So I assume either the `Dockerfile` that you used to build the `spencercooley/wordpress` image has `VOLUME`s defined or you specified them on command line with the `-v` switch.
You could simply start a new container which imports the volumes from the old one... | You could set an environment variable to a running Docker container by
`docker exec -it -e "your environment Key"="your new value" <container> /bin/bash`
Verify it using below command
`printenv`
This will update your key with the new value provided.
**Note**: This will get reverted back to old on if docker gets r... |
27,812,548 | If I have a docker container that I started a while back, what is the best way to set an environment variable in that running container? I set an environment variable initially when I ran the run command.
```
$ docker run --name my-wordpress -e VIRTUAL_HOST=domain.example --link my-mysql:mysql -d spencercooley/wordpre... | 2015/01/07 | [
"https://Stackoverflow.com/questions/27812548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/550221/"
] | For a somewhat narrow use case, [docker issue 8838](https://github.com/docker/docker/issues/8838#issuecomment-117284347) mentions this sort-of-hack:
>
> You just stop docker daemon and change container config in /var/lib/docker/containers/[container-id]/config.json (sic)
>
>
>
This solution updates the environmen... | Firstly you can set env inside the container the same way as you do on a linux box.
Secondly, you can do it by modifying the config file of your docker container (`/var/lib/docker/containers/xxxx/config.v2.json`). Note you need restart docker service to take affect. This way you can change some other things like port ... |
27,812,548 | If I have a docker container that I started a while back, what is the best way to set an environment variable in that running container? I set an environment variable initially when I ran the run command.
```
$ docker run --name my-wordpress -e VIRTUAL_HOST=domain.example --link my-mysql:mysql -d spencercooley/wordpre... | 2015/01/07 | [
"https://Stackoverflow.com/questions/27812548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/550221/"
] | Docker doesn't offer this feature.
There is an issue: "[How to set an enviroment variable on an existing container? #8838](https://github.com/docker/docker/issues/8838)"
Also from "[Allow `docker start` to take environment variables #7561](https://github.com/docker/docker/issues/7561)":
>
> Right now Docker can't c... | To:
1. set up many env. vars in one step,
2. prevent exposing them in 'sh' history, like with '-e' option (passing credentials/api tokens!),
you can use
>
> --env-file key\_value\_file.txt
>
>
>
option:
```
docker run --env-file key_value_file.txt $INSTANCE_ID
``` |
27,812,548 | If I have a docker container that I started a while back, what is the best way to set an environment variable in that running container? I set an environment variable initially when I ran the run command.
```
$ docker run --name my-wordpress -e VIRTUAL_HOST=domain.example --link my-mysql:mysql -d spencercooley/wordpre... | 2015/01/07 | [
"https://Stackoverflow.com/questions/27812548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/550221/"
] | To:
1. set up many env. vars in one step,
2. prevent exposing them in 'sh' history, like with '-e' option (passing credentials/api tokens!),
you can use
>
> --env-file key\_value\_file.txt
>
>
>
option:
```
docker run --env-file key_value_file.txt $INSTANCE_ID
``` | I solve this problem with **docker commit** after some modifications in the base container, we only need to **tag** the new image and start that one
docs.docker.com/engine/reference/commandline/commit
>
> docker commit [container-id] [tag]
>
>
>
>
> docker commit b0e71de98cb9 stack-overflow:0.0.1
>
>
>
then... |
27,812,548 | If I have a docker container that I started a while back, what is the best way to set an environment variable in that running container? I set an environment variable initially when I ran the run command.
```
$ docker run --name my-wordpress -e VIRTUAL_HOST=domain.example --link my-mysql:mysql -d spencercooley/wordpre... | 2015/01/07 | [
"https://Stackoverflow.com/questions/27812548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/550221/"
] | here is how to update a docker container config permanently
1. stop container: `docker stop <container name>`
2. edit container config: `docker run -it -v /var/lib/docker:/var/lib/docker alpine vi $(docker inspect --format='/var/lib/docker/containers/{{.Id}}/config.v2.json' <container name>)`
3. restart docker | Use `export VAR=Value`
Then type `printenv` in terminal to validate it is set correctly. |
27,812,548 | If I have a docker container that I started a while back, what is the best way to set an environment variable in that running container? I set an environment variable initially when I ran the run command.
```
$ docker run --name my-wordpress -e VIRTUAL_HOST=domain.example --link my-mysql:mysql -d spencercooley/wordpre... | 2015/01/07 | [
"https://Stackoverflow.com/questions/27812548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/550221/"
] | For a somewhat narrow use case, [docker issue 8838](https://github.com/docker/docker/issues/8838#issuecomment-117284347) mentions this sort-of-hack:
>
> You just stop docker daemon and change container config in /var/lib/docker/containers/[container-id]/config.json (sic)
>
>
>
This solution updates the environmen... | Use `export VAR=Value`
Then type `printenv` in terminal to validate it is set correctly. |
27,812,548 | If I have a docker container that I started a while back, what is the best way to set an environment variable in that running container? I set an environment variable initially when I ran the run command.
```
$ docker run --name my-wordpress -e VIRTUAL_HOST=domain.example --link my-mysql:mysql -d spencercooley/wordpre... | 2015/01/07 | [
"https://Stackoverflow.com/questions/27812548",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/550221/"
] | To:
1. set up many env. vars in one step,
2. prevent exposing them in 'sh' history, like with '-e' option (passing credentials/api tokens!),
you can use
>
> --env-file key\_value\_file.txt
>
>
>
option:
```
docker run --env-file key_value_file.txt $INSTANCE_ID
``` | Basically you can do like in normal linux, adding `export MY_VAR="value"` to ~/.bashrc file.
### Instructions
1. Using VScode attach to your running container
2. Then with VScode open the ~/.bashrc file
3. Export your variable by adding the code in the end of the file
```
export MY_VAR="value"
```
4. Finally execu... |
7,414,385 | Please find the full stacktrace
```
2011-09-14 15:45:47 ContextLoader [ERROR] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'actionTypeManager': Injection of autowired dependencies failed; nested exception is org.spri
ngframework.beans.factory.Bean... | 2011/09/14 | [
"https://Stackoverflow.com/questions/7414385",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/936313/"
] | If you are using ADO in Excel, it is case sensitive and the wild card is % not \*.
To be a little clearer, the wild card for ADO is always %. | The only wildcard that worked for me was %.
Edit - my experience applies to Excel with ADODB driver only. In my project I had the same problem - "\*" symbol used as wildcard gave me errors. Once I used "%" it worked. I did not spend time investigating... |
10,790 | I want to create a wallet for monitoring incoming transactions. So it should be receive only wallet that will be place on hosting, that is potentially not secure. If I understand it well, this won't allow attacker to stole funds if server is compromised. How I can create such a wallet with only public keys? And can I i... | 2013/05/10 | [
"https://bitcoin.stackexchange.com/questions/10790",
"https://bitcoin.stackexchange.com",
"https://bitcoin.stackexchange.com/users/4723/"
] | You're right, storing your private keys on a server is a bad idea - it means you're liable to lose all of your funds in the case of a hack.
But as you aren't storing them, do you need to install the bitcoin daemon on your server? You could use an API from one of the online blockchains to monitor transactions from you... | Commands can be entered after opening Window -> Console
in Bitcoin Core
Create a new empty wallet with
`createwallet 'wallet_name' true`
<https://bitcoincore.org/en/doc/0.17.0/rpc/wallet/createwallet/>
Then use
`importmulti` command with "watchonly": true
<https://bitcoincore.org/en/doc/0.17.0/rpc/wallet/importmu... |
37,825,553 | I have project in Phonegap / Cordova and i need secrecy in source-code. Is there any way to encrypt my source code for anyone don't extract the APK file in android?
I saw a plugin [Cordova crypt file plugin](https://github.com/tkyaji/cordova-plugin-crypt-file), but it does not work, it is out of date and not have supo... | 2016/06/15 | [
"https://Stackoverflow.com/questions/37825553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6214696/"
] | **Best solutions for Obfuscation encryption:**
[jscrambler](http://jscrambler.com) and [Javascript Obfuscator](http://www.javascriptobfuscator.com)
>
> Decryption performed tests and they did well. Much of the code has not
> been decrypted and organized completely, which brought more security.
>
>
> I recommend j... | To encrypt use the cordova command line (cli):
```
cordova build android
```
And not encrypt if you are using the command run android or emulate android. |
37,825,553 | I have project in Phonegap / Cordova and i need secrecy in source-code. Is there any way to encrypt my source code for anyone don't extract the APK file in android?
I saw a plugin [Cordova crypt file plugin](https://github.com/tkyaji/cordova-plugin-crypt-file), but it does not work, it is out of date and not have supo... | 2016/06/15 | [
"https://Stackoverflow.com/questions/37825553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6214696/"
] | **Best solutions for Obfuscation encryption:**
[jscrambler](http://jscrambler.com) and [Javascript Obfuscator](http://www.javascriptobfuscator.com)
>
> Decryption performed tests and they did well. Much of the code has not
> been decrypted and organized completely, which brought more security.
>
>
> I recommend j... | I found a nice workaround here
[Encrypt Source Files](https://ourcodeworld.com/articles/read/386/how-to-encrypt-protect-the-source-code-of-an-android-cordova-app)
All you need to do is add:
cordova plugin add cordova-plugin-crypt-file
and as soon as you run:
cordova build android
or
cordova build android --prod -... |
37,825,553 | I have project in Phonegap / Cordova and i need secrecy in source-code. Is there any way to encrypt my source code for anyone don't extract the APK file in android?
I saw a plugin [Cordova crypt file plugin](https://github.com/tkyaji/cordova-plugin-crypt-file), but it does not work, it is out of date and not have supo... | 2016/06/15 | [
"https://Stackoverflow.com/questions/37825553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6214696/"
] | **Best solutions for Obfuscation encryption:**
[jscrambler](http://jscrambler.com) and [Javascript Obfuscator](http://www.javascriptobfuscator.com)
>
> Decryption performed tests and they did well. Much of the code has not
> been decrypted and organized completely, which brought more security.
>
>
> I recommend j... | It is working fine...
You can follow below step:
1.Add source at **root www** folder.
2.Add cordova plugin add -> **cordova-plugin-crypt-file**
3.Execute below command:
**cordova build**
Its encrypt the root **www** folder to **{project\_name}\platforms\android\assets\www**. |
37,825,553 | I have project in Phonegap / Cordova and i need secrecy in source-code. Is there any way to encrypt my source code for anyone don't extract the APK file in android?
I saw a plugin [Cordova crypt file plugin](https://github.com/tkyaji/cordova-plugin-crypt-file), but it does not work, it is out of date and not have supo... | 2016/06/15 | [
"https://Stackoverflow.com/questions/37825553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6214696/"
] | **Best solutions for Obfuscation encryption:**
[jscrambler](http://jscrambler.com) and [Javascript Obfuscator](http://www.javascriptobfuscator.com)
>
> Decryption performed tests and they did well. Much of the code has not
> been decrypted and organized completely, which brought more security.
>
>
> I recommend j... | This is the Best plugin for Cordova/PhoneGap app source code security.
try this plugin: `cordova plugin add cordova-plugin-crypt-file`
Official Repo: [enter link description here](https://github.com/tkyaji/cordova-plugin-crypt-file.git) |
37,825,553 | I have project in Phonegap / Cordova and i need secrecy in source-code. Is there any way to encrypt my source code for anyone don't extract the APK file in android?
I saw a plugin [Cordova crypt file plugin](https://github.com/tkyaji/cordova-plugin-crypt-file), but it does not work, it is out of date and not have supo... | 2016/06/15 | [
"https://Stackoverflow.com/questions/37825553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6214696/"
] | I found a nice workaround here
[Encrypt Source Files](https://ourcodeworld.com/articles/read/386/how-to-encrypt-protect-the-source-code-of-an-android-cordova-app)
All you need to do is add:
cordova plugin add cordova-plugin-crypt-file
and as soon as you run:
cordova build android
or
cordova build android --prod -... | To encrypt use the cordova command line (cli):
```
cordova build android
```
And not encrypt if you are using the command run android or emulate android. |
37,825,553 | I have project in Phonegap / Cordova and i need secrecy in source-code. Is there any way to encrypt my source code for anyone don't extract the APK file in android?
I saw a plugin [Cordova crypt file plugin](https://github.com/tkyaji/cordova-plugin-crypt-file), but it does not work, it is out of date and not have supo... | 2016/06/15 | [
"https://Stackoverflow.com/questions/37825553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6214696/"
] | It is working fine...
You can follow below step:
1.Add source at **root www** folder.
2.Add cordova plugin add -> **cordova-plugin-crypt-file**
3.Execute below command:
**cordova build**
Its encrypt the root **www** folder to **{project\_name}\platforms\android\assets\www**. | To encrypt use the cordova command line (cli):
```
cordova build android
```
And not encrypt if you are using the command run android or emulate android. |
37,825,553 | I have project in Phonegap / Cordova and i need secrecy in source-code. Is there any way to encrypt my source code for anyone don't extract the APK file in android?
I saw a plugin [Cordova crypt file plugin](https://github.com/tkyaji/cordova-plugin-crypt-file), but it does not work, it is out of date and not have supo... | 2016/06/15 | [
"https://Stackoverflow.com/questions/37825553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6214696/"
] | I found a nice workaround here
[Encrypt Source Files](https://ourcodeworld.com/articles/read/386/how-to-encrypt-protect-the-source-code-of-an-android-cordova-app)
All you need to do is add:
cordova plugin add cordova-plugin-crypt-file
and as soon as you run:
cordova build android
or
cordova build android --prod -... | This is the Best plugin for Cordova/PhoneGap app source code security.
try this plugin: `cordova plugin add cordova-plugin-crypt-file`
Official Repo: [enter link description here](https://github.com/tkyaji/cordova-plugin-crypt-file.git) |
37,825,553 | I have project in Phonegap / Cordova and i need secrecy in source-code. Is there any way to encrypt my source code for anyone don't extract the APK file in android?
I saw a plugin [Cordova crypt file plugin](https://github.com/tkyaji/cordova-plugin-crypt-file), but it does not work, it is out of date and not have supo... | 2016/06/15 | [
"https://Stackoverflow.com/questions/37825553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6214696/"
] | It is working fine...
You can follow below step:
1.Add source at **root www** folder.
2.Add cordova plugin add -> **cordova-plugin-crypt-file**
3.Execute below command:
**cordova build**
Its encrypt the root **www** folder to **{project\_name}\platforms\android\assets\www**. | This is the Best plugin for Cordova/PhoneGap app source code security.
try this plugin: `cordova plugin add cordova-plugin-crypt-file`
Official Repo: [enter link description here](https://github.com/tkyaji/cordova-plugin-crypt-file.git) |
22,921 | How to export list of prop values as .txt to *Local Disk (C:) > Blender game > New Folder*?
And how to import them back?
Now im creating save and load game: global position, stats, items etc...
and im planning to save it as list.
Tho im not sure how to do it.
Let's say I have informantion set as var `myprop` and... | 2015/01/09 | [
"https://blender.stackexchange.com/questions/22921",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/9664/"
] | Here's a very simple example, of how you could write out something to a text file:
```
import os
# Ensure all folders of the path exist
path = "C:/Blender game/YourFolder/"
os.makedirs(path, exist_ok=True)
# Write data out (2 integers)
with open(path + "file.txt", "w") as file:
file.write("%i %i" % (myprop, mypr... | A very simple example with a string and integer variable
```
prop1 = "abc"
prop2 = 123
# write to file
f = open("props.txt", "w")
print("%s\n%d" % (prop1,prop2), file=f)
f.close()
# read back
prop1 = ""
prop2 = 0
f = open("props.txt", "r")
prop1 = f.readline()
prop2 = int(f.readline())
f.close()
# test
print(prop... |
39,998,485 | In the linker script, I defined `PROVIDE(__KERNEL_BEGIN__ = .);`.
The address can be accessed from:
```
extern uint32_t __KERNEL_BEGIN__[];
```
But, the following does not work (gives an incorrect address):
```
extern uint32_t * __KERNEL_BEGIN__;
```
I looked at the assembly. The first method, `__KERNEL_BEGIN__`... | 2016/10/12 | [
"https://Stackoverflow.com/questions/39998485",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5159891/"
] | You need to take the address of the `extern` variable. It is not completely intuitive but is explained in [the manual](https://sourceware.org/binutils/docs/ld/Source-Code-Reference.html).
In theory, the `extern` can be any primitive data type. For reasons which I am unaware, the convention is to use a `char`:
```
ext... | This is more in reference to your follow-up question beneath Ryan's post, however it may help answer your original question as well.
"Variables" defined in linker scripts aren't treated the same as those defined in C; they're more *symbols* than anything. When accessing these *symbols* defined in your linker scripts, ... |
7,921,720 | ```
String s1 = "create table testing " +
"(id number NOT NULL PRIMARY KEY, " +
"url varchar(1000) NOT NULL, " +
"urlHash varchar(1000) NOT NULL, " +
"contentHash varchar(1000), " +
"modDate date, " +
"contentLocation varchar(1000), " +
"status i... | 2011/10/27 | [
"https://Stackoverflow.com/questions/7921720",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/663148/"
] | The date format in your first `TO_DATE` call is no good -- you're trying to use single quotes inside a single-quoted string, so it ends up not being enclosed properly. Probably this is giving the parser fits, resulting in a not very sensible error message.
In an Oracle date format, the literal bits need to be enclosed... | This may not pertain to your issue, but I was getting the same error and I happened to have two comment lines at the beginning of my SQL. I moved those to the bottom and the error went away. |
68,855,198 | All of the dates are becoming empty even if there are dates present in the cell. This is from a gridview template field. I am trying to convert those cells that are not empty but instead, all of them are empty.
```
asp:Label ID="Label13" runat="server" Text='<%# Eval("assigned_date") != null ? "" : Convert.ToDateTime... | 2021/08/19 | [
"https://Stackoverflow.com/questions/68855198",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9968694/"
] | You can use this code:
```
struct pix (*pixels)[800] = malloc(600 * sizeof *pixels);
```
This declares `pixels` to be a pointer to an array of 800 `struct pix` and allocates 600 of them. Then you can access the element in row `i` and column `j` as `pixels[i][j]`, and its members with `pixels[i][j].red`. (Do not forg... | This uses a similar pointer to what Eric used, but I've added an array descriptor `struct` that can be passed around easily.
That is, from `main`, how do you pass the array to subfunctions? Especially, if you have to have multiple arrays that have differing dimensions?
The syntax of (e.g.):
```
struct pix (*pixels)[... |
29,631 | I have a code where I don't understand parts of the I2C protocol.
The code below is a part of the code to **read** a bit from the bus
```
if (SDA==1)
{
i_byte = (i_byte << 1) | 0x01;
}
else
{
i_byte = i_byte << 1;
}
```
Why is the ORing with 0x01 done ?
The code below is a part of the code t... | 2012/04/10 | [
"https://electronics.stackexchange.com/questions/29631",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/9162/"
] | You really should provide more data like what system you're using, to which pins are the I^2C lines connected and so on.
Since I have to guess, here's what it looks to me:
```
if (SDA==1)
{
i_byte = (i_byte << 1) | 0x01;
}
else
{
i_byte = i_byte << 1;
}
```
`if (SDA==1)` I'd say that this tes... | Before you do any more programming of a microcontroller, you'll find it *extremely* helpful to learn about the following concepts:
* Binary counting
* Hexadecimal counting
* The AND operation
* The OR operation
These four things are tragically misunderstood, even by very experienced software developers who have not h... |
29,631 | I have a code where I don't understand parts of the I2C protocol.
The code below is a part of the code to **read** a bit from the bus
```
if (SDA==1)
{
i_byte = (i_byte << 1) | 0x01;
}
else
{
i_byte = i_byte << 1;
}
```
Why is the ORing with 0x01 done ?
The code below is a part of the code t... | 2012/04/10 | [
"https://electronics.stackexchange.com/questions/29631",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/9162/"
] | The code in your example is "clocking in" or "shifting in" a byte using a serial protocol. On every pulse of the clock line, your program reads in the next bit from a data line.
Here's another way to write your code which may be clearer, assuming that your program is the master (ie. in charge of generating the clock l... | You really should provide more data like what system you're using, to which pins are the I^2C lines connected and so on.
Since I have to guess, here's what it looks to me:
```
if (SDA==1)
{
i_byte = (i_byte << 1) | 0x01;
}
else
{
i_byte = i_byte << 1;
}
```
`if (SDA==1)` I'd say that this tes... |
29,631 | I have a code where I don't understand parts of the I2C protocol.
The code below is a part of the code to **read** a bit from the bus
```
if (SDA==1)
{
i_byte = (i_byte << 1) | 0x01;
}
else
{
i_byte = i_byte << 1;
}
```
Why is the ORing with 0x01 done ?
The code below is a part of the code t... | 2012/04/10 | [
"https://electronics.stackexchange.com/questions/29631",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/9162/"
] | These snippets looks like they have been taken out of receive/send loops that iterate 8 times for each byte. The first loop shifts received bits left (I2C transfers data MSB first) and sets the newly arrived bit to 1 if SDA is high and to 0 if it's low. The left shift operator [is defined to set vacated bits to zero](h... | Before you do any more programming of a microcontroller, you'll find it *extremely* helpful to learn about the following concepts:
* Binary counting
* Hexadecimal counting
* The AND operation
* The OR operation
These four things are tragically misunderstood, even by very experienced software developers who have not h... |
29,631 | I have a code where I don't understand parts of the I2C protocol.
The code below is a part of the code to **read** a bit from the bus
```
if (SDA==1)
{
i_byte = (i_byte << 1) | 0x01;
}
else
{
i_byte = i_byte << 1;
}
```
Why is the ORing with 0x01 done ?
The code below is a part of the code t... | 2012/04/10 | [
"https://electronics.stackexchange.com/questions/29631",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/9162/"
] | The code in your example is "clocking in" or "shifting in" a byte using a serial protocol. On every pulse of the clock line, your program reads in the next bit from a data line.
Here's another way to write your code which may be clearer, assuming that your program is the master (ie. in charge of generating the clock l... | These snippets looks like they have been taken out of receive/send loops that iterate 8 times for each byte. The first loop shifts received bits left (I2C transfers data MSB first) and sets the newly arrived bit to 1 if SDA is high and to 0 if it's low. The left shift operator [is defined to set vacated bits to zero](h... |
29,631 | I have a code where I don't understand parts of the I2C protocol.
The code below is a part of the code to **read** a bit from the bus
```
if (SDA==1)
{
i_byte = (i_byte << 1) | 0x01;
}
else
{
i_byte = i_byte << 1;
}
```
Why is the ORing with 0x01 done ?
The code below is a part of the code t... | 2012/04/10 | [
"https://electronics.stackexchange.com/questions/29631",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/9162/"
] | The code in your example is "clocking in" or "shifting in" a byte using a serial protocol. On every pulse of the clock line, your program reads in the next bit from a data line.
Here's another way to write your code which may be clearer, assuming that your program is the master (ie. in charge of generating the clock l... | Before you do any more programming of a microcontroller, you'll find it *extremely* helpful to learn about the following concepts:
* Binary counting
* Hexadecimal counting
* The AND operation
* The OR operation
These four things are tragically misunderstood, even by very experienced software developers who have not h... |
29,631 | I have a code where I don't understand parts of the I2C protocol.
The code below is a part of the code to **read** a bit from the bus
```
if (SDA==1)
{
i_byte = (i_byte << 1) | 0x01;
}
else
{
i_byte = i_byte << 1;
}
```
Why is the ORing with 0x01 done ?
The code below is a part of the code t... | 2012/04/10 | [
"https://electronics.stackexchange.com/questions/29631",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/9162/"
] | Others have explained the code snippets. I'll address the 0x00, 0x90 and 0x91.
The datasheet (http://astro.temple.edu/~cvecchio/PCF8591\_6.pdf) page 5 figure 4 shows how the address byte is built: the 1001 bits go in the upper nibble, the lowest bit selects read/write, the remaining 3 bits are determined by pins of t... | Before you do any more programming of a microcontroller, you'll find it *extremely* helpful to learn about the following concepts:
* Binary counting
* Hexadecimal counting
* The AND operation
* The OR operation
These four things are tragically misunderstood, even by very experienced software developers who have not h... |
29,631 | I have a code where I don't understand parts of the I2C protocol.
The code below is a part of the code to **read** a bit from the bus
```
if (SDA==1)
{
i_byte = (i_byte << 1) | 0x01;
}
else
{
i_byte = i_byte << 1;
}
```
Why is the ORing with 0x01 done ?
The code below is a part of the code t... | 2012/04/10 | [
"https://electronics.stackexchange.com/questions/29631",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/9162/"
] | The code in your example is "clocking in" or "shifting in" a byte using a serial protocol. On every pulse of the clock line, your program reads in the next bit from a data line.
Here's another way to write your code which may be clearer, assuming that your program is the master (ie. in charge of generating the clock l... | Others have explained the code snippets. I'll address the 0x00, 0x90 and 0x91.
The datasheet (http://astro.temple.edu/~cvecchio/PCF8591\_6.pdf) page 5 figure 4 shows how the address byte is built: the 1001 bits go in the upper nibble, the lowest bit selects read/write, the remaining 3 bits are determined by pins of t... |
11,302,977 | General structure of my application:
```
[includes] - not accessible by the web
.. important database classes, etc
[public]
.. all files that the application publicly uses
```
I'm trying to make a decision about where I should store the `[uploads]` folder. This is the where all users will be storing their media (ima... | 2012/07/03 | [
"https://Stackoverflow.com/questions/11302977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/337806/"
] | In a sibling directory. That is, a directory at the same level as `includes/` and `public/`. | It depends on what you are trying to achieve. If you are uploading for example photos for user articles, place them in publicly visible folder such as `/public/images` (that images are visible either way). If you are on the other hand making an application that will (for example) profit from uploaded files, it's better... |
11,302,977 | General structure of my application:
```
[includes] - not accessible by the web
.. important database classes, etc
[public]
.. all files that the application publicly uses
```
I'm trying to make a decision about where I should store the `[uploads]` folder. This is the where all users will be storing their media (ima... | 2012/07/03 | [
"https://Stackoverflow.com/questions/11302977",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/337806/"
] | In a sibling directory. That is, a directory at the same level as `includes/` and `public/`. | >
> I suppose only that user. I mean, without brining "sharing" media into the conversation ... which is a possibility down the road.
>
>
>
In that case, the usual setup is
* Place the files outside the web root (ie. outside the `public` folder - where exactly, is up to you really)
* Build a PHP script that check... |
90,730 | I have been trying to load Animation Nodes, but can't seem to get Numpy to work, and have no idea how to install. I have done a clean install on latest version (and other tower works fine) but this particular machine won't work. I have not had to install Numpy on the working machine. The Numpy folder has been installed... | 2017/09/20 | [
"https://blender.stackexchange.com/questions/90730",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/44340/"
] | Blender installation issue
==========================
Blender comes with numpy installed. Maybe something got wrong in your blender installation, if so you should not be able to import numpy directly from the python console: (deactivate AN first)
[](https://i.stack.im... | "pip install --user --upgrade numpy"
run this in cmd |
25,663,463 | I am trying to display a RelativeLayout above a Fragment without success.
And here my xml :
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientatio... | 2014/09/04 | [
"https://Stackoverflow.com/questions/25663463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2802154/"
] | You must use different id for both carousel like this
```
<!--carousel one -->
<div id="carousel" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel" data-slide-to="0" class="active"></li>
<li data-target="#carou... | Here is the solution for that on click if 'Go to slide3' , It will take the specific slider , ex: that is now i am targeting it to the class 'slidehere' in '#carousel2'
```
<!-- link to specific slider -->
<a href="#" class="slide3">Go to slide3</a>
<!--carousel one -->
<div id="carousel" class=... |
47,497,110 | I'd like to use the vim sort command to start sorting at a certain position.
Without installing any plugins.
```
2011-09-17 00:37 |Free|ALL RIGHT NOW
2011-09-17 00:41 |Kim Wilde|CAMBODIA
2011-09-17 00:45 |Take That|NEVER FORGET
2011-09-17 00:53 |Visage|FADE TO GREY
2011-09-17 00:56 |SUTHERLAND BROTHERS & QUIVER|A... | 2017/11/26 | [
"https://Stackoverflow.com/questions/47497110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2335020/"
] | You can skip the first part of the line (until the "|" char) in your sort by the VIM command:
```
:sort /^[^|]*/
``` | If you really want to sort from position 20, use the next syntax:
```
:sort /^.\{19}/
```
Mind the *backslash* before the opening bracket and the character to be repeated must be *before* the quantifier. |
47,497,110 | I'd like to use the vim sort command to start sorting at a certain position.
Without installing any plugins.
```
2011-09-17 00:37 |Free|ALL RIGHT NOW
2011-09-17 00:41 |Kim Wilde|CAMBODIA
2011-09-17 00:45 |Take That|NEVER FORGET
2011-09-17 00:53 |Visage|FADE TO GREY
2011-09-17 00:56 |SUTHERLAND BROTHERS & QUIVER|A... | 2017/11/26 | [
"https://Stackoverflow.com/questions/47497110",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2335020/"
] | Out of the box, you can sort starting at a virtual column
```
:sort /\%20v/
```
from `:help :sort` | You can skip the first part of the line (until the "|" char) in your sort by the VIM command:
```
:sort /^[^|]*/
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.