qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
6,907,423
I have a module called 'admin' in my application, which is accessible at /mysite/admin. To improve the site security I want to change this URL to something more difficult to guess to the normal users and only the site admin will know. I tried urlManager rules but couldn't get the desired result, for example: ``` 'adm...
2011/08/02
[ "https://Stackoverflow.com/questions/6907423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/238784/" ]
``` rules=>array( 'admin-panel' =>'admin', 'admin-panel/<_c:\w+>/<_a:\w+>/<id:\d+>' =>'admin/<_c>/<_a>/<id>', 'admin-panel/<_c:\w+>/<_a:\w+>' =>'admin/<_c>/<_a>', 'admin-panel/<_c:\w+>' =>'admin/<_c>', ) ``` But it's just alias - your admin module ...
try adding: ``` 'admin-panel'=>'admin', 'admin-panel/<controller:\w+>'=>'admin/<controller>', 'admin-panel/<controller:\w+>/<action:\w+>'=>'admin/<controller>/<action>', ```
6,907,423
I have a module called 'admin' in my application, which is accessible at /mysite/admin. To improve the site security I want to change this URL to something more difficult to guess to the normal users and only the site admin will know. I tried urlManager rules but couldn't get the desired result, for example: ``` 'adm...
2011/08/02
[ "https://Stackoverflow.com/questions/6907423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/238784/" ]
``` rules=>array( 'admin-panel' =>'admin', 'admin-panel/<_c:\w+>/<_a:\w+>/<id:\d+>' =>'admin/<_c>/<_a>/<id>', 'admin-panel/<_c:\w+>/<_a:\w+>' =>'admin/<_c>/<_a>', 'admin-panel/<_c:\w+>' =>'admin/<_c>', ) ``` But it's just alias - your admin module ...
``` 'urlManager'=>array( 'urlFormat'=>'path', 'rules'=>array( 'module/<module:\w+>/<controller:\w+>/<action:\w+>'=>'<module>/<controller>/<action>', 'module/<m:\w+>/<c:\w+>/<a:\w+>'=>'<m>/<c>/<a>', ) ), ```
3,011,125
As the title says, is it valid to insert the power of the cosine to its angle? Edit : Is it valid when x is very small ?
2018/11/24
[ "https://math.stackexchange.com/questions/3011125", "https://math.stackexchange.com", "https://math.stackexchange.com/users/612589/" ]
For $x = \pi^{3/4}$, $\cos^{3}(x^{4/3}) = \cos^{3}(\pi) = -1$. However, $\cos(\pi^{4})\neq -1$, since $\pi^{4}$ can't be a rational multiple of $\pi$ (since $\pi$ is a transcendental number!).
Although $$ (x^{4/3})^3 = x^4, $$ one does not have $$ [f(x^{4/3})]^3=f(x^4) $$ in general. [![enter image description here](https://i.stack.imgur.com/dbq4L.png)](https://i.stack.imgur.com/dbq4L.png) > > For your added question "Is it valid when $x$ is very small?": > > > I assume that you mean when $|x|$ is ve...
710,157
I'm making a hardware project that will run a GNU/Linux OS, and I have a question.(edit: it's ARM based) How EXACTLY does the Linux kernel know what type of hardware is connected to the CPU, I mean how hoes it know that yeah this a a RAM and that is a drive ...etc. ESPECIALLY for network interfaces, if the system has...
2022/07/17
[ "https://unix.stackexchange.com/questions/710157", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/243639/" ]
All this very low level work will of course depend on… the [architecture](https://en.wikipedia.org/wiki/List_of_Linux-supported_computer_architectures). For the most common (x86/IBM PC) the BIOS will help a lot for a good start. If you get one, look at your bootlog, it will start querying the BIOS : > > BIOS-provide...
The x86 architecture describes standard PC components (interfaces including PCI, PCI-E, RAM, etc.) which the Linux kernel enumerates part of the boot process. Some buses allow to attach/detach devices on the fly, e.g. USB or SATA. Your question is not Linux/Unix specific. * [https://www.cs.uic.edu/~jbell/CourseNotes/O...
1,191,372
I am currently using the formula below to have a cell say 0 if the numeric value is less than 8. If the numeric value in that cell is greater than 8, i would like the value to show in the cell and subtract it by 8. =SUMIF(B3,">8")-8 It works if the value is greater than 8 perfectly, but when it is less than 8 it give...
2017/03/22
[ "https://superuser.com/questions/1191372", "https://superuser.com", "https://superuser.com/users/710089/" ]
Use if to set whether you return 0 or the value less 8: ``` =IF(B3<8,0,B3-8) ``` [![enter image description here](https://i.stack.imgur.com/mBQV9.png)](https://i.stack.imgur.com/mBQV9.png) Or you can use MAX: ``` =MAX(B3-8,0) ``` [![enter image description here](https://i.stack.imgur.com/dbnmD.png)](https://i.st...
I would keep it simple: `=MAX(0, A1-8)` When `a1-8` is less than 0, it returns 0 (by definition.) Otherwise it returns `a1-8`. For example ``` In Output -1 0 8 0 9 1 10 2 11 3 12 4 13 5 ```
3,905,749
1.Let f ∈ S3 be a permutation which is not the identity. Prove that there exists g ∈ S3 such that fg ≠ gf. 2.Let n ≥ 3, and let f ∈ Sn be a permutation which is not the identity. Prove that there exists g ∈ Sn such that fg ≠ gf. Hey guys I am completely stuck in these two questions I'm really not sure where to start ...
2020/11/13
[ "https://math.stackexchange.com/questions/3905749", "https://math.stackexchange.com", "https://math.stackexchange.com/users/835595/" ]
I'll try to formally trace your solution. First you apply the trick $y'(x)=p(y(x))$ with the dot indicating the $y$ derivative. This gives correctly equation (II). Next you set $\dot p(y)=u$ and compute $y$ as a function of $u$, $y=v(u)$, giving the combined equation $y(x)=v(\dot p(y(x)))$, that is, $v$ is the inverse ...
Differentiating $p=2y\dot p+\log\sqrt{\dot p}$ gives $\dot p=2\dot p+2y\ddot p+\ddot p/(2\dot p)$ so $(1+4yq)\dot q=-2q^2$ where $q=\dot p$. As this is exact, the general solution is $c=f(y)$ where $f\_q=1+4yq$ and $f\_y=2q^2$. Thus $f(y)=d+q+2yq^2$ so $q=(-1\pm\sqrt{1+Cy})/4y$ and substituting back into $p=y'$ yields ...
280,351
Some animals have different words for the animal and for the meat - *cow/beef*, *pig/pork*. Some animals just use the same word without any compound - *fish*, *quail*. But some animals use compounds of the form [animal] *meat*, while others use [animal] *flesh*. I looked at the Wiktionary entry on *[flesh](https://en....
2015/10/15
[ "https://english.stackexchange.com/questions/280351", "https://english.stackexchange.com", "https://english.stackexchange.com/users/1420/" ]
I suspect the main reason why *flesh* is not commonly associated with animals' carcasses stems from a sense of aversion, and sanctity. Consider the expression, *[flesh and blood](http://idioms.thefreedictionary.com/flesh+and+blood)*, which is used in connection with our children, (*‘She is my own flesh and blood’*) o...
Language is ever evolving though so making arguments based solely on older definitions and usage doesn't account for all of the morphology of the word, since there are examples in modern usage. I would agree with OP that those are common phrases that I've heard as a native English speaker. Another commenter included th...
280,351
Some animals have different words for the animal and for the meat - *cow/beef*, *pig/pork*. Some animals just use the same word without any compound - *fish*, *quail*. But some animals use compounds of the form [animal] *meat*, while others use [animal] *flesh*. I looked at the Wiktionary entry on *[flesh](https://en....
2015/10/15
[ "https://english.stackexchange.com/questions/280351", "https://english.stackexchange.com", "https://english.stackexchange.com/users/1420/" ]
"Meat" is "flesh" that one would consider eating. > > We talk about "human flesh" not "human meat" > > > *because we don't eat humans.* > > we use *meat* not *flesh* for kangaroos, dogs, whales or dolphins, all of whom tend to be "friends not food" to most English-speakers. > > > I'm not sure who "we" is ...
Language is ever evolving though so making arguments based solely on older definitions and usage doesn't account for all of the morphology of the word, since there are examples in modern usage. I would agree with OP that those are common phrases that I've heard as a native English speaker. Another commenter included th...
347,158
We are having integration with the Salesforce from the Mulesoft. Now, as Salesforce is planning to roll-out MFA for all apps. Will it affect our API integration?
2021/06/17
[ "https://salesforce.stackexchange.com/questions/347158", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/87961/" ]
Salesforce Functions is not GA. Until the feature becomes GA or you obtain access to a preview program and follow any applicable setup instructions, you won't be able to use that command or follow steps in demo videos. Clarification: I don't know whether there are any preview programs available at the time of this wri...
To apply for the Beta, you need to sign up via <https://sfdc.co/functions-beta> Once you have been approved, and have access to the feature in your dev hub, you need to follow the steps from the documentation: [Configure Orgs for Functions](https://developer.salesforce.com/docs/platform/functions/guide/config-org.htm...
123,118
I have installed two magento on my local server.*I added product from my first magento installation its added fine but it also display in second magento installation*. **Why does this happen? Any one have same issue?** [![enter image description here](https://i.stack.imgur.com/b7BQr.png)](https://i.stack.imgur.com/b7B...
2016/06/28
[ "https://magento.stackexchange.com/questions/123118", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/28492/" ]
According to your URLs, **my guess is that your two Magento installations share the cookies and/or sessions.** As they use the same base URLs, the cookies from the second install are being shared with the second installation. I suggest you **avoid using the same URLs for two different installations and setup proper d...
You are using same URL for 2 sites. So the cookies will be shared. You should create different Url for each site. Example: Site 1: magento2.mcs.com Site2 : magento202.mcs.com You can reference this document for create virtual host: <https://httpd.apache.org/docs/current/vhosts/examples.html>
77,782
I have two tables, for simplicity table1, with id as Primary key, and a field name, and table2 with the same. Each table has quite a few records, but during a complicated form process, the user is presented with every record from table1, but depending on their choice in the form (done by radio, with id as the value) th...
2014/09/26
[ "https://dba.stackexchange.com/questions/77782", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/48249/" ]
There are many ways to do this. Most common are with a `LEFT JOIN` / `IS NULL` check, `NOT IN` or `NOT EXISTS` subquery. Here's a solution with the 3rd option: ``` SELECT t2.id, t2.name FROM table2 AS t2 WHERE NOT EXISTS ( SELECT * FROM table3 AS t3 WHERE t3.table1_id = @t1_id -- the t1.id v...
Check this post out from a similar request to find records NOT IN another table. [MySQL “NOT IN” query](https://stackoverflow.com/questions/1519272/mysql-not-in-query) ``` SELECT * FROM Table2 WHERE Table2.principal NOT IN (SELECT principal FROM table1) ``` Hope that helps!
44,917,042
I have these three arrays: ``` $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; ``` And this is expected result: ``` /* Array ( [0] => one [1] => two [3] => three [4] => four [5] => five [6] => six [7] => seven ...
2017/07/05
[ "https://Stackoverflow.com/questions/44917042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5259594/" ]
Use this: ``` array_unique(array_merge($arr1,$arr2,$arr3), SORT_REGULAR); ``` this will merge the arrays into one, then removes all duplicates Tested [Here](http://sandbox.onlinephpfunctions.com/code/223f20bd509f1550af717fe7340403674d4a74a9) It outputs: ``` Array ( [0] => one [1] => two [2] => three ...
I think this will work just fine ``` $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; $n_array = array_values(array_unique(array_merge($arr1 , $arr2 , $arr3))); echo "<pre>";print_r($n_array);echo "</pre>";die; ``` Output is ``` Array ( [0] => one [1] =>...
44,917,042
I have these three arrays: ``` $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; ``` And this is expected result: ``` /* Array ( [0] => one [1] => two [3] => three [4] => four [5] => five [6] => six [7] => seven ...
2017/07/05
[ "https://Stackoverflow.com/questions/44917042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5259594/" ]
Use this: ``` array_unique(array_merge($arr1,$arr2,$arr3), SORT_REGULAR); ``` this will merge the arrays into one, then removes all duplicates Tested [Here](http://sandbox.onlinephpfunctions.com/code/223f20bd509f1550af717fe7340403674d4a74a9) It outputs: ``` Array ( [0] => one [1] => two [2] => three ...
use array\_merge then, array\_unique ``` $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; print_r(array_unique (array_merge($arr1,$arr2,$arr3))); ``` Result ``` Array ( [0] => one [1] => two [2] => three [4] => four [6] => five [7] => six [8] => seven ) ```
44,917,042
I have these three arrays: ``` $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; ``` And this is expected result: ``` /* Array ( [0] => one [1] => two [3] => three [4] => four [5] => five [6] => six [7] => seven ...
2017/07/05
[ "https://Stackoverflow.com/questions/44917042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5259594/" ]
Use this: ``` array_unique(array_merge($arr1,$arr2,$arr3), SORT_REGULAR); ``` this will merge the arrays into one, then removes all duplicates Tested [Here](http://sandbox.onlinephpfunctions.com/code/223f20bd509f1550af717fe7340403674d4a74a9) It outputs: ``` Array ( [0] => one [1] => two [2] => three ...
> > **Just Do That.. use `array_uniqe`** > > > Demo: <https://eval.in/827705> > > > ``` <?php $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; print_r ($difference = array_unique(array_merge($arr1, $arr2,$arr3))); ?> ```
44,917,042
I have these three arrays: ``` $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; ``` And this is expected result: ``` /* Array ( [0] => one [1] => two [3] => three [4] => four [5] => five [6] => six [7] => seven ...
2017/07/05
[ "https://Stackoverflow.com/questions/44917042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5259594/" ]
Use this: ``` array_unique(array_merge($arr1,$arr2,$arr3), SORT_REGULAR); ``` this will merge the arrays into one, then removes all duplicates Tested [Here](http://sandbox.onlinephpfunctions.com/code/223f20bd509f1550af717fe7340403674d4a74a9) It outputs: ``` Array ( [0] => one [1] => two [2] => three ...
``` <?php $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; $merge_arr = array_merge($arr1,$arr2,$arr3); $unique_arr = array_unique($merge_arr); echo '<pre>'; print_r($unique_arr); echo '</pre>'; ?> ``` Output ``` Array ( [0] ...
44,917,042
I have these three arrays: ``` $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; ``` And this is expected result: ``` /* Array ( [0] => one [1] => two [3] => three [4] => four [5] => five [6] => six [7] => seven ...
2017/07/05
[ "https://Stackoverflow.com/questions/44917042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5259594/" ]
I think this will work just fine ``` $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; $n_array = array_values(array_unique(array_merge($arr1 , $arr2 , $arr3))); echo "<pre>";print_r($n_array);echo "</pre>";die; ``` Output is ``` Array ( [0] => one [1] =>...
use array\_merge then, array\_unique ``` $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; print_r(array_unique (array_merge($arr1,$arr2,$arr3))); ``` Result ``` Array ( [0] => one [1] => two [2] => three [4] => four [6] => five [7] => six [8] => seven ) ```
44,917,042
I have these three arrays: ``` $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; ``` And this is expected result: ``` /* Array ( [0] => one [1] => two [3] => three [4] => four [5] => five [6] => six [7] => seven ...
2017/07/05
[ "https://Stackoverflow.com/questions/44917042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5259594/" ]
I think this will work just fine ``` $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; $n_array = array_values(array_unique(array_merge($arr1 , $arr2 , $arr3))); echo "<pre>";print_r($n_array);echo "</pre>";die; ``` Output is ``` Array ( [0] => one [1] =>...
> > **Just Do That.. use `array_uniqe`** > > > Demo: <https://eval.in/827705> > > > ``` <?php $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; print_r ($difference = array_unique(array_merge($arr1, $arr2,$arr3))); ?> ```
44,917,042
I have these three arrays: ``` $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; ``` And this is expected result: ``` /* Array ( [0] => one [1] => two [3] => three [4] => four [5] => five [6] => six [7] => seven ...
2017/07/05
[ "https://Stackoverflow.com/questions/44917042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5259594/" ]
I think this will work just fine ``` $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; $n_array = array_values(array_unique(array_merge($arr1 , $arr2 , $arr3))); echo "<pre>";print_r($n_array);echo "</pre>";die; ``` Output is ``` Array ( [0] => one [1] =>...
``` <?php $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; $merge_arr = array_merge($arr1,$arr2,$arr3); $unique_arr = array_unique($merge_arr); echo '<pre>'; print_r($unique_arr); echo '</pre>'; ?> ``` Output ``` Array ( [0] ...
44,917,042
I have these three arrays: ``` $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; ``` And this is expected result: ``` /* Array ( [0] => one [1] => two [3] => three [4] => four [5] => five [6] => six [7] => seven ...
2017/07/05
[ "https://Stackoverflow.com/questions/44917042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5259594/" ]
> > **Just Do That.. use `array_uniqe`** > > > Demo: <https://eval.in/827705> > > > ``` <?php $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; print_r ($difference = array_unique(array_merge($arr1, $arr2,$arr3))); ?> ```
use array\_merge then, array\_unique ``` $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; print_r(array_unique (array_merge($arr1,$arr2,$arr3))); ``` Result ``` Array ( [0] => one [1] => two [2] => three [4] => four [6] => five [7] => six [8] => seven ) ```
44,917,042
I have these three arrays: ``` $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; ``` And this is expected result: ``` /* Array ( [0] => one [1] => two [3] => three [4] => four [5] => five [6] => six [7] => seven ...
2017/07/05
[ "https://Stackoverflow.com/questions/44917042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5259594/" ]
> > **Just Do That.. use `array_uniqe`** > > > Demo: <https://eval.in/827705> > > > ``` <?php $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; print_r ($difference = array_unique(array_merge($arr1, $arr2,$arr3))); ?> ```
``` <?php $arr1 = ['one', 'two', 'three']; $arr2 = ['three', 'four']; $arr3 = ['two', 'five', 'six', 'seven']; $merge_arr = array_merge($arr1,$arr2,$arr3); $unique_arr = array_unique($merge_arr); echo '<pre>'; print_r($unique_arr); echo '</pre>'; ?> ``` Output ``` Array ( [0] ...
59,937,931
Okay, So I've done a fair bit of research on this particular topic previously, and I'm aware that it is a feature that the Flutter devs have not yet implemented to function automatically (setting the light and dark themes to change dynamically checking upon opening the app) but I know it IS possible. I don't want my us...
2020/01/27
[ "https://Stackoverflow.com/questions/59937931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12627794/" ]
After banging my head against a brick wall for a few hours, finally figured it out (For anyone else having a similar issue). The trick is that yes, you do in fact need to place the code that selects the theme inside the line ``` return CupertinoApp( <Here> ) ``` You can do this through: ``` builder: (BuildContext...
Placing a DefaultTextStyle widget somewhere near the top of the widget tree is a good workaround. Just remember it needs to be one level lower than the CupertinoApp, or else it cannot find the inherited theme using its build context. ``` class MyApp extends StatelessWidget { @override Widget build(BuildContext con...
17,191,070
I have an application with multiple view controllers. I created categories to change colors of each element (UIButton, UILabel, UIView etc). Everything is going fine for all elements but one. I can't find out how to change the tint of the UINavigationBar of a reusableView (header) in a CollectionView. I managed to c...
2013/06/19
[ "https://Stackoverflow.com/questions/17191070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1915800/" ]
Within your click handler, check if the number of elements with the class **line** is less than 10. ``` if ($('.line').length < 10) { //execute code }else{ alert('Only 10 allowed'); return false; } ``` [Fiddle](http://jsfiddle.net/24zD9/)
Here I used the .length method from jQuery. ``` var container = $('.copies'), value_src = $('#current'); $('.copy_form') .on('click', '.add', function(){ if ($('.accepted').length < 10) { var value = value_src.val(); var html = '<div class="line">' + '<input class="accepted" type="text" value=...
17,191,070
I have an application with multiple view controllers. I created categories to change colors of each element (UIButton, UILabel, UIView etc). Everything is going fine for all elements but one. I can't find out how to change the tint of the UINavigationBar of a reusableView (header) in a CollectionView. I managed to c...
2013/06/19
[ "https://Stackoverflow.com/questions/17191070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1915800/" ]
Rather than embedding 'magic numbers' in your code (see: [What is a magic number, and why is it bad?](https://stackoverflow.com/questions/47882/what-is-a-magic-number-and-why-is-it-bad)), define a maxFields variable and maintain a count throughout, checking against that value each time another one tries to be added. T...
Here I used the .length method from jQuery. ``` var container = $('.copies'), value_src = $('#current'); $('.copy_form') .on('click', '.add', function(){ if ($('.accepted').length < 10) { var value = value_src.val(); var html = '<div class="line">' + '<input class="accepted" type="text" value=...
816,964
I'd be needing to connect to several AWS EC2 instances and putty works fine with the keys, but it's just one at a time. I also tried Remmina, however it keeps asking SSH private keyphrase what it shouldn't. Any other suggestion?
2016/08/26
[ "https://askubuntu.com/questions/816964", "https://askubuntu.com", "https://askubuntu.com/users/539828/" ]
I've observed the same issue, but it's only noticeable when playing a graphically intensive game or watching a youtube video in my browser. In these cases, the game/video freezes in place for about half a second upon changing focus, and then resumes as normal. With sloppy focus, if I move the mouse rapidly between 2 wi...
Probably the same issue as [CPU spikes and performance problems changing window focus in Unity/Ubuntu 16.04.2](https://askubuntu.com/questions/890888/cpu-spikes-and-performance-problems-changing-window-focus-in-unity-ubuntu-16-04). I'm also seeing this on 16.04 with i5-4460 and a GTX 960 on a 32bit system (don't ask!)...
11,826,806
I am trying to import an OSGI blueprint XML file in to another OSGi blueprint XML file. e.g.: blueprint1.xml: ``` <?xml version="1.0" encoding="UTF-8"?> <blueprint ....> <bean id="myBean1" class="com.company.Class1"/> <bean id="myBean2" class="com.company.Class2"/> </blueprint> </xml> ``` blueprint2.xml: `...
2012/08/06
[ "https://Stackoverflow.com/questions/11826806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/896805/" ]
Apparently, Spring like imports are not currently possible in blueprint. However, if the files are in the same OSGi bundle then they are in the same context and can be used from other blueprint files. Also, see here: <http://fusesource.com/forums/message.jspa?messageID=15091#15091>
If you're using Gemini Blueprint (formerly Spring DM) you can simply tell it to load both files, and basically treat them as if they were one big file: > > In the absence of the Spring-Context header the extender expects every > ".xml" file in the META-INF/spring folder to be a valid Spring > configuration file [.....
461,030
Some websites, notably Github, started using special downloadable fonts and various little pictures are broken when font downloading is disabled. How to statically install just GitHub's font into Firefox without enabling font downloading from web?
2012/08/13
[ "https://superuser.com/questions/461030", "https://superuser.com", "https://superuser.com/users/27264/" ]
Browsers may cache font resources (`.woff` etc.), but usually don’t support a permanent install. If the font license allows it, you could fetch the file ([fontinfo addon](https://addons.mozilla.org/en/firefox/addon/fontinfo/) may help), convert it to a format your OS supports (usually `.ttf`/`.otf`, several tools and s...
It is *possible* that the following will work: * Download <https://github.global.ssl.fastly.net/assets/octicons-42317b4656db563d0370825b447f9df85a9f4bd5.woff> * Save it to, eg., `C:\Windows\Fonts` Then again, it might not work. If it doesn't, try renaming it to `octicons.woff`. I haven't tried this: it might do all s...
3,589,863
In Stanford Encyclopedia of Philosophy they say that (for a formal system F) by the Diagonalization Lemma a sentence G can be constructed: $F \vdash G\_F$ $\leftrightarrow$ $\lnot Prov(⌈G\_F⌉)$. This sentence G basically says that F proves $G\_F$ iff the Goedelnumber of $G\_F$ is not provable. If I assume G then I can...
2020/03/22
[ "https://math.stackexchange.com/questions/3589863", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
You misunderstood: $G$ is not the biconditional $(F \vdash G\_F) \leftrightarrow (\lnot Prov(⌈G\_F⌉))$. Rather, $G$ is the *metalogical* claim that the biconditional $G\_F$ $\leftrightarrow$ $\lnot Prov(⌈G\_F⌉)$ (which is a logical claim) can be proven in $F$. And that metalogical claim we write as $F \vdash G\_F \left...
The diagonal lemma isn't used to construct what you call $G$, but rather $G\_F$. Really, we should ignore $G$ altogether and just focus on what's going on "inside $F$." * EDIT: actually, it's even worse than that! [The article](https://plato.stanford.edu/entries/goedel-incompleteness/#FirIncTheCom) uses $G$ ambiguousl...
44,461,449
the program can accept two inputs to search by, using zip code or account number. Trying to make the SQL work with either one, I am using sql server. ``` select name, city, zip, acc_number case when zip then zip ='01111' when acc_number then acc_number = '00007' else NULL end as nodata from mytable ``` I am proba...
2017/06/09
[ "https://Stackoverflow.com/questions/44461449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/844930/" ]
Maybe that one? It searches by `zip` first. Then if no records found the second part of `union all` searches by acc\_number. ``` ;with _raw as ( select name, city, zip, acc_number from mytable where zip ='01111' union all select name, city, zip, acc_number from mytable whe...
How about this: ``` select name, city, zip, acc_number from mytable where zip ='01111' or acc_number = '00007' ``` I am not sure if I have understood your question correctly, but this will search based on the zip being '01111' (and ignoring the acc\_number), or searching based on the acc\_number being '00007', and i...
44,461,449
the program can accept two inputs to search by, using zip code or account number. Trying to make the SQL work with either one, I am using sql server. ``` select name, city, zip, acc_number case when zip then zip ='01111' when acc_number then acc_number = '00007' else NULL end as nodata from mytable ``` I am proba...
2017/06/09
[ "https://Stackoverflow.com/questions/44461449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/844930/" ]
Since you mentioned that you are already filtering out the parameter to check if it is `zip` or `acc_number` your query should be ``` declare @Zip int = 07652; declare @acc_number int; select top 1 name, city, zip, acc_number from mytable where 1 = case when isnull(@zip,0)!=0 and zip = @Zip then 1 else ...
How about this: ``` select name, city, zip, acc_number from mytable where zip ='01111' or acc_number = '00007' ``` I am not sure if I have understood your question correctly, but this will search based on the zip being '01111' (and ignoring the acc\_number), or searching based on the acc\_number being '00007', and i...
44,461,449
the program can accept two inputs to search by, using zip code or account number. Trying to make the SQL work with either one, I am using sql server. ``` select name, city, zip, acc_number case when zip then zip ='01111' when acc_number then acc_number = '00007' else NULL end as nodata from mytable ``` I am proba...
2017/06/09
[ "https://Stackoverflow.com/questions/44461449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/844930/" ]
Maybe that one? It searches by `zip` first. Then if no records found the second part of `union all` searches by acc\_number. ``` ;with _raw as ( select name, city, zip, acc_number from mytable where zip ='01111' union all select name, city, zip, acc_number from mytable whe...
Something like this? Your question is not 100% clear ``` select name, city, zip, acc_number case when zip ='01111' then 'Match' else when acc_number acc_number = '00007' then 'Match' else 'Not match' end as nodata from mytable ```
44,461,449
the program can accept two inputs to search by, using zip code or account number. Trying to make the SQL work with either one, I am using sql server. ``` select name, city, zip, acc_number case when zip then zip ='01111' when acc_number then acc_number = '00007' else NULL end as nodata from mytable ``` I am proba...
2017/06/09
[ "https://Stackoverflow.com/questions/44461449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/844930/" ]
Since you mentioned that you are already filtering out the parameter to check if it is `zip` or `acc_number` your query should be ``` declare @Zip int = 07652; declare @acc_number int; select top 1 name, city, zip, acc_number from mytable where 1 = case when isnull(@zip,0)!=0 and zip = @Zip then 1 else ...
Something like this? Your question is not 100% clear ``` select name, city, zip, acc_number case when zip ='01111' then 'Match' else when acc_number acc_number = '00007' then 'Match' else 'Not match' end as nodata from mytable ```
44,461,449
the program can accept two inputs to search by, using zip code or account number. Trying to make the SQL work with either one, I am using sql server. ``` select name, city, zip, acc_number case when zip then zip ='01111' when acc_number then acc_number = '00007' else NULL end as nodata from mytable ``` I am proba...
2017/06/09
[ "https://Stackoverflow.com/questions/44461449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/844930/" ]
Maybe that one? It searches by `zip` first. Then if no records found the second part of `union all` searches by acc\_number. ``` ;with _raw as ( select name, city, zip, acc_number from mytable where zip ='01111' union all select name, city, zip, acc_number from mytable whe...
You just need a conditional where clause. What this allows you to do is pass in values for either, both, or neither parameters. If both parameters are passed in the results that are returned are based off both conditions. That is, where the account number is what you passed in **AND** the zip code is passed in. If you ...
44,461,449
the program can accept two inputs to search by, using zip code or account number. Trying to make the SQL work with either one, I am using sql server. ``` select name, city, zip, acc_number case when zip then zip ='01111' when acc_number then acc_number = '00007' else NULL end as nodata from mytable ``` I am proba...
2017/06/09
[ "https://Stackoverflow.com/questions/44461449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/844930/" ]
Since you mentioned that you are already filtering out the parameter to check if it is `zip` or `acc_number` your query should be ``` declare @Zip int = 07652; declare @acc_number int; select top 1 name, city, zip, acc_number from mytable where 1 = case when isnull(@zip,0)!=0 and zip = @Zip then 1 else ...
You just need a conditional where clause. What this allows you to do is pass in values for either, both, or neither parameters. If both parameters are passed in the results that are returned are based off both conditions. That is, where the account number is what you passed in **AND** the zip code is passed in. If you ...
44,461,449
the program can accept two inputs to search by, using zip code or account number. Trying to make the SQL work with either one, I am using sql server. ``` select name, city, zip, acc_number case when zip then zip ='01111' when acc_number then acc_number = '00007' else NULL end as nodata from mytable ``` I am proba...
2017/06/09
[ "https://Stackoverflow.com/questions/44461449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/844930/" ]
Maybe that one? It searches by `zip` first. Then if no records found the second part of `union all` searches by acc\_number. ``` ;with _raw as ( select name, city, zip, acc_number from mytable where zip ='01111' union all select name, city, zip, acc_number from mytable whe...
Since you mentioned that you are already filtering out the parameter to check if it is `zip` or `acc_number` your query should be ``` declare @Zip int = 07652; declare @acc_number int; select top 1 name, city, zip, acc_number from mytable where 1 = case when isnull(@zip,0)!=0 and zip = @Zip then 1 else ...
23,780,029
I have a long css document that has px values that I need to convert to % values. I am looking for a quick solution without having to change each value one by one. Was wondering is there any JS code for automatically converting those values on the fly when the page loads? So for example Page container has a max wi...
2014/05/21
[ "https://Stackoverflow.com/questions/23780029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3660176/" ]
Using nokogiri in this place seems a litte oversized. You can do this with plain ruby: ``` require 'net/http' xml_content = Net::HTTP.get(URI.parse('http://www.heureka.cz/direct/xml-export/shops/heureka-sekce.xml')) data = Hash.from_xml(xml_content) ``` Then your able to access the data as a hash object.
If we indent your XML you will see the problem: ``` <HEUREKA> <CATEGORY> <CATEGORY_ID>971</CATEGORY_ID> <CATEGORY_NAME>Auto-moto</CATEGORY_NAME> <CATEGORY> <CATEGORY_ID>881</CATEGORY_ID> <CATEGORY_NAME>Alkohol testery</CATEGORY_NAME> <CATEGORY_FULLNAME>Heureka.cz | Auto-moto | Alkohol t...
23,780,029
I have a long css document that has px values that I need to convert to % values. I am looking for a quick solution without having to change each value one by one. Was wondering is there any JS code for automatically converting those values on the fly when the page loads? So for example Page container has a max wi...
2014/05/21
[ "https://Stackoverflow.com/questions/23780029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3660176/" ]
If we indent your XML you will see the problem: ``` <HEUREKA> <CATEGORY> <CATEGORY_ID>971</CATEGORY_ID> <CATEGORY_NAME>Auto-moto</CATEGORY_NAME> <CATEGORY> <CATEGORY_ID>881</CATEGORY_ID> <CATEGORY_NAME>Alkohol testery</CATEGORY_NAME> <CATEGORY_FULLNAME>Heureka.cz | Auto-moto | Alkohol t...
Simply change one line: ``` doc.css("CATEGORY").each do |node| ``` to the following: ``` doc.css("CATEGORY:has(CATEGORY_FULLNAME)").each do |node| ``` This selects only `CATEGORY` elements containing a `CATEGORY_FULLNAME` subelement. As an alternative, the equivalent XPath: ``` doc.xpath("//CATEGORY[CATEGORY_FU...
23,780,029
I have a long css document that has px values that I need to convert to % values. I am looking for a quick solution without having to change each value one by one. Was wondering is there any JS code for automatically converting those values on the fly when the page loads? So for example Page container has a max wi...
2014/05/21
[ "https://Stackoverflow.com/questions/23780029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3660176/" ]
Using nokogiri in this place seems a litte oversized. You can do this with plain ruby: ``` require 'net/http' xml_content = Net::HTTP.get(URI.parse('http://www.heureka.cz/direct/xml-export/shops/heureka-sekce.xml')) data = Hash.from_xml(xml_content) ``` Then your able to access the data as a hash object.
Simply change one line: ``` doc.css("CATEGORY").each do |node| ``` to the following: ``` doc.css("CATEGORY:has(CATEGORY_FULLNAME)").each do |node| ``` This selects only `CATEGORY` elements containing a `CATEGORY_FULLNAME` subelement. As an alternative, the equivalent XPath: ``` doc.xpath("//CATEGORY[CATEGORY_FU...
1,599,787
a. My C# program will load a dll (which is dynamic), for now let's take a.dll (similarly my program will load more dll like b.dll, c.dll, etc....). b. My program will invoke a method "Onstart" inside a.dll (it's constant for all the dll). I am able to achieve the above 2 cases by reflection mechanism. The problem is...
2009/10/21
[ "https://Stackoverflow.com/questions/1599787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193219/" ]
Have a look at this: <http://bytes.com/topic/c-sharp/answers/232691-how-dynamically-load-assembly-w-dependencies>. Basically, in the AssemblyResolve event, you need to load the referenced assemblies manually. ``` private Assembly AssemblyResolveHandler(object sender,ResolveEventArgs e) { try { string[]...
Perhaps the second DLL reference isn't available to your application? Make sure the second DLL is in the same directory as the first DLL or that the application is configured to look in a directory that does have the second DLL.
1,599,787
a. My C# program will load a dll (which is dynamic), for now let's take a.dll (similarly my program will load more dll like b.dll, c.dll, etc....). b. My program will invoke a method "Onstart" inside a.dll (it's constant for all the dll). I am able to achieve the above 2 cases by reflection mechanism. The problem is...
2009/10/21
[ "https://Stackoverflow.com/questions/1599787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193219/" ]
Have a look at this: <http://bytes.com/topic/c-sharp/answers/232691-how-dynamically-load-assembly-w-dependencies>. Basically, in the AssemblyResolve event, you need to load the referenced assemblies manually. ``` private Assembly AssemblyResolveHandler(object sender,ResolveEventArgs e) { try { string[]...
I think, it needs more explanation. Let me explain.... a. My C# program will load a dll (which is dynamic), for now let's take a.dll (similarly more dll like b.dll, c.dll, etc....). b. My program will invoke a method "Onstart" (it's constant for all the dll) inside a.dll. I am able to achieve the above 2 cases by re...
1,599,787
a. My C# program will load a dll (which is dynamic), for now let's take a.dll (similarly my program will load more dll like b.dll, c.dll, etc....). b. My program will invoke a method "Onstart" inside a.dll (it's constant for all the dll). I am able to achieve the above 2 cases by reflection mechanism. The problem is...
2009/10/21
[ "https://Stackoverflow.com/questions/1599787", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193219/" ]
Have a look at this: <http://bytes.com/topic/c-sharp/answers/232691-how-dynamically-load-assembly-w-dependencies>. Basically, in the AssemblyResolve event, you need to load the referenced assemblies manually. ``` private Assembly AssemblyResolveHandler(object sender,ResolveEventArgs e) { try { string[]...
I think you can not do anything other than adding all references which are used . ps : usually an external assembly should be complete for use (or the package will contain all needed assemblies so you can add them)
2,577,040
My question is inspired by [Functional puzzle: find $f(2)$](https://math.stackexchange.com/questions/2577003/functional-puzzle-find-f2) A function $f\colon \mathbb{R}\to\mathbb{R}$ satisfies $$f(x)=xf(x^2-3)-x$$ for all $x$. For which $x$ is the value of $f(x)$ known? I know values of $f(x)$ for $x\in\{0,\pm1,\pm2\}$...
2017/12/22
[ "https://math.stackexchange.com/questions/2577040", "https://math.stackexchange.com", "https://math.stackexchange.com/users/72361/" ]
This question is actually less well-formed than you think it is. First of all, there's the question of what 'for all $x$ means', because that isn't actually enough to specify a domain. For all $x\in\mathbb{Z}$? For all $x$ in $\mathbb{R}$? A function isn't a function unless you specify the domain *and* the range, and t...
If you know $x=0$ then you know $x^2-3=0\implies x=\pm\sqrt 3$ because: $f(\pm \sqrt 3)=\pm \sqrt 3f(0)-\pm \sqrt 3$ Now you can solve for $x^2-3=\pm\sqrt3$ with the same logic, and so on. With this you can create few sets of answers, with those you may can work to more sets(I didn't try to find the values for those...
56,029,423
I'm working on a android app that will display gemstones. Putting thumbnails in drawable-XXSIZE is not a problem, but how can I continue this with expansion files? If I create folders such as: drawable-ldpi, drawable-mdpi etc. and put everything in a zip (I can only have 2 expansion files) will I be able to download o...
2019/05/07
[ "https://Stackoverflow.com/questions/56029423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
As a note, this only happens when you run the entire code snippit as a single statement (i.e. as a script from the ISE, or copying an pasting the entire code snippit). If, instead, you run each statement line individually from the PowerShell console, you will get the expected results. As @PetSerAl says, the issue is ...
As @LotPings said, with Out-String code works as expected.
56,029,423
I'm working on a android app that will display gemstones. Putting thumbnails in drawable-XXSIZE is not a problem, but how can I continue this with expansion files? If I create folders such as: drawable-ldpi, drawable-mdpi etc. and put everything in a zip (I can only have 2 expansion files) will I be able to download o...
2019/05/07
[ "https://Stackoverflow.com/questions/56029423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
As a note, this only happens when you run the entire code snippit as a single statement (i.e. as a script from the ISE, or copying an pasting the entire code snippit). If, instead, you run each statement line individually from the PowerShell console, you will get the expected results. As @PetSerAl says, the issue is ...
This is a common gotcha. Format-table is implicitly running, and it doesn't know how to display different sets of columns. Piping the script through format-list works ok. Another weird workaround is to put get-date at the beginning of the script. For some reason, a known object type (that has a format file) at the top ...
71,443,066
after running the query: ``` SELECT title , year FROM movies WHERE title LIKE 'Harry Potter%' ORDER BY year; ``` [sql query output][1] [1]: https://i.stack.imgur.com/jb0gT.png but i want to remove title and year headers from the table. How to do that?
2022/03/11
[ "https://Stackoverflow.com/questions/71443066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18143801/" ]
I would assume that you're using class components, so the solution I would provide is for that. First step is to import ConnectedProps: ``` import { connect, ConnectedProps } from 'react-redux' ``` Next step is to define the objects that your state/reducer, so in a file that we can name `TsConnector.ts`, add someth...
Have you tried `useDispatch` and `useSelector` in ts file to get redux state ``` import { useSelector as useReduxSelector, TypedUseSelectorHook, } from 'react-redux' export const useSelector: TypedUseSelectorHook<RootState> = useReduxSelector ```
67,456,334
I'm new to Flutter and UI development in general and I'm stuck so I need some help! I'm trying to build a list of video posts in my application with lazy loading / infinite scrolling. The lazy loading part seems to be working fine but the problem I'm having is that every time new videos are loaded, the scroll goes bac...
2021/05/09
[ "https://Stackoverflow.com/questions/67456334", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7138472/" ]
you can use property of listview.builder reverse which may help for this question change reverse=true, by default reverse is false and check it.
In the `_getMore()` method we could load the videos and then scroll to the bottom. In order to do so, however, we need to be mindful to not create an infinite-loop. We could do so by the means of a `_loading` state variable: ``` bool _loading = false; @override void initState() { super.initState(); _videoResponse...
105,803
I was going to leave my company about 2 months ago, but was offered a promotion to stay. After receiving this promotion I was offered another position at a third company which is even better. Is it unprofessional for me to accept this third position so soon after accepting the promotion at my original company? How bes...
2018/01/29
[ "https://workplace.stackexchange.com/questions/105803", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/82301/" ]
There Is really no way for your present employer to see this as anything other than a slap in the face. Accept that. That said, if money were no object, would you move on? If not, then stay. Your present employer has already shown that they care enough to negotiate a promotion to retain you so you KNOW that you are va...
> > How best to accept the new position without burning bridges or seeming > to be unprofessional? > > > The only thing to do if your intent on taking the offer, is to **turn in your notice and leave**. Do it in writing of course, and when there are questions asked, be open and honest about it. Also, be prepared ...
105,803
I was going to leave my company about 2 months ago, but was offered a promotion to stay. After receiving this promotion I was offered another position at a third company which is even better. Is it unprofessional for me to accept this third position so soon after accepting the promotion at my original company? How bes...
2018/01/29
[ "https://workplace.stackexchange.com/questions/105803", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/82301/" ]
There Is really no way for your present employer to see this as anything other than a slap in the face. Accept that. That said, if money were no object, would you move on? If not, then stay. Your present employer has already shown that they care enough to negotiate a promotion to retain you so you KNOW that you are va...
We see over and over people that want to leave, and accept a counter offer, end up leaving anyway. Even in cases where the company doesn't renege on their promises, the employee still feels that there are better positions/offers/companies available. It is impossible to predict how they will feel. It is likely that you...
105,803
I was going to leave my company about 2 months ago, but was offered a promotion to stay. After receiving this promotion I was offered another position at a third company which is even better. Is it unprofessional for me to accept this third position so soon after accepting the promotion at my original company? How bes...
2018/01/29
[ "https://workplace.stackexchange.com/questions/105803", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/82301/" ]
There Is really no way for your present employer to see this as anything other than a slap in the face. Accept that. That said, if money were no object, would you move on? If not, then stay. Your present employer has already shown that they care enough to negotiate a promotion to retain you so you KNOW that you are va...
It's best to do what you feel is right. Everyone here is speaking about how you'll burn bridges, but unless your company is brand spanking new, or the HR is brand new, or your manager is brand new, it's highly likely that they know you'll be leaving soon once you put in your original notice and they asked you to come b...
105,803
I was going to leave my company about 2 months ago, but was offered a promotion to stay. After receiving this promotion I was offered another position at a third company which is even better. Is it unprofessional for me to accept this third position so soon after accepting the promotion at my original company? How bes...
2018/01/29
[ "https://workplace.stackexchange.com/questions/105803", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/82301/" ]
> > How best to accept the new position without burning bridges or seeming > to be unprofessional? > > > The only thing to do if your intent on taking the offer, is to **turn in your notice and leave**. Do it in writing of course, and when there are questions asked, be open and honest about it. Also, be prepared ...
We see over and over people that want to leave, and accept a counter offer, end up leaving anyway. Even in cases where the company doesn't renege on their promises, the employee still feels that there are better positions/offers/companies available. It is impossible to predict how they will feel. It is likely that you...
105,803
I was going to leave my company about 2 months ago, but was offered a promotion to stay. After receiving this promotion I was offered another position at a third company which is even better. Is it unprofessional for me to accept this third position so soon after accepting the promotion at my original company? How bes...
2018/01/29
[ "https://workplace.stackexchange.com/questions/105803", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/82301/" ]
It's best to do what you feel is right. Everyone here is speaking about how you'll burn bridges, but unless your company is brand spanking new, or the HR is brand new, or your manager is brand new, it's highly likely that they know you'll be leaving soon once you put in your original notice and they asked you to come b...
We see over and over people that want to leave, and accept a counter offer, end up leaving anyway. Even in cases where the company doesn't renege on their promises, the employee still feels that there are better positions/offers/companies available. It is impossible to predict how they will feel. It is likely that you...
12,992,895
For a homework assignment, I am not allowed to use any variables like "int i = 0;" -- only pointers. The problem is that I need to do something n times -- let's say 10 times -- but I can't figure out a way to do this said things n times without a for loop. It is manipulating a pointer to integer, and it is not termina...
2012/10/20
[ "https://Stackoverflow.com/questions/12992895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1661781/" ]
Maybe like this: ``` int *q = p + 10; while (p != q) { *p++ = 0; } ``` UPDATE: Doing this you would avoid using integers by just identifying a beginning (p) and an end (p + 10) and then just iterating over them. It doesn't apply to this particular case but many times you don't know (or need to know) the size of...
``` #include <stdio.h> #include <stdlib.h> int main() { int *p = (int*)malloc(sizeof(int)); for(*p = 0; *p < 10; (*p)++) printf("%d\n", (*p)); } ```
27,327,426
My function: ``` Shot *shot_collide(Shot *shot) { Shot *moving, *remaining; remaining=NULL; moving=shot; while(moving!=NULL) { if(moving->y>658) //ha eléri az alját { if(remaining==NULL) //ha ez az első elem { shot=moving->next; ...
2014/12/06
[ "https://Stackoverflow.com/questions/27327426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4330853/" ]
I think the problem is `new Array(data)`, if data is of string type then it creates an array with one element which is the string, else if data is an array then the `tArrx` will be an array with 1 element which is the array so your `$.inArray()` will always return `-1`. ``` $.ajax({ type: 'POST', url: 'loc/bch...
It seems to me that you have to cast the variables: ``` if ($.inArray(bTm.toString(), tArrx) !== -1) ```
27,327,426
My function: ``` Shot *shot_collide(Shot *shot) { Shot *moving, *remaining; remaining=NULL; moving=shot; while(moving!=NULL) { if(moving->y>658) //ha eléri az alját { if(remaining==NULL) //ha ez az első elem { shot=moving->next; ...
2014/12/06
[ "https://Stackoverflow.com/questions/27327426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4330853/" ]
You have actually created a multidimensional array ``` tArrx = new Array(data); ``` So this is how you would match your array ``` var data = ["1","2","3","4"]; var tArrx = new Array(data); confirm(tArrx[0]); confirm(data); confirm($.inArray('1', tArrx[0]) !== -1); ``` Better yet simply don't cast data to an array...
It seems to me that you have to cast the variables: ``` if ($.inArray(bTm.toString(), tArrx) !== -1) ```
27,327,426
My function: ``` Shot *shot_collide(Shot *shot) { Shot *moving, *remaining; remaining=NULL; moving=shot; while(moving!=NULL) { if(moving->y>658) //ha eléri az alját { if(remaining==NULL) //ha ez az első elem { shot=moving->next; ...
2014/12/06
[ "https://Stackoverflow.com/questions/27327426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4330853/" ]
So, I figured it out. The problem was that the PHP response was not an PHP array. To fix this I made my response an array and added this to my PHP file: ``` json_encode($tArrx); ``` And changed my jQuery as follows: ``` $.ajax({ type: 'POST', url: 'loc/bcheck.php', dataType: 'json', success: functio...
It seems to me that you have to cast the variables: ``` if ($.inArray(bTm.toString(), tArrx) !== -1) ```
27,327,426
My function: ``` Shot *shot_collide(Shot *shot) { Shot *moving, *remaining; remaining=NULL; moving=shot; while(moving!=NULL) { if(moving->y>658) //ha eléri az alját { if(remaining==NULL) //ha ez az első elem { shot=moving->next; ...
2014/12/06
[ "https://Stackoverflow.com/questions/27327426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4330853/" ]
I think the problem is `new Array(data)`, if data is of string type then it creates an array with one element which is the string, else if data is an array then the `tArrx` will be an array with 1 element which is the array so your `$.inArray()` will always return `-1`. ``` $.ajax({ type: 'POST', url: 'loc/bch...
Do you have a typo in this line: ``` if ($.inArray(bTm, tArrx) !== -1){ ``` shouldn't it be: ``` if ($.inArray(Tbm, tArrx) !== -1){ ```
27,327,426
My function: ``` Shot *shot_collide(Shot *shot) { Shot *moving, *remaining; remaining=NULL; moving=shot; while(moving!=NULL) { if(moving->y>658) //ha eléri az alját { if(remaining==NULL) //ha ez az első elem { shot=moving->next; ...
2014/12/06
[ "https://Stackoverflow.com/questions/27327426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4330853/" ]
You have actually created a multidimensional array ``` tArrx = new Array(data); ``` So this is how you would match your array ``` var data = ["1","2","3","4"]; var tArrx = new Array(data); confirm(tArrx[0]); confirm(data); confirm($.inArray('1', tArrx[0]) !== -1); ``` Better yet simply don't cast data to an array...
Do you have a typo in this line: ``` if ($.inArray(bTm, tArrx) !== -1){ ``` shouldn't it be: ``` if ($.inArray(Tbm, tArrx) !== -1){ ```
27,327,426
My function: ``` Shot *shot_collide(Shot *shot) { Shot *moving, *remaining; remaining=NULL; moving=shot; while(moving!=NULL) { if(moving->y>658) //ha eléri az alját { if(remaining==NULL) //ha ez az első elem { shot=moving->next; ...
2014/12/06
[ "https://Stackoverflow.com/questions/27327426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4330853/" ]
So, I figured it out. The problem was that the PHP response was not an PHP array. To fix this I made my response an array and added this to my PHP file: ``` json_encode($tArrx); ``` And changed my jQuery as follows: ``` $.ajax({ type: 'POST', url: 'loc/bcheck.php', dataType: 'json', success: functio...
Do you have a typo in this line: ``` if ($.inArray(bTm, tArrx) !== -1){ ``` shouldn't it be: ``` if ($.inArray(Tbm, tArrx) !== -1){ ```
332,121
I was reviewing few posts and noticed that after reviewing a particular post I get this error > > Our system has identified this post as possible spam; please review carefully > > > I immediately reverted back to check what was the 'probable' spam link. **When I looked back, there wasn't any link at all**. I'm no...
2016/08/10
[ "https://meta.stackoverflow.com/questions/332121", "https://meta.stackoverflow.com", "https://meta.stackoverflow.com/users/4046274/" ]
Posts don't have to contain links in order to be spam. They can also contain phone numbers and emails, or just plain information about a product hoping you'll be interested enough to look it up. Sometimes the algorithms that attempt to detect these things pick up false positives. That's why the message says *possible* ...
This happens when somebody has flagged the post as spam. Then the system knows that there's a reasonable chance that it is spam, and warns subsequent reviewers.
332,121
I was reviewing few posts and noticed that after reviewing a particular post I get this error > > Our system has identified this post as possible spam; please review carefully > > > I immediately reverted back to check what was the 'probable' spam link. **When I looked back, there wasn't any link at all**. I'm no...
2016/08/10
[ "https://meta.stackoverflow.com/questions/332121", "https://meta.stackoverflow.com", "https://meta.stackoverflow.com/users/4046274/" ]
A post doesn't need to have a link in it for it to be spam. I.e: Call 863-555-9385 to get **SUPER CHEAP** programming books.
This happens when somebody has flagged the post as spam. Then the system knows that there's a reasonable chance that it is spam, and warns subsequent reviewers.
332,121
I was reviewing few posts and noticed that after reviewing a particular post I get this error > > Our system has identified this post as possible spam; please review carefully > > > I immediately reverted back to check what was the 'probable' spam link. **When I looked back, there wasn't any link at all**. I'm no...
2016/08/10
[ "https://meta.stackoverflow.com/questions/332121", "https://meta.stackoverflow.com", "https://meta.stackoverflow.com/users/4046274/" ]
Posts don't have to contain links in order to be spam. They can also contain phone numbers and emails, or just plain information about a product hoping you'll be interested enough to look it up. Sometimes the algorithms that attempt to detect these things pick up false positives. That's why the message says *possible* ...
A post doesn't need to have a link in it for it to be spam. I.e: Call 863-555-9385 to get **SUPER CHEAP** programming books.
995,691
I am trying to install the `kernel-devel` package matching the running kernel version. My guess was: ``` package { 'kernel-devel': ensure => "${facts['kernelrelease']}", } ``` but it doesn't work if more than one `kernel-devel` package are already installed. This is the error I get: `Error: Could not upd...
2019/12/16
[ "https://serverfault.com/questions/995691", "https://serverfault.com", "https://serverfault.com/users/288777/" ]
Unless I am misunderstanding, you can solve this with the version in the resource title. ``` package { "kernel-devel-${facts['kernelrelease']}": ensure => present, } ``` Or, if you have other resources which depend on 'kernel-devel' you can use the name attribute. ``` package { 'kernel-devel': name => "kernel...
I've recently run into the same thing. I'm not sure there is a nice way to handle this, from bug tickets I've found apparently Puppet don't really want to acknowledge that there could be multiple versions of a package installed as it breaks their resource model. I think the only thing you can do is fall back to using ...
70,947,518
I often run into this situation while coding in Python, and am not sure which is more performant. Suppose I have a list `l = [3, 13, 6, 8, 9, 53]`, and I want to use a list comprehension to create a new list that subtracts off the minimum value so that the lowest number is zero. I could do: ```py [x - min(l) for x in ...
2022/02/01
[ "https://Stackoverflow.com/questions/70947518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2392192/" ]
It has a very large impact, you can run this quick test to see for yourself: ``` from datetime import datetime as dt now = dt.now l = [] #create list for i in range(20000): l.append(i) #mark time print(str(now().time())) #save min first min_val = min(l) new = [x - min_val for x in l] #mark time print(str(now()...
``` import time from functools import lru_cache l = [i for i in range(10000)] min_val = min(l) def f1(): min_l = [x - min(l) for x in l] def f2(): min_l = [x - min_val for x in l] @lru_cache def lru_min(x): return min(x) if __name__ == '__main__': start_time = time.time() f1() print("--- f1...
70,947,518
I often run into this situation while coding in Python, and am not sure which is more performant. Suppose I have a list `l = [3, 13, 6, 8, 9, 53]`, and I want to use a list comprehension to create a new list that subtracts off the minimum value so that the lowest number is zero. I could do: ```py [x - min(l) for x in ...
2022/02/01
[ "https://Stackoverflow.com/questions/70947518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2392192/" ]
I prefer the timeit calls from the commandline in this case as this problem isn't too complicated: ``` $ python -m timeit --setup "x = [i for i in range(1000)]" "[i - min(x) for i in x]" 50 loops, best of 5: 8.07 msec per loop $ python -m timeit --setup "x = [i for i in range(1000)]" "y = min(x);[i - y for i in x]" 10...
It has a very large impact, you can run this quick test to see for yourself: ``` from datetime import datetime as dt now = dt.now l = [] #create list for i in range(20000): l.append(i) #mark time print(str(now().time())) #save min first min_val = min(l) new = [x - min_val for x in l] #mark time print(str(now()...
70,947,518
I often run into this situation while coding in Python, and am not sure which is more performant. Suppose I have a list `l = [3, 13, 6, 8, 9, 53]`, and I want to use a list comprehension to create a new list that subtracts off the minimum value so that the lowest number is zero. I could do: ```py [x - min(l) for x in ...
2022/02/01
[ "https://Stackoverflow.com/questions/70947518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2392192/" ]
Yes, `min(l)` will be called for every iteration in the list comprehension. You can test this using your own function, as @jarmod has mentioned. Yes, this will add complexity compared to storing it in a variable, because [`min(l)` is `O(n)`](https://stackoverflow.com/questions/35386546/big-o-of-min-and-max-in-python)....
``` import time from functools import lru_cache l = [i for i in range(10000)] min_val = min(l) def f1(): min_l = [x - min(l) for x in l] def f2(): min_l = [x - min_val for x in l] @lru_cache def lru_min(x): return min(x) if __name__ == '__main__': start_time = time.time() f1() print("--- f1...
70,947,518
I often run into this situation while coding in Python, and am not sure which is more performant. Suppose I have a list `l = [3, 13, 6, 8, 9, 53]`, and I want to use a list comprehension to create a new list that subtracts off the minimum value so that the lowest number is zero. I could do: ```py [x - min(l) for x in ...
2022/02/01
[ "https://Stackoverflow.com/questions/70947518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2392192/" ]
I prefer the timeit calls from the commandline in this case as this problem isn't too complicated: ``` $ python -m timeit --setup "x = [i for i in range(1000)]" "[i - min(x) for i in x]" 50 loops, best of 5: 8.07 msec per loop $ python -m timeit --setup "x = [i for i in range(1000)]" "y = min(x);[i - y for i in x]" 10...
Yes, `min(l)` will be called for every iteration in the list comprehension. You can test this using your own function, as @jarmod has mentioned. Yes, this will add complexity compared to storing it in a variable, because [`min(l)` is `O(n)`](https://stackoverflow.com/questions/35386546/big-o-of-min-and-max-in-python)....
70,947,518
I often run into this situation while coding in Python, and am not sure which is more performant. Suppose I have a list `l = [3, 13, 6, 8, 9, 53]`, and I want to use a list comprehension to create a new list that subtracts off the minimum value so that the lowest number is zero. I could do: ```py [x - min(l) for x in ...
2022/02/01
[ "https://Stackoverflow.com/questions/70947518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2392192/" ]
There is this really cool module called timeit ... with wich you can ... timeit. Don't ask, measure: ``` import timeit def a(): l = list(range(100))[::-1] return [x - min(l) for x in l] def b(): l = list(range(100))[::-1] min_val = min(l) return [x - min_val for x in l] # do 100 calls to the giv...
``` import time from functools import lru_cache l = [i for i in range(10000)] min_val = min(l) def f1(): min_l = [x - min(l) for x in l] def f2(): min_l = [x - min_val for x in l] @lru_cache def lru_min(x): return min(x) if __name__ == '__main__': start_time = time.time() f1() print("--- f1...
70,947,518
I often run into this situation while coding in Python, and am not sure which is more performant. Suppose I have a list `l = [3, 13, 6, 8, 9, 53]`, and I want to use a list comprehension to create a new list that subtracts off the minimum value so that the lowest number is zero. I could do: ```py [x - min(l) for x in ...
2022/02/01
[ "https://Stackoverflow.com/questions/70947518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2392192/" ]
I prefer the timeit calls from the commandline in this case as this problem isn't too complicated: ``` $ python -m timeit --setup "x = [i for i in range(1000)]" "[i - min(x) for i in x]" 50 loops, best of 5: 8.07 msec per loop $ python -m timeit --setup "x = [i for i in range(1000)]" "y = min(x);[i - y for i in x]" 10...
There is this really cool module called timeit ... with wich you can ... timeit. Don't ask, measure: ``` import timeit def a(): l = list(range(100))[::-1] return [x - min(l) for x in l] def b(): l = list(range(100))[::-1] min_val = min(l) return [x - min_val for x in l] # do 100 calls to the giv...
70,947,518
I often run into this situation while coding in Python, and am not sure which is more performant. Suppose I have a list `l = [3, 13, 6, 8, 9, 53]`, and I want to use a list comprehension to create a new list that subtracts off the minimum value so that the lowest number is zero. I could do: ```py [x - min(l) for x in ...
2022/02/01
[ "https://Stackoverflow.com/questions/70947518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2392192/" ]
I prefer the timeit calls from the commandline in this case as this problem isn't too complicated: ``` $ python -m timeit --setup "x = [i for i in range(1000)]" "[i - min(x) for i in x]" 50 loops, best of 5: 8.07 msec per loop $ python -m timeit --setup "x = [i for i in range(1000)]" "y = min(x);[i - y for i in x]" 10...
``` import time from functools import lru_cache l = [i for i in range(10000)] min_val = min(l) def f1(): min_l = [x - min(l) for x in l] def f2(): min_l = [x - min_val for x in l] @lru_cache def lru_min(x): return min(x) if __name__ == '__main__': start_time = time.time() f1() print("--- f1...
9,433,667
Short question: Can anyone tell me what the requirements (especially when it comes to SQL components) are for the web server used as web sync for merge replication? Background: I have a solution which uses merge replication to do one-way data sync with the client application of the solution. The server uses SQL Ser...
2012/02/24
[ "https://Stackoverflow.com/questions/9433667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/391658/" ]
According to [How to: Configure IIS for Web Synchronization](http://msdn.microsoft.com/en-us/library/ms152511%28v=sql.105%29.aspx), Microsoft SQL Server Connectivity Components and SQL Server Management Studio will need to be installed on the computer that is running IIS by using the SQL Server Installation Wizard.
You will need SQL Server Native Client (SNAC). But as far as I'm aware, you won't need anything else on the IIS server.
26,642,433
I'm a bit confused with the counting of a string that I would enter manually. I am basically trying to count the number of words and the number of characters without spaces. Also if it would be possible, who can help with counting the vowels? This is all I have so far: ``` vowels = [ 'a','e','i','o','u','A','E','I','...
2014/10/29
[ "https://Stackoverflow.com/questions/26642433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4196251/" ]
``` s = input("Enter a sentence: ") word_count = len(s.split()) # count the words with split char_count = len(s.replace(' ', '')) # count the chars having replaced spaces with '' vowel_count = sum(1 for c in s if c.lower() in ['a','e','i','o','u']) # sum 1 for each vowel ``` **more info:** on `str.split`: <http://w...
``` vowels = [ 'a','e','i','o','u'] sentence = "Our World is a better place" count_vow = 0 count_con = 0 for x in sentence: if x.isalpha(): if x.lower() in vowels: count_vow += 1 else: count_con += 1 print count_vow,count_con ```
26,642,433
I'm a bit confused with the counting of a string that I would enter manually. I am basically trying to count the number of words and the number of characters without spaces. Also if it would be possible, who can help with counting the vowels? This is all I have so far: ``` vowels = [ 'a','e','i','o','u','A','E','I','...
2014/10/29
[ "https://Stackoverflow.com/questions/26642433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4196251/" ]
``` s = input("Enter a sentence: ") word_count = len(s.split()) # count the words with split char_count = len(s.replace(' ', '')) # count the chars having replaced spaces with '' vowel_count = sum(1 for c in s if c.lower() in ['a','e','i','o','u']) # sum 1 for each vowel ``` **more info:** on `str.split`: <http://w...
For vowels: Basic way of doing this is using a for loop and checking each character if they exist in a string, list or other sequence (vowels in this case). I think this is the way you should first learn to do it since it's easiest for beginner to understand. ``` def how_many_vowels(text): vowels = 'aeiou' vowel_...
62,270
Suggestions for other ways to describe such a person would also be appreciated
2022/06/01
[ "https://writers.stackexchange.com/questions/62270", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/52787/" ]
No, this description wouldn’t be appropriate. As Kate Gregory points out in a comment, ‘the apple of my eye’ is often used by doting parents/older relatives about children, and doesn’t work in a romantic sense. You don’t give much context so it’s difficult to suggest a useful alternative. Any one line is going to depe...
For fiction writing you need more exposition & less narrative. Narrative tells the reader. Exposition shows the reader. **Narrative Example (less good)** > > George was a nice man. > > > **Expositional Example (more good)** > > George looked at his watch and saw it was already 7:45am. Going to be > late for t...
62,270
Suggestions for other ways to describe such a person would also be appreciated
2022/06/01
[ "https://writers.stackexchange.com/questions/62270", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/52787/" ]
The answer is an emphatic yes. Further you could dress that up. In fiction, you want movement and flow, emotion, oomph, a pointed description and a hold-no-punches emphasis. *To say she was the apple of every man's eye in town was to massively, outrageously, understate the point. Clementine was far more than some comm...
For fiction writing you need more exposition & less narrative. Narrative tells the reader. Exposition shows the reader. **Narrative Example (less good)** > > George was a nice man. > > > **Expositional Example (more good)** > > George looked at his watch and saw it was already 7:45am. Going to be > late for t...
62,270
Suggestions for other ways to describe such a person would also be appreciated
2022/06/01
[ "https://writers.stackexchange.com/questions/62270", "https://writers.stackexchange.com", "https://writers.stackexchange.com/users/52787/" ]
No, this description wouldn’t be appropriate. As Kate Gregory points out in a comment, ‘the apple of my eye’ is often used by doting parents/older relatives about children, and doesn’t work in a romantic sense. You don’t give much context so it’s difficult to suggest a useful alternative. Any one line is going to depe...
The answer is an emphatic yes. Further you could dress that up. In fiction, you want movement and flow, emotion, oomph, a pointed description and a hold-no-punches emphasis. *To say she was the apple of every man's eye in town was to massively, outrageously, understate the point. Clementine was far more than some comm...
32,012
I'm working on an ASP.NET web application that will have to store sensitive information. I would like to encrypt the sensitive fields to protect against any possible SQL injection vulnerabilities. However, I also will need to report on these fields. For these reasons, I've excluded transparent database encryption (sinc...
2013/03/05
[ "https://security.stackexchange.com/questions/32012", "https://security.stackexchange.com", "https://security.stackexchange.com/users/10574/" ]
Yes, it's a good plan, but there are still a number of potential vulnerabilities. Really, the only attack that you're mitigating is the attack you mentioned, the ability to grab the cleartext data with an arbitrary SQL statement. You're not mitigating any other attacks, for instance, a malicious user who uses SQL injec...
> > I would like to encrypt the sensitive fields to protect against any possible SQL injection vulnerabilities. > > > This is probably wrong at the outset. If your database is accessed through the application, in what circumstance would the application not decrypt the data? SQL injection is an application vulnerab...
32,012
I'm working on an ASP.NET web application that will have to store sensitive information. I would like to encrypt the sensitive fields to protect against any possible SQL injection vulnerabilities. However, I also will need to report on these fields. For these reasons, I've excluded transparent database encryption (sinc...
2013/03/05
[ "https://security.stackexchange.com/questions/32012", "https://security.stackexchange.com", "https://security.stackexchange.com/users/10574/" ]
Yes, it's a good plan, but there are still a number of potential vulnerabilities. Really, the only attack that you're mitigating is the attack you mentioned, the ability to grab the cleartext data with an arbitrary SQL statement. You're not mitigating any other attacks, for instance, a malicious user who uses SQL injec...
I second @Jeff Ferland in that there is a confusing statement in your question: > > I would like to encrypt the sensitive fields to protect against any > possible SQL injection vulnerabilities > > > SQL injection is an application level problem, while DB encryption is meant to avoid insider threat, or someone wh...
32,012
I'm working on an ASP.NET web application that will have to store sensitive information. I would like to encrypt the sensitive fields to protect against any possible SQL injection vulnerabilities. However, I also will need to report on these fields. For these reasons, I've excluded transparent database encryption (sinc...
2013/03/05
[ "https://security.stackexchange.com/questions/32012", "https://security.stackexchange.com", "https://security.stackexchange.com/users/10574/" ]
> > I would like to encrypt the sensitive fields to protect against any possible SQL injection vulnerabilities. > > > This is probably wrong at the outset. If your database is accessed through the application, in what circumstance would the application not decrypt the data? SQL injection is an application vulnerab...
I second @Jeff Ferland in that there is a confusing statement in your question: > > I would like to encrypt the sensitive fields to protect against any > possible SQL injection vulnerabilities > > > SQL injection is an application level problem, while DB encryption is meant to avoid insider threat, or someone wh...
31,361,930
I want to make an array of players sorted in order of salary from the following XML. Notice that I already sort the basketball teams by salary. ``` <?php $string = <<<EOS <Sports_Team> <Basketball> <Players>Tom, Jack, Sue</Players> <salary>4</salary> </Basketball> <Basketball> <Players>Josh, Lee, Carter, Bennett</Play...
2015/07/11
[ "https://Stackoverflow.com/questions/31361930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2237387/" ]
Basically you have done everything perfectly right, except a couple of tiny bits which i will address bellow :) * In your user-defined comparison function 'sort\_trees', best to compare integer directly and not the string, so no need to compare string using (strcmp). * Also you could use `uasort()` method instead of `...
Assuming you have PHP 5.3+, try this: ``` $playersArray = array_map( create_function('$inputArray', 'return (string) $inputArray->Players;'), $trees ); ``` For example: ``` php > var_dump($playersArray); array(3) { [0]=> string(18) "Mary, Jimmy, Nancy" [1]=> string(26) "Josh, Lee, Carter, Bennett" ...
67,817,640
I want to use json schema in order to validate something like this: ```json { "function_mapper": { "critical": [ "DataContentValidation.get_multiple_types_columns", "DataContentValidation.get_invalid_session_ids" ], "warning": [ "DataContentValidation.get_columns_if_most_data_null", ...
2021/06/03
[ "https://Stackoverflow.com/questions/67817640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15414616/" ]
`.Find` returns a range object. Is this what you are trying? ``` Option Explicit Sub Sample() Dim wb As Workbook: Set wb = ThisWorkbook Dim ws As Worksheet: Set ws = wb.Sheets("worksheet1") Dim lo As ListObject: Set lo = ws.ListObjects("Table1") Dim aCell As Range Set aCell = lo.HeaderRowRange.Fin...
There are several way to access the column in `listobject table` other than `hearderRow`, hope you find it useful ``` Sub tt() Dim tb1 As ListObject Dim rcol As Range Set tb1 = Sheet1.ListObjects("Table1") Set rcol = tb1.ListColumns("Ctry").DataBodyRange Debug.Print rcol(3).Value 'Hawaii End Sub ``` [![enter im...
67,817,640
I want to use json schema in order to validate something like this: ```json { "function_mapper": { "critical": [ "DataContentValidation.get_multiple_types_columns", "DataContentValidation.get_invalid_session_ids" ], "warning": [ "DataContentValidation.get_columns_if_most_data_null", ...
2021/06/03
[ "https://Stackoverflow.com/questions/67817640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15414616/" ]
As I know the name of the column header, I can simply use this code to get the column count w/in the ListObject: ``` j= lo.ListColumns("Column3").Index ```
There are several way to access the column in `listobject table` other than `hearderRow`, hope you find it useful ``` Sub tt() Dim tb1 As ListObject Dim rcol As Range Set tb1 = Sheet1.ListObjects("Table1") Set rcol = tb1.ListColumns("Ctry").DataBodyRange Debug.Print rcol(3).Value 'Hawaii End Sub ``` [![enter im...
67,817,640
I want to use json schema in order to validate something like this: ```json { "function_mapper": { "critical": [ "DataContentValidation.get_multiple_types_columns", "DataContentValidation.get_invalid_session_ids" ], "warning": [ "DataContentValidation.get_columns_if_most_data_null", ...
2021/06/03
[ "https://Stackoverflow.com/questions/67817640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15414616/" ]
As I know the name of the column header, I can simply use this code to get the column count w/in the ListObject: ``` j= lo.ListColumns("Column3").Index ```
`.Find` returns a range object. Is this what you are trying? ``` Option Explicit Sub Sample() Dim wb As Workbook: Set wb = ThisWorkbook Dim ws As Worksheet: Set ws = wb.Sheets("worksheet1") Dim lo As ListObject: Set lo = ws.ListObjects("Table1") Dim aCell As Range Set aCell = lo.HeaderRowRange.Fin...
21,703,537
I have the following code for responsive fonts: ``` @media all and (max-width: 1200px) { /* screen size until 1200px */ body { font-size: 1.5em; /* 1.5x default size */ } } @media all and (max-width: 1000px) { /* screen size until 1000px */ body { font-size: 1.2em; /* 1.2x default size */ ...
2014/02/11
[ "https://Stackoverflow.com/questions/21703537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3157384/" ]
Here's a simple formula to convert from px to em: ``` Size in em = size in pixels / parent size in pixels ``` **Example**: 21px / 14px = 1.5em and back: ``` Size in px = size in EMs * parent size in pixels ``` **Example**: 1.5em \* 14px = 21px PS: 14px is the default font size in Bootstrap. [Source](http://getb...
The `em` unit always uses the unit of the parent element as the base. e.g. if your `body` has a `font-size` of `12px`, then setting `1em` on a child element would also render it with `12px` (1em = 100%) From then on, you can use sites like <http://pxtoem.com/> to calculate the appropriate `em` values you're trying to...
21,703,537
I have the following code for responsive fonts: ``` @media all and (max-width: 1200px) { /* screen size until 1200px */ body { font-size: 1.5em; /* 1.5x default size */ } } @media all and (max-width: 1000px) { /* screen size until 1000px */ body { font-size: 1.2em; /* 1.2x default size */ ...
2014/02/11
[ "https://Stackoverflow.com/questions/21703537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3157384/" ]
Since this is the body font-size, 1.5em should equal to 24px. **em** always use his parent element as its base but, relative em or **rem** doesn't use his immediate parent; It uses the html or body font-size. e.g. ``` body{ font-size:1em = 16px } .container{ font-size:1em = 16px font-size:0.75em = 12px } ```
Here's a simple formula to convert from px to em: ``` Size in em = size in pixels / parent size in pixels ``` **Example**: 21px / 14px = 1.5em and back: ``` Size in px = size in EMs * parent size in pixels ``` **Example**: 1.5em \* 14px = 21px PS: 14px is the default font size in Bootstrap. [Source](http://getb...
21,703,537
I have the following code for responsive fonts: ``` @media all and (max-width: 1200px) { /* screen size until 1200px */ body { font-size: 1.5em; /* 1.5x default size */ } } @media all and (max-width: 1000px) { /* screen size until 1000px */ body { font-size: 1.2em; /* 1.2x default size */ ...
2014/02/11
[ "https://Stackoverflow.com/questions/21703537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3157384/" ]
Since this is the body font-size, 1.5em should equal to 24px. **em** always use his parent element as its base but, relative em or **rem** doesn't use his immediate parent; It uses the html or body font-size. e.g. ``` body{ font-size:1em = 16px } .container{ font-size:1em = 16px font-size:0.75em = 12px } ```
The `em` unit always uses the unit of the parent element as the base. e.g. if your `body` has a `font-size` of `12px`, then setting `1em` on a child element would also render it with `12px` (1em = 100%) From then on, you can use sites like <http://pxtoem.com/> to calculate the appropriate `em` values you're trying to...
39,860,225
I have a "document" model, an upload system using dropzone.js and the register/login. Im now lost on how to apply permissions to each individual uploaded **File** so only the specified users can access them. Basically: File1->accessible\_by = user1,user2 File2->accesible\_by=user3,user5... And so on. Thanks to anyo...
2016/10/04
[ "https://Stackoverflow.com/questions/39860225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6900730/" ]
Just return a `(payload)` from weave. It will be a `HashMap`.
You can do that without DataWeave too, like below - ``` <json:json-to-object-transformer returnClass="java.util.HashMap" doc:name="JSON to Object" /> ```
72,709,031
My code is failing this testcase. Can someone please help me understand what is incorrect with my code? Input: "badc" "baba" Output: true Expected: false ``` class Solution(object): def isIsomorphic(self, s, t): """ :type s: str :type t: str :rtype: bool """ dict = ...
2022/06/22
[ "https://Stackoverflow.com/questions/72709031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13144897/" ]
This works but i would prefer not to hardcode in the where clause of the 2nd query in this union : ``` select st.ID "Student ID", st.Name "Name", round(avg(scr.Score),0) "Average Score" from Student st LEFT OUTER JOIN Score scr on st.ID = scr.Student where scr.ID < 9 Group by st.ID union select st.ID "Student ID", st....
All you need is to use `ISNULL` ```sql SELECT st.ID "Student ID", st.Name "Name", round(avg(ISNULL(scr.Score, -1)), 0) "Av Score" FROM Student st LEFT OUTER JOIN Score scr on st.ID = scr.Player WHERE scr.ID < 9 -- Because records greater have been known to be false and we don't need them GROUP...
72,709,031
My code is failing this testcase. Can someone please help me understand what is incorrect with my code? Input: "badc" "baba" Output: true Expected: false ``` class Solution(object): def isIsomorphic(self, s, t): """ :type s: str :type t: str :rtype: bool """ dict = ...
2022/06/22
[ "https://Stackoverflow.com/questions/72709031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13144897/" ]
An outer join works thus: If there are matching rows, they get joined (just like with an inner join). If there are no matching rows, you still get a joined row, but the columns of the outer joined table are set to null. You want to outer join all scores below nine. Instead you outer join all scores: ``` LEFT OUTER JO...
All you need is to use `ISNULL` ```sql SELECT st.ID "Student ID", st.Name "Name", round(avg(ISNULL(scr.Score, -1)), 0) "Av Score" FROM Student st LEFT OUTER JOIN Score scr on st.ID = scr.Player WHERE scr.ID < 9 -- Because records greater have been known to be false and we don't need them GROUP...
32,973,285
``` class Example { @Override protected void finalize() { System.out.println("Object getting garbage collected"); } } public class GarbageCollectionDemo { public static void main(String [] args) { Example e1 = new Example(); { Example e2 = new Example(); ...
2015/10/06
[ "https://Stackoverflow.com/questions/32973285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5249269/" ]
You can interact with the GC using references, like for example shown [here](http://pawlan.com/monica/articles/refobjs/). In particular, keeping a reference (created with a ReferenceQueue) to your object gives you an option to be notified when the object is GC-ed.
Try to read first [Why not to use finalize() method in java](http://howtodoinjava.com/2012/10/31/why-not-to-use-finalize-method-in-java/), before take a look deeper in my answer. In most cases, you can find a better solution, then to rely on finalize method behaviour. If you still need to use `finalize()`, for some re...
37,069,678
``` string x = "alok b"; string y = "alok b"; string z = "alok"; //y += x.Replace(y, string.Empty); z += " b"; Console.WriteLine(object.ReferenceEquals(x,y)); Console.WriteLine(object.ReferenceEquals(y, z)); ``` How is first line is printing `true` and second `false`? and changing to below statement is printing ...
2016/05/06
[ "https://Stackoverflow.com/questions/37069678", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4576125/" ]
It's called [string interning](http://www.c-sharpcorner.com/UploadFile/d551d3/what-is-string-interning/).
When you create a string it creates an object (`x`). when you create `y`, you just point to it"again", it points to the same one (has it). When you create Z, and the do the `+=` it creates a NEW one altogether, hence, it won't match the address in the memory for the previous one.
40,503,793
I am reading a txt file of multiple pipe delimited records, each token of records corresponds to unique key and different value. I need to compare each record values (with same keys). To compare this I want to use HashMap to store first record then will iterate and store second record. After that will compare both hash...
2016/11/09
[ "https://Stackoverflow.com/questions/40503793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2076174/" ]
You probably need to use [@RepositoryRestController](http://docs.spring.io/spring-data/rest/docs/current/reference/html/#customizing-sdr.overriding-sdr-response-handlers) for this. It lets you get stuff from the @Repository and then add new things to the response object. Pretty similar to @RestController, but keeps Spr...
you could add Interceptor implementing [HandleInterceptor](http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/servlet/HandlerInterceptor.html) and add it to mapped inteceptor bean. ``` @Bean public MappedInterceptor myMappedInterceptor() { return new MappedInterceptor(new String[]{"/**"...
430,410
The CS inequality is given by > > $$x\_1y\_1 + x\_2y\_2 \leq \sqrt{x\_1^2 + x\_2^2}\sqrt{y\_1^2 + y\_2^2}$$ > > > I read that if $x\_1 = cy\_1$ and $x\_2 = cy\_2$, then equality holds. But I reduced the above to $c \leq \sqrt{c^2} = |c|$. So isn't this only true if $c > 0$?
2013/06/26
[ "https://math.stackexchange.com/questions/430410", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26728/" ]
Assume $x\_1,\dots,y\_2$ are real numbers. We have $$(x\_1^2+x\_2^2)(y\_1^2+y\_2^2)-(x\_1y\_1+x\_2y\_2)^2=(x\_1y\_2-x\_2y\_1)^2.$$ This is the case $n=2$ of an identity due to Lagrange. (See more on this, positive polynomials, sums of squares of polynomials, and Hilbert's 17th problem, in [this](http://andrescaicedo....
$c\le|c|$ ins't restricts to $c>0$
430,410
The CS inequality is given by > > $$x\_1y\_1 + x\_2y\_2 \leq \sqrt{x\_1^2 + x\_2^2}\sqrt{y\_1^2 + y\_2^2}$$ > > > I read that if $x\_1 = cy\_1$ and $x\_2 = cy\_2$, then equality holds. But I reduced the above to $c \leq \sqrt{c^2} = |c|$. So isn't this only true if $c > 0$?
2013/06/26
[ "https://math.stackexchange.com/questions/430410", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26728/" ]
Assume $x\_1,\dots,y\_2$ are real numbers. We have $$(x\_1^2+x\_2^2)(y\_1^2+y\_2^2)-(x\_1y\_1+x\_2y\_2)^2=(x\_1y\_2-x\_2y\_1)^2.$$ This is the case $n=2$ of an identity due to Lagrange. (See more on this, positive polynomials, sums of squares of polynomials, and Hilbert's 17th problem, in [this](http://andrescaicedo....
Suppose $(x\_1,x\_2)=c(y\_1,y\_2)$, then $$ \begin{align} x\_1y\_1+x\_2y\_2&=cy\_1^2+cy\_2^2\\ x\_1^2+x\_2^2&=c^2y\_1^2+c^2y\_2^2 \end{align} $$ Therefore, $$ \begin{align} x\_1y\_1+x\_2y\_2 &=\frac{c}{|c|}\sqrt{x\_1^2+x\_2^2}\sqrt{y\_1^2+y\_2^2}\\ &=\pm\sqrt{x\_1^2+x\_2^2}\sqrt{y\_1^2+y\_2^2} \end{align} $$ Thus, the ...
36,891,399
I want to launch an RDS instance from CloudFormation. I am constructing the JSON template based on the AWS documentation . I want to set the *PreferredBackupWindow* parameter, but there is no example how to enter it's value. I want to set it to create a snapshot every day at 6 in the morning. How should I write it?...
2016/04/27
[ "https://Stackoverflow.com/questions/36891399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1163667/" ]
The preferred backup and maintenance can be set as the following string inputs: ``` MySQLDatabase: Type: 'AWS::RDS::DBInstance' Properties: ... PreferredBackupWindow: "22:30-23:30" PreferredMaintenanceWindow: "mon:23:30-tue:00:30" ... ``` Please note that the time is set according to the UTC time...
You can enter string in following format hh24:mi-hh24:mi (24H Clock UTC). For Example: ``` "PreferredBackupWindow": "19:30-20:00" ```
99,482
Over on SO several questions have been tagged as [compass](/questions/tagged/compass "show questions tagged 'compass'") when they should have been classified as [compass-css](/questions/tagged/compass-css "show questions tagged 'compass-css'") instead. What's the proper process for requesting they get retagged properly...
2011/07/22
[ "https://meta.stackexchange.com/questions/99482", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/136062/" ]
The numbered versions for Mac OS X tags do not appear to be that popular: * [macosx-10.5](/questions/tagged/macosx-10.5 "show questions tagged 'macosx-10.5'") = 80 questions * [osx-10.6](/questions/tagged/osx-10.6 "show questions tagged 'osx-10.6'") = 18 questions * [osx-10.7](/questions/tagged/osx-10.7 "show question...
I've got no problem with setting up suitable synonyms, but given that Apple are referring to their own operating system as 'OS X Lion' rather than '10.7' (<http://www.apple.com/macosx/>) I have to respectfully suggest that your current choice of preferred synonym is incorrect.
99,482
Over on SO several questions have been tagged as [compass](/questions/tagged/compass "show questions tagged 'compass'") when they should have been classified as [compass-css](/questions/tagged/compass-css "show questions tagged 'compass-css'") instead. What's the proper process for requesting they get retagged properly...
2011/07/22
[ "https://meta.stackexchange.com/questions/99482", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/136062/" ]
I've got no problem with setting up suitable synonyms, but given that Apple are referring to their own operating system as 'OS X Lion' rather than '10.7' (<http://www.apple.com/macosx/>) I have to respectfully suggest that your current choice of preferred synonym is incorrect.
Since [lion](/questions/tagged/lion "show questions tagged 'lion'") was far and away the most popular, I went with [Daniel's suggestion](https://meta.stackexchange.com/questions/99481/add-lion-tag-to-synonyms-for-osx-10-7/99487#99487) and merged / synonymized [osx-10.7](/questions/tagged/osx-10.7 "show questions tagged...
99,482
Over on SO several questions have been tagged as [compass](/questions/tagged/compass "show questions tagged 'compass'") when they should have been classified as [compass-css](/questions/tagged/compass-css "show questions tagged 'compass-css'") instead. What's the proper process for requesting they get retagged properly...
2011/07/22
[ "https://meta.stackexchange.com/questions/99482", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/136062/" ]
The numbered versions for Mac OS X tags do not appear to be that popular: * [macosx-10.5](/questions/tagged/macosx-10.5 "show questions tagged 'macosx-10.5'") = 80 questions * [osx-10.6](/questions/tagged/osx-10.6 "show questions tagged 'osx-10.6'") = 18 questions * [osx-10.7](/questions/tagged/osx-10.7 "show question...
Since [lion](/questions/tagged/lion "show questions tagged 'lion'") was far and away the most popular, I went with [Daniel's suggestion](https://meta.stackexchange.com/questions/99481/add-lion-tag-to-synonyms-for-osx-10-7/99487#99487) and merged / synonymized [osx-10.7](/questions/tagged/osx-10.7 "show questions tagged...
8,147
My fellow mathematicians Paul and Sam are very fond of mathematical puzzles. One day, I came up with the idea on mathematical puzzles while three of us having lunch together. I: Hey, guys. I am thinking of two integers which are greater than or equal to 2. I will tell you the product and the sum of two numbers. Why do...
2015/01/25
[ "https://puzzling.stackexchange.com/questions/8147", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/3914/" ]
The numbers are > > 6 and 2 > > > Explanation > > P gets 12 and S gets 8 > > P knows the numbers are (4, 3) or (6, 2), so replies I don't know > > S knows the numbers are (2, 6) or (4, 4) but can not be (3, 5) as P doesn't know the answer, so still replies I don't know > > Suddenly P realizes that...
In the accepted answer the second bonus question is answered incorrectly: > > What is the largest possible number of "I don't know" before one can answer "I know" when solving two integers? > > > It should be like that: > > 3 don't knows: 4,4 > > 4 don't knows: 2,8 > > 5 don't knows: 4,6 > > 6 and ...
4,465,444
I'm a programmer and trying to create a hash function that reliably distributes features over a length of data based on probability and seed. A generative algorithm of this kind would be simple to make but I want to make in the form of a hash so that I can process the data in parallel without intercommunication. Anywa...
2022/06/04
[ "https://math.stackexchange.com/questions/4465444", "https://math.stackexchange.com", "https://math.stackexchange.com/users/318301/" ]
Perhaps what you seek is the negative binomial law, that gives the number of trials you need to obtain $k$ successes. <https://en.wikipedia.org/wiki/Negative_binomial_distribution>
Based on your question, I *think* you are trying to sample numbers drawn from the binomial distribution, by transforming a uniformly-distributed random number into a number distributed according to the binomial distribution. You are correct to point out that the formula you have is "inside-out" - but in the case of a d...
4,465,444
I'm a programmer and trying to create a hash function that reliably distributes features over a length of data based on probability and seed. A generative algorithm of this kind would be simple to make but I want to make in the form of a hash so that I can process the data in parallel without intercommunication. Anywa...
2022/06/04
[ "https://math.stackexchange.com/questions/4465444", "https://math.stackexchange.com", "https://math.stackexchange.com/users/318301/" ]
Addendum added to respond to the comment of Kevin. --- The Math can be *programmatically* manually derived. You have that $$p(x) = \binom{n}{x} p^x q^{n-x}. \tag1 $$ This answer assumes that you are looking for the positive integer $x$ that comes closest to satisfying the above constraint. If that is not the case,...
Based on your question, I *think* you are trying to sample numbers drawn from the binomial distribution, by transforming a uniformly-distributed random number into a number distributed according to the binomial distribution. You are correct to point out that the formula you have is "inside-out" - but in the case of a d...
50,376,116
I am quite new in C# and I found something unexpected in string comparison which I don't really understand. Can someone please explain me why the comparison between characters gave the opposite result as the comparison of one character length strings in the following code ? I expected that `"9" < "="` will be `true`...
2018/05/16
[ "https://Stackoverflow.com/questions/50376116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9801081/" ]
This is because [String.Compare](https://msdn.microsoft.com/en-us/library/84787k22(v=vs.110).aspx) uses word sort orders by default, rather than numeric values for characters. It just happens to be that for the culture being used, `9` comes before `=` in the sort order. If you specify Ordinal (binary) sort rules, ment...
In the case of character comparison, the characters will be cast to an `int` corresponding to the ASCII value. `9` has an ASCII value of 57, and `=` has a value of 61. This means that string comparison and character comparison aren't comparing exactly the same thing (which is why they may have different results).