qid
int64
20
74.4M
question
stringlengths
36
16.3k
date
stringlengths
10
10
metadata
listlengths
3
3
response_j
stringlengths
33
24k
response_k
stringlengths
33
23k
1,202,075
I would like to update a table in mySql with data from another table. I have two tables "people" and "business". The people table is linked to the business table by a column called "business\_id". The necessary table structure, primary key is starred (Table: columns): People: \*business\_id, \*sort\_order, email Bu...
2009/07/29
[ "https://Stackoverflow.com/questions/1202075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/54259/" ]
``` UPDATE business b, people p SET b.email = p.email WHERE b.business_id = p.business_id AND p.sort_order = '1' AND b.email = '' ```
Note, if sort\_order is an INT, then don't use '1' - use 1: ``` UPDATE business b JOIN People p ON p.business_id = b.business_id AND p.sort_order = '1' SET b.email = p.email WHERE b.email = ''; ```
1,202,075
I would like to update a table in mySql with data from another table. I have two tables "people" and "business". The people table is linked to the business table by a column called "business\_id". The necessary table structure, primary key is starred (Table: columns): People: \*business\_id, \*sort\_order, email Bu...
2009/07/29
[ "https://Stackoverflow.com/questions/1202075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/54259/" ]
``` UPDATE business b, people p SET b.email = p.email WHERE b.business_id = p.business_id AND p.sort_order = '1' AND b.email = '' ```
Try this, it works fine for me. ``` Update table a, table b Set a.importantField = b.importantField, a.importantField2 = b.importantField2 where a.matchedfield = b.matchedfield; ```
1,202,075
I would like to update a table in mySql with data from another table. I have two tables "people" and "business". The people table is linked to the business table by a column called "business\_id". The necessary table structure, primary key is starred (Table: columns): People: \*business\_id, \*sort\_order, email Bu...
2009/07/29
[ "https://Stackoverflow.com/questions/1202075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/54259/" ]
Note, if sort\_order is an INT, then don't use '1' - use 1: ``` UPDATE business b JOIN People p ON p.business_id = b.business_id AND p.sort_order = '1' SET b.email = p.email WHERE b.email = ''; ```
Try this, it works fine for me. ``` Update table a, table b Set a.importantField = b.importantField, a.importantField2 = b.importantField2 where a.matchedfield = b.matchedfield; ```
40,407,955
I have component that renders jsx like this ``` <section> <div> <input type="text" class="hide" /> <button id={item.uniqueID}>show input</button> </div> <div> <input type="text" class="hide" /> <button id={item.uniqueID}>show input</button> </div> <div> <i...
2016/11/03
[ "https://Stackoverflow.com/questions/40407955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/455340/" ]
If it were me I would make a new component out of: show input Lets call it `<InputToggler/>` and then it would have a state of inputHidden for its own input and use classes to determine if it should show or not and the button would have an onclick handler to toggle the state of hidden or shown. Here is a pen showing...
This is the concept not the exact code. Each button should have onClick with callback to a function ex. toggleShow ``` <button id={item.uniqueID} onClick={this.toggleShow.bind(this)}>show input</button> ``` toggleShow do something like: ``` toggleShow(e){ var item = e.target.id; this.setState({inputClassNa...
35,917,100
I am developing an Android app. In my app I need to work with tabs. But when I add tabs to TabLayout in code, it is throwing error. What is wrong with my code? This is my tablayout XML in custom action bar: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/andr...
2016/03/10
[ "https://Stackoverflow.com/questions/35917100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4675736/" ]
Your id of TabLayout in your xml is `@+id/tab_layout"` but you're finding the view with id `main_tab_layout` in your Activity. Line `tabLayout = (TabLayout)findViewById(R.id.main_tab_layout);` It should be `tabLayout = (TabLayout)findViewById(R.id.tab_layout);`
I believe that you are referencing the wrong tablayout. You define android:id="@+id/tab\_layout" in your xml but you are looking for tabLayout = (TabLayout)findViewById(R.id.main\_tab\_layout);. Try changing findViewById(R.id.main\_tab\_layout) to findViewById(R.id.tab\_layout). If this doesn't work could you includ...
26,455,839
I just came across this code: ``` array_filter(array_map('intval', $array)); ``` It seems to return all entries of $array converted to int where the number is > 0. However, I can't see on the manual page that this is defined. It is supposed to return the array value if the callback function evaluates to true. But t...
2014/10/19
[ "https://Stackoverflow.com/questions/26455839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/123594/" ]
Removes empty or equivalent values from array: ``` $entry = array( 0 => 'foo', 1 => false, 2 => -1, 3 => null, 4 => '', 5 => 0 ); print_r(array_filter($entry)); ``` **Result** ``` Array ( [0] => foo [2] => -1 ) ``` See the [original documentation](http://php.net/manual/en/function...
If you read just a little further on the page to which you linked, you find, "If no callback is supplied, all entries of array equal to FALSE (see converting to boolean) will be removed."
329,336
In my quest to better my experience in my windows 7 environment, I have installed cygwin and have started using mintty as my command line interface tool. This has been nice and takes me back to my more productive days in working in a unix environment. There is one annoying thing however, that I can't seem to get worki...
2011/08/29
[ "https://superuser.com/questions/329336", "https://superuser.com", "https://superuser.com/users/27663/" ]
I'm not sure of the answer to your question, but here are a few things that might help: * Check that the `PATHEXT` environment variable includes `.BAT`. * Read about the `noacl` option [here](http://www.cygwin.com/cygwin-ug-net/using.html). It seems that you might do better to remove `noacl`, and spend some time getti...
For those who uses `noacl` options (the only sane option to live outside of Cygwin) add single colon `:` as a first line of your batch file. Official docs says: > > Files ending in certain extensions (.exe, .com, .lnk) are assumed > to be executable. Files whose first two characters > are "#!", "MZ", or ":\n" are ...
63,595,089
I'm trying to set chrome as default browser for launching jupyter notebook. For this i'm following the usual steps- 1. In anaconda prompt, i fired- `jupyter notebook --generate-config` ,a config file 'jupyter\_notebook\_config.py' is created. 2. Opened the file in notepad & change the line `# c.NotebookApp.browser = '...
2020/08/26
[ "https://Stackoverflow.com/questions/63595089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13994287/" ]
In windows 10 - Goto file explorer - browse to C:\Users\your user name\AppData\Roaming\jupyter\runtime. Locate the nbserver-####-open.html files. Right click anyone of them. Select Properties (at bottom). With popup window, choose OPEN WITH: change button (at top) and select browser of your choice.
Why are you running `python jupyter_notebook_config.py`? You are supposed to run `jupyter notebook` in the console. and *jupyter* should ideally read off the `config`, and you should get something like : ``` The Jupyter Notebook is running at: [I 03:33:00.085 NotebookApp] http://localhost:8888/?token=... ```
52,220,105
I want to format pagination in laravel like this: ``` api/posts?from=1&to=10 ``` I tried: ``` $posts = new LengthAwarePaginator(Post::all(), 100, 10); return $posts->toArray(); ``` Which didn’t work at all :( Please help
2018/09/07
[ "https://Stackoverflow.com/questions/52220105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9764412/" ]
Try this ``` $x = array_search ('english', $request->all()); ```
use ``` $x = array_keys ($request->all(),'english'); ``` returns all the keys having value english if given only the array returns all the keys. The search field is included as a second parameter to get keys for the given search value and there is a optional third parameter strict which may be either true or false...
69,254,790
I have a small issue with my application that I spotted when testing it. I have a `println` statement that should run to inform the user they have entered an invalid **product code**. I have a **for-loop** that will run through an Array List of objects where an if statement will match each item in said Array List to a...
2021/09/20
[ "https://Stackoverflow.com/questions/69254790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16740107/" ]
Separate out the printing from the looping: Loop through the list until you find the item: ``` Report r = null; for (int i = 0; i < report.size(); ++i) { if (report.get(i).code.equals(searchTerm)) { r = report.get(i); break; } } // or for (Report rep : report) { if (rep.code.equals(searchTerm)) { ...
Use a boolean flag to detect if the product is found: ``` boolean found = false; for (int i = 0; i < report.size(); i++) { if (report.get(i).code.equals(searchTerm)) { System.out.println("****************************************************************************" ...
69,254,790
I have a small issue with my application that I spotted when testing it. I have a `println` statement that should run to inform the user they have entered an invalid **product code**. I have a **for-loop** that will run through an Array List of objects where an if statement will match each item in said Array List to a...
2021/09/20
[ "https://Stackoverflow.com/questions/69254790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16740107/" ]
Use a boolean flag to detect if the product is found: ``` boolean found = false; for (int i = 0; i < report.size(); i++) { if (report.get(i).code.equals(searchTerm)) { System.out.println("****************************************************************************" ...
Switch the data structure used for searching the items in 'report' from a List to HashMap to avoid having to loop through all of them: ``` HashMap<String, Integer> quickSearchMapping; quickSearchMapping = new HashMap<>(); for(int i=0 ; i<report.size ; i++ ){ quickSearchMapping.put(report.get(i).code, i); } while...
69,254,790
I have a small issue with my application that I spotted when testing it. I have a `println` statement that should run to inform the user they have entered an invalid **product code**. I have a **for-loop** that will run through an Array List of objects where an if statement will match each item in said Array List to a...
2021/09/20
[ "https://Stackoverflow.com/questions/69254790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16740107/" ]
Separate out the printing from the looping: Loop through the list until you find the item: ``` Report r = null; for (int i = 0; i < report.size(); ++i) { if (report.get(i).code.equals(searchTerm)) { r = report.get(i); break; } } // or for (Report rep : report) { if (rep.code.equals(searchTerm)) { ...
Switch the data structure used for searching the items in 'report' from a List to HashMap to avoid having to loop through all of them: ``` HashMap<String, Integer> quickSearchMapping; quickSearchMapping = new HashMap<>(); for(int i=0 ; i<report.size ; i++ ){ quickSearchMapping.put(report.get(i).code, i); } while...
47,061,829
I'm trying to get image format plugins working on Android. My plan is to build this [APNG](https://github.com/Skycoder42/qapng) image format plugin, which closely follows the style of the official Qt extra [image format plugins](http://doc.qt.io/qt-5/qtimageformats-index.html). The answer to my problem will be the sam...
2017/11/01
[ "https://Stackoverflow.com/questions/47061829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1964167/" ]
Following @Felix answer, `ANDROID_EXTRA_PLUGINS` is correct, but how it works is a bit strange. Following a discussion on the lack of doc for this feature [here](https://bugreports.qt.io/browse/QTBUG-60022), and some trial and error, i found that; `ANDROID_EXTRA_PLUGINS` must specify a *directory*, not a file. So you...
The answer is on the same site, a little lower on the page: [Android-specific qmake Variables](https://doc.qt.io/qt-5/deployment-android.html#android-specific-qmake-variables) The one you are looking for is most likely `ANDROID_EXTRA_PLUGINS`. There is no usage example, so you will have to try out in wich format to ad...
421,335
So here's the question: ***We want to design a circuit that determines if a four-bit number is less than 10 and is also even.*** ***a. (10 points) Write an expression of M such that M=1 if the four-bit number X (x3 x2 x1 x0) is less than 10 and is also even.*** Is this asking for the answer in POS form since it is u...
2019/02/09
[ "https://electronics.stackexchange.com/questions/421335", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/212333/" ]
They probably want the simplest form.
Yes. The conventional representation for the POS form is M(.). Now, since the last bit for the even numbers is 0, it is enough to have 3 bits will all numbers from 0 to 4. So, we just need a mod 5 counter to generate all these numbers and the last bit of the four bits (LSB) being grounded always.
48,333,458
I want to repeat data using div and in this div , I have one more repeatation using id value from first repeatation. So I want to pass this value using function in ng-init but got me error. ``` <div ng-controller="ProductsCtrl" ng-init="getData()"> <div class="col-sm-12" ng-repeat="data in fo...
2018/01/19
[ "https://Stackoverflow.com/questions/48333458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7942721/" ]
You can use nested for loops to loop through all arguments. `argc` will tell you number of arguments, while `argv` contains the array of arrays. I also used `strlen()` function from `strings` library. It will tell you how long a string is. This way you can check for any number of arguments. Your *if* statement can also...
While you can use multiple conditional expressions to test if the current character is a vowel, it is often beneficial to create a constant string containing all possible members of a set to test against (vowels here) and loop over your string of vowels to determine if the current character is a match. Instead of loop...
48,333,458
I want to repeat data using div and in this div , I have one more repeatation using id value from first repeatation. So I want to pass this value using function in ng-init but got me error. ``` <div ng-controller="ProductsCtrl" ng-init="getData()"> <div class="col-sm-12" ng-repeat="data in fo...
2018/01/19
[ "https://Stackoverflow.com/questions/48333458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7942721/" ]
> > `I was hoping someone could use the context of this question to help me understand pointers better....` > > > In context of your program: ``` int main(int argc, char *argv[]) ``` First, understand what is `argc` and `argv` here. **`argc`(argument count):** is the number of arguments passed into the program...
You can use nested for loops to loop through all arguments. `argc` will tell you number of arguments, while `argv` contains the array of arrays. I also used `strlen()` function from `strings` library. It will tell you how long a string is. This way you can check for any number of arguments. Your *if* statement can also...
48,333,458
I want to repeat data using div and in this div , I have one more repeatation using id value from first repeatation. So I want to pass this value using function in ng-init but got me error. ``` <div ng-controller="ProductsCtrl" ng-init="getData()"> <div class="col-sm-12" ng-repeat="data in fo...
2018/01/19
[ "https://Stackoverflow.com/questions/48333458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7942721/" ]
You can use nested for loops to loop through all arguments. `argc` will tell you number of arguments, while `argv` contains the array of arrays. I also used `strlen()` function from `strings` library. It will tell you how long a string is. This way you can check for any number of arguments. Your *if* statement can also...
If anyone else is coming to this from *Learn C The Hard Way* the answers above using pointers are getting a bit far ahead of us as we won't be covering pointers until chapter 15. However you can do this piece of extra credit with what we've learned so far. I won't spoil the fun but you can use a for loop for the argume...
48,333,458
I want to repeat data using div and in this div , I have one more repeatation using id value from first repeatation. So I want to pass this value using function in ng-init but got me error. ``` <div ng-controller="ProductsCtrl" ng-init="getData()"> <div class="col-sm-12" ng-repeat="data in fo...
2018/01/19
[ "https://Stackoverflow.com/questions/48333458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7942721/" ]
> > `I was hoping someone could use the context of this question to help me understand pointers better....` > > > In context of your program: ``` int main(int argc, char *argv[]) ``` First, understand what is `argc` and `argv` here. **`argc`(argument count):** is the number of arguments passed into the program...
While you can use multiple conditional expressions to test if the current character is a vowel, it is often beneficial to create a constant string containing all possible members of a set to test against (vowels here) and loop over your string of vowels to determine if the current character is a match. Instead of loop...
48,333,458
I want to repeat data using div and in this div , I have one more repeatation using id value from first repeatation. So I want to pass this value using function in ng-init but got me error. ``` <div ng-controller="ProductsCtrl" ng-init="getData()"> <div class="col-sm-12" ng-repeat="data in fo...
2018/01/19
[ "https://Stackoverflow.com/questions/48333458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7942721/" ]
While you can use multiple conditional expressions to test if the current character is a vowel, it is often beneficial to create a constant string containing all possible members of a set to test against (vowels here) and loop over your string of vowels to determine if the current character is a match. Instead of loop...
If anyone else is coming to this from *Learn C The Hard Way* the answers above using pointers are getting a bit far ahead of us as we won't be covering pointers until chapter 15. However you can do this piece of extra credit with what we've learned so far. I won't spoil the fun but you can use a for loop for the argume...
48,333,458
I want to repeat data using div and in this div , I have one more repeatation using id value from first repeatation. So I want to pass this value using function in ng-init but got me error. ``` <div ng-controller="ProductsCtrl" ng-init="getData()"> <div class="col-sm-12" ng-repeat="data in fo...
2018/01/19
[ "https://Stackoverflow.com/questions/48333458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7942721/" ]
> > `I was hoping someone could use the context of this question to help me understand pointers better....` > > > In context of your program: ``` int main(int argc, char *argv[]) ``` First, understand what is `argc` and `argv` here. **`argc`(argument count):** is the number of arguments passed into the program...
If anyone else is coming to this from *Learn C The Hard Way* the answers above using pointers are getting a bit far ahead of us as we won't be covering pointers until chapter 15. However you can do this piece of extra credit with what we've learned so far. I won't spoil the fun but you can use a for loop for the argume...
3,574
I am getting the error - `'System.QueryException: sObject type 'CollaborationGroup' is not supported.'` When running the following code as part of a managed package by scheduled apex: > > List groups = [select id, name, description from > collaborationGroup]; > > > What's strange is that the code works if I r...
2012/10/22
[ "https://salesforce.stackexchange.com/questions/3574", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/783/" ]
Your code must be run in a `without sharing` context in order for it to have access to the `CollaborationGroup` SObject. I'm guessing that your Utility class which contains the query is *not* explicitly declared as `without sharing`, so you can do one of two things: 1. Move all of your code into your actual PostInstal...
It looks like your querying for `Group`, as in a [user group](http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_group.htm) instead of a `Collaboration Group` *which is the API name for a [Chatter group](http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_collaborationgrou...
5,018,340
I have this little piece of code, and I'm trying to convert a JSON string to a map. ``` String json = "[{'code':':)','img':'<img src=/faccine/sorriso.gif>'}]"; ObjectMapper mapper = new ObjectMapper(); Map<String,String> userData = mapper.readValue(json,new TypeReference<HashMap<String,String>>() { }); ``` But it re...
2011/02/16
[ "https://Stackoverflow.com/questions/5018340", "https://Stackoverflow.com", "https://Stackoverflow.com/users/613631/" ]
From what I remember Jackson is used to convert json to java classes - it is probably expecting the first object is reads to be a map, like ``` String json = "{'code':':)','img':'<img src=/faccine/sorriso.gif>'}"; ```
Right: you're asking Jackson to map a JSON Array into an object; there is no obvious way to do that. So, tofarr's answer is correct. But if you wanted a List or an array, you could achieved it easily by: ``` List<?> list = mapper.readValue(json, List.class); ``` Or with full type reference; optional in this case be...
57,698,746
I am trying to do a migration in django 2.2.4 in python 3.7. First I try to make do makemigations: ``` python3 manage.py makemigrations ``` I get: ``` Migrations for 'main': main/migrations/0001_initial.py - Create model TutorialCategory - Create model TutorialSeries - Create model Tutorial ``` But ...
2019/08/28
[ "https://Stackoverflow.com/questions/57698746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8802333/" ]
Somehow your migrations are virtually or faked applied in the database, Truncating **django\_migrations** table should work. 1. Delete all the migrations files: find . -path "*/migrations/*.py" -not -name "**init**.py" -delete find . -path "*/migrations/*.pyc" -delete 2. Truncate table: truncate django\_migrations 3...
I faced the same problem in django 2.2, The following worked for me... 1. delete the migrations folder resided inside the app folder 2. delete the pycache folder too 3. restart the server [if your server is on and you are working from another cli] 4. `python manage.py makemigrations <app_name> zero` 5. `python manage....
57,698,746
I am trying to do a migration in django 2.2.4 in python 3.7. First I try to make do makemigations: ``` python3 manage.py makemigrations ``` I get: ``` Migrations for 'main': main/migrations/0001_initial.py - Create model TutorialCategory - Create model TutorialSeries - Create model Tutorial ``` But ...
2019/08/28
[ "https://Stackoverflow.com/questions/57698746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8802333/" ]
Somehow your migrations are virtually or faked applied in the database, Truncating **django\_migrations** table should work. 1. Delete all the migrations files: find . -path "*/migrations/*.py" -not -name "**init**.py" -delete find . -path "*/migrations/*.pyc" -delete 2. Truncate table: truncate django\_migrations 3...
1. w/in the app directory I deleted the `pycache` and `migrations` folders, 2. from `django.migrations` tables I deleted all rows like this for PostgreSQL ``` DELETE FROM public.django_migrations WHERE public.django_migrations.app = 'target_app_name'; ``` 3. To delete any app tables already created for the tables to ...
57,698,746
I am trying to do a migration in django 2.2.4 in python 3.7. First I try to make do makemigations: ``` python3 manage.py makemigrations ``` I get: ``` Migrations for 'main': main/migrations/0001_initial.py - Create model TutorialCategory - Create model TutorialSeries - Create model Tutorial ``` But ...
2019/08/28
[ "https://Stackoverflow.com/questions/57698746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8802333/" ]
Somehow your migrations are virtually or faked applied in the database, Truncating **django\_migrations** table should work. 1. Delete all the migrations files: find . -path "*/migrations/*.py" -not -name "**init**.py" -delete find . -path "*/migrations/*.pyc" -delete 2. Truncate table: truncate django\_migrations 3...
Mine didn't migrate cause there was already a record in the django\_migrations table with the same name, so I just removed it and then migrate worked.
57,698,746
I am trying to do a migration in django 2.2.4 in python 3.7. First I try to make do makemigations: ``` python3 manage.py makemigrations ``` I get: ``` Migrations for 'main': main/migrations/0001_initial.py - Create model TutorialCategory - Create model TutorialSeries - Create model Tutorial ``` But ...
2019/08/28
[ "https://Stackoverflow.com/questions/57698746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8802333/" ]
I faced the same problem in django 2.2, The following worked for me... 1. delete the migrations folder resided inside the app folder 2. delete the pycache folder too 3. restart the server [if your server is on and you are working from another cli] 4. `python manage.py makemigrations <app_name> zero` 5. `python manage....
1. w/in the app directory I deleted the `pycache` and `migrations` folders, 2. from `django.migrations` tables I deleted all rows like this for PostgreSQL ``` DELETE FROM public.django_migrations WHERE public.django_migrations.app = 'target_app_name'; ``` 3. To delete any app tables already created for the tables to ...
57,698,746
I am trying to do a migration in django 2.2.4 in python 3.7. First I try to make do makemigations: ``` python3 manage.py makemigrations ``` I get: ``` Migrations for 'main': main/migrations/0001_initial.py - Create model TutorialCategory - Create model TutorialSeries - Create model Tutorial ``` But ...
2019/08/28
[ "https://Stackoverflow.com/questions/57698746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8802333/" ]
I faced the same problem in django 2.2, The following worked for me... 1. delete the migrations folder resided inside the app folder 2. delete the pycache folder too 3. restart the server [if your server is on and you are working from another cli] 4. `python manage.py makemigrations <app_name> zero` 5. `python manage....
Mine didn't migrate cause there was already a record in the django\_migrations table with the same name, so I just removed it and then migrate worked.
46,377,827
Let us assume In PHP ``` $i = 016; echo $i / 2; ``` The output is returning `7`.! why..?
2017/09/23
[ "https://Stackoverflow.com/questions/46377827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6382509/" ]
Appending 0 to the front of a number in PHP is making it octal. 16 in octal is equivalent to 14 in decimal. So , 14/2 = 7 is the answer.
The leading `0` will cause `016` to be interpreted as written in base `8`, thus in base `10` it will actually be `14`. So `14/2 = 7`
2,825,220
I currently have a JS function that allows me to load partial content from another page into the current page using jQuery.load() However I noticed when using this that I get a duplicate ID in the DOM (when inspecting with FireBug) This function is used in conjuction with a Flash Building viewe so it does not contain...
2010/05/13
[ "https://Stackoverflow.com/questions/2825220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69795/" ]
If it's just that ID that is causing you an annoyance, you could either change that id, or remove the duplicate when the document is loaded: ``` function displayApartment(apartmentID) { $("#apartmentInfo").load(siteURL + apartmentID + ".aspx #apartmentInfo", function () { $(this).attr('id', 'somethingElse'...
a way around it maybe ``` function displayApartment(apartmentID) { var parent = $("#apartmentInfo").load(siteURL + apartmentID + ".aspx #apartmentInfo", function () { parent.children(':first').unwrap(); //re-do links loaded in $("a.gallery").colorbox({ opacity: "0.5" }); }); } ```
2,825,220
I currently have a JS function that allows me to load partial content from another page into the current page using jQuery.load() However I noticed when using this that I get a duplicate ID in the DOM (when inspecting with FireBug) This function is used in conjuction with a Flash Building viewe so it does not contain...
2010/05/13
[ "https://Stackoverflow.com/questions/2825220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69795/" ]
If it's just that ID that is causing you an annoyance, you could either change that id, or remove the duplicate when the document is loaded: ``` function displayApartment(apartmentID) { $("#apartmentInfo").load(siteURL + apartmentID + ".aspx #apartmentInfo", function () { $(this).attr('id', 'somethingElse'...
Simply Use This: ``` #apartmentInfo > * ``` Full Code: ``` function displayApartment(apartmentID) { $("#apartmentInfo").load(siteURL + apartmentID + ".aspx #apartmentInfo > *", function () { //re-do links loaded in $("a.gallery").colorbox({ opacity: "0.5" }); }); } ```
2,825,220
I currently have a JS function that allows me to load partial content from another page into the current page using jQuery.load() However I noticed when using this that I get a duplicate ID in the DOM (when inspecting with FireBug) This function is used in conjuction with a Flash Building viewe so it does not contain...
2010/05/13
[ "https://Stackoverflow.com/questions/2825220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69795/" ]
If it's just that ID that is causing you an annoyance, you could either change that id, or remove the duplicate when the document is loaded: ``` function displayApartment(apartmentID) { $("#apartmentInfo").load(siteURL + apartmentID + ".aspx #apartmentInfo", function () { $(this).attr('id', 'somethingElse'...
I came here thanks to *the Google* looking for what I believe OP was really looking for; a way to have **all** of the **contents** of `$(selector).load('my.html #apartmentInfo')` without the surrounding div. E.g.: ``` <div id='apartmentInfo' data-from="main page"> Address: 123 Hell Street <p>Manager: Hugh Jas...
2,825,220
I currently have a JS function that allows me to load partial content from another page into the current page using jQuery.load() However I noticed when using this that I get a duplicate ID in the DOM (when inspecting with FireBug) This function is used in conjuction with a Flash Building viewe so it does not contain...
2010/05/13
[ "https://Stackoverflow.com/questions/2825220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69795/" ]
a way around it maybe ``` function displayApartment(apartmentID) { var parent = $("#apartmentInfo").load(siteURL + apartmentID + ".aspx #apartmentInfo", function () { parent.children(':first').unwrap(); //re-do links loaded in $("a.gallery").colorbox({ opacity: "0.5" }); }); } ```
Simply Use This: ``` #apartmentInfo > * ``` Full Code: ``` function displayApartment(apartmentID) { $("#apartmentInfo").load(siteURL + apartmentID + ".aspx #apartmentInfo > *", function () { //re-do links loaded in $("a.gallery").colorbox({ opacity: "0.5" }); }); } ```
2,825,220
I currently have a JS function that allows me to load partial content from another page into the current page using jQuery.load() However I noticed when using this that I get a duplicate ID in the DOM (when inspecting with FireBug) This function is used in conjuction with a Flash Building viewe so it does not contain...
2010/05/13
[ "https://Stackoverflow.com/questions/2825220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69795/" ]
a way around it maybe ``` function displayApartment(apartmentID) { var parent = $("#apartmentInfo").load(siteURL + apartmentID + ".aspx #apartmentInfo", function () { parent.children(':first').unwrap(); //re-do links loaded in $("a.gallery").colorbox({ opacity: "0.5" }); }); } ```
I came here thanks to *the Google* looking for what I believe OP was really looking for; a way to have **all** of the **contents** of `$(selector).load('my.html #apartmentInfo')` without the surrounding div. E.g.: ``` <div id='apartmentInfo' data-from="main page"> Address: 123 Hell Street <p>Manager: Hugh Jas...
114,864
I am trying to get Emacs (24.3.1), Org-mode (8.0.3, from ELPA) and BibTeX (from TeX Live 2012) to work together. I have followed the instructions under the **Bibliography** section in <http://orgmode.org/worg/org-tutorials/org-latex-export.html> but after exporting the document to LaTeX, compiling to PDF, and opening t...
2013/05/18
[ "https://tex.stackexchange.com/questions/114864", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/11886/" ]
@G.JayKerns has a perfectly good solution in the comments, but since this question has been a while without an answer, I'll fill it in. The important elisp variable is `org-latex-pdf-process`, which can work with a number of settings. I have mine set up as something like: ```lisp (setq org-latex-pdf-process (list "...
This answer from [Problems with .bbl in org-mode](https://tex.stackexchange.com/questions/32348/problems-with-bbl-in-org-mode) ```lisp (setq org-latex-to-pdf-process (list "latexmk -pdf %f")) ``` worked for me
114,864
I am trying to get Emacs (24.3.1), Org-mode (8.0.3, from ELPA) and BibTeX (from TeX Live 2012) to work together. I have followed the instructions under the **Bibliography** section in <http://orgmode.org/worg/org-tutorials/org-latex-export.html> but after exporting the document to LaTeX, compiling to PDF, and opening t...
2013/05/18
[ "https://tex.stackexchange.com/questions/114864", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/11886/" ]
@G.JayKerns has a perfectly good solution in the comments, but since this question has been a while without an answer, I'll fill it in. The important elisp variable is `org-latex-pdf-process`, which can work with a number of settings. I have mine set up as something like: ```lisp (setq org-latex-pdf-process (list "...
From the documentation for `org-latex-pdf-process` in org-mode version 8.2.5h (February 10, 2014): > > By default, Org uses 3 runs of `pdflatex` to do the processing. > If you have texi2dvi on your system and if that does not cause > the infamous egrep/locale bug: > > > <http://lists.gnu.org/archive/html/bug-texi...
114,864
I am trying to get Emacs (24.3.1), Org-mode (8.0.3, from ELPA) and BibTeX (from TeX Live 2012) to work together. I have followed the instructions under the **Bibliography** section in <http://orgmode.org/worg/org-tutorials/org-latex-export.html> but after exporting the document to LaTeX, compiling to PDF, and opening t...
2013/05/18
[ "https://tex.stackexchange.com/questions/114864", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/11886/" ]
@G.JayKerns has a perfectly good solution in the comments, but since this question has been a while without an answer, I'll fill it in. The important elisp variable is `org-latex-pdf-process`, which can work with a number of settings. I have mine set up as something like: ```lisp (setq org-latex-pdf-process (list "...
Because bibtex usually uses `\cite{some_reference}` there is a conflict involving reftex in org-mode where the usual bib{some\_reference} is used. To get round this I define a my-org2pdf-export, which works for me using emacs-24 and org 8.3. I then an org file using reftex to call references and then use M-x my-org2pdf...
114,864
I am trying to get Emacs (24.3.1), Org-mode (8.0.3, from ELPA) and BibTeX (from TeX Live 2012) to work together. I have followed the instructions under the **Bibliography** section in <http://orgmode.org/worg/org-tutorials/org-latex-export.html> but after exporting the document to LaTeX, compiling to PDF, and opening t...
2013/05/18
[ "https://tex.stackexchange.com/questions/114864", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/11886/" ]
This answer from [Problems with .bbl in org-mode](https://tex.stackexchange.com/questions/32348/problems-with-bbl-in-org-mode) ```lisp (setq org-latex-to-pdf-process (list "latexmk -pdf %f")) ``` worked for me
Because bibtex usually uses `\cite{some_reference}` there is a conflict involving reftex in org-mode where the usual bib{some\_reference} is used. To get round this I define a my-org2pdf-export, which works for me using emacs-24 and org 8.3. I then an org file using reftex to call references and then use M-x my-org2pdf...
114,864
I am trying to get Emacs (24.3.1), Org-mode (8.0.3, from ELPA) and BibTeX (from TeX Live 2012) to work together. I have followed the instructions under the **Bibliography** section in <http://orgmode.org/worg/org-tutorials/org-latex-export.html> but after exporting the document to LaTeX, compiling to PDF, and opening t...
2013/05/18
[ "https://tex.stackexchange.com/questions/114864", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/11886/" ]
From the documentation for `org-latex-pdf-process` in org-mode version 8.2.5h (February 10, 2014): > > By default, Org uses 3 runs of `pdflatex` to do the processing. > If you have texi2dvi on your system and if that does not cause > the infamous egrep/locale bug: > > > <http://lists.gnu.org/archive/html/bug-texi...
Because bibtex usually uses `\cite{some_reference}` there is a conflict involving reftex in org-mode where the usual bib{some\_reference} is used. To get round this I define a my-org2pdf-export, which works for me using emacs-24 and org 8.3. I then an org file using reftex to call references and then use M-x my-org2pdf...
4,082
I think that [this question](https://math.stackexchange.com/questions/3704/integral-representation-of-infinite-series) deserves to be reopened. Hopefully now that we have more meta members, enough others will agree. Please vote to reopen if you agree. **Edit** $\ $ The question is now reopened. Thanks to everyone who ...
2012/05/01
[ "https://math.meta.stackexchange.com/questions/4082", "https://math.meta.stackexchange.com", "https://math.meta.stackexchange.com/users/242/" ]
I cast the final reopen vote. While at face value I think it made a close-worthy question according to the word of the FAQ and rules and such, I personally have a higher bar for my close votes: * If the question has proven amenable to a valuable and original contribution from some member of the community as an answer,...
I'm posting here my idea of editing this question so that it's not bumped unnecessarily. In addition to what's below, I would add the `big-list` tag. I would ask those who think that this version is still beyond repair to downvote this answer. I would ask those who think that this version is fine to upvote. Those who t...
339,291
After opening the emoji keyboard with `Ctrl + Cmd + Space`, selecting an emoji and finally hitting enter, the emoji keyboard closes but nothing is inserted at my cursor. [![enter image description here](https://i.stack.imgur.com/S8hL5.png)](https://i.stack.imgur.com/S8hL5.png) A restart seems to fix this, but after s...
2018/10/11
[ "https://apple.stackexchange.com/questions/339291", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/43263/" ]
Lets assume you are not confusing Google and Chrome. Google application passwords are stored in your KeyChain, for things like Gmail, Calendar, Google drive ect.. Chrome passwords are stored on your HD at `~/Library/Application Support/Google/Chrome/Default/databases` in special format. (SQL) However Chrome is a b...
All of your Chrome passwords are encrypted by Chrome and stored in an SQLite database file under Chrome's Local App Data. It is not stored via Keychain. If you would like to know more about the technical details, refer [this](https://superuser.com/questions/146742/how-does-google-chrome-store-passwords) answer.
339,291
After opening the emoji keyboard with `Ctrl + Cmd + Space`, selecting an emoji and finally hitting enter, the emoji keyboard closes but nothing is inserted at my cursor. [![enter image description here](https://i.stack.imgur.com/S8hL5.png)](https://i.stack.imgur.com/S8hL5.png) A restart seems to fix this, but after s...
2018/10/11
[ "https://apple.stackexchange.com/questions/339291", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/43263/" ]
Lets assume you are not confusing Google and Chrome. Google application passwords are stored in your KeyChain, for things like Gmail, Calendar, Google drive ect.. Chrome passwords are stored on your HD at `~/Library/Application Support/Google/Chrome/Default/databases` in special format. (SQL) However Chrome is a b...
I don't think this is the case any longer. I'm using Chrome Version 76.0.3809.132. When I start Chrome and get the question to 'Allow Always', 'Deny', or 'Allow' access to the keychain, I Deny its use of the keychain. In Chrome, I have 'Offer to save passwords' and 'Auto Sign-in' on and it never asks me to save passwor...
33,099,133
When I am run my application in android studio error. I am new in android developing. My Logtag is here: ``` Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:assembleDebug] Error:A problem occurred configuring project ':app'. > Could not resolve all depen...
2015/10/13
[ "https://Stackoverflow.com/questions/33099133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5064636/" ]
**Error:** > > Error:A problem occurred configuring project ':app'. Could not > resolve all dependencies for configuration ':app:\_debugCompile'. > > Could not find com.android.support:recyclerview-v7:. > > > From error i can say you'll have to add the following gradle dependency : ``` compile 'com.android....
Did you forget the version? In your gradle config you should have something like this: ``` compile 'com.android.support:recyclerview-v7:23.0.1' ```
33,099,133
When I am run my application in android studio error. I am new in android developing. My Logtag is here: ``` Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:assembleDebug] Error:A problem occurred configuring project ':app'. > Could not resolve all depen...
2015/10/13
[ "https://Stackoverflow.com/questions/33099133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5064636/" ]
**Error:** > > Error:A problem occurred configuring project ':app'. Could not > resolve all dependencies for configuration ':app:\_debugCompile'. > > Could not find com.android.support:recyclerview-v7:. > > > From error i can say you'll have to add the following gradle dependency : ``` compile 'com.android....
In my case, I deleted `caches` folder inside `.gradle` folder and then I added `compile`. It worked for me!
68,682,825
I am using last version of ActiveMQ Artemis. My use case is pretty simple. The broker sends a lot of messages to consumer - a single queue. I have 2 consumers per queue. Consumers are set to use default prefetch size of messages (1000). Is there a way to monitor how many messages are pre-fetch and processed from each...
2021/08/06
[ "https://Stackoverflow.com/questions/68682825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4173038/" ]
There are several ways you can go about "shuffling" an array. I chose the Fisher-Yates method in an experimental "war" card game. <https://github.com/scottm85/war/blob/master/src/Game/Deck.js#L80> ``` shuffle() { /* Use a Fisher-Yates shuffle...If provides a much more reliable shuffle than using variations of a so...
You can use `sort` and `Math.random()` methods like this: ```js function shuffleCards() { var parent = document.getElementById("parent"); let cards = document.querySelectorAll('.card'); let cardsArray = Array.from(cards); //console.log(cardsArray) cardsAr...
68,682,825
I am using last version of ActiveMQ Artemis. My use case is pretty simple. The broker sends a lot of messages to consumer - a single queue. I have 2 consumers per queue. Consumers are set to use default prefetch size of messages (1000). Is there a way to monitor how many messages are pre-fetch and processed from each...
2021/08/06
[ "https://Stackoverflow.com/questions/68682825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4173038/" ]
There are several ways you can go about "shuffling" an array. I chose the Fisher-Yates method in an experimental "war" card game. <https://github.com/scottm85/war/blob/master/src/Game/Deck.js#L80> ``` shuffle() { /* Use a Fisher-Yates shuffle...If provides a much more reliable shuffle than using variations of a so...
Others have provided algorithms for the randomization portion, but here is how you can handle the detaching and reattaching portion. [`removeChild()`](https://developer.mozilla.org/en-US/docs/Web/API/Node/removeChild) will get you the node detached from the DOM and [`appendChild()`](https://developer.mozilla.org/en-US/...
68,682,825
I am using last version of ActiveMQ Artemis. My use case is pretty simple. The broker sends a lot of messages to consumer - a single queue. I have 2 consumers per queue. Consumers are set to use default prefetch size of messages (1000). Is there a way to monitor how many messages are pre-fetch and processed from each...
2021/08/06
[ "https://Stackoverflow.com/questions/68682825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4173038/" ]
There are several ways you can go about "shuffling" an array. I chose the Fisher-Yates method in an experimental "war" card game. <https://github.com/scottm85/war/blob/master/src/Game/Deck.js#L80> ``` shuffle() { /* Use a Fisher-Yates shuffle...If provides a much more reliable shuffle than using variations of a so...
The following approach is agnostic to where the queried nodes need to be removed from, and after shuffling, have to be inserted into again. Thus one does not need to know anything about the DOM structure except for the element query. Basically ... 1. Use only reliable/proven shuffle functions like [`_.shuffle`](http...
25,906,182
I am using Eclipse Indigo (version 3.7) for my Plug in development. I have created a plug-in and added Jersey archive jars in my Build Path . When i try to debug or run the application I am getting...... ``` org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NoClassDefFoundError: com/sun/jersey/api/c...
2014/09/18
[ "https://Stackoverflow.com/questions/25906182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3926459/" ]
**EDIT** I've just noticed (after adding my answer) an error in your constructor - it's name is `_construct` with single underscore. It should be with double underscore `__construct` so correct the name and make sure if error is still present and if it is, read the rest of the answer. **Rest of the answer** The firs...
You can call it just by using the variable $wait ;-)
77,767
In a cavity, the standing wave will constructively interfere with itself, so its energy gets higher while the oscillator is still vibrating. Since the vibration time is not a constant value, and sometimes the wall of the cavity absorbs some of the wave energy, the energy of a standing EM wave is probabilistic and follo...
2013/09/18
[ "https://physics.stackexchange.com/questions/77767", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/24610/" ]
Conservation of energy follows directly from Maxwell's equations, so if you convince yourself that energy isn't conserved when EM waves interfere, you've made a mistake, and you need to go back and figure out what your mistake was. > > In a cavity, the standing wave will constructively interfere with itself, [...] > ...
The constructive interference in a cavity doesn’t really make the energy higher. It is a way of seeing how a wave propagates in a confined space, the answer is there is a wave say going from left to right. At the same time there is another wave with the same frequency going from right to left. Those two waves construct...
77,767
In a cavity, the standing wave will constructively interfere with itself, so its energy gets higher while the oscillator is still vibrating. Since the vibration time is not a constant value, and sometimes the wall of the cavity absorbs some of the wave energy, the energy of a standing EM wave is probabilistic and follo...
2013/09/18
[ "https://physics.stackexchange.com/questions/77767", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/24610/" ]
In a standing wave of this type, energy swaps back and forth between E field (electric) and B field (magnetic) energy. The total energy remains constant, as noted by earlier commenters. This is very much like the case of an LC oscillator, oscillating at resonance. Of course we have to assume in all cases that the losse...
The constructive interference in a cavity doesn’t really make the energy higher. It is a way of seeing how a wave propagates in a confined space, the answer is there is a wave say going from left to right. At the same time there is another wave with the same frequency going from right to left. Those two waves construct...
7,660
I've started Wing Chun few days before. Everything seems to be nice, but I've seen some videos on internet, they say that Wing Chun can't handle Boxers or Wrestlers. What are the comparisons between Wing Chun and boxing/wrestling that would lead someone to make this claim? Are there weaknesses that can be exploited?
2017/07/16
[ "https://martialarts.stackexchange.com/questions/7660", "https://martialarts.stackexchange.com", "https://martialarts.stackexchange.com/users/-1/" ]
As always, you can't compare style A with style B and say either one is better. It's not because you're a boxer, you immediately win agains a wing chun practitioner. It all depends on how good both fighters are, how much experience they got fighting opponents of different styles, the competition's rules (eg. if you pit...
I don't think that it makes too much sense to compare styles instead of individual athletes, but I will try to answer your question anyway. There is no one answer to this as it is very hard to say how important the advantages and disadvantages of both styles are. Therefore I will give you some insight to the advantage...
7,660
I've started Wing Chun few days before. Everything seems to be nice, but I've seen some videos on internet, they say that Wing Chun can't handle Boxers or Wrestlers. What are the comparisons between Wing Chun and boxing/wrestling that would lead someone to make this claim? Are there weaknesses that can be exploited?
2017/07/16
[ "https://martialarts.stackexchange.com/questions/7660", "https://martialarts.stackexchange.com", "https://martialarts.stackexchange.com/users/-1/" ]
As always, you can't compare style A with style B and say either one is better. It's not because you're a boxer, you immediately win agains a wing chun practitioner. It all depends on how good both fighters are, how much experience they got fighting opponents of different styles, the competition's rules (eg. if you pit...
So there are some fundamental assumptions here that one must look at with "intent or goal". **Goal: To beat your opponent senseless?** * If this is your goal then you will probably want a style that focuses aggression and subjugation of your opponent over anything else. **Goal: To protect oneself?** * If this is th...
7,660
I've started Wing Chun few days before. Everything seems to be nice, but I've seen some videos on internet, they say that Wing Chun can't handle Boxers or Wrestlers. What are the comparisons between Wing Chun and boxing/wrestling that would lead someone to make this claim? Are there weaknesses that can be exploited?
2017/07/16
[ "https://martialarts.stackexchange.com/questions/7660", "https://martialarts.stackexchange.com", "https://martialarts.stackexchange.com/users/-1/" ]
I don't think that it makes too much sense to compare styles instead of individual athletes, but I will try to answer your question anyway. There is no one answer to this as it is very hard to say how important the advantages and disadvantages of both styles are. Therefore I will give you some insight to the advantage...
So there are some fundamental assumptions here that one must look at with "intent or goal". **Goal: To beat your opponent senseless?** * If this is your goal then you will probably want a style that focuses aggression and subjugation of your opponent over anything else. **Goal: To protect oneself?** * If this is th...
7,660
I've started Wing Chun few days before. Everything seems to be nice, but I've seen some videos on internet, they say that Wing Chun can't handle Boxers or Wrestlers. What are the comparisons between Wing Chun and boxing/wrestling that would lead someone to make this claim? Are there weaknesses that can be exploited?
2017/07/16
[ "https://martialarts.stackexchange.com/questions/7660", "https://martialarts.stackexchange.com", "https://martialarts.stackexchange.com/users/-1/" ]
The great advantage of boxing and wrestling is that boxers and wrestlers practice actual fighting, with all other elements of their training - weights, bag work, jumping rope - in support of improving them as fighters. Even when practicing a constrained format a boxer's conditioning, strength and (most importantly) fam...
I don't think that it makes too much sense to compare styles instead of individual athletes, but I will try to answer your question anyway. There is no one answer to this as it is very hard to say how important the advantages and disadvantages of both styles are. Therefore I will give you some insight to the advantage...
7,660
I've started Wing Chun few days before. Everything seems to be nice, but I've seen some videos on internet, they say that Wing Chun can't handle Boxers or Wrestlers. What are the comparisons between Wing Chun and boxing/wrestling that would lead someone to make this claim? Are there weaknesses that can be exploited?
2017/07/16
[ "https://martialarts.stackexchange.com/questions/7660", "https://martialarts.stackexchange.com", "https://martialarts.stackexchange.com/users/-1/" ]
The great advantage of boxing and wrestling is that boxers and wrestlers practice actual fighting, with all other elements of their training - weights, bag work, jumping rope - in support of improving them as fighters. Even when practicing a constrained format a boxer's conditioning, strength and (most importantly) fam...
So there are some fundamental assumptions here that one must look at with "intent or goal". **Goal: To beat your opponent senseless?** * If this is your goal then you will probably want a style that focuses aggression and subjugation of your opponent over anything else. **Goal: To protect oneself?** * If this is th...
12,011,559
I have the following html that is bound to an object containing id and status. I want to translate status values into a specific color (hence the converter function convertStatus). I can see the converter work on the first binding, but if I change status in the binding list I do not see any UI update nor do I see conve...
2012/08/17
[ "https://Stackoverflow.com/questions/12011559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/665106/" ]
To answer your two questions: 1) Why can't I set id through binding? This is deliberately prevented. The WinJS binding system uses the ID to track the element that it's binding to (to avoid leaking DOM elements through dangling bindings). As such, it has to be able to control the id for bound templates. 2) Why isn't...
I've found that if I doing the following, I will see updates to the UI post-binding: ``` var list = new WinJS.Binding.List({binding: true}); var item = WinJS.Binding.as({ firstName: "Billy", lastName: "Bob" }); list.push(item); ``` Later in the application, you can change some values like so: ``` item.first...
12,011,559
I have the following html that is bound to an object containing id and status. I want to translate status values into a specific color (hence the converter function convertStatus). I can see the converter work on the first binding, but if I change status in the binding list I do not see any UI update nor do I see conve...
2012/08/17
[ "https://Stackoverflow.com/questions/12011559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/665106/" ]
To answer your two questions: 1) Why can't I set id through binding? This is deliberately prevented. The WinJS binding system uses the ID to track the element that it's binding to (to avoid leaking DOM elements through dangling bindings). As such, it has to be able to control the id for bound templates. 2) Why isn't...
Regarding setting the value of id. I found that I was able to set the value of the name attribute, for a <button>. I had been trying to set id, but that wouldn't work. HTH
12,011,559
I have the following html that is bound to an object containing id and status. I want to translate status values into a specific color (hence the converter function convertStatus). I can see the converter work on the first binding, but if I change status in the binding list I do not see any UI update nor do I see conve...
2012/08/17
[ "https://Stackoverflow.com/questions/12011559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/665106/" ]
To answer your two questions: 1) Why can't I set id through binding? This is deliberately prevented. The WinJS binding system uses the ID to track the element that it's binding to (to avoid leaking DOM elements through dangling bindings). As such, it has to be able to control the id for bound templates. 2) Why isn't...
optimizeBindingReferences property Determines whether or not binding should automatically set the ID of an element. This property should be set to true in apps that use Windows Library for JavaScript (WinJS) binding. ``` WinJS.Binding.optimizeBindingReferences = true; ``` source: <http://msdn.microsoft.com/en-us/li...
46,586,267
Context ------- For quite a lot of our CentOS servers I would like to install some monitoring software, the software is based on the CentOS version, I want to check the release version and install software based on that. Issue ----- It seems that the if statements are run successfully without errors while the result...
2017/10/05
[ "https://Stackoverflow.com/questions/46586267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8726241/" ]
As a general rule of thumb, on probably all of the programming languages, a single equal (`=`) sign is for assignment and not for equality check which in this case is double equal (`=`) sign. The reason you're entering all of your `if` statements is that the result of your assignment expression is `true` and therefore...
You are doing something wrong in your if-statement. Simple answer: 1. Make sure to use the `==` if you want to compare strings. 2. Please use `if [ "$version" == "xyz" ]` instead of `if [[ "$version" = "xyz" ]]` Summarized: `if [ "$version"=="CentOS release 6.9 (Final)" ]; then` and it sould work! Regards, FrankT...
46,586,267
Context ------- For quite a lot of our CentOS servers I would like to install some monitoring software, the software is based on the CentOS version, I want to check the release version and install software based on that. Issue ----- It seems that the if statements are run successfully without errors while the result...
2017/10/05
[ "https://Stackoverflow.com/questions/46586267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8726241/" ]
You need whitespace around the `=` sign; without it, the shell treats the "expression" as a single word, not a comparison of two words for equality. ``` [[ "$version" = "CentOS release 6.9 (Final)" ]] ``` `[[ a=b ]]` is equivalent to `[[ -n a=b ]]`, i.e., you are simply testing if the single word is a non-empty stri...
As a general rule of thumb, on probably all of the programming languages, a single equal (`=`) sign is for assignment and not for equality check which in this case is double equal (`=`) sign. The reason you're entering all of your `if` statements is that the result of your assignment expression is `true` and therefore...
46,586,267
Context ------- For quite a lot of our CentOS servers I would like to install some monitoring software, the software is based on the CentOS version, I want to check the release version and install software based on that. Issue ----- It seems that the if statements are run successfully without errors while the result...
2017/10/05
[ "https://Stackoverflow.com/questions/46586267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8726241/" ]
You need whitespace around the `=` sign; without it, the shell treats the "expression" as a single word, not a comparison of two words for equality. ``` [[ "$version" = "CentOS release 6.9 (Final)" ]] ``` `[[ a=b ]]` is equivalent to `[[ -n a=b ]]`, i.e., you are simply testing if the single word is a non-empty stri...
You are doing something wrong in your if-statement. Simple answer: 1. Make sure to use the `==` if you want to compare strings. 2. Please use `if [ "$version" == "xyz" ]` instead of `if [[ "$version" = "xyz" ]]` Summarized: `if [ "$version"=="CentOS release 6.9 (Final)" ]; then` and it sould work! Regards, FrankT...
539,083
I am trying to build a small circuit using an ESP8288-12E, 4 5V relays and a 74HC595 shift register as the main components. To power the whole circuit I am using a Hi Link HLK 5M05 5V/5W switch power supply module. Here is how I planned the whole circuit: [![enter image description here](https://i.stack.imgur.com/iTD...
2020/12/25
[ "https://electronics.stackexchange.com/questions/539083", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/212459/" ]
If there is no load at all on the 3V3 regulator, it has no minimum required load so it won't output 3V3. When there is no ESP connected, there is nothing connected on HC595 input pins, so they are floating. The input impedance is so high that taking multimeter probes nearby will cause the HC595 to see activity on inpu...
Throw away that pcb before it kills you and burns down your house - I’m not joking. As others have observed, the clearance between tracks carrying mains voltages and low voltage tracks is nowhere near safe. Have your mains wiring down one end of the pcb well away from the low voltage circuit. What current do you expect...
66,223,067
Is it possible to expose all the Spring metrics in an rest endpoint? In our environment Micrometer cannot forward directly the metrics to our monitoring system, then my idea was to have all the metrics exposed in a rest endpoint (or on a file, json format but the endpoint is preferable) and then having a script to fet...
2021/02/16
[ "https://Stackoverflow.com/questions/66223067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/980515/" ]
You may use this redirect rule in your site root .htaccess: ```sh RewriteEngine On RewriteCond %{HTTP_HOST} ^(?:www\.)?website\.com$ [NC] RewriteRule ^reservation/?$ https://test.com/test/page [L,NC,R=301] ``` Query string and fragment i.e. part after `#` will automatically be forwarded to the new URL.
Based on your shown samples, could you please try following. Where you want to redirect from `(www).website.com` to `new-website.com` in url. Please make sure you clear your browser cache before testing your URLs. ``` RewriteEngine ON RewriteCond %{HTTP_HOST} ^(?:www\.)?(.*) [NC] RewriteRule ^ https://new-%1/test/pag...
42,347,969
how to block a jsp page (i want is ,when I click the links to redirect each pages I want to block some specific pages for specific users) I create an java script function to retrieve the jsp pages of each users(pages that user can access).But I have no idea to block other pages for the same user)
2017/02/20
[ "https://Stackoverflow.com/questions/42347969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5983136/" ]
use js `document.getElementById("id name of link").style.display = 'none';` to remove the link from page and use **'block'** instead of **'none'** for showing the link.
You could use the `event.preventDefault();` and have a variable saying if the user should or not be blocked. Check the following example: ```js var BlockUser = true; function CheckUser() { if ( BlockUser ) { event.preventDefault(); } } ``` ```html <a href="http://stackoverflow.com/">Link for any user</a>...
42,347,969
how to block a jsp page (i want is ,when I click the links to redirect each pages I want to block some specific pages for specific users) I create an java script function to retrieve the jsp pages of each users(pages that user can access).But I have no idea to block other pages for the same user)
2017/02/20
[ "https://Stackoverflow.com/questions/42347969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5983136/" ]
You could use the `event.preventDefault();` and have a variable saying if the user should or not be blocked. Check the following example: ```js var BlockUser = true; function CheckUser() { if ( BlockUser ) { event.preventDefault(); } } ``` ```html <a href="http://stackoverflow.com/">Link for any user</a>...
You can use this ``` document.getElementById( "id of your link element" ).style.display = 'none'; ``` **`style.display`** is use for not displaying anything by setting it to **`none`**
42,347,969
how to block a jsp page (i want is ,when I click the links to redirect each pages I want to block some specific pages for specific users) I create an java script function to retrieve the jsp pages of each users(pages that user can access).But I have no idea to block other pages for the same user)
2017/02/20
[ "https://Stackoverflow.com/questions/42347969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5983136/" ]
use js `document.getElementById("id name of link").style.display = 'none';` to remove the link from page and use **'block'** instead of **'none'** for showing the link.
Pure jsp solution: assuming you have an array of available links: `List<String> links`, which you pass under the same name to request(or you may retrieve it from user, doesn't matter, assume you have array of those links despite way of getting it), then you can do something like: ``` ... <c:forEach var="link"...
42,347,969
how to block a jsp page (i want is ,when I click the links to redirect each pages I want to block some specific pages for specific users) I create an java script function to retrieve the jsp pages of each users(pages that user can access).But I have no idea to block other pages for the same user)
2017/02/20
[ "https://Stackoverflow.com/questions/42347969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5983136/" ]
Pure jsp solution: assuming you have an array of available links: `List<String> links`, which you pass under the same name to request(or you may retrieve it from user, doesn't matter, assume you have array of those links despite way of getting it), then you can do something like: ``` ... <c:forEach var="link"...
You can use this ``` document.getElementById( "id of your link element" ).style.display = 'none'; ``` **`style.display`** is use for not displaying anything by setting it to **`none`**
42,347,969
how to block a jsp page (i want is ,when I click the links to redirect each pages I want to block some specific pages for specific users) I create an java script function to retrieve the jsp pages of each users(pages that user can access).But I have no idea to block other pages for the same user)
2017/02/20
[ "https://Stackoverflow.com/questions/42347969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5983136/" ]
use js `document.getElementById("id name of link").style.display = 'none';` to remove the link from page and use **'block'** instead of **'none'** for showing the link.
You can use this ``` document.getElementById( "id of your link element" ).style.display = 'none'; ``` **`style.display`** is use for not displaying anything by setting it to **`none`**
44,124,940
How would I go about dividing arrays into quarters? For example, I want to ask the user to enter say 12 values. Then, divide them into 4 quarters and add the values in each quarter. I figured how to add all of them up, but I'm stuck on how to add them separately in groups. Thank You. ``` import java.util.Scanner; impo...
2017/05/23
[ "https://Stackoverflow.com/questions/44124940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8051072/" ]
``` String[] quarters = {"first", "second", "third", "fourth"}; for (int i = 0; i < 12; i += 3) System.out.printf("The %s quarter total is %d%n", quarters[i / 3], Arrays.stream(salesData, i, i + 3).sum()); ```
You are on the right track, you already know all the pieces you need. 1. You know how to declare an array of a fixed size (12). 2. You know how to write a for loop. 3. You know how to index an array using the for loop counter. So if I wanted to do the first quarter... ``` int firstQuarter = 0; for (int i = 0; i < 3;...
44,124,940
How would I go about dividing arrays into quarters? For example, I want to ask the user to enter say 12 values. Then, divide them into 4 quarters and add the values in each quarter. I figured how to add all of them up, but I'm stuck on how to add them separately in groups. Thank You. ``` import java.util.Scanner; impo...
2017/05/23
[ "https://Stackoverflow.com/questions/44124940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8051072/" ]
``` String[] quarters = {"first", "second", "third", "fourth"}; for (int i = 0; i < 12; i += 3) System.out.printf("The %s quarter total is %d%n", quarters[i / 3], Arrays.stream(salesData, i, i + 3).sum()); ```
You don't say specifically, but let's just assume that quarter #1 is entries 0 - 2 in 'salesData`; quarter #2 is entries 3 to 5, etc. Here's one way to find and print the quarter totals: ``` int salesData[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; int qtotal[] = new int[4]; for (int q = 0; q < 4; ++q) ...
28,277,685
I have webpages with URL <http://siteurl/directory/onemore/>$fileID.php I am trying to extract just the $fileID and after that use ``` $query = $mysqli->query("SELECT * FROM tablename WHERE ID = $fileID"); $rows = mysqli_fetch_array($query); $hits = $rows['HITS']; $hits = $hits + 1; $query = $mysqli->query("UPDATE t...
2015/02/02
[ "https://Stackoverflow.com/questions/28277685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4516574/" ]
You can determine the $fileId like this: ``` /* $_SERVER['PHP_SELF'] results to e.g. '/directory/onemore/5.php' */ /* basename(...) results to e.g. '5.php' */ $fileName = basename($_SERVER['PHP_SELF']); /* take the text before the last occurrence of '.' */ $fileID = substr($fileName, 0, strrpos($fileName, '.')); $que...
Try this: ``` <?php $url = 'http://username:password@hostname/path?arg=value#anchor'; print_r(parse_url($url)); echo parse_url($url, PHP_URL_PATH); ?> ``` > > Output > > > ``` Array ( [scheme] => http [host] => hostname [user] => username [pass] => password [path] => /path [query] => a...
28,277,685
I have webpages with URL <http://siteurl/directory/onemore/>$fileID.php I am trying to extract just the $fileID and after that use ``` $query = $mysqli->query("SELECT * FROM tablename WHERE ID = $fileID"); $rows = mysqli_fetch_array($query); $hits = $rows['HITS']; $hits = $hits + 1; $query = $mysqli->query("UPDATE t...
2015/02/02
[ "https://Stackoverflow.com/questions/28277685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4516574/" ]
Try this: ``` <?php $url = 'http://username:password@hostname/path?arg=value#anchor'; print_r(parse_url($url)); echo parse_url($url, PHP_URL_PATH); ?> ``` > > Output > > > ``` Array ( [scheme] => http [host] => hostname [user] => username [pass] => password [path] => /path [query] => a...
Getting $fileID of the URL: Have a look at [pathinfo()](http://php.net/manual/de/function.pathinfo.php) - this function extracts the URL in different parts In your case it would be: ``` $path_parts = pathinfo($_SERVER["SCRIPT_FILENAME"]); $fileID = $path_parts['filename']; ``` Your update query will work, in case...
28,277,685
I have webpages with URL <http://siteurl/directory/onemore/>$fileID.php I am trying to extract just the $fileID and after that use ``` $query = $mysqli->query("SELECT * FROM tablename WHERE ID = $fileID"); $rows = mysqli_fetch_array($query); $hits = $rows['HITS']; $hits = $hits + 1; $query = $mysqli->query("UPDATE t...
2015/02/02
[ "https://Stackoverflow.com/questions/28277685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4516574/" ]
You can determine the $fileId like this: ``` /* $_SERVER['PHP_SELF'] results to e.g. '/directory/onemore/5.php' */ /* basename(...) results to e.g. '5.php' */ $fileName = basename($_SERVER['PHP_SELF']); /* take the text before the last occurrence of '.' */ $fileID = substr($fileName, 0, strrpos($fileName, '.')); $que...
If you don't need to print the hits every time, you can increment it in a single query which is a bit more clear and efficient. ``` UPDATE tablename SET hits = hits + 1 WHERE id = $fileID ```
28,277,685
I have webpages with URL <http://siteurl/directory/onemore/>$fileID.php I am trying to extract just the $fileID and after that use ``` $query = $mysqli->query("SELECT * FROM tablename WHERE ID = $fileID"); $rows = mysqli_fetch_array($query); $hits = $rows['HITS']; $hits = $hits + 1; $query = $mysqli->query("UPDATE t...
2015/02/02
[ "https://Stackoverflow.com/questions/28277685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4516574/" ]
You can determine the $fileId like this: ``` /* $_SERVER['PHP_SELF'] results to e.g. '/directory/onemore/5.php' */ /* basename(...) results to e.g. '5.php' */ $fileName = basename($_SERVER['PHP_SELF']); /* take the text before the last occurrence of '.' */ $fileID = substr($fileName, 0, strrpos($fileName, '.')); $que...
Getting $fileID of the URL: Have a look at [pathinfo()](http://php.net/manual/de/function.pathinfo.php) - this function extracts the URL in different parts In your case it would be: ``` $path_parts = pathinfo($_SERVER["SCRIPT_FILENAME"]); $fileID = $path_parts['filename']; ``` Your update query will work, in case...
28,277,685
I have webpages with URL <http://siteurl/directory/onemore/>$fileID.php I am trying to extract just the $fileID and after that use ``` $query = $mysqli->query("SELECT * FROM tablename WHERE ID = $fileID"); $rows = mysqli_fetch_array($query); $hits = $rows['HITS']; $hits = $hits + 1; $query = $mysqli->query("UPDATE t...
2015/02/02
[ "https://Stackoverflow.com/questions/28277685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4516574/" ]
If you don't need to print the hits every time, you can increment it in a single query which is a bit more clear and efficient. ``` UPDATE tablename SET hits = hits + 1 WHERE id = $fileID ```
Getting $fileID of the URL: Have a look at [pathinfo()](http://php.net/manual/de/function.pathinfo.php) - this function extracts the URL in different parts In your case it would be: ``` $path_parts = pathinfo($_SERVER["SCRIPT_FILENAME"]); $fileID = $path_parts['filename']; ``` Your update query will work, in case...
22,345,614
How can this be possible: ``` var string1 = "", string2 = ""; //comparing the charCode console.log(string1.charCodeAt(0) === string2.charCodeAt(0)); //true //comparing the character console.log(string1 === string2.substring(0,1)); //false //This is giving me a headache. ``` <http://jsfiddle.net/Derek...
2014/03/12
[ "https://Stackoverflow.com/questions/22345614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/283863/" ]
In JavaScript, strings are treated by characters instead of bytes, but only if they can be expressed in 16-bit code points. A majority of the characters will cause no issues, but in this case they don't "fit" and so they occupy 2 characters as far as JavaScript is concerned. In this case you need to do: ``` string2....
You can use the method to compare 2 strings: ``` string1.localeCompare(string2); ```
22,345,614
How can this be possible: ``` var string1 = "", string2 = ""; //comparing the charCode console.log(string1.charCodeAt(0) === string2.charCodeAt(0)); //true //comparing the character console.log(string1 === string2.substring(0,1)); //false //This is giving me a headache. ``` <http://jsfiddle.net/Derek...
2014/03/12
[ "https://Stackoverflow.com/questions/22345614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/283863/" ]
In JavaScript, strings are treated by characters instead of bytes, but only if they can be expressed in 16-bit code points. A majority of the characters will cause no issues, but in this case they don't "fit" and so they occupy 2 characters as far as JavaScript is concerned. In this case you need to do: ``` string2....
Substring parameters are the index where he starts, and the end, where as if you change it to substr, the parameters are index where to start and how many characters.
9,743,846
I have to do some processing on a file loaded by the user. This process can take a long time based on the number of pages within the file. I am planning on using jQuery UIs progressbar and telling the user how many pages have been processed. However, my progress check does not return until the first ajax call is comple...
2012/03/16
[ "https://Stackoverflow.com/questions/9743846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2486/" ]
You can do it in a single thread. Suppose you have a script that prints lines at random times: ``` #!/usr/bin/env python #file: child.py import os import random import sys import time for i in range(10): print("%2d %s %s" % (int(sys.argv[1]), os.getpid(), i)) sys.stdout.flush() time.sleep(random.random()...
You don't need to run a thread for each process. You can peek at the `stdout` streams for each process without blocking on them, and only read from them if they have data available to read. You *do* have to be careful not to accidentally block on them, though, if you're not intending to.
9,743,846
I have to do some processing on a file loaded by the user. This process can take a long time based on the number of pages within the file. I am planning on using jQuery UIs progressbar and telling the user how many pages have been processed. However, my progress check does not return until the first ajax call is comple...
2012/03/16
[ "https://Stackoverflow.com/questions/9743846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2486/" ]
You can also collect stdout from multiple subprocesses concurrently using [`twisted`](http://twistedmatrix.com/trac/): ``` #!/usr/bin/env python import sys from twisted.internet import protocol, reactor class ProcessProtocol(protocol.ProcessProtocol): def outReceived(self, data): print data, # received ch...
You don't need to run a thread for each process. You can peek at the `stdout` streams for each process without blocking on them, and only read from them if they have data available to read. You *do* have to be careful not to accidentally block on them, though, if you're not intending to.
9,743,846
I have to do some processing on a file loaded by the user. This process can take a long time based on the number of pages within the file. I am planning on using jQuery UIs progressbar and telling the user how many pages have been processed. However, my progress check does not return until the first ajax call is comple...
2012/03/16
[ "https://Stackoverflow.com/questions/9743846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2486/" ]
You don't need to run a thread for each process. You can peek at the `stdout` streams for each process without blocking on them, and only read from them if they have data available to read. You *do* have to be careful not to accidentally block on them, though, if you're not intending to.
You can wait for `process.poll()` to finish, and run other stuff concurrently: ``` import time ...
9,743,846
I have to do some processing on a file loaded by the user. This process can take a long time based on the number of pages within the file. I am planning on using jQuery UIs progressbar and telling the user how many pages have been processed. However, my progress check does not return until the first ajax call is comple...
2012/03/16
[ "https://Stackoverflow.com/questions/9743846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2486/" ]
You can do it in a single thread. Suppose you have a script that prints lines at random times: ``` #!/usr/bin/env python #file: child.py import os import random import sys import time for i in range(10): print("%2d %s %s" % (int(sys.argv[1]), os.getpid(), i)) sys.stdout.flush() time.sleep(random.random()...
You can also collect stdout from multiple subprocesses concurrently using [`twisted`](http://twistedmatrix.com/trac/): ``` #!/usr/bin/env python import sys from twisted.internet import protocol, reactor class ProcessProtocol(protocol.ProcessProtocol): def outReceived(self, data): print data, # received ch...
9,743,846
I have to do some processing on a file loaded by the user. This process can take a long time based on the number of pages within the file. I am planning on using jQuery UIs progressbar and telling the user how many pages have been processed. However, my progress check does not return until the first ajax call is comple...
2012/03/16
[ "https://Stackoverflow.com/questions/9743846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2486/" ]
You can do it in a single thread. Suppose you have a script that prints lines at random times: ``` #!/usr/bin/env python #file: child.py import os import random import sys import time for i in range(10): print("%2d %s %s" % (int(sys.argv[1]), os.getpid(), i)) sys.stdout.flush() time.sleep(random.random()...
You can wait for `process.poll()` to finish, and run other stuff concurrently: ``` import time ...
9,743,846
I have to do some processing on a file loaded by the user. This process can take a long time based on the number of pages within the file. I am planning on using jQuery UIs progressbar and telling the user how many pages have been processed. However, my progress check does not return until the first ajax call is comple...
2012/03/16
[ "https://Stackoverflow.com/questions/9743846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2486/" ]
You can also collect stdout from multiple subprocesses concurrently using [`twisted`](http://twistedmatrix.com/trac/): ``` #!/usr/bin/env python import sys from twisted.internet import protocol, reactor class ProcessProtocol(protocol.ProcessProtocol): def outReceived(self, data): print data, # received ch...
You can wait for `process.poll()` to finish, and run other stuff concurrently: ``` import time ...
22,312,325
I have a set of 8 buttons in a horizontal row. How can i make them like the buttons in [www.dotacinema.com](http://www.dotacinema.com) where when you smaller the window the buttons go together too (or zoom in, the buttons are still visible) Thanks EDIT: ``` height: 38px; float: left; min-width: 60px; max-width: ...
2014/03/10
[ "https://Stackoverflow.com/questions/22312325", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2881151/" ]
Make the width of the buttons a percentage of the page, and then set a minimum button width using `min-width: ;` to stop them getting any smaller than readable. <http://jsfiddle.net/s2VvX/3/>
What they did on the site you provided is change the `ul` into a table using CSS, where each `li` is a table-cell which causes it to automatically adjust the width of the `li`s to fill the `ul`. You can find out more by using the [Chrome Developer Tools](https://developers.google.com/chrome-developer-tools/). Note th...
65,229,771
After working with the tensorflow's example tutorial on colab: Basic regression: Predict fuel efficiency, which can be found here: <https://www.tensorflow.org/tutorials/keras/regression>. I've been trying to run this example on jupyter notebook via anaconda in order to be able to run it offline too. The code that...
2020/12/10
[ "https://Stackoverflow.com/questions/65229771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14799022/" ]
I see you are using different models in them. In **Colab** you have used model having only **5** parameters whereas in **Notebook** you are using a dense model having **944** parameters. **Try running the model with less parameter on notebook first** or Try running the same model on both.(Maybe the complex model was n...
Putting an extra set of brackets around each horsepower value fixes the issue for me: ``` horsepower = np.array([[h] for h in train_features['Horsepower']]) ```
38,408,974
I'm new in swift-ios. I'm studying [this](https://www.ralfebert.de/tutorials/ios-swift-uitableviewcontroller/) when I'm trying to create cocoa file, > > import cocoa > > > is giving error. I've searched in google and found cocoa class not work in ios-swift. it works in osx. So I'm not getting what'll I do no...
2016/07/16
[ "https://Stackoverflow.com/questions/38408974", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2007490/" ]
Cocoa is a framework for macOS. However, CocoaTouch is an umbrella module for iOS. To import the main module dependency for an iOS app, you use ``` import Foundation ``` And to import the main UI module for an iOS app, you use ``` import UIKit ```
The term “Cocoa” has been used to refer generically to any class or object that is based on the Objective-C runtime and inherits from the root class, NSObject.
50,621,187
I need to click a button whose xpath is "**//input[contains(@value,'Export to Excel')]**" through **Execute Javascript** keyword. I don't know how to use it. Can anyone help me out!!!
2018/05/31
[ "https://Stackoverflow.com/questions/50621187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9667509/" ]
You can write it as below ``` Execute JavaScript document.evaluate("ur xpath",document.body,null,9,null).singleNodeValue.click(); ```
The solution I found out for this problem is I have **reloaded the page** after **executing the AutoIT** script, then I was able to execute the remaining code.
1,038,189
which one of the 2 have the best performance? In javascript I was heard douglas crockford say that you shouldn't use str += if you are concatenating a large string but use array.push instead. I've seen lots of code where developers use $str .= to concatenate a large string in PHP as well, but since "everything" in PH...
2009/06/24
[ "https://Stackoverflow.com/questions/1038189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/117278/" ]
`.=` is for strings. [`array_push()`](http://us2.php.net/manual/en/function.array-push.php) is for arrays. They aren't the same thing in PHP. Using one on the other will generate an error.
array\_push() won't work for appending to a string in PHP, because PHP strings aren't really arrays (like you'd see them in C or JavaScript).
1,038,189
which one of the 2 have the best performance? In javascript I was heard douglas crockford say that you shouldn't use str += if you are concatenating a large string but use array.push instead. I've seen lots of code where developers use $str .= to concatenate a large string in PHP as well, but since "everything" in PH...
2009/06/24
[ "https://Stackoverflow.com/questions/1038189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/117278/" ]
Strings are mutable in PHP so using .= does not have the same affect in php as using += in javascript. That is, you will not not end up with two different strings every time you use the operator. See: [php String Concatenation, Performance](https://stackoverflow.com/questions/124067/php-string-concatenation-performa...
array\_push() won't work for appending to a string in PHP, because PHP strings aren't really arrays (like you'd see them in C or JavaScript).
1,038,189
which one of the 2 have the best performance? In javascript I was heard douglas crockford say that you shouldn't use str += if you are concatenating a large string but use array.push instead. I've seen lots of code where developers use $str .= to concatenate a large string in PHP as well, but since "everything" in PH...
2009/06/24
[ "https://Stackoverflow.com/questions/1038189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/117278/" ]
Strings are mutable in PHP so using .= does not have the same affect in php as using += in javascript. That is, you will not not end up with two different strings every time you use the operator. See: [php String Concatenation, Performance](https://stackoverflow.com/questions/124067/php-string-concatenation-performa...
`.=` is for strings. [`array_push()`](http://us2.php.net/manual/en/function.array-push.php) is for arrays. They aren't the same thing in PHP. Using one on the other will generate an error.
61,339,388
I have two tables t1 & t2. In t1, there are 1641787 records. In t2, there are 33176007 records. I want to take two columns from t2 and keep everything of t1 using a left join. When I use left join with t1 to t2, I got more records than t1. I would like to get a similar number of records as t1 after joining. Please give...
2020/04/21
[ "https://Stackoverflow.com/questions/61339388", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5846329/" ]
You need to aggregate `t2` *before* joining: ``` SELECT t1.*, t2.City FROM t1 LEFT JOIN (SELECT t2.ID, ANY_VALUE(t2.City) as City FROM t2 GROUP BY t2.ID) ) t2 ON t1.ID = t2.ID; ```
"select **destinct** ..." add a "order by" Like this: ``` SELECT DESTINCT t1.*, t2.City FROM t1 LEFT JOIN t2 ON t1.ID = t2.ID ORDER BY t1.name ASC; ```
4,012,120
I am trying to build a simple graphics application in WPF C#. The purpose is to draw 10000\*10000 rectangles of size 4 pixels each. I have modified the OnRender method of the canvas to draw the rectangles. Drawings are performed for smaller number of rectangles (say 50\*50 or 100\*100 rectangles of 4 pixel each) but i...
2010/10/25
[ "https://Stackoverflow.com/questions/4012120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/461537/" ]
One more tip on top of what everyone already said, make sure the pens and brushes are frozen - if you create the brush call Freeze before using it (brushes from the Brushes class (Brushes.White) are already frozen).
The bitmap approach might speed up more - BitmapSource has a Create method that takes raw data either as an array or a pointer to unsafe memory. It should be a bit faster to set values in an array than drawing actual rectangles - however you have to checkout the pixelformats to set the individual pixels correctly.
4,012,120
I am trying to build a simple graphics application in WPF C#. The purpose is to draw 10000\*10000 rectangles of size 4 pixels each. I have modified the OnRender method of the canvas to draw the rectangles. Drawings are performed for smaller number of rectangles (say 50\*50 or 100\*100 rectangles of 4 pixel each) but i...
2010/10/25
[ "https://Stackoverflow.com/questions/4012120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/461537/" ]
One more tip on top of what everyone already said, make sure the pens and brushes are frozen - if you create the brush call Freeze before using it (brushes from the Brushes class (Brushes.White) are already frozen).
Perhaps try overlaying the canvas with a VisualBrush. To this visualBrush simply add the 4\*4 rectangle and have it repeat in a tile mode. Alternatively you could just add the lines to it so that it doesnt overlap the edges of the rectangle... your choice :) Your problem is in the creation of the brush... A test ru...
4,012,120
I am trying to build a simple graphics application in WPF C#. The purpose is to draw 10000\*10000 rectangles of size 4 pixels each. I have modified the OnRender method of the canvas to draw the rectangles. Drawings are performed for smaller number of rectangles (say 50\*50 or 100\*100 rectangles of 4 pixel each) but i...
2010/10/25
[ "https://Stackoverflow.com/questions/4012120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/461537/" ]
You should try StreamGeometry then. <http://msdn.microsoft.com/en-us/library/system.windows.media.streamgeometry.aspx> > > For complex geometries that don’t need > to be modified after they are created, > you should consider using > StreamGeometry rather than > PathGeometry as a performance > optimization. Strea...
The bitmap approach might speed up more - BitmapSource has a Create method that takes raw data either as an array or a pointer to unsafe memory. It should be a bit faster to set values in an array than drawing actual rectangles - however you have to checkout the pixelformats to set the individual pixels correctly.
4,012,120
I am trying to build a simple graphics application in WPF C#. The purpose is to draw 10000\*10000 rectangles of size 4 pixels each. I have modified the OnRender method of the canvas to draw the rectangles. Drawings are performed for smaller number of rectangles (say 50\*50 or 100\*100 rectangles of 4 pixel each) but i...
2010/10/25
[ "https://Stackoverflow.com/questions/4012120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/461537/" ]
You don't need to recreate the brush for each iteration of the loop, since they use the same color over and over: ``` SolidColorBrush blueBrush = new SolidColorBrush(Colors.Blue) SolidColorPen bluePen = new SolidColorPen(blueBrush) for (int i = 0; i < MaxRow; i++) { for (int j = 0; j < MaxColumn; j++) { ...
Perhaps try overlaying the canvas with a VisualBrush. To this visualBrush simply add the 4\*4 rectangle and have it repeat in a tile mode. Alternatively you could just add the lines to it so that it doesnt overlap the edges of the rectangle... your choice :) Your problem is in the creation of the brush... A test ru...
4,012,120
I am trying to build a simple graphics application in WPF C#. The purpose is to draw 10000\*10000 rectangles of size 4 pixels each. I have modified the OnRender method of the canvas to draw the rectangles. Drawings are performed for smaller number of rectangles (say 50\*50 or 100\*100 rectangles of 4 pixel each) but i...
2010/10/25
[ "https://Stackoverflow.com/questions/4012120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/461537/" ]
You should try StreamGeometry then. <http://msdn.microsoft.com/en-us/library/system.windows.media.streamgeometry.aspx> > > For complex geometries that don’t need > to be modified after they are created, > you should consider using > StreamGeometry rather than > PathGeometry as a performance > optimization. Strea...
Perhaps try overlaying the canvas with a VisualBrush. To this visualBrush simply add the 4\*4 rectangle and have it repeat in a tile mode. Alternatively you could just add the lines to it so that it doesnt overlap the edges of the rectangle... your choice :) Your problem is in the creation of the brush... A test ru...
4,012,120
I am trying to build a simple graphics application in WPF C#. The purpose is to draw 10000\*10000 rectangles of size 4 pixels each. I have modified the OnRender method of the canvas to draw the rectangles. Drawings are performed for smaller number of rectangles (say 50\*50 or 100\*100 rectangles of 4 pixel each) but i...
2010/10/25
[ "https://Stackoverflow.com/questions/4012120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/461537/" ]
> > The purpose is to draw 10000\*10000 > rectangles of size 4 pixels each. > > > Do NOT draw them. That simple. This would be 40k to 40k pixels. Most will not be visible. So they must not bee drawn. Basically only draw those that are visible in the canvas. When resizing or scrolling you repaint anyway, then do ...
You should try StreamGeometry then. <http://msdn.microsoft.com/en-us/library/system.windows.media.streamgeometry.aspx> > > For complex geometries that don’t need > to be modified after they are created, > you should consider using > StreamGeometry rather than > PathGeometry as a performance > optimization. Strea...
4,012,120
I am trying to build a simple graphics application in WPF C#. The purpose is to draw 10000\*10000 rectangles of size 4 pixels each. I have modified the OnRender method of the canvas to draw the rectangles. Drawings are performed for smaller number of rectangles (say 50\*50 or 100\*100 rectangles of 4 pixel each) but i...
2010/10/25
[ "https://Stackoverflow.com/questions/4012120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/461537/" ]
> > The purpose is to draw 10000\*10000 > rectangles of size 4 pixels each. > > > Do NOT draw them. That simple. This would be 40k to 40k pixels. Most will not be visible. So they must not bee drawn. Basically only draw those that are visible in the canvas. When resizing or scrolling you repaint anyway, then do ...
You don't need to recreate the brush for each iteration of the loop, since they use the same color over and over: ``` SolidColorBrush blueBrush = new SolidColorBrush(Colors.Blue) SolidColorPen bluePen = new SolidColorPen(blueBrush) for (int i = 0; i < MaxRow; i++) { for (int j = 0; j < MaxColumn; j++) { ...
4,012,120
I am trying to build a simple graphics application in WPF C#. The purpose is to draw 10000\*10000 rectangles of size 4 pixels each. I have modified the OnRender method of the canvas to draw the rectangles. Drawings are performed for smaller number of rectangles (say 50\*50 or 100\*100 rectangles of 4 pixel each) but i...
2010/10/25
[ "https://Stackoverflow.com/questions/4012120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/461537/" ]
> > The purpose is to draw 10000\*10000 > rectangles of size 4 pixels each. > > > Do NOT draw them. That simple. This would be 40k to 40k pixels. Most will not be visible. So they must not bee drawn. Basically only draw those that are visible in the canvas. When resizing or scrolling you repaint anyway, then do ...
The bitmap approach might speed up more - BitmapSource has a Create method that takes raw data either as an array or a pointer to unsafe memory. It should be a bit faster to set values in an array than drawing actual rectangles - however you have to checkout the pixelformats to set the individual pixels correctly.
4,012,120
I am trying to build a simple graphics application in WPF C#. The purpose is to draw 10000\*10000 rectangles of size 4 pixels each. I have modified the OnRender method of the canvas to draw the rectangles. Drawings are performed for smaller number of rectangles (say 50\*50 or 100\*100 rectangles of 4 pixel each) but i...
2010/10/25
[ "https://Stackoverflow.com/questions/4012120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/461537/" ]
The bitmap approach might speed up more - BitmapSource has a Create method that takes raw data either as an array or a pointer to unsafe memory. It should be a bit faster to set values in an array than drawing actual rectangles - however you have to checkout the pixelformats to set the individual pixels correctly.
Perhaps try overlaying the canvas with a VisualBrush. To this visualBrush simply add the 4\*4 rectangle and have it repeat in a tile mode. Alternatively you could just add the lines to it so that it doesnt overlap the edges of the rectangle... your choice :) Your problem is in the creation of the brush... A test ru...
4,012,120
I am trying to build a simple graphics application in WPF C#. The purpose is to draw 10000\*10000 rectangles of size 4 pixels each. I have modified the OnRender method of the canvas to draw the rectangles. Drawings are performed for smaller number of rectangles (say 50\*50 or 100\*100 rectangles of 4 pixel each) but i...
2010/10/25
[ "https://Stackoverflow.com/questions/4012120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/461537/" ]
You don't need to recreate the brush for each iteration of the loop, since they use the same color over and over: ``` SolidColorBrush blueBrush = new SolidColorBrush(Colors.Blue) SolidColorPen bluePen = new SolidColorPen(blueBrush) for (int i = 0; i < MaxRow; i++) { for (int j = 0; j < MaxColumn; j++) { ...
The bitmap approach might speed up more - BitmapSource has a Create method that takes raw data either as an array or a pointer to unsafe memory. It should be a bit faster to set values in an array than drawing actual rectangles - however you have to checkout the pixelformats to set the individual pixels correctly.