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
11,941,257
Last days as a result of some customer complains and discussion with our marketing guys I've got a request to change the default behavior of the configurable products options. They asked me to remove the + $xx.xx from the options drop-down as it is confusing the customers/visitors and just leave the available options w...
2012/08/13
[ "https://Stackoverflow.com/questions/11941257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1177078/" ]
Just to add to @anton-s's absolutely correct answer, you can also do "full" class rewrites: ``` // Create the original class var ClassA = Class.create(); ClassA.prototype = { initialize: function(config) { this.config = config; }, test: function(msg) { console.log('Hi from class A with mess...
**How to override \js\varien\configurable.js in Magento 1.9 EE and add new data attribute** Create file \js\jsoverride\configurable.js: ``` Product.Config.prototype.reloadOptionLabels = Product.Config.prototype.reloadOptionLabels.wrap(function (parentMethod, element) { var selectedPrice; if (element.optio...
430,442
Suppose I have a random variable which I suspect is the product of a lognormally distributed random variable $X$ and an independent uniformly distributed variable $U(0, 1)$. (The variables are the total incomes of workers in a calendar year who started on a random day in that year. The logic is that workers' annual sal...
2019/10/08
[ "https://stats.stackexchange.com/questions/430442", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/21701/" ]
$\log X$ is not ExpGaussian, however $-\log X$ is; it being the sum of an $\text{Exp}(1)$ and a $N(-\mu,\sigma^2)$. This may be a part of your problem! If you try the estimation on $-\log X$ and then negate the estimate of $\mu$ you might get a better outcome.
I will assume your two random variables are independent (you didn't specify.) Let the $Z=XY$ where $X,Y$ are independent, with $X \sim \mathcal{logNorm}(\mu,\sigma^2)$ and $Y\sim \mathcal{Unif}(0,1)$. We will use mgf's (moment generating functions.) We can find that the density function of $\log Y$ is $f\_{\log Y}(z)=e...
17,179,163
I have this code which I use in order to upload a CSV file. ``` $handle = fopen($_FILES['filename']['tmp_name'], "r"); while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { $import="INSERT into matching(date, time, location, epos_id, rbpos_id, type_of_payment, basket_information, user_id, points) values('$dat...
2013/06/18
[ "https://Stackoverflow.com/questions/17179163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2379666/" ]
You probably set the option [`virtualedit`](http://vimdoc.sourceforge.net/htmldoc/options.html#%27virtualedit%27) somewhere. To turn it off for the instance you can use `:set virtualedit=`. Or to permanently disable it remove it from your vimrc.
The feature is call virtual edit. You can disable this with: ``` :set virtualedit= ``` See `:h 've'` for more information.
17,033,566
I'm working on a small bug in our app which I'll attempt to simplify here. I have this company model (the actual model has many more associations, but this here displays the problem): ``` class Company < ActiveRecord::Base has_many :contacts def self.search(query, page=1) companies = includes(:contacts).orde...
2013/06/10
[ "https://Stackoverflow.com/questions/17033566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/649006/" ]
Okay, let's do the query as you want ``` select companies.* from companies left outer join contacts <and other included tables> on <join criteria> where <filter criteria> ``` Let's manually override the `.joins(...)` ``` Company.includes(:contacts). joins("left outer join contacts c on c.company_id = compan...
I see that you need two queries: * one to select the company (or companies) * one to select the contacts of a (selected) company Using Rails magic you could select companies by using `joins`: ``` @companies = Company.joins(:contacts).where(...).uniq ``` giving `SELECT DISTINCT "companies".* FROM "companies" INNER ...
71,650,269
I want to display multiple images at once in one figure (i used a set of 22 images so for the subplot i used 5 rows and 5 columns) , but the problem is they display one by one every time i close the figure, here is how i did it : ``` import cv2 import glob import matplotlib.pyplot as plt path="data/*.jpg" images=[cv...
2022/03/28
[ "https://Stackoverflow.com/questions/71650269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18609891/" ]
I tried disabling all the browser extensions. Before narrowing it down to find that the Apollo Client DevTools extension was the culprit.
I had the same error resolved disabling "Keepa - Amazon Price Tracker" extension.
62,465,428
I'm a Python newbie. What I wanted to do was calculate the differences between float numbers. Differences must be between the number after and the number before. So first difference must be between 2nd number and last number. Here's my code: ``` x = [811.91, 796.04, 796.14, 796.50, 796.81] i = 0 for i in x: diffe...
2020/06/19
[ "https://Stackoverflow.com/questions/62465428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12715822/" ]
You can do something like this: ``` buttons = [] for i in range(11): buttons.append( tk.Button(root, text = ('out'+str(i)), bg=random.choice(color), command=lambda:code(i)) if b[0]['bg'] == 'red': pin = pin[:-1] ``` Now `buttons` is a list with button i at index i. You just have to rewrite your command `co...
See classes in python ! class button(self): and here you put your code about buttons This is really helpful because you can put more arguments than just self, and then call button(arguments) to create a new button !
46,355,137
I have a script that loads songs and each song's data from a db (using peewee) and then downloads each song. ``` for music in musiclibrary.select().where(musiclibrary.downloaded == 0): if not os.path.exists("mp3s/" + music.category + "/" + music.artist_name): os.makedirs("mp3s/" + music.category + "/" + m...
2017/09/22
[ "https://Stackoverflow.com/questions/46355137", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5833932/" ]
Couple of problems with your code: * you're doing `listToSumbit.push(newEntry)`, which should be `listToSubmit.push(newEntry)` * starting with `i = "0"` is a bit weird and could cause issues - try `i = 0` instead. With the typo, I strongly recommend using a good linter in your IDE - eslint is great. It'll help catch ...
To get the correct index, you can loop all of the checkboxes: ```js listToSubmit = [] elements = document.querySelectorAll("input[name=mycheckboxgroup]") for (i = 0; i < elements.length; i++) if (elements[i].checked) listToSubmit.push( { 'ID-Number' : i + 1 + '', 'ID-Data' : elements[i].value } ) console....
74,589,883
I have array of array double but it won't add element after using `.plusElement`or `.plus`. code below inside from view model that returns it.data which is a list of object ### Code ``` var ageEntry : Int val dataObject : Array<Array<Double>> = arrayOf() for (dataWeight in it.data!!){ ageEntry = dataWeight.date...
2022/11/27
[ "https://Stackoverflow.com/questions/74589883", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7354428/" ]
The OP's proposed answer is subpar to say the least. If you need a mutable data structure, use a list not an array. I suggest something like this: ``` it.data?.fold(ArrayList<Array<Double>>()) { list, dataWeight -> val ageEntry = dataWeight.date.toLocalDate().getAgeInMonth().toString().toInt() list.add(arrayOf...
**Im adding this function to add array Element** ``` fun <T> appendArray(arr: Array<T>, element: T): Array<T?> { val array = arr.copyOf(arr.size + 1) array[arr.size] = element return array } ``` **then you can call it** ``` appendArray(copyDataObject, arrayOf(ageEntry,arrayOf(arrayOf(2.0...
14,912,373
I want this button's image use the image stored in database (image path)... ``` private void button15_Click(object sender, EventArgs e) { string a = button11.Text; string connString = "Server=Localhost;Database=test;Uid=*****;password=*****;"; MySqlConnection conn = ...
2013/02/16
[ "https://Stackoverflow.com/questions/14912373", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1952807/" ]
The CUDA Toolkit [Release Notes](http://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html) list the supported platforms and compilers.
Well I think it's the other way around. The thing is, there is a driver called `nvcc`. it generates device code and host code and sends the host code to a compiler. It should be a C compiler and it should be in the executable path. (EDIT: and it should be gcc on Linux and cl on Windows and I think I should ignore mac a...
34,204,968
I have checked all the posts on the subject, and added a callback in the iterator. However, it seems it does not work. ```js async.forEachOf(scoreTree.nodes, function (node,key, callback){ if(!node.composition.weights){ mongooseCall.etc.find({} } ,function (err, da...
2015/12/10
[ "https://Stackoverflow.com/questions/34204968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4622967/" ]
It seems you want to count how many rows in `table1` have a matching value in either column. One easy way is: ``` select t2.*, (select count(*) from table1 t1 where t2.id in (t1.day1, t1.day2) ) as occur from table2 t2; ```
In table 1, you must make a foreign key for the table 2. Probably the id of user. With that: ``` Select t2.id, t2.name, Sum(t1.day) from table1 t1 innerjoin table2 t2 on t1.id = t2.id ```
34,204,968
I have checked all the posts on the subject, and added a callback in the iterator. However, it seems it does not work. ```js async.forEachOf(scoreTree.nodes, function (node,key, callback){ if(!node.composition.weights){ mongooseCall.etc.find({} } ,function (err, da...
2015/12/10
[ "https://Stackoverflow.com/questions/34204968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4622967/" ]
It seems you want to count how many rows in `table1` have a matching value in either column. One easy way is: ``` select t2.*, (select count(*) from table1 t1 where t2.id in (t1.day1, t1.day2) ) as occur from table2 t2; ```
Select id and name from table2 and get the amount of occurrences in table1 in a subquery: ``` select id, name, ( select sum ( case when t1.day1 = t2.id then 1 else 0 end + case when t1.day2 = t2.id then 1 else 0 end ) from table1 t1 where t2.id in (t1.day1, t1.day2) ) as occu...
34,204,968
I have checked all the posts on the subject, and added a callback in the iterator. However, it seems it does not work. ```js async.forEachOf(scoreTree.nodes, function (node,key, callback){ if(!node.composition.weights){ mongooseCall.etc.find({} } ,function (err, da...
2015/12/10
[ "https://Stackoverflow.com/questions/34204968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4622967/" ]
It seems you want to count how many rows in `table1` have a matching value in either column. One easy way is: ``` select t2.*, (select count(*) from table1 t1 where t2.id in (t1.day1, t1.day2) ) as occur from table2 t2; ```
Combine `day1` and `day2` column to one, then count. **Query** ``` select t1.ID, t1.Name, count(t2.[day]) as occur from table2 t1 left join (select Day1 as [day] from table1 union all select Day2 as [day] from table1) t2 on t1.ID = t2.[day] group by t1.ID, t1.Name; ```
23,202,836
How can I do something like this in Ruby? ``` if variable = something do A do B do D elsif variable = something different do A do B do C do D else do A do C do D A = set of loops with if else B = set of loops with if else C = set of loops with if else D = final steps ...
2014/04/21
[ "https://Stackoverflow.com/questions/23202836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3525873/" ]
Instead of goto just create functions for A, B and so on and use them for example: ``` def A # Lot of code end ``` Now you can `goto` A by just writing `A`. Also instead of using if/else you can use switch case, so that your code will look like ``` A case variable when something B D when something else B ...
This is a classic use for switch case. [Here](https://stackoverflow.com/questions/948135/how-can-i-write-a-switch-statement-in-ruby) is how you do it in ruby. Also, I would make all the do's methods and call them from inside `when`
3,630,755
Ok so what I want to do is create a background agent that monitors http traffic to/from a certain application and performs actions when there are requests and responses to a certain website. Is there a good way to do this in Cocoa? I'd like to avoid using really low level sniffing and/or requiring root access to do thi...
2010/09/02
[ "https://Stackoverflow.com/questions/3630755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/574/" ]
If the application your trying to monitor supports proxy servers you could write one and use that in your app. That probably is the easiest solution. If that doesn’t work you could use something like `mach_inject` and `mach_override` to overwrite some socket system calls (`socket` and `write` probably are enough) in ...
Here's [tcpdump](http://www.tcpdump.org/) and it's library libpcap: <http://www.tcpdump.org/tcpdump_man.html> and <http://www.tcpdump.org/pcap3_man.html> There's a tutorial here: <http://www.tcpdump.org/pcap.htm> Like Sven said you'll need admin privileges to do anything spectacular.
17,036,623
An example of what I'm trying to do is probably best: ``` def repeater(n = 1) n.times { yield } end ``` By default, repeater will go through the block given once. However, I want it to go through the block multiple times if given n > 1. For some reason the above code doesn't work. For instance: I would expect th...
2013/06/11
[ "https://Stackoverflow.com/questions/17036623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2328259/" ]
The problem is that the return value of `repeater` is the return value of `times`, which will always be `n`, so you should interrogate the resulting value of `y` itself instead: ``` y = 2 repeater(5) { y *= 2 } #=> 5 y #=> 64 ``` If you want `repeater` to actually return the final result, you could [`reduce`](http...
There is nothing wrong with `yield`. The function returns a result of `n.times { … }` which is obviously equals `5`: ``` > 5.times { } # => 5 ``` You want to accumulate the result of yield and explicitely return it from your function.
17,036,623
An example of what I'm trying to do is probably best: ``` def repeater(n = 1) n.times { yield } end ``` By default, repeater will go through the block given once. However, I want it to go through the block multiple times if given n > 1. For some reason the above code doesn't work. For instance: I would expect th...
2013/06/11
[ "https://Stackoverflow.com/questions/17036623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2328259/" ]
The problem is that the return value of `repeater` is the return value of `times`, which will always be `n`, so you should interrogate the resulting value of `y` itself instead: ``` y = 2 repeater(5) { y *= 2 } #=> 5 y #=> 64 ``` If you want `repeater` to actually return the final result, you could [`reduce`](http...
I managed to solve this using the `times` method as I was attempting to do: ``` def repeater(n = 1) (n - 1).times { yield } yield end ``` The above looks nice, as I wanted, but I was hoping I could do this with `n.times` instead of `(n - 1).times`. The following is a solution using that, but it doesn't look el...
270,857
on linux server I use [BackupPC](http://backuppc.sourceforge.net/) and I want to do copys for windows clients. What lexic I should use? i now are using and work good: \*.pl ``` $Conf{BackupFilesOnly} = { 'C$' => [ '/Testas' ] }; $Conf{SmbSharePasswd} = '*****'; $Conf{SmbShareUserName} = 'EXAMPLE\\Administrat...
2011/05/18
[ "https://serverfault.com/questions/270857", "https://serverfault.com", "https://serverfault.com/users/80341/" ]
Are you already running Nagios? Check out check\_dirsize or check\_filesize\_dir: <http://exchange.nagios.org/directory/Plugins/Uncategorized/Operating-Systems/Linux/CheckDirSize/details> <http://exchange.nagios.org/directory/Plugins/Uncategorized/Operating-Systems/Linux/check_filesize_dir/details> Both could be ea...
I would think that [inotifywait(1)](http://linux.die.net/man/1/inotifywait) from [inotify-tools](http://inotify-tools.sourceforge.net/) would be helpful here.
270,857
on linux server I use [BackupPC](http://backuppc.sourceforge.net/) and I want to do copys for windows clients. What lexic I should use? i now are using and work good: \*.pl ``` $Conf{BackupFilesOnly} = { 'C$' => [ '/Testas' ] }; $Conf{SmbSharePasswd} = '*****'; $Conf{SmbShareUserName} = 'EXAMPLE\\Administrat...
2011/05/18
[ "https://serverfault.com/questions/270857", "https://serverfault.com", "https://serverfault.com/users/80341/" ]
Are you already running Nagios? Check out check\_dirsize or check\_filesize\_dir: <http://exchange.nagios.org/directory/Plugins/Uncategorized/Operating-Systems/Linux/CheckDirSize/details> <http://exchange.nagios.org/directory/Plugins/Uncategorized/Operating-Systems/Linux/check_filesize_dir/details> Both could be ea...
``` #!/bin/bash DIR=/path/to/dir SIZE=10000 MAILADDR="mail@domain.com" if [ $(du -s $DIR | awk '{print $1}') -gt $SIZE ]; then echo "$DIR" | mail -s "Directory limit exceeded in $DIR" $MAILADDR fi ``` SIZE has to be given in Bytes!
270,857
on linux server I use [BackupPC](http://backuppc.sourceforge.net/) and I want to do copys for windows clients. What lexic I should use? i now are using and work good: \*.pl ``` $Conf{BackupFilesOnly} = { 'C$' => [ '/Testas' ] }; $Conf{SmbSharePasswd} = '*****'; $Conf{SmbShareUserName} = 'EXAMPLE\\Administrat...
2011/05/18
[ "https://serverfault.com/questions/270857", "https://serverfault.com", "https://serverfault.com/users/80341/" ]
Are you already running Nagios? Check out check\_dirsize or check\_filesize\_dir: <http://exchange.nagios.org/directory/Plugins/Uncategorized/Operating-Systems/Linux/CheckDirSize/details> <http://exchange.nagios.org/directory/Plugins/Uncategorized/Operating-Systems/Linux/check_filesize_dir/details> Both could be ea...
This answer is based on my specific directory needed but you could easily modify it to suite any volume name or even a multiple volumes. I'm not the best with scripting and adapted some functions I found, it will be good to see responses with improvement. Thanks Script will check the size of /home and if it is too lar...
270,857
on linux server I use [BackupPC](http://backuppc.sourceforge.net/) and I want to do copys for windows clients. What lexic I should use? i now are using and work good: \*.pl ``` $Conf{BackupFilesOnly} = { 'C$' => [ '/Testas' ] }; $Conf{SmbSharePasswd} = '*****'; $Conf{SmbShareUserName} = 'EXAMPLE\\Administrat...
2011/05/18
[ "https://serverfault.com/questions/270857", "https://serverfault.com", "https://serverfault.com/users/80341/" ]
``` #!/bin/bash DIR=/path/to/dir SIZE=10000 MAILADDR="mail@domain.com" if [ $(du -s $DIR | awk '{print $1}') -gt $SIZE ]; then echo "$DIR" | mail -s "Directory limit exceeded in $DIR" $MAILADDR fi ``` SIZE has to be given in Bytes!
I would think that [inotifywait(1)](http://linux.die.net/man/1/inotifywait) from [inotify-tools](http://inotify-tools.sourceforge.net/) would be helpful here.
270,857
on linux server I use [BackupPC](http://backuppc.sourceforge.net/) and I want to do copys for windows clients. What lexic I should use? i now are using and work good: \*.pl ``` $Conf{BackupFilesOnly} = { 'C$' => [ '/Testas' ] }; $Conf{SmbSharePasswd} = '*****'; $Conf{SmbShareUserName} = 'EXAMPLE\\Administrat...
2011/05/18
[ "https://serverfault.com/questions/270857", "https://serverfault.com", "https://serverfault.com/users/80341/" ]
``` #!/bin/bash DIR=/path/to/dir SIZE=10000 MAILADDR="mail@domain.com" if [ $(du -s $DIR | awk '{print $1}') -gt $SIZE ]; then echo "$DIR" | mail -s "Directory limit exceeded in $DIR" $MAILADDR fi ``` SIZE has to be given in Bytes!
This answer is based on my specific directory needed but you could easily modify it to suite any volume name or even a multiple volumes. I'm not the best with scripting and adapted some functions I found, it will be good to see responses with improvement. Thanks Script will check the size of /home and if it is too lar...
48,061,371
here I am trying to validate structure of hive table and CSV file which is stored in s3. This is schema of CSV file in dataframe. ``` +----+----------------+----+---+-----------+-----------+ |S_No| Variable|Type|Len| Format| Informat| +----+----------------+----+---+-----------+-----------+ | 1| ...
2018/01/02
[ "https://Stackoverflow.com/questions/48061371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9163827/" ]
It is been blocked by the PHP Session. You can't serve to pages that requires access to the same session id. Although once you close/serve/release the session on the slow page, another page can be served on the same session. On the slow page just call [`Session::save()`](http://api.symfony.com/3.4/Symfony/Component/H...
The reason the firewall takes so long is that of **debug is enabled**. In debug, the listeners are all wrapped with debugging listeners. **All the information in the Firewall is being profiled and logged**. Try to run the same request with Symfony debug disabled.
48,061,371
here I am trying to validate structure of hive table and CSV file which is stored in s3. This is schema of CSV file in dataframe. ``` +----+----------------+----+---+-----------+-----------+ |S_No| Variable|Type|Len| Format| Informat| +----+----------------+----+---+-----------+-----------+ | 1| ...
2018/01/02
[ "https://Stackoverflow.com/questions/48061371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9163827/" ]
It is been blocked by the PHP Session. You can't serve to pages that requires access to the same session id. Although once you close/serve/release the session on the slow page, another page can be served on the same session. On the slow page just call [`Session::save()`](http://api.symfony.com/3.4/Symfony/Component/H...
We had a similar problem. When sending a couple of consecutive requests to the server in a short period, the server became very slow. I enabled the profiler bar, and a lot of time was spent by the ContextListener [![screenshot of the profiler information](https://i.stack.imgur.com/lTCsP.png)](https://i.stack.imgur.com/...
1,252,549
I would like to know how to get excel to count a value in a column IF it detects a specific (pre-stated) ID within a row. Specifically, I have two sheets. In workbook A, a person enters data on a video coding project. They list the ID, date, start time, end time, and a variety of variables they may have seen. For inst...
2017/09/21
[ "https://superuser.com/questions/1252549", "https://superuser.com", "https://superuser.com/users/773587/" ]
Contrary to what I wrote in my comment, it turns out that `COUNTIFS` is available in Excel 2010. You can use it to count the number of rows that has a given id in column B and a "P" in column H. If you enter "d509" in cell B2, the following formula will return 5 (assuming the data shown in your Entry Workbook picture. ...
Check whether you have a COUNTIFS function; if so, this is your best answer. You can specify a range and more than one criterion. Failing that, you may be able to do this with an array formula. `=SUM( N( B2='[Coder1 Template.xlsx]ENTRY'!$B$2:$K$7100 ) * N('[Coder1 Template.xlsx]ENTRY'!$H$2:$H$7100 = "P" ) )` using ...
40,161,718
Now I have following problem: ``` C:\Program Files\PostgreSQL\9.6\bin>raster2pgsql -s 4326 -I -C -M "C:\Users\I\Landsat.tif" -F -t 100x100 public.elevation > elev.sql psql -h 134.235.282.611 -p 6432 -d some_database -U username ACCESS DENIED ``` Can anyone help me?
2016/10/20
[ "https://Stackoverflow.com/questions/40161718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The SGML Standard (ISO 8879:1986/A1:1988, 11.2.4) explicitly recommends to **not use** content models like `(#PCDATA, foo, bar)` (emphasis mine): > > NOTE - It is recommended that “`#PCDATA`” be used **only** when data characters are to be permitted anywhere in the content of the element; that is, in a content model ...
Whitespace that looks innocuous is in fact significant character data, which results in an error. This is sometimes referred to as "pernicious mixed content". You have already hinted at a solution (allowing `#PCDATA` after the `bar` element): ``` <!ELEMENT outer - - (#PCDATA, foo, bar, #PCDATA) > ``` Another option ...
72,596,666
i am making a house management app i have to upload images of the property alongside other data related to the property so i am using two screens one for the general info about the house and the second one specifically to upload images **Form screen** [![enter image description here](https://i.stack.imgur.com/m062a.p...
2022/06/12
[ "https://Stackoverflow.com/questions/72596666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10796813/" ]
You could look up the indexes of the `marker` elements in the list, and then take sublists based on those positions: ```py lst = ["elem1", "elem2", "marker1", "elem3", "marker2", "elem4", "elem5"] idxs = [i for i, v in enumerate(lst) if type(v) == str and v.startswith('marker')] separated = [lst[i:j] for i, j in zip([...
this is how `i` look like `[['elem1', 'elem2'],['marker1'],['elem3'],['marker2'],['elem4', 'elem5'],['marker3'],['elem6', 'elem7']]` but in a generator ofcourse so we use `zip` and `i` as `generator` to compine every 2 lists together `['elem1', 'elem2'] + ['marker1']` ```py from itertools import groupby lst = ["elem...
72,596,666
i am making a house management app i have to upload images of the property alongside other data related to the property so i am using two screens one for the general info about the house and the second one specifically to upload images **Form screen** [![enter image description here](https://i.stack.imgur.com/m062a.p...
2022/06/12
[ "https://Stackoverflow.com/questions/72596666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10796813/" ]
Create (and include) a new inner list at the start or at a marker, otherwise append to the current inner list ([Try it online!](https://tio.run/##dY7BCoMwDIbvPkXwooII6gZD2CvsBaSHgBFl2pY2MPf0XdtNdxjLIfxN8v399ZMnJduLNs4xWbZwhT4BX326ormTqdMSUlpoPUQTxHvZ7LM2FeUH@3dbf29/@dMuzsFIJMmoDCyWYZYQc3XRHX28m5IUH5Y0GmQaQmaEzvdNQAC3gE...
this is how `i` look like `[['elem1', 'elem2'],['marker1'],['elem3'],['marker2'],['elem4', 'elem5'],['marker3'],['elem6', 'elem7']]` but in a generator ofcourse so we use `zip` and `i` as `generator` to compine every 2 lists together `['elem1', 'elem2'] + ['marker1']` ```py from itertools import groupby lst = ["elem...
72,596,666
i am making a house management app i have to upload images of the property alongside other data related to the property so i am using two screens one for the general info about the house and the second one specifically to upload images **Form screen** [![enter image description here](https://i.stack.imgur.com/m062a.p...
2022/06/12
[ "https://Stackoverflow.com/questions/72596666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10796813/" ]
Create (and include) a new inner list at the start or at a marker, otherwise append to the current inner list ([Try it online!](https://tio.run/##dY7BCoMwDIbvPkXwooII6gZD2CvsBaSHgBFl2pY2MPf0XdtNdxjLIfxN8v399ZMnJduLNs4xWbZwhT4BX326ormTqdMSUlpoPUQTxHvZ7LM2FeUH@3dbf29/@dMuzsFIJMmoDCyWYZYQc3XRHX28m5IUH5Y0GmQaQmaEzvdNQAC3gE...
You could look up the indexes of the `marker` elements in the list, and then take sublists based on those positions: ```py lst = ["elem1", "elem2", "marker1", "elem3", "marker2", "elem4", "elem5"] idxs = [i for i, v in enumerate(lst) if type(v) == str and v.startswith('marker')] separated = [lst[i:j] for i, j in zip([...
10,215,606
I have a macro-enabled WorkBook. I need to specify the current folder in which the macro-enabled file is present as the path. I tried setting ``` path = ActiveWorkbook.Path ``` *and* ``` path = CurDir() ``` but neither of these work for me. Any idea on this?
2012/04/18
[ "https://Stackoverflow.com/questions/10215606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1270123/" ]
If the path you want is the one to the workbook running the macro, and that workbook has been saved, then `ThisWorkbook.Path` is what you would use.
I thought I had misunderstood but I was right. In this scenario, it will be `ActiveWorkbook.Path` But the main issue was not here. The problem was with these 2 lines of code ``` strFile = Dir(strPath & "*.csv") ``` Which should have written as ``` strFile = Dir(strPath & "\*.csv") ``` and ``` With .QueryTables...
49,378,743
I'm using `react-toastify` and I can't get a simple toast to be rendered... ``` import React from "react"; import { toast } from 'react-toastify'; class MyView extends React.Component<{}, {}> { constructor() { super(); this.state = { }; } componentDidMount() { toast("Hel...
2018/03/20
[ "https://Stackoverflow.com/questions/49378743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3387233/" ]
You need to remember to include the `<ToastContainer />` in your render.
To make use of the react-toastify, Please follow below steps:- 1. Install the npm package npm i toastify --save 2. Import the react-toastify as shown below in that given order import 'react-toastify/dist/ReactToastify.css'; // import first import { ToastContainer, toast } from 'react-toastify'; // then this
49,378,743
I'm using `react-toastify` and I can't get a simple toast to be rendered... ``` import React from "react"; import { toast } from 'react-toastify'; class MyView extends React.Component<{}, {}> { constructor() { super(); this.state = { }; } componentDidMount() { toast("Hel...
2018/03/20
[ "https://Stackoverflow.com/questions/49378743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3387233/" ]
For me moving `ReactToastify.css` above `toast` solved the issue! ``` import 'react-toastify/dist/ReactToastify.css'; // import first import { ToastContainer, toast } from 'react-toastify'; // then this ```
``` import React from "react"; import { ToastContainer,toast } from 'react-toastify'; // <- add ToastContainer import 'react-toastify/dist/ReactToastify.css'; // <- add line class MyView extends React.Component<{}, {}> { constructor() { super(); this.state = { }; } componentDidM...
49,378,743
I'm using `react-toastify` and I can't get a simple toast to be rendered... ``` import React from "react"; import { toast } from 'react-toastify'; class MyView extends React.Component<{}, {}> { constructor() { super(); this.state = { }; } componentDidMount() { toast("Hel...
2018/03/20
[ "https://Stackoverflow.com/questions/49378743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3387233/" ]
You have to also `import 'react-toastify/dist/ReactToastify.css';` ``` import React, { Component } from 'react'; import { ToastContainer, toast } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css'; // minified version is also included // import 'react-toastify/dist/ReactToastify.min.css'; ...
My mistake was importing toast without {} curly braces because my course instructor did so. Try to change this: ``` import toast from 'react-toastify'; ``` To: ``` import { toast } from 'react-toastify'; ``` Also according to all other 'react-toastify' stackoverflow responses, installing latest version c...
49,378,743
I'm using `react-toastify` and I can't get a simple toast to be rendered... ``` import React from "react"; import { toast } from 'react-toastify'; class MyView extends React.Component<{}, {}> { constructor() { super(); this.state = { }; } componentDidMount() { toast("Hel...
2018/03/20
[ "https://Stackoverflow.com/questions/49378743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3387233/" ]
For me moving `ReactToastify.css` above `toast` solved the issue! ``` import 'react-toastify/dist/ReactToastify.css'; // import first import { ToastContainer, toast } from 'react-toastify'; // then this ```
My mistake was importing toast without {} curly braces because my course instructor did so. Try to change this: ``` import toast from 'react-toastify'; ``` To: ``` import { toast } from 'react-toastify'; ``` Also according to all other 'react-toastify' stackoverflow responses, installing latest version c...
49,378,743
I'm using `react-toastify` and I can't get a simple toast to be rendered... ``` import React from "react"; import { toast } from 'react-toastify'; class MyView extends React.Component<{}, {}> { constructor() { super(); this.state = { }; } componentDidMount() { toast("Hel...
2018/03/20
[ "https://Stackoverflow.com/questions/49378743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3387233/" ]
The other solutions didn't work for me - turns out I wasn't passing a string to the `toast.*` function. For example: ``` getSomethingFromApi() .then((response) => { // this works fine because response.message is a string toast.notify(response.message) }) .catch((error) => { ...
``` import React from "react"; import { ToastContainer,toast } from 'react-toastify'; // <- add ToastContainer import 'react-toastify/dist/ReactToastify.css'; // <- add line class MyView extends React.Component<{}, {}> { constructor() { super(); this.state = { }; } componentDidM...
49,378,743
I'm using `react-toastify` and I can't get a simple toast to be rendered... ``` import React from "react"; import { toast } from 'react-toastify'; class MyView extends React.Component<{}, {}> { constructor() { super(); this.state = { }; } componentDidMount() { toast("Hel...
2018/03/20
[ "https://Stackoverflow.com/questions/49378743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3387233/" ]
Even better, import minified css: `import 'react-toastify/dist/ReactToastify.min.css';` or in case you are importing it in .scss file `@import '~react-toastify/dist/ReactToastify.min.css';`
To make use of the react-toastify, Please follow below steps:- 1. Install the npm package npm i toastify --save 2. Import the react-toastify as shown below in that given order import 'react-toastify/dist/ReactToastify.css'; // import first import { ToastContainer, toast } from 'react-toastify'; // then this
49,378,743
I'm using `react-toastify` and I can't get a simple toast to be rendered... ``` import React from "react"; import { toast } from 'react-toastify'; class MyView extends React.Component<{}, {}> { constructor() { super(); this.state = { }; } componentDidMount() { toast("Hel...
2018/03/20
[ "https://Stackoverflow.com/questions/49378743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3387233/" ]
Before declaring your class, add the following line: ``` toast.configure(); ```
The other solutions didn't work for me - turns out I wasn't passing a string to the `toast.*` function. For example: ``` getSomethingFromApi() .then((response) => { // this works fine because response.message is a string toast.notify(response.message) }) .catch((error) => { ...
49,378,743
I'm using `react-toastify` and I can't get a simple toast to be rendered... ``` import React from "react"; import { toast } from 'react-toastify'; class MyView extends React.Component<{}, {}> { constructor() { super(); this.state = { }; } componentDidMount() { toast("Hel...
2018/03/20
[ "https://Stackoverflow.com/questions/49378743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3387233/" ]
Before declaring your class, add the following line: ``` toast.configure(); ```
My mistake was importing toast without {} curly braces because my course instructor did so. Try to change this: ``` import toast from 'react-toastify'; ``` To: ``` import { toast } from 'react-toastify'; ``` Also according to all other 'react-toastify' stackoverflow responses, installing latest version c...
49,378,743
I'm using `react-toastify` and I can't get a simple toast to be rendered... ``` import React from "react"; import { toast } from 'react-toastify'; class MyView extends React.Component<{}, {}> { constructor() { super(); this.state = { }; } componentDidMount() { toast("Hel...
2018/03/20
[ "https://Stackoverflow.com/questions/49378743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3387233/" ]
The other solutions didn't work for me - turns out I wasn't passing a string to the `toast.*` function. For example: ``` getSomethingFromApi() .then((response) => { // this works fine because response.message is a string toast.notify(response.message) }) .catch((error) => { ...
For me moving `ReactToastify.css` above `toast` solved the issue! ``` import 'react-toastify/dist/ReactToastify.css'; // import first import { ToastContainer, toast } from 'react-toastify'; // then this ```
49,378,743
I'm using `react-toastify` and I can't get a simple toast to be rendered... ``` import React from "react"; import { toast } from 'react-toastify'; class MyView extends React.Component<{}, {}> { constructor() { super(); this.state = { }; } componentDidMount() { toast("Hel...
2018/03/20
[ "https://Stackoverflow.com/questions/49378743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3387233/" ]
install react-toastify using command ```sh npm i react-toastify ``` Then: ```js import {ToastContainer,toast} from 'react-toastify' ``` and in return add ```js <ToastContainer /> ``` and after that when you do `toast('hy')` then it will show toast
To make use of the react-toastify, Please follow below steps:- 1. Install the npm package npm i toastify --save 2. Import the react-toastify as shown below in that given order import 'react-toastify/dist/ReactToastify.css'; // import first import { ToastContainer, toast } from 'react-toastify'; // then this
3,570,592
Let $Lip((a,b))$ be the space of Lipschitz functions on $(a,b)$: it is obvious the inclusion $Lip((a,b))\subset \mathcal{C}^0([a,b])$, but I was wondering if maybe this subspace is closed with respct to the supremum norm. I've studied that $B\_{Lip((a,b))}$, that is the unit ball of $Lip((a,b))$ is compact in $\mathca...
2020/03/05
[ "https://math.stackexchange.com/questions/3570592", "https://math.stackexchange.com", "https://math.stackexchange.com/users/746358/" ]
Any infinite set $B$ has at least a proper subset $C$ such that $|C|=|B|$ (assuming choice, of course, or some weaker axiom thereof). Since $B$ is infinite, it is not empty. Let $b\_0\in B$ and consider $C=B\setminus\{b\_0\}$. Then $|B|=|C|$. Indeed, take a countable subset $Z$ of $B$ (it exists by choice). Then $Z\c...
I believe the specification in $(2)$ of proper subsets instead of the full set, $B$, is a historical remnant from Cantor's original formulation of the definition. As the other answer and comment by [**egreg**](https://math.stackexchange.com/users/62967/egreg) and [**JMoravitz**](https://math.stackexchange.com/users/179...
27,689,732
I want to set the values of a dropdownList according to the selectedValue of another dropdownList. So for example : ``` ViewBag.Brand = new SelectList(db.Brand, "Libel", "Libel"); ViewBag.IdModel = new SelectList(db.Model.Where(model => model.Brand == ViewBag.Brand.SelectedValue), "IdModel", "Descriptive"); ``` I k...
2014/12/29
[ "https://Stackoverflow.com/questions/27689732", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3520621/" ]
In your case your need to ajax call or server call when you change brand dropdown box. See Below example it is just used static data to identify the when brand model is change then automatically changed model dropdown using jquery(Client Side). **View Side:-** ``` @*Display the elements in the page*@ @*--------------...
there are 2 ways: 1 do it on client; 2 do it on server 1. On client. Second drop down options should contain ids with brand id, then you could write javascript which should change selected index of second drop down based on selected value of first drop down. Here need to base on your model structure. 2. On server. Do...
294,395
The sample XML looks like this: ``` <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <root> <level01> <field01>AAAAAAAAAAAAAAAAAAAA</field01> <field02>BBBBBBBB</field02> <field03>CCCCCCCCCCCCCCCCCCCC</field03> <field04>DDDDDDDDDDDDDDDDDDDD</field04> <field05>DDD</field05> <level02> ...
2016/07/07
[ "https://unix.stackexchange.com/questions/294395", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/178570/" ]
**xmlstartlet** arguments are a little bit tricky. You have to see them as templtes (-t) in the xsl way... ``` xmlstarlet sel -B -t -m '//text()' -c 'concat(.,",")' x1.xml ``` where: * -B : generically remove spaces * -t : template in the xsl sense * -m : match xpath exp * -c : copy-of xpath exp This expression, p...
Using [xml2](http://ofb.net/~egnor/xml2/) (available packaged for debian and most other distros) instead of `xml2starlet`, along with `awk` and `paste`: ``` $ xml2 <sdfsdf.xml | awk -F= '{ print $2 }' | paste -sd, AAAAAAAAAAAAAAAAAAAA,BBBBBBBB,CCCCCCCCCCCCCCCCCCCC,DDDDDDDDDDDDDDDDDDDD,DDD,EEEEEEEEE,FFF,GGGGGGGGGGs,HHH...
14,025,628
My script makes an Ajax request through jQuery. The data received is json\_encoded via a server side script (php). This is further, stringified and then parseJSON'ed using jQuery to yield a recordCollection. I loop through recordCollection and push it onto records array, the variable that was declared outside the scope...
2012/12/24
[ "https://Stackoverflow.com/questions/14025628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/709101/" ]
You are correct in that, ajax calls are async, hence `Asynchronous Javascript and XML`. You can make it sync, but you shouldn't because your array will then be available for anyone to play with, which can cause some big headaches. Instead, have an init call that is run once your ajax call is completed. ``` function c...
Ajax stands for [Asynchronous JavaScript and XML](http://en.wikipedia.org/wiki/Ajax_%28programming%29) (forget the XML part) so i think you can guess what is right ;-) I added the execution order with comments: ``` var records = [] ; // 1. send request and return immediately $.getJSON(url, {id : recordid}, function...
61,445,011
**The application** Simple REST API registration service in Spring, after sending proper POST request new user is created in database and Amazon SES sends an email with registration link to verify. **The problem** Locally after setting local variables (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_DEFAULT_RE...
2020/04/26
[ "https://Stackoverflow.com/questions/61445011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12152413/" ]
If you're running app on EC2, don't use IAM user. Instead create IAM **role** with same permissions and assign that role to the instance. If app uses AWS SDK it will be able to pick up credentials without any problems. In your case problem is probably app's environment being different from yours, if you export crede...
The DefaultAWSCredentialsProvider has multiple places it will look for credentials. Instead of setting up your credentials as an environment variable, you can set up a credentials profile. See this documentation: [Working with AWS Credentials](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html...
55,235,565
I want to visualize a matrix of integer values between 0 and 255 as a gray-scale image in Qt 5.12. First, I built a sample 256x256 uchar array with values between 0 and 255 in each row. then I tried to show the image with QImage and format\_grayscale as the format. But confusingly, the resulting image contains disturbe...
2019/03/19
[ "https://Stackoverflow.com/questions/55235565", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11224648/" ]
My guess is your buffer is deallocated and partially overwritten before you can get it displayed. It is your responsability to ensure the data buffer remains valid when using a constructor that does not perform a deep copy. Quoting from [the Qt documentation](https://doc.qt.io/qt-5/qimage.html#QImage-3): > > Constru...
You should not use a matrix but an array of size 256x256 = 65535 , So instead of : ``` uchar imageArray[256][256]; ``` use : ``` uchar imageArray[65536]; ``` Then fill your array with the values you want. Then, call the constructor of QImage : ``` QImage image(imageArray, 256, 256, QImage::Format_Grayscal...
5,609,727
Can you please suggest some books on Software Architecture, which should talk about how to design software at module level and how those modules will interact. There are numerous books which talks about design patterns which are mostly low level details. I know low level details are also important, but I want list of g...
2011/04/10
[ "https://Stackoverflow.com/questions/5609727", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2302649/" ]
I *think* this is the book that came to mind when I first read this question. It talks about various architectural styles like pipes-and-filters, blackboard systems, etc. It's an oldie, and I'll let you judge whether it's a 'goodie'. [Pattern Oriented Software Architecture](https://rads.stackoverflow.com/amzn/click/co...
I'm not familiar with books that detail architectures and not design pattern. I mostly use the design books to get an understanding of how I would build such a system and I use sources such as [highscalability](http://highscalability.com/) to learn about the architecture of various companies, just look at the "all time...
5,609,727
Can you please suggest some books on Software Architecture, which should talk about how to design software at module level and how those modules will interact. There are numerous books which talks about design patterns which are mostly low level details. I know low level details are also important, but I want list of g...
2011/04/10
[ "https://Stackoverflow.com/questions/5609727", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2302649/" ]
Where can you get knowledge about software architecture? One place is your experience building systems. Another is conversations with other developers or reading their code. Yet another place is books. I am the author of a book on software architecture ([Just Enough Software Architecture](http://rhinoresearch.com/conte...
I'm not familiar with books that detail architectures and not design pattern. I mostly use the design books to get an understanding of how I would build such a system and I use sources such as [highscalability](http://highscalability.com/) to learn about the architecture of various companies, just look at the "all time...
5,609,727
Can you please suggest some books on Software Architecture, which should talk about how to design software at module level and how those modules will interact. There are numerous books which talks about design patterns which are mostly low level details. I know low level details are also important, but I want list of g...
2011/04/10
[ "https://Stackoverflow.com/questions/5609727", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2302649/" ]
Where can you get knowledge about software architecture? One place is your experience building systems. Another is conversations with other developers or reading their code. Yet another place is books. I am the author of a book on software architecture ([Just Enough Software Architecture](http://rhinoresearch.com/conte...
I *think* this is the book that came to mind when I first read this question. It talks about various architectural styles like pipes-and-filters, blackboard systems, etc. It's an oldie, and I'll let you judge whether it's a 'goodie'. [Pattern Oriented Software Architecture](https://rads.stackoverflow.com/amzn/click/co...
325,201
As from the title. I've been receiving this from a security guard, when attending a developer conference, well, a bit overdressed (wearing a suit where all the other nerds just appeared in t-shirt, jeans and sneakers). But I've also heard that otherwise (not thrown on me, the above anecdote was my only personal exper...
2016/05/12
[ "https://english.stackexchange.com/questions/325201", "https://english.stackexchange.com", "https://english.stackexchange.com/users/85265/" ]
It is impossible to tell from the minimal description of the circumstances surrounding the guard's comment what his intentions were in saying "Nice shoes." On the one hand, there is at least a possibility that the intention was sincerely to compliment you on your shoes. After all, some consultants recommend it as an in...
This complement was likely genuine but likely also meant as a humorous, slightly sarcastic understatement. It's a stereotype almost to the point of cliche in business that you can tell who really has money by looking not at their suit, but at their shoes. The same mentality is also behind the term "well-heeled" meani...
12,375,739
I am having problems with the following statement, I know its probably something small and silly but I cant seem to find the solution. ``` $field_sql = 'SHOW FIELDS FROM '.$table ' WHERE FIELD '=''.$column'; ```
2012/09/11
[ "https://Stackoverflow.com/questions/12375739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1658413/" ]
You're missing a dot and have quotes when you don't need them: ``` $field_sql = 'SHOW FIELDS FROM ' . $table . ' WHERE FIELD = ' . $column; ^ ^^^ ^ Missing Removed extra quotes ``` However, for SQL stri...
``` $field_sql = 'SHOW FIELDS FROM ' . $table . ' WHERE FIELD = '.$column; ```
12,375,739
I am having problems with the following statement, I know its probably something small and silly but I cant seem to find the solution. ``` $field_sql = 'SHOW FIELDS FROM '.$table ' WHERE FIELD '=''.$column'; ```
2012/09/11
[ "https://Stackoverflow.com/questions/12375739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1658413/" ]
You're missing a dot and have quotes when you don't need them: ``` $field_sql = 'SHOW FIELDS FROM ' . $table . ' WHERE FIELD = ' . $column; ^ ^^^ ^ Missing Removed extra quotes ``` However, for SQL stri...
You cna try with ``` $field_sql= 'SHOW FIELDS FROM ' . $table . ' WHERE FIELD =' . $column; ```
84,679
Is there a 'psychic mode' plugin for kopete? Psychic mode is a pidgin plugin that opens up the chat dialog as soon as someone starts talking with you, before message is sent. i'm looking for the same functionality in kopete.
2009/12/17
[ "https://superuser.com/questions/84679", "https://superuser.com", "https://superuser.com/users/17980/" ]
Here you go : [kopete psyko 0.1](http://opendesktop.org/content/show.php?content=121585), Same plugin [download link 2](http://linux.softpedia.com/get/Communications/Chat/kopete-psyko-55357.shtml) Hope this helps!
In Configuration->Behavior->General, there is "Message Handling": "Open messages instantly".
13,600,351
This code works perfect for crome and firefox.. but error in IE8 ``` if($('#soundcheck').is(':checked')){ //alert('checked'); var audio = document.createElement('audio'); document.body.appendChild(audio); audio.src = system_base_url+'/soun...
2012/11/28
[ "https://Stackoverflow.com/questions/13600351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1713941/" ]
The `<audio>` tag is HTML5 and is only supported in newer browsers, such as Internet Explorer 9, Firefox, Opera, Chrome, and Safari.
Had the same problem! Try: ``` <a href="javascript: void(0);" onclick="playSound('sound.mp3');">...</a> <script language="javascript" type="text/javascript"> function playSound(soundfile) { document.getElementById("dummy").innerHTML= "<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false...
13,600,351
This code works perfect for crome and firefox.. but error in IE8 ``` if($('#soundcheck').is(':checked')){ //alert('checked'); var audio = document.createElement('audio'); document.body.appendChild(audio); audio.src = system_base_url+'/soun...
2012/11/28
[ "https://Stackoverflow.com/questions/13600351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1713941/" ]
IE 8 and earlier does not support Audio tag, you need to use some hack. Hope it can help. ``` <audio id='audio' controls> <source src="audioes/song.ogg" type="audio/ogg" /> <source src="audioes/song.mp3" type="audio/mp3" /> <div>Your browser doesn't support HTML5 audio</div> <%--Fall back on th...
Had the same problem! Try: ``` <a href="javascript: void(0);" onclick="playSound('sound.mp3');">...</a> <script language="javascript" type="text/javascript"> function playSound(soundfile) { document.getElementById("dummy").innerHTML= "<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false...
34,560,936
I want to check some user inputs with an `if statement` and depending on them, specify some parameters to send as an `ajax` request. My approach doesn't work at all. It's just not valid code: ``` $.ajax({ method : "GET", url : "test.php", data : if (...) { a: "abc", b: "def...
2016/01/01
[ "https://Stackoverflow.com/questions/34560936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/982865/" ]
I think the cleanest way is to place your condition before the request call : ``` var data; if (...) { data = {a: "abc",b: "def"}; }else{ data = {b: "ghi",c: "jkl"}; } $.ajax({ method : "GET", url : "test.php", data : data, success : function(data) { console.log(data) }, error...
You may use a self executing function to set data as: ``` var i = true; $.ajax({ method: "GET", url: '/echo/js/', data: (function() { if (i) return { a: "abc", b: "def" } else return { b: "ghi", c: "jkl" } })(), complete: function(response) { console.log(response) }, error: funct...
40,728,927
I have this table structure: **product\_skus table** ``` | id | | 1 | ... ``` **product\_sku\_values table** ``` | product_sku_id | value_id | | 1 | 1 | | 1 | 2 | | 1 | 3 | ... ``` I need the query to find the `product_sku_id`, having the three values...
2016/11/21
[ "https://Stackoverflow.com/questions/40728927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1535394/" ]
This is a canonical method: ``` select psv.product_sku_id from product_sku_values psv where psv.value_id in (1, 2, 3) group by psv.product_sku_id having count(distinct psv.value_id) = 3; ``` If you know that `product_sku_values` have no duplicates, then use `count(*)` in the `having` clause.
You can simply use `group by` clause to get all the possible values, e.g.: ``` select product_sku_id, group_concat(value_id) from product_sku_values group by product_sku_id; ``` If you are only interested in value\_id 1,2 and 3 then you can add one `where` clause, e.g: ``` select product_sku_id, group_concat(value...
60,593
Looking for movie featuring Dragons vs. Navy (or Army, but the trailer featured battleship trying to shoot the dragons down). Trailer also showed a dogfight between helicopters and dragons, capping (on the trailer) with a dragon setting a Blackhawk's blades on fire.
2014/07/03
[ "https://scifi.stackexchange.com/questions/60593", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/28220/" ]
Sounds similar to [Dragon Wars : D-War](https://en.wikipedia.org/wiki/D-War), although I haven't found a specific trailer (of which there are quite a few) with a Blackhawk's blades on fire. Plenty of dragons destroying helicopters in other ways though. Here is a [short trailer](http://www.imdb.com/video/screenplay/vi34...
This sounds very like the British film [Reign of Fire](http://en.wikipedia.org/wiki/Reign_of_Fire_%28film%29), which included several scenes of fire-breathing dragons versus helicopters. The trailer is [here](https://www.youtube.com/watch?v=Wg7bjwEXp7Y) and although there are various helicopter shots there's nothing s...
60,593
Looking for movie featuring Dragons vs. Navy (or Army, but the trailer featured battleship trying to shoot the dragons down). Trailer also showed a dogfight between helicopters and dragons, capping (on the trailer) with a dragon setting a Blackhawk's blades on fire.
2014/07/03
[ "https://scifi.stackexchange.com/questions/60593", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/28220/" ]
I saw that trailer too and then could not find it again , but stumbled across it today ,it is called Crimson Skies Only other info i could find on this is that it was originaly called Dragon seige but your guess is as good as mine as to wether its movie or game
Sounds similar to [Dragon Wars : D-War](https://en.wikipedia.org/wiki/D-War), although I haven't found a specific trailer (of which there are quite a few) with a Blackhawk's blades on fire. Plenty of dragons destroying helicopters in other ways though. Here is a [short trailer](http://www.imdb.com/video/screenplay/vi34...
60,593
Looking for movie featuring Dragons vs. Navy (or Army, but the trailer featured battleship trying to shoot the dragons down). Trailer also showed a dogfight between helicopters and dragons, capping (on the trailer) with a dragon setting a Blackhawk's blades on fire.
2014/07/03
[ "https://scifi.stackexchange.com/questions/60593", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/28220/" ]
Sounds similar to [Dragon Wars : D-War](https://en.wikipedia.org/wiki/D-War), although I haven't found a specific trailer (of which there are quite a few) with a Blackhawk's blades on fire. Plenty of dragons destroying helicopters in other ways though. Here is a [short trailer](http://www.imdb.com/video/screenplay/vi34...
MainStay Productions released a trailer on YouTube last year, about a movie project they are working on with BluFire Studios, ostensibly called Crimson Skies. The premise is that a volcanic island erupts, releasing thousands of dragons from millenia-long slumber, that attack a small fleet of Navy vessels. I checked on...
60,593
Looking for movie featuring Dragons vs. Navy (or Army, but the trailer featured battleship trying to shoot the dragons down). Trailer also showed a dogfight between helicopters and dragons, capping (on the trailer) with a dragon setting a Blackhawk's blades on fire.
2014/07/03
[ "https://scifi.stackexchange.com/questions/60593", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/28220/" ]
I saw that trailer too and then could not find it again , but stumbled across it today ,it is called Crimson Skies Only other info i could find on this is that it was originaly called Dragon seige but your guess is as good as mine as to wether its movie or game
This sounds very like the British film [Reign of Fire](http://en.wikipedia.org/wiki/Reign_of_Fire_%28film%29), which included several scenes of fire-breathing dragons versus helicopters. The trailer is [here](https://www.youtube.com/watch?v=Wg7bjwEXp7Y) and although there are various helicopter shots there's nothing s...
60,593
Looking for movie featuring Dragons vs. Navy (or Army, but the trailer featured battleship trying to shoot the dragons down). Trailer also showed a dogfight between helicopters and dragons, capping (on the trailer) with a dragon setting a Blackhawk's blades on fire.
2014/07/03
[ "https://scifi.stackexchange.com/questions/60593", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/28220/" ]
This sounds very like the British film [Reign of Fire](http://en.wikipedia.org/wiki/Reign_of_Fire_%28film%29), which included several scenes of fire-breathing dragons versus helicopters. The trailer is [here](https://www.youtube.com/watch?v=Wg7bjwEXp7Y) and although there are various helicopter shots there's nothing s...
MainStay Productions released a trailer on YouTube last year, about a movie project they are working on with BluFire Studios, ostensibly called Crimson Skies. The premise is that a volcanic island erupts, releasing thousands of dragons from millenia-long slumber, that attack a small fleet of Navy vessels. I checked on...
60,593
Looking for movie featuring Dragons vs. Navy (or Army, but the trailer featured battleship trying to shoot the dragons down). Trailer also showed a dogfight between helicopters and dragons, capping (on the trailer) with a dragon setting a Blackhawk's blades on fire.
2014/07/03
[ "https://scifi.stackexchange.com/questions/60593", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/28220/" ]
I saw that trailer too and then could not find it again , but stumbled across it today ,it is called Crimson Skies Only other info i could find on this is that it was originaly called Dragon seige but your guess is as good as mine as to wether its movie or game
MainStay Productions released a trailer on YouTube last year, about a movie project they are working on with BluFire Studios, ostensibly called Crimson Skies. The premise is that a volcanic island erupts, releasing thousands of dragons from millenia-long slumber, that attack a small fleet of Navy vessels. I checked on...
41,780,284
I have an array **InputFields**, in my situation - **six InputFields**. How can I get the text and save it from each InputField? Everything should work like this: I turn on the app, I change one, two or all of the input field, then turn off the application. Again, I turn on, and input fields have to be values which I...
2017/01/21
[ "https://Stackoverflow.com/questions/41780284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7450427/" ]
To change the list row header style you must use custom [ListRowPresenter](https://developer.android.com/reference/android/support/v17/leanback/widget/ListRowPresenter.html): ``` public class CustomListRowPresenter extends ListRowPresenter { public CustomListRowPresenter() { super(); setHeaderPrese...
Another simple way to set color for header text is to override leanback color in xml: ``` <color name="lb_browse_header_color">#f00</color> ``` advantage/drawback: it set color for all headers.
41,780,284
I have an array **InputFields**, in my situation - **six InputFields**. How can I get the text and save it from each InputField? Everything should work like this: I turn on the app, I change one, two or all of the input field, then turn off the application. Again, I turn on, and input fields have to be values which I...
2017/01/21
[ "https://Stackoverflow.com/questions/41780284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7450427/" ]
To change the list row header style you must use custom [ListRowPresenter](https://developer.android.com/reference/android/support/v17/leanback/widget/ListRowPresenter.html): ``` public class CustomListRowPresenter extends ListRowPresenter { public CustomListRowPresenter() { super(); setHeaderPrese...
Might be a bit late but for whosoever is still looking ``` <style name="AppTheme" parent="@style/Theme.AppCompat.Leanback"> <item name="rowHeaderStyle">@style/MediaHeader</item> </style> <style name="MediaHeader"> <item name="android:textAppearance">@style/MyMediaTextStyle</item> </style> <style name...
41,780,284
I have an array **InputFields**, in my situation - **six InputFields**. How can I get the text and save it from each InputField? Everything should work like this: I turn on the app, I change one, two or all of the input field, then turn off the application. Again, I turn on, and input fields have to be values which I...
2017/01/21
[ "https://Stackoverflow.com/questions/41780284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7450427/" ]
To change the list row header style you must use custom [ListRowPresenter](https://developer.android.com/reference/android/support/v17/leanback/widget/ListRowPresenter.html): ``` public class CustomListRowPresenter extends ListRowPresenter { public CustomListRowPresenter() { super(); setHeaderPrese...
Change rowHeaderStyle in your theme `<style name="Header" parent="Widget.Leanback.Header"> <item name="android:textAppearance">@style/YourApperance</item> </style>`
41,780,284
I have an array **InputFields**, in my situation - **six InputFields**. How can I get the text and save it from each InputField? Everything should work like this: I turn on the app, I change one, two or all of the input field, then turn off the application. Again, I turn on, and input fields have to be values which I...
2017/01/21
[ "https://Stackoverflow.com/questions/41780284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7450427/" ]
``` public class CustomListRowPresenter extends ListRowPresenter { public CustomListRowPresenter() { super(); setHeaderPresenter(new CustomRowHeaderPresenter()); } } class CustomRowHeaderPresenter extends RowHeaderPresenter { @Override public void onBindViewHolder(Presenter.ViewHolder ...
Another simple way to set color for header text is to override leanback color in xml: ``` <color name="lb_browse_header_color">#f00</color> ``` advantage/drawback: it set color for all headers.
41,780,284
I have an array **InputFields**, in my situation - **six InputFields**. How can I get the text and save it from each InputField? Everything should work like this: I turn on the app, I change one, two or all of the input field, then turn off the application. Again, I turn on, and input fields have to be values which I...
2017/01/21
[ "https://Stackoverflow.com/questions/41780284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7450427/" ]
``` public class CustomListRowPresenter extends ListRowPresenter { public CustomListRowPresenter() { super(); setHeaderPresenter(new CustomRowHeaderPresenter()); } } class CustomRowHeaderPresenter extends RowHeaderPresenter { @Override public void onBindViewHolder(Presenter.ViewHolder ...
Might be a bit late but for whosoever is still looking ``` <style name="AppTheme" parent="@style/Theme.AppCompat.Leanback"> <item name="rowHeaderStyle">@style/MediaHeader</item> </style> <style name="MediaHeader"> <item name="android:textAppearance">@style/MyMediaTextStyle</item> </style> <style name...
41,780,284
I have an array **InputFields**, in my situation - **six InputFields**. How can I get the text and save it from each InputField? Everything should work like this: I turn on the app, I change one, two or all of the input field, then turn off the application. Again, I turn on, and input fields have to be values which I...
2017/01/21
[ "https://Stackoverflow.com/questions/41780284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7450427/" ]
``` public class CustomListRowPresenter extends ListRowPresenter { public CustomListRowPresenter() { super(); setHeaderPresenter(new CustomRowHeaderPresenter()); } } class CustomRowHeaderPresenter extends RowHeaderPresenter { @Override public void onBindViewHolder(Presenter.ViewHolder ...
Change rowHeaderStyle in your theme `<style name="Header" parent="Widget.Leanback.Header"> <item name="android:textAppearance">@style/YourApperance</item> </style>`
41,780,284
I have an array **InputFields**, in my situation - **six InputFields**. How can I get the text and save it from each InputField? Everything should work like this: I turn on the app, I change one, two or all of the input field, then turn off the application. Again, I turn on, and input fields have to be values which I...
2017/01/21
[ "https://Stackoverflow.com/questions/41780284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7450427/" ]
Another simple way to set color for header text is to override leanback color in xml: ``` <color name="lb_browse_header_color">#f00</color> ``` advantage/drawback: it set color for all headers.
Might be a bit late but for whosoever is still looking ``` <style name="AppTheme" parent="@style/Theme.AppCompat.Leanback"> <item name="rowHeaderStyle">@style/MediaHeader</item> </style> <style name="MediaHeader"> <item name="android:textAppearance">@style/MyMediaTextStyle</item> </style> <style name...
41,780,284
I have an array **InputFields**, in my situation - **six InputFields**. How can I get the text and save it from each InputField? Everything should work like this: I turn on the app, I change one, two or all of the input field, then turn off the application. Again, I turn on, and input fields have to be values which I...
2017/01/21
[ "https://Stackoverflow.com/questions/41780284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7450427/" ]
Another simple way to set color for header text is to override leanback color in xml: ``` <color name="lb_browse_header_color">#f00</color> ``` advantage/drawback: it set color for all headers.
Change rowHeaderStyle in your theme `<style name="Header" parent="Widget.Leanback.Header"> <item name="android:textAppearance">@style/YourApperance</item> </style>`
22,060,885
here is my code ``` SELECT h.ENTERED_DATE, d.DENOMINATION, sum(h.invoice_total-h.TOTTAL_DISCOUNT)as amount FROM sales_details d LEFT JOIN sales_header h ON d.invoice_id=h.invoice_id WHERE entered_by='2254' --HERE IS NEED TO GET DETAILS CURRENT MONTH 1st Date to Sysdate GROUP BY ...
2014/02/27
[ "https://Stackoverflow.com/questions/22060885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2224206/" ]
try this: ``` WHERE entered_by='2254' AND ENTERED_DATE BETWEEN trunc (sysdate, 'mm')/*current month*/ AND SYSDATE ```
Try : ``` SELECT TRUNC(SYSDATE, 'month') FROM DUAL; ```
22,060,885
here is my code ``` SELECT h.ENTERED_DATE, d.DENOMINATION, sum(h.invoice_total-h.TOTTAL_DISCOUNT)as amount FROM sales_details d LEFT JOIN sales_header h ON d.invoice_id=h.invoice_id WHERE entered_by='2254' --HERE IS NEED TO GET DETAILS CURRENT MONTH 1st Date to Sysdate GROUP BY ...
2014/02/27
[ "https://Stackoverflow.com/questions/22060885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2224206/" ]
Mudassir's answer worked for me but I would also check the year to make sure you are not getting last year's records. ``` WHERE TO_CHAR(ENTERED_DATE, 'mm') = TO_CHAR(SYSDATE, 'mm') AND TO_CHAR(ENTERED_DATE, 'yyyy') = TO_CHAR(SYSDATE, 'yyyy') ``` Also, if you are running a large query, functions in your `WHERE` cla...
Try : ``` SELECT TRUNC(SYSDATE, 'month') FROM DUAL; ```
22,060,885
here is my code ``` SELECT h.ENTERED_DATE, d.DENOMINATION, sum(h.invoice_total-h.TOTTAL_DISCOUNT)as amount FROM sales_details d LEFT JOIN sales_header h ON d.invoice_id=h.invoice_id WHERE entered_by='2254' --HERE IS NEED TO GET DETAILS CURRENT MONTH 1st Date to Sysdate GROUP BY ...
2014/02/27
[ "https://Stackoverflow.com/questions/22060885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2224206/" ]
Try : ``` SELECT TRUNC(SYSDATE, 'month') FROM DUAL; ```
``` select 'WITHIN' as result from dual where '28-FEB-2019' between trunc(last_day(add_months(sysdate, -1))+1) and trunc(last_day(sysdate)); ``` Take care because there are many examples that are using just the month and because of that you could get records from all the year, year is not being considered. Also as y...
22,060,885
here is my code ``` SELECT h.ENTERED_DATE, d.DENOMINATION, sum(h.invoice_total-h.TOTTAL_DISCOUNT)as amount FROM sales_details d LEFT JOIN sales_header h ON d.invoice_id=h.invoice_id WHERE entered_by='2254' --HERE IS NEED TO GET DETAILS CURRENT MONTH 1st Date to Sysdate GROUP BY ...
2014/02/27
[ "https://Stackoverflow.com/questions/22060885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2224206/" ]
try this: ``` WHERE entered_by='2254' AND ENTERED_DATE BETWEEN trunc (sysdate, 'mm')/*current month*/ AND SYSDATE ```
Compare months in where condition `WHERE to_char( sysdate, 'mm' ) = to_char( ENTERED_DATE, 'mm' )` Also `WHERE EXTRACT(month FROM sysdate)=EXTRACT(month FROM ENTERED_DATE)`
22,060,885
here is my code ``` SELECT h.ENTERED_DATE, d.DENOMINATION, sum(h.invoice_total-h.TOTTAL_DISCOUNT)as amount FROM sales_details d LEFT JOIN sales_header h ON d.invoice_id=h.invoice_id WHERE entered_by='2254' --HERE IS NEED TO GET DETAILS CURRENT MONTH 1st Date to Sysdate GROUP BY ...
2014/02/27
[ "https://Stackoverflow.com/questions/22060885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2224206/" ]
Mudassir's answer worked for me but I would also check the year to make sure you are not getting last year's records. ``` WHERE TO_CHAR(ENTERED_DATE, 'mm') = TO_CHAR(SYSDATE, 'mm') AND TO_CHAR(ENTERED_DATE, 'yyyy') = TO_CHAR(SYSDATE, 'yyyy') ``` Also, if you are running a large query, functions in your `WHERE` cla...
Compare months in where condition `WHERE to_char( sysdate, 'mm' ) = to_char( ENTERED_DATE, 'mm' )` Also `WHERE EXTRACT(month FROM sysdate)=EXTRACT(month FROM ENTERED_DATE)`
22,060,885
here is my code ``` SELECT h.ENTERED_DATE, d.DENOMINATION, sum(h.invoice_total-h.TOTTAL_DISCOUNT)as amount FROM sales_details d LEFT JOIN sales_header h ON d.invoice_id=h.invoice_id WHERE entered_by='2254' --HERE IS NEED TO GET DETAILS CURRENT MONTH 1st Date to Sysdate GROUP BY ...
2014/02/27
[ "https://Stackoverflow.com/questions/22060885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2224206/" ]
Compare months in where condition `WHERE to_char( sysdate, 'mm' ) = to_char( ENTERED_DATE, 'mm' )` Also `WHERE EXTRACT(month FROM sysdate)=EXTRACT(month FROM ENTERED_DATE)`
``` select 'WITHIN' as result from dual where '28-FEB-2019' between trunc(last_day(add_months(sysdate, -1))+1) and trunc(last_day(sysdate)); ``` Take care because there are many examples that are using just the month and because of that you could get records from all the year, year is not being considered. Also as y...
22,060,885
here is my code ``` SELECT h.ENTERED_DATE, d.DENOMINATION, sum(h.invoice_total-h.TOTTAL_DISCOUNT)as amount FROM sales_details d LEFT JOIN sales_header h ON d.invoice_id=h.invoice_id WHERE entered_by='2254' --HERE IS NEED TO GET DETAILS CURRENT MONTH 1st Date to Sysdate GROUP BY ...
2014/02/27
[ "https://Stackoverflow.com/questions/22060885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2224206/" ]
try this: ``` WHERE entered_by='2254' AND ENTERED_DATE BETWEEN trunc (sysdate, 'mm')/*current month*/ AND SYSDATE ```
Mudassir's answer worked for me but I would also check the year to make sure you are not getting last year's records. ``` WHERE TO_CHAR(ENTERED_DATE, 'mm') = TO_CHAR(SYSDATE, 'mm') AND TO_CHAR(ENTERED_DATE, 'yyyy') = TO_CHAR(SYSDATE, 'yyyy') ``` Also, if you are running a large query, functions in your `WHERE` cla...
22,060,885
here is my code ``` SELECT h.ENTERED_DATE, d.DENOMINATION, sum(h.invoice_total-h.TOTTAL_DISCOUNT)as amount FROM sales_details d LEFT JOIN sales_header h ON d.invoice_id=h.invoice_id WHERE entered_by='2254' --HERE IS NEED TO GET DETAILS CURRENT MONTH 1st Date to Sysdate GROUP BY ...
2014/02/27
[ "https://Stackoverflow.com/questions/22060885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2224206/" ]
try this: ``` WHERE entered_by='2254' AND ENTERED_DATE BETWEEN trunc (sysdate, 'mm')/*current month*/ AND SYSDATE ```
``` select 'WITHIN' as result from dual where '28-FEB-2019' between trunc(last_day(add_months(sysdate, -1))+1) and trunc(last_day(sysdate)); ``` Take care because there are many examples that are using just the month and because of that you could get records from all the year, year is not being considered. Also as y...
22,060,885
here is my code ``` SELECT h.ENTERED_DATE, d.DENOMINATION, sum(h.invoice_total-h.TOTTAL_DISCOUNT)as amount FROM sales_details d LEFT JOIN sales_header h ON d.invoice_id=h.invoice_id WHERE entered_by='2254' --HERE IS NEED TO GET DETAILS CURRENT MONTH 1st Date to Sysdate GROUP BY ...
2014/02/27
[ "https://Stackoverflow.com/questions/22060885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2224206/" ]
Mudassir's answer worked for me but I would also check the year to make sure you are not getting last year's records. ``` WHERE TO_CHAR(ENTERED_DATE, 'mm') = TO_CHAR(SYSDATE, 'mm') AND TO_CHAR(ENTERED_DATE, 'yyyy') = TO_CHAR(SYSDATE, 'yyyy') ``` Also, if you are running a large query, functions in your `WHERE` cla...
``` select 'WITHIN' as result from dual where '28-FEB-2019' between trunc(last_day(add_months(sysdate, -1))+1) and trunc(last_day(sysdate)); ``` Take care because there are many examples that are using just the month and because of that you could get records from all the year, year is not being considered. Also as y...
495,643
I have CentOS 5.8 on my computer, with 5x 1TB hard drives. I used software RAID. (RAID 1 as a boot partition md0, RAID 0 as a root partition md1 and RAID 5 as /home partition md3). Unfortunately one of these hard drives failed lately and I want to replace it with a new one. I want to know that is it possible to chan...
2012/10/29
[ "https://superuser.com/questions/495643", "https://superuser.com", "https://superuser.com/users/163708/" ]
The folks at this location actually mapped the serial numbers of the physical disks to separate names to help identify those in the RAID array. They used UDEV rules for it. This eliminates the guesswork since serial numbers are typically written on the disk paper labels. In the below link you'll find real 2 drive fail...
It should be something like ``` mdadm --add /dev/md3 /dev/<disk> ``` … where `<disk>` is of the form `sda1`, `sdb1`, `sdc1`, etc.
495,643
I have CentOS 5.8 on my computer, with 5x 1TB hard drives. I used software RAID. (RAID 1 as a boot partition md0, RAID 0 as a root partition md1 and RAID 5 as /home partition md3). Unfortunately one of these hard drives failed lately and I want to replace it with a new one. I want to know that is it possible to chan...
2012/10/29
[ "https://superuser.com/questions/495643", "https://superuser.com", "https://superuser.com/users/163708/" ]
The folks at this location actually mapped the serial numbers of the physical disks to separate names to help identify those in the RAID array. They used UDEV rules for it. This eliminates the guesswork since serial numbers are typically written on the disk paper labels. In the below link you'll find real 2 drive fail...
Assuming you disk setup is as follows: ![Disk layout constructed from the comments](https://i.stack.imgur.com/ap6cJ.png) With: sda1 and sdb1 as md1 (mirrored) root sda2 and sdb2 as md0 (striped) boot sda3, sdb3, sdc1, sdd1 and sde1 as md2 (RAID5) /home Since you lost drive 2 (sdb) you: * You lost md0. A str...
14,855,400
I need to export the images stored in **CompanyImage** table to a *image files*. How can I do it? Reading the table I obtain a Bitmap field but how to know the type of image to build the correct extension and save it to file?
2013/02/13
[ "https://Stackoverflow.com/questions/14855400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/160787/" ]
Finally I found the solution. To export the image from CompanyImage: ``` // Grant clrinterop permission. new InteropPermission(InteropKind::ClrInterop).assert(); image = new Image(); image.setData(companyImage.Image); result = image.saveImage(@"c:\test.jpg",3); CodeAccessPermission::revertA...
The above code wouldn't work right away. Here's the code that would run: ``` bindata bin = new bindata(); str content; container image; CompanyImage companyImage; ; select companyImage; image = companyImage.Image; bin.setData(image); content=bin.base64Encode(); AifUtil::saveBase64ToFile("c:\\temp\\test.tif", conten...
51,983,002
In my current application for a company Im having a ForegroundService that is running while the workers are on duty (logged in to the app). It is important to keep that foreground service running while users are logged in. To recover from cases where this foreground service gets killed somehow (User task swipe acciden...
2018/08/23
[ "https://Stackoverflow.com/questions/51983002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7798869/" ]
Possible solutions to codepoint slicing --------------------------------------- > > I know I can use the `chars()` iterator and manually walk through the desired substring, but is there a more concise way? > > > If you know the exact byte indices, you can slice a string: ``` let text = "Hello привет"; println!("...
A UTF-8 encoded string may contain characters which consists of multiple bytes. In your case, `п` starts at index 6 (inclusive) and ends at position 8 (exclusive) so indexing 7 is not the start of the character. This is why your error occurred. You may use [`str::char_indices()`](https://doc.rust-lang.org/std/primitiv...
51,983,002
In my current application for a company Im having a ForegroundService that is running while the workers are on duty (logged in to the app). It is important to keep that foreground service running while users are logged in. To recover from cases where this foreground service gets killed somehow (User task swipe acciden...
2018/08/23
[ "https://Stackoverflow.com/questions/51983002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7798869/" ]
Possible solutions to codepoint slicing --------------------------------------- > > I know I can use the `chars()` iterator and manually walk through the desired substring, but is there a more concise way? > > > If you know the exact byte indices, you can slice a string: ``` let text = "Hello привет"; println!("...
Here is a function which retrieves a utf8 slice, with the following pros: * handle all edge cases (empty input, 0-width output ranges, out-of-scope ranges); * never panics; * use start-inclusive, end-exclusive ranges. ``` pub fn utf8_slice(s: &str, start: usize, end: usize) -> Option<&str> { let mut iter = s.char...
51,983,002
In my current application for a company Im having a ForegroundService that is running while the workers are on duty (logged in to the app). It is important to keep that foreground service running while users are logged in. To recover from cases where this foreground service gets killed somehow (User task swipe acciden...
2018/08/23
[ "https://Stackoverflow.com/questions/51983002", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7798869/" ]
A UTF-8 encoded string may contain characters which consists of multiple bytes. In your case, `п` starts at index 6 (inclusive) and ends at position 8 (exclusive) so indexing 7 is not the start of the character. This is why your error occurred. You may use [`str::char_indices()`](https://doc.rust-lang.org/std/primitiv...
Here is a function which retrieves a utf8 slice, with the following pros: * handle all edge cases (empty input, 0-width output ranges, out-of-scope ranges); * never panics; * use start-inclusive, end-exclusive ranges. ``` pub fn utf8_slice(s: &str, start: usize, end: usize) -> Option<&str> { let mut iter = s.char...
2,016,329
> > If $\alpha = 2\arctan(2\sqrt{2}-1)$ and $\displaystyle \beta = 3\arcsin\left(\frac{1}{3}\right)+\arcsin\left(\frac{3}{5}\right)\;,$ Then prove that $\alpha>\beta$ > > > $\bf{My\; Try::}$ Given $$ \alpha = \arctan \bigg(\frac{2(2\sqrt{2}-1)}{1-(2\sqrt{2}-1)^2}\bigg)=\arctan \bigg(\frac{(2\sqrt{2}-1)}{2\sqrt{2}-...
2016/11/16
[ "https://math.stackexchange.com/questions/2016329", "https://math.stackexchange.com", "https://math.stackexchange.com/users/14311/" ]
HINT: As $\arcsin\dfrac13<\arcsin\dfrac12=\dfrac\pi6$ $3\arcsin\dfrac13=\arcsin\dfrac{23}{27}=\arctan\dfrac{23}{10\sqrt2}$ $\arcsin\dfrac35=\arctan\dfrac34$ As $\dfrac{23}{10\sqrt2}\cdot\dfrac34>1,$ using [Inverse trigonometric function identity doubt: $\tan^{-1}x+\tan^{-1}y =-\pi+\tan^{-1}\left(\frac{x+y}{1-xy}\r...
\begin{align} \beta&=\sqrt{10}\left(\frac{3}{\sqrt{10}}\arcsin\frac13+\frac{1}{\sqrt{10}}\arcsin\frac35\right)\\ &<\sqrt{10}\arcsin\left(\frac{4\sqrt{10}}{25}\right) \end{align} where I use the convexity of $\arcsin$. On the other hand using the definition of $\arctan$ we obtain $$\arcsin\left(\frac{4\sqrt{10}}{25}\rig...
2,016,329
> > If $\alpha = 2\arctan(2\sqrt{2}-1)$ and $\displaystyle \beta = 3\arcsin\left(\frac{1}{3}\right)+\arcsin\left(\frac{3}{5}\right)\;,$ Then prove that $\alpha>\beta$ > > > $\bf{My\; Try::}$ Given $$ \alpha = \arctan \bigg(\frac{2(2\sqrt{2}-1)}{1-(2\sqrt{2}-1)^2}\bigg)=\arctan \bigg(\frac{(2\sqrt{2}-1)}{2\sqrt{2}-...
2016/11/16
[ "https://math.stackexchange.com/questions/2016329", "https://math.stackexchange.com", "https://math.stackexchange.com/users/14311/" ]
On the one hand we have $$\tan{\alpha\over2}=2\sqrt{2}-1>\sqrt{3}=\tan{\pi\over3}\ ,$$ hence ${\alpha\over2}>{\pi\over3}$, or $$\alpha>{2\pi\over3}\ .$$ On the other hand the convexity of $$t\mapsto\arcsin t\qquad(0\leq t\leq{\pi\over2})$$ implies $$\arcsin{1\over3}<{2\over3}\arcsin{1\over2}={2\over3}\>{\pi\over6}={\p...
\begin{align} \beta&=\sqrt{10}\left(\frac{3}{\sqrt{10}}\arcsin\frac13+\frac{1}{\sqrt{10}}\arcsin\frac35\right)\\ &<\sqrt{10}\arcsin\left(\frac{4\sqrt{10}}{25}\right) \end{align} where I use the convexity of $\arcsin$. On the other hand using the definition of $\arctan$ we obtain $$\arcsin\left(\frac{4\sqrt{10}}{25}\rig...
16,432,909
I am making a custom Application in Android. I am displaying a html page with an img tag inside a div. ``` <div class="press"> <img src="but.png" width="150" height="62" border="0"/> </div> ``` In the javascript I am writing: ``` $(".press").bind("click",function() { //display something }); ``` When I cli...
2013/05/08
[ "https://Stackoverflow.com/questions/16432909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2360830/" ]
You can prevent selection on your page through css. You can change the \* selector to the element selector you want to prevent from selection. ``` /*IE9*/ *::selection { background-color:transparent; } *::-moz-selection { background-color:transparent; } * { -webkit-user-select: none; -moz-use...
It may be the background color or the border color on the div that includes the button. Else use a code like following to remove the css after click completely ``` $("#myButton").click(function(){ $("#displayPanel div").removeClass('someClass'); }); ```
16,432,909
I am making a custom Application in Android. I am displaying a html page with an img tag inside a div. ``` <div class="press"> <img src="but.png" width="150" height="62" border="0"/> </div> ``` In the javascript I am writing: ``` $(".press").bind("click",function() { //display something }); ``` When I cli...
2013/05/08
[ "https://Stackoverflow.com/questions/16432909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2360830/" ]
You can prevent selection on your page through css. You can change the \* selector to the element selector you want to prevent from selection. ``` /*IE9*/ *::selection { background-color:transparent; } *::-moz-selection { background-color:transparent; } * { -webkit-user-select: none; -moz-use...
Try this: **CSS** ``` .press, img, .press:focus, img:focus{ outline: 0 !important; border:0 none !important; } ```
16,432,909
I am making a custom Application in Android. I am displaying a html page with an img tag inside a div. ``` <div class="press"> <img src="but.png" width="150" height="62" border="0"/> </div> ``` In the javascript I am writing: ``` $(".press").bind("click",function() { //display something }); ``` When I cli...
2013/05/08
[ "https://Stackoverflow.com/questions/16432909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2360830/" ]
You can prevent selection on your page through css. You can change the \* selector to the element selector you want to prevent from selection. ``` /*IE9*/ *::selection { background-color:transparent; } *::-moz-selection { background-color:transparent; } * { -webkit-user-select: none; -moz-use...
You could use CSS: \*\* HTML \*\* ``` <button class="press"> <img src="but.png" width="150" height="62" border="0"/> </button> ``` \*\* CSS \*\* ``` .press{ outline-width: 0; } .press:focus{ outline: none; } ``` Answer take from here: [How to remove the border highlight on an input text element](ht...
16,432,909
I am making a custom Application in Android. I am displaying a html page with an img tag inside a div. ``` <div class="press"> <img src="but.png" width="150" height="62" border="0"/> </div> ``` In the javascript I am writing: ``` $(".press").bind("click",function() { //display something }); ``` When I cli...
2013/05/08
[ "https://Stackoverflow.com/questions/16432909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2360830/" ]
Try this: **CSS** ``` .press, img, .press:focus, img:focus{ outline: 0 !important; border:0 none !important; } ```
It may be the background color or the border color on the div that includes the button. Else use a code like following to remove the css after click completely ``` $("#myButton").click(function(){ $("#displayPanel div").removeClass('someClass'); }); ```
16,432,909
I am making a custom Application in Android. I am displaying a html page with an img tag inside a div. ``` <div class="press"> <img src="but.png" width="150" height="62" border="0"/> </div> ``` In the javascript I am writing: ``` $(".press").bind("click",function() { //display something }); ``` When I cli...
2013/05/08
[ "https://Stackoverflow.com/questions/16432909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2360830/" ]
You could use CSS: \*\* HTML \*\* ``` <button class="press"> <img src="but.png" width="150" height="62" border="0"/> </button> ``` \*\* CSS \*\* ``` .press{ outline-width: 0; } .press:focus{ outline: none; } ``` Answer take from here: [How to remove the border highlight on an input text element](ht...
It may be the background color or the border color on the div that includes the button. Else use a code like following to remove the css after click completely ``` $("#myButton").click(function(){ $("#displayPanel div").removeClass('someClass'); }); ```
364,027
in the image suppose A is an observer. a box length of 1 light second is moving away from A with a velocity of half of the speed of light. a laser is shot from the front side of the box(C) to the opposite side of the box meaning that the light is going to the opposite direction of the velocity of the box. if there is ...
2017/10/20
[ "https://physics.stackexchange.com/questions/364027", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/136782/" ]
Before I start, we have to agree on what Huygens’ principle says. The Wikipedia page you cite does a poor job at presenting Huygens’ original idea, instead entirely focusing on Fresnel’s addition to it (the article is titled Huygens-Fresnel principle after all). You may know what I am going to explain but it may be sti...
The wind basically adds new sources for waves that also have to be considered regarding Huygens' principle. These new wave sources will look different depending on the wind you choose. Maybe you can imagine it as if you would throw a lot of little stone everywhere the wind hits the water. After the wind stops the princ...
1,886,580
I am in a early stage of a project, graphically modelling the system structure. Is there any widely accepted graphical notation for showing interface "bundles"? Interface bundles would be a collection of several separate interfaces (belonging together) which are aggregated in order to reduce figure complexity. Exam...
2009/12/11
[ "https://Stackoverflow.com/questions/1886580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74168/" ]
So, it all depends on what you are trying to say from a modeling perspective. Options 3 could be your hinting, but there are other options. 1. Use packages for grouping and add a keyword of 'group'/'interface set' plus name the package what the grouping should be called as, not my personal favorite, but common, becaus...
If you're using UML, I think the relevant diagram is a component diagram, which you could use to easily capture component ("bundles") and describe their interfaces. example: [Component diagram example](http://images.google.com/imgres?imgurl=http://images.devshed.com/ds/stories/Introducing%2520UML/image%25204.jpg&imgre...
1,886,580
I am in a early stage of a project, graphically modelling the system structure. Is there any widely accepted graphical notation for showing interface "bundles"? Interface bundles would be a collection of several separate interfaces (belonging together) which are aggregated in order to reduce figure complexity. Exam...
2009/12/11
[ "https://Stackoverflow.com/questions/1886580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/74168/" ]
So, it all depends on what you are trying to say from a modeling perspective. Options 3 could be your hinting, but there are other options. 1. Use packages for grouping and add a keyword of 'group'/'interface set' plus name the package what the grouping should be called as, not my personal favorite, but common, becaus...
Sounds like component diagrams would be useful here. Check out the following example: [![Component diagram](https://i.stack.imgur.com/HeVkP.png)](https://i.stack.imgur.com/HeVkP.png) **UML Component Diagrams: Reference**: <http://msdn.microsoft.com/en-us/library/dd409390%28VS.100%29.aspx>
7,778,025
I am using TabView for an activity layout. Unfortunately, the first time that I enter the acticity, TabView displays the content of all tabs at the same time, creating corrupted output. My layout uses an ImageView for the background and adds on top of it the TabHost. The ScrollView is there because the content of some...
2011/10/15
[ "https://Stackoverflow.com/questions/7778025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/140227/" ]
How about this (only the changed parts shown):- ``` // Handler interface interface IHandles<T> where T : ICommand { void Handle(T command); } // Bus interface interface IBus { void Publish<T>(T cmd) where T : ICommand; } // Bus implementation class BusImpl : IBus { public void Publish<T>(T cmd) where T :...
Does this work? Your IoC is returning object, consider returning T instead then you wont have to handle type ambiguity as done below. ``` public void Publish(ICommand cmd) { var cmdType = cmd.GetType(); var handler = IoC.Resolve(typeof(IHandles<>).MakeGenericType(cmdType)) as IHandles<ICommand>; if (handle...
8,357,942
I'm loading a very large data set into R from java. I have created a Java program that calls R using rJava's jri. This program has been wrapped up into an executable jar file and is being called from the terminal (linux). The data is in region of 50 columns by 13.7 million rows. R alone can handle this without a proble...
2011/12/02
[ "https://Stackoverflow.com/questions/8357942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/952425/" ]
Have you tried adjusting the JVM Heap size by starting the executable with options? Like: ``` java -Xmx1024m -Xms1024m myJar ``` You can adjust the memory values, obviously, but the option `-Xmx` sets the maximum heap size for the JVM and `-Xms` sets the initial size. This may help if you are processing a lot of d...
One way to do it that would allow you to call R without having anything come back to Java would be to call R as an external process. Since it looks like that is roughly what you are doing anyway, perhaps having the OS execute the call to R, rather than the library inside of Java, would prevent the overflow.
14,900,906
I am trying to create a image button and I want to give the specific width and height to it, but my image size 512 x 512 and when activity starts layout is distorted because of the image. Is there anyway I can resize it to some specific size? ``` <Button android:id="@+id/prev" andr...
2013/02/15
[ "https://Stackoverflow.com/questions/14900906", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1725388/" ]
Yes. Set your layout\_width and layout\_height to numeric values and it will fix the image to that exact size. You can then control how its scaled or cropped vi the scaleType parameter. Be careful specifying dp or px- dp will let you specify it in 160ths of an inch, px will be phyiscal pixels (but may be any real world...
You can specify the size in `px` which will be physical pixels instead of `dp` (Density-independent pixel); **However**, you should **not** do this if your app should support multiple screens. Also, consider using `android:layout_height` and `android:layout_width` instead of `height` and `width`
70,405,640
What should be the css to align them in the same line? ``` <div class="discount-tab"> <h1 class="discount-heading">Book your first adventure with us at 10% discount</h1> <button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent">Book now</button> </div> ```
2021/12/18
[ "https://Stackoverflow.com/questions/70405640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17223877/" ]
You can set the `h1` tag to: `display: inline-block`. It'll only take up the space it needs that way. Another approach, which might be even better is to make use of flexbox. Flexbox can align all the items vertically and/or horizontally. ``` .discount-tab { display: flex; flex-direction: row; align-items:...
You can use `FlexBox` like this:([here](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox) you can read more about `FlexBox`) ```css .discount-tab { display: flex; align-items: center; } ``` ```html <div class="discount-tab"> <h1 class="discount-heading">Book you...
70,405,640
What should be the css to align them in the same line? ``` <div class="discount-tab"> <h1 class="discount-heading">Book your first adventure with us at 10% discount</h1> <button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent">Book now</button> </div> ```
2021/12/18
[ "https://Stackoverflow.com/questions/70405640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17223877/" ]
You can use `FlexBox` like this:([here](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox) you can read more about `FlexBox`) ```css .discount-tab { display: flex; align-items: center; } ``` ```html <div class="discount-tab"> <h1 class="discount-heading">Book you...
You can use [grid](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout) `display: grid;` and add styling to button a little. ```css .discount-tab { display: grid; align-items: center; justify-content: center; grid-template-columns: 4fr 1fr; } .mdl-button { max-width: 100px; } ``` ```html <div ...