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
47,046,023
[JSON for Modern C++](https://github.com/nlohmann/json) uses the following syntax: ``` json j = "{ \"happy\": true, \"pi\": 3.141 }"_json; ``` and I was wondering how they are accomplishing this. I don't understand the string literal \_ json syntax.
2017/10/31
[ "https://Stackoverflow.com/questions/47046023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2887872/" ]
C++11 added [user defined literals](http://en.cppreference.com/w/cpp/language/user_literal) to the language. Defining a user defined string literal would look like so: ``` MyType operator"" _my_udl(char const*, std::size_t); ``` It works almost exactly like a regular function call. When you have `"some string"_my_ud...
On the docs for [JSON for Modern C++](https://github.com/nlohmann/json): (serialisation / deserialisation) Note that without appending the \_json suffix, the passed string literal is not parsed, but just used as JSON string value. That is, json j = "{ \"happy\": true, \"pi\": 3.141 }" would just store the string "{ "...
2,513,832
I am writing an application to listen the `SMS inbox` in Android with one `Activity` and one `BroadcastReceiver`. Once the SMS comes the Receiver is showing Alert message... But i want to send the message information from Receiver to Activity. I don't know how to achieve this. Anybody knows it please help me.....
2010/03/25
[ "https://Stackoverflow.com/questions/2513832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/131062/" ]
> > I am writing an application to listen > the SMS inbox in android with one > activity and one BroadcastReceiver. > > > [Please do not do this](http://www.androidguys.com/2009/12/14/code-pollution-reaching-past-the-sdk/). This is not part of the Android SDK. Your application will break on some phones. Your app...
You can add 'extras' to the [`Intent`](http://developer.android.com/reference/android/content/Intent.html) you use to start the `Activity` using the [`putExtra`](http://developer.android.com/reference/android/content/Intent.html#putExtra) methods and retrieve the values using the [`getExtras`](http://developer.android....
70,560,930
I am using executer service to run task in parallel . The parallel running method takes input integer and returns integer . As parallel task has return type , so I have used Callable anonymous class . You can see in below example `ExecutorServiceExample task(int i )` is called from executer . The task method also has w...
2022/01/03
[ "https://Stackoverflow.com/questions/70560930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2845414/" ]
In fact, every task produced an `IllegalMonitorStateException` because you did not call `wait` method in a `synchronized` block: [IllegalMonitorStateException on wait() call](https://stackoverflow.com/questions/1537116/illegalmonitorstateexception-on-wait-call). Maybe you should use `sleep` instead of `wait`. `Executi...
I don't know why you designed it like this. But obviously, it has many problems. `i/7==0 or i % 7 ==0`? `examples` aren't locks, so why use wait? the futures that the returns of 'invokeAll' are must be done but maybe get an exception when invoke get. Is this what you want? ``` import java.util.List; import java.util.c...
42,421,768
As per the [API](http://docs.oracle.com/javase/7/docs/api/java/io/RandomAccessFile.html#seek(long)), these are the facts: * The `seek(long bytePosition)` method simply put, moves the pointer to the position specified with the `bytePosition` parameter. * When the `bytePosition` is greater than the file length, the file...
2017/02/23
[ "https://Stackoverflow.com/questions/42421768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4743373/" ]
When you write 100,000 bytes to a `BufferedOutputStream`, your program is explicitly accessing each byte of the file and writing a zero. When you use a `RandomAccessFile.seek()` on a local file, you are indirectly using the C system call `fseek()`. How that gets handled depends on the operating system. In most modern...
Your operating system and filesystem support *sparse files* and when it's the case, *seek* is implemented to make use of this feature. This is not really related to Java, it's just a feature of `fseek` and `fwrite` functions from C library, which are most likely the backend behind File implementation on the JRE you ar...
1,230,471
Gnome has a system monitor panel applet that can be seen even when all your windows are maximized: [![enter image description here](https://i.stack.imgur.com/P8Ifv.png)](https://i.stack.imgur.com/P8Ifv.png) Is there anything similar for Xubuntu / XFCE?
2020/04/24
[ "https://askubuntu.com/questions/1230471", "https://askubuntu.com", "https://askubuntu.com/users/121652/" ]
You can install **[Multiload-ng](https://github.com/udda/multiload-ng)** or **[XFCE4-hardware-monitor-plugin](https://goodies.xfce.org/projects/panel-plugins/xfce4-hardware-monitor-plugin)** as **all-in-one** solution. Also some separate solutions are in the **[xfce4-goodies](https://docs.xfce.org/xfce/xfce4-panel/star...
Try using [Multiload-ng](https://udda.github.io/multiload-ng/), it is a bit old but it works on Xubuntu 20.04. You will need to compile it yourself tho.
1,230,471
Gnome has a system monitor panel applet that can be seen even when all your windows are maximized: [![enter image description here](https://i.stack.imgur.com/P8Ifv.png)](https://i.stack.imgur.com/P8Ifv.png) Is there anything similar for Xubuntu / XFCE?
2020/04/24
[ "https://askubuntu.com/questions/1230471", "https://askubuntu.com", "https://askubuntu.com/users/121652/" ]
You can install **[Multiload-ng](https://github.com/udda/multiload-ng)** or **[XFCE4-hardware-monitor-plugin](https://goodies.xfce.org/projects/panel-plugins/xfce4-hardware-monitor-plugin)** as **all-in-one** solution. Also some separate solutions are in the **[xfce4-goodies](https://docs.xfce.org/xfce/xfce4-panel/star...
Sure there are. System Load Monitor, CPU Graph and Network Monitor are panel plugins of Xfce. They can be installed as dependencies by installing xfce4-goodies package. And you add the panel items by first right-clicking on panel or by using Panel dialog.
236,260
Now, I know that pyrokinesis is an actual thing in the *Star Wars* universe. I know that Force-users can manipulate fire to their advantage. But can they do the "create fire out of nothing" type of pyrokinesis? Since Force-users can manipulate things on a molecular & subatomic level, I've been thinking that a Force-us...
2020/08/23
[ "https://scifi.stackexchange.com/questions/236260", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/-1/" ]
Within the main canon there don't appear to be any examples of this, although Wookieepedia does label Palpatine's energy rope thing as "[fiery energy](https://starwars.fandom.com/wiki/Fiery_energy)". It seems highly debatable whether this counts or. Within the EU we see this power on multiple occasions. **Leia uses t...
**Star Wars: The Clone Wars:** In the episode "Massacre," Nightsister Mother Talzin waves her hand and appears to start a fire from apparently nothing. [![enter image description here](https://i.stack.imgur.com/HNCr1.png)](https://i.stack.imgur.com/HNCr1.png) [![enter image description here](https://i.stack.imgur.co...
62,539,867
I am trying to make a JFrame that closes after 10 seconds after openning. I know that you can use `setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)` , but you need to manually click to close the frame. If you could help me with some codelines. Thanks!
2020/06/23
[ "https://Stackoverflow.com/questions/62539867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13459535/" ]
**@EnableSwagger2 was removed in swagger 2.10.x, but from 3.x.x it is there again.** **@EnableSwagger2WebMvc is deprecated in 3.0.0+** Funny but true :) --- Optionally you can use following dependency with Spring 5 MVC ``` <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-boot-starter</art...
``` @Configuration @EnableSwagger2WebMvc @Import({SpringDataRestConfiguration.class, BeanValidatorPluginsConfiguration.class}) public class ApplicationSwaggerConfig { @Bean public Docket schoolApi() { return new Docket(DocumentationType.SWAGGER_2). select(). apis(Request...
144,591
I would like to install the inet manager for Windows 7, but I get a message that I need to install the IIS management console first, and I can't figure out how. So, how do I install the IIS Management Console on my Windows 7 Home Basic edition machine?
2010/05/24
[ "https://superuser.com/questions/144591", "https://superuser.com", "https://superuser.com/users/-1/" ]
> > How can i install Management Consol in my machine. > > > Upgrade to Windows 7 Home Premium and then install the Management Console. See [here](http://technet.microsoft.com/en-us/library/cc753473.aspx) for this justification.
Now you can also use WebMatrix which includes IIS Developer Express and will give you a simpler Management experience and the full functionality of IIS 7.5 even for Starter and Basic editions (including XP). Its only 8 MB and free: <http://www.microsoft.com/web/webmatrix/>
144,591
I would like to install the inet manager for Windows 7, but I get a message that I need to install the IIS management console first, and I can't figure out how. So, how do I install the IIS Management Console on my Windows 7 Home Basic edition machine?
2010/05/24
[ "https://superuser.com/questions/144591", "https://superuser.com", "https://superuser.com/users/-1/" ]
> > How can i install Management Consol in my machine. > > > Upgrade to Windows 7 Home Premium and then install the Management Console. See [here](http://technet.microsoft.com/en-us/library/cc753473.aspx) for this justification.
Apart from upgrading Windows, you can also use the free [Apache](http://www.apache.org/) web server. See [Using Apache With Microsoft Windows](http://httpd.apache.org/docs/2.0/platform/windows.html).
144,591
I would like to install the inet manager for Windows 7, but I get a message that I need to install the IIS management console first, and I can't figure out how. So, how do I install the IIS Management Console on my Windows 7 Home Basic edition machine?
2010/05/24
[ "https://superuser.com/questions/144591", "https://superuser.com", "https://superuser.com/users/-1/" ]
Now you can also use WebMatrix which includes IIS Developer Express and will give you a simpler Management experience and the full functionality of IIS 7.5 even for Starter and Basic editions (including XP). Its only 8 MB and free: <http://www.microsoft.com/web/webmatrix/>
Apart from upgrading Windows, you can also use the free [Apache](http://www.apache.org/) web server. See [Using Apache With Microsoft Windows](http://httpd.apache.org/docs/2.0/platform/windows.html).
14,959,088
I'm not that good OO design .. so please bear with me.. I have Class A, And 2 classes which extend A. But both of them have same fields.. So what is better, to have getter / setters in A or to have same getter / setters in both child classes.. Or is there a better a way to do this..? this is what i have done (mock).....
2013/02/19
[ "https://Stackoverflow.com/questions/14959088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/746710/" ]
This depends on the classes If those properties are a property of A then yes, if it's just chance they have the same properties then no. Basicly the question you need to ask yourself is, will there ever be a class that extends A that doesn't need those properties. If the answer is no, put them on A, If the answer...
Let's say your classes are `A` (the parent) and `B` and `C` (the children). You say that `B` and `C` have some fields that are the same. Ask yourself: If you had another class `D`, child of `A`, would it have those fields too regardless of its specific functionality? * If the answer is yes, then the existence of the...
56,614,879
The problem is to get the list of first element of each tuple in a list. Erlang is giving me a hard time. How do I add elements dynamically in a list in erlang? ``` I tried to read the list of tuples and store it into another list to get the first element of each tuple in the list. getBankList([BankData|T]) -> ...
2019/06/15
[ "https://Stackoverflow.com/questions/56614879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6557901/" ]
If you have ``` List = [{jill,450}, {joe,157}, {bob,100}, {sue,125}, {pat,344}] ``` then ``` [Name || {Name, _} <- List] ``` will get `[jill, joe, bob, sue, pat]`. This is *list comprehension*, read more about it [here](http://erlang.org/doc/programming_examples/list_comprehensions.html).
If you haven't covered list comprehensions yet, here is how to solve your problem with simple recursion: ``` -module(my). -compile([export_all]). firsts([]) -> []; firsts([Tuple|Tuples]) -> {Name, _Amount} = Tuple, [Name | firsts(Tuples)]. ``` Instead of your `createList()` function (and by the way, the con...
56,614,879
The problem is to get the list of first element of each tuple in a list. Erlang is giving me a hard time. How do I add elements dynamically in a list in erlang? ``` I tried to read the list of tuples and store it into another list to get the first element of each tuple in the list. getBankList([BankData|T]) -> ...
2019/06/15
[ "https://Stackoverflow.com/questions/56614879", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6557901/" ]
You can use the [`lists:unzip/1` function](http://erlang.org/doc/man/lists.html#unzip-1) to split a list of pair tuples into a tuple of two lists, one for the first elements and one for the second elements: ``` {Names, _Amounts} = lists:unzip([{jill,450}, {joe,157}, {bob,100}, {sue,125}, {pat,344}]). ``` The resulti...
If you haven't covered list comprehensions yet, here is how to solve your problem with simple recursion: ``` -module(my). -compile([export_all]). firsts([]) -> []; firsts([Tuple|Tuples]) -> {Name, _Amount} = Tuple, [Name | firsts(Tuples)]. ``` Instead of your `createList()` function (and by the way, the con...
55,621,031
Is it possible to combinate "normal points" and "bubble points"? I have two sets of data - file1.txt and file2.txt and for one of them (file2.txt) I would like to use points like <http://gnuplot-tricks.blogspot.com/2009/06/> How to compose this into code please? When I use the code from that webpage how to plot anothe...
2019/04/10
[ "https://Stackoverflow.com/questions/55621031", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11019321/" ]
Here is a variant of the "trick" shown in your [second link](http://gnuplot-tricks.blogspot.com/2009/09/bubble-graphs-in-gnuplot-once-more.html). I have extracted the customized point styles into a pre-defined set of linetypes. This makes the plot command itself simpler, and it is easier to reuse the definitions in mul...
Please clarify what exactly what properties your plot needs to have. (1) The term "bubble plot" usually refers to a plot in which each point is drawn as a circle with additional properties encoded by changing the size, color, or other property of the circle. Gnuplot can do that quite well. A good example can be found...
2,572,664
i made a windows service & add project installer.in which only contain this code. System.Diagnostics.Process.Start(@"C:\Windows\system32\notepad.exe"); inside the timer tick event & interval is 60 sec.i just wanted to try to run Windows service. **1st-serviceProcessInstaller1 i have been changed its account setting as...
2010/04/03
[ "https://Stackoverflow.com/questions/2572664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/307989/" ]
Not the answer to your original question, but * Starting an application with a GUI from a service is a bad idea (tm) and won't work in the majority of cases * Check what kind of Timer you use. .Net provides 3 Timer classes, not all of them work in a service (because they depend on a window's message loop, iirc) To te...
I'd suggest trying to install the assembly manually to see if you get any kind of error message. Just open a Visual Studio command prompt and run `InstallUtil.exe [YourService].exe`. At least you'll know if it installed properly.
2,572,664
i made a windows service & add project installer.in which only contain this code. System.Diagnostics.Process.Start(@"C:\Windows\system32\notepad.exe"); inside the timer tick event & interval is 60 sec.i just wanted to try to run Windows service. **1st-serviceProcessInstaller1 i have been changed its account setting as...
2010/04/03
[ "https://Stackoverflow.com/questions/2572664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/307989/" ]
Not the answer to your original question, but * Starting an application with a GUI from a service is a bad idea (tm) and won't work in the majority of cases * Check what kind of Timer you use. .Net provides 3 Timer classes, not all of them work in a service (because they depend on a window's message loop, iirc) To te...
Even better option is to use the command line tool sc.exe Try "sc create /?" on command line and see its options. You can then use "sc start " , "sc stop " & "sc query " to control service. You can use sc.exe to send custom command to the service. Check windows event log for errors related to service installation. It m...
2,572,664
i made a windows service & add project installer.in which only contain this code. System.Diagnostics.Process.Start(@"C:\Windows\system32\notepad.exe"); inside the timer tick event & interval is 60 sec.i just wanted to try to run Windows service. **1st-serviceProcessInstaller1 i have been changed its account setting as...
2010/04/03
[ "https://Stackoverflow.com/questions/2572664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/307989/" ]
I'd suggest trying to install the assembly manually to see if you get any kind of error message. Just open a Visual Studio command prompt and run `InstallUtil.exe [YourService].exe`. At least you'll know if it installed properly.
Even better option is to use the command line tool sc.exe Try "sc create /?" on command line and see its options. You can then use "sc start " , "sc stop " & "sc query " to control service. You can use sc.exe to send custom command to the service. Check windows event log for errors related to service installation. It m...
67,859,694
My problem is that when I press the button paragraph's text should be hide and will show "Click to see more" and again pressing the same button the paragraph's text should be visible.
2021/06/06
[ "https://Stackoverflow.com/questions/67859694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15985031/" ]
1. Set **parent\_name\_1** as index. 2. Transpose the dataframe 3. Convert it to **dict** ignoring the new index after the transpose ***parent\_1, parent\_2, parent\_3*** using **to\_dict(orient="list")**. `cat = travel_df.set_index("parent_name_1").T.to_dict(orient="list")`
I don't know if it is the best way, but you can try: ``` import pandas if __name__ == "__main__": xls = pandas.read_excel("test.xls") data = {xls.iloc[i][0]: list(xls.iloc[i][1:].values) for i in range(len(xls))} ``` Assuming that your first column has **unique** keys.
67,859,694
My problem is that when I press the button paragraph's text should be hide and will show "Click to see more" and again pressing the same button the paragraph's text should be visible.
2021/06/06
[ "https://Stackoverflow.com/questions/67859694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15985031/" ]
1. Set **parent\_name\_1** as index. 2. Transpose the dataframe 3. Convert it to **dict** ignoring the new index after the transpose ***parent\_1, parent\_2, parent\_3*** using **to\_dict(orient="list")**. `cat = travel_df.set_index("parent_name_1").T.to_dict(orient="list")`
Maybe there is a better function to do this directly, but I couldn't find it... But the `df.to_dict('split')` gets something that helps, and is easy enough to finish the way. This is what split gives us: ``` {'index': [0, 1, 2, 3], 'columns': ['parent_name_1', 'parent_name_2', 'parent_name_3'], 'data': [['A1', 'B1',...
67,859,694
My problem is that when I press the button paragraph's text should be hide and will show "Click to see more" and again pressing the same button the paragraph's text should be visible.
2021/06/06
[ "https://Stackoverflow.com/questions/67859694", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15985031/" ]
1. Set **parent\_name\_1** as index. 2. Transpose the dataframe 3. Convert it to **dict** ignoring the new index after the transpose ***parent\_1, parent\_2, parent\_3*** using **to\_dict(orient="list")**. `cat = travel_df.set_index("parent_name_1").T.to_dict(orient="list")`
```py import pandas as pd my_data = pd.DataFrame({ 'A': ['A1', 'A2', 'A3', 'A4'], 'B': ['B1', 'B2', 'B3', 'B4'], 'C': ['C1', 'C2', 'C3', 'C4'] }) result = my_data.set_index('A').to_dict('index') {key: list(value.values()) for key, value in result.items()} ``` #### Result Object: ``` {'A1': {'B': 'B1',...
16,737,895
Let's say I have two json objects, one of users and one of accounts, something like: ```js users = [ {id: 1, account_id: 1}, {id: 2, account_id: 2}, {id: 3, account_id: 1} ] accounts = [ {id: 1, name: "administrator"}, {id: 2, name: "moderator"} ] ``` So I have to loop accross all the users array, and for...
2013/05/24
[ "https://Stackoverflow.com/questions/16737895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1164011/" ]
If you really don't like the thought of changing the shape of the data coming from the server, another option is to just map the users to accounts in javascript. ``` app.controller("MyController", function($scope) { // Pretend that 'users' and 'accounts' here came from an xhr request var users = [ {id: 1, acc...
I faced the same problem and decided it was not the front-end job to perform data mapping. So instead of returning on account\_id like: ``` users = [ {id: 1, account_id: 1}, {id: 2, account_id: 2}, {id: 3, account_id: 1} ] ``` I extended the model with "account\_name" (or whatever the equivalent for me) ...
9,724,284
I have the following code: ``` $(serialNumbersDDL).children("option:gt(0)").remove(); ``` It will delete all the options except the first one. Now I need to delete all the options except the first one and also not delete the option whose value is equal to the label text. How can I say that with writing limited amou...
2012/03/15
[ "https://Stackoverflow.com/questions/9724284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3797/" ]
try ``` $("option:not(':first')",serialNumbersDDL).filter(function(){ return $(this).val()!=$(this).text(); }).remove(); ```
I'd try ``` $(serialNumbersDDL).children("option:gt(0)").not(function(){ return $(this.labels).text() == this.value; }).remove(); ```
838,648
Can someone tell me how to prove the folowing equalty : $$\prod\_{k=0}^{n-1}e^{\frac{2\pi i k}{n}}=(-1)^{n-1}\;\;\; n\in\mathbb{N}^\*.$$ Thanks in advance.
2014/06/18
[ "https://math.stackexchange.com/questions/838648", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
I will answer my question We have : $$\prod\_{k=0}^{n-1}e^{\frac{2\pi i k}{n}}=e^{\frac{2\pi i }{n}\frac{n(n-1)}{2}}=e^{\pi i (n-1)}=\cos((n-1)\pi)=(-1)^{n-1}.$$
Consider the polynomial $x^n-1$. Vieta's formula says that $-1=(-1)^n z\_1\cdots z\_n$ where the $z\_i$ are the roots of the polynomial. What are these roots?
32,361,846
I have a method being called constantly. I want the method to have the following: ``` if(screen is being touched) { Do this } else { Do this } ``` Another way to phrase the question is that I want something to happen as long as the screen is being touched not just something to happen onetime as soon as the screen h...
2015/09/02
[ "https://Stackoverflow.com/questions/32361846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5289849/" ]
One possible way to accomplish your desired result: try put a View on top of your view hierarchy, set it the same size of the screen, then override the `setPressed()` method of the view. If pressed, do something, if not, do something else: ``` @Override public void setPressed(boolean pressed) { if (pre...
Try using `onTouchListener()` and implementing `onTouch(View v, MotionEvent e)` to check for the events `ACTION_UP` and `ACTION_DOWN`. Implementation example: [Touch Release method in Android](https://stackoverflow.com/questions/5765904/touch-release-method-in-android) Edit: Reading over some of your discussions wit...
32,361,846
I have a method being called constantly. I want the method to have the following: ``` if(screen is being touched) { Do this } else { Do this } ``` Another way to phrase the question is that I want something to happen as long as the screen is being touched not just something to happen onetime as soon as the screen h...
2015/09/02
[ "https://Stackoverflow.com/questions/32361846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5289849/" ]
You can use something like this code ``` view.setOnTouchListener(new OnTouchListener () { public boolean onTouch(View view, MotionEvent event) { switch(event.getAction()) { case MotionEvent.ACTION_DOWN: // The user just touched the screen break; case...
Try using `onTouchListener()` and implementing `onTouch(View v, MotionEvent e)` to check for the events `ACTION_UP` and `ACTION_DOWN`. Implementation example: [Touch Release method in Android](https://stackoverflow.com/questions/5765904/touch-release-method-in-android) Edit: Reading over some of your discussions wit...
32,361,846
I have a method being called constantly. I want the method to have the following: ``` if(screen is being touched) { Do this } else { Do this } ``` Another way to phrase the question is that I want something to happen as long as the screen is being touched not just something to happen onetime as soon as the screen h...
2015/09/02
[ "https://Stackoverflow.com/questions/32361846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5289849/" ]
You can use something like this code ``` view.setOnTouchListener(new OnTouchListener () { public boolean onTouch(View view, MotionEvent event) { switch(event.getAction()) { case MotionEvent.ACTION_DOWN: // The user just touched the screen break; case...
One possible way to accomplish your desired result: try put a View on top of your view hierarchy, set it the same size of the screen, then override the `setPressed()` method of the view. If pressed, do something, if not, do something else: ``` @Override public void setPressed(boolean pressed) { if (pre...
32,361,846
I have a method being called constantly. I want the method to have the following: ``` if(screen is being touched) { Do this } else { Do this } ``` Another way to phrase the question is that I want something to happen as long as the screen is being touched not just something to happen onetime as soon as the screen h...
2015/09/02
[ "https://Stackoverflow.com/questions/32361846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5289849/" ]
One possible way to accomplish your desired result: try put a View on top of your view hierarchy, set it the same size of the screen, then override the `setPressed()` method of the view. If pressed, do something, if not, do something else: ``` @Override public void setPressed(boolean pressed) { if (pre...
After reading Lamorak's answer I did something very similar. I had a onTouch method with the following: ``` @Override public boolean onTouch(View v, MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: bool = true; break; case MotionEvent.ACTION_UP...
32,361,846
I have a method being called constantly. I want the method to have the following: ``` if(screen is being touched) { Do this } else { Do this } ``` Another way to phrase the question is that I want something to happen as long as the screen is being touched not just something to happen onetime as soon as the screen h...
2015/09/02
[ "https://Stackoverflow.com/questions/32361846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5289849/" ]
You can use something like this code ``` view.setOnTouchListener(new OnTouchListener () { public boolean onTouch(View view, MotionEvent event) { switch(event.getAction()) { case MotionEvent.ACTION_DOWN: // The user just touched the screen break; case...
After reading Lamorak's answer I did something very similar. I had a onTouch method with the following: ``` @Override public boolean onTouch(View v, MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: bool = true; break; case MotionEvent.ACTION_UP...
277,786
The initial value problem is : $$P'(t)=0.7P(t)(1-\frac{P(t)}{750})-20, P(0)=30$$ The time step is set to $Δt=7$ days For the algorithm we have: $f(t,P)=0.7P(1-\frac{P}{750})-20$ with step $h=7$ $t\_0=0$. Euler's method reads in this case $$ P\_0 = 30, \quad P\_{i+1} = P\_i + h \left( 0.7 P\_i \left(1- \frac{P\_i}...
2022/12/26
[ "https://mathematica.stackexchange.com/questions/277786", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/88548/" ]
In this example *data* is cleared in advance for reruns. `Clear[name]` clears *name* not *data* so `Apply` is used. ``` filename = "data.txt"; name = First[StringSplit[filename, "."]]; Apply[Clear, List[name]] With[{x = ToExpression[name]}, x = Import[filename, "Lines"]] data ``` > > 1,2,3 > > > You can also u...
I would suggest two aspects of your code: (1) don't encode information in variable names, as commented above, and (2) don't read everything in a `Do` loop but rather lazy-read on demand. Concretely, using a memoizing field `data`: ``` data[name_String] := data[name] = Import[name, "Lines"] ``` In this way, every tim...
10,031,198
Like the title says, I need a way to detect if the build is in adhoc, release or distribution since I am using keychain-access-groups for each type of build I am using a different provisiong so the bundle seed id are different. I just need an effective way to switch this on certain build.
2012/04/05
[ "https://Stackoverflow.com/questions/10031198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/175027/" ]
Go to the target you want to test, then build settings and search for preprocessing and you should see something like this: ![enter image description here](https://i.stack.imgur.com/japIJ.png) As you can see debug already has a value. You can enter RELEASE=1 if you want to check for a release build. Then in your code...
Maybe you can use a Custom Build Setting (aka define), which will have different values in different build configurations?
188,571
Here is an issue that thoroughly confuses me. I hope I can express it in a way that is clear cut enough for this site. Let $G$ be a real reductive Lie group and $\mathfrak{g}$ be the complexification of its Lie algebra. (We work with complexifications since we are interested in complex representations.) Let $P$ be a m...
2014/12/02
[ "https://mathoverflow.net/questions/188571", "https://mathoverflow.net", "https://mathoverflow.net/users/41139/" ]
I don't know whether this helps, but there is a nice description of the relation between the two modules in geometric terms. The principal series representation can be viewed as the space of smooth sections of the homogeneous line bundle $E$ over $G/P$ induced by the representation $\lambda$ of $P$. Then you can form t...
In the paper David A. Vogan, .“Gelfand-Kirillov dimension for Harish-Chandra modules,” Inventiones math.48(1978), 75–98. You find a proof that for a given (g,K)-module V, the algebraic dual of V contains a Verma module Z, so that the natural pairing VxZ---->C is non-degenerate. In the work of Kobayashi-Prevznev you wi...
26,900,385
in manage attributes set say default i created a group say "my custom group" now i want to get value of all attributes under this group for current product how can i do this?.. ``` $attributeValue = Mage::getModel('catalog/product') ->load($this->getProduct()->getId()); ...
2014/11/13
[ "https://Stackoverflow.com/questions/26900385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1799722/" ]
Not the most efficient, but works in bash. Use `wc -l` to count the lines, and divide by two. Then use `tail -n +N | head -n 1` to print just the `N`th line (where `N` starts at 1). ``` $ cat input.txt A B C D E $ tail -n +$(((`cat input.txt | wc -l` / 2) + 1)) input.txt | head -n 1 C ``` Note that a file with an e...
``` sed -n $(((`cat input.txt| wc -l`/ 2) + 1))p input.txt ```
1,441,140
How can i change my site URL using mod\_rewrite my problem is when i open my site's admin section i have to write www.example.com/index.php/admin what i want is i directly open my site like www.example.com/admin please help thanks
2009/09/17
[ "https://Stackoverflow.com/questions/1441140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/129099/" ]
Rows and columns have "weight" which describes how they grow or shrink to fill extra space in the master. By default a row or column has a weight of zero, which means you've told the label to fill the column but you haven't told the column to fill the master frame. To fix this, give the column a weight. Any positive ...
This solution with columns and frames works, but to get labels to have the same width in a grid, you do not need the enclosing frames. See below example ``` from tkinter import * root = Tk() label1 = Label(root, text='short', bg='light green', relief=RIDGE) label1.grid(sticky=E+W) label2 = Label(root, text='quite a ...
747,564
Apparently lusrmgr.msc is not available in the Windows 8.1 version I'm using, and thus I can't change my username under the Local Users and Groups tab. I would like to rename my user profile name so that the address line will display > > C:\Users\John > > > and not > > C:\Users\John's PC > > > How can I...
2014/04/29
[ "https://superuser.com/questions/747564", "https://superuser.com", "https://superuser.com/users/319210/" ]
As far as I know, you can rename your user in Win8.1, but the directory your profile lies in won't change to reflect the new user name! It will always stay the same as it was created. Let's assume you named your user correctly ('John') in the first place, then handed your computer over to a friend named 'Heather' and ...
This is what worked for me: To open User Accounts, click the Start button Picture of the Start button, click Control Panel, click User Accounts and Family Safety, click User Accounts, and then click Change your account name. Administrator permission required If you're prompted for an administrator password or confirma...
747,564
Apparently lusrmgr.msc is not available in the Windows 8.1 version I'm using, and thus I can't change my username under the Local Users and Groups tab. I would like to rename my user profile name so that the address line will display > > C:\Users\John > > > and not > > C:\Users\John's PC > > > How can I...
2014/04/29
[ "https://superuser.com/questions/747564", "https://superuser.com", "https://superuser.com/users/319210/" ]
If you want to change your default user folder, [this article](http://www.sevenforums.com/tutorials/87555-user-profile-change-default-location.html) will help you. Let me bring you short version of that article: 1. Back up to recover if smtg goes wrong 2. Log in as another (administrator) user. Don't try to do it w...
This is what worked for me: To open User Accounts, click the Start button Picture of the Start button, click Control Panel, click User Accounts and Family Safety, click User Accounts, and then click Change your account name. Administrator permission required If you're prompted for an administrator password or confirma...
25,283,607
According to Firefox addons sdk's [UI/Button/Action](https://developer.mozilla.org/en-US/Add-ons/SDK/Low-Level_APIs/ui_button_action) low level API I can perfectly put the extension icon on the toolbar. Actually By default, the button appears in the Firefox toolbar. ``` var buttons = require('sdk/ui/button/action'); ...
2014/08/13
[ "https://Stackoverflow.com/questions/25283607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1061236/" ]
Here is some code that perfoms what @ZER0 describes. ~~I haven't tested this in Australis, but I think it should still work~~ I have tested it, and it does work. ``` var loadUrlbarButton = function(doc, urlBtnClick) { var urlBarIcons = doc.getElementById('urlbar-icons') var btn = doc.createElement('toolbarbutt...
It's not currently possible with Add-on SDK or Customizable UI APIs; you have basically to do that manually – it means, track all the browser windows, and append a XUL DOM node in the right place, and handle the click. Such feature was actually planned, but because in the new Australis interface the UX team decided to...
28,997,539
HP Compaq 6200 Pro SFF PC 64 BIT Trying build an app but every time i build i get this message. I have tried multiple solutions I enabled in the BIOS I set the bit I tried the intel workaround. I NEED HELP
2015/03/11
[ "https://Stackoverflow.com/questions/28997539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4659686/" ]
What matters if the CPU - must be Intel processor that supports VT and NX bit (XD) - you can check your CPU # at <http://ark.intel.com> Also make sure hyperV off bcdedit /set hypervisorlaunchtype off XD bit is on bcdedit /set nx AlwaysOn Use the installer from <https://software.intel.com/en-us/android/art...
According to [This link (developer.android.com)](http://developer.android.com/tools/devices/emulator.html#acceleration): > > Virtual machine acceleration for Windows requires the installation of the Intel Hardware Accelerated Execution Manager (Intel HAXM). The > software requires an Intel CPU with Virtualization Tec...
28,997,539
HP Compaq 6200 Pro SFF PC 64 BIT Trying build an app but every time i build i get this message. I have tried multiple solutions I enabled in the BIOS I set the bit I tried the intel workaround. I NEED HELP
2015/03/11
[ "https://Stackoverflow.com/questions/28997539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4659686/" ]
What matters if the CPU - must be Intel processor that supports VT and NX bit (XD) - you can check your CPU # at <http://ark.intel.com> Also make sure hyperV off bcdedit /set hypervisorlaunchtype off XD bit is on bcdedit /set nx AlwaysOn Use the installer from <https://software.intel.com/en-us/android/art...
* Unchecking the Avast Antivirus feature "Enable Hardware Assisted Virtualization" under `Settings > Troubleshooting` solved my problem. * Now restart the computer * Now install the HAXM installer and it will install successfully. * Now start the AVD and it will work perfectly.
28,997,539
HP Compaq 6200 Pro SFF PC 64 BIT Trying build an app but every time i build i get this message. I have tried multiple solutions I enabled in the BIOS I set the bit I tried the intel workaround. I NEED HELP
2015/03/11
[ "https://Stackoverflow.com/questions/28997539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4659686/" ]
What matters if the CPU - must be Intel processor that supports VT and NX bit (XD) - you can check your CPU # at <http://ark.intel.com> Also make sure hyperV off bcdedit /set hypervisorlaunchtype off XD bit is on bcdedit /set nx AlwaysOn Use the installer from <https://software.intel.com/en-us/android/art...
restart window and go to BIOS --> Enabled intel virtualization technology --> save and exit --> open window and re-install HAXM.exe
10,039,402
I am making a page in which there will be array of images. I need the images to be zoomed when the mouse is hovered and i got it successfully through java script. But the problem is when the image gets enlarged the position of the other images is also getting changed. I want such that the zoomed image does not change ...
2012/04/06
[ "https://Stackoverflow.com/questions/10039402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1240384/" ]
You should use absolute positioning and z-index. HTML ``` <div class="container"><img src="#" /></div> <div class="container"><img src="#" /></div> ``` CSS ``` .container { position: relative; } .container img { position: absolute; z-index: 0; } .container img:hover { position: absolute; z...
Avoid making use of percentage for giving height and width. I have experienced it too. Instead provide height and width in "pixels(px)". That would serve better and the solution for your query.
13,095,007
I am trying to create a camera app which, would act like the default camera app more or less. The thing, which is not working for me at the moment, is tap to focus. I want the camera to focus and do whatever it does on my touched point, just like the real camera app does. Here's my viewDidLoad ``` - (void)viewDidLoa...
2012/10/26
[ "https://Stackoverflow.com/questions/13095007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1760206/" ]
You have to adjust the touchPoint to a range of [0,1] using something like the following code: ``` CGRect screenRect = [[UIScreen mainScreen] bounds]; screenWidth = screenRect.size.width; screenHeight = screenRect.size.height; double focus_x = thisFocusPoint.center.x/screenWidth; double focus_y =...
``` UITapGestureRecognizer *shortTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapToFocus:)]; shortTap.numberOfTapsRequired=1; shortTap.numberOfTouchesRequired=1; [viewCanvasRecording addGestureRecognizer:shortTap]; ``` and then this: ``` - (void)handleTapToFocus:(UITapGestureReco...
13,095,007
I am trying to create a camera app which, would act like the default camera app more or less. The thing, which is not working for me at the moment, is tap to focus. I want the camera to focus and do whatever it does on my touched point, just like the real camera app does. Here's my viewDidLoad ``` - (void)viewDidLoa...
2012/10/26
[ "https://Stackoverflow.com/questions/13095007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1760206/" ]
You have to adjust the touchPoint to a range of [0,1] using something like the following code: ``` CGRect screenRect = [[UIScreen mainScreen] bounds]; screenWidth = screenRect.size.width; screenHeight = screenRect.size.height; double focus_x = thisFocusPoint.center.x/screenWidth; double focus_y =...
So here is how I handle gestures for my AV camera preview. Setup your UITapGestureRecognizer first, then get the point by using captureDevicePointOfInterestForPoint. ``` - (void)setupGestures { UITapGestureRecognizer *tapToFocusRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self ...
13,095,007
I am trying to create a camera app which, would act like the default camera app more or less. The thing, which is not working for me at the moment, is tap to focus. I want the camera to focus and do whatever it does on my touched point, just like the real camera app does. Here's my viewDidLoad ``` - (void)viewDidLoa...
2012/10/26
[ "https://Stackoverflow.com/questions/13095007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1760206/" ]
``` UITapGestureRecognizer *shortTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapToFocus:)]; shortTap.numberOfTapsRequired=1; shortTap.numberOfTouchesRequired=1; [viewCanvasRecording addGestureRecognizer:shortTap]; ``` and then this: ``` - (void)handleTapToFocus:(UITapGestureReco...
So here is how I handle gestures for my AV camera preview. Setup your UITapGestureRecognizer first, then get the point by using captureDevicePointOfInterestForPoint. ``` - (void)setupGestures { UITapGestureRecognizer *tapToFocusRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self ...
4,987
The context I want to use it in is as follows: > > Even within that confined space the chickens bustled around. Bobbing > their heads in every direction, they balanced themselves by lifting > their feet in turns from the bars. They *puffed out* their wings a > little as well. > > >
2013/04/05
[ "https://ell.stackexchange.com/questions/4987", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/1227/" ]
"Puffed out" is actually a nicely creative way of saying this. Other creative choices are possible: "flung," "thrusted... sideways," "jerked," "popped," "quivered," "lifted," "spread." Each of these requires modifying words, thus: > > "They jerked their wings in and out, making tiny balancing movements." > > > "Th...
You can say, "They shifted their feet and stretched out their wings a bit to adjust their balance as a tightrope walker would use a balancing pole." or "They fidgeted around on the bars, constantly changing positions, using their unfurled wings for balance."
3,701,690
when two fair dice are rolled,the odds of throwing a 'double'(two dice with the same number) is 1:5. if two dice are rolled 400 times ,the best estimate of the number of times you would NOT get a double would be \_\_\_? my work: 400/2=80/2=40 is this the correct answer to the solution and if not ,what is the correct...
2020/06/02
[ "https://math.stackexchange.com/questions/3701690", "https://math.stackexchange.com", "https://math.stackexchange.com/users/790381/" ]
Start by calculating the probability of getting a double of a particular number (1 for instance). Each dice has 6 numbers, so the probably of getting 1 on a single dice is $\left(\frac 16\right)$. The probability of getting 1 on both dice is the product of the probabilities of getting 1 on each individual dice: $$\lef...
So lets try to calculate the number of times we would throw a 'double', given the probability is 1:5 , and n=400. So if we were to throw the pair of two dice once, there is 1/5 chance that they would be a double. If we were to throw it again, the probability will still stay the same; so no matter how many times you th...
16,733,067
I'm writing a widget UI where the user can manipulate widgets and text. One of the UI functions needed is to select an icon from the list of icons in a glyph and as I'm using twitter bootstrap it should be possible to select the "icon-" classes in the CSS in JavaScript then display them in a DIV. However I'm still rela...
2013/05/24
[ "https://Stackoverflow.com/questions/16733067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2328253/" ]
Something like this should work if your browser implements the [CSSStyleSheet interface](http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet): ``` var icons = []; var cssRules = document.styleSheets[0].cssRules; // your bootstrap.css for (var i=0; i<cssRules.length; i++) { var selectorText = cssRules[i...
The best approach I can think of is creating an array of the possible values, then looping through them. Here, I made it for you: ([from this page](http://twitter.github.io/bootstrap/base-css.html#icons)) ``` var icons = ["glass","music","search","envelope","heart","star","star-empty","user","film","th-large","th","th...
13,936,640
I have Form with a Timer1, and it set to 10Sec. There is a KeyDown event - when the user press "Enter", I would like to save in "ans" the time duration that past in the 10S interval before it ends. For Example: If i starting the timer1 now, and after 3Sec, I'm pressing Enter, ans = 3. and if I didnt press any key, a...
2012/12/18
[ "https://Stackoverflow.com/questions/13936640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1770679/" ]
Well, to start out with, Timer is not what you want to use. The timer class is designed to fire off events at a pre-defined interval of time; for example, you might use a timer to update a text box on a form every 10 seconds. Instead, what you wish to do is use a stopwatch (System.Diagnostics.Stopwatch). Call Stopwatc...
You can use *Tick* event of Timer. ``` bool isPressed = false; Timer timer1 = new Timer() { Interval = 10000}; timer1.Tick += (s, e) => { if (!isPressed) ResponseTimeList.Add(timer1.Interval); isPressed = false; }; ``` And when key pressed: ``` if (e.KeyCode == Keys.Enter) { ResponseTimeList...
39,944,099
I'm trying make authorization in my ember application. Its working on client side, but ember doesn't attach Bearer token to api request. My adapter ``` import DS from 'ember-data'; import DataAdapterMixin from 'ember-simple-auth/mixins/data-adapter-mixin'; export default DS.JSONAPIAdapter.extend(DataAdapterMixin, {...
2016/10/09
[ "https://Stackoverflow.com/questions/39944099", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6599883/" ]
I am writing you a full tutorial please just follow that hope it works for you. ``` //folders and files tree adapters --- application.js authenticators --- oauth2.js authorizers ---- oauth2-bearer.js ``` Adapters/application.js ``` import DS from 'ember-data'; import DataAdapterMixin fro...
My only problem was that i have not `authorization` in my accept headers in api `allow_headers: ['origin', 'X-Custom-Auth', 'Content-Type', 'Authorization']` That is strange, because when tested by Postman all was working.
12,394,894
i am trying to upload a file to box.com with their v2 api. i am able to successfully upload a file with curl, but cannot upload a file from my rails application. i am passing my upload function the correct folder id and file is a tempfile object created by a form upload in my app. here is the successful curl command ...
2012/09/12
[ "https://Stackoverflow.com/questions/12394894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1457400/" ]
This works properly for me ``` require 'httmultiparty' class SomeClient include HTTMultiParty base_uri 'https://api.box.com/2.0' end response = SomeClient.post('/files/data', :headers => { 'authorization' => 'BoxAuth api_key={YOUR API KEY}&auth_token={YOUR TOKEN' }, :body => { :folder_id => '0', :s...
Sean already covered this in his answer but I'll highlight it explicitly. We had some issues using the <https://upload.box.com> URL which is no longer recommended by box. I'd recommend trying the <https://api.box.com/2.0> URL and seeing if that it changes your results. Worst case I'd try capturing my packets using a p...
12,394,894
i am trying to upload a file to box.com with their v2 api. i am able to successfully upload a file with curl, but cannot upload a file from my rails application. i am passing my upload function the correct folder id and file is a tempfile object created by a form upload in my app. here is the successful curl command ...
2012/09/12
[ "https://Stackoverflow.com/questions/12394894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1457400/" ]
Despite from being late, this could be useful for people who came across this question. There is a gem [ruby-box](https://github.com/attachmentsme/ruby-box) to use with Box service at the 2.0 version of their API.
Sean already covered this in his answer but I'll highlight it explicitly. We had some issues using the <https://upload.box.com> URL which is no longer recommended by box. I'd recommend trying the <https://api.box.com/2.0> URL and seeing if that it changes your results. Worst case I'd try capturing my packets using a p...
18,945,624
I have a view which has been created like this: ``` CREATE VIEW [dbo].[vwData] WITH SCHEMABINDING AS SELECT [DataField1] , [DataField2] , [DataField3] FROM dbo.tblData ``` When I try to create a full text index on it, like this: ``` CREATE FULLTEXT INDEX ON [dbo].[vwData]( [DataF...
2013/09/22
[ "https://Stackoverflow.com/questions/18945624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/192131/" ]
you have to make your view indexed by creating unique clustered index: ``` create unique clustered index ix_vwData on vwData(<unique columns>) ``` After that, index `idx_DataField` must be a unique, non-nullable, single-column index.
First you need to create a unique clustered index on a view, before creating a fulltext index. Suppose you have a table: ``` CREATE TABLE [dbo].[tblData]( [DataField1] [Varchar] NOT NULL, [DataField2] [varchar](10) NULL, [DataField3] [varchar](10) NULL ) ``` And as you already did, you have a view: ...
50,387,748
How to pass the form values to the Angular script and, from script to Spring MVC controller. Below I have written code where form data is unable to send the controller Script ------ ``` <script type="text/javascript"> var app = angular.module('formSubmit', []); app.controller('FormSubmitController',[ '$scope', '$htt...
2018/05/17
[ "https://Stackoverflow.com/questions/50387748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6506801/" ]
Maybe you need to allow the cross origin in your spring MVC like that : ``` @CrossOrigin @RequestMapping(value = "submitmock", method = RequestMethod.POST) public @ResponseBody Emp getMock(@RequestBody Emp Emp) { serviceInD.savedata(Emp); return Emp; } ``` You can refer to the spring guide : <https://...
You will need to indicate the type of data you send to your controller in your http post. You can specify the type with header in your request : `var response = $http.post('submitmock', { Emp: formData}, {headers:{'Content-Type': 'application/json'}});`
50,387,748
How to pass the form values to the Angular script and, from script to Spring MVC controller. Below I have written code where form data is unable to send the controller Script ------ ``` <script type="text/javascript"> var app = angular.module('formSubmit', []); app.controller('FormSubmitController',[ '$scope', '$htt...
2018/05/17
[ "https://Stackoverflow.com/questions/50387748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6506801/" ]
Maybe you need to allow the cross origin in your spring MVC like that : ``` @CrossOrigin @RequestMapping(value = "submitmock", method = RequestMethod.POST) public @ResponseBody Emp getMock(@RequestBody Emp Emp) { serviceInD.savedata(Emp); return Emp; } ``` You can refer to the spring guide : <https://...
Your formData is already body do not need to map with Emp. Try replacing the following code in your script file ``` var response = $http.post('submitmock', formData); //passing Emp response.success(function(data, status, headers, config) { $scope.list.push(data); });...
39,055,914
I just installed Android Studio on Ubuntu this morning and I've got a problem with gradle. It mentions that ``` Error:Execution failed for task ':app:prepareComAndroidSupportAnimatedVectorDrawable2420Library'. > Could not expand ZIP '/home/beetlikeyg087/Android/Sdk/extras/android/m2repository/com/android/support/an...
2016/08/20
[ "https://Stackoverflow.com/questions/39055914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
**Finally, This issue is solved.** It is because I installed Ubuntu in Thai language system, so I reinstalled Ubuntu with English system and installed android studio again. **And it works perfectly.** So, the issue is not about permission or something else but it is language system. If you have the same problem as m...
I have fixed the issue for my case. I have Android Studio installed in /opt/android-studio (though with the folders and files belonging to my user), and the SDK in a NTFS drive. For that NTFS drive, fstab was set so that the drive was mounted as root:plugdev, being my user member of the plugdev group. This way I could...
29,335,233
I would like to train a conv neural network to detect the presence of hands in images. The difficulty is that: 1/ the images will contain other objects than the hands, just like a picture of a group of people where the hands are just a small part of the image 2/ hands can have many orientations / shapes etc (whether t...
2015/03/29
[ "https://Stackoverflow.com/questions/29335233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1010393/" ]
Does it work if you try this instead? ``` $email = $_POST['email']; $pass = $_POST['pass']; $query = mysql_query("SELECT * FROM users WHERE email = '{$email}' AND password = '{$pass}'; ``` I highly recommend you to switch over to PHP's [PDO Object](http://code.tutsplus.com/tutorials/why-you-should-be-using-phps-pdo-...
$\_POST['submit'] is passing no value (it'a submit button), at all. try to var\_dump, changing your last lines to this: ``` if(isset($_POST['submit'])) { signUp(); } else { echo "the problem with post_submit is that is not here inside: "; var_dump($_POST); } ``` to get an idea of what is inside the...
6,373,564
I have the following php-codeigniter script which attempts to increment a field of a record using active-record syntax: ``` $data = array('votes' => '(votes + 1)'); $this->db->where('id', $post['identifier']); $this->db->update('users', $data); ``` This produces the following SQL: `"UPDATE`users`SET`votes`= '(votes...
2011/06/16
[ "https://Stackoverflow.com/questions/6373564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/480807/" ]
You can do as given below: ``` $this->db->where('id', $post['identifier']); $this->db->set('votes', 'votes+1', FALSE); $this->db->update('users'); ``` The reason this works is because the third (optional) FALSE parameter tells CodeIgniter not to protect the generated query with backticks (`'`). This means that the g...
``` $data = array('votes' => 'votes + 1'); foreach ($data as $key=>$val) { $this->db->set($key, $val, FALSE); } $this->db->where('id', $post['identifier']); $this->db->update('users', $data); ```
6,373,564
I have the following php-codeigniter script which attempts to increment a field of a record using active-record syntax: ``` $data = array('votes' => '(votes + 1)'); $this->db->where('id', $post['identifier']); $this->db->update('users', $data); ``` This produces the following SQL: `"UPDATE`users`SET`votes`= '(votes...
2011/06/16
[ "https://Stackoverflow.com/questions/6373564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/480807/" ]
You can do as given below: ``` $this->db->where('id', $post['identifier']); $this->db->set('votes', 'votes+1', FALSE); $this->db->update('users'); ``` The reason this works is because the third (optional) FALSE parameter tells CodeIgniter not to protect the generated query with backticks (`'`). This means that the g...
You can do as given below: ``` public function increment_product_count(){ $product_id=$this->input->post('product_id'); $this->db->where('id', $product_id); $this->db->set('click_count', 'click_count+1', FALSE); $this->db->update('tbl_product'); } ```
6,373,564
I have the following php-codeigniter script which attempts to increment a field of a record using active-record syntax: ``` $data = array('votes' => '(votes + 1)'); $this->db->where('id', $post['identifier']); $this->db->update('users', $data); ``` This produces the following SQL: `"UPDATE`users`SET`votes`= '(votes...
2011/06/16
[ "https://Stackoverflow.com/questions/6373564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/480807/" ]
``` $data = array('votes' => 'votes + 1'); foreach ($data as $key=>$val) { $this->db->set($key, $val, FALSE); } $this->db->where('id', $post['identifier']); $this->db->update('users', $data); ```
You can do as given below: ``` public function increment_product_count(){ $product_id=$this->input->post('product_id'); $this->db->where('id', $product_id); $this->db->set('click_count', 'click_count+1', FALSE); $this->db->update('tbl_product'); } ```
3,237,949
I have the following problem: I have a time-series with more than 10000 entries and I want to perform some calculations with each of them. This alone wouldn't be a problem, but I need to get the last calculated value in order to get the next one. A very simple form of what I need would look like this: `Val(n) = Val(n-...
2010/07/13
[ "https://Stackoverflow.com/questions/3237949", "https://Stackoverflow.com", "https://Stackoverflow.com/users/390525/" ]
If you only care about the final result, use `reduce`; if you need to get a seq of results of transforming each value in turn (where each transformation depends on the previous ones), use `reductions` (found in `clojure.contrib.seq-utils` in 1.1 and in `clojure.core` in 1.2). Below, `transform-first-entry` does whatev...
If you just want a hint; look into using [`partition`](http://richhickey.github.com/clojure/clojure.core-api.html#clojure.core/partition). *For a little more than a hint*… ``` (defn calc-val [time-series element] (let [p (partition 2 1 time-series)] (for [t p] (let [first-value (first t) sec...
38,752,198
I made django project through DRF. On my struggling with DRF, I getting wonder that it is possible to serializing these models. **models.py** ``` class Post(models.Model): author = models.ForeignKey(User, related_name='related_postwriter') title = models.CharField(max_length=200, blank = False) text = mo...
2016/08/03
[ "https://Stackoverflow.com/questions/38752198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6426449/" ]
There is nothing wrong, you are just accessing the wrong attributes. If you look at your models, you define a related name to posts: `post = models.ForeignKey('blog.Post', related_name='related_comments')` So, when you write your serializer, the "field" you should be accessing should be the related name instead of co...
You can use [Nested relationships](http://www.django-rest-framework.org/api-guide/relations/#nested-relationships)
18,380,648
By using `Eclipse` shortcut (`CTRL`+`Shift`+`R`) Will show both (`src`) files and also (`target`) files. Like that ![enter image description here](https://i.stack.imgur.com/ef15Z.png) The problem is that Some times by mistake I select the target file then i update my changes After build i will NOT se...
2013/08/22
[ "https://Stackoverflow.com/questions/18380648", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1824361/" ]
**The quick and (dirty way) :** Right click on a `target folder`(s) Go to folder(s) properties, Mark folder as `Derived` like that. ![enter image description here](https://i.stack.imgur.com/zBHst.png) Derived entities are excluded from searching by default like that. ![enter image description here](https://i....
In the project-settings on java build-path you'll find on source a checkbox like this: ![enter image description here](https://i.stack.imgur.com/91N22.png) Disable it, for not getting files which are in the target folder to your view. So you will not find it by Eclipse shortcut (`CTRL`+`Shift`+`R`)
58,036,457
Today (2019-09-20) I updated my android emulator to version 29.2.0. After the install I couldn't initialize it. It always return the error: `Segmentation fault (core dumped)`
2019/09/21
[ "https://Stackoverflow.com/questions/58036457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/246097/" ]
UPDATE: Emulator update has been released in the stable channel. So this problem is now fixed. After searching through stackoverflow, I couldn't find anything about that. Then I tried on Google and also couldn't find anything. Just when checking the release notes of Android Emulator 29.2.1 Canary (<https://androidst...
today, 2019-9-24, exactly the same issue
48,318,195
i have excel file which have following column NAME RICE SUGAR TEA.i want to import all data into my oracle database please see image below. [![EXCEL FILE DATA FORMAT ](https://i.stack.imgur.com/WyegL.jpg)](https://i.stack.imgur.com/WyegL.jpg) [![ORACLE DATABASE TABLE RESULT](https://i.stack.imgur.com/zGKRd.jpg)](https...
2018/01/18
[ "https://Stackoverflow.com/questions/48318195", "https://Stackoverflow.com", "https://Stackoverflow.com/users/757321/" ]
Assuming your data is in the range `A2:D5` then you can put the formula below into `E3` and copy it across the range `E3:G5`: ``` ="INSERT INTO table_name ( name, item, quantity ) VALUES ( '" & $A3 & "', '" & B$2 & "', " & B3 & ");" ``` Then just copy the generated SQL statements and run them in Oracle. You could a...
Why you want to import data from excel to Oracle. Create external table using excel and use it. It is best way to use new feature of Oracle. You can join both table for running report or queries. If you change excel (or dump more data in excel sheet) then no need to create again external table because it automatically ...
18,080,648
When debugging scripts, you often need to know the value of your variables to know exactly what is going on. Outputting variables with [MsgBox](https://autohotkey.com/docs/commands/MsgBox.htm) to tackle this problem is annoying and inefficient. Is there a function that can help me with debugging variables? I want it ...
2013/08/06
[ "https://Stackoverflow.com/questions/18080648", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2650351/" ]
Take a look at the [ListVars command](http://www.autohotkey.com/docs/commands/ListVars.htm). It lists all of the variables. You can also get more extensive information using a method like this: ``` MsgBox, % GetAhkStats("lines") MsgBox, % GetAhkStats("variables") MsgBox, % GetAhkStats("hotkeys") Stat1 := GetAhkStats(...
listvars does the trick for me.
20,742,768
I am currently trying to create my own J.A.R.V.I.S system as a web app. So of course, like any good J.A.R.V.I.S system, it needs good speech recognition. I have done research trying to find a JavaScript speech recognition API that I can customize as much as I like, and have decided to use Annyang. (It's simple, and wor...
2013/12/23
[ "https://Stackoverflow.com/questions/20742768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2918513/" ]
<https://github.com/TalAter/annyang/issues/53> Please read through the whole issue. You might need to setup HTTPS for it.
The prompt will reappear if there is no SSL for every time the Listening action starts. If you have a valid SSL on a FQDN it will work, as long as you have setup the javascript correctly. Right now it is prompting, as after you Allow it, it cycles through the preconfigured matches, and then starts over, and prompts a...
20,742,768
I am currently trying to create my own J.A.R.V.I.S system as a web app. So of course, like any good J.A.R.V.I.S system, it needs good speech recognition. I have done research trying to find a JavaScript speech recognition API that I can customize as much as I like, and have decided to use Annyang. (It's simple, and wor...
2013/12/23
[ "https://Stackoverflow.com/questions/20742768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2918513/" ]
<https://github.com/TalAter/annyang/issues/53> Please read through the whole issue. You might need to setup HTTPS for it.
Even I faced the same situation, I got it resolved. There are 2 solutions to fix the issue. 1. Close all the other tabs which uses the microphone. 2. Recheck, in your annyang.js file ``` abort: function () { autoRestart = false; if (isInitialized) { recognition.abort(); } } ``` Which, need to re...
20,742,768
I am currently trying to create my own J.A.R.V.I.S system as a web app. So of course, like any good J.A.R.V.I.S system, it needs good speech recognition. I have done research trying to find a JavaScript speech recognition API that I can customize as much as I like, and have decided to use Annyang. (It's simple, and wor...
2013/12/23
[ "https://Stackoverflow.com/questions/20742768", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2918513/" ]
Even I faced the same situation, I got it resolved. There are 2 solutions to fix the issue. 1. Close all the other tabs which uses the microphone. 2. Recheck, in your annyang.js file ``` abort: function () { autoRestart = false; if (isInitialized) { recognition.abort(); } } ``` Which, need to re...
The prompt will reappear if there is no SSL for every time the Listening action starts. If you have a valid SSL on a FQDN it will work, as long as you have setup the javascript correctly. Right now it is prompting, as after you Allow it, it cycles through the preconfigured matches, and then starts over, and prompts a...
6,881,670
This is my json string `"[{"/stab/cg/{4CD742B1-C1CA-4708-BE78-0FCA2EB01A86}/TOPS_00":[{"key":"C0.A8.01.06","value":"31"},{"key":"C0.A8.50.01","value":"25"},{"key":"C0.A8.50.81","value":"22"},{"key":"E0.00.00.FC","value":"19"},{"key":"C0.A8.01.FF","value":"18"},{"key":"C0.A8.50.FF","value":"18"},{"key":"4A.7D.EC.5F",...
2011/07/30
[ "https://Stackoverflow.com/questions/6881670", "https://Stackoverflow.com", "https://Stackoverflow.com/users/869207/" ]
This is what MVVM uses the ViewModel for. Do not modify the Model but instead create ViewModel classes that are structured according to the needs of the View. that is where you would leave out the properties you don't want. **EDIT** Here is a way of doing that: ``` public class ItemTypeViewModel : INotifyPropertyC...
If this is your database model you can easily make a view for join those tables. or you can use this following code as pattern : ``` var temp = from i in categoryList from it in itemList where i.ItemCategoryID == it.ItemCategoryID select new { i, it }; ...
6,881,670
This is my json string `"[{"/stab/cg/{4CD742B1-C1CA-4708-BE78-0FCA2EB01A86}/TOPS_00":[{"key":"C0.A8.01.06","value":"31"},{"key":"C0.A8.50.01","value":"25"},{"key":"C0.A8.50.81","value":"22"},{"key":"E0.00.00.FC","value":"19"},{"key":"C0.A8.01.FF","value":"18"},{"key":"C0.A8.50.FF","value":"18"},{"key":"4A.7D.EC.5F",...
2011/07/30
[ "https://Stackoverflow.com/questions/6881670", "https://Stackoverflow.com", "https://Stackoverflow.com/users/869207/" ]
The answer provided by both guys are perfectly valid and fit your needs, as much as I understood your question. The basic idea is: @Amani: ``` //check if the query fits your needs var temp = from i in categoryList from it in itemList where i.ItemCategoryID == it.ItemCategoryID ...
If this is your database model you can easily make a view for join those tables. or you can use this following code as pattern : ``` var temp = from i in categoryList from it in itemList where i.ItemCategoryID == it.ItemCategoryID select new { i, it }; ...
6,881,670
This is my json string `"[{"/stab/cg/{4CD742B1-C1CA-4708-BE78-0FCA2EB01A86}/TOPS_00":[{"key":"C0.A8.01.06","value":"31"},{"key":"C0.A8.50.01","value":"25"},{"key":"C0.A8.50.81","value":"22"},{"key":"E0.00.00.FC","value":"19"},{"key":"C0.A8.01.FF","value":"18"},{"key":"C0.A8.50.FF","value":"18"},{"key":"4A.7D.EC.5F",...
2011/07/30
[ "https://Stackoverflow.com/questions/6881670", "https://Stackoverflow.com", "https://Stackoverflow.com/users/869207/" ]
This is what MVVM uses the ViewModel for. Do not modify the Model but instead create ViewModel classes that are structured according to the needs of the View. that is where you would leave out the properties you don't want. **EDIT** Here is a way of doing that: ``` public class ItemTypeViewModel : INotifyPropertyC...
The answer provided by both guys are perfectly valid and fit your needs, as much as I understood your question. The basic idea is: @Amani: ``` //check if the query fits your needs var temp = from i in categoryList from it in itemList where i.ItemCategoryID == it.ItemCategoryID ...
298,503
I'm having a little trouble finding the Thevenin resistance equivalent of this circuit. Without the 7.5k resistor, I expect it to be just 15k||15k. Does the 7.5k resistor here act in parallel with the lower 7.5k resistor (to become a 5k resistor) or is it more complicated than that? ![schematic](https://i.stack.imgur....
2017/04/09
[ "https://electronics.stackexchange.com/questions/298503", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/144609/" ]
You might find it easier to forget you ever heard the word "Thevenin." You're trying to find a single voltage source and single resistor that would have the same open circuit output voltage and short circuit output current as the circuit in the problem (definition of Thevenin and Norton equivalents). There's no special...
Yes to 5k. No it is not more complicated than that
68,554
I'm trying to understand how to feed data into `LSTM` layer of `Keras`, but I'm in trouble and I don't understand how to do it. I've have a dataset composed by words and each words is embedded with a vector of 839 elements, so the shape of my dataset is (x, 839). I want to feed my dataset into the `LSTM` layer, but I ...
2020/02/23
[ "https://datascience.stackexchange.com/questions/68554", "https://datascience.stackexchange.com", "https://datascience.stackexchange.com/users/90006/" ]
**The table of correlation** coefficients shows the *pairwise correlation* between the variables in your data set: on a range from 0 (no correlation) to 1 (full correlation), to what extent does variation in one variable explain variation in the other variable? **The coefficients from the regression table**, on the o...
The correlation coefficient(.58 ) between the two variables (X4 and y is significant statistically given a very large sample. This positive relationship is corroborated by the multiple-regression model results. Your model produced a t-value = 1.969 which is statistically significant at alpha = .05. It is actually sign...
30,503,989
I have defined the following route: ``` Route::get('/tours/{country_identifier}', ['as' => 'country', 'uses' => 'CountryController@index']); ``` Now I would like to link to this named route using something like ``` route('country') ``` with a parameter for {country\_identifier} filled in, e.g. '/tours/Canada'. H...
2015/05/28
[ "https://Stackoverflow.com/questions/30503989", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2169147/" ]
You can pass the parameters as second argument array: ``` route('country', ['country_identifier' => $someValue]); ``` You can take a look at the [documentation](http://laravel.com/docs/5.0/routing), there are a lot of useful examples there :)
Try this ``` route('country', array('country_identifier' => 'Canada')) ``` It will take 'canada'as parameter to route.
30,503,989
I have defined the following route: ``` Route::get('/tours/{country_identifier}', ['as' => 'country', 'uses' => 'CountryController@index']); ``` Now I would like to link to this named route using something like ``` route('country') ``` with a parameter for {country\_identifier} filled in, e.g. '/tours/Canada'. H...
2015/05/28
[ "https://Stackoverflow.com/questions/30503989", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2169147/" ]
You can pass the parameters as second argument array: ``` route('country', ['country_identifier' => $someValue]); ``` You can take a look at the [documentation](http://laravel.com/docs/5.0/routing), there are a lot of useful examples there :)
To link from a view use (assuming you use blade) ``` <a href="{{ URL::route('country', array('country_identifier' => $var)) }}">$var</a> ```
30,503,989
I have defined the following route: ``` Route::get('/tours/{country_identifier}', ['as' => 'country', 'uses' => 'CountryController@index']); ``` Now I would like to link to this named route using something like ``` route('country') ``` with a parameter for {country\_identifier} filled in, e.g. '/tours/Canada'. H...
2015/05/28
[ "https://Stackoverflow.com/questions/30503989", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2169147/" ]
You can pass the parameters as second argument array: ``` route('country', ['country_identifier' => $someValue]); ``` You can take a look at the [documentation](http://laravel.com/docs/5.0/routing), there are a lot of useful examples there :)
Its simple: For a single link ``` <a href="{{ route('country', ['country_identifier' => $country_id]) }}">$country_name</a> ``` If you are generating some links you can do for example ``` @foreach($countries as $country) <a href="{{ route('country', ['country_identifier' => $country->id]) }}">$country->name</a> ...
30,503,989
I have defined the following route: ``` Route::get('/tours/{country_identifier}', ['as' => 'country', 'uses' => 'CountryController@index']); ``` Now I would like to link to this named route using something like ``` route('country') ``` with a parameter for {country\_identifier} filled in, e.g. '/tours/Canada'. H...
2015/05/28
[ "https://Stackoverflow.com/questions/30503989", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2169147/" ]
To link from a view use (assuming you use blade) ``` <a href="{{ URL::route('country', array('country_identifier' => $var)) }}">$var</a> ```
Try this ``` route('country', array('country_identifier' => 'Canada')) ``` It will take 'canada'as parameter to route.
30,503,989
I have defined the following route: ``` Route::get('/tours/{country_identifier}', ['as' => 'country', 'uses' => 'CountryController@index']); ``` Now I would like to link to this named route using something like ``` route('country') ``` with a parameter for {country\_identifier} filled in, e.g. '/tours/Canada'. H...
2015/05/28
[ "https://Stackoverflow.com/questions/30503989", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2169147/" ]
Its simple: For a single link ``` <a href="{{ route('country', ['country_identifier' => $country_id]) }}">$country_name</a> ``` If you are generating some links you can do for example ``` @foreach($countries as $country) <a href="{{ route('country', ['country_identifier' => $country->id]) }}">$country->name</a> ...
Try this ``` route('country', array('country_identifier' => 'Canada')) ``` It will take 'canada'as parameter to route.
181,910
I remember some elements of this story, but the name and fine details i have forgotten. It was either in 2000AD or Starlord comics back in the 80’s in the UK. If anyone remembers, or can point me at a site with this on, then it would be much appreciated.
2018/02/21
[ "https://scifi.stackexchange.com/questions/181910", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/96834/" ]
This is, I believe, Harry Angel from 2000AD. He was an RAF officer involved in a plane crash during which the flight computer of his plane (I thought it was a Harrier (as a play on 'Harry') but [this link](https://comicvine.gamespot.com/harry-angel/4005-83217/) suggests it was a fictional F-20) got bonded to his body, ...
This is a stretch (and I don't know about the comic) but there is a 1973 story by Theodore R. Cogswell and Theodore L. Thomas called [Early Bird](https://www.isfdb.org/cgi-bin/title.cgi?81635). In this story, a space "scout"-fighter pilot is in combat over a world populated by cybernetic organisms. This scout-fighter a...
4,905,290
I'm running a java web app in Eclipse (Helios) using Tomcat 7. The server startups up successfully (duration indicated) however Eclipse's progress bar still spins saying that Tomcat is starting up. Eventually the timeout is reached and an error is thrown. I believe Tomcat is fine as I've taken the command that it uses...
2011/02/05
[ "https://Stackoverflow.com/questions/4905290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/251736/" ]
I had this issue, it seems that the Eclipse calls the application url after start up to make sure it is running. A proxy client (pshione) had changed the system proxy so the eclipse could not call the start page and thinks that the application is not starting yet!! I removed the proxy and it works fine now! Edited: ...
I got this problem, it seems that my tomcat version was buggy (tomcat 7.0.23) switch your tomcat version to another (i.e tomcat 7.0.14) it works for me. good luck
4,905,290
I'm running a java web app in Eclipse (Helios) using Tomcat 7. The server startups up successfully (duration indicated) however Eclipse's progress bar still spins saying that Tomcat is starting up. Eventually the timeout is reached and an error is thrown. I believe Tomcat is fine as I've taken the command that it uses...
2011/02/05
[ "https://Stackoverflow.com/questions/4905290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/251736/" ]
Some updates of Java cause problems with Eclipse's networking operation. Specifically, Eclipse tries to use IPv6 instead of IPv4 and sometimes fails. When Eclipse starts up Tomcat, one of the final steps that it does is tests the a debug call to Tomcat. This is likely to be the part that is hanging. Fortunately, the fi...
This could happen if two servlets have been mapped to the same request URL, Tomcat will start up fine but eclipse won't be able to generate the correct web.xml file and therefore won't be able to publish the webApp. Check your servlet mapping `@WebServlet("\TheURLThatShouldInvokeThisServlet")` make sure two servlets do...
4,905,290
I'm running a java web app in Eclipse (Helios) using Tomcat 7. The server startups up successfully (duration indicated) however Eclipse's progress bar still spins saying that Tomcat is starting up. Eventually the timeout is reached and an error is thrown. I believe Tomcat is fine as I've taken the command that it uses...
2011/02/05
[ "https://Stackoverflow.com/questions/4905290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/251736/" ]
I got this problem, it seems that my tomcat version was buggy (tomcat 7.0.23) switch your tomcat version to another (i.e tomcat 7.0.14) it works for me. good luck
This could happen if two servlets have been mapped to the same request URL, Tomcat will start up fine but eclipse won't be able to generate the correct web.xml file and therefore won't be able to publish the webApp. Check your servlet mapping `@WebServlet("\TheURLThatShouldInvokeThisServlet")` make sure two servlets do...
4,905,290
I'm running a java web app in Eclipse (Helios) using Tomcat 7. The server startups up successfully (duration indicated) however Eclipse's progress bar still spins saying that Tomcat is starting up. Eventually the timeout is reached and an error is thrown. I believe Tomcat is fine as I've taken the command that it uses...
2011/02/05
[ "https://Stackoverflow.com/questions/4905290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/251736/" ]
I had this issue, it seems that the Eclipse calls the application url after start up to make sure it is running. A proxy client (pshione) had changed the system proxy so the eclipse could not call the start page and thinks that the application is not starting yet!! I removed the proxy and it works fine now! Edited: ...
This issue is related to a tomcat configured with HTTPS without a HTTP connector. I had this SSL connector in server.xml and my tomcat in Eclipse is always showing *Starting*: ``` <Connector SSLEnabled="true" asyncTimeout="10000000" clientAuth="false" connectionTimeout="10000000" keepAliveTimeout="10000000" ...
4,905,290
I'm running a java web app in Eclipse (Helios) using Tomcat 7. The server startups up successfully (duration indicated) however Eclipse's progress bar still spins saying that Tomcat is starting up. Eventually the timeout is reached and an error is thrown. I believe Tomcat is fine as I've taken the command that it uses...
2011/02/05
[ "https://Stackoverflow.com/questions/4905290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/251736/" ]
Some updates of Java cause problems with Eclipse's networking operation. Specifically, Eclipse tries to use IPv6 instead of IPv4 and sometimes fails. When Eclipse starts up Tomcat, one of the final steps that it does is tests the a debug call to Tomcat. This is likely to be the part that is hanging. Fortunately, the fi...
I got this problem, it seems that my tomcat version was buggy (tomcat 7.0.23) switch your tomcat version to another (i.e tomcat 7.0.14) it works for me. good luck
4,905,290
I'm running a java web app in Eclipse (Helios) using Tomcat 7. The server startups up successfully (duration indicated) however Eclipse's progress bar still spins saying that Tomcat is starting up. Eventually the timeout is reached and an error is thrown. I believe Tomcat is fine as I've taken the command that it uses...
2011/02/05
[ "https://Stackoverflow.com/questions/4905290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/251736/" ]
This issue is related to a tomcat configured with HTTPS without a HTTP connector. I had this SSL connector in server.xml and my tomcat in Eclipse is always showing *Starting*: ``` <Connector SSLEnabled="true" asyncTimeout="10000000" clientAuth="false" connectionTimeout="10000000" keepAliveTimeout="10000000" ...
I got this problem, it seems that my tomcat version was buggy (tomcat 7.0.23) switch your tomcat version to another (i.e tomcat 7.0.14) it works for me. good luck
4,905,290
I'm running a java web app in Eclipse (Helios) using Tomcat 7. The server startups up successfully (duration indicated) however Eclipse's progress bar still spins saying that Tomcat is starting up. Eventually the timeout is reached and an error is thrown. I believe Tomcat is fine as I've taken the command that it uses...
2011/02/05
[ "https://Stackoverflow.com/questions/4905290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/251736/" ]
I had this issue, it seems that the Eclipse calls the application url after start up to make sure it is running. A proxy client (pshione) had changed the system proxy so the eclipse could not call the start page and thinks that the application is not starting yet!! I removed the proxy and it works fine now! Edited: ...
I had the same issue, it was due to the connectors I had defined (I only had an AJP connector). Adding an HTTP connector to Tomcat's server.xml solved the problem.
4,905,290
I'm running a java web app in Eclipse (Helios) using Tomcat 7. The server startups up successfully (duration indicated) however Eclipse's progress bar still spins saying that Tomcat is starting up. Eventually the timeout is reached and an error is thrown. I believe Tomcat is fine as I've taken the command that it uses...
2011/02/05
[ "https://Stackoverflow.com/questions/4905290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/251736/" ]
I had the same issue, it was due to the connectors I had defined (I only had an AJP connector). Adding an HTTP connector to Tomcat's server.xml solved the problem.
This could happen if two servlets have been mapped to the same request URL, Tomcat will start up fine but eclipse won't be able to generate the correct web.xml file and therefore won't be able to publish the webApp. Check your servlet mapping `@WebServlet("\TheURLThatShouldInvokeThisServlet")` make sure two servlets do...
4,905,290
I'm running a java web app in Eclipse (Helios) using Tomcat 7. The server startups up successfully (duration indicated) however Eclipse's progress bar still spins saying that Tomcat is starting up. Eventually the timeout is reached and an error is thrown. I believe Tomcat is fine as I've taken the command that it uses...
2011/02/05
[ "https://Stackoverflow.com/questions/4905290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/251736/" ]
This issue is related to a tomcat configured with HTTPS without a HTTP connector. I had this SSL connector in server.xml and my tomcat in Eclipse is always showing *Starting*: ``` <Connector SSLEnabled="true" asyncTimeout="10000000" clientAuth="false" connectionTimeout="10000000" keepAliveTimeout="10000000" ...
This could happen if two servlets have been mapped to the same request URL, Tomcat will start up fine but eclipse won't be able to generate the correct web.xml file and therefore won't be able to publish the webApp. Check your servlet mapping `@WebServlet("\TheURLThatShouldInvokeThisServlet")` make sure two servlets do...
4,905,290
I'm running a java web app in Eclipse (Helios) using Tomcat 7. The server startups up successfully (duration indicated) however Eclipse's progress bar still spins saying that Tomcat is starting up. Eventually the timeout is reached and an error is thrown. I believe Tomcat is fine as I've taken the command that it uses...
2011/02/05
[ "https://Stackoverflow.com/questions/4905290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/251736/" ]
I had this issue, it seems that the Eclipse calls the application url after start up to make sure it is running. A proxy client (pshione) had changed the system proxy so the eclipse could not call the start page and thinks that the application is not starting yet!! I removed the proxy and it works fine now! Edited: ...
Some updates of Java cause problems with Eclipse's networking operation. Specifically, Eclipse tries to use IPv6 instead of IPv4 and sometimes fails. When Eclipse starts up Tomcat, one of the final steps that it does is tests the a debug call to Tomcat. This is likely to be the part that is hanging. Fortunately, the fi...
8,194,272
I have given some thought on how to calculate how many users I can handle with Heroku and one dyno. But to figure it out I need some input. And I must say that the official documentation isn't nice to navigate and interpreter so I haven't read it all. My complaints about it are that it doesn't describe things very wel...
2011/11/19
[ "https://Stackoverflow.com/questions/8194272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/425367/" ]
Indeed.. not playable with mac/chrome (ver 15.0.874.120) flash (ver 11.1.102.55). You can try Monster Debugger: <http://demonsterdebugger.com/> Its quite easy to use. But first.. my guess is that you have something in your main gameloop (onEnterFrame, timer). You can try to remove things from your gameloop piece by ...
Flash uses a garbage collector for managing memory. That means that memory leaks do not exist by definition, everything that is in memory is being referenced somewhere. There's no way for an external tool or application to know whether or not an object in memory should be referenced. What you can do is run your game t...
8,194,272
I have given some thought on how to calculate how many users I can handle with Heroku and one dyno. But to figure it out I need some input. And I must say that the official documentation isn't nice to navigate and interpreter so I haven't read it all. My complaints about it are that it doesn't describe things very wel...
2011/11/19
[ "https://Stackoverflow.com/questions/8194272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/425367/" ]
Indeed.. not playable with mac/chrome (ver 15.0.874.120) flash (ver 11.1.102.55). You can try Monster Debugger: <http://demonsterdebugger.com/> Its quite easy to use. But first.. my guess is that you have something in your main gameloop (onEnterFrame, timer). You can try to remove things from your gameloop piece by ...
it seems like you're not clearing or recycling bitmap data, or some other object, when it's no longer useful, which results in adding more and more data to memory (often in an Enter Frame event handler) and causes major performance issues as we see here.
20,630,518
I have a table transactions and I trying to figure out our new customers in a given month. That means that if a customer didn't have a transaction in the time before the month he/she counts as a new customer. I have figured out a way, but it is seriously inefficient and takes ages. I then came across this [artikel](ht...
2013/12/17
[ "https://Stackoverflow.com/questions/20630518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1430476/" ]
You have to create the cell in ``` -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath ``` `dequeueReusableCellWithIdentifier` will return nil if no cell is available to dequeue. Modify it to something similar to this: ``` -(UITableViewCell *)tableView:(UI...
After a ton of stuff - this worked - I checked use autolayout for the table view(it had been unchecked before, I guess because this view exists inside of a scroll view, and I had unchecked autolayout for that). It then drew - I have no idea why.
20,630,518
I have a table transactions and I trying to figure out our new customers in a given month. That means that if a customer didn't have a transaction in the time before the month he/she counts as a new customer. I have figured out a way, but it is seriously inefficient and takes ages. I then came across this [artikel](ht...
2013/12/17
[ "https://Stackoverflow.com/questions/20630518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1430476/" ]
You have to create the cell in ``` -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath ``` `dequeueReusableCellWithIdentifier` will return nil if no cell is available to dequeue. Modify it to something similar to this: ``` -(UITableViewCell *)tableView:(UI...
I had the same problem, none of the provided examples worked, so I rolled out a a simple delay function. ``` class func delay(delay:Double, closure:()->()) { dispatch_after( dispatch_time( DISPATCH_TIME_NOW, Int64(delay * Double(NSEC_PER_SEC)) ), dispatch_get_main_qu...
20,630,518
I have a table transactions and I trying to figure out our new customers in a given month. That means that if a customer didn't have a transaction in the time before the month he/she counts as a new customer. I have figured out a way, but it is seriously inefficient and takes ages. I then came across this [artikel](ht...
2013/12/17
[ "https://Stackoverflow.com/questions/20630518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1430476/" ]
I had the same problem, none of the provided examples worked, so I rolled out a a simple delay function. ``` class func delay(delay:Double, closure:()->()) { dispatch_after( dispatch_time( DISPATCH_TIME_NOW, Int64(delay * Double(NSEC_PER_SEC)) ), dispatch_get_main_qu...
After a ton of stuff - this worked - I checked use autolayout for the table view(it had been unchecked before, I guess because this view exists inside of a scroll view, and I had unchecked autolayout for that). It then drew - I have no idea why.
2,233,761
If I understand [AccessController.doPrivileged](https://stackoverflow.com/questions/852453/accesscontroller-doprivileged) correctly, it is saying that untrusted code should be able to invoke methods requiring permissions (such as `System.getProperty()`) through an intermediate method that *does* have permissions. That...
2010/02/10
[ "https://Stackoverflow.com/questions/2233761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14731/" ]
Agree with [Suraj's answer](https://stackoverflow.com/questions/2233761/when-should-accesscontroller-doprivileged-be-used/2234080#2234080), but thought I'd add a specific example where I've required the use of a privileged block. Imagine you've built an application that provides a number of services to pluggable modul...
1. **..through an intermediate method that does have permissions** . No, the final effective permissions is the intersection of all permissions in the domain stack. So suppose an operation requires a permission B to execute, and say some intermediate LIB has two permissions B and A. Now when some untrusted code with on...
2,233,761
If I understand [AccessController.doPrivileged](https://stackoverflow.com/questions/852453/accesscontroller-doprivileged) correctly, it is saying that untrusted code should be able to invoke methods requiring permissions (such as `System.getProperty()`) through an intermediate method that *does* have permissions. That...
2010/02/10
[ "https://Stackoverflow.com/questions/2233761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14731/" ]
1. **..through an intermediate method that does have permissions** . No, the final effective permissions is the intersection of all permissions in the domain stack. So suppose an operation requires a permission B to execute, and say some intermediate LIB has two permissions B and A. Now when some untrusted code with on...
Check out these links and scroll down to using the doPrivileged API. Java 6: <http://docs.oracle.com/javase/6/docs/technotes/guides/security/doprivileged.html> Java 7: <http://docs.oracle.com/javase/7/docs/technotes/guides/security/doprivileged.html> When the AccessController checkPermission method is invoked by the...
2,233,761
If I understand [AccessController.doPrivileged](https://stackoverflow.com/questions/852453/accesscontroller-doprivileged) correctly, it is saying that untrusted code should be able to invoke methods requiring permissions (such as `System.getProperty()`) through an intermediate method that *does* have permissions. That...
2010/02/10
[ "https://Stackoverflow.com/questions/2233761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14731/" ]
1. **..through an intermediate method that does have permissions** . No, the final effective permissions is the intersection of all permissions in the domain stack. So suppose an operation requires a permission B to execute, and say some intermediate LIB has two permissions B and A. Now when some untrusted code with on...
Essentially, AccessController.doPriviledged() is the equivalent of a set-user-id file. It is saying "I hereby request that this method be done with my privileges, even if I was invoked by a method that does not have them."
2,233,761
If I understand [AccessController.doPrivileged](https://stackoverflow.com/questions/852453/accesscontroller-doprivileged) correctly, it is saying that untrusted code should be able to invoke methods requiring permissions (such as `System.getProperty()`) through an intermediate method that *does* have permissions. That...
2010/02/10
[ "https://Stackoverflow.com/questions/2233761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14731/" ]
Agree with [Suraj's answer](https://stackoverflow.com/questions/2233761/when-should-accesscontroller-doprivileged-be-used/2234080#2234080), but thought I'd add a specific example where I've required the use of a privileged block. Imagine you've built an application that provides a number of services to pluggable modul...
Check out these links and scroll down to using the doPrivileged API. Java 6: <http://docs.oracle.com/javase/6/docs/technotes/guides/security/doprivileged.html> Java 7: <http://docs.oracle.com/javase/7/docs/technotes/guides/security/doprivileged.html> When the AccessController checkPermission method is invoked by the...
2,233,761
If I understand [AccessController.doPrivileged](https://stackoverflow.com/questions/852453/accesscontroller-doprivileged) correctly, it is saying that untrusted code should be able to invoke methods requiring permissions (such as `System.getProperty()`) through an intermediate method that *does* have permissions. That...
2010/02/10
[ "https://Stackoverflow.com/questions/2233761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14731/" ]
Agree with [Suraj's answer](https://stackoverflow.com/questions/2233761/when-should-accesscontroller-doprivileged-be-used/2234080#2234080), but thought I'd add a specific example where I've required the use of a privileged block. Imagine you've built an application that provides a number of services to pluggable modul...
Essentially, AccessController.doPriviledged() is the equivalent of a set-user-id file. It is saying "I hereby request that this method be done with my privileges, even if I was invoked by a method that does not have them."
2,233,761
If I understand [AccessController.doPrivileged](https://stackoverflow.com/questions/852453/accesscontroller-doprivileged) correctly, it is saying that untrusted code should be able to invoke methods requiring permissions (such as `System.getProperty()`) through an intermediate method that *does* have permissions. That...
2010/02/10
[ "https://Stackoverflow.com/questions/2233761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14731/" ]
Essentially, AccessController.doPriviledged() is the equivalent of a set-user-id file. It is saying "I hereby request that this method be done with my privileges, even if I was invoked by a method that does not have them."
Check out these links and scroll down to using the doPrivileged API. Java 6: <http://docs.oracle.com/javase/6/docs/technotes/guides/security/doprivileged.html> Java 7: <http://docs.oracle.com/javase/7/docs/technotes/guides/security/doprivileged.html> When the AccessController checkPermission method is invoked by the...