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
61,732,702
I have the following database query where I am trying to check if there exists an item with a particular barcode that is linked to a particular mailbag. The query is as follows: ``` var exists = await dbcontext.Items .Include(t => t.MailBagItems) .ThenInclude(mt => mt.MailBag) ...
2020/05/11
[ "https://Stackoverflow.com/questions/61732702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6006981/" ]
Managed to make the query work by changing it to the following: ``` var exists = dbcontext.Items .AnyAsync(t => t.Barcode.Equals(barcode) && t.MailBagItems.Any(t => t.MailBag.Number.ToLower().Equals(mailbagNumber.ToLower()))); ``` Seems it wasn't enjoying the .FirstOrDefau...
Your `AnyAsync` is to complex for EF to transform to SQL, if you want to still use that query you will have to materialize the entities first, like this: ``` var exists = dbcontext.Items .Include(t => t.MailBagItems) .ThenInclude(mt => mt.MailBag) .ToListAsync() ...
5,634,943
i have a big problem and i need your help. Here's what i need to accomplish: 1. The user select a row from a TableView 2. A new view controller is pushed in the NavigationController, and displays only a "Loading" message 3. Meanwhile some data is read from an XML file (via http) 4. When the data has been read, an NSUC...
2011/04/12
[ "https://Stackoverflow.com/questions/5634943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/396133/" ]
If there is no chance that anybody might ever want to view the stored data manually, or there is a particular requirement for that level of precision then fine. But generally, I don't like it, It's a pain to look at a days data in a database when the date is in some obscure format!
Why would you want to do that? There is no penalty in storing it as regular DateTime. The better question you should ask yourself is how you would handle different timezones. We store all dates in database as UTC, and do the appropriate conversion based on either user selected timezone or server timezone. Usually user...
5,634,943
i have a big problem and i need your help. Here's what i need to accomplish: 1. The user select a row from a TableView 2. A new view controller is pushed in the NavigationController, and displays only a "Loading" message 3. Meanwhile some data is read from an XML file (via http) 4. When the data has been read, an NSUC...
2011/04/12
[ "https://Stackoverflow.com/questions/5634943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/396133/" ]
If there is no chance that anybody might ever want to view the stored data manually, or there is a particular requirement for that level of precision then fine. But generally, I don't like it, It's a pain to look at a days data in a database when the date is in some obscure format!
Every modern database have `DATETIME`, `DATE` and/or `TIMESTAMP` datatypes, so there is no need for using an `Int64`. But you could use `DateTime.Ticks` if you're saving data into a text file, for instance. Seems to be a good option in that case.
59,109,965
I am using [this tutorial](https://olingo.apache.org/doc/odata4/tutorials/read/tutorial_read.html) and it works for a simple java web application. Now I want to convert it to Spring Boot. I remove the web.xml and add the following two annotations to DemoServlet ``` @RestController public class DemoServlet extends Disp...
2019/11/29
[ "https://Stackoverflow.com/questions/59109965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1858796/" ]
user the below code for the process method. ``` handler.process(new HttpServletRequestWrapper(request) { // Spring MVC matches the whole path as the servlet path // Olingo wants just the prefix, ie upto /odata, so that it // can parse the rest of it as an OData path. So we need to override...
Add the following after the handler.register call: req.setAttribute("requestMapping", "/DemoService.svc");
59,109,965
I am using [this tutorial](https://olingo.apache.org/doc/odata4/tutorials/read/tutorial_read.html) and it works for a simple java web application. Now I want to convert it to Spring Boot. I remove the web.xml and add the following two annotations to DemoServlet ``` @RestController public class DemoServlet extends Disp...
2019/11/29
[ "https://Stackoverflow.com/questions/59109965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1858796/" ]
user the below code for the process method. ``` handler.process(new HttpServletRequestWrapper(request) { // Spring MVC matches the whole path as the servlet path // Olingo wants just the prefix, ie upto /odata, so that it // can parse the rest of it as an OData path. So we need to override...
The best implementation of olingo2 and spring-boot can be found [here](https://github.com/jpenninkhof/odata-boilerplate). I would suggest to take a look at this repository, it is very straight forward and easy.
59,109,965
I am using [this tutorial](https://olingo.apache.org/doc/odata4/tutorials/read/tutorial_read.html) and it works for a simple java web application. Now I want to convert it to Spring Boot. I remove the web.xml and add the following two annotations to DemoServlet ``` @RestController public class DemoServlet extends Disp...
2019/11/29
[ "https://Stackoverflow.com/questions/59109965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1858796/" ]
Add the following after the handler.register call: req.setAttribute("requestMapping", "/DemoService.svc");
The best implementation of olingo2 and spring-boot can be found [here](https://github.com/jpenninkhof/odata-boilerplate). I would suggest to take a look at this repository, it is very straight forward and easy.
59,109,965
I am using [this tutorial](https://olingo.apache.org/doc/odata4/tutorials/read/tutorial_read.html) and it works for a simple java web application. Now I want to convert it to Spring Boot. I remove the web.xml and add the following two annotations to DemoServlet ``` @RestController public class DemoServlet extends Disp...
2019/11/29
[ "https://Stackoverflow.com/questions/59109965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1858796/" ]
You can create a `@Configuration` and Map your servlet in it like the following ``` @Bean public ServletRegistrationBean odataServlet() { ServletRegistrationBean odataServRegstration = new ServletRegistrationBean(new CXFNonSpringJaxrsServlet(), "/DemoService.svc/*"); Map<String, String> initParame...
Add the following after the handler.register call: req.setAttribute("requestMapping", "/DemoService.svc");
59,109,965
I am using [this tutorial](https://olingo.apache.org/doc/odata4/tutorials/read/tutorial_read.html) and it works for a simple java web application. Now I want to convert it to Spring Boot. I remove the web.xml and add the following two annotations to DemoServlet ``` @RestController public class DemoServlet extends Disp...
2019/11/29
[ "https://Stackoverflow.com/questions/59109965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1858796/" ]
You can create a `@Configuration` and Map your servlet in it like the following ``` @Bean public ServletRegistrationBean odataServlet() { ServletRegistrationBean odataServRegstration = new ServletRegistrationBean(new CXFNonSpringJaxrsServlet(), "/DemoService.svc/*"); Map<String, String> initParame...
The best implementation of olingo2 and spring-boot can be found [here](https://github.com/jpenninkhof/odata-boilerplate). I would suggest to take a look at this repository, it is very straight forward and easy.
33,163
I have an option to buy a road bike that has the height of the frame 54 cm : <https://www.willhaben.at/iad/kaufen-und-verkaufen/sport-sportgeraete/top-rennrad-ktm-strada-nur-9-3-kg-alles-shimano-ultegra-132209154/> . I am 182 cm tall. When I went to a shop and asked the "expert" about the bike, he suggested me to buy t...
2015/09/03
[ "https://bicycles.stackexchange.com/questions/33163", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/19236/" ]
I am 175cm tall. I rode a road bike recently with a 56cm frame. I it had been any bigger I wouldn't have been able to ride it safely. 54 or 52cm would have been a better fit. I suspect that a 54cm frame would be a bit small for you, but not painfully so. Get a 56 if you can.
I am 183 cm tall and ride size 55. I have relatively short legs, so I had a custom frame with longer than usual top tube made. For a person with more usual proportions a normal 56 would probably be fine. As already said, it depends on the exact dimensions and angles of that particular model.
23,578,069
Is it possible to print out the entities in a char array so one can actually see every characters that is string terminator \0 and new line \n ... for instance? Let say a string consists of the following ``` abkdfkdfmdfier\nkdfdfkdkf\n\0 ``` I want to see everything via std::cout
2014/05/10
[ "https://Stackoverflow.com/questions/23578069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2991252/" ]
I think you should write a function that creates a new string based on the old one and changes `'\n','\0'` chars to `"\\n","\\0"` strings. I may have some error but my main idea is this. Ihope this helps. ``` #include <stdio.h> #include <conio.h> #include <string.h> #include <malloc.h> #include <stdlib.h> char *mst...
Here is a solution using [isprint](http://en.cppreference.com/w/cpp/string/byte/isprint) & stream formatters: ``` #include <cctype> void print_escaped(char chr) { if (std::isprint(chr)) { std::cout << chr; } else { switch(chr) { case '\0': std::cout << "\\0"; break; case '\r': ...
23,578,069
Is it possible to print out the entities in a char array so one can actually see every characters that is string terminator \0 and new line \n ... for instance? Let say a string consists of the following ``` abkdfkdfmdfier\nkdfdfkdkf\n\0 ``` I want to see everything via std::cout
2014/05/10
[ "https://Stackoverflow.com/questions/23578069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2991252/" ]
You need to check the ASCII code of a char in string. ``` for (int i=0; i<strlen(string)+1; i++) { if (printable(string[i])) cout << string[i]; // If normal char like abc ' ' 123 !@# else { int code = string[i]; // i will write for '\n' for example switch (code) { case 0x0A...
Here is a solution using [isprint](http://en.cppreference.com/w/cpp/string/byte/isprint) & stream formatters: ``` #include <cctype> void print_escaped(char chr) { if (std::isprint(chr)) { std::cout << chr; } else { switch(chr) { case '\0': std::cout << "\\0"; break; case '\r': ...
32,169,534
I am parsing the message on robot.hear: ``` robot.hear /^\[(.+)\]$/, (res) -> json_string = res.match["input"] try params = JSON.parse json_string console.log "success" catch error console.log "error" ``` with the following results: [] -> success [1,2,3] -> success [true, false] -> success ["a...
2015/08/23
[ "https://Stackoverflow.com/questions/32169534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/798177/" ]
`["a": true]` and `['a': true]` are not valid JSON. First off, JSON only recognizes strings with double quotes, so the second one is straight out. Then, JSON objects are enclosed in braces, like `{"a": true}`, not brackets like `["a": true]`; brackets denote an array, and arrays can’t have keys, so that’s also invalid ...
Try below : [{"a": true}] [{'a': true}] You are not giving proper JSON object as input.
8,871,751
In the applications I currently write, I deal a lot with a couple of MySql databases. I know I am doing this the wrong way, so you don't need to tell me that, but how do I do this the correct way? As in, what is the correct practice for dealing with a MySql database from a .Net application. At the minute I use a class...
2012/01/15
[ "https://Stackoverflow.com/questions/8871751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/969613/" ]
First off, I'd make an interface to put between your MySql database and your code. This decouples your application from the MySql database classes; something like this: ``` public interface IDbProvider : IDisposable { void Open(); void BeginTransaction(); IDataReader ExecuteReader(string query); int Ex...
Nothing specific to MySQL in here. If you are dealing with multiple DBMS's then one way to go is to use the .net db interfaces IDbCommand, IDbConnection etc.. Put the connection string in app.config or some such. Raw SQL in your code, bad? You could look at entity frameworks, LinQToSQL, a stored procedure based desig...
8,871,751
In the applications I currently write, I deal a lot with a couple of MySql databases. I know I am doing this the wrong way, so you don't need to tell me that, but how do I do this the correct way? As in, what is the correct practice for dealing with a MySql database from a .Net application. At the minute I use a class...
2012/01/15
[ "https://Stackoverflow.com/questions/8871751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/969613/" ]
Nothing specific to MySQL in here. If you are dealing with multiple DBMS's then one way to go is to use the .net db interfaces IDbCommand, IDbConnection etc.. Put the connection string in app.config or some such. Raw SQL in your code, bad? You could look at entity frameworks, LinQToSQL, a stored procedure based desig...
Expanding TrueWill's comment: * install [fluent nhibernate](https://www.nuget.org/packages/FluentNHibernate) and dependencies with nuget * write database configuration code to [register the database connection](http://stackoverflow.com/questions/626339/how-to-configure-fluent-nhibernate-with-mysql) on application sta...
8,871,751
In the applications I currently write, I deal a lot with a couple of MySql databases. I know I am doing this the wrong way, so you don't need to tell me that, but how do I do this the correct way? As in, what is the correct practice for dealing with a MySql database from a .Net application. At the minute I use a class...
2012/01/15
[ "https://Stackoverflow.com/questions/8871751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/969613/" ]
First off, I'd make an interface to put between your MySql database and your code. This decouples your application from the MySql database classes; something like this: ``` public interface IDbProvider : IDisposable { void Open(); void BeginTransaction(); IDataReader ExecuteReader(string query); int Ex...
Expanding TrueWill's comment: * install [fluent nhibernate](https://www.nuget.org/packages/FluentNHibernate) and dependencies with nuget * write database configuration code to [register the database connection](http://stackoverflow.com/questions/626339/how-to-configure-fluent-nhibernate-with-mysql) on application sta...
35,390,692
In order to set a default-src for self it will exclude the subdomains of the origin website. ``` default-src 'self' ``` How to enable the subdomains of the self URL?
2016/02/14
[ "https://Stackoverflow.com/questions/35390692", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2034955/" ]
You need to explicitly add them with fully qualified domains: ``` default-src 'self' sub1.example.com sub2.example.com ``` Or with wildcards: ``` default-src 'self' *.example.com ```
Wanted to add one thing, the wildcard `*.mydomain.com` doesn't cover the main domain `mydomain.com` and it needs to be individually added to the policy as below. ``` default-src 'self' *.mydomain.com mydomain.com ```
7,094
What is the difference between those two words? Are they interchangeable? Could you please provide some examples of their usage?
2013/06/27
[ "https://german.stackexchange.com/questions/7094", "https://german.stackexchange.com", "https://german.stackexchange.com/users/1593/" ]
Here is from my perception: **antun** (more precisely ***jemandem etwas antun***) * formally to describe that someone was hurt (usually when directed at the victim) – connotation of dismay likely + *Wer hat ihnen das angetan?* + *Wer würde jemandem so etwas antun?* + *Wir **taten** ihnen Unaussprechliches **an**....
'Tun' is a nowadays rather uncommon word for 'To do' (notice the similarity?), sometimes also 'to put'; in some cases it has been replaced by "machen", but is still used a lot in following cases: 1. merged with other verbs as copula (antun, leidtun...) 2. when someone executes an aforementioned action, especially if t...
7,094
What is the difference between those two words? Are they interchangeable? Could you please provide some examples of their usage?
2013/06/27
[ "https://german.stackexchange.com/questions/7094", "https://german.stackexchange.com", "https://german.stackexchange.com/users/1593/" ]
I want to add one thing that is not mentioned in the other answer. As @Matthaeus is indicating, *antun* can also be used in a positive way. This usually happens in the following idioms: > > es jemandem angetan haben > > von etw./jdm. angetan sein > > > This means that you're really excited by something or so...
'Tun' is a nowadays rather uncommon word for 'To do' (notice the similarity?), sometimes also 'to put'; in some cases it has been replaced by "machen", but is still used a lot in following cases: 1. merged with other verbs as copula (antun, leidtun...) 2. when someone executes an aforementioned action, especially if t...
7,094
What is the difference between those two words? Are they interchangeable? Could you please provide some examples of their usage?
2013/06/27
[ "https://german.stackexchange.com/questions/7094", "https://german.stackexchange.com", "https://german.stackexchange.com/users/1593/" ]
'Tun' is a nowadays rather uncommon word for 'To do' (notice the similarity?), sometimes also 'to put'; in some cases it has been replaced by "machen", but is still used a lot in following cases: 1. merged with other verbs as copula (antun, leidtun...) 2. when someone executes an aforementioned action, especially if t...
In his song "Amerika" (1984), Herbert Grönemeyer plays with the constructive/destructive nature of the verb "tun": "Amerika, du hast viel für uns getan/Amerika, tu uns das nicht an." America, you did a lot for us; America, don't "undo" us; or "don't harm" us; or don't "do us in"; or, in more recent slang: "don't do us....
7,094
What is the difference between those two words? Are they interchangeable? Could you please provide some examples of their usage?
2013/06/27
[ "https://german.stackexchange.com/questions/7094", "https://german.stackexchange.com", "https://german.stackexchange.com/users/1593/" ]
Here is from my perception: **antun** (more precisely ***jemandem etwas antun***) * formally to describe that someone was hurt (usually when directed at the victim) – connotation of dismay likely + *Wer hat ihnen das angetan?* + *Wer würde jemandem so etwas antun?* + *Wir **taten** ihnen Unaussprechliches **an**....
I want to add one thing that is not mentioned in the other answer. As @Matthaeus is indicating, *antun* can also be used in a positive way. This usually happens in the following idioms: > > es jemandem angetan haben > > von etw./jdm. angetan sein > > > This means that you're really excited by something or so...
7,094
What is the difference between those two words? Are they interchangeable? Could you please provide some examples of their usage?
2013/06/27
[ "https://german.stackexchange.com/questions/7094", "https://german.stackexchange.com", "https://german.stackexchange.com/users/1593/" ]
Here is from my perception: **antun** (more precisely ***jemandem etwas antun***) * formally to describe that someone was hurt (usually when directed at the victim) – connotation of dismay likely + *Wer hat ihnen das angetan?* + *Wer würde jemandem so etwas antun?* + *Wir **taten** ihnen Unaussprechliches **an**....
In his song "Amerika" (1984), Herbert Grönemeyer plays with the constructive/destructive nature of the verb "tun": "Amerika, du hast viel für uns getan/Amerika, tu uns das nicht an." America, you did a lot for us; America, don't "undo" us; or "don't harm" us; or don't "do us in"; or, in more recent slang: "don't do us....
7,094
What is the difference between those two words? Are they interchangeable? Could you please provide some examples of their usage?
2013/06/27
[ "https://german.stackexchange.com/questions/7094", "https://german.stackexchange.com", "https://german.stackexchange.com/users/1593/" ]
I want to add one thing that is not mentioned in the other answer. As @Matthaeus is indicating, *antun* can also be used in a positive way. This usually happens in the following idioms: > > es jemandem angetan haben > > von etw./jdm. angetan sein > > > This means that you're really excited by something or so...
In his song "Amerika" (1984), Herbert Grönemeyer plays with the constructive/destructive nature of the verb "tun": "Amerika, du hast viel für uns getan/Amerika, tu uns das nicht an." America, you did a lot for us; America, don't "undo" us; or "don't harm" us; or don't "do us in"; or, in more recent slang: "don't do us....
40,747,666
I'm having a hard time understanding what this error means. The command I used was: ``` psql -U postgres -d app -1 -f postgres.sql ``` and this is the error: ``` psql:postgres.sql:1879: ERROR: current transaction is aborted, commands ignored until end of transaction block ROLLBACK psql:postgres.sql:0: WARNI...
2016/11/22
[ "https://Stackoverflow.com/questions/40747666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7177035/" ]
You can put this shape drawable inside a layer-list drawable: ``` <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <!-- black background --> <item android:drawable="@android:color/black"/> <!-- red shape on top of black background --> <...
Just place your layout inside one with black background. ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:o...
40,747,666
I'm having a hard time understanding what this error means. The command I used was: ``` psql -U postgres -d app -1 -f postgres.sql ``` and this is the error: ``` psql:postgres.sql:1879: ERROR: current transaction is aborted, commands ignored until end of transaction block ROLLBACK psql:postgres.sql:0: WARNI...
2016/11/22
[ "https://Stackoverflow.com/questions/40747666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7177035/" ]
So you have managed that curved shape I guess. To make this transparent, Use its color transparent instead of simple `red` color. Try following code with your xml. ``` <gradient android:angle="45" android:endColor="#aaF00" android:centerColor="#aaF00" android:startColor="#aaF00" /> ``` So the whole ...
You can put this shape drawable inside a layer-list drawable: ``` <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <!-- black background --> <item android:drawable="@android:color/black"/> <!-- red shape on top of black background --> <...
40,747,666
I'm having a hard time understanding what this error means. The command I used was: ``` psql -U postgres -d app -1 -f postgres.sql ``` and this is the error: ``` psql:postgres.sql:1879: ERROR: current transaction is aborted, commands ignored until end of transaction block ROLLBACK psql:postgres.sql:0: WARNI...
2016/11/22
[ "https://Stackoverflow.com/questions/40747666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7177035/" ]
So you have managed that curved shape I guess. To make this transparent, Use its color transparent instead of simple `red` color. Try following code with your xml. ``` <gradient android:angle="45" android:endColor="#aaF00" android:centerColor="#aaF00" android:startColor="#aaF00" /> ``` So the whole ...
Just place your layout inside one with black background. ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:o...
212,848
Before proceeding to calculations in Mathematica, I would like to clarify with knowledgeable people. There is an ordinary linear three-mass system. [![enter image description here](https://i.stack.imgur.com/qPodJ.gif)](https://i.stack.imgur.com/qPodJ.gif) If we write its Lagrangian, we get the following equation. [...
2020/01/14
[ "https://mathematica.stackexchange.com/questions/212848", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/67019/" ]
First let me derive the equations of motion. The Lagrangian: ``` L = Sum[1/2 Subscript[J, i] D[Subscript[\[Phi], i][t], t]^2, {i, 3}] - Sum[1/2 Subscript[c, 10 i + i + 1] (Subscript[\[Phi], i][t] - Subscript[\[Phi], i + 1][t])^2, {i, 2} ] ``` > > [![enter image description here](https://i.stack....
Below is the equation of motion of the system given in OP. You need to use the variational package in Mathematica. The equation of motion is arrived at without considering the rotational inertia. And use NDsove to find the system solution. ``` ClearAll["Global`*"]; << VariationalMethods` Needs["DifferentialEquations`N...
44,215,705
I am doing a Z80 emulator in Ada. I am implementing the JR (Jump relative) family, But I am not satisfied with my code: ``` with Ada.Text_IO; procedure main is type UInt16 is mod 2 ** 16; type UInt8 is mod 2 ** 8; type Int8 is range -128 .. 127; package UInt16_IO is new Ada.Text_IO.Modular_IO (UI...
2017/05/27
[ "https://Stackoverflow.com/questions/44215705", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5456966/" ]
You could look at ```ada function Jr (Address : UInt16; D: UInt8) return UInt16 is Offset : constant Uint16 := Uint16 (D) + (if D >= 16#80# then 16#ff00# else 0); begin return Address + Offset + 2; end Jr; ``` but it rather depends on what you need to happen when - for instance - Address is 0 and D is, sa...
In case two integer types are very closely related, at least form a certain point of view, if they only differ in the subset of values but not function, consider subtypes. I suspect that choosing subtypes might blur matters, though, from a conceptual point of view. So, if I may speculate, using your knowledge about th...
44,215,705
I am doing a Z80 emulator in Ada. I am implementing the JR (Jump relative) family, But I am not satisfied with my code: ``` with Ada.Text_IO; procedure main is type UInt16 is mod 2 ** 16; type UInt8 is mod 2 ** 8; type Int8 is range -128 .. 127; package UInt16_IO is new Ada.Text_IO.Modular_IO (UI...
2017/05/27
[ "https://Stackoverflow.com/questions/44215705", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5456966/" ]
You could look at ```ada function Jr (Address : UInt16; D: UInt8) return UInt16 is Offset : constant Uint16 := Uint16 (D) + (if D >= 16#80# then 16#ff00# else 0); begin return Address + Offset + 2; end Jr; ``` but it rather depends on what you need to happen when - for instance - Address is 0 and D is, sa...
Since Ada focuses on the type safety, the following two type definitions are not directly compatible as seen by the Ada compiler: ``` type UInt8 is mod 2 ** 8; type UInt_8 is mod 2 ** 8; ``` This is why a type conversion is needed when they are used in the same expression. One way to solve this issue is to define a ...
44,215,705
I am doing a Z80 emulator in Ada. I am implementing the JR (Jump relative) family, But I am not satisfied with my code: ``` with Ada.Text_IO; procedure main is type UInt16 is mod 2 ** 16; type UInt8 is mod 2 ** 8; type Int8 is range -128 .. 127; package UInt16_IO is new Ada.Text_IO.Modular_IO (UI...
2017/05/27
[ "https://Stackoverflow.com/questions/44215705", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5456966/" ]
You could look at ```ada function Jr (Address : UInt16; D: UInt8) return UInt16 is Offset : constant Uint16 := Uint16 (D) + (if D >= 16#80# then 16#ff00# else 0); begin return Address + Offset + 2; end Jr; ``` but it rather depends on what you need to happen when - for instance - Address is 0 and D is, sa...
I suspect that a little alteration in naming might help things out here. You could use this: ``` Subtype Address is UInt16; Function "+"( Location : Address; Offset: Int8 ) return Address is (if Offset < 0 then Location - UInt16(ABS Offset) else Location + UInt16(Offset) ); ``` Which would allow you to reform...
6,648,345
if I understand correctly - the main difference between Flash and Flex on the client's side is that Flex requires loading additional files for Flex to work. Is this the case, and if so, how much added data does Flex load up compared to Flash applications? Thanks!
2011/07/11
[ "https://Stackoverflow.com/questions/6648345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693683/" ]
Flex is actually compiling as result biger files than Flash, because of the Frameworks which adds. About the difference - it will be different, depending what actually library you have been used inside your project. Anyway - i think quality of flex framework shall be considered over the file size. The difference usua...
Flash movies created by the Flex compiler don't load any "additional files" to be loaded by some Flash Player. Even though the question in its original form is asking about loading files on the client side, I guess we can expand on what Flex is vs. Flash. Flex applications are just that, applications, so yes the small...
6,648,345
if I understand correctly - the main difference between Flash and Flex on the client's side is that Flex requires loading additional files for Flex to work. Is this the case, and if so, how much added data does Flex load up compared to Flash applications? Thanks!
2011/07/11
[ "https://Stackoverflow.com/questions/6648345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693683/" ]
The overhead that Flex brings in is significant. You can do this experiment: Create an empty project in Flash Builder and then Flash CS5 and compile it. The Flex project is 1024 KBytes. The app itself comes in at 41 KB and the rest is mostly in the Flex framework, the Spark framework, and the text layout libraries. (R...
Flash movies created by the Flex compiler don't load any "additional files" to be loaded by some Flash Player. Even though the question in its original form is asking about loading files on the client side, I guess we can expand on what Flex is vs. Flash. Flex applications are just that, applications, so yes the small...
6,648,345
if I understand correctly - the main difference between Flash and Flex on the client's side is that Flex requires loading additional files for Flex to work. Is this the case, and if so, how much added data does Flex load up compared to Flash applications? Thanks!
2011/07/11
[ "https://Stackoverflow.com/questions/6648345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693683/" ]
Flex is actually compiling as result biger files than Flash, because of the Frameworks which adds. About the difference - it will be different, depending what actually library you have been used inside your project. Anyway - i think quality of flex framework shall be considered over the file size. The difference usua...
The overhead that Flex brings in is significant. You can do this experiment: Create an empty project in Flash Builder and then Flash CS5 and compile it. The Flex project is 1024 KBytes. The app itself comes in at 41 KB and the rest is mostly in the Flex framework, the Spark framework, and the text layout libraries. (R...
6,648,345
if I understand correctly - the main difference between Flash and Flex on the client's side is that Flex requires loading additional files for Flex to work. Is this the case, and if so, how much added data does Flex load up compared to Flash applications? Thanks!
2011/07/11
[ "https://Stackoverflow.com/questions/6648345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693683/" ]
Flex is actually compiling as result biger files than Flash, because of the Frameworks which adds. About the difference - it will be different, depending what actually library you have been used inside your project. Anyway - i think quality of flex framework shall be considered over the file size. The difference usua...
Flex 3 introduced the "framework RSL" feature which allows the Flex framework to be loaded separately from the main application SWF. This brings about a significant reduction in overall Flex application size: <http://ted.onflash.org/2007/06/flex-3-thursday-dramatically-smaller.php> The other benefit to the RSL archit...
6,648,345
if I understand correctly - the main difference between Flash and Flex on the client's side is that Flex requires loading additional files for Flex to work. Is this the case, and if so, how much added data does Flex load up compared to Flash applications? Thanks!
2011/07/11
[ "https://Stackoverflow.com/questions/6648345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693683/" ]
The overhead that Flex brings in is significant. You can do this experiment: Create an empty project in Flash Builder and then Flash CS5 and compile it. The Flex project is 1024 KBytes. The app itself comes in at 41 KB and the rest is mostly in the Flex framework, the Spark framework, and the text layout libraries. (R...
Flex 3 introduced the "framework RSL" feature which allows the Flex framework to be loaded separately from the main application SWF. This brings about a significant reduction in overall Flex application size: <http://ted.onflash.org/2007/06/flex-3-thursday-dramatically-smaller.php> The other benefit to the RSL archit...
2,984,264
For ex. $\binom{n}{n}$ = $\binom{n-1}{n-1}$ + $\binom{n-1}{n}$ according to the rule $\binom{n}{i}$ = $\binom{n-1}{i-1}$ + $\binom{n-1}{i}$
2018/11/04
[ "https://math.stackexchange.com/questions/2984264", "https://math.stackexchange.com", "https://math.stackexchange.com/users/562492/" ]
Yes, and it's not an arbitrary "convention". By definition, $$\binom x{n+1}=\frac{x(x-1)(x-2)\cdots(x-n)}{(n+1)!},$$ a polynomial of degree $n+1$ with zeros at $x=0,1,2,\dots,n$.
Defining $\binom{n}{k}$ as the number of size-$k$ subsets of a size-$n$ set, your statement is indeed correct. You can even keep the usual formula in terms of factorials, viz. $\frac{1}{(-1)!}=\frac{1}{\infty}=0$.
218,247
Is potential energy calculated between a system? More specifically, if we say 'potential energy of a ball with respect to earth', does it mean that the Earth + the ball is a system?
2015/11/13
[ "https://physics.stackexchange.com/questions/218247", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/98369/" ]
Potential energy is the energy due to configuration of the system. If you keep three charges very, very far from each other, then the potential energy of the system is very effectively zero. But when you bring them close together to a specified coordinate, then the **potential energy of the system** increases from ...
Potential Energy is calculated of a system, ie, a system possesses potential energy and the capacity to do work with it. If you a raise a ball of weight *mg* to a height *h* above the surface of the earth, then the total potential energy of the ball will be *PE = mgh* as you have done work against the gravity of the ea...
20,251,285
I was wondering how to make a button move like up, down, right, or left, by touching an arrow key on my keyboard. I have tried: ``` button1.Location.X += 1; ``` But, I get an error saying how it's not a variable. So, I also tried: ``` public int xPos, yPos; ``` Then, down a bit under form1\_keydown: ``` xPos = C...
2013/11/27
[ "https://Stackoverflow.com/questions/20251285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2997877/" ]
I oversimplify a little bit to make it clear (and I skip all checks you have to do) but it may be something like this: ``` switch (e.KeyData) { case Keys.Right: button1.Location = new Point(button1.Left + 1, button1.Top); break; case Keys.Left: button1.Location = new Point(button1.Left ...
You should do: ``` button1.Location = new Point(button1.Location.X + 1, button1.Location.Y); ```
20,251,285
I was wondering how to make a button move like up, down, right, or left, by touching an arrow key on my keyboard. I have tried: ``` button1.Location.X += 1; ``` But, I get an error saying how it's not a variable. So, I also tried: ``` public int xPos, yPos; ``` Then, down a bit under form1\_keydown: ``` xPos = C...
2013/11/27
[ "https://Stackoverflow.com/questions/20251285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2997877/" ]
I oversimplify a little bit to make it clear (and I skip all checks you have to do) but it may be something like this: ``` switch (e.KeyData) { case Keys.Right: button1.Location = new Point(button1.Left + 1, button1.Top); break; case Keys.Left: button1.Location = new Point(button1.Left ...
You need to create a new location for your button, you cannot modify only X or Y because `Point` (The `Location` property type) is a `struct`. You can do this, for example, on the `KeyUp` event of your form (Don't forget to actually wire the event, and not just copy/paste): ``` private void OnKeyUp(object sender, Key...
58,060,261
I am converting some jQuery code to React.JS, but got stuck due to jQuery "this" selector. ``` $('.nav-cart-options-toggle').on('click', function() { $(this).toggleClass('show'); $(this) .closest('.nav-cart-options') .find('ul') .toggle(); }); ``` I was able to do the toggling using React, but it i...
2019/09/23
[ "https://Stackoverflow.com/questions/58060261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6893979/" ]
Save the ID of every user who liked for every post and then check if that person already like it? Then you can just count the amount of people who liked.
You can do something like this: ``` boolean canClick = true; // inside the click event if (canClick) canClick = false; // when the click event ends: canClick = true; ```
58,060,261
I am converting some jQuery code to React.JS, but got stuck due to jQuery "this" selector. ``` $('.nav-cart-options-toggle').on('click', function() { $(this).toggleClass('show'); $(this) .closest('.nav-cart-options') .find('ul') .toggle(); }); ``` I was able to do the toggling using React, but it i...
2019/09/23
[ "https://Stackoverflow.com/questions/58060261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6893979/" ]
Save the ID of every user who liked for every post and then check if that person already like it? Then you can just count the amount of people who liked.
You can use `btn.setEnabled(false);` & `btn.setEnabled(true);` to control multiple click
2,710,458
I am writing a custom Swing component with my own painting. I'd like to query whether or not the current look and feel's components are opaque, and if so, what their background color is so my component can use it too. I'm having a hard time finding that on Google. Anyone know? Thanks!
2010/04/26
[ "https://Stackoverflow.com/questions/2710458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/316760/" ]
You can't have multiple names for same action. It will be different actions. This is the way how mvc works. Mabe it's better to implement described behaviour with routing. ``` routes.MapRoute("Lang1RouteToController1Action1", "Lang1Controller/Lang1Action/{id}", new { controller = "Home", action = "Index", id = UrlPa...
I'm not sure if having multiple action names is possible. One way I could think of doing this is by defining multiple actions with different names that internal cal/execute the same action.
2,710,458
I am writing a custom Swing component with my own painting. I'd like to query whether or not the current look and feel's components are opaque, and if so, what their background color is so my component can use it too. I'm having a hard time finding that on Google. Anyone know? Thanks!
2010/04/26
[ "https://Stackoverflow.com/questions/2710458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/316760/" ]
I know I'm late to the party but in in case someone is googling, I created an attribute (inspired from ActionName attribute) that matches multiple names as follows: ``` using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Web.Mvc; [AttributeUsage(AttributeTargets.Me...
I'm not sure if having multiple action names is possible. One way I could think of doing this is by defining multiple actions with different names that internal cal/execute the same action.
2,710,458
I am writing a custom Swing component with my own painting. I'd like to query whether or not the current look and feel's components are opaque, and if so, what their background color is so my component can use it too. I'm having a hard time finding that on Google. Anyone know? Thanks!
2010/04/26
[ "https://Stackoverflow.com/questions/2710458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/316760/" ]
You can't have multiple names for same action. It will be different actions. This is the way how mvc works. Mabe it's better to implement described behaviour with routing. ``` routes.MapRoute("Lang1RouteToController1Action1", "Lang1Controller/Lang1Action/{id}", new { controller = "Home", action = "Index", id = UrlPa...
I know I'm late to the party but in in case someone is googling, I created an attribute (inspired from ActionName attribute) that matches multiple names as follows: ``` using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Web.Mvc; [AttributeUsage(AttributeTargets.Me...
14,742,651
Say I have two tables: ``` CREATE TABLE state ( id TINYINT, state CHAR(2), PRIMARY KEY (id) ); CREATE TABLE valid_state ( id INT, state CHAR(2), # or stateId TINYINT or whatever productId INT ); ``` If a product can only be sold in CA it'll have a single entry in valid\_state. If it can be s...
2013/02/07
[ "https://Stackoverflow.com/questions/14742651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/569976/" ]
One way you can accomplish this is with using `UNION` and `NOT EXISTS`: ``` SELECT DISTINCT S.Id, S.State FROM State S JOIN valid_state V ON S.State = V.State AND V.ProductId = @ProductId UNION SELECT DISTINCT S.Id, S.State FROM State S WHERE NOT EXISTS (SELECT * FROM valid_state WHERE ProductId = @Produc...
I came up with a different approach. I get all the states and mark which of those is valid for a given product with the first LEFT JOIN. With the second LEFT JOIN I take the all the states that product is valid for and join together. Without the V.id = V2.id I'd have valid\_states \* 2 rows returned but with it I jus...
63,481,213
I'm trying to wrap a ValueListenableBuilder around a Textfield which has a functionality of taking input text and returning the same text. The original purpose is to persist the input data through a database. But while implementing the basic code given below, I'm getting the error "Expected a value of type 'TextEditing...
2020/08/19
[ "https://Stackoverflow.com/questions/63481213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14129669/" ]
You are not pass a TextEditingController to the TextField ```dart ValueListenableBuilder( valueListenable: _controller, builder: (BuildContext context, _controller, _ ) { // this _controller is not equal to the valueListenable: _controller above, it means _controller.value ...
You should do the following: ``` import 'package:flutter/material.dart'; void main() => runApp(MyTextFieldApp()); class MyTextFieldApp extends StatelessWidget { final _controller = TextEditingController(); final ValueNotifier valueNotifier = ValueNotifier("initial"); @override Widget build(BuildContext cont...
63,481,213
I'm trying to wrap a ValueListenableBuilder around a Textfield which has a functionality of taking input text and returning the same text. The original purpose is to persist the input data through a database. But while implementing the basic code given below, I'm getting the error "Expected a value of type 'TextEditing...
2020/08/19
[ "https://Stackoverflow.com/questions/63481213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14129669/" ]
You are not pass a TextEditingController to the TextField ```dart ValueListenableBuilder( valueListenable: _controller, builder: (BuildContext context, _controller, _ ) { // this _controller is not equal to the valueListenable: _controller above, it means _controller.value ...
If you wanna use `TextEditingController` with `ValueNotifier` to handle real time when user input anything in `TextField/TextFormField` like picture below: [![enter image description here](https://i.stack.imgur.com/nQAmi.png)](https://i.stack.imgur.com/nQAmi.png) [![enter image description here](https://i.stack.imgur...
63,481,213
I'm trying to wrap a ValueListenableBuilder around a Textfield which has a functionality of taking input text and returning the same text. The original purpose is to persist the input data through a database. But while implementing the basic code given below, I'm getting the error "Expected a value of type 'TextEditing...
2020/08/19
[ "https://Stackoverflow.com/questions/63481213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14129669/" ]
You should do the following: ``` import 'package:flutter/material.dart'; void main() => runApp(MyTextFieldApp()); class MyTextFieldApp extends StatelessWidget { final _controller = TextEditingController(); final ValueNotifier valueNotifier = ValueNotifier("initial"); @override Widget build(BuildContext cont...
If you wanna use `TextEditingController` with `ValueNotifier` to handle real time when user input anything in `TextField/TextFormField` like picture below: [![enter image description here](https://i.stack.imgur.com/nQAmi.png)](https://i.stack.imgur.com/nQAmi.png) [![enter image description here](https://i.stack.imgur...
59,413,151
I have the following two DataFrames (df1 and df2 respectively): ``` df1 = Type Price Size Dates 2019-08-16 00:00:34 TRADE 130.859375 1 2019-08-16 00:00:57 TRADE 130.859375 5 2019-08-16 00:00:57 TRADE 130.859375 2 2019-08-16 00:01:0...
2019/12/19
[ "https://Stackoverflow.com/questions/59413151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3911832/" ]
You can also alternatively use the JasperReports Server docker from bitnami, which uses the CE version of the server: <https://github.com/bitnami/bitnami-docker-jasperreports>
You need to make changes to the js-docker Docker files, shell scripts and roll your own Docker Compose file, for example: ``` version: '3.7' services: postgres: container_name: postgres build: context: ./services/postgres dockerfile: Dockerfile ports: - "5432:5432" volumes: ...
133,628
When using ArrayPlot with both `PixelConstrained->True` and `Mesh->True`, the lower and right walls of the mesh both drop out: `ArrayPlot[Table[Mod[Ceiling[i/2] + Ceiling[j/2], 2], {i, 8}, {j, 8}], PixelConstrained -> 8, Mesh -> True]` [![missing walls](https://i.stack.imgur.com/feVfe.gif)](https://i.stack.imgur.com...
2016/12/16
[ "https://mathematica.stackexchange.com/questions/133628", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/36771/" ]
Found a solution myself, although I had to get a bit creative: `ImageTake[ArrayPlot[ArrayPad[Table[Mod[Ceiling[i/2] + Ceiling[j/2], 2], {i, 8}, {j, 8}], 1], PixelConstrained -> 8, Mesh -> True], {9, -8}, {9, -8}]` [![crop](https://i.stack.imgur.com/lCp0z.gif)](https://i.stack.imgur.com/lCp0z.gif) In a more general f...
This seems to work in the example provided. Please test it and tell me if it fails. ``` fixPC = Show[#, PlotRangePadding -> 1, ImageSize -> 2 + PlotRange[#][[All, 2]]] &; ArrayPlot[ Array[Mod[⌈#/2⌉ + ⌈#2/2⌉, 2] &, {8, 8}] , Mesh -> True , PixelConstrained -> 12 ] // fixPC ``` [![enter image description here](...
133,628
When using ArrayPlot with both `PixelConstrained->True` and `Mesh->True`, the lower and right walls of the mesh both drop out: `ArrayPlot[Table[Mod[Ceiling[i/2] + Ceiling[j/2], 2], {i, 8}, {j, 8}], PixelConstrained -> 8, Mesh -> True]` [![missing walls](https://i.stack.imgur.com/feVfe.gif)](https://i.stack.imgur.com...
2016/12/16
[ "https://mathematica.stackexchange.com/questions/133628", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/36771/" ]
Instead of using `PixelConstrained -> 8`, use the undocumented (but not going away) syntax `ImageSize -> 1 -> 8`. For your first example: ``` ArrayPlot[ Table[Mod[Ceiling[i/2]+Ceiling[j/2],2],{i,8},{j,8}], ImageSize -> 1 -> 8, Mesh -> True ] ``` [![enter image description here](https://i.stack.imgur.com/...
This seems to work in the example provided. Please test it and tell me if it fails. ``` fixPC = Show[#, PlotRangePadding -> 1, ImageSize -> 2 + PlotRange[#][[All, 2]]] &; ArrayPlot[ Array[Mod[⌈#/2⌉ + ⌈#2/2⌉, 2] &, {8, 8}] , Mesh -> True , PixelConstrained -> 12 ] // fixPC ``` [![enter image description here](...
19,051,942
I have this super simple piece of code: ``` <body> <div style="position:fixed; width: 100%; height: 40px; background: #333"></div> <div style='margin-top:40px; border: 1px solid green'> Some contents!<br>Some contents!<br>Some contents!<br> </div> </body> ``` But somehow the fixed div has a margin of 40px and ove...
2013/09/27
[ "https://Stackoverflow.com/questions/19051942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1572953/" ]
You have a `position:absolute` set against the top div with no `top:0` position set. Try this: ``` <body> <div style="position:absolute; width: 100%; height: 40px; background: #333; top: 0"></div> <div style='margin-top:40px; border: 1px solid green'> Some contents!<br>Some contents!<br>Some contents!<br> </div> </b...
Add a top, left, right, or bottom css attribute to the fixed div. For example ``` { top: 0; /*Fixes it to the top*/ } ```
7,493,863
I'm a new bee in android programming. Do you have any ideas on how to read a PDF file programmatically if the file is from the assets directory?Any help would be appreciated.
2011/09/21
[ "https://Stackoverflow.com/questions/7493863", "https://Stackoverflow.com", "https://Stackoverflow.com/users/956465/" ]
The biggest single piece of advice I would give is to first build your application using good programming practices, and then use a profiler to see what is taking the most time in your application. If you start out trying to make everything go as fast as possible you will waste all your time on things that don't really...
As far as performance in concerned, your best bet is to go with ASP.NET MVC to avoid the page size overhead generated by the ViewState. In and of itself, MVC won't make your application performant, but it will definitely allow more flexibility than ASP.NET WebForms will when it comes to squeezing out those last few mi...
11,345,387
How would you implement a jsp site containing a text area which shows a log file on the (tomcat) server and refreshes automatically. I think the refresh is simple to poll to the server using setTimeout and sending an ajax request. But the problem is how to monitor the file on the server (it is a Log4J Logfile - maybe ...
2012/07/05
[ "https://Stackoverflow.com/questions/11345387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1504118/" ]
[ajax](/questions/tagged/ajax "show questions tagged 'ajax'") and polling the server every few seconds is a good idea, but using [comet](/questions/tagged/comet "show questions tagged 'comet'")/[server-push](/questions/tagged/server-push "show questions tagged 'server-push'")/[websocket](/questions/tagged/websocket "sh...
There's a taglib for that: <http://www.servletsuite.com/servlets/tailtag.htm> Put the jar in WEB-INF/lib, the tld in WEB-INF/tags, and you can use: ``` <%@ taglib uri="taglib.tld" prefix="t" %> <!-- read last 50 rows and print them --> <t:tail file="c:/webserver/log.txt" count="50" id="S"> <br><%=S%> </t:tail>...
11,345,387
How would you implement a jsp site containing a text area which shows a log file on the (tomcat) server and refreshes automatically. I think the refresh is simple to poll to the server using setTimeout and sending an ajax request. But the problem is how to monitor the file on the server (it is a Log4J Logfile - maybe ...
2012/07/05
[ "https://Stackoverflow.com/questions/11345387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1504118/" ]
[ajax](/questions/tagged/ajax "show questions tagged 'ajax'") and polling the server every few seconds is a good idea, but using [comet](/questions/tagged/comet "show questions tagged 'comet'")/[server-push](/questions/tagged/server-push "show questions tagged 'server-push'")/[websocket](/questions/tagged/websocket "sh...
Very good solutions that I didn't know are mention in the thread, here is another one that I found in google- [stail](http://code.google.com/p/stail/)
11,345,387
How would you implement a jsp site containing a text area which shows a log file on the (tomcat) server and refreshes automatically. I think the refresh is simple to poll to the server using setTimeout and sending an ajax request. But the problem is how to monitor the file on the server (it is a Log4J Logfile - maybe ...
2012/07/05
[ "https://Stackoverflow.com/questions/11345387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1504118/" ]
[ajax](/questions/tagged/ajax "show questions tagged 'ajax'") and polling the server every few seconds is a good idea, but using [comet](/questions/tagged/comet "show questions tagged 'comet'")/[server-push](/questions/tagged/server-push "show questions tagged 'server-push'")/[websocket](/questions/tagged/websocket "sh...
no tail/ajax but there is this [jsp file browser](http://www.vonloesch.de/filebrowser.html)
11,345,387
How would you implement a jsp site containing a text area which shows a log file on the (tomcat) server and refreshes automatically. I think the refresh is simple to poll to the server using setTimeout and sending an ajax request. But the problem is how to monitor the file on the server (it is a Log4J Logfile - maybe ...
2012/07/05
[ "https://Stackoverflow.com/questions/11345387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1504118/" ]
[ajax](/questions/tagged/ajax "show questions tagged 'ajax'") and polling the server every few seconds is a good idea, but using [comet](/questions/tagged/comet "show questions tagged 'comet'")/[server-push](/questions/tagged/server-push "show questions tagged 'server-push'")/[websocket](/questions/tagged/websocket "sh...
Tailer provided by Jakarta Common IO library might be helpful. Tailer can act as producer and GUI polling can be consumer. <http://alvinalexander.com/java/jwarehouse/commons-io-2.0/src/test/java/org/apache/commons/io/input/TailerTest.java.shtml>
11,345,387
How would you implement a jsp site containing a text area which shows a log file on the (tomcat) server and refreshes automatically. I think the refresh is simple to poll to the server using setTimeout and sending an ajax request. But the problem is how to monitor the file on the server (it is a Log4J Logfile - maybe ...
2012/07/05
[ "https://Stackoverflow.com/questions/11345387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1504118/" ]
no tail/ajax but there is this [jsp file browser](http://www.vonloesch.de/filebrowser.html)
There's a taglib for that: <http://www.servletsuite.com/servlets/tailtag.htm> Put the jar in WEB-INF/lib, the tld in WEB-INF/tags, and you can use: ``` <%@ taglib uri="taglib.tld" prefix="t" %> <!-- read last 50 rows and print them --> <t:tail file="c:/webserver/log.txt" count="50" id="S"> <br><%=S%> </t:tail>...
11,345,387
How would you implement a jsp site containing a text area which shows a log file on the (tomcat) server and refreshes automatically. I think the refresh is simple to poll to the server using setTimeout and sending an ajax request. But the problem is how to monitor the file on the server (it is a Log4J Logfile - maybe ...
2012/07/05
[ "https://Stackoverflow.com/questions/11345387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1504118/" ]
no tail/ajax but there is this [jsp file browser](http://www.vonloesch.de/filebrowser.html)
Very good solutions that I didn't know are mention in the thread, here is another one that I found in google- [stail](http://code.google.com/p/stail/)
11,345,387
How would you implement a jsp site containing a text area which shows a log file on the (tomcat) server and refreshes automatically. I think the refresh is simple to poll to the server using setTimeout and sending an ajax request. But the problem is how to monitor the file on the server (it is a Log4J Logfile - maybe ...
2012/07/05
[ "https://Stackoverflow.com/questions/11345387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1504118/" ]
no tail/ajax but there is this [jsp file browser](http://www.vonloesch.de/filebrowser.html)
Tailer provided by Jakarta Common IO library might be helpful. Tailer can act as producer and GUI polling can be consumer. <http://alvinalexander.com/java/jwarehouse/commons-io-2.0/src/test/java/org/apache/commons/io/input/TailerTest.java.shtml>
40,158,875
I am trying to get Ansible to deploy resources to the Azure cloud and I am having an error while getting it in to work. I have a fresh install of Ubuntu 14.04 I have installed ansible by running the following: ``` - sudo apt-get install software-properties-common - sudo apt-add-repository ppa:ansible/ansible - sud...
2016/10/20
[ "https://Stackoverflow.com/questions/40158875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7048875/" ]
**New answer for Ansible 3.0+ / ansible-core 2.10+:** To install Azure support, use the [Ansible Azure collection](https://galaxy.ansible.com/azure/azcollection) as follows: ``` # Install dependencies curl -O https://raw.githubusercontent.com/ansible-collections/azure/dev/requirements-azure.txt pip install -r require...
Ansible suggestion in this error message is really confusing. Usually you need to add a few more packages besides `azure==2.0.0rc5`. Pay attention to the package name given in the following part of the message: > > No module named **enum** > > > So in this case try: ``` sudo pip install enum ``` One thing to ...
1,018,827
In a quantum mechanics project I encountered the following definite integral: $$I(x) = \int\_0^\infty \sin(xt) \frac{t^2}{(1 + t^2)^2} \ dt$$ It appears deceptively simple, but gives me headaches.... The integration over variable $t$ runs from zero to +infinity. It would be nice if one could extend the integration ...
2014/11/12
[ "https://math.stackexchange.com/questions/1018827", "https://math.stackexchange.com", "https://math.stackexchange.com/users/30735/" ]
According to Maple, $$\int\_0^\infty \dfrac{\sin(x t) t^2}{(1+t^2)^2}\; dt = \dfrac{\sinh \left( x \right) x+\cosh \left( x \right)}{2} {\it Shi} \left( x \right) - \dfrac{ \cosh \left( x \right) x +\sinh \left( x \right) }{4} {\it Ei} \left( x \right)- \dfrac{ \cosh \left( x \right) x +\sinh \left( x \right) }{4...
This is what Mathematica finds: ``` 1/4 Sqrt[\[Pi]] x MeijerG[{{-1}, {}}, {{0, 0}, {-(1/2)}}, x^2/4] ```
1,018,827
In a quantum mechanics project I encountered the following definite integral: $$I(x) = \int\_0^\infty \sin(xt) \frac{t^2}{(1 + t^2)^2} \ dt$$ It appears deceptively simple, but gives me headaches.... The integration over variable $t$ runs from zero to +infinity. It would be nice if one could extend the integration ...
2014/11/12
[ "https://math.stackexchange.com/questions/1018827", "https://math.stackexchange.com", "https://math.stackexchange.com/users/30735/" ]
Since the inverse Laplace transform of $\frac{t^2}{(1+t^2)^2}$ is $\frac{1}{2}\left(x\cos x +\sin x\right)$, we have: $$ I = \frac{1}{2}\int\_{0}^{+\infty}\sin(xt)\int\_{0}^{+\infty}\left(y\cos y +\sin y\right)e^{-yt}\,dy\,dt$$ and switching the order of integration: $$ I = \frac{1}{2}\int\_{0}^{+\infty}\frac{x\left...
This is what Mathematica finds: ``` 1/4 Sqrt[\[Pi]] x MeijerG[{{-1}, {}}, {{0, 0}, {-(1/2)}}, x^2/4] ```
1,018,827
In a quantum mechanics project I encountered the following definite integral: $$I(x) = \int\_0^\infty \sin(xt) \frac{t^2}{(1 + t^2)^2} \ dt$$ It appears deceptively simple, but gives me headaches.... The integration over variable $t$ runs from zero to +infinity. It would be nice if one could extend the integration ...
2014/11/12
[ "https://math.stackexchange.com/questions/1018827", "https://math.stackexchange.com", "https://math.stackexchange.com/users/30735/" ]
According to Maple, $$\int\_0^\infty \dfrac{\sin(x t) t^2}{(1+t^2)^2}\; dt = \dfrac{\sinh \left( x \right) x+\cosh \left( x \right)}{2} {\it Shi} \left( x \right) - \dfrac{ \cosh \left( x \right) x +\sinh \left( x \right) }{4} {\it Ei} \left( x \right)- \dfrac{ \cosh \left( x \right) x +\sinh \left( x \right) }{4...
Let $~F(x)=\displaystyle\int\_0^\infty\frac{\sin(xt)}{t^2+a}dt.\quad$ Then $~I(x)=\bigg[\dfrac{d^2}{dx^2}\dfrac{d}{da}F(x)\bigg]\_{a~{\large=}~1}\quad$ Unfortunately, unlike its cosine equivalent, $F(x)$ does not possess a closed form in terms of known constants. If, on the other hand, your integral would've been $...
1,018,827
In a quantum mechanics project I encountered the following definite integral: $$I(x) = \int\_0^\infty \sin(xt) \frac{t^2}{(1 + t^2)^2} \ dt$$ It appears deceptively simple, but gives me headaches.... The integration over variable $t$ runs from zero to +infinity. It would be nice if one could extend the integration ...
2014/11/12
[ "https://math.stackexchange.com/questions/1018827", "https://math.stackexchange.com", "https://math.stackexchange.com/users/30735/" ]
Since the inverse Laplace transform of $\frac{t^2}{(1+t^2)^2}$ is $\frac{1}{2}\left(x\cos x +\sin x\right)$, we have: $$ I = \frac{1}{2}\int\_{0}^{+\infty}\sin(xt)\int\_{0}^{+\infty}\left(y\cos y +\sin y\right)e^{-yt}\,dy\,dt$$ and switching the order of integration: $$ I = \frac{1}{2}\int\_{0}^{+\infty}\frac{x\left...
Let $~F(x)=\displaystyle\int\_0^\infty\frac{\sin(xt)}{t^2+a}dt.\quad$ Then $~I(x)=\bigg[\dfrac{d^2}{dx^2}\dfrac{d}{da}F(x)\bigg]\_{a~{\large=}~1}\quad$ Unfortunately, unlike its cosine equivalent, $F(x)$ does not possess a closed form in terms of known constants. If, on the other hand, your integral would've been $...
53,963,358
I'm trying to print only one of the elements of this COBOL table, but it seems I'm having trouble in understanding how arrays (tables) in COBOL work! ``` data division. working-storage section. 01 m-airlines. 05 m-united occurs 3 times. 10 m-u-a330 pic 9(1) value 3. 10 m-u-...
2018/12/28
[ "https://Stackoverflow.com/questions/53963358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7802354/" ]
These are the tables your code generates. This isn't what you intented. ``` +-------------+-------------+-------------+ m-united(1): | m-u-a330(1) | m-u-a321(1) | m-u-a300(1) | +-------------+-------------+-------------+ m-united(2): | m-u-a330(2) | m-u-a321(2) | m-u-a300(2) | +...
As per the code, you've two table elements (or) 2 one dimensional tables, `m-united` and `m-delta`. To refer to an item in a table, you should use the data-name of the table element, along with its occurence number(subscript) in parentheses. This is called as **Subscripting**. As @Bruce Martin mentioned in the comments...
72,385,882
I'm trying to make a class selecting system and I have 2 scriptable objects one for the player and the other for classes and I'm trying to figure out how to change the values in `PlayerSettings` to the ones in `BaseClass` when a class is selected. ```cs public class BaseClass : ScriptableObject { public float heal...
2022/05/26
[ "https://Stackoverflow.com/questions/72385882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19202752/" ]
The thing throwing you off is that you don't need to put all your code into a function. Your code could (and should) be rewritten as this: ```py sum = a + b print(sum) ``` This code will do the exact same thing. **A function, by definition, is a block of code that is given a name**, so you can use it multiple times ...
When you define a function with `def`, all you're doing is telling Python that your function exists. If you only had that `def` block and didn't call `myFunc()` at the end, Python would simply have gone, "Okay, your function exists. Neat." What you want is not only to tell Python about the function but instruct Python...
10,458
In school we are taught the vowels: A, E, I, O, U, and sometimes Y. [Today's XKCD](http://xkcd.com/853/) got me thinking about when the letter *Y* is considered to be a vowel. I understand (perhaps incorrectly) that in words like *bicycle* and *why* it is a vowel. What about the word *voyeur* (as mentioned in the XKC...
2011/01/28
[ "https://english.stackexchange.com/questions/10458", "https://english.stackexchange.com", "https://english.stackexchange.com/users/380/" ]
The answer is that it depends on what purpose you have in assigning it, or what set of rules you are following. From the point of view of phonetics, the first thing to realise is that letters are not vowels or consonants: they represent sounds which may be vowels or consonants (and in the case of "y" possibly both). ...
The following excerpt from [decoz.com](http://www.decoz.com/Y_vowel-consonant.htm) sounds useful: > > When determining if the Y is a vowel > or a consonant, the basic rule is > this: > > > When the letter serves as a vowel, and > in fact sounds like one, it is a > vowel. The same is true when the Y > serves as...
10,458
In school we are taught the vowels: A, E, I, O, U, and sometimes Y. [Today's XKCD](http://xkcd.com/853/) got me thinking about when the letter *Y* is considered to be a vowel. I understand (perhaps incorrectly) that in words like *bicycle* and *why* it is a vowel. What about the word *voyeur* (as mentioned in the XKC...
2011/01/28
[ "https://english.stackexchange.com/questions/10458", "https://english.stackexchange.com", "https://english.stackexchange.com/users/380/" ]
The following excerpt from [decoz.com](http://www.decoz.com/Y_vowel-consonant.htm) sounds useful: > > When determining if the Y is a vowel > or a consonant, the basic rule is > this: > > > When the letter serves as a vowel, and > in fact sounds like one, it is a > vowel. The same is true when the Y > serves as...
Also not being an English speaker, I mostly seem to default to the logic used with an *i* in Latin. That *i* acts like a consonant *j* when it appears before another vowel (except for diphthongs). Consequently, the Latin alphabet did not officially have a *j*. As far as I can tell, this is the case with the *y* in Eng...
10,458
In school we are taught the vowels: A, E, I, O, U, and sometimes Y. [Today's XKCD](http://xkcd.com/853/) got me thinking about when the letter *Y* is considered to be a vowel. I understand (perhaps incorrectly) that in words like *bicycle* and *why* it is a vowel. What about the word *voyeur* (as mentioned in the XKC...
2011/01/28
[ "https://english.stackexchange.com/questions/10458", "https://english.stackexchange.com", "https://english.stackexchange.com/users/380/" ]
Y can make 4 sounds: a hard *y*, as in **yield** (in this case, it is a consonant, it's most common use) a short *i* sound, as in **bicycle** a long *i* sound, as in **my** a long *e* sound, as in **baby** In the last three cases it is used just as the letter *i* would be, and so it is a vowel. It can als...
The following excerpt from [decoz.com](http://www.decoz.com/Y_vowel-consonant.htm) sounds useful: > > When determining if the Y is a vowel > or a consonant, the basic rule is > this: > > > When the letter serves as a vowel, and > in fact sounds like one, it is a > vowel. The same is true when the Y > serves as...
10,458
In school we are taught the vowels: A, E, I, O, U, and sometimes Y. [Today's XKCD](http://xkcd.com/853/) got me thinking about when the letter *Y* is considered to be a vowel. I understand (perhaps incorrectly) that in words like *bicycle* and *why* it is a vowel. What about the word *voyeur* (as mentioned in the XKC...
2011/01/28
[ "https://english.stackexchange.com/questions/10458", "https://english.stackexchange.com", "https://english.stackexchange.com/users/380/" ]
The letter *y* represents the consonant /j/ (as in *yes*), known variously as a palatal glide, a palatal approximant and a palatal semi-vowel. It also represents the vowels /ɪ/ (as in *hymn*) or in some dialects /i:/ (as in *trendy*) and, alone or in combination, it represents the diphthongs /aɪ/ (as in *try*), /ɔɪ/ (a...
The following excerpt from [decoz.com](http://www.decoz.com/Y_vowel-consonant.htm) sounds useful: > > When determining if the Y is a vowel > or a consonant, the basic rule is > this: > > > When the letter serves as a vowel, and > in fact sounds like one, it is a > vowel. The same is true when the Y > serves as...
10,458
In school we are taught the vowels: A, E, I, O, U, and sometimes Y. [Today's XKCD](http://xkcd.com/853/) got me thinking about when the letter *Y* is considered to be a vowel. I understand (perhaps incorrectly) that in words like *bicycle* and *why* it is a vowel. What about the word *voyeur* (as mentioned in the XKC...
2011/01/28
[ "https://english.stackexchange.com/questions/10458", "https://english.stackexchange.com", "https://english.stackexchange.com/users/380/" ]
The answer is that it depends on what purpose you have in assigning it, or what set of rules you are following. From the point of view of phonetics, the first thing to realise is that letters are not vowels or consonants: they represent sounds which may be vowels or consonants (and in the case of "y" possibly both). ...
Also not being an English speaker, I mostly seem to default to the logic used with an *i* in Latin. That *i* acts like a consonant *j* when it appears before another vowel (except for diphthongs). Consequently, the Latin alphabet did not officially have a *j*. As far as I can tell, this is the case with the *y* in Eng...
10,458
In school we are taught the vowels: A, E, I, O, U, and sometimes Y. [Today's XKCD](http://xkcd.com/853/) got me thinking about when the letter *Y* is considered to be a vowel. I understand (perhaps incorrectly) that in words like *bicycle* and *why* it is a vowel. What about the word *voyeur* (as mentioned in the XKC...
2011/01/28
[ "https://english.stackexchange.com/questions/10458", "https://english.stackexchange.com", "https://english.stackexchange.com/users/380/" ]
The answer is that it depends on what purpose you have in assigning it, or what set of rules you are following. From the point of view of phonetics, the first thing to realise is that letters are not vowels or consonants: they represent sounds which may be vowels or consonants (and in the case of "y" possibly both). ...
Y can make 4 sounds: a hard *y*, as in **yield** (in this case, it is a consonant, it's most common use) a short *i* sound, as in **bicycle** a long *i* sound, as in **my** a long *e* sound, as in **baby** In the last three cases it is used just as the letter *i* would be, and so it is a vowel. It can als...
10,458
In school we are taught the vowels: A, E, I, O, U, and sometimes Y. [Today's XKCD](http://xkcd.com/853/) got me thinking about when the letter *Y* is considered to be a vowel. I understand (perhaps incorrectly) that in words like *bicycle* and *why* it is a vowel. What about the word *voyeur* (as mentioned in the XKC...
2011/01/28
[ "https://english.stackexchange.com/questions/10458", "https://english.stackexchange.com", "https://english.stackexchange.com/users/380/" ]
The answer is that it depends on what purpose you have in assigning it, or what set of rules you are following. From the point of view of phonetics, the first thing to realise is that letters are not vowels or consonants: they represent sounds which may be vowels or consonants (and in the case of "y" possibly both). ...
The letter *y* represents the consonant /j/ (as in *yes*), known variously as a palatal glide, a palatal approximant and a palatal semi-vowel. It also represents the vowels /ɪ/ (as in *hymn*) or in some dialects /i:/ (as in *trendy*) and, alone or in combination, it represents the diphthongs /aɪ/ (as in *try*), /ɔɪ/ (a...
10,458
In school we are taught the vowels: A, E, I, O, U, and sometimes Y. [Today's XKCD](http://xkcd.com/853/) got me thinking about when the letter *Y* is considered to be a vowel. I understand (perhaps incorrectly) that in words like *bicycle* and *why* it is a vowel. What about the word *voyeur* (as mentioned in the XKC...
2011/01/28
[ "https://english.stackexchange.com/questions/10458", "https://english.stackexchange.com", "https://english.stackexchange.com/users/380/" ]
Y can make 4 sounds: a hard *y*, as in **yield** (in this case, it is a consonant, it's most common use) a short *i* sound, as in **bicycle** a long *i* sound, as in **my** a long *e* sound, as in **baby** In the last three cases it is used just as the letter *i* would be, and so it is a vowel. It can als...
Also not being an English speaker, I mostly seem to default to the logic used with an *i* in Latin. That *i* acts like a consonant *j* when it appears before another vowel (except for diphthongs). Consequently, the Latin alphabet did not officially have a *j*. As far as I can tell, this is the case with the *y* in Eng...
10,458
In school we are taught the vowels: A, E, I, O, U, and sometimes Y. [Today's XKCD](http://xkcd.com/853/) got me thinking about when the letter *Y* is considered to be a vowel. I understand (perhaps incorrectly) that in words like *bicycle* and *why* it is a vowel. What about the word *voyeur* (as mentioned in the XKC...
2011/01/28
[ "https://english.stackexchange.com/questions/10458", "https://english.stackexchange.com", "https://english.stackexchange.com/users/380/" ]
The letter *y* represents the consonant /j/ (as in *yes*), known variously as a palatal glide, a palatal approximant and a palatal semi-vowel. It also represents the vowels /ɪ/ (as in *hymn*) or in some dialects /i:/ (as in *trendy*) and, alone or in combination, it represents the diphthongs /aɪ/ (as in *try*), /ɔɪ/ (a...
Also not being an English speaker, I mostly seem to default to the logic used with an *i* in Latin. That *i* acts like a consonant *j* when it appears before another vowel (except for diphthongs). Consequently, the Latin alphabet did not officially have a *j*. As far as I can tell, this is the case with the *y* in Eng...
1,005,231
The full question is this: Volume of a solid in any region R is given by: $$\int\!\!\!\int\_Rf(x,y)dydx $$ where, $$f(x,y) = z = \ln(x^2+y^2)$$ and, $$x^2+y^2=r^2$$ There for, $$dydx = \\_\\_\\_drd\theta$$ My answer is: $$r\ln(r^2)\, dr\,d\theta$$ but the book says the correct answer is: $$r \,dr\,d\theta$$ ...
2014/11/04
[ "https://math.stackexchange.com/questions/1005231", "https://math.stackexchange.com", "https://math.stackexchange.com/users/97662/" ]
There two different things: $\ln(x^2+y^2)$ is transformed into $\ln(r^2)$, **and** $dx\,dy$ is transformed into $r\,dr\,d\theta$. Of course I cannot know, what exactly states yor book, but at least partially it tells the truth.
Oh my god, I was dumb. I real realized the question was asking what $dxdy = r drd\theta$ It didn't ask me to convert $ln(x^2+y^2)dxdy to drd\theta$
67,241,146
My flow is as follows in selenium: 1. Access a webpage 2. Click a tab 3. Click on add button in a tab where a window would open 4. Close that window 5. Click on that same tab again I'm able to go through steps 1 to 4 without issues however at step 5 i'm not able to click the tab element knowing that i've clicked that...
2021/04/24
[ "https://Stackoverflow.com/questions/67241146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13349373/" ]
Regarding what you do, Pandas seems better suited. Here is an example: ```py df = pd.DataFrame(myList) # Create a dataframe sortedDf = df.sort_values('Revenue', ascending=False) # Sort by revenue result = sortedDf['Revenue'].to_numpy().cumsum() # Make the cumulative sum print(sortedDf...
Using [numpy.cumsum()](https://numpy.org/doc/stable/reference/generated/numpy.cumsum.html): [Try it online!](https://tio.run/##dY7NCoJAFEb3PsVlNo4gYkgQgoty2yraiYspbyQ212F@iiF8dhMySKjdWZyP7yhvrz1l49hK1WsL5KTyIAyQCqTft8ZCAdWTlb1UgjzLPwRbFgM74B3JIctXaTrE8MvbLbxs/c8rF94mHeqA8DEXmKkNG/4uiqFDX9yEPDUCuhy6Kpx3YR2DnlAbLI7aYRSI...
67,241,146
My flow is as follows in selenium: 1. Access a webpage 2. Click a tab 3. Click on add button in a tab where a window would open 4. Close that window 5. Click on that same tab again I'm able to go through steps 1 to 4 without issues however at step 5 i'm not able to click the tab element knowing that i've clicked that...
2021/04/24
[ "https://Stackoverflow.com/questions/67241146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13349373/" ]
Let us try with [`np.cumsum`](https://numpy.org/doc/stable/reference/generated/numpy.cumsum.html) after sorting the values from the `Revenue` in descending order ``` np.cumsum(sorted([d['Revenue'] for d in myList], reverse=True)) ``` --- ``` array([350, 450, 530]) ```
Using [numpy.cumsum()](https://numpy.org/doc/stable/reference/generated/numpy.cumsum.html): [Try it online!](https://tio.run/##dY7NCoJAFEb3PsVlNo4gYkgQgoty2yraiYspbyQ212F@iiF8dhMySKjdWZyP7yhvrz1l49hK1WsL5KTyIAyQCqTft8ZCAdWTlb1UgjzLPwRbFgM74B3JIctXaTrE8MvbLbxs/c8rF94mHeqA8DEXmKkNG/4uiqFDX9yEPDUCuhy6Kpx3YR2DnlAbLI7aYRSI...
38,565,530
I'd like to loop through all of the select inputs on a page and if the selected value is not a certain option then set that value to selected I have some selects ``` <select name="select1"> <option value="1">One</option> <option value="2" selected>Two</option> <option value="3">Three</option> <option value="4...
2016/07/25
[ "https://Stackoverflow.com/questions/38565530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6626006/" ]
This is total code : ``` [HttpPost] public ActionResult Index() { string FileContent = ""; using (StreamReader sr = new StreamReader(Request.InputStream)) { FileContent = sr.ReadToEnd(); } AfterShip model = JsonConvert.DeserializeObject<AfterShip>(FileConten...
Try this - you'll need to add authorization headers if required: ``` using (var httpClient = new HttpClient()) { try { var response = await httpClient.GetAsync(url); if (response.StatusCode == HttpStatusCode.OK) { var responseContent = await response.Content.ReadAsStringAsy...
38,565,530
I'd like to loop through all of the select inputs on a page and if the selected value is not a certain option then set that value to selected I have some selects ``` <select name="select1"> <option value="1">One</option> <option value="2" selected>Two</option> <option value="3">Three</option> <option value="4...
2016/07/25
[ "https://Stackoverflow.com/questions/38565530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6626006/" ]
This is total code : ``` [HttpPost] public ActionResult Index() { string FileContent = ""; using (StreamReader sr = new StreamReader(Request.InputStream)) { FileContent = sr.ReadToEnd(); } AfterShip model = JsonConvert.DeserializeObject<AfterShip>(FileConten...
You can access it as an input stream ``` string FileContent = ""; using (StreamReader sr = new StreamReader(Request.InputStream)) { FileContent = sr.ReadToEnd(); } ``` And serialize the content received.
12,511,580
While trying to create a shared library using android-ndk-r8b it shows the error ``` Your APP_BUILD_SCRIPT points to an unknown file /home/myLib/ndk1/jni/Android.mk Android NDK Aborting... .Stop ``` For my application,I simply created a jni folder which contains a ndk1.c file and Android.mk file Steps for buil...
2012/09/20
[ "https://Stackoverflow.com/questions/12511580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/676603/" ]
This is a very good tutorial for ndk beginners <http://marakana.com/forums/android/examples/49.html> In tutorial : as you are building on android-ndk-r8b replace step which says ``` go to your NDK-HOME and run make APP=ndk_demo ``` do this ``` go to your android project directory and run ndk-build in termina...
try verbose with the "ndk-build".... So you can follow step-by-step what the build is doing with the instructions in the .mk ndk-build -B V=1 use above for more details ....
4,264,355
How to stop or interrupt a sleeping thread in java.? I have a thread that syncs data and sleeps for 10 minutes in run() method, if i want to stop the sync by stopping the thread when it is sleeping.? How can this be achieved?
2010/11/24
[ "https://Stackoverflow.com/questions/4264355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/110024/" ]
Call the interrupt() method on your thread. This will cause the sleep to be cancelled and an InterruptedException will be thrown.
Frederik is right: call Thread.interrupt(); I just wanted to warn you **not to use** stop() as it is deprecated since java 1.1. And other warning. I think that if you are using sleep() and wish to interrupt the thread it is a good moment to think about move to wait() and notify(). There are many tutorials about java th...
4,264,355
How to stop or interrupt a sleeping thread in java.? I have a thread that syncs data and sleeps for 10 minutes in run() method, if i want to stop the sync by stopping the thread when it is sleeping.? How can this be achieved?
2010/11/24
[ "https://Stackoverflow.com/questions/4264355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/110024/" ]
Call the interrupt() method on your thread. This will cause the sleep to be cancelled and an InterruptedException will be thrown.
Suresh, I wish to pay attention to one issue. interrupt() methods itself does not interrupt thread. It just sends a request to a thread for interruption, by setting the flag to true. Usually your thread should process cancellation/interruption policy. It is greatly described in Java Concurrecy in Practice, section 7.1 ...
4,264,355
How to stop or interrupt a sleeping thread in java.? I have a thread that syncs data and sleeps for 10 minutes in run() method, if i want to stop the sync by stopping the thread when it is sleeping.? How can this be achieved?
2010/11/24
[ "https://Stackoverflow.com/questions/4264355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/110024/" ]
Call the interrupt() method on your thread. This will cause the sleep to be cancelled and an InterruptedException will be thrown.
Since I can't comment, I'll post another answer. I just want to reinforce and clarify what Alexandr said. `interrupt()` only sets a flag in the `Thread`, and the extended `Thread` or `Runnable` object have to check if it have been interrupted with `Thread.interrupted()` to do what it's supposed to do when interrupted. ...
4,264,355
How to stop or interrupt a sleeping thread in java.? I have a thread that syncs data and sleeps for 10 minutes in run() method, if i want to stop the sync by stopping the thread when it is sleeping.? How can this be achieved?
2010/11/24
[ "https://Stackoverflow.com/questions/4264355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/110024/" ]
You can interrupt a sleeping thread with `Thread.interrupt()`. Now stopping a thread is deprecated - what if the thread is holding a lock to something? (There was a `Thread.stop()`, but it is HIGHLY discouraged). Alternatively, instead of sleeping, you can have your thread wait for an object to be notified with a time...
Frederik is right: call Thread.interrupt(); I just wanted to warn you **not to use** stop() as it is deprecated since java 1.1. And other warning. I think that if you are using sleep() and wish to interrupt the thread it is a good moment to think about move to wait() and notify(). There are many tutorials about java th...
4,264,355
How to stop or interrupt a sleeping thread in java.? I have a thread that syncs data and sleeps for 10 minutes in run() method, if i want to stop the sync by stopping the thread when it is sleeping.? How can this be achieved?
2010/11/24
[ "https://Stackoverflow.com/questions/4264355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/110024/" ]
You can interrupt a sleeping thread with `Thread.interrupt()`. Now stopping a thread is deprecated - what if the thread is holding a lock to something? (There was a `Thread.stop()`, but it is HIGHLY discouraged). Alternatively, instead of sleeping, you can have your thread wait for an object to be notified with a time...
Suresh, I wish to pay attention to one issue. interrupt() methods itself does not interrupt thread. It just sends a request to a thread for interruption, by setting the flag to true. Usually your thread should process cancellation/interruption policy. It is greatly described in Java Concurrecy in Practice, section 7.1 ...
4,264,355
How to stop or interrupt a sleeping thread in java.? I have a thread that syncs data and sleeps for 10 minutes in run() method, if i want to stop the sync by stopping the thread when it is sleeping.? How can this be achieved?
2010/11/24
[ "https://Stackoverflow.com/questions/4264355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/110024/" ]
You can interrupt a sleeping thread with `Thread.interrupt()`. Now stopping a thread is deprecated - what if the thread is holding a lock to something? (There was a `Thread.stop()`, but it is HIGHLY discouraged). Alternatively, instead of sleeping, you can have your thread wait for an object to be notified with a time...
Since I can't comment, I'll post another answer. I just want to reinforce and clarify what Alexandr said. `interrupt()` only sets a flag in the `Thread`, and the extended `Thread` or `Runnable` object have to check if it have been interrupted with `Thread.interrupted()` to do what it's supposed to do when interrupted. ...
4,264,355
How to stop or interrupt a sleeping thread in java.? I have a thread that syncs data and sleeps for 10 minutes in run() method, if i want to stop the sync by stopping the thread when it is sleeping.? How can this be achieved?
2010/11/24
[ "https://Stackoverflow.com/questions/4264355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/110024/" ]
Suresh, I wish to pay attention to one issue. interrupt() methods itself does not interrupt thread. It just sends a request to a thread for interruption, by setting the flag to true. Usually your thread should process cancellation/interruption policy. It is greatly described in Java Concurrecy in Practice, section 7.1 ...
Frederik is right: call Thread.interrupt(); I just wanted to warn you **not to use** stop() as it is deprecated since java 1.1. And other warning. I think that if you are using sleep() and wish to interrupt the thread it is a good moment to think about move to wait() and notify(). There are many tutorials about java th...
4,264,355
How to stop or interrupt a sleeping thread in java.? I have a thread that syncs data and sleeps for 10 minutes in run() method, if i want to stop the sync by stopping the thread when it is sleeping.? How can this be achieved?
2010/11/24
[ "https://Stackoverflow.com/questions/4264355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/110024/" ]
Suresh, I wish to pay attention to one issue. interrupt() methods itself does not interrupt thread. It just sends a request to a thread for interruption, by setting the flag to true. Usually your thread should process cancellation/interruption policy. It is greatly described in Java Concurrecy in Practice, section 7.1 ...
Since I can't comment, I'll post another answer. I just want to reinforce and clarify what Alexandr said. `interrupt()` only sets a flag in the `Thread`, and the extended `Thread` or `Runnable` object have to check if it have been interrupted with `Thread.interrupted()` to do what it's supposed to do when interrupted. ...
9,855,445
I want to use a different color of text in my auto-generated PDF. According to [the reportlab docs](http://www.reportlab.com/software/opensource/rl-toolkit/faq/#2.1.4) all I need to do is: ``` self.canvas.setFillColorRGB(255,0,0) self.canvas.drawCentredString(...) ``` But that doesn't do anything. The text is black...
2012/03/24
[ "https://Stackoverflow.com/questions/9855445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84398/" ]
If you copy and paste the code in User Guide Section 2. You'll get a fancy coloured rectangle with a coloured Text within it. Probably the approach is not that clear in the user guide, I'd spent some time playing with it and I finally know how it works. You need to imagine yourself drawing a canvas. You need to do all...
I can't verify this at the moment, but if you look in the linked example whenever they set the color before calling `drawCenteredString` they always do it with `setFillColor`, never `setFillColorRGB`, only using the latter to set the color of rects. So try instead changing it to ``` self.canvas.setFillColor(red) self....
9,855,445
I want to use a different color of text in my auto-generated PDF. According to [the reportlab docs](http://www.reportlab.com/software/opensource/rl-toolkit/faq/#2.1.4) all I need to do is: ``` self.canvas.setFillColorRGB(255,0,0) self.canvas.drawCentredString(...) ``` But that doesn't do anything. The text is black...
2012/03/24
[ "https://Stackoverflow.com/questions/9855445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84398/" ]
``` from reportlab.lib.colors import HexColor ... # sets fill color like orange c.setFillColor(HexColor(0xff8100)) # or c.setFillColor(HexColor('#ff8100')) ... ```
I can't verify this at the moment, but if you look in the linked example whenever they set the color before calling `drawCenteredString` they always do it with `setFillColor`, never `setFillColorRGB`, only using the latter to set the color of rects. So try instead changing it to ``` self.canvas.setFillColor(red) self....
9,855,445
I want to use a different color of text in my auto-generated PDF. According to [the reportlab docs](http://www.reportlab.com/software/opensource/rl-toolkit/faq/#2.1.4) all I need to do is: ``` self.canvas.setFillColorRGB(255,0,0) self.canvas.drawCentredString(...) ``` But that doesn't do anything. The text is black...
2012/03/24
[ "https://Stackoverflow.com/questions/9855445", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84398/" ]
If you copy and paste the code in User Guide Section 2. You'll get a fancy coloured rectangle with a coloured Text within it. Probably the approach is not that clear in the user guide, I'd spent some time playing with it and I finally know how it works. You need to imagine yourself drawing a canvas. You need to do all...
``` from reportlab.lib.colors import HexColor ... # sets fill color like orange c.setFillColor(HexColor(0xff8100)) # or c.setFillColor(HexColor('#ff8100')) ... ```
1,671
Are there any tools specifically designed for compressing floating point scientific data? If a function is smooth, there's obviously a lot of correlation between the numbers representing that function, so the data should compress well. Zipping/gzipping binary floating point data doesn't compress it that well though. I...
2012/03/17
[ "https://scicomp.stackexchange.com/questions/1671", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/605/" ]
Try out [Blosc](http://www.blosc.org/). It is in many cases **faster than memcopy**. Think about that for a second. . . wicked. It is super stable, highly-vetted, cross-platform, and performs like a champ.
> > If a function is smooth, there's obviously a lot of correlation between the numbers representing that function, so the data should compress well. > > > Perhaps the format you require need to store just the offsets from value to neighboring value. Alternately, maybe you could make use of the frequency domain, ...
1,671
Are there any tools specifically designed for compressing floating point scientific data? If a function is smooth, there's obviously a lot of correlation between the numbers representing that function, so the data should compress well. Zipping/gzipping binary floating point data doesn't compress it that well though. I...
2012/03/17
[ "https://scicomp.stackexchange.com/questions/1671", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/605/" ]
Try out [Blosc](http://www.blosc.org/). It is in many cases **faster than memcopy**. Think about that for a second. . . wicked. It is super stable, highly-vetted, cross-platform, and performs like a champ.
Arguably, you can interpret regression or transform methods (Fourier transform, Chebyshev transform) methods as "compression" for time-series or 1D function data. Remez's algorithm would be another candidate. In that case, using something like regression, FFT, or Chebyshev via FFT would work for your purposes. That sai...
1,671
Are there any tools specifically designed for compressing floating point scientific data? If a function is smooth, there's obviously a lot of correlation between the numbers representing that function, so the data should compress well. Zipping/gzipping binary floating point data doesn't compress it that well though. I...
2012/03/17
[ "https://scicomp.stackexchange.com/questions/1671", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/605/" ]
Arguably, you can interpret regression or transform methods (Fourier transform, Chebyshev transform) methods as "compression" for time-series or 1D function data. Remez's algorithm would be another candidate. In that case, using something like regression, FFT, or Chebyshev via FFT would work for your purposes. That sai...
We have been using [ZFP](https://computation.llnl.gov/projects/floating-point-compression "ZFP") with HDF5 for our medical imaging data. It is made for lossy, floating point compression. We're running it on literally everything, and have more than 40TB of data stored (and being used!). It is fast enough to save our d...
1,671
Are there any tools specifically designed for compressing floating point scientific data? If a function is smooth, there's obviously a lot of correlation between the numbers representing that function, so the data should compress well. Zipping/gzipping binary floating point data doesn't compress it that well though. I...
2012/03/17
[ "https://scicomp.stackexchange.com/questions/1671", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/605/" ]
Possible methods, that can be used for floating-point compression: * Transpose 4xN for float and 8xN for double + lz77 Implementation: [Floating point compression in TurboTranspose](https://github.com/powturbo/TurboTranspose) see also error-bounded lossy compression * Predictor (ex. Finite Context Method) + enco...
Why not just save float32 / float16 ? In numpy, ``` A.astype( np.float32 ) # 100M: 200 msec imac A.astype( np.float16 ) # 100M: 700 msec ``` These won't do if you're simulating the [Butterfly effect](https://en.wikipedia.org/wiki/Butterfly_effect) in chaos theory, but they're understandable, portable, "do not requ...
1,671
Are there any tools specifically designed for compressing floating point scientific data? If a function is smooth, there's obviously a lot of correlation between the numbers representing that function, so the data should compress well. Zipping/gzipping binary floating point data doesn't compress it that well though. I...
2012/03/17
[ "https://scicomp.stackexchange.com/questions/1671", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/605/" ]
I got good results using [HDF5](http://www.hdfgroup.org/HDF5/) and its GZIP filter. The HDF5 also provides an [SZIP](http://www.hdfgroup.org/doc_resource/SZIP/) filter which achieves better results for some scientifica data-sets. In my experience the choice of compressions depends heavily on the kind of data and be...
We have been using [ZFP](https://computation.llnl.gov/projects/floating-point-compression "ZFP") with HDF5 for our medical imaging data. It is made for lossy, floating point compression. We're running it on literally everything, and have more than 40TB of data stored (and being used!). It is fast enough to save our d...
1,671
Are there any tools specifically designed for compressing floating point scientific data? If a function is smooth, there's obviously a lot of correlation between the numbers representing that function, so the data should compress well. Zipping/gzipping binary floating point data doesn't compress it that well though. I...
2012/03/17
[ "https://scicomp.stackexchange.com/questions/1671", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/605/" ]
HDF5 can use a "shuffling" algorithm where the bytes for N floating point numbers are rearranged so that the first bytes of the N numbers come first, then the 2nd, and so on. This produces better compression ratios after gzip is applied, as it is more likely to produce longer sequences of the same value. See [here for ...
SZ (developed by Argonne in 2016) could be a good choice. SZ: Fast Error-Bounded Floating-point Data Compressor for Scientific Applications <https://collab.cels.anl.gov/display/ESR/SZ>
1,671
Are there any tools specifically designed for compressing floating point scientific data? If a function is smooth, there's obviously a lot of correlation between the numbers representing that function, so the data should compress well. Zipping/gzipping binary floating point data doesn't compress it that well though. I...
2012/03/17
[ "https://scicomp.stackexchange.com/questions/1671", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/605/" ]
We have been using [ZFP](https://computation.llnl.gov/projects/floating-point-compression "ZFP") with HDF5 for our medical imaging data. It is made for lossy, floating point compression. We're running it on literally everything, and have more than 40TB of data stored (and being used!). It is fast enough to save our d...
> > If a function is smooth, there's obviously a lot of correlation between the numbers representing that function, so the data should compress well. > > > Perhaps the format you require need to store just the offsets from value to neighboring value. Alternately, maybe you could make use of the frequency domain, ...
1,671
Are there any tools specifically designed for compressing floating point scientific data? If a function is smooth, there's obviously a lot of correlation between the numbers representing that function, so the data should compress well. Zipping/gzipping binary floating point data doesn't compress it that well though. I...
2012/03/17
[ "https://scicomp.stackexchange.com/questions/1671", "https://scicomp.stackexchange.com", "https://scicomp.stackexchange.com/users/605/" ]
Possible methods, that can be used for floating-point compression: * Transpose 4xN for float and 8xN for double + lz77 Implementation: [Floating point compression in TurboTranspose](https://github.com/powturbo/TurboTranspose) see also error-bounded lossy compression * Predictor (ex. Finite Context Method) + enco...
> > If a function is smooth, there's obviously a lot of correlation between the numbers representing that function, so the data should compress well. > > > Perhaps the format you require need to store just the offsets from value to neighboring value. Alternately, maybe you could make use of the frequency domain, ...