qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
68,889,719
I just started learning NumPy, so I'm still a bit dazed with all of its ins and outs. I'm learning how to create arrays with specific data types. I'm a bit confused with this: When I create an array of int32 data type, it shows just that: ``` a = np.zeros((2, 3), dtype=np.int32) print(a) print(a.dtype) ``` The prin...
2021/08/23
[ "https://Stackoverflow.com/questions/68889719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16731452/" ]
As you can see, if you simply do: ``` >>> np.string_ <class 'numpy.bytes_'> >>> ``` It automatically gives a `numpy.bytes_` object for each value.' So you should do `np.str_` as follows: ``` >>> np.array([1,2,3,4,5,6], dtype=np.str_) array(['1', '2', '3', '4', '5', '6'], dtype='<U1') >>> ``` Which gives a regu...
*What does it mean?* Simply speaking `S1` is length-1 string, consider following example ``` import numpy as np arr1 = np.array(['A','A','A'],dtype=np.string_) arr3 = np.array(['ABC','ABC','ABC'],dtype=np.string_) arr5 = np.array(['ABCDE','ABCDE','ABCDE'],dtype=np.string_) print(arr1.dtype) # |S1 print(arr3.dtype) ...
7,381,155
A simple problem but I can't find a solution for it: I have 2 UIViews, one above the other in the same parent view. Both have `GestureRecognizers` on them but only the top most is receiving the events. How can I make the top most view pass all the gestures he gets to the other UIViews beneath it?
2011/09/11
[ "https://Stackoverflow.com/questions/7381155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/399707/" ]
This is how i pass touches... Subclass the uiview and add ``` -(id)hitTest:(CGPoint)point withEvent:(UIEvent *)event { UIView *hitView = [super hitTest:point withEvent:event]; if (hitView == self){ return nil; } else { return hitView; } } ```
It seems you need to use the NSNotificationCenter for the said task. Have a look at this [tutorial](http://macdevelopertips.com/cocoa/basics-of-notifications.html).
14,690,704
I have a separate asynctask class which creates a url for me. I tried to use an interface in the onPostExecute to send the url to my fragment, but could not managed it. I was always doing the same process in the fragments by forcing to implement the interface in onAttach. After myTask.execute(), i simply wait for the ...
2013/02/04
[ "https://Stackoverflow.com/questions/14690704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1878393/" ]
You could try making a interface and have a method or a constructor in your asynctask that accepts said listener. Create the listener in your fragment and set it for you asynctask. ``` public class Example extends AsyncTask<Void, Void, Void> { AsyncListener listener; Object result; @Override protected Void doInBackg...
Alright I found my mistake finally. As ePeace mentioned in his answer. In my Asyntask class, I created a constructor which throws nullpointerexception is the listener is null. ``` AsyncListener listener; public ReportFactory(AsyncListener a) { if(a == null) { throw new NullPointerException("Listener c...
37,222,036
I have a 3x3 two-dimensional array TicTac toe game, and I am having trouble in a method that should return the winner. The number 1 was assigned to player 1 and -1 to player 2, I need to sum the lines, the columns and the diagonals to see if there is a winner. ``` public static int checkWinner (int[][] board) { ...
2016/05/14
[ "https://Stackoverflow.com/questions/37222036", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5562760/" ]
Assuming that board contains 0's in spaces that haven't been played in yet, and you have a square board, this should work on any size board. I changed your method to return 0 if there was a tie instead of -10. Also note, this is not the most efficient implementation, but it is good. You could add counters and only use ...
``` public class TicTacToe { enum State { NO_WINNER, WINNER_1, WINNER_2 }; public static State checkWinner(int[][] board) { // Check LINES for (int i = 0; i < board.length; i++) { // for each line int sum = 0; for (int j = 0; j < board[i].length; j++) { ...
3,309
Some years ago, particularly before the 1990s, there way a saying in Europe that (paraphrased) you can sell your blue jeans in every part of Eastern Europe and literally live like a king for a week. Naturally things have changed since then. But is it still possible to do so in any part of Europe?
2011/11/07
[ "https://travel.stackexchange.com/questions/3309", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/693/" ]
It used to be the thing to travel to New York for the weekend and come back with a suitcase full of Levi's (nonchalantly avoiding the red channel). Looking at Levi US and EU\_GB sites, I see the prices for the classic 501 is from $44 or £70 ($112). However, mid-nineties saw the emergence of a large grey market. I gues...
Not anymore. Now you'd have to sell a blue auto... Nowadays you can buy a heck of jeans of various quality everywhere, from marketplaces to supermarkets. The prices in, for example, Poland, are much lower than in Germany, so you'd have more luck selling your jeans in Germany... Before the 1990s the situation was comp...
3,309
Some years ago, particularly before the 1990s, there way a saying in Europe that (paraphrased) you can sell your blue jeans in every part of Eastern Europe and literally live like a king for a week. Naturally things have changed since then. But is it still possible to do so in any part of Europe?
2011/11/07
[ "https://travel.stackexchange.com/questions/3309", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/693/" ]
That used to be true, back in the 1980s, in the Soviet Bloc countries, because: * blue jeans were *the* fashion trend then and there * they were not available on the market, *at all* (not "sold out", not "in small quantities", not at all.) * thus providing an opportunity for home-made imitations *and* for scarce (rare...
Yes, real Levi's still go for considerably more in foreign countries than in the US, in official shops. Like 501s are usually under $50 in the US, and over $100 in Australia. This is partly historic, partly due to currency fluctuations and the dollar being down at the moment, and partly due to VAT/GST. No, you will no...
3,309
Some years ago, particularly before the 1990s, there way a saying in Europe that (paraphrased) you can sell your blue jeans in every part of Eastern Europe and literally live like a king for a week. Naturally things have changed since then. But is it still possible to do so in any part of Europe?
2011/11/07
[ "https://travel.stackexchange.com/questions/3309", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/693/" ]
That used to be true, back in the 1980s, in the Soviet Bloc countries, because: * blue jeans were *the* fashion trend then and there * they were not available on the market, *at all* (not "sold out", not "in small quantities", not at all.) * thus providing an opportunity for home-made imitations *and* for scarce (rare...
Not anymore. Now you'd have to sell a blue auto... Nowadays you can buy a heck of jeans of various quality everywhere, from marketplaces to supermarkets. The prices in, for example, Poland, are much lower than in Germany, so you'd have more luck selling your jeans in Germany... Before the 1990s the situation was comp...
3,309
Some years ago, particularly before the 1990s, there way a saying in Europe that (paraphrased) you can sell your blue jeans in every part of Eastern Europe and literally live like a king for a week. Naturally things have changed since then. But is it still possible to do so in any part of Europe?
2011/11/07
[ "https://travel.stackexchange.com/questions/3309", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/693/" ]
Let's take this one step at a time. 1. First you must own jeans. Here's your problem - you'll want them to be worth a bit. You can buy jeans for anything from $5 to a few hundred dollars if you really want to in western clothing stores. Let's say an expensive pair - US$200, and I assure you I've never spent that much ...
That used to be true in 1980ies, but it ended with the collapse of the USSR a whole generation ago. In essence, in USSR there was a thriving black market for imported goods which weren't generally available locally - jeans, music records and consumer electronics such as VCRs; such items would be worth a fortune and th...
3,309
Some years ago, particularly before the 1990s, there way a saying in Europe that (paraphrased) you can sell your blue jeans in every part of Eastern Europe and literally live like a king for a week. Naturally things have changed since then. But is it still possible to do so in any part of Europe?
2011/11/07
[ "https://travel.stackexchange.com/questions/3309", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/693/" ]
Let's take this one step at a time. 1. First you must own jeans. Here's your problem - you'll want them to be worth a bit. You can buy jeans for anything from $5 to a few hundred dollars if you really want to in western clothing stores. Let's say an expensive pair - US$200, and I assure you I've never spent that much ...
**Probably not.** I saw blue jeans for sale in streetside markets in Niš, Serbia for €5. I'm now so far east in Eastern Europe that I'm technically in Asia and there doesn't seem to be any shortage of jeans. Then again my jeans are about the cheapest I could find in a Chinese import store in Greece, which are probab...
3,309
Some years ago, particularly before the 1990s, there way a saying in Europe that (paraphrased) you can sell your blue jeans in every part of Eastern Europe and literally live like a king for a week. Naturally things have changed since then. But is it still possible to do so in any part of Europe?
2011/11/07
[ "https://travel.stackexchange.com/questions/3309", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/693/" ]
That used to be true, back in the 1980s, in the Soviet Bloc countries, because: * blue jeans were *the* fashion trend then and there * they were not available on the market, *at all* (not "sold out", not "in small quantities", not at all.) * thus providing an opportunity for home-made imitations *and* for scarce (rare...
It used to be the thing to travel to New York for the weekend and come back with a suitcase full of Levi's (nonchalantly avoiding the red channel). Looking at Levi US and EU\_GB sites, I see the prices for the classic 501 is from $44 or £70 ($112). However, mid-nineties saw the emergence of a large grey market. I gues...
3,309
Some years ago, particularly before the 1990s, there way a saying in Europe that (paraphrased) you can sell your blue jeans in every part of Eastern Europe and literally live like a king for a week. Naturally things have changed since then. But is it still possible to do so in any part of Europe?
2011/11/07
[ "https://travel.stackexchange.com/questions/3309", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/693/" ]
Let's take this one step at a time. 1. First you must own jeans. Here's your problem - you'll want them to be worth a bit. You can buy jeans for anything from $5 to a few hundred dollars if you really want to in western clothing stores. Let's say an expensive pair - US$200, and I assure you I've never spent that much ...
Yes, real Levi's still go for considerably more in foreign countries than in the US, in official shops. Like 501s are usually under $50 in the US, and over $100 in Australia. This is partly historic, partly due to currency fluctuations and the dollar being down at the moment, and partly due to VAT/GST. No, you will no...
3,309
Some years ago, particularly before the 1990s, there way a saying in Europe that (paraphrased) you can sell your blue jeans in every part of Eastern Europe and literally live like a king for a week. Naturally things have changed since then. But is it still possible to do so in any part of Europe?
2011/11/07
[ "https://travel.stackexchange.com/questions/3309", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/693/" ]
That used to be true, back in the 1980s, in the Soviet Bloc countries, because: * blue jeans were *the* fashion trend then and there * they were not available on the market, *at all* (not "sold out", not "in small quantities", not at all.) * thus providing an opportunity for home-made imitations *and* for scarce (rare...
That used to be true in 1980ies, but it ended with the collapse of the USSR a whole generation ago. In essence, in USSR there was a thriving black market for imported goods which weren't generally available locally - jeans, music records and consumer electronics such as VCRs; such items would be worth a fortune and th...
3,309
Some years ago, particularly before the 1990s, there way a saying in Europe that (paraphrased) you can sell your blue jeans in every part of Eastern Europe and literally live like a king for a week. Naturally things have changed since then. But is it still possible to do so in any part of Europe?
2011/11/07
[ "https://travel.stackexchange.com/questions/3309", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/693/" ]
Yes, real Levi's still go for considerably more in foreign countries than in the US, in official shops. Like 501s are usually under $50 in the US, and over $100 in Australia. This is partly historic, partly due to currency fluctuations and the dollar being down at the moment, and partly due to VAT/GST. No, you will no...
Not anymore. Now you'd have to sell a blue auto... Nowadays you can buy a heck of jeans of various quality everywhere, from marketplaces to supermarkets. The prices in, for example, Poland, are much lower than in Germany, so you'd have more luck selling your jeans in Germany... Before the 1990s the situation was comp...
3,309
Some years ago, particularly before the 1990s, there way a saying in Europe that (paraphrased) you can sell your blue jeans in every part of Eastern Europe and literally live like a king for a week. Naturally things have changed since then. But is it still possible to do so in any part of Europe?
2011/11/07
[ "https://travel.stackexchange.com/questions/3309", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/693/" ]
Let's take this one step at a time. 1. First you must own jeans. Here's your problem - you'll want them to be worth a bit. You can buy jeans for anything from $5 to a few hundred dollars if you really want to in western clothing stores. Let's say an expensive pair - US$200, and I assure you I've never spent that much ...
It used to be the thing to travel to New York for the weekend and come back with a suitcase full of Levi's (nonchalantly avoiding the red channel). Looking at Levi US and EU\_GB sites, I see the prices for the classic 501 is from $44 or £70 ($112). However, mid-nineties saw the emergence of a large grey market. I gues...
58,860,408
I have a DataFrame, `sega_df`: ``` >>> sega_df 0 1 2 Tails 20161016 Knuckles 20170202 20101216 Sonic 20160623 20101203 20160603 Amy 20160923 Shadow 20160919 20160723 Cream 2011030...
2019/11/14
[ "https://Stackoverflow.com/questions/58860408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9343043/" ]
Here is a way using [`df.stack()`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.stack.html) and [`df.droplevel()`](https://pandas.pydata.org/pandas-docs/version/0.24.0rc1/api/generated/pandas.Series.droplevel.html) with [`series.to_frame()`](https://pandas.pydata.org/pandas-docs/stable/re...
Here's another way using melt: ``` df = df.melt(id_vars='', value_name='0').dropna().drop('variable', axis=1) ``` which returns: ``` 0 Tails 20161016.0 Knuckles 20170202.0 Sonic 20160623.0 Amy 20160923.0 Shadow 20160919.0 Cream 20110309.0 Silver 20160405.0 Blaze 2016...
2,904,059
The class `java.io.FileReader` not found in Java ME. I need this in order to get the file and then parse it with an xml parser. Anyone know any alternatives for this class? \*added using CLDC profile. The xml file to be read is in the JAR.
2010/05/25
[ "https://Stackoverflow.com/questions/2904059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/290274/" ]
Yeah I agree this isn't really a canonical example of any pattern, but I see elements of dependency injection (obviously, it's using Guice), and a factory method (`getInstance()`).
This snippet doesn't represent a design-pattern from the [catalog](http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29). Patterns (except Singleton) usually represent more complex relationship than setting a changeable default implementation of something.
2,904,059
The class `java.io.FileReader` not found in Java ME. I need this in order to get the file and then parse it with an xml parser. Anyone know any alternatives for this class? \*added using CLDC profile. The xml file to be read is in the JAR.
2010/05/25
[ "https://Stackoverflow.com/questions/2904059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/290274/" ]
Well, I'd call this bit: ``` private static Injector injector = Guice.createInjector(new Guicer()); public static void setInjector(Injector injector) { Guicer.injector = injector; } ``` a write-only global variable. And here: ``` public static <T> T getInstance(Class<T> c) { return injector.getInstance(c...
This snippet doesn't represent a design-pattern from the [catalog](http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29). Patterns (except Singleton) usually represent more complex relationship than setting a changeable default implementation of something.
24,932,813
got the following problem. i need the following just to be drag/dropable in the green area. should be something like that: ``` limit($(this).parent()); ``` but thats not working, im using this for dnd: ``` $('#dragThis').draggable({ drag: function () { var offset = $(this).offset(); var xPos = M...
2014/07/24
[ "https://Stackoverflow.com/questions/24932813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3481756/" ]
The only way that I can see that you can get a `NullPointerException` on line 116 of [`IntentService.java`](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/java/android/app/IntentService.java) would be if your service overrides `onCreate()` and does not chain to the superclass.
From your requirement i feel you need to use a pending intent along with the Alarm manager. A sample of the same is shown below: ``` //Creating a PendingIntent Intent intent = new Intent(MainActivity.this, MyService.class); PendingIntent pendingIntent = PendingIntent.getService( MainActivity.this, UNIQUE_ID_RANDOM, in...
9,932,536
I'm trying to calculate all the correct answer a user gets and update it in the score table. But it gives me a fun little error. ``` UPDATE score SET end_time = CURTIME(), final_score = COUNT( SELECT * FROM answered WHERE (exam_id = 8 and student_login = 'user' and guessed = 1) ) WHERE exam_id = 8 and stud...
2012/03/29
[ "https://Stackoverflow.com/questions/9932536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1279231/" ]
``` UPDATE score SET end_time = CURTIME(), final_score = ( SELECT COUNT(*) FROM answered WHERE (exam_id = 8 and student_login = 'user' and guessed = 1) ) WHERE exam_id = 8 and student_login = 'user' ``` Should do it. COUNT cannot (as far as I know) operate on sub queries.
Try this: ``` UPDATE score SET end_time = CURTIME(), final_score = ( SELECT COUNT(*) FROM answered WHERE (exam_id = 8 and student_login = 'user' and guessed = 1) ) WHERE exam_id = 8 and student_login = 'user' ```
9,932,536
I'm trying to calculate all the correct answer a user gets and update it in the score table. But it gives me a fun little error. ``` UPDATE score SET end_time = CURTIME(), final_score = COUNT( SELECT * FROM answered WHERE (exam_id = 8 and student_login = 'user' and guessed = 1) ) WHERE exam_id = 8 and stud...
2012/03/29
[ "https://Stackoverflow.com/questions/9932536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1279231/" ]
``` UPDATE score SET end_time = CURTIME(), final_score = ( SELECT COUNT(*) FROM answered WHERE (exam_id = 8 and student_login = 'user' and guessed = 1) ) WHERE exam_id = 8 and student_login = 'user' ``` Should do it. COUNT cannot (as far as I know) operate on sub queries.
try this.. ``` UPDATE score SET end_time = CURTIME(), final_score = ( SELECT cnt=count(*) FROM answered WHERE (exam_id = 8 and student_login = 'user' and guessed = 1) ) WHERE exam_id = 8 and student_login = 'user' ```
9,932,536
I'm trying to calculate all the correct answer a user gets and update it in the score table. But it gives me a fun little error. ``` UPDATE score SET end_time = CURTIME(), final_score = COUNT( SELECT * FROM answered WHERE (exam_id = 8 and student_login = 'user' and guessed = 1) ) WHERE exam_id = 8 and stud...
2012/03/29
[ "https://Stackoverflow.com/questions/9932536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1279231/" ]
Try this: ``` UPDATE score SET end_time = CURTIME(), final_score = ( SELECT COUNT(*) FROM answered WHERE (exam_id = 8 and student_login = 'user' and guessed = 1) ) WHERE exam_id = 8 and student_login = 'user' ```
try this.. ``` UPDATE score SET end_time = CURTIME(), final_score = ( SELECT cnt=count(*) FROM answered WHERE (exam_id = 8 and student_login = 'user' and guessed = 1) ) WHERE exam_id = 8 and student_login = 'user' ```
68,844,375
I'm trying to answer a question from a challenge. Question: **Some numbers have personality, while other numbers are just dull. Let's write a program that asks for a list of numbers and describes the interesting ones using the personality traits below, while counting up all the dull ones without traits.** Your progra...
2021/08/19
[ "https://Stackoverflow.com/questions/68844375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16693542/" ]
Your output string `trts` will always contain `''`. Instead of this you should validate if `trts` is an empty string. So, instead of ``` if '' in trts: dullcounter = dullcounter + 1 ``` you should use this or similar: ``` if not trts: dullcounter = dullcounter + 1 ```
The problem is that your function always returns a string, albeit an emtpy string if the number is dull. Try introducing logic that breaks out of the function if a number is dull (instead of returning an empty string).
68,844,375
I'm trying to answer a question from a challenge. Question: **Some numbers have personality, while other numbers are just dull. Let's write a program that asks for a list of numbers and describes the interesting ones using the personality traits below, while counting up all the dull ones without traits.** Your progra...
2021/08/19
[ "https://Stackoverflow.com/questions/68844375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16693542/" ]
Your output string `trts` will always contain `''`. Instead of this you should validate if `trts` is an empty string. So, instead of ``` if '' in trts: dullcounter = dullcounter + 1 ``` you should use this or similar: ``` if not trts: dullcounter = dullcounter + 1 ```
Your if condition is always True. Use an alternative condition like this ```py if len(trts) > 0: dullcounter = dullcounter + 1 ```
25,684,274
I want to create a test script in QTP which when I execute does 'Right mouse button' operation on any windows folder and select any specified Popupmenu eg. Refresh. I have added the folder under QTP OR and its reflects the black folder area as 'WinList'. This is the added OR hierarchy that I added: Window("abc").WinO...
2014/09/05
[ "https://Stackoverflow.com/questions/25684274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3913344/" ]
``` ^([a-zA-Z]{3}t[1|2][a-zA-Z]{2}_([a-zA-Z][0-9]){2})$ ``` Just add anchors. `^` matches the beginning of the line. `$` matches the end of the line. Since you have `$` it will not match strings with extra characters.
Also you can simplify your expression: ``` \b([a-z]{3}t[1|2][a-z]{2}_([a-z][0-9]){2})\b ``` -match operator is case insensitive Or if you want validate the entire string: ``` \A([a-z]{3}t[1|2][a-z]{2}_([a-z][0-9]){2})\z ```
184,864
Has anyone had good experiences of talking direct to RPG programs running on a V5R4 iSeries machine from Java? If so, what are the recommendations of the community, and what pitfalls should I try to avoid? From the various pieces of literature and spike solutions I have attempted it looks as though we can use ProgramC...
2008/10/08
[ "https://Stackoverflow.com/questions/184864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26283/" ]
I suggest using IBM's Java Toolbox for Java. Put the JT400.jar into your classpath (or JT400Ntv.jar if the Java is running on the iSeries). I've used both the ProgramCall class and the CommandCall classes. The com.ibm.as400.access.CommandCall class is easy to use. It has a simple constructor that you pass a com.ibm.as...
We just use JDBC and stored procedures. The stored procedure calls the RPG instead of running SQL. I'm not an RPG programmer, but it seems like a very simple interface. DataQueues are OK, but they aren't as robust as something like JMS (no guaranteed delivery).
184,864
Has anyone had good experiences of talking direct to RPG programs running on a V5R4 iSeries machine from Java? If so, what are the recommendations of the community, and what pitfalls should I try to avoid? From the various pieces of literature and spike solutions I have attempted it looks as though we can use ProgramC...
2008/10/08
[ "https://Stackoverflow.com/questions/184864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26283/" ]
You should look at [JTOpen](http://jt400.sourceforge.net/). It is fairly easy to use that to do what you want to do. Here is an example someone has put together: [program call to as400 using jtopen](http://codenewbie.com/forum/java/1921-program-call-as400-using-jtopen.html)
I've had some success with PCML documents. I decided to use PCML since encoding the commandcall into a string when passing parameters to an RPG program can get really ugly. PCML allows you to somewhat transparently pass java data types to an rpg program as a parameter. The drawback is that the xml in the PCML doc beco...
184,864
Has anyone had good experiences of talking direct to RPG programs running on a V5R4 iSeries machine from Java? If so, what are the recommendations of the community, and what pitfalls should I try to avoid? From the various pieces of literature and spike solutions I have attempted it looks as though we can use ProgramC...
2008/10/08
[ "https://Stackoverflow.com/questions/184864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26283/" ]
I suggest using IBM's Java Toolbox for Java. Put the JT400.jar into your classpath (or JT400Ntv.jar if the Java is running on the iSeries). I've used both the ProgramCall class and the CommandCall classes. The com.ibm.as400.access.CommandCall class is easy to use. It has a simple constructor that you pass a com.ibm.as...
You should look at [JTOpen](http://jt400.sourceforge.net/). It is fairly easy to use that to do what you want to do. Here is an example someone has put together: [program call to as400 using jtopen](http://codenewbie.com/forum/java/1921-program-call-as400-using-jtopen.html)
184,864
Has anyone had good experiences of talking direct to RPG programs running on a V5R4 iSeries machine from Java? If so, what are the recommendations of the community, and what pitfalls should I try to avoid? From the various pieces of literature and spike solutions I have attempted it looks as though we can use ProgramC...
2008/10/08
[ "https://Stackoverflow.com/questions/184864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26283/" ]
I suggest using IBM's Java Toolbox for Java. Put the JT400.jar into your classpath (or JT400Ntv.jar if the Java is running on the iSeries). I've used both the ProgramCall class and the CommandCall classes. The com.ibm.as400.access.CommandCall class is easy to use. It has a simple constructor that you pass a com.ibm.as...
I've had some success with PCML documents. I decided to use PCML since encoding the commandcall into a string when passing parameters to an RPG program can get really ugly. PCML allows you to somewhat transparently pass java data types to an rpg program as a parameter. The drawback is that the xml in the PCML doc beco...
184,864
Has anyone had good experiences of talking direct to RPG programs running on a V5R4 iSeries machine from Java? If so, what are the recommendations of the community, and what pitfalls should I try to avoid? From the various pieces of literature and spike solutions I have attempted it looks as though we can use ProgramC...
2008/10/08
[ "https://Stackoverflow.com/questions/184864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26283/" ]
I've had some success with PCML documents. I decided to use PCML since encoding the commandcall into a string when passing parameters to an RPG program can get really ugly. PCML allows you to somewhat transparently pass java data types to an rpg program as a parameter. The drawback is that the xml in the PCML doc beco...
Hmm, I'm new here and would vote KC Baltz answer up, but cannot yet. Stored procedures are the way to go. I've used JT open to call programs natively and found issues with the number of parms that could be passed, issues with data types, etc. Once you have an SQL procedure wrapper around your program you'll find the Ja...
184,864
Has anyone had good experiences of talking direct to RPG programs running on a V5R4 iSeries machine from Java? If so, what are the recommendations of the community, and what pitfalls should I try to avoid? From the various pieces of literature and spike solutions I have attempted it looks as though we can use ProgramC...
2008/10/08
[ "https://Stackoverflow.com/questions/184864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26283/" ]
It is quite simple to call java methods directly from RPG. I am not sure exactly what you are trying to do, I have made calls directly to java methods several times. For an example of how this is done. Take a look at [RPGMail](http://mowyourlawn.com/html/RPGMail.php). You can look at the source and see how Aaron used ...
Hmm, I'm new here and would vote KC Baltz answer up, but cannot yet. Stored procedures are the way to go. I've used JT open to call programs natively and found issues with the number of parms that could be passed, issues with data types, etc. Once you have an SQL procedure wrapper around your program you'll find the Ja...
184,864
Has anyone had good experiences of talking direct to RPG programs running on a V5R4 iSeries machine from Java? If so, what are the recommendations of the community, and what pitfalls should I try to avoid? From the various pieces of literature and spike solutions I have attempted it looks as though we can use ProgramC...
2008/10/08
[ "https://Stackoverflow.com/questions/184864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26283/" ]
I suggest using IBM's Java Toolbox for Java. Put the JT400.jar into your classpath (or JT400Ntv.jar if the Java is running on the iSeries). I've used both the ProgramCall class and the CommandCall classes. The com.ibm.as400.access.CommandCall class is easy to use. It has a simple constructor that you pass a com.ibm.as...
It is quite simple to call java methods directly from RPG. I am not sure exactly what you are trying to do, I have made calls directly to java methods several times. For an example of how this is done. Take a look at [RPGMail](http://mowyourlawn.com/html/RPGMail.php). You can look at the source and see how Aaron used ...
184,864
Has anyone had good experiences of talking direct to RPG programs running on a V5R4 iSeries machine from Java? If so, what are the recommendations of the community, and what pitfalls should I try to avoid? From the various pieces of literature and spike solutions I have attempted it looks as though we can use ProgramC...
2008/10/08
[ "https://Stackoverflow.com/questions/184864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26283/" ]
I suggest using IBM's Java Toolbox for Java. Put the JT400.jar into your classpath (or JT400Ntv.jar if the Java is running on the iSeries). I've used both the ProgramCall class and the CommandCall classes. The com.ibm.as400.access.CommandCall class is easy to use. It has a simple constructor that you pass a com.ibm.as...
Hmm, I'm new here and would vote KC Baltz answer up, but cannot yet. Stored procedures are the way to go. I've used JT open to call programs natively and found issues with the number of parms that could be passed, issues with data types, etc. Once you have an SQL procedure wrapper around your program you'll find the Ja...
184,864
Has anyone had good experiences of talking direct to RPG programs running on a V5R4 iSeries machine from Java? If so, what are the recommendations of the community, and what pitfalls should I try to avoid? From the various pieces of literature and spike solutions I have attempted it looks as though we can use ProgramC...
2008/10/08
[ "https://Stackoverflow.com/questions/184864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26283/" ]
We just use JDBC and stored procedures. The stored procedure calls the RPG instead of running SQL. I'm not an RPG programmer, but it seems like a very simple interface. DataQueues are OK, but they aren't as robust as something like JMS (no guaranteed delivery).
Hmm, I'm new here and would vote KC Baltz answer up, but cannot yet. Stored procedures are the way to go. I've used JT open to call programs natively and found issues with the number of parms that could be passed, issues with data types, etc. Once you have an SQL procedure wrapper around your program you'll find the Ja...
184,864
Has anyone had good experiences of talking direct to RPG programs running on a V5R4 iSeries machine from Java? If so, what are the recommendations of the community, and what pitfalls should I try to avoid? From the various pieces of literature and spike solutions I have attempted it looks as though we can use ProgramC...
2008/10/08
[ "https://Stackoverflow.com/questions/184864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26283/" ]
You should look at [JTOpen](http://jt400.sourceforge.net/). It is fairly easy to use that to do what you want to do. Here is an example someone has put together: [program call to as400 using jtopen](http://codenewbie.com/forum/java/1921-program-call-as400-using-jtopen.html)
We just use JDBC and stored procedures. The stored procedure calls the RPG instead of running SQL. I'm not an RPG programmer, but it seems like a very simple interface. DataQueues are OK, but they aren't as robust as something like JMS (no guaranteed delivery).
5,994,724
Using the recv() function in C to read from a 'stream' socket, can the len parameter be zero? The recv() function returns zero for 'remote connection closed' and the number of bytes actually read on normal operation, so it sounds problematic if it should read zero bytes. P.S. Yes I know to deal with it separately,...
2011/05/13
[ "https://Stackoverflow.com/questions/5994724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2134702/" ]
I'm pretty sure it's undefined ... looking at Linux it's passed all the way down to the "driver" (ie. tcp, etc.) so it can mean something, but again I don't think that meaning is defined well. Certainly SuS doesn't say anything explicit about it. I think you are almost certainly better off just not doing it, and using...
I don't think the length parameter can be zero since even an empty string (message) needs to be terminated with '\0'.
5,994,724
Using the recv() function in C to read from a 'stream' socket, can the len parameter be zero? The recv() function returns zero for 'remote connection closed' and the number of bytes actually read on normal operation, so it sounds problematic if it should read zero bytes. P.S. Yes I know to deal with it separately,...
2011/05/13
[ "https://Stackoverflow.com/questions/5994724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2134702/" ]
I believe the answer is "it depends". **If it is not specified by the standard** (and indeed I believe it isn't) any implementation could do as it pleases. * It could fail with `EINVAL` * It could hang * It could return `0` and go on * It could print a funny message and start the game rogue (I understand `gcc` used to...
I don't think the length parameter can be zero since even an empty string (message) needs to be terminated with '\0'.
5,994,724
Using the recv() function in C to read from a 'stream' socket, can the len parameter be zero? The recv() function returns zero for 'remote connection closed' and the number of bytes actually read on normal operation, so it sounds problematic if it should read zero bytes. P.S. Yes I know to deal with it separately,...
2011/05/13
[ "https://Stackoverflow.com/questions/5994724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2134702/" ]
The documentation for `recv` on my system (Linux) says > If no messages are available at the socket, the receive calls wait for a message to arrive and > If a message is too long to fit in the supplied buffer, excess bytes may be discarded depending on the type of socket the message is received from. Based on the d...
I don't think the length parameter can be zero since even an empty string (message) needs to be terminated with '\0'.
5,994,724
Using the recv() function in C to read from a 'stream' socket, can the len parameter be zero? The recv() function returns zero for 'remote connection closed' and the number of bytes actually read on normal operation, so it sounds problematic if it should read zero bytes. P.S. Yes I know to deal with it separately,...
2011/05/13
[ "https://Stackoverflow.com/questions/5994724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2134702/" ]
POSIX's page about `recv()` is not really clear about it. In a non-normative part ("Application Usage"), it says `recv()` on a socket is equivalent to `read()` if no flags are given. POSIX's page about `read()` says a read of 0 bytes may check for errors; if there is no error or the implementation does not check, nothi...
I don't think the length parameter can be zero since even an empty string (message) needs to be terminated with '\0'.
5,994,724
Using the recv() function in C to read from a 'stream' socket, can the len parameter be zero? The recv() function returns zero for 'remote connection closed' and the number of bytes actually read on normal operation, so it sounds problematic if it should read zero bytes. P.S. Yes I know to deal with it separately,...
2011/05/13
[ "https://Stackoverflow.com/questions/5994724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2134702/" ]
I believe the answer is "it depends". **If it is not specified by the standard** (and indeed I believe it isn't) any implementation could do as it pleases. * It could fail with `EINVAL` * It could hang * It could return `0` and go on * It could print a funny message and start the game rogue (I understand `gcc` used to...
I'm pretty sure it's undefined ... looking at Linux it's passed all the way down to the "driver" (ie. tcp, etc.) so it can mean something, but again I don't think that meaning is defined well. Certainly SuS doesn't say anything explicit about it. I think you are almost certainly better off just not doing it, and using...
5,994,724
Using the recv() function in C to read from a 'stream' socket, can the len parameter be zero? The recv() function returns zero for 'remote connection closed' and the number of bytes actually read on normal operation, so it sounds problematic if it should read zero bytes. P.S. Yes I know to deal with it separately,...
2011/05/13
[ "https://Stackoverflow.com/questions/5994724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2134702/" ]
The documentation for `recv` on my system (Linux) says > If no messages are available at the socket, the receive calls wait for a message to arrive and > If a message is too long to fit in the supplied buffer, excess bytes may be discarded depending on the type of socket the message is received from. Based on the d...
I'm pretty sure it's undefined ... looking at Linux it's passed all the way down to the "driver" (ie. tcp, etc.) so it can mean something, but again I don't think that meaning is defined well. Certainly SuS doesn't say anything explicit about it. I think you are almost certainly better off just not doing it, and using...
5,994,724
Using the recv() function in C to read from a 'stream' socket, can the len parameter be zero? The recv() function returns zero for 'remote connection closed' and the number of bytes actually read on normal operation, so it sounds problematic if it should read zero bytes. P.S. Yes I know to deal with it separately,...
2011/05/13
[ "https://Stackoverflow.com/questions/5994724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2134702/" ]
I believe the answer is "it depends". **If it is not specified by the standard** (and indeed I believe it isn't) any implementation could do as it pleases. * It could fail with `EINVAL` * It could hang * It could return `0` and go on * It could print a funny message and start the game rogue (I understand `gcc` used to...
The documentation for `recv` on my system (Linux) says > If no messages are available at the socket, the receive calls wait for a message to arrive and > If a message is too long to fit in the supplied buffer, excess bytes may be discarded depending on the type of socket the message is received from. Based on the d...
5,994,724
Using the recv() function in C to read from a 'stream' socket, can the len parameter be zero? The recv() function returns zero for 'remote connection closed' and the number of bytes actually read on normal operation, so it sounds problematic if it should read zero bytes. P.S. Yes I know to deal with it separately,...
2011/05/13
[ "https://Stackoverflow.com/questions/5994724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2134702/" ]
I believe the answer is "it depends". **If it is not specified by the standard** (and indeed I believe it isn't) any implementation could do as it pleases. * It could fail with `EINVAL` * It could hang * It could return `0` and go on * It could print a funny message and start the game rogue (I understand `gcc` used to...
POSIX's page about `recv()` is not really clear about it. In a non-normative part ("Application Usage"), it says `recv()` on a socket is equivalent to `read()` if no flags are given. POSIX's page about `read()` says a read of 0 bytes may check for errors; if there is no error or the implementation does not check, nothi...
5,994,724
Using the recv() function in C to read from a 'stream' socket, can the len parameter be zero? The recv() function returns zero for 'remote connection closed' and the number of bytes actually read on normal operation, so it sounds problematic if it should read zero bytes. P.S. Yes I know to deal with it separately,...
2011/05/13
[ "https://Stackoverflow.com/questions/5994724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2134702/" ]
The documentation for `recv` on my system (Linux) says > If no messages are available at the socket, the receive calls wait for a message to arrive and > If a message is too long to fit in the supplied buffer, excess bytes may be discarded depending on the type of socket the message is received from. Based on the d...
POSIX's page about `recv()` is not really clear about it. In a non-normative part ("Application Usage"), it says `recv()` on a socket is equivalent to `read()` if no flags are given. POSIX's page about `read()` says a read of 0 bytes may check for errors; if there is no error or the implementation does not check, nothi...
17,998,228
The signs of the eigenvectors in the `eigen` function change depending on the specification of the `symmetric` argument. Consider the following example: ``` set.seed(1234) data <- matrix(rnorm(200),nrow=100) cov.matrix <- cov(data) vectors.1 <- eigen(cov.matrix,symmetric=TRUE)$vectors vectors.2 <- eigen(cov.matrix,sym...
2013/08/01
[ "https://Stackoverflow.com/questions/17998228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1317443/" ]
Eigenvectors remain eigenvectors after multiplication by a scalar (including -1). The proof is simple: If `v` is an eigenvector of matrix `A` with matching eigenvalue `c`, then by definition `Av=cv`. Then, `A(-v) = -(Av) = -(cv) = c(-v)`. So `-v` is also an eigenvector with the same eigenvalue. The bottom line is t...
If you want to change the sign of eigenvector elements, then simply ensure $\mathbf{1}^T\mathbf{e}>1$. In other words, sum all the elements in each eigenvector, and ensure the sum is greater than one. If not, change the sign of each element to the opposite sign. This is the trick to get the sign of eigenvector elements...
17,998,228
The signs of the eigenvectors in the `eigen` function change depending on the specification of the `symmetric` argument. Consider the following example: ``` set.seed(1234) data <- matrix(rnorm(200),nrow=100) cov.matrix <- cov(data) vectors.1 <- eigen(cov.matrix,symmetric=TRUE)$vectors vectors.2 <- eigen(cov.matrix,sym...
2013/08/01
[ "https://Stackoverflow.com/questions/17998228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1317443/" ]
Linear algebra libraries like [LAPACK](http://en.wikipedia.org/wiki/LAPACK) contain multiple subroutines for carrying out operations like eigendecompositions. The particular subroutine used in any given case may depend on the type of matrix being decomposed, and the pieces of that decomposition needed by the user. As ...
If you want to change the sign of eigenvector elements, then simply ensure $\mathbf{1}^T\mathbf{e}>1$. In other words, sum all the elements in each eigenvector, and ensure the sum is greater than one. If not, change the sign of each element to the opposite sign. This is the trick to get the sign of eigenvector elements...
315,961
As stated in the title, how is the following simplification performed? $$\frac{\left(\frac{n}{e}\right)^n}{\left(\frac{n}{2e}\right)^n}=2^n$$ This was shown by a student in this [Recitation video](http://www.youtube.com/watch?feature=player_embedded&v=P7frcB_-g4w) (29:05) from MIT OpenCourseware.
2013/02/27
[ "https://math.stackexchange.com/questions/315961", "https://math.stackexchange.com", "https://math.stackexchange.com/users/52207/" ]
$$\frac{\left(\frac{n}{e}\right)^n}{\left(\frac{n}{2e}\right)^n} = \frac{n^n (2e)^n}{e^nn^n}$$ by $\frac{a/b}{c/d} = \frac{ad}{bc}$. Clearly, the $n^n$ terms cancel, and $(2e)^n = 2^ne^n$. Then, the $e^n$ terms cancel.
Use the rules: $$\dfrac{\frac{a}{b}}{\frac{c}{d}} = \frac{a d}{b c}$$ $$ \left(\frac{a}{b}\right)^n = \frac{a^n}{b^n}$$ $$ (ab)^n = a^n b^n$$ See if you can figure out how it simplifies.
315,961
As stated in the title, how is the following simplification performed? $$\frac{\left(\frac{n}{e}\right)^n}{\left(\frac{n}{2e}\right)^n}=2^n$$ This was shown by a student in this [Recitation video](http://www.youtube.com/watch?feature=player_embedded&v=P7frcB_-g4w) (29:05) from MIT OpenCourseware.
2013/02/27
[ "https://math.stackexchange.com/questions/315961", "https://math.stackexchange.com", "https://math.stackexchange.com/users/52207/" ]
$$\frac{\left(\frac{n}{e}\right)^n}{\left(\frac{n}{2e}\right)^n} = \frac{n^n (2e)^n}{e^nn^n}$$ by $\frac{a/b}{c/d} = \frac{ad}{bc}$. Clearly, the $n^n$ terms cancel, and $(2e)^n = 2^ne^n$. Then, the $e^n$ terms cancel.
$$\frac{\left(\frac{n}{e}\right)^n}{\left(\frac{n}{2e}\right)^n} =\frac{\left(\frac{n}{e}\right)^n}{\left(\frac{1}{2}\right)^n\left(\frac{n}{e}\right)^n} =\frac{1}{1/2^n}=2^n$$
856
My Expresso-store shipping dropdown is coded like this: ``` <strong>Please select your delivery/collection preference:</strong> <br /> <span class="bluetext">(please note we do not deliver outside the zones listed here) </span> <br /> <select name="shipping_method"> <option value="">Select collection or delivery prefe...
2012/11/30
[ "https://expressionengine.stackexchange.com/questions/856", "https://expressionengine.stackexchange.com", "https://expressionengine.stackexchange.com/users/437/" ]
Simply add `require="shipping_method"` to your template: ``` {exp:store:checkout require="shipping_method"} <select name="shipping_method"> <option value="">Select collection or delivery preference...</option> {shipping_method_options} </select> {if error:shipping_method}<p class="form_erro...
The easiest way to achieve what you are after would be to do it with a bit of javascript. Personally I like [Validate](http://archive.plugins.jquery.com/project/validate) jQuery plugin. So you could do it a few ways with that. ``` <select name="shipping_method" class="required"> <option value="">Select collection or ...
75,758
I have a car cigarette extension cord with a USB out on it as well. The USB out though will not charge my phone, which is a bit annoying. I had a look at the circuit inside in the device and it looked something like this: ![Power supply circuit](https://i.imgur.com/faPZh30.png) I'm guessing the reason the phone won't...
2013/07/13
[ "https://electronics.stackexchange.com/questions/75758", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/26315/" ]
A linear regulator such as 7805 would work, if you heatsink it adequately. Suppose, that the 7805 is outputting 1A\*\* at 5V, which is 5W. It draws 1A at 14.5\*\*\* from the supply, which is 14.5W. Where does the remaining 9.5W go? It's lost as heat. To keep 7805 cool, the heat needs to be dissipated. That's why you...
The basic concept is sound, although a bit profligate. You want to worry a little bit about heat-sinking the 7805, since for every 5 mW out, you're burning 7 mW in the regulator heat sink (because current out essentially = current in, and you're dropping 7V across the regulator). You'd do a lot better with a 12V-to-5V ...
75,758
I have a car cigarette extension cord with a USB out on it as well. The USB out though will not charge my phone, which is a bit annoying. I had a look at the circuit inside in the device and it looked something like this: ![Power supply circuit](https://i.imgur.com/faPZh30.png) I'm guessing the reason the phone won't...
2013/07/13
[ "https://electronics.stackexchange.com/questions/75758", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/26315/" ]
Two things. One, the 7805 and 78L05 are identical in operation and pinning, the only significant difference being the current they can operate at. There is heat concerns with higher current, but the TO-220 case that the 7805 comes in handles more heat. Essentially, they are drop in replacements for each other. **BUT t...
The basic concept is sound, although a bit profligate. You want to worry a little bit about heat-sinking the 7805, since for every 5 mW out, you're burning 7 mW in the regulator heat sink (because current out essentially = current in, and you're dropping 7V across the regulator). You'd do a lot better with a 12V-to-5V ...
75,758
I have a car cigarette extension cord with a USB out on it as well. The USB out though will not charge my phone, which is a bit annoying. I had a look at the circuit inside in the device and it looked something like this: ![Power supply circuit](https://i.imgur.com/faPZh30.png) I'm guessing the reason the phone won't...
2013/07/13
[ "https://electronics.stackexchange.com/questions/75758", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/26315/" ]
The basic concept is sound, although a bit profligate. You want to worry a little bit about heat-sinking the 7805, since for every 5 mW out, you're burning 7 mW in the regulator heat sink (because current out essentially = current in, and you're dropping 7V across the regulator). You'd do a lot better with a 12V-to-5V ...
A better alternative is by using SMR88xx ([eBay link](http://www.ebay.com/itm/DC-DC-converter-mini-SMR88xx-high-current-replacement-7805-7809-1-Lot-10pcs-/181181177608)), it's has higher power, less dissipation heat.
75,758
I have a car cigarette extension cord with a USB out on it as well. The USB out though will not charge my phone, which is a bit annoying. I had a look at the circuit inside in the device and it looked something like this: ![Power supply circuit](https://i.imgur.com/faPZh30.png) I'm guessing the reason the phone won't...
2013/07/13
[ "https://electronics.stackexchange.com/questions/75758", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/26315/" ]
A linear regulator such as 7805 would work, if you heatsink it adequately. Suppose, that the 7805 is outputting 1A\*\* at 5V, which is 5W. It draws 1A at 14.5\*\*\* from the supply, which is 14.5W. Where does the remaining 9.5W go? It's lost as heat. To keep 7805 cool, the heat needs to be dissipated. That's why you...
A better alternative is by using SMR88xx ([eBay link](http://www.ebay.com/itm/DC-DC-converter-mini-SMR88xx-high-current-replacement-7805-7809-1-Lot-10pcs-/181181177608)), it's has higher power, less dissipation heat.
75,758
I have a car cigarette extension cord with a USB out on it as well. The USB out though will not charge my phone, which is a bit annoying. I had a look at the circuit inside in the device and it looked something like this: ![Power supply circuit](https://i.imgur.com/faPZh30.png) I'm guessing the reason the phone won't...
2013/07/13
[ "https://electronics.stackexchange.com/questions/75758", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/26315/" ]
Two things. One, the 7805 and 78L05 are identical in operation and pinning, the only significant difference being the current they can operate at. There is heat concerns with higher current, but the TO-220 case that the 7805 comes in handles more heat. Essentially, they are drop in replacements for each other. **BUT t...
A better alternative is by using SMR88xx ([eBay link](http://www.ebay.com/itm/DC-DC-converter-mini-SMR88xx-high-current-replacement-7805-7809-1-Lot-10pcs-/181181177608)), it's has higher power, less dissipation heat.
307,623
I'm writing some RSS feeds in PHP and stuggling with character-encoding issues. Should I utf8\_encode() before or after htmlentities() encoding? For example, I've got both ampersands and Chinese characters in a description element, and I'm not sure which of these is proper: ``` $output = utf8_encode(htmlentities($sour...
2008/11/21
[ "https://Stackoverflow.com/questions/307623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17307/" ]
Don't use `htmlentities()`! Simply use UTF-8 characters. Just make sure you declare encoding of the feed in HTTP headers (`Content-Type:application/xml;charset=UTF-8`) or failing that, in the feed itself using `<?xml version="1.0" encoding="UTF-8"?>` on the first line.
You want to do `$output = htmlentities(utf8_encode($source));`. This is because you want to convert your international characters into proper UTF8 first, and then have ampersands (and possibly some of the UTF-8 characters as well) turned in to HTML entities. If you do the entities first, then some of the international ...
307,623
I'm writing some RSS feeds in PHP and stuggling with character-encoding issues. Should I utf8\_encode() before or after htmlentities() encoding? For example, I've got both ampersands and Chinese characters in a description element, and I'm not sure which of these is proper: ``` $output = utf8_encode(htmlentities($sour...
2008/11/21
[ "https://Stackoverflow.com/questions/307623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17307/" ]
Don't use `htmlentities()`! Simply use UTF-8 characters. Just make sure you declare encoding of the feed in HTTP headers (`Content-Type:application/xml;charset=UTF-8`) or failing that, in the feed itself using `<?xml version="1.0" encoding="UTF-8"?>` on the first line.
It might be easier to forget htmlentities and use a CDATA section. It works for the title section, which doesn't seem support encoded HTML characters in Firefox's RSS viewer: ``` <title><![CDATA[News & Updates " > » ☂ ☺ ☹ ☃ Test!]]></title> ```
307,623
I'm writing some RSS feeds in PHP and stuggling with character-encoding issues. Should I utf8\_encode() before or after htmlentities() encoding? For example, I've got both ampersands and Chinese characters in a description element, and I'm not sure which of these is proper: ``` $output = utf8_encode(htmlentities($sour...
2008/11/21
[ "https://Stackoverflow.com/questions/307623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17307/" ]
Don't use `htmlentities()`! Simply use UTF-8 characters. Just make sure you declare encoding of the feed in HTTP headers (`Content-Type:application/xml;charset=UTF-8`) or failing that, in the feed itself using `<?xml version="1.0" encoding="UTF-8"?>` on the first line.
After much trial & error, I finally found a way to properly display a string from a utf8-encoded database value, through an xml file, to an html page: ``` $output = '<![CDATA['.utf8_encode(htmlentities($string)).']]>'; ``` I hope this helps someone.
307,623
I'm writing some RSS feeds in PHP and stuggling with character-encoding issues. Should I utf8\_encode() before or after htmlentities() encoding? For example, I've got both ampersands and Chinese characters in a description element, and I'm not sure which of these is proper: ``` $output = utf8_encode(htmlentities($sour...
2008/11/21
[ "https://Stackoverflow.com/questions/307623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17307/" ]
It might be easier to forget htmlentities and use a CDATA section. It works for the title section, which doesn't seem support encoded HTML characters in Firefox's RSS viewer: ``` <title><![CDATA[News & Updates " > » ☂ ☺ ☹ ☃ Test!]]></title> ```
After much trial & error, I finally found a way to properly display a string from a utf8-encoded database value, through an xml file, to an html page: ``` $output = '<![CDATA['.utf8_encode(htmlentities($string)).']]>'; ``` I hope this helps someone.
307,623
I'm writing some RSS feeds in PHP and stuggling with character-encoding issues. Should I utf8\_encode() before or after htmlentities() encoding? For example, I've got both ampersands and Chinese characters in a description element, and I'm not sure which of these is proper: ``` $output = utf8_encode(htmlentities($sour...
2008/11/21
[ "https://Stackoverflow.com/questions/307623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17307/" ]
It's important to pass the character set to the htmlentities function, as the default is ISO-8859-1: ``` utf8_encode(htmlentities($source,ENT_COMPAT,'utf-8')); ``` You should apply htmlentities first as to allow utf8\_encode to encode the entities properly. (EDIT: I changed from my opinion before that the order did...
It might be easier to forget htmlentities and use a CDATA section. It works for the title section, which doesn't seem support encoded HTML characters in Firefox's RSS viewer: ``` <title><![CDATA[News & Updates " > » ☂ ☺ ☹ ☃ Test!]]></title> ```
307,623
I'm writing some RSS feeds in PHP and stuggling with character-encoding issues. Should I utf8\_encode() before or after htmlentities() encoding? For example, I've got both ampersands and Chinese characters in a description element, and I'm not sure which of these is proper: ``` $output = utf8_encode(htmlentities($sour...
2008/11/21
[ "https://Stackoverflow.com/questions/307623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17307/" ]
First: The [`utf8_encode` function](http://docs.php.net/utf8_encode) converts from ISO 8859-1 to UTF-8. So you only need this function, if your input encoding/charset is ISO 8859-1. But why don’t you use UTF-8 in the first place? Second: You don’t need [`htmlentities`](http://docs.php.net/htmlentities). You just need ...
Don't use `htmlentities()`! Simply use UTF-8 characters. Just make sure you declare encoding of the feed in HTTP headers (`Content-Type:application/xml;charset=UTF-8`) or failing that, in the feed itself using `<?xml version="1.0" encoding="UTF-8"?>` on the first line.
307,623
I'm writing some RSS feeds in PHP and stuggling with character-encoding issues. Should I utf8\_encode() before or after htmlentities() encoding? For example, I've got both ampersands and Chinese characters in a description element, and I'm not sure which of these is proper: ``` $output = utf8_encode(htmlentities($sour...
2008/11/21
[ "https://Stackoverflow.com/questions/307623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17307/" ]
It's important to pass the character set to the htmlentities function, as the default is ISO-8859-1: ``` utf8_encode(htmlentities($source,ENT_COMPAT,'utf-8')); ``` You should apply htmlentities first as to allow utf8\_encode to encode the entities properly. (EDIT: I changed from my opinion before that the order did...
You want to do `$output = htmlentities(utf8_encode($source));`. This is because you want to convert your international characters into proper UTF8 first, and then have ampersands (and possibly some of the UTF-8 characters as well) turned in to HTML entities. If you do the entities first, then some of the international ...
307,623
I'm writing some RSS feeds in PHP and stuggling with character-encoding issues. Should I utf8\_encode() before or after htmlentities() encoding? For example, I've got both ampersands and Chinese characters in a description element, and I'm not sure which of these is proper: ``` $output = utf8_encode(htmlentities($sour...
2008/11/21
[ "https://Stackoverflow.com/questions/307623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17307/" ]
You want to do `$output = htmlentities(utf8_encode($source));`. This is because you want to convert your international characters into proper UTF8 first, and then have ampersands (and possibly some of the UTF-8 characters as well) turned in to HTML entities. If you do the entities first, then some of the international ...
After much trial & error, I finally found a way to properly display a string from a utf8-encoded database value, through an xml file, to an html page: ``` $output = '<![CDATA['.utf8_encode(htmlentities($string)).']]>'; ``` I hope this helps someone.
307,623
I'm writing some RSS feeds in PHP and stuggling with character-encoding issues. Should I utf8\_encode() before or after htmlentities() encoding? For example, I've got both ampersands and Chinese characters in a description element, and I'm not sure which of these is proper: ``` $output = utf8_encode(htmlentities($sour...
2008/11/21
[ "https://Stackoverflow.com/questions/307623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17307/" ]
It's important to pass the character set to the htmlentities function, as the default is ISO-8859-1: ``` utf8_encode(htmlentities($source,ENT_COMPAT,'utf-8')); ``` You should apply htmlentities first as to allow utf8\_encode to encode the entities properly. (EDIT: I changed from my opinion before that the order did...
First: The [`utf8_encode` function](http://docs.php.net/utf8_encode) converts from ISO 8859-1 to UTF-8. So you only need this function, if your input encoding/charset is ISO 8859-1. But why don’t you use UTF-8 in the first place? Second: You don’t need [`htmlentities`](http://docs.php.net/htmlentities). You just need ...
307,623
I'm writing some RSS feeds in PHP and stuggling with character-encoding issues. Should I utf8\_encode() before or after htmlentities() encoding? For example, I've got both ampersands and Chinese characters in a description element, and I'm not sure which of these is proper: ``` $output = utf8_encode(htmlentities($sour...
2008/11/21
[ "https://Stackoverflow.com/questions/307623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17307/" ]
It might be easier to forget htmlentities and use a CDATA section. It works for the title section, which doesn't seem support encoded HTML characters in Firefox's RSS viewer: ``` <title><![CDATA[News & Updates " > » ☂ ☺ ☹ ☃ Test!]]></title> ```
You want to do `$output = htmlentities(utf8_encode($source));`. This is because you want to convert your international characters into proper UTF8 first, and then have ampersands (and possibly some of the UTF-8 characters as well) turned in to HTML entities. If you do the entities first, then some of the international ...
48,729,167
I have an API that I am POSTing a small JSON object too. This runs as an infinite loop, looping over 7 colours (the rainbow) and send these inside the aforementioned JSON object. The API I am connecting to has a rate limit on it of 40 requests per minute. I don't want to hit the rate limit and so I have devised a me...
2018/02/11
[ "https://Stackoverflow.com/questions/48729167", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1739852/" ]
My suggestion: Take an entirely different approach to rate limiting. I would put it in the HTTP transport, since that's logically where such a limit ought to exist, and then you needn't mangle your application code at all. Something like: ``` import ( "net/http" "golang.org/x/time/rate" ) type rateLimitTran...
Try changing to ``` func makeTheLightsBlinkTheRainbow(request *gorequest.SuperAgent) { colours := [7]string{"red", "orange", "yellow", "green", "blue", "purple", "pink"} i := 0 for { if rateLimit > 0 { response, _, _ := request.Post("http://example.com/blink"). Send(f...
28,997,850
I practice in realization a memory manager in C. I want the structure, that has a various length and self-described. So, I peep at a POSIX textbook something, like that: ``` struct layout { uint32_t size; // array size in bytes, include space after the struct uchar_t data[1]; }; // But, is next line correct? la...
2015/03/11
[ "https://Stackoverflow.com/questions/28997850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/864113/" ]
The Standard C version of this is called *flexible array member* and it looks like: ``` struct layout { uint32_t size; uchar_t data[]; }; // allocate one of these blocks (in a function) struct layout *val = malloc( sizeof *val + number_of_bytes ); val->size = number_of_bytes; ``` --- The code `val1->data +...
The general idea will work, but that specific struct will only work if the most-severe boundary alignment case is an int. A memory manager, particularly one that might be a back-end for an implementation of `malloc()`, must know what that worst-case boundary is. The actual start of data must be on that boundary in or...
1,281,032
$$ A \times B \times C \times D \times E \times F = 7 \times 10^7 $$ How can I find the number of ordered solutions for integers (I mean for integers $A,B,C,D,E,F$) so that they can satisfy the above equation?
2015/05/13
[ "https://math.stackexchange.com/questions/1281032", "https://math.stackexchange.com", "https://math.stackexchange.com/users/240350/" ]
The factorization of $7 \times 10^7 $ is simply $2^7 \times 5^7 \times 7 $. Suppose for now we restrict the search for positive integer solutions only. For non-negative integers $x\_i, y\_i, z\_i $, let $A = 2^{x\_1} \cdot 5^{y\_1} \cdot 7^{z\_1}, B = 2^{x\_2} \cdot 5^{y\_2} \cdot 7^{z\_2} , \ldots, F = 2^{x\_6} \cdot ...
This is essentially the same as: [How many ways are there to express a number as the product of groups of three of its factors?](https://math.stackexchange.com/questions/1273623/how-many-ways-are-there-to-express-a-number-as-the-product-of-groups-of-three-of/1273628#1273628) except instead of needing 3 distinct numbers...
38,989,127
i understand,below `column` will be `signed int` by default. ``` id INT(6); ``` Can an `auto increment column` specified below be signed by default? Mysql starts the value from 1 for an auto increment column. ``` id INT(6) AUTO_INCREMENT PRIMARY KEY ```
2016/08/17
[ "https://Stackoverflow.com/questions/38989127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1704453/" ]
Yes, you can create an auto increment primary key with a signed int. Try this: ``` CREATE TABLE mytable( id int(6) AUTO_INCREMENT PRIMARY KEY); ``` Then the following queries are both valid ``` INSERT INTO mytable values(); INSERT INTO mytable values(-10); ``` This will result in the table having a row with -10 a...
After a lot of searches... I looked for a solution with a TRIGGER called BEFORE INSERT ! I found this : <https://stackoverflow.com/a/43441586/2282880> Here is my variant : ``` CREATE TRIGGER `invertID` BEFORE INSERT ON `<table>` FOR EACH ROW SET NEW.id=CONCAT("-", ( SELECT `auto_increment` FROM ...
57,893,426
Consider this enum: ```vb Private Enum colors white = 0 black = 1 End Enum ``` IntelliSense shows black and then white while I'd prefer to see white and then black. I don't care about the numbers. Is there a way to customize the enum sequence of the items shown by IntelliSense?
2019/09/11
[ "https://Stackoverflow.com/questions/57893426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11738627/" ]
You could prefix the values to create you custom list order. [![Screenshot](https://i.stack.imgur.com/yBHts.png)](https://i.stack.imgur.com/yBHts.png)
> > *if you type "colors." and then the TAB key it writes the first element (black). I'd prefer to put the most used one first for writing it faster.* > > > Don't use `TAB` for completion then. Type `colors.b` then hit `Ctrl`+`Space`, and it'll either complete to `Black` (if it's the only member that begins with a...
39,436,029
I have an activity 'A' in the application that I'm developing. This activity will be shown once I start the app. It can also be visited by selecting it from the overflow menu in the action bar. I have configured the action bar of this activity 'A' in such a way that the `UP` icon will be displayed when it is selected...
2016/09/11
[ "https://Stackoverflow.com/questions/39436029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3972508/" ]
You can handle the `up` click and fire off your parent activity intent: ``` @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { // Respond to the action bar's Up/Home button case android.R.id.home: startActivity(new Intent(this, YourActivity.class)); ...
Don't bother with setting the parent, just handle the up button yourself. Here is how; ``` @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: // Launch activity here return(true); } return(super.onOptionsIte...
4,216
I've been looking at [the cards from Dominion: Alchemy](http://dominion.diehrstraits.com/?set=Alchemy) and want to use some of them in my own games through proxying of the blank cards. However, I don't feel like delving into the whole potion thing, especially since it would be annoying to have to proxy at least 4 diffe...
2011/07/18
[ "https://boardgames.stackexchange.com/questions/4216", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/191/" ]
One of the defining characteristics of Potions in Alchemy is that they force a reshuffle-delay. That is, you have to first invest in the potion, then reshuffle and draw it before you're able to spend it on a card. This is never going to be true of a cost that is just boosted to cost more coins, unfortunately. I don'...
Honestly, I would just proxy a pair of potions. Potions are different from normal treasures in that each player often will only buy 1, whereas a typical game will have multiple purchases of Gold and Silver by each person. So, making the Potion proxies does not require as many cards as Kingdom card proxies. If your goa...
4,216
I've been looking at [the cards from Dominion: Alchemy](http://dominion.diehrstraits.com/?set=Alchemy) and want to use some of them in my own games through proxying of the blank cards. However, I don't feel like delving into the whole potion thing, especially since it would be annoying to have to proxy at least 4 diffe...
2011/07/18
[ "https://boardgames.stackexchange.com/questions/4216", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/191/" ]
I agree with the other two answers, but I have a little more to add, so since you haven't accepted an answer I'll throw in my two cents. The point of potions in the cost isn't to make things cost *more*, it's to make things cost *different*. (The re-shuffle delay is also a good point.) If you want a potion card, you n...
One of the defining characteristics of Potions in Alchemy is that they force a reshuffle-delay. That is, you have to first invest in the potion, then reshuffle and draw it before you're able to spend it on a card. This is never going to be true of a cost that is just boosted to cost more coins, unfortunately. I don'...
4,216
I've been looking at [the cards from Dominion: Alchemy](http://dominion.diehrstraits.com/?set=Alchemy) and want to use some of them in my own games through proxying of the blank cards. However, I don't feel like delving into the whole potion thing, especially since it would be annoying to have to proxy at least 4 diffe...
2011/07/18
[ "https://boardgames.stackexchange.com/questions/4216", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/191/" ]
One of the defining characteristics of Potions in Alchemy is that they force a reshuffle-delay. That is, you have to first invest in the potion, then reshuffle and draw it before you're able to spend it on a card. This is never going to be true of a cost that is just boosted to cost more coins, unfortunately. I don'...
So many of the Alchemy cards don't make sense unless you have potions that giving them potionless costs seems like it completely misses the point. That said, I disagree that a pair of potions is enough -- when I go potion I almost always buy two.
4,216
I've been looking at [the cards from Dominion: Alchemy](http://dominion.diehrstraits.com/?set=Alchemy) and want to use some of them in my own games through proxying of the blank cards. However, I don't feel like delving into the whole potion thing, especially since it would be annoying to have to proxy at least 4 diffe...
2011/07/18
[ "https://boardgames.stackexchange.com/questions/4216", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/191/" ]
I agree with the other two answers, but I have a little more to add, so since you haven't accepted an answer I'll throw in my two cents. The point of potions in the cost isn't to make things cost *more*, it's to make things cost *different*. (The re-shuffle delay is also a good point.) If you want a potion card, you n...
Honestly, I would just proxy a pair of potions. Potions are different from normal treasures in that each player often will only buy 1, whereas a typical game will have multiple purchases of Gold and Silver by each person. So, making the Potion proxies does not require as many cards as Kingdom card proxies. If your goa...
4,216
I've been looking at [the cards from Dominion: Alchemy](http://dominion.diehrstraits.com/?set=Alchemy) and want to use some of them in my own games through proxying of the blank cards. However, I don't feel like delving into the whole potion thing, especially since it would be annoying to have to proxy at least 4 diffe...
2011/07/18
[ "https://boardgames.stackexchange.com/questions/4216", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/191/" ]
Honestly, I would just proxy a pair of potions. Potions are different from normal treasures in that each player often will only buy 1, whereas a typical game will have multiple purchases of Gold and Silver by each person. So, making the Potion proxies does not require as many cards as Kingdom card proxies. If your goa...
So many of the Alchemy cards don't make sense unless you have potions that giving them potionless costs seems like it completely misses the point. That said, I disagree that a pair of potions is enough -- when I go potion I almost always buy two.
4,216
I've been looking at [the cards from Dominion: Alchemy](http://dominion.diehrstraits.com/?set=Alchemy) and want to use some of them in my own games through proxying of the blank cards. However, I don't feel like delving into the whole potion thing, especially since it would be annoying to have to proxy at least 4 diffe...
2011/07/18
[ "https://boardgames.stackexchange.com/questions/4216", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/191/" ]
I agree with the other two answers, but I have a little more to add, so since you haven't accepted an answer I'll throw in my two cents. The point of potions in the cost isn't to make things cost *more*, it's to make things cost *different*. (The re-shuffle delay is also a good point.) If you want a potion card, you n...
So many of the Alchemy cards don't make sense unless you have potions that giving them potionless costs seems like it completely misses the point. That said, I disagree that a pair of potions is enough -- when I go potion I almost always buy two.
70,189,413
What could be the best way to use a list set and create or export this data to a **csv** file?  To begin with, I must highlight that my data is of type `string` so I will need a method to collect these and filter the commas and values as integer *type*. ``` signals = ['-108', '-107', '-107', '-107', '-107', '-107', '...
2021/12/01
[ "https://Stackoverflow.com/questions/70189413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17002128/" ]
``` android { ... lintOptions { checkReleaseBuilds false } } ```
Try with `abortOnError true`. It should ignor lint error. Lint is a tool that checks for warnings and errors on your project. And additionally I advise you to use [Android Studio Canary](https://developer.android.com/studio/preview?gclid=CjwKCAiAwKyNBhBfEiwA_mrUMgDipky7Vm34qh3Gt-QCjl0kQIr1sMYhKSx6IbN-HlPCJOS6LN58bRoC74...
50,411,296
I am getting a crash below: > > This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this data. > > > But I have already added the 'Pri...
2018/05/18
[ "https://Stackoverflow.com/questions/50411296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1619132/" ]
Please check your .plist as a source code and see if your key doesn't contain space at the end like: ``` <key>NSContactsUsageDescription </key> ```
if you are using App test and and App UItest then there would be multple plist files in your project just make it sure you are adding discription in right if **plist** [![enter image description here](https://i.stack.imgur.com/gcJ2O.png)](https://i.stack.imgur.com/gcJ2O.png)
50,411,296
I am getting a crash below: > > This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this data. > > > But I have already added the 'Pri...
2018/05/18
[ "https://Stackoverflow.com/questions/50411296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1619132/" ]
Please check your .plist as a source code and see if your key doesn't contain space at the end like: ``` <key>NSContactsUsageDescription </key> ```
Go To info.plist And Privacy - Contacts Usage Description Value : Allow Contact Access For Details [enter image description here](https://i.stack.imgur.com/EkzyA.png)
50,411,296
I am getting a crash below: > > This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this data. > > > But I have already added the 'Pri...
2018/05/18
[ "https://Stackoverflow.com/questions/50411296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1619132/" ]
Please check your .plist as a source code and see if your key doesn't contain space at the end like: ``` <key>NSContactsUsageDescription </key> ```
I had this problem. There was no Info.plist in a new project and adding it didn't do anything. Solution: * Click project * Select `Info` tab * HERE you can add stuff!
50,411,296
I am getting a crash below: > > This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this data. > > > But I have already added the 'Pri...
2018/05/18
[ "https://Stackoverflow.com/questions/50411296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1619132/" ]
Could be that you have accidentally added the key to your UITests target. I've done that a few times with the location privacy keys. By the way, your contacts usage description "Allow contact access" probably would not pass Apple's review, because it does not state *why* you want to use them.
if you are using App test and and App UItest then there would be multple plist files in your project just make it sure you are adding discription in right if **plist** [![enter image description here](https://i.stack.imgur.com/gcJ2O.png)](https://i.stack.imgur.com/gcJ2O.png)
50,411,296
I am getting a crash below: > > This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this data. > > > But I have already added the 'Pri...
2018/05/18
[ "https://Stackoverflow.com/questions/50411296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1619132/" ]
Could be that you have accidentally added the key to your UITests target. I've done that a few times with the location privacy keys. By the way, your contacts usage description "Allow contact access" probably would not pass Apple's review, because it does not state *why* you want to use them.
Go To info.plist And Privacy - Contacts Usage Description Value : Allow Contact Access For Details [enter image description here](https://i.stack.imgur.com/EkzyA.png)
50,411,296
I am getting a crash below: > > This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this data. > > > But I have already added the 'Pri...
2018/05/18
[ "https://Stackoverflow.com/questions/50411296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1619132/" ]
Could be that you have accidentally added the key to your UITests target. I've done that a few times with the location privacy keys. By the way, your contacts usage description "Allow contact access" probably would not pass Apple's review, because it does not state *why* you want to use them.
I had this problem. There was no Info.plist in a new project and adding it didn't do anything. Solution: * Click project * Select `Info` tab * HERE you can add stuff!
6,940,773
I have the following jQuery code: ``` $('#foo').click(function () { var loading = $('<img id="loading" src="images/loader.gif" alt="loading" />'); $('#stars').prepend(loading); alert('WAIT'); }); $('#bar').click(function () { $('#stars').empty(); }); ``` When first clicking `#foo` the image is be...
2011/08/04
[ "https://Stackoverflow.com/questions/6940773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/549007/" ]
`onMeasure()` is usually called during layout phase. Besides as far as I know `onMeasure()` is where *YOU* have to measure your view. It receives 2 values which are the size of the parent of your view which may be constant. Why don't you just check the length of the text you're setting and if it's too long just replac...
From the [`View`](http://developer.android.com/reference/android/view/View.html#onMeasure%28int,%20int%29) documentation page. > > Measure the view and its content to determine the measured width and > the measured height. This method is invoked by **measure(int, int)** > and should be overriden by subclasses to pr...
6,940,773
I have the following jQuery code: ``` $('#foo').click(function () { var loading = $('<img id="loading" src="images/loader.gif" alt="loading" />'); $('#stars').prepend(loading); alert('WAIT'); }); $('#bar').click(function () { $('#stars').empty(); }); ``` When first clicking `#foo` the image is be...
2011/08/04
[ "https://Stackoverflow.com/questions/6940773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/549007/" ]
`onMeasure()` is usually called during layout phase. Besides as far as I know `onMeasure()` is where *YOU* have to measure your view. It receives 2 values which are the size of the parent of your view which may be constant. Why don't you just check the length of the text you're setting and if it's too long just replac...
In your `onMeasure(int,int)` 1. **CALL `super(int,int)`** 2. **Use `getMeasuredWidth()` and `getMeasuredHeight`** something like this: ``` void onMeasure(int a, int b){ super(a,b); if(getMeasuredWidth()>bla) setText("default"); } ```
6,940,773
I have the following jQuery code: ``` $('#foo').click(function () { var loading = $('<img id="loading" src="images/loader.gif" alt="loading" />'); $('#stars').prepend(loading); alert('WAIT'); }); $('#bar').click(function () { $('#stars').empty(); }); ``` When first clicking `#foo` the image is be...
2011/08/04
[ "https://Stackoverflow.com/questions/6940773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/549007/" ]
`onMeasure()` is usually called during layout phase. Besides as far as I know `onMeasure()` is where *YOU* have to measure your view. It receives 2 values which are the size of the parent of your view which may be constant. Why don't you just check the length of the text you're setting and if it's too long just replac...
This is what I do to reduce the text font in case the text content is large enough to goto the next line. The problem is pretty much the same the only difference in your case is that you want to replace it with some other default text. ``` ViewTreeObserver vto = ((TextView)findViewById(R.id.myTextView)).getViewTreeObs...
6,940,773
I have the following jQuery code: ``` $('#foo').click(function () { var loading = $('<img id="loading" src="images/loader.gif" alt="loading" />'); $('#stars').prepend(loading); alert('WAIT'); }); $('#bar').click(function () { $('#stars').empty(); }); ``` When first clicking `#foo` the image is be...
2011/08/04
[ "https://Stackoverflow.com/questions/6940773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/549007/" ]
`onMeasure()` is usually called during layout phase. Besides as far as I know `onMeasure()` is where *YOU* have to measure your view. It receives 2 values which are the size of the parent of your view which may be constant. Why don't you just check the length of the text you're setting and if it's too long just replac...
This is my idea: You can measure the text trivially with `.length()` if its length is bigger than your desired limit, than cut put only the substring. But if you want to display entire text you can implement `onClickListener()` on that `TextView` which envoking will show entire text as `Dialog` or whatever. Another ...
6,940,773
I have the following jQuery code: ``` $('#foo').click(function () { var loading = $('<img id="loading" src="images/loader.gif" alt="loading" />'); $('#stars').prepend(loading); alert('WAIT'); }); $('#bar').click(function () { $('#stars').empty(); }); ``` When first clicking `#foo` the image is be...
2011/08/04
[ "https://Stackoverflow.com/questions/6940773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/549007/" ]
`onMeasure()` is usually called during layout phase. Besides as far as I know `onMeasure()` is where *YOU* have to measure your view. It receives 2 values which are the size of the parent of your view which may be constant. Why don't you just check the length of the text you're setting and if it's too long just replac...
You could register a custom `TextWatcher` with `addTextChangedListener (TextWatcher watcher)`. Inside the `TextWatcher` you would override the `afterTextChanged(Editable s)` function, mesure the lenght of the text, and if too long, set it back to your default text. EDIT: I'm not too sure about this, but this is why I...
6,940,773
I have the following jQuery code: ``` $('#foo').click(function () { var loading = $('<img id="loading" src="images/loader.gif" alt="loading" />'); $('#stars').prepend(loading); alert('WAIT'); }); $('#bar').click(function () { $('#stars').empty(); }); ``` When first clicking `#foo` the image is be...
2011/08/04
[ "https://Stackoverflow.com/questions/6940773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/549007/" ]
`onMeasure()` is usually called during layout phase. Besides as far as I know `onMeasure()` is where *YOU* have to measure your view. It receives 2 values which are the size of the parent of your view which may be constant. Why don't you just check the length of the text you're setting and if it's too long just replac...
You will want to implement `Textwatcher` and in the `onTextChanged(...)` method, call `TextView`'s [setEms(...)](http://developer.android.com/reference/android/widget/TextView.html#setEms%28int%29) method, which will set the width of the `TextView` to the width of (n *m*'s), where n is the input for `setEms(...)`. ``...
30,337
I am supposed to give a speech on a chuppah next week BSD. I am totally blank! Have had a few ideas to talk about, focusing on Shalom Bayit, but I cannot pick a nice one so everyone present can learn from it. Would anyone have any good and inspiring Shalom Bayis stories to share so I could pick one?
2013/08/05
[ "https://judaism.stackexchange.com/questions/30337", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/3090/" ]
I once posted this [here](https://judaism.stackexchange.com/questions/3350/milchig-fleishig-arrangement#comment10153_3351): > > Story with the Lubavitcher Rebbe: A man once asked the Lubavitcher Rebbe if it is true that folding your tallis right after shabbos is a segulah for shalom bayis. The Rebbe answered, "I don'...
Or this story from [here](http://learningtogive.org/faithgroups/voices/shalom_bayit.asp) > > It is important not to fall prey to the danger of forfeiting Shalom > Bayit in the very process of pursuing the ideal of a blissful Jewish > home. The story is told that one Friday night the Chafetz Chaim > visited the ho...
30,337
I am supposed to give a speech on a chuppah next week BSD. I am totally blank! Have had a few ideas to talk about, focusing on Shalom Bayit, but I cannot pick a nice one so everyone present can learn from it. Would anyone have any good and inspiring Shalom Bayis stories to share so I could pick one?
2013/08/05
[ "https://judaism.stackexchange.com/questions/30337", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/3090/" ]
I once posted this [here](https://judaism.stackexchange.com/questions/3350/milchig-fleishig-arrangement#comment10153_3351): > > Story with the Lubavitcher Rebbe: A man once asked the Lubavitcher Rebbe if it is true that folding your tallis right after shabbos is a segulah for shalom bayis. The Rebbe answered, "I don'...
[Here](https://www.youtube.com/watch?v=XhuCWb0TV9U) is my favorite collection of ideas to share at a chuppah (told over by Rabbi Shlomo Carlebach).
30,337
I am supposed to give a speech on a chuppah next week BSD. I am totally blank! Have had a few ideas to talk about, focusing on Shalom Bayit, but I cannot pick a nice one so everyone present can learn from it. Would anyone have any good and inspiring Shalom Bayis stories to share so I could pick one?
2013/08/05
[ "https://judaism.stackexchange.com/questions/30337", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/3090/" ]
Or this story from [here](http://learningtogive.org/faithgroups/voices/shalom_bayit.asp) > > It is important not to fall prey to the danger of forfeiting Shalom > Bayit in the very process of pursuing the ideal of a blissful Jewish > home. The story is told that one Friday night the Chafetz Chaim > visited the ho...
[Here](https://www.youtube.com/watch?v=XhuCWb0TV9U) is my favorite collection of ideas to share at a chuppah (told over by Rabbi Shlomo Carlebach).
18,630,320
How to modify classic strategy pattern in case when each ConcreteStrategy talks to DataStorage? There are different types of data storage and the interface depends on the concrete strategy.
2013/09/05
[ "https://Stackoverflow.com/questions/18630320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1058588/" ]
Make your strategies dependent on DataStorage via constructor injection. Then each strategy can use DataStorage as they please. If DataStorage implements many interfaces, make each strategy dependent on that particular interface.
A brief answer could be: First Define your common interfaces for data storage like: ``` Query() Update() Delete() Add() Create() ``` Second, implement these interfaces in each concrete data storage implementation class. When you use these class objects, you call the method via interface methods, the real task carr...
18,630,320
How to modify classic strategy pattern in case when each ConcreteStrategy talks to DataStorage? There are different types of data storage and the interface depends on the concrete strategy.
2013/09/05
[ "https://Stackoverflow.com/questions/18630320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1058588/" ]
Make your strategies dependent on DataStorage via constructor injection. Then each strategy can use DataStorage as they please. If DataStorage implements many interfaces, make each strategy dependent on that particular interface.
Remember that pattern is just general thing. You can do whatever you need to make that pattern work in your situation. You can combine your strategy with Factory, Memento, etc. Right now everybody talks about "injecting". But using interfaces has been around for long time. ``` public class ConcreteStrategy : IStrateg...
33,580,250
``` >>> b = lambda x, y = 2: x + y >>> b( 1 ) 3 ``` I can't figure out how this function produces 3
2015/11/07
[ "https://Stackoverflow.com/questions/33580250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5473302/" ]
b is equivalent to ``` def b(x, y=2): return x+y ``` Then I think you could understand why b(1) is 3
That's because a default value is set to `y` Let's see with demo: * with no default value ``` >>b = lambda x, y: x + y >>b() TypeError: <lambda>() takes exactly 2 arguments (0 given) >>b(1) TypeError: <lambda>() takes exactly 2 arguments (1 given) >>b(1,2) 3 ``` * With default value in `y` ``` >>b = lambda x, y=1:...
42,342
[![enter image description here](https://i.stack.imgur.com/I8qAm.png)](https://i.stack.imgur.com/I8qAm.png)I want to have a wired Internet connection before or after a PoE access point. Is that possible?
2017/07/04
[ "https://networkengineering.stackexchange.com/questions/42342", "https://networkengineering.stackexchange.com", "https://networkengineering.stackexchange.com/users/37980/" ]
As far as I understand your problem: on the location of the AP you want another, wired Internet access? You can run the AP's patch cable through a switch to add ports to the network. However, (usually) PoE doesn't pass the switch, so you'll need to connect the switch to the LAN side of the PoE injector. Then, from the...
The Access point has the Ethernet port,there you can connect a PC or Switch.from that port you can get access user will get access on the same AP IP range.
42,342
[![enter image description here](https://i.stack.imgur.com/I8qAm.png)](https://i.stack.imgur.com/I8qAm.png)I want to have a wired Internet connection before or after a PoE access point. Is that possible?
2017/07/04
[ "https://networkengineering.stackexchange.com/questions/42342", "https://networkengineering.stackexchange.com", "https://networkengineering.stackexchange.com/users/37980/" ]
For PoE to work, the last device before the PD (powered device, in your case an access point) needs to be the PSE (power sourcing equipment, in your case the PoE "injector", also called a Midspan). Your options are a) remove the PoE injector and install a switch which supports PoE instead between the firewall and AP, o...
As far as I understand your problem: on the location of the AP you want another, wired Internet access? You can run the AP's patch cable through a switch to add ports to the network. However, (usually) PoE doesn't pass the switch, so you'll need to connect the switch to the LAN side of the PoE injector. Then, from the...
42,342
[![enter image description here](https://i.stack.imgur.com/I8qAm.png)](https://i.stack.imgur.com/I8qAm.png)I want to have a wired Internet connection before or after a PoE access point. Is that possible?
2017/07/04
[ "https://networkengineering.stackexchange.com/questions/42342", "https://networkengineering.stackexchange.com", "https://networkengineering.stackexchange.com/users/37980/" ]
For PoE to work, the last device before the PD (powered device, in your case an access point) needs to be the PSE (power sourcing equipment, in your case the PoE "injector", also called a Midspan). Your options are a) remove the PoE injector and install a switch which supports PoE instead between the firewall and AP, o...
The Access point has the Ethernet port,there you can connect a PC or Switch.from that port you can get access user will get access on the same AP IP range.
700,844
I'm having a problem with my hard disk. I only have 80GB of HD, then I rename my Admin user like (Shaqnet to My PC) then from that time before I rename the administrator I only have 39GB space and a free space of 38GB. After I rename it I notice that I only have 1 GB space. What should I do? I tried to delete the fil...
2014/01/13
[ "https://superuser.com/questions/700844", "https://superuser.com", "https://superuser.com/users/289468/" ]
One thing you could do if some suspicious activity takes place, is to kill the **gnome-keyring-daemon** like so : ``` kill -9 $(pgrep gnome-keyring-d) ``` You could simply do a simple script to make it automatically: ``` #!/bin/bash case $1 in hibernate) pkill gnome-keyring-d ;; suspend) ...
In the main GUI of Gnome keyring (at least in the current version, which is seahorse 3.36), the user can right-click a keyring to get the context menu where an option to lock the keyring is available. It is also possible to create more keyrings in addition to the default one (called "login") and store passwords in diff...
700,844
I'm having a problem with my hard disk. I only have 80GB of HD, then I rename my Admin user like (Shaqnet to My PC) then from that time before I rename the administrator I only have 39GB space and a free space of 38GB. After I rename it I notice that I only have 1 GB space. What should I do? I tried to delete the fil...
2014/01/13
[ "https://superuser.com/questions/700844", "https://superuser.com", "https://superuser.com/users/289468/" ]
You only need to call [gnome\_keyring\_lock\_all\_sync()](https://developer.gnome.org/gnome-keyring/stable/gnome-keyring-Keyrings.html#gnome-keyring-lock-all). Here's a simple program which does that: lock-keyring.c: ``` #include <stdio.h> #include <gnome-keyring.h> int main() { GnomeKeyringResult lock_result =...
In the main GUI of Gnome keyring (at least in the current version, which is seahorse 3.36), the user can right-click a keyring to get the context menu where an option to lock the keyring is available. It is also possible to create more keyrings in addition to the default one (called "login") and store passwords in diff...
700,844
I'm having a problem with my hard disk. I only have 80GB of HD, then I rename my Admin user like (Shaqnet to My PC) then from that time before I rename the administrator I only have 39GB space and a free space of 38GB. After I rename it I notice that I only have 1 GB space. What should I do? I tried to delete the fil...
2014/01/13
[ "https://superuser.com/questions/700844", "https://superuser.com", "https://superuser.com/users/289468/" ]
The Gnome keyring can be locked via dbus: ``` dbus-send --dest=org.gnome.keyring --print-reply /org/freedesktop/secrets org.freedesktop.Secret.Service.LockService # or with qdbus qdbus org.gnome.keyring /org/freedesktop/secrets org.freedesktop.Secret.Service.LockService ``` Source: <https://github.com/Intika-Linux-A...
In the main GUI of Gnome keyring (at least in the current version, which is seahorse 3.36), the user can right-click a keyring to get the context menu where an option to lock the keyring is available. It is also possible to create more keyrings in addition to the default one (called "login") and store passwords in diff...