qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
18,844,218
I am using SQL Server 2008. I want to get Start Date and End Date of all quarters of year. For example if I pass 2013 in query then output should like ``` StartDate EndDate QuarterNo ------------------------------------------------------------- 2013-04-01 00:00:00.000 2013-06-30 00:...
2013/09/17
[ "https://Stackoverflow.com/questions/18844218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1635294/" ]
My favorite way but EOMONTH and DATEFROMPARTS doesn't exist before SQLServer 2012: ``` DECLARE @FISCAL_YEAR INT = 2013, @QUATER INT = 2 SELECT DATEFROMPARTS(@fiscal_year,(@Quater * 3)-2,1) AS QuaterStart, EOMONTH(DATEFROMPARTS(@fiscal_year,@Quater * 3,1)) AS QuaterEnd ```
Stumbled upon these two posts when looking to truncate dates. * [SQL Server: Date truncation for custom time periods](http://www.silota.com/docs/recipes/sql-server-date-parts-truncation.html)! * [What is the best way to truncate a date in SQL Server?](https://stackoverflow.com/questions/2639051/what-is-the-best-way-to...
18,844,218
I am using SQL Server 2008. I want to get Start Date and End Date of all quarters of year. For example if I pass 2013 in query then output should like ``` StartDate EndDate QuarterNo ------------------------------------------------------------- 2013-04-01 00:00:00.000 2013-06-30 00:...
2013/09/17
[ "https://Stackoverflow.com/questions/18844218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1635294/" ]
My favorite way but EOMONTH and DATEFROMPARTS doesn't exist before SQLServer 2012: ``` DECLARE @FISCAL_YEAR INT = 2013, @QUATER INT = 2 SELECT DATEFROMPARTS(@fiscal_year,(@Quater * 3)-2,1) AS QuaterStart, EOMONTH(DATEFROMPARTS(@fiscal_year,@Quater * 3,1)) AS QuaterEnd ```
Last date of previous quarter. This code can run on SQL Server 2012 and later ``` select EOMONTH(DATEFROMPARTS(year(DATEADD(month, -1, GETDATE())),DATENAME(qq,DATEADD(month, -1, GETDATE())) * 3,1)) AS QuarterEnd ```
18,844,218
I am using SQL Server 2008. I want to get Start Date and End Date of all quarters of year. For example if I pass 2013 in query then output should like ``` StartDate EndDate QuarterNo ------------------------------------------------------------- 2013-04-01 00:00:00.000 2013-06-30 00:...
2013/09/17
[ "https://Stackoverflow.com/questions/18844218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1635294/" ]
One more way to do it ``` SELECT DATEADD(mm, (quarter - 1) * 3, year_date) StartDate, DATEADD(dd, -1, DATEADD(mm, quarter * 3, year_date)) EndDate, quarter QuarterNo FROM ( SELECT '2013-04-01' year_date ) s CROSS JOIN ( SELECT 1 quarter UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT ...
Last date of previous quarter. This code can run on SQL Server 2012 and later ``` select EOMONTH(DATEFROMPARTS(year(DATEADD(month, -1, GETDATE())),DATENAME(qq,DATEADD(month, -1, GETDATE())) * 3,1)) AS QuarterEnd ```
18,844,218
I am using SQL Server 2008. I want to get Start Date and End Date of all quarters of year. For example if I pass 2013 in query then output should like ``` StartDate EndDate QuarterNo ------------------------------------------------------------- 2013-04-01 00:00:00.000 2013-06-30 00:...
2013/09/17
[ "https://Stackoverflow.com/questions/18844218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1635294/" ]
Stumbled upon these two posts when looking to truncate dates. * [SQL Server: Date truncation for custom time periods](http://www.silota.com/docs/recipes/sql-server-date-parts-truncation.html)! * [What is the best way to truncate a date in SQL Server?](https://stackoverflow.com/questions/2639051/what-is-the-best-way-to...
``` SELECT CAST(DATEADD(M,3*(NUMBER-1),DATEADD(YYYY,DATEDIFF(YYYY,0,GETDATE()),0)) AS DATE) [QT START DATE] , CAST(DATEADD(D,-1,DATEADD(M,3*(NUMBER),DATEADD(YYYY,DATEDIFF(YYYY,0,GETDATE()),0))) AS DATE) [QT END DATE] , NUMBER AS [QUARTER NAME] FROM MASTER..SPT_VALUES WHERE TYPE='P' AND NUMBER BETWEEN...
18,844,218
I am using SQL Server 2008. I want to get Start Date and End Date of all quarters of year. For example if I pass 2013 in query then output should like ``` StartDate EndDate QuarterNo ------------------------------------------------------------- 2013-04-01 00:00:00.000 2013-06-30 00:...
2013/09/17
[ "https://Stackoverflow.com/questions/18844218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1635294/" ]
Stumbled upon these two posts when looking to truncate dates. * [SQL Server: Date truncation for custom time periods](http://www.silota.com/docs/recipes/sql-server-date-parts-truncation.html)! * [What is the best way to truncate a date in SQL Server?](https://stackoverflow.com/questions/2639051/what-is-the-best-way-to...
Last date of previous quarter. This code can run on SQL Server 2012 and later ``` select EOMONTH(DATEFROMPARTS(year(DATEADD(month, -1, GETDATE())),DATENAME(qq,DATEADD(month, -1, GETDATE())) * 3,1)) AS QuarterEnd ```
18,844,218
I am using SQL Server 2008. I want to get Start Date and End Date of all quarters of year. For example if I pass 2013 in query then output should like ``` StartDate EndDate QuarterNo ------------------------------------------------------------- 2013-04-01 00:00:00.000 2013-06-30 00:...
2013/09/17
[ "https://Stackoverflow.com/questions/18844218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1635294/" ]
My favorite way but EOMONTH and DATEFROMPARTS doesn't exist before SQLServer 2012: ``` DECLARE @FISCAL_YEAR INT = 2013, @QUATER INT = 2 SELECT DATEFROMPARTS(@fiscal_year,(@Quater * 3)-2,1) AS QuaterStart, EOMONTH(DATEFROMPARTS(@fiscal_year,@Quater * 3,1)) AS QuaterEnd ```
Here's a solution for calendar quarters using a recursive CTE. ``` DECLARE @Date DATE = '2021-11-06' ;WITH CalendarQuarters AS ( SELECT 1 AS QuarterNo ,CONVERT(DATE,DATEADD(DAY,-(DATEPART(DAY,@Date))+1, DATEADD(MONTH,-(DATEPART(MONTH,@Date))+1,@Date))) AS StartDate ,CONVERT(DATE,DATEADD(DAY,-(...
60,942,449
In Main.cpp why does `p3 = p3 + 2;` work but `p3 = 2 + p3;` gives me the error stated in the title? Pair.h ``` #pragma once class Pair { private: int num1, num2; public: Pair(); Pair(int num1, int num2); int get1(); int get2(); Pair operator+(const Pair& other); Pair operator+(int otherNum...
2020/03/31
[ "https://Stackoverflow.com/questions/60942449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12186133/" ]
The reason your code doesn't work as you would think is documented in the [MDN String documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String). > > When using bracket notation for character access, attempting to delete or assign a value to these properties will not succe...
Looks like the assignment on strings doesn't work like that in Javascript, too bad, it's intuitively correct. So, use a string splice, which doesn't exist, so split the string into an array of characters with `str.split('')`, and use array splice. The splice modifies the input array in place, so you don't need to r...
60,942,449
In Main.cpp why does `p3 = p3 + 2;` work but `p3 = 2 + p3;` gives me the error stated in the title? Pair.h ``` #pragma once class Pair { private: int num1, num2; public: Pair(); Pair(int num1, int num2); int get1(); int get2(); Pair operator+(const Pair& other); Pair operator+(int otherNum...
2020/03/31
[ "https://Stackoverflow.com/questions/60942449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12186133/" ]
The reason your code doesn't work as you would think is documented in the [MDN String documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String). > > When using bracket notation for character access, attempting to delete or assign a value to these properties will not succe...
very elegantly looks with methods chaining - **split+map+join** and patterns of string **`${var1}${var2}`** - in left back quote **" ` "** **var1** - item[0].toUpperCase() - first symbol toUpperCase **var2** - item.substring(1) - killing first symbol .toLowerCase() - other symbols toLowerCase ```js cons...
14,342,026
i need help in select sql statement. in my mysql database: location table ``` serialID(AI)|locations | telephone | address --------------------------------------------- 1 | A 2 | B 3 | C 4 | D users table userID | location chosen ------------------------- 1 | A 2 ...
2013/01/15
[ "https://Stackoverflow.com/questions/14342026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1938510/" ]
``` SELECT loc.*, countResult.usersFavourable FROM location loc LEFT JOIN ( SELECT locationChoosen, COUNT(*) `usersFavourable` FROM users GROUP BY locationChoosen ) countResult ON loc.locations = countResult.locationChoosen ORDER BY countResult.user...
``` SELECT LocationChosen, Count(*) FROM usersTable GROUP BY LocationChosen ```
14,342,026
i need help in select sql statement. in my mysql database: location table ``` serialID(AI)|locations | telephone | address --------------------------------------------- 1 | A 2 | B 3 | C 4 | D users table userID | location chosen ------------------------- 1 | A 2 ...
2013/01/15
[ "https://Stackoverflow.com/questions/14342026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1938510/" ]
Try something like this: ``` SELECT l.location, l.address, l.telephone, COUNT(u.userID) AS [users favourable] FROM location l LEFT JOIN users u ON l.location = u.locationchosen GROUP BY l.location, l.address, l.telephone ```
``` SELECT LocationChosen, Count(*) FROM usersTable GROUP BY LocationChosen ```
14,342,026
i need help in select sql statement. in my mysql database: location table ``` serialID(AI)|locations | telephone | address --------------------------------------------- 1 | A 2 | B 3 | C 4 | D users table userID | location chosen ------------------------- 1 | A 2 ...
2013/01/15
[ "https://Stackoverflow.com/questions/14342026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1938510/" ]
You could just do a query like this: ``` SELECT l.locations, l.telephone, l.address, COUNT (u.userID) as `location_count` FROM location AS l LEFT OUTER JOIN users AS u on l.locations = u.location_chosen GROUP BY l.locations ORDER BY `location_count` DESC ```
``` SELECT LocationChosen, Count(*) FROM usersTable GROUP BY LocationChosen ```
14,342,026
i need help in select sql statement. in my mysql database: location table ``` serialID(AI)|locations | telephone | address --------------------------------------------- 1 | A 2 | B 3 | C 4 | D users table userID | location chosen ------------------------- 1 | A 2 ...
2013/01/15
[ "https://Stackoverflow.com/questions/14342026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1938510/" ]
use this: ``` select count(userId) count,locations,address,telephone from Table1 Left join Table2 on Table1.locations = Table2.location group by locations order by count desc ; ``` see here.. [link](http://sqlfiddle.com/#!2/7ea50/15/0)
``` SELECT LocationChosen, Count(*) FROM usersTable GROUP BY LocationChosen ```
14,342,026
i need help in select sql statement. in my mysql database: location table ``` serialID(AI)|locations | telephone | address --------------------------------------------- 1 | A 2 | B 3 | C 4 | D users table userID | location chosen ------------------------- 1 | A 2 ...
2013/01/15
[ "https://Stackoverflow.com/questions/14342026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1938510/" ]
You could just do a query like this: ``` SELECT l.locations, l.telephone, l.address, COUNT (u.userID) as `location_count` FROM location AS l LEFT OUTER JOIN users AS u on l.locations = u.location_chosen GROUP BY l.locations ORDER BY `location_count` DESC ```
``` SELECT loc.*, countResult.usersFavourable FROM location loc LEFT JOIN ( SELECT locationChoosen, COUNT(*) `usersFavourable` FROM users GROUP BY locationChoosen ) countResult ON loc.locations = countResult.locationChoosen ORDER BY countResult.user...
14,342,026
i need help in select sql statement. in my mysql database: location table ``` serialID(AI)|locations | telephone | address --------------------------------------------- 1 | A 2 | B 3 | C 4 | D users table userID | location chosen ------------------------- 1 | A 2 ...
2013/01/15
[ "https://Stackoverflow.com/questions/14342026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1938510/" ]
You could just do a query like this: ``` SELECT l.locations, l.telephone, l.address, COUNT (u.userID) as `location_count` FROM location AS l LEFT OUTER JOIN users AS u on l.locations = u.location_chosen GROUP BY l.locations ORDER BY `location_count` DESC ```
Try something like this: ``` SELECT l.location, l.address, l.telephone, COUNT(u.userID) AS [users favourable] FROM location l LEFT JOIN users u ON l.location = u.locationchosen GROUP BY l.location, l.address, l.telephone ```
14,342,026
i need help in select sql statement. in my mysql database: location table ``` serialID(AI)|locations | telephone | address --------------------------------------------- 1 | A 2 | B 3 | C 4 | D users table userID | location chosen ------------------------- 1 | A 2 ...
2013/01/15
[ "https://Stackoverflow.com/questions/14342026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1938510/" ]
You could just do a query like this: ``` SELECT l.locations, l.telephone, l.address, COUNT (u.userID) as `location_count` FROM location AS l LEFT OUTER JOIN users AS u on l.locations = u.location_chosen GROUP BY l.locations ORDER BY `location_count` DESC ```
use this: ``` select count(userId) count,locations,address,telephone from Table1 Left join Table2 on Table1.locations = Table2.location group by locations order by count desc ; ``` see here.. [link](http://sqlfiddle.com/#!2/7ea50/15/0)
34,173,739
I want to change os.path in `os.py`, but it failed. path is different in different platform. `os.py` ``` import ntpath as path sys.modules['os.path'] = path from os.path import (curdir, pardir, sep, pathsep, defpath, extsep, altsep, devnull) ``` It turns out that ``` from os.path import (curdir, pardir, sep, p...
2015/12/09
[ "https://Stackoverflow.com/questions/34173739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/996925/" ]
Your approach should work. Rename the subdirectory `os` in your current directory to `my_os`. Python finds your `os` directory first and tries to import from there. Adding this line: ``` __future__ import absolute_import ``` to the beginning of the `os.py` avoids this problem by using [absolute imports](https://doc...
did you try with "[\_\_import\_\_](https://docs.python.org/2/library/functions.html#__import__)" function ? ``` import mtpath as path os_path = __import__(path, globals(), locals(), ['curdir', 'pardir', 'sep', 'pathsep', 'defpath', 'extsep', 'altsep', 'devnull'] ``` Then, you can use 'curdir' as : ``` os_path.curdi...
1,912
In the US, clothes dryers are one of the leading causes of house fires: > > In 1998, CPSC estimates that there were approximately 15,600 clothes dryer fires resulting in 20 deaths, 370 injuries and $75.4 million in property damage. > > > Or [more recent numbers](http://www.nfpa.org/safety-information/for-consume...
2015/03/01
[ "https://engineering.stackexchange.com/questions/1912", "https://engineering.stackexchange.com", "https://engineering.stackexchange.com/users/33/" ]
Taking the data you supplied at face value, a relatively simple solution is for the dryer to measure either the exhaust air flow or back pressure, and refuse to operate when out of spec. Sensing these parameters can be done cheaply with today's electronics, especially considering such dryers already have a microcontrol...
Just for shiggles I'm imagining a perfect dryer duct with no kinks that fits recommended installation parameters. It seems to me that influencing the vent speed would: * Force slightly more particles through the lint trap * Simply cause the lint clog to collect further from the dryer Preventative maintenance aside (...
1,912
In the US, clothes dryers are one of the leading causes of house fires: > > In 1998, CPSC estimates that there were approximately 15,600 clothes dryer fires resulting in 20 deaths, 370 injuries and $75.4 million in property damage. > > > Or [more recent numbers](http://www.nfpa.org/safety-information/for-consume...
2015/03/01
[ "https://engineering.stackexchange.com/questions/1912", "https://engineering.stackexchange.com", "https://engineering.stackexchange.com/users/33/" ]
One of the issues of having an exhaust velocity that is too high is the increased possibility of injuring someone who might go past, particularly and eye or ear canal injury. A cover on the outlet would reduce air velocity and increase the chance of lint build up near the exhaust outlet. The other issue with increased...
Just for shiggles I'm imagining a perfect dryer duct with no kinks that fits recommended installation parameters. It seems to me that influencing the vent speed would: * Force slightly more particles through the lint trap * Simply cause the lint clog to collect further from the dryer Preventative maintenance aside (...
1,912
In the US, clothes dryers are one of the leading causes of house fires: > > In 1998, CPSC estimates that there were approximately 15,600 clothes dryer fires resulting in 20 deaths, 370 injuries and $75.4 million in property damage. > > > Or [more recent numbers](http://www.nfpa.org/safety-information/for-consume...
2015/03/01
[ "https://engineering.stackexchange.com/questions/1912", "https://engineering.stackexchange.com", "https://engineering.stackexchange.com/users/33/" ]
There is a product on the market today that is specifically aimed to address this issue - it is the [dryer booster fan](http://www.fantech.net/Support/FAQs/Dryer-Exhaust/). I installed one of these on my dryer (I was seeing excessive lint buildup in my ducts which were borderline for size and length) and it made a big...
Just for shiggles I'm imagining a perfect dryer duct with no kinks that fits recommended installation parameters. It seems to me that influencing the vent speed would: * Force slightly more particles through the lint trap * Simply cause the lint clog to collect further from the dryer Preventative maintenance aside (...
12,393,112
I am using Jquery to dynamically populate the table element. My table will have three columns - Label, textarea and a button. I am binding a click event on click of the button. Below is my Jquery code. ``` var rowElem = $('<tr id="'+ key + '" class="queryRow"> </tr>'); rowElem.append($('<td class="queryTitleCol">' + k...
2012/09/12
[ "https://Stackoverflow.com/questions/12393112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/646276/" ]
Try ``` var label = $(".queryTitleCol", rowElem)[0].innerHTML; ``` or ``` var label = $(".queryTitleCol", rowElem).text(); ```
You could try something like ``` $('button').click(function(){ $(this).prev('.queryTitleCol').text(); }); ``` This will always grab the previous element with `queryTitleCol` as its class. It only returns one element, so you shouldn't run into the problem you've been describing.
12,393,112
I am using Jquery to dynamically populate the table element. My table will have three columns - Label, textarea and a button. I am binding a click event on click of the button. Below is my Jquery code. ``` var rowElem = $('<tr id="'+ key + '" class="queryRow"> </tr>'); rowElem.append($('<td class="queryTitleCol">' + k...
2012/09/12
[ "https://Stackoverflow.com/questions/12393112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/646276/" ]
Try ``` var label = $(".queryTitleCol", rowElem)[0].innerHTML; ``` or ``` var label = $(".queryTitleCol", rowElem).text(); ```
You can try this ``` function action() { var titleCol = $(this).parent().parent().find('td:eq(0)').text(); } ``` Check this [FIDDLE](http://jsfiddle.net/sushanth009/n7aSb/)
58,047,338
Need only IP address as marked in the below image and nothing else. **[![PLEASE VIEW THIS IMAGE](https://i.stack.imgur.com/YsqxZ.png)](https://i.stack.imgur.com/YsqxZ.png)** Could someone please provide a specific bash command?
2019/09/22
[ "https://Stackoverflow.com/questions/58047338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9944121/" ]
You can use something like this : ``` ifconfig wlan0| awk '/inet /{print $2}' ifconfig wlan0| grep -w "inet"|cut -d" " -f2 ```
That exact CMD will be useful : ``` ifconfig wlan0 inet | grep inet | cut -d ' ' -f2 ```
58,047,338
Need only IP address as marked in the below image and nothing else. **[![PLEASE VIEW THIS IMAGE](https://i.stack.imgur.com/YsqxZ.png)](https://i.stack.imgur.com/YsqxZ.png)** Could someone please provide a specific bash command?
2019/09/22
[ "https://Stackoverflow.com/questions/58047338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9944121/" ]
You can use something like this : ``` ifconfig wlan0| awk '/inet /{print $2}' ifconfig wlan0| grep -w "inet"|cut -d" " -f2 ```
You can do it by only grep. ``` ifconfig wlan0 | grep -oE '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}' ```
31,799
Could anybody provide an example how to get the attributes of selected features? I tried the following code in the Python Console : but I'm stuck at the point where I'd like to get the attributes: ```py from qgis.utils import iface canvas = iface.mapCanvas() cLayer = canvas.currentLayer() selectList = [] if cLayer:...
2012/08/20
[ "https://gis.stackexchange.com/questions/31799", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/9318/" ]
This will work: ```py layer = iface.activeLayer() features = layer.selectedFeatures() for f in features: print f.attributeMap() ``` In PyQGIS 3: ```py layer = iface.activeLayer() features = layer.selectedFeatures() for f in features: # refer to all attributes print (f.attributes()) # results in [3, ...
**For QGIS 3.10** Not sure if this post was asking for it in a list... Print field of selected features ```py layer = iface.activeLayer() for feature in layer.selectedFeatures(): print(feature['field name']) ``` Create list of selected features ```py layer = iface.activeLayer() list = [] for feature in lay...
31,799
Could anybody provide an example how to get the attributes of selected features? I tried the following code in the Python Console : but I'm stuck at the point where I'd like to get the attributes: ```py from qgis.utils import iface canvas = iface.mapCanvas() cLayer = canvas.currentLayer() selectList = [] if cLayer:...
2012/08/20
[ "https://gis.stackexchange.com/questions/31799", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/9318/" ]
This will work: ```py layer = iface.activeLayer() features = layer.selectedFeatures() for f in features: print f.attributeMap() ``` In PyQGIS 3: ```py layer = iface.activeLayer() features = layer.selectedFeatures() for f in features: # refer to all attributes print (f.attributes()) # results in [3, ...
There are also other approaches available: Approach 1 : [`QgsAggregateCalculator`](https://qgis.org/api/3.16/classQgsAggregateCalculator.html#a51eb9f5752cf107d72266829a21cf2fa) with `ArrayAggregate` ------------------------------------------------------------------------------------------------------------------------...
6,318,272
I am following the C programming tutorial at <http://www.cprogramming.com/tutorial/c/lesson10.html>. This particular tutorial teaches file I/O in C; in particular, the fopen command is discussed. At one point, they give the following example (which I think should print the contents of file test.txt): ``` FILE *fp; fp=...
2011/06/11
[ "https://Stackoverflow.com/questions/6318272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/794233/" ]
This is because you use `open` instead of `fopen`. `Open` is from the POSIX standard and returns an (integer) handle; `fopen` returns the memory address of a `FILE` structure. You cannot use both in an interchangeable way. As it stands, your code implicitly casts the received integer (likely 4) to a `FILE*` pointer, ma...
`fopen()` returns a pointer to a `FILE` object while `open()` returns a file descriptor which is a plain `int`. Unless you need low-level functions it's usually better to work with `fopen` and `FILE` objects.
6,318,272
I am following the C programming tutorial at <http://www.cprogramming.com/tutorial/c/lesson10.html>. This particular tutorial teaches file I/O in C; in particular, the fopen command is discussed. At one point, they give the following example (which I think should print the contents of file test.txt): ``` FILE *fp; fp=...
2011/06/11
[ "https://Stackoverflow.com/questions/6318272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/794233/" ]
This is because you use `open` instead of `fopen`. `Open` is from the POSIX standard and returns an (integer) handle; `fopen` returns the memory address of a `FILE` structure. You cannot use both in an interchangeable way. As it stands, your code implicitly casts the received integer (likely 4) to a `FILE*` pointer, ma...
I'm guessing this was just an unfortunate typo - `open()` instead of `fopen()` - which just happens to work well enough to build a final executable (rather than a deliberate attempt to use `open()`)... You see `warning: assignment makes pointer from integer without a cast` because there is no "prototype" - a declarati...
22,964,302
In my application, I am using hive metastore(mysql) from JDBC. Now the requirement got changed and I won't be able to get metastore credentials. Hence I can't use JDBC to access metastore. I wanted to know, Is there a way to access hivemetastore tables like TBLS and INDXS from HCATALOG? Thanks in advance.
2014/04/09
[ "https://Stackoverflow.com/questions/22964302", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3011822/" ]
You can probably get most of the information you need through HCatalog, without direct access to the metastore tables. ``` HiveConf conf = new HiveConf(); // should pull hive-site.xml automatically HiveMetaStoreClient hiveClient = new HiveMetaStoreClient(conf); Table hiveTable = HCatUtil.getTable(hiveClient, "default...
Yes, that's what HCatalog is all about: access and manipulate the metastore. See [SHOW TABLES](https://cwiki.apache.org/confluence/display/Hive/HCatalog+CLI#HCatalogCLI-SHOWTABLES).
42,116,187
In R I'm trying to profile the columns of a data frame. This is the data frame: ``` > library(MASS) > data<-iris[1:5,1:4] > data Sepal.Length Sepal.Width Petal.Length Petal.Width 1 5.1 3.5 1.4 0.2 2 4.9 3.0 1.4 0.2 3 4.7 3.2 ...
2017/02/08
[ "https://Stackoverflow.com/questions/42116187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/286795/" ]
Oneliner with `base R`: ``` t(sapply(data, summary))[, c('Min.', 'Max.', 'Mean')] ```
Using `dplyr` to allow use of any functions ``` library(dplyr) library(tidyr) data %>% gather() %>% group_by(key) %>% summarise_all(funs(min, max, mean)) ```
42,116,187
In R I'm trying to profile the columns of a data frame. This is the data frame: ``` > library(MASS) > data<-iris[1:5,1:4] > data Sepal.Length Sepal.Width Petal.Length Petal.Width 1 5.1 3.5 1.4 0.2 2 4.9 3.0 1.4 0.2 3 4.7 3.2 ...
2017/02/08
[ "https://Stackoverflow.com/questions/42116187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/286795/" ]
``` library(plyr) t(sapply(data, each(min,max,mean))) ```
Using `dplyr` to allow use of any functions ``` library(dplyr) library(tidyr) data %>% gather() %>% group_by(key) %>% summarise_all(funs(min, max, mean)) ```
20,166,014
I have a hadoop application. I write a java program which needs org.json.jar package as well as hadoop-core.jar. I compile this source file with the following linux command. ``` mkdir q3_classes javac -classpath ${HADOOP_HOME}/hadoop-core.jar:${HADOOP_HOME}/org.json-20120521.jar -d q3_classes ETLQ3.java jar -cvf q3.ja...
2013/11/23
[ "https://Stackoverflow.com/questions/20166014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3023526/" ]
Use [mysql\_affected\_rows](http://www.php.net/manual/fr/function.mysql-affected-rows.php) to count the number of affected rows. If it returns 0, no row was updated.
**mysql functions are deprecated, so you may want to use mysqli\_ functions.** Using the deprecated mysql functions, one can use [mysql\_errno](http://php.net/manual/en/function.mysql-errno.php) to check if an error occurred. ``` $result = mysql_query("update testDb SET username ='$DataVar' WHERE ID = '$IdVar'"); if...
20,166,014
I have a hadoop application. I write a java program which needs org.json.jar package as well as hadoop-core.jar. I compile this source file with the following linux command. ``` mkdir q3_classes javac -classpath ${HADOOP_HOME}/hadoop-core.jar:${HADOOP_HOME}/org.json-20120521.jar -d q3_classes ETLQ3.java jar -cvf q3.ja...
2013/11/23
[ "https://Stackoverflow.com/questions/20166014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3023526/" ]
[mysql\_affected\_rows](http://us1.php.net/mysql_affected_rows) count the number of affected rows on success, and -1 if the last query failed. ``` echo ( mysql_affected_rows() > 0 ) ? "Success update" : "No rows update"; ```
**mysql functions are deprecated, so you may want to use mysqli\_ functions.** Using the deprecated mysql functions, one can use [mysql\_errno](http://php.net/manual/en/function.mysql-errno.php) to check if an error occurred. ``` $result = mysql_query("update testDb SET username ='$DataVar' WHERE ID = '$IdVar'"); if...
8,119,423
I am saving the imae from drawing canvas. It takes some seconds to geting save to the sdcard. So, During the process of save i want to show the dialog that the Image getting save... So how to implement the progress dialog for that ? The code for Image save is as like below: ``` case R.id.saveBtn: Toast....
2011/11/14
[ "https://Stackoverflow.com/questions/8119423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/881635/" ]
Since you are using `AsyncTask` (`ExportBitmapToFile`) you can call `ProgressDialog` in `preExecute()` and dismiss it in `postExecute` method. There are no `Handler`s required to do this. **edit** ``` class ExportBitmapToFile extends AsyncTask<...> { private ProgressDialog m_progressDialog = null; .... ...
It looks like ExportBitmapToFile is an AsyncTask, in which case call `saveHandler.sendEmptyMessage(0);` in `onPreExecute()`. You could also call `savehandler.sendEmptyMessage(1)` in `onPostExecute()` and make the alertDialog a member variable (rather than local instance) of you activity and look at `msg.what` in your ...
8,119,423
I am saving the imae from drawing canvas. It takes some seconds to geting save to the sdcard. So, During the process of save i want to show the dialog that the Image getting save... So how to implement the progress dialog for that ? The code for Image save is as like below: ``` case R.id.saveBtn: Toast....
2011/11/14
[ "https://Stackoverflow.com/questions/8119423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/881635/" ]
Since you are using `AsyncTask` (`ExportBitmapToFile`) you can call `ProgressDialog` in `preExecute()` and dismiss it in `postExecute` method. There are no `Handler`s required to do this. **edit** ``` class ExportBitmapToFile extends AsyncTask<...> { private ProgressDialog m_progressDialog = null; .... ...
You should use onPreExecute and onPostExecute in your ExportBitmapToFile AsyncTask Class so you should add something like that to that class. ``` @Override protected void onPostExecute(Void result) { // TODO Auto-generated method stub if (progressDialog.isShowing()) { progressDialog...
4,188,617
I want to develop facebook applications and I have bought some books from amazon. But this books contents are for old facebook APIs. (2008-2009). Can I develop applications with old api? Or I have to use new version?
2010/11/15
[ "https://Stackoverflow.com/questions/4188617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/361635/" ]
You can still use the old api's, but as you can probably imagine it is discouraged. Read more in the [facebook developer documentation](http://developers.facebook.com/docs/). **EDIT** Given your name, I assume that you know a bit of php. To get started just go to <http://www.facebook.com/developers> and create a new a...
I would definitely not start a new app with the old APIs. Facebook has deprecated many of the old APIs and is in the process of deprecating the rest of them. Additionally, the authentication system changed completely about 6 months ago. Sorry for the bad news but books on Facebook that are more than about 3-6 months ol...
31,841
I'm trying to mount Luxos IQ2 onto the fork crown. There isn't quite enough space between the back of the light and front brake cable and I was wondering if I could add a spacer between IQ2 metal bracket and the fork crown. Or would it weaken the stability of the mount? ![Luxos IQ2](https://i.stack.imgur.com/buPlP.jp...
2015/07/09
[ "https://bicycles.stackexchange.com/questions/31841", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/20389/" ]
There is not that much load on the light - just add spacers or bend the mount as @super proposed, you'll be fine.
The only problem that you might run into with a spacer is that you'd loose the fit on the curve of the fork, so the light might be little more likely to flop to the side. I would think that a rubber or leather washer would handle that. You don't need anything as fancy as a purpose built part. Your local hardware store...
22,806,607
I use tortoise svn. But I'm fairly new to svn in general. I have some experience with git though. In the docu it says > > Reintegrate a branch > > > This method covers the case when you have made > a feature branch as discussed in the Subversion book. > All trunk changes have been ported to the feature > bran...
2014/04/02
[ "https://Stackoverflow.com/questions/22806607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3119817/" ]
First a quick lesson on how merging works and works for almost all version control systems. The standard Merge is a *three way merge*. In this, you're comparing the two versions with the *last common ancestor* of the two versions. For example, I branch from trunk. The version on the trunk before the branch is the *las...
1. More or less 2. The point of frequent merges from trunk to your feature branch is that it's **piece-meal**: small and manageable. When conflicts arise, they can be fixed with changes fresh in your mind. Nothing "bad" will happen if you don't merge changes from trunk to feature branch before reintegrating. Just that ...
56,298,812
I am trying to implement Photo Sphere Viewer on my React Component, i already did it with Google Maps API and it worked fine, but i'm using the same technique, no results. If is there any other option to implement 360 Photo Viewer on React (Already used Pannellum, didn't like it, didn't worked) i'm open to suggestions....
2019/05/24
[ "https://Stackoverflow.com/questions/56298812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10997255/" ]
React 16.8 version with `useEffect` hook: ``` import React, { useEffect } from 'react'; import PhotoSphereViewer from 'photo-sphere-viewer'; export default function Photo(props) { const sphereElementRef = React.createRef(); const { src } = props; useEffect(() => { const shperePlayerInstance = PhotoSphereVi...
I had similar problem and this is how I solve it: ``` npm install --save photo-sphere-viewer ``` and component look like this: ``` import React, { Component } from 'react' import * as Sphere from "photo-sphere-viewer"; import "photo-sphere-viewer/dist/photo-sphere-viewer.min.css" export default class SphereCompone...
65,725,539
(I couldn't figure out how to upload my screen capture to stackoverflow. So this is a streamable link: <https://streamable.com/0im8tx>) In this video, VSCode opens QueriesController.class as opposed to QueriesController.java when I cmd click into `QueriesController`. I have compiled provided the definitions of the ja...
2021/01/14
[ "https://Stackoverflow.com/questions/65725539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1641300/" ]
would something like this work for you? ```js const {LinearProgress, makeStyles} = MaterialUI const useStyles = makeStyles({ root: { height: 10, borderRadius: 5 }, bar: ({ progress }) => ({ borderRadius: 5, background: `linear-gradient(90deg, #6fcbb6 ${100 - progress}%, #9c64f4 100%)` }) }); ...
You can stagger it like this: ```js const {LinearProgress, makeStyles} = MaterialUI const useStyles = makeStyles({ root: { height: 5, borderRadius: 5 }, bar: ({ props }) => ({ borderRadius: 5, backgroundImage: `linear-gradient(90deg, rgba(74,211,255,1) 30% ${props.value > 60 ? `,rgba(158,220,190,1) 60%` : ""} ...
65,725,539
(I couldn't figure out how to upload my screen capture to stackoverflow. So this is a streamable link: <https://streamable.com/0im8tx>) In this video, VSCode opens QueriesController.class as opposed to QueriesController.java when I cmd click into `QueriesController`. I have compiled provided the definitions of the ja...
2021/01/14
[ "https://Stackoverflow.com/questions/65725539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1641300/" ]
would something like this work for you? ```js const {LinearProgress, makeStyles} = MaterialUI const useStyles = makeStyles({ root: { height: 10, borderRadius: 5 }, bar: ({ progress }) => ({ borderRadius: 5, background: `linear-gradient(90deg, #6fcbb6 ${100 - progress}%, #9c64f4 100%)` }) }); ...
Slightly easier way to color the progress bar: ```js <LinearProgress variant="determinate" value={progressVal} sx={{ background: 'linear-gradient(to right, #6fcbb6, #9c64f4)' '> span': { backgroundColor: 'red' }, }} /> ```
65,725,539
(I couldn't figure out how to upload my screen capture to stackoverflow. So this is a streamable link: <https://streamable.com/0im8tx>) In this video, VSCode opens QueriesController.class as opposed to QueriesController.java when I cmd click into `QueriesController`. I have compiled provided the definitions of the ja...
2021/01/14
[ "https://Stackoverflow.com/questions/65725539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1641300/" ]
You can stagger it like this: ```js const {LinearProgress, makeStyles} = MaterialUI const useStyles = makeStyles({ root: { height: 5, borderRadius: 5 }, bar: ({ props }) => ({ borderRadius: 5, backgroundImage: `linear-gradient(90deg, rgba(74,211,255,1) 30% ${props.value > 60 ? `,rgba(158,220,190,1) 60%` : ""} ...
Slightly easier way to color the progress bar: ```js <LinearProgress variant="determinate" value={progressVal} sx={{ background: 'linear-gradient(to right, #6fcbb6, #9c64f4)' '> span': { backgroundColor: 'red' }, }} /> ```
12,617,188
Let’s suppose we’ve got two php files, a.php and b.php Here’s content of file a.php: ``` <?php // content of a.php class A { } ``` And here’s the content of file b.php ``` <?php // content of b.php include dirname(__FILE__) . "/a.php"; echo "A: ", class_exists("A") ? "exists" : "doesn’t exist", "\n"; echo "B: ", c...
2012/09/27
[ "https://Stackoverflow.com/questions/12617188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1621862/" ]
Disclaimer: I don't claim to understand the inner workings of Zend. The following is my interpretation of the PHP source, fueled in great part by educated guesses. Even though I am fully confident in the conclusion, the terminology or details might be off. I 'd love to hear from anyone with experience in Zend internals...
This simply as to do with PHP handle class in included files `include dirname(__FILE__) . "/a.php";` `BB` exists because it extends `B` which was define in the same file. `BA` does not exist because PHP did not parse `A` online it is called Both would work return the same result Using `class BA extends B` ``` in...
10,025,344
I would like to make something like *tryruby.org*. I take a line from the user (e.g., `echo __FILE__`) and I want to execute it in PHP and return the output back to the client. I tried to do `exec('php -r ' . $command, $output)`, but `$output` always contains the PHP help section. How can I implement this feature?
2012/04/05
[ "https://Stackoverflow.com/questions/10025344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/411685/" ]
To make `php -r` you have to have to put the code you want to execute between `'` .. your code .. `'` Example: ``` php -r ' $var = 34; print_r($var); ' ```
Look up 'eval()' and more importantly, why eval() and what you're trying to do is very difficult to achieve in a secure manner. Imaging for example the user who inputs: ``` echo file_get_contents('/etc/passwd'); ``` You'll need quite a bit of work to make this secure, including watching and filtering all system call...
10,025,344
I would like to make something like *tryruby.org*. I take a line from the user (e.g., `echo __FILE__`) and I want to execute it in PHP and return the output back to the client. I tried to do `exec('php -r ' . $command, $output)`, but `$output` always contains the PHP help section. How can I implement this feature?
2012/04/05
[ "https://Stackoverflow.com/questions/10025344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/411685/" ]
<http://tryruby.org> seems have an interactive Ruby shell. That seems to be a good starting point. Here are two projects that provide such a shell for PHP: [php\_repl](https://github.com/ieure/php_repl) and [phpsh](http://www.phpsh.org/). The other part is the web interface for the interactive shell. For that part, I...
Look up 'eval()' and more importantly, why eval() and what you're trying to do is very difficult to achieve in a secure manner. Imaging for example the user who inputs: ``` echo file_get_contents('/etc/passwd'); ``` You'll need quite a bit of work to make this secure, including watching and filtering all system call...
10,025,344
I would like to make something like *tryruby.org*. I take a line from the user (e.g., `echo __FILE__`) and I want to execute it in PHP and return the output back to the client. I tried to do `exec('php -r ' . $command, $output)`, but `$output` always contains the PHP help section. How can I implement this feature?
2012/04/05
[ "https://Stackoverflow.com/questions/10025344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/411685/" ]
It looks like your problem is that you aren't wrapping your code to be executed with `' '`. You also need to be wary of `'` in the code, special characters, escape sequences, etc. In fact, if you insist on using `exec()`, it might be better to do this (to completely avoid having to worry about escaping and the such): ...
Look up 'eval()' and more importantly, why eval() and what you're trying to do is very difficult to achieve in a secure manner. Imaging for example the user who inputs: ``` echo file_get_contents('/etc/passwd'); ``` You'll need quite a bit of work to make this secure, including watching and filtering all system call...
10,025,344
I would like to make something like *tryruby.org*. I take a line from the user (e.g., `echo __FILE__`) and I want to execute it in PHP and return the output back to the client. I tried to do `exec('php -r ' . $command, $output)`, but `$output` always contains the PHP help section. How can I implement this feature?
2012/04/05
[ "https://Stackoverflow.com/questions/10025344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/411685/" ]
To make `php -r` you have to have to put the code you want to execute between `'` .. your code .. `'` Example: ``` php -r ' $var = 34; print_r($var); ' ```
<http://tryruby.org> seems have an interactive Ruby shell. That seems to be a good starting point. Here are two projects that provide such a shell for PHP: [php\_repl](https://github.com/ieure/php_repl) and [phpsh](http://www.phpsh.org/). The other part is the web interface for the interactive shell. For that part, I...
10,025,344
I would like to make something like *tryruby.org*. I take a line from the user (e.g., `echo __FILE__`) and I want to execute it in PHP and return the output back to the client. I tried to do `exec('php -r ' . $command, $output)`, but `$output` always contains the PHP help section. How can I implement this feature?
2012/04/05
[ "https://Stackoverflow.com/questions/10025344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/411685/" ]
To make `php -r` you have to have to put the code you want to execute between `'` .. your code .. `'` Example: ``` php -r ' $var = 34; print_r($var); ' ```
It looks like your problem is that you aren't wrapping your code to be executed with `' '`. You also need to be wary of `'` in the code, special characters, escape sequences, etc. In fact, if you insist on using `exec()`, it might be better to do this (to completely avoid having to worry about escaping and the such): ...
10,025,344
I would like to make something like *tryruby.org*. I take a line from the user (e.g., `echo __FILE__`) and I want to execute it in PHP and return the output back to the client. I tried to do `exec('php -r ' . $command, $output)`, but `$output` always contains the PHP help section. How can I implement this feature?
2012/04/05
[ "https://Stackoverflow.com/questions/10025344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/411685/" ]
It looks like your problem is that you aren't wrapping your code to be executed with `' '`. You also need to be wary of `'` in the code, special characters, escape sequences, etc. In fact, if you insist on using `exec()`, it might be better to do this (to completely avoid having to worry about escaping and the such): ...
<http://tryruby.org> seems have an interactive Ruby shell. That seems to be a good starting point. Here are two projects that provide such a shell for PHP: [php\_repl](https://github.com/ieure/php_repl) and [phpsh](http://www.phpsh.org/). The other part is the web interface for the interactive shell. For that part, I...
52,682,873
I have do a custom page with a planning of the actual week, and the week is defined by the today's day. I need to put link for previous and next week, and i want to make a link to reopen my page with today'day + 7 (for next) or -7 (for previous). This is the function for defined days of the week with the today's day ...
2018/10/06
[ "https://Stackoverflow.com/questions/52682873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5446505/" ]
I have something similar on my page, I have created different variables with dates and then just use them whenever I need to... So create: ``` <?php $todayMinus7 = Date('y-m-d', strtotime("-7 days")); //set variable to last week (-7 days) $today = Date('y-m-d'); //set variable to today $to...
So i have do this and it's work great : ``` <?php date_default_timezone_set('Europe/Paris'); if (!empty($_GET['today'])) { $today = $_GET['today']; } else { $today = Date('Y-m-d'); } $todayMinus7 = Date('Y-m-d', strtotime("-7 days", strtotime($today))); $todayPlus7 = Date('Y-m-d', strtotime("+7 days", str...
53,376,725
Say I'm using this piece of code ``` With TextBox .Size = New Windows.Size(InsideRadius) End With ``` I want to choose within the function call which size to use dependent on which is the biggest, If Inside Radius is the biggest then choose that, but if a number such as say 20 is bigger then pick that, all within th...
2018/11/19
[ "https://Stackoverflow.com/questions/53376725", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10513485/" ]
Your attempt probably does not work because of floating point rounding errors. You can read more about it [here](https://fr.mathworks.com/matlabcentral/answers/57444-faq-why-is-0-3-0-2-0-1-not-equal-to-zero). You could look into the the [eps function](https://fr.mathworks.com/help/matlab/ref/eps.html), or just use this...
Try the following: ``` mat = randi(30,50943,3); vec = [1,2,3]; % R2106b+ code ind = find(all(mat==vec,2)); % or: explicit expansion, works with all versions ind = find(all(bsxfun(@eq,mat,vec),2)); ``` What it does: `==` or `eq` will check if coordinates are equal (gives a [50943x3] bool matrix) `all` will return tru...
81,877
My Schengen Visa expires on 10th January 2017. It is an 80 days visa for family visit purpose. Now my return journey from Dusseldorf to Mumbai is via Zurich. I am departing Dusseldorf on 10th January 2017 at 20:30 Hrs (CET). Reaching Zurich on 21:30 Hrs (CET). My flight for Mumbai from Zurich is the next day (11th Janu...
2016/11/02
[ "https://travel.stackexchange.com/questions/81877", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/53282/" ]
As correctly pointed out by @pnuts, yes it is a problem. I see two ways out: 1. Contact the consulate (or the place that issued your visa) and ask for a correction of the dates on your visa. If you handed in the itinerary with your application they could/should have noticed that. 2. ZRH has an airside transit hotel...
> > Doesn't it look like I am overstaying my visa period? > > > Yes. > > But is it really a problem as I am returning back to the country I am a passport holder of (India)? > > > Yes.
81,877
My Schengen Visa expires on 10th January 2017. It is an 80 days visa for family visit purpose. Now my return journey from Dusseldorf to Mumbai is via Zurich. I am departing Dusseldorf on 10th January 2017 at 20:30 Hrs (CET). Reaching Zurich on 21:30 Hrs (CET). My flight for Mumbai from Zurich is the next day (11th Janu...
2016/11/02
[ "https://travel.stackexchange.com/questions/81877", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/53282/" ]
As correctly pointed out by @pnuts, yes it is a problem. I see two ways out: 1. Contact the consulate (or the place that issued your visa) and ask for a correction of the dates on your visa. If you handed in the itinerary with your application they could/should have noticed that. 2. ZRH has an airside transit hotel...
> > Yes, you are overstaying your Schengen visa for 1 day. > > > Although you are finishing your Schengen stay in Dusseldorf , but you exit from Zurich next day (11 January 2017) which is actually your last stop in Schengen Zone. There could be serious consequences for your next Schengen visa , also you are stayi...
36,990,761
Since I started structuring my JavaScript as a [module pattern](https://css-tricks.com/how-do-you-structure-javascript-the-module-pattern-edition/), some of my click events no longer work. Since other parts of my JavaScript add HTML to the DOM, I need to use `$('body').on('click')` for a button. This is what my module...
2016/05/02
[ "https://Stackoverflow.com/questions/36990761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1329116/" ]
The second argument for your handler when the event is delegated is expected to be a **string**. In your case it is a **jQuery Object**. That is the root cause your click event is not working. Change ``` barButton: $(".bar-button") ``` to ``` barButton: ".bar-button" ```
If you're creating the element in JS, you have to bind the event AFTER the element is created. So put the binding event in a function, then call that function after your JS code has created the element. :)
36,990,761
Since I started structuring my JavaScript as a [module pattern](https://css-tricks.com/how-do-you-structure-javascript-the-module-pattern-edition/), some of my click events no longer work. Since other parts of my JavaScript add HTML to the DOM, I need to use `$('body').on('click')` for a button. This is what my module...
2016/05/02
[ "https://Stackoverflow.com/questions/36990761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1329116/" ]
The second argument for your handler when the event is delegated is expected to be a **string**. In your case it is a **jQuery Object**. That is the root cause your click event is not working. Change ``` barButton: $(".bar-button") ``` to ``` barButton: ".bar-button" ```
When using `.on()` for event delegation, the second parameter *has to be a string*. Passing anything else won't work. <http://api.jquery.com/on/#on-events-selector-data>
56,706,492
First question, can Windows 10 support multiple websites under IIS 10? If that is yes, the how? We need them to be on the same port, 80, and to have SSO. We have tried setting the bindings to give each web site a hostname Any IP Address and port 80. Each has its own App Pool. Do we need to get corporate IT involved t...
2019/06/21
[ "https://Stackoverflow.com/questions/56706492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3143269/" ]
Firstly you need to remove any `id` attributes you create in your HTML within the loop in your PHP, as this will create duplicates which is invalid. Instead change them to classes. Secondly, attach your events using unobtrusive event handlers, not inline ones as they are outdated and bad practice. As you're using jQue...
If you are using ajax then (making it as simple as possible). Add your loading gif image to html and make it hidden (using style in html itself now, you can add it to separate CSS):- ``` <img src="path\to\loading\gif" id="img" style="display:none"/ > ``` Show the image when button is clicked and hide it again on su...
34,031
After coming from cygwin, I'm quite confused about the bash (version 4.1.5) globbing on my Ubuntu 10.4. I'd love one of the following two possibilities: * ignore `.` and `..`, match everything else * ignore filenames starting with a dot unless given explicitly The current behavior is plain strange: ``` cd; ls .* ``...
2012/03/12
[ "https://unix.stackexchange.com/questions/34031", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/5116/" ]
The "ls: cannot access .\*: No such file or directory" error sounds like there are permissions problems with the current directory. I can reproduce it with: ``` $ mkdir -p ~/tmp/tmp $ cd ~/tmp/tmp $ ls .* .: ..: tmp $ chmod u-r . $ ls .* ls: cannot access .*: No such file or directory $ ls -ldn . d-wxr-xr-x 2 1000 10...
It is more than likely that you have no files being matched by the globs. If no files are matched, `bash` by default interprets `*` literally. You may wish to set `nullglob` using `shopt -s nullglob` to avoid this (although this will leave the command barren of arguments altogether if no files are matched).
34,031
After coming from cygwin, I'm quite confused about the bash (version 4.1.5) globbing on my Ubuntu 10.4. I'd love one of the following two possibilities: * ignore `.` and `..`, match everything else * ignore filenames starting with a dot unless given explicitly The current behavior is plain strange: ``` cd; ls .* ``...
2012/03/12
[ "https://unix.stackexchange.com/questions/34031", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/5116/" ]
Unfortunately, I must answer my own question. It was `GLOBIGNORE`. From the man page: *A colon-separated list of patterns defining the set of filenames to be ignored by pathname expansion. If a filename matched by a pathname expansion pattern also matches one of the patterns in GLOBIGNORE, it is removed from the list ...
It is more than likely that you have no files being matched by the globs. If no files are matched, `bash` by default interprets `*` literally. You may wish to set `nullglob` using `shopt -s nullglob` to avoid this (although this will leave the command barren of arguments altogether if no files are matched).
34,031
After coming from cygwin, I'm quite confused about the bash (version 4.1.5) globbing on my Ubuntu 10.4. I'd love one of the following two possibilities: * ignore `.` and `..`, match everything else * ignore filenames starting with a dot unless given explicitly The current behavior is plain strange: ``` cd; ls .* ``...
2012/03/12
[ "https://unix.stackexchange.com/questions/34031", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/5116/" ]
Unfortunately, I must answer my own question. It was `GLOBIGNORE`. From the man page: *A colon-separated list of patterns defining the set of filenames to be ignored by pathname expansion. If a filename matched by a pathname expansion pattern also matches one of the patterns in GLOBIGNORE, it is removed from the list ...
The "ls: cannot access .\*: No such file or directory" error sounds like there are permissions problems with the current directory. I can reproduce it with: ``` $ mkdir -p ~/tmp/tmp $ cd ~/tmp/tmp $ ls .* .: ..: tmp $ chmod u-r . $ ls .* ls: cannot access .*: No such file or directory $ ls -ldn . d-wxr-xr-x 2 1000 10...
51,190,844
i have simple `Edittext` and when I'm going to change input letters in im setting listener `new textWatcher` and it's `onTextChanged()` method like: ``` @Override public void onTextChanged(CharSequence s, int start, int before, int count) { Log.d("qwer", "onTextChanged: " + s + " " + start + " " + ...
2018/07/05
[ "https://Stackoverflow.com/questions/51190844", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6123917/" ]
I will suggest a few things, let me know which one works for you. 1.As you are exposing port number 5000 (for the front-end and backend), then you should be simply able to communicate using IP address. * <http://ip_address_of_host_machine:5000> 2.If you decided not to expose port number as security risk then in the ...
You need to [EXPOSE](https://docs.docker.com/v17.09/engine/reference/builder/#expose) the port on the module. This will tell it to listen from within Docker (port is from outside, e.g. from your browser) ``` module: build: . expose: - "5000" ...etc ```
58,581,887
I'm displaying an image, `<img [src]="anImage">`, after converting it, and some time I'm getting this error message, **but not always**. [![enter image description here](https://i.stack.imgur.com/frvcq.png)](https://i.stack.imgur.com/frvcq.png) I think it's because the process to convert the image takes time. I have ...
2019/10/27
[ "https://Stackoverflow.com/questions/58581887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11244704/" ]
The error lies within the `destination URL` as specified by the error message. > > I run this code in GCP Shell Environment > > > Remember that you are running the command from the **Cloud Shell** and not in a local terminal or Windows Command Line. Thus, it is throwing that error because it cannot find the path...
Your destination path is invalid: ``` ./C:\Users\Myname\Desktop\Bucket ``` Change to: ``` /Users/Myname/Desktop/Bucket ``` `C:` is a reserved device name. You cannot specify reserved device names in a relative path. `./C:` is not valid.
58,581,887
I'm displaying an image, `<img [src]="anImage">`, after converting it, and some time I'm getting this error message, **but not always**. [![enter image description here](https://i.stack.imgur.com/frvcq.png)](https://i.stack.imgur.com/frvcq.png) I think it's because the process to convert the image takes time. I have ...
2019/10/27
[ "https://Stackoverflow.com/questions/58581887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11244704/" ]
To download an entire bucket You must [install google cloud SDK](https://cloud.google.com/sdk/docs/downloads-interactive#windows) then run this command `gsutil -m cp -R gs://project-bucket-name path/to/local` where `path/to/local` is your path of local storage of your machine
Your destination path is invalid: ``` ./C:\Users\Myname\Desktop\Bucket ``` Change to: ``` /Users/Myname/Desktop/Bucket ``` `C:` is a reserved device name. You cannot specify reserved device names in a relative path. `./C:` is not valid.
58,581,887
I'm displaying an image, `<img [src]="anImage">`, after converting it, and some time I'm getting this error message, **but not always**. [![enter image description here](https://i.stack.imgur.com/frvcq.png)](https://i.stack.imgur.com/frvcq.png) I think it's because the process to convert the image takes time. I have ...
2019/10/27
[ "https://Stackoverflow.com/questions/58581887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11244704/" ]
The error lies within the `destination URL` as specified by the error message. > > I run this code in GCP Shell Environment > > > Remember that you are running the command from the **Cloud Shell** and not in a local terminal or Windows Command Line. Thus, it is throwing that error because it cannot find the path...
There is not a one-button solution for downloading a full bucket to your local machine through the Cloud Shell. The best option for an environment like yours (only using the Cloud Shell interface, without `gcloud` installed on your local system), is to follow a series of steps: * Downloading the whole bucket on the C...
58,581,887
I'm displaying an image, `<img [src]="anImage">`, after converting it, and some time I'm getting this error message, **but not always**. [![enter image description here](https://i.stack.imgur.com/frvcq.png)](https://i.stack.imgur.com/frvcq.png) I think it's because the process to convert the image takes time. I have ...
2019/10/27
[ "https://Stackoverflow.com/questions/58581887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11244704/" ]
To download an entire bucket You must [install google cloud SDK](https://cloud.google.com/sdk/docs/downloads-interactive#windows) then run this command `gsutil -m cp -R gs://project-bucket-name path/to/local` where `path/to/local` is your path of local storage of your machine
The error lies within the `destination URL` as specified by the error message. > > I run this code in GCP Shell Environment > > > Remember that you are running the command from the **Cloud Shell** and not in a local terminal or Windows Command Line. Thus, it is throwing that error because it cannot find the path...
58,581,887
I'm displaying an image, `<img [src]="anImage">`, after converting it, and some time I'm getting this error message, **but not always**. [![enter image description here](https://i.stack.imgur.com/frvcq.png)](https://i.stack.imgur.com/frvcq.png) I think it's because the process to convert the image takes time. I have ...
2019/10/27
[ "https://Stackoverflow.com/questions/58581887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11244704/" ]
To download an entire bucket You must [install google cloud SDK](https://cloud.google.com/sdk/docs/downloads-interactive#windows) then run this command `gsutil -m cp -R gs://project-bucket-name path/to/local` where `path/to/local` is your path of local storage of your machine
There is not a one-button solution for downloading a full bucket to your local machine through the Cloud Shell. The best option for an environment like yours (only using the Cloud Shell interface, without `gcloud` installed on your local system), is to follow a series of steps: * Downloading the whole bucket on the C...
2,839,533
For a computer vision program, I have values **between $0$ and $255$** that need to follow a **cubic function ($y=x^3$) behavior** so that : * $f(255) = 255$ * $f(\frac{255}{2}) = 128$ * $f(0) = 0$ But I don't know how to find its equation. Thank you for your help.
2018/07/03
[ "https://math.stackexchange.com/questions/2839533", "https://math.stackexchange.com", "https://math.stackexchange.com/users/573797/" ]
A natural parameterIn addition to your own answer: a natural 4th condition is to fix the slope in the middle (that's the only thing you are allowing to change). This makes sense, because it defines the contrast of the nonlinear mapping. Using it this way, you can get through analytically. Let's stretch everything to t...
Thanks to @lulu, I've found a good solution to my problem. Using [Wolfram Alpha](https://www.wolframalpha.com) First, here is what I was expecting as the result function : ![Original schema](https://i.stack.imgur.com/4h95q.png) But to determine a cubic function equation, you need a 4th parameter. I did the hypothesis...
2,839,533
For a computer vision program, I have values **between $0$ and $255$** that need to follow a **cubic function ($y=x^3$) behavior** so that : * $f(255) = 255$ * $f(\frac{255}{2}) = 128$ * $f(0) = 0$ But I don't know how to find its equation. Thank you for your help.
2018/07/03
[ "https://math.stackexchange.com/questions/2839533", "https://math.stackexchange.com", "https://math.stackexchange.com/users/573797/" ]
A natural parameterIn addition to your own answer: a natural 4th condition is to fix the slope in the middle (that's the only thing you are allowing to change). This makes sense, because it defines the contrast of the nonlinear mapping. Using it this way, you can get through analytically. Let's stretch everything to t...
Since $f(0)=0$, let us consider the cubic equation $$f(x)=a x+b x^2+c x^3$$ So $$f(255)=255 a+ (255)^2 b+(255)^3c$$ $$f\left(\frac{255}{2}\right)=a\left(\frac{255}{2}\right)+\left(\frac{255}{2}\right)^2b+\left(\frac{255}{2}\right)^3c$$ Solve for $a$ and $b$ to get $$a=\frac{65025 c}{2}+\frac{257}{255}\qquad \text{and}...
36,873,780
I'm working on putting a Parse Server on Heroku. I'm using this app: <https://github.com/ParsePlatform/parse-server-example> Uploading to heroku using this guide: <https://devcenter.heroku.com/articles/getting-started-with-nodejs> I've updated the db and server URLs in the parse server code, and everything uploads ...
2016/04/26
[ "https://Stackoverflow.com/questions/36873780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3307720/" ]
1) In most cases `std::vector` is faster than `std::list` due to processor's cache usage. 2) Sort both arrays. Insert the new element in the correct position to keep the sorted order. 3) Use binary search to check the presence of an element from vector2 in the vector1. The complexity should be `M * log(N)`, where N...
In the following program the copy and move constructors and assignment operators are deleted to ensure we don't copy or move the large objects. Sorting is only done on the pointers once per frame and should require minimal time. ``` #include <iostream> #include <vector> #include <set> #include <algorithm> #include <it...
32,479,606
How do I change the border color of a WPF combo box, I've tried everything but it remains the same. [![ComboBox with default border](https://i.stack.imgur.com/8cXDd.png)](https://i.stack.imgur.com/8cXDd.png) My Mark up: ``` <ComboBox Canvas.Left="12" Canvas.Top="44" Height="32"Name="cmbDeviceList" Width="158" Foregr...
2015/09/09
[ "https://Stackoverflow.com/questions/32479606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3388058/" ]
Set the property `BorderBrush` to the desired color or brush: ``` <ComboBox Margin="10" BorderBrush="Red"> <ComboBoxItem>No Device Selected</ComboBoxItem> </ComboBox> ``` Screenshot: [![Screenshot of combo box with red border](https://i.stack.imgur.com/bPLWu.png)](https://i.stack.imgur.com/bPLWu.png)
The below XAML snippet is for combobox. The BorderBrush will define the color and Border Thickness will define the thickness of line ``` <ComboBox Width="200" Height="30" BorderBrush="Blue" BorderThickness="3"></ComboBox> ```
66,034,014
```py package = input("Enter a package designation A,B, C: ") while package != 'a' or package != 'A' or package != 'b' or package != 'B' or package != 'c' or package != 'C': print("Erorr:you didn't enter a valid package") package = input("Enter a package designation A,B, C: ") ``` Every time I input the lett...
2021/02/03
[ "https://Stackoverflow.com/questions/66034014", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15139934/" ]
Well there a pretty good reason for this. Let me explain this below so I can make it easy for you.(I hope) Every time you are giving a letter the condition will be True. But why is that? **Let's debug this together:** `package = input("Enter a package designation A,B, C: ")` We are giving for an example the letter ...
The condition is always `True` due to the `or`s. Putting all the conditions into one simple conditional statement solves this. ``` package = str(input("Enter a package designation A,B, C: ")) while package.lower() not in ['a','b','c']: print("Erorr:you didn't enter a valid package") package = str(input("Enter ...
13,405,806
I have a parser, and after gathering the data for a row, I want to fire an aync function and let it process the row, while the main thread continues on and gets the next row. I've seen this post: [How do I execute two tasks simultaneously and wait for the results in Groovy?](https://stackoverflow.com/questions/1152952...
2012/11/15
[ "https://Stackoverflow.com/questions/13405806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1373467/" ]
1. Call to allPromises\*.get() will throw InterruptedException if the waiting (main) thread gets interrupted 2. Yes, the promises have been created anyway, so grouping them in a list should not impose additional memory requirements, in my opinion. 3. The suggested solutions with a CountDownLanch or a Phaser are IMO muc...
An alternative to an `AtomicInteger` is to use a [`CountDownLatch`](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/CountDownLatch.html). It avoids both the `sleep` and the large collection of `Promise` objects. You could use it like this: ``` latch = new CountDownLatch(sheet.rowsRead) ... def promise = ...
7,723,514
I have a webform and an input if you put in Latté and `POST` it using JSON... ``` $.ajax({ type: "POST", url: "http://"+document.domain+"/includes/rpc.php", data: {method:"add_item",item:item}, dataType: "json", timeout: 10000, success:...... ``` `item` will be the value `Latté` Latté is ...
2011/10/11
[ "https://Stackoverflow.com/questions/7723514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/505055/" ]
It could be MySQL's collation. It could also be HTTP encoding. Or you could be using string functions in PHP which are not multi-byte-safe. This kind of error can happen at many points through your tool chain.
Either the database collation is wrong or the DBAL you are using (PDO?).
7,723,514
I have a webform and an input if you put in Latté and `POST` it using JSON... ``` $.ajax({ type: "POST", url: "http://"+document.domain+"/includes/rpc.php", data: {method:"add_item",item:item}, dataType: "json", timeout: 10000, success:...... ``` `item` will be the value `Latté` Latté is ...
2011/10/11
[ "https://Stackoverflow.com/questions/7723514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/505055/" ]
To be precise, the collation is the way in which the strings are compared and sorted. It has a relationship with the character set, but **your problem is an character set problem**, not a collation problem. > > [A character set is a set of symbols and encodings. A collation is a set of rules for comparing characters...
Either the database collation is wrong or the DBAL you are using (PDO?).
7,723,514
I have a webform and an input if you put in Latté and `POST` it using JSON... ``` $.ajax({ type: "POST", url: "http://"+document.domain+"/includes/rpc.php", data: {method:"add_item",item:item}, dataType: "json", timeout: 10000, success:...... ``` `item` will be the value `Latté` Latté is ...
2011/10/11
[ "https://Stackoverflow.com/questions/7723514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/505055/" ]
It could be MySQL's collation. It could also be HTTP encoding. Or you could be using string functions in PHP which are not multi-byte-safe. This kind of error can happen at many points through your tool chain.
Use utf8\_encode() around your fetched values in your PHP backend before you output it
7,723,514
I have a webform and an input if you put in Latté and `POST` it using JSON... ``` $.ajax({ type: "POST", url: "http://"+document.domain+"/includes/rpc.php", data: {method:"add_item",item:item}, dataType: "json", timeout: 10000, success:...... ``` `item` will be the value `Latté` Latté is ...
2011/10/11
[ "https://Stackoverflow.com/questions/7723514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/505055/" ]
To be precise, the collation is the way in which the strings are compared and sorted. It has a relationship with the character set, but **your problem is an character set problem**, not a collation problem. > > [A character set is a set of symbols and encodings. A collation is a set of rules for comparing characters...
It could be MySQL's collation. It could also be HTTP encoding. Or you could be using string functions in PHP which are not multi-byte-safe. This kind of error can happen at many points through your tool chain.
7,723,514
I have a webform and an input if you put in Latté and `POST` it using JSON... ``` $.ajax({ type: "POST", url: "http://"+document.domain+"/includes/rpc.php", data: {method:"add_item",item:item}, dataType: "json", timeout: 10000, success:...... ``` `item` will be the value `Latté` Latté is ...
2011/10/11
[ "https://Stackoverflow.com/questions/7723514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/505055/" ]
To be precise, the collation is the way in which the strings are compared and sorted. It has a relationship with the character set, but **your problem is an character set problem**, not a collation problem. > > [A character set is a set of symbols and encodings. A collation is a set of rules for comparing characters...
Use utf8\_encode() around your fetched values in your PHP backend before you output it
60,767,722
Let's say I want to visualize how my hypothetical students are doing with respect to their majors. I have 32 students in my class Data Frames 101. What I'm interested in doing is plotting the percent of students per major per grade decile. Here's my sample data frame. ``` # Grade Decile grade <- c(90, 90, 90, 80, 80,...
2020/03/20
[ "https://Stackoverflow.com/questions/60767722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9143280/" ]
Remove folder with module name from modules folder - you already have folder with this name there.
module class name must be the same as the module name, like: ``` class myNextModule extends Module{ public function __construct(){ $this->name = 'myNextModule'; ... ``` If not, this throws 'Module is not a valid module name' error during installation. Had the same problem, after correction installation finished...
60,767,722
Let's say I want to visualize how my hypothetical students are doing with respect to their majors. I have 32 students in my class Data Frames 101. What I'm interested in doing is plotting the percent of students per major per grade decile. Here's my sample data frame. ``` # Grade Decile grade <- c(90, 90, 90, 80, 80,...
2020/03/20
[ "https://Stackoverflow.com/questions/60767722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9143280/" ]
It is also possible that your module is in development mode and you have the buggy sql query in sql/install.php or sql/uninstall.php in your module folder. This happened in my case.
module class name must be the same as the module name, like: ``` class myNextModule extends Module{ public function __construct(){ $this->name = 'myNextModule'; ... ``` If not, this throws 'Module is not a valid module name' error during installation. Had the same problem, after correction installation finished...
60,767,722
Let's say I want to visualize how my hypothetical students are doing with respect to their majors. I have 32 students in my class Data Frames 101. What I'm interested in doing is plotting the percent of students per major per grade decile. Here's my sample data frame. ``` # Grade Decile grade <- c(90, 90, 90, 80, 80,...
2020/03/20
[ "https://Stackoverflow.com/questions/60767722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9143280/" ]
Remove folder with module name from modules folder - you already have folder with this name there.
Try [disable debug mode](https://www.prestashop.com/forums/topic/575132-how-to-enable-debug-mode-on-prestashop-17-and-older-versions-turn-on-error-reporting-blank-page/). It's working in my case: ```php if (!defined('_PS_MODE_DEV_')) { define('_PS_MODE_DEV_', false); } ```
60,767,722
Let's say I want to visualize how my hypothetical students are doing with respect to their majors. I have 32 students in my class Data Frames 101. What I'm interested in doing is plotting the percent of students per major per grade decile. Here's my sample data frame. ``` # Grade Decile grade <- c(90, 90, 90, 80, 80,...
2020/03/20
[ "https://Stackoverflow.com/questions/60767722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9143280/" ]
It is also possible that your module is in development mode and you have the buggy sql query in sql/install.php or sql/uninstall.php in your module folder. This happened in my case.
Try [disable debug mode](https://www.prestashop.com/forums/topic/575132-how-to-enable-debug-mode-on-prestashop-17-and-older-versions-turn-on-error-reporting-blank-page/). It's working in my case: ```php if (!defined('_PS_MODE_DEV_')) { define('_PS_MODE_DEV_', false); } ```
42,108,970
I have a SOAP response that I am trying to parse, however I seem to be getting an error. SOAP response: ``` <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <ValidateNewUserResponse xmlns="urn:websitea.com/v2"><ValidateNewUserResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Message...
2017/02/08
[ "https://Stackoverflow.com/questions/42108970", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7445927/" ]
Try the following, works fine for me. ``` $doc = new DOMDocument(); $doc->loadXML($strResponse); $result = $doc->getElementsByTagName('Status')->item(0)->nodeValue; echo $result; ```
Or you can use a WSDL to php generator so you don't have to parse the XML response nor generate the XML request as you'll always handle PHP objects. This is the case using the basic native PHP SoapClient class. You can also use a WSDL to php generator such as [PackageGenerator](https://github.com/WsdlToPhp/PackageGener...
42,108,970
I have a SOAP response that I am trying to parse, however I seem to be getting an error. SOAP response: ``` <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <ValidateNewUserResponse xmlns="urn:websitea.com/v2"><ValidateNewUserResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Message...
2017/02/08
[ "https://Stackoverflow.com/questions/42108970", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7445927/" ]
You will get the error if the XML string is corrupted or not properly escaped and you used double quotes. Testing your code, the following worked for me (using single quotes): ``` $strXml = '<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <ValidateNewUserResponse xmlns="urn:websitea.com/v2"><...
Or you can use a WSDL to php generator so you don't have to parse the XML response nor generate the XML request as you'll always handle PHP objects. This is the case using the basic native PHP SoapClient class. You can also use a WSDL to php generator such as [PackageGenerator](https://github.com/WsdlToPhp/PackageGener...
46,730,048
how sql query can be created for following I have two table fist table contain emp code and category like ``` paycode category 12345 manager 23456 manager 23654 manager 78965 AM 56987 AM 58966 AM ``` and second table contain paycode and leave type taken and date ``` Paycode leavetype da...
2017/10/13
[ "https://Stackoverflow.com/questions/46730048", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2863880/" ]
Will a [`Timer`](https://docs.julialang.org/en/stable/stdlib/base/#Base.Timer-Tuple%7BFunction,Real,Real%7D) work? This form of `Timer` calls your function in a [`Task`](https://docs.julialang.org/en/stable/stdlib/parallel/#Tasks-1) so you need to yield control from you main loop occasionally to allow the timer task to...
I noticed that a scheduling library for [Julia](https://julialang.org/) was missing so I wrote one <https://github.com/scls19fr/ExtensibleScheduler.jl> Here is a basic example using a blocking scheduler. ``` using ExtensibleScheduler function read_modbus(p1, p2, p3, p4) println("Read_modbus with $p1 $p2 $p3 $p4"...
602,032
I am trying to get a java gui to open a web page. So the gui runs some code that does things and then produces a html file. I then want this file to open in a web browser (preferrably Firefox) as soon as it is created. How would I go about doing that?
2009/03/02
[ "https://Stackoverflow.com/questions/602032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68888/" ]
If you're using Java 6 or above, see the [Desktop](http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html) API, in particular [browse](http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html#browse(java.net.URI)). Use it like this (not tested): ``` // using this in real life, you'd probably want to check that...
I've used [BrowserLauncher2](http://browserlaunch2.sourceforge.net/) with success. It'll invoke the default browser on all platforms tested. I use this for demoing software via JNLP. The software downloads, runs and drives the user's browser to information pages/feedback etc. JDK 1.4 and above, I believe.
602,032
I am trying to get a java gui to open a web page. So the gui runs some code that does things and then produces a html file. I then want this file to open in a web browser (preferrably Firefox) as soon as it is created. How would I go about doing that?
2009/03/02
[ "https://Stackoverflow.com/questions/602032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68888/" ]
If you're using Java 6 or above, see the [Desktop](http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html) API, in particular [browse](http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html#browse(java.net.URI)). Use it like this (not tested): ``` // using this in real life, you'd probably want to check that...
I know that all of these answers have basically answered the question, but here is a the code for a method that fails gracefully. Note that the string can be the location of an html file ``` /** * If possible this method opens the default browser to the specified web page. * If not it notifies the user of webpage's u...
602,032
I am trying to get a java gui to open a web page. So the gui runs some code that does things and then produces a html file. I then want this file to open in a web browser (preferrably Firefox) as soon as it is created. How would I go about doing that?
2009/03/02
[ "https://Stackoverflow.com/questions/602032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68888/" ]
Ya, But if you want to open the webpage in your default web browser by a java program then you can try using this code. ``` /// file OpenPageInDefaultBrowser.java public class OpenPageInDefaultBrowser { public static void main(String[] args) { try { //Set your page url in this string. For eg, I m us...
I've used [BrowserLauncher2](http://browserlaunch2.sourceforge.net/) with success. It'll invoke the default browser on all platforms tested. I use this for demoing software via JNLP. The software downloads, runs and drives the user's browser to information pages/feedback etc. JDK 1.4 and above, I believe.
602,032
I am trying to get a java gui to open a web page. So the gui runs some code that does things and then produces a html file. I then want this file to open in a web browser (preferrably Firefox) as soon as it is created. How would I go about doing that?
2009/03/02
[ "https://Stackoverflow.com/questions/602032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68888/" ]
I know that all of these answers have basically answered the question, but here is a the code for a method that fails gracefully. Note that the string can be the location of an html file ``` /** * If possible this method opens the default browser to the specified web page. * If not it notifies the user of webpage's u...
I've used [BrowserLauncher2](http://browserlaunch2.sourceforge.net/) with success. It'll invoke the default browser on all platforms tested. I use this for demoing software via JNLP. The software downloads, runs and drives the user's browser to information pages/feedback etc. JDK 1.4 and above, I believe.
602,032
I am trying to get a java gui to open a web page. So the gui runs some code that does things and then produces a html file. I then want this file to open in a web browser (preferrably Firefox) as soon as it is created. How would I go about doing that?
2009/03/02
[ "https://Stackoverflow.com/questions/602032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68888/" ]
Ya, But if you want to open the webpage in your default web browser by a java program then you can try using this code. ``` /// file OpenPageInDefaultBrowser.java public class OpenPageInDefaultBrowser { public static void main(String[] args) { try { //Set your page url in this string. For eg, I m us...
I know that all of these answers have basically answered the question, but here is a the code for a method that fails gracefully. Note that the string can be the location of an html file ``` /** * If possible this method opens the default browser to the specified web page. * If not it notifies the user of webpage's u...
30,418,324
I know you can pass an array by reference by doing: ``` void func(T (&arr)[4]) { std::cout<<sizeof(arr)/sizeof(arr[0]); } ``` and you can pass an array of function pointers like: ``` void func(void(**run)(int i)) { run[0](100); } void func(void(*run[4])(int i)) { run[0](100); } ``` But you can't use ...
2015/05/23
[ "https://Stackoverflow.com/questions/30418324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1462718/" ]
The syntax would (oddly) be: ```c++ void func(void (*(&run)[4])(int)) ``` The extra parenthesis is to disambiguate the declaration from an array of references - which is illegal in C++.
@0x499602D2's answer is correct, but you might be better off spending a couple of lines defining the types you need: ``` typedef void (*Func)(int i); typedef Func FuncArr[4]; void callFuncs(FuncArr& funcs) { ... } ``` IMHO, it's a little bit more readable.
33,706,147
I have two tables: ``` Table: products ----------------------------------------------------- | id | name | other fields... ----------------------------------------------------- | 20 | Intel i5 4690K | ... | 21 | AMD A6-7400K | ... | 23 | AMD A8-3850 |...
2015/11/14
[ "https://Stackoverflow.com/questions/33706147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5561255/" ]
To get `AMD` `4 CORES`, This query works fine. You need to do inner join Twice on `product_details` to get `manufacturer` as well as `no of cores`. Here is the [**SQLFiddle Demo**](http://sqlfiddle.com/#!9/aa4ad/1) ``` Select product_details.product_id, products.name, product_details.op...
Your query as written selects all options and all values for the #cores option. You would do better to break it down into a nested subquery: 1. Find the `product_details` records specifying only the desired value for the desired option. (The inner query.) 2. Find the `products` records whose `id`s match those returned...
33,706,147
I have two tables: ``` Table: products ----------------------------------------------------- | id | name | other fields... ----------------------------------------------------- | 20 | Intel i5 4690K | ... | 21 | AMD A6-7400K | ... | 23 | AMD A8-3850 |...
2015/11/14
[ "https://Stackoverflow.com/questions/33706147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5561255/" ]
To get `AMD` `4 CORES`, This query works fine. You need to do inner join Twice on `product_details` to get `manufacturer` as well as `no of cores`. Here is the [**SQLFiddle Demo**](http://sqlfiddle.com/#!9/aa4ad/1) ``` Select product_details.product_id, products.name, product_details.op...
First if you need only AMD manufacture then where is the option of this value ? you said that: ``` 2478 = Number of Cores 2482 = Manufacturer 55032 = 4 cores 55050 = 6 cores ``` Ok, But where were the `value`of the `option_id = 2482` ? you must know them and include them in your `Where` clause. Also I prefer to use...
33,229,213
If any element doesnot exists in Selenium Testing, then I am unable to handle it. I have tried this code. ``` public static bool IsElementPresent(IWebDriver driver, By by) { try { driver.FindElement(by); return true; } catch (NoSuchElementException) ...
2015/10/20
[ "https://Stackoverflow.com/questions/33229213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5259554/" ]
Another option would be something like ``` return driver.FindElements(by).length > 0; ```
I generally use the Displayed property. I use the page object model with pre-determined IWebElements in the example below: ``` public bool IsPageObjectPresent(IWebElement PageObject) { try { if (PageObject.Displayed) { Console.WriteLine("Element is displa...
33,229,213
If any element doesnot exists in Selenium Testing, then I am unable to handle it. I have tried this code. ``` public static bool IsElementPresent(IWebDriver driver, By by) { try { driver.FindElement(by); return true; } catch (NoSuchElementException) ...
2015/10/20
[ "https://Stackoverflow.com/questions/33229213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5259554/" ]
Another option would be something like ``` return driver.FindElements(by).length > 0; ```
``` try{ // Add your complete portion of code here // System.out.println("Portion of code executed Successfully"); } catch(Exception name) { System.out.println("Portion of code failed"); } ``` Please try and let me know.......
33,229,213
If any element doesnot exists in Selenium Testing, then I am unable to handle it. I have tried this code. ``` public static bool IsElementPresent(IWebDriver driver, By by) { try { driver.FindElement(by); return true; } catch (NoSuchElementException) ...
2015/10/20
[ "https://Stackoverflow.com/questions/33229213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5259554/" ]
I generally use the Displayed property. I use the page object model with pre-determined IWebElements in the example below: ``` public bool IsPageObjectPresent(IWebElement PageObject) { try { if (PageObject.Displayed) { Console.WriteLine("Element is displa...
``` try{ // Add your complete portion of code here // System.out.println("Portion of code executed Successfully"); } catch(Exception name) { System.out.println("Portion of code failed"); } ``` Please try and let me know.......
33,185,207
The way to have ad-hoc polymorphism (function overloading) in Haskell is through type classes (see answers to [this](https://stackoverflow.com/questions/33177019/why-has-haskell-troubles-resolving-overloaded-operators), [this](https://stackoverflow.com/questions/30039135/haskell-ad-hoc-polymorphism) and [this](https://...
2015/10/17
[ "https://Stackoverflow.com/questions/33185207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/286335/" ]
I've done a bit of experimenting with line-heights within input boxes and think I've come to some sort of conclusion. It appears that if the size of the font in an input box equals or exceeds the line height, then the box changes size and its content (but **not** placeholder) changes also to fit. This is obvious if y...
**Updated base on comments below** In order to use the same `line-height` for each of the elements I updated the CSS to this: ``` *, *:before, *:after { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } div { line-height: 50px; font-family: Arial; } input, span { b...
33,185,207
The way to have ad-hoc polymorphism (function overloading) in Haskell is through type classes (see answers to [this](https://stackoverflow.com/questions/33177019/why-has-haskell-troubles-resolving-overloaded-operators), [this](https://stackoverflow.com/questions/30039135/haskell-ad-hoc-polymorphism) and [this](https://...
2015/10/17
[ "https://Stackoverflow.com/questions/33185207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/286335/" ]
Why is this happening? ====================== This misalignment is being caused by the caret and as such I don't think you will find a way to align the text if the `font-size` and `line-height` are the same. Why is the caret at fault? -------------------------- The caret has a `height` greater than the text which is...
Line height to 1.2 value (that's 120% of font size) works perfectly in chrome <http://plnkr.co/edit/rJmXLRrGFpi46Vv5THm5?p=preview> ``` div, input, span { line-height: 1.2; } ``` The only change that I make it's change the two line heights of 50 pixels to 1.2. It doesn't breaks the layout and the three el...
33,185,207
The way to have ad-hoc polymorphism (function overloading) in Haskell is through type classes (see answers to [this](https://stackoverflow.com/questions/33177019/why-has-haskell-troubles-resolving-overloaded-operators), [this](https://stackoverflow.com/questions/30039135/haskell-ad-hoc-polymorphism) and [this](https://...
2015/10/17
[ "https://Stackoverflow.com/questions/33185207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/286335/" ]
I've done a bit of experimenting with line-heights within input boxes and think I've come to some sort of conclusion. It appears that if the size of the font in an input box equals or exceeds the line height, then the box changes size and its content (but **not** placeholder) changes also to fit. This is obvious if y...
Line height to 1.2 value (that's 120% of font size) works perfectly in chrome <http://plnkr.co/edit/rJmXLRrGFpi46Vv5THm5?p=preview> ``` div, input, span { line-height: 1.2; } ``` The only change that I make it's change the two line heights of 50 pixels to 1.2. It doesn't breaks the layout and the three el...
33,185,207
The way to have ad-hoc polymorphism (function overloading) in Haskell is through type classes (see answers to [this](https://stackoverflow.com/questions/33177019/why-has-haskell-troubles-resolving-overloaded-operators), [this](https://stackoverflow.com/questions/30039135/haskell-ad-hoc-polymorphism) and [this](https://...
2015/10/17
[ "https://Stackoverflow.com/questions/33185207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/286335/" ]
Why is this happening? ====================== This misalignment is being caused by the caret and as such I don't think you will find a way to align the text if the `font-size` and `line-height` are the same. Why is the caret at fault? -------------------------- The caret has a `height` greater than the text which is...
Because diacritics are not part of the traditional definition of font size, you can't ever have line height = font size. Even [ASCII](http://www.unicode.org/charts/PDF/U0000.pdf) includes some diacritics (for example U0060). Diacritics can be applied to capitalized letters too, you don't even need obscure unicode exten...
33,185,207
The way to have ad-hoc polymorphism (function overloading) in Haskell is through type classes (see answers to [this](https://stackoverflow.com/questions/33177019/why-has-haskell-troubles-resolving-overloaded-operators), [this](https://stackoverflow.com/questions/30039135/haskell-ad-hoc-polymorphism) and [this](https://...
2015/10/17
[ "https://Stackoverflow.com/questions/33185207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/286335/" ]
I've done a bit of experimenting with line-heights within input boxes and think I've come to some sort of conclusion. It appears that if the size of the font in an input box equals or exceeds the line height, then the box changes size and its content (but **not** placeholder) changes also to fit. This is obvious if y...
Because diacritics are not part of the traditional definition of font size, you can't ever have line height = font size. Even [ASCII](http://www.unicode.org/charts/PDF/U0000.pdf) includes some diacritics (for example U0060). Diacritics can be applied to capitalized letters too, you don't even need obscure unicode exten...
33,185,207
The way to have ad-hoc polymorphism (function overloading) in Haskell is through type classes (see answers to [this](https://stackoverflow.com/questions/33177019/why-has-haskell-troubles-resolving-overloaded-operators), [this](https://stackoverflow.com/questions/30039135/haskell-ad-hoc-polymorphism) and [this](https://...
2015/10/17
[ "https://Stackoverflow.com/questions/33185207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/286335/" ]
I've done a bit of experimenting with line-heights within input boxes and think I've come to some sort of conclusion. It appears that if the size of the font in an input box equals or exceeds the line height, then the box changes size and its content (but **not** placeholder) changes also to fit. This is obvious if y...
Try like this As per the link:[Firefox line-height issue with input fields](https://stackoverflow.com/questions/3650530/firefox-line-height-issue-with-input-fields) > > line-height on input won't change unless you change the font-size > > > so reduce the font-size:50px to 45px it will look fine. Code Below ``...
33,185,207
The way to have ad-hoc polymorphism (function overloading) in Haskell is through type classes (see answers to [this](https://stackoverflow.com/questions/33177019/why-has-haskell-troubles-resolving-overloaded-operators), [this](https://stackoverflow.com/questions/30039135/haskell-ad-hoc-polymorphism) and [this](https://...
2015/10/17
[ "https://Stackoverflow.com/questions/33185207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/286335/" ]
### I think I've done it!!! In my testing it seems that line-height must be at least ~115% of font-size, so if you want 50px high element you must have ~43px for things to all line up: [![Fig 1. Font-size 86% of 50px line-height.](https://i.stack.imgur.com/fiWAC.png)](https://i.stack.imgur.com/fiWAC.png) *Fig 1. Fon...
Because diacritics are not part of the traditional definition of font size, you can't ever have line height = font size. Even [ASCII](http://www.unicode.org/charts/PDF/U0000.pdf) includes some diacritics (for example U0060). Diacritics can be applied to capitalized letters too, you don't even need obscure unicode exten...