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
2,001,967
**strong text**I have a base class with a method in it for synchronizing data. However I need to be able to create a new object in the process that is the same as the parent object that inherited the base class. I want to do something like this: ``` Sub Transfer(ByVal OBType As BaseClass) Dim A as new typeof(OBT...
2010/01/04
[ "https://Stackoverflow.com/questions/2001967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35331/" ]
I have commented above as well, because there are few options to consider - but by the sound of it your initial description I think you could get away with a simple SAX processor here: which will probably run faster (although it might not look as pretty when it comes to mapping the Java class) than other mechanisms: T...
Avoid anything that is a DOM parser - no need for that, especially with a large-ish file and relatively simple XML syntax. Which specific one to use, sorry, I haven't used them, so I can't give you any more guidance than to look at your licensing, performance, and support (for questions).
2,001,967
**strong text**I have a base class with a method in it for synchronizing data. However I need to be able to create a new object in the process that is the same as the parent object that inherited the base class. I want to do something like this: ``` Sub Transfer(ByVal OBType As BaseClass) Dim A as new typeof(OBT...
2010/01/04
[ "https://Stackoverflow.com/questions/2001967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35331/" ]
My favorite XML library is Dom4j
Whenever I have to deal with XML I just use [XMLBeans](http://xmlbeans.apache.org/). It may be overkill for what you are after, but it makes life easy (once you know how to use it).
2,001,967
**strong text**I have a base class with a method in it for synchronizing data. However I need to be able to create a new object in the process that is the same as the parent object that inherited the base class. I want to do something like this: ``` Sub Transfer(ByVal OBType As BaseClass) Dim A as new typeof(OBT...
2010/01/04
[ "https://Stackoverflow.com/questions/2001967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35331/" ]
Avoid anything that is a DOM parser - no need for that, especially with a large-ish file and relatively simple XML syntax. Which specific one to use, sorry, I haven't used them, so I can't give you any more guidance than to look at your licensing, performance, and support (for questions).
If you don't care about performance at all, [Apache Digester](http://commons.apache.org/digester/) may be useful for you, as it will already initialize the Java objects for you after you define the rules.
2,001,967
**strong text**I have a base class with a method in it for synchronizing data. However I need to be able to create a new object in the process that is the same as the parent object that inherited the base class. I want to do something like this: ``` Sub Transfer(ByVal OBType As BaseClass) Dim A as new typeof(OBT...
2010/01/04
[ "https://Stackoverflow.com/questions/2001967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35331/" ]
> > *I kinda like XPath, but people suggested Stax and even VDT-XML. What should I do.* > > > DOM, SAX and VTD-XML are all three different ways to parse a XML document. Roughly in this order of memory efficiency. DOM needs over 5 times of memory as XML file big is. SAX is only a bit more efficient, VTD-XML uses on...
Whenever I have to deal with XML I just use [XMLBeans](http://xmlbeans.apache.org/). It may be overkill for what you are after, but it makes life easy (once you know how to use it).
2,001,967
**strong text**I have a base class with a method in it for synchronizing data. However I need to be able to create a new object in the process that is the same as the parent object that inherited the base class. I want to do something like this: ``` Sub Transfer(ByVal OBType As BaseClass) Dim A as new typeof(OBT...
2010/01/04
[ "https://Stackoverflow.com/questions/2001967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35331/" ]
I have commented above as well, because there are few options to consider - but by the sound of it your initial description I think you could get away with a simple SAX processor here: which will probably run faster (although it might not look as pretty when it comes to mapping the Java class) than other mechanisms: T...
500 kb is not that large. If you like XPath, go for it.
2,001,967
**strong text**I have a base class with a method in it for synchronizing data. However I need to be able to create a new object in the process that is the same as the parent object that inherited the base class. I want to do something like this: ``` Sub Transfer(ByVal OBType As BaseClass) Dim A as new typeof(OBT...
2010/01/04
[ "https://Stackoverflow.com/questions/2001967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35331/" ]
Avoid anything that is a DOM parser - no need for that, especially with a large-ish file and relatively simple XML syntax. Which specific one to use, sorry, I haven't used them, so I can't give you any more guidance than to look at your licensing, performance, and support (for questions).
Whenever I have to deal with XML I just use [XMLBeans](http://xmlbeans.apache.org/). It may be overkill for what you are after, but it makes life easy (once you know how to use it).
2,001,967
**strong text**I have a base class with a method in it for synchronizing data. However I need to be able to create a new object in the process that is the same as the parent object that inherited the base class. I want to do something like this: ``` Sub Transfer(ByVal OBType As BaseClass) Dim A as new typeof(OBT...
2010/01/04
[ "https://Stackoverflow.com/questions/2001967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35331/" ]
I have commented above as well, because there are few options to consider - but by the sound of it your initial description I think you could get away with a simple SAX processor here: which will probably run faster (although it might not look as pretty when it comes to mapping the Java class) than other mechanisms: T...
Whenever I have to deal with XML I just use [XMLBeans](http://xmlbeans.apache.org/). It may be overkill for what you are after, but it makes life easy (once you know how to use it).
2,001,967
**strong text**I have a base class with a method in it for synchronizing data. However I need to be able to create a new object in the process that is the same as the parent object that inherited the base class. I want to do something like this: ``` Sub Transfer(ByVal OBType As BaseClass) Dim A as new typeof(OBT...
2010/01/04
[ "https://Stackoverflow.com/questions/2001967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35331/" ]
> > *I kinda like XPath, but people suggested Stax and even VDT-XML. What should I do.* > > > DOM, SAX and VTD-XML are all three different ways to parse a XML document. Roughly in this order of memory efficiency. DOM needs over 5 times of memory as XML file big is. SAX is only a bit more efficient, VTD-XML uses on...
If you don't care about performance at all, [Apache Digester](http://commons.apache.org/digester/) may be useful for you, as it will already initialize the Java objects for you after you define the rules.
2,001,967
**strong text**I have a base class with a method in it for synchronizing data. However I need to be able to create a new object in the process that is the same as the parent object that inherited the base class. I want to do something like this: ``` Sub Transfer(ByVal OBType As BaseClass) Dim A as new typeof(OBT...
2010/01/04
[ "https://Stackoverflow.com/questions/2001967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35331/" ]
500 kb is not that large. If you like XPath, go for it.
If you don't care about performance at all, [Apache Digester](http://commons.apache.org/digester/) may be useful for you, as it will already initialize the Java objects for you after you define the rules.
2,001,967
**strong text**I have a base class with a method in it for synchronizing data. However I need to be able to create a new object in the process that is the same as the parent object that inherited the base class. I want to do something like this: ``` Sub Transfer(ByVal OBType As BaseClass) Dim A as new typeof(OBT...
2010/01/04
[ "https://Stackoverflow.com/questions/2001967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35331/" ]
I have commented above as well, because there are few options to consider - but by the sound of it your initial description I think you could get away with a simple SAX processor here: which will probably run faster (although it might not look as pretty when it comes to mapping the Java class) than other mechanisms: T...
My favorite XML library is Dom4j
325,363
I have been a member of many SE sites for years now, as a result, I am quite familiar with the guidelines and expectations on the platform. However, even after reviewing the help section I can't seem to find much info on this topic. I saw the topic on jokes (which was answered with ambiguity) but nothing on comments l...
2019/03/18
[ "https://meta.stackexchange.com/questions/325363", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/496342/" ]
This is covered in the [Help Center](https://meta.stackexchange.com/help/privileges/comment): > > ### When shouldn't I comment? > > > Comments are not recommended for any of the following: [...] > > > * Compliments which do not add new information ("+1, great answer!"); instead, up-vote it and [pay it forward](ht...
There seem to be two different situations you're talking about: jokes in comments and "thank you" comments. "Thank you" comments or other useless comments that add up to nothing but thanking the poster of a question or answer should be flagged as "no longer needed". These should be expressed in the form of an upvote a...
56,285,677
I am using Bootstrap 4+ to create a card with collapsable card-body, triggered by a link in the card-head. ``` <div class="card text-left mb-3 mt-3"> <div class="card-head p-3"> <h4>How do we get started?</h4> <a class="float-right" data-toggle="collapse" href="#collapse1" aria-expanded="false" aria-controls...
2019/05/24
[ "https://Stackoverflow.com/questions/56285677", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7522285/" ]
Just add `d-flex justify-content-between` classes with your `card-head` class will resolve your issue. I hope it'll help you out. Thanks > > **Bootstrap 4 Flexbox - [Documentation](https://getbootstrap.com/docs/4.3/utilities/flex/)** > > > ```html <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bo...
You can use `d-flex align-items-center` which is available in Bootstrap 4+ in your `card-head` and also you don't need to use `float-right` instead you can use `ml-auto`. Something like this ``` <div class="card text-left mb-3 mt-3"> <div class="d-flex align-items-center card-head p-3"> <h4>How do we get started...
382,619
I would like to add some RAM to my laptop but I have one small problem: I would like to know what is the fastest speed I can put inside it. I know from CPU-Z that I use DDR3 RAM: One piece of RAM is PC3-10700 (667 Mhz) and the other is PC3-8500F (533 Mhz) I use Acer Travel Mate 5742G if that's relevant. My Chipset ...
2012/01/26
[ "https://superuser.com/questions/382619", "https://superuser.com", "https://superuser.com/users/73377/" ]
You laptop will take up to 8GB and the fastest speed it will take is DDR3 PC3-10600 . You can buy it here >> <http://www.crucial.com/store/mpartspecs.aspx?mtbpoid=E5A23A8EA5CA7304>
You can put a faster ram, it will just run at a slower speed. I’ve had once some 133MHz SDR sticks running at 100MHz.
212,192
I have a field name 'field\_new' in a content type 'article'. I want to insert the value of node title on this field (all the nodes) programatically. What I have done to achieve, I am using hook\_node\_update for this, but it is not updating the field values. ``` function modulename_node_update($node) { $new_value ...
2016/08/20
[ "https://drupal.stackexchange.com/questions/212192", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/63452/" ]
[hook\_node\_update](https://api.drupal.org/api/drupal/modules%21node%21node.api.php/function/hook_node_update/7.x) - Respond to updates to a node. This is useful when you wants to update a field during node save. This will not helpful in this case because you wants to update all your exiting nodes. 1.Hope this code w...
As per the "*It would be great if there are another alternatives to do this*" in your question: yes there are alternatives, using [Rules](https://www.drupal.org/project/rules) and [Views Bulk Operations](https://www.drupal.org/project/views_bulk_operations) and without writing custom code, as further detailed below ......
4,006,771
How can I point imagemagick to a directory of images and use the adaptive sharpen tool to increase the sharpness of all the files in the folder? Thank you.
2010/10/24
[ "https://Stackoverflow.com/questions/4006771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/216605/" ]
This really belongs on SuperUser i think as it relates more to general purpose scripting as opposed to programming... However, if youre \*nix you could do the following with a bash script: ``` for f in /path/to/images/*; \ do echo "Sharpening $f file.." \ && OUTPUT_FILE="sharpened.`basename $f`" \ && echo "Output to $...
Similar question has been asked and answered on the ImageMagick forum [How to "Smart Sharpen," adaptive-sharpen not working](http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=10266) > > I'd like to be able to batch sharpen > my photos, then just work on the ones that need more attention. > > >
4,006,771
How can I point imagemagick to a directory of images and use the adaptive sharpen tool to increase the sharpness of all the files in the folder? Thank you.
2010/10/24
[ "https://Stackoverflow.com/questions/4006771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/216605/" ]
This really belongs on SuperUser i think as it relates more to general purpose scripting as opposed to programming... However, if youre \*nix you could do the following with a bash script: ``` for f in /path/to/images/*; \ do echo "Sharpening $f file.." \ && OUTPUT_FILE="sharpened.`basename $f`" \ && echo "Output to $...
``` ls *.jpg|xargs -n 1 -P #cpus -t command_to_sharpen ``` There's also a good wrapper for the protocol described here: <http://gimpguru.org/Tutorials/SmartSharpening2/> at <http://astoryworthtelling.wordpress.com/2011/03/28/smart-sharpening-in-imagemagick/>
3,802,045
Say that I have $f\_{XYZ} = C$ that is defined within a 3-D sphere and that it's constant. If I want to obtain $f\_X$, I have to integrate over $Y$ and $Z$ dimensions. What is the easiest way to do this, and how do I determine the limits of integration? For within a sphere, I know we have to satisfy $$ X^2 + Y^2 + Z^2...
2020/08/24
[ "https://math.stackexchange.com/questions/3802045", "https://math.stackexchange.com", "https://math.stackexchange.com/users/325981/" ]
If you interset the plane $\{X=x\}\cap\mathbb{R}^3$ with the ball $\{X^2+Y^2+Z^2 \leq R^2\}\cap\mathbb{R}^3$ for fixed $x\in[-R,R]$ and project onto the $yz-$plane you're looking at the disc $$\{Y^2+Z^2\leq R^2-x^2\}\cap\mathbb{R}^2$$ That being said, $$f\_X(x)=\int\_{-\sqrt{R^2-x^2}}^{\sqrt{R^2-x^2}}\int\_{-\sqrt{R^2-...
Easiest way is to see that when you solve your result for $z$, you get $$ z = \pm \sqrt{R^2-x^2-y^2}, $$ which will be the bounds on the inner integral. Now when you collapse the sphere to the $xy$-plane, you end up with $x^2+y^2 < R^2$ and so $y = \pm \sqrt{R^2-x^2}$, so you have $$ f\_X(x) = \int\_{y=-\sqrt{R^2-x^2}...
52,730,270
I have a library that I'm converting to 64-bits. However, I can't get bit-exact results on 64-bit mode, so my tests are failing. I reduced the problem to a simple test case: ```c #include <stdio.h> int main(void) { printf("%d bits: ", sizeof(void*) * 8); volatile double d = 10.870191700000001; volatile d...
2018/10/09
[ "https://Stackoverflow.com/questions/52730270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3754432/" ]
Since you said you need the more precise `...01` result, as well as determinism, you unfortunately can't just use `-msse2 -mfpmath=sse` in your 32-bit build. Future readers looking for determinism should use that. --- You can use `-mfpmath=387` to ask gcc to use slow/obsolete x87 math in 64-bit mode, where it's not t...
I would not aim to reproduce the 32-bit output, since it's a consequence of excess precision in the 32-bit x86 (x87) ABI and possibly also compiler non-conformance. Instead try to match the 64-bit output which is what you should expect on good targets. As long as you're okay with requiring a machine with sse2+, `-mfpma...
30,988,642
I am trying to read in .properties files with many different languages, add new entries to them, sort, and print back to file. I have the encoding as UTF-8, and it works for all my current languages except Russian. When reading the file in I get all question marks from the Russian file. When it prints back out it has a...
2015/06/22
[ "https://Stackoverflow.com/questions/30988642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4912469/" ]
`new String(readIn)` and `replacer.getBytes()` don't use UTF8. They use your platform default encoding. Pass `StandardCharsets.UTF_8` as an additional argument to both calls. BTW, transforming a STring to a byte array, to then transform back the bytes to characters and reading them is a waste of time and resources. Ju...
Sometimes changing the encoding to utf-8 gives rise to errors, such as some extra characters or does nothing. The link: [How can i read a Russian file in Java?](https://stackoverflow.com/questions/11340042/how-can-i-read-a-russian-file-in-java) may help you.
31,176,709
I'm trying to load the table of Supreme Court Justices into R from the following URL. <https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States> I'm using the following code: ``` scotusURL <- "https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States" sco...
2015/07/02
[ "https://Stackoverflow.com/questions/31176709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3562553/" ]
If you don't mind using a different package, you can try the "rvest" package. ``` library(rvest) scotusURL <- "https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States" ``` * Option 1: Grab the tables from the page and use the `html_table` function to extract the tables you're int...
You could try this: ``` url <- "https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States" library(rvest) #v 0.2.0.9000 the_table <- read_html(url) %>% html_node("table.wikitable:nth-child(11)") %>% html_table() ```
31,176,709
I'm trying to load the table of Supreme Court Justices into R from the following URL. <https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States> I'm using the following code: ``` scotusURL <- "https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States" sco...
2015/07/02
[ "https://Stackoverflow.com/questions/31176709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3562553/" ]
If you don't mind using a different package, you can try the "rvest" package. ``` library(rvest) scotusURL <- "https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States" ``` * Option 1: Grab the tables from the page and use the `html_table` function to extract the tables you're int...
For some reason the googlesheets dependency wasn't working, so I pulled it through google anyway. I ran: ``` =importhtml("https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States", "table", 2) ``` and then downloaded the file as a .csv Don't know why I didn't think of that before. ...
31,176,709
I'm trying to load the table of Supreme Court Justices into R from the following URL. <https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States> I'm using the following code: ``` scotusURL <- "https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States" sco...
2015/07/02
[ "https://Stackoverflow.com/questions/31176709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3562553/" ]
If you don't mind using a different package, you can try the "rvest" package. ``` library(rvest) scotusURL <- "https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States" ``` * Option 1: Grab the tables from the page and use the `html_table` function to extract the tables you're int...
I would remove all the `<span style="display:none">` nodes and read the table from scotusDoc instead of trying to select a table class value that has changed. ``` scotusDoc <- htmlParse(scotusData, encoding="UTF-8") xpathSApply(scotusDoc, "//span[@style='display:none']", removeNodes) x <- readHTMLTable(scotusDoc, whic...
31,176,709
I'm trying to load the table of Supreme Court Justices into R from the following URL. <https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States> I'm using the following code: ``` scotusURL <- "https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States" sco...
2015/07/02
[ "https://Stackoverflow.com/questions/31176709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3562553/" ]
You could try this: ``` url <- "https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States" library(rvest) #v 0.2.0.9000 the_table <- read_html(url) %>% html_node("table.wikitable:nth-child(11)") %>% html_table() ```
For some reason the googlesheets dependency wasn't working, so I pulled it through google anyway. I ran: ``` =importhtml("https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States", "table", 2) ``` and then downloaded the file as a .csv Don't know why I didn't think of that before. ...
31,176,709
I'm trying to load the table of Supreme Court Justices into R from the following URL. <https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States> I'm using the following code: ``` scotusURL <- "https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States" sco...
2015/07/02
[ "https://Stackoverflow.com/questions/31176709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3562553/" ]
You could try this: ``` url <- "https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States" library(rvest) #v 0.2.0.9000 the_table <- read_html(url) %>% html_node("table.wikitable:nth-child(11)") %>% html_table() ```
I would remove all the `<span style="display:none">` nodes and read the table from scotusDoc instead of trying to select a table class value that has changed. ``` scotusDoc <- htmlParse(scotusData, encoding="UTF-8") xpathSApply(scotusDoc, "//span[@style='display:none']", removeNodes) x <- readHTMLTable(scotusDoc, whic...
31,176,709
I'm trying to load the table of Supreme Court Justices into R from the following URL. <https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States> I'm using the following code: ``` scotusURL <- "https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States" sco...
2015/07/02
[ "https://Stackoverflow.com/questions/31176709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3562553/" ]
I would remove all the `<span style="display:none">` nodes and read the table from scotusDoc instead of trying to select a table class value that has changed. ``` scotusDoc <- htmlParse(scotusData, encoding="UTF-8") xpathSApply(scotusDoc, "//span[@style='display:none']", removeNodes) x <- readHTMLTable(scotusDoc, whic...
For some reason the googlesheets dependency wasn't working, so I pulled it through google anyway. I ran: ``` =importhtml("https://en.wikipedia.org/wiki/List_of_Justices_of_the_Supreme_Court_of_the_United_States", "table", 2) ``` and then downloaded the file as a .csv Don't know why I didn't think of that before. ...
269,810
Most optics texts will mention that alkali metals can become transparent in the near ultraviolet in the sections on reflections from metals, plasma frequency, and electron density. I remembered this again just now when I saw Table XXVII in Born and Wolf's Principles of Optics (6th ed.) and saw that the critical wavelen...
2016/07/25
[ "https://physics.stackexchange.com/questions/269810", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/83380/" ]
Simple metals are transparent at short wavelengths. It is maybe a problem that physicists do not usually write what their samples look like (chemists often note color and smell). I found this old [paper from 1931](https://www.jstor.org/stable/95606?seq=1#metadata_info_tab_contents) that starts: > > It is a matter of...
We used cesium based atomic line filters in an air to air laser communications system, but the wavelength was near 850 nm (near infrared). But a quick search finding [this](https://www.osapublishing.org/ol/abstract.cfm?uri=ol-17-19-1388) suggests Cs is also useful in the blue spectrum, so possibly UV. Atomic line fil...
269,810
Most optics texts will mention that alkali metals can become transparent in the near ultraviolet in the sections on reflections from metals, plasma frequency, and electron density. I remembered this again just now when I saw Table XXVII in Born and Wolf's Principles of Optics (6th ed.) and saw that the critical wavelen...
2016/07/25
[ "https://physics.stackexchange.com/questions/269810", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/83380/" ]
Simple metals are transparent at short wavelengths. It is maybe a problem that physicists do not usually write what their samples look like (chemists often note color and smell). I found this old [paper from 1931](https://www.jstor.org/stable/95606?seq=1#metadata_info_tab_contents) that starts: > > It is a matter of...
Yes, this is true under certain circumstances, of course. I will keep things simple and say that the best way to answer your question is to look at the refractive index and transmittance spectrum of caesium. For that, I invite you to visit this link <https://refractiveindex.info/?shelf=main&book=Cs&page=Smith> Where ...
269,810
Most optics texts will mention that alkali metals can become transparent in the near ultraviolet in the sections on reflections from metals, plasma frequency, and electron density. I remembered this again just now when I saw Table XXVII in Born and Wolf's Principles of Optics (6th ed.) and saw that the critical wavelen...
2016/07/25
[ "https://physics.stackexchange.com/questions/269810", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/83380/" ]
Simple metals are transparent at short wavelengths. It is maybe a problem that physicists do not usually write what their samples look like (chemists often note color and smell). I found this old [paper from 1931](https://www.jstor.org/stable/95606?seq=1#metadata_info_tab_contents) that starts: > > It is a matter of...
It is absolutely accurate that two continuous functions (the magnitude and imaginary component of the optical index, in this case) will cross if they trend in opposite directions. Therefore, there must be a very specific wavelength at which the the real and imaginary components are exactly equal. There are many reason...
5,229,458
hello everyone how to select multiple cell from table using jquery . i dont want to use any plugin for this. i have to two tables which are dynamically generated.
2011/03/08
[ "https://Stackoverflow.com/questions/5229458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/635236/" ]
The common term or these inline class definitions is Anonymous Classes. You can read more about the discussion on these in [Java/Android: anonymous local classes vs named classes](https://stackoverflow.com/q/3577013/808940) Essentially the main differences are readbility, speed of coding, re-use and scope. From a re...
This really isn't an answer to the above question because I don't know what "the best way" is, and it likely depends on what you're doing. However, I'll explain what I'm doing and why. I'm writing an app that serves as a remote controller. There are several activities that will interact with the controlled device, and...
5,229,458
hello everyone how to select multiple cell from table using jquery . i dont want to use any plugin for this. i have to two tables which are dynamically generated.
2011/03/08
[ "https://Stackoverflow.com/questions/5229458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/635236/" ]
<http://developer.android.com/reference/android/os/Handler.html> ``` package : android.os public class Handler extends Object ``` A Handler allows you to send and process Message and Runnable objects associated with a thread's MessageQueue. Each Handler instance is associated with a single thread and that thread's m...
This really isn't an answer to the above question because I don't know what "the best way" is, and it likely depends on what you're doing. However, I'll explain what I'm doing and why. I'm writing an app that serves as a remote controller. There are several activities that will interact with the controlled device, and...
5,229,458
hello everyone how to select multiple cell from table using jquery . i dont want to use any plugin for this. i have to two tables which are dynamically generated.
2011/03/08
[ "https://Stackoverflow.com/questions/5229458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/635236/" ]
The common term or these inline class definitions is Anonymous Classes. You can read more about the discussion on these in [Java/Android: anonymous local classes vs named classes](https://stackoverflow.com/q/3577013/808940) Essentially the main differences are readbility, speed of coding, re-use and scope. From a re...
<http://developer.android.com/reference/android/os/Handler.html> ``` package : android.os public class Handler extends Object ``` A Handler allows you to send and process Message and Runnable objects associated with a thread's MessageQueue. Each Handler instance is associated with a single thread and that thread's m...
5,229,458
hello everyone how to select multiple cell from table using jquery . i dont want to use any plugin for this. i have to two tables which are dynamically generated.
2011/03/08
[ "https://Stackoverflow.com/questions/5229458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/635236/" ]
The common term or these inline class definitions is Anonymous Classes. You can read more about the discussion on these in [Java/Android: anonymous local classes vs named classes](https://stackoverflow.com/q/3577013/808940) Essentially the main differences are readbility, speed of coding, re-use and scope. From a re...
There is a danger in using anonymous classes in Android. As described in [this blog post](http://www.androiddesignpatterns.com/2013/01/inner-class-handler-memory-leak.html?showComment=1387475947875#c5406161336938634644) - > > In Java, non-static inner and anonymous classes hold an implicit > reference to their outer...
5,229,458
hello everyone how to select multiple cell from table using jquery . i dont want to use any plugin for this. i have to two tables which are dynamically generated.
2011/03/08
[ "https://Stackoverflow.com/questions/5229458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/635236/" ]
<http://developer.android.com/reference/android/os/Handler.html> ``` package : android.os public class Handler extends Object ``` A Handler allows you to send and process Message and Runnable objects associated with a thread's MessageQueue. Each Handler instance is associated with a single thread and that thread's m...
There is a danger in using anonymous classes in Android. As described in [this blog post](http://www.androiddesignpatterns.com/2013/01/inner-class-handler-memory-leak.html?showComment=1387475947875#c5406161336938634644) - > > In Java, non-static inner and anonymous classes hold an implicit > reference to their outer...
59,636,392
I have just finished a Udemy course, and everything works fine on localhost. To deploy on Heroku, I added an extra index.php file at the root folder because Heroku couldn't 'see' the index.php file within the public folder. So I simply added `include 'public/index.php';` to the new index.php file. So far, the site now...
2020/01/07
[ "https://Stackoverflow.com/questions/59636392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11358830/" ]
You should not be using rewrite or includes to do this. You can tell Apache or nginx to point to the public folder in your Procfile. For Apache, `web: vendor/bin/heroku-php-apache2 public/` does the trick. See <https://devcenter.heroku.com/articles/custom-php-settings#setting-the-document-root> for more details.
The problem was an htaccess file that had a redirect to a full file path that I was using in the developoment phase. When uploaded to Heroku, this needed to be just directed to the public folder. Problem solved.
71,994,527
the code below retrieve all the data from the url below. But I want to save the results in the output file text. like (info.text), Would you mind help me. url: <https://www150.statcan.gc.ca/n1/pub/71-607-x/2021004/exp-eng.htm?r1=(1)&r2=0&r3=0&r4=12&r5=0&r7=0&r8=2022-02-01&r9=2022-02-01> ``` from selenium import webdr...
2022/04/25
[ "https://Stackoverflow.com/questions/71994527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16832397/" ]
You can use [`std::function`](https://en.cppreference.com/w/cpp/utility/functional/function), to store you functions in a container. Then create an array of `std::function` of size `3`. ```cpp #include <functional> #include <iostream> void triple_balls() { /* YOUR CODE */ } void longer_paddle() { /* YOUR CODE */ } ...
Use a function pointer array instead ``` using BonusFunc = void (*)(); BonusFunc[3] = { triple_balls, longer_paddle, shorter_paddle }; void bonus_activator(){ BonusFunc[rand() % 3](); // just an example, don't use rand() in real code } ```
71,994,527
the code below retrieve all the data from the url below. But I want to save the results in the output file text. like (info.text), Would you mind help me. url: <https://www150.statcan.gc.ca/n1/pub/71-607-x/2021004/exp-eng.htm?r1=(1)&r2=0&r3=0&r4=12&r5=0&r7=0&r8=2022-02-01&r9=2022-02-01> ``` from selenium import webdr...
2022/04/25
[ "https://Stackoverflow.com/questions/71994527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16832397/" ]
Use a function pointer array instead ``` using BonusFunc = void (*)(); BonusFunc[3] = { triple_balls, longer_paddle, shorter_paddle }; void bonus_activator(){ BonusFunc[rand() % 3](); // just an example, don't use rand() in real code } ```
``` std::array{ &triple_balls, &longer_paddle, &shorter_paddle, } .at(rand() % 3)(); ``` fits in only one-line and no variables needed and the optimizer will likely reduce this into a switch-statement-like operation: ``` std::array{ &triple_balls, &longer_paddle, &shorter_paddle }.at(rand() % 3)(); ```
71,994,527
the code below retrieve all the data from the url below. But I want to save the results in the output file text. like (info.text), Would you mind help me. url: <https://www150.statcan.gc.ca/n1/pub/71-607-x/2021004/exp-eng.htm?r1=(1)&r2=0&r3=0&r4=12&r5=0&r7=0&r8=2022-02-01&r9=2022-02-01> ``` from selenium import webdr...
2022/04/25
[ "https://Stackoverflow.com/questions/71994527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16832397/" ]
You can use [`std::function`](https://en.cppreference.com/w/cpp/utility/functional/function), to store you functions in a container. Then create an array of `std::function` of size `3`. ```cpp #include <functional> #include <iostream> void triple_balls() { /* YOUR CODE */ } void longer_paddle() { /* YOUR CODE */ } ...
``` std::array{ &triple_balls, &longer_paddle, &shorter_paddle, } .at(rand() % 3)(); ``` fits in only one-line and no variables needed and the optimizer will likely reduce this into a switch-statement-like operation: ``` std::array{ &triple_balls, &longer_paddle, &shorter_paddle }.at(rand() % 3)(); ```
15,116,948
* We have an iPad app displaying contents from drupal site (serving just json files). * our IT dept placed a SSO in front of the drupal site. WebSEAL is used for implementing SSO. * so when we access the drupal site from the browser we are redirected to login page (forms authentication) and we need to enter our windows...
2013/02/27
[ "https://Stackoverflow.com/questions/15116948", "https://Stackoverflow.com", "https://Stackoverflow.com/users/301960/" ]
I know this is an old question but I tried to do very similar thing (.Net client accessing a web service behind WebSeal). No useful solution after googling. However IBM documentation gave me a clue <http://www.ibm.com/support/knowledgecenter/SSPREK_8.0.1.2/com.ibm.isamw.doc_8.0.1.2/wrp_config/task/tsk_submt_form_data_...
``` ------------------------------------------------------------------------------------ STEP (1) ------------------------------------------------------------------------------------ WEBSEAL URL: https://webseal/pkmslogin.form METHOD : POST TYPE : FormUrlEncodedContent HEADER : Content-Type: application/x...
35,733,748
I have some XML from survey system. Sample structure is shown below: ``` <?xml version="1.0" encoding="windows-1250" standalone="yes" ?> <document> <ID>100</ID> <DOCUMENT_DATA> <OWNER>SOME OWNER</OWNER> <CODING>WINDOWS-1250</CODING> <MAIN_DATA> <NAME>JOHN</NAME> <SURNAME>DOE</SURNAME> <SYSTEM_ID>000</...
2016/03/01
[ "https://Stackoverflow.com/questions/35733748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6004676/" ]
This you should get what you want: ```typescript @Component({ selector: 'ul[my-list]', template: ` <ng-content></ng-content> ` }) export class MyList { } ``` ```typescript @Component({ selector: 'li[my-item]', template: ` <ng-content></ng-content> ` }) export class MyItem { ... } ``` ```html <u...
New angular versions have really cool directive, which may be used also for your use case. Tadaa: [NgComponentOutlet](https://v4.angular.io/api/common/NgComponentOutlet). Happy coding ;) Example: ``` @Component({selector: 'hello-world', template: 'Hello World!'}) class HelloWorld { } @Component({ selector: 'ng-com...
35,733,748
I have some XML from survey system. Sample structure is shown below: ``` <?xml version="1.0" encoding="windows-1250" standalone="yes" ?> <document> <ID>100</ID> <DOCUMENT_DATA> <OWNER>SOME OWNER</OWNER> <CODING>WINDOWS-1250</CODING> <MAIN_DATA> <NAME>JOHN</NAME> <SURNAME>DOE</SURNAME> <SYSTEM_ID>000</...
2016/03/01
[ "https://Stackoverflow.com/questions/35733748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6004676/" ]
This you should get what you want: ```typescript @Component({ selector: 'ul[my-list]', template: ` <ng-content></ng-content> ` }) export class MyList { } ``` ```typescript @Component({ selector: 'li[my-item]', template: ` <ng-content></ng-content> ` }) export class MyItem { ... } ``` ```html <u...
In the latest angular you can even avoid adding `<ng-content></ng-content>` I've applied is like: ``` import {Component} from '@angular/core'; @Component({ selector: 'div[app-root]', templateUrl: 'app.component.html', styleUrls: ['app.component.css'] }) export class AppComponent { title = 'Delegates...
35,733,748
I have some XML from survey system. Sample structure is shown below: ``` <?xml version="1.0" encoding="windows-1250" standalone="yes" ?> <document> <ID>100</ID> <DOCUMENT_DATA> <OWNER>SOME OWNER</OWNER> <CODING>WINDOWS-1250</CODING> <MAIN_DATA> <NAME>JOHN</NAME> <SURNAME>DOE</SURNAME> <SYSTEM_ID>000</...
2016/03/01
[ "https://Stackoverflow.com/questions/35733748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6004676/" ]
Finally I found solution: injecting `ElementRef` to `MyItem` and using its `nativeElement.innerHTML`: **MyList**: ```typescript import { Component, ContentChildren, QueryList } from 'angular2/core' import { MyItem } from './myitem' @Component({ selector: 'my-list', template: ` <ul> <li *ngFor="#item of...
New angular versions have really cool directive, which may be used also for your use case. Tadaa: [NgComponentOutlet](https://v4.angular.io/api/common/NgComponentOutlet). Happy coding ;) Example: ``` @Component({selector: 'hello-world', template: 'Hello World!'}) class HelloWorld { } @Component({ selector: 'ng-com...
35,733,748
I have some XML from survey system. Sample structure is shown below: ``` <?xml version="1.0" encoding="windows-1250" standalone="yes" ?> <document> <ID>100</ID> <DOCUMENT_DATA> <OWNER>SOME OWNER</OWNER> <CODING>WINDOWS-1250</CODING> <MAIN_DATA> <NAME>JOHN</NAME> <SURNAME>DOE</SURNAME> <SYSTEM_ID>000</...
2016/03/01
[ "https://Stackoverflow.com/questions/35733748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6004676/" ]
Finally I found solution: injecting `ElementRef` to `MyItem` and using its `nativeElement.innerHTML`: **MyList**: ```typescript import { Component, ContentChildren, QueryList } from 'angular2/core' import { MyItem } from './myitem' @Component({ selector: 'my-list', template: ` <ul> <li *ngFor="#item of...
In the latest angular you can even avoid adding `<ng-content></ng-content>` I've applied is like: ``` import {Component} from '@angular/core'; @Component({ selector: 'div[app-root]', templateUrl: 'app.component.html', styleUrls: ['app.component.css'] }) export class AppComponent { title = 'Delegates...
35,733,748
I have some XML from survey system. Sample structure is shown below: ``` <?xml version="1.0" encoding="windows-1250" standalone="yes" ?> <document> <ID>100</ID> <DOCUMENT_DATA> <OWNER>SOME OWNER</OWNER> <CODING>WINDOWS-1250</CODING> <MAIN_DATA> <NAME>JOHN</NAME> <SURNAME>DOE</SURNAME> <SYSTEM_ID>000</...
2016/03/01
[ "https://Stackoverflow.com/questions/35733748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6004676/" ]
New angular versions have really cool directive, which may be used also for your use case. Tadaa: [NgComponentOutlet](https://v4.angular.io/api/common/NgComponentOutlet). Happy coding ;) Example: ``` @Component({selector: 'hello-world', template: 'Hello World!'}) class HelloWorld { } @Component({ selector: 'ng-com...
In the latest angular you can even avoid adding `<ng-content></ng-content>` I've applied is like: ``` import {Component} from '@angular/core'; @Component({ selector: 'div[app-root]', templateUrl: 'app.component.html', styleUrls: ['app.component.css'] }) export class AppComponent { title = 'Delegates...
1,236,339
The question is, given $Y\sim N(\mu,\sigma^2)$, how to prove$E[e^{e^Y}]=\infty$? I tried to look Y as some kind of Ito's process and apply Ito's formula to it but it doesn't make sense. Next I tried to use variable change $u=e^y$ and I still can't prove it. Is there anyway to do that?
2015/04/15
[ "https://math.stackexchange.com/questions/1236339", "https://math.stackexchange.com", "https://math.stackexchange.com/users/174574/" ]
Edit: this was posted before the question was edited to reflect the clarification. The following is the answer to a different problem: If $b<a$, it's the line segment along $x=a$ with length $b$. Otherwise, it's the line segment along $y=b$ with length $a$ (if $a=b$, then they're the same length). You can see this by ...
Here is my solution. ![enter image description here](https://i.stack.imgur.com/SzHZ0.png) Your given point is $P(a,b)$, and we let our independent variable be angle $\theta$ as given in the diagram. The other points result from $P$ and $\theta$. Length $PQ$ is then $a\sec\theta$ and length $PR$ is $b\csc\theta$. The...
29,782,707
I have images being passed dynamically to the UI and they can sent as any size size. I then need to scale them to specific sizes depending on which img tag that image is going to be displayed in. These images need to be circles of a statically set size, but not ovals and when they are cropped I want the circle to come ...
2015/04/21
[ "https://Stackoverflow.com/questions/29782707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/535878/" ]
You should enclose your image in a parent div. The only thing .img-circle does is apply border-radius: 50%; It will inherit the width and the height of the chosen element. If those are not equal it will be an oval. In that case you will have to define sizes but then the images will get distorted. So that's why you nee...
Right, as far as I can answer from the information you've provided, you're setting the image tag to have 117px in both height and width. This is the IMG tag you're changing, and so every image will be stretched TO that specification. So, you have two options: 1) You can either set a specific width or height and allow ...
9,793,440
We recently received a bunch of files with tab-delimiters. We were having difficulties importing them in sql server database. The vendor who sent the files also sent the code below for us to use in converting the files from tab to comma delimiters. How do I use this file in visual studio. I have used visual studio ...
2012/03/20
[ "https://Stackoverflow.com/questions/9793440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/967857/" ]
Create a console app, and replace contents of generated program.cs with the text above. And then, hit RUN :)
You need to create a new Console application and then paste this code into the example file created as part of the solution. Then change the "c:\input.txt" to be the file you want to convert and then hit run.
9,793,440
We recently received a bunch of files with tab-delimiters. We were having difficulties importing them in sql server database. The vendor who sent the files also sent the code below for us to use in converting the files from tab to comma delimiters. How do I use this file in visual studio. I have used visual studio ...
2012/03/20
[ "https://Stackoverflow.com/questions/9793440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/967857/" ]
Create a console app, and replace contents of generated program.cs with the text above. And then, hit RUN :)
OK, that was nice playing in the answers with all kind of methods how to replace characters in a string. But unfortunately, reality is not as easy as that. How do you handle data with comma's in it for example? Like `Telephone bill{tab}USD{tab}1,234.00` becoming `Telephone bill,USD,1,234.00`. An extra column is inserte...
9,793,440
We recently received a bunch of files with tab-delimiters. We were having difficulties importing them in sql server database. The vendor who sent the files also sent the code below for us to use in converting the files from tab to comma delimiters. How do I use this file in visual studio. I have used visual studio ...
2012/03/20
[ "https://Stackoverflow.com/questions/9793440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/967857/" ]
Also, here's a replacement for the content of `Main()` that might make your life easier, as long as the files are of decent size: ``` foreach(string f in args) { System.IO.File.WriteAllText(f, System.IO.File.ReadAllText(f).Replace('\t', ',')); } ``` Compile and drag and drop all your files onto the resulting exe...
You need to create a new Console application and then paste this code into the example file created as part of the solution. Then change the "c:\input.txt" to be the file you want to convert and then hit run.
9,793,440
We recently received a bunch of files with tab-delimiters. We were having difficulties importing them in sql server database. The vendor who sent the files also sent the code below for us to use in converting the files from tab to comma delimiters. How do I use this file in visual studio. I have used visual studio ...
2012/03/20
[ "https://Stackoverflow.com/questions/9793440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/967857/" ]
Also, here's a replacement for the content of `Main()` that might make your life easier, as long as the files are of decent size: ``` foreach(string f in args) { System.IO.File.WriteAllText(f, System.IO.File.ReadAllText(f).Replace('\t', ',')); } ``` Compile and drag and drop all your files onto the resulting exe...
OK, that was nice playing in the answers with all kind of methods how to replace characters in a string. But unfortunately, reality is not as easy as that. How do you handle data with comma's in it for example? Like `Telephone bill{tab}USD{tab}1,234.00` becoming `Telephone bill,USD,1,234.00`. An extra column is inserte...
41,734,862
I am using the [GraphView Library](http://www.android-graphview.org//) to render a graph. I have placed a checkbox below the graph so that the user can show / hide the legend in the graph. When the user clicks this button, I need to refresh the GraphView. I tried redrawAll(), but Android Studio says it "cannot resolve...
2017/01/19
[ "https://Stackoverflow.com/questions/41734862", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3477466/" ]
> > but not showing anydata in listview > > > Because you told it not to create any views. ``` @Override public int getCount() { return 0; } ``` You are using an ArrayAdapter. You don't need to implement `getCount`, but if you do, return the size of the list ``` @Override public int getCount() { retur...
you are overriding method getCount(); and it is returning zero, you have to return the size of the array-list.
10,411,975
In my code I have an `Image View` in my XML layout and I keep changing the source image for this in my code. Now I want to know the width and height of the generated image each time. I tried using `getWidth()`, `getHeight(),` `getMeasuredWidth(),` and `getMeasuredHeight()`, but they all return 0. How can I get this?
2012/05/02
[ "https://Stackoverflow.com/questions/10411975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/901798/" ]
try this ``` ImageView iv=(ImageView)findViewById(R.id.image); ViewTreeObserver vto = iv.getViewTreeObserver(); vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { public boolean onPreDraw() { finalHeight = iv.getMeasuredHeight(); finalWidth = iv.getMeasuredWidth(); ...
if you set ImageView a drawable, and the ImageView's height and width type is WRAP\_CONTENT, you can get the ImageView's height and width by this even you calling from `onCreate()` ``` int height = imageView.getDrawable().getIntrinsicHeight(); int width = imageView.getDrawable().getIntrinsicWidth(); ```
10,411,975
In my code I have an `Image View` in my XML layout and I keep changing the source image for this in my code. Now I want to know the width and height of the generated image each time. I tried using `getWidth()`, `getHeight(),` `getMeasuredWidth(),` and `getMeasuredHeight()`, but they all return 0. How can I get this?
2012/05/02
[ "https://Stackoverflow.com/questions/10411975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/901798/" ]
try this code ``` int finalHeight, finalWidth; final ImageView iv = (ImageView)findViewById(R.id.scaled_image); final TextView tv = (TextView)findViewById(R.id.size_label); ViewTreeObserver vto = iv.getViewTreeObserver(); vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { public boolean onPreDraw...
The way you make **reference to the image object** is wrong. That's why you are given zero all the time. first create a bitmap object from imageview and get the width and height from it. When taken a image from cam I do the following and it works like a charm. ``` Bitmap image2 = (Bitmap) data1.getExtras().get("data"...
10,411,975
In my code I have an `Image View` in my XML layout and I keep changing the source image for this in my code. Now I want to know the width and height of the generated image each time. I tried using `getWidth()`, `getHeight(),` `getMeasuredWidth(),` and `getMeasuredHeight()`, but they all return 0. How can I get this?
2012/05/02
[ "https://Stackoverflow.com/questions/10411975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/901798/" ]
try this code ``` int finalHeight, finalWidth; final ImageView iv = (ImageView)findViewById(R.id.scaled_image); final TextView tv = (TextView)findViewById(R.id.size_label); ViewTreeObserver vto = iv.getViewTreeObserver(); vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { public boolean onPreDraw...
First you have to convert the image to mutablebitmap and the try to get the width and height of the image and mostly this will solve your issue.. ``` Bitmap Rbitmap = Bitmap.createBitmap(bitmap).copy( Config.ARGB_4444, true); Rbitmap.getWidth(); Rbitmap.getheight(); ```
10,411,975
In my code I have an `Image View` in my XML layout and I keep changing the source image for this in my code. Now I want to know the width and height of the generated image each time. I tried using `getWidth()`, `getHeight(),` `getMeasuredWidth(),` and `getMeasuredHeight()`, but they all return 0. How can I get this?
2012/05/02
[ "https://Stackoverflow.com/questions/10411975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/901798/" ]
Where you calling `getWidth()` and `getHeight()` on ImageView? If you calling from `onCreate()` in activity, it won't work. You need to wait for activity window to attached and then call `getWidth() and getHeight()` on ImageView. You can try calling `getWidth() and getHeight()` from `onWindowFocusChanged()` method of y...
First you have to convert the image to mutablebitmap and the try to get the width and height of the image and mostly this will solve your issue.. ``` Bitmap Rbitmap = Bitmap.createBitmap(bitmap).copy( Config.ARGB_4444, true); Rbitmap.getWidth(); Rbitmap.getheight(); ```
10,411,975
In my code I have an `Image View` in my XML layout and I keep changing the source image for this in my code. Now I want to know the width and height of the generated image each time. I tried using `getWidth()`, `getHeight(),` `getMeasuredWidth(),` and `getMeasuredHeight()`, but they all return 0. How can I get this?
2012/05/02
[ "https://Stackoverflow.com/questions/10411975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/901798/" ]
Where you calling `getWidth()` and `getHeight()` on ImageView? If you calling from `onCreate()` in activity, it won't work. You need to wait for activity window to attached and then call `getWidth() and getHeight()` on ImageView. You can try calling `getWidth() and getHeight()` from `onWindowFocusChanged()` method of y...
if you set ImageView a drawable, and the ImageView's height and width type is WRAP\_CONTENT, you can get the ImageView's height and width by this even you calling from `onCreate()` ``` int height = imageView.getDrawable().getIntrinsicHeight(); int width = imageView.getDrawable().getIntrinsicWidth(); ```
10,411,975
In my code I have an `Image View` in my XML layout and I keep changing the source image for this in my code. Now I want to know the width and height of the generated image each time. I tried using `getWidth()`, `getHeight(),` `getMeasuredWidth(),` and `getMeasuredHeight()`, but they all return 0. How can I get this?
2012/05/02
[ "https://Stackoverflow.com/questions/10411975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/901798/" ]
try this code ``` int finalHeight, finalWidth; final ImageView iv = (ImageView)findViewById(R.id.scaled_image); final TextView tv = (TextView)findViewById(R.id.size_label); ViewTreeObserver vto = iv.getViewTreeObserver(); vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { public boolean onPreDraw...
Try this solution: ``` Bitmap bitmap = ((BitmapDrawable)imageView.getBackground()).getBitmap(); int width = bitmap.getWidth(); int height = bitmap.getHeight(); ```
10,411,975
In my code I have an `Image View` in my XML layout and I keep changing the source image for this in my code. Now I want to know the width and height of the generated image each time. I tried using `getWidth()`, `getHeight(),` `getMeasuredWidth(),` and `getMeasuredHeight()`, but they all return 0. How can I get this?
2012/05/02
[ "https://Stackoverflow.com/questions/10411975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/901798/" ]
try this ``` ImageView iv=(ImageView)findViewById(R.id.image); ViewTreeObserver vto = iv.getViewTreeObserver(); vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { public boolean onPreDraw() { finalHeight = iv.getMeasuredHeight(); finalWidth = iv.getMeasuredWidth(); ...
First you have to convert the image to mutablebitmap and the try to get the width and height of the image and mostly this will solve your issue.. ``` Bitmap Rbitmap = Bitmap.createBitmap(bitmap).copy( Config.ARGB_4444, true); Rbitmap.getWidth(); Rbitmap.getheight(); ```
10,411,975
In my code I have an `Image View` in my XML layout and I keep changing the source image for this in my code. Now I want to know the width and height of the generated image each time. I tried using `getWidth()`, `getHeight(),` `getMeasuredWidth(),` and `getMeasuredHeight()`, but they all return 0. How can I get this?
2012/05/02
[ "https://Stackoverflow.com/questions/10411975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/901798/" ]
try this ``` ImageView iv=(ImageView)findViewById(R.id.image); ViewTreeObserver vto = iv.getViewTreeObserver(); vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { public boolean onPreDraw() { finalHeight = iv.getMeasuredHeight(); finalWidth = iv.getMeasuredWidth(); ...
try this code ``` int finalHeight, finalWidth; final ImageView iv = (ImageView)findViewById(R.id.scaled_image); final TextView tv = (TextView)findViewById(R.id.size_label); ViewTreeObserver vto = iv.getViewTreeObserver(); vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { public boolean onPreDraw...
10,411,975
In my code I have an `Image View` in my XML layout and I keep changing the source image for this in my code. Now I want to know the width and height of the generated image each time. I tried using `getWidth()`, `getHeight(),` `getMeasuredWidth(),` and `getMeasuredHeight()`, but they all return 0. How can I get this?
2012/05/02
[ "https://Stackoverflow.com/questions/10411975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/901798/" ]
Where you calling `getWidth()` and `getHeight()` on ImageView? If you calling from `onCreate()` in activity, it won't work. You need to wait for activity window to attached and then call `getWidth() and getHeight()` on ImageView. You can try calling `getWidth() and getHeight()` from `onWindowFocusChanged()` method of y...
The way you make **reference to the image object** is wrong. That's why you are given zero all the time. first create a bitmap object from imageview and get the width and height from it. When taken a image from cam I do the following and it works like a charm. ``` Bitmap image2 = (Bitmap) data1.getExtras().get("data"...
10,411,975
In my code I have an `Image View` in my XML layout and I keep changing the source image for this in my code. Now I want to know the width and height of the generated image each time. I tried using `getWidth()`, `getHeight(),` `getMeasuredWidth(),` and `getMeasuredHeight()`, but they all return 0. How can I get this?
2012/05/02
[ "https://Stackoverflow.com/questions/10411975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/901798/" ]
if you set ImageView a drawable, and the ImageView's height and width type is WRAP\_CONTENT, you can get the ImageView's height and width by this even you calling from `onCreate()` ``` int height = imageView.getDrawable().getIntrinsicHeight(); int width = imageView.getDrawable().getIntrinsicWidth(); ```
try this code ``` int finalHeight, finalWidth; final ImageView iv = (ImageView)findViewById(R.id.scaled_image); final TextView tv = (TextView)findViewById(R.id.size_label); ViewTreeObserver vto = iv.getViewTreeObserver(); vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() { public boolean onPreDraw...
17,369,539
So I am using this code, to export a formview to Word. Its works great..But I want it to export to PDF so that it cannot be edited. Or may be to a word doc so that not body can make changes. ``` protected void Button1_Click(object sender, EventArgs e) { Response.Clear(); Response.Buffer = true; Response.Ad...
2013/06/28
[ "https://Stackoverflow.com/questions/17369539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2232614/" ]
Your best bet to create PDFs in ASP.NET is to use a plug in like iTextSharp. I have used it in the past and it's very simple and free. <http://itextpdf.com/>
As mentioned above, creating PDF using one of the existing libraries would be more efficient. But if you're down to use `interop`, you can download s[ave as pdf plugin](http://www.microsoft.com/en-us/download/details.aspx?id=7) for Microsoft Office. And then pass "pdf" format to `SaveAs` method Alternatively, you...
13,978,873
As I more heavily use JavaScript like a high-level object-oriented language, I find myself thinking like the C/C++ programmer that I am when I'm finished with objects. I know the GC is going to run eventually and clean up my mess, but are there things I can do to actually help it along? For example, I have an array o...
2012/12/20
[ "https://Stackoverflow.com/questions/13978873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/479574/" ]
Rarely. Which is different from never. Generally, if you develop in a reasonable manner, unused objects will be falling out of scope appropriately and the Garbage Collector will simply work as expected. And unless you really understand what you're doing, efforts to help the Garbage Collector do its job often don't wo...
Very smart people have worked very hard on those garbage collection models. The odds that anything you do is going to massively improve performance over what they implemented is relatively low. If garbage collection is becoming a major cost for you, you're likely better off focusing on reducing the number of objects ...
13,978,873
As I more heavily use JavaScript like a high-level object-oriented language, I find myself thinking like the C/C++ programmer that I am when I'm finished with objects. I know the GC is going to run eventually and clean up my mess, but are there things I can do to actually help it along? For example, I have an array o...
2012/12/20
[ "https://Stackoverflow.com/questions/13978873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/479574/" ]
This may depend on the specific garbage collector, so an answer would depend on which JavaScript engine you're using. First, I'll note that the best application code does two things. It achieves its technical goals of functionality and performance, and it is resilient to change. Additional code should serve enough of ...
Very smart people have worked very hard on those garbage collection models. The odds that anything you do is going to massively improve performance over what they implemented is relatively low. If garbage collection is becoming a major cost for you, you're likely better off focusing on reducing the number of objects ...
13,978,873
As I more heavily use JavaScript like a high-level object-oriented language, I find myself thinking like the C/C++ programmer that I am when I'm finished with objects. I know the GC is going to run eventually and clean up my mess, but are there things I can do to actually help it along? For example, I have an array o...
2012/12/20
[ "https://Stackoverflow.com/questions/13978873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/479574/" ]
This may depend on the specific garbage collector, so an answer would depend on which JavaScript engine you're using. First, I'll note that the best application code does two things. It achieves its technical goals of functionality and performance, and it is resilient to change. Additional code should serve enough of ...
Rarely. Which is different from never. Generally, if you develop in a reasonable manner, unused objects will be falling out of scope appropriately and the Garbage Collector will simply work as expected. And unless you really understand what you're doing, efforts to help the Garbage Collector do its job often don't wo...
10,276,573
My Use Case: ------------ I want to import the large data from EC2 through SQOOP into the Hive. Imported data in Hive will get processed in Hive by applying some algorithm and will generate some result (in table form, in Hive only). And generated result will be exported back to Ec2 again through SQOOP only. I am new ...
2012/04/23
[ "https://Stackoverflow.com/questions/10276573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1073129/" ]
It is possible to install Sqoop on AWS EMR. You are not required to use S3 to store files and can use the local (temporary) HDFS instead. After you have Sqoop installed, you can import your data with it into HDFS, run your calculations in HDFS, then export your data back out using Sqoop again. Here's an article I wrot...
Same as my response from Hive mailing list: To answer your questions: 1) S3 terminology uses the word "object" and I am sure they have good reasons as to why but for us Hive'ers, an S3 object is the same as a file stored on S3. The complete path to the file would be what Amazon calls the S3 "key" and the correspondin...
10,276,573
My Use Case: ------------ I want to import the large data from EC2 through SQOOP into the Hive. Imported data in Hive will get processed in Hive by applying some algorithm and will generate some result (in table form, in Hive only). And generated result will be exported back to Ec2 again through SQOOP only. I am new ...
2012/04/23
[ "https://Stackoverflow.com/questions/10276573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1073129/" ]
It is possible to install Sqoop on AWS EMR. You are not required to use S3 to store files and can use the local (temporary) HDFS instead. After you have Sqoop installed, you can import your data with it into HDFS, run your calculations in HDFS, then export your data back out using Sqoop again. Here's an article I wrot...
@mark-grover mentioned you can use s3:// interchangeably with hdfs:// which is not entirely accurate. You may in some cases, however using the AWS EMR built in apache sqoop with the import command it complains; `ERROR tool.ImportTool: Imported Failed: Wrong FS: s3://<my bucket path>, expected: hdfs://ip-<private ip>.a...
10,276,573
My Use Case: ------------ I want to import the large data from EC2 through SQOOP into the Hive. Imported data in Hive will get processed in Hive by applying some algorithm and will generate some result (in table form, in Hive only). And generated result will be exported back to Ec2 again through SQOOP only. I am new ...
2012/04/23
[ "https://Stackoverflow.com/questions/10276573", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1073129/" ]
Same as my response from Hive mailing list: To answer your questions: 1) S3 terminology uses the word "object" and I am sure they have good reasons as to why but for us Hive'ers, an S3 object is the same as a file stored on S3. The complete path to the file would be what Amazon calls the S3 "key" and the correspondin...
@mark-grover mentioned you can use s3:// interchangeably with hdfs:// which is not entirely accurate. You may in some cases, however using the AWS EMR built in apache sqoop with the import command it complains; `ERROR tool.ImportTool: Imported Failed: Wrong FS: s3://<my bucket path>, expected: hdfs://ip-<private ip>.a...
60,901,054
I build some SQL query strings in VBA in an MS Access Database (current Office 365 Access Version) and I ran into a weird **localization problem with boolean values read from form controls**: `Me.MyBooleanControl` returns "Wahr" (german "True") => the generated SQL fails. I'm using a workaround now, wrapping each valu...
2020/03/28
[ "https://Stackoverflow.com/questions/60901054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1349511/" ]
Here is an adaption of [this example](https://matplotlib.org/2.0.2/examples/animation/dynamic_image.html) to work with two lists of data. Note that when the images don't all have the same range of data, the range will be taken from the first element drawn. A workaround is to explicitly set vmin and vmax to the global m...
``` plt.savefig('someimgname.jpg') ``` This will do the trick. But remember after you do this - open this with `Image.Open()` and this will work. ``` im = Image.open('someimgname.jpg') im.show() # or do whatever you want to do with this image object ``` Example code: ``` from matplotlib import pyplot as plt from...
60,901,054
I build some SQL query strings in VBA in an MS Access Database (current Office 365 Access Version) and I ran into a weird **localization problem with boolean values read from form controls**: `Me.MyBooleanControl` returns "Wahr" (german "True") => the generated SQL fails. I'm using a workaround now, wrapping each valu...
2020/03/28
[ "https://Stackoverflow.com/questions/60901054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1349511/" ]
Here is an adaption of [this example](https://matplotlib.org/2.0.2/examples/animation/dynamic_image.html) to work with two lists of data. Note that when the images don't all have the same range of data, the range will be taken from the first element drawn. A workaround is to explicitly set vmin and vmax to the global m...
you can use: ``` plt.savefig('name.png') ```
60,901,054
I build some SQL query strings in VBA in an MS Access Database (current Office 365 Access Version) and I ran into a weird **localization problem with boolean values read from form controls**: `Me.MyBooleanControl` returns "Wahr" (german "True") => the generated SQL fails. I'm using a workaround now, wrapping each valu...
2020/03/28
[ "https://Stackoverflow.com/questions/60901054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1349511/" ]
Here is an adaption of [this example](https://matplotlib.org/2.0.2/examples/animation/dynamic_image.html) to work with two lists of data. Note that when the images don't all have the same range of data, the range will be taken from the first element drawn. A workaround is to explicitly set vmin and vmax to the global m...
You can save it to an *"in-memory"* buffer like this: ``` # Save PNG to memory buffer as BytesIO from io import BytesIO buffer = BytesIO() plt.savefig(buffer,format='png') PNG = buffer.getvalue() ``` If you mean you want a PIL/Pillow Image from that: ``` reloadedPILImage = Image.open(buffer) ```
40,505,008
Okay im really new to all of this and im starting the CSS part for my TAFE so here it is I've been asked to add * A list * a table with 10 rows and 5 columns * A background picture * and three links. But i can figure out how to position all of these things in different spots? help? this is all I've got so far ...
2016/11/09
[ "https://Stackoverflow.com/questions/40505008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6930471/" ]
I made an example with your code description, and it works just fine. Can you please check if your array has the correct size? ``` private static void Main(string[] args) { var array1 = new List<string[]> { new[] {"1", "2", "3", "4"}, new[] {"A", "B", "C", "D"} }; var array2 = new List...
p is not an array now. Use: ``` var r = array1.Where( p => array2.All( p2 => p2[12] != p ) ).ToList(); ```
370,084
One more question about memory on Solaris 10. A *top* shows me that I have 672 MB free memory : ``` 130 processes: 126 sleeping, 2 zombie, 2 on cpu CPU states: 95.1% idle, 3.9% user, 1.0% kernel, 0.0% iowait, 0.0% swap Memory: 16G phys mem, 672M free mem, 2048M total swap, 2023M free swap ``` A *vmstat* shows m...
2012/03/15
[ "https://serverfault.com/questions/370084", "https://serverfault.com", "https://serverfault.com/users/98927/" ]
ZFS is likely using most of your memory as ARC cache. Should you want to know how your RAM is used, run this command as root: ``` # echo ::memstat | mdb -k ``` On Solaris 10 10/09 and newer, this displays something like this: ``` Page Summary Pages MB %Tot ------------ -----------...
The memory is filled with unmapped pages of data read from disk. It's kept in memory because those files may be read again and keeping the data in memory saves a disk read. Free memory is forever wasted, so the computer tries to keep as little of it as possible. For example, say you run a program. The program terminat...
1,815,586
I have some confusion about generic programming in java: If Manager is subclass of Employee, ``` Collection<Manager> managers=new Collection<Manager>; Collection<Employee> employees=managers;//why illegal? ``` Why the last statement is illegal? Since according to illustration in the book CORE JAVA,after the eras...
2009/11/29
[ "https://Stackoverflow.com/questions/1815586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149199/" ]
If the above were true, then you could take your collection of managers, treat it as a collection of employees, and then put *any* employee into a collection of managers (i.e. not just a manager, but a (say) graduate trainee, a CIO etc.) It's a little counter-intuitive. An orange **is a** fruit. A list of oranges **is...
if Y <-- X i.e. X i a type of Y, then you can substitue Y in place of X. However, that's not to say that a list of X is the same as a list of Y. This makes ``` Collection<Employee> employees=managers; ``` illegal
1,815,586
I have some confusion about generic programming in java: If Manager is subclass of Employee, ``` Collection<Manager> managers=new Collection<Manager>; Collection<Employee> employees=managers;//why illegal? ``` Why the last statement is illegal? Since according to illustration in the book CORE JAVA,after the eras...
2009/11/29
[ "https://Stackoverflow.com/questions/1815586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149199/" ]
Just imagine your code would be legal. (Let Apple be a subclass of Fruit) ``` Collection<Fruit> apples = { new Apple() }; Collection<Apple> fruit = apples; fruit.add(new Banana()); // Inserting a banana into a list of apples // Breaks type safety ```
If you don't want to change your declaration of `employees`, you can do it like this: ``` Collection<Employee> employees=new ArrayList<Employee>(managers); ```
1,815,586
I have some confusion about generic programming in java: If Manager is subclass of Employee, ``` Collection<Manager> managers=new Collection<Manager>; Collection<Employee> employees=managers;//why illegal? ``` Why the last statement is illegal? Since according to illustration in the book CORE JAVA,after the eras...
2009/11/29
[ "https://Stackoverflow.com/questions/1815586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149199/" ]
If the above were true, then you could take your collection of managers, treat it as a collection of employees, and then put *any* employee into a collection of managers (i.e. not just a manager, but a (say) graduate trainee, a CIO etc.) It's a little counter-intuitive. An orange **is a** fruit. A list of oranges **is...
*The following code snippet should highlight the problem.* ``` Collection<Manager> managers=new Collection<Manager>; Collection<Employee> employees=managers; employees.add(new Janitor()); // Writing it out with iterator instead of enhanced for-loop for(Iterator<Manager> it = managers.iterator(); it.hasNext() ; ) {...
1,815,586
I have some confusion about generic programming in java: If Manager is subclass of Employee, ``` Collection<Manager> managers=new Collection<Manager>; Collection<Employee> employees=managers;//why illegal? ``` Why the last statement is illegal? Since according to illustration in the book CORE JAVA,after the eras...
2009/11/29
[ "https://Stackoverflow.com/questions/1815586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149199/" ]
This is called [covariance and contravariance](http://en.wikipedia.org/wiki/Covariance_and_contravariance_%28computer_science%29). The issue you just discovered is a traditional problem of type systems. The corresponding [wikipedia page](http://en.wikipedia.org/wiki/Covariance_and_contravariance_%28computer_science%29#...
if Y <-- X i.e. X i a type of Y, then you can substitue Y in place of X. However, that's not to say that a list of X is the same as a list of Y. This makes ``` Collection<Employee> employees=managers; ``` illegal
1,815,586
I have some confusion about generic programming in java: If Manager is subclass of Employee, ``` Collection<Manager> managers=new Collection<Manager>; Collection<Employee> employees=managers;//why illegal? ``` Why the last statement is illegal? Since according to illustration in the book CORE JAVA,after the eras...
2009/11/29
[ "https://Stackoverflow.com/questions/1815586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149199/" ]
If the above were true, then you could take your collection of managers, treat it as a collection of employees, and then put *any* employee into a collection of managers (i.e. not just a manager, but a (say) graduate trainee, a CIO etc.) It's a little counter-intuitive. An orange **is a** fruit. A list of oranges **is...
> > Why the last statement is illegal? > > > Since according to illustration in the > book CORE JAVA,after the > erasion,Collection and > Collection are all converted > into raw type Collection. > > > Because generics in java are keeping your code safe during build time. If you want this to work, use wildcar...
1,815,586
I have some confusion about generic programming in java: If Manager is subclass of Employee, ``` Collection<Manager> managers=new Collection<Manager>; Collection<Employee> employees=managers;//why illegal? ``` Why the last statement is illegal? Since according to illustration in the book CORE JAVA,after the eras...
2009/11/29
[ "https://Stackoverflow.com/questions/1815586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149199/" ]
Just imagine your code would be legal. (Let Apple be a subclass of Fruit) ``` Collection<Fruit> apples = { new Apple() }; Collection<Apple> fruit = apples; fruit.add(new Banana()); // Inserting a banana into a list of apples // Breaks type safety ```
Forgetting about erasure for the moment: If you were allowed to assign a value of type Collection[Manager] to a variable of type Collection[Employee], then when you tried to, say add an Employee to the collection (which the variable name indicates is definitely legal), the addition would fail because what the variable ...
1,815,586
I have some confusion about generic programming in java: If Manager is subclass of Employee, ``` Collection<Manager> managers=new Collection<Manager>; Collection<Employee> employees=managers;//why illegal? ``` Why the last statement is illegal? Since according to illustration in the book CORE JAVA,after the eras...
2009/11/29
[ "https://Stackoverflow.com/questions/1815586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149199/" ]
*The following code snippet should highlight the problem.* ``` Collection<Manager> managers=new Collection<Manager>; Collection<Employee> employees=managers; employees.add(new Janitor()); // Writing it out with iterator instead of enhanced for-loop for(Iterator<Manager> it = managers.iterator(); it.hasNext() ; ) {...
Forgetting about erasure for the moment: If you were allowed to assign a value of type Collection[Manager] to a variable of type Collection[Employee], then when you tried to, say add an Employee to the collection (which the variable name indicates is definitely legal), the addition would fail because what the variable ...
1,815,586
I have some confusion about generic programming in java: If Manager is subclass of Employee, ``` Collection<Manager> managers=new Collection<Manager>; Collection<Employee> employees=managers;//why illegal? ``` Why the last statement is illegal? Since according to illustration in the book CORE JAVA,after the eras...
2009/11/29
[ "https://Stackoverflow.com/questions/1815586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149199/" ]
*The following code snippet should highlight the problem.* ``` Collection<Manager> managers=new Collection<Manager>; Collection<Employee> employees=managers; employees.add(new Janitor()); // Writing it out with iterator instead of enhanced for-loop for(Iterator<Manager> it = managers.iterator(); it.hasNext() ; ) {...
Because anyone handling the employees collection will see it as simply being a collection of `Employee`, meaning there's no problem adding to it other `Employee` objects. But it's exactly the same instance as the one in the managers collection, meaning that someone handling the managers collection might get an `Employe...
1,815,586
I have some confusion about generic programming in java: If Manager is subclass of Employee, ``` Collection<Manager> managers=new Collection<Manager>; Collection<Employee> employees=managers;//why illegal? ``` Why the last statement is illegal? Since according to illustration in the book CORE JAVA,after the eras...
2009/11/29
[ "https://Stackoverflow.com/questions/1815586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149199/" ]
*The following code snippet should highlight the problem.* ``` Collection<Manager> managers=new Collection<Manager>; Collection<Employee> employees=managers; employees.add(new Janitor()); // Writing it out with iterator instead of enhanced for-loop for(Iterator<Manager> it = managers.iterator(); it.hasNext() ; ) {...
Actually, what you're trying is possible: ``` Collection managers = new Collection<Manager>(); // note the missing generic type on the variable Collection employees = new Collection<Employee>(); employees = managers; //compiles fine. ``` You do get some generic type warnings, though. But as long as you don't cast y...
1,815,586
I have some confusion about generic programming in java: If Manager is subclass of Employee, ``` Collection<Manager> managers=new Collection<Manager>; Collection<Employee> employees=managers;//why illegal? ``` Why the last statement is illegal? Since according to illustration in the book CORE JAVA,after the eras...
2009/11/29
[ "https://Stackoverflow.com/questions/1815586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/149199/" ]
*The following code snippet should highlight the problem.* ``` Collection<Manager> managers=new Collection<Manager>; Collection<Employee> employees=managers; employees.add(new Janitor()); // Writing it out with iterator instead of enhanced for-loop for(Iterator<Manager> it = managers.iterator(); it.hasNext() ; ) {...
if Y <-- X i.e. X i a type of Y, then you can substitue Y in place of X. However, that's not to say that a list of X is the same as a list of Y. This makes ``` Collection<Employee> employees=managers; ``` illegal
783,617
I am using Web Flow 2.0.7 with Spring MVC and Hibernate. My problem is about custom converters for my custom types and database connection from within my converter. Let's say I have a type *Person* and the *Person* has a field of my custom type *Title*, and all *Titles* are already in my database. Now I have an html ...
2009/04/23
[ "https://Stackoverflow.com/questions/783617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/95033/" ]
I use to do this. Basically I load the list of Titles and put it in my form model. In the form model I have also a currentTitleId or selectedTitleId variable to store the value of the selected item. This field name is set in the "path" of the spring combobox and the titleList is set in the "items". Then the value that ...
I'm not so sure about Spring Web Flow, but with the normal Spring MVC it is sufficient to register a new PropertyEditor and then this stuff works automatically <http://static.springframework.org/spring/docs/2.5.x/reference/validation.html#beans-beans-conversion-customeditor-registration> <http://static.springframewor...
30,777
I purchased a Chlorophytum Comosum in October 2016. It's 3 or 4 separate plants. I moved it from its 10cm diameter plastic pot into one that's roughly 15 cm and about 20 cm deep, without drainage. When moving it, I just took all of the soil and the plant from the original pot and placed it into a hole that I dug in the...
2017/02/12
[ "https://gardening.stackexchange.com/questions/30777", "https://gardening.stackexchange.com", "https://gardening.stackexchange.com/users/16516/" ]
Sorry, I am not seeing a plant with problems. Perhaps a little stress from transplanting and/or being moved from a source of higher light to lower light. You are using potting soil and your watering sounds and looks just fine. Beautiful spider plant! The leaves as they age will bend more than new growth. The color is r...
Spider plants have very fleshy roots. They are greedy feeders and will transfer nutrients into their root system as though preparing for a long, long drought and so look great for the longest time. Then all of a sudden things look not quite so rosy. I have knocked them out of their pots to find that the root ball of so...
30,777
I purchased a Chlorophytum Comosum in October 2016. It's 3 or 4 separate plants. I moved it from its 10cm diameter plastic pot into one that's roughly 15 cm and about 20 cm deep, without drainage. When moving it, I just took all of the soil and the plant from the original pot and placed it into a hole that I dug in the...
2017/02/12
[ "https://gardening.stackexchange.com/questions/30777", "https://gardening.stackexchange.com", "https://gardening.stackexchange.com/users/16516/" ]
(Sorry, not enough reputation here to comment) As Colin Beckingham mentions, my experience is that these plants create many roots, eventually replacing all soil. If you wait too long with repotting them into a bigger pot (or dealing with all these roots some other way?), it may be very hard to remove the plant from it...
Spider plants have very fleshy roots. They are greedy feeders and will transfer nutrients into their root system as though preparing for a long, long drought and so look great for the longest time. Then all of a sudden things look not quite so rosy. I have knocked them out of their pots to find that the root ball of so...
19,368,438
I've started exercising some C and found this nice exercise where I have to print a triangle via input. for the input 6 it will print ``` * ** *** **** ***** ****** ***** **** *** ** * ``` Now, looking at it I thought, well, that's not such a hard task. So I decided to try and write it using recursion, no loops and ...
2013/10/14
[ "https://Stackoverflow.com/questions/19368438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1035062/" ]
Anything done with loops can be done with recursion with the same number of variables. You just have to tease out what is the state, and pass that updated state in a recursive call, instead of looping. So let's do it iterativey, first. The input is `size`, the size of the triangle. Let's have two state variables, `li...
Using 2 parameters as OP suggested ``` void PrintTriangle(int iMainNumber, int iCurrNumber) { if (iMainNumber < 0) { // Row (use negative iMainNumber) printf("%c", '*'); PrintTriangle(iMainNumber + 1, 0); if (iMainNumber == -1) printf("\n"); } else if (iMainNumber > 0) { if (iCurrNumber < iM...
19,368,438
I've started exercising some C and found this nice exercise where I have to print a triangle via input. for the input 6 it will print ``` * ** *** **** ***** ****** ***** **** *** ** * ``` Now, looking at it I thought, well, that's not such a hard task. So I decided to try and write it using recursion, no loops and ...
2013/10/14
[ "https://Stackoverflow.com/questions/19368438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1035062/" ]
I came up with: ``` void PrintTriangle(int size, int indent) { switch(size) { case 0: if (indent > 1) PrintTriangle(size, indent-1); putchar('*'); break; case 1: PrintTriangle(size-1, indent+1); putchar('\n'); break; default: PrintTriangle(1, inde...
Anything done with loops can be done with recursion with the same number of variables. You just have to tease out what is the state, and pass that updated state in a recursive call, instead of looping. So let's do it iterativey, first. The input is `size`, the size of the triangle. Let's have two state variables, `li...
19,368,438
I've started exercising some C and found this nice exercise where I have to print a triangle via input. for the input 6 it will print ``` * ** *** **** ***** ****** ***** **** *** ** * ``` Now, looking at it I thought, well, that's not such a hard task. So I decided to try and write it using recursion, no loops and ...
2013/10/14
[ "https://Stackoverflow.com/questions/19368438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1035062/" ]
Anything done with loops can be done with recursion with the same number of variables. You just have to tease out what is the state, and pass that updated state in a recursive call, instead of looping. So let's do it iterativey, first. The input is `size`, the size of the triangle. Let's have two state variables, `li...
From what I have read, most suggestions have already pointed out to pass in any state you need. However, you really don't need that many branching statements. Most of what you need, you can derive arithmetically. You can calculate the total number of recursions and derive the number of stars from the current recursio...
19,368,438
I've started exercising some C and found this nice exercise where I have to print a triangle via input. for the input 6 it will print ``` * ** *** **** ***** ****** ***** **** *** ** * ``` Now, looking at it I thought, well, that's not such a hard task. So I decided to try and write it using recursion, no loops and ...
2013/10/14
[ "https://Stackoverflow.com/questions/19368438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1035062/" ]
Anything done with loops can be done with recursion with the same number of variables. You just have to tease out what is the state, and pass that updated state in a recursive call, instead of looping. So let's do it iterativey, first. The input is `size`, the size of the triangle. Let's have two state variables, `li...
Pure recursion, no loops, calling program 'main()' passes only one parameter: ``` void PrintTheClms(int width, int stars) { printf("*"); if stars < width then { PrintTheClms(width, stars+1); } } void PrintStars(int width) { PrintTheClms(width, 1); printf("\n"); } void PrintTheRows(int size...
19,368,438
I've started exercising some C and found this nice exercise where I have to print a triangle via input. for the input 6 it will print ``` * ** *** **** ***** ****** ***** **** *** ** * ``` Now, looking at it I thought, well, that's not such a hard task. So I decided to try and write it using recursion, no loops and ...
2013/10/14
[ "https://Stackoverflow.com/questions/19368438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1035062/" ]
I came up with: ``` void PrintTriangle(int size, int indent) { switch(size) { case 0: if (indent > 1) PrintTriangle(size, indent-1); putchar('*'); break; case 1: PrintTriangle(size-1, indent+1); putchar('\n'); break; default: PrintTriangle(1, inde...
Using 2 parameters as OP suggested ``` void PrintTriangle(int iMainNumber, int iCurrNumber) { if (iMainNumber < 0) { // Row (use negative iMainNumber) printf("%c", '*'); PrintTriangle(iMainNumber + 1, 0); if (iMainNumber == -1) printf("\n"); } else if (iMainNumber > 0) { if (iCurrNumber < iM...
19,368,438
I've started exercising some C and found this nice exercise where I have to print a triangle via input. for the input 6 it will print ``` * ** *** **** ***** ****** ***** **** *** ** * ``` Now, looking at it I thought, well, that's not such a hard task. So I decided to try and write it using recursion, no loops and ...
2013/10/14
[ "https://Stackoverflow.com/questions/19368438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1035062/" ]
Using 2 parameters as OP suggested ``` void PrintTriangle(int iMainNumber, int iCurrNumber) { if (iMainNumber < 0) { // Row (use negative iMainNumber) printf("%c", '*'); PrintTriangle(iMainNumber + 1, 0); if (iMainNumber == -1) printf("\n"); } else if (iMainNumber > 0) { if (iCurrNumber < iM...
From what I have read, most suggestions have already pointed out to pass in any state you need. However, you really don't need that many branching statements. Most of what you need, you can derive arithmetically. You can calculate the total number of recursions and derive the number of stars from the current recursio...
19,368,438
I've started exercising some C and found this nice exercise where I have to print a triangle via input. for the input 6 it will print ``` * ** *** **** ***** ****** ***** **** *** ** * ``` Now, looking at it I thought, well, that's not such a hard task. So I decided to try and write it using recursion, no loops and ...
2013/10/14
[ "https://Stackoverflow.com/questions/19368438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1035062/" ]
Using 2 parameters as OP suggested ``` void PrintTriangle(int iMainNumber, int iCurrNumber) { if (iMainNumber < 0) { // Row (use negative iMainNumber) printf("%c", '*'); PrintTriangle(iMainNumber + 1, 0); if (iMainNumber == -1) printf("\n"); } else if (iMainNumber > 0) { if (iCurrNumber < iM...
Pure recursion, no loops, calling program 'main()' passes only one parameter: ``` void PrintTheClms(int width, int stars) { printf("*"); if stars < width then { PrintTheClms(width, stars+1); } } void PrintStars(int width) { PrintTheClms(width, 1); printf("\n"); } void PrintTheRows(int size...
19,368,438
I've started exercising some C and found this nice exercise where I have to print a triangle via input. for the input 6 it will print ``` * ** *** **** ***** ****** ***** **** *** ** * ``` Now, looking at it I thought, well, that's not such a hard task. So I decided to try and write it using recursion, no loops and ...
2013/10/14
[ "https://Stackoverflow.com/questions/19368438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1035062/" ]
I came up with: ``` void PrintTriangle(int size, int indent) { switch(size) { case 0: if (indent > 1) PrintTriangle(size, indent-1); putchar('*'); break; case 1: PrintTriangle(size-1, indent+1); putchar('\n'); break; default: PrintTriangle(1, inde...
From what I have read, most suggestions have already pointed out to pass in any state you need. However, you really don't need that many branching statements. Most of what you need, you can derive arithmetically. You can calculate the total number of recursions and derive the number of stars from the current recursio...
19,368,438
I've started exercising some C and found this nice exercise where I have to print a triangle via input. for the input 6 it will print ``` * ** *** **** ***** ****** ***** **** *** ** * ``` Now, looking at it I thought, well, that's not such a hard task. So I decided to try and write it using recursion, no loops and ...
2013/10/14
[ "https://Stackoverflow.com/questions/19368438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1035062/" ]
I came up with: ``` void PrintTriangle(int size, int indent) { switch(size) { case 0: if (indent > 1) PrintTriangle(size, indent-1); putchar('*'); break; case 1: PrintTriangle(size-1, indent+1); putchar('\n'); break; default: PrintTriangle(1, inde...
Pure recursion, no loops, calling program 'main()' passes only one parameter: ``` void PrintTheClms(int width, int stars) { printf("*"); if stars < width then { PrintTheClms(width, stars+1); } } void PrintStars(int width) { PrintTheClms(width, 1); printf("\n"); } void PrintTheRows(int size...
9,740
I work at a very young start-up company. We have had turn-over rates (mass resignation of staff, thrice) in the past but changes in the system have led to a more a stable employee retention and better technical-skilled employees. We do games, and I don't know with other software fields, but the "[death march](http://ar...
2013/02/18
[ "https://workplace.stackexchange.com/questions/9740", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/7817/" ]
The link you included in your question contains really all the information and references you need. Especially the Evan Robinson's well-known paper [Why Crunch Modes Doesn't Work](https://web.archive.org/web/20160304165322/http://www.igda.org/?page=crunchsixlessons), together with the supporting material and references...
To change from a culture of overtime to efficiency you will have to stop the death marches. Each person has a limit, after that they can actually produce negative work. The density and severity of their errors will mean that that last few hours they worked, the project went backwards. Their mistakes may be obvious , th...
9,740
I work at a very young start-up company. We have had turn-over rates (mass resignation of staff, thrice) in the past but changes in the system have led to a more a stable employee retention and better technical-skilled employees. We do games, and I don't know with other software fields, but the "[death march](http://ar...
2013/02/18
[ "https://workplace.stackexchange.com/questions/9740", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/7817/" ]
The simple answer is to simply begin working 40 hour work weeks and make sure YOU are efficient for those 40 hours. If you aren't already burned out then the results will become apparent fairly quickly. If you are already burned out then 40 hour weeks probably won't make a difference, so keep working your 60-90 hour wo...
To change from a culture of overtime to efficiency you will have to stop the death marches. Each person has a limit, after that they can actually produce negative work. The density and severity of their errors will mean that that last few hours they worked, the project went backwards. Their mistakes may be obvious , th...
9,740
I work at a very young start-up company. We have had turn-over rates (mass resignation of staff, thrice) in the past but changes in the system have led to a more a stable employee retention and better technical-skilled employees. We do games, and I don't know with other software fields, but the "[death march](http://ar...
2013/02/18
[ "https://workplace.stackexchange.com/questions/9740", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/7817/" ]
To change from a culture of overtime to efficiency you will have to stop the death marches. Each person has a limit, after that they can actually produce negative work. The density and severity of their errors will mean that that last few hours they worked, the project went backwards. Their mistakes may be obvious , th...
**Seems to be working** If you're meeting the deadlines, I don't see how you can justify calling them impossible. Your boss thinks he's the next Steve Jobs. Just push for more-it's really that simple. **Negative Consequences** I haven't found any mention of what happens when deadlines aren't met. Has anyone been fired...
9,740
I work at a very young start-up company. We have had turn-over rates (mass resignation of staff, thrice) in the past but changes in the system have led to a more a stable employee retention and better technical-skilled employees. We do games, and I don't know with other software fields, but the "[death march](http://ar...
2013/02/18
[ "https://workplace.stackexchange.com/questions/9740", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/7817/" ]
To change from a culture of overtime to efficiency you will have to stop the death marches. Each person has a limit, after that they can actually produce negative work. The density and severity of their errors will mean that that last few hours they worked, the project went backwards. Their mistakes may be obvious , th...
Other replies list why it's a bad idea to work extreme hours. Let me focus on a different aspect instead. What you're attempting to do is basically a culture transformation. This is impossible to do without a heavy management sponsorship. You don't just need to *convince* the management. You need to transform them in...
9,740
I work at a very young start-up company. We have had turn-over rates (mass resignation of staff, thrice) in the past but changes in the system have led to a more a stable employee retention and better technical-skilled employees. We do games, and I don't know with other software fields, but the "[death march](http://ar...
2013/02/18
[ "https://workplace.stackexchange.com/questions/9740", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/7817/" ]
The link you included in your question contains really all the information and references you need. Especially the Evan Robinson's well-known paper [Why Crunch Modes Doesn't Work](https://web.archive.org/web/20160304165322/http://www.igda.org/?page=crunchsixlessons), together with the supporting material and references...
The simple answer is to simply begin working 40 hour work weeks and make sure YOU are efficient for those 40 hours. If you aren't already burned out then the results will become apparent fairly quickly. If you are already burned out then 40 hour weeks probably won't make a difference, so keep working your 60-90 hour wo...
9,740
I work at a very young start-up company. We have had turn-over rates (mass resignation of staff, thrice) in the past but changes in the system have led to a more a stable employee retention and better technical-skilled employees. We do games, and I don't know with other software fields, but the "[death march](http://ar...
2013/02/18
[ "https://workplace.stackexchange.com/questions/9740", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/7817/" ]
The link you included in your question contains really all the information and references you need. Especially the Evan Robinson's well-known paper [Why Crunch Modes Doesn't Work](https://web.archive.org/web/20160304165322/http://www.igda.org/?page=crunchsixlessons), together with the supporting material and references...
**Seems to be working** If you're meeting the deadlines, I don't see how you can justify calling them impossible. Your boss thinks he's the next Steve Jobs. Just push for more-it's really that simple. **Negative Consequences** I haven't found any mention of what happens when deadlines aren't met. Has anyone been fired...