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
32,684
How can I shorten this class method (currently 10 lines long)? ``` class DoubleSeries def self.generate_sequences(seq1_start, seq2_start, seq1_step, seq2_step, iterations) seq1,seq2=seq1_start,seq2_start result=[] (1..iterations).each do result << seq1 << seq2 seq1+=seq1_step seq2+=seq2...
2013/10/14
[ "https://codereview.stackexchange.com/questions/32684", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/13039/" ]
You could a number of different things. For instance, using ranges and a couple of Array methods, I get this: ``` class DoubleSeries def self.generate_sequences(seq1_start, seq2_start, seq1_step, seq2_step, iterations) seq1_end = seq1_start + iterations * seq1_step seq2_end = seq2_start + iterations * seq2_s...
You can do it all in one expression. It's quite long, but the names of the variables give a good hint about the purpose of each part of the code. ``` class DoubleSeries def self.generate_sequences(seq1_start, seq2_start, seq1_step, seq2_step, iterations) [[seq1_start, seq1_step], [seq2_start, seq2_step]].map do ...
32,684
How can I shorten this class method (currently 10 lines long)? ``` class DoubleSeries def self.generate_sequences(seq1_start, seq2_start, seq1_step, seq2_step, iterations) seq1,seq2=seq1_start,seq2_start result=[] (1..iterations).each do result << seq1 << seq2 seq1+=seq1_step seq2+=seq2...
2013/10/14
[ "https://codereview.stackexchange.com/questions/32684", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/13039/" ]
You could a number of different things. For instance, using ranges and a couple of Array methods, I get this: ``` class DoubleSeries def self.generate_sequences(seq1_start, seq2_start, seq1_step, seq2_step, iterations) seq1_end = seq1_start + iterations * seq1_step seq2_end = seq2_start + iterations * seq2_s...
To generate a sequence, the shortest thing i can think of is : ``` (seq_start..Float::INFINITY).step(seq_step).take(iterations) ``` *note : works under ruby 2, don't know for other versions* **EDIT :** warning - unfortunately, this will only work with *positive* steps. I think it would be better to change the m...
32,684
How can I shorten this class method (currently 10 lines long)? ``` class DoubleSeries def self.generate_sequences(seq1_start, seq2_start, seq1_step, seq2_step, iterations) seq1,seq2=seq1_start,seq2_start result=[] (1..iterations).each do result << seq1 << seq2 seq1+=seq1_step seq2+=seq2...
2013/10/14
[ "https://codereview.stackexchange.com/questions/32684", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/13039/" ]
You could a number of different things. For instance, using ranges and a couple of Array methods, I get this: ``` class DoubleSeries def self.generate_sequences(seq1_start, seq2_start, seq1_step, seq2_step, iterations) seq1_end = seq1_start + iterations * seq1_step seq2_end = seq2_start + iterations * seq2_s...
I would be inclined to write it like this: ``` class DoubleSeries class << self def generate_sequences(seq1, seq2, iterations) s1 = sequence(seq1, iterations) s2 = sequence(seq2, iterations) s1.zip(s2) end private def sequence(seq, iterations) rng = (seq[:start]..seq[:start]...
32,684
How can I shorten this class method (currently 10 lines long)? ``` class DoubleSeries def self.generate_sequences(seq1_start, seq2_start, seq1_step, seq2_step, iterations) seq1,seq2=seq1_start,seq2_start result=[] (1..iterations).each do result << seq1 << seq2 seq1+=seq1_step seq2+=seq2...
2013/10/14
[ "https://codereview.stackexchange.com/questions/32684", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/13039/" ]
You can do it all in one expression. It's quite long, but the names of the variables give a good hint about the purpose of each part of the code. ``` class DoubleSeries def self.generate_sequences(seq1_start, seq2_start, seq1_step, seq2_step, iterations) [[seq1_start, seq1_step], [seq2_start, seq2_step]].map do ...
To generate a sequence, the shortest thing i can think of is : ``` (seq_start..Float::INFINITY).step(seq_step).take(iterations) ``` *note : works under ruby 2, don't know for other versions* **EDIT :** warning - unfortunately, this will only work with *positive* steps. I think it would be better to change the m...
32,684
How can I shorten this class method (currently 10 lines long)? ``` class DoubleSeries def self.generate_sequences(seq1_start, seq2_start, seq1_step, seq2_step, iterations) seq1,seq2=seq1_start,seq2_start result=[] (1..iterations).each do result << seq1 << seq2 seq1+=seq1_step seq2+=seq2...
2013/10/14
[ "https://codereview.stackexchange.com/questions/32684", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/13039/" ]
I would be inclined to write it like this: ``` class DoubleSeries class << self def generate_sequences(seq1, seq2, iterations) s1 = sequence(seq1, iterations) s2 = sequence(seq2, iterations) s1.zip(s2) end private def sequence(seq, iterations) rng = (seq[:start]..seq[:start]...
To generate a sequence, the shortest thing i can think of is : ``` (seq_start..Float::INFINITY).step(seq_step).take(iterations) ``` *note : works under ruby 2, don't know for other versions* **EDIT :** warning - unfortunately, this will only work with *positive* steps. I think it would be better to change the m...
6,587,237
I used **SparseBooleanArray** to get positions of checked listitems in a listView: ``` // lv is my listview final SparseBooleanArray checkedItems = lv.getCheckedItemPositions(); ``` This works fine when I check a list item. But when I unchecked an item from listview, its size didn't decrease. It remained as it was. ...
2011/07/05
[ "https://Stackoverflow.com/questions/6587237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
[`SparseBooleanArray`](http://developer.android.com/reference/android/util/SparseBooleanArray.html) maps integers to booleans. The `size()` method does not return the number of `true` items contained, it returns the number of items stored. Some of those items may be `false`. If you want to know the number of items che...
The `SparseBooleanArray` does not contain the details of all the rows. The keys contain the index of the row and the value contains if that is checked. If one row was checked and then unchecked, the array will contain one entry for that row. So to deal with this you need to do the following: 1. Get the size by calling...
47,148,517
I'm currently working through a game of Hexapawn (A 3 by 3 Chessboard game with each player having 3 pawns) using MATLAB. Currently, I am using an array that represents the chessboard (chessboard = [1 1 1; 0 0 0; 2 2 2];) : 1 1 1 0 0 0 2 2 2 The 1s represent player 1's pawns, the 0s represent empty spaces, and th...
2017/11/07
[ "https://Stackoverflow.com/questions/47148517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8839174/" ]
Here is a partial answer to your question. The function below will take a current board arrangement, and a given pawn. Then determine if that single Pawn has available moves. It will return a logical matrix the size of the board Example for the given board check the upper left pawn. ``` board = [1 1 1;... 0...
Add n matrices with the same size as your chessboard which each shows one possible move. Maybe like a 1 where the current figure is and a 3 where he can move to. Each move can be calculated by getting the indices of the current figure and checking if he can move upwards/sidewards (as long as he doesn't get out of boun...
3,429,965
How can I access server side functions from the HTML code? See the following code: ``` <a id="Taggloud" runat="server" class="lblTagCloud" onClick="TagOnCloud_Click">click</a> ``` Here I'm calling the `tagonCloud_click` function that's defined in server side(code behind). How can i call that function?
2010/08/07
[ "https://Stackoverflow.com/questions/3429965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/413743/" ]
If you don't mind a full post back, swap out the `<a>` tag for a `<asp:HyperLink>`, which will allow you to wire up server-side event handlers.
You will need to make a web service and call that web service from the client (via jQuery is one option). That web service can call a function. However, I'd put the code you have in the tagonCloud\_click function in another function and have the click call that function. That way both the web service and click functio...
3,429,965
How can I access server side functions from the HTML code? See the following code: ``` <a id="Taggloud" runat="server" class="lblTagCloud" onClick="TagOnCloud_Click">click</a> ``` Here I'm calling the `tagonCloud_click` function that's defined in server side(code behind). How can i call that function?
2010/08/07
[ "https://Stackoverflow.com/questions/3429965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/413743/" ]
You will need to make a web service and call that web service from the client (via jQuery is one option). That web service can call a function. However, I'd put the code you have in the tagonCloud\_click function in another function and have the click call that function. That way both the web service and click functio...
Use a LinkButton server side control: ``` <asp:LinkButton ID="Taggloud" runat="server" onclick="TagOnCloud_Click">click</asp:LinkButton> ```
3,429,965
How can I access server side functions from the HTML code? See the following code: ``` <a id="Taggloud" runat="server" class="lblTagCloud" onClick="TagOnCloud_Click">click</a> ``` Here I'm calling the `tagonCloud_click` function that's defined in server side(code behind). How can i call that function?
2010/08/07
[ "https://Stackoverflow.com/questions/3429965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/413743/" ]
If you don't mind a full post back, swap out the `<a>` tag for a `<asp:HyperLink>`, which will allow you to wire up server-side event handlers.
Use a LinkButton server side control: ``` <asp:LinkButton ID="Taggloud" runat="server" onclick="TagOnCloud_Click">click</asp:LinkButton> ```
625,091
I'm sending xml to another program, which expects boolean flags as "yes" or "no", rather than "true" or "false". I have a class defined like: ``` [XmlRoot()] public class Foo { public bool Bar { get; set; } } ``` When I serialize it, my output looks like this: ``` <Foo><Bar>true</Bar></Foo> ``` But I would l...
2009/03/09
[ "https://Stackoverflow.com/questions/625091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369/" ]
Very simple. Use a surrogate property. Apply XmlIgnore on the actual property. The surrogate is a string, and must use the XmlElement attribute that takes a element-name override. Specify the name of the *actual property* in the override. The surrogate property serializes differently based on the value of the actual pr...
What you're needing to do sounds more like a display issue. If your application allows, you will be better off keeping the data type as a boolean and displaying Yes/No in your user interface.
625,091
I'm sending xml to another program, which expects boolean flags as "yes" or "no", rather than "true" or "false". I have a class defined like: ``` [XmlRoot()] public class Foo { public bool Bar { get; set; } } ``` When I serialize it, my output looks like this: ``` <Foo><Bar>true</Bar></Foo> ``` But I would l...
2009/03/09
[ "https://Stackoverflow.com/questions/625091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369/" ]
Ok, I've been looking into this some more. Here's what I've come up with: ``` // use this instead of a bool, and it will serialize to "yes" or "no" // minimal example, not very robust public struct YesNo : IXmlSerializable { // we're just wrapping a bool private bool Value; // allow implicit casts to/fro...
What you're needing to do sounds more like a display issue. If your application allows, you will be better off keeping the data type as a boolean and displaying Yes/No in your user interface.
625,091
I'm sending xml to another program, which expects boolean flags as "yes" or "no", rather than "true" or "false". I have a class defined like: ``` [XmlRoot()] public class Foo { public bool Bar { get; set; } } ``` When I serialize it, my output looks like this: ``` <Foo><Bar>true</Bar></Foo> ``` But I would l...
2009/03/09
[ "https://Stackoverflow.com/questions/625091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369/" ]
Very simple. Use a surrogate property. Apply XmlIgnore on the actual property. The surrogate is a string, and must use the XmlElement attribute that takes a element-name override. Specify the name of the *actual property* in the override. The surrogate property serializes differently based on the value of the actual pr...
Making a bool value serialize as "yes" or "no" changes the data type from being a boolean at all. Instead, can you add a separate property which evaluates a boolean and returns "yes" or "no" as appropriate for it's data type? Maybe you could even force "yes" or "no" by making the return type be an enum which only speci...
625,091
I'm sending xml to another program, which expects boolean flags as "yes" or "no", rather than "true" or "false". I have a class defined like: ``` [XmlRoot()] public class Foo { public bool Bar { get; set; } } ``` When I serialize it, my output looks like this: ``` <Foo><Bar>true</Bar></Foo> ``` But I would l...
2009/03/09
[ "https://Stackoverflow.com/questions/625091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369/" ]
Ok, I've been looking into this some more. Here's what I've come up with: ``` // use this instead of a bool, and it will serialize to "yes" or "no" // minimal example, not very robust public struct YesNo : IXmlSerializable { // we're just wrapping a bool private bool Value; // allow implicit casts to/fro...
@Blorgbeard: If you have more then one of these YesNo classes in an object class, make sure to read the entire element. ``` public void ReadXml(XmlReader reader) { string element = reader.ReadOuterXml(); int startIndex = element.IndexOf('>') + 1; int length = element.LastIndexOf('<') - startIndex; str...
625,091
I'm sending xml to another program, which expects boolean flags as "yes" or "no", rather than "true" or "false". I have a class defined like: ``` [XmlRoot()] public class Foo { public bool Bar { get; set; } } ``` When I serialize it, my output looks like this: ``` <Foo><Bar>true</Bar></Foo> ``` But I would l...
2009/03/09
[ "https://Stackoverflow.com/questions/625091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369/" ]
Ok, I've been looking into this some more. Here's what I've come up with: ``` // use this instead of a bool, and it will serialize to "yes" or "no" // minimal example, not very robust public struct YesNo : IXmlSerializable { // we're just wrapping a bool private bool Value; // allow implicit casts to/fro...
Making a bool value serialize as "yes" or "no" changes the data type from being a boolean at all. Instead, can you add a separate property which evaluates a boolean and returns "yes" or "no" as appropriate for it's data type? Maybe you could even force "yes" or "no" by making the return type be an enum which only speci...
625,091
I'm sending xml to another program, which expects boolean flags as "yes" or "no", rather than "true" or "false". I have a class defined like: ``` [XmlRoot()] public class Foo { public bool Bar { get; set; } } ``` When I serialize it, my output looks like this: ``` <Foo><Bar>true</Bar></Foo> ``` But I would l...
2009/03/09
[ "https://Stackoverflow.com/questions/625091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369/" ]
@Blorgbeard: If you have more then one of these YesNo classes in an object class, make sure to read the entire element. ``` public void ReadXml(XmlReader reader) { string element = reader.ReadOuterXml(); int startIndex = element.IndexOf('>') + 1; int length = element.LastIndexOf('<') - startIndex; str...
What you're needing to do sounds more like a display issue. If your application allows, you will be better off keeping the data type as a boolean and displaying Yes/No in your user interface.
625,091
I'm sending xml to another program, which expects boolean flags as "yes" or "no", rather than "true" or "false". I have a class defined like: ``` [XmlRoot()] public class Foo { public bool Bar { get; set; } } ``` When I serialize it, my output looks like this: ``` <Foo><Bar>true</Bar></Foo> ``` But I would l...
2009/03/09
[ "https://Stackoverflow.com/questions/625091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369/" ]
Very simple. Use a surrogate property. Apply XmlIgnore on the actual property. The surrogate is a string, and must use the XmlElement attribute that takes a element-name override. Specify the name of the *actual property* in the override. The surrogate property serializes differently based on the value of the actual pr...
@Blorgbeard: If you have more then one of these YesNo classes in an object class, make sure to read the entire element. ``` public void ReadXml(XmlReader reader) { string element = reader.ReadOuterXml(); int startIndex = element.IndexOf('>') + 1; int length = element.LastIndexOf('<') - startIndex; str...
625,091
I'm sending xml to another program, which expects boolean flags as "yes" or "no", rather than "true" or "false". I have a class defined like: ``` [XmlRoot()] public class Foo { public bool Bar { get; set; } } ``` When I serialize it, my output looks like this: ``` <Foo><Bar>true</Bar></Foo> ``` But I would l...
2009/03/09
[ "https://Stackoverflow.com/questions/625091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369/" ]
Very simple. Use a surrogate property. Apply XmlIgnore on the actual property. The surrogate is a string, and must use the XmlElement attribute that takes a element-name override. Specify the name of the *actual property* in the override. The surrogate property serializes differently based on the value of the actual pr...
I use the property method, but instead of checking to see if the string is equal to yes or no, I prefer to check if the string starts with (case insensitive) "YT1". This allows the file to contain true, True, t, T, y, Y, yes, Yes, 1, etc. all which will evaluate to true. While I can specify that false is false, False, ...
625,091
I'm sending xml to another program, which expects boolean flags as "yes" or "no", rather than "true" or "false". I have a class defined like: ``` [XmlRoot()] public class Foo { public bool Bar { get; set; } } ``` When I serialize it, my output looks like this: ``` <Foo><Bar>true</Bar></Foo> ``` But I would l...
2009/03/09
[ "https://Stackoverflow.com/questions/625091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369/" ]
Ok, I've been looking into this some more. Here's what I've come up with: ``` // use this instead of a bool, and it will serialize to "yes" or "no" // minimal example, not very robust public struct YesNo : IXmlSerializable { // we're just wrapping a bool private bool Value; // allow implicit casts to/fro...
Your property example is probably the simplest way you could do it. If it helps, I believe you don't need to make it a public property, since the attribute implements ISerializable on the class behind your back. To enable deserialization, you should be able to just implement `set { Bar = value == "yes"; }`
625,091
I'm sending xml to another program, which expects boolean flags as "yes" or "no", rather than "true" or "false". I have a class defined like: ``` [XmlRoot()] public class Foo { public bool Bar { get; set; } } ``` When I serialize it, my output looks like this: ``` <Foo><Bar>true</Bar></Foo> ``` But I would l...
2009/03/09
[ "https://Stackoverflow.com/questions/625091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369/" ]
I use the property method, but instead of checking to see if the string is equal to yes or no, I prefer to check if the string starts with (case insensitive) "YT1". This allows the file to contain true, True, t, T, y, Y, yes, Yes, 1, etc. all which will evaluate to true. While I can specify that false is false, False, ...
@Blorgbeard: If you have more then one of these YesNo classes in an object class, make sure to read the entire element. ``` public void ReadXml(XmlReader reader) { string element = reader.ReadOuterXml(); int startIndex = element.IndexOf('>') + 1; int length = element.LastIndexOf('<') - startIndex; str...
62,910,417
I have a list of objects `List<WorkingActivityModel> mList = new ArrayList<>();` ``` public class WorkingActivityModel { private String name; private Sales sales; private Shifts shifts; } ``` The Sales model is: ``` public class Sales { private int product1; private int product2; } ``` The Shifts...
2020/07/15
[ "https://Stackoverflow.com/questions/62910417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6310948/" ]
You can do that using a custom merge operation defined such that performing `toMap` becomes slightly easier. ``` Collection<WorkingActivityModel> result = mList.stream() .collect(Collectors.toMap(WorkingActivityModel::getName, Function.identity(), (a, b) -> WorkingActivityModel.mergeModels(a, b...
You can do this: ``` mList.stream() .collect(Collectors.toMap(WorkingActivityModel::getName,Function.identity(), (o, o2) -> { o.getSales().sum(o2.getSales()); o.getShifts().sum(o2.getShifts()); return o; ...
62,910,417
I have a list of objects `List<WorkingActivityModel> mList = new ArrayList<>();` ``` public class WorkingActivityModel { private String name; private Sales sales; private Shifts shifts; } ``` The Sales model is: ``` public class Sales { private int product1; private int product2; } ``` The Shifts...
2020/07/15
[ "https://Stackoverflow.com/questions/62910417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6310948/" ]
You can do that using a custom merge operation defined such that performing `toMap` becomes slightly easier. ``` Collection<WorkingActivityModel> result = mList.stream() .collect(Collectors.toMap(WorkingActivityModel::getName, Function.identity(), (a, b) -> WorkingActivityModel.mergeModels(a, b...
You can also sum directly as item\_added within a custom data structure. ``` import java.util.HashMap; public class MyHash extends HashMap<String, WorkingActivityModel> { @Override public WorkingActivityModel put(String key, WorkingActivityModel value) { if(this.containsKey(key)) { ...
62,910,417
I have a list of objects `List<WorkingActivityModel> mList = new ArrayList<>();` ``` public class WorkingActivityModel { private String name; private Sales sales; private Shifts shifts; } ``` The Sales model is: ``` public class Sales { private int product1; private int product2; } ``` The Shifts...
2020/07/15
[ "https://Stackoverflow.com/questions/62910417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6310948/" ]
You can do that using a custom merge operation defined such that performing `toMap` becomes slightly easier. ``` Collection<WorkingActivityModel> result = mList.stream() .collect(Collectors.toMap(WorkingActivityModel::getName, Function.identity(), (a, b) -> WorkingActivityModel.mergeModels(a, b...
If my understanding of your question is right, this might help - ``` List<WorkingActivityModel> mList = generateList(6); Map<String, WorkingActivityModel> map = mList.stream() .collect(groupingBy(WorkingActivityModel::getName)) .entrySet().stream() .collect(Collectors.toMap(entry -...
62,910,417
I have a list of objects `List<WorkingActivityModel> mList = new ArrayList<>();` ``` public class WorkingActivityModel { private String name; private Sales sales; private Shifts shifts; } ``` The Sales model is: ``` public class Sales { private int product1; private int product2; } ``` The Shifts...
2020/07/15
[ "https://Stackoverflow.com/questions/62910417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6310948/" ]
You can do this: ``` mList.stream() .collect(Collectors.toMap(WorkingActivityModel::getName,Function.identity(), (o, o2) -> { o.getSales().sum(o2.getSales()); o.getShifts().sum(o2.getShifts()); return o; ...
You can also sum directly as item\_added within a custom data structure. ``` import java.util.HashMap; public class MyHash extends HashMap<String, WorkingActivityModel> { @Override public WorkingActivityModel put(String key, WorkingActivityModel value) { if(this.containsKey(key)) { ...
62,910,417
I have a list of objects `List<WorkingActivityModel> mList = new ArrayList<>();` ``` public class WorkingActivityModel { private String name; private Sales sales; private Shifts shifts; } ``` The Sales model is: ``` public class Sales { private int product1; private int product2; } ``` The Shifts...
2020/07/15
[ "https://Stackoverflow.com/questions/62910417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6310948/" ]
You can do this: ``` mList.stream() .collect(Collectors.toMap(WorkingActivityModel::getName,Function.identity(), (o, o2) -> { o.getSales().sum(o2.getSales()); o.getShifts().sum(o2.getShifts()); return o; ...
If my understanding of your question is right, this might help - ``` List<WorkingActivityModel> mList = generateList(6); Map<String, WorkingActivityModel> map = mList.stream() .collect(groupingBy(WorkingActivityModel::getName)) .entrySet().stream() .collect(Collectors.toMap(entry -...
44,053,274
``` #include<tuple> #include<iostream> using namespace std; class A { ...
2017/05/18
[ "https://Stackoverflow.com/questions/44053274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8032189/" ]
``` // now it will using tuple_args = tuple< Args... >; tuple_args argstuple3((Args(a))...); ```
clang has a better error code: ``` <source>:36:28: warning: parentheses were disambiguated as a function declaration [-Wvexing-parse] tuple<Args...> argstuple3(Args(a)...); ^~~~~~~~~~~~ <source>:36:29: note: add a pair of parentheses to declare a variable tuple<Args...> argstuple3(Ar...
5,926,280
I use Wordpress and have a sidebar containing widgets, run by this code: ``` <div class="sidebar modern"> <?php if ( is_active_sidebar( 'sidebar-modern' )) : ?> <ul> <?php dynamic_sidebar( 'sidebar-modern' ); ?> </ul> <?php else : ?> <?php endif; ?> </div> ``` **What I do in w...
2011/05/08
[ "https://Stackoverflow.com/questions/5926280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/148496/" ]
Where you register the sidebar: ``` register_sidebar( array( 'name' => 'Sidebar Modern', 'id' => 'sidebar-modern', 'before_widget' => '<div id="%1$s" class="%2$s widget clearfix">', 'after_widget' => '</div>', 'before_title' => '<h3 class="title">', 'after_title' =>...
It's not possible right now without editing the Wordpress core.
35,927,307
I want to print out the nth string using the Queue data type. Ex. ``` $ java NthString 5 a b c d e f < ctrl -d > ``` should give me: ``` b (the fifth string from the right) ``` This is what I have so far, but I do not know my next step: ``` public class NthString { public static void main(String[] args) {...
2016/03/10
[ "https://Stackoverflow.com/questions/35927307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5759234/" ]
``` public class NthString { public static void main(String[] args) { Integer n = Integer.parseInt(args[0]); Queue<Integer> q = new Queue<Integer>(); while(!StdIn.isEmpty()){ q.enqueue(StdIn.readInt()); } while(q.size() > n){ q.dequeue(); } StdOut.println(...
First of all you should know how these stuff work, so read my comments carefully. I have written a sample for you but it is not exactly what you need but with small changes you can reach the requirement. ``` import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.L...
1,014,298
I am having issues trying to run Virtual Box; which are the "`appropiate headers"`?? ``` WARNING: The character device /dev/vboxdrv does not exist. Please install the virtualbox-dkms package and the appropriate headers, most likely linux-headers-generic. You will not be able to start VMs until this pro...
2018/03/12
[ "https://askubuntu.com/questions/1014298", "https://askubuntu.com", "https://askubuntu.com/users/397943/" ]
Did you try: ``` sudo apt-get update sudo apt-get upgrade sudo apt-get install --reinstall virtualbox-dkms ``` Hope this will help.
To install the headers do ``` sudo apt install linux-headers-generic ```
1,014,298
I am having issues trying to run Virtual Box; which are the "`appropiate headers"`?? ``` WARNING: The character device /dev/vboxdrv does not exist. Please install the virtualbox-dkms package and the appropriate headers, most likely linux-headers-generic. You will not be able to start VMs until this pro...
2018/03/12
[ "https://askubuntu.com/questions/1014298", "https://askubuntu.com", "https://askubuntu.com/users/397943/" ]
To install the headers do ``` sudo apt install linux-headers-generic ```
How did you install it in the first place? I usuall just install it with ``` sudo apt-get install virtualbox ``` which installs all required packages and builds the modules for the current kernel. You will have to run ``` sudo dpkg-reconfigure virtualbox-dkms ``` if you upgrade your kernel. Hope it gives you a ...
1,014,298
I am having issues trying to run Virtual Box; which are the "`appropiate headers"`?? ``` WARNING: The character device /dev/vboxdrv does not exist. Please install the virtualbox-dkms package and the appropriate headers, most likely linux-headers-generic. You will not be able to start VMs until this pro...
2018/03/12
[ "https://askubuntu.com/questions/1014298", "https://askubuntu.com", "https://askubuntu.com/users/397943/" ]
To install the headers do ``` sudo apt install linux-headers-generic ```
Install/Check Virtualbox Driver =============================== The installation of the Virtualbox drivers can fail for several reasons. First check if the kernel modules have been create: ``` $ ls -la /lib/modules/$(uname -r)/misc total 696 drwxr-xr-x 2 root root 4096 Mar 7 16:02 . drwxr-xr-x 6 root root 4096 M...
1,014,298
I am having issues trying to run Virtual Box; which are the "`appropiate headers"`?? ``` WARNING: The character device /dev/vboxdrv does not exist. Please install the virtualbox-dkms package and the appropriate headers, most likely linux-headers-generic. You will not be able to start VMs until this pro...
2018/03/12
[ "https://askubuntu.com/questions/1014298", "https://askubuntu.com", "https://askubuntu.com/users/397943/" ]
Did you try: ``` sudo apt-get update sudo apt-get upgrade sudo apt-get install --reinstall virtualbox-dkms ``` Hope this will help.
How did you install it in the first place? I usuall just install it with ``` sudo apt-get install virtualbox ``` which installs all required packages and builds the modules for the current kernel. You will have to run ``` sudo dpkg-reconfigure virtualbox-dkms ``` if you upgrade your kernel. Hope it gives you a ...
1,014,298
I am having issues trying to run Virtual Box; which are the "`appropiate headers"`?? ``` WARNING: The character device /dev/vboxdrv does not exist. Please install the virtualbox-dkms package and the appropriate headers, most likely linux-headers-generic. You will not be able to start VMs until this pro...
2018/03/12
[ "https://askubuntu.com/questions/1014298", "https://askubuntu.com", "https://askubuntu.com/users/397943/" ]
Did you try: ``` sudo apt-get update sudo apt-get upgrade sudo apt-get install --reinstall virtualbox-dkms ``` Hope this will help.
Install/Check Virtualbox Driver =============================== The installation of the Virtualbox drivers can fail for several reasons. First check if the kernel modules have been create: ``` $ ls -la /lib/modules/$(uname -r)/misc total 696 drwxr-xr-x 2 root root 4096 Mar 7 16:02 . drwxr-xr-x 6 root root 4096 M...
51,448,914
**SITUATION:** I am currently learning to scrape using puppeteer. For some reason, my current code gives me this error: "UnhandledPromiseRejectionWarning: Error: Evaluation failed: ReferenceError: page is not defined" (**EDIT**) The issue is that while the page loads and each item is clicked, the data is not scrap...
2018/07/20
[ "https://Stackoverflow.com/questions/51448914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8119401/" ]
There are a few issues with this code: * `1`, `2`, etc. are not valid identifiers (I’m guessing this is just for the example, though) * `.click()` and `.waitFor()` would return promises, which you don’t wait for, but in any case… * the function you pass to `evaluate` is evaluated in the context of the page, not your N...
Try changing this line: ``` await page.goto('https://website.com'); ``` to: ``` await page.goto('https://website.com', { waitUntil: 'networkidle' }) ```
2,912,322
Let me describe my question - I have a Java application - Hibernate as the DB interfacing layer over MySQL. I get the communications link failure error in my application. The occurence of this error is a very specific case. I get this error , When I leave mysql server unattended for more than approximately 6 hours (i...
2010/05/26
[ "https://Stackoverflow.com/questions/2912322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/183902/" ]
I had issue before. It looks like MySQL server times out your connection. Timeout is 28800 by default which is 8 hours. Please refer to this link for more details. <http://shengchien.blogspot.com/2009/10/hibernate-c3p0-and-mysql.html> Hope it is useful to you.
Even I faced this error, I got it solved only after enabling autoReconnect=true in c3p0 config ``` <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/ex_app?autoReconnect=true</property> ```
2,912,322
Let me describe my question - I have a Java application - Hibernate as the DB interfacing layer over MySQL. I get the communications link failure error in my application. The occurence of this error is a very specific case. I get this error , When I leave mysql server unattended for more than approximately 6 hours (i...
2010/05/26
[ "https://Stackoverflow.com/questions/2912322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/183902/" ]
I had issue before. It looks like MySQL server times out your connection. Timeout is 28800 by default which is 8 hours. Please refer to this link for more details. <http://shengchien.blogspot.com/2009/10/hibernate-c3p0-and-mysql.html> Hope it is useful to you.
I solved my communication link failure with c3p0. I came across the blog below that explained that the org.hibernate version must be equal to the c3p0 version, so this is the pom configuration that made my day ``` <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifa...
2,912,322
Let me describe my question - I have a Java application - Hibernate as the DB interfacing layer over MySQL. I get the communications link failure error in my application. The occurence of this error is a very specific case. I get this error , When I leave mysql server unattended for more than approximately 6 hours (i...
2010/05/26
[ "https://Stackoverflow.com/questions/2912322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/183902/" ]
I had issue before. It looks like MySQL server times out your connection. Timeout is 28800 by default which is 8 hours. Please refer to this link for more details. <http://shengchien.blogspot.com/2009/10/hibernate-c3p0-and-mysql.html> Hope it is useful to you.
For me i downgrade Java SE Runtime Environment to 1.8.0\_281 and it work fine.
2,912,322
Let me describe my question - I have a Java application - Hibernate as the DB interfacing layer over MySQL. I get the communications link failure error in my application. The occurence of this error is a very specific case. I get this error , When I leave mysql server unattended for more than approximately 6 hours (i...
2010/05/26
[ "https://Stackoverflow.com/questions/2912322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/183902/" ]
Even I faced this error, I got it solved only after enabling autoReconnect=true in c3p0 config ``` <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/ex_app?autoReconnect=true</property> ```
I solved my communication link failure with c3p0. I came across the blog below that explained that the org.hibernate version must be equal to the c3p0 version, so this is the pom configuration that made my day ``` <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifa...
2,912,322
Let me describe my question - I have a Java application - Hibernate as the DB interfacing layer over MySQL. I get the communications link failure error in my application. The occurence of this error is a very specific case. I get this error , When I leave mysql server unattended for more than approximately 6 hours (i...
2010/05/26
[ "https://Stackoverflow.com/questions/2912322", "https://Stackoverflow.com", "https://Stackoverflow.com/users/183902/" ]
Even I faced this error, I got it solved only after enabling autoReconnect=true in c3p0 config ``` <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/ex_app?autoReconnect=true</property> ```
For me i downgrade Java SE Runtime Environment to 1.8.0\_281 and it work fine.
43,310,739
I know this question was asked a lot, but going through dozens of answers none have been helpful. I'm attempting to run a simple hello world on my Huawei Mate 9 using Android Studio 2.3.1 (The APP is 4.X Jellybean API) running on Debian (Jesse). -I have enabled debugging options on the phone (I can see developer opt...
2017/04/09
[ "https://Stackoverflow.com/questions/43310739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7789305/" ]
You originally asked which strategy argument to use with `git pull` to discard your own work (there is a pending edit that will change the question, if the edit is approved). The answer is: None. Don't use `git pull` at all. Run `git fetch` first: ``` git fetch origin ``` This brings over all the new stuff from the...
In Android studio do the following: Go to VCS -> Git -> Reset HEAD Change Reset type to hard
43,310,739
I know this question was asked a lot, but going through dozens of answers none have been helpful. I'm attempting to run a simple hello world on my Huawei Mate 9 using Android Studio 2.3.1 (The APP is 4.X Jellybean API) running on Debian (Jesse). -I have enabled debugging options on the phone (I can see developer opt...
2017/04/09
[ "https://Stackoverflow.com/questions/43310739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7789305/" ]
You originally asked which strategy argument to use with `git pull` to discard your own work (there is a pending edit that will change the question, if the edit is approved). The answer is: None. Don't use `git pull` at all. Run `git fetch` first: ``` git fetch origin ``` This brings over all the new stuff from the...
In Android Studio do the following: -Open the **Version Control** tool window Alt+9 and switch to the **Log** tab. -Select the recent commit and right click on it than select **Reset Current Branch to Here**. -A Git Reset popup will open -> select **Hard** -> click **Reset**
1,312,894
So, we have to find $\lim\limits\_{x\to 0}(\frac{\sin(x)}{x})^{\frac{\sin(x)}{x-\sin(x)}}$ with and without L'Hopital's Rule. **My Work**: Let $\lim\limits\_{x\to 0}(\frac{\sin(x)}{x})^{\frac{\sin(x)}{x-\sin(x)}}=L$ Taking $\ln$ of both sides and bringing the exponent down. $\lim\limits\_{x\to 0}{\frac{\sin(x)}{x...
2015/06/05
[ "https://math.stackexchange.com/questions/1312894", "https://math.stackexchange.com", "https://math.stackexchange.com/users/217555/" ]
You need to work a bit more. Let's continue it as follows \begin{align} \log L &= \lim\_{x \to 0}\frac{\sin x}{x - \sin x}\log\left(\frac{\sin x}{x}\right)\notag\\ &= \lim\_{x \to 0}\frac{\sin x}{x - \sin x}\log\left(1 + \frac{\sin x}{x} - 1\right)\notag\\ &= \lim\_{x \to 0}\frac{\sin x}{x - \sin x}\cdot\left(\dfrac{\s...
Take logarithm as you did then write what follows \begin{equation\*} \frac{\sin x}{x-\sin x}\ln \left( \frac{\sin x}{x}\right) =\frac{\ln \left( \frac{\sin x}{x}\right) }{\frac{x-\sin x}{\sin x}}=\frac{\ln \left( 1+\left[ \frac{\sin x}{x}-1\right] \right) }{\frac{x-\sin x}{x}\times \frac{x}{\sin x}% }=-\frac{\ln \lef...
1,312,894
So, we have to find $\lim\limits\_{x\to 0}(\frac{\sin(x)}{x})^{\frac{\sin(x)}{x-\sin(x)}}$ with and without L'Hopital's Rule. **My Work**: Let $\lim\limits\_{x\to 0}(\frac{\sin(x)}{x})^{\frac{\sin(x)}{x-\sin(x)}}=L$ Taking $\ln$ of both sides and bringing the exponent down. $\lim\limits\_{x\to 0}{\frac{\sin(x)}{x...
2015/06/05
[ "https://math.stackexchange.com/questions/1312894", "https://math.stackexchange.com", "https://math.stackexchange.com/users/217555/" ]
You need to work a bit more. Let's continue it as follows \begin{align} \log L &= \lim\_{x \to 0}\frac{\sin x}{x - \sin x}\log\left(\frac{\sin x}{x}\right)\notag\\ &= \lim\_{x \to 0}\frac{\sin x}{x - \sin x}\log\left(1 + \frac{\sin x}{x} - 1\right)\notag\\ &= \lim\_{x \to 0}\frac{\sin x}{x - \sin x}\cdot\left(\dfrac{\s...
Change variable: $\frac{sinx}{x} = u$. Then $u\to 1$ when $x\to 0 $. Then $$ln(L) = \lim\_{u\to 1} \frac{ln(u)}{1/u - 1}$$ It will be then much easier to work with/without L'Hospital rule
1,312,894
So, we have to find $\lim\limits\_{x\to 0}(\frac{\sin(x)}{x})^{\frac{\sin(x)}{x-\sin(x)}}$ with and without L'Hopital's Rule. **My Work**: Let $\lim\limits\_{x\to 0}(\frac{\sin(x)}{x})^{\frac{\sin(x)}{x-\sin(x)}}=L$ Taking $\ln$ of both sides and bringing the exponent down. $\lim\limits\_{x\to 0}{\frac{\sin(x)}{x...
2015/06/05
[ "https://math.stackexchange.com/questions/1312894", "https://math.stackexchange.com", "https://math.stackexchange.com/users/217555/" ]
You need to work a bit more. Let's continue it as follows \begin{align} \log L &= \lim\_{x \to 0}\frac{\sin x}{x - \sin x}\log\left(\frac{\sin x}{x}\right)\notag\\ &= \lim\_{x \to 0}\frac{\sin x}{x - \sin x}\log\left(1 + \frac{\sin x}{x} - 1\right)\notag\\ &= \lim\_{x \to 0}\frac{\sin x}{x - \sin x}\cdot\left(\dfrac{\s...
Let $y=\dfrac{\sin x}{x},$ then $x\to 0\iff y\to 1.$ $$\lim\limits\_{x\to 0}\left(\dfrac{\sin x}{x}\right)^{\dfrac{\sin x}{x-\sin x}} =\lim\_{y\to1}y^{\left(\dfrac{y}{1-y}\right)}$$ continue from here.
1,312,894
So, we have to find $\lim\limits\_{x\to 0}(\frac{\sin(x)}{x})^{\frac{\sin(x)}{x-\sin(x)}}$ with and without L'Hopital's Rule. **My Work**: Let $\lim\limits\_{x\to 0}(\frac{\sin(x)}{x})^{\frac{\sin(x)}{x-\sin(x)}}=L$ Taking $\ln$ of both sides and bringing the exponent down. $\lim\limits\_{x\to 0}{\frac{\sin(x)}{x...
2015/06/05
[ "https://math.stackexchange.com/questions/1312894", "https://math.stackexchange.com", "https://math.stackexchange.com/users/217555/" ]
You need to work a bit more. Let's continue it as follows \begin{align} \log L &= \lim\_{x \to 0}\frac{\sin x}{x - \sin x}\log\left(\frac{\sin x}{x}\right)\notag\\ &= \lim\_{x \to 0}\frac{\sin x}{x - \sin x}\log\left(1 + \frac{\sin x}{x} - 1\right)\notag\\ &= \lim\_{x \to 0}\frac{\sin x}{x - \sin x}\cdot\left(\dfrac{\s...
$$ \begin{align} \log\left(\left(\frac{\sin(x)}{x}\right)^{\frac{\large\sin(x)}{\large x-\sin(x)}}\right) &=\frac{\sin(x)}{x-\sin(x)}\log\left(\frac{\sin(x)}{x}\right)\\ &=\frac{\sin(x)}x\frac1{\color{#C00000}{1-\frac{\sin(x)}x}}\log\left(1-\left(\color{#C00000}{1-\frac{\sin(x)}x}\right)\right) \end{align} $$ Since $\l...
1,312,894
So, we have to find $\lim\limits\_{x\to 0}(\frac{\sin(x)}{x})^{\frac{\sin(x)}{x-\sin(x)}}$ with and without L'Hopital's Rule. **My Work**: Let $\lim\limits\_{x\to 0}(\frac{\sin(x)}{x})^{\frac{\sin(x)}{x-\sin(x)}}=L$ Taking $\ln$ of both sides and bringing the exponent down. $\lim\limits\_{x\to 0}{\frac{\sin(x)}{x...
2015/06/05
[ "https://math.stackexchange.com/questions/1312894", "https://math.stackexchange.com", "https://math.stackexchange.com/users/217555/" ]
Take logarithm as you did then write what follows \begin{equation\*} \frac{\sin x}{x-\sin x}\ln \left( \frac{\sin x}{x}\right) =\frac{\ln \left( \frac{\sin x}{x}\right) }{\frac{x-\sin x}{\sin x}}=\frac{\ln \left( 1+\left[ \frac{\sin x}{x}-1\right] \right) }{\frac{x-\sin x}{x}\times \frac{x}{\sin x}% }=-\frac{\ln \lef...
Change variable: $\frac{sinx}{x} = u$. Then $u\to 1$ when $x\to 0 $. Then $$ln(L) = \lim\_{u\to 1} \frac{ln(u)}{1/u - 1}$$ It will be then much easier to work with/without L'Hospital rule
1,312,894
So, we have to find $\lim\limits\_{x\to 0}(\frac{\sin(x)}{x})^{\frac{\sin(x)}{x-\sin(x)}}$ with and without L'Hopital's Rule. **My Work**: Let $\lim\limits\_{x\to 0}(\frac{\sin(x)}{x})^{\frac{\sin(x)}{x-\sin(x)}}=L$ Taking $\ln$ of both sides and bringing the exponent down. $\lim\limits\_{x\to 0}{\frac{\sin(x)}{x...
2015/06/05
[ "https://math.stackexchange.com/questions/1312894", "https://math.stackexchange.com", "https://math.stackexchange.com/users/217555/" ]
Take logarithm as you did then write what follows \begin{equation\*} \frac{\sin x}{x-\sin x}\ln \left( \frac{\sin x}{x}\right) =\frac{\ln \left( \frac{\sin x}{x}\right) }{\frac{x-\sin x}{\sin x}}=\frac{\ln \left( 1+\left[ \frac{\sin x}{x}-1\right] \right) }{\frac{x-\sin x}{x}\times \frac{x}{\sin x}% }=-\frac{\ln \lef...
Let $y=\dfrac{\sin x}{x},$ then $x\to 0\iff y\to 1.$ $$\lim\limits\_{x\to 0}\left(\dfrac{\sin x}{x}\right)^{\dfrac{\sin x}{x-\sin x}} =\lim\_{y\to1}y^{\left(\dfrac{y}{1-y}\right)}$$ continue from here.
1,312,894
So, we have to find $\lim\limits\_{x\to 0}(\frac{\sin(x)}{x})^{\frac{\sin(x)}{x-\sin(x)}}$ with and without L'Hopital's Rule. **My Work**: Let $\lim\limits\_{x\to 0}(\frac{\sin(x)}{x})^{\frac{\sin(x)}{x-\sin(x)}}=L$ Taking $\ln$ of both sides and bringing the exponent down. $\lim\limits\_{x\to 0}{\frac{\sin(x)}{x...
2015/06/05
[ "https://math.stackexchange.com/questions/1312894", "https://math.stackexchange.com", "https://math.stackexchange.com/users/217555/" ]
$$ \begin{align} \log\left(\left(\frac{\sin(x)}{x}\right)^{\frac{\large\sin(x)}{\large x-\sin(x)}}\right) &=\frac{\sin(x)}{x-\sin(x)}\log\left(\frac{\sin(x)}{x}\right)\\ &=\frac{\sin(x)}x\frac1{\color{#C00000}{1-\frac{\sin(x)}x}}\log\left(1-\left(\color{#C00000}{1-\frac{\sin(x)}x}\right)\right) \end{align} $$ Since $\l...
Change variable: $\frac{sinx}{x} = u$. Then $u\to 1$ when $x\to 0 $. Then $$ln(L) = \lim\_{u\to 1} \frac{ln(u)}{1/u - 1}$$ It will be then much easier to work with/without L'Hospital rule
1,312,894
So, we have to find $\lim\limits\_{x\to 0}(\frac{\sin(x)}{x})^{\frac{\sin(x)}{x-\sin(x)}}$ with and without L'Hopital's Rule. **My Work**: Let $\lim\limits\_{x\to 0}(\frac{\sin(x)}{x})^{\frac{\sin(x)}{x-\sin(x)}}=L$ Taking $\ln$ of both sides and bringing the exponent down. $\lim\limits\_{x\to 0}{\frac{\sin(x)}{x...
2015/06/05
[ "https://math.stackexchange.com/questions/1312894", "https://math.stackexchange.com", "https://math.stackexchange.com/users/217555/" ]
$$ \begin{align} \log\left(\left(\frac{\sin(x)}{x}\right)^{\frac{\large\sin(x)}{\large x-\sin(x)}}\right) &=\frac{\sin(x)}{x-\sin(x)}\log\left(\frac{\sin(x)}{x}\right)\\ &=\frac{\sin(x)}x\frac1{\color{#C00000}{1-\frac{\sin(x)}x}}\log\left(1-\left(\color{#C00000}{1-\frac{\sin(x)}x}\right)\right) \end{align} $$ Since $\l...
Let $y=\dfrac{\sin x}{x},$ then $x\to 0\iff y\to 1.$ $$\lim\limits\_{x\to 0}\left(\dfrac{\sin x}{x}\right)^{\dfrac{\sin x}{x-\sin x}} =\lim\_{y\to1}y^{\left(\dfrac{y}{1-y}\right)}$$ continue from here.
9,808,213
I'm develop my first Android Application. I tried every snipped of code i found in this page and others. Well, my problem is a need log in an user using an Internet Service, so i use an AsyncTask class, but when i tried to add an ProgressDialog into the background method, this dialog show only a second later that the b...
2012/03/21
[ "https://Stackoverflow.com/questions/9808213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/984825/" ]
The root point that makes your UI thread block is: ``` new ObtenerDatos().execute(credenciales,null,null).get(); ``` By calling AsyncTask.get(), you are actually making you UI thread block and wait for worker thread (AKA. AsyncTask.doInBackground()) to finish. in another word, by doing that, your AsyncTask is runnin...
--> protected ProgressDialog progressDialog; Write this line at class level..
9,808,213
I'm develop my first Android Application. I tried every snipped of code i found in this page and others. Well, my problem is a need log in an user using an Internet Service, so i use an AsyncTask class, but when i tried to add an ProgressDialog into the background method, this dialog show only a second later that the b...
2012/03/21
[ "https://Stackoverflow.com/questions/9808213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/984825/" ]
The root point that makes your UI thread block is: ``` new ObtenerDatos().execute(credenciales,null,null).get(); ``` By calling AsyncTask.get(), you are actually making you UI thread block and wait for worker thread (AKA. AsyncTask.doInBackground()) to finish. in another word, by doing that, your AsyncTask is runnin...
I would recommend something like this... ``` public class PanelAdministracion extends Activity { private ProgressDialog mProgressDialog; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.paneladministracion); try { Bundle datos...
51,214,655
I think a Guid is generally the preferred unique table row identifier from a dba perspective. But I'm working on a project where the developers and managers appear to want a way to reference things by an int value. I can understand their perspective b/c they want a simple and easy way to reference different entities. ...
2018/07/06
[ "https://Stackoverflow.com/questions/51214655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9393635/" ]
There is two ways to achieve this. One is using the `Config` option, as mentioned by @Aldarund. You can read about it [here](https://vue-test-utils.vuejs.org/api/#config). If you are using Jest, I recommend doing this in the `jest.init.js` file: ``` import { config } from '@vue/test-utils' config.mocks['$apiUrls'] =...
You can do it with [vue-test-utils beta 15](https://github.com/vuejs/vue-test-utils/issues/325#issuecomment-383098083) and later. Here [docs](https://vue-test-utils.vuejs.org/api/config.html#mocks) And some example would be: ``` import VueTestUtils from '@vue/test-utils' VueTestUtils.config.mocks['$apiUrls'] = { ...
51,214,655
I think a Guid is generally the preferred unique table row identifier from a dba perspective. But I'm working on a project where the developers and managers appear to want a way to reference things by an int value. I can understand their perspective b/c they want a simple and easy way to reference different entities. ...
2018/07/06
[ "https://Stackoverflow.com/questions/51214655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9393635/" ]
There is two ways to achieve this. One is using the `Config` option, as mentioned by @Aldarund. You can read about it [here](https://vue-test-utils.vuejs.org/api/#config). If you are using Jest, I recommend doing this in the `jest.init.js` file: ``` import { config } from '@vue/test-utils' config.mocks['$apiUrls'] =...
I don't think the answers above work anymore (in 2020). Here's what worked for me: For vue-test-utils 1.x.x (Vue 2) -------------------------------- 1. Create a new file, name it eg. `jest.init.js` 2. Give it the following content: ```js import { config } from "@vue/test-utils"; config.mocks["yourGlobalProperty"] =...
52,664,523
I have delegated user permission `User.ReadBasic.All`. In the [documentation](https://developer.microsoft.com/en-us/graph/docs/concepts/permissions_reference#user-permissions), it states this > > "Allows the app to read a basic set of profile properties of other users in your organization on behalf of the signed-in u...
2018/10/05
[ "https://Stackoverflow.com/questions/52664523", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4689622/" ]
You can hit the Graph API `users/<email_id>` endpoint (`https://graph.microsoft.com/v1.0/users/<email_id_of_the_user>`) with the proper Bearer token for getting the basic details of other users. You can try that out in the Graph Explorer as well - <https://developer.microsoft.com/en-us/graph/graph-explorer#> [![ente...
It is the same regardless of whether you use `User.ReadBasic.All` or `User.Read.All`: ` ``` await graphServiceClient .Users .Request() .GetAsync(); ``` The only difference between the two will be in the result set. Properties that are inaccessible using `User.ReadBasic.All` will simply not be returned in...
52,664,523
I have delegated user permission `User.ReadBasic.All`. In the [documentation](https://developer.microsoft.com/en-us/graph/docs/concepts/permissions_reference#user-permissions), it states this > > "Allows the app to read a basic set of profile properties of other users in your organization on behalf of the signed-in u...
2018/10/05
[ "https://Stackoverflow.com/questions/52664523", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4689622/" ]
You can hit the Graph API `users/<email_id>` endpoint (`https://graph.microsoft.com/v1.0/users/<email_id_of_the_user>`) with the proper Bearer token for getting the basic details of other users. You can try that out in the Graph Explorer as well - <https://developer.microsoft.com/en-us/graph/graph-explorer#> [![ente...
I got solution and get users basic profile of my organization. Solution: Get Access token using AcquireTokenSilentAsync method. [More Details](https://stackoverflow.com/questions/46566717/net-core-2-0-get-aad-access-token-to-use-with-microsoft-graph) ``` options.Scope.Add("User.ReadBasic.All"); options.ResponseType ...
52,664,523
I have delegated user permission `User.ReadBasic.All`. In the [documentation](https://developer.microsoft.com/en-us/graph/docs/concepts/permissions_reference#user-permissions), it states this > > "Allows the app to read a basic set of profile properties of other users in your organization on behalf of the signed-in u...
2018/10/05
[ "https://Stackoverflow.com/questions/52664523", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4689622/" ]
Here you are really getting a token from the cache (using `AcquireTokenSilentAsync`), whereas your token was really added in the cache when you have redeemed the authorization code produced by ASP.NET using the call to `AcquireTokenByAuthorizationCodeAsync`. you will find the explanation in ADAL.NET conceptual document...
It is the same regardless of whether you use `User.ReadBasic.All` or `User.Read.All`: ` ``` await graphServiceClient .Users .Request() .GetAsync(); ``` The only difference between the two will be in the result set. Properties that are inaccessible using `User.ReadBasic.All` will simply not be returned in...
52,664,523
I have delegated user permission `User.ReadBasic.All`. In the [documentation](https://developer.microsoft.com/en-us/graph/docs/concepts/permissions_reference#user-permissions), it states this > > "Allows the app to read a basic set of profile properties of other users in your organization on behalf of the signed-in u...
2018/10/05
[ "https://Stackoverflow.com/questions/52664523", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4689622/" ]
Here you are really getting a token from the cache (using `AcquireTokenSilentAsync`), whereas your token was really added in the cache when you have redeemed the authorization code produced by ASP.NET using the call to `AcquireTokenByAuthorizationCodeAsync`. you will find the explanation in ADAL.NET conceptual document...
I got solution and get users basic profile of my organization. Solution: Get Access token using AcquireTokenSilentAsync method. [More Details](https://stackoverflow.com/questions/46566717/net-core-2-0-get-aad-access-token-to-use-with-microsoft-graph) ``` options.Scope.Add("User.ReadBasic.All"); options.ResponseType ...
19,154,170
I have `Dictionary(Of List(Of Object), Integer)` and need to get my dictionary grouped by keys. For example: ``` Dictionary (0) = Key: {List(12, "SomeString", 3)} Value: 54 Dictionary (1) = Key: {List(8, "SomeAnotherString", 3)} Value: 6 Dictionary (2) = Key: {List(12, "SomeString", 3)} Value: 15 ``` How can I g...
2013/10/03
[ "https://Stackoverflow.com/questions/19154170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2706173/" ]
AsyncTask.execute() is a non-blocking call. You can't set the result to the Bundle and start an Intent immediatly after execute(). That's why you are getting a NPE in your second Activity because `sending` isn't initialized, so it's null. Move the code to start a new Activity with the desired data in your callback: `...
As your variable `t` is globally declared in your activity so can directly use the value of `t` which you are assigning in your `onPostExecute()` method. Just you need to check for its null value only in your button click event as below : > > > ``` > b.setOnClickListener(new OnClickListener() { > @Overrid...
19,154,170
I have `Dictionary(Of List(Of Object), Integer)` and need to get my dictionary grouped by keys. For example: ``` Dictionary (0) = Key: {List(12, "SomeString", 3)} Value: 54 Dictionary (1) = Key: {List(8, "SomeAnotherString", 3)} Value: 6 Dictionary (2) = Key: {List(12, "SomeString", 3)} Value: 15 ``` How can I g...
2013/10/03
[ "https://Stackoverflow.com/questions/19154170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2706173/" ]
AsyncTask.execute() is a non-blocking call. You can't set the result to the Bundle and start an Intent immediatly after execute(). That's why you are getting a NPE in your second Activity because `sending` isn't initialized, so it's null. Move the code to start a new Activity with the desired data in your callback: `...
``` // try this public class MainActivity extends Activity { public String t; public Bundle bnd; public Intent intent; private static final String TAG = "MyActivity"; ProductConnect asyncTask; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanc...
19,154,170
I have `Dictionary(Of List(Of Object), Integer)` and need to get my dictionary grouped by keys. For example: ``` Dictionary (0) = Key: {List(12, "SomeString", 3)} Value: 54 Dictionary (1) = Key: {List(8, "SomeAnotherString", 3)} Value: 6 Dictionary (2) = Key: {List(12, "SomeString", 3)} Value: 15 ``` How can I g...
2013/10/03
[ "https://Stackoverflow.com/questions/19154170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2706173/" ]
AsyncTask.execute() is a non-blocking call. You can't set the result to the Bundle and start an Intent immediatly after execute(). That's why you are getting a NPE in your second Activity because `sending` isn't initialized, so it's null. Move the code to start a new Activity with the desired data in your callback: `...
Shortly before someone posted a solution and it works without any errors but it was deleted. This solution is by this way: ``` public void onClick(View arg0) { asyncTask.execute(true); } }); } ``` Then OnPostExecute changed like this: ``` protected void onPostExecute(String result) { ...
34,014
I am very new in security testing. It will be very helpful if any one can suggest open-source/free tools that can run Scans for security issues (E.G SQL Injection) on REST APIs which use JSON requests. Some services also use OAUTH. Thanks
2016/06/20
[ "https://softwarerecs.stackexchange.com/questions/34014", "https://softwarerecs.stackexchange.com", "https://softwarerecs.stackexchange.com/users/24535/" ]
For VBScript or ASP Classic, or for modeling VBA (Visual Basic for Applications) such as macros used in Microsoft Excel (but without specific Excel libraries), there is: <http://VBFiddle.net> I developed this website/script a few weeks ago specifically as a Thank you! to all of the contributors of Stack Exchange, Sta...
Desktop editors like Context and Notepad++ provide syntax highlighters for Classic ASP. Microsoft Visual InterDev provides intellisense and code completion. It was part of Visual Studio 6. Unfortunately, current MSDN subscription provide access to VB6 but not Interdev. However old MSDN subscribers may have already obta...
335,097
I'm a first timer here. In a normal liquid-vapor P-V biphasic curve at a temperature below critical temperature, we can compress a vapor at a constant temperature till it becomes saturated, or is just about to turn into a liquid. Any further compression would lead to the existence of the two phases together, as we know...
2017/05/24
[ "https://physics.stackexchange.com/questions/335097", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/157112/" ]
This answer is meant to add to [Luke's excellent concise answer](https://physics.stackexchange.com/a/335094/26076), so please read his answer first. In quantum mechanics, only measurements have the statistical distributions, the "uncertainties" and all the things that are (validly) bothering you. As you point out, thi...
There is no full consensus about what relativistic means, but as a good start, we can take the criterion given by Tim Maudlin in his paper "Space-Time in the Quantum World": > > [A] theory is compatible with Relativity if it can be formulated without ascribing to space-time any more of different intrinsic structure t...
335,097
I'm a first timer here. In a normal liquid-vapor P-V biphasic curve at a temperature below critical temperature, we can compress a vapor at a constant temperature till it becomes saturated, or is just about to turn into a liquid. Any further compression would lead to the existence of the two phases together, as we know...
2017/05/24
[ "https://physics.stackexchange.com/questions/335097", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/157112/" ]
There is no full consensus about what relativistic means, but as a good start, we can take the criterion given by Tim Maudlin in his paper "Space-Time in the Quantum World": > > [A] theory is compatible with Relativity if it can be formulated without ascribing to space-time any more of different intrinsic structure t...
> > How exactly did Dirac incorporate SR into his wave equation? > > > Relativity treats space and time on equal footing. Lorentz transformations ("boosts") "mix" space and time more or less analogously to the way a 3-dimensional rotations "mixes" the usual $(x,y,z)$ coordinates of space. The Schrödinger equation...
335,097
I'm a first timer here. In a normal liquid-vapor P-V biphasic curve at a temperature below critical temperature, we can compress a vapor at a constant temperature till it becomes saturated, or is just about to turn into a liquid. Any further compression would lead to the existence of the two phases together, as we know...
2017/05/24
[ "https://physics.stackexchange.com/questions/335097", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/157112/" ]
There is no full consensus about what relativistic means, but as a good start, we can take the criterion given by Tim Maudlin in his paper "Space-Time in the Quantum World": > > [A] theory is compatible with Relativity if it can be formulated without ascribing to space-time any more of different intrinsic structure t...
To put it concretely: In my course on QED, I can remember two conditions which were imposed due to relativity. * The fields transform via a Lorentz transformation, and the Lagrangian should not change form under this Lorentz transformation. * Since measurements cannot affect each other at spacelike separation, the com...
335,097
I'm a first timer here. In a normal liquid-vapor P-V biphasic curve at a temperature below critical temperature, we can compress a vapor at a constant temperature till it becomes saturated, or is just about to turn into a liquid. Any further compression would lead to the existence of the two phases together, as we know...
2017/05/24
[ "https://physics.stackexchange.com/questions/335097", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/157112/" ]
This answer is meant to add to [Luke's excellent concise answer](https://physics.stackexchange.com/a/335094/26076), so please read his answer first. In quantum mechanics, only measurements have the statistical distributions, the "uncertainties" and all the things that are (validly) bothering you. As you point out, thi...
> > How exactly did Dirac incorporate SR into his wave equation? > > > Relativity treats space and time on equal footing. Lorentz transformations ("boosts") "mix" space and time more or less analogously to the way a 3-dimensional rotations "mixes" the usual $(x,y,z)$ coordinates of space. The Schrödinger equation...
335,097
I'm a first timer here. In a normal liquid-vapor P-V biphasic curve at a temperature below critical temperature, we can compress a vapor at a constant temperature till it becomes saturated, or is just about to turn into a liquid. Any further compression would lead to the existence of the two phases together, as we know...
2017/05/24
[ "https://physics.stackexchange.com/questions/335097", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/157112/" ]
This answer is meant to add to [Luke's excellent concise answer](https://physics.stackexchange.com/a/335094/26076), so please read his answer first. In quantum mechanics, only measurements have the statistical distributions, the "uncertainties" and all the things that are (validly) bothering you. As you point out, thi...
To put it concretely: In my course on QED, I can remember two conditions which were imposed due to relativity. * The fields transform via a Lorentz transformation, and the Lagrangian should not change form under this Lorentz transformation. * Since measurements cannot affect each other at spacelike separation, the com...
335,097
I'm a first timer here. In a normal liquid-vapor P-V biphasic curve at a temperature below critical temperature, we can compress a vapor at a constant temperature till it becomes saturated, or is just about to turn into a liquid. Any further compression would lead to the existence of the two phases together, as we know...
2017/05/24
[ "https://physics.stackexchange.com/questions/335097", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/157112/" ]
> > How exactly did Dirac incorporate SR into his wave equation? > > > Relativity treats space and time on equal footing. Lorentz transformations ("boosts") "mix" space and time more or less analogously to the way a 3-dimensional rotations "mixes" the usual $(x,y,z)$ coordinates of space. The Schrödinger equation...
To put it concretely: In my course on QED, I can remember two conditions which were imposed due to relativity. * The fields transform via a Lorentz transformation, and the Lagrangian should not change form under this Lorentz transformation. * Since measurements cannot affect each other at spacelike separation, the com...
50,354,526
I'm pretty new to coding and always used "classname instancename=new classname()" to create instances but today I've found the following code which doesn't follow and won't work with this syntax. My question is what happens in the 5th line. Thank you very much. ``` private void _InsertIntoBinarySearchTree(ref Element<...
2018/05/15
[ "https://Stackoverflow.com/questions/50354526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9630194/" ]
First, you can't use a type specifier for the variable `p` since you're not declaring a new variable `p`, you're *assigning* a value to an existing variable. See also: ``` int myVal; myVal = 5; ``` Second, well, you're assigning to the variable `p`. Thus, it'll override whatever was in there before with the new valu...
You'll notice the class of the p variable is `Element<K>` from the method signature on line one. Ignoring for the moment that it's passed by ref, it's the similar to the following code. ``` Element<K> p = new Element<K>(); ``` Element is a generic class of type K. K is the type of object that is being sorted. It's g...
50,354,526
I'm pretty new to coding and always used "classname instancename=new classname()" to create instances but today I've found the following code which doesn't follow and won't work with this syntax. My question is what happens in the 5th line. Thank you very much. ``` private void _InsertIntoBinarySearchTree(ref Element<...
2018/05/15
[ "https://Stackoverflow.com/questions/50354526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9630194/" ]
`p` if by `ref` in the method so whatever you do it is affected outside of it; meaning when you assign it with `new` the caller of the method's parameter of `p` is also reassigned. You're stating it's an `Element<K>` type in the parameter so `p` must conform to that type. In the method, the line in question, you rea...
You'll notice the class of the p variable is `Element<K>` from the method signature on line one. Ignoring for the moment that it's passed by ref, it's the similar to the following code. ``` Element<K> p = new Element<K>(); ``` Element is a generic class of type K. K is the type of object that is being sorted. It's g...
37,351,052
I have an EditText with the ImeOptions set to EditorInfo.IME\_ACTION\_NEXT. So the "Next" button is displayed on the keyboard when the field is focused. I want the button to change for "Done" WHILE the user is typing (for some reasons). So I have a TextWatcher and I try to change the ImeOptions to EditorInfo.IME\_ACTI...
2016/05/20
[ "https://Stackoverflow.com/questions/37351052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1827254/" ]
I tried this and it works, the problem is that you can sometime see when the keyboard appears and disappears. ``` @Override public void afterTextChanged(Editable s) { if (/*condition*/) { // Change the IME of the current focused EditText editText.setImeOptions(EditorInfo.IME_ACTION_DONE); ...
You can try something like that: ``` if (your condition) { youreditText.setImeOptions(EditorInfo.IME_ACTION_DONE); hideKeyboard(activity); InputMethodManager input= (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE); input.restartInput(youreditText); showKeyboard(youract...
37,351,052
I have an EditText with the ImeOptions set to EditorInfo.IME\_ACTION\_NEXT. So the "Next" button is displayed on the keyboard when the field is focused. I want the button to change for "Done" WHILE the user is typing (for some reasons). So I have a TextWatcher and I try to change the ImeOptions to EditorInfo.IME\_ACTI...
2016/05/20
[ "https://Stackoverflow.com/questions/37351052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1827254/" ]
I tried this and it works, the problem is that you can sometime see when the keyboard appears and disappears. ``` @Override public void afterTextChanged(Editable s) { if (/*condition*/) { // Change the IME of the current focused EditText editText.setImeOptions(EditorInfo.IME_ACTION_DONE); ...
From the answers above: ``` // Restart the input on the current focused EditText InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE); imm.restartInput(editText); ``` Only restarting the input does the trick. Otherwise, presumeably keyboard flickering is to be expecte...
18,667,828
So, I use my own .NET Process to start up a command line process like so: `ProcessStartInfo startInfo = new ProcessStartInfo();` ``` Process p = new Process(); startInfo.CreateNoWindow = true; startInfo.RedirectStandardOutput = redirectOutput; startInfo.RedirectStandardError = redirect...
2013/09/06
[ "https://Stackoverflow.com/questions/18667828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/476298/" ]
Finally found the answer through much perseverance and google foo! Here is a link to the stackoverflow answer: <https://stackoverflow.com/a/15281070/476298> And here is the website that pointed me in that direction: <http://stanislavs.org/stopping-command-line-applications-programatically-with-ctrl-c-events-from-ne...
This [link](http://msdn.microsoft.com/en-us/library/system.diagnostics.process.getcurrentprocess.aspx) is very useful ``` // Get the current process. Process currentProcess = Process.GetCurrentProcess(); // Get all instances of Notepad running on the local ...
18,667,828
So, I use my own .NET Process to start up a command line process like so: `ProcessStartInfo startInfo = new ProcessStartInfo();` ``` Process p = new Process(); startInfo.CreateNoWindow = true; startInfo.RedirectStandardOutput = redirectOutput; startInfo.RedirectStandardError = redirect...
2013/09/06
[ "https://Stackoverflow.com/questions/18667828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/476298/" ]
if you can run a CMD process, and you know your processes PIDs, why don't you simply use `TASKKILL /PID 1234` ? What I didn't get here is where you're getting the PID from.
This [link](http://msdn.microsoft.com/en-us/library/system.diagnostics.process.getcurrentprocess.aspx) is very useful ``` // Get the current process. Process currentProcess = Process.GetCurrentProcess(); // Get all instances of Notepad running on the local ...
18,667,828
So, I use my own .NET Process to start up a command line process like so: `ProcessStartInfo startInfo = new ProcessStartInfo();` ``` Process p = new Process(); startInfo.CreateNoWindow = true; startInfo.RedirectStandardOutput = redirectOutput; startInfo.RedirectStandardError = redirect...
2013/09/06
[ "https://Stackoverflow.com/questions/18667828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/476298/" ]
Finally found the answer through much perseverance and google foo! Here is a link to the stackoverflow answer: <https://stackoverflow.com/a/15281070/476298> And here is the website that pointed me in that direction: <http://stanislavs.org/stopping-command-line-applications-programatically-with-ctrl-c-events-from-ne...
Use [GetProcessesByName()](http://msdn.microsoft.com/en-us/library/system.diagnostics.process.getprocessesbyname.aspx) and look for the "python.exe" or "pythonw.exe" process.
18,667,828
So, I use my own .NET Process to start up a command line process like so: `ProcessStartInfo startInfo = new ProcessStartInfo();` ``` Process p = new Process(); startInfo.CreateNoWindow = true; startInfo.RedirectStandardOutput = redirectOutput; startInfo.RedirectStandardError = redirect...
2013/09/06
[ "https://Stackoverflow.com/questions/18667828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/476298/" ]
if you can run a CMD process, and you know your processes PIDs, why don't you simply use `TASKKILL /PID 1234` ? What I didn't get here is where you're getting the PID from.
Use [GetProcessesByName()](http://msdn.microsoft.com/en-us/library/system.diagnostics.process.getprocessesbyname.aspx) and look for the "python.exe" or "pythonw.exe" process.
18,667,828
So, I use my own .NET Process to start up a command line process like so: `ProcessStartInfo startInfo = new ProcessStartInfo();` ``` Process p = new Process(); startInfo.CreateNoWindow = true; startInfo.RedirectStandardOutput = redirectOutput; startInfo.RedirectStandardError = redirect...
2013/09/06
[ "https://Stackoverflow.com/questions/18667828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/476298/" ]
Finally found the answer through much perseverance and google foo! Here is a link to the stackoverflow answer: <https://stackoverflow.com/a/15281070/476298> And here is the website that pointed me in that direction: <http://stanislavs.org/stopping-command-line-applications-programatically-with-ctrl-c-events-from-ne...
if you can run a CMD process, and you know your processes PIDs, why don't you simply use `TASKKILL /PID 1234` ? What I didn't get here is where you're getting the PID from.
2,858,785
I try to delete a list of rows from a table using this Native Query: ``` @NamedNativeQuery(name="WebGroup.DeleteIn", query="DELETE FROM WebGroup WHERE WebGroup.GROUP_ID IN (:IDsList)" getEm().createNamedQuery("WebGroup.DeleteIn") .setParameter("IDsList", groupToDeleteIDs) .executeUpdate();...
2010/05/18
[ "https://Stackoverflow.com/questions/2858785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/329680/" ]
What if you add a `delay()` to the fadeout? For example 1-2 seconds. That way you can move your mouse away and back onto the dropdown without causing any animations. <http://api.jquery.com/delay/>
The best way I've found to deal with such issues is to use the [HoverIntent](http://cherne.net/brian/resources/jquery.hoverIntent.html) plug-in. It was designed to prevent the flicker problems you're having.
2,858,785
I try to delete a list of rows from a table using this Native Query: ``` @NamedNativeQuery(name="WebGroup.DeleteIn", query="DELETE FROM WebGroup WHERE WebGroup.GROUP_ID IN (:IDsList)" getEm().createNamedQuery("WebGroup.DeleteIn") .setParameter("IDsList", groupToDeleteIDs) .executeUpdate();...
2010/05/18
[ "https://Stackoverflow.com/questions/2858785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/329680/" ]
The best way I've found to deal with such issues is to use the [HoverIntent](http://cherne.net/brian/resources/jquery.hoverIntent.html) plug-in. It was designed to prevent the flicker problems you're having.
I don't seem to be getting the flickering you mentioned, but then again - I did create the markup because yours wasn't available. ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script lang...
2,858,785
I try to delete a list of rows from a table using this Native Query: ``` @NamedNativeQuery(name="WebGroup.DeleteIn", query="DELETE FROM WebGroup WHERE WebGroup.GROUP_ID IN (:IDsList)" getEm().createNamedQuery("WebGroup.DeleteIn") .setParameter("IDsList", groupToDeleteIDs) .executeUpdate();...
2010/05/18
[ "https://Stackoverflow.com/questions/2858785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/329680/" ]
What if you add a `delay()` to the fadeout? For example 1-2 seconds. That way you can move your mouse away and back onto the dropdown without causing any animations. <http://api.jquery.com/delay/>
I don't seem to be getting the flickering you mentioned, but then again - I did create the markup because yours wasn't available. ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script lang...
2,858,785
I try to delete a list of rows from a table using this Native Query: ``` @NamedNativeQuery(name="WebGroup.DeleteIn", query="DELETE FROM WebGroup WHERE WebGroup.GROUP_ID IN (:IDsList)" getEm().createNamedQuery("WebGroup.DeleteIn") .setParameter("IDsList", groupToDeleteIDs) .executeUpdate();...
2010/05/18
[ "https://Stackoverflow.com/questions/2858785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/329680/" ]
What if you add a `delay()` to the fadeout? For example 1-2 seconds. That way you can move your mouse away and back onto the dropdown without causing any animations. <http://api.jquery.com/delay/>
use: overflow: hidden;
2,858,785
I try to delete a list of rows from a table using this Native Query: ``` @NamedNativeQuery(name="WebGroup.DeleteIn", query="DELETE FROM WebGroup WHERE WebGroup.GROUP_ID IN (:IDsList)" getEm().createNamedQuery("WebGroup.DeleteIn") .setParameter("IDsList", groupToDeleteIDs) .executeUpdate();...
2010/05/18
[ "https://Stackoverflow.com/questions/2858785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/329680/" ]
use: overflow: hidden;
I don't seem to be getting the flickering you mentioned, but then again - I did create the markup because yours wasn't available. ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script lang...
33,416,987
I'm trying to create a simple "english to leet" converter but I have no idea what method to use in order to convert the string to leet. And for some reason I can't use equalsIgnoreCase when I have the strings english[] and leet[] ``` public static void main(String[] args) { String english[] = {"A", "B", "C",...
2015/10/29
[ "https://Stackoverflow.com/questions/33416987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5502697/" ]
Since array english just lists "A" to "Z" in order, you do even need to loop through the english array, just do: ``` Scanner sc = new Scanner(System.in); String Str = sc.nextLine().toUpperCase(); // convert all to upper case so that you don't need equalsIgnoreCase() for (int i = 0; i < Str.length(); ++i) { ...
It requires two for loops, and you should use a character array instead of a String array for better practice. Here is the solution: ``` char english[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}; char leet[] = {'4', '8', '(', ')...
41,867,139
In JQGrid table, one of the cells has a link in it, when clicked, it should execute a javascript. ``` {name : 'localAccountNo' , jsonmap : 'localAccountNo', label : 'Customer <br>Number', width:50, frozen:true, formatter : localAccountNumberCellFormatter} ``` JQGrid localAccountNumber cell formatter code ``` functi...
2017/01/26
[ "https://Stackoverflow.com/questions/41867139", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3833423/" ]
Custom formatter should be correct HTML fragment. Thus you have to encode the `rowObject` as string (using `JSON.stringify`, for example) and escape the quotes of the string inside of the custom formatter. The method `selectCustomer` will have to convert the string parameter back to object (using `JSON.parse`) before b...
You can use `JSON.stringify` to pass the object ``` return '<a onclick="selectCustomer('+ JSON.stringify(rowObject) +')">'+ cellvalue +'</a>'; ```
41,867,139
In JQGrid table, one of the cells has a link in it, when clicked, it should execute a javascript. ``` {name : 'localAccountNo' , jsonmap : 'localAccountNo', label : 'Customer <br>Number', width:50, frozen:true, formatter : localAccountNumberCellFormatter} ``` JQGrid localAccountNumber cell formatter code ``` functi...
2017/01/26
[ "https://Stackoverflow.com/questions/41867139", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3833423/" ]
Custom formatter should be correct HTML fragment. Thus you have to encode the `rowObject` as string (using `JSON.stringify`, for example) and escape the quotes of the string inside of the custom formatter. The method `selectCustomer` will have to convert the string parameter back to object (using `JSON.parse`) before b...
If you don't have to support IE, you could use template strings: ``` function localAccountNumberCellFormatter(cellvalue, options, rowObject) { return `<a onclick="selectCustomer(${rowObject})">${cellvalue}</a>`; } ```
36,449,912
I'm asking about **Suricata** Is there way to write a conditional alert? For example - alert of HTTP GET if the server status to the request is "success" Thanks, Efrat
2016/04/06
[ "https://Stackoverflow.com/questions/36449912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4218371/" ]
Can't comment so I'll answer here. Try it in an Emulator. You can't access those folders on a device unless it is rooted. You can use the `adb pull` shell command to copy the db file onto your local machine. <http://adbshell.com/commands/adb-pull>
First of all, you cannot see inside of `/data/data/` as it is not browsable unless you have root permission. But, you can access it by code. the `mnt`, abbreviation of `mount`, is appeared as the Android Studio gives right to browse the path including your db file for development purpose. Check out below code to copy...
36,449,912
I'm asking about **Suricata** Is there way to write a conditional alert? For example - alert of HTTP GET if the server status to the request is "success" Thanks, Efrat
2016/04/06
[ "https://Stackoverflow.com/questions/36449912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4218371/" ]
Stetho from Facebook allows you to view the on device database (as well as other things) using Chrome developer tools. It's very easy to set up and use. <http://facebook.github.io/stetho/>
First of all, you cannot see inside of `/data/data/` as it is not browsable unless you have root permission. But, you can access it by code. the `mnt`, abbreviation of `mount`, is appeared as the Android Studio gives right to browse the path including your db file for development purpose. Check out below code to copy...
4,251,092
> > For the differential equation $\displaystyle a\frac{d^2x}{dt^2}+5\frac{dx}{dt}+5x=0,$ where $a>0$ > > > > > Represent supercritical damping, Then range of $a$ as > > > What i try :: Here we have campare with $\displaystyle A\frac{dx^2}{dt^2}+b\frac{dx}{dt}+C=0$ Then $A=a,B=5,C=5$ So here $D=B^2-4AC=25-5...
2021/09/15
[ "https://math.stackexchange.com/questions/4251092", "https://math.stackexchange.com", "https://math.stackexchange.com/users/14096/" ]
There is a theorem that says that an integer $d$ is the "greatest common divisor" of two integers $a,b$ if and only if: * $d$ is a divisor of both $a$ and $b$, i.e. $a=ud, b=vd$ for some integers $u, v$, and * $d$ is a "linear combination" of $a$ and $b$, i.e. $d=xa+yb$ for some integers $x,y$. So, knowing that $d=\g...
The key idea that is missing is that the gcd is the *least* positive number that can be written as a linear combination of the two. So $d=ax+by$ for some integers $x,y$ and $d$ is the smallest number that can be written that way. Then you also know that gcd$(ma,mb)$ can be written as $ma(i)+mb(j)$ for some $i,j$ and i...
4,251,092
> > For the differential equation $\displaystyle a\frac{d^2x}{dt^2}+5\frac{dx}{dt}+5x=0,$ where $a>0$ > > > > > Represent supercritical damping, Then range of $a$ as > > > What i try :: Here we have campare with $\displaystyle A\frac{dx^2}{dt^2}+b\frac{dx}{dt}+C=0$ Then $A=a,B=5,C=5$ So here $D=B^2-4AC=25-5...
2021/09/15
[ "https://math.stackexchange.com/questions/4251092", "https://math.stackexchange.com", "https://math.stackexchange.com/users/14096/" ]
There is a theorem that says that an integer $d$ is the "greatest common divisor" of two integers $a,b$ if and only if: * $d$ is a divisor of both $a$ and $b$, i.e. $a=ud, b=vd$ for some integers $u, v$, and * $d$ is a "linear combination" of $a$ and $b$, i.e. $d=xa+yb$ for some integers $x,y$. So, knowing that $d=\g...
Hint: Instead of Bezout's, use the Euclidean algorithm on $(a,b)$ and on $(ma,mb)$ in parallel. (This necessarily has to be done somewhat abstractly, possibly with a smidge of induction.)
16,600,349
Normally an error while doing something on the UI thread from another thread I thought, but I don't get what I'm doing wrong. The error seems only to appear when the phone is travelling, so with a changing GPS location. I want the most recent location to be stored, so nothing on the UI. I have the following method cal...
2013/05/17
[ "https://Stackoverflow.com/questions/16600349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1062575/" ]
In this case, I think what you need is a looper thread, [this](https://stackoverflow.com/questions/6277953/how-to-manage-loopers-and-threads-thread-doesnt-die-anymore) may help you. Or you may create a handler inside your run() method make it a looper thread as the following example. ``` Handler mHandler; public vo...
``` runOnUiThread(new Runnable() { @Override public void run() { // TODO Auto-generated method stub alert("Error: " + message); } }); ``` You can use simply runOnUiThread to fix this issue. Thanks!!
25,809,038
After I issue a mpirun command, I want to get the pid of this process, so that I can kill this process later. How to do this without having to add '&' at the end of the mpirun command to send it to background? Other condition is that there could be more than one mpirun processes running on the machine.
2014/09/12
[ "https://Stackoverflow.com/questions/25809038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1803121/" ]
With Open MPI one could instruct `mpirun` to output its own PID by giving it the `--report-pid` option: * `--report-pid -` outputs the PID to the standard output; * `--report-pid +` outputs the PID to the standard error; * `--report-pid /path/to/filename` writes the PID into `filename`. To get the PIDs of all your ru...
You can use 'ps' to get pid ``` ps -A | grep process-name ```
25,809,038
After I issue a mpirun command, I want to get the pid of this process, so that I can kill this process later. How to do this without having to add '&' at the end of the mpirun command to send it to background? Other condition is that there could be more than one mpirun processes running on the machine.
2014/09/12
[ "https://Stackoverflow.com/questions/25809038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1803121/" ]
With Open MPI one could instruct `mpirun` to output its own PID by giving it the `--report-pid` option: * `--report-pid -` outputs the PID to the standard output; * `--report-pid +` outputs the PID to the standard error; * `--report-pid /path/to/filename` writes the PID into `filename`. To get the PIDs of all your ru...
``` ps aux | grep application_name ``` This syntax works great on Ubuntu, but I don't know if it works well for the other distributions. It returns (at least) two different rows: one containing the pid of your current search process and the other containing the pid of the process you are searching for. The program PI...
25,809,038
After I issue a mpirun command, I want to get the pid of this process, so that I can kill this process later. How to do this without having to add '&' at the end of the mpirun command to send it to background? Other condition is that there could be more than one mpirun processes running on the machine.
2014/09/12
[ "https://Stackoverflow.com/questions/25809038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1803121/" ]
With Open MPI one could instruct `mpirun` to output its own PID by giving it the `--report-pid` option: * `--report-pid -` outputs the PID to the standard output; * `--report-pid +` outputs the PID to the standard error; * `--report-pid /path/to/filename` writes the PID into `filename`. To get the PIDs of all your ru...
Besides putting the `&` and using `$!` and then `%` to put the `mpirun` process bash to foreground: ``` $ mpirun -np 4 ./a.out & [1] 12345 $ PID=$! $ % ... ``` You can use the [`pkill`](http://www.unix.com/man-page/opensolaris/1/pkill/) commands to terminate it e.g. `pkill mpirun` but then you need to make sure only...
59,470,021
I do not know why the response.body() is null, that make my app crashing, check the code please This is Common Class ``` public class Common { public static User userterkini; public static tujuan tujuanterkini; public static final String UPDATE = "Update"; public static final String DELETE = "Delete"; public static ...
2019/12/24
[ "https://Stackoverflow.com/questions/59470021", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12479666/" ]
Retrofit `onResponse` ([documentation](https://square.github.io/retrofit/2.x/retrofit/retrofit2/Callback.html)) is invoked when an HTTP response is received, in other words, 200 or 404 also considered. Please use `Response.isSuccessful()` to check if the request succeeds, otherwise, just print the error code and/or err...
You can create a Model based on your JSON response, after that use Gson and GsonConverter!! when You use GsonConverter, it is not necessary to parse JSON , because of Gson do this for your code!!
49,531,531
Is it possible to invoke a private static method with `MethodUtils`? ``` LocalDateTime d = (LocalDateTime)MethodUtils.invokeStaticMethod(Service.class, "getNightStart", LocalTime.of(0, 0), LocalTime.of(8,0)); ``` This code throws the exception: ``` java.lang.NoSuchMethodException: No such accessi...
2018/03/28
[ "https://Stackoverflow.com/questions/49531531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3457177/" ]
No, because `MethodUtils.invokeStaticMethod()` calls `Class.getMethod()` under the hood. Even if you try to hack the modifier it won't be visible to the `MethodUtils` as it won't see the modified `Method` reference: ``` Service.class .getDeclaredMethod("getNightStart", LocalTime.class, LocalTime.class) .setAccessi...
use method with `forceAccess`, and set `true` [apidoc for common-lang3 MethodUtils.invokeMethod](https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/reflect/MethodUtils.html#invokeMethod-java.lang.Object-boolean-java.lang.String-java.lang.Object...-)
69,656,821
I am working with a web application using Node.js and Express, and I display a video with some subtitles generated dynamically. I was wondering if there was a way to integrate this subtitles in the video so that the user could download this new video.
2021/10/21
[ "https://Stackoverflow.com/questions/69656821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6109428/" ]
Duplicated `kotlin-gradle-plugin` in Project's `build.gradle` might mess things up
Updating `com.android.tools.build:gradle` version to `7.0.4` fixed it for me ``` classpath "com.android.tools.build:gradle:7.0.4" ```
46,048,747
I have a column in Pandas which contains booleans and want to count thr rows since the last True value, something like this: ``` a b False 0 True 0 False 1 False 2 False 3 True 0 False 1 True 0 ``` I could do it via a loop but it seems there must be a b...
2017/09/05
[ "https://Stackoverflow.com/questions/46048747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8515559/" ]
``` a = ~df['a'] b = a.cumsum() c = b-b.where(~a).ffill().fillna(1).astype(int) print (c) 0 0 1 0 2 1 3 2 4 3 5 0 6 1 7 0 Name: a, dtype: int32 ```
I found the above code didn't work, but this does: ``` #Create DataFrame import pandas as pd d = {'condition': [False,False,False,True,False,False,True,False,True,False,False,False,False,False,False,True]} df = pd.DataFrame(data=d) #Calculate Rows Since Condition df['counter'] = df.index.where(df.condition) df['count...
10,902,403
I am querying my postgres database and getting a name and id like so: ``` $datesQuery = "SELECT date_ridden, id from dates WHERE user_id=$userId"; //query $theDates = pg_query($db, $datesQuery); //execute query $dates=array(); //want to use this array to have the key as id and value as date_ridden ``` I want to make...
2012/06/05
[ "https://Stackoverflow.com/questions/10902403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1422222/" ]
I believe the loop structure you are looking for is: ``` while( $date = pg_fetch_row($theDates) ){ $dates[$date[1]] = $date[0]; } ``` If I misunderstood, then the issue with your current attempt is that it appends the id and label as separate array indexes in `$dates`. Instead try this: ``` while( $date = pg_f...
If I understand what your asking, then it would be something like this ``` while( $date = pg_fetch_row( $theDates ) ) { $dates[][$date[1]] = $date[0]; } ``` or if your wanting to access $dates['some id'] then ``` while( $date = pg_fetch_row( $theDates ) ) { $dates[$date[1]] = $date[0]; } ```
19,345,788
Sorry for the vague title, but I don't know how to describe the problem more precisely in a short sentence. My problem is the following: When I manipulate form values within an `onsubmit` callback function like in the following example, the browser sometimes show the changed input/textarea values to the user while su...
2013/10/13
[ "https://Stackoverflow.com/questions/19345788", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1159435/" ]
how about creating two forms one fake and the other real... the user enters data in the fake form.. which when submitted calls the function manipulateForm... the default submit action of the fake form is prevented.. and the data from the fake from is extracted.. manipulated.. and set in the real form.. then the real's ...
There is no reason to make a second form, the `onsubmit` function can alter the data before it is submitted. in the example below, the data will be altered before it is sent on. ``` <html> <form id=myform target=apage.html onsubmit=alter()> <input type=text id=name name=name> <input type=age id=age name=age> <input t...
43,826,865
I've read about the splice method for my todo list app but I don't know why this doesn't work. <https://codepen.io/dev999/pen/XRzMwx> Could anyone please tell me how to fix my splice method so that it deletes the right to do item? Thank you! So far it seems to only delete the first item no matter what ``` function del...
2017/05/07
[ "https://Stackoverflow.com/questions/43826865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7974766/" ]
You can always `CTRL-C` in the terminal window to stop the server. You could also `ps aux | grep StanfordCoreNLPServer` to find the pid and then kill the process manually. When the server is started it should create a shutdown key and you can send that message to the server to close the server. This isn't working on ...
If you just want to kill the process. You can use lsof command. ``` #install lsof if missing sudo apt install lsof ``` You can find the pid of CoreNLP using ``` lsof -i:9000 ``` Replace 9000 with the port you used to run the server. The output looks like ``` COMMAND PID USER FD TYPE DEVICE SIZE/OFF NOD...
20,725,548
So I have been messing around with D3.js for a couple of days now and I have basic circle generation / animation (that act as bubbles), and I was wondering how I could animate the circles on the x axsis, so they wobble back forth as the travel / transition to the top of the page. The current animation can be viewed at ...
2013/12/22
[ "https://Stackoverflow.com/questions/20725548", "https://Stackoverflow.com", "https://Stackoverflow.com/users/708807/" ]
**Demo of Solution:** Note the lack of symmetry: <http://jsfiddle.net/blakedietz/R5cRK/1/embedded/result/> **Approach:** * Determine a mathematical function that would properly model the movement that you want. + In this case we want a **sine** wave. We can modify aspects of each bubbles characteristics to give a ...
You can do that using [custom `tween` function](https://github.com/mbostock/d3/wiki/Transitions#wiki-attrTween) for `cx`: ```js var circlesTransition = d3.selectAll("circle") .transition() .duration(5000) .attr("cy", "0") .attrTween('cx', function (d, i, a) { return function (t) { // Add ...