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
66,629,574
I am currently in the process of making a website for a minecraft server. It is going quite well although it is still in it's infancy. However I have a very stubborn margin on the left which no matter what I try I cannot get rid of. I am not great at web development so maybe there is something that I haven't seen in th...
2021/03/14
[ "https://Stackoverflow.com/questions/66629574", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15395977/" ]
you can use this <https://pub.dev/packages/auto_direction> This package changes the direction of a widget from ltr direction into rtl direction and vice versa based on the language of the text provided.
From [official documentation](https://flutter.dev/docs/development/accessibility-and-localization/internationalization) By default, Flutter only provides US English localizations. To add support for other languages, an application must specify additional MaterialApp (or CupertinoApp) properties, and include a package ...
7,111,728
Say you have two binary values ```none 001011 001111 ``` How can you get the number of different bits in MySQL? I tried ```sql SELECT BIT_COUNT(BINARY 001011 ^ BINARY 001111) ``` This returns 6, while I need a solution that returns 1 in this example.
2011/08/18
[ "https://Stackoverflow.com/questions/7111728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/901128/" ]
``` SELECT BIT_COUNT( CONV( '001011', 2, 10 ) ^ CONV( '001111', 2, 10 ) ) ```
``` SELECT BIT_COUNT(b'001011' ^ b'001111'); ```
7,111,728
Say you have two binary values ```none 001011 001111 ``` How can you get the number of different bits in MySQL? I tried ```sql SELECT BIT_COUNT(BINARY 001011 ^ BINARY 001111) ``` This returns 6, while I need a solution that returns 1 in this example.
2011/08/18
[ "https://Stackoverflow.com/questions/7111728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/901128/" ]
``` SELECT BIT_COUNT( CONV( '001011', 2, 10 ) ^ CONV( '001111', 2, 10 ) ) ```
It's converting the numbers 1011 and 1111 (base 10) to binary and doing the comparison. If you did: ``` SELECT BIT_COUNT(11 ^ 15) ``` It'd work.
7,111,728
Say you have two binary values ```none 001011 001111 ``` How can you get the number of different bits in MySQL? I tried ```sql SELECT BIT_COUNT(BINARY 001011 ^ BINARY 001111) ``` This returns 6, while I need a solution that returns 1 in this example.
2011/08/18
[ "https://Stackoverflow.com/questions/7111728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/901128/" ]
``` SELECT BIT_COUNT(b'001011' ^ b'001111'); ```
It's converting the numbers 1011 and 1111 (base 10) to binary and doing the comparison. If you did: ``` SELECT BIT_COUNT(11 ^ 15) ``` It'd work.
59,633
It just strikes to me that if top 2 bitcoin miners which would own more than 50% mining, merges can they control bitcoin. In hypothetical scenario if have bad intension can they control the price etx of bitcoin ?
2017/09/17
[ "https://bitcoin.stackexchange.com/questions/59633", "https://bitcoin.stackexchange.com", "https://bitcoin.stackexchange.com/users/57846/" ]
You are speaking of 51% attack or Majority Attack You can read more about it [in here](https://en.bitcoin.it/wiki/Majority_attack) If they join, yes they can double spend or so. But they can't change the price though, as that purely depends on the market demand. Till now, there has been no Majority Attack on BTC, t...
1. If they want spent twice, it will cost a lot of power to do so, so the tx must has huge amounts which be worth to do it. But when you create a transaction with huge amounts, you just wait for more confirmations. 2. But going short the bitcoin market, it would be a tempting reason.
2,215,809
> > Let T:$P\_3$→$P\_2$ be the differentiation transformation $T(p(x))=\frac{dp(x)}{dx}$. > > > Find bases for the kernel and the image space of $T$. > > >
2017/04/03
[ "https://math.stackexchange.com/questions/2215809", "https://math.stackexchange.com", "https://math.stackexchange.com/users/431351/" ]
Let us see what happens to $p\_3(x) = a\_3x^3 + a\_2 x^2 + a\_1x + a\_0$ after derivation. You get $p'(x)=3a\_3 x^2 + 2a\_2 x + a\_1$. Namely, the original polynomial $p\_3(x)$ is spanned by $\{x^3, x^2, x, 1\}$ where the Image is spanned by $\{x^2, x, 1\}$. As such, the polynomials which derivation is $0$ are constant...
Bases of P3 are x$^3$, x$^2$, x, 1. Bases of P2 are x$^2$, x, 1. f(x$^3$)= 3x$^2$ ; f(x$^2$)= 2x ; f(x)=1; Thus the base of kernel is {1} Base of Image is {x$^2$, x, 1}
8,975,964
I have now tried a basic java implementation of a code for XOAUTH and Gmail, and I keep encountering into the popular "Invalid Credential Error". Is there a known solution to this as I cannot seem to find anything online. Please see below for my code: CODE: ``` public class Oauth { private static final String SCOPE ...
2012/01/23
[ "https://Stackoverflow.com/questions/8975964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1154876/" ]
I was getting the same problem and then made sure that the exchange with gmail was exactly as shown in [this example](https://developers.google.com/google-apps/gmail/oauth_protocol#imap_protocol_exchange) i.e. sending a capability request to the server and also using exactly the same tags (e.g. A01) and it worked for...
Add `Thread.Sleep(3000)` after `getFolder("Inbox");` and `inbox.open(Folder.READ_ONLY);` After doing this it is working for me.
20,292,261
If I search for files that include file *libusb.h*, ``` $grep -r "libusb.h" /usr/local/lib/ ``` I get: > > Binary file /usr/local/lib//libusb-1.0.0.dylib matches > > Binary file /usr/local/lib//libusb-1.0.a matches > > Binary file /usr/local/lib//libusb-1.0.dylib matches > > > But when I compile my cla...
2013/11/29
[ "https://Stackoverflow.com/questions/20292261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125212/" ]
Including the lib path won't help you here. The lib path contains the path of the binary files you link with. You need to find the *include* path which provides the declarations for the exported symbols of the lib that you link against. A common distribution (not set in stone!), is: ``` lib/ (binaries to link...
This works... ``` gcc -std=c++0x -stdlib=libc++ -I/usr/local/include -L/usr/local/lib -lusb-1.0 -lstdc++ test.cpp ``` You can also switch to [Clang](https://en.wikipedia.org/wiki/Clang). This works: ``` clang++ -std=c++0x -stdlib=libc++ -I/usr/local/include -L/usr/local/lib -lusb-1.0 test.cpp ``` See comments for...
20,292,261
If I search for files that include file *libusb.h*, ``` $grep -r "libusb.h" /usr/local/lib/ ``` I get: > > Binary file /usr/local/lib//libusb-1.0.0.dylib matches > > Binary file /usr/local/lib//libusb-1.0.a matches > > Binary file /usr/local/lib//libusb-1.0.dylib matches > > > But when I compile my cla...
2013/11/29
[ "https://Stackoverflow.com/questions/20292261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125212/" ]
Including the lib path won't help you here. The lib path contains the path of the binary files you link with. You need to find the *include* path which provides the declarations for the exported symbols of the lib that you link against. A common distribution (not set in stone!), is: ``` lib/ (binaries to link...
I may be beating a dead horse here. However I had the same issue and the solutions listed did not work for me. If you are in the same boat, this is what ended up working for me: `gcc -I /usr/include/libusb-1.0/ -lusb-1.0 example.c`
2,178
* *One Piece's* Luffy, * *Naruto's* Naruto, * *Fairy Tail's* Natsu, * *Reborn's* Tsuna, * *Dragon Ball's* Goku All of the above are shown to be simple-minded and foolish. Why is it so common to depict the lead protagonist to be so stupid?
2013/01/26
[ "https://anime.stackexchange.com/questions/2178", "https://anime.stackexchange.com", "https://anime.stackexchange.com/users/99/" ]
This is a [common archetype](http://tvtropes.org/pmwiki/pmwiki.php/Main/IdiotHero) in many forms of fiction, not just shounen anime and manga. for instance, many seinen romance series have protagonists who are usually at or below average intelligence, e.g. Clannad, Chobits, though seinen also has some intelligent prota...
This seems to be a general feeling of creators for shounen, that characters should be straightforward and stupid. A lot of them also seem to have been based off of Dragonball Regarding [Naruto](http://en.wikipedia.org/wiki/Naruto_Uzumaki): > > When creating Naruto, Masashi Kishimoto incorporated into the character a...
2,178
* *One Piece's* Luffy, * *Naruto's* Naruto, * *Fairy Tail's* Natsu, * *Reborn's* Tsuna, * *Dragon Ball's* Goku All of the above are shown to be simple-minded and foolish. Why is it so common to depict the lead protagonist to be so stupid?
2013/01/26
[ "https://anime.stackexchange.com/questions/2178", "https://anime.stackexchange.com", "https://anime.stackexchange.com/users/99/" ]
This seems to be a general feeling of creators for shounen, that characters should be straightforward and stupid. A lot of them also seem to have been based off of Dragonball Regarding [Naruto](http://en.wikipedia.org/wiki/Naruto_Uzumaki): > > When creating Naruto, Masashi Kishimoto incorporated into the character a...
One of the reason for this is that we get attached to this type of personalities. Moreover, they sometimes make the viewers optimistic as the protagonists being stupid achieve many things which seems impossible!
2,178
* *One Piece's* Luffy, * *Naruto's* Naruto, * *Fairy Tail's* Natsu, * *Reborn's* Tsuna, * *Dragon Ball's* Goku All of the above are shown to be simple-minded and foolish. Why is it so common to depict the lead protagonist to be so stupid?
2013/01/26
[ "https://anime.stackexchange.com/questions/2178", "https://anime.stackexchange.com", "https://anime.stackexchange.com/users/99/" ]
This seems to be a general feeling of creators for shounen, that characters should be straightforward and stupid. A lot of them also seem to have been based off of Dragonball Regarding [Naruto](http://en.wikipedia.org/wiki/Naruto_Uzumaki): > > When creating Naruto, Masashi Kishimoto incorporated into the character a...
Shonen, for me, is all about doing the hard things. It's about effort, moving past self-doubt, facing impossible odds, and somehow through luck, faith, and grit you make it through. I think to do any and all of that instinctively, you have to be a little stupid. I consider myself a smart person. Most of my friends ar...
2,178
* *One Piece's* Luffy, * *Naruto's* Naruto, * *Fairy Tail's* Natsu, * *Reborn's* Tsuna, * *Dragon Ball's* Goku All of the above are shown to be simple-minded and foolish. Why is it so common to depict the lead protagonist to be so stupid?
2013/01/26
[ "https://anime.stackexchange.com/questions/2178", "https://anime.stackexchange.com", "https://anime.stackexchange.com/users/99/" ]
This seems to be a general feeling of creators for shounen, that characters should be straightforward and stupid. A lot of them also seem to have been based off of Dragonball Regarding [Naruto](http://en.wikipedia.org/wiki/Naruto_Uzumaki): > > When creating Naruto, Masashi Kishimoto incorporated into the character a...
Those protagonists aren’t dumb, but more so simple-minded. There are some definitions of the word that make it seem like simple-minded equals stupidity, but it honestly doesn’t mean stupid. People who are simple-minded can still problem solve pretty well even if it takes them longer to figure it out. They think and sol...
2,178
* *One Piece's* Luffy, * *Naruto's* Naruto, * *Fairy Tail's* Natsu, * *Reborn's* Tsuna, * *Dragon Ball's* Goku All of the above are shown to be simple-minded and foolish. Why is it so common to depict the lead protagonist to be so stupid?
2013/01/26
[ "https://anime.stackexchange.com/questions/2178", "https://anime.stackexchange.com", "https://anime.stackexchange.com/users/99/" ]
This is a [common archetype](http://tvtropes.org/pmwiki/pmwiki.php/Main/IdiotHero) in many forms of fiction, not just shounen anime and manga. for instance, many seinen romance series have protagonists who are usually at or below average intelligence, e.g. Clannad, Chobits, though seinen also has some intelligent prota...
One of the reason for this is that we get attached to this type of personalities. Moreover, they sometimes make the viewers optimistic as the protagonists being stupid achieve many things which seems impossible!
2,178
* *One Piece's* Luffy, * *Naruto's* Naruto, * *Fairy Tail's* Natsu, * *Reborn's* Tsuna, * *Dragon Ball's* Goku All of the above are shown to be simple-minded and foolish. Why is it so common to depict the lead protagonist to be so stupid?
2013/01/26
[ "https://anime.stackexchange.com/questions/2178", "https://anime.stackexchange.com", "https://anime.stackexchange.com/users/99/" ]
This is a [common archetype](http://tvtropes.org/pmwiki/pmwiki.php/Main/IdiotHero) in many forms of fiction, not just shounen anime and manga. for instance, many seinen romance series have protagonists who are usually at or below average intelligence, e.g. Clannad, Chobits, though seinen also has some intelligent prota...
Shonen, for me, is all about doing the hard things. It's about effort, moving past self-doubt, facing impossible odds, and somehow through luck, faith, and grit you make it through. I think to do any and all of that instinctively, you have to be a little stupid. I consider myself a smart person. Most of my friends ar...
2,178
* *One Piece's* Luffy, * *Naruto's* Naruto, * *Fairy Tail's* Natsu, * *Reborn's* Tsuna, * *Dragon Ball's* Goku All of the above are shown to be simple-minded and foolish. Why is it so common to depict the lead protagonist to be so stupid?
2013/01/26
[ "https://anime.stackexchange.com/questions/2178", "https://anime.stackexchange.com", "https://anime.stackexchange.com/users/99/" ]
This is a [common archetype](http://tvtropes.org/pmwiki/pmwiki.php/Main/IdiotHero) in many forms of fiction, not just shounen anime and manga. for instance, many seinen romance series have protagonists who are usually at or below average intelligence, e.g. Clannad, Chobits, though seinen also has some intelligent prota...
Those protagonists aren’t dumb, but more so simple-minded. There are some definitions of the word that make it seem like simple-minded equals stupidity, but it honestly doesn’t mean stupid. People who are simple-minded can still problem solve pretty well even if it takes them longer to figure it out. They think and sol...
2,178
* *One Piece's* Luffy, * *Naruto's* Naruto, * *Fairy Tail's* Natsu, * *Reborn's* Tsuna, * *Dragon Ball's* Goku All of the above are shown to be simple-minded and foolish. Why is it so common to depict the lead protagonist to be so stupid?
2013/01/26
[ "https://anime.stackexchange.com/questions/2178", "https://anime.stackexchange.com", "https://anime.stackexchange.com/users/99/" ]
Shonen, for me, is all about doing the hard things. It's about effort, moving past self-doubt, facing impossible odds, and somehow through luck, faith, and grit you make it through. I think to do any and all of that instinctively, you have to be a little stupid. I consider myself a smart person. Most of my friends ar...
One of the reason for this is that we get attached to this type of personalities. Moreover, they sometimes make the viewers optimistic as the protagonists being stupid achieve many things which seems impossible!
2,178
* *One Piece's* Luffy, * *Naruto's* Naruto, * *Fairy Tail's* Natsu, * *Reborn's* Tsuna, * *Dragon Ball's* Goku All of the above are shown to be simple-minded and foolish. Why is it so common to depict the lead protagonist to be so stupid?
2013/01/26
[ "https://anime.stackexchange.com/questions/2178", "https://anime.stackexchange.com", "https://anime.stackexchange.com/users/99/" ]
Those protagonists aren’t dumb, but more so simple-minded. There are some definitions of the word that make it seem like simple-minded equals stupidity, but it honestly doesn’t mean stupid. People who are simple-minded can still problem solve pretty well even if it takes them longer to figure it out. They think and sol...
One of the reason for this is that we get attached to this type of personalities. Moreover, they sometimes make the viewers optimistic as the protagonists being stupid achieve many things which seems impossible!
2,178
* *One Piece's* Luffy, * *Naruto's* Naruto, * *Fairy Tail's* Natsu, * *Reborn's* Tsuna, * *Dragon Ball's* Goku All of the above are shown to be simple-minded and foolish. Why is it so common to depict the lead protagonist to be so stupid?
2013/01/26
[ "https://anime.stackexchange.com/questions/2178", "https://anime.stackexchange.com", "https://anime.stackexchange.com/users/99/" ]
Shonen, for me, is all about doing the hard things. It's about effort, moving past self-doubt, facing impossible odds, and somehow through luck, faith, and grit you make it through. I think to do any and all of that instinctively, you have to be a little stupid. I consider myself a smart person. Most of my friends ar...
Those protagonists aren’t dumb, but more so simple-minded. There are some definitions of the word that make it seem like simple-minded equals stupidity, but it honestly doesn’t mean stupid. People who are simple-minded can still problem solve pretty well even if it takes them longer to figure it out. They think and sol...
816,129
I want to solve Poisson's equation given by $$ \partial\_t f = \nabla^2f = \partial^2\_r f + \frac{1}{r}\partial\_r f $$ on a circular disc, so it is 2D. I use separation of variables to write $f=R(r)T(t)$, which gives me these equations for $R$ and $T$ $$ T'+\lambda T=0\\ rR'' + R' + \lambda r R=0 $$ The equation for ...
2014/05/31
[ "https://math.stackexchange.com/questions/816129", "https://math.stackexchange.com", "https://math.stackexchange.com/users/73620/" ]
Servaes's answer has shown the non-existence of zero divisors. Now let $a \not =0, a \in R$, so $\exists b \in R$ with $aba=a$. Let $ab=t, ba=u$, where $t, u \in R$. Now $ta=a$ so $xta=xa \, \forall x \in R$ so $(xt-x)a=0$ so ($a \not =0$) $xt=x \, \forall x\in R$. Similarly $ux=x \, \forall x \in R$. Finally $u=ut=t$ ...
Let $a\in R$ be nonzero and let $c\in R$ be such that $ac=0$. There exists a *unique* element $b\in R$ such that $aba=a$, so from the identities $$a(b+c)a=(ab+ac)a=(ab)a=aba=a,$$ it follows that $b+c=b$, and hence that $c=0$. This shows that $a$ is not a zero divisor
23,826,920
Original Question ----------------- I tried to make a generic class for my web requests ``` internal class Request<TRequest, TResponse> where TRequest : class where TResponse : class { public Uri RequestUri; public TRequest RequestItem; public TResponse ResponseItem; ... } ``` The types `TRe...
2014/05/23
[ "https://Stackoverflow.com/questions/23826920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1033581/" ]
This is a classic situation. Asked many times before too. I see two approaches. -> The obvious choice would be to have a **non-generic base class/interface** which can account for all your request types, and then carry around `List<NonGenericRequest>`. -> The second approach would be utilizing **covariance**. I see y...
I think that generics wildcards could help you there: <http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2633766-wildcard-generic> As this is not going to happen at least in the near future, I see three options: * You can vote, wait, and hope Microsoft will adopt wildcards in generics... * As ...
23,826,920
Original Question ----------------- I tried to make a generic class for my web requests ``` internal class Request<TRequest, TResponse> where TRequest : class where TResponse : class { public Uri RequestUri; public TRequest RequestItem; public TResponse ResponseItem; ... } ``` The types `TRe...
2014/05/23
[ "https://Stackoverflow.com/questions/23826920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1033581/" ]
This is a classic situation. Asked many times before too. I see two approaches. -> The obvious choice would be to have a **non-generic base class/interface** which can account for all your request types, and then carry around `List<NonGenericRequest>`. -> The second approach would be utilizing **covariance**. I see y...
You can take advantage of interface variance, by extracting a variant `IRequest` interface: ``` interface IRequest<out T, out T1> { } ``` and implement it in your Request class: ``` class Request<TRequest, TResponse> : IRequest<TRequest, TResponse> where TRequest : class where TResponse : class ``` This w...
2,100,966
We're using MS Visual Studio 2008. TFS seems to take into account the creation date of a file or something, to determine whether the files should be committed. Is it possible to make TFS test just on the filename and content? * I check out an xml or txt file * I copy the content * I open notepad and paste * I save ...
2010/01/20
[ "https://Stackoverflow.com/questions/2100966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1163/" ]
When you actually perform the check-in of the file, have a look at the changeset that actually is created in the history view. Normally TFS will check the contents of the files uploaded and will only include a file in the changeset if the MD5 hash of the file is different to the last version that was in version control...
Take a look at the tfpt scripts. I think the following is what you are looking for: TFPT.exe uu /r The UU is Undo Unchanged and the /r is the recursive flag. Take a look here: <http://blogs.msdn.com/buckh/archive/2005/11/16/493401.aspx>
2,100,966
We're using MS Visual Studio 2008. TFS seems to take into account the creation date of a file or something, to determine whether the files should be committed. Is it possible to make TFS test just on the filename and content? * I check out an xml or txt file * I copy the content * I open notepad and paste * I save ...
2010/01/20
[ "https://Stackoverflow.com/questions/2100966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1163/" ]
Take a look at the tfpt scripts. I think the following is what you are looking for: TFPT.exe uu /r The UU is Undo Unchanged and the /r is the recursive flag. Take a look here: <http://blogs.msdn.com/buckh/archive/2005/11/16/493401.aspx>
Like Martin said, MD5 should be the only thing that matters.\* Copy/pasting text into notepad is not necessarily a no-op. Common differences I've seen: * 8-bit codepage -> UTF8, or vice versa * plain UTF8 -> UTF8 with BOM, or vice versa * trailing newline -> no trailing newline, or vice versa Your XML generation scri...
2,100,966
We're using MS Visual Studio 2008. TFS seems to take into account the creation date of a file or something, to determine whether the files should be committed. Is it possible to make TFS test just on the filename and content? * I check out an xml or txt file * I copy the content * I open notepad and paste * I save ...
2010/01/20
[ "https://Stackoverflow.com/questions/2100966", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1163/" ]
When you actually perform the check-in of the file, have a look at the changeset that actually is created in the history view. Normally TFS will check the contents of the files uploaded and will only include a file in the changeset if the MD5 hash of the file is different to the last version that was in version control...
Like Martin said, MD5 should be the only thing that matters.\* Copy/pasting text into notepad is not necessarily a no-op. Common differences I've seen: * 8-bit codepage -> UTF8, or vice versa * plain UTF8 -> UTF8 with BOM, or vice versa * trailing newline -> no trailing newline, or vice versa Your XML generation scri...
122,329
We are required to create a firewall on our building that is less than 5' from the property line. We removed a window and now need to know if we can just leave the old header and framing and insert studs at 16" centers within the old window opening. Can anyone offer insight into this? thank you.
2017/08/29
[ "https://diy.stackexchange.com/questions/122329", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/74854/" ]
Absolutely, that is common practice. Not much insight required, sounds like you got this.
Setbacks from property lines are based on the buildings "occupancy", (i.e.: residential, commercial, institutional, etc.) (IBC Table 601) AND what it is made out of, (i.e.: concrete, wood, etc.) (IBC Table 602.) When a building of a certain occupancy encroaches into this required setback, the exterior wall must be cons...
45,654,541
I have a table `Employee` with those columns ``` empid, empname, job, hiredate, sal, comm, deptno ``` I want to verify if this is correct: 1. Number of employees in each department 2. How many people there are in each type of job in each department 3. Display the department and number of employees in department wit...
2017/08/12
[ "https://Stackoverflow.com/questions/45654541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8456042/" ]
I hope that below queries will help you. > > 1. no of employees in each dept? > > > ``` SELECT DEPTNO, count(*) AS NO_OF_PERSONS FROM EMP GROUP BY DEPTNO; ``` > > 2. how many people are there in each type of job in each department? > > > ``` SELECT job, deptno, count(*) AS NO_OF_PERSON...
``` select e1.name, e1.sal from EMP e1 where e1.DEPTNO = 20 and not exists(select * from EMP e2 where e2.DEPTNO = 20 and e2.sal > e1.sal); ```
16,256,124
I have the following HTML code directly embedded in one PHP page, ``` <select name="language_levels[]" class="span2"> <option value="beginner">beginner</option> <option value="intermediate">intermediate</option> <option value="fluent">fluent</option> <option value="native">native</option> </select> `...
2013/04/27
[ "https://Stackoverflow.com/questions/16256124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/977145/" ]
``` $value = 'beginner'; $options = array('beginner', 'intermediate', 'fluent', 'native'); <select name="language_levels[]" class="span2"> <?php foreach($options as $o) { $selected = $o === $value ? "selected='selected'" : ""; echo "<option value='$o' $selected>$o</option>"; } ?> </select> ```
Here's how a webpage is made (with PHP): 1. The user asks for `example.com/foo.php` from your server 2. Your server runs all of the PHP code at `foo.php` to generate an HTML file 3. That HTML file gets sent back to the user's machine 4. That user's machine parses the HTML and runs any Javascript within As you can see...
16,256,124
I have the following HTML code directly embedded in one PHP page, ``` <select name="language_levels[]" class="span2"> <option value="beginner">beginner</option> <option value="intermediate">intermediate</option> <option value="fluent">fluent</option> <option value="native">native</option> </select> `...
2013/04/27
[ "https://Stackoverflow.com/questions/16256124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/977145/" ]
``` $value = 'beginner'; $options = array('beginner', 'intermediate', 'fluent', 'native'); <select name="language_levels[]" class="span2"> <?php foreach($options as $o) { $selected = $o === $value ? "selected='selected'" : ""; echo "<option value='$o' $selected>$o</option>"; } ?> </select> ```
``` <select id = "level" name="language_levels[]" class="span2"> <option value="beginner">beginner</option> <option value="intermediate">intermediate</option> <option value="fluent">fluent</option> <option value="native">native</option> </select> ``` By using jquery you can do this ``` var prevSelect...
16,256,124
I have the following HTML code directly embedded in one PHP page, ``` <select name="language_levels[]" class="span2"> <option value="beginner">beginner</option> <option value="intermediate">intermediate</option> <option value="fluent">fluent</option> <option value="native">native</option> </select> `...
2013/04/27
[ "https://Stackoverflow.com/questions/16256124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/977145/" ]
Here's how a webpage is made (with PHP): 1. The user asks for `example.com/foo.php` from your server 2. Your server runs all of the PHP code at `foo.php` to generate an HTML file 3. That HTML file gets sent back to the user's machine 4. That user's machine parses the HTML and runs any Javascript within As you can see...
``` <select id = "level" name="language_levels[]" class="span2"> <option value="beginner">beginner</option> <option value="intermediate">intermediate</option> <option value="fluent">fluent</option> <option value="native">native</option> </select> ``` By using jquery you can do this ``` var prevSelect...
43,101,712
I'm using IntelliJ and selenium to automate a very simple test case but It's crashing in the beginning itself. Also, I tried changing the firefox browser to `46` but it still opens `52.0.2` and crashes. Questions: - ***How can I get it to work?*** - ***How can I change the default browser firefox browser to...
2017/03/29
[ "https://Stackoverflow.com/questions/43101712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2845220/" ]
I had something similar on Linux Mint. As it was suggested, You need to update your [Gecko Driver](https://github.com/mozilla/geckodriver/releases). The last version is `v0.15.0`. After it, you have to set it's location as property, before creating FF driver: ``` System.setProperty("webdriver.gecko.driver","G:\\S...
as per <https://github.com/mozilla/geckodriver/issues/548> & <https://github.com/mozilla/geckodriver/issues/526> this issue is still at large ;) so I'd suggest you to downgrade your Gecko driver to `v0.14` or `v0.13`, if these gecko versions doesn't work with `selenium 3.3.1` then you can also try to downgrade seleniu...
43,101,712
I'm using IntelliJ and selenium to automate a very simple test case but It's crashing in the beginning itself. Also, I tried changing the firefox browser to `46` but it still opens `52.0.2` and crashes. Questions: - ***How can I get it to work?*** - ***How can I change the default browser firefox browser to...
2017/03/29
[ "https://Stackoverflow.com/questions/43101712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2845220/" ]
For me it works (also from IntelliJ IDEA) with * Selenium 3.0.1, * Firefox 52.0.2 64-bit on Windows 10, * Gecko driver 0.14.0 64-bit. System property `webdriver.gecko.driver` also needs to be set correctly, of course. By the way, the second assertion should be changed to ```java assertEquals( "Source Code for the...
as per <https://github.com/mozilla/geckodriver/issues/548> & <https://github.com/mozilla/geckodriver/issues/526> this issue is still at large ;) so I'd suggest you to downgrade your Gecko driver to `v0.14` or `v0.13`, if these gecko versions doesn't work with `selenium 3.3.1` then you can also try to downgrade seleniu...
20,620,032
The database I am working with currently has a varchar field, and in my code I want to map the potential values to a enumeration like: ``` public enum UserStatus { Anonymous, Enrolled, SuperUser } ``` At the database level for this column, there is a constrain on it where the value has to be: ``` ANONYM...
2013/12/16
[ "https://Stackoverflow.com/questions/20620032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1361315/" ]
You can't override `ToString` for enums, instead you can create your own [Extension Method](http://msdn.microsoft.com/en-us/library/bb383977.aspx) like: ``` public static class MyExtensions { public static string ToUpperString(this UserStatus userStatus) { return userStatus.ToString().ToUpper();// OR ....
Enum.ToString supports [4 different formats](http://msdn.microsoft.com/en-us/library/c3s1ez6e%28v=vs.110%29.aspx). I'd go for: ``` UserStatus.SuperUser.ToString("G").ToUpper(); ``` "G" ensures that it will try first to get the string representation of your enum.
20,620,032
The database I am working with currently has a varchar field, and in my code I want to map the potential values to a enumeration like: ``` public enum UserStatus { Anonymous, Enrolled, SuperUser } ``` At the database level for this column, there is a constrain on it where the value has to be: ``` ANONYM...
2013/12/16
[ "https://Stackoverflow.com/questions/20620032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1361315/" ]
A better solution may be to take advantage of the [`DescriptionAttribute`](http://msdn.microsoft.com/en-us/library/system.componentmodel.descriptionattribute%28v=vs.110%29.aspx): ``` public enum UserStatus { [Description("ANONYMOUS")] Anonymous, [Description("ENROLLED")] Enrolled, [Description("SUP...
Enum.ToString supports [4 different formats](http://msdn.microsoft.com/en-us/library/c3s1ez6e%28v=vs.110%29.aspx). I'd go for: ``` UserStatus.SuperUser.ToString("G").ToUpper(); ``` "G" ensures that it will try first to get the string representation of your enum.
183,645
I created a custom module for my internship, I have to add an item to the users menu in the frontend * MY ACCOUNT * ACCOUNT DASHBOARD * ACCOUNT INFORMATION * ADDRESS BOOK * MY ORDERS * BILLING AGREEMENTS * RECURRING PROFILES * MY PRODUCT REVIEWS * MY TAGS * MY WISHLIST * MY APPLICATIONS * NEWSLETTER SUBSCRIPTIONS * MY...
2017/07/13
[ "https://magento.stackexchange.com/questions/183645", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/56552/" ]
Read the notice in the Dev Docs [uninstall sample data](http://devdocs.magento.com/guides/v2.0/install-gde/install/sample-data.html) You can disable those modules but an Uninstall is not possible. the DB will still contain references to them.
So it turns out all I needed to do was create a `composer.json` file for the offending module `Theme/Blog/composer.json`, and I was then able to run the sampledata:remove command. Which also updates the composer library and removes them from future downloads. if you get an error when trying to run the command referenc...
7,129,301
So, I just bought a computer with windows 7 64 bit and installed Android SDK on it for Android development. When I try to start any of the virtual android machines, I get an error saying that I should use @foo instead of foo. It will not let me boot any of the virtual android machines. I have installed java, and before...
2011/08/20
[ "https://Stackoverflow.com/questions/7129301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/780198/" ]
Make sure your path doesn't have any spaces in it. Save it in C:\android\_sdk or something like that.
Try and start it from the command line rather from the GUI. On windows I use a .bat file as ``` cd c:\program files\Android\android-sdk\tools emulator -avd avd3 -sdcard MySdCardFile.img ``` you might get better error information
7,129,301
So, I just bought a computer with windows 7 64 bit and installed Android SDK on it for Android development. When I try to start any of the virtual android machines, I get an error saying that I should use @foo instead of foo. It will not let me boot any of the virtual android machines. I have installed java, and before...
2011/08/20
[ "https://Stackoverflow.com/questions/7129301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/780198/" ]
Try and start it from the command line rather from the GUI. On windows I use a .bat file as ``` cd c:\program files\Android\android-sdk\tools emulator -avd avd3 -sdcard MySdCardFile.img ``` you might get better error information
ya sure it is problem of path of your SDK for more information refer this [Running first Android application - error message](https://stackoverflow.com/questions/7099479/running-first-android-application-error-message/7102100#7102100)
7,129,301
So, I just bought a computer with windows 7 64 bit and installed Android SDK on it for Android development. When I try to start any of the virtual android machines, I get an error saying that I should use @foo instead of foo. It will not let me boot any of the virtual android machines. I have installed java, and before...
2011/08/20
[ "https://Stackoverflow.com/questions/7129301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/780198/" ]
Try and start it from the command line rather from the GUI. On windows I use a .bat file as ``` cd c:\program files\Android\android-sdk\tools emulator -avd avd3 -sdcard MySdCardFile.img ``` you might get better error information
Instead of going through a new installation you can query the 8.3 name of the directory containing a space on the command line with "dir /X". Replace the wrong path with that short name in Eclipses Android SDK location setting (Window/Properties/Android).
7,129,301
So, I just bought a computer with windows 7 64 bit and installed Android SDK on it for Android development. When I try to start any of the virtual android machines, I get an error saying that I should use @foo instead of foo. It will not let me boot any of the virtual android machines. I have installed java, and before...
2011/08/20
[ "https://Stackoverflow.com/questions/7129301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/780198/" ]
Make sure your path doesn't have any spaces in it. Save it in C:\android\_sdk or something like that.
ya sure it is problem of path of your SDK for more information refer this [Running first Android application - error message](https://stackoverflow.com/questions/7099479/running-first-android-application-error-message/7102100#7102100)
7,129,301
So, I just bought a computer with windows 7 64 bit and installed Android SDK on it for Android development. When I try to start any of the virtual android machines, I get an error saying that I should use @foo instead of foo. It will not let me boot any of the virtual android machines. I have installed java, and before...
2011/08/20
[ "https://Stackoverflow.com/questions/7129301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/780198/" ]
Make sure your path doesn't have any spaces in it. Save it in C:\android\_sdk or something like that.
Instead of going through a new installation you can query the 8.3 name of the directory containing a space on the command line with "dir /X". Replace the wrong path with that short name in Eclipses Android SDK location setting (Window/Properties/Android).
7,129,301
So, I just bought a computer with windows 7 64 bit and installed Android SDK on it for Android development. When I try to start any of the virtual android machines, I get an error saying that I should use @foo instead of foo. It will not let me boot any of the virtual android machines. I have installed java, and before...
2011/08/20
[ "https://Stackoverflow.com/questions/7129301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/780198/" ]
ya sure it is problem of path of your SDK for more information refer this [Running first Android application - error message](https://stackoverflow.com/questions/7099479/running-first-android-application-error-message/7102100#7102100)
Instead of going through a new installation you can query the 8.3 name of the directory containing a space on the command line with "dir /X". Replace the wrong path with that short name in Eclipses Android SDK location setting (Window/Properties/Android).
197,726
Could someone please explain how these two `gamm` from the `mgcv` package specifications differ? I am using the Owls data and first model example from the Zuur text on Mixed Models found here: (<http://www2.unil.ch/popgen/modsel/rcode/owls.R>) ``` M7 <- gamm(NegPerChick~FoodTreatment + s(ArrivalTime,by=a...
2016/02/21
[ "https://stats.stackexchange.com/questions/197726", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/46609/" ]
Those two calls to `gamm()` essentially specify the same model but `M7` is clearly unstable when the algorithm tries to fit the model. I currently get: ``` > gamm(NegPerChick~FoodTreatment + + s(ArrivalTime,by=as.numeric(FoodTreatment=="Deprived")) + + s(ArrivalTime,by=as.numeric(FoodTreatmen...
These models should be equivalent but the `gamm` function gives different outputs. I'll use as an example the `Hawaii` dataset from the book you have mentioned (mainly, paragraph 6.2). In the book you have: ``` BM2 = gamm(Birds ~ Rain + ID + s(Time, by = as.numeric(ID == "Stilt.Oahu"))+ s(Time, by...
8,847,899
I don't have the option to use but OpenGL methods (that is `glxxx()` methods). I need to draw text using gl methods only. After reading the red book, I understand that it is possible only through the `glBitmap()` method. If this is the only possible way, then can any one help me with the pixel array information for all...
2012/01/13
[ "https://Stackoverflow.com/questions/8847899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1129336/" ]
Theory ====== **Why it is hard** Popular font formats like [TrueType](https://en.wikipedia.org/wiki/TrueType) and [OpenType](https://en.wikipedia.org/wiki/OpenType) are vector outline formats: they use [Bezier curves](https://en.wikipedia.org/wiki/B%C3%A9zier_curve) to define the boundary of the letter. ![](https://...
I think that the best solution for drawing text in OpenGL is texture fonts, I work with them for a long time. They are flexible, fast and nice looking (with some rear exceptions). I use special program for converting font files (.ttf for example) to texture, which is saved to file of some internal "font" format (I've d...
8,847,899
I don't have the option to use but OpenGL methods (that is `glxxx()` methods). I need to draw text using gl methods only. After reading the red book, I understand that it is possible only through the `glBitmap()` method. If this is the only possible way, then can any one help me with the pixel array information for all...
2012/01/13
[ "https://Stackoverflow.com/questions/8847899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1129336/" ]
Theory ====== **Why it is hard** Popular font formats like [TrueType](https://en.wikipedia.org/wiki/TrueType) and [OpenType](https://en.wikipedia.org/wiki/OpenType) are vector outline formats: they use [Bezier curves](https://en.wikipedia.org/wiki/B%C3%A9zier_curve) to define the boundary of the letter. ![](https://...
Load an image with characters as texture and draw the part of that texture depending on what character you want. You can create that texture using a paint program, hardcode it or use a window component to draw to an image and retrieve that image for an exact copy of system fonts. No need to use Glut or any other exten...
8,847,899
I don't have the option to use but OpenGL methods (that is `glxxx()` methods). I need to draw text using gl methods only. After reading the red book, I understand that it is possible only through the `glBitmap()` method. If this is the only possible way, then can any one help me with the pixel array information for all...
2012/01/13
[ "https://Stackoverflow.com/questions/8847899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1129336/" ]
![enter image description here](https://i.stack.imgur.com/rJwJv.jpg) Use `glutStrokeCharacter(GLUT_STROKE_ROMAN, myCharString)`. An example: A STAR WARS SCROLLER. ``` #include <windows.h> #include <string.h> #include <GL\glut.h> #include <iostream.h> #include <fstream.h> GLfloat UpwardsScrollVelocity = -10.0; float...
I think that the best solution for drawing text in OpenGL is texture fonts, I work with them for a long time. They are flexible, fast and nice looking (with some rear exceptions). I use special program for converting font files (.ttf for example) to texture, which is saved to file of some internal "font" format (I've d...
8,847,899
I don't have the option to use but OpenGL methods (that is `glxxx()` methods). I need to draw text using gl methods only. After reading the red book, I understand that it is possible only through the `glBitmap()` method. If this is the only possible way, then can any one help me with the pixel array information for all...
2012/01/13
[ "https://Stackoverflow.com/questions/8847899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1129336/" ]
Theory ====== **Why it is hard** Popular font formats like [TrueType](https://en.wikipedia.org/wiki/TrueType) and [OpenType](https://en.wikipedia.org/wiki/OpenType) are vector outline formats: they use [Bezier curves](https://en.wikipedia.org/wiki/B%C3%A9zier_curve) to define the boundary of the letter. ![](https://...
Drawing text in plain OpenGL isn't a straigth-forward task. You should probably have a look at libraries for doing this (either by using a library or as an example implementation). Some good starting points could be [GLFont](http://students.cs.byu.edu/~bfish/glfontdl.php), [OpenGL Font Survey](http://www.opengl.org/re...
8,847,899
I don't have the option to use but OpenGL methods (that is `glxxx()` methods). I need to draw text using gl methods only. After reading the red book, I understand that it is possible only through the `glBitmap()` method. If this is the only possible way, then can any one help me with the pixel array information for all...
2012/01/13
[ "https://Stackoverflow.com/questions/8847899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1129336/" ]
[This article](http://www.opengl.org/resources/features/fontsurvey/) describes how to render text in OpenGL using various techniques. With only using opengl, there are several ways: * using glBitmap * using textures * using display lists
I think that the best solution for drawing text in OpenGL is texture fonts, I work with them for a long time. They are flexible, fast and nice looking (with some rear exceptions). I use special program for converting font files (.ttf for example) to texture, which is saved to file of some internal "font" format (I've d...
8,847,899
I don't have the option to use but OpenGL methods (that is `glxxx()` methods). I need to draw text using gl methods only. After reading the red book, I understand that it is possible only through the `glBitmap()` method. If this is the only possible way, then can any one help me with the pixel array information for all...
2012/01/13
[ "https://Stackoverflow.com/questions/8847899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1129336/" ]
Theory ====== **Why it is hard** Popular font formats like [TrueType](https://en.wikipedia.org/wiki/TrueType) and [OpenType](https://en.wikipedia.org/wiki/OpenType) are vector outline formats: they use [Bezier curves](https://en.wikipedia.org/wiki/B%C3%A9zier_curve) to define the boundary of the letter. ![](https://...
![enter image description here](https://i.stack.imgur.com/rJwJv.jpg) Use `glutStrokeCharacter(GLUT_STROKE_ROMAN, myCharString)`. An example: A STAR WARS SCROLLER. ``` #include <windows.h> #include <string.h> #include <GL\glut.h> #include <iostream.h> #include <fstream.h> GLfloat UpwardsScrollVelocity = -10.0; float...
8,847,899
I don't have the option to use but OpenGL methods (that is `glxxx()` methods). I need to draw text using gl methods only. After reading the red book, I understand that it is possible only through the `glBitmap()` method. If this is the only possible way, then can any one help me with the pixel array information for all...
2012/01/13
[ "https://Stackoverflow.com/questions/8847899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1129336/" ]
[This article](http://www.opengl.org/resources/features/fontsurvey/) describes how to render text in OpenGL using various techniques. With only using opengl, there are several ways: * using glBitmap * using textures * using display lists
Load an image with characters as texture and draw the part of that texture depending on what character you want. You can create that texture using a paint program, hardcode it or use a window component to draw to an image and retrieve that image for an exact copy of system fonts. No need to use Glut or any other exten...
8,847,899
I don't have the option to use but OpenGL methods (that is `glxxx()` methods). I need to draw text using gl methods only. After reading the red book, I understand that it is possible only through the `glBitmap()` method. If this is the only possible way, then can any one help me with the pixel array information for all...
2012/01/13
[ "https://Stackoverflow.com/questions/8847899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1129336/" ]
Theory ====== **Why it is hard** Popular font formats like [TrueType](https://en.wikipedia.org/wiki/TrueType) and [OpenType](https://en.wikipedia.org/wiki/OpenType) are vector outline formats: they use [Bezier curves](https://en.wikipedia.org/wiki/B%C3%A9zier_curve) to define the boundary of the letter. ![](https://...
[This article](http://www.opengl.org/resources/features/fontsurvey/) describes how to render text in OpenGL using various techniques. With only using opengl, there are several ways: * using glBitmap * using textures * using display lists
8,847,899
I don't have the option to use but OpenGL methods (that is `glxxx()` methods). I need to draw text using gl methods only. After reading the red book, I understand that it is possible only through the `glBitmap()` method. If this is the only possible way, then can any one help me with the pixel array information for all...
2012/01/13
[ "https://Stackoverflow.com/questions/8847899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1129336/" ]
Drawing text in plain OpenGL isn't a straigth-forward task. You should probably have a look at libraries for doing this (either by using a library or as an example implementation). Some good starting points could be [GLFont](http://students.cs.byu.edu/~bfish/glfontdl.php), [OpenGL Font Survey](http://www.opengl.org/re...
I think that the best solution for drawing text in OpenGL is texture fonts, I work with them for a long time. They are flexible, fast and nice looking (with some rear exceptions). I use special program for converting font files (.ttf for example) to texture, which is saved to file of some internal "font" format (I've d...
8,847,899
I don't have the option to use but OpenGL methods (that is `glxxx()` methods). I need to draw text using gl methods only. After reading the red book, I understand that it is possible only through the `glBitmap()` method. If this is the only possible way, then can any one help me with the pixel array information for all...
2012/01/13
[ "https://Stackoverflow.com/questions/8847899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1129336/" ]
![enter image description here](https://i.stack.imgur.com/rJwJv.jpg) Use `glutStrokeCharacter(GLUT_STROKE_ROMAN, myCharString)`. An example: A STAR WARS SCROLLER. ``` #include <windows.h> #include <string.h> #include <GL\glut.h> #include <iostream.h> #include <fstream.h> GLfloat UpwardsScrollVelocity = -10.0; float...
Load an image with characters as texture and draw the part of that texture depending on what character you want. You can create that texture using a paint program, hardcode it or use a window component to draw to an image and retrieve that image for an exact copy of system fonts. No need to use Glut or any other exten...
19,883,186
I've built a small project on my system. After building the project, I put it on a USB drive, and copied to another system. When I run the project, how can it detect if django is installed in the system or if the system has all of the the requirements for the project? For example, I made a blog example project o...
2013/11/09
[ "https://Stackoverflow.com/questions/19883186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2681077/" ]
As in my comment, I've tested the first rules set without RewriteCond, ``` RewriteRule ^/?$ /home-%1.html [NC,QSA,E=SITE_VERSION:%1] ``` I obtained this: ``` http://www.example.com/ => http://www.example.com/home-.html ``` The second ruleset has an visible error: %{THE\_REQUEST} ^(a-specific-page|another-spe...
The full solution. This does the following: 1. Detects the URL parameter ?site-version, and if found, sets a cookie on the client called site-version, storing the country code (au, eu, za, etc), to last 2 years (1051200 minutes). It then removes the parameter from the URL and gets the user's browser to request the ori...
81,451
I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through `db.TextProperty` and `db.BlobProperty`. I'll be glad anyone can provide code sample (both the client and th...
2008/09/17
[ "https://Stackoverflow.com/questions/81451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
In fact, this question is answered in the App Egnine documentation. See an example on [Uploading User Images](http://code.google.com/appengine/docs/images/usingimages.html#Uploading). HTML code, inside <form></form>: ``` <input type="file" name="img"/> ``` Python code: ``` class Guestbook(webapp.RequestHandler): ...
There is a way of using **flat file system**( Atleast in usage perspective) There is this [**Google App Engine Virtual FileSystem project**](http://code.google.com/p/gaevfs/). that is implemented with the help of datastore and memcache APIs to emulate an ordinary filesystem. Using this library you can use in you proje...
81,451
I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through `db.TextProperty` and `db.BlobProperty`. I'll be glad anyone can provide code sample (both the client and th...
2008/09/17
[ "https://Stackoverflow.com/questions/81451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
Here is a complete, working file. I pulled the original from the Google site and modified it to make it slightly more real world. A few things to notice: 1. This code uses the [BlobStore API](http://code.google.com/appengine/docs/python/blobstore/) 2. The purpose of this line in the ServeHandler class is to "fix" the...
In fact, this question is answered in the App Egnine documentation. See an example on [Uploading User Images](http://code.google.com/appengine/docs/images/usingimages.html#Uploading). HTML code, inside <form></form>: ``` <input type="file" name="img"/> ``` Python code: ``` class Guestbook(webapp.RequestHandler): ...
81,451
I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through `db.TextProperty` and `db.BlobProperty`. I'll be glad anyone can provide code sample (both the client and th...
2008/09/17
[ "https://Stackoverflow.com/questions/81451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
There is a thread in Google Groups about it: [Uploading Files](http://groups.google.com/group/google-appengine/browse_thread/thread/f9d0f22d8de8c025/bba32165e308dd13?lnk=gst&q=uploading+files#bba32165e308dd13) With a lot of useful code, that discussion helped me very much in uploading files.
If your still having a problem, check you are using enctype in the form tag No: ``` <form encoding="multipart/form-data" action="/upload"> ``` Yes: ``` <form enctype="multipart/form-data" action="/upload"> ```
81,451
I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through `db.TextProperty` and `db.BlobProperty`. I'll be glad anyone can provide code sample (both the client and th...
2008/09/17
[ "https://Stackoverflow.com/questions/81451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
In fact, this question is answered in the App Egnine documentation. See an example on [Uploading User Images](http://code.google.com/appengine/docs/images/usingimages.html#Uploading). HTML code, inside <form></form>: ``` <input type="file" name="img"/> ``` Python code: ``` class Guestbook(webapp.RequestHandler): ...
I try it today, It works as following: my sdk version is 1.3.x html page: ``` <form enctype="multipart/form-data" action="/upload" method="post" > <input type="file" name="myfile" /> <input type="submit" /> </form> ``` Server Code: ``` file_contents = self.request.POST.get('myfile').file.read() ```
81,451
I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through `db.TextProperty` and `db.BlobProperty`. I'll be glad anyone can provide code sample (both the client and th...
2008/09/17
[ "https://Stackoverflow.com/questions/81451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
Here is a complete, working file. I pulled the original from the Google site and modified it to make it slightly more real world. A few things to notice: 1. This code uses the [BlobStore API](http://code.google.com/appengine/docs/python/blobstore/) 2. The purpose of this line in the ServeHandler class is to "fix" the...
There's no flat file storing in Google App Engine. Everything has to go in to the [Datastore](http://code.google.com/appengine/docs/datastore/) which is a bit like a relational database but not quite. You could store the files as [TextProperty](http://code.google.com/appengine/docs/datastore/typesandpropertyclasses.ht...
81,451
I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through `db.TextProperty` and `db.BlobProperty`. I'll be glad anyone can provide code sample (both the client and th...
2008/09/17
[ "https://Stackoverflow.com/questions/81451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
Personally I found the tutorial described [here](http://shogi-software.blogspot.com/2009/04/google-app-engine-and-file-upload.html) useful when using the Java run time with GAE. For some reason, when I tried to upload a file using ``` <form action="/testservelet" method="get" enctype="multipart/form-data"> <div> ...
I have observed some strange behavior when uploading files on App Engine. When you submit the following form: ``` <form method="post" action="/upload" enctype="multipart/form-data"> <input type="file" name="img" /> ... </form> ``` And then you extract the `img` from the request like this: ``` img_contents =...
81,451
I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through `db.TextProperty` and `db.BlobProperty`. I'll be glad anyone can provide code sample (both the client and th...
2008/09/17
[ "https://Stackoverflow.com/questions/81451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
In fact, this question is answered in the App Egnine documentation. See an example on [Uploading User Images](http://code.google.com/appengine/docs/images/usingimages.html#Uploading). HTML code, inside <form></form>: ``` <input type="file" name="img"/> ``` Python code: ``` class Guestbook(webapp.RequestHandler): ...
There's no flat file storing in Google App Engine. Everything has to go in to the [Datastore](http://code.google.com/appengine/docs/datastore/) which is a bit like a relational database but not quite. You could store the files as [TextProperty](http://code.google.com/appengine/docs/datastore/typesandpropertyclasses.ht...
81,451
I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through `db.TextProperty` and `db.BlobProperty`. I'll be glad anyone can provide code sample (both the client and th...
2008/09/17
[ "https://Stackoverflow.com/questions/81451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
Here is a complete, working file. I pulled the original from the Google site and modified it to make it slightly more real world. A few things to notice: 1. This code uses the [BlobStore API](http://code.google.com/appengine/docs/python/blobstore/) 2. The purpose of this line in the ServeHandler class is to "fix" the...
Google has released a service for storing large files. Have a look at [blobstore API documentation](http://code.google.com/appengine/docs/python/blobstore/). If your files are > 1MB, you should use it.
81,451
I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through `db.TextProperty` and `db.BlobProperty`. I'll be glad anyone can provide code sample (both the client and th...
2008/09/17
[ "https://Stackoverflow.com/questions/81451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
If your still having a problem, check you are using enctype in the form tag No: ``` <form encoding="multipart/form-data" action="/upload"> ``` Yes: ``` <form enctype="multipart/form-data" action="/upload"> ```
I have observed some strange behavior when uploading files on App Engine. When you submit the following form: ``` <form method="post" action="/upload" enctype="multipart/form-data"> <input type="file" name="img" /> ... </form> ``` And then you extract the `img` from the request like this: ``` img_contents =...
81,451
I am planning to create a web app that allows users to downgrade their visual studio project files. However, It seems Google App Engine accepts files uploading and flat file storing on the Google Server through `db.TextProperty` and `db.BlobProperty`. I'll be glad anyone can provide code sample (both the client and th...
2008/09/17
[ "https://Stackoverflow.com/questions/81451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3834/" ]
In fact, this question is answered in the App Egnine documentation. See an example on [Uploading User Images](http://code.google.com/appengine/docs/images/usingimages.html#Uploading). HTML code, inside <form></form>: ``` <input type="file" name="img"/> ``` Python code: ``` class Guestbook(webapp.RequestHandler): ...
I have observed some strange behavior when uploading files on App Engine. When you submit the following form: ``` <form method="post" action="/upload" enctype="multipart/form-data"> <input type="file" name="img" /> ... </form> ``` And then you extract the `img` from the request like this: ``` img_contents =...
1,039,207
**Question:** > > Find a sequence of differentiable functions $f\_n$ on $\mathbb{R}$ that converge uniformly to a differentiable function $f$, such that $f'\_n$ converges pointwise but not uniformly to $f'$. > > > **Attempt:** I have tried a number of possibilities, such as $f\_n=x^n$ or $f\_n=\frac{x^n}{n}$ but...
2014/11/26
[ "https://math.stackexchange.com/questions/1039207", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26559/" ]
I think that$$f\_n(x) = \dfrac{\sin(nx)}{n^2x}$$ will work. We have $f\_n = \frac{1}{n}\textrm{sinc}(nx)$ and $\textrm{sinc}$ is uniformly bounded by $1$, so $f\_n$ converges uniformly to zero. Further, $$f\_n' = \dfrac{\cos nx}{nx} - \dfrac{\sin nx}{n^2 x^2}$$ which *should* converge pointwise to zero, but $f\_n'(\pi...
Take $f\_{n}(x)=\sqrt{x^{2}+\frac{1}{n^{2}}}.$ Then for all $x\in %TCIMACRO{\U{211d} }% %BeginExpansion \mathbb{R} %EndExpansion ,$ $$\lim\_{n\rightarrow \infty }f\_{n}(x)=\left\vert x\right\vert =f(x).$$ So $% f\_{n}$ converges pointwise to $f$ on $% %TCIMACRO{\U{211d} }% %BeginExpansion \mathbb{R} %EndExpansion .$ ...
1,039,207
**Question:** > > Find a sequence of differentiable functions $f\_n$ on $\mathbb{R}$ that converge uniformly to a differentiable function $f$, such that $f'\_n$ converges pointwise but not uniformly to $f'$. > > > **Attempt:** I have tried a number of possibilities, such as $f\_n=x^n$ or $f\_n=\frac{x^n}{n}$ but...
2014/11/26
[ "https://math.stackexchange.com/questions/1039207", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26559/" ]
I think that$$f\_n(x) = \dfrac{\sin(nx)}{n^2x}$$ will work. We have $f\_n = \frac{1}{n}\textrm{sinc}(nx)$ and $\textrm{sinc}$ is uniformly bounded by $1$, so $f\_n$ converges uniformly to zero. Further, $$f\_n' = \dfrac{\cos nx}{nx} - \dfrac{\sin nx}{n^2 x^2}$$ which *should* converge pointwise to zero, but $f\_n'(\pi...
Let $f$ be a function which is everywhere zero except interval (0; 1) where it has some shape of a bell. Now the sequence is $f\_n(x) = \frac{f(n(x - n))}n$ As you can see, "the bell" moves along the x-axis, becoming lower and lower, so the sequence uniformly converges to zero. But considering the derivative, we see...
1,039,207
**Question:** > > Find a sequence of differentiable functions $f\_n$ on $\mathbb{R}$ that converge uniformly to a differentiable function $f$, such that $f'\_n$ converges pointwise but not uniformly to $f'$. > > > **Attempt:** I have tried a number of possibilities, such as $f\_n=x^n$ or $f\_n=\frac{x^n}{n}$ but...
2014/11/26
[ "https://math.stackexchange.com/questions/1039207", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26559/" ]
I think that$$f\_n(x) = \dfrac{\sin(nx)}{n^2x}$$ will work. We have $f\_n = \frac{1}{n}\textrm{sinc}(nx)$ and $\textrm{sinc}$ is uniformly bounded by $1$, so $f\_n$ converges uniformly to zero. Further, $$f\_n' = \dfrac{\cos nx}{nx} - \dfrac{\sin nx}{n^2 x^2}$$ which *should* converge pointwise to zero, but $f\_n'(\pi...
Let $f\_n(x)=0$ if $|x|\ge 1/n.$ For $|x|<1/n$ let $f\_n(x)=n^3(x^2-1/n^2)^2.$ $|f\_n(x)|\le 1/n$ for all $x$ so $f\_n$ converges uniformly to $f=0.$ So $f'=0.$ It is easy to confirm that $f'\_n(x)$ exists when $x=\pm 1/n.$ $-1=\frac {f\_n(1/n)-f\_n(0)}{1/n-0}=f'\_n(y\_n)$ for some $y\_n\in (0,1/n)$ so $f'\_n$ does ...
1,039,207
**Question:** > > Find a sequence of differentiable functions $f\_n$ on $\mathbb{R}$ that converge uniformly to a differentiable function $f$, such that $f'\_n$ converges pointwise but not uniformly to $f'$. > > > **Attempt:** I have tried a number of possibilities, such as $f\_n=x^n$ or $f\_n=\frac{x^n}{n}$ but...
2014/11/26
[ "https://math.stackexchange.com/questions/1039207", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26559/" ]
Take $f\_{n}(x)=\sqrt{x^{2}+\frac{1}{n^{2}}}.$ Then for all $x\in %TCIMACRO{\U{211d} }% %BeginExpansion \mathbb{R} %EndExpansion ,$ $$\lim\_{n\rightarrow \infty }f\_{n}(x)=\left\vert x\right\vert =f(x).$$ So $% f\_{n}$ converges pointwise to $f$ on $% %TCIMACRO{\U{211d} }% %BeginExpansion \mathbb{R} %EndExpansion .$ ...
Let $f$ be a function which is everywhere zero except interval (0; 1) where it has some shape of a bell. Now the sequence is $f\_n(x) = \frac{f(n(x - n))}n$ As you can see, "the bell" moves along the x-axis, becoming lower and lower, so the sequence uniformly converges to zero. But considering the derivative, we see...
1,039,207
**Question:** > > Find a sequence of differentiable functions $f\_n$ on $\mathbb{R}$ that converge uniformly to a differentiable function $f$, such that $f'\_n$ converges pointwise but not uniformly to $f'$. > > > **Attempt:** I have tried a number of possibilities, such as $f\_n=x^n$ or $f\_n=\frac{x^n}{n}$ but...
2014/11/26
[ "https://math.stackexchange.com/questions/1039207", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26559/" ]
Take $f\_{n}(x)=\sqrt{x^{2}+\frac{1}{n^{2}}}.$ Then for all $x\in %TCIMACRO{\U{211d} }% %BeginExpansion \mathbb{R} %EndExpansion ,$ $$\lim\_{n\rightarrow \infty }f\_{n}(x)=\left\vert x\right\vert =f(x).$$ So $% f\_{n}$ converges pointwise to $f$ on $% %TCIMACRO{\U{211d} }% %BeginExpansion \mathbb{R} %EndExpansion .$ ...
Let $f\_n(x)=0$ if $|x|\ge 1/n.$ For $|x|<1/n$ let $f\_n(x)=n^3(x^2-1/n^2)^2.$ $|f\_n(x)|\le 1/n$ for all $x$ so $f\_n$ converges uniformly to $f=0.$ So $f'=0.$ It is easy to confirm that $f'\_n(x)$ exists when $x=\pm 1/n.$ $-1=\frac {f\_n(1/n)-f\_n(0)}{1/n-0}=f'\_n(y\_n)$ for some $y\_n\in (0,1/n)$ so $f'\_n$ does ...
1,039,207
**Question:** > > Find a sequence of differentiable functions $f\_n$ on $\mathbb{R}$ that converge uniformly to a differentiable function $f$, such that $f'\_n$ converges pointwise but not uniformly to $f'$. > > > **Attempt:** I have tried a number of possibilities, such as $f\_n=x^n$ or $f\_n=\frac{x^n}{n}$ but...
2014/11/26
[ "https://math.stackexchange.com/questions/1039207", "https://math.stackexchange.com", "https://math.stackexchange.com/users/26559/" ]
Let $f$ be a function which is everywhere zero except interval (0; 1) where it has some shape of a bell. Now the sequence is $f\_n(x) = \frac{f(n(x - n))}n$ As you can see, "the bell" moves along the x-axis, becoming lower and lower, so the sequence uniformly converges to zero. But considering the derivative, we see...
Let $f\_n(x)=0$ if $|x|\ge 1/n.$ For $|x|<1/n$ let $f\_n(x)=n^3(x^2-1/n^2)^2.$ $|f\_n(x)|\le 1/n$ for all $x$ so $f\_n$ converges uniformly to $f=0.$ So $f'=0.$ It is easy to confirm that $f'\_n(x)$ exists when $x=\pm 1/n.$ $-1=\frac {f\_n(1/n)-f\_n(0)}{1/n-0}=f'\_n(y\_n)$ for some $y\_n\in (0,1/n)$ so $f'\_n$ does ...
3,376,277
I just completed mapping 100~ tables from our production Oracle database. Along the way I noticed that many relationships were not modelling. Mostly foreign keys. Should I modify my mappings to include the appropriate relationships? Or should I keep the mapping as is to reflect the database 100%? I'm more inclined th...
2010/07/31
[ "https://Stackoverflow.com/questions/3376277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25371/" ]
It sounds like you wish to bind a function to the form's `submit` event. See <http://api.jquery.com/submit/> To fit your request, this should work: ``` $('form').submit(function(){ alert('hello'); return true; }); ``` Addendum: Okay, since you have two submit buttons, you'll need to use the `click` event. `...
You should use the `.click()` method for the button. ``` $('#apply_action').click( function(){ // do your stuff here.. } ); ```
31,871,627
Trying to run a web application programmatically. Wrote a code that will automatically deploy the web application. After the web application has been deployed, I call the servlet with some input using `URL` class and print the response as shown below. ``` //code to start Tomcat server and deploy the web app St...
2015/08/07
[ "https://Stackoverflow.com/questions/31871627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4472665/" ]
It's not a good idea to call: ``` android.os.Process.killProcess(android.os.Process.myPid()); System.exit(0); ``` because android will handle processes automatically. Also exclude your app from recent isn't a correct behavior. By the way you can put under your "exit" activity tag in manifest: ``` android:excludeFr...
finish() is enough. If the app still remains in memory after call finish(), it may be Memory leak in your app.
31,871,627
Trying to run a web application programmatically. Wrote a code that will automatically deploy the web application. After the web application has been deployed, I call the servlet with some input using `URL` class and print the response as shown below. ``` //code to start Tomcat server and deploy the web app St...
2015/08/07
[ "https://Stackoverflow.com/questions/31871627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4472665/" ]
It's not a good idea to call: ``` android.os.Process.killProcess(android.os.Process.myPid()); System.exit(0); ``` because android will handle processes automatically. Also exclude your app from recent isn't a correct behavior. By the way you can put under your "exit" activity tag in manifest: ``` android:excludeFr...
While mentioning tag in manifest we can keep ``` `android:`noHistory=true ``` so that mentioned activity wont be in back stack. For example: ``` <activity android:name="Splash_Activity" android:label="Splash" android:noHistory="true" /> ``` You can call just `finish()` to c...
21,998,887
I am trying to assign issues to epics using Jira's python API. From the documentation, I found there is an add\_issues\_to\_epic method in the GreenHopper class, but it doesn't seem to work for me. I have the following so far ``` from jira.client import JIRA from jira.client import GreenHopper jira = JIRA(options, ba...
2014/02/24
[ "https://Stackoverflow.com/questions/21998887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1521083/" ]
As @Vladimir Oselsky has mentioned, only looking at the execution plan will give you a definite answer. In this contrived example the CTE subselect will likely run twice.
In DB2, common table expressions should create the Common Table Expression Node in the execution plan (see the documentation [here](http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=/com.ibm.db2tools.oe.doc.ug/osc_commontableexpressionnode.htm)). This node explicitly says: > > They serve as inter...
14,009,850
I need to find a way to directly modify the private members of a class in Java through a getter function. I know I can do this in C++ using pointers like this; ``` class FooBar { private: Foo foo; public: Foo* getFoo() { return &foo; } } ``` Then I could directly ...
2012/12/23
[ "https://Stackoverflow.com/questions/14009850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1426469/" ]
What do you need can be accessed throught simply getter as was already shown. Some significant details: if you wanna somethink like ``` getFoo()->callFunction(); ``` be sure that: * *Foo* class is visible (*default* modifier if you are in the same package, *protected* if caller is subclass or *public* otherwise) ...
Java is *Pass by Value*, or more specifically, *Pass a Reference by Value*. This means all reference types are passed around such that: ``` List<String> a = myObj.getList(); a.add("My String"); // this modifies the source list List<String> b = new ArrayList<String>(); a = b; // this doesn't change the source list's r...
14,009,850
I need to find a way to directly modify the private members of a class in Java through a getter function. I know I can do this in C++ using pointers like this; ``` class FooBar { private: Foo foo; public: Foo* getFoo() { return &foo; } } ``` Then I could directly ...
2012/12/23
[ "https://Stackoverflow.com/questions/14009850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1426469/" ]
``` class FooBar { private Foo foo; public Foo getFoo() { return foo; } } ``` All object variables in Java are references to an object, so you can think of them as "locked" pointers. "Locked" in the sense that you can't do any pointer arithmetic with it.
What do you need can be accessed throught simply getter as was already shown. Some significant details: if you wanna somethink like ``` getFoo()->callFunction(); ``` be sure that: * *Foo* class is visible (*default* modifier if you are in the same package, *protected* if caller is subclass or *public* otherwise) ...
14,009,850
I need to find a way to directly modify the private members of a class in Java through a getter function. I know I can do this in C++ using pointers like this; ``` class FooBar { private: Foo foo; public: Foo* getFoo() { return &foo; } } ``` Then I could directly ...
2012/12/23
[ "https://Stackoverflow.com/questions/14009850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1426469/" ]
Since, Java doesn't have `Pointer`. But, you can do this, using **getter** and **setter**, it will help you like this ``` class myclass{ private myclass val; // private field //get the private field public myclass getVal(){ return val; } //set/change the member field value public void setVal(myclass val){ this.val=...
Java is *Pass by Value*, or more specifically, *Pass a Reference by Value*. This means all reference types are passed around such that: ``` List<String> a = myObj.getList(); a.add("My String"); // this modifies the source list List<String> b = new ArrayList<String>(); a = b; // this doesn't change the source list's r...
14,009,850
I need to find a way to directly modify the private members of a class in Java through a getter function. I know I can do this in C++ using pointers like this; ``` class FooBar { private: Foo foo; public: Foo* getFoo() { return &foo; } } ``` Then I could directly ...
2012/12/23
[ "https://Stackoverflow.com/questions/14009850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1426469/" ]
``` class FooBar { private Foo foo; public Foo getFoo() { return foo; } } ``` All object variables in Java are references to an object, so you can think of them as "locked" pointers. "Locked" in the sense that you can't do any pointer arithmetic with it.
You must provide a getter and a setter ``` class FooBar { private Foo foo; public Foo getFoo() { return foo; } public void setFoo(Foo foo) { this.foo = foo; } } ```
14,009,850
I need to find a way to directly modify the private members of a class in Java through a getter function. I know I can do this in C++ using pointers like this; ``` class FooBar { private: Foo foo; public: Foo* getFoo() { return &foo; } } ``` Then I could directly ...
2012/12/23
[ "https://Stackoverflow.com/questions/14009850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1426469/" ]
What do you need can be accessed throught simply getter as was already shown. Some significant details: if you wanna somethink like ``` getFoo()->callFunction(); ``` be sure that: * *Foo* class is visible (*default* modifier if you are in the same package, *protected* if caller is subclass or *public* otherwise) ...
Even in C++ this is a bad idea, because if the object becomes deallocated, your pointer will now point toward an invalid memory location. This is one of the reasons why you don't have pointer in Java; in order to protect the memory to be accessed from rogue pointers. Therefore, in Java, all the accesses to a private fi...
14,009,850
I need to find a way to directly modify the private members of a class in Java through a getter function. I know I can do this in C++ using pointers like this; ``` class FooBar { private: Foo foo; public: Foo* getFoo() { return &foo; } } ``` Then I could directly ...
2012/12/23
[ "https://Stackoverflow.com/questions/14009850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1426469/" ]
``` class FooBar { private Foo foo; public Foo getFoo() { return foo; } } ``` All object variables in Java are references to an object, so you can think of them as "locked" pointers. "Locked" in the sense that you can't do any pointer arithmetic with it.
Java is *Pass by Value*, or more specifically, *Pass a Reference by Value*. This means all reference types are passed around such that: ``` List<String> a = myObj.getList(); a.add("My String"); // this modifies the source list List<String> b = new ArrayList<String>(); a = b; // this doesn't change the source list's r...
14,009,850
I need to find a way to directly modify the private members of a class in Java through a getter function. I know I can do this in C++ using pointers like this; ``` class FooBar { private: Foo foo; public: Foo* getFoo() { return &foo; } } ``` Then I could directly ...
2012/12/23
[ "https://Stackoverflow.com/questions/14009850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1426469/" ]
In java your getter returns a reference to the object so you could rely on public methods of the returned object to mofify it. I can elaborate further if you detail what you want to do. As an example, If a getter returns a list, it would be possible for callers to modify the list using add or remove methods.
Even in C++ this is a bad idea, because if the object becomes deallocated, your pointer will now point toward an invalid memory location. This is one of the reasons why you don't have pointer in Java; in order to protect the memory to be accessed from rogue pointers. Therefore, in Java, all the accesses to a private fi...
14,009,850
I need to find a way to directly modify the private members of a class in Java through a getter function. I know I can do this in C++ using pointers like this; ``` class FooBar { private: Foo foo; public: Foo* getFoo() { return &foo; } } ``` Then I could directly ...
2012/12/23
[ "https://Stackoverflow.com/questions/14009850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1426469/" ]
In java your getter returns a reference to the object so you could rely on public methods of the returned object to mofify it. I can elaborate further if you detail what you want to do. As an example, If a getter returns a list, it would be possible for callers to modify the list using add or remove methods.
Java is *Pass by Value*, or more specifically, *Pass a Reference by Value*. This means all reference types are passed around such that: ``` List<String> a = myObj.getList(); a.add("My String"); // this modifies the source list List<String> b = new ArrayList<String>(); a = b; // this doesn't change the source list's r...
14,009,850
I need to find a way to directly modify the private members of a class in Java through a getter function. I know I can do this in C++ using pointers like this; ``` class FooBar { private: Foo foo; public: Foo* getFoo() { return &foo; } } ``` Then I could directly ...
2012/12/23
[ "https://Stackoverflow.com/questions/14009850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1426469/" ]
Since, Java doesn't have `Pointer`. But, you can do this, using **getter** and **setter**, it will help you like this ``` class myclass{ private myclass val; // private field //get the private field public myclass getVal(){ return val; } //set/change the member field value public void setVal(myclass val){ this.val=...
You must provide a getter and a setter ``` class FooBar { private Foo foo; public Foo getFoo() { return foo; } public void setFoo(Foo foo) { this.foo = foo; } } ```
14,009,850
I need to find a way to directly modify the private members of a class in Java through a getter function. I know I can do this in C++ using pointers like this; ``` class FooBar { private: Foo foo; public: Foo* getFoo() { return &foo; } } ``` Then I could directly ...
2012/12/23
[ "https://Stackoverflow.com/questions/14009850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1426469/" ]
Since, Java doesn't have `Pointer`. But, you can do this, using **getter** and **setter**, it will help you like this ``` class myclass{ private myclass val; // private field //get the private field public myclass getVal(){ return val; } //set/change the member field value public void setVal(myclass val){ this.val=...
What do you need can be accessed throught simply getter as was already shown. Some significant details: if you wanna somethink like ``` getFoo()->callFunction(); ``` be sure that: * *Foo* class is visible (*default* modifier if you are in the same package, *protected* if caller is subclass or *public* otherwise) ...
21,008,264
I am developing a custom telephony application that is able to receive calls. Using this code for handling the incoming call <https://code.google.com/p/auto-answer/source/browse/trunk/src/com/everysoft/autoanswer/AutoAnswerIntentService.java> Unfortunately my app loses focus on the incoming call. THIS was a partial ...
2014/01/08
[ "https://Stackoverflow.com/questions/21008264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/129899/" ]
Since the reference you made about outgoing calls is acceptable, then you can place an activity in front of the incoming call screen shortly after it displays. The difficulty in doing this is that the call state will change to "RINGING" and then also "OFFHOOK" but the phone has not displayed the InCallScreen when these...
Mention the below broadcast receiver in manifest.xml file. ``` <receiver android:name="com.example.incomingcall.IncomingCallReceiver" > <intent-filter> <action android:name="android.intent.action.PHONE_STATE" /> </intent-filter> </receiver> ``` IncomingCallReceiver.java: ``` public class...
17,481,719
I have to sign my `APK` and Google market provide me a key which is something like > > YOUR LICENSE KEY FOR THIS APPLICATION Base64-encoded RSA public key to > include in your binary. Please remove any spaces. > MIIBIjANBgasdfasdfdaskqhkiG9w0BAQEadfadfasdFAAOCAQ8AMIIBCgKCAQEAuacIf........ > > > How can I sign m...
2013/07/05
[ "https://Stackoverflow.com/questions/17481719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2526707/" ]
I too am like the original poster asked wondering what to do with the lisence key generated by the developer console on my way to publishing in the Google Play store. While all the above posts show how to export and create keystore etc in Eclipse or from a command line, none of them answer what the dadgum key Google o...
The Android Developer site has a great walkthrough for signing apps [here](http://developer.android.com/tools/publishing/app-signing.html#setup). Seeing as though you have your key, you just need to create a password-protected keystore file "`.keystore`" by using the keytool shown [here](http://developer.android.com/...
17,481,719
I have to sign my `APK` and Google market provide me a key which is something like > > YOUR LICENSE KEY FOR THIS APPLICATION Base64-encoded RSA public key to > include in your binary. Please remove any spaces. > MIIBIjANBgasdfasdfdaskqhkiG9w0BAQEadfadfasdFAAOCAQ8AMIIBCgKCAQEAuacIf........ > > > How can I sign m...
2013/07/05
[ "https://Stackoverflow.com/questions/17481719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2526707/" ]
I had the same question. Finally found that the RSA public key on Dev-Console is for "licensing". It means that the app can use the key to query if the user has a current and valid license for using your app or the services in it. **This is totally different from signing an apk.** <http://developer.android.com/google...
The Android Developer site has a great walkthrough for signing apps [here](http://developer.android.com/tools/publishing/app-signing.html#setup). Seeing as though you have your key, you just need to create a password-protected keystore file "`.keystore`" by using the keytool shown [here](http://developer.android.com/...
17,481,719
I have to sign my `APK` and Google market provide me a key which is something like > > YOUR LICENSE KEY FOR THIS APPLICATION Base64-encoded RSA public key to > include in your binary. Please remove any spaces. > MIIBIjANBgasdfasdfdaskqhkiG9w0BAQEadfadfasdFAAOCAQ8AMIIBCgKCAQEAuacIf........ > > > How can I sign m...
2013/07/05
[ "https://Stackoverflow.com/questions/17481719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2526707/" ]
I had the same question. Finally found that the RSA public key on Dev-Console is for "licensing". It means that the app can use the key to query if the user has a current and valid license for using your app or the services in it. **This is totally different from signing an apk.** <http://developer.android.com/google...
I too am like the original poster asked wondering what to do with the lisence key generated by the developer console on my way to publishing in the Google Play store. While all the above posts show how to export and create keystore etc in Eclipse or from a command line, none of them answer what the dadgum key Google o...
595,241
> > The time *rate of change* of the vector $\mathbf{G}$ as seen by > the two observers is then obtained by dividing the terms in Eq. > (4.81) by the differential time element $dt$ under consideration; > $$\bbox[yellow]{ > \left(\frac{d\mathbf{G}}{dt}\right)\_\text{space} > =\left(\frac{d\textbf{G}}{dt}\right)\_\tex...
2020/11/20
[ "https://physics.stackexchange.com/questions/595241", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/264772/" ]
Consider a any vector $\mathbf{B}$ that undergoes pure rotation around axis $\mathbf{\hat{n}}$ at rate $\Omega$. $$\frac{d\mathbf{B}}{dt}=\mathbf{\Omega}\times\mathbf{B}$$ which can be proved with elementary math (see Section 9.5.1 in Introduction to Mechanics Klepner). --- Consider any vector $\mathbf{C}$ that is ...
*Clarification added* *As Goldstein points out, only after the differentiation has been carried out in relationship (4.82) of the question, can the components be taken along another set of coordinate axes. That is ${d\vec G \over dt})\_{space}$ must be evaluated using space coordinates before it can be expressed in bo...
595,241
> > The time *rate of change* of the vector $\mathbf{G}$ as seen by > the two observers is then obtained by dividing the terms in Eq. > (4.81) by the differential time element $dt$ under consideration; > $$\bbox[yellow]{ > \left(\frac{d\mathbf{G}}{dt}\right)\_\text{space} > =\left(\frac{d\textbf{G}}{dt}\right)\_\tex...
2020/11/20
[ "https://physics.stackexchange.com/questions/595241", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/264772/" ]
You have two coordinate system , the inertial system index I, and the body fixed system index B, thus the components of a vector in I-system are: $$\left(\vec G\right)\_I=R\,\left(\vec G\right)\_B\tag 1$$ where $R$ is orthonormal transformation matrix between B-system and I-system the derivative of eq. (1) is: $$\fr...
*Clarification added* *As Goldstein points out, only after the differentiation has been carried out in relationship (4.82) of the question, can the components be taken along another set of coordinate axes. That is ${d\vec G \over dt})\_{space}$ must be evaluated using space coordinates before it can be expressed in bo...
3,445,192
I need to store in my object which values have already been handlerd, I am doubting what would cost more performance, should I create an array that stores: * The instance references (they are not structs, only ref classes) * The hashcode of the items * The name of the name of the properties (string) that have been han...
2010/08/10
[ "https://Stackoverflow.com/questions/3445192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/75500/" ]
**Storing references to the object seems like the easiest and lowest memory cost option**. If you're using this for a "has this been handled" check, the best option (for fastest checking) is probably to implement [Object.Equals](http://msdn.microsoft.com/en-us/library/system.object.equals.aspx) and [Object.GetHashCode...
.NET style hashcodes aren't an option unless the possible range of different values for your objects is less than 2^32, as otherwise you will get false-positives (and given the birthday paradox, this can happen more often than you might think even with a great hash function). Hashcodes give a quick link to a bucket of ...
32,670,136
I am making a file browser using JTree. I need to rename a directory (folder). So far I have succeeded in renaming the directory, but I can`t rename the node. This is what I have so far: ``` public TreePath findTreePath(File find) { for (int ii = 0; ii < tree.getRowCount(); ii++) { TreePath treePath = tre...
2015/09/19
[ "https://Stackoverflow.com/questions/32670136", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5353965/" ]
``` int mask = 0xFF; int result = (x & mask) | (y & (~mask)); ``` Is above helpful?
Why not use: ``` int result = (x & 0xFFULL) | (y & ~0xFFULL); ``` unsigned long long should be the biggest integer type on your platform, and the calculation will work for any smaller integer type. Doing it with non-integer types would be intrinsically type- and platform-dependent, and is probably a bad idea.
316,498
Can someone give me an intuitive example (best would be using a discrete coin toss generator but Brownian Motion would also do) of a stochastic process that is a martingale with respect to a filtration $F\_1$, but not a martingale with respect to a larger filtration $F\_2$ (s.t. $F\_1 \subset F\_2$). Thanks!
2013/02/28
[ "https://math.stackexchange.com/questions/316498", "https://math.stackexchange.com", "https://math.stackexchange.com/users/61787/" ]
Let $(B\_t)\_{t \geq 0}$ be a Brownian motion, then $(B\_t)\_{t \geq 0}$ is a martingale with respect to the natural filtration $$\mathcal{F}\_t := \sigma(B\_s; s \leq t).$$ In contrast, for $\mathcal{G}\_t := \mathcal{F}\_{2t}$ the process $(B\_t,\mathcal{G}\_t)\_{t \geq 0}$ is *not* a martingale since $$\mathbb{E}(B\...
Here is a typical example. Take a Brownian Motion $W\_t$ within its natural completed filtration $\mathcal{F}\_t$ for $t\in [0,1]$. Then let's take $\mathcal{G}\_t$ the augmented the filtration of $\mathcal{F}\_t$ in the following way : $$\forall t\in [0,1]~;~ \mathcal{G}\_t =\mathcal{F}\_t\vee \sigma(W\_1)$$ The...
46,852,751
I know there exists the [LEAVE](http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000202782.htm) statement for data step DO loops to terminate the current loop. I cannot find, however, documentation for a corresponding macro command. I've tried `%LEAVE` but that appears not to be defi...
2017/10/20
[ "https://Stackoverflow.com/questions/46852751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5065796/" ]
No, unfortunately there is no equivalent of `leave` in the macro language (as of v9.4). You can see a complete list of macro statements in the documentation in the [Macro Language Dictionary](http://documentation.sas.com/?docsetId=mcrolref&docsetTarget=p0rmrcca06xibcn1w7eynijd7ir7.htm&docsetVersion=9.4&locale=en). As...
If you want to break out of a macro completely, you can use `%abort` (if you want to trigger an error) or `%return` (if you don't). These won't help if you just want to break out of a loop and carry on with the rest of your macro, but you could potentially write a loop as a separate macro and call it inside a larger ma...
46,852,751
I know there exists the [LEAVE](http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000202782.htm) statement for data step DO loops to terminate the current loop. I cannot find, however, documentation for a corresponding macro command. I've tried `%LEAVE` but that appears not to be defi...
2017/10/20
[ "https://Stackoverflow.com/questions/46852751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5065796/" ]
I generally use a %GOTO for breaking out of a macro loop, if a %RETURN statement is not an option. And I sometimes also use a GOTO for leaving a datastep loop, because: the most CPU-efficient way of programming depends on being able to leave not just the current loop, but the loop surrounding that as well. Until you c...
If you want to break out of a macro completely, you can use `%abort` (if you want to trigger an error) or `%return` (if you don't). These won't help if you just want to break out of a loop and carry on with the rest of your macro, but you could potentially write a loop as a separate macro and call it inside a larger ma...
58,820,187
I have some on page script that produces a constant `ReferenceError: $ is not defined` error. The jQuery is loaded at the bottom of the html page just before the tag. I have added a DOM listener so the code can wait for the JQuery load. Can you see anything wrong, code is bellow. Webpack config: ``` new webpack.Prov...
2019/11/12
[ "https://Stackoverflow.com/questions/58820187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10814553/" ]
Make sure you have added jQuery `<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>` This could be in the HEAD or in the footer of the page, just make sure you load it before you try to call any other jQuery stuff. If it still gives you error, try to add `var $ = jQuery`. It shou...
This isn't the solution but can help you determine if the problem is coming because jQuery hasn't yet loaded or not, if the second console log still doesn't show up then the problem is related to something else. I delayed the execution of the code by 5 seconds which is largely enough for jquery to load before your code...
58,820,187
I have some on page script that produces a constant `ReferenceError: $ is not defined` error. The jQuery is loaded at the bottom of the html page just before the tag. I have added a DOM listener so the code can wait for the JQuery load. Can you see anything wrong, code is bellow. Webpack config: ``` new webpack.Prov...
2019/11/12
[ "https://Stackoverflow.com/questions/58820187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10814553/" ]
Make sure you have added jQuery `<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>` This could be in the HEAD or in the footer of the page, just make sure you load it before you try to call any other jQuery stuff. If it still gives you error, try to add `var $ = jQuery`. It shou...
So it seems that jQuery is not available due to Webpack settings. After some research i found an answer that helped solve the error: <https://stackoverflow.com/a/46937798/10814553> Install expose-loader: `npm install expose-loader --save-dev` and add this to webpack.config.js ``` module: { rules: [ ...
58,820,187
I have some on page script that produces a constant `ReferenceError: $ is not defined` error. The jQuery is loaded at the bottom of the html page just before the tag. I have added a DOM listener so the code can wait for the JQuery load. Can you see anything wrong, code is bellow. Webpack config: ``` new webpack.Prov...
2019/11/12
[ "https://Stackoverflow.com/questions/58820187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10814553/" ]
So it seems that jQuery is not available due to Webpack settings. After some research i found an answer that helped solve the error: <https://stackoverflow.com/a/46937798/10814553> Install expose-loader: `npm install expose-loader --save-dev` and add this to webpack.config.js ``` module: { rules: [ ...
This isn't the solution but can help you determine if the problem is coming because jQuery hasn't yet loaded or not, if the second console log still doesn't show up then the problem is related to something else. I delayed the execution of the code by 5 seconds which is largely enough for jquery to load before your code...
3,942,893
I was wondering how extensive your knowledge of php should be to write a decent wordpress plugin? Can you create a wordpress plugin with just basic knowledge and little experience with the language? thanks.
2010/10/15
[ "https://Stackoverflow.com/questions/3942893", "https://Stackoverflow.com", "https://Stackoverflow.com/users/458683/" ]
If you can write a script that does something you can write a wordpress plugin. Examine existing WP plugins to get the structure right and some inspiration. I started just by recreating existing ones from scratch to get a feel for it. ``` <?php /* Plugin Name: My Plugin Plugin URI: http://foobar.co.uk/ Description: A...
There are some great tutorials online to help any level of experience: <http://net.tutsplus.com/tutorials/wordpress/creating-a-custom-wordpress-plugin-from-scratch/>
3,942,893
I was wondering how extensive your knowledge of php should be to write a decent wordpress plugin? Can you create a wordpress plugin with just basic knowledge and little experience with the language? thanks.
2010/10/15
[ "https://Stackoverflow.com/questions/3942893", "https://Stackoverflow.com", "https://Stackoverflow.com/users/458683/" ]
The more you will know PHP, the easier it will be to develop great plugins, but an expensive knowledge of the language is not required. You can start a plugin with low PHP skills. But when it will come to devlop and debug a 5000 lines plugin, a deep understanding of the WP API -and of PHP- will be almost mandatory. Y...
There are some great tutorials online to help any level of experience: <http://net.tutsplus.com/tutorials/wordpress/creating-a-custom-wordpress-plugin-from-scratch/>
14,969,859
I apologize for such a simple question, but I've been working on fixing this code for several hours now and I can't make any headway. I have a project that calls for the usage of three classes: a customer, a employee, and a customer group. The classes are populated from file (.csv) and are then dumped back onto consol...
2013/02/19
[ "https://Stackoverflow.com/questions/14969859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2088808/" ]
Follow these steps: 1. Change the console window font to *Lucida Console* for both when debugging / not debugging. 2. Execute the following code: ``` public static void Main(String[] args) { Console.OutputEncoding = System.Text.Encoding.GetEncoding("Cyrillic"); Console.InputEncoding = System.Text.Encoding.Get...
This seems like a complete overkill for C# but it worked for me: ``` using System.Runtime.InteropServices; [DllImport("kernel32.dll", SetLastError = true)] static extern IntPtr GetStdHandle(int nStdHandle); [DllImport("kernel32.dll")] static extern bool ReadConsoleW(IntPtr hConsoleInput, [Out] byte[] lpBuffer, u...