qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
17,067,849
I've created a method that makes a black bar appear on the side of an image on mouseover. It's all well and good when it's only one image but when applied to multiple images the black bar appears on both images in the event of mouse over. Is it possible to to get each image to act independently from each other so tha...
2013/06/12
[ "https://Stackoverflow.com/questions/17067849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1225755/" ]
Not sure why you're doing this all in js, can you use CSS? Just remove ``` imgEl.hover(function() { $(menuEl).css("visibility", "visible"); }, function() { $(menuEl).css("visibility", "hidden"); }); ``` and you can add ``` .img_wrapper:hover .img_menu { visibility: visible; } ``` ...
People beat me to it but heres my answer, creating a plugin here is the ideal way to go! ``` $.fn.panelize = function (initState) { // set a default show state var show = initState || false; var animation = { duration: 300, easing: 'linear', }; return this.each(function() { _this = $(this); ...
17,067,849
I've created a method that makes a black bar appear on the side of an image on mouseover. It's all well and good when it's only one image but when applied to multiple images the black bar appears on both images in the event of mouse over. Is it possible to to get each image to act independently from each other so tha...
2013/06/12
[ "https://Stackoverflow.com/questions/17067849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1225755/" ]
you can do ``` $.fn.panzoom = function() { return this.each(function(){ var $this = $(this); $this.imagesLoaded(function(){ $this.wrap('<div class="img_wrapper" />'); var imgEl = $this.parent(".img_wrapper"); imgEl.width($this.width()); imgEl.height($this.height()); ...
People beat me to it but heres my answer, creating a plugin here is the ideal way to go! ``` $.fn.panelize = function (initState) { // set a default show state var show = initState || false; var animation = { duration: 300, easing: 'linear', }; return this.each(function() { _this = $(this); ...
60,778,415
This is driving me crazy!!! Here is the code that I am trying to put data for the last 31 days between 2 dates, NOW and 31 days later. This code does not work: ``` $now = date("Y-m-d"); $datetime = new DateTime($now); $datetime->modify('+31 days'); $NEW_30 = $datetime->format('Y-m-d'); $get_time1ax = "select * from...
2020/03/20
[ "https://Stackoverflow.com/questions/60778415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9005537/" ]
> > I am trying to put data for the last 31 days between [...] now and 31 days later. > > > You can do date arithmetics directly in the database: ``` select * from support_tickets where start_date >= curent_date and end_date <= current_date + interval 31 day ``` Possibly, you mean 1 month when you say 31 days...
try this: ``` $current_date = date("Y-m-d"); $current_date_plus_31 = date('Y-m-d',strtotime('+31 days',strtotime($current_date))); ``` this is how it works for me with today's date and in 31 days
39,663,167
I am creating an app in IOS and android in cordova cli 6.3.1. I am not getting the app icon displayed in IOS but working fine in android. Here is my config My APP My APP ``` <content src="index.html" /> <plugin name="cordova-plugin-splashscreen" spec="4.0.0" /> <plugin name="cordova-plugin-network-information" ...
2016/09/23
[ "https://Stackoverflow.com/questions/39663167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6435435/" ]
You're probably missing the right icon size. Currently these are all the icons iOS requires. ``` <platform name="ios"> <icon height="57" src="res/icons/icon-57.png" width="57" /> <icon height="114" src="res/icons/icon-114.png" width="114" /> <icon height="72" src="res/icons/icon-72.png" width=...
Yes. For cordova with iOS and change icon and splash image, the simplest way is: 1. Having a 1024 icon for better quality Process for iOS all sizes with [pgicons.abiro.com](http://pgicons.abiro.com) 2. Get zip uncompressed and copy to the root directory of the project. 3. Finally edit from root directory the config.xm...
39,663,167
I am creating an app in IOS and android in cordova cli 6.3.1. I am not getting the app icon displayed in IOS but working fine in android. Here is my config My APP My APP ``` <content src="index.html" /> <plugin name="cordova-plugin-splashscreen" spec="4.0.0" /> <plugin name="cordova-plugin-network-information" ...
2016/09/23
[ "https://Stackoverflow.com/questions/39663167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6435435/" ]
You're probably missing the right icon size. Currently these are all the icons iOS requires. ``` <platform name="ios"> <icon height="57" src="res/icons/icon-57.png" width="57" /> <icon height="114" src="res/icons/icon-114.png" width="114" /> <icon height="72" src="res/icons/icon-72.png" width=...
You can try the following scripts that auto-generate icons and splashscreens for Cordova using ImageMagick: <https://github.com/AlexDisler/cordova-icon> <https://github.com/AlexDisler/cordova-splash>
25,981,099
How does method chaining work in ruby? As a C# developer, when I see `1.hour.from_now.localtime`, I'm not sure what's going on. How does this code work? ``` <%= 1.hour.from_now.localtime %> ```
2014/09/22
[ "https://Stackoverflow.com/questions/25981099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/554019/" ]
`1` is an object that responds to hour ``` pry(main)> 1.class => Fixnum ``` `.hour` is a method on Fixnum that signifies it as an hour (by changing it to 3600) ``` pry(main)> 1.hour.class => Fixnum pry(main)> 1.hour.to_i => 3600 ``` `.from_now` changes the type of `3600` to a DateTime, 3600 seconds in to the futu...
Everything in Ruby is an object, so in this case: * The Fixnum `1` object receives the message `hour` + Which returns a Fixnum of seconds * `3600 seconds` receives the message `from_now` + Which returns an `ActiveSupport::TimeWithZone` object + Essentially it offsets the current time (the `from_now`) by an offset (...
2,170,675
let : $h: \mathbb{R}\to \mathbb{R}$ ane for any real number $$h(x^2+x+3)+2h(x^2-3x+5)=6x^2-10x+17$$ then : $$h(85)=?$$ My Try: $$x=0:h(3)+2h(5)=17\\x=1:h(5)+2h(3)=13\\+\\3h(3)+3h(5)=30\\h(3)+h(5)=10$$ now ?
2017/03/03
[ "https://math.stackexchange.com/questions/2170675", "https://math.stackexchange.com", "https://math.stackexchange.com/users/402750/" ]
Let $h(x) \equiv Ax+B$, then $$A(x^2+x+3)+B+2A(x^2-3x+5)+2B\equiv 6x^2-10x+17$$ $$ \left \{ \begin{align\*} 3A &= 6 \\ -5A &= -10 \\ 13A+2B &= 17 \\ \end{align\*} \right.$$ On solving, $(A,B)=\left( 2, -\dfrac{9}{2} \right)$ --- Alternatively, * $x=\dfrac{-1 \pm \sqrt{329}}{2} \implies x^2+x+3=85 \quad \text{an...
Denote: $x^2+x+3=t$. Then: $$h(t)+2h(t-4x+2)=6t-16x-1.$$ Plug $x=\frac{1}{2}$ to get: $$h(t)+2h(t)=6t-9 \Rightarrow h(t)=2t-3.$$ Hence: $$h(85)=2\cdot 85-3=167.$$
2,170,675
let : $h: \mathbb{R}\to \mathbb{R}$ ane for any real number $$h(x^2+x+3)+2h(x^2-3x+5)=6x^2-10x+17$$ then : $$h(85)=?$$ My Try: $$x=0:h(3)+2h(5)=17\\x=1:h(5)+2h(3)=13\\+\\3h(3)+3h(5)=30\\h(3)+h(5)=10$$ now ?
2017/03/03
[ "https://math.stackexchange.com/questions/2170675", "https://math.stackexchange.com", "https://math.stackexchange.com/users/402750/" ]
Let $h(x) \equiv Ax+B$, then $$A(x^2+x+3)+B+2A(x^2-3x+5)+2B\equiv 6x^2-10x+17$$ $$ \left \{ \begin{align\*} 3A &= 6 \\ -5A &= -10 \\ 13A+2B &= 17 \\ \end{align\*} \right.$$ On solving, $(A,B)=\left( 2, -\dfrac{9}{2} \right)$ --- Alternatively, * $x=\dfrac{-1 \pm \sqrt{329}}{2} \implies x^2+x+3=85 \quad \text{an...
For a general way of solving this, look at my answer to this [question](https://math.stackexchange.com/questions/2819063/fx2-x2fx2-3x-2-9x2-15x-then-find-f2016/2819289#2819289). When supposing it's a linear function, you also have to prove it can't be anything else, so your solution is complete.
12,766,653
**Problem:** I'd like to try building a proof-of-concept app using the Samsung SmartTV SDK 2.5 (I have a 2011 model TV - UA55D8000). Unfortunaltely, the SDK comes in two varieties that only seem to work on Microsoft Windows. It's weird because there's no reason it should be the case: the televisions themselves run L...
2012/10/07
[ "https://Stackoverflow.com/questions/12766653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289384/" ]
I've had a reasonable amount of success setting up a development environment on my Ubuntu machine and I'd like to share my methods here for anyone looking to do the same. This answer is intended to be platform independent, so the same advice should work on any fully fledged operating system. Introduction ------------...
I know it's an old question, but since I'm delving into the process, I figured I'd share some links. Enjoy! Decent quick start guide on developing for the Smart TV platform: <http://www.samsungdforum.com/Guide/c02/index.html>. These are the minimum project requirements and some example files: <http://www.samsungdforu...
12,766,653
**Problem:** I'd like to try building a proof-of-concept app using the Samsung SmartTV SDK 2.5 (I have a 2011 model TV - UA55D8000). Unfortunaltely, the SDK comes in two varieties that only seem to work on Microsoft Windows. It's weird because there's no reason it should be the case: the televisions themselves run L...
2012/10/07
[ "https://Stackoverflow.com/questions/12766653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289384/" ]
I've had a reasonable amount of success setting up a development environment on my Ubuntu machine and I'd like to share my methods here for anyone looking to do the same. This answer is intended to be platform independent, so the same advice should work on any fully fledged operating system. Introduction ------------...
One tip that I have not seen mentioned in any of the answers, is that the TV will attempt to open a socket connection on port 45634 of the machine where the app was downloaded from (the one with the widgetlist.xml). All debugging (alerts() calls), will be sent over this port, allowing for remote debugging. I use NetC...
12,766,653
**Problem:** I'd like to try building a proof-of-concept app using the Samsung SmartTV SDK 2.5 (I have a 2011 model TV - UA55D8000). Unfortunaltely, the SDK comes in two varieties that only seem to work on Microsoft Windows. It's weird because there's no reason it should be the case: the televisions themselves run L...
2012/10/07
[ "https://Stackoverflow.com/questions/12766653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289384/" ]
I've had a reasonable amount of success setting up a development environment on my Ubuntu machine and I'd like to share my methods here for anyone looking to do the same. This answer is intended to be platform independent, so the same advice should work on any fully fledged operating system. Introduction ------------...
They have now released Smart TV SDK 4.0 which includes support for Linux & Mac OS X: <http://www.samsungdforum.com/SamsungDForum/NewsView?newsID=27> "In addition to the Eclipse-based App Editor, a new Linux-based Emulator has been released. This Emulator executes in an Ubuntu virtual machine that is run in the Virt...
12,766,653
**Problem:** I'd like to try building a proof-of-concept app using the Samsung SmartTV SDK 2.5 (I have a 2011 model TV - UA55D8000). Unfortunaltely, the SDK comes in two varieties that only seem to work on Microsoft Windows. It's weird because there's no reason it should be the case: the televisions themselves run L...
2012/10/07
[ "https://Stackoverflow.com/questions/12766653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289384/" ]
I've created this Answer for a topic that I know nothing about, but nevertheless I did spot something that threw a red flag in my direction... *[bounty](/questions/tagged/bounty "show questions tagged 'bounty'") or not.* First, I looked at your [**WineHQ Bug Report**](http://bugs.winehq.org/show_bug.cgi?id=32414) to s...
For people who like doing everything with command line, smarttvjs (<http://smarttvjs.org>) has made it very easy: * $smarttvjs init #create sample project * ... do some development (IDE is nor required) * $smarttvjs build samsung (create a package for samsung) * $smarttvjs run samsung #launch simulator
12,766,653
**Problem:** I'd like to try building a proof-of-concept app using the Samsung SmartTV SDK 2.5 (I have a 2011 model TV - UA55D8000). Unfortunaltely, the SDK comes in two varieties that only seem to work on Microsoft Windows. It's weird because there's no reason it should be the case: the televisions themselves run L...
2012/10/07
[ "https://Stackoverflow.com/questions/12766653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289384/" ]
They have now released Smart TV SDK 4.0 which includes support for Linux & Mac OS X: <http://www.samsungdforum.com/SamsungDForum/NewsView?newsID=27> "In addition to the Eclipse-based App Editor, a new Linux-based Emulator has been released. This Emulator executes in an Ubuntu virtual machine that is run in the Virt...
For people who like doing everything with command line, smarttvjs (<http://smarttvjs.org>) has made it very easy: * $smarttvjs init #create sample project * ... do some development (IDE is nor required) * $smarttvjs build samsung (create a package for samsung) * $smarttvjs run samsung #launch simulator
12,766,653
**Problem:** I'd like to try building a proof-of-concept app using the Samsung SmartTV SDK 2.5 (I have a 2011 model TV - UA55D8000). Unfortunaltely, the SDK comes in two varieties that only seem to work on Microsoft Windows. It's weird because there's no reason it should be the case: the televisions themselves run L...
2012/10/07
[ "https://Stackoverflow.com/questions/12766653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289384/" ]
One tip that I have not seen mentioned in any of the answers, is that the TV will attempt to open a socket connection on port 45634 of the machine where the app was downloaded from (the one with the widgetlist.xml). All debugging (alerts() calls), will be sent over this port, allowing for remote debugging. I use NetC...
I know it's an old question, but since I'm delving into the process, I figured I'd share some links. Enjoy! Decent quick start guide on developing for the Smart TV platform: <http://www.samsungdforum.com/Guide/c02/index.html>. These are the minimum project requirements and some example files: <http://www.samsungdforu...
12,766,653
**Problem:** I'd like to try building a proof-of-concept app using the Samsung SmartTV SDK 2.5 (I have a 2011 model TV - UA55D8000). Unfortunaltely, the SDK comes in two varieties that only seem to work on Microsoft Windows. It's weird because there's no reason it should be the case: the televisions themselves run L...
2012/10/07
[ "https://Stackoverflow.com/questions/12766653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289384/" ]
I've had a reasonable amount of success setting up a development environment on my Ubuntu machine and I'd like to share my methods here for anyone looking to do the same. This answer is intended to be platform independent, so the same advice should work on any fully fledged operating system. Introduction ------------...
For people who like doing everything with command line, smarttvjs (<http://smarttvjs.org>) has made it very easy: * $smarttvjs init #create sample project * ... do some development (IDE is nor required) * $smarttvjs build samsung (create a package for samsung) * $smarttvjs run samsung #launch simulator
12,766,653
**Problem:** I'd like to try building a proof-of-concept app using the Samsung SmartTV SDK 2.5 (I have a 2011 model TV - UA55D8000). Unfortunaltely, the SDK comes in two varieties that only seem to work on Microsoft Windows. It's weird because there's no reason it should be the case: the televisions themselves run L...
2012/10/07
[ "https://Stackoverflow.com/questions/12766653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289384/" ]
They have now released Smart TV SDK 4.0 which includes support for Linux & Mac OS X: <http://www.samsungdforum.com/SamsungDForum/NewsView?newsID=27> "In addition to the Eclipse-based App Editor, a new Linux-based Emulator has been released. This Emulator executes in an Ubuntu virtual machine that is run in the Virt...
I've created this Answer for a topic that I know nothing about, but nevertheless I did spot something that threw a red flag in my direction... *[bounty](/questions/tagged/bounty "show questions tagged 'bounty'") or not.* First, I looked at your [**WineHQ Bug Report**](http://bugs.winehq.org/show_bug.cgi?id=32414) to s...
12,766,653
**Problem:** I'd like to try building a proof-of-concept app using the Samsung SmartTV SDK 2.5 (I have a 2011 model TV - UA55D8000). Unfortunaltely, the SDK comes in two varieties that only seem to work on Microsoft Windows. It's weird because there's no reason it should be the case: the televisions themselves run L...
2012/10/07
[ "https://Stackoverflow.com/questions/12766653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289384/" ]
I know it's an old question, but since I'm delving into the process, I figured I'd share some links. Enjoy! Decent quick start guide on developing for the Smart TV platform: <http://www.samsungdforum.com/Guide/c02/index.html>. These are the minimum project requirements and some example files: <http://www.samsungdforu...
For people who like doing everything with command line, smarttvjs (<http://smarttvjs.org>) has made it very easy: * $smarttvjs init #create sample project * ... do some development (IDE is nor required) * $smarttvjs build samsung (create a package for samsung) * $smarttvjs run samsung #launch simulator
12,766,653
**Problem:** I'd like to try building a proof-of-concept app using the Samsung SmartTV SDK 2.5 (I have a 2011 model TV - UA55D8000). Unfortunaltely, the SDK comes in two varieties that only seem to work on Microsoft Windows. It's weird because there's no reason it should be the case: the televisions themselves run L...
2012/10/07
[ "https://Stackoverflow.com/questions/12766653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1289384/" ]
One tip that I have not seen mentioned in any of the answers, is that the TV will attempt to open a socket connection on port 45634 of the machine where the app was downloaded from (the one with the widgetlist.xml). All debugging (alerts() calls), will be sent over this port, allowing for remote debugging. I use NetC...
For people who like doing everything with command line, smarttvjs (<http://smarttvjs.org>) has made it very easy: * $smarttvjs init #create sample project * ... do some development (IDE is nor required) * $smarttvjs build samsung (create a package for samsung) * $smarttvjs run samsung #launch simulator
12,309
I've always used "я понимаю" to mean "I understand" but today came across "мне понятно" which, after checking, seems to mean the same. Is there a difference?
2016/04/19
[ "https://russian.stackexchange.com/questions/12309", "https://russian.stackexchange.com", "https://russian.stackexchange.com/users/7169/" ]
Although in some situations these sentences may be used interchangeably, there is a subtle difference. "Мне понятно" is a neutral impersonal sentence that basically means 'it is clear to me that...' ('A clear picture of the subject is present in my mind'): * `Мне непонятно, как ему это удаётся.` - 'I can't understand...
No, Echilon, there is no significant difference, it's quite the same. At least, it's so in the case of "Я понимаю, что..." and "Мне понятно, что...".
12,309
I've always used "я понимаю" to mean "I understand" but today came across "мне понятно" which, after checking, seems to mean the same. Is there a difference?
2016/04/19
[ "https://russian.stackexchange.com/questions/12309", "https://russian.stackexchange.com", "https://russian.stackexchange.com/users/7169/" ]
Although in some situations these sentences may be used interchangeably, there is a subtle difference. "Мне понятно" is a neutral impersonal sentence that basically means 'it is clear to me that...' ('A clear picture of the subject is present in my mind'): * `Мне непонятно, как ему это удаётся.` - 'I can't understand...
*Я понимаю A* = active voice, *I understand A* *Мне понятно A* = passive voice, *A is understandable for me*
20,394,311
I have 'Workbook1' which has command buttons to perform certain operations. When a button is clicked in this workbook, it downloads a different workbook from Outlook and opens that workbook with a variable name, which is 'Workbook2'. After this, I want to set a filter in that workbook. But I'm not able to do that. I am...
2013/12/05
[ "https://Stackoverflow.com/questions/20394311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3004817/" ]
Two things: (1) Using `ActiveSheet` or just going straight to `Range` means you're running from the workbook that's calling the macro. Since you opened a new book, you have two workbooks active, but you are targeting the current workbook with the way your code is set up. (2) This code block might cause some problem: ...
You open you workbook in separate instance of Excel while you try to run `find method` in the instance of excel where is you code. Try this: ``` colNameF = EXCELApplication.Workbooks(DefPath & strExt & ".xlsb"). _ Sheets("Release Level View"). _ Range("A8:DD8").Find(What:="Teams", LookI...
61,024,412
I am working on Send money feature in a banking application. In this, the customer has to select a recipient from the recipient list and the selected recipient should be highlighted is the requirement. Let's say there are 3 nested divs which contains each recipient information. The problem I'm facing is when I select...
2020/04/04
[ "https://Stackoverflow.com/questions/61024412", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5188100/" ]
If you always want to get a year, you could use a RegEx, with [`match()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match), something like: ``` '\"yearBirthday\":1979'.match(/yearBirthday\":(\d{4})/)[1] ``` ```js console.log('\"yearBirthday\":1979'.match(/yearBirthday\":...
You can use match and capture group ```js let str = `"{\"VariantQuery{\\\"zpid\\\":28261252}\":{\"property\":{\"zpid\":28261252,\"streetAddress\":\"3415 Willow Ridge Dr\",\"zipcode\":\"77339\",\"city\":\"Humble\",\"state\":\"TX\",\"latitude\":30.058258,\"longitude\":-95.199617,\"price\":318000,\"dateSold\":15605433530...
178,926
I came across this notation while at [this MathOverflow thread](https://mathoverflow.net/questions/21003/polynomial-bijection-from-qxq-to-q) and I could not find its meaning. It makes the biggest sense that $f(x,y) \in \Bbb Q[x,y] $ represents any continuous function on the interval $[x,y] \in \Bbb Q$ and thus $\Bbb Q[...
2012/08/04
[ "https://math.stackexchange.com/questions/178926", "https://math.stackexchange.com", "https://math.stackexchange.com/users/31852/" ]
It means a polynomial in two variables with coefficients in the rational numbers $\mathbb Q.$
Or, it means the rationals adjoined with the elements *x,y* as a *ring*. So in @Will Jagy 's answer, *x,y* are indeterminants and therefore transcendentals. But *x,y* could also be other numbers that are not transcendental (i.e. algebraic), but you would need explicit values. For example, $x=\sqrt2$ and $y=\sqrt3$ woul...
11,135,105
I want to test "Add new item" activity in my application. When user fills data incorrectly and then press OK button - the toast (issues list) is displayed. My question is: How can I check that toast is not shown? Thanks!
2012/06/21
[ "https://Stackoverflow.com/questions/11135105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001120/" ]
I know its an old post but just in case anyone comes across this question, this is the a better way: solo.waitForText(text); // put here the toast text
Simply assign a `flag` variable where you handle the `onClick` event of your `OK` Button which issues the `Toast`. Set that `flag` to `true`,and then later check, if the `flag` is `false`, the `Toast` was never shown.
11,135,105
I want to test "Add new item" activity in my application. When user fills data incorrectly and then press OK button - the toast (issues list) is displayed. My question is: How can I check that toast is not shown? Thanks!
2012/06/21
[ "https://Stackoverflow.com/questions/11135105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001120/" ]
Simply assign a `flag` variable where you handle the `onClick` event of your `OK` Button which issues the `Toast`. Set that `flag` to `true`,and then later check, if the `flag` is `false`, the `Toast` was never shown.
this one is works for me ``` TextView toast = (TextView) solo.getView(android.R.id.message); assertEquals("toast is not showing", toast.getText().toString(), solo.getString(R.string.error_invalid_phone)); ```
11,135,105
I want to test "Add new item" activity in my application. When user fills data incorrectly and then press OK button - the toast (issues list) is displayed. My question is: How can I check that toast is not shown? Thanks!
2012/06/21
[ "https://Stackoverflow.com/questions/11135105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001120/" ]
I know its an old post but just in case anyone comes across this question, this is the a better way: solo.waitForText(text); // put here the toast text
this one is works for me ``` TextView toast = (TextView) solo.getView(android.R.id.message); assertEquals("toast is not showing", toast.getText().toString(), solo.getString(R.string.error_invalid_phone)); ```
11,135,105
I want to test "Add new item" activity in my application. When user fills data incorrectly and then press OK button - the toast (issues list) is displayed. My question is: How can I check that toast is not shown? Thanks!
2012/06/21
[ "https://Stackoverflow.com/questions/11135105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001120/" ]
I know its an old post but just in case anyone comes across this question, this is the a better way: solo.waitForText(text); // put here the toast text
``` //wait up to a second for the toast Date date = new Date(); TextView toast; long elapsed; do{ elapsed = new Date().getTime() - date.getTime(); toast = (TextView)solo.getView(android.R.id.message); }while(elapsed<1000&&toast!=null); assertEquals(toast.getText().toString()...
11,135,105
I want to test "Add new item" activity in my application. When user fills data incorrectly and then press OK button - the toast (issues list) is displayed. My question is: How can I check that toast is not shown? Thanks!
2012/06/21
[ "https://Stackoverflow.com/questions/11135105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1001120/" ]
``` //wait up to a second for the toast Date date = new Date(); TextView toast; long elapsed; do{ elapsed = new Date().getTime() - date.getTime(); toast = (TextView)solo.getView(android.R.id.message); }while(elapsed<1000&&toast!=null); assertEquals(toast.getText().toString()...
this one is works for me ``` TextView toast = (TextView) solo.getView(android.R.id.message); assertEquals("toast is not showing", toast.getText().toString(), solo.getString(R.string.error_invalid_phone)); ```
2,291
Satan was once an angel, but was expelled from heaven because of his pride. What type of angel is he now? A seraph, a cherub, or something else?
2017/01/15
[ "https://mythology.stackexchange.com/questions/2291", "https://mythology.stackexchange.com", "https://mythology.stackexchange.com/users/3230/" ]
This answer will be based on the Catholic traditions in regards to Satan and the nine choirs of angels. Although it is now generally accept that there are [nine choirs of angel](https://en.wikipedia.org/wiki/Christian_angelology) and each choir is of angel is different and ranked accordingly. > > During the Middle A...
If we were to leave to expand or literature beyond Christianity for the sake of understanding angels we could look at the Qur 'an. Here we have beings called the Djinn, they were another cast of beings who had powers beyond that of man but also had free will like man. If Lucifer was indeed an angel he would not be able...
2,291
Satan was once an angel, but was expelled from heaven because of his pride. What type of angel is he now? A seraph, a cherub, or something else?
2017/01/15
[ "https://mythology.stackexchange.com/questions/2291", "https://mythology.stackexchange.com", "https://mythology.stackexchange.com/users/3230/" ]
This answer will be based on the Catholic traditions in regards to Satan and the nine choirs of angels. Although it is now generally accept that there are [nine choirs of angel](https://en.wikipedia.org/wiki/Christian_angelology) and each choir is of angel is different and ranked accordingly. > > During the Middle A...
Satan is described as being serpent looking - therefore he must be a seraph. At least part seraph.
2,291
Satan was once an angel, but was expelled from heaven because of his pride. What type of angel is he now? A seraph, a cherub, or something else?
2017/01/15
[ "https://mythology.stackexchange.com/questions/2291", "https://mythology.stackexchange.com", "https://mythology.stackexchange.com/users/3230/" ]
This answer will be based on the Catholic traditions in regards to Satan and the nine choirs of angels. Although it is now generally accept that there are [nine choirs of angel](https://en.wikipedia.org/wiki/Christian_angelology) and each choir is of angel is different and ranked accordingly. > > During the Middle A...
The Bible say:- [] Added > > NWT Ezekiel 28:16, 17 "So I [God] will cast you [Satan] out as profane from the mountain of God and destroy you, ***O covering cherub***, away from the stones of fire. 17 Your heart became haughty because of your beauty. You corrupted your wisdom because of your own glorious splendor.. . ...
2,291
Satan was once an angel, but was expelled from heaven because of his pride. What type of angel is he now? A seraph, a cherub, or something else?
2017/01/15
[ "https://mythology.stackexchange.com/questions/2291", "https://mythology.stackexchange.com", "https://mythology.stackexchange.com/users/3230/" ]
This answer will be based on the Catholic traditions in regards to Satan and the nine choirs of angels. Although it is now generally accept that there are [nine choirs of angel](https://en.wikipedia.org/wiki/Christian_angelology) and each choir is of angel is different and ranked accordingly. > > During the Middle A...
It´s pretty clear according to Ezekiel 28 that he is called a cherub. YET, very interestingly, when the Lord instructed Moses in Numbers to make the serpent and mount it on a pole, the actual word used in Hebrew is “seraph”, which is the singular form of the plural “seraphim”. The Hebrew word “seraphim” is used in Isa...
2,291
Satan was once an angel, but was expelled from heaven because of his pride. What type of angel is he now? A seraph, a cherub, or something else?
2017/01/15
[ "https://mythology.stackexchange.com/questions/2291", "https://mythology.stackexchange.com", "https://mythology.stackexchange.com/users/3230/" ]
If we were to leave to expand or literature beyond Christianity for the sake of understanding angels we could look at the Qur 'an. Here we have beings called the Djinn, they were another cast of beings who had powers beyond that of man but also had free will like man. If Lucifer was indeed an angel he would not be able...
Satan is described as being serpent looking - therefore he must be a seraph. At least part seraph.
2,291
Satan was once an angel, but was expelled from heaven because of his pride. What type of angel is he now? A seraph, a cherub, or something else?
2017/01/15
[ "https://mythology.stackexchange.com/questions/2291", "https://mythology.stackexchange.com", "https://mythology.stackexchange.com/users/3230/" ]
If we were to leave to expand or literature beyond Christianity for the sake of understanding angels we could look at the Qur 'an. Here we have beings called the Djinn, they were another cast of beings who had powers beyond that of man but also had free will like man. If Lucifer was indeed an angel he would not be able...
The Bible say:- [] Added > > NWT Ezekiel 28:16, 17 "So I [God] will cast you [Satan] out as profane from the mountain of God and destroy you, ***O covering cherub***, away from the stones of fire. 17 Your heart became haughty because of your beauty. You corrupted your wisdom because of your own glorious splendor.. . ...
2,291
Satan was once an angel, but was expelled from heaven because of his pride. What type of angel is he now? A seraph, a cherub, or something else?
2017/01/15
[ "https://mythology.stackexchange.com/questions/2291", "https://mythology.stackexchange.com", "https://mythology.stackexchange.com/users/3230/" ]
If we were to leave to expand or literature beyond Christianity for the sake of understanding angels we could look at the Qur 'an. Here we have beings called the Djinn, they were another cast of beings who had powers beyond that of man but also had free will like man. If Lucifer was indeed an angel he would not be able...
It´s pretty clear according to Ezekiel 28 that he is called a cherub. YET, very interestingly, when the Lord instructed Moses in Numbers to make the serpent and mount it on a pole, the actual word used in Hebrew is “seraph”, which is the singular form of the plural “seraphim”. The Hebrew word “seraphim” is used in Isa...
2,291
Satan was once an angel, but was expelled from heaven because of his pride. What type of angel is he now? A seraph, a cherub, or something else?
2017/01/15
[ "https://mythology.stackexchange.com/questions/2291", "https://mythology.stackexchange.com", "https://mythology.stackexchange.com/users/3230/" ]
The Bible say:- [] Added > > NWT Ezekiel 28:16, 17 "So I [God] will cast you [Satan] out as profane from the mountain of God and destroy you, ***O covering cherub***, away from the stones of fire. 17 Your heart became haughty because of your beauty. You corrupted your wisdom because of your own glorious splendor.. . ...
Satan is described as being serpent looking - therefore he must be a seraph. At least part seraph.
2,291
Satan was once an angel, but was expelled from heaven because of his pride. What type of angel is he now? A seraph, a cherub, or something else?
2017/01/15
[ "https://mythology.stackexchange.com/questions/2291", "https://mythology.stackexchange.com", "https://mythology.stackexchange.com/users/3230/" ]
The Bible say:- [] Added > > NWT Ezekiel 28:16, 17 "So I [God] will cast you [Satan] out as profane from the mountain of God and destroy you, ***O covering cherub***, away from the stones of fire. 17 Your heart became haughty because of your beauty. You corrupted your wisdom because of your own glorious splendor.. . ...
It´s pretty clear according to Ezekiel 28 that he is called a cherub. YET, very interestingly, when the Lord instructed Moses in Numbers to make the serpent and mount it on a pole, the actual word used in Hebrew is “seraph”, which is the singular form of the plural “seraphim”. The Hebrew word “seraphim” is used in Isa...
2,219,338
Is there a standard site structure format? The use of this would be for export and import into a CMS or framework to define the urls, content, metadata for a website. Something tool agnostic would be the goal. JSON, YAML, XML, whatever. Maybe something like: ``` { 'baseurl': 'http://example.com', 'site': [ {'...
2010/02/08
[ "https://Stackoverflow.com/questions/2219338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63094/" ]
There is a *proposed* industry standard for a data exchange/interop format for WCMS (trying to find the link), however IMO it will not take off. Regardless, it is guaranteed that whatever data you're thinking about porting right now will be beyond stale by the time a format might arise, so you're best off just making o...
I have come across a tool called [zen](http://www.tomelam.com/) which does something similar to what you're describing. As for an already existing standard, no. CMSes are different beasts than layout/content specification languages which is what XHTML/CSS are. As for uploading content into a CMS, most of them have ...
2,219,338
Is there a standard site structure format? The use of this would be for export and import into a CMS or framework to define the urls, content, metadata for a website. Something tool agnostic would be the goal. JSON, YAML, XML, whatever. Maybe something like: ``` { 'baseurl': 'http://example.com', 'site': [ {'...
2010/02/08
[ "https://Stackoverflow.com/questions/2219338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63094/" ]
Don't know if it really answers your question but there is a standard called CMIS that basically is a specification for syncing and exchanging content between CMSs. Alfresco, KnowledgeTree and a bunch of other commercial CMSs support it. Drupal supports it too through a contrib module. See <http://en.wikipedia.org/wiki...
There is a *proposed* industry standard for a data exchange/interop format for WCMS (trying to find the link), however IMO it will not take off. Regardless, it is guaranteed that whatever data you're thinking about porting right now will be beyond stale by the time a format might arise, so you're best off just making o...
2,219,338
Is there a standard site structure format? The use of this would be for export and import into a CMS or framework to define the urls, content, metadata for a website. Something tool agnostic would be the goal. JSON, YAML, XML, whatever. Maybe something like: ``` { 'baseurl': 'http://example.com', 'site': [ {'...
2010/02/08
[ "https://Stackoverflow.com/questions/2219338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63094/" ]
There is a *proposed* industry standard for a data exchange/interop format for WCMS (trying to find the link), however IMO it will not take off. Regardless, it is guaranteed that whatever data you're thinking about porting right now will be beyond stale by the time a format might arise, so you're best off just making o...
Pretty much any CMS has a database interface so I would suppose an SQL dump would be pretty close to a generic format. You could then write some tools to map table/column names and datatypes between various CMS systems. If you used postgres you could even create views to mimic the structure of various CMS systems witho...
2,219,338
Is there a standard site structure format? The use of this would be for export and import into a CMS or framework to define the urls, content, metadata for a website. Something tool agnostic would be the goal. JSON, YAML, XML, whatever. Maybe something like: ``` { 'baseurl': 'http://example.com', 'site': [ {'...
2010/02/08
[ "https://Stackoverflow.com/questions/2219338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63094/" ]
Don't know if it really answers your question but there is a standard called CMIS that basically is a specification for syncing and exchanging content between CMSs. Alfresco, KnowledgeTree and a bunch of other commercial CMSs support it. Drupal supports it too through a contrib module. See <http://en.wikipedia.org/wiki...
I have come across a tool called [zen](http://www.tomelam.com/) which does something similar to what you're describing. As for an already existing standard, no. CMSes are different beasts than layout/content specification languages which is what XHTML/CSS are. As for uploading content into a CMS, most of them have ...
2,219,338
Is there a standard site structure format? The use of this would be for export and import into a CMS or framework to define the urls, content, metadata for a website. Something tool agnostic would be the goal. JSON, YAML, XML, whatever. Maybe something like: ``` { 'baseurl': 'http://example.com', 'site': [ {'...
2010/02/08
[ "https://Stackoverflow.com/questions/2219338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63094/" ]
I have come across a tool called [zen](http://www.tomelam.com/) which does something similar to what you're describing. As for an already existing standard, no. CMSes are different beasts than layout/content specification languages which is what XHTML/CSS are. As for uploading content into a CMS, most of them have ...
Pretty much any CMS has a database interface so I would suppose an SQL dump would be pretty close to a generic format. You could then write some tools to map table/column names and datatypes between various CMS systems. If you used postgres you could even create views to mimic the structure of various CMS systems witho...
2,219,338
Is there a standard site structure format? The use of this would be for export and import into a CMS or framework to define the urls, content, metadata for a website. Something tool agnostic would be the goal. JSON, YAML, XML, whatever. Maybe something like: ``` { 'baseurl': 'http://example.com', 'site': [ {'...
2010/02/08
[ "https://Stackoverflow.com/questions/2219338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63094/" ]
Don't know if it really answers your question but there is a standard called CMIS that basically is a specification for syncing and exchanging content between CMSs. Alfresco, KnowledgeTree and a bunch of other commercial CMSs support it. Drupal supports it too through a contrib module. See <http://en.wikipedia.org/wiki...
Pretty much any CMS has a database interface so I would suppose an SQL dump would be pretty close to a generic format. You could then write some tools to map table/column names and datatypes between various CMS systems. If you used postgres you could even create views to mimic the structure of various CMS systems witho...
67,294,776
I am calling activity B from activity A using the `ActivityResultLauncher` and setting the result from activity B when the task is done. This works perfectly if orientation is not changed. The problem is when I change orientation from activity B and then setting the result, then `registerForActivityResult` of activity ...
2021/04/28
[ "https://Stackoverflow.com/questions/67294776", "https://Stackoverflow.com", "https://Stackoverflow.com/users/504162/" ]
You can save the value in `onSaveInstanceState()` and use setResult in `onRestoreInstanceState()`.
Everytime orientation changes it calls `onCreate` and it resets your views & Other variables like `launcher` are re-assigned. So you can follow the example shown in official document here: <https://developer.android.com/training/basics/intents/result#launch> And pull your `launcher` assignment out of `onCreate` as fol...
67,294,776
I am calling activity B from activity A using the `ActivityResultLauncher` and setting the result from activity B when the task is done. This works perfectly if orientation is not changed. The problem is when I change orientation from activity B and then setting the result, then `registerForActivityResult` of activity ...
2021/04/28
[ "https://Stackoverflow.com/questions/67294776", "https://Stackoverflow.com", "https://Stackoverflow.com/users/504162/" ]
Try moving the `registerForActivityResult` assignment of `launcher` to `onCreateView()` (override it if you haven't already). Putting it here, I'm not getting the "is attempting to register while current state is STARTED" `RuntimeException` in `OnCreateView()` as it would with `onResume()` or later. The advantage of `O...
Everytime orientation changes it calls `onCreate` and it resets your views & Other variables like `launcher` are re-assigned. So you can follow the example shown in official document here: <https://developer.android.com/training/basics/intents/result#launch> And pull your `launcher` assignment out of `onCreate` as fol...
2,030,774
I'm not entirely sure what's happening here. I have my code that exists like: ``` var mycode = { init:function(){ //my code here } } //sizzle pasted here... (function(){ //sizzle code here })(); ``` Where "sizzle code here" is the copy/paste of Sizzle in its entirety. Sizzle is contained in an anony...
2010/01/08
[ "https://Stackoverflow.com/questions/2030774", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68788/" ]
the code should be ``` var mycode = { init:function(){ //my code here } }; //sizzle pasted here... (function(){ /*sizzle code here*/ })(); ``` the missing semicolon after your 'mycode' object results as, ``` var mycode = { init:function() {}}(function(){/*sizzle code here*/...
Missing the closing paren for your function wrapper, should be: ``` (function(){ //sizzle code here })(); ```
49,943,927
I have created a table that contains a list of keywords and a code that identifies synonyms. I.e. All keywords with the same code are to be considered the same keyword. `varchar varchar tsvector C1000 AI 'ai':1 C1000 Artificial intelligence 'artifici':1 'intellig':2 C1001 Algorithms 'algorithm':1 C1002 Software Design ...
2018/04/20
[ "https://Stackoverflow.com/questions/49943927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5334389/" ]
It seems that you need a mix of `opt` and `if` keywords. Consider a simplified example: ``` count: 0 div: ['div some integer! /div] probe parse [ div 1 2 3 /div div 4 5 6 /div div 7 8 9 /div ][ some [ div (count: count + 1) opt [if (count = 1) mark:] ] ] probe mark ``` Here, after eac...
Here a solution working in Red and Rebol using your approach plus adding some selfmodification to the rules ``` rules: [ thru <div class="main"> (div-count: 1 clear rules/5/8 ) some [ "<div" (probe div-count: div-count + 1) skip | "</div>" mark: ( probe div-count: div...
20,061,396
I am trying to write a simple paint program and I have fully functioning save and draw features, though in the open button's method, the msg.create\_image function isnt showing the image. THere is no error, just the GUI and a blank large canvas. Here is my code in python 2.7.5 with PIL 1.1.7 written on a windows 7 64 b...
2013/11/19
[ "https://Stackoverflow.com/questions/20061396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2658538/" ]
Your div and /div tags appear to be mis-matched, Razor views care about that sort of thing, make sure you open and close them inside the same code block (defined by curly braces)
You have a "dangling-div". Here: ``` } <br /> </div> ``` That `</div>` should be inside the `foreach` brace.
18,048,095
I'm using monotouch for developing ios applications.Suppose that I have 3 screens: s1, s2 and s3. User can open them like this: s1 -> s2 -> s3 . I want that if user open s2 it can back by navigation back button to the s1 screen, but if it goes to the s3 screen by pressing back button in the navigation bar the applicat...
2013/08/04
[ "https://Stackoverflow.com/questions/18048095", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1939409/" ]
You can manually edit the view controllers in your navigationController to remove s2. You can use `self.navigationController.viewControllers` to get the current stack, and `[self.navigationController setViewControllers:animated:]` to set the stack. In your case, you might want to do: ``` NSMutableArray *views = [[NS...
U can try this On Back Button Press: ``` for (UIViewController * viewController in self.navigationController.viewControllers) { if ([viewController isKindOfClass: NSClassFromString(@"<ClassName for S3>")]) { [self.navigationController popToViewController: [self.navigationController.viewControllers o...
6,177,690
If you use mocks to test object interactions, you'll have to pass collaborators via constructors or specific methods. In a sufficiently complex application you'll have a lot of small objects interacting with each other. How do you manage the construction of the whole object graph at the topmost level of an app? In shor...
2011/05/30
[ "https://Stackoverflow.com/questions/6177690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/56463/" ]
The example given is simply **Poor Man's DI**. As long as you constrain yourself to [composing the entire object graph](http://blog.ploeh.dk/2011/03/04/ComposeObjectGraphsWithConfidence.aspx) in the application's Composition Root (entry point) you'd be doing fine. (As an aside, I recently heard Dan North refer to this ...
As far as I know, the only way to keep all these dependencies under control is to either create a general Context object that you can pass around (but even that has its complexities), or to use IoC with constructor injection. Especially in the example you give, CI is a good solution because you can manage the complexi...
33,188,162
This is my code so far. I am a beginner and I cant understand why this doesn't work properly. My task is to take a number of minutes (2000 to 40000), and to output how many days, hours, minutes it consititutes (e.g 25000 minutes are - 17 days 8 hours 40 minutes). Additionally, it should show the date it will be if I...
2015/10/17
[ "https://Stackoverflow.com/questions/33188162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5457301/" ]
Like said by Chris K : ``` final static int ONE_DAY_IN_MINUTES = 1440; ``` But you have made two other mistakes : ``` numberOfHours = (input % ONE_DAY_IN_MINUTES) / 3600; ``` Why would you divide by 3600? Let's take an example : We have an input of `1500` (it represents `1 day : 1 hour : 0 minutes`) ``` = (150...
Your constants 60, 3600 and 86400 are the number of **seconds** in a minute, hour and day, hence your program computes the equivalent in days, hours and minutes of 25000 **seconds**. You can use 1, 60 and 24\*60 instead and it'll compute the equivalent of 25000 minutes.
33,188,162
This is my code so far. I am a beginner and I cant understand why this doesn't work properly. My task is to take a number of minutes (2000 to 40000), and to output how many days, hours, minutes it consititutes (e.g 25000 minutes are - 17 days 8 hours 40 minutes). Additionally, it should show the date it will be if I...
2015/10/17
[ "https://Stackoverflow.com/questions/33188162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5457301/" ]
Like said by Chris K : ``` final static int ONE_DAY_IN_MINUTES = 1440; ``` But you have made two other mistakes : ``` numberOfHours = (input % ONE_DAY_IN_MINUTES) / 3600; ``` Why would you divide by 3600? Let's take an example : We have an input of `1500` (it represents `1 day : 1 hour : 0 minutes`) ``` = (150...
Editing from your codes.. ``` public static void main(String[] args) { int input = 25000; //25000 mins int numberOfDays = input / (60 * 24); int numberOfHours = input % (60 * 24); int numberOfMinutes = input % 60 System.out.println("Number of days :" + numberOfDays); System.out.println("Numbe...
33,188,162
This is my code so far. I am a beginner and I cant understand why this doesn't work properly. My task is to take a number of minutes (2000 to 40000), and to output how many days, hours, minutes it consititutes (e.g 25000 minutes are - 17 days 8 hours 40 minutes). Additionally, it should show the date it will be if I...
2015/10/17
[ "https://Stackoverflow.com/questions/33188162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5457301/" ]
Editing from your codes.. ``` public static void main(String[] args) { int input = 25000; //25000 mins int numberOfDays = input / (60 * 24); int numberOfHours = input % (60 * 24); int numberOfMinutes = input % 60 System.out.println("Number of days :" + numberOfDays); System.out.println("Numbe...
Your constants 60, 3600 and 86400 are the number of **seconds** in a minute, hour and day, hence your program computes the equivalent in days, hours and minutes of 25000 **seconds**. You can use 1, 60 and 24\*60 instead and it'll compute the equivalent of 25000 minutes.
56,866,328
I need to access the private folder of my app for debugging purposes. I use `myActivity.getFilesDir()` to handle the private folder but I cannot see it in the filesystem when using the file manager. Before, I used `Environment.getExternalStorageDirectory()` and I could see the `com.myDomain.app` folder in the `Androi...
2019/07/03
[ "https://Stackoverflow.com/questions/56866328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/930835/" ]
```vb With item1.Recipients For i = 1 To .Count If .Item(i).Type = OlMailRecipientType.olCC Then vCcEmailAddress = .Item(i).Address Exit For End If Next i End With ```
``` Set objFolder = olns.GetDefaultFolder(6) For each item1 in objFolder.Items For Each RecipientObject In item1.Recipients If RecipientObject.Type = 2 Then msgbox RecipientObject.Address End if Next Next ```
21,482,969
I am having milliseconds value and want to display the time subtracting 5 minutes from current milliseconds value in `hh:mm:ss` format. **Code** ``` String str = String.format("%02d:%02d:%02d", TimeUnit.MILLISECONDS.toHours((cal.getTimeInMillis()-300000)), ...
2014/01/31
[ "https://Stackoverflow.com/questions/21482969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2319542/" ]
Check this solution. It's more elegant ``` SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss", Locale.getDefault()); String str = sdf.format(new Date(System.currentTimeMillis())); Toast.makeText(getApplicationContext(), "Alarm Set."+str, Toast.LENGTH_LONG).show() ```
Using the [Joda-Time](http://www.joda.org/joda-time/) library makes this work much easier. ```java // Note that milliseconds-since-epoch needs to be a "long" rather than an "int". long millis = new DateTime().getMillis(); // Specify a time zone rather than rely on default. DateTimeZone timeZone = DateTimeZone.forID(...
21,482,969
I am having milliseconds value and want to display the time subtracting 5 minutes from current milliseconds value in `hh:mm:ss` format. **Code** ``` String str = String.format("%02d:%02d:%02d", TimeUnit.MILLISECONDS.toHours((cal.getTimeInMillis()-300000)), ...
2014/01/31
[ "https://Stackoverflow.com/questions/21482969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2319542/" ]
It is working fine as is, the only reason you see such a huge offset is because it is calculating the total number of hours since the UNIX epoch. When you do a `Calendar.getInstance()` it gets you the current point in time. Converting it to milliseconds are the total millis since the UNIX epoch. You can check the tot...
Using the [Joda-Time](http://www.joda.org/joda-time/) library makes this work much easier. ```java // Note that milliseconds-since-epoch needs to be a "long" rather than an "int". long millis = new DateTime().getMillis(); // Specify a time zone rather than rely on default. DateTimeZone timeZone = DateTimeZone.forID(...
813,007
Is there a tutorial around that I'm missing on how to set up Bind 9.10 on Ubuntu 16.04 for integration with Samba4 ADDC? The official Samba Wiki only covers Bind 9.8 and Bind 9.9 setup. I'm at a dead-end.
2016/08/16
[ "https://askubuntu.com/questions/813007", "https://askubuntu.com", "https://askubuntu.com/users/580507/" ]
Although this article (<http://blogging.dragon.org.uk/samba4-ad-dc-on-ubuntu-14-04/>) is titled referencing U14.04, I have successfully used it with U16.04.1LTS. Surprisingly, this article is quite close to being correct, there are just a few pieces of the puzzle missing. First, ext4, there is no need to manually adju...
Is there a difference in syntax between versions? Is there major config file changes? I would suspect not between minor upgrades like 9.9 to 9.10 according to the [bind website](https://www.isc.org/bind-9-10-new-features/) it would appear not. They seem to have only added more tools and improved performance! So you s...
6,888,824
I am sending a post containing text, numbers and data. The numbers and data work fine, but I'm having problems with the text, since it may contain an ampersand (&). For example ``` page.php?text=Hello World & Space. ``` Now I found that the "&" is received by server, but read as if a new variable starts. So it sees ...
2011/07/31
[ "https://Stackoverflow.com/questions/6888824", "https://Stackoverflow.com", "https://Stackoverflow.com/users/858672/" ]
Unfortunately `stringByAddingPercentEscapesUsingEncoding` is not URL-encoding as most people understand it. It escapes characters that are completely invalid to have in a URL, but not characters that have a special meaning in a URL. So it's usable for ‘correcting’ an invalid user-inputted URL, but it's quite unsuitable...
Thanks for that answer and sorry for my premature posting :S I hope it at least helps anybody who has the same issue as I had. I just had a chat with a friend and he told me: > > To display and ampersand in XML simply use the &amp; quote. Unlike with a pure "&", the NSXMLParser won't output an error. Using &amp; also...
8,843,322
I have this simple ajax code, for some reason it wont load content onto textarea. I need it to load the content so that it can be edited in the textarea. Here's the code, I'm not sure what I'm doing wrong. But it displays in a div like so ``` <div id="content"></div> ``` Here's the full code ``` <html> <head> <ti...
2012/01/12
[ "https://Stackoverflow.com/questions/8843322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/136731/" ]
From your code this looks to do exactly what you want: ``` if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("content").innerHTML=xmlhttp.responseText; } ``` Since your `div` has the id of "content" the response is being put there. Try something like: ``` document.getElementById("area1")...
This worked for me: ``` document.getElementById("area1").value=xmlhttp.responseText; ```
15,678,840
I put my apps in google play store,due to some reasons,its showing some error.Now i did those correction and i want to update the new apk,without reducing my older download numbers and their ratings and comments.Is this possible to update apk without reducing the older downloads ``` <?xml version="1.0" encoding="u...
2013/03/28
[ "https://Stackoverflow.com/questions/15678840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2031842/" ]
There are four potential problems. 1) You're missing a closing brace for the `messages` section. ``` $("#phone").rules("add", { required: true, phoneUS: true, messages: { required: "Enter company phone number", phoneUS: "Enter valid phone number" } //<-- this was missing }); ``` **D...
Above code won't work because it is missing `}` after property list.
15,678,840
I put my apps in google play store,due to some reasons,its showing some error.Now i did those correction and i want to update the new apk,without reducing my older download numbers and their ratings and comments.Is this possible to update apk without reducing the older downloads ``` <?xml version="1.0" encoding="u...
2013/03/28
[ "https://Stackoverflow.com/questions/15678840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2031842/" ]
As a related bug, if you add a custom rule, using: ``` $.validator.addMethod('field-is-valid', function (val, element) { ...}) ``` but then reference it in your rules declaration with the wrong name: ``` $(element).rules('add', { "field-valid": true }) ``` you'll get the same `Cannot call method call of undef...
Above code won't work because it is missing `}` after property list.
15,678,840
I put my apps in google play store,due to some reasons,its showing some error.Now i did those correction and i want to update the new apk,without reducing my older download numbers and their ratings and comments.Is this possible to update apk without reducing the older downloads ``` <?xml version="1.0" encoding="u...
2013/03/28
[ "https://Stackoverflow.com/questions/15678840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2031842/" ]
I came across similar problem twice recently and spent a lot of time trying to figure it out, so I am going to leave here a simple solution. And if moderator thinks that this is not the right place, just let me know. The error happens while running this sample code: ``` $(document).ready(function () { $.validato...
You also need to add this additional methods <http://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/additional-methods.js>
15,678,840
I put my apps in google play store,due to some reasons,its showing some error.Now i did those correction and i want to update the new apk,without reducing my older download numbers and their ratings and comments.Is this possible to update apk without reducing the older downloads ``` <?xml version="1.0" encoding="u...
2013/03/28
[ "https://Stackoverflow.com/questions/15678840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2031842/" ]
Above code won't work because it is missing `}` after property list.
You also need to add this additional methods <http://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/additional-methods.js>
15,678,840
I put my apps in google play store,due to some reasons,its showing some error.Now i did those correction and i want to update the new apk,without reducing my older download numbers and their ratings and comments.Is this possible to update apk without reducing the older downloads ``` <?xml version="1.0" encoding="u...
2013/03/28
[ "https://Stackoverflow.com/questions/15678840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2031842/" ]
There are four potential problems. 1) You're missing a closing brace for the `messages` section. ``` $("#phone").rules("add", { required: true, phoneUS: true, messages: { required: "Enter company phone number", phoneUS: "Enter valid phone number" } //<-- this was missing }); ``` **D...
I had the same problem, but with a different cause. The same problem happens when I put a rule "require:true" instead of "required:true". This error happens when you specify in your rules a validation that has no corresponding method. Through debugging I found that the exception is showing I specified a rule "require"...
15,678,840
I put my apps in google play store,due to some reasons,its showing some error.Now i did those correction and i want to update the new apk,without reducing my older download numbers and their ratings and comments.Is this possible to update apk without reducing the older downloads ``` <?xml version="1.0" encoding="u...
2013/03/28
[ "https://Stackoverflow.com/questions/15678840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2031842/" ]
There are four potential problems. 1) You're missing a closing brace for the `messages` section. ``` $("#phone").rules("add", { required: true, phoneUS: true, messages: { required: "Enter company phone number", phoneUS: "Enter valid phone number" } //<-- this was missing }); ``` **D...
You also need to add this additional methods <http://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/additional-methods.js>
15,678,840
I put my apps in google play store,due to some reasons,its showing some error.Now i did those correction and i want to update the new apk,without reducing my older download numbers and their ratings and comments.Is this possible to update apk without reducing the older downloads ``` <?xml version="1.0" encoding="u...
2013/03/28
[ "https://Stackoverflow.com/questions/15678840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2031842/" ]
I had the same problem, but with a different cause. The same problem happens when I put a rule "require:true" instead of "required:true". This error happens when you specify in your rules a validation that has no corresponding method. Through debugging I found that the exception is showing I specified a rule "require"...
Above code won't work because it is missing `}` after property list.
15,678,840
I put my apps in google play store,due to some reasons,its showing some error.Now i did those correction and i want to update the new apk,without reducing my older download numbers and their ratings and comments.Is this possible to update apk without reducing the older downloads ``` <?xml version="1.0" encoding="u...
2013/03/28
[ "https://Stackoverflow.com/questions/15678840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2031842/" ]
I came across similar problem twice recently and spent a lot of time trying to figure it out, so I am going to leave here a simple solution. And if moderator thinks that this is not the right place, just let me know. The error happens while running this sample code: ``` $(document).ready(function () { $.validato...
Above code won't work because it is missing `}` after property list.
15,678,840
I put my apps in google play store,due to some reasons,its showing some error.Now i did those correction and i want to update the new apk,without reducing my older download numbers and their ratings and comments.Is this possible to update apk without reducing the older downloads ``` <?xml version="1.0" encoding="u...
2013/03/28
[ "https://Stackoverflow.com/questions/15678840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2031842/" ]
I had the same problem, but with a different cause. The same problem happens when I put a rule "require:true" instead of "required:true". This error happens when you specify in your rules a validation that has no corresponding method. Through debugging I found that the exception is showing I specified a rule "require"...
I came across similar problem twice recently and spent a lot of time trying to figure it out, so I am going to leave here a simple solution. And if moderator thinks that this is not the right place, just let me know. The error happens while running this sample code: ``` $(document).ready(function () { $.validato...
15,678,840
I put my apps in google play store,due to some reasons,its showing some error.Now i did those correction and i want to update the new apk,without reducing my older download numbers and their ratings and comments.Is this possible to update apk without reducing the older downloads ``` <?xml version="1.0" encoding="u...
2013/03/28
[ "https://Stackoverflow.com/questions/15678840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2031842/" ]
As a related bug, if you add a custom rule, using: ``` $.validator.addMethod('field-is-valid', function (val, element) { ...}) ``` but then reference it in your rules declaration with the wrong name: ``` $(element).rules('add', { "field-valid": true }) ``` you'll get the same `Cannot call method call of undef...
I came across similar problem twice recently and spent a lot of time trying to figure it out, so I am going to leave here a simple solution. And if moderator thinks that this is not the right place, just let me know. The error happens while running this sample code: ``` $(document).ready(function () { $.validato...
8,903
Two very common connectors used in the eighties were the Centronics parallel port (particularly used for printers) and the RS-232 serial port (particularly used for mice and modems). Suppose you have a computer with one kind of port and a peripheral with another (particularly, a computer that talks RS-232 and a printe...
2019/01/23
[ "https://retrocomputing.stackexchange.com/questions/8903", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/4274/" ]
This can be done with a UART such as the 6402. Here's an example that converts serial to parallel:- [Schematics of a Printer Adaptor](http://archive.psion2.org/org2/hardware/par_printer.htm) [![enter image description here](https://i.stack.imgur.com/7XN24.gif)](https://i.stack.imgur.com/7XN24.gif) Unlike more modern...
This is only barely Retrocomputing. Almost all the printers I use today (and most people I know) are connected USB or networked. But [ports for PCs are still available](https://www.startech.com/Cards-Adapters/Serial-Cards-Adapters/2-Port-16C550-Serial-1-Port-EPPECP-Parallel-PCI-Card%7EPCI2S1P) and as noted below, the c...
8,903
Two very common connectors used in the eighties were the Centronics parallel port (particularly used for printers) and the RS-232 serial port (particularly used for mice and modems). Suppose you have a computer with one kind of port and a peripheral with another (particularly, a computer that talks RS-232 and a printe...
2019/01/23
[ "https://retrocomputing.stackexchange.com/questions/8903", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/4274/" ]
This is only barely Retrocomputing. Almost all the printers I use today (and most people I know) are connected USB or networked. But [ports for PCs are still available](https://www.startech.com/Cards-Adapters/Serial-Cards-Adapters/2-Port-16C550-Serial-1-Port-EPPECP-Parallel-PCI-Card%7EPCI2S1P) and as noted below, the c...
The innards of above device depicted by tofro are **completely** different. No PIC inside but a 74HC164 8-bit serial-in, parallel-out shift register: [![The Miracle Systems Centronics Printer Interface (Duel Port Version)](https://i.stack.imgur.com/35NLE.jpg)](https://i.stack.imgur.com/35NLE.jpg)
8,903
Two very common connectors used in the eighties were the Centronics parallel port (particularly used for printers) and the RS-232 serial port (particularly used for mice and modems). Suppose you have a computer with one kind of port and a peripheral with another (particularly, a computer that talks RS-232 and a printe...
2019/01/23
[ "https://retrocomputing.stackexchange.com/questions/8903", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/4274/" ]
This can be done with a UART such as the 6402. Here's an example that converts serial to parallel:- [Schematics of a Printer Adaptor](http://archive.psion2.org/org2/hardware/par_printer.htm) [![enter image description here](https://i.stack.imgur.com/7XN24.gif)](https://i.stack.imgur.com/7XN24.gif) Unlike more modern...
Yes, there were such gadgets that converted serial to parallel. The attached picture shows a Miracle Serial to parallel converter for the Sinclair QL, courtesy of 1984. The QL had no ex-factory Centronics printer interface, and solutions that blocked the expansion port for connecting a printer only were not really wha...
8,903
Two very common connectors used in the eighties were the Centronics parallel port (particularly used for printers) and the RS-232 serial port (particularly used for mice and modems). Suppose you have a computer with one kind of port and a peripheral with another (particularly, a computer that talks RS-232 and a printe...
2019/01/23
[ "https://retrocomputing.stackexchange.com/questions/8903", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/4274/" ]
This can be done with a UART such as the 6402. Here's an example that converts serial to parallel:- [Schematics of a Printer Adaptor](http://archive.psion2.org/org2/hardware/par_printer.htm) [![enter image description here](https://i.stack.imgur.com/7XN24.gif)](https://i.stack.imgur.com/7XN24.gif) Unlike more modern...
The innards of above device depicted by tofro are **completely** different. No PIC inside but a 74HC164 8-bit serial-in, parallel-out shift register: [![The Miracle Systems Centronics Printer Interface (Duel Port Version)](https://i.stack.imgur.com/35NLE.jpg)](https://i.stack.imgur.com/35NLE.jpg)
8,903
Two very common connectors used in the eighties were the Centronics parallel port (particularly used for printers) and the RS-232 serial port (particularly used for mice and modems). Suppose you have a computer with one kind of port and a peripheral with another (particularly, a computer that talks RS-232 and a printe...
2019/01/23
[ "https://retrocomputing.stackexchange.com/questions/8903", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/4274/" ]
Yes, there were such gadgets that converted serial to parallel. The attached picture shows a Miracle Serial to parallel converter for the Sinclair QL, courtesy of 1984. The QL had no ex-factory Centronics printer interface, and solutions that blocked the expansion port for connecting a printer only were not really wha...
The innards of above device depicted by tofro are **completely** different. No PIC inside but a 74HC164 8-bit serial-in, parallel-out shift register: [![The Miracle Systems Centronics Printer Interface (Duel Port Version)](https://i.stack.imgur.com/35NLE.jpg)](https://i.stack.imgur.com/35NLE.jpg)
41,744,079
In this code "this" keyword is used in the div element in function calls parameter, so my question is that "this" keyword is used for object or global object like window, so why here we used "this" keyword whats the purpose of using this here, kindly Explain someone. ```js <!DOCTYPE HTML> <html> <body> <link type="...
2017/01/19
[ "https://Stackoverflow.com/questions/41744079", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7342169/" ]
Here `this` refers to the element, because it's an object. When you're in the scope of an object (inside the constructor or in a prototype), then `this` holds the instance you're currently changing Elements are objects inside javascript. They have an onclick property, which you can change to any function you like. T...
In your snippet, the purpose of `this` if follow: `this` is a `reference` to the current object(DOM element), in your case `this` refers to div `clicked`. In your example, it is applied `backgroundColor` to all event because comes in play `event bubbling` and `capturing`.To stop this use `stopPropagation` method and p...
41,744,079
In this code "this" keyword is used in the div element in function calls parameter, so my question is that "this" keyword is used for object or global object like window, so why here we used "this" keyword whats the purpose of using this here, kindly Explain someone. ```js <!DOCTYPE HTML> <html> <body> <link type="...
2017/01/19
[ "https://Stackoverflow.com/questions/41744079", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7342169/" ]
Here `this` refers to the element, because it's an object. When you're in the scope of an object (inside the constructor or in a prototype), then `this` holds the instance you're currently changing Elements are objects inside javascript. They have an onclick property, which you can change to any function you like. T...
'this' keyword in onclick is simply a reference to DOM element on which onclick is sitting. For example 'this' in the first div with class 'd1' is reference to that div - div with class 'd1'. In the second div with class 'd2', 'this' is reference to that div - div with class 'd2' and so on...
65,966,320
I am trying to read a gexf file using nx and get the above error: ``` import networkx as nx nx.read_gexf('KwNet-Journals/KwNet-Journals.gexf') ``` The gexf file can be found [here](https://data.mendeley.com/datasets/4cbf9sxj7x/7).
2021/01/30
[ "https://Stackoverflow.com/questions/65966320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7281675/" ]
**NetworkX doesn't support GEXF 1.3 that this file is in.** --- ``` In [5]: pdb Automatic pdb calling has been turned ON In [6]: nx.read_gexf(r"<...>\KwNet-Journals.gexf") <...> NetworkXError: No <graph> element in GEXF file. <...> ipdb> l 688 for version in self.versions: 689 self.set_v...
You might be able to get away by replacing the header of the GEXF file with namespace descriptions related to GEXF version 1.2. That is, remove ``` <gexf xmlns="http://www.gexf.net/1.3" version="1.3" xmlns:viz="http://www.gexf.net/1.3/viz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ht...
65,966,320
I am trying to read a gexf file using nx and get the above error: ``` import networkx as nx nx.read_gexf('KwNet-Journals/KwNet-Journals.gexf') ``` The gexf file can be found [here](https://data.mendeley.com/datasets/4cbf9sxj7x/7).
2021/01/30
[ "https://Stackoverflow.com/questions/65966320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7281675/" ]
**NetworkX doesn't support GEXF 1.3 that this file is in.** --- ``` In [5]: pdb Automatic pdb calling has been turned ON In [6]: nx.read_gexf(r"<...>\KwNet-Journals.gexf") <...> NetworkXError: No <graph> element in GEXF file. <...> ipdb> l 688 for version in self.versions: 689 self.set_v...
I do not take any pride in this answer as it circumvents XML syntax. However, as it gets the job done, I will share it anyway. ``` f = io.open("demo.gexf", mode="r", encoding="utf-8") gexf = f.read() gexf = gexf.replace('xmlns="http://www.gexf.net/1.3"', 'xmlns="http://www.gexf.net/1.2draft"')\ .replace('version="1.3"...
13,233,337
I am using a permalink structure in wordpress like `www.domain.com/sample-post/` but it blocks naturally all parameters which it doesnt know. I actually just want to add Googles `?utm_source=` variable to some links to track some sources, but Wordpress blocks them and i get a 404 error with a `/none` output in my log...
2012/11/05
[ "https://Stackoverflow.com/questions/13233337", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1753660/" ]
instead of using ? you can elect to use # to pass utm\_source values. to do this just add this line to analytics tracking code above \_trackPageview \_gaq.push(['\_setAllowAnchor', true]); Now you can tag utm\_source parameters like this <http://mysite.net/index.html#utm_source=Source&utm_medium=email&utm_campaign=N...
``` # Block the include-only files. RewriteEngine On RewriteBase / # RewriteRule ^wp-admin/includes/ - [F,L] RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L] RewriteRule ^wp-includes/theme-compat/ - [F,L] # Preventing Directory Listing, Leads to Block and 403 and 401 Options -Indexes # BEGIN WordPress Rewr...
5,032,098
I have a media application which starts playback when the intent is sent to the player activity with the following intent extras; data "path to the music" and type "mime/audio format". I pick up the intent data at the player activity execute to start playback and I remove the passed extras from the intent to avoid hav...
2011/02/17
[ "https://Stackoverflow.com/questions/5032098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/398248/" ]
My Solution: ``` Bundle mExtrass = null; getIntent().replaceExtras(mExtrass); ``` And this clear the extra data.
Unclear on this, but have you tried Intent flags FLAG\_ACTIVITY\_RESET\_TASK\_IF\_NEEDED, FLAG\_ACTIVITY\_CLEAR\_WHEN\_TASK\_RESET, or FLAG\_ACTIVITY\_NEW\_TASK?
5,032,098
I have a media application which starts playback when the intent is sent to the player activity with the following intent extras; data "path to the music" and type "mime/audio format". I pick up the intent data at the player activity execute to start playback and I remove the passed extras from the intent to avoid hav...
2011/02/17
[ "https://Stackoverflow.com/questions/5032098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/398248/" ]
My Solution: ``` Bundle mExtrass = null; getIntent().replaceExtras(mExtrass); ``` And this clear the extra data.
When retrieving the data and type strings, try passing them as extras instead of using `getDataString()` and `getType()`: ``` final String data = getIntent().getExtras().getString("music_path"); final String type = getIntent().getExtras().getString("data_type"); // start playback requestPlay( data, type ); ...
5,032,098
I have a media application which starts playback when the intent is sent to the player activity with the following intent extras; data "path to the music" and type "mime/audio format". I pick up the intent data at the player activity execute to start playback and I remove the passed extras from the intent to avoid hav...
2011/02/17
[ "https://Stackoverflow.com/questions/5032098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/398248/" ]
My Solution: ``` Bundle mExtrass = null; getIntent().replaceExtras(mExtrass); ``` And this clear the extra data.
I've experienced the same issue. In my case the problem was that I sometimes got two intents on application startup: one in onCreate and then another in onNewIntent. The intent from onCreate had some really old data attached (that should have been cleared according to the docs), while the onNewIntent had no extra data ...
5,939,272
I'm just new to C++, and doing a small project which implementing some inheritance. It can basically be summarized below: ``` //.h file class Food{ public: Food(); virtual ~Food(); }; class Animal{ public: Animal(); virtual ~Animal(); virtual void eat( Food f); }; class Meat : public Food{ public: Meat(); ~Me...
2011/05/09
[ "https://Stackoverflow.com/questions/5939272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745446/" ]
When you have a function like this: ``` void Carnivore::eat(Food f) ``` it takes its parameter *by value*. That means a copy of the provided object is made. In this case, you're specifying a type `Food`, so you end up with a `Food` object. No magic polymorphism, nothing. Just a bog-standard `Food` object. This is ...
You're passing food by value into the eating function. For polymorphism to work you need to pass either by reference or by pointer: (by pointer:) ``` void Carnivore::eat(Food* f) { Meat* m = dynamic_cast<Meat*>(f); if(m != 0) cout << "can eat\n"; else cout << "can not eat\n"; } ```
5,939,272
I'm just new to C++, and doing a small project which implementing some inheritance. It can basically be summarized below: ``` //.h file class Food{ public: Food(); virtual ~Food(); }; class Animal{ public: Animal(); virtual ~Animal(); virtual void eat( Food f); }; class Meat : public Food{ public: Meat(); ~Me...
2011/05/09
[ "https://Stackoverflow.com/questions/5939272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745446/" ]
You're passing food by value into the eating function. For polymorphism to work you need to pass either by reference or by pointer: (by pointer:) ``` void Carnivore::eat(Food* f) { Meat* m = dynamic_cast<Meat*>(f); if(m != 0) cout << "can eat\n"; else cout << "can not eat\n"; } ```
Object slicing is what causing the problem in your implementation. Your `eat()` function should take either *reference* to `Food` or *pointer* to `Food` as explained below: ``` virtual void eat(Food & f); //usage Meat meat; animal.eat(meat); ``` Or ``` virtual void eat(Food * pf); //usage Meat meat; animal.eat(&...
5,939,272
I'm just new to C++, and doing a small project which implementing some inheritance. It can basically be summarized below: ``` //.h file class Food{ public: Food(); virtual ~Food(); }; class Animal{ public: Animal(); virtual ~Animal(); virtual void eat( Food f); }; class Meat : public Food{ public: Meat(); ~Me...
2011/05/09
[ "https://Stackoverflow.com/questions/5939272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745446/" ]
You're passing food by value into the eating function. For polymorphism to work you need to pass either by reference or by pointer: (by pointer:) ``` void Carnivore::eat(Food* f) { Meat* m = dynamic_cast<Meat*>(f); if(m != 0) cout << "can eat\n"; else cout << "can not eat\n"; } ```
This is what's known as the "slicing problem". Your functions are taking a *copy* of the object you pass. The copy is being generated by the copy constructor for the base type, and any specialization you've done for the derived class is lost.
5,939,272
I'm just new to C++, and doing a small project which implementing some inheritance. It can basically be summarized below: ``` //.h file class Food{ public: Food(); virtual ~Food(); }; class Animal{ public: Animal(); virtual ~Animal(); virtual void eat( Food f); }; class Meat : public Food{ public: Meat(); ~Me...
2011/05/09
[ "https://Stackoverflow.com/questions/5939272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745446/" ]
You're passing food by value into the eating function. For polymorphism to work you need to pass either by reference or by pointer: (by pointer:) ``` void Carnivore::eat(Food* f) { Meat* m = dynamic_cast<Meat*>(f); if(m != 0) cout << "can eat\n"; else cout << "can not eat\n"; } ```
C++'s run-time polymorphism (aka virtual function calls / virtual dispatch) requires that the functions be called via a pointer or reference to a base class. Here, your eat function takes a Food argument **by value**... which copies or *slices* the part of the \*f value and creates a new `Food` object. Such objects can...
5,939,272
I'm just new to C++, and doing a small project which implementing some inheritance. It can basically be summarized below: ``` //.h file class Food{ public: Food(); virtual ~Food(); }; class Animal{ public: Animal(); virtual ~Animal(); virtual void eat( Food f); }; class Meat : public Food{ public: Meat(); ~Me...
2011/05/09
[ "https://Stackoverflow.com/questions/5939272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745446/" ]
When you have a function like this: ``` void Carnivore::eat(Food f) ``` it takes its parameter *by value*. That means a copy of the provided object is made. In this case, you're specifying a type `Food`, so you end up with a `Food` object. No magic polymorphism, nothing. Just a bog-standard `Food` object. This is ...
Object slicing is what causing the problem in your implementation. Your `eat()` function should take either *reference* to `Food` or *pointer* to `Food` as explained below: ``` virtual void eat(Food & f); //usage Meat meat; animal.eat(meat); ``` Or ``` virtual void eat(Food * pf); //usage Meat meat; animal.eat(&...
5,939,272
I'm just new to C++, and doing a small project which implementing some inheritance. It can basically be summarized below: ``` //.h file class Food{ public: Food(); virtual ~Food(); }; class Animal{ public: Animal(); virtual ~Animal(); virtual void eat( Food f); }; class Meat : public Food{ public: Meat(); ~Me...
2011/05/09
[ "https://Stackoverflow.com/questions/5939272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745446/" ]
When you have a function like this: ``` void Carnivore::eat(Food f) ``` it takes its parameter *by value*. That means a copy of the provided object is made. In this case, you're specifying a type `Food`, so you end up with a `Food` object. No magic polymorphism, nothing. Just a bog-standard `Food` object. This is ...
This is what's known as the "slicing problem". Your functions are taking a *copy* of the object you pass. The copy is being generated by the copy constructor for the base type, and any specialization you've done for the derived class is lost.
5,939,272
I'm just new to C++, and doing a small project which implementing some inheritance. It can basically be summarized below: ``` //.h file class Food{ public: Food(); virtual ~Food(); }; class Animal{ public: Animal(); virtual ~Animal(); virtual void eat( Food f); }; class Meat : public Food{ public: Meat(); ~Me...
2011/05/09
[ "https://Stackoverflow.com/questions/5939272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745446/" ]
When you have a function like this: ``` void Carnivore::eat(Food f) ``` it takes its parameter *by value*. That means a copy of the provided object is made. In this case, you're specifying a type `Food`, so you end up with a `Food` object. No magic polymorphism, nothing. Just a bog-standard `Food` object. This is ...
C++'s run-time polymorphism (aka virtual function calls / virtual dispatch) requires that the functions be called via a pointer or reference to a base class. Here, your eat function takes a Food argument **by value**... which copies or *slices* the part of the \*f value and creates a new `Food` object. Such objects can...
5,939,272
I'm just new to C++, and doing a small project which implementing some inheritance. It can basically be summarized below: ``` //.h file class Food{ public: Food(); virtual ~Food(); }; class Animal{ public: Animal(); virtual ~Animal(); virtual void eat( Food f); }; class Meat : public Food{ public: Meat(); ~Me...
2011/05/09
[ "https://Stackoverflow.com/questions/5939272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745446/" ]
This is what's known as the "slicing problem". Your functions are taking a *copy* of the object you pass. The copy is being generated by the copy constructor for the base type, and any specialization you've done for the derived class is lost.
Object slicing is what causing the problem in your implementation. Your `eat()` function should take either *reference* to `Food` or *pointer* to `Food` as explained below: ``` virtual void eat(Food & f); //usage Meat meat; animal.eat(meat); ``` Or ``` virtual void eat(Food * pf); //usage Meat meat; animal.eat(&...
5,939,272
I'm just new to C++, and doing a small project which implementing some inheritance. It can basically be summarized below: ``` //.h file class Food{ public: Food(); virtual ~Food(); }; class Animal{ public: Animal(); virtual ~Animal(); virtual void eat( Food f); }; class Meat : public Food{ public: Meat(); ~Me...
2011/05/09
[ "https://Stackoverflow.com/questions/5939272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/745446/" ]
This is what's known as the "slicing problem". Your functions are taking a *copy* of the object you pass. The copy is being generated by the copy constructor for the base type, and any specialization you've done for the derived class is lost.
C++'s run-time polymorphism (aka virtual function calls / virtual dispatch) requires that the functions be called via a pointer or reference to a base class. Here, your eat function takes a Food argument **by value**... which copies or *slices* the part of the \*f value and creates a new `Food` object. Such objects can...
34,304,164
I want to create a combination chart (line and bar) for same json data so that the line touches the all the bars since datapoints are same. Here is the code ``` var graphdata=[ { 'indicator': 'X', 'total': 100 }, { 'indicator': 'Y', 'total': 200 }, { 'indicator': 'Z', 'total': 300 } ]; var g1=...
2015/12/16
[ "https://Stackoverflow.com/questions/34304164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4985560/" ]
Using [`os.path.join`](https://docs.python.org/3/library/os.path.html#os.path.join) is the best approach, replacing: ``` open(args.confdir + "/" + 'sample.txt') ``` with: ``` open(os.path.join(args.confdir, 'sample.txt')) ``` `os.path.join` will properly prevent doubled separators, so it doesn't matter if `confd...
Change: ``` open(args.confdir + "/" + 'sample.txt') ``` to ``` open(args.confdir + os.sep + "sample.txt') ```
34,304,164
I want to create a combination chart (line and bar) for same json data so that the line touches the all the bars since datapoints are same. Here is the code ``` var graphdata=[ { 'indicator': 'X', 'total': 100 }, { 'indicator': 'Y', 'total': 200 }, { 'indicator': 'Z', 'total': 300 } ]; var g1=...
2015/12/16
[ "https://Stackoverflow.com/questions/34304164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4985560/" ]
You could use an object such as [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html) that takes care of the trailing path separator automatically e.g.: ``` #!/usr/bin/env python3 import argparse import pathlib parser = argparse.ArgumentParser() parser.add_argument('--confdir', type=pathlib.Path, default='...
Change: ``` open(args.confdir + "/" + 'sample.txt') ``` to ``` open(args.confdir + os.sep + "sample.txt') ```
34,304,164
I want to create a combination chart (line and bar) for same json data so that the line touches the all the bars since datapoints are same. Here is the code ``` var graphdata=[ { 'indicator': 'X', 'total': 100 }, { 'indicator': 'Y', 'total': 200 }, { 'indicator': 'Z', 'total': 300 } ]; var g1=...
2015/12/16
[ "https://Stackoverflow.com/questions/34304164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4985560/" ]
Using [`os.path.join`](https://docs.python.org/3/library/os.path.html#os.path.join) is the best approach, replacing: ``` open(args.confdir + "/" + 'sample.txt') ``` with: ``` open(os.path.join(args.confdir, 'sample.txt')) ``` `os.path.join` will properly prevent doubled separators, so it doesn't matter if `confd...
You could use an object such as [`pathlib.Path`](https://docs.python.org/3/library/pathlib.html) that takes care of the trailing path separator automatically e.g.: ``` #!/usr/bin/env python3 import argparse import pathlib parser = argparse.ArgumentParser() parser.add_argument('--confdir', type=pathlib.Path, default='...
31,081,901
For the following variable ``` var dict2 = ["key1" : "value1", "key2" : [ "value1" , "value2" ]] ``` How to add a third value for the second key of the following dictionary?
2015/06/26
[ "https://Stackoverflow.com/questions/31081901", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5037910/" ]
If I can reformulate your `dict2` declaration slightly: ``` var dict2 = ["key1" : ["value1"], "key2" : [ "value1" , "value2" ]] ``` then you can append an extra item to `key2` like this: ``` dict2["key2"]?.append("value3") ``` However, you will probably need to be careful to check that `key2` was already present....
@AirspeedVelocity provides a working solution, but requiring a small change to the way the data is defined - but that is what I would do myself, if possible. However if you have to stick with the original data format, you can use this code: ``` var dict2: [String : AnyObject] = ["key1" : "value1", "key2" : [ "value1"...
5,563
I'm facing an issue with Freya. Every time my Lenovo Y50-70 is suspended and then waked it shows a black screen with cursor. I am unable to type anything nor use alt+shift+ to access the terminal. The computer simply stays frozen and I am forced to power it off and boot again. How can I fix this black screen issue?
2016/05/25
[ "https://elementaryos.stackexchange.com/questions/5563", "https://elementaryos.stackexchange.com", "https://elementaryos.stackexchange.com/users/4833/" ]
This was a confirmed [bug](https://bugs.launchpad.net/ubuntu/+source/linux-restricted-modules-2.6.20/+bug/109529) in Elementary OS Freya when using nvidia-glx module. I had resolved it by following [this](https://elementaryos.stackexchange.com/questions/586/once-locked-screen-stays-black-and-cannot-be-unlocked) post. ...
I have had the same issue for quite a while now, Maybe they have fixed this on the Loki update. To solve your issue i have found that pressing the f buttons (f5, f6 f7) solves the problem, not sure why, nor which one specifically does the trick
9,992
I built Monero private testnet (basically used these instructions <https://github.com/moneroexamples/private-testnet>, but with the latest codebase). Everything seemed to work fine, but I realized that transactions created by the wallet have tx.version=1 in cryptonote\_tx\_utils.cpp ``` tx.version = rct ? 2 : 1; ``` ...
2018/08/16
[ "https://monero.stackexchange.com/questions/9992", "https://monero.stackexchange.com", "https://monero.stackexchange.com/users/9066/" ]
No. Bulletproofs ~~currently use~~ used to use openssl's BN API for this, and now use an optimized algorithm for computing the inverse of a set of scalars.
The division part no. The `mod l` part, yes, `sc_reduce` in [src/crypto/crypto-ops.c](https://github.com/monero-project/monero/blob/b780cf4db1f9dfc49e7f16afc47892a5b40fe68a/src/crypto/crypto-ops.c#L1678).
68,181,533
I am developing an angular component. it is an avatar creater using with svg. My problem is that when I run my component in angular project it draws just a circle not other components like nose,hair,face etc. ,but when I inspect my component and copy its svg elements and paste in a svg viewer, it shows as how should it...
2021/06/29
[ "https://Stackoverflow.com/questions/68181533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8784762/" ]
Problem is that, when I create components with selector tags , angular adds its own element tags to svg schema and this breasks the svg's schema and browser doesn't render it. So, I used attribute selector for achieving this problem. This [SO](https://stackoverflow.com/a/58944913/8784762) answer help me to solve this p...
maybe it is due to the changedetection of angular. Have you perhaps tried <https://angular.io/api/core/ChangeDetectorRef> detectChanges after you change some other component? ``` ngOnInit(): void { this.random(); this.cd.detectChanges() } ```
68,181,533
I am developing an angular component. it is an avatar creater using with svg. My problem is that when I run my component in angular project it draws just a circle not other components like nose,hair,face etc. ,but when I inspect my component and copy its svg elements and paste in a svg viewer, it shows as how should it...
2021/06/29
[ "https://Stackoverflow.com/questions/68181533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8784762/" ]
Problem is that, when I create components with selector tags , angular adds its own element tags to svg schema and this breasks the svg's schema and browser doesn't render it. So, I used attribute selector for achieving this problem. This [SO](https://stackoverflow.com/a/58944913/8784762) answer help me to solve this p...
I had the same problem and it was cause due to a mismatch of angulars syntax to set html attributes. Beware of the defferent usage of ``` [style.height]="getHeight()" ... getHeight(): string ``` and ``` [attr.height]="getHeight()" ... getHeight(): string | number ``` Both work, but when you use [style.height], th...
721,804
I noticed that the sum of any even number of odds with any other even numbers is even. So, in making 5 elements I counted only the ones with 2 odd numbers, the rest being even for example 1 3 2 4 6 and 4 odd number, the last number being even, and of of course the set itself, which is even. for example 1 3 5 7 2 ...
2014/03/22
[ "https://math.stackexchange.com/questions/721804", "https://math.stackexchange.com", "https://math.stackexchange.com/users/137120/" ]
We need to choose $1$ even and $4$ odd, or $3$ even and $2$ odd, or $5$ even and $0$ odd. The total is $$\binom{5}{1}\binom{5}{4}+\binom{5}{3}\binom{5}{2}+\binom{5}{5}\binom{5}{0}.$$ There is a little less work if we notice that $\binom{5}{5-k}=\binom{5}{k}$. **Remark:** The following argument is fancier, but more i...
Here is a proof using generating functions of the count of subsets of the set $\{1,2,3,\ldots,2n\}$ with $n$ elements whose sum is even. By inspection the bivariate ordinary generating function of these sets by total sum (variable $z$) and number of elements (variable $u$) is $$f(z, u) = \prod\_{k=1}^{2n} (1 + u z^k)....