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
17,367,700
I have created a form with the option to dynamically add fields with excellent code help from <http://charlie.griefer.com/blog/2009/09/17/jquery-dynamically-adding-form-elements/>. The only issue is that I want the fields to generate without also showing new 'Add' and 'Remove' buttons. How should I go about doing this?...
2013/06/28
[ "https://Stackoverflow.com/questions/17367700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2532297/" ]
Like this? ``` var arrClasses = []; $("div[class*='some-class-']").removeClass(function () { // Select the element divs which has class that starts with some-class- var className = this.className.match(/some-class-\d+/); //get a match to match the pattern some-class-somenumber and extract that classname if (cl...
**The easy way** You clould create your own filter : ``` $.fn.hasClassStartsWith = function(className) { return this.filter('[class^=\''+className+'\'], [class*=\''+className+'\']'); } var divs = $('div').hasClassStartsWith("some-class-"); console.log(divs.get()); ``` [**See fiddle**](http://jsfiddle.net/W7PvB...
17,367,700
I have created a form with the option to dynamically add fields with excellent code help from <http://charlie.griefer.com/blog/2009/09/17/jquery-dynamically-adding-form-elements/>. The only issue is that I want the fields to generate without also showing new 'Add' and 'Remove' buttons. How should I go about doing this?...
2013/06/28
[ "https://Stackoverflow.com/questions/17367700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2532297/" ]
Like this? ``` var arrClasses = []; $("div[class*='some-class-']").removeClass(function () { // Select the element divs which has class that starts with some-class- var className = this.className.match(/some-class-\d+/); //get a match to match the pattern some-class-somenumber and extract that classname if (cl...
You can iterate over each found node and iterate over the classes to find a match; if found, remove the class and log it: ``` var found = []; $('div[class*="some-class-"]').each(function() { var classes = this.className.split(/\s+/), $this = $(this); $.each(classes, function(i, name) { if (name.indexOf('...
17,367,700
I have created a form with the option to dynamically add fields with excellent code help from <http://charlie.griefer.com/blog/2009/09/17/jquery-dynamically-adding-form-elements/>. The only issue is that I want the fields to generate without also showing new 'Add' and 'Remove' buttons. How should I go about doing this?...
2013/06/28
[ "https://Stackoverflow.com/questions/17367700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2532297/" ]
You could loop through all the elements, pull the class name using a regular expression, and store them in an array: ```js var classNames = []; $('div[class*="some-class-"]').each(function(i, el){ var name = (el.className.match(/(^|\s)(some\-class\-[^\s]*)/) || [,,''])[2]; if(name){ classNames.push...
**The easy way** You clould create your own filter : ``` $.fn.hasClassStartsWith = function(className) { return this.filter('[class^=\''+className+'\'], [class*=\''+className+'\']'); } var divs = $('div').hasClassStartsWith("some-class-"); console.log(divs.get()); ``` [**See fiddle**](http://jsfiddle.net/W7PvB...
17,367,700
I have created a form with the option to dynamically add fields with excellent code help from <http://charlie.griefer.com/blog/2009/09/17/jquery-dynamically-adding-form-elements/>. The only issue is that I want the fields to generate without also showing new 'Add' and 'Remove' buttons. How should I go about doing this?...
2013/06/28
[ "https://Stackoverflow.com/questions/17367700", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2532297/" ]
You can iterate over each found node and iterate over the classes to find a match; if found, remove the class and log it: ``` var found = []; $('div[class*="some-class-"]').each(function() { var classes = this.className.split(/\s+/), $this = $(this); $.each(classes, function(i, name) { if (name.indexOf('...
**The easy way** You clould create your own filter : ``` $.fn.hasClassStartsWith = function(className) { return this.filter('[class^=\''+className+'\'], [class*=\''+className+'\']'); } var divs = $('div').hasClassStartsWith("some-class-"); console.log(divs.get()); ``` [**See fiddle**](http://jsfiddle.net/W7PvB...
72,192,162
I am trying to solve a problem where i need to find difference of number months between 2 strings ``` "January 2022" "July 2022" Answer=7 ``` I looked all over internet to find answer but could not, mostly answer used datetime library Is there any other way to solve this problem? I tried to create a static dicti...
2022/05/10
[ "https://Stackoverflow.com/questions/72192162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13184945/" ]
At first I tried to use `datetime` modules but later if found much simpler way. 1. you reverse the dictionary to convert month to month id 2. convert year to month by mulitplying with 12. ``` month_ids = dict({ "January":1, "February":2, "March":3, "April":4, "May":5, "June":6, "July":7, ...
Use [`dateutil`](https://dateutil.readthedocs.io/en/stable/index.html): ``` from dateutil import parser, relativedelta def delta_months(a, b): """ returns negative delta if b > a """ a = parser.parse(a) b = parser.parse(b) delta = relativedelta.relativedelta(a, b) delta = delta.years * 12 + delta....
2,619,967
Let $m$ be a perfect square of 4 digits, with the digits $\lt 9$. Adding $1$ to each of the digits of $m$ will form another perfect square. Find $m$. To be honest i'm absolutely lost, i tried with brute force but for this kind of problem i like to get the "elegant" way to solve it.
2018/01/25
[ "https://math.stackexchange.com/questions/2619967", "https://math.stackexchange.com", "https://math.stackexchange.com/users/455734/" ]
$m=a^2$ and $m+1111=b^2$, so $b^2-a^2=(b-a)(b+a)=1111=11\cdot 101$ where $11$ and $101$ are prime. Thus, there are two solutions for $b-a$ and $b+a$ that we need to try: * $b-a=1, b+a=1111$: $b=556, a=555$, but then $a^2=308025$ and is not a 4-digit number * $b-a=11, b+a=101$: $b=56, a=45$: $a^2=2025$ and $b^2=3136$ -...
\begin{eqnarray\*} 1000a+100b+10c+d=x^2 \\ 1000(a+1)+100(b+1)+10(c+1)+(d+1)=y^2 \\ 1111 = y^2-x^2 \\ \color{blue}{11} \times \color{red}{101} = \color{blue}{(y-x)} \color{red}{(y+x)} \end{eqnarray\*} Gives $x=45$ and $y=56$.
15,144,255
I would like to build a treeview like this: ``` People Person 1 Relatives Relative 1 Relative 2 Mom Dad Pets Pet 1 Pet 2 ``` The problem is that a person has 2 lists (Relatives and Pets) and two Single Items (Mom and Dad). I'm pretty familiar with HierarchicalDataTempl...
2013/02/28
[ "https://Stackoverflow.com/questions/15144255", "https://Stackoverflow.com", "https://Stackoverflow.com/users/221515/" ]
Just a guess but, are you getting a warning about initialization casting a double to a float (using MSVS)? Or possibly it's messing up b/c everything is ending up being cast as an integer b/c of the '4'? If so, the problem is that when you type out a number it's a double. But you're using it as a float, to resolve it,...
You're using the C style cast. The syntax for casts has changed with C++. You want to look for something like this: ``` dynamic_cast<something*>( yourthing ); ```
423,748
thank you for reading. I was trying to use some commutators in an array when I found this error : > > ! Missing number, treated as zero. a l.9 [a] A > number should have been here; I inserted '0'. (If you can't figure out > why I needed to see a number, look up 'weird error' in the index to > The TeXbook.) > > ...
2018/03/28
[ "https://tex.stackexchange.com/questions/423748", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/159394/" ]
* in your table you not need `\multirow` cells. * however, if you persit to have them in your table design, you can exploit new features of `multirow` package, which offer new option `=` by which multiroe cell overtake defined width ov column. for example, that column is of type `p{22mm}`, than `\multirow{2}{=}{<cell c...
Actually, you don't need any multirow,and only 4 columns. Here is a much simpler code, with the first column 1/3 of the other columns width. Also, you should use `booktabs` with vertical rules: horizontal and vertical rules don't intersect properly. I replaced `\bottomrule` with `\Xhline` from `makecell. Last point: ne...
62,231,220
I have an HTML input on my page. The user is able to type text into it. When he types in a command, that I specified, and presses enter, the page outputs information into the `input.value`. If the user types in something random and confirms his input, the page just outputs: "Unknown command.", again into to `input.valu...
2020/06/06
[ "https://Stackoverflow.com/questions/62231220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13693217/" ]
I have updated your code a bit to do exactly what you want. What was essentially done was to: 1. Keep track of when you pressed `13 - Enter`. 2. Then if `13 - Enter` was previously pressed, just make sure to clear the input. You can check the demo here: <https://jsfiddle.net/nh6c7ugf/> ``` var clInput = 0; // Note: ...
Sorry if I don't understand what you are trying to say but if you want that the user can just start typing in something new, after receiving value and doesn't have to delete the value that you put in there. you can do ``` function test() { document.querySelector("#inputMain").value = "This is kind of working…"; ...
5,350,591
I have a simple code below: ``` class B; class A{ B b; }; class B{ public: B(){ } }; ``` In class A's definition, I have a B-typed property. Using MS Visual Studio to compile, I've got the following error: ``` error C2079: 'A::b' uses undefined class 'B' ``` Due to some reasons, I can't put class B'...
2011/03/18
[ "https://Stackoverflow.com/questions/5350591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/197896/" ]
The compiler is already telling you what's wrong : A has a member data b which is of an undefined type. Your forward declaration: ``` class B; ``` is just that : a declaration, not a definition. Since class A contains an instance of B directly (not just a pointer to B), the compiler needs to know the exact size of B...
``` class A; class B { A * getA(); }; class A { B b; }; ``` This is the typical way to solve this. You *must* have B's definition in order to have a `B b;` member. You need a forward declaration in order to declare a reference/pointer to B, you need the full definition in order to do anything else with B (suc...
5,350,591
I have a simple code below: ``` class B; class A{ B b; }; class B{ public: B(){ } }; ``` In class A's definition, I have a B-typed property. Using MS Visual Studio to compile, I've got the following error: ``` error C2079: 'A::b' uses undefined class 'B' ``` Due to some reasons, I can't put class B'...
2011/03/18
[ "https://Stackoverflow.com/questions/5350591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/197896/" ]
The compiler is already telling you what's wrong : A has a member data b which is of an undefined type. Your forward declaration: ``` class B; ``` is just that : a declaration, not a definition. Since class A contains an instance of B directly (not just a pointer to B), the compiler needs to know the exact size of B...
You can do what you wish if you change the reference to `b` into a pointer to `B`. ``` class A{ B* bPtr; }; class B{ public: B(){ } }; ``` In principle, you don't need an *explicit declaration* - that is, a *forward declaration* is all that is needed - when you don't need the actual size of the class, ...
5,350,591
I have a simple code below: ``` class B; class A{ B b; }; class B{ public: B(){ } }; ``` In class A's definition, I have a B-typed property. Using MS Visual Studio to compile, I've got the following error: ``` error C2079: 'A::b' uses undefined class 'B' ``` Due to some reasons, I can't put class B'...
2011/03/18
[ "https://Stackoverflow.com/questions/5350591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/197896/" ]
The compiler is already telling you what's wrong : A has a member data b which is of an undefined type. Your forward declaration: ``` class B; ``` is just that : a declaration, not a definition. Since class A contains an instance of B directly (not just a pointer to B), the compiler needs to know the exact size of B...
C++ has the concept of an "incomplete" class and it is something you need to know. Using an incomplete class allows you, in many situations, to use a class just knowing it is one, without knowing what is in it. This enables the class detail to change later without requiring a recompile, thus it is a far weaker depend...
47,213,127
I have a column 'Incident\_Time' representing time in a data frame in R. when I call the str() function on the column it says something like this > > str(crime\_data$Incident\_Time) > > > Factor w/ 1439 levels "00:01:00","00:02:00",..: 840 945 1140 981 1260 969 1020 840 980 765 ... > > > I want to convert this...
2017/11/09
[ "https://Stackoverflow.com/questions/47213127", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1496554/" ]
Unverified as there is no sample data, but you shouldn't have your incident time as a factor. Convert to time: ``` crime_data$Incident_Time <- chron(times=as.character(crime_data$Incident_Time)) ``` Then run your existing code
To provide a complete example. **Example Data** ``` sampletime<-chron(times=as.character(as.ITime(Sys.time()+sample(86400,100)))) ``` No modifications needed to code but it would not work until I converted `sampletime` to class `times` by using `chron`. I believe cut will not work if your data is not the same `clas...
37,464,446
I have 4 divs and 4 images and each of them has an ID. I need to show another div when you hover the first div's image. I wrote this code but only the first image with ID="insta2" and div ID="iinsta2" worked. ``` <style type="text/css"> #insta1{display:none} #insta2{display:none} #insta3{display:none} #insta...
2016/05/26
[ "https://Stackoverflow.com/questions/37464446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6383507/" ]
Use this way: ```css #insta1, #insta2, #insta3, #insta4 { display: none; } #iinsta1:hover + #insta1, #iinsta2:hover + #insta2, #iinsta3:hover + #insta3, #iinsta4:hover + #insta4 { display: block; } ``` ```html <table> <tr> <td colspan="3" rowspan="2" style="text-align:center; width:30%"> ...
```css img ~ p { visibility: hidden; } img:hover ~ p { visibility: visible; } ``` ```html <table border=1> <tr> <td> <div class="item"> <h1>Hover 1</h1> <img src="http://placekitten.com/100" /> <p>Hover</p> </div> </td> <td> <div class="item">...
544
I'm making a mint chocolate stout. I've made it before; I added 1.5 ounces of fresh spearmint to the last 10 or 15 minutes of the boil. It turned out alright, but it's not as strong as I'd like. The obvious answer would be to add more mint. But before I make it again, I'd like to utilize your collective experience. Wh...
2010/11/15
[ "https://homebrew.stackexchange.com/questions/544", "https://homebrew.stackexchange.com", "https://homebrew.stackexchange.com/users/12/" ]
Adding mint during the boil is good, but the problem is that you'll lose a lot of the mint aroma during primary fermentation as the C02 carries it out the airlock. The first thing that comes to mind would be to create a mint extract (soak the mint in vodka) and add that to your secondary. You can, of course, add the m...
Have you considered making an extract from your mint using vodka? It would give you a lot of control over how minty your stout ends up. When you're ready to bottle you can take a small sample of the beer and add the mint extract until the flavor profile is what you're looking for. Then you just scale the amount up for ...
544
I'm making a mint chocolate stout. I've made it before; I added 1.5 ounces of fresh spearmint to the last 10 or 15 minutes of the boil. It turned out alright, but it's not as strong as I'd like. The obvious answer would be to add more mint. But before I make it again, I'd like to utilize your collective experience. Wh...
2010/11/15
[ "https://homebrew.stackexchange.com/questions/544", "https://homebrew.stackexchange.com", "https://homebrew.stackexchange.com/users/12/" ]
Have you considered making an extract from your mint using vodka? It would give you a lot of control over how minty your stout ends up. When you're ready to bottle you can take a small sample of the beer and add the mint extract until the flavor profile is what you're looking for. Then you just scale the amount up for ...
What about sanitizing it then muddling it, than add it to your bottling bucket and pour your fermented beer over it. Similar to using mint for drinks in a bar the oils will break down and stay in bottles, or you could boil the mint in your priming sugar for boiling and make a simple syrup.
544
I'm making a mint chocolate stout. I've made it before; I added 1.5 ounces of fresh spearmint to the last 10 or 15 minutes of the boil. It turned out alright, but it's not as strong as I'd like. The obvious answer would be to add more mint. But before I make it again, I'd like to utilize your collective experience. Wh...
2010/11/15
[ "https://homebrew.stackexchange.com/questions/544", "https://homebrew.stackexchange.com", "https://homebrew.stackexchange.com/users/12/" ]
Adding mint during the boil is good, but the problem is that you'll lose a lot of the mint aroma during primary fermentation as the C02 carries it out the airlock. The first thing that comes to mind would be to create a mint extract (soak the mint in vodka) and add that to your secondary. You can, of course, add the m...
What about sanitizing it then muddling it, than add it to your bottling bucket and pour your fermented beer over it. Similar to using mint for drinks in a bar the oils will break down and stay in bottles, or you could boil the mint in your priming sugar for boiling and make a simple syrup.
58,375,170
I'm very new to coding, and want the code to count the frequency of the words, but I am stopped because I'm unsure of how to remove duplicates. ``` txt = " remember all those walls we built remember those times" words = txt.split() for word in words: print (word + " " + str(txt.count(word))) import pandas as pd m...
2019/10/14
[ "https://Stackoverflow.com/questions/58375170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Your syntax error is due to a closing missing parentheses (`)`) for `print` on the line *prior to* `import pandas as pd`. This line should read: ``` print(word + " " + str(txt.count(word))) ``` As a general tip for syntax errors, first check the preceding line or previous function call for missing or extra parenthes...
You need to add an extra closing bracket in line 4, and also add import pandas as pd in line 5 because you are using pd instead of pandas
58,375,170
I'm very new to coding, and want the code to count the frequency of the words, but I am stopped because I'm unsure of how to remove duplicates. ``` txt = " remember all those walls we built remember those times" words = txt.split() for word in words: print (word + " " + str(txt.count(word))) import pandas as pd m...
2019/10/14
[ "https://Stackoverflow.com/questions/58375170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You need: ``` txt = " remember all those walls we built remember those times" words = txt.split() for word in words: print(word + " " + str(txt.count(word))) import pandas as pd mytable = pd.DataFrame() for word in words: tempdf = pd.DataFrame ({"word" : [word], "frequency" : [txt.count(word)]}) myt...
You need to add an extra closing bracket in line 4, and also add import pandas as pd in line 5 because you are using pd instead of pandas
35,128,527
In Qt 4.8.5 32-bit and VS2010, I'm trying to create a Window as shown in this screenshot from QtDesigner: [![enter image description here](https://i.stack.imgur.com/P1v02.png)](https://i.stack.imgur.com/P1v02.png) When I run the application, the widgets get laid down on top of each other : [![enter image description ...
2016/02/01
[ "https://Stackoverflow.com/questions/35128527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2394327/" ]
The most clean and easy for understanding way would be to collect all tasks and run them directly on event. I just need to use invokeAll of ExecutorService. Following code sample can help: ``` public void handleSomeEvent(Event event) { List<Task> tasksToRunOnEvent = getTasksToRunOnEvent(event); List<Future<Tas...
I took tvelykyy's advice and played around a little bit and came up with this impl: ``` public class EventBasedExecutor extends ScheduledThreadPoolExecutor implements EventBasedExecutorService { private List<RunnableScheduledFuture<?>> workers = new ArrayList<>(); private int index; public EventBasedExe...
27,097,297
I'm trying to create a function to loop through some table rows but I need to use this.isempty instead of isempty. How do I access this inside of an each loop. Code: ``` function checkValues(look) { this.isempty = 1; this.search = $(look).find("input").each(function(){ if ($...
2014/11/24
[ "https://Stackoverflow.com/questions/27097297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4134359/" ]
You can use a closure variable in this case to refer `isempty` ``` function checkValues(look) { this.isempty = 1; var self = this; this.search = $(look).find("input").each(function () { if ($.trim($(this).val()) != "") { self.isempty = 0; } }); return this.isempty; } ``...
Do you need to reference `this` because of a constraint in your code? Would the following work? ``` function checkValues(look) { var isEmpty = 1; $(look).find("input").each(function(){ if ($.trim($(this).val())!="") { isEmpty = 0; return false; // Brea...
17,167,168
I have some strange problem where all my string arrays has the same value in the List. Here is my code: ``` List<string[]> map_data = new List<string[]>(); string[] map_data_array = new string[11]; for(int i = 0; i < 2000; i++) { map_data_array = PopulateDataFromFile(); // it returns different data every call ...
2013/06/18
[ "https://Stackoverflow.com/questions/17167168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1234373/" ]
That only happens if you place the same array into the list. As you did not give the code to `PopulateDataFromFile` we can only guess what happens. Make sure that the function returns a seperate array created with `new` each time.
In the loop everytime you just change the address of map\_data\_array , so that's why always the value will get changed to the newer data obtained from the method call. Reinitialize the string array everytime will help. It should look something like this ``` for(int i = 0; i < 2000; i++) { string[] ma...
17,167,168
I have some strange problem where all my string arrays has the same value in the List. Here is my code: ``` List<string[]> map_data = new List<string[]>(); string[] map_data_array = new string[11]; for(int i = 0; i < 2000; i++) { map_data_array = PopulateDataFromFile(); // it returns different data every call ...
2013/06/18
[ "https://Stackoverflow.com/questions/17167168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1234373/" ]
That only happens if you place the same array into the list. As you did not give the code to `PopulateDataFromFile` we can only guess what happens. Make sure that the function returns a seperate array created with `new` each time.
PopulateDataFromFile() is returning a String array with the same values.
17,167,168
I have some strange problem where all my string arrays has the same value in the List. Here is my code: ``` List<string[]> map_data = new List<string[]>(); string[] map_data_array = new string[11]; for(int i = 0; i < 2000; i++) { map_data_array = PopulateDataFromFile(); // it returns different data every call ...
2013/06/18
[ "https://Stackoverflow.com/questions/17167168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1234373/" ]
That only happens if you place the same array into the list. As you did not give the code to `PopulateDataFromFile` we can only guess what happens. Make sure that the function returns a seperate array created with `new` each time.
You need to process your data in chunks since `PopulateDataFromFile();` looks to be returning all of its data in one go (or as much as the array can fit). Using an extension method, you could do something like this: - ``` List<string[]> map_data = new List<string[]>(); foreach (var batch in PopulateDataFromFile().Batc...
17,167,168
I have some strange problem where all my string arrays has the same value in the List. Here is my code: ``` List<string[]> map_data = new List<string[]>(); string[] map_data_array = new string[11]; for(int i = 0; i < 2000; i++) { map_data_array = PopulateDataFromFile(); // it returns different data every call ...
2013/06/18
[ "https://Stackoverflow.com/questions/17167168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1234373/" ]
PopulateDataFromFile() is returning a String array with the same values.
In the loop everytime you just change the address of map\_data\_array , so that's why always the value will get changed to the newer data obtained from the method call. Reinitialize the string array everytime will help. It should look something like this ``` for(int i = 0; i < 2000; i++) { string[] ma...
17,167,168
I have some strange problem where all my string arrays has the same value in the List. Here is my code: ``` List<string[]> map_data = new List<string[]>(); string[] map_data_array = new string[11]; for(int i = 0; i < 2000; i++) { map_data_array = PopulateDataFromFile(); // it returns different data every call ...
2013/06/18
[ "https://Stackoverflow.com/questions/17167168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1234373/" ]
You need to process your data in chunks since `PopulateDataFromFile();` looks to be returning all of its data in one go (or as much as the array can fit). Using an extension method, you could do something like this: - ``` List<string[]> map_data = new List<string[]>(); foreach (var batch in PopulateDataFromFile().Batc...
In the loop everytime you just change the address of map\_data\_array , so that's why always the value will get changed to the newer data obtained from the method call. Reinitialize the string array everytime will help. It should look something like this ``` for(int i = 0; i < 2000; i++) { string[] ma...
17,167,168
I have some strange problem where all my string arrays has the same value in the List. Here is my code: ``` List<string[]> map_data = new List<string[]>(); string[] map_data_array = new string[11]; for(int i = 0; i < 2000; i++) { map_data_array = PopulateDataFromFile(); // it returns different data every call ...
2013/06/18
[ "https://Stackoverflow.com/questions/17167168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1234373/" ]
You need to process your data in chunks since `PopulateDataFromFile();` looks to be returning all of its data in one go (or as much as the array can fit). Using an extension method, you could do something like this: - ``` List<string[]> map_data = new List<string[]>(); foreach (var batch in PopulateDataFromFile().Batc...
PopulateDataFromFile() is returning a String array with the same values.
28,976,763
i am having trouble with this problem i can not find the bug i am storing strings form a file to a linked list. lets say the file contains 5 strings 1. jack 2. juan 3. steven 4. mike 5. sam --- the problem is that when i print the 5 node's linked list it prints [sam] [sam] [sam] [sam] [sam] . it prints the last str...
2015/03/11
[ "https://Stackoverflow.com/questions/28976763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3290636/" ]
You have only a single buffer to store your strings, `data`. Its contents get overwritten with every call to fscanf. Try `insertb(strdup(data));`.
you are setting the head to temp, which is the very last one every time you add some stuff into the list. In insertb function the else block is probably where you want to look for. Also it is considered to be a pretty bad idea to make global variables, hence it is very likely to change the content of the global variabl...
28,937,273
I want to read all the files in a particular directory, and I want to read it one by one. Here's what i've done so far. ls successfully get all the files from a specified directory, but could not give the file names to me one by one. It Echos the files one time only. I want to get it one by one because I need to do so...
2015/03/09
[ "https://Stackoverflow.com/questions/28937273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3714598/" ]
You can do ``` for output in /home/myComputer/Desktop/* do echo $output done ``` If there's any risk that `/home/myComputer/Desktop` is empty, please follow @JIDs advice in the comments below.
The next solution also works when the dir is empty. ``` ls /home/myComputer/Desktop/ 2>/dev/null |while read -r output; do echo ${output} done ``` This construction is nice to know, for when you want to split the input lines in some fields: ``` cat someFile | while read -r field1 field2 remainingfields; do ```
1,495,854
``` my $hash_ref = { one => { val => 1, name => 'one' }, three => { val => 3, name => 'three'}, two => { val => 2, name => 'two' }, }; ``` I would like to sort `$hash_ref` such that a foreach would order them by ``` $hash_ref->{$key}->{'val'} one two three ``` Any suggestions?
2009/09/30
[ "https://Stackoverflow.com/questions/1495854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
`@sorted_list` is an array of references to the sorted hash elements: ``` @sorted_list = sort { $a->{'val'} <=> $b->{'val'} } values %{$unsorted_hash_ref}; ``` You can use it like so: ``` #!/usr/bin/perl my $hash_ref = { one => { val => 1, name => 'one' }, three => { val => 3, name => 'three' }, tw...
Hash tables don't have any specific order. However, you can sort the keys in an array and use that to iterate through the hash: ``` my $hash_ref = { one => { val => 1, name => 'one'}, three => { val => 3, name => 'three'}, two => { val => 2, name => 'two'}, }; use strict; use warnings; use Lingua::EN::Wor...
1,495,854
``` my $hash_ref = { one => { val => 1, name => 'one' }, three => { val => 3, name => 'three'}, two => { val => 2, name => 'two' }, }; ``` I would like to sort `$hash_ref` such that a foreach would order them by ``` $hash_ref->{$key}->{'val'} one two three ``` Any suggestions?
2009/09/30
[ "https://Stackoverflow.com/questions/1495854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
`@sorted_list` is an array of references to the sorted hash elements: ``` @sorted_list = sort { $a->{'val'} <=> $b->{'val'} } values %{$unsorted_hash_ref}; ``` You can use it like so: ``` #!/usr/bin/perl my $hash_ref = { one => { val => 1, name => 'one' }, three => { val => 3, name => 'three' }, tw...
``` use strict; use warnings; my %hash_ref = ( one => { val => 1, name => 'one' }, three => { val => 3, name => 'three'}, two => { val => 2, name => 'two' }, ); foreach my $key(sort {$hash_ref{$a}{val} <=> $hash_ref{$b}{val}} keys %hash_ref) { my $value = $hash_ref{$key}{val}; my $name = $hash_ref{$key}{name}; ...
1,495,854
``` my $hash_ref = { one => { val => 1, name => 'one' }, three => { val => 3, name => 'three'}, two => { val => 2, name => 'two' }, }; ``` I would like to sort `$hash_ref` such that a foreach would order them by ``` $hash_ref->{$key}->{'val'} one two three ``` Any suggestions?
2009/09/30
[ "https://Stackoverflow.com/questions/1495854", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
`@sorted_list` is an array of references to the sorted hash elements: ``` @sorted_list = sort { $a->{'val'} <=> $b->{'val'} } values %{$unsorted_hash_ref}; ``` You can use it like so: ``` #!/usr/bin/perl my $hash_ref = { one => { val => 1, name => 'one' }, three => { val => 3, name => 'three' }, tw...
``` #!/usr/bin/perl my $hash_ref = ( one => {val => 1, name => "one"}, three => {val => 3, name => "three"}, two => {val => 2, name => 'two'}, ); foreach $elem( sort {$$hash_ref{$a}{val} <=> $$hash_ref{$b}{val}} keys %$hash_ref){ my $value = $h...
383,981
I have a file with many columns and some empty cells in different columns. I would like to replace the empty cells for NA only in the third column. My file: ``` 1 id1 info 2 otherinfo 3 id2 4 noinfo 5 id3 6 id4 info2 ``` So the output should be: ``` 1 id1 info 2 otherinfo 3 id2 NA 4 noinfo 5 id3...
2017/08/04
[ "https://unix.stackexchange.com/questions/383981", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/137472/" ]
Short ***awk*** solution: ``` awk -F'[[:space:]]' '$2 && !$3{ $3="NA" }1' file ``` The output: ``` 1 id1 info 2 otherinfo 3 id2 NA 4 noinfo 5 id3 NA 6 id4 info2 ```
This `sed` works for me: ``` sed -E 's/(.*id[0-9]{1,}$)/\1 NA/' ``` Example: ``` sed -E 's/(.*id[0-9]{1,}$)/\1 NA/' NA.txt 1 id1 info 2 otherinfo 3 id2 NA 4 noinfo 5 id3 NA 6 id4 info2 ``` Where `NA.txt` is this file: ``` cat NA.txt 1 id1 info 2 otherinfo 3 id2 4 noinfo 5 id3 6 id4 info2 ```
383,981
I have a file with many columns and some empty cells in different columns. I would like to replace the empty cells for NA only in the third column. My file: ``` 1 id1 info 2 otherinfo 3 id2 4 noinfo 5 id3 6 id4 info2 ``` So the output should be: ``` 1 id1 info 2 otherinfo 3 id2 NA 4 noinfo 5 id3...
2017/08/04
[ "https://unix.stackexchange.com/questions/383981", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/137472/" ]
If your file has fixed-width columns, you can parse them in GNU awk with `FIELDWIDTHS`, e.g.: ``` awk -v FIELDWIDTHS='1 1 3 1 99' -v OFS="" '!$5 { $5 = " NA" } 1' infile ``` Output: ``` 1 id1 info 2 otherinfo 3 id2 NA 4 noinfo 5 id3 NA 6 id4 info2 ```
This `sed` works for me: ``` sed -E 's/(.*id[0-9]{1,}$)/\1 NA/' ``` Example: ``` sed -E 's/(.*id[0-9]{1,}$)/\1 NA/' NA.txt 1 id1 info 2 otherinfo 3 id2 NA 4 noinfo 5 id3 NA 6 id4 info2 ``` Where `NA.txt` is this file: ``` cat NA.txt 1 id1 info 2 otherinfo 3 id2 4 noinfo 5 id3 6 id4 info2 ```
383,981
I have a file with many columns and some empty cells in different columns. I would like to replace the empty cells for NA only in the third column. My file: ``` 1 id1 info 2 otherinfo 3 id2 4 noinfo 5 id3 6 id4 info2 ``` So the output should be: ``` 1 id1 info 2 otherinfo 3 id2 NA 4 noinfo 5 id3...
2017/08/04
[ "https://unix.stackexchange.com/questions/383981", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/137472/" ]
Short ***awk*** solution: ``` awk -F'[[:space:]]' '$2 && !$3{ $3="NA" }1' file ``` The output: ``` 1 id1 info 2 otherinfo 3 id2 NA 4 noinfo 5 id3 NA 6 id4 info2 ```
If your file has fixed-width columns, you can parse them in GNU awk with `FIELDWIDTHS`, e.g.: ``` awk -v FIELDWIDTHS='1 1 3 1 99' -v OFS="" '!$5 { $5 = " NA" } 1' infile ``` Output: ``` 1 id1 info 2 otherinfo 3 id2 NA 4 noinfo 5 id3 NA 6 id4 info2 ```
5,643,103
What's the best way to use ImageMagick in MonoTouch? Adding the ImageMagickNET lib seems to produce errors during runtime, such as: > > Method > 'Module:CrtImplementationDetails.DoDllLanguageSupportValidation > ()' in assembly > '/ImageMagickNET/bin/ReleaseQ8/ImageMagickNET.dll' > contains native code that cann...
2011/04/13
[ "https://Stackoverflow.com/questions/5643103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/427221/" ]
First, why this does not work. Second, what you can do about it. Why it does not work: The library that you are using is compiled with C++/CLI compiler against the Microsoft libraries. All managed code that you use in MonoTouch must be compiled using MonoTouch's assemblies and tools, so the above wont work for two r...
that error answers your question for you : > > in assembly '/ImageMagickNET/bin/ReleaseQ8/ImageMagickNET.dll' contains native code that > cannot be executed by Mono on this > platform. > > > A quick google tells me on [the imagemagick codeplex page](http://imagemagick.codeplex.com/) that you're probably using ...
59,795,747
Ok, I'm sorry, but I just cannot figure out how to do this... There are literally hundreds of "how do I validate my form in Angular" posts on here, but none of them **quite** fit what I'm trying to do, and I just cannot figure out how to make it work. So I'm asking this here. Forgive me if it's been asked before. I'm ...
2020/01/17
[ "https://Stackoverflow.com/questions/59795747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2620218/" ]
To get this: ``` [1, 2, 4, ...,26, etc] ``` without using `df.reset_index()` (ie; leaving the `DatetimeIndex` as is), why don't you iterate on the *Range* of the *Length* of the index itself: ``` range(df.index.shape[0]) ``` and to get a list directly you may use *List Comprehension*: ``` [i for i in range(df.in...
You can get integer index from datetimeindex by ```py import numpy as np np.where(df.index.isin(df.index)) ``` Output: ```bash (array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], dtype=int64),) ```
3,458,503
I need text to fill a predefined area. I don't necessarily want the fonts to grow beyond a certain limit, but I would prefer that it at least shrinks if it doesn't fit in a certain area. (So to have an upperbound on the font size, and also a lowerbound, but take the upperbound as default and scale down when required.) ...
2010/08/11
[ "https://Stackoverflow.com/questions/3458503", "https://Stackoverflow.com", "https://Stackoverflow.com/users/136476/" ]
I eventually ended up using the [fitText](http://www.jarvana.com/jarvana/view/com/lowagie/itext/2.1.2/itext-2.1.2-javadoc.jar!/com/lowagie/text/pdf/PdfSignatureAppearance.html#fitText%28com.lowagie.text.Font,%20java.lang.String,%20com.lowagie.text.Rectangle,%20float,%20int%29) operation on PdfSignatureAppearance, inclu...
I would hand pick the font sizes you want to use to make sure they look good on the target output. No reason to stick to 3, use as many as you want. The rectangle passed into getFont() must have x an y both set to 0. ``` public class FontFactory { private Font[] fonts; public FontFactory() { fonts = new Font[...
44,197,910
List enumerators not working in case when they are put in a list. For example in case of two lists (two enumerators) ``` public void test() { var firstList = new List<int>() { 1, 2, 3 }; var secondList = new List<int>() { 4, 5, 6 }; var lists = new List<List<int>>(); lists.Add(firstList); lists.Add...
2017/05/26
[ "https://Stackoverflow.com/questions/44197910", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1765621/" ]
This is because the [`List<T>.GetEnumerator`](https://msdn.microsoft.com/en-us/library/b0yss765(v=vs.110).aspx) method returns a [`List<T>.Enumerator`](https://msdn.microsoft.com/en-us/library/x854yt9s(v=vs.110).aspx) *mutable struct*. When you assign it to a variable and call `MoveNext` and `Current`, it works. But ...
Its because you run 2 separate `.ForEach()` in the not working part. Do both actions in 1 foreach (`MoveNext()`, then print). `MoveNext` will not be remembered in a `.Foreach()` for a good explaination: [Go to this answer](https://stackoverflow.com/a/44198312/2885376) **This:** ``` iterators.ForEach(x => x.MoveNext...
44,197,910
List enumerators not working in case when they are put in a list. For example in case of two lists (two enumerators) ``` public void test() { var firstList = new List<int>() { 1, 2, 3 }; var secondList = new List<int>() { 4, 5, 6 }; var lists = new List<List<int>>(); lists.Add(firstList); lists.Add...
2017/05/26
[ "https://Stackoverflow.com/questions/44197910", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1765621/" ]
This is because the [`List<T>.GetEnumerator`](https://msdn.microsoft.com/en-us/library/b0yss765(v=vs.110).aspx) method returns a [`List<T>.Enumerator`](https://msdn.microsoft.com/en-us/library/x854yt9s(v=vs.110).aspx) *mutable struct*. When you assign it to a variable and call `MoveNext` and `Current`, it works. But ...
List's enumerator is implemented as a value type ([source code](https://referencesource.microsoft.com/#mscorlib/system/collections/generic/list.cs,cf7f4095e4de7646)): ``` iterators[0].GetType().IsValueType // true ``` That means - iterators are passed by value when you are passing them to the methods (i.e. copy of i...
7,586,764
We are multiple developers working on the same Xcode 4 iOS project. We are trying to commit to use Subversion but we keep getting conflicts with project.pbxproj when 2 developers add a new target or change the project structure. What is the proper way to go about this issue?
2011/09/28
[ "https://Stackoverflow.com/questions/7586764", "https://Stackoverflow.com", "https://Stackoverflow.com/users/969550/" ]
About a week ago I revisited this problem and came up with a solution. The solution requires me to do a lot of manual width setting for the columns in this grid, and I consider that to be extremely sub-par in this day and age. Unfortunately, I have also continued to look for a more well-rounded solution native to the A...
Off the top of my head, this is how I would approach this: 1) Create an interface with one method that your Activity would implement to receive scroll coordinates and that your ScrollView can call back to when a scroll occurs: ``` public interface ScrollCallback { public void scrollChanged(int newXPos, int newYPo...
7,586,764
We are multiple developers working on the same Xcode 4 iOS project. We are trying to commit to use Subversion but we keep getting conflicts with project.pbxproj when 2 developers add a new target or change the project structure. What is the proper way to go about this issue?
2011/09/28
[ "https://Stackoverflow.com/questions/7586764", "https://Stackoverflow.com", "https://Stackoverflow.com/users/969550/" ]
[TableFixHeaders](https://github.com/InQBarna/TableFixHeaders) library might be useful for you in this case.
Off the top of my head, this is how I would approach this: 1) Create an interface with one method that your Activity would implement to receive scroll coordinates and that your ScrollView can call back to when a scroll occurs: ``` public interface ScrollCallback { public void scrollChanged(int newXPos, int newYPo...
7,586,764
We are multiple developers working on the same Xcode 4 iOS project. We are trying to commit to use Subversion but we keep getting conflicts with project.pbxproj when 2 developers add a new target or change the project structure. What is the proper way to go about this issue?
2011/09/28
[ "https://Stackoverflow.com/questions/7586764", "https://Stackoverflow.com", "https://Stackoverflow.com/users/969550/" ]
About a week ago I revisited this problem and came up with a solution. The solution requires me to do a lot of manual width setting for the columns in this grid, and I consider that to be extremely sub-par in this day and age. Unfortunately, I have also continued to look for a more well-rounded solution native to the A...
[TableFixHeaders](https://github.com/InQBarna/TableFixHeaders) library might be useful for you in this case.
25,319,322
I have a very unique problem which occurs only when font sizes dip below a certain level. Here is the code that I am working with which gives an example of what I'm trying to achieve: ``` <!DOCTYPE html> <html> <head> <style> div { width: 18px; height: 18px; ...
2014/08/14
[ "https://Stackoverflow.com/questions/25319322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2543167/" ]
I came up the following that works: <http://jsfiddle.net/gfbxrgum/> 1. Wrap the rows in an element that will break. I just created a block level span that will clear both. 2. Float the divs and set clear to none. CSS ``` div { width: 12px; /* change made here */ height: 12px; /* change made here */ back...
Nothing wrong with your Style. You have a 'br' tag in between your Divs. Remove it and it'll work like a charm. :-D If you still need to have a line break please refer to [this](https://stackoverflow.com/questions/13546227/is-there-a-way-to-have-a-line-break-between-divs) thread in SO
27,642,037
Haven't been able to solve this since my last go, but I restructured the code after this <https://developers.facebook.com/blog/post/576/> I can't trigger the re-request for accepting all the permissions (ignore the alert text content as that will change to tell the user about why the permission are needed) Here's th...
2014/12/24
[ "https://Stackoverflow.com/questions/27642037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2827338/" ]
Seems like there are some bugs in your code. I highly recommend you to format and style your code properly. I have fixed the bugs and you may refer to the revised code below. Note that this is using facebook jssdk v2.2. ``` window.fbAsyncInit = function() { FB.init({ appId : '960839450617376', xfbml ...
@Jeff Caspian This is the exact right way to get user email address, thanks a lot I was nearly struck for 2 days. Actually lot of them are reporting as bug to Facebook team that they are not able to get email address in fact me too. ``` FB.api("/me/permissions", function(response) { } ``` This is the call which sa...
12,540
I recently read an article entitled [how NAT works](http://computer.howstuffworks.com/nat.htm "How NAT works"). Some things still remain unclear to me. I would be thankful if someone could explain. Below is the part of the article regarding DynamicNAT that is most confusing: > > A computer on the stub domain attempt...
2014/10/17
[ "https://networkengineering.stackexchange.com/questions/12540", "https://networkengineering.stackexchange.com", "https://networkengineering.stackexchange.com/users/9952/" ]
There is a general misconception between [NAT](http://en.wikipedia.org/wiki/Network_address_translation) (Network address translation) and PAT (Port Address Translation), which is what we mostly use in our home routers. **NAT** Let's assume we have a network with the following topology: *Private\_Network* <-----...
The router knows where packets belong because `The router saves ... an address translation table.` It remembers what inside-outside address translations it has made. As such, one inside address equals one outside address, and the out-on-the-internet destination is irrelevant. This, of course, ignores the firewall prese...
74,215
I was cleaning my chainring, chain and cassette with vinegar, to remove unwanted grease but suddenly after a few minutes it suddenly turned slightly orange. It spread all over my rear gears. I got worried so I put light oil; it worked but still has some light rust on it. What should I do?
2020/12/29
[ "https://bicycles.stackexchange.com/questions/74215", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/54430/" ]
Hey I would not worry too much about it at this point. Chains, cassettes, and chain rings are wear and tear components so let the rest of the rust come off with wear/tear and proper cleaning in the future. If it really bugs you, you can use some steel wool, but I would not. In the future it is much better to use a pro...
The rust is only cosmetic surface rust. I would ignore it. In future, don not use vinegar as it is quite acidic. A proper degreaser will clean the chain and running gear without causing rust. Oiling the chain is essential after cleaning, mainly to provide lubrication, but also the oil prevents rust. It is best to use...
74,215
I was cleaning my chainring, chain and cassette with vinegar, to remove unwanted grease but suddenly after a few minutes it suddenly turned slightly orange. It spread all over my rear gears. I got worried so I put light oil; it worked but still has some light rust on it. What should I do?
2020/12/29
[ "https://bicycles.stackexchange.com/questions/74215", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/54430/" ]
The rust is only cosmetic surface rust. I would ignore it. In future, don not use vinegar as it is quite acidic. A proper degreaser will clean the chain and running gear without causing rust. Oiling the chain is essential after cleaning, mainly to provide lubrication, but also the oil prevents rust. It is best to use...
Just oil the chain & cassette , it has rusted the surface.If you really want to, you can just degrease the cassette and chain rings and sand/paint them again with some paint for a surface protectant/cosmetic finish.Any exposure to moisture/caustic agent/acid on bare metal will cause rust.
74,215
I was cleaning my chainring, chain and cassette with vinegar, to remove unwanted grease but suddenly after a few minutes it suddenly turned slightly orange. It spread all over my rear gears. I got worried so I put light oil; it worked but still has some light rust on it. What should I do?
2020/12/29
[ "https://bicycles.stackexchange.com/questions/74215", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/54430/" ]
The rust is only cosmetic surface rust. I would ignore it. In future, don not use vinegar as it is quite acidic. A proper degreaser will clean the chain and running gear without causing rust. Oiling the chain is essential after cleaning, mainly to provide lubrication, but also the oil prevents rust. It is best to use...
You don’t want rust on your drivetrain. And rust, in my experience, has an “infective” property, whereby it can seed more rust if moved from one area to another. If it were my bike, I’d buy some phosphoric acid rust remover (or similar) and clean the drivetrain (take the chain and cogs off) with it to remove all traces...
74,215
I was cleaning my chainring, chain and cassette with vinegar, to remove unwanted grease but suddenly after a few minutes it suddenly turned slightly orange. It spread all over my rear gears. I got worried so I put light oil; it worked but still has some light rust on it. What should I do?
2020/12/29
[ "https://bicycles.stackexchange.com/questions/74215", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/54430/" ]
Hey I would not worry too much about it at this point. Chains, cassettes, and chain rings are wear and tear components so let the rest of the rust come off with wear/tear and proper cleaning in the future. If it really bugs you, you can use some steel wool, but I would not. In the future it is much better to use a pro...
Just oil the chain & cassette , it has rusted the surface.If you really want to, you can just degrease the cassette and chain rings and sand/paint them again with some paint for a surface protectant/cosmetic finish.Any exposure to moisture/caustic agent/acid on bare metal will cause rust.
74,215
I was cleaning my chainring, chain and cassette with vinegar, to remove unwanted grease but suddenly after a few minutes it suddenly turned slightly orange. It spread all over my rear gears. I got worried so I put light oil; it worked but still has some light rust on it. What should I do?
2020/12/29
[ "https://bicycles.stackexchange.com/questions/74215", "https://bicycles.stackexchange.com", "https://bicycles.stackexchange.com/users/54430/" ]
Hey I would not worry too much about it at this point. Chains, cassettes, and chain rings are wear and tear components so let the rest of the rust come off with wear/tear and proper cleaning in the future. If it really bugs you, you can use some steel wool, but I would not. In the future it is much better to use a pro...
You don’t want rust on your drivetrain. And rust, in my experience, has an “infective” property, whereby it can seed more rust if moved from one area to another. If it were my bike, I’d buy some phosphoric acid rust remover (or similar) and clean the drivetrain (take the chain and cogs off) with it to remove all traces...
72,665,680
So I have a problem that `strcmp` not working even the string is same. The cmp between destination and source string is have same string, but when `strcmp` it, it not working. See the code for explanation: ``` # include <stdio.h> # include <string.h> int main() { FILE *fp; fp = fopen("test.txt", "r"); cha...
2022/06/17
[ "https://Stackoverflow.com/questions/72665680", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19326012/" ]
If you change your `printf` statement to this, the problem will likely become clear to you: ``` printf("\ntdeeprint : '%s'\n",tdeeprint); ``` Output snippet: ``` tdeeprint : 'Jarang Berolahraga ' ``` The same applies to `namalengkap` and `gender`. The `%52[^\n]` pattern includes ...
Regarding the last question, `fscanf(fp, "= TDEE : %52.3f =\n", &datusr.tdeenum)` fails after consuming the input up to `= TDEE :` because `%52.3f` is not a valid conversion specifier: there is no *precision* field in `scanf` conversions. You should just use `%52f` or simply `%f`. Note that your parser is very brittl...
53,464,314
[I asked the following question on the CS SE](https://cs.stackexchange.com/q/100175/26856): > > For example, in the proof of lemma 6.4.1 in the HoTT book, a function > inductively defined over a function is simply applied on paths `loop` > and `refl`, and then a path between `loop` and `refl` is used > (presumably...
2018/11/25
[ "https://Stackoverflow.com/questions/53464314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/477476/" ]
> > Is this the correct way to import the jars? > > > *Yes*, include the log4j in the `dependency` section of the child `pom.xml`. ``` <dependencies> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> <!-- version is optional when using depe...
If you add below part to child pom.xml file, you don't need to import lof4j dependency separately though child pom.xml. ``` <parent> <artifactId>testing.parent</artifactId> <groupId>testing.group</groupId> <version>1.0</version> </parent> ```
63,207,013
I am a beginner of pytorch ,when i read the source code of a project about mask rcnn .I don't konw from where can i get some information about some methods that i don't understand .The official documentation doesn't seem very detailed? ``` # load an instance segmentation model pre-trained pre-trained on COCO model = t...
2020/08/01
[ "https://Stackoverflow.com/questions/63207013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14013952/" ]
For this sort of thing, I find it helps to *draw* the commits. Of course, since you can't find the exact commit, you'll be stuck with drawing some approximation—but maybe that will help you find the right commits. > > I have a `master` branch and a `topic` branch which diverged from `master` at some "last common ance...
I suggest you re-base topic on top of the new master using the `--onto` flag. You'll have to specify the point `topic` diverged from master. Find the "last common ancestor", I'll call it `abcd`. Now do this: `git rebase --onto master abcd` EDIT: Just realized you said you can't find that commit. That's very weird. Tr...
63,207,013
I am a beginner of pytorch ,when i read the source code of a project about mask rcnn .I don't konw from where can i get some information about some methods that i don't understand .The official documentation doesn't seem very detailed? ``` # load an instance segmentation model pre-trained pre-trained on COCO model = t...
2020/08/01
[ "https://Stackoverflow.com/questions/63207013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14013952/" ]
I suggest you re-base topic on top of the new master using the `--onto` flag. You'll have to specify the point `topic` diverged from master. Find the "last common ancestor", I'll call it `abcd`. Now do this: `git rebase --onto master abcd` EDIT: Just realized you said you can't find that commit. That's very weird. Tr...
I am sure torek's response will have all the gory details... here's my short answer: find both the new and the old Id of that revision that was the common ancestor. ``` git rebase --onto new-id old-id topic ``` That is to get the branch at the position where it *was*.... but could also run ``` git rebase --onto mas...
63,207,013
I am a beginner of pytorch ,when i read the source code of a project about mask rcnn .I don't konw from where can i get some information about some methods that i don't understand .The official documentation doesn't seem very detailed? ``` # load an instance segmentation model pre-trained pre-trained on COCO model = t...
2020/08/01
[ "https://Stackoverflow.com/questions/63207013", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14013952/" ]
For this sort of thing, I find it helps to *draw* the commits. Of course, since you can't find the exact commit, you'll be stuck with drawing some approximation—but maybe that will help you find the right commits. > > I have a `master` branch and a `topic` branch which diverged from `master` at some "last common ance...
I am sure torek's response will have all the gory details... here's my short answer: find both the new and the old Id of that revision that was the common ancestor. ``` git rebase --onto new-id old-id topic ``` That is to get the branch at the position where it *was*.... but could also run ``` git rebase --onto mas...
10,772,177
On iOS, if a view has several layers, then can the `drawRect` method just choose any one layer to display, and 1 second later, choose another layer to display, to achieve an animation effect? Right now, I have several layers, but I don't think they are the view's layers (they are just individual layers which are not s...
2012/05/27
[ "https://Stackoverflow.com/questions/10772177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/325419/" ]
If you know that the checkboxes are all on a form: ``` var list = new List<CheckBox>(); foreach(var control in this.Controls) { var checkBox = control as CheckBox; if(checkBox != null) { list.Add(checkBox); } } var checkBoxArray = list.ToArray(); ``` If you don't know where the controls are ...
You can't do new and then ``` checkboxarray = new CheckBox[] { txtChckBx0, ....} ``` it's two different ways to define an array. you need to do: ``` CheckBox[] checkboxarray = { txtChckBx0, ....}; ``` If you want it to work. Good luck.
10,772,177
On iOS, if a view has several layers, then can the `drawRect` method just choose any one layer to display, and 1 second later, choose another layer to display, to achieve an animation effect? Right now, I have several layers, but I don't think they are the view's layers (they are just individual layers which are not s...
2012/05/27
[ "https://Stackoverflow.com/questions/10772177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/325419/" ]
If you know that the checkboxes are all on a form: ``` var list = new List<CheckBox>(); foreach(var control in this.Controls) { var checkBox = control as CheckBox; if(checkBox != null) { list.Add(checkBox); } } var checkBoxArray = list.ToArray(); ``` If you don't know where the controls are ...
In WinForm ``` List<CheckBox> checkBox = new List<CheckBox>(); // Adding checkboxes for testing... for (int i = 0; i <= 80; i++) { var cbox = new CheckBox(); cbox.Name = "txtChckBx"+ i.ToString(); checkBox.Add(cbox); Controls.Add(cbox); } List<CheckBox> checkBoxfound = new List<CheckBox>(); // loop t...
68,740
How I should check if a program is a virus in VMware? Some programs I do need admin ability to install and it makes sense. But how do I know if it's doing more than I want? Some thoughts are: * How many processes open when I launch the application * What is added to the startup tab in msconfig * If any services are ad...
2009/11/10
[ "https://superuser.com/questions/68740", "https://superuser.com", "https://superuser.com/users/-1/" ]
Wireshark to monitor traffic, Process Explorer to monitor file and registry changes. Keep a "known good" snapshot to boot into every time to reduce possible contamination. Don't give it an internet connection if you don't have to.
Along the lines of your analysis (though, it's always safer to check where you downloaded it from and use local antivirus software), 1. Check for what network communications it attempts. It's always fairly easy to enumerate what network activity is likely from the program description. You can use the Sysinterna...
68,740
How I should check if a program is a virus in VMware? Some programs I do need admin ability to install and it makes sense. But how do I know if it's doing more than I want? Some thoughts are: * How many processes open when I launch the application * What is added to the startup tab in msconfig * If any services are ad...
2009/11/10
[ "https://superuser.com/questions/68740", "https://superuser.com", "https://superuser.com/users/-1/" ]
Run an outgoing firewall that prompts for new connections. If the software attempts to make many outbound connections then it might be up to no good. A lot of software will check for updates either on initial start up or periodically, so you'll have to let the first one through. Don't check the "remember my answer for...
Along the lines of your analysis (though, it's always safer to check where you downloaded it from and use local antivirus software), 1. Check for what network communications it attempts. It's always fairly easy to enumerate what network activity is likely from the program description. You can use the Sysinterna...
68,740
How I should check if a program is a virus in VMware? Some programs I do need admin ability to install and it makes sense. But how do I know if it's doing more than I want? Some thoughts are: * How many processes open when I launch the application * What is added to the startup tab in msconfig * If any services are ad...
2009/11/10
[ "https://superuser.com/questions/68740", "https://superuser.com", "https://superuser.com/users/-1/" ]
Run an outgoing firewall that prompts for new connections. If the software attempts to make many outbound connections then it might be up to no good. A lot of software will check for updates either on initial start up or periodically, so you'll have to let the first one through. Don't check the "remember my answer for...
Wireshark to monitor traffic, Process Explorer to monitor file and registry changes. Keep a "known good" snapshot to boot into every time to reduce possible contamination. Don't give it an internet connection if you don't have to.
42,826,388
I have time from epochs timestamps I use `data.Time_req = pd.to_datetime(data.Time_req)` But I get UTC time, I need +5:30 from the given time. How do I tell pandas to use `'IST'` timezone or just `5hrs 30 mins` further to the time it currently shows me. eg. `7 hrs` should become `12:30 hrs` and so on.
2017/03/16
[ "https://Stackoverflow.com/questions/42826388", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1977867/" ]
You can use [`tz_localize`](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.tz_localize.html) to set the timezone to `UTC`/+0000, and then [`tz_convert`](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.tz_convert.html) to add the timezone you want: ``` start = pd.to_datetime('20...
### From unix epoch timestamps ``` timestamps = [1656285319, 1656285336, 1656285424] pd.to_datetime(timestamps, unit='s', utc=True).map(lambda x: x.tz_convert('Asia/Kolkata')) ``` outputs: ``` DatetimeIndex(['2022-06-27 04:45:19+05:30', '2022-06-27 04:45:36+05:30', '2022-06-27 04:47:04+05:30'], ...
42,826,388
I have time from epochs timestamps I use `data.Time_req = pd.to_datetime(data.Time_req)` But I get UTC time, I need +5:30 from the given time. How do I tell pandas to use `'IST'` timezone or just `5hrs 30 mins` further to the time it currently shows me. eg. `7 hrs` should become `12:30 hrs` and so on.
2017/03/16
[ "https://Stackoverflow.com/questions/42826388", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1977867/" ]
You can use [`tz_localize`](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.tz_localize.html) to set the timezone to `UTC`/+0000, and then [`tz_convert`](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.tz_convert.html) to add the timezone you want: ``` start = pd.to_datetime('20...
The following worked for me: ``` df['Local_Time'] = pd.to_datetime(df,unit='s', utc=True)\ .map(lambda x: x.tz_convert('America/Chicago')) ``` [This is the list of the name of timezones in pytz.](https://gist.github.com/heyalexej/8bf688fd67d7199be4a1682b3eec7568) Hope this helps someone!
42,826,388
I have time from epochs timestamps I use `data.Time_req = pd.to_datetime(data.Time_req)` But I get UTC time, I need +5:30 from the given time. How do I tell pandas to use `'IST'` timezone or just `5hrs 30 mins` further to the time it currently shows me. eg. `7 hrs` should become `12:30 hrs` and so on.
2017/03/16
[ "https://Stackoverflow.com/questions/42826388", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1977867/" ]
### From unix epoch timestamps ``` timestamps = [1656285319, 1656285336, 1656285424] pd.to_datetime(timestamps, unit='s', utc=True).map(lambda x: x.tz_convert('Asia/Kolkata')) ``` outputs: ``` DatetimeIndex(['2022-06-27 04:45:19+05:30', '2022-06-27 04:45:36+05:30', '2022-06-27 04:47:04+05:30'], ...
The following worked for me: ``` df['Local_Time'] = pd.to_datetime(df,unit='s', utc=True)\ .map(lambda x: x.tz_convert('America/Chicago')) ``` [This is the list of the name of timezones in pytz.](https://gist.github.com/heyalexej/8bf688fd67d7199be4a1682b3eec7568) Hope this helps someone!
1,329,260
Can you compare two large exponential numbers, like $5^{44}$ and $4^{53}$ without taking their logs?
2015/06/17
[ "https://math.stackexchange.com/questions/1329260", "https://math.stackexchange.com", "https://math.stackexchange.com/users/223077/" ]
One approach is to figure that, roughly, $2^{10} \approx 10^3$, and $5^9 \approx 2,000,000 = 2 \cdot 10^6$. Then, \begin{align} 4^{53} &= (2^2)^{53} \\ &= 2^{106} \\ &= 2^{100} \cdot 2^6 \\ &= (2^{10})^{10} \cdot 2^6 \\ &\approx (10^3)^{10} \cdot 2^6 \\ &= 10^{30} \cdot 2^6 \end{align} By way of comparison, \begi...
I'll interpret the actual question as "without using a calculator?" since I assume that's your objection to using logs. What I know about $5$ and $4$ is that $5^3 = 125$ is pretty close to but a bit smaller than $2^7 = 128$. That tells me that $\log\_2 5 \le\frac{7}{3}$, hence that $$\log\_2 5^{44} \le \frac{308}{3}...
1,329,260
Can you compare two large exponential numbers, like $5^{44}$ and $4^{53}$ without taking their logs?
2015/06/17
[ "https://math.stackexchange.com/questions/1329260", "https://math.stackexchange.com", "https://math.stackexchange.com/users/223077/" ]
$$5^{44}<5^{45}=(5^3)^{15}=125^{15}<128^{15}=(256/2)^{15}=4^{60}/2^{15}<4^{53}$$ (because $2^{15}>2^{14}=4^{7}$)
One approach is to figure that, roughly, $2^{10} \approx 10^3$, and $5^9 \approx 2,000,000 = 2 \cdot 10^6$. Then, \begin{align} 4^{53} &= (2^2)^{53} \\ &= 2^{106} \\ &= 2^{100} \cdot 2^6 \\ &= (2^{10})^{10} \cdot 2^6 \\ &\approx (10^3)^{10} \cdot 2^6 \\ &= 10^{30} \cdot 2^6 \end{align} By way of comparison, \begi...
1,329,260
Can you compare two large exponential numbers, like $5^{44}$ and $4^{53}$ without taking their logs?
2015/06/17
[ "https://math.stackexchange.com/questions/1329260", "https://math.stackexchange.com", "https://math.stackexchange.com/users/223077/" ]
One approach is to figure that, roughly, $2^{10} \approx 10^3$, and $5^9 \approx 2,000,000 = 2 \cdot 10^6$. Then, \begin{align} 4^{53} &= (2^2)^{53} \\ &= 2^{106} \\ &= 2^{100} \cdot 2^6 \\ &= (2^{10})^{10} \cdot 2^6 \\ &\approx (10^3)^{10} \cdot 2^6 \\ &= 10^{30} \cdot 2^6 \end{align} By way of comparison, \begi...
[Binomial expansion](https://en.wikipedia.org/wiki/Binomial_theorem) can help. $$ (x+y) = \sum\_{k=0}^n\frac{n!}{k!(n-k)!}x^{n-k}y^k $$ In this case, x = 4, y = 1, which simplifies For massive expansion like you have, you really only need to look at the first few terms (although with a low x and a big exponent, extr...
1,329,260
Can you compare two large exponential numbers, like $5^{44}$ and $4^{53}$ without taking their logs?
2015/06/17
[ "https://math.stackexchange.com/questions/1329260", "https://math.stackexchange.com", "https://math.stackexchange.com/users/223077/" ]
Using a GCD-like approach, start by dividing out the "smaller" term: $${5^{44}\over 4^{44}}=\left(\frac54\right)^{44}\\ {4^{53}\over 4^{44}}=4^9$$ Now the new "smaller" term is $\frac54$: $${\left(\frac54\right)^{44}\over \left(\frac54\right)^{18}}=\left(\frac54\right)^{26}\\ {4^9\over \left(\frac54\right)^{18}}=\le...
One approach is to figure that, roughly, $2^{10} \approx 10^3$, and $5^9 \approx 2,000,000 = 2 \cdot 10^6$. Then, \begin{align} 4^{53} &= (2^2)^{53} \\ &= 2^{106} \\ &= 2^{100} \cdot 2^6 \\ &= (2^{10})^{10} \cdot 2^6 \\ &\approx (10^3)^{10} \cdot 2^6 \\ &= 10^{30} \cdot 2^6 \end{align} By way of comparison, \begi...
1,329,260
Can you compare two large exponential numbers, like $5^{44}$ and $4^{53}$ without taking their logs?
2015/06/17
[ "https://math.stackexchange.com/questions/1329260", "https://math.stackexchange.com", "https://math.stackexchange.com/users/223077/" ]
$$5^{44}<5^{45}=(5^3)^{15}=125^{15}<128^{15}=(256/2)^{15}=4^{60}/2^{15}<4^{53}$$ (because $2^{15}>2^{14}=4^{7}$)
I'll interpret the actual question as "without using a calculator?" since I assume that's your objection to using logs. What I know about $5$ and $4$ is that $5^3 = 125$ is pretty close to but a bit smaller than $2^7 = 128$. That tells me that $\log\_2 5 \le\frac{7}{3}$, hence that $$\log\_2 5^{44} \le \frac{308}{3}...
1,329,260
Can you compare two large exponential numbers, like $5^{44}$ and $4^{53}$ without taking their logs?
2015/06/17
[ "https://math.stackexchange.com/questions/1329260", "https://math.stackexchange.com", "https://math.stackexchange.com/users/223077/" ]
Using a GCD-like approach, start by dividing out the "smaller" term: $${5^{44}\over 4^{44}}=\left(\frac54\right)^{44}\\ {4^{53}\over 4^{44}}=4^9$$ Now the new "smaller" term is $\frac54$: $${\left(\frac54\right)^{44}\over \left(\frac54\right)^{18}}=\left(\frac54\right)^{26}\\ {4^9\over \left(\frac54\right)^{18}}=\le...
I'll interpret the actual question as "without using a calculator?" since I assume that's your objection to using logs. What I know about $5$ and $4$ is that $5^3 = 125$ is pretty close to but a bit smaller than $2^7 = 128$. That tells me that $\log\_2 5 \le\frac{7}{3}$, hence that $$\log\_2 5^{44} \le \frac{308}{3}...
1,329,260
Can you compare two large exponential numbers, like $5^{44}$ and $4^{53}$ without taking their logs?
2015/06/17
[ "https://math.stackexchange.com/questions/1329260", "https://math.stackexchange.com", "https://math.stackexchange.com/users/223077/" ]
$$5^{44}<5^{45}=(5^3)^{15}=125^{15}<128^{15}=(256/2)^{15}=4^{60}/2^{15}<4^{53}$$ (because $2^{15}>2^{14}=4^{7}$)
[Binomial expansion](https://en.wikipedia.org/wiki/Binomial_theorem) can help. $$ (x+y) = \sum\_{k=0}^n\frac{n!}{k!(n-k)!}x^{n-k}y^k $$ In this case, x = 4, y = 1, which simplifies For massive expansion like you have, you really only need to look at the first few terms (although with a low x and a big exponent, extr...
1,329,260
Can you compare two large exponential numbers, like $5^{44}$ and $4^{53}$ without taking their logs?
2015/06/17
[ "https://math.stackexchange.com/questions/1329260", "https://math.stackexchange.com", "https://math.stackexchange.com/users/223077/" ]
Using a GCD-like approach, start by dividing out the "smaller" term: $${5^{44}\over 4^{44}}=\left(\frac54\right)^{44}\\ {4^{53}\over 4^{44}}=4^9$$ Now the new "smaller" term is $\frac54$: $${\left(\frac54\right)^{44}\over \left(\frac54\right)^{18}}=\left(\frac54\right)^{26}\\ {4^9\over \left(\frac54\right)^{18}}=\le...
[Binomial expansion](https://en.wikipedia.org/wiki/Binomial_theorem) can help. $$ (x+y) = \sum\_{k=0}^n\frac{n!}{k!(n-k)!}x^{n-k}y^k $$ In this case, x = 4, y = 1, which simplifies For massive expansion like you have, you really only need to look at the first few terms (although with a low x and a big exponent, extr...
70,625,715
Is there a module in python to get integers from string in given range (with limit/restriction) ? It can be useful to make code cleaner. ``` def get_int_from_str(string: str, low_boundary: int = 0, high_boundary: int = 100) -> int | bool: # (or False directly) try: number = int("".join(filter(str.isdigit,...
2022/01/07
[ "https://Stackoverflow.com/questions/70625715", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14190526/" ]
Don't fight exceptions. If you can't parse a string as an integer, let the `ValueError` be raised. If the number is out of range, raise a different `ValueError`. Otherwise, return a value that is *guaranteed* to be in the requested range. ``` def get_int_from_str(string: str, low_boundary: int = 0, high_boundary: int ...
``` def get_int_from_str(string: str, low_boundary: int = 0, high_boundary: int = 100) -> int | False: number = "".join(filter(str.isdigit, string)) if number: number = int(number) if low_boundary < number < high_boundary: return number return False ``` Note: Using not operator...
15,623,951
Yes, I have read the EXCELLENT explanations that there are at Stackoverflow about the NPE, and I have understood what they meant. Yet, I found (I think I found) an issue about this NPE in one of the sample exercises on that textbook, that in fact, I used at Harvard long long time ago. It is about the reference variabl...
2013/03/25
[ "https://Stackoverflow.com/questions/15623951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1961282/" ]
Following code works for me. Setting autofocus (preview class): ``` Parameters params = camera.getParameters(); params.setFocusMode(Parameters.FOCUS_MODE_AUTO); //some more settings camera.setParameters(params); ``` Call camera for shot a picture in case that autofocus is ready (activity class): ``` public void bu...
you can try code: ``` ShutterCallback _pfnShutterCallback = new ShutterCallback() { @Override public void onShutter() { // TODO Auto-generated method stub } }; PictureCallback _pfnRawPictureCallback = new PictureCallback() { @Override public void onPictu...
15,623,951
Yes, I have read the EXCELLENT explanations that there are at Stackoverflow about the NPE, and I have understood what they meant. Yet, I found (I think I found) an issue about this NPE in one of the sample exercises on that textbook, that in fact, I used at Harvard long long time ago. It is about the reference variabl...
2013/03/25
[ "https://Stackoverflow.com/questions/15623951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1961282/" ]
For me this worked a treat: ``` //set camera to continually auto-focus Camera.Parameters params = c.getParameters(); //*EDIT*//params.setFocusMode("continuous-picture"); //It is better to use defined constraints as opposed to String, thanks to AbdelHady params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTU...
Looks like you should [continuous autofocus](http://developer.android.com/reference/android/hardware/Camera.Parameters.html#FOCUS_MODE_CONTINUOUS_VIDEO) as is discussed here. There is a [question here](https://stackoverflow.com/questions/5878042/android-camera-autofocus-on-demand) that you can reference.
15,623,951
Yes, I have read the EXCELLENT explanations that there are at Stackoverflow about the NPE, and I have understood what they meant. Yet, I found (I think I found) an issue about this NPE in one of the sample exercises on that textbook, that in fact, I used at Harvard long long time ago. It is about the reference variabl...
2013/03/25
[ "https://Stackoverflow.com/questions/15623951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1961282/" ]
Looks like you should [continuous autofocus](http://developer.android.com/reference/android/hardware/Camera.Parameters.html#FOCUS_MODE_CONTINUOUS_VIDEO) as is discussed here. There is a [question here](https://stackoverflow.com/questions/5878042/android-camera-autofocus-on-demand) that you can reference.
you can try code: ``` ShutterCallback _pfnShutterCallback = new ShutterCallback() { @Override public void onShutter() { // TODO Auto-generated method stub } }; PictureCallback _pfnRawPictureCallback = new PictureCallback() { @Override public void onPictu...
15,623,951
Yes, I have read the EXCELLENT explanations that there are at Stackoverflow about the NPE, and I have understood what they meant. Yet, I found (I think I found) an issue about this NPE in one of the sample exercises on that textbook, that in fact, I used at Harvard long long time ago. It is about the reference variabl...
2013/03/25
[ "https://Stackoverflow.com/questions/15623951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1961282/" ]
Try to use `Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO` or `Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE`. See below: ``` Camera.Parameters params = camera.getParameters(); if (params.getSupportedFocusModes().contains( Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) { params.setFocusMode(Camera.Parameters....
you can try code: ``` ShutterCallback _pfnShutterCallback = new ShutterCallback() { @Override public void onShutter() { // TODO Auto-generated method stub } }; PictureCallback _pfnRawPictureCallback = new PictureCallback() { @Override public void onPictu...
15,623,951
Yes, I have read the EXCELLENT explanations that there are at Stackoverflow about the NPE, and I have understood what they meant. Yet, I found (I think I found) an issue about this NPE in one of the sample exercises on that textbook, that in fact, I used at Harvard long long time ago. It is about the reference variabl...
2013/03/25
[ "https://Stackoverflow.com/questions/15623951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1961282/" ]
This works perfectly for preview callback: ``` Camera.Parameters parameters = camera.getParameters(); if (parameters.getSupportedFocusModes().contains( Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) { parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO); } camera.setParameters(parameters...
you can try code: ``` ShutterCallback _pfnShutterCallback = new ShutterCallback() { @Override public void onShutter() { // TODO Auto-generated method stub } }; PictureCallback _pfnRawPictureCallback = new PictureCallback() { @Override public void onPictu...
15,623,951
Yes, I have read the EXCELLENT explanations that there are at Stackoverflow about the NPE, and I have understood what they meant. Yet, I found (I think I found) an issue about this NPE in one of the sample exercises on that textbook, that in fact, I used at Harvard long long time ago. It is about the reference variabl...
2013/03/25
[ "https://Stackoverflow.com/questions/15623951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1961282/" ]
Following code works for me. Setting autofocus (preview class): ``` Parameters params = camera.getParameters(); params.setFocusMode(Parameters.FOCUS_MODE_AUTO); //some more settings camera.setParameters(params); ``` Call camera for shot a picture in case that autofocus is ready (activity class): ``` public void bu...
This works perfectly for preview callback: ``` Camera.Parameters parameters = camera.getParameters(); if (parameters.getSupportedFocusModes().contains( Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) { parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO); } camera.setParameters(parameters...
15,623,951
Yes, I have read the EXCELLENT explanations that there are at Stackoverflow about the NPE, and I have understood what they meant. Yet, I found (I think I found) an issue about this NPE in one of the sample exercises on that textbook, that in fact, I used at Harvard long long time ago. It is about the reference variabl...
2013/03/25
[ "https://Stackoverflow.com/questions/15623951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1961282/" ]
Try to use `Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO` or `Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE`. See below: ``` Camera.Parameters params = camera.getParameters(); if (params.getSupportedFocusModes().contains( Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) { params.setFocusMode(Camera.Parameters....
This works perfectly for preview callback: ``` Camera.Parameters parameters = camera.getParameters(); if (parameters.getSupportedFocusModes().contains( Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) { parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO); } camera.setParameters(parameters...
15,623,951
Yes, I have read the EXCELLENT explanations that there are at Stackoverflow about the NPE, and I have understood what they meant. Yet, I found (I think I found) an issue about this NPE in one of the sample exercises on that textbook, that in fact, I used at Harvard long long time ago. It is about the reference variabl...
2013/03/25
[ "https://Stackoverflow.com/questions/15623951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1961282/" ]
Looks like you should [continuous autofocus](http://developer.android.com/reference/android/hardware/Camera.Parameters.html#FOCUS_MODE_CONTINUOUS_VIDEO) as is discussed here. There is a [question here](https://stackoverflow.com/questions/5878042/android-camera-autofocus-on-demand) that you can reference.
This works perfectly for preview callback: ``` Camera.Parameters parameters = camera.getParameters(); if (parameters.getSupportedFocusModes().contains( Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) { parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO); } camera.setParameters(parameters...
15,623,951
Yes, I have read the EXCELLENT explanations that there are at Stackoverflow about the NPE, and I have understood what they meant. Yet, I found (I think I found) an issue about this NPE in one of the sample exercises on that textbook, that in fact, I used at Harvard long long time ago. It is about the reference variabl...
2013/03/25
[ "https://Stackoverflow.com/questions/15623951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1961282/" ]
For me this worked a treat: ``` //set camera to continually auto-focus Camera.Parameters params = c.getParameters(); //*EDIT*//params.setFocusMode("continuous-picture"); //It is better to use defined constraints as opposed to String, thanks to AbdelHady params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTU...
Try to use `Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO` or `Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE`. See below: ``` Camera.Parameters params = camera.getParameters(); if (params.getSupportedFocusModes().contains( Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) { params.setFocusMode(Camera.Parameters....
15,623,951
Yes, I have read the EXCELLENT explanations that there are at Stackoverflow about the NPE, and I have understood what they meant. Yet, I found (I think I found) an issue about this NPE in one of the sample exercises on that textbook, that in fact, I used at Harvard long long time ago. It is about the reference variabl...
2013/03/25
[ "https://Stackoverflow.com/questions/15623951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1961282/" ]
Following code works for me. Setting autofocus (preview class): ``` Parameters params = camera.getParameters(); params.setFocusMode(Parameters.FOCUS_MODE_AUTO); //some more settings camera.setParameters(params); ``` Call camera for shot a picture in case that autofocus is ready (activity class): ``` public void bu...
Looks like you should [continuous autofocus](http://developer.android.com/reference/android/hardware/Camera.Parameters.html#FOCUS_MODE_CONTINUOUS_VIDEO) as is discussed here. There is a [question here](https://stackoverflow.com/questions/5878042/android-camera-autofocus-on-demand) that you can reference.
17,632,914
Hi I'm having trouble understanding why this isn't working ``` if(Long.parseLong(morse) == 4545454545){ System.out.println("2"); } ``` Where morse is just a String of numbers. The problem is it says Integer number too large: 4545454545, but I'm sure a Long can be much longer than that.
2013/07/13
[ "https://Stackoverflow.com/questions/17632914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2579707/" ]
You need to use `4545454545l` or `4545454545L` to qualify it as `long`. Be default , `4545454545` is an `int` literal and `4545454545` is out of range of `int`. *It is recommended to use uppercase alphabet `L` to avoid confusion , as `l` and `1` looks pretty similar* You can do : ``` if(Long.valueOf(4545454545l).equ...
You need to use `4545454545L` or `4545454545l` to qualify it as long.
17,632,914
Hi I'm having trouble understanding why this isn't working ``` if(Long.parseLong(morse) == 4545454545){ System.out.println("2"); } ``` Where morse is just a String of numbers. The problem is it says Integer number too large: 4545454545, but I'm sure a Long can be much longer than that.
2013/07/13
[ "https://Stackoverflow.com/questions/17632914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2579707/" ]
You need to use `4545454545l` or `4545454545L` to qualify it as `long`. Be default , `4545454545` is an `int` literal and `4545454545` is out of range of `int`. *It is recommended to use uppercase alphabet `L` to avoid confusion , as `l` and `1` looks pretty similar* You can do : ``` if(Long.valueOf(4545454545l).equ...
If your integer value is larger than `2147483647`, as your literal is then you need to use a long literal: `4545454545L` ...note the `L` at the end, which is the difference between a long and an int literal. A lower case `l` works too, but is less readable as it's easily confused with a 1 (not a great thing when you'...
58,083,876
I have previous implementation of AIDL for IPC in android. I want to add new method as this aidl has multiple implementation in client class and I don't want to implement for all classes.. I want to use default method just like its supported in Java 8.
2019/09/24
[ "https://Stackoverflow.com/questions/58083876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7887831/" ]
The `default` keyword should be available in any `interface` description, even if generated from `AIDL`. This will not be backwards compatible with Java 7, so it might require `minSdkVersion 26` and: ``` android { compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility Java...
Use it who is stopping you? Inside interface you can write your code like below: ``` default void show() { System.out.println("Default method here"); } ```
1,556
I have installed Chromium on my Raspberry Pi (running Raspian) with `sudo apt-get install chromium-browser` and I followed the instructions from this site to attempt to get flash player running: <http://linuxologist.com/01general/howto-chromium-browser-on-linux-with-flash/> ie I just downloaded `libflashplayer.so`, pl...
2012/08/12
[ "https://raspberrypi.stackexchange.com/questions/1556", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1111/" ]
I think Adobe did not release any flash plugin of ARM Linux. <http://get.adobe.com/flashplayer/otherversions/> I don't know where do you get the "libflashplayer.so", but i guess it is X86 or X64 version.
Possible solution,install [android](http://www.raspberrypi.org/archives/1700) on a chrooted environment. That way android can play flash because of the [google chrome support](http://www.mobilemag.com/2012/02/07/google-chrome-arrives-for-android-ics-4-0/) and the [flash plugin](http://www.anandtech.com/show/5250/adobe-...
1,556
I have installed Chromium on my Raspberry Pi (running Raspian) with `sudo apt-get install chromium-browser` and I followed the instructions from this site to attempt to get flash player running: <http://linuxologist.com/01general/howto-chromium-browser-on-linux-with-flash/> ie I just downloaded `libflashplayer.so`, pl...
2012/08/12
[ "https://raspberrypi.stackexchange.com/questions/1556", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1111/" ]
ARM vs x86 ========== Intel processors used by desktops are 32/64-bit architectures, generally known as x86 and x86\_64. ARM processors, which is used by the Raspberry Pi, also use a 32-bit architecture, but it is incompatible with x86. Therefore, x86 libraries will not run on the Raspberry Pi. How do I know you hav...
Gnash ===== > > Gnash is a free SWF movie player. It is available as a stand-alone application or as a plugin for several popular web browsers. It supports playing media from a disk or streaming over a network connection. Some popular video sharing sites like YouTube are supported on a wide variety of devices from em...
1,556
I have installed Chromium on my Raspberry Pi (running Raspian) with `sudo apt-get install chromium-browser` and I followed the instructions from this site to attempt to get flash player running: <http://linuxologist.com/01general/howto-chromium-browser-on-linux-with-flash/> ie I just downloaded `libflashplayer.so`, pl...
2012/08/12
[ "https://raspberrypi.stackexchange.com/questions/1556", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1111/" ]
Gnash ===== > > Gnash is a free SWF movie player. It is available as a stand-alone application or as a plugin for several popular web browsers. It supports playing media from a disk or streaming over a network connection. Some popular video sharing sites like YouTube are supported on a wide variety of devices from em...
Possible solution,install [android](http://www.raspberrypi.org/archives/1700) on a chrooted environment. That way android can play flash because of the [google chrome support](http://www.mobilemag.com/2012/02/07/google-chrome-arrives-for-android-ics-4-0/) and the [flash plugin](http://www.anandtech.com/show/5250/adobe-...
1,556
I have installed Chromium on my Raspberry Pi (running Raspian) with `sudo apt-get install chromium-browser` and I followed the instructions from this site to attempt to get flash player running: <http://linuxologist.com/01general/howto-chromium-browser-on-linux-with-flash/> ie I just downloaded `libflashplayer.so`, pl...
2012/08/12
[ "https://raspberrypi.stackexchange.com/questions/1556", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1111/" ]
OS maemo/meego(based on debain) supports flash player on nokia n900(with ARM Cortex A8) microB Browser(based on Mozilla Firefox): <http://natisbad.org/N900/n900-commented-hardware-specs.html> maemo download link: <http://tablets-dev.nokia.com/> next link is needed to generate IMEI for N900 to download image files: \*t...
Are you using Google Chrome? I think that's short for Chronium. If so, I read that Google Chrome cannot run correctly on an ARM processor. Hope this helps. Try finding a different browser, use Epiphany or your pre-installed browser, or find another one using > > sudo apt-get install > > >
1,556
I have installed Chromium on my Raspberry Pi (running Raspian) with `sudo apt-get install chromium-browser` and I followed the instructions from this site to attempt to get flash player running: <http://linuxologist.com/01general/howto-chromium-browser-on-linux-with-flash/> ie I just downloaded `libflashplayer.so`, pl...
2012/08/12
[ "https://raspberrypi.stackexchange.com/questions/1556", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1111/" ]
Possible solution,install [android](http://www.raspberrypi.org/archives/1700) on a chrooted environment. That way android can play flash because of the [google chrome support](http://www.mobilemag.com/2012/02/07/google-chrome-arrives-for-android-ics-4-0/) and the [flash plugin](http://www.anandtech.com/show/5250/adobe-...
Are you using Google Chrome? I think that's short for Chronium. If so, I read that Google Chrome cannot run correctly on an ARM processor. Hope this helps. Try finding a different browser, use Epiphany or your pre-installed browser, or find another one using > > sudo apt-get install > > >
1,556
I have installed Chromium on my Raspberry Pi (running Raspian) with `sudo apt-get install chromium-browser` and I followed the instructions from this site to attempt to get flash player running: <http://linuxologist.com/01general/howto-chromium-browser-on-linux-with-flash/> ie I just downloaded `libflashplayer.so`, pl...
2012/08/12
[ "https://raspberrypi.stackexchange.com/questions/1556", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1111/" ]
ARM vs x86 ========== Intel processors used by desktops are 32/64-bit architectures, generally known as x86 and x86\_64. ARM processors, which is used by the Raspberry Pi, also use a 32-bit architecture, but it is incompatible with x86. Therefore, x86 libraries will not run on the Raspberry Pi. How do I know you hav...
OS maemo/meego(based on debain) supports flash player on nokia n900(with ARM Cortex A8) microB Browser(based on Mozilla Firefox): <http://natisbad.org/N900/n900-commented-hardware-specs.html> maemo download link: <http://tablets-dev.nokia.com/> next link is needed to generate IMEI for N900 to download image files: \*t...
1,556
I have installed Chromium on my Raspberry Pi (running Raspian) with `sudo apt-get install chromium-browser` and I followed the instructions from this site to attempt to get flash player running: <http://linuxologist.com/01general/howto-chromium-browser-on-linux-with-flash/> ie I just downloaded `libflashplayer.so`, pl...
2012/08/12
[ "https://raspberrypi.stackexchange.com/questions/1556", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1111/" ]
ARM vs x86 ========== Intel processors used by desktops are 32/64-bit architectures, generally known as x86 and x86\_64. ARM processors, which is used by the Raspberry Pi, also use a 32-bit architecture, but it is incompatible with x86. Therefore, x86 libraries will not run on the Raspberry Pi. How do I know you hav...
I think Adobe did not release any flash plugin of ARM Linux. <http://get.adobe.com/flashplayer/otherversions/> I don't know where do you get the "libflashplayer.so", but i guess it is X86 or X64 version.
1,556
I have installed Chromium on my Raspberry Pi (running Raspian) with `sudo apt-get install chromium-browser` and I followed the instructions from this site to attempt to get flash player running: <http://linuxologist.com/01general/howto-chromium-browser-on-linux-with-flash/> ie I just downloaded `libflashplayer.so`, pl...
2012/08/12
[ "https://raspberrypi.stackexchange.com/questions/1556", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1111/" ]
I think Adobe did not release any flash plugin of ARM Linux. <http://get.adobe.com/flashplayer/otherversions/> I don't know where do you get the "libflashplayer.so", but i guess it is X86 or X64 version.
Are you using Google Chrome? I think that's short for Chronium. If so, I read that Google Chrome cannot run correctly on an ARM processor. Hope this helps. Try finding a different browser, use Epiphany or your pre-installed browser, or find another one using > > sudo apt-get install > > >
1,556
I have installed Chromium on my Raspberry Pi (running Raspian) with `sudo apt-get install chromium-browser` and I followed the instructions from this site to attempt to get flash player running: <http://linuxologist.com/01general/howto-chromium-browser-on-linux-with-flash/> ie I just downloaded `libflashplayer.so`, pl...
2012/08/12
[ "https://raspberrypi.stackexchange.com/questions/1556", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1111/" ]
Gnash ===== > > Gnash is a free SWF movie player. It is available as a stand-alone application or as a plugin for several popular web browsers. It supports playing media from a disk or streaming over a network connection. Some popular video sharing sites like YouTube are supported on a wide variety of devices from em...
OS maemo/meego(based on debain) supports flash player on nokia n900(with ARM Cortex A8) microB Browser(based on Mozilla Firefox): <http://natisbad.org/N900/n900-commented-hardware-specs.html> maemo download link: <http://tablets-dev.nokia.com/> next link is needed to generate IMEI for N900 to download image files: \*t...
1,556
I have installed Chromium on my Raspberry Pi (running Raspian) with `sudo apt-get install chromium-browser` and I followed the instructions from this site to attempt to get flash player running: <http://linuxologist.com/01general/howto-chromium-browser-on-linux-with-flash/> ie I just downloaded `libflashplayer.so`, pl...
2012/08/12
[ "https://raspberrypi.stackexchange.com/questions/1556", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/1111/" ]
ARM vs x86 ========== Intel processors used by desktops are 32/64-bit architectures, generally known as x86 and x86\_64. ARM processors, which is used by the Raspberry Pi, also use a 32-bit architecture, but it is incompatible with x86. Therefore, x86 libraries will not run on the Raspberry Pi. How do I know you hav...
Are you using Google Chrome? I think that's short for Chronium. If so, I read that Google Chrome cannot run correctly on an ARM processor. Hope this helps. Try finding a different browser, use Epiphany or your pre-installed browser, or find another one using > > sudo apt-get install > > >
30,230,857
I am looking for a Date Picker control to choose a date between 10'000 B.C. till today (2015). Can I use the `UIDatePicker` for that ( I didn't find any information with [UIDatePicker](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDatePicker_Class/index.html#//apple_ref/occ/instp/UIDatePicker/...
2015/05/14
[ "https://Stackoverflow.com/questions/30230857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1344545/" ]
The OLEDB provider may not properly installed. What you chose is the SQL Server native client. Do you have SSMS installed on server? This should come with sql native client OLE DB.
I would like to share an experience when I faced following error > > Cannot create an instance of OLE DB provider "xxx.YYYY" for linked server "test". Error 7302. > > > I observed this message from a failed SQL Server job. On analysis it is found that `Allow Inprocess` was not enabled for the `provider`. When th...
180,842
I don't understand what do 'snapped forward' 'bounded off' mean in context? > > The breath whistled out of Jock Danby's throat, and he stopped in mid-charge as though hit in the chest with a double charge of buck-shot. His head and arms **snapped forward**, nerveless as a straw-man, and he flew backwards, crashing in...
2018/09/26
[ "https://ell.stackexchange.com/questions/180842", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/80300/" ]
Both of these may be found in the dictionary: > > [**snap**](https://en.oxforddictionaries.com/definition/snap) (v): 1.2 [with complement or adverbial] *Move or alter with a brisk movement and typically a sharp sound.* > > > [**bound**](https://en.oxforddictionaries.com/definition/bound) (v): 1.1 (of an object) *re...
"Snap" is a sudden movement. "Forward" means that the movement was to (his) front. The implication is that the rest of him was stopped in its movement by something, but his extremities kept on going. "Bounded" means "jumped" or "leapt". "Off" is a preposition meaning "away from on". He was on the table and he jumped ...
180,842
I don't understand what do 'snapped forward' 'bounded off' mean in context? > > The breath whistled out of Jock Danby's throat, and he stopped in mid-charge as though hit in the chest with a double charge of buck-shot. His head and arms **snapped forward**, nerveless as a straw-man, and he flew backwards, crashing in...
2018/09/26
[ "https://ell.stackexchange.com/questions/180842", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/80300/" ]
Something hit the character and caused his arms and head to snap back. [arms, head, legs,] + snap: an **involuntary sharp movement** of the head or arms etc. Like (for the head) when you are in a car crash. snap forward or back[ward]. bound ***off of table***: to jump off it, to get off the table in one movement...
"Snap" is a sudden movement. "Forward" means that the movement was to (his) front. The implication is that the rest of him was stopped in its movement by something, but his extremities kept on going. "Bounded" means "jumped" or "leapt". "Off" is a preposition meaning "away from on". He was on the table and he jumped ...
180,842
I don't understand what do 'snapped forward' 'bounded off' mean in context? > > The breath whistled out of Jock Danby's throat, and he stopped in mid-charge as though hit in the chest with a double charge of buck-shot. His head and arms **snapped forward**, nerveless as a straw-man, and he flew backwards, crashing in...
2018/09/26
[ "https://ell.stackexchange.com/questions/180842", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/80300/" ]
Both of these may be found in the dictionary: > > [**snap**](https://en.oxforddictionaries.com/definition/snap) (v): 1.2 [with complement or adverbial] *Move or alter with a brisk movement and typically a sharp sound.* > > > [**bound**](https://en.oxforddictionaries.com/definition/bound) (v): 1.1 (of an object) *re...
Something hit the character and caused his arms and head to snap back. [arms, head, legs,] + snap: an **involuntary sharp movement** of the head or arms etc. Like (for the head) when you are in a car crash. snap forward or back[ward]. bound ***off of table***: to jump off it, to get off the table in one movement...