qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
27,743,113
I create a project with the NavigationDrawerFragment, and I set the fragments for the menu. Switching between menus fragments are working. But now I create an imageview on one of the fragments. and I want that when you click on the imageview it changes fragment just like the menu. MainActivity.java ``` package com.**...
2015/01/02
[ "https://Stackoverflow.com/questions/27743113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4412515/" ]
This commit introduced the breaking change: <https://github.com/indutny/miller-rabin/commit/bb85f555974587a410a17173f0bc484133b53cb7> The author of the library should fix it, but meanwhile you can: 1. Delete the existing `node_modules` folder 2. `npm install miller-rabin@1.1.1 --save-peer` 3. `npm install browserify`
Try zipping your existing node\_modules and package.json, then delete them. You may need to 1st generate a new package.json using: ``` npm init ``` Then install browserify locally: `npm install browserify` Also, you'll have to install browserify globally: ``` npm install browserify -g ``` To zip on CMD or term...
27,743,113
I create a project with the NavigationDrawerFragment, and I set the fragments for the menu. Switching between menus fragments are working. But now I create an imageview on one of the fragments. and I want that when you click on the imageview it changes fragment just like the menu. MainActivity.java ``` package com.**...
2015/01/02
[ "https://Stackoverflow.com/questions/27743113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4412515/" ]
This commit introduced the breaking change: <https://github.com/indutny/miller-rabin/commit/bb85f555974587a410a17173f0bc484133b53cb7> The author of the library should fix it, but meanwhile you can: 1. Delete the existing `node_modules` folder 2. `npm install miller-rabin@1.1.1 --save-peer` 3. `npm install browserify`
There are details of a workaround list in the issues on the github page [Error listing](https://github.com/substack/node-browserify/issues/1049) To summarise the solution posted in the issue, you need to install miller-rabin@1.1.1 as a peer-dependency in your own project (npm install miller-rabin@1.1.1 --save-peer) t...
27,743,113
I create a project with the NavigationDrawerFragment, and I set the fragments for the menu. Switching between menus fragments are working. But now I create an imageview on one of the fragments. and I want that when you click on the imageview it changes fragment just like the menu. MainActivity.java ``` package com.**...
2015/01/02
[ "https://Stackoverflow.com/questions/27743113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4412515/" ]
Had the same issue on Linux. Try running `npm update -g` before installing browserify. This has worked for me.
Try zipping your existing node\_modules and package.json, then delete them. You may need to 1st generate a new package.json using: ``` npm init ``` Then install browserify locally: `npm install browserify` Also, you'll have to install browserify globally: ``` npm install browserify -g ``` To zip on CMD or term...
27,743,113
I create a project with the NavigationDrawerFragment, and I set the fragments for the menu. Switching between menus fragments are working. But now I create an imageview on one of the fragments. and I want that when you click on the imageview it changes fragment just like the menu. MainActivity.java ``` package com.**...
2015/01/02
[ "https://Stackoverflow.com/questions/27743113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4412515/" ]
Had the same issue on Linux. Try running `npm update -g` before installing browserify. This has worked for me.
Recently found this issue on browserify's github. <https://github.com/substack/node-browserify/issues/1049> There is a workaround described.
27,743,113
I create a project with the NavigationDrawerFragment, and I set the fragments for the menu. Switching between menus fragments are working. But now I create an imageview on one of the fragments. and I want that when you click on the imageview it changes fragment just like the menu. MainActivity.java ``` package com.**...
2015/01/02
[ "https://Stackoverflow.com/questions/27743113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4412515/" ]
Had the same issue on Linux. Try running `npm update -g` before installing browserify. This has worked for me.
There are details of a workaround list in the issues on the github page [Error listing](https://github.com/substack/node-browserify/issues/1049) To summarise the solution posted in the issue, you need to install miller-rabin@1.1.1 as a peer-dependency in your own project (npm install miller-rabin@1.1.1 --save-peer) t...
27,743,113
I create a project with the NavigationDrawerFragment, and I set the fragments for the menu. Switching between menus fragments are working. But now I create an imageview on one of the fragments. and I want that when you click on the imageview it changes fragment just like the menu. MainActivity.java ``` package com.**...
2015/01/02
[ "https://Stackoverflow.com/questions/27743113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4412515/" ]
In order to make the `workaround` work, you have to 1. Delete the existing `node_modules` folder. 2. `npm install miller-rabin@1.1.1 --save-peer` 3. `npm install browserify` That works guaranteed.
Recently found this issue on browserify's github. <https://github.com/substack/node-browserify/issues/1049> There is a workaround described.
27,743,113
I create a project with the NavigationDrawerFragment, and I set the fragments for the menu. Switching between menus fragments are working. But now I create an imageview on one of the fragments. and I want that when you click on the imageview it changes fragment just like the menu. MainActivity.java ``` package com.**...
2015/01/02
[ "https://Stackoverflow.com/questions/27743113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4412515/" ]
This commit introduced the breaking change: <https://github.com/indutny/miller-rabin/commit/bb85f555974587a410a17173f0bc484133b53cb7> The author of the library should fix it, but meanwhile you can: 1. Delete the existing `node_modules` folder 2. `npm install miller-rabin@1.1.1 --save-peer` 3. `npm install browserify`
Recently found this issue on browserify's github. <https://github.com/substack/node-browserify/issues/1049> There is a workaround described.
27,743,113
I create a project with the NavigationDrawerFragment, and I set the fragments for the menu. Switching between menus fragments are working. But now I create an imageview on one of the fragments. and I want that when you click on the imageview it changes fragment just like the menu. MainActivity.java ``` package com.**...
2015/01/02
[ "https://Stackoverflow.com/questions/27743113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4412515/" ]
In order to make the `workaround` work, you have to 1. Delete the existing `node_modules` folder. 2. `npm install miller-rabin@1.1.1 --save-peer` 3. `npm install browserify` That works guaranteed.
Try zipping your existing node\_modules and package.json, then delete them. You may need to 1st generate a new package.json using: ``` npm init ``` Then install browserify locally: `npm install browserify` Also, you'll have to install browserify globally: ``` npm install browserify -g ``` To zip on CMD or term...
27,743,113
I create a project with the NavigationDrawerFragment, and I set the fragments for the menu. Switching between menus fragments are working. But now I create an imageview on one of the fragments. and I want that when you click on the imageview it changes fragment just like the menu. MainActivity.java ``` package com.**...
2015/01/02
[ "https://Stackoverflow.com/questions/27743113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4412515/" ]
Recently found this issue on browserify's github. <https://github.com/substack/node-browserify/issues/1049> There is a workaround described.
There are details of a workaround list in the issues on the github page [Error listing](https://github.com/substack/node-browserify/issues/1049) To summarise the solution posted in the issue, you need to install miller-rabin@1.1.1 as a peer-dependency in your own project (npm install miller-rabin@1.1.1 --save-peer) t...
27,743,113
I create a project with the NavigationDrawerFragment, and I set the fragments for the menu. Switching between menus fragments are working. But now I create an imageview on one of the fragments. and I want that when you click on the imageview it changes fragment just like the menu. MainActivity.java ``` package com.**...
2015/01/02
[ "https://Stackoverflow.com/questions/27743113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4412515/" ]
Recently found this issue on browserify's github. <https://github.com/substack/node-browserify/issues/1049> There is a workaround described.
Try zipping your existing node\_modules and package.json, then delete them. You may need to 1st generate a new package.json using: ``` npm init ``` Then install browserify locally: `npm install browserify` Also, you'll have to install browserify globally: ``` npm install browserify -g ``` To zip on CMD or term...
25,648,704
I am getting trouble trying to delete a pointer that is owned by a vector. In my application I have a QListView, and I store new items based on a vector of pointers. This is the declaration: ``` private: vector<QStandardItem *> item; QStandardItemModel* model = new QStandardItemModel(); ``` I simplified it, but it ...
2014/09/03
[ "https://Stackoverflow.com/questions/25648704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3758543/" ]
You're actually deleting a second time the `QStandardItem` that was at this index. Indeed, as you can see in the following extract from the Qt doc of the [`QStandardItemModel`'s function `setItem`](http://qt-project.org/doc/qt-5/qstandarditemmodel.html#setItem) > > Sets the item for the given row and column to item. ...
As far as I know, Qt is managing the lifetime of the objects through a parent-child relationship and automatically deletes children. This was at least the case Qt while I was using it. Considering that, I think there is no need for manual memory management here because the item will be deleted by Qt.
20,285,562
Why this perl code is giving output "True"? ``` $bar = "\\"; if ($bar =~ /[A-z]/){ print "True"; } else { print "False"; } ``` Shouldn't it return false?
2013/11/29
[ "https://Stackoverflow.com/questions/20285562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1503870/" ]
Because \ is between A-z. See table below, 92 is between 65 and 122. Try [A-Z]. ``` 0 nul 1 soh 2 stx 3 etx 4 eot 5 enq 6 ack 7 bel 8 bs 9 ht 10 nl 11 vt 12 np 13 cr 14 so 15 si 16 dle 17 dc1 18 dc2 19 dc3 20 dc4 21 nak 22 syn 23 etb 24 can 25 em ...
``` $bar =~ /[A-z]/; ``` is not same as ``` $bar =~ /[A-Z]/; ``` Check all chars between `A` and `z`: ``` perl -le 'print map chr, ord("A") .. ord("z")' ``` --- ``` ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz ```
20,285,562
Why this perl code is giving output "True"? ``` $bar = "\\"; if ($bar =~ /[A-z]/){ print "True"; } else { print "False"; } ``` Shouldn't it return false?
2013/11/29
[ "https://Stackoverflow.com/questions/20285562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1503870/" ]
``` $bar =~ /[A-z]/; ``` is not same as ``` $bar =~ /[A-Z]/; ``` Check all chars between `A` and `z`: ``` perl -le 'print map chr, ord("A") .. ord("z")' ``` --- ``` ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz ```
Becauase you've written `[A-z]`: See: <http://perldoc.perl.org/perlrecharclass.html> ``` [a-z] # Matches a character that is a lower case ASCII letter. ``` Try `[A-Z]` for uppercase, or `[a-zA-Z]` for both upper and lower case
20,285,562
Why this perl code is giving output "True"? ``` $bar = "\\"; if ($bar =~ /[A-z]/){ print "True"; } else { print "False"; } ``` Shouldn't it return false?
2013/11/29
[ "https://Stackoverflow.com/questions/20285562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1503870/" ]
Because \ is between A-z. See table below, 92 is between 65 and 122. Try [A-Z]. ``` 0 nul 1 soh 2 stx 3 etx 4 eot 5 enq 6 ack 7 bel 8 bs 9 ht 10 nl 11 vt 12 np 13 cr 14 so 15 si 16 dle 17 dc1 18 dc2 19 dc3 20 dc4 21 nak 22 syn 23 etb 24 can 25 em ...
Becauase you've written `[A-z]`: See: <http://perldoc.perl.org/perlrecharclass.html> ``` [a-z] # Matches a character that is a lower case ASCII letter. ``` Try `[A-Z]` for uppercase, or `[a-zA-Z]` for both upper and lower case
9,742,752
I am trying to add a second pager to my slideshows in 1/3 > format so if there are 3 slides it shows how many slides and what slide your on and if you want to move forward you just click the arrow. It has to be simple but I can't find any examples out there. Here is what I have so far: ``` $(function() { $('.slideshow...
2012/03/16
[ "https://Stackoverflow.com/questions/9742752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1130990/" ]
If you click the dropdown on your MainPage.xaml.cs you will see methods that are greyed out, these are the methods that you are looking for. If you have another partial class based on your MainPage they will be visible there also. ![](https://i.stack.imgur.com/lrfdS.png)
Should be in YourProject\obj\x86\Debug\MainWindow.g.cs
9,742,752
I am trying to add a second pager to my slideshows in 1/3 > format so if there are 3 slides it shows how many slides and what slide your on and if you want to move forward you just click the arrow. It has to be simple but I can't find any examples out there. Here is what I have so far: ``` $(function() { $('.slideshow...
2012/03/16
[ "https://Stackoverflow.com/questions/9742752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1130990/" ]
If you click the dropdown on your MainPage.xaml.cs you will see methods that are greyed out, these are the methods that you are looking for. If you have another partial class based on your MainPage they will be visible there also. ![](https://i.stack.imgur.com/lrfdS.png)
When Ctrl Key Pressed Click on Class name (MainPage for this instance) and you will see list of other partials. Not for just Silverlight projects. Its a good way extending a class I think. When you manage well. ![enter image description here](https://i.stack.imgur.com/ASqvF.png)
9,742,752
I am trying to add a second pager to my slideshows in 1/3 > format so if there are 3 slides it shows how many slides and what slide your on and if you want to move forward you just click the arrow. It has to be simple but I can't find any examples out there. Here is what I have so far: ``` $(function() { $('.slideshow...
2012/03/16
[ "https://Stackoverflow.com/questions/9742752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1130990/" ]
When Ctrl Key Pressed Click on Class name (MainPage for this instance) and you will see list of other partials. Not for just Silverlight projects. Its a good way extending a class I think. When you manage well. ![enter image description here](https://i.stack.imgur.com/ASqvF.png)
Should be in YourProject\obj\x86\Debug\MainWindow.g.cs
1,004,191
With twitter being down today I was thinking about how to best handle calls to an API when it is down. If I am using CURL to call their api how do I cause the script to fail quickly and handle the errors so as not to slow down the application?
2009/06/16
[ "https://Stackoverflow.com/questions/1004191", "https://Stackoverflow.com", "https://Stackoverflow.com/users/105008/" ]
I wrote a [blog post](http://www.joshclarkson.net/blog/file-uploads-in-a-hidden-iframe-using-jquery/) about doing this with jQuery to upload a file using a hidden iframe. Here's the code: Here is the HTML for the form: ``` <div id="uploadform"> <form id="theuploadform"> <input type="hidden" id="max" name="MAX_FILE_SI...
I don't have the code handy but my team accomplished this purely in Javascript. As I recall it went something like this: ``` function postToPage() { var iframe = document.getElementById('myIFrame'); if (iframe) { var newForm = '<html><head></head><body><form...> <input type="hidden" name="..." value="..." /> ...
215,849
I am trying to export regions of interest in google map as geotiff. I know google earth has option to save image as jpeg. Are there any tools to obtain a part of image from google maps with its world file or as geotiff? Is there any way to do that with python?
2016/10/28
[ "https://gis.stackexchange.com/questions/215849", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/48497/" ]
[Google don't like copying or saving](https://developers.google.com/maps/terms) of their map/earth products. So I doubt it is possible within their API. However it is possible to get a georeferenced gtiff of google maps imagery for a limited area through Qgis: 1. Use google street within the Openlayers plugin 2. Zoom...
[Downloading images from Google Maps is against the Terms of Service.](https://gis.stackexchange.com/questions/69962/download-google-map-tiles-images) You can, however, embed maps using Google Maps APIs. See: [Google Static Maps Developer Guide](https://developers.google.com/maps/documentation/static-maps/intro)
638,225
I have formatted a flash drive and thus needed to unmount the device. Is there a way to trigger automount via command line after formatting was finished ? (I know I can just reinsert a USB flash drive, but that seems like a cheap shot ;) And manually mounting seems a bit cumbersome as one needs to mkdir the mount dire...
2013/08/29
[ "https://superuser.com/questions/638225", "https://superuser.com", "https://superuser.com/users/247896/" ]
``` /usr/bin/udisks --mount /dev/sdc1 ``` worked for me. This seems to be what is invoked by gnome according to <https://help.ubuntu.com/community/AutomaticallyMountPartitions>.
I think you need to run ``` sudo partprobe ``` to re-scan all devices for partitions and filesystems. On my Xubuntu 12.04 (debian-based), this also triggers automount.
638,225
I have formatted a flash drive and thus needed to unmount the device. Is there a way to trigger automount via command line after formatting was finished ? (I know I can just reinsert a USB flash drive, but that seems like a cheap shot ;) And manually mounting seems a bit cumbersome as one needs to mkdir the mount dire...
2013/08/29
[ "https://superuser.com/questions/638225", "https://superuser.com", "https://superuser.com/users/247896/" ]
``` /usr/bin/udisks --mount /dev/sdc1 ``` worked for me. This seems to be what is invoked by gnome according to <https://help.ubuntu.com/community/AutomaticallyMountPartitions>.
Here my solution on Ubuntu 18.04: ``` udisksctl mount -b {device} ```
27,416,200
I am posting because I have encountered a problem with one script that I am trying to develop . What I am trying to create is a gallery that receives it's images from Instagram. In order to accomplish this two tasks I've found two plugins that fits my needs , but I am unable to fusion them both. I'm relatively new t...
2014/12/11
[ "https://Stackoverflow.com/questions/27416200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4072618/" ]
There are many different [CoNLL](http://ifarm.nl/signll/conll/) formats since CoNLL is a different shared task each year. The format for CoNLL 2009 is described [here](http://ufal.mff.cuni.cz/conll2009-st/task-description.html). Each line represents a single word with a series of tab-separated fields. `_`s indicate emp...
As update to @dmcc's answer: * CoNLL is the conventional name for TSV formats in NLP (TSV - tab-separated values, i.e., CSV with `<TAB>` as separator) * It originates from a series of shared tasks organized at the Conferences of Natural Language Learning (hence the name) * Not all of these tasks use "CoNLL" formats, s...
1,294,568
I have a data set that looks like the table shown on the left. The data has 3 columns, ranked by values in column 3; column 1 is the index of the row in the ranking; column 2 is the 'category' assigned to that row. I am not sure if this is a 'single series' or 'two data series' problem... but I would like to draw a c...
2018/02/13
[ "https://superuser.com/questions/1294568", "https://superuser.com", "https://superuser.com/users/872269/" ]
You *could* edit and change the marker style for just those two points. But that causes some difficulties with the labels in the legend. A better solution is to arrange your data table as shown below. That causes Excel to plot the data as two separate series, and then you can format the two series separately as you wi...
I was able to do this as a single series scatter plot, 1st column vs. 3rd column, where I set the markers of the series to 'None'. To get the correct markers I used data labels where the label contained the value from the second column. I placed the labels on the 'Center' position. For the second column I replaced the...
1,294,568
I have a data set that looks like the table shown on the left. The data has 3 columns, ranked by values in column 3; column 1 is the index of the row in the ranking; column 2 is the 'category' assigned to that row. I am not sure if this is a 'single series' or 'two data series' problem... but I would like to draw a c...
2018/02/13
[ "https://superuser.com/questions/1294568", "https://superuser.com", "https://superuser.com/users/872269/" ]
A better solution would be to: 1. Create an Excel Data Table from your existing data. 2. Create a Pivot Table from your Data Table (which will update as you add rows to your Data Table). 3. Create your chart from the Pivot Table (which will also update as you add rows to your Data Table).
I was able to do this as a single series scatter plot, 1st column vs. 3rd column, where I set the markers of the series to 'None'. To get the correct markers I used data labels where the label contained the value from the second column. I placed the labels on the 'Center' position. For the second column I replaced the...
1,294,568
I have a data set that looks like the table shown on the left. The data has 3 columns, ranked by values in column 3; column 1 is the index of the row in the ranking; column 2 is the 'category' assigned to that row. I am not sure if this is a 'single series' or 'two data series' problem... but I would like to draw a c...
2018/02/13
[ "https://superuser.com/questions/1294568", "https://superuser.com", "https://superuser.com/users/872269/" ]
You *could* edit and change the marker style for just those two points. But that causes some difficulties with the labels in the legend. A better solution is to arrange your data table as shown below. That causes Excel to plot the data as two separate series, and then you can format the two series separately as you wi...
A better solution would be to: 1. Create an Excel Data Table from your existing data. 2. Create a Pivot Table from your Data Table (which will update as you add rows to your Data Table). 3. Create your chart from the Pivot Table (which will also update as you add rows to your Data Table).
58,244,999
I have been trying to specific access a nested property of req.body the output however is always undefined the code is as follows ``` let dataRecieved = JSON.stringify(req.body); console.log(dataRecieved); let refCode = dataRecieved["refferal"]; ``` and the output in the terminal is ``` {"name":...
2019/10/05
[ "https://Stackoverflow.com/questions/58244999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12167200/" ]
***When you push the value to same array during loop***, you end up in ***infinite loop***, create a temp array push value to it, in the end add it to `this` ```js const a = [1, 2, 3, 4, 5]; //this is the what I tried Array.prototype.multiply = function() { let newArr = [] for (const m of this) { newArr....
Pushing a new value into an array in the middle of a `for ... of` loop creates an infinite loop as the loop includes the new values. You can use `forEach` instead as that ignores the new values added: ```js const a = [1, 2, 3, 4, 5]; Array.prototype.multiply = function() { this.forEach(v => this.push(v*v)); } ...
8,831,824
This is the query generated by Mongomapper: ``` MONGODB mydatabase['users'].find({:name=>"bob"}).limit(-1) ``` But this is not valid in the mongo console since the correct syntax is ``` db.users.find({:name=>"bob"}).limit(-1) ``` If I just use the generated one, I got this error in the console ``` Thu Jan 12 03:...
2012/01/12
[ "https://Stackoverflow.com/questions/8831824", "https://Stackoverflow.com", "https://Stackoverflow.com/users/304319/" ]
You can't use symbols in the MongoDB console as they are ruby and not javascript :-) Try this: ``` db.users.find({name: "bob"}).limit(-1) ```
It is not mongodb's issue. 406 is pretty much relating to the controller call. I need to use: ``` render :json => @user ``` rather than ``` respond_to ```
14,112,340
I am using the Opus iMacros add-on with Internet Explorer. The following Macro takes a variable from the first line of my excel CSV File and performs a search on a website. The search results from the website may be anywhere from 10 to 200 records, which are grouped 20 per page (1-10 pages). The macro then extracts eac...
2013/01/01
[ "https://Stackoverflow.com/questions/14112340", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1093827/" ]
Use [`request.get_json()`](http://flask.pocoo.org/docs/latest/api/#flask.Request.get_json) and set `force` to `True`: ``` @menus.route('/', methods=["PUT", "POST"]) def new(): return jsonify(request.get_json(force=True)) ``` From the documentation: > > By default this function will only load the json data if t...
the `request` object already has a method `get_json` which can give you the json regardless of the content-type if you execute it with `force=True` so your code would be something like the following: ``` @menus.route('/', methods=["PUT", "POST"]) def new(): return jsonify(request.get_json(force=True)) ``` in fac...
74,657,605
In Python I can do something like: ```py def add_postfix(name: str, postfix: str = None): if base is None: postfix = some_computation_based_on_name(name) return name + postfix ``` So I have an optional parameter which, if not provided, gets assigned a value. Notice that I don't have a constant default for `p...
2022/12/02
[ "https://Stackoverflow.com/questions/74657605", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4391249/" ]
You do this with two functions: ``` std::string add_postfix(const std::string& name, const std::string& postfix) { // whatever } std::string add_default_postfix(const std::string& name) { return add_postfix(name, "2"); } ``` Or, if you're into overloading, you can write the second one as an overload by naming it `a...
You simply can write: ``` std::string add_postfix(const std::string& name, const std::string& postfix = "default value") { return name + postfix; } ```
74,657,605
In Python I can do something like: ```py def add_postfix(name: str, postfix: str = None): if base is None: postfix = some_computation_based_on_name(name) return name + postfix ``` So I have an optional parameter which, if not provided, gets assigned a value. Notice that I don't have a constant default for `p...
2022/12/02
[ "https://Stackoverflow.com/questions/74657605", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4391249/" ]
One possibility is to use a `std::string const*` (a non-constant pointer to a `const std::string`) as a function argument. ```cpp std::string add_postfix(const std::string& name, std::string const* postfix = nullptr) { std::string derivedSuffix; if(!postfix) { derivedSuffix = some_computation(name); ...
You simply can write: ``` std::string add_postfix(const std::string& name, const std::string& postfix = "default value") { return name + postfix; } ```
74,657,605
In Python I can do something like: ```py def add_postfix(name: str, postfix: str = None): if base is None: postfix = some_computation_based_on_name(name) return name + postfix ``` So I have an optional parameter which, if not provided, gets assigned a value. Notice that I don't have a constant default for `p...
2022/12/02
[ "https://Stackoverflow.com/questions/74657605", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4391249/" ]
You do this with two functions: ``` std::string add_postfix(const std::string& name, const std::string& postfix) { // whatever } std::string add_default_postfix(const std::string& name) { return add_postfix(name, "2"); } ``` Or, if you're into overloading, you can write the second one as an overload by naming it `a...
With your usage, [`value_or`](https://en.cppreference.com/w/cpp/utility/optional/value_or) seems to do the job: ``` std::string add_postfix(const std::string& name, const std::optional<std::string>& postfix) { return name + postfix.value_or("2"); } ``` If you really want `optional<T&>`, `...
74,657,605
In Python I can do something like: ```py def add_postfix(name: str, postfix: str = None): if base is None: postfix = some_computation_based_on_name(name) return name + postfix ``` So I have an optional parameter which, if not provided, gets assigned a value. Notice that I don't have a constant default for `p...
2022/12/02
[ "https://Stackoverflow.com/questions/74657605", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4391249/" ]
One possibility is to use a `std::string const*` (a non-constant pointer to a `const std::string`) as a function argument. ```cpp std::string add_postfix(const std::string& name, std::string const* postfix = nullptr) { std::string derivedSuffix; if(!postfix) { derivedSuffix = some_computation(name); ...
You do this with two functions: ``` std::string add_postfix(const std::string& name, const std::string& postfix) { // whatever } std::string add_default_postfix(const std::string& name) { return add_postfix(name, "2"); } ``` Or, if you're into overloading, you can write the second one as an overload by naming it `a...
74,657,605
In Python I can do something like: ```py def add_postfix(name: str, postfix: str = None): if base is None: postfix = some_computation_based_on_name(name) return name + postfix ``` So I have an optional parameter which, if not provided, gets assigned a value. Notice that I don't have a constant default for `p...
2022/12/02
[ "https://Stackoverflow.com/questions/74657605", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4391249/" ]
One possibility is to use a `std::string const*` (a non-constant pointer to a `const std::string`) as a function argument. ```cpp std::string add_postfix(const std::string& name, std::string const* postfix = nullptr) { std::string derivedSuffix; if(!postfix) { derivedSuffix = some_computation(name); ...
With your usage, [`value_or`](https://en.cppreference.com/w/cpp/utility/optional/value_or) seems to do the job: ``` std::string add_postfix(const std::string& name, const std::optional<std::string>& postfix) { return name + postfix.value_or("2"); } ``` If you really want `optional<T&>`, `...
7,023,981
How does one change file access permissions? ``` f = open('test','w') f.close() ``` Defaults access permissions: 10600
2011/08/11
[ "https://Stackoverflow.com/questions/7023981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/853863/" ]
You can use [os.chmod](http://docs.python.org/library/os.html#os.chmod) ``` os.chmod(path, mode) ``` You probably want to use an octal integer literal, like 0777 for the mode.
Use [os.chmod(path, mode)](http://docs.python.org/library/os.html#os.chmod)
7,613,027
I'm doing a code review for a change in a Java product I don't own. I'm not a Java expert, but I strongly suspect that this is pointless and indicates a fundamental misunderstanding of how synchronization works. ``` synchronized (this) { this.notify(); } ``` But I could be wrong, since Java is not my primary pl...
2011/09/30
[ "https://Stackoverflow.com/questions/7613027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74815/" ]
It certainly is not pointless, you can have another thread that has a reference to the object containing the above code doing ``` synchronized(foo) { foo.wait(); } ``` in order to be woken up when something happens. Though, in many cases it's considered good practice to synchronize on an internal/private lock o...
This is generally not a anti-pattern, if you still want to use intrinsic locks. Some may regard this as an anti pattern, as the new explicit locks from `java.util.concurrent` are more fine grained. But your code is still valid. For instance, such code can be found in a blocking queue, when an blocking operation has su...
7,613,027
I'm doing a code review for a change in a Java product I don't own. I'm not a Java expert, but I strongly suspect that this is pointless and indicates a fundamental misunderstanding of how synchronization works. ``` synchronized (this) { this.notify(); } ``` But I could be wrong, since Java is not my primary pl...
2011/09/30
[ "https://Stackoverflow.com/questions/7613027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74815/" ]
This is perfectly fine. According to the [Java 6 `Object#notify()` api documentation](http://download.oracle.com/javase/6/docs/api/java/lang/Object.html#notify%28%29): > > This method should only be called by a thread that is the owner of this object's monitor. > > >
This is generally not a anti-pattern, if you still want to use intrinsic locks. Some may regard this as an anti pattern, as the new explicit locks from `java.util.concurrent` are more fine grained. But your code is still valid. For instance, such code can be found in a blocking queue, when an blocking operation has su...
7,613,027
I'm doing a code review for a change in a Java product I don't own. I'm not a Java expert, but I strongly suspect that this is pointless and indicates a fundamental misunderstanding of how synchronization works. ``` synchronized (this) { this.notify(); } ``` But I could be wrong, since Java is not my primary pl...
2011/09/30
[ "https://Stackoverflow.com/questions/7613027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74815/" ]
If that is all that is in the synchonized block then it *is* an antipattern, the point of synchronizing is to do something within the block, setting some condition, then call `notify` or `notifyAll` to wake up one or more waiting threads. When you use wait and notify you have to use a condition variable, see [this Ora...
This is generally not a anti-pattern, if you still want to use intrinsic locks. Some may regard this as an anti pattern, as the new explicit locks from `java.util.concurrent` are more fine grained. But your code is still valid. For instance, such code can be found in a blocking queue, when an blocking operation has su...
7,613,027
I'm doing a code review for a change in a Java product I don't own. I'm not a Java expert, but I strongly suspect that this is pointless and indicates a fundamental misunderstanding of how synchronization works. ``` synchronized (this) { this.notify(); } ``` But I could be wrong, since Java is not my primary pl...
2011/09/30
[ "https://Stackoverflow.com/questions/7613027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74815/" ]
It certainly is not pointless, you can have another thread that has a reference to the object containing the above code doing ``` synchronized(foo) { foo.wait(); } ``` in order to be woken up when something happens. Though, in many cases it's considered good practice to synchronize on an internal/private lock o...
The Java API documentation for [Object.notify()](http://download.oracle.com/javase/6/docs/api/java/lang/Object.html#notify%28%29) states that the method "should only be called by a thread that is the owner of this object's monitor". So the use could be legitimate depending upon the surrounding context.
7,613,027
I'm doing a code review for a change in a Java product I don't own. I'm not a Java expert, but I strongly suspect that this is pointless and indicates a fundamental misunderstanding of how synchronization works. ``` synchronized (this) { this.notify(); } ``` But I could be wrong, since Java is not my primary pl...
2011/09/30
[ "https://Stackoverflow.com/questions/7613027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74815/" ]
It certainly is not pointless, you can have another thread that has a reference to the object containing the above code doing ``` synchronized(foo) { foo.wait(); } ``` in order to be woken up when something happens. Though, in many cases it's considered good practice to synchronize on an internal/private lock o...
This is perfectly fine. According to the [Java 6 `Object#notify()` api documentation](http://download.oracle.com/javase/6/docs/api/java/lang/Object.html#notify%28%29): > > This method should only be called by a thread that is the owner of this object's monitor. > > >
7,613,027
I'm doing a code review for a change in a Java product I don't own. I'm not a Java expert, but I strongly suspect that this is pointless and indicates a fundamental misunderstanding of how synchronization works. ``` synchronized (this) { this.notify(); } ``` But I could be wrong, since Java is not my primary pl...
2011/09/30
[ "https://Stackoverflow.com/questions/7613027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74815/" ]
It certainly is not pointless, you can have another thread that has a reference to the object containing the above code doing ``` synchronized(foo) { foo.wait(); } ``` in order to be woken up when something happens. Though, in many cases it's considered good practice to synchronize on an internal/private lock o...
If that is all that is in the synchonized block then it *is* an antipattern, the point of synchronizing is to do something within the block, setting some condition, then call `notify` or `notifyAll` to wake up one or more waiting threads. When you use wait and notify you have to use a condition variable, see [this Ora...
7,613,027
I'm doing a code review for a change in a Java product I don't own. I'm not a Java expert, but I strongly suspect that this is pointless and indicates a fundamental misunderstanding of how synchronization works. ``` synchronized (this) { this.notify(); } ``` But I could be wrong, since Java is not my primary pl...
2011/09/30
[ "https://Stackoverflow.com/questions/7613027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74815/" ]
This is perfectly fine. According to the [Java 6 `Object#notify()` api documentation](http://download.oracle.com/javase/6/docs/api/java/lang/Object.html#notify%28%29): > > This method should only be called by a thread that is the owner of this object's monitor. > > >
The Java API documentation for [Object.notify()](http://download.oracle.com/javase/6/docs/api/java/lang/Object.html#notify%28%29) states that the method "should only be called by a thread that is the owner of this object's monitor". So the use could be legitimate depending upon the surrounding context.
7,613,027
I'm doing a code review for a change in a Java product I don't own. I'm not a Java expert, but I strongly suspect that this is pointless and indicates a fundamental misunderstanding of how synchronization works. ``` synchronized (this) { this.notify(); } ``` But I could be wrong, since Java is not my primary pl...
2011/09/30
[ "https://Stackoverflow.com/questions/7613027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74815/" ]
If that is all that is in the synchonized block then it *is* an antipattern, the point of synchronizing is to do something within the block, setting some condition, then call `notify` or `notifyAll` to wake up one or more waiting threads. When you use wait and notify you have to use a condition variable, see [this Ora...
The Java API documentation for [Object.notify()](http://download.oracle.com/javase/6/docs/api/java/lang/Object.html#notify%28%29) states that the method "should only be called by a thread that is the owner of this object's monitor". So the use could be legitimate depending upon the surrounding context.
73,312
A possible solution to [my other question](https://android.stackexchange.com/questions/73244/secure-boot-while-still-being-able-to-keep-up-with-nightlies) related to this. Having root access, what's there to prevent me from manually flashing a custom recovery from my running operating system? If my bootloader is locke...
2014/06/17
[ "https://android.stackexchange.com/questions/73312", "https://android.stackexchange.com", "https://android.stackexchange.com/users/2829/" ]
In response to my own question: yes, you can flash a custom recovery from a running OS. The recovery, since it isn't mounted, should be fine to write: ``` dd if=openrecovery-twrp-2.7.0-deb.img of=/dev/block/platform/msm_sdcc.1/by-name/recovery ``` You run the above at your own risk and I accept no responsibility for...
A 'newer' and free (and in my opinion the best so far) root app is Flashify. It can flash kernels and recoveries from your phone. Additionally it can download the images for you, too. <https://play.google.com/store/apps/details?id=com.cgollner.flashify>
73,312
A possible solution to [my other question](https://android.stackexchange.com/questions/73244/secure-boot-while-still-being-able-to-keep-up-with-nightlies) related to this. Having root access, what's there to prevent me from manually flashing a custom recovery from my running operating system? If my bootloader is locke...
2014/06/17
[ "https://android.stackexchange.com/questions/73312", "https://android.stackexchange.com", "https://android.stackexchange.com/users/2829/" ]
A 'newer' and free (and in my opinion the best so far) root app is Flashify. It can flash kernels and recoveries from your phone. Additionally it can download the images for you, too. <https://play.google.com/store/apps/details?id=com.cgollner.flashify>
Actually I have tried this on around 3-5 occassions(and it has always worked, for some reason). What I did was I download recovery in img format (or if it was zip I manually extracted it to get the img file). Then renamed file from whatever name to `recovery.img` Then I went to `system/etc` and deleted existing recov...
73,312
A possible solution to [my other question](https://android.stackexchange.com/questions/73244/secure-boot-while-still-being-able-to-keep-up-with-nightlies) related to this. Having root access, what's there to prevent me from manually flashing a custom recovery from my running operating system? If my bootloader is locke...
2014/06/17
[ "https://android.stackexchange.com/questions/73312", "https://android.stackexchange.com", "https://android.stackexchange.com/users/2829/" ]
In response to my own question: yes, you can flash a custom recovery from a running OS. The recovery, since it isn't mounted, should be fine to write: ``` dd if=openrecovery-twrp-2.7.0-deb.img of=/dev/block/platform/msm_sdcc.1/by-name/recovery ``` You run the above at your own risk and I accept no responsibility for...
Actually I have tried this on around 3-5 occassions(and it has always worked, for some reason). What I did was I download recovery in img format (or if it was zip I manually extracted it to get the img file). Then renamed file from whatever name to `recovery.img` Then I went to `system/etc` and deleted existing recov...
2,036,024
$\sum\_{n=0}^{\infty} \frac{1}{\sqrt{n^2 + n}}$ Is there an elementary way to show that this *diverges*?
2016/11/29
[ "https://math.stackexchange.com/questions/2036024", "https://math.stackexchange.com", "https://math.stackexchange.com/users/384153/" ]
Hint: $$\frac1{\sqrt{n^2+n}}>\frac1{n+1}$$
You have $$\frac{1}{\sqrt{n^2+n}}\sim \frac 1n.$$ So by comparaison to Riemann example, this series diverges.
50,879,151
How to get previous friday in SQL Server? Here is the code I have so far: ``` select (7 -datePart(dw, getdate()+3)) +1 ```
2018/06/15
[ "https://Stackoverflow.com/questions/50879151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5635467/" ]
Use mod like this: ``` declare @date datetime = getdate() declare @dow int = datepart(dw,@date) declare @mod int = @dow % 7 +1 select cast(dateadd(d,-@mod ,@date) as date) ```
If your week starts on Sunday, then here's a one-liner: ``` SELECT DATEADD(WEEK ,DATEDIFF(WEEK, '1900-01-05', DATEADD(DAY, 6 - DATEPART(DAY, GETDATE()) - 1, GETDATE())) ,'1900-01-05') AS [Last Friday] ``` The query counts the number of weeks since 1900-01-05 (which is a Friday) to today's...
50,879,151
How to get previous friday in SQL Server? Here is the code I have so far: ``` select (7 -datePart(dw, getdate()+3)) +1 ```
2018/06/15
[ "https://Stackoverflow.com/questions/50879151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5635467/" ]
Use mod like this: ``` declare @date datetime = getdate() declare @dow int = datepart(dw,@date) declare @mod int = @dow % 7 +1 select cast(dateadd(d,-@mod ,@date) as date) ```
Try this select convert(varchar(10), DATEADD(DD, -1 - DATEPART(DW, CONVERT(DATETIME, FLOOR(CONVERT(FLOAT, GETDATE()))) ),CONVERT(DATETIME, FLOOR(CONVERT(FLOAT, GETDATE())))),101) It will give you previous friday of every week
40,995,032
I have an idea for a code style for writing specific kinds of numerical algorithms where you write your algorithm purely in data-layout agnostic fashion. i.e. All of your functions take (one or more) scalar arguments, and return (through a pointer) one or more scalar return values. So, for example, if you have a funct...
2016/12/06
[ "https://Stackoverflow.com/questions/40995032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/139802/" ]
I wrote some code to do a trivial test of my idea: ``` // Compile using gcc -O4 main.c && objdump -d a.out void add4(float x0, float x1, float x2, float x3, float y0, float y1, float y2, float y3, float* out0, float* out1, float* out2, float* out3) { // Non-inlined version of this uses xmm reg...
Your concern is correct. No compiler is going to autovectorize those 4 adds. It's simply not worth it, considering the inputs aren't contiguous and aligned. The cost of gathering arguments into a SIMD register are much higher than the saving of a vector addition. Of course, the reason the compiler can't use an aligned...
29,166,701
Till now I solved most of my problems/questions by myself, simply searching for already existing threads...unfortunately this did not work for my current problem, so I thought I give it a try: I am new to VBA and just recently started programming some useful marcos to automate/simplify slide development on PowerPoint ...
2015/03/20
[ "https://Stackoverflow.com/questions/29166701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4693949/" ]
I know I am a bit late but I just had a similar problem and it was driving me crazy. To answer your question " ...I am trying to figure it out, where I am creating an issue"... The error is being created at ``` $ffs = imagecreatefromjpeg($image); ``` This error came from executing this line of code, when uploading...
the solution I found is the following: ``` $file_dimensions = getimagesize($_SERVER['DOCUMENT_ROOT'] . $fileUrl); $ImageType = strtolower($file_dimensions['mime']); switch(strtolower($ImageType)) { case 'image/png': $img_r = imagecreatefrompng($_SERVER['DOCUMENT_ROOT'] . $fileUrl); break; case 'image/jpeg': $i...
7,463,377
I recently had a stack overflow exception in my .NET app (asp.net website), which I know because it showed up in my EventLog. I understand that a StackOverflow exception cannot be caught or handled, but is there a way to log it before it kills your application? I have 100k lines of code. If I knew the stack trace, or j...
2011/09/18
[ "https://Stackoverflow.com/questions/7463377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/197605/" ]
Your best bet is to use [ADPlus](http://msdn.microsoft.com/en-us/library/ff537953.aspx). The Windows NT Kernel Debugging Team has a nice [blog post](http://blogs.msdn.com/b/ntdebugging/archive/2009/05/18/capturing-adplus-clr-crashes.aspx) on how to catch CLR exceptions with it. There are a lot of details on that there...
You could try logging messages at key points in your application and take out the part where the flow of log messages break. Then, try and replicate it with that section of code using unit tests. The only way to get a trace for a stack overflow error that I know of is to have an intermediary layer taking snapshots of...
7,463,377
I recently had a stack overflow exception in my .NET app (asp.net website), which I know because it showed up in my EventLog. I understand that a StackOverflow exception cannot be caught or handled, but is there a way to log it before it kills your application? I have 100k lines of code. If I knew the stack trace, or j...
2011/09/18
[ "https://Stackoverflow.com/questions/7463377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/197605/" ]
Your best bet is to use [ADPlus](http://msdn.microsoft.com/en-us/library/ff537953.aspx). The Windows NT Kernel Debugging Team has a nice [blog post](http://blogs.msdn.com/b/ntdebugging/archive/2009/05/18/capturing-adplus-clr-crashes.aspx) on how to catch CLR exceptions with it. There are a lot of details on that there...
Very wise to ask about StackOverFlowException on StackOverflow :) AFAIK, about the only thing you can do is get a dump on a crash. The CLR is going to take you down unless you host your own CLR. A related question on getting a dump of IIS worker process on crash: * [Getting IIS Worker Process Crash dumps](https://st...
12,234,193
I am calling a function named edit from an onclick event as follows. ``` <script type="text/javascript"> $(document).ready(function () { ... $.each(data, function (key, val) { ... var td11 = $('<input type="button" value="Edit" onclick="edit();" />') .attr("name",val.Id); $(tr2)....
2012/09/02
[ "https://Stackoverflow.com/questions/12234193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1385490/" ]
Running svnserve with -d -r can be a solution: <http://blog.dbtracer.org/2010/01/20/porting-subversion-git-with-error/>
From [here](https://github.com/nirvdrum/svn2git/issues/69): > > I had the same problem, happens when an error occurs (i missed some authors in the authors file) in the middle of the process. I solved it by removing the directory in where you executed svn2git, recreate it and execute it again. Still this isn't a solut...
12,234,193
I am calling a function named edit from an onclick event as follows. ``` <script type="text/javascript"> $(document).ready(function () { ... $.each(data, function (key, val) { ... var td11 = $('<input type="button" value="Edit" onclick="edit();" />') .attr("name",val.Id); $(tr2)....
2012/09/02
[ "https://Stackoverflow.com/questions/12234193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1385490/" ]
The problem is that you are accessing this file locally and using different formats for your original svn repo and the git instance that is migrating from svn to git (most likely your git is behind your svn repo version) - instead try running the migration through an svn server - try starting up an svn server with `s...
From [here](https://github.com/nirvdrum/svn2git/issues/69): > > I had the same problem, happens when an error occurs (i missed some authors in the authors file) in the middle of the process. I solved it by removing the directory in where you executed svn2git, recreate it and execute it again. Still this isn't a solut...
12,234,193
I am calling a function named edit from an onclick event as follows. ``` <script type="text/javascript"> $(document).ready(function () { ... $.each(data, function (key, val) { ... var td11 = $('<input type="button" value="Edit" onclick="edit();" />') .attr("name",val.Id); $(tr2)....
2012/09/02
[ "https://Stackoverflow.com/questions/12234193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1385490/" ]
Running svnserve with -d -r can be a solution: <http://blog.dbtracer.org/2010/01/20/porting-subversion-git-with-error/>
The problem is that you are accessing this file locally and using different formats for your original svn repo and the git instance that is migrating from svn to git (most likely your git is behind your svn repo version) - instead try running the migration through an svn server - try starting up an svn server with `s...
26,814,081
``` string = c("Hello-", "HelloA", "Helloa") grep("Hello$[A-z]", string) ``` I wish to find the indices of the strings in which the next character after the word "Hello" is a letter (case insensitive). The code above doesn't work, but I would like grep() to return indices 2 and 3 since those words have a lett...
2014/11/08
[ "https://Stackoverflow.com/questions/26814081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3391549/" ]
Use Positive lookahead ``` > string = c("Hello-", "HelloA", "Helloa") > grep('Hello(?=[A-Za-z])', string, perl=T) [1] 2 3 ``` `(?=[A-Za-z])` this positive lookahead asserts that the character following the string `Hello` must be a letter. **OR** ``` > grep('Hello[A-Za-z]', string) [1] 2 3 ``` Add a `$` in the re...
The "$" is the symbol for the end of the string, so you need to remove. ``` string = c("Hello-", "HelloA", "Helloa") grep("Hello[A-z]", string) #[1] 2 3 ?regex # to my memory of the "alpha" version of the character class grep("Hello[[:alpha:]]", string) #[1] 2 3 ``` The second one is preferable because "A-z" can...
8,835,413
> > **Possible Duplicate:** > > [Difference between DOMContentLoaded and Load events](https://stackoverflow.com/questions/2414750/difference-between-domcontentloaded-and-load-events) > > > Whats the difference between ``` window.addEventListener("load", load, false); ``` and ``` document.addEventListener("...
2012/01/12
[ "https://Stackoverflow.com/questions/8835413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/579421/" ]
* `DOMContentLoaded` - the whole document (HTML) has been loaded. * `load` - the whole document and its resources (e.g. images, iframes, scripts) have been loaded.
DOMContentLoaded awaits only for HTML and scripts to be loaded. window.onload and iframe.onload triggers when the page is fully loaded with all dependent resources including images and styles. Here is more details you can find <http://javascript.info/tutorial/onload-ondomcontentloaded>
13,293,607
If I use this: ``` mCamera.rotateY(45); mCamera.getMatrix(mMatrix); mMatrix.preTranslate(-pivotX, -pivotY); mMatrix.postTranslate(pivotX + centerX, pivotY + centerY); ``` And do: ``` canvas.drawBitmap(bitmap, mMatrix, null); ``` Then the drawn picture will be taller and slimmer and the matrix will be nicely appli...
2012/11/08
[ "https://Stackoverflow.com/questions/13293607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1663253/" ]
Well, you could easily let the matrix map the corners of your bitmap and then calculate the bounds, as the mapped corners will be the max / min for x and y coordinate. Maybe you can do it without too many `if` clauses :) **Edit:** Check out ``` RectF r = new RectF(/*your bitmap's corners*/); matrix.mapRect(r); ``` ...
If you stick to 45° then Pythagoras is the key
44,243,853
I have couple of file with same name, and I wanted to get the latest file [root@xxx tmp]# ls -t1 abclog\* abclog.1957 abclog.1830 abclog.1799 abclog.1742 I can accomplish that by executing below command. [root@xxx tmp]# ls -t1 abclog\*| head -n 1 abclog.1957 But when I am trying to execute the same in python , g...
2017/05/29
[ "https://Stackoverflow.com/questions/44243853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4377271/" ]
I think you are asking for open resource(`Ctrl`+`Shift`+`R`) not open type(`Ctrl`+`Shift`+`T`). IMHO there is no way to filter out **types** by their paths, as because same type(ex Enum/Inner class) may exist in different Java classes. Yes. You can filter out resources by project/folder path. Refer this answer <https...
Open Resource and Open Type both let You use *Working Sets*. So You can define a WS per project or whatever makes sense for You and use the one You need at the given moment. You can choose the WS directly in the modal dialog.
211,303
I want to count the number of rows with duplicate ids My current code is ``` SET @x=1; SELECT c.id, so.trans_id, IF(c.id = c.id, @x + 1, @x) as count_t FROM customer c LEFT JOIN sales_order so ``` Current Result ``` +-----+----------+----------+ | id | trans_id | count_t | +-----+----------+----------+ | 101 ...
2018/07/04
[ "https://dba.stackexchange.com/questions/211303", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/154178/" ]
That's not a bug. That's 'move to standard'. Do not fix this problem by change server's SQL Mode. Fix it by altering the queries which uses partial `GROUP BY` expressions. Details can be read in [MySQL Handling of GROUP BY](https://dev.mysql.com/doc/refman/5.7/en/group-by-handling.html).
You should add it to your config file, for example: /etc/my.cnf: ``` sql_mode='...' ``` Do note that this is not a bug, this is the way it is supposed to work. By disabling this check you risk getting indeterministic answers from your queries. A small example: ``` create table t (x int not null, y int not null, z i...
60,362
My requirement is to add two binary numbers, say "1001" and "0101" as `binary1` and `binary2`. ``` Partial Class Default2 Inherits System.Web.UI.Page Dim carry As Boolean = False ' Boolean variable to hold the carry if occured Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles But...
2014/08/18
[ "https://codereview.stackexchange.com/questions/60362", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/51382/" ]
For now, let's ignore the fact that there are easier ways to add binary numbers. There are other issues with this code. --- > > > ``` > Inherits System.Web.UI.Page > > ``` > > Why is code that adds binary numbers inheriting from a UI class? There's no need for this. Separate the concerns and create a module fo...
Once the user input is validated to be ones or zeros in the textboxes the conversion / addition is simple. Using the OP's input parameters: ``` 'verify user input as a binary digit For Each c As Char In TextBox1.Text If Not (c = "0"c OrElse c = "1"c) Then Stop 'not a binary digit - error h...
40,592,103
I am new in OpenGL. I created an OpenGL object and display it on the screen. I wan to ask how to get the position of the OpenGL object ? Because I want to detect whether the OpenGL object is being collided with others objects or not. So, how do I get the position (point x, point y) of the OpenGL object in Android.
2016/11/14
[ "https://Stackoverflow.com/questions/40592103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6600150/" ]
First, you are violating the [DRY principle](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself). Instead of having separate variables for each set of products, store each of them in a sort of dictionary structure such as an object. This would be my **first revision**. ``` var dict = { a: ["V1-1: 1/4-4 900-450...
You can pass these selected values to a product page using the markup you already have, just add an action to the form ``` <form action="yourpageurl" method="get"> ``` You need to write your product page to dynamically show whatever information is necessary or redirect based on the parameters passed through. As we h...
40,592,103
I am new in OpenGL. I created an OpenGL object and display it on the screen. I wan to ask how to get the position of the OpenGL object ? Because I want to detect whether the OpenGL object is being collided with others objects or not. So, how do I get the position (point x, point y) of the OpenGL object in Android.
2016/11/14
[ "https://Stackoverflow.com/questions/40592103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6600150/" ]
First, you are violating the [DRY principle](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself). Instead of having separate variables for each set of products, store each of them in a sort of dictionary structure such as an object. This would be my **first revision**. ``` var dict = { a: ["V1-1: 1/4-4 900-450...
I think that I would take this approach. Store an array of objects, each of which contain the product name and the appropriate url for that product. Then (assuming you are using a form) you can change the action of form to the value of the selected option. Side notes: It's recommended to use the bracket notation (`[]`...
25,657
Found a sentence, > > 人間の身体能力は吸血鬼の**7分の1**しかありません > > > Is this how you write ratios in Japanese?
2015/07/13
[ "https://japanese.stackexchange.com/questions/25657", "https://japanese.stackexchange.com", "https://japanese.stackexchange.com/users/10345/" ]
Not exactly (as several have commented). This is how you talk about *fractions* in Japanese: > > 7分の1 → 1/7 > > > Literally, you can think about it as 'one part of seven'. It is not a ratio, i.e. 'one part to seven parts', as that equates to 1/8.
Yes. > > n / m = n : m > > > is written > > m分のn, > > > where "m" and "n" are positive integers. BTW, is > > 人間の身体能力は、吸血鬼の身体能力の7分の1しかありません > > > more acceptable for you? **\* added \*** I just learned that the notation n : m confuses some people. Here is what Hans Lundmark pointed out to me in re...
25,657
Found a sentence, > > 人間の身体能力は吸血鬼の**7分の1**しかありません > > > Is this how you write ratios in Japanese?
2015/07/13
[ "https://japanese.stackexchange.com/questions/25657", "https://japanese.stackexchange.com", "https://japanese.stackexchange.com/users/10345/" ]
Not exactly (as several have commented). This is how you talk about *fractions* in Japanese: > > 7分の1 → 1/7 > > > Literally, you can think about it as 'one part of seven'. It is not a ratio, i.e. 'one part to seven parts', as that equates to 1/8.
Yes, 「7分の1」 means same as 1:7 mathematically. 1:7 = (1/8):(7/8) = (1/8)/(7/8) = (1/8)x(8/7) = 8/56 = 1/7 However, in Japan, kids are taught that 1:7 is 「[比]{ひ}」 and 1/7 is 「[分数]{ぶんすう}」. I guess that 「比」 is translated as "ratios", and 「分数」 is translated as "fractions" generally. So, Japanese people tend to think that ...
62,216,682
Suppose we have the following class: ```py from __future__ import annotations class BaseSwallow: # Can't get the ref to `BaseSwallow` at runtime DerivedSwallow = NewType('DerivedSwallow', BaseSwallow) def carry_with(self, swallow: DerivedSwallow): self.carry() swallow.carry() def ca...
2020/06/05
[ "https://Stackoverflow.com/questions/62216682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5989906/" ]
I don't think there's a way to express "all subclasses of `T` excluding `T`" using type annotations. If you have a fixed set of subclasses you could use a `Union` type to capture them all, but that's probably not what you want. I think [Sam's answer](https://stackoverflow.com/a/62220325/4909228) is your best bet: just ...
can you just mark `carry` as an [`abstractmethod`](https://docs.python.org/3/library/abc.html#abc.abstractmethod)? for example, something like: ``` import abc class BaseSwallow: def carry_with(self, swallow: BaseSwallow) -> None: self.carry() swallow.carry() @abc.abstractmethod def carry(...
2,830,707
i need to get images from a webpage source. i can use cfhttp method get and use htmleditformat() to read the html from that page, now i need to loop through the content to get all image url's(src) can i use rematch() or refind() etc... and if yes how?? please help!!!!! if im not clear i can try to clarify..
2010/05/13
[ "https://Stackoverflow.com/questions/2830707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/270737/" ]
[It can be very difficult to reliably parse html with regex.](https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454)
Use a browser and jQuery to 'query' out all the img tag from the DOM might be easier...
2,830,707
i need to get images from a webpage source. i can use cfhttp method get and use htmleditformat() to read the html from that page, now i need to loop through the content to get all image url's(src) can i use rematch() or refind() etc... and if yes how?? please help!!!!! if im not clear i can try to clarify..
2010/05/13
[ "https://Stackoverflow.com/questions/2830707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/270737/" ]
Here's a function that will probably trip up on a lot of bad cases, but might work if you just need something quick and dirty. ``` <cffunction name="getSrcAttributes" access="public" output="No"> <cfargument name="pageContents" required="Yes" type="string" default="" /> <cfset var continueSearch = true /> ...
Use a browser and jQuery to 'query' out all the img tag from the DOM might be easier...
52,654,797
I am working with django and using angularjs. I made a request which responded with an object containing the name, price and date this input was modified. My html has the following `{{price_level.modified }}` providing me with `2018-01-16T10:15:34.401839Z`. Here is the data that I am getting when I console.log the d...
2018/10/04
[ "https://Stackoverflow.com/questions/52654797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9766402/" ]
Your result appears to be a string in YYYY-mm-dd format with time, so just slice it. ``` {{price_level.modified[:10] }} ```
If you just want `YYYY-MM-DD` you could do a substring from position 0 through 9. Example in Python `dateStr[:10]`
71,500
The majority of primates have really thick nails, though not as broad or flat as humans'. However, marmosets have 18 claws, and only their big toes have nails. What differences in evolutionary pressures caused this? And how does the structural relationship between marmosets' germinal matrices and their distal phalanxes...
2018/03/18
[ "https://biology.stackexchange.com/questions/71500", "https://biology.stackexchange.com", "https://biology.stackexchange.com/users/41155/" ]
Since marmosets and tamarins are considered the most primitive primates, we can't assume that evolutionary pressure led to the development of claws. Rather, it's accepted that claws disappeared as primates adapted to an arboreal lifestyle. So the question is really "Why did marmosets not completely lose their claws?" ...
Ill try and research this later and add references, it's a bit of a draft version while im on laptop in the car, A good place to think but not to write and surf from! It's probably best viewed as a vestigial trait, made redundant by monkey's prehensile grasp, and related to their strong social and hierarchical behavi...
29,414,250
I get this weird error on SQL Server. And I cannot find solution in older posts. I have this procedure: ``` create proc _upJM_SyncAll_test as begin DECLARE @SQLString nvarchar(max) set @SQLString = N' DELETE FROM OPENQUERY([LOCAL_MYSQL],''SELECT acSubject FROM _utjm_setitemprices'') where acSubject not in (sele...
2015/04/02
[ "https://Stackoverflow.com/questions/29414250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3185532/" ]
Triggers are included in the implicit transaction required for insert, update, and delete statements. Because you are connecting to a linked server within a transaction, SQL Server promotes it to a Distributed Transaction. You'll need to configure MSDTC, you can either open MMC and load the MSDTC plugin or use the fol...
My issue was resolved by disabling a conflicting service/driver. I disabled all of my HP services (HP App Helper, HP CASL, HP System Info), and now it works fine.
29,414,250
I get this weird error on SQL Server. And I cannot find solution in older posts. I have this procedure: ``` create proc _upJM_SyncAll_test as begin DECLARE @SQLString nvarchar(max) set @SQLString = N' DELETE FROM OPENQUERY([LOCAL_MYSQL],''SELECT acSubject FROM _utjm_setitemprices'') where acSubject not in (sele...
2015/04/02
[ "https://Stackoverflow.com/questions/29414250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3185532/" ]
Triggers are included in the implicit transaction required for insert, update, and delete statements. Because you are connecting to a linked server within a transaction, SQL Server promotes it to a Distributed Transaction. You'll need to configure MSDTC, you can either open MMC and load the MSDTC plugin or use the fol...
I ran into the same error, however it wasn't as simple as the Distributed Transaction Coordinator service from not running. I received a driver update automatically through windows that was causing issues with COM+ and not allowing MSDTC to communicate properly even though the MSDTC service was running. In my case, it ...
29,414,250
I get this weird error on SQL Server. And I cannot find solution in older posts. I have this procedure: ``` create proc _upJM_SyncAll_test as begin DECLARE @SQLString nvarchar(max) set @SQLString = N' DELETE FROM OPENQUERY([LOCAL_MYSQL],''SELECT acSubject FROM _utjm_setitemprices'') where acSubject not in (sele...
2015/04/02
[ "https://Stackoverflow.com/questions/29414250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3185532/" ]
I ran into the same error, however it wasn't as simple as the Distributed Transaction Coordinator service from not running. I received a driver update automatically through windows that was causing issues with COM+ and not allowing MSDTC to communicate properly even though the MSDTC service was running. In my case, it ...
I was having the same issue but for Azure SQL. (Just posting this here in case someone is having same issue with Azure SQL.) It was because of the application intent being set with the readonly option (ApplicationIntent=ReadOnly) when connecting to the Azure SQL DB with Read Scale Out option enabled in Azure. For a qu...
29,414,250
I get this weird error on SQL Server. And I cannot find solution in older posts. I have this procedure: ``` create proc _upJM_SyncAll_test as begin DECLARE @SQLString nvarchar(max) set @SQLString = N' DELETE FROM OPENQUERY([LOCAL_MYSQL],''SELECT acSubject FROM _utjm_setitemprices'') where acSubject not in (sele...
2015/04/02
[ "https://Stackoverflow.com/questions/29414250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3185532/" ]
'Distributed Transaction Coordinator' service was not running, So started service and changed service type to automatic too.
Recently this appeared as an issue on my work machine (Win 10, MSSQL 2016 SP2 Express). I do not have linked servers. This appeared from nothing. The MSDTC service is running, MSSQL works fine using the Mgmt Studio. However my .NET 4.7.1 Unit test app refuse to connect with the database with that "MSDTC on server '...'...
29,414,250
I get this weird error on SQL Server. And I cannot find solution in older posts. I have this procedure: ``` create proc _upJM_SyncAll_test as begin DECLARE @SQLString nvarchar(max) set @SQLString = N' DELETE FROM OPENQUERY([LOCAL_MYSQL],''SELECT acSubject FROM _utjm_setitemprices'') where acSubject not in (sele...
2015/04/02
[ "https://Stackoverflow.com/questions/29414250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3185532/" ]
In my case, the service was **stopped**. solution: need to turn the MSDTC service on 1. go to **Services**. (START > SETTINGS > CONTROL PANEL > ADMINISTRATIVE TOOLS > SERVICES) 2. Find the service called '**Distributed Transaction Coordinator**' and RIGHT CLICK (on it and select) > **Start**. 3. make this service to r...
Triggers are included in the implicit transaction required for insert, update, and delete statements. Because you are connecting to a linked server within a transaction, SQL Server promotes it to a Distributed Transaction. You'll need to configure MSDTC, you can either open MMC and load the MSDTC plugin or use the fol...
29,414,250
I get this weird error on SQL Server. And I cannot find solution in older posts. I have this procedure: ``` create proc _upJM_SyncAll_test as begin DECLARE @SQLString nvarchar(max) set @SQLString = N' DELETE FROM OPENQUERY([LOCAL_MYSQL],''SELECT acSubject FROM _utjm_setitemprices'') where acSubject not in (sele...
2015/04/02
[ "https://Stackoverflow.com/questions/29414250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3185532/" ]
'Distributed Transaction Coordinator' service was not running, So started service and changed service type to automatic too.
I was having the same issue but for Azure SQL. (Just posting this here in case someone is having same issue with Azure SQL.) It was because of the application intent being set with the readonly option (ApplicationIntent=ReadOnly) when connecting to the Azure SQL DB with Read Scale Out option enabled in Azure. For a qu...
29,414,250
I get this weird error on SQL Server. And I cannot find solution in older posts. I have this procedure: ``` create proc _upJM_SyncAll_test as begin DECLARE @SQLString nvarchar(max) set @SQLString = N' DELETE FROM OPENQUERY([LOCAL_MYSQL],''SELECT acSubject FROM _utjm_setitemprices'') where acSubject not in (sele...
2015/04/02
[ "https://Stackoverflow.com/questions/29414250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3185532/" ]
In my case, the service was **stopped**. solution: need to turn the MSDTC service on 1. go to **Services**. (START > SETTINGS > CONTROL PANEL > ADMINISTRATIVE TOOLS > SERVICES) 2. Find the service called '**Distributed Transaction Coordinator**' and RIGHT CLICK (on it and select) > **Start**. 3. make this service to r...
Powershell solution: ``` Get-Service -Name MSDTC | Set-Service -StartupType Automatic ```
29,414,250
I get this weird error on SQL Server. And I cannot find solution in older posts. I have this procedure: ``` create proc _upJM_SyncAll_test as begin DECLARE @SQLString nvarchar(max) set @SQLString = N' DELETE FROM OPENQUERY([LOCAL_MYSQL],''SELECT acSubject FROM _utjm_setitemprices'') where acSubject not in (sele...
2015/04/02
[ "https://Stackoverflow.com/questions/29414250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3185532/" ]
In my case, the service was **stopped**. solution: need to turn the MSDTC service on 1. go to **Services**. (START > SETTINGS > CONTROL PANEL > ADMINISTRATIVE TOOLS > SERVICES) 2. Find the service called '**Distributed Transaction Coordinator**' and RIGHT CLICK (on it and select) > **Start**. 3. make this service to r...
Recently this appeared as an issue on my work machine (Win 10, MSSQL 2016 SP2 Express). I do not have linked servers. This appeared from nothing. The MSDTC service is running, MSSQL works fine using the Mgmt Studio. However my .NET 4.7.1 Unit test app refuse to connect with the database with that "MSDTC on server '...'...
29,414,250
I get this weird error on SQL Server. And I cannot find solution in older posts. I have this procedure: ``` create proc _upJM_SyncAll_test as begin DECLARE @SQLString nvarchar(max) set @SQLString = N' DELETE FROM OPENQUERY([LOCAL_MYSQL],''SELECT acSubject FROM _utjm_setitemprices'') where acSubject not in (sele...
2015/04/02
[ "https://Stackoverflow.com/questions/29414250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3185532/" ]
Triggers are included in the implicit transaction required for insert, update, and delete statements. Because you are connecting to a linked server within a transaction, SQL Server promotes it to a Distributed Transaction. You'll need to configure MSDTC, you can either open MMC and load the MSDTC plugin or use the fol...
I was having the same issue but for Azure SQL. (Just posting this here in case someone is having same issue with Azure SQL.) It was because of the application intent being set with the readonly option (ApplicationIntent=ReadOnly) when connecting to the Azure SQL DB with Read Scale Out option enabled in Azure. For a qu...
29,414,250
I get this weird error on SQL Server. And I cannot find solution in older posts. I have this procedure: ``` create proc _upJM_SyncAll_test as begin DECLARE @SQLString nvarchar(max) set @SQLString = N' DELETE FROM OPENQUERY([LOCAL_MYSQL],''SELECT acSubject FROM _utjm_setitemprices'') where acSubject not in (sele...
2015/04/02
[ "https://Stackoverflow.com/questions/29414250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3185532/" ]
In my case, the service was **stopped**. solution: need to turn the MSDTC service on 1. go to **Services**. (START > SETTINGS > CONTROL PANEL > ADMINISTRATIVE TOOLS > SERVICES) 2. Find the service called '**Distributed Transaction Coordinator**' and RIGHT CLICK (on it and select) > **Start**. 3. make this service to r...
I was having the same issue but for Azure SQL. (Just posting this here in case someone is having same issue with Azure SQL.) It was because of the application intent being set with the readonly option (ApplicationIntent=ReadOnly) when connecting to the Azure SQL DB with Read Scale Out option enabled in Azure. For a qu...
42,736,765
I have an assignment to create an ArrayList of employees, to provide a menu to add, find, and delete employee records. I successfully managed to implement all the functions on my own, but there is a small problem. When I use the find or delete option, the correct record is found or deleted properly but the code goes th...
2017/03/11
[ "https://Stackoverflow.com/questions/42736765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6836874/" ]
``` else { System.out.print("Employee not found!"); } ``` This has to be AFTER the for loops are over. You need a found flag. If after the loop is false then print the message
Remove this block of code ``` else { System.out.print("Employee not found!"); } ``` It should work fine after that. --- **EDIT** This is off topic but when you ask question next time remember to post image of output rather than typing it or posting a link. And...
42,736,765
I have an assignment to create an ArrayList of employees, to provide a menu to add, find, and delete employee records. I successfully managed to implement all the functions on my own, but there is a small problem. When I use the find or delete option, the correct record is found or deleted properly but the code goes th...
2017/03/11
[ "https://Stackoverflow.com/questions/42736765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6836874/" ]
1. Create a variable to track if employee not found before the loops 2. In the if statements sent it to false if found. 3. At the end of the loop check if it is true. Then print the message "Employee not found" See the sample below ``` boolean notFound = true; for(int i=0;i<myEList.size();i++) { if(myEList.get(i...
Remove this block of code ``` else { System.out.print("Employee not found!"); } ``` It should work fine after that. --- **EDIT** This is off topic but when you ask question next time remember to post image of output rather than typing it or posting a link. And...
15,194,896
I want to load the image from url, as well as the text show in below the image. Like this, ![Widget Example](https://i.stack.imgur.com/tmx0R.png) 1. Alignment on ImageView & TextView, here is my code but doesn't shows the desired layout ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http...
2013/03/04
[ "https://Stackoverflow.com/questions/15194896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/898931/" ]
**Available Widget views & Layout** A **widget** is restricted in the View classes it can use. As layouts you can use the **FrameLayout, LinearLayout** and **RelativeLayout** classes. As views you can use AnalogClock, Button, Chromometer, ImageButton, ImageView, ProgressBar and TextView. As of Android 3.0 more views ...
Hi you can check this **[tutorial](https://code.google.com/p/url-image-widget/)** for Loading Image from URL (Http) . Try the following code : URL Image widget provider class ``` public class URLImageAppWidgetProvider extends AppWidgetProvider { public static String TAG = "URLImageWidget"; public static cla...
15,194,896
I want to load the image from url, as well as the text show in below the image. Like this, ![Widget Example](https://i.stack.imgur.com/tmx0R.png) 1. Alignment on ImageView & TextView, here is my code but doesn't shows the desired layout ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http...
2013/03/04
[ "https://Stackoverflow.com/questions/15194896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/898931/" ]
**Available Widget views & Layout** A **widget** is restricted in the View classes it can use. As layouts you can use the **FrameLayout, LinearLayout** and **RelativeLayout** classes. As views you can use AnalogClock, Button, Chromometer, ImageButton, ImageView, ProgressBar and TextView. As of Android 3.0 more views ...
see this. [How to create android app with app widget in single application](https://stackoverflow.com/questions/15038385/how-to-create-android-app-with-app-widget-in-single-application) This is helpful for you if you find out any problem then let me know.
46,109,017
I want to user `substr` in an 'if-statement' in mysql. for example... ``` if(substr(member, 1, 2 ) = 'A1','one','two') as member ``` When I use substr in the 'select-statement', the result is good. But the above query will cause an error. > > Can not 'substr' be used in an 'if-statement'? > > > Is there any o...
2017/09/08
[ "https://Stackoverflow.com/questions/46109017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6759208/" ]
you can try `$parent`. you can access the parent scope as follows ``` //This assigns the RESULT of login() to $scope.test $scope.test= $scope.$parent.login(); ```
If I understand the question correctly, I believe you need to assign `var vm = $scope.LoginCtrl = this`. This is so the ng-click has the correct method to fire, as it currently isn't assigned to the login function.
46,109,017
I want to user `substr` in an 'if-statement' in mysql. for example... ``` if(substr(member, 1, 2 ) = 'A1','one','two') as member ``` When I use substr in the 'select-statement', the result is good. But the above query will cause an error. > > Can not 'substr' be used in an 'if-statement'? > > > Is there any o...
2017/09/08
[ "https://Stackoverflow.com/questions/46109017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6759208/" ]
you can try `$parent`. you can access the parent scope as follows ``` //This assigns the RESULT of login() to $scope.test $scope.test= $scope.$parent.login(); ```
You should use the controllerAs syntax to give an alias to each controller. You can then call any method as follows: ``` alias.method() ``` The method you are calling must be in scope. e.g. where a controller is nested in another, the child controller has access to the parents methods.
23,599,278
How can I go out of the currect directory and access the test.php file? I have tried the following: ``` realpath(__dir__.'../test.php'); realpath(__dir__.'./test.php'); ``` But it does not work! Also could you please let me know what is the difference between ./ and ../ ? UPDATED: The following lines give the f...
2014/05/12
[ "https://Stackoverflow.com/questions/23599278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
What you need to do is: 1. create `www` folder in the same folder as `server.R` and `ui.R` 2. put javascript file into `www` folder. 3. put `tags$head(tags$script(src="hoge.js"))` in UI. The folder looks like: ``` ├── server.R ├── ui.R └── www └── hoge.js ``` The `ui.R` is something like ``` library(shiny) sh...
``` └──shiny ├── server.R ├── ui.R └── www ├── stylesheet.css └── js └── hoge.js ``` ui.R ==== Either one of them will work ``` 1. tags$head(HTML("<script type='text/javascript' src='js/hoge.js'></script>")) 2. HTML('<head> <link rel="stylesheet" type="text/c...
23,599,278
How can I go out of the currect directory and access the test.php file? I have tried the following: ``` realpath(__dir__.'../test.php'); realpath(__dir__.'./test.php'); ``` But it does not work! Also could you please let me know what is the difference between ./ and ../ ? UPDATED: The following lines give the f...
2014/05/12
[ "https://Stackoverflow.com/questions/23599278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
What you need to do is: 1. create `www` folder in the same folder as `server.R` and `ui.R` 2. put javascript file into `www` folder. 3. put `tags$head(tags$script(src="hoge.js"))` in UI. The folder looks like: ``` ├── server.R ├── ui.R └── www └── hoge.js ``` The `ui.R` is something like ``` library(shiny) sh...
Another way is to use: ``` includeScript("mapManipulator.js"), ```
23,599,278
How can I go out of the currect directory and access the test.php file? I have tried the following: ``` realpath(__dir__.'../test.php'); realpath(__dir__.'./test.php'); ``` But it does not work! Also could you please let me know what is the difference between ./ and ../ ? UPDATED: The following lines give the f...
2014/05/12
[ "https://Stackoverflow.com/questions/23599278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
What you need to do is: 1. create `www` folder in the same folder as `server.R` and `ui.R` 2. put javascript file into `www` folder. 3. put `tags$head(tags$script(src="hoge.js"))` in UI. The folder looks like: ``` ├── server.R ├── ui.R └── www └── hoge.js ``` The `ui.R` is something like ``` library(shiny) sh...
Another option not discussed yet is that you just delete the ui.R file entirely, and then code the entire thing as a custom HTML file. Details here <https://shiny.rstudio.com/articles/html-ui.html> In this article, the default HTML form elements are automatically used as inputs in server.R, but you can also build cust...
23,599,278
How can I go out of the currect directory and access the test.php file? I have tried the following: ``` realpath(__dir__.'../test.php'); realpath(__dir__.'./test.php'); ``` But it does not work! Also could you please let me know what is the difference between ./ and ../ ? UPDATED: The following lines give the f...
2014/05/12
[ "https://Stackoverflow.com/questions/23599278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
What you need to do is: 1. create `www` folder in the same folder as `server.R` and `ui.R` 2. put javascript file into `www` folder. 3. put `tags$head(tags$script(src="hoge.js"))` in UI. The folder looks like: ``` ├── server.R ├── ui.R └── www └── hoge.js ``` The `ui.R` is something like ``` library(shiny) sh...
My preferred way is like this: ui.R: ``` extendShinyjs(script = "app.js", functions = c("alerta")), ``` app.js: ``` shinyjs.alerta = function(text){ alert(text); } ``` server.R ``` js$alerta("alerta alerta antifascista") ``` You can also include code like this: ui.R after library imports: ``` jsCode...
23,599,278
How can I go out of the currect directory and access the test.php file? I have tried the following: ``` realpath(__dir__.'../test.php'); realpath(__dir__.'./test.php'); ``` But it does not work! Also could you please let me know what is the difference between ./ and ../ ? UPDATED: The following lines give the f...
2014/05/12
[ "https://Stackoverflow.com/questions/23599278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Another way is to use: ``` includeScript("mapManipulator.js"), ```
``` └──shiny ├── server.R ├── ui.R └── www ├── stylesheet.css └── js └── hoge.js ``` ui.R ==== Either one of them will work ``` 1. tags$head(HTML("<script type='text/javascript' src='js/hoge.js'></script>")) 2. HTML('<head> <link rel="stylesheet" type="text/c...
23,599,278
How can I go out of the currect directory and access the test.php file? I have tried the following: ``` realpath(__dir__.'../test.php'); realpath(__dir__.'./test.php'); ``` But it does not work! Also could you please let me know what is the difference between ./ and ../ ? UPDATED: The following lines give the f...
2014/05/12
[ "https://Stackoverflow.com/questions/23599278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` └──shiny ├── server.R ├── ui.R └── www ├── stylesheet.css └── js └── hoge.js ``` ui.R ==== Either one of them will work ``` 1. tags$head(HTML("<script type='text/javascript' src='js/hoge.js'></script>")) 2. HTML('<head> <link rel="stylesheet" type="text/c...
Another option not discussed yet is that you just delete the ui.R file entirely, and then code the entire thing as a custom HTML file. Details here <https://shiny.rstudio.com/articles/html-ui.html> In this article, the default HTML form elements are automatically used as inputs in server.R, but you can also build cust...
23,599,278
How can I go out of the currect directory and access the test.php file? I have tried the following: ``` realpath(__dir__.'../test.php'); realpath(__dir__.'./test.php'); ``` But it does not work! Also could you please let me know what is the difference between ./ and ../ ? UPDATED: The following lines give the f...
2014/05/12
[ "https://Stackoverflow.com/questions/23599278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` └──shiny ├── server.R ├── ui.R └── www ├── stylesheet.css └── js └── hoge.js ``` ui.R ==== Either one of them will work ``` 1. tags$head(HTML("<script type='text/javascript' src='js/hoge.js'></script>")) 2. HTML('<head> <link rel="stylesheet" type="text/c...
My preferred way is like this: ui.R: ``` extendShinyjs(script = "app.js", functions = c("alerta")), ``` app.js: ``` shinyjs.alerta = function(text){ alert(text); } ``` server.R ``` js$alerta("alerta alerta antifascista") ``` You can also include code like this: ui.R after library imports: ``` jsCode...
23,599,278
How can I go out of the currect directory and access the test.php file? I have tried the following: ``` realpath(__dir__.'../test.php'); realpath(__dir__.'./test.php'); ``` But it does not work! Also could you please let me know what is the difference between ./ and ../ ? UPDATED: The following lines give the f...
2014/05/12
[ "https://Stackoverflow.com/questions/23599278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Another way is to use: ``` includeScript("mapManipulator.js"), ```
Another option not discussed yet is that you just delete the ui.R file entirely, and then code the entire thing as a custom HTML file. Details here <https://shiny.rstudio.com/articles/html-ui.html> In this article, the default HTML form elements are automatically used as inputs in server.R, but you can also build cust...
23,599,278
How can I go out of the currect directory and access the test.php file? I have tried the following: ``` realpath(__dir__.'../test.php'); realpath(__dir__.'./test.php'); ``` But it does not work! Also could you please let me know what is the difference between ./ and ../ ? UPDATED: The following lines give the f...
2014/05/12
[ "https://Stackoverflow.com/questions/23599278", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Another way is to use: ``` includeScript("mapManipulator.js"), ```
My preferred way is like this: ui.R: ``` extendShinyjs(script = "app.js", functions = c("alerta")), ``` app.js: ``` shinyjs.alerta = function(text){ alert(text); } ``` server.R ``` js$alerta("alerta alerta antifascista") ``` You can also include code like this: ui.R after library imports: ``` jsCode...
22,966,279
Is there a possibility where I can make a button on which when I click, the contents directly get shared on facebook without showing our user the share prompt dialog box? I referred it online and found that its possible through mobile devices: <http://www.mindfiresolutions.com/How-to-post-message-on-your-facebook-wall...
2014/04/09
[ "https://Stackoverflow.com/questions/22966279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2368690/" ]
Of course you can using the Graph API. On the button click you just have to make a `\POST` call to `/me/feed`. Learn more about publishing a feed via Graph API and what all parameters are available [here](https://developers.facebook.com/docs/graph-api/reference/user/feed/#publish). Permission required: `publish_strea...
Try this way: <https://developers.facebook.com/docs/reference/php/> When coding the wep app, you only have to provide the App Id and the App Secret, then you should have to specify the content to be posted. You should try also the Javascript Facebook SDK, you'll find it here: <https://developers.facebook.com/docs/javas...
22,966,279
Is there a possibility where I can make a button on which when I click, the contents directly get shared on facebook without showing our user the share prompt dialog box? I referred it online and found that its possible through mobile devices: <http://www.mindfiresolutions.com/How-to-post-message-on-your-facebook-wall...
2014/04/09
[ "https://Stackoverflow.com/questions/22966279", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2368690/" ]
Of course you can using the Graph API. On the button click you just have to make a `\POST` call to `/me/feed`. Learn more about publishing a feed via Graph API and what all parameters are available [here](https://developers.facebook.com/docs/graph-api/reference/user/feed/#publish). Permission required: `publish_strea...
Just go to <https://developers.facebook.com/docs/opengraph/> Review it and place what kind of share you want. This is the long process to be handle so. you need to study it.
9,958,357
Lets say I have 3 domains "example.com", "example.net", and "example.org". I also have a VPS running Ubuntu 11.04 32bit with Apache, MySQL, PHP5, ProFTPd and Webmin. Sally owns example.com and has her home at: > > /home/sally > > > Joe owns example.net and has his home at: > > /home/joe > > > Dave owns ...
2012/03/31
[ "https://Stackoverflow.com/questions/9958357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1305351/" ]
You need to use an `Array` instead an `Object` there. Like ``` var myThings = { thing1: [ ['24-04-12', '90'], ['25-04-12', '90'], ['26-04-12', '90'] ], thing2: [ ['24-04-12', '10'], ['25-04-12', '30'], ['26-04-12', '210'] ] } ``` Now since `thing1` and ...
I'd do: ``` //create your array dynamically var array1 = [['24-04-12', '90'], ['25-04-12', '90'], ['26-04-12', '90'] ]; var myThings = { thing1: array1 , thing2: array1 } ``` This way, the properties of your object are arrays.
9,958,357
Lets say I have 3 domains "example.com", "example.net", and "example.org". I also have a VPS running Ubuntu 11.04 32bit with Apache, MySQL, PHP5, ProFTPd and Webmin. Sally owns example.com and has her home at: > > /home/sally > > > Joe owns example.net and has his home at: > > /home/joe > > > Dave owns ...
2012/03/31
[ "https://Stackoverflow.com/questions/9958357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1305351/" ]
You need to use an `Array` instead an `Object` there. Like ``` var myThings = { thing1: [ ['24-04-12', '90'], ['25-04-12', '90'], ['26-04-12', '90'] ], thing2: [ ['24-04-12', '10'], ['25-04-12', '30'], ['26-04-12', '210'] ] } ``` Now since `thing1` and ...
Instead of your inner items being objects, you should make them arrays. Objects must exist in key-value pairs, which does not make sense for your usage. Arrays are also key-value pairs, but the key is simply the index number. ``` var myThings = { thing1: [ // thing1 is now an array of arrays ['24-04-12', '...
9,958,357
Lets say I have 3 domains "example.com", "example.net", and "example.org". I also have a VPS running Ubuntu 11.04 32bit with Apache, MySQL, PHP5, ProFTPd and Webmin. Sally owns example.com and has her home at: > > /home/sally > > > Joe owns example.net and has his home at: > > /home/joe > > > Dave owns ...
2012/03/31
[ "https://Stackoverflow.com/questions/9958357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1305351/" ]
I'd do: ``` //create your array dynamically var array1 = [['24-04-12', '90'], ['25-04-12', '90'], ['26-04-12', '90'] ]; var myThings = { thing1: array1 , thing2: array1 } ``` This way, the properties of your object are arrays.
Instead of your inner items being objects, you should make them arrays. Objects must exist in key-value pairs, which does not make sense for your usage. Arrays are also key-value pairs, but the key is simply the index number. ``` var myThings = { thing1: [ // thing1 is now an array of arrays ['24-04-12', '...