qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
58,539,906
I have widget with following info: ``` <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minWidth="328dp" android:minHeight="56dp" android:updatePeriodMillis="1000000" android:initialLayout="@layout/home_widget" android:previewImage="@drawable/widget_preview...
2019/10/24
[ "https://Stackoverflow.com/questions/58539906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1619036/" ]
Screen density is not same for all devices, hence a best solution is to introduce `ssp` and `sdp` instead of `dp` which is fixed for all devices `ssp` is used for setting size to text and [sdp](https://github.com/intuit/sdp) is used for layouts. <https://github.com/intuit/sdp>
becuase of we use diffrent screen size and diffrent density of the screen to solve this dont use dp or sp rather than use sdp or ssp which is provide in this library <https://github.com/intuit/sdp> And this make your space preamter screen responsive
58,539,906
I have widget with following info: ``` <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minWidth="328dp" android:minHeight="56dp" android:updatePeriodMillis="1000000" android:initialLayout="@layout/home_widget" android:previewImage="@drawable/widget_preview...
2019/10/24
[ "https://Stackoverflow.com/questions/58539906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1619036/" ]
becuase of we use diffrent screen size and diffrent density of the screen to solve this dont use dp or sp rather than use sdp or ssp which is provide in this library <https://github.com/intuit/sdp> And this make your space preamter screen responsive
As mentioned above, **different phones got different screen sizes** so when using a fixed size value (`328dp` for example) your layout may not be responsive to all devices. --- *Naman's* answer will work for you, you can use something like this: ``` <view android:layout_height="@dimen/_100sdp" android:width=...
58,539,906
I have widget with following info: ``` <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minWidth="328dp" android:minHeight="56dp" android:updatePeriodMillis="1000000" android:initialLayout="@layout/home_widget" android:previewImage="@drawable/widget_preview...
2019/10/24
[ "https://Stackoverflow.com/questions/58539906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1619036/" ]
Screen density is not same for all devices, hence a best solution is to introduce `ssp` and `sdp` instead of `dp` which is fixed for all devices `ssp` is used for setting size to text and [sdp](https://github.com/intuit/sdp) is used for layouts. <https://github.com/intuit/sdp>
If you want widget width match as parent then you can use the `android:layout_width="match_parent"` `match_parent` defines the width/height as match of parent, there is not any need to define the static dimen. It is adjust the width according to parent's width. I hope its work for you.
58,539,906
I have widget with following info: ``` <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minWidth="328dp" android:minHeight="56dp" android:updatePeriodMillis="1000000" android:initialLayout="@layout/home_widget" android:previewImage="@drawable/widget_preview...
2019/10/24
[ "https://Stackoverflow.com/questions/58539906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1619036/" ]
As mentioned above, **different phones got different screen sizes** so when using a fixed size value (`328dp` for example) your layout may not be responsive to all devices. --- *Naman's* answer will work for you, you can use something like this: ``` <view android:layout_height="@dimen/_100sdp" android:width=...
If you want widget width match as parent then you can use the `android:layout_width="match_parent"` `match_parent` defines the width/height as match of parent, there is not any need to define the static dimen. It is adjust the width according to parent's width. I hope its work for you.
58,539,906
I have widget with following info: ``` <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minWidth="328dp" android:minHeight="56dp" android:updatePeriodMillis="1000000" android:initialLayout="@layout/home_widget" android:previewImage="@drawable/widget_preview...
2019/10/24
[ "https://Stackoverflow.com/questions/58539906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1619036/" ]
Screen density is not same for all devices, hence a best solution is to introduce `ssp` and `sdp` instead of `dp` which is fixed for all devices `ssp` is used for setting size to text and [sdp](https://github.com/intuit/sdp) is used for layouts. <https://github.com/intuit/sdp>
As mentioned above, **different phones got different screen sizes** so when using a fixed size value (`328dp` for example) your layout may not be responsive to all devices. --- *Naman's* answer will work for you, you can use something like this: ``` <view android:layout_height="@dimen/_100sdp" android:width=...
30,210,685
I am very new to android app development. I am designing the layout of an Activity of an Android project in android studio. I am noticing a strange behavior and I am not able to find a solution. In the design view I am seeing the following view being generated for the following code. View generated: ![View generated](...
2015/05/13
[ "https://Stackoverflow.com/questions/30210685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3797372/" ]
The reason for the seemingly odd behaviour in your question is because the width of Nexus 5 and Xperia Z Ultra are different in dps (density independent pixels) You need to prepare different layout files based on size qualifiers to give the same look across multiple devices. Take a look [here](http://developer.android...
You should use the relative positions for the layout parameters, do not use hard coded (fixed) values. Relative positions will be rendered accordingly on different screen size and density devices. You can refer [this link](http://developer.android.com/training/multiscreen/screensizes.html)
97,927
If we have a rewrite system for primitive recursive functions, which simplifies each term according to how the function was defined, then what is the computational complexity of this calculation? That is, what is the coplexity of the normalization procedure? I have heard a claim that for a closed term calculating the v...
2012/05/25
[ "https://mathoverflow.net/questions/97927", "https://mathoverflow.net", "https://mathoverflow.net/users/23947/" ]
I find some aspects of this question difficult to understand. For example, the part about "calculating the value of the function requires transfinite induction up to $\varepsilon\_0$" seems to conflate methods of proof (like transfinite induction) with methods of computation. Also, much (if not all) of the question app...
Actually there is no need for any transfinite induction. A monotone interpretation yields that the derivation lengths for any fixed term will be primitive recursive in the values of the numerals plugged in. I have a paper in APAL with Cichon on the topic and, in addition, a paper in JSL regarding Goedel's T showing tha...
97,927
If we have a rewrite system for primitive recursive functions, which simplifies each term according to how the function was defined, then what is the computational complexity of this calculation? That is, what is the coplexity of the normalization procedure? I have heard a claim that for a closed term calculating the v...
2012/05/25
[ "https://mathoverflow.net/questions/97927", "https://mathoverflow.net", "https://mathoverflow.net/users/23947/" ]
I find some aspects of this question difficult to understand. For example, the part about "calculating the value of the function requires transfinite induction up to $\varepsilon\_0$" seems to conflate methods of proof (like transfinite induction) with methods of computation. Also, much (if not all) of the question app...
Dear Andreas, yes indeed. We have the follwing (not too difficult) fact: Let S^m(0) be the numeral for $m$. For any PRA term $t(x\_1,\ldots,x\_n)$ The derivation length of $t(S^{m\_1}(0),\ldots,S^{m\_n}(0))$ will be bounded by a primitive recursive function (depending on $t$) with arguments $m\_1,\ldots,m\_n$. (Here I...
97,927
If we have a rewrite system for primitive recursive functions, which simplifies each term according to how the function was defined, then what is the computational complexity of this calculation? That is, what is the coplexity of the normalization procedure? I have heard a claim that for a closed term calculating the v...
2012/05/25
[ "https://mathoverflow.net/questions/97927", "https://mathoverflow.net", "https://mathoverflow.net/users/23947/" ]
Actually there is no need for any transfinite induction. A monotone interpretation yields that the derivation lengths for any fixed term will be primitive recursive in the values of the numerals plugged in. I have a paper in APAL with Cichon on the topic and, in addition, a paper in JSL regarding Goedel's T showing tha...
Dear Andreas, yes indeed. We have the follwing (not too difficult) fact: Let S^m(0) be the numeral for $m$. For any PRA term $t(x\_1,\ldots,x\_n)$ The derivation length of $t(S^{m\_1}(0),\ldots,S^{m\_n}(0))$ will be bounded by a primitive recursive function (depending on $t$) with arguments $m\_1,\ldots,m\_n$. (Here I...
17,223,945
I am using a WAMP server, and I want to upload images in the database using CI.The image variable in database is of blob datatype. My question's as follows: 1) How to store the image instead of the file name and what datatypes should I use? 2) How to retrieve images from the DB? My controller's code: ``` <?php clas...
2013/06/20
[ "https://Stackoverflow.com/questions/17223945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2506856/" ]
DO NOT STORE FILES INSIDE THE DATABASE!!! This is always a bad design idea. Store the files in the file system and simply store the file names and point to the file, it will save you a lot of headaches in the future.
try this code models code ``` function do_upload() { $config = array( 'allowed_types' => 'jpg|png|bmp', 'upload_path'=>'./images1/', //make sure you have this folder 'max_size'=>2000 ); $this->load->library('upload',$config); if ($this->upload->do_u...
17,223,945
I am using a WAMP server, and I want to upload images in the database using CI.The image variable in database is of blob datatype. My question's as follows: 1) How to store the image instead of the file name and what datatypes should I use? 2) How to retrieve images from the DB? My controller's code: ``` <?php clas...
2013/06/20
[ "https://Stackoverflow.com/questions/17223945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2506856/" ]
DO NOT STORE FILES INSIDE THE DATABASE!!! This is always a bad design idea. Store the files in the file system and simply store the file names and point to the file, it will save you a lot of headaches in the future.
Here's a quick something I use for small PNG thumbnails. These are stored in a table called "coreg" in a field named "IMAGE". The field-type is LONGBLOB. Every upload overwrites the previous image. In the actual app the view-file is displayed as an iframe: VIEW FILE FOR UPLOADING (better to use the CI specific form ta...
17,223,945
I am using a WAMP server, and I want to upload images in the database using CI.The image variable in database is of blob datatype. My question's as follows: 1) How to store the image instead of the file name and what datatypes should I use? 2) How to retrieve images from the DB? My controller's code: ``` <?php clas...
2013/06/20
[ "https://Stackoverflow.com/questions/17223945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2506856/" ]
DO NOT STORE FILES INSIDE THE DATABASE!!! This is always a bad design idea. Store the files in the file system and simply store the file names and point to the file, it will save you a lot of headaches in the future.
try this code controller:- ``` <?php class Profile extends CI_Controller { public function __construct() { parent::__construct(); $this->load->helper(array('form', 'url')); } public function index() { $this->load->view('profile', ...
17,223,945
I am using a WAMP server, and I want to upload images in the database using CI.The image variable in database is of blob datatype. My question's as follows: 1) How to store the image instead of the file name and what datatypes should I use? 2) How to retrieve images from the DB? My controller's code: ``` <?php clas...
2013/06/20
[ "https://Stackoverflow.com/questions/17223945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2506856/" ]
DO NOT STORE FILES INSIDE THE DATABASE!!! This is always a bad design idea. Store the files in the file system and simply store the file names and point to the file, it will save you a lot of headaches in the future.
view: ``` <?php echo form_open_multipart('profile/do_upload');?> <input type="file" name="userfile" size="20" /> <br /><br /> <input type="submit" value="upload" /> <img src="<?php echo $img ?>" width="300px" height="300px"> </form> ?> ```
17,223,945
I am using a WAMP server, and I want to upload images in the database using CI.The image variable in database is of blob datatype. My question's as follows: 1) How to store the image instead of the file name and what datatypes should I use? 2) How to retrieve images from the DB? My controller's code: ``` <?php clas...
2013/06/20
[ "https://Stackoverflow.com/questions/17223945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2506856/" ]
``` // uploading public function do_upload(){ ... $image_path=$this->upload->data(); $uploaded_image = $image_path['full_path']; // Read the file $fp = fopen($uploaded_image, 'r'); $data = fread($fp, filesize($uploaded_image)); $data = addslashes($data); fclose($fp); // here you can easy insert $data to 'a_photo' co...
try this code models code ``` function do_upload() { $config = array( 'allowed_types' => 'jpg|png|bmp', 'upload_path'=>'./images1/', //make sure you have this folder 'max_size'=>2000 ); $this->load->library('upload',$config); if ($this->upload->do_u...
17,223,945
I am using a WAMP server, and I want to upload images in the database using CI.The image variable in database is of blob datatype. My question's as follows: 1) How to store the image instead of the file name and what datatypes should I use? 2) How to retrieve images from the DB? My controller's code: ``` <?php clas...
2013/06/20
[ "https://Stackoverflow.com/questions/17223945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2506856/" ]
``` // uploading public function do_upload(){ ... $image_path=$this->upload->data(); $uploaded_image = $image_path['full_path']; // Read the file $fp = fopen($uploaded_image, 'r'); $data = fread($fp, filesize($uploaded_image)); $data = addslashes($data); fclose($fp); // here you can easy insert $data to 'a_photo' co...
Here's a quick something I use for small PNG thumbnails. These are stored in a table called "coreg" in a field named "IMAGE". The field-type is LONGBLOB. Every upload overwrites the previous image. In the actual app the view-file is displayed as an iframe: VIEW FILE FOR UPLOADING (better to use the CI specific form ta...
17,223,945
I am using a WAMP server, and I want to upload images in the database using CI.The image variable in database is of blob datatype. My question's as follows: 1) How to store the image instead of the file name and what datatypes should I use? 2) How to retrieve images from the DB? My controller's code: ``` <?php clas...
2013/06/20
[ "https://Stackoverflow.com/questions/17223945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2506856/" ]
``` // uploading public function do_upload(){ ... $image_path=$this->upload->data(); $uploaded_image = $image_path['full_path']; // Read the file $fp = fopen($uploaded_image, 'r'); $data = fread($fp, filesize($uploaded_image)); $data = addslashes($data); fclose($fp); // here you can easy insert $data to 'a_photo' co...
try this code controller:- ``` <?php class Profile extends CI_Controller { public function __construct() { parent::__construct(); $this->load->helper(array('form', 'url')); } public function index() { $this->load->view('profile', ...
17,223,945
I am using a WAMP server, and I want to upload images in the database using CI.The image variable in database is of blob datatype. My question's as follows: 1) How to store the image instead of the file name and what datatypes should I use? 2) How to retrieve images from the DB? My controller's code: ``` <?php clas...
2013/06/20
[ "https://Stackoverflow.com/questions/17223945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2506856/" ]
``` // uploading public function do_upload(){ ... $image_path=$this->upload->data(); $uploaded_image = $image_path['full_path']; // Read the file $fp = fopen($uploaded_image, 'r'); $data = fread($fp, filesize($uploaded_image)); $data = addslashes($data); fclose($fp); // here you can easy insert $data to 'a_photo' co...
view: ``` <?php echo form_open_multipart('profile/do_upload');?> <input type="file" name="userfile" size="20" /> <br /><br /> <input type="submit" value="upload" /> <img src="<?php echo $img ?>" width="300px" height="300px"> </form> ?> ```
281,433
``` selection= until [ "$selection" = "0" ]; do echo "" echo "PROGRAM MENU" echo "1 - display free disk space" echo "2 - display free memory" echo "" echo "0 - exit program" echo "" echo -n "Enter selection: " read selection echo "" case $selection in 1 ) df ;; 2 ) free ;; 0 ) ...
2016/05/06
[ "https://unix.stackexchange.com/questions/281433", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/169164/" ]
You can't. The selection is used by the case statement to decide what to do. It is not set by the case statement. You might want to try something like this instead: ``` selection= until [ "$selection" = "0" ]; do cmd='' echo "" echo "PROGRAM MENU" echo "1 - display free disk space" echo "2 - display free...
> > if i press 2 its showing free space and echo is showing 2 > but i need echo is "free" > > > So, currently `echo $selection` prints `2` for free and you want it to print `free`. In that case, replace: ``` 2 ) free ;; ``` With: ``` 2 ) free; selection=free ;; ``` With the variable `selection` set to t...
281,433
``` selection= until [ "$selection" = "0" ]; do echo "" echo "PROGRAM MENU" echo "1 - display free disk space" echo "2 - display free memory" echo "" echo "0 - exit program" echo "" echo -n "Enter selection: " read selection echo "" case $selection in 1 ) df ;; 2 ) free ;; 0 ) ...
2016/05/06
[ "https://unix.stackexchange.com/questions/281433", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/169164/" ]
You can't. The selection is used by the case statement to decide what to do. It is not set by the case statement. You might want to try something like this instead: ``` selection= until [ "$selection" = "0" ]; do cmd='' echo "" echo "PROGRAM MENU" echo "1 - display free disk space" echo "2 - display free...
Here is how I would do this. Might be helpful/instructive. ``` #!/bin/bash menu() { cat >&2 <<EOF PROGRAM MENU 1 - display free disk space 2 - display free memory 0 - exit program EOF } while true; do menu read -p "Enter selection: " selection case "$selection" in 1) echo df df ;; ...
1,057,853
After some automatic updates (or being hacked?) I have many things broken and a huge problem to resolve them since **I can't login as root anymore**. * ssh admin: login success * su root: permission denied (probably not the same password) What I have tried: * read log: but permission denied * use 'synopass' and empt...
2016/03/27
[ "https://superuser.com/questions/1057853", "https://superuser.com", "https://superuser.com/users/244725/" ]
Your Synology probably upgraded to DSM6, in which security has been hardened... In DSM6 you can no longer use root for SSH, but you can use any other member account of the administrators group. Mind that you now need to sudo when logged in using SSH. See the DSM6 release notes!
You can also just SSH using rsa keys, then you can SSH as root, even after installing DSM6, without making any additional changes.
1,057,853
After some automatic updates (or being hacked?) I have many things broken and a huge problem to resolve them since **I can't login as root anymore**. * ssh admin: login success * su root: permission denied (probably not the same password) What I have tried: * read log: but permission denied * use 'synopass' and empt...
2016/03/27
[ "https://superuser.com/questions/1057853", "https://superuser.com", "https://superuser.com/users/244725/" ]
Your Synology probably upgraded to DSM6, in which security has been hardened... In DSM6 you can no longer use root for SSH, but you can use any other member account of the administrators group. Mind that you now need to sudo when logged in using SSH. See the DSM6 release notes!
If you're still with DSM Version 5, you might have logged in as admin instead of root. This makes a difference, even though root and admin share the same password. To solve, do ``` ssh root@synology.local ``` with using the admin password. This will log you in as root, with root access.
1,057,853
After some automatic updates (or being hacked?) I have many things broken and a huge problem to resolve them since **I can't login as root anymore**. * ssh admin: login success * su root: permission denied (probably not the same password) What I have tried: * read log: but permission denied * use 'synopass' and empt...
2016/03/27
[ "https://superuser.com/questions/1057853", "https://superuser.com", "https://superuser.com/users/244725/" ]
Your Synology probably upgraded to DSM6, in which security has been hardened... In DSM6 you can no longer use root for SSH, but you can use any other member account of the administrators group. Mind that you now need to sudo when logged in using SSH. See the DSM6 release notes!
In DSM Version 6 you can still login as root when using RSA keys. Therefore just copy your public key as admin to your Synolgy: ``` $ cat ~/.ssh/id_rsa.pub | ssh admin@192.168.1.10 'umask 077; cat >>/tmp/authorized_keys' ``` After that login to your Synology as admin and become root: ``` $ ssh admin@192.168.1.10 ad...
1,057,853
After some automatic updates (or being hacked?) I have many things broken and a huge problem to resolve them since **I can't login as root anymore**. * ssh admin: login success * su root: permission denied (probably not the same password) What I have tried: * read log: but permission denied * use 'synopass' and empt...
2016/03/27
[ "https://superuser.com/questions/1057853", "https://superuser.com", "https://superuser.com/users/244725/" ]
If your synology is in DSM6 and you're logged with a user part of administrator group, you can do : **sudo -i** enter your root/admin password or even **sudo su -** (it works to) now you're root tadaaa
You can also just SSH using rsa keys, then you can SSH as root, even after installing DSM6, without making any additional changes.
1,057,853
After some automatic updates (or being hacked?) I have many things broken and a huge problem to resolve them since **I can't login as root anymore**. * ssh admin: login success * su root: permission denied (probably not the same password) What I have tried: * read log: but permission denied * use 'synopass' and empt...
2016/03/27
[ "https://superuser.com/questions/1057853", "https://superuser.com", "https://superuser.com/users/244725/" ]
If your synology is in DSM6 and you're logged with a user part of administrator group, you can do : **sudo -i** enter your root/admin password or even **sudo su -** (it works to) now you're root tadaaa
If you're still with DSM Version 5, you might have logged in as admin instead of root. This makes a difference, even though root and admin share the same password. To solve, do ``` ssh root@synology.local ``` with using the admin password. This will log you in as root, with root access.
1,057,853
After some automatic updates (or being hacked?) I have many things broken and a huge problem to resolve them since **I can't login as root anymore**. * ssh admin: login success * su root: permission denied (probably not the same password) What I have tried: * read log: but permission denied * use 'synopass' and empt...
2016/03/27
[ "https://superuser.com/questions/1057853", "https://superuser.com", "https://superuser.com/users/244725/" ]
If your synology is in DSM6 and you're logged with a user part of administrator group, you can do : **sudo -i** enter your root/admin password or even **sudo su -** (it works to) now you're root tadaaa
In DSM Version 6 you can still login as root when using RSA keys. Therefore just copy your public key as admin to your Synolgy: ``` $ cat ~/.ssh/id_rsa.pub | ssh admin@192.168.1.10 'umask 077; cat >>/tmp/authorized_keys' ``` After that login to your Synology as admin and become root: ``` $ ssh admin@192.168.1.10 ad...
1,057,853
After some automatic updates (or being hacked?) I have many things broken and a huge problem to resolve them since **I can't login as root anymore**. * ssh admin: login success * su root: permission denied (probably not the same password) What I have tried: * read log: but permission denied * use 'synopass' and empt...
2016/03/27
[ "https://superuser.com/questions/1057853", "https://superuser.com", "https://superuser.com/users/244725/" ]
In DSM Version 6 you can still login as root when using RSA keys. Therefore just copy your public key as admin to your Synolgy: ``` $ cat ~/.ssh/id_rsa.pub | ssh admin@192.168.1.10 'umask 077; cat >>/tmp/authorized_keys' ``` After that login to your Synology as admin and become root: ``` $ ssh admin@192.168.1.10 ad...
You can also just SSH using rsa keys, then you can SSH as root, even after installing DSM6, without making any additional changes.
1,057,853
After some automatic updates (or being hacked?) I have many things broken and a huge problem to resolve them since **I can't login as root anymore**. * ssh admin: login success * su root: permission denied (probably not the same password) What I have tried: * read log: but permission denied * use 'synopass' and empt...
2016/03/27
[ "https://superuser.com/questions/1057853", "https://superuser.com", "https://superuser.com/users/244725/" ]
In DSM Version 6 you can still login as root when using RSA keys. Therefore just copy your public key as admin to your Synolgy: ``` $ cat ~/.ssh/id_rsa.pub | ssh admin@192.168.1.10 'umask 077; cat >>/tmp/authorized_keys' ``` After that login to your Synology as admin and become root: ``` $ ssh admin@192.168.1.10 ad...
If you're still with DSM Version 5, you might have logged in as admin instead of root. This makes a difference, even though root and admin share the same password. To solve, do ``` ssh root@synology.local ``` with using the admin password. This will log you in as root, with root access.
130,727
I know this has been attempted many times before: Here [Transfer points between sites](https://meta.stackexchange.com/questions/34860/transfer-points-between-sites), here [Should SO rep be considered in SU and SF?](https://meta.stackexchange.com/questions/15117/should-so-rep-be-considered-in-su-and-sf), here too [Wh...
2012/04/29
[ "https://meta.stackexchange.com/questions/130727", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/180987/" ]
> > The fact that there are so many posts about it shows that there is a true desire for a transferring reputation from site to site. > > > Yup. Coupled with, > > My idea is to setup another "currency" lets call it "bounty credit" > > > ...the mistaken idea that reputation is in any significant way *a curren...
Once upon a time there was a site called experts exchange. They started out offering Q&A for free. Then they started charging. So to get help, to get that knowledge out of people's heads, required cold hard cash. Jeff and Joel when they started SO did so [with the express intention of not being experts exchange.](http...
130,727
I know this has been attempted many times before: Here [Transfer points between sites](https://meta.stackexchange.com/questions/34860/transfer-points-between-sites), here [Should SO rep be considered in SU and SF?](https://meta.stackexchange.com/questions/15117/should-so-rep-be-considered-in-su-and-sf), here too [Wh...
2012/04/29
[ "https://meta.stackexchange.com/questions/130727", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/180987/" ]
> > The fact that there are so many posts about it shows that there is a true desire for a transferring reputation from site to site. > > > Yup. Coupled with, > > My idea is to setup another "currency" lets call it "bounty credit" > > > ...the mistaken idea that reputation is in any significant way *a curren...
I started a bounty today on Skeptics, on a [question](https://skeptics.stackexchange.com/q/7750/5142) that I really want to know the answer to. The 50 rep bounty may seem quite insignificant, but it did lose me three privileges on the site (create chat rooms, edit community wiki, and ironically set bounties) and it cou...
130,727
I know this has been attempted many times before: Here [Transfer points between sites](https://meta.stackexchange.com/questions/34860/transfer-points-between-sites), here [Should SO rep be considered in SU and SF?](https://meta.stackexchange.com/questions/15117/should-so-rep-be-considered-in-su-and-sf), here too [Wh...
2012/04/29
[ "https://meta.stackexchange.com/questions/130727", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/180987/" ]
I started a bounty today on Skeptics, on a [question](https://skeptics.stackexchange.com/q/7750/5142) that I really want to know the answer to. The 50 rep bounty may seem quite insignificant, but it did lose me three privileges on the site (create chat rooms, edit community wiki, and ironically set bounties) and it cou...
Once upon a time there was a site called experts exchange. They started out offering Q&A for free. Then they started charging. So to get help, to get that knowledge out of people's heads, required cold hard cash. Jeff and Joel when they started SO did so [with the express intention of not being experts exchange.](http...
59,241,490
Here is my spreadsheet for testing purposes: <https://docs.google.com/spreadsheets/d/1m8_ck9hvxIXohMjGBTX17uvOui0P4KjsTwF8M72MSFg/edit?usp=sharing> What I am trying to do is find all values > 15 in a 2D range in the spreadsheet tab "InvoiceBackup", then list their order numbers and prices on a separate tab. I used Log...
2019/12/09
[ "https://Stackoverflow.com/questions/59241490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12465806/" ]
You need to use `AddIdentity` instead of `AddDefaultIdentity` if you would like to set by `ConfigureApplicationCookie`. ``` services.AddIdentity<IdentityUser,IdentityRole>() //.AddDefaultUI(UIFramework.Bootstrap4) .AddEntityFrameworkStores<ApplicationDbContext>() .AddDefaultTokenPro...
I had a similar problem and the only thing that solved it was using creating a `PathString` instead of using an string for any path. ``` options.LoginPath = new PathString("/Home/Index"); ```
1,390,047
I couldn't solve this equation. Could you help me to solve this step by step. Thank you. $$\sqrt[4]{\frac{8^x}{8}}=\sqrt[3]{16}$$
2015/08/08
[ "https://math.stackexchange.com/questions/1390047", "https://math.stackexchange.com", "https://math.stackexchange.com/users/258415/" ]
\begin{align} \sqrt[4]{8^{x} \times \frac{1}{8}} &= \sqrt[3]{16} \\ \sqrt[4]{8^{x-1}} &= \sqrt[3]{16} \\ 8^{x-1} &= \left( \sqrt[3]{16} \right)^{4} \\ 8^{x-1} &= 16^{\frac{4}{3}} \\ 2^{3x-3} &= 2^{\frac{16}{3}} \\ 3x-3 &= \frac{16}{3} \quad \to \quad 3x = \frac{16}{3} +3 \quad \to \quad x = 1+\frac{16}{9} \quad \t...
$$2^{(3x-3)/4}=2^{4/3}$$ $$9x-9=16$$ $$x=25/9$$
50,768,023
Okie dokie, I'm trying to get Google's Dialogflow python API working with Google App Engine, and I seem to be running into issues when I run the application. I have pip installed dialogflow to a lib folder and added the lib folder through the app.yaml file. I keep running into an error where it says that it can't find...
2018/06/08
[ "https://Stackoverflow.com/questions/50768023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9915619/" ]
Okay, this is what I've come up with. It doesn't literally let me know when the slider is released, but it tells me when the player stops editing the slider. It still sends an alert if you pause briefly, but that is okay for my game. It doesn't send continuous alerts like if you just use \_on\_HSlider\_value\_changed()...
You can achieve what you want by overriding the \_gui\_input function. Attach a script to your slider, and then add this code: ``` func _gui_input(event): if (event is InputEventMouseButton) && !event.pressed && (event.button_index == BUTTON_LEFT): print("Released") ``` This will work whether the user re...
7,386,072
My case scenario passes parameter to a procedure, that only does an insert. But two threads might try to pass the same value. How to handle this situation w/out throwing an exception and with least amount of locks? My performance requirement is at least 10k inserts per second. **EDIT:** Column is unique. Timestamp ...
2011/09/12
[ "https://Stackoverflow.com/questions/7386072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/546051/" ]
Create index on table with ignore duplicate key option. It will not insert duplicate row and also won't through any error. E.g. ``` create unique index i1 on #tmp(id) with ignore_dup_key insert into #tmp values(1,"A") 2> go (1 row affected) 1> insert into #tmp values(1,"A") 2> go Duplicate key was ignored. (0 rows ...
Try the [MERGE](http://technet.microsoft.com/en-us/library/bb510625.aspx) statement From MSDN . A common scenario is updating one or more columns in a table if a matching row exists, or inserting the data as a new row if a matching row does not exist. This is usually done by passing parameters to a stored procedure th...
7,386,072
My case scenario passes parameter to a procedure, that only does an insert. But two threads might try to pass the same value. How to handle this situation w/out throwing an exception and with least amount of locks? My performance requirement is at least 10k inserts per second. **EDIT:** Column is unique. Timestamp ...
2011/09/12
[ "https://Stackoverflow.com/questions/7386072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/546051/" ]
Create index on table with ignore duplicate key option. It will not insert duplicate row and also won't through any error. E.g. ``` create unique index i1 on #tmp(id) with ignore_dup_key insert into #tmp values(1,"A") 2> go (1 row affected) 1> insert into #tmp values(1,"A") 2> go Duplicate key was ignored. (0 rows ...
As **@Martin Smith** has pointed out there is good solution - even though it is contrary to my question, it has good reasoning behind that seems well supported. The original answer you can find [here](https://stackoverflow.com/questions/3407857/only-inserting-a-row-if-its-not-already-there/3408196#3408196) posted by **...
23,651,982
When user click on notification I want to start an Activity and two Intent Service. Is it possible to do ? If yes Please can any one give me the idea to do this ? Suppose I have no control on Activity. The Activity belongs to third party app. Please don't tell me that start intent service from your Activity . I kn...
2014/05/14
[ "https://Stackoverflow.com/questions/23651982", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2020622/" ]
Follow the steps Hope this helps you 1) Create a BroadCastReceiver ``` public class MyBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { // Start Activity // Start Services } } ``` 2) Just Fire Broadcast on notification clic...
The answer given by Biraj will also do the job. But for that You have to declare the BroadcastReceiver in your manifest file as well as all activity and services which you are starting from BroadcastReceiver. So I have not choosen the above way. How I have implemented ? I have started an Intent service from where...
3,711,165
The problem is [![enter image description here](https://i.stack.imgur.com/8Mn6d.png)](https://i.stack.imgur.com/8Mn6d.png) I have been able to prove $left hand \rightarrow composite$, but I haven't be able to prove the reverse direction, so if you could point to me in the right direction via hint, I would really app...
2020/06/08
[ "https://math.stackexchange.com/questions/3711165", "https://math.stackexchange.com", "https://math.stackexchange.com/users/414214/" ]
You know there is $N$ such that $\forall n \ge N$ you have $d(x\_n, x) <1/2$ and you know that this implies $x\_n=x$ because the metric is discrete. Thus you proved that not only $x\_N=x$, but that FOR ALL $n \ge N$ it happens that $x\_n=x$. If the sequence is eventually constant, then it literally means that there ar...
Dude, as u said earlier $x\_n$ converging to $x$. Now in discrete metric (or in any metric) $d(x,y)=0$ iff $x=y$ hence now for all $n\geq N$ $d(x\_{n},x)<1/2$ so in this discrete metric $d(x,y)=1$ or $0$ so $d(x\_n,x)=0$ so $x\_n=x$ for all $n\geq N$
3,711,165
The problem is [![enter image description here](https://i.stack.imgur.com/8Mn6d.png)](https://i.stack.imgur.com/8Mn6d.png) I have been able to prove $left hand \rightarrow composite$, but I haven't be able to prove the reverse direction, so if you could point to me in the right direction via hint, I would really app...
2020/06/08
[ "https://math.stackexchange.com/questions/3711165", "https://math.stackexchange.com", "https://math.stackexchange.com/users/414214/" ]
You know there is $N$ such that $\forall n \ge N$ you have $d(x\_n, x) <1/2$ and you know that this implies $x\_n=x$ because the metric is discrete. Thus you proved that not only $x\_N=x$, but that FOR ALL $n \ge N$ it happens that $x\_n=x$. If the sequence is eventually constant, then it literally means that there ar...
Let $x\_n$ be a sequence of points of the metric space, converging to a point $x$. By definition of converging sequence, that means that for every $\epsilon$ you fixed, greater than $0$, you can find a positive integer $N\_{\epsilon}$ such that $d(x\_n,x)<\epsilon$ for all indexes $n$ greater than $N\_{\epsilon}$. That...
3,711,165
The problem is [![enter image description here](https://i.stack.imgur.com/8Mn6d.png)](https://i.stack.imgur.com/8Mn6d.png) I have been able to prove $left hand \rightarrow composite$, but I haven't be able to prove the reverse direction, so if you could point to me in the right direction via hint, I would really app...
2020/06/08
[ "https://math.stackexchange.com/questions/3711165", "https://math.stackexchange.com", "https://math.stackexchange.com/users/414214/" ]
Let $x\_n$ be a sequence of points of the metric space, converging to a point $x$. By definition of converging sequence, that means that for every $\epsilon$ you fixed, greater than $0$, you can find a positive integer $N\_{\epsilon}$ such that $d(x\_n,x)<\epsilon$ for all indexes $n$ greater than $N\_{\epsilon}$. That...
Dude, as u said earlier $x\_n$ converging to $x$. Now in discrete metric (or in any metric) $d(x,y)=0$ iff $x=y$ hence now for all $n\geq N$ $d(x\_{n},x)<1/2$ so in this discrete metric $d(x,y)=1$ or $0$ so $d(x\_n,x)=0$ so $x\_n=x$ for all $n\geq N$
31,707,629
The following code was taken from an [Arduino tutorial on smoothing](http://playground.arduino.cc/Main/Smooth): ``` int smooth(int data, float filterVal, float smoothedVal) { if (filterVal > 1) { filterVal = .99; } else if (filterVal <= 0) { filterVal = 0; } smoothedVal = (data * (1 - filterVal)) ...
2015/07/29
[ "https://Stackoverflow.com/questions/31707629", "https://Stackoverflow.com", "https://Stackoverflow.com/users/401828/" ]
A simple technique is scaling up by multiplying the input value with for example `10000` and putting that result in an `int`, do the calculations in `int`, and then scale the output back into a `float` by dividing with the same factor. In your function you then also need scale up everything with that same factor. The...
``` // ------------------------------------------------------------------ // SMOOTHING WITH INTEGER VARIABLES (CSHARP) // ------------------------------------------------------------------ Int32 Storage; Int32 SmoothingINT(Int32 NewValue, Int32 Divisor) { Int32 AvgValue; // ------------------------- Compu...
18,371,653
``` class switch1 { public static void main(String args[]) { int a = 10; switch(a) { default: System.out.println("Default"); case -1: System.out.println("-1"); } } } ``` I understand that this program will execute both "default" and "case -1" stateme...
2013/08/22
[ "https://Stackoverflow.com/questions/18371653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2532299/" ]
As for a., requiring the use of `break` allows shorthand notation where common code can be placed at the bottom block. This may make code more readable in some cases. See "[Switch statement fallthrough in C#?](https://stackoverflow.com/questions/174155/switch-statement-fallthrough-in-c?lq=1)" for more information on f...
a) Why fall-through / required break in switch? The fall-through behavior is useful in some cases, but the problem is that it's extra work in the common case. Therefore it's reasonable to expect that the "break" keyword would not be required in a more modern language So why is it there? To match the behavior of C++ (...
18,371,653
``` class switch1 { public static void main(String args[]) { int a = 10; switch(a) { default: System.out.println("Default"); case -1: System.out.println("-1"); } } } ``` I understand that this program will execute both "default" and "case -1" stateme...
2013/08/22
[ "https://Stackoverflow.com/questions/18371653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2532299/" ]
> > a) why does a switch statement relies heavily on a break statement to achieve its purpose ? > > > Because that's the way they defined it. It's copied from C. Pascal doesn't have fall-through, so it doesn't have break either. It also has case ranges, which Java lacks. Languages are allowed to be different. Or t...
a) Why fall-through / required break in switch? The fall-through behavior is useful in some cases, but the problem is that it's extra work in the common case. Therefore it's reasonable to expect that the "break" keyword would not be required in a more modern language So why is it there? To match the behavior of C++ (...
18,371,653
``` class switch1 { public static void main(String args[]) { int a = 10; switch(a) { default: System.out.println("Default"); case -1: System.out.println("-1"); } } } ``` I understand that this program will execute both "default" and "case -1" stateme...
2013/08/22
[ "https://Stackoverflow.com/questions/18371653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2532299/" ]
The break statements are necessary because without them, statements in switch blocks fall through: All statements after the matching case label are executed in sequence, regardless of the expression of subsequent case labels, until a break statement is encountered. check this documentation : <http://docs.oracle.com/ja...
**In Switch case the point of interest is the break statement.** > > Each break statement terminates the enclosing switch statement. > Control flow continues with the first statement following the switch > block. The break statements are necessary because without them, > statements in switch blocks fall through: ...
18,371,653
``` class switch1 { public static void main(String args[]) { int a = 10; switch(a) { default: System.out.println("Default"); case -1: System.out.println("-1"); } } } ``` I understand that this program will execute both "default" and "case -1" stateme...
2013/08/22
[ "https://Stackoverflow.com/questions/18371653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2532299/" ]
Sometimes you need multiple cases to execute the same function. For example, I am letting a user specify either mode 1 or mode 32 to represent 32-bit mode, and mode 2 or mode 64 for 64-bit mode. ``` switch (input) { case 1: case 32: /* Do 32-bit related code */ break; case 2: case 64: ...
`switch` statements without `break`s let you do things like this: ``` // Compute the most significant bit set in a number from 0 to 7 int topBit = -1; switch(n) { case 0: topBit = 0; break; case 1: topBit = 1; break; case 2: case 3: topBit = 2; break; case 4: case 5: case 6: case 7: topBit ...
18,371,653
``` class switch1 { public static void main(String args[]) { int a = 10; switch(a) { default: System.out.println("Default"); case -1: System.out.println("-1"); } } } ``` I understand that this program will execute both "default" and "case -1" stateme...
2013/08/22
[ "https://Stackoverflow.com/questions/18371653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2532299/" ]
Sometimes you need multiple cases to execute the same function. For example, I am letting a user specify either mode 1 or mode 32 to represent 32-bit mode, and mode 2 or mode 64 for 64-bit mode. ``` switch (input) { case 1: case 32: /* Do 32-bit related code */ break; case 2: case 64: ...
**In Switch case the point of interest is the break statement.** > > Each break statement terminates the enclosing switch statement. > Control flow continues with the first statement following the switch > block. The break statements are necessary because without them, > statements in switch blocks fall through: ...
18,371,653
``` class switch1 { public static void main(String args[]) { int a = 10; switch(a) { default: System.out.println("Default"); case -1: System.out.println("-1"); } } } ``` I understand that this program will execute both "default" and "case -1" stateme...
2013/08/22
[ "https://Stackoverflow.com/questions/18371653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2532299/" ]
Sometimes you need multiple cases to execute the same function. For example, I am letting a user specify either mode 1 or mode 32 to represent 32-bit mode, and mode 2 or mode 64 for 64-bit mode. ``` switch (input) { case 1: case 32: /* Do 32-bit related code */ break; case 2: case 64: ...
From the [Java Language Specification section on the `break` statement](http://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html#jls-14.15): > > A break statement transfers control out of an enclosing statement. > > > and... > > a break statement ... always completes abruptly > > > a) It simply allows t...
18,371,653
``` class switch1 { public static void main(String args[]) { int a = 10; switch(a) { default: System.out.println("Default"); case -1: System.out.println("-1"); } } } ``` I understand that this program will execute both "default" and "case -1" stateme...
2013/08/22
[ "https://Stackoverflow.com/questions/18371653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2532299/" ]
`switch` statements without `break`s let you do things like this: ``` // Compute the most significant bit set in a number from 0 to 7 int topBit = -1; switch(n) { case 0: topBit = 0; break; case 1: topBit = 1; break; case 2: case 3: topBit = 2; break; case 4: case 5: case 6: case 7: topBit ...
The break statements are necessary because without them, statements in switch blocks fall through: All statements after the matching case label are executed in sequence, regardless of the expression of subsequent case labels, until a break statement is encountered. check this documentation : <http://docs.oracle.com/ja...
18,371,653
``` class switch1 { public static void main(String args[]) { int a = 10; switch(a) { default: System.out.println("Default"); case -1: System.out.println("-1"); } } } ``` I understand that this program will execute both "default" and "case -1" stateme...
2013/08/22
[ "https://Stackoverflow.com/questions/18371653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2532299/" ]
`switch` statements without `break`s let you do things like this: ``` // Compute the most significant bit set in a number from 0 to 7 int topBit = -1; switch(n) { case 0: topBit = 0; break; case 1: topBit = 1; break; case 2: case 3: topBit = 2; break; case 4: case 5: case 6: case 7: topBit ...
As for a., requiring the use of `break` allows shorthand notation where common code can be placed at the bottom block. This may make code more readable in some cases. See "[Switch statement fallthrough in C#?](https://stackoverflow.com/questions/174155/switch-statement-fallthrough-in-c?lq=1)" for more information on f...
18,371,653
``` class switch1 { public static void main(String args[]) { int a = 10; switch(a) { default: System.out.println("Default"); case -1: System.out.println("-1"); } } } ``` I understand that this program will execute both "default" and "case -1" stateme...
2013/08/22
[ "https://Stackoverflow.com/questions/18371653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2532299/" ]
`switch` statements without `break`s let you do things like this: ``` // Compute the most significant bit set in a number from 0 to 7 int topBit = -1; switch(n) { case 0: topBit = 0; break; case 1: topBit = 1; break; case 2: case 3: topBit = 2; break; case 4: case 5: case 6: case 7: topBit ...
**In Switch case the point of interest is the break statement.** > > Each break statement terminates the enclosing switch statement. > Control flow continues with the first statement following the switch > block. The break statements are necessary because without them, > statements in switch blocks fall through: ...
18,371,653
``` class switch1 { public static void main(String args[]) { int a = 10; switch(a) { default: System.out.println("Default"); case -1: System.out.println("-1"); } } } ``` I understand that this program will execute both "default" and "case -1" stateme...
2013/08/22
[ "https://Stackoverflow.com/questions/18371653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2532299/" ]
`switch` statements without `break`s let you do things like this: ``` // Compute the most significant bit set in a number from 0 to 7 int topBit = -1; switch(n) { case 0: topBit = 0; break; case 1: topBit = 1; break; case 2: case 3: topBit = 2; break; case 4: case 5: case 6: case 7: topBit ...
If you add break to a loop, it cancels out of the loop. so for a switch statement it goes to the correct case and once it is there it carries out the code until the `break` where it will then exit the switch statemnt. If you removed the break it would carry on to the next `case` and until is sees a break. If there are ...
19,849,858
I'm working on a program that is supposed to sort a vector of ints and then get passed to a recursive function to remove any duplicates by having an element check it's neighbor, and remove it if they're the same. Here is my code: ``` #include<iostream> #include<vector> #include<algorithm> using namespace std; void ch...
2013/11/08
[ "https://Stackoverflow.com/questions/19849858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2320914/" ]
You have commented out `return`s completely except the recursive call. The functions go on although it should not. You should use `return checkNum(v, n);` on those lines. Edit: Your code is completely flawed and won't do what you want. Here is a quick ugly code of how you should be doing it while you stick to limita...
Ok got it to work. You need to add a return after the line, cout << "No duplicates found" like: ``` if (i == v.size()) { cout << "No duplicates found." << endl; return; // add this return } ``` The reason is that by the time the recursive call reaches this point in the program, you are done checking for duplic...
72,283,127
I am implementing a variant of the the ants algorithm in a discrete 2d grid. The design is similar to how Reinforcement Learning environments work, where there is a `state` variable, and `action(s)` to transition the environment from one state to another. The state of the environment is the integer values of how many t...
2022/05/18
[ "https://Stackoverflow.com/questions/72283127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13683123/" ]
In the case *you only need the inputs* that were provided to `step 1 [setup]` to be passed to `step 3 [finish]` you should be able to access the *Execution Input* via the Context Object as described in my answer here: <https://stackoverflow.com/a/71230038/4526019> --- If `step 3 [finish]` needs the input to `step 1 ...
Not exactly sure why, but using `ResultPath` in both my step1 and step2 worked. So something like ``` stateMachine: { StartAt: 'setup', States: { setup: { Type: 'Task', TimeoutSeconds: 3600, Retry: [ { ErrorEquals: ['States.ALL'], MaxAttempts: 2, ...
15,186,541
I was asked this question in an interview recently. > > Given an input file, a regex and an output file. Read the input file, match each line to the regex and write the matching lines to an output file. > > > I came up with the rough scheme of using a BufferedReader chained to a FileReader (to optimize Reads fr...
2013/03/03
[ "https://Stackoverflow.com/questions/15186541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2107162/" ]
I think that the interviewer was looking for a solution that performs reading/regex checking in parallel with writing the output. If you set up a work queue that you fill asynchronously by reading and filtering, and put writing in a separate thread, then the combined process would take five seconds per line, starting w...
Well since the time for a read is fixed and the time for a write is fixed, the only option you have in this case is to change the nature of the regex bit. You could write code to apply the regex test quickly without the overhead of all the clever things that regex can do. If on the other hand the problem is that each...
15,186,541
I was asked this question in an interview recently. > > Given an input file, a regex and an output file. Read the input file, match each line to the regex and write the matching lines to an output file. > > > I came up with the rough scheme of using a BufferedReader chained to a FileReader (to optimize Reads fr...
2013/03/03
[ "https://Stackoverflow.com/questions/15186541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2107162/" ]
I think that the interviewer was looking for a solution that performs reading/regex checking in parallel with writing the output. If you set up a work queue that you fill asynchronously by reading and filtering, and put writing in a separate thread, then the combined process would take five seconds per line, starting w...
Tough question, since we don't no much about the system. My guess would be using threads/ async processing. Use one Thread to read and one to process an two or more for writing, thus reducing the time spent for IO Wait. Let my try to convert this into an ASCII Chart: * R/r means reading (3 Sec) * P/p means process...
303,130
I have a form on my wordpress page template -- ``` <form id="pollyform" method="post"> <textarea name="pollytext" id="text"></textarea> <input type="submit" id="savetext" name="savetext" value="save-text" /> </form> ``` I am trying to get the data from my textarea field and send to my script -- ``` $(document).rea...
2018/05/09
[ "https://wordpress.stackexchange.com/questions/303130", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/24067/" ]
It's in the post meta table (usually `wp_postmeta`), with the page id in post\_id, meta\_key with `_wp_page_template` and meta\_value with the template file name.
Example select query: ```sql SELECT * FROM wp_postmeta WHERE meta_key = '_wp_page_template' # AND post_id = 50 ``` Example update query: ```sql UPDATE wp_postmeta SET meta_value = 'templates/template-example.php' WHERE meta_key = '_wp_page_template' AND post_id = 50; ```
7,336,667
I've got an extension to this question: [How to deal with Form Collection on Symfony2 Beta?](https://stackoverflow.com/questions/5894570/how-to-deal-with-form-collection-on-symfony2-beta "How to deal with Form Collection on Symfony2 Beta?") - My project is similar, but the objects are nested deeper. I've got Articles w...
2011/09/07
[ "https://Stackoverflow.com/questions/7336667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/468744/" ]
Iterate through all content's media: ``` <form action="{{ path('article_create') }}" method="post" {{ form_enctype(form) }}> {{ form_widget(form) }} {% for content in form.contents %} {% for media in content.medias %} {{ form_widget(media) }} {% endfor %} {% endfor %} <p> ...
``` <form action="{{ path('article_create') }}" method="post" {{ form_enctype(form) }}> {% for media in form.contents.medias.children %} {{ form_widget(media) }} {% endfor %} {{ form_rest(form) }} <p> <button type="submit">Create</button> </p> </form> ```
21,398,869
I have written the following code. The whole thing was working fine until i added the following HTML in my PHP code. ``` echo " <div class='fpd-product' title='$name' data-thumbnail='$base_image_loc'> "; ``` If i remove this HTML(div), it fetches all the record from database and echo them, ...
2014/01/28
[ "https://Stackoverflow.com/questions/21398869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2541348/" ]
your echo statement should look like this ``` echo "<div class='fpd-product' title='".$name."' data-thumbnail='".$base_image_loc."'>"; ``` and where is div close? or you can do with html like this ``` <div class='fpd-product' title='<?php echo $name; ?>' data-thumbnail='<?php echo $base_image_loc; ?>'> ``` and c...
Change your echo statement ``` echo "<div class='fpd-product' title=".$name." data-thumbnail=".$base_image_loc.">"; ``` and close the div, end of the code ``` echo "</div>"; ```
21,398,869
I have written the following code. The whole thing was working fine until i added the following HTML in my PHP code. ``` echo " <div class='fpd-product' title='$name' data-thumbnail='$base_image_loc'> "; ``` If i remove this HTML(div), it fetches all the record from database and echo them, ...
2014/01/28
[ "https://Stackoverflow.com/questions/21398869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2541348/" ]
your echo statement should look like this ``` echo "<div class='fpd-product' title='".$name."' data-thumbnail='".$base_image_loc."'>"; ``` and where is div close? or you can do with html like this ``` <div class='fpd-product' title='<?php echo $name; ?>' data-thumbnail='<?php echo $base_image_loc; ?>'> ``` and c...
For debugging such problems, you have to check the HTML source code (rightclick in browser -> view source). If you see all records there, it is a problem purely with HTML; that means you should first use an HTML validator before anything else.
21,398,869
I have written the following code. The whole thing was working fine until i added the following HTML in my PHP code. ``` echo " <div class='fpd-product' title='$name' data-thumbnail='$base_image_loc'> "; ``` If i remove this HTML(div), it fetches all the record from database and echo them, ...
2014/01/28
[ "https://Stackoverflow.com/questions/21398869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2541348/" ]
You need a `</div>` here: ``` while($image_query_fetch= mysql_fetch_array($image_query_run)) { $image_location= $image_query_fetch['images']; $image_name= $image_query_fetch['name']; } echo "</div>"; ```
Change your echo statement ``` echo "<div class='fpd-product' title=".$name." data-thumbnail=".$base_image_loc.">"; ``` and close the div, end of the code ``` echo "</div>"; ```
21,398,869
I have written the following code. The whole thing was working fine until i added the following HTML in my PHP code. ``` echo " <div class='fpd-product' title='$name' data-thumbnail='$base_image_loc'> "; ``` If i remove this HTML(div), it fetches all the record from database and echo them, ...
2014/01/28
[ "https://Stackoverflow.com/questions/21398869", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2541348/" ]
You need a `</div>` here: ``` while($image_query_fetch= mysql_fetch_array($image_query_run)) { $image_location= $image_query_fetch['images']; $image_name= $image_query_fetch['name']; } echo "</div>"; ```
For debugging such problems, you have to check the HTML source code (rightclick in browser -> view source). If you see all records there, it is a problem purely with HTML; that means you should first use an HTML validator before anything else.
35,545,137
``` form: ControlGroup childForm1: ControlGroup childForm2: ControlGroup childForm3: ControlGroup constructor(fb: FormBuilder) { this.form = fb.group({ name: [''], childForm1: fb.group({ child1: [''], child2: [''] }), childForm2: fb.group({ child3: [''], ...
2016/02/22
[ "https://Stackoverflow.com/questions/35545137", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2000548/" ]
Before init, I want to share a free tool (chrome app) very useful during this type of works: [DHC Rest Client](https://chrome.google.com/webstore/detail/dhc-rest-client/aejoelaoggembcahagimdiliamlcdmfm?utm_source=chrome-ntp-icon) : with this tool you can verify if your parameters, headers and your upload files work wit...
Using [@alessandro-ornano](https://stackoverflow.com/a/35559587/2752041)'s answer I was able to make an upload signed request using `multipartFormData`: ``` func uploadProfilePicture(photo: UIImage, callback: apiCallback){ guard let userId = _loggedInUser?["pk"].int else { callback(Response(success: false,...
3,309,614
Say I have a struct defined somewhere deep in low-level code used all over the place in the most crazy and unknown ways: ``` struct T { unsigned short name_len; char d_name[LENGTH]; } ``` With accompanying functions that fill d\_name with whatever needs to be put there, like ``` struct T* fill( somethingOrO...
2010/07/22
[ "https://Stackoverflow.com/questions/3309614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/256138/" ]
If T really is used all over the place in crazy and unknown ways, then a change like that is likely to break something. Somewhere there will be a piece of code that has a local declaration of T instead of using your header file, or casts a 'mystruct \*' to a 'T \*', or something equally repugnant.
Yes- when you use an opaque pointer like that, then it is irrelevant of the contents. As long as your users only ever used the opaque pointers, you can muck around with the struct and it's implementation all you like.
3,309,614
Say I have a struct defined somewhere deep in low-level code used all over the place in the most crazy and unknown ways: ``` struct T { unsigned short name_len; char d_name[LENGTH]; } ``` With accompanying functions that fill d\_name with whatever needs to be put there, like ``` struct T* fill( somethingOrO...
2010/07/22
[ "https://Stackoverflow.com/questions/3309614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/256138/" ]
It might make sense to extend your structs like this: ``` struct newT { struct T t; int newElement; ... } ``` Then you can safely use a newT pointer as a T pointer; the C standard guarantees that there is no padding before the first element of a struct.
Yes- when you use an opaque pointer like that, then it is irrelevant of the contents. As long as your users only ever used the opaque pointers, you can muck around with the struct and it's implementation all you like.
3,309,614
Say I have a struct defined somewhere deep in low-level code used all over the place in the most crazy and unknown ways: ``` struct T { unsigned short name_len; char d_name[LENGTH]; } ``` With accompanying functions that fill d\_name with whatever needs to be put there, like ``` struct T* fill( somethingOrO...
2010/07/22
[ "https://Stackoverflow.com/questions/3309614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/256138/" ]
As long as the code using this API only obtains `T` objects as pointers returned by the library, and does not declare them itself, `malloc` them itself (using `sizeof(struct T)`), or do anything else that depends on the size of the struct, then it should be fine. If the calling code accessed the contents of the struct,...
Yes- when you use an opaque pointer like that, then it is irrelevant of the contents. As long as your users only ever used the opaque pointers, you can muck around with the struct and it's implementation all you like.
3,309,614
Say I have a struct defined somewhere deep in low-level code used all over the place in the most crazy and unknown ways: ``` struct T { unsigned short name_len; char d_name[LENGTH]; } ``` With accompanying functions that fill d\_name with whatever needs to be put there, like ``` struct T* fill( somethingOrO...
2010/07/22
[ "https://Stackoverflow.com/questions/3309614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/256138/" ]
Yes- when you use an opaque pointer like that, then it is irrelevant of the contents. As long as your users only ever used the opaque pointers, you can muck around with the struct and it's implementation all you like.
Crazy and unknown is not good. The best bet is to scan through the codebase for struct T and examine how it is used, with the alternative approach of changing it and see if something breaks... If the code only uses opaque pointers, you should be on the safe side. If the code accesses the members, but doesn't do somethi...
3,309,614
Say I have a struct defined somewhere deep in low-level code used all over the place in the most crazy and unknown ways: ``` struct T { unsigned short name_len; char d_name[LENGTH]; } ``` With accompanying functions that fill d\_name with whatever needs to be put there, like ``` struct T* fill( somethingOrO...
2010/07/22
[ "https://Stackoverflow.com/questions/3309614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/256138/" ]
It might make sense to extend your structs like this: ``` struct newT { struct T t; int newElement; ... } ``` Then you can safely use a newT pointer as a T pointer; the C standard guarantees that there is no padding before the first element of a struct.
If T really is used all over the place in crazy and unknown ways, then a change like that is likely to break something. Somewhere there will be a piece of code that has a local declaration of T instead of using your header file, or casts a 'mystruct \*' to a 'T \*', or something equally repugnant.
3,309,614
Say I have a struct defined somewhere deep in low-level code used all over the place in the most crazy and unknown ways: ``` struct T { unsigned short name_len; char d_name[LENGTH]; } ``` With accompanying functions that fill d\_name with whatever needs to be put there, like ``` struct T* fill( somethingOrO...
2010/07/22
[ "https://Stackoverflow.com/questions/3309614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/256138/" ]
As long as the code using this API only obtains `T` objects as pointers returned by the library, and does not declare them itself, `malloc` them itself (using `sizeof(struct T)`), or do anything else that depends on the size of the struct, then it should be fine. If the calling code accessed the contents of the struct,...
If T really is used all over the place in crazy and unknown ways, then a change like that is likely to break something. Somewhere there will be a piece of code that has a local declaration of T instead of using your header file, or casts a 'mystruct \*' to a 'T \*', or something equally repugnant.
3,309,614
Say I have a struct defined somewhere deep in low-level code used all over the place in the most crazy and unknown ways: ``` struct T { unsigned short name_len; char d_name[LENGTH]; } ``` With accompanying functions that fill d\_name with whatever needs to be put there, like ``` struct T* fill( somethingOrO...
2010/07/22
[ "https://Stackoverflow.com/questions/3309614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/256138/" ]
If T really is used all over the place in crazy and unknown ways, then a change like that is likely to break something. Somewhere there will be a piece of code that has a local declaration of T instead of using your header file, or casts a 'mystruct \*' to a 'T \*', or something equally repugnant.
Crazy and unknown is not good. The best bet is to scan through the codebase for struct T and examine how it is used, with the alternative approach of changing it and see if something breaks... If the code only uses opaque pointers, you should be on the safe side. If the code accesses the members, but doesn't do somethi...
3,309,614
Say I have a struct defined somewhere deep in low-level code used all over the place in the most crazy and unknown ways: ``` struct T { unsigned short name_len; char d_name[LENGTH]; } ``` With accompanying functions that fill d\_name with whatever needs to be put there, like ``` struct T* fill( somethingOrO...
2010/07/22
[ "https://Stackoverflow.com/questions/3309614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/256138/" ]
It might make sense to extend your structs like this: ``` struct newT { struct T t; int newElement; ... } ``` Then you can safely use a newT pointer as a T pointer; the C standard guarantees that there is no padding before the first element of a struct.
Crazy and unknown is not good. The best bet is to scan through the codebase for struct T and examine how it is used, with the alternative approach of changing it and see if something breaks... If the code only uses opaque pointers, you should be on the safe side. If the code accesses the members, but doesn't do somethi...
3,309,614
Say I have a struct defined somewhere deep in low-level code used all over the place in the most crazy and unknown ways: ``` struct T { unsigned short name_len; char d_name[LENGTH]; } ``` With accompanying functions that fill d\_name with whatever needs to be put there, like ``` struct T* fill( somethingOrO...
2010/07/22
[ "https://Stackoverflow.com/questions/3309614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/256138/" ]
As long as the code using this API only obtains `T` objects as pointers returned by the library, and does not declare them itself, `malloc` them itself (using `sizeof(struct T)`), or do anything else that depends on the size of the struct, then it should be fine. If the calling code accessed the contents of the struct,...
Crazy and unknown is not good. The best bet is to scan through the codebase for struct T and examine how it is used, with the alternative approach of changing it and see if something breaks... If the code only uses opaque pointers, you should be on the safe side. If the code accesses the members, but doesn't do somethi...
23,483,086
There is a well known blog post going around on how to set a usb bluetooth 4 dongle to be an iBeacon. It boils down to this magical command: ``` sudo hcitool -i hci0 cmd 0x08 0x0008 1e 02 01 1a 1a ff 4c 00 02 15 e2 c5 6d b5 df fb 48 d2 b0 60 d0 f5 a7 10 96 e0 00 00 00 00 c5 00 00 00 00 00 00 00 00 00 00 00 00 00 ``` ...
2014/05/05
[ "https://Stackoverflow.com/questions/23483086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3606020/" ]
Late reply, but somebody might find this useful. I found it as I was looking around for solutions myself when using hcitool. If you use `hcitool cmd --help` it will tell you something like this `cmd <ogf> <ocf> ...`. It helps to look at the [Bluetooth Core Specification](https://www.bluetooth.org/docman/handlers/downl...
Check out [this answer](https://stackoverflow.com/a/22148306/1461050) to a similar question. It basically describes how you can download the giant [Bluetooth Core Spec](https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=229737) document, and read through all the commands that it offers you. You can use t...
23,483,086
There is a well known blog post going around on how to set a usb bluetooth 4 dongle to be an iBeacon. It boils down to this magical command: ``` sudo hcitool -i hci0 cmd 0x08 0x0008 1e 02 01 1a 1a ff 4c 00 02 15 e2 c5 6d b5 df fb 48 d2 b0 60 d0 f5 a7 10 96 e0 00 00 00 00 c5 00 00 00 00 00 00 00 00 00 00 00 00 00 ``` ...
2014/05/05
[ "https://Stackoverflow.com/questions/23483086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3606020/" ]
No. None of this answers is correct and clean. 1) BLE have a separate command set. "LE Set Advertising Data" command must be used (see 7.8.7 vol 2 part E). 2) LE Set Advertising Data is much complex than what explained above. There are at least 2 1-octet length fields, packet must be 32 bytes length, zero padded,...
Check out [this answer](https://stackoverflow.com/a/22148306/1461050) to a similar question. It basically describes how you can download the giant [Bluetooth Core Spec](https://www.bluetooth.org/docman/handlers/downloaddoc.ashx?doc_id=229737) document, and read through all the commands that it offers you. You can use t...
23,483,086
There is a well known blog post going around on how to set a usb bluetooth 4 dongle to be an iBeacon. It boils down to this magical command: ``` sudo hcitool -i hci0 cmd 0x08 0x0008 1e 02 01 1a 1a ff 4c 00 02 15 e2 c5 6d b5 df fb 48 d2 b0 60 d0 f5 a7 10 96 e0 00 00 00 00 c5 00 00 00 00 00 00 00 00 00 00 00 00 00 ``` ...
2014/05/05
[ "https://Stackoverflow.com/questions/23483086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3606020/" ]
Late reply, but somebody might find this useful. I found it as I was looking around for solutions myself when using hcitool. If you use `hcitool cmd --help` it will tell you something like this `cmd <ogf> <ocf> ...`. It helps to look at the [Bluetooth Core Specification](https://www.bluetooth.org/docman/handlers/downl...
It would appear you need to use two commands rather than one. The iBeacon data is contained in the "LE Set Advertising Data" data and has been mentioned elsewhere in this post. To see a BLE friendly name you can use an additional command "LE Set Scan Response Data", this requires the receiver to scan your device (rathe...
23,483,086
There is a well known blog post going around on how to set a usb bluetooth 4 dongle to be an iBeacon. It boils down to this magical command: ``` sudo hcitool -i hci0 cmd 0x08 0x0008 1e 02 01 1a 1a ff 4c 00 02 15 e2 c5 6d b5 df fb 48 d2 b0 60 d0 f5 a7 10 96 e0 00 00 00 00 c5 00 00 00 00 00 00 00 00 00 00 00 00 00 ``` ...
2014/05/05
[ "https://Stackoverflow.com/questions/23483086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3606020/" ]
No. None of this answers is correct and clean. 1) BLE have a separate command set. "LE Set Advertising Data" command must be used (see 7.8.7 vol 2 part E). 2) LE Set Advertising Data is much complex than what explained above. There are at least 2 1-octet length fields, packet must be 32 bytes length, zero padded,...
It would appear you need to use two commands rather than one. The iBeacon data is contained in the "LE Set Advertising Data" data and has been mentioned elsewhere in this post. To see a BLE friendly name you can use an additional command "LE Set Scan Response Data", this requires the receiver to scan your device (rathe...
316,879
I have a method in an objective-C class. It has 2 callback functions written in C. The class pointer i.e. `self` is passed to these functions as `void *`. In the C functions I create a pointer of type class and assign the `void *` parameter. The first callback function executes successfully. But the `void *` pointer be...
2008/11/25
[ "https://Stackoverflow.com/questions/316879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39270/" ]
Generally, callbacks in Objective-C are handled by passing a delegate object and a selector to perform on that delegate. For example, this method will call a method on its delegate after logging a message, passing both itself and the message that was logged. ``` - (void)logMessage:(NSString *)message delegat...
This is what Objective-C's selector is for: [<http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/NSInvocationOperation_Class>](http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/NSInvocationOperation_Class/Reference/Reference.html) The API isn't very intuitive, but its fine on...
316,879
I have a method in an objective-C class. It has 2 callback functions written in C. The class pointer i.e. `self` is passed to these functions as `void *`. In the C functions I create a pointer of type class and assign the `void *` parameter. The first callback function executes successfully. But the `void *` pointer be...
2008/11/25
[ "https://Stackoverflow.com/questions/316879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39270/" ]
Are your problems specifically with the IOKit callback routines? The problem with the specific example you gave is that the IOServiceMatchingCallback takes only 2 parameters, not 3. You need your RawDeviceAdded() and BulkTestDeviceAdded() callback functions to match the IOServiceMatchingCallback prototype and to accept...
This is what Objective-C's selector is for: [<http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/NSInvocationOperation_Class>](http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/NSInvocationOperation_Class/Reference/Reference.html) The API isn't very intuitive, but its fine on...
316,879
I have a method in an objective-C class. It has 2 callback functions written in C. The class pointer i.e. `self` is passed to these functions as `void *`. In the C functions I create a pointer of type class and assign the `void *` parameter. The first callback function executes successfully. But the `void *` pointer be...
2008/11/25
[ "https://Stackoverflow.com/questions/316879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39270/" ]
Are your problems specifically with the IOKit callback routines? The problem with the specific example you gave is that the IOServiceMatchingCallback takes only 2 parameters, not 3. You need your RawDeviceAdded() and BulkTestDeviceAdded() callback functions to match the IOServiceMatchingCallback prototype and to accept...
Generally, callbacks in Objective-C are handled by passing a delegate object and a selector to perform on that delegate. For example, this method will call a method on its delegate after logging a message, passing both itself and the message that was logged. ``` - (void)logMessage:(NSString *)message delegat...
4,038,534
Suppose that $a,b,c,d$ are vectors in $\mathbb{R}^2$, so $a\_{\alpha}$ where $\alpha = 1,2$. We define a scalar product as $a \cdot b := a\_1 b\_2 - a\_2 b\_1$. Suppose also that we have a real-valued function $f(a,b,c)$ which is a function of some $3$ vectors. What does the Taylor expansion of $f$ look like to first ...
2021/02/24
[ "https://math.stackexchange.com/questions/4038534", "https://math.stackexchange.com", "https://math.stackexchange.com/users/203030/" ]
There is something to confront here in your question, which has been pointed out already. The first thing is to see that your "scalar product" is not a scalar product: it's a skew symmetric bilinear form. More specifically, notice that $a \cdot a = 0 \hspace{4pt} \forall a$. What you've written is actually the magnitud...
If have only a partial answer, hope this helps: The difficulty here is definitely your "scalar product". I set this in quotation marks because it is not a scalar product (not even a semi-definite one) because it is skew-symmetric: $a\cdot b = -b \cdot a$ It is merely a skew-symmetric bilinear form, which does not d...
4,038,534
Suppose that $a,b,c,d$ are vectors in $\mathbb{R}^2$, so $a\_{\alpha}$ where $\alpha = 1,2$. We define a scalar product as $a \cdot b := a\_1 b\_2 - a\_2 b\_1$. Suppose also that we have a real-valued function $f(a,b,c)$ which is a function of some $3$ vectors. What does the Taylor expansion of $f$ look like to first ...
2021/02/24
[ "https://math.stackexchange.com/questions/4038534", "https://math.stackexchange.com", "https://math.stackexchange.com/users/203030/" ]
$\def\va{{\bf a}} \def\vb{{\bf b}} \def\vc{{\bf c}} \def\vd{{\bf d}} \def\e{\varepsilon} \def\np{\odot}$We have \begin{align\*} f(\va+\vb,\vc,\vd) &= f(\va,\vc,\vd) + \sum\_i b\_i\left.\frac{\partial f(\va+\vb,\vc,\vd)}{\partial b\_i}\right|\_{b\_i=0} + \ldots \\ &= f(\va,\vc,\vd) + \sum\_i b\_i \frac{\partial f(\va,\...
If have only a partial answer, hope this helps: The difficulty here is definitely your "scalar product". I set this in quotation marks because it is not a scalar product (not even a semi-definite one) because it is skew-symmetric: $a\cdot b = -b \cdot a$ It is merely a skew-symmetric bilinear form, which does not d...
4,038,534
Suppose that $a,b,c,d$ are vectors in $\mathbb{R}^2$, so $a\_{\alpha}$ where $\alpha = 1,2$. We define a scalar product as $a \cdot b := a\_1 b\_2 - a\_2 b\_1$. Suppose also that we have a real-valued function $f(a,b,c)$ which is a function of some $3$ vectors. What does the Taylor expansion of $f$ look like to first ...
2021/02/24
[ "https://math.stackexchange.com/questions/4038534", "https://math.stackexchange.com", "https://math.stackexchange.com/users/203030/" ]
There is something to confront here in your question, which has been pointed out already. The first thing is to see that your "scalar product" is not a scalar product: it's a skew symmetric bilinear form. More specifically, notice that $a \cdot a = 0 \hspace{4pt} \forall a$. What you've written is actually the magnitud...
$\def\va{{\bf a}} \def\vb{{\bf b}} \def\vc{{\bf c}} \def\vd{{\bf d}} \def\e{\varepsilon} \def\np{\odot}$We have \begin{align\*} f(\va+\vb,\vc,\vd) &= f(\va,\vc,\vd) + \sum\_i b\_i\left.\frac{\partial f(\va+\vb,\vc,\vd)}{\partial b\_i}\right|\_{b\_i=0} + \ldots \\ &= f(\va,\vc,\vd) + \sum\_i b\_i \frac{\partial f(\va,\...
74,020,294
From a dos prompt if I lauch the following command ``` echo text=1>script.conf ``` in the script.conf will be written `text=` and not `text=1` How can I solve this problem? Thanks.
2022/10/10
[ "https://Stackoverflow.com/questions/74020294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16578432/" ]
I hope I've understood your question well. Try: ```py from ast import literal_eval df["experimental_properties"] = df["experimental_properties"].apply( lambda x: {d["name"]: d["property"] for d in literal_eval(x)} ) df = pd.concat([df, df.pop("experimental_properties").apply(pd.Series)], axis=1) print(df) ``` ...
Is the expected output really what you are looking for? Another way to visualise the data would be to have "name", "property", and "sourceNumber" as column names. ``` import json import pandas as pd data = [ '''[{'name': 'Boiling Point', 'property': '115.3 °C', 'sourceNumber': 1}]''', '''[{'name': 'Boiling Point', 'p...
242,423
So I've been asked to prove non-differentiability using this particular method, and I'm a bit lost. I'm supposed to prove that $f(x,y) = |x-y|$ is not differentiable along the $x=y$ line. To do it, I'm supposed to use this definition of differentiability: A function $f$ is called differentiable at a point $a$ in it's ...
2012/11/22
[ "https://math.stackexchange.com/questions/242423", "https://math.stackexchange.com", "https://math.stackexchange.com/users/50288/" ]
A subset $A$ of a set $X$ is closed with respect to a metric $d$ on $X$ precisely if every point in the closure of $A$ is in $A$. A point $a\in X$ is in the closure of $A$ if for every positive number $\varepsilon$, no matter how small, the ball of radius $\varepsilon$ centered at $a$ intersects $A$.
An alternative but very important way to define a closed subset of a metric space X is as the complement of an open subset of X. The definition of an open subset is defined here: <http://en.wikipedia.org/wiki/Open_set#Metric_spaces> You can then define a closed subset A of X as any set where it's complement X\A is op...
65,267,593
When I execute the following simple script in PowerShell 7.1, I get the (correct) value of 3, regardless of whether the script's encoding is Latin1 or UTF8. ``` 'Bär'.length ``` This surprises me because I was under the (apparently wrong) impression that the default encoding in PowerShell 5.1 is UTF16-LE and in Powe...
2020/12/12
[ "https://Stackoverflow.com/questions/65267593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180275/" ]
The encoding is unrelated to this case: you are calling `string.Length` which is documented to return the number of UTF-16 code units. This roughly correlates to letters (when you ignore combining characters and high codepoints like emoji) Encoding only comes into play when converting implicitly or explicitly to/from ...
I think without a BOM, PS 5 assumes ansi or windows-1252, while PS 7 assumes utf8 no bom. This file saved as ansi in notepad works in PS 5 but not perfectly in PS 7. Just like a utf8 no bom file with special characters wouldn't work perfectly in PS 5. A utf16 ps1 file would always have a BOM or encoding signature. A po...
65,267,593
When I execute the following simple script in PowerShell 7.1, I get the (correct) value of 3, regardless of whether the script's encoding is Latin1 or UTF8. ``` 'Bär'.length ``` This surprises me because I was under the (apparently wrong) impression that the default encoding in PowerShell 5.1 is UTF16-LE and in Powe...
2020/12/12
[ "https://Stackoverflow.com/questions/65267593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180275/" ]
> > I was under the (apparently wrong) impression that the default encoding in PowerShell 5.1 is UTF16-LE and in PowerShell 7.1 UTF-8. > > > There are two distinct default character encodings to consider: * The **default *output* encoding** used by various cmdlets (`Out-File`, `Set-Content`) and the redirection o...
The encoding is unrelated to this case: you are calling `string.Length` which is documented to return the number of UTF-16 code units. This roughly correlates to letters (when you ignore combining characters and high codepoints like emoji) Encoding only comes into play when converting implicitly or explicitly to/from ...
65,267,593
When I execute the following simple script in PowerShell 7.1, I get the (correct) value of 3, regardless of whether the script's encoding is Latin1 or UTF8. ``` 'Bär'.length ``` This surprises me because I was under the (apparently wrong) impression that the default encoding in PowerShell 5.1 is UTF16-LE and in Powe...
2020/12/12
[ "https://Stackoverflow.com/questions/65267593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180275/" ]
> > I was under the (apparently wrong) impression that the default encoding in PowerShell 5.1 is UTF16-LE and in PowerShell 7.1 UTF-8. > > > There are two distinct default character encodings to consider: * The **default *output* encoding** used by various cmdlets (`Out-File`, `Set-Content`) and the redirection o...
I think without a BOM, PS 5 assumes ansi or windows-1252, while PS 7 assumes utf8 no bom. This file saved as ansi in notepad works in PS 5 but not perfectly in PS 7. Just like a utf8 no bom file with special characters wouldn't work perfectly in PS 5. A utf16 ps1 file would always have a BOM or encoding signature. A po...
32,325,025
I'm reading a file and then running a for loop for each value. My script is stopping after executing the first value. The file\_detail.txt has multiple lines. But it is not proceeding to the next value. My script looks something like this -- ``` open (my $fh, "<", "$mycrdir/file_detail.txt" ); foreach(my $value = ...
2015/09/01
[ "https://Stackoverflow.com/questions/32325025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4519655/" ]
Change your `foreach` to `while`. `my $value = <$fh>` returns a single value, which is the first line of the file. `foreach` then receives that single value and loops over only that one value, after which the loop terminates without reading the next line from `$fh`.
Either use while loop as Dave mentioned or slurp the file in an array then loop over array using foreach. ``` use IO::All; my @lines = io($filename)->slurp; foreach (@lines){ #work on each line } ```
32,325,025
I'm reading a file and then running a for loop for each value. My script is stopping after executing the first value. The file\_detail.txt has multiple lines. But it is not proceeding to the next value. My script looks something like this -- ``` open (my $fh, "<", "$mycrdir/file_detail.txt" ); foreach(my $value = ...
2015/09/01
[ "https://Stackoverflow.com/questions/32325025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4519655/" ]
Your code needs: 1. use warnings; use strict; 2. error handling on `open` 3. error handling on `qx`, i.e. replace it with `system` since you do not care about the output, or better yet, with `File::Path::mkpath()` 4. change the `foreach` to a `while` 5. add an `else` clause to your loop Try this: **Input** ``` 123 ...
Change your `foreach` to `while`. `my $value = <$fh>` returns a single value, which is the first line of the file. `foreach` then receives that single value and loops over only that one value, after which the loop terminates without reading the next line from `$fh`.
32,325,025
I'm reading a file and then running a for loop for each value. My script is stopping after executing the first value. The file\_detail.txt has multiple lines. But it is not proceeding to the next value. My script looks something like this -- ``` open (my $fh, "<", "$mycrdir/file_detail.txt" ); foreach(my $value = ...
2015/09/01
[ "https://Stackoverflow.com/questions/32325025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4519655/" ]
Change your `foreach` to `while`. `my $value = <$fh>` returns a single value, which is the first line of the file. `foreach` then receives that single value and loops over only that one value, after which the loop terminates without reading the next line from `$fh`.
Maybe, here is an other solution, if I mean well the problem ... ``` open FH, "$mycrdir/file_detail.txt" || die $!; while(<$FH>) { chomp; if (/^abc$/) { ... } elsif(/^123$/) { ... } } close FH; ```
32,325,025
I'm reading a file and then running a for loop for each value. My script is stopping after executing the first value. The file\_detail.txt has multiple lines. But it is not proceeding to the next value. My script looks something like this -- ``` open (my $fh, "<", "$mycrdir/file_detail.txt" ); foreach(my $value = ...
2015/09/01
[ "https://Stackoverflow.com/questions/32325025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4519655/" ]
Your code needs: 1. use warnings; use strict; 2. error handling on `open` 3. error handling on `qx`, i.e. replace it with `system` since you do not care about the output, or better yet, with `File::Path::mkpath()` 4. change the `foreach` to a `while` 5. add an `else` clause to your loop Try this: **Input** ``` 123 ...
Either use while loop as Dave mentioned or slurp the file in an array then loop over array using foreach. ``` use IO::All; my @lines = io($filename)->slurp; foreach (@lines){ #work on each line } ```
32,325,025
I'm reading a file and then running a for loop for each value. My script is stopping after executing the first value. The file\_detail.txt has multiple lines. But it is not proceeding to the next value. My script looks something like this -- ``` open (my $fh, "<", "$mycrdir/file_detail.txt" ); foreach(my $value = ...
2015/09/01
[ "https://Stackoverflow.com/questions/32325025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4519655/" ]
Your code needs: 1. use warnings; use strict; 2. error handling on `open` 3. error handling on `qx`, i.e. replace it with `system` since you do not care about the output, or better yet, with `File::Path::mkpath()` 4. change the `foreach` to a `while` 5. add an `else` clause to your loop Try this: **Input** ``` 123 ...
Maybe, here is an other solution, if I mean well the problem ... ``` open FH, "$mycrdir/file_detail.txt" || die $!; while(<$FH>) { chomp; if (/^abc$/) { ... } elsif(/^123$/) { ... } } close FH; ```
6,114
This is inspired partly by [this question](https://mathoverflow.net/questions/5957/what-is-a-metric-space), especially Tom Leinster's answer. Let me start with some background. I apologize that this will be rather long, since I'm hoping for input from people who probably don't much about the following. Classically, ...
2009/11/19
[ "https://mathoverflow.net/questions/6114", "https://mathoverflow.net", "https://mathoverflow.net/users/1044/" ]
This is a rewording of Matthew's answer, but one can use nonstandard analysis to obtain a category that achieves what Mark wants. After taking ultrapowers, one obtains non-standard integers (ultralimits of standard integers), nonstandard finite dimensional Banach spaces (ultralimits of standard finite dimensional Banac...
The best solution that I can think of is one that analysts have already embraced: Use the category of linear maps, but enrich the category over itself. In other words, make $\mathrm{Hom}(X,Y)$ into a Banach space as well using operator norm. Then it isn't so bad that all $n$-dimensional Banach spaces are isomorphic. Si...
6,114
This is inspired partly by [this question](https://mathoverflow.net/questions/5957/what-is-a-metric-space), especially Tom Leinster's answer. Let me start with some background. I apologize that this will be rather long, since I'm hoping for input from people who probably don't much about the following. Classically, ...
2009/11/19
[ "https://mathoverflow.net/questions/6114", "https://mathoverflow.net", "https://mathoverflow.net/users/1044/" ]
This is a rewording of Matthew's answer, but one can use nonstandard analysis to obtain a category that achieves what Mark wants. After taking ultrapowers, one obtains non-standard integers (ultralimits of standard integers), nonstandard finite dimensional Banach spaces (ultralimits of standard finite dimensional Banac...
A (reasonably) standard trick to convert finite-dimensional limiting type problems into single, infinite dimensional problems is to use Ultraproducts (or non-standard hulls, if you know more model theory than I do). Let $(E\_i)$ be a family of Banach spaces on an index set $I$, and let $\ell^\infty(I,E\_i)$ be the Ban...
15,964,051
This question is bit complex atleast for me. Well, I am working on a project and need some bit more help.. Actually i have a module , where when 1 user login he get limited data from 1 table and he update its records. That is done ! second thing, the issue : i have 5 user who will login and will work on data. but n...
2013/04/12
[ "https://Stackoverflow.com/questions/15964051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2232188/" ]
Ok. This is just a raw answer to give you a better idea. This is how you will insert the login . Consider having a table containing following fields, Table Name: Temp\_Table user, assigned\_rows\_last\_no, date\_assigned ``` <?php $con=mysqli_connect("example.com","hiren","abc123","my_db"); // These things can be ...
You don't need a extra framework. Simply done with php 'n' sql! Why you don't save the last edited lines (linenumbers) in a extra SQL-Table? Maybe with the username / userid.
28,260,559
In Python3 I can do (thanks to [pep 3102](https://www.python.org/dev/peps/pep-3102/)): ``` def some_fun(a, *args, log=None, verbose=0): pass ``` and be sure that if I call this with: ``` some_fun(1, 2, 3, lob=debug_log) ``` I get a type error on the unexpected keyword argument `lob`. On Python2 I cannot defi...
2015/02/01
[ "https://Stackoverflow.com/questions/28260559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4516363/" ]
Instead of using `.get()` to retrieve the values, use `.pop()` and check if `kw` is empty after popping all keyword-only arguments. I use a small helper function for this: ``` def check_empty_kwargs(kwargs): import inspect try: keys = kwargs.keys() assert len(keys) == 0 except AssertionError: ...
You can check against allowed keys, eg: ``` def f(a, *args, **kwargs): surplus = set(kwargs).difference(('log', 'foo', 'bar')) if surplus: raise TypeError('got unexpected keyword argument(s): ' + ', '.join(surplus)) ```
28,260,559
In Python3 I can do (thanks to [pep 3102](https://www.python.org/dev/peps/pep-3102/)): ``` def some_fun(a, *args, log=None, verbose=0): pass ``` and be sure that if I call this with: ``` some_fun(1, 2, 3, lob=debug_log) ``` I get a type error on the unexpected keyword argument `lob`. On Python2 I cannot defi...
2015/02/01
[ "https://Stackoverflow.com/questions/28260559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4516363/" ]
Instead of using `.get()` to retrieve the values, use `.pop()` and check if `kw` is empty after popping all keyword-only arguments. I use a small helper function for this: ``` def check_empty_kwargs(kwargs): import inspect try: keys = kwargs.keys() assert len(keys) == 0 except AssertionError: ...
If you have a bunch of processing steps, you can combine the above techniques with another one: ``` def f(a, *args, **kwargs): # we allow xyz, a, b xyz = kwargs.pop('xyz', 1) # now xyz must be gone, so we can only have a and/or b others = (lambda a=1, b=2: (a, b)(**kwargs)) # either that was ok or ...
23,754,814
I'm attempting to implement a circular queue class in Java. And in doing so I had to created a node class to group together elements and pointers to the next node. Being circular, the nodes need to be able to point to themselves. However when I go to compile the code below, the compiler (javac) is telling me I'm doing ...
2014/05/20
[ "https://Stackoverflow.com/questions/23754814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The compile error is ``` Cannot refer to 'this' nor 'super' while explicitly invoking a constructor ``` Basically, you cannot use "`this`" from inside "`this(...)`"
You dont need to pass it in all cases. since you can refer to it in the other construtor
23,754,814
I'm attempting to implement a circular queue class in Java. And in doing so I had to created a node class to group together elements and pointers to the next node. Being circular, the nodes need to be able to point to themselves. However when I go to compile the code below, the compiler (javac) is telling me I'm doing ...
2014/05/20
[ "https://Stackoverflow.com/questions/23754814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You cannot refer tho this (or super) in a constructor, so you should change your code like this: ``` public class Node<Key>{ private Key key; private Node<Key> next; public Node(){ key = null; next = this; } public Node(final Key k){ key = null; next = this; } public...
The compile error is ``` Cannot refer to 'this' nor 'super' while explicitly invoking a constructor ``` Basically, you cannot use "`this`" from inside "`this(...)`"
23,754,814
I'm attempting to implement a circular queue class in Java. And in doing so I had to created a node class to group together elements and pointers to the next node. Being circular, the nodes need to be able to point to themselves. However when I go to compile the code below, the compiler (javac) is telling me I'm doing ...
2014/05/20
[ "https://Stackoverflow.com/questions/23754814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The compile error is ``` Cannot refer to 'this' nor 'super' while explicitly invoking a constructor ``` Basically, you cannot use "`this`" from inside "`this(...)`"
Can not pass "this" as a parameter to call the constructor.
23,754,814
I'm attempting to implement a circular queue class in Java. And in doing so I had to created a node class to group together elements and pointers to the next node. Being circular, the nodes need to be able to point to themselves. However when I go to compile the code below, the compiler (javac) is telling me I'm doing ...
2014/05/20
[ "https://Stackoverflow.com/questions/23754814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You cannot refer tho this (or super) in a constructor, so you should change your code like this: ``` public class Node<Key>{ private Key key; private Node<Key> next; public Node(){ key = null; next = this; } public Node(final Key k){ key = null; next = this; } public...
You dont need to pass it in all cases. since you can refer to it in the other construtor
23,754,814
I'm attempting to implement a circular queue class in Java. And in doing so I had to created a node class to group together elements and pointers to the next node. Being circular, the nodes need to be able to point to themselves. However when I go to compile the code below, the compiler (javac) is telling me I'm doing ...
2014/05/20
[ "https://Stackoverflow.com/questions/23754814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You cannot refer tho this (or super) in a constructor, so you should change your code like this: ``` public class Node<Key>{ private Key key; private Node<Key> next; public Node(){ key = null; next = this; } public Node(final Key k){ key = null; next = this; } public...
Can not pass "this" as a parameter to call the constructor.