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
54,126
Matthew 1:18 (NIV) > > This is how the birth of Jesus the Messiah came about[a]: His mother > Mary was pledged to be married to Joseph, but before they came > together, she was found to be pregnant through the Holy Spirit. > > > It says Mary became pregnant through the Holy Spirit, but how does one rule-out the i...
2021/01/02
[ "https://hermeneutics.stackexchange.com/questions/54126", "https://hermeneutics.stackexchange.com", "https://hermeneutics.stackexchange.com/users/32532/" ]
There are three things that have led people to believe in the virgin birth of Jesus, based on the inspired record in Matt 1:18-25 - * **V18**, "before they [Mary and Joseph] came together [= had slept together], Mary was found with a child in the womb out of [= ἐκ] the Holy Spirit * **V19-24** - Joseph then considers ...
Here is the passage from the ancient Greek translation to which he appeals: > > [Isaiah 7:14](https://studybible.info/Brenton/Isaiah%207:14) > Brenton(i) 14 Therefore the Lord himself shall give you a sign; behold, a virgin shall conceive in the womb, and shall bring forth a son, and thou shalt call his name Emmanuel...
54,126
Matthew 1:18 (NIV) > > This is how the birth of Jesus the Messiah came about[a]: His mother > Mary was pledged to be married to Joseph, but before they came > together, she was found to be pregnant through the Holy Spirit. > > > It says Mary became pregnant through the Holy Spirit, but how does one rule-out the i...
2021/01/02
[ "https://hermeneutics.stackexchange.com/questions/54126", "https://hermeneutics.stackexchange.com", "https://hermeneutics.stackexchange.com/users/32532/" ]
There are three things that have led people to believe in the virgin birth of Jesus, based on the inspired record in Matt 1:18-25 - * **V18**, "before they [Mary and Joseph] came together [= had slept together], Mary was found with a child in the womb out of [= ἐκ] the Holy Spirit * **V19-24** - Joseph then considers ...
First, the text eliminates the possibility that Joseph’s seed contributed to the conception because it said Mary was found pregnant (lit., “having in her womb”) while she and Joseph were betrothed and before she and Joseph came together (i.e., had intercourse). Notice the phrase at the end: «ἐκ πνεύματος ἁγίου». The t...
34,783,791
**Method 1:** ``` public class1 { private string _val1; private string _val2; public string Value1 { get {return _val1;} } public string Value2 { get {return _val2;} } public void ReadingDataFromDB() { //code to retrieve data from database ...
2016/01/14
[ "https://Stackoverflow.com/questions/34783791", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5308318/" ]
I suggest something like that (Method 1 improved or Method 3): ``` public class MyClass { //TODO: find better names for Value1, Value2 public String Value1 {get; private set} public String Value2 {get; private set} // static: the method actually creates an instance as read form DB public static ...
Take a look at an `ORM`, the [EntityFramework](https://msdn.microsoft.com/de-de/data/ef.aspx) for example. However: Basicly you should have a Model: ``` class FooModel { public string Value1 {get;set;} public string Value2 {get;set;} } ``` And a Repository: ``` class FooRepository { private _db; pu...
30,842,515
I'm trying to loop through "tabs" in the Json object using AngularJS? How can I do it? ``` var model = { "$id": "1", "tabs": [{ "$id": "2", "id": 2, "name": "Output", "layoutId": 1, "order": 1, "dashboardId": 1 }, { "$id": "15", "id": 3, ...
2015/06/15
[ "https://Stackoverflow.com/questions/30842515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1367915/" ]
I expect that the model is not ready at the time you loop though it. Run the following code with your inspector open - the code you have is correct, but in your case fails because `model` isn't ready when you run the loop. If you're loading data asyncronously you'll want to wait until the data is returned, either usi...
Ok I found the answer. It looks like my controller returns Json object as a string, so I have to switch it to object before I can use it as an object. I have add this line before using model in the loop: ``` model = JSON.parse(data); ``` The whole solution with promise (not sure if I need it now): ``` DataService...
37,161,612
Consider: ``` struct S { ... // Some data members double x, y; ///< Coordinates ... // More data members } ``` The comment that I intended for `x` and `y` is interpreted by `doxygfen` to refer only to `y` (or, at least, there is not indication in the resulting documentation that it refers to both of them...
2016/05/11
[ "https://Stackoverflow.com/questions/37161612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2725810/" ]
Imho it is good practice in general to declare one variable per line. This avoids some confusion about e.g. ``` int* x,y; ``` among other things. I dont really understand your concern about "less readable, since these members are logically related". They are contained in the same struct, because they are logically...
In doxygen there are some possibilities to copy documentation for items `\copy...` also linking to other documentation is possible `\ref` `\link ... \endlink`. With the `\copydoc` we can get here: ``` struct Point { double x; ///< x & y are coordinates. (more detailed description) double y; ///< \copydoc Poi...
37,161,612
Consider: ``` struct S { ... // Some data members double x, y; ///< Coordinates ... // More data members } ``` The comment that I intended for `x` and `y` is interpreted by `doxygfen` to refer only to `y` (or, at least, there is not indication in the resulting documentation that it refers to both of them...
2016/05/11
[ "https://Stackoverflow.com/questions/37161612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2725810/" ]
The proper answer to your question is: encapsulate coordinates into one type, like: ``` struct Point { double x; double y; }; ``` Then the problem *disappears*: ``` struct S { ... // Some data members Point coordinates; ///< Coordinates ... // More data members }; ``` Probably after that change...
In doxygen there are some possibilities to copy documentation for items `\copy...` also linking to other documentation is possible `\ref` `\link ... \endlink`. With the `\copydoc` we can get here: ``` struct Point { double x; ///< x & y are coordinates. (more detailed description) double y; ///< \copydoc Poi...
37,161,612
Consider: ``` struct S { ... // Some data members double x, y; ///< Coordinates ... // More data members } ``` The comment that I intended for `x` and `y` is interpreted by `doxygfen` to refer only to `y` (or, at least, there is not indication in the resulting documentation that it refers to both of them...
2016/05/11
[ "https://Stackoverflow.com/questions/37161612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2725810/" ]
I see nothing wrong with something like; ``` struct Point { double x; ///< x & y are coordinates. (more detailed description) double y; ///< See "x". }; ```
In doxygen there are some possibilities to copy documentation for items `\copy...` also linking to other documentation is possible `\ref` `\link ... \endlink`. With the `\copydoc` we can get here: ``` struct Point { double x; ///< x & y are coordinates. (more detailed description) double y; ///< \copydoc Poi...
48,080,390
I am having a strange memory leak when I use setTimeout. I call the following code every 15 sec with an async function that returns an array of promises (Promise.all), and it is supposed to run again 15 sec after all the promises have resolved and it finished all the logic. ``` const schedule = (fn, seconds, runNow =...
2018/01/03
[ "https://Stackoverflow.com/questions/48080390", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6086851/" ]
What happens if you get rid of the try catch? ``` const schedule = (fn, seconds, runNow = false) => { Meteor.setTimeout(() => { Promise.resolve() .then(fn) .then( ()=> schedule(fn, seconds, false) ) .catch((err)=>{ log.error(err) schedule(fn, seconds, false) }); },...
I am not sure if this is the solution but in the ReactJS FAQ is a topic called [Arrow Function in Render](https://reactjs.org/docs/faq-functions.html#arrow-function-in-render) which sais: > > Using an arrow function in render creates a new function each time the > component renders, which may have performance impl...
58,603
According to the poem: > > Three Rings for the Elven-kings under the sky, > > Seven for the Dwarf-lords in their halls of stone, > > Nine for Mortal Men doomed to die, > > One for the Dark Lord on his dark throne > > In the Land of Mordor where the Shadows lie. > > One Ring to rule them all. One R...
2014/06/04
[ "https://scifi.stackexchange.com/questions/58603", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/27933/" ]
The control that the One Ring has over the others is significant but that's not the real reason why it must be destroyed. If we look at *Of the Rings of Power and the Third Age*, in *The silmarillion*, we'll see the reason why the One Ring was made and the reason why it must be destroyed: > > And much of the strengt...
The One Ring would: * Solidify the control of the Ringwraiths and empower them toward greater evil than they were already capable of. * Prevent the use of the 3 Elven rings because as long as Sauron had the One Ring, no one would consider using the 3 in any way for fear of being controlled, manipulated and eventually ...
58,603
According to the poem: > > Three Rings for the Elven-kings under the sky, > > Seven for the Dwarf-lords in their halls of stone, > > Nine for Mortal Men doomed to die, > > One for the Dark Lord on his dark throne > > In the Land of Mordor where the Shadows lie. > > One Ring to rule them all. One R...
2014/06/04
[ "https://scifi.stackexchange.com/questions/58603", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/27933/" ]
The control that the One Ring has over the others is significant but that's not the real reason why it must be destroyed. If we look at *Of the Rings of Power and the Third Age*, in *The silmarillion*, we'll see the reason why the One Ring was made and the reason why it must be destroyed: > > And much of the strengt...
It is likely that Sauron's purpose in creating the Ruling Ring was indeed complete dominion over the Elves through their rings, but by the time of LOTR the Ring means something very different to Sauron and the Free Peoples. In addition to controlling the other Rings, The Ruling Ring focuses and multiplies the willpower...
58,603
According to the poem: > > Three Rings for the Elven-kings under the sky, > > Seven for the Dwarf-lords in their halls of stone, > > Nine for Mortal Men doomed to die, > > One for the Dark Lord on his dark throne > > In the Land of Mordor where the Shadows lie. > > One Ring to rule them all. One R...
2014/06/04
[ "https://scifi.stackexchange.com/questions/58603", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/27933/" ]
The One Ring would: * Solidify the control of the Ringwraiths and empower them toward greater evil than they were already capable of. * Prevent the use of the 3 Elven rings because as long as Sauron had the One Ring, no one would consider using the 3 in any way for fear of being controlled, manipulated and eventually ...
It is likely that Sauron's purpose in creating the Ruling Ring was indeed complete dominion over the Elves through their rings, but by the time of LOTR the Ring means something very different to Sauron and the Free Peoples. In addition to controlling the other Rings, The Ruling Ring focuses and multiplies the willpower...
36,734,082
There's this HackerRank problem about implementing a linked list. It is pretty basic and I thought I'd do it in a jiffy since I'd done all kinds of linked list implementations in C++. But I'm stuck somewhere. ``` class Node: def __init__(self,data): self.data = data self.next = None class Solution:...
2016/04/20
[ "https://Stackoverflow.com/questions/36734082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4305436/" ]
You are appending the `new_node` after all the elements, and also you are *not* returning the newly created node. Modify your `insert` method like this: ``` def insert(self,head,data): new_node = Node(data) if head is not None: current = head new_node.next = current return new_node ```
I think the error is here: ``` head = mylist.insert(head, data) ``` the method `Solution.insert()` is not returning anything, therefore head is assigned None every time. When done, `Solution.insert()` must return the `new_node` created
36,734,082
There's this HackerRank problem about implementing a linked list. It is pretty basic and I thought I'd do it in a jiffy since I'd done all kinds of linked list implementations in C++. But I'm stuck somewhere. ``` class Node: def __init__(self,data): self.data = data self.next = None class Solution:...
2016/04/20
[ "https://Stackoverflow.com/questions/36734082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4305436/" ]
I think the error is here: ``` head = mylist.insert(head, data) ``` the method `Solution.insert()` is not returning anything, therefore head is assigned None every time. When done, `Solution.insert()` must return the `new_node` created
The reason your code doesn't work is because of the None check that you are doing in `insert` method. ``` if head == None: head = new_node ``` The `head` you are updating is local to the function `insert` and doesn't change `head` in the loop. So, `head` is always `None` in your loop.
36,734,082
There's this HackerRank problem about implementing a linked list. It is pretty basic and I thought I'd do it in a jiffy since I'd done all kinds of linked list implementations in C++. But I'm stuck somewhere. ``` class Node: def __init__(self,data): self.data = data self.next = None class Solution:...
2016/04/20
[ "https://Stackoverflow.com/questions/36734082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4305436/" ]
You are appending the `new_node` after all the elements, and also you are *not* returning the newly created node. Modify your `insert` method like this: ``` def insert(self,head,data): new_node = Node(data) if head is not None: current = head new_node.next = current return new_node ```
The reason your code doesn't work is because of the None check that you are doing in `insert` method. ``` if head == None: head = new_node ``` The `head` you are updating is local to the function `insert` and doesn't change `head` in the loop. So, `head` is always `None` in your loop.
19,898,026
I need to decompile a jar file and when I do I get these weird things inside of switch statements. ``` private String getRawToolName() switch (1.$SwitchMap$org$bukkit$Material[getItem().getType().ordinal()]) { case 1: return "Diamond Axe"; case 2: return "Diamond Pickaxe"; case 3: return "Diamond Hoe"; case...
2013/11/11
[ "https://Stackoverflow.com/questions/19898026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2977659/" ]
Simply changing `switch (1.$SwitchMap$org$bukkit$Material[getItem().getType().ordinal()])` to `getItem().getType().ordinal()` fixes it in the similar cases I've encountered. Seems to be something about the way it decompiles switches, but you can figure out what the original was.
[Procyon](https://bitbucket.org/mstrobel/procyon/) should decompile these correctly, as should [CFR](http://www.benf.org/other/cfr/).
33,034,169
In Asp.Net 5 the development is faster because it compiles on save. But I still have to refresh the browser manually. Is there a live reload option in Visual Studio, or should I use a gulp plugin for that?
2015/10/09
[ "https://Stackoverflow.com/questions/33034169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/899227/" ]
You can enable BrowserLink and while editing your code hit `Ctrl+Alt+Enter` to cause the browsers to refresh automatically. Alternatively you can hit the browser link refresh button in the Visual Studio ToolBar. ``` public void Configure(IApplicationBuilder application) { // Only enable browser link if IHostingEnv...
context => Mats made a new extension which refreshes automatically after SAVE button. Grag the VS extension from visual studio gallery. Save your VS changes and the browser is reloaded. <https://visualstudiogallery.msdn.microsoft.com/46eef4d9-045b-4596-bd7f-eee980bb5450>
20,833,878
Why the output of the following code is always `suck`. How to get `happy` as the output? Why the `happy` branch is unreachable? ``` public class HowToMakeStackoverflowBetter { private static final int HUMAN_PATIENCE = 10; private List<Member> members = new ArrayList<>(); private int atmosphere = -10; ...
2013/12/30
[ "https://Stackoverflow.com/questions/20833878", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043719/" ]
You forgot to initialize `sentinel` In code below you are trying to initialize sentinel (which is not yet constructed) with sentinel(same thing). So you have to pass something to constructor which can be used to initialize your member variable `sentinel` ``` *sentinel.last=sentinel; ``` Also no need to call destruc...
the program may crash, with this: ``` *sentinel.last=sentinel; *sentinel.next=sentinel; ``` sentinel is not initialized sot i has random value on stack.
20,833,878
Why the output of the following code is always `suck`. How to get `happy` as the output? Why the `happy` branch is unreachable? ``` public class HowToMakeStackoverflowBetter { private static final int HUMAN_PATIENCE = 10; private List<Member> members = new ArrayList<>(); private int atmosphere = -10; ...
2013/12/30
[ "https://Stackoverflow.com/questions/20833878", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043719/" ]
Two problems. First: ``` linkedList::linkedList(){ *sentinel.last=sentinel; *sentinel.next=sentinel; sentinel.str="I am sentinel!!"; }; ``` `sentinel` is your member variable, and `.last` is its pointer to another node. This hasn't been initialised, so trying to use it is undefined behaviour. In...
You forgot to initialize `sentinel` In code below you are trying to initialize sentinel (which is not yet constructed) with sentinel(same thing). So you have to pass something to constructor which can be used to initialize your member variable `sentinel` ``` *sentinel.last=sentinel; ``` Also no need to call destruc...
20,833,878
Why the output of the following code is always `suck`. How to get `happy` as the output? Why the `happy` branch is unreachable? ``` public class HowToMakeStackoverflowBetter { private static final int HUMAN_PATIENCE = 10; private List<Member> members = new ArrayList<>(); private int atmosphere = -10; ...
2013/12/30
[ "https://Stackoverflow.com/questions/20833878", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043719/" ]
You forgot to initialize `sentinel` In code below you are trying to initialize sentinel (which is not yet constructed) with sentinel(same thing). So you have to pass something to constructor which can be used to initialize your member variable `sentinel` ``` *sentinel.last=sentinel; ``` Also no need to call destruc...
You're trying to de-reference the pointers `last` and `next` of member variable `sentinel` when they are not yet initialized. And these de-references `*sentinel.last=sentinel` `*sentinel.next=sentinel` are causing the crash because without assigning the values to pointers you're changing the value pointed by the poi...
20,833,878
Why the output of the following code is always `suck`. How to get `happy` as the output? Why the `happy` branch is unreachable? ``` public class HowToMakeStackoverflowBetter { private static final int HUMAN_PATIENCE = 10; private List<Member> members = new ArrayList<>(); private int atmosphere = -10; ...
2013/12/30
[ "https://Stackoverflow.com/questions/20833878", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043719/" ]
Since you allocated it as a local variable, your `mylist` will be destroyed automatically upon exiting main. Since you've already explicitly invoked its destructor, that leads to undefined behavior (attempting to destroy the same object twice). As a quick guideline, essentially the *only* time you explicitly invoke a ...
the program may crash, with this: ``` *sentinel.last=sentinel; *sentinel.next=sentinel; ``` sentinel is not initialized sot i has random value on stack.
20,833,878
Why the output of the following code is always `suck`. How to get `happy` as the output? Why the `happy` branch is unreachable? ``` public class HowToMakeStackoverflowBetter { private static final int HUMAN_PATIENCE = 10; private List<Member> members = new ArrayList<>(); private int atmosphere = -10; ...
2013/12/30
[ "https://Stackoverflow.com/questions/20833878", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043719/" ]
Two problems. First: ``` linkedList::linkedList(){ *sentinel.last=sentinel; *sentinel.next=sentinel; sentinel.str="I am sentinel!!"; }; ``` `sentinel` is your member variable, and `.last` is its pointer to another node. This hasn't been initialised, so trying to use it is undefined behaviour. In...
the program may crash, with this: ``` *sentinel.last=sentinel; *sentinel.next=sentinel; ``` sentinel is not initialized sot i has random value on stack.
20,833,878
Why the output of the following code is always `suck`. How to get `happy` as the output? Why the `happy` branch is unreachable? ``` public class HowToMakeStackoverflowBetter { private static final int HUMAN_PATIENCE = 10; private List<Member> members = new ArrayList<>(); private int atmosphere = -10; ...
2013/12/30
[ "https://Stackoverflow.com/questions/20833878", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043719/" ]
Two problems. First: ``` linkedList::linkedList(){ *sentinel.last=sentinel; *sentinel.next=sentinel; sentinel.str="I am sentinel!!"; }; ``` `sentinel` is your member variable, and `.last` is its pointer to another node. This hasn't been initialised, so trying to use it is undefined behaviour. In...
Since you allocated it as a local variable, your `mylist` will be destroyed automatically upon exiting main. Since you've already explicitly invoked its destructor, that leads to undefined behavior (attempting to destroy the same object twice). As a quick guideline, essentially the *only* time you explicitly invoke a ...
20,833,878
Why the output of the following code is always `suck`. How to get `happy` as the output? Why the `happy` branch is unreachable? ``` public class HowToMakeStackoverflowBetter { private static final int HUMAN_PATIENCE = 10; private List<Member> members = new ArrayList<>(); private int atmosphere = -10; ...
2013/12/30
[ "https://Stackoverflow.com/questions/20833878", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043719/" ]
Since you allocated it as a local variable, your `mylist` will be destroyed automatically upon exiting main. Since you've already explicitly invoked its destructor, that leads to undefined behavior (attempting to destroy the same object twice). As a quick guideline, essentially the *only* time you explicitly invoke a ...
You're trying to de-reference the pointers `last` and `next` of member variable `sentinel` when they are not yet initialized. And these de-references `*sentinel.last=sentinel` `*sentinel.next=sentinel` are causing the crash because without assigning the values to pointers you're changing the value pointed by the poi...
20,833,878
Why the output of the following code is always `suck`. How to get `happy` as the output? Why the `happy` branch is unreachable? ``` public class HowToMakeStackoverflowBetter { private static final int HUMAN_PATIENCE = 10; private List<Member> members = new ArrayList<>(); private int atmosphere = -10; ...
2013/12/30
[ "https://Stackoverflow.com/questions/20833878", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3043719/" ]
Two problems. First: ``` linkedList::linkedList(){ *sentinel.last=sentinel; *sentinel.next=sentinel; sentinel.str="I am sentinel!!"; }; ``` `sentinel` is your member variable, and `.last` is its pointer to another node. This hasn't been initialised, so trying to use it is undefined behaviour. In...
You're trying to de-reference the pointers `last` and `next` of member variable `sentinel` when they are not yet initialized. And these de-references `*sentinel.last=sentinel` `*sentinel.next=sentinel` are causing the crash because without assigning the values to pointers you're changing the value pointed by the poi...
66,415,668
In development, should we convert the .html or .htm file extension to .PHP? To implement the PHP session, and not to redirect if the session is destroyed? I mean, in C# we use `RedirectToPagePermanent` to keep the user to only access the pages the system will be redirected. How about PHP? for example process. 1. Lo...
2021/03/01
[ "https://Stackoverflow.com/questions/66415668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13403537/" ]
``` subqueries1 = ['name','name2','name3'] def sub_view(qry, subqueries): qry_list = [] for sub in subqueries: qry_list.append(qry + """SELECT * FROM""" + sub + """ WHERE id=weather""") return qry_list x=sub_view('qry',subqueries1) for i in x: print(i) ```
you can use format strings, using "f" before starts a string, and using your variable inside `{}`, like this: `{sub}`, then use the `.append()` function to add to your list. ``` for sub in subqueries: qry_list.append(qry + f"SELECT * FROM {sub} WHERE id=weather") ```
66,415,668
In development, should we convert the .html or .htm file extension to .PHP? To implement the PHP session, and not to redirect if the session is destroyed? I mean, in C# we use `RedirectToPagePermanent` to keep the user to only access the pages the system will be redirected. How about PHP? for example process. 1. Lo...
2021/03/01
[ "https://Stackoverflow.com/questions/66415668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13403537/" ]
``` subqueries1 = ['name','name2','name3'] def sub_view(qry, subqueries): qry_list = [] for sub in subqueries: qry_list.append(qry + """SELECT * FROM""" + sub + """ WHERE id=weather""") return qry_list x=sub_view('qry',subqueries1) for i in x: print(i) ```
You can use [f strings](https://docs.python.org/3/tutorial/inputoutput.html). Also your function has a tiny error, the corrected and formatted version is: ``` def sub_view(qry, subqueries): qry_list = [] for sub in subqueries: qry_list = f"{qry} SELECT * FROM {sub} WHERE id=weather" return qry_...
66,415,668
In development, should we convert the .html or .htm file extension to .PHP? To implement the PHP session, and not to redirect if the session is destroyed? I mean, in C# we use `RedirectToPagePermanent` to keep the user to only access the pages the system will be redirected. How about PHP? for example process. 1. Lo...
2021/03/01
[ "https://Stackoverflow.com/questions/66415668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13403537/" ]
``` subqueries1 = ['name','name2','name3'] def sub_view(qry, subqueries): qry_list = [] for sub in subqueries: qry_list.append(qry + """SELECT * FROM""" + sub + """ WHERE id=weather""") return qry_list x=sub_view('qry',subqueries1) for i in x: print(i) ```
you can use "lambda" like this: ``` def sub_view(qry, subqueries): return list(map(lambda s: qry + """SELECT * FROM """ + s + """ WHERE id=weather""", subqueries)) ``` also you can use "for" like this: ``` def sub_view(qry, subqueries): qry_list = [] for sub in subqueries: #qry_list.append(qry +...
66,415,668
In development, should we convert the .html or .htm file extension to .PHP? To implement the PHP session, and not to redirect if the session is destroyed? I mean, in C# we use `RedirectToPagePermanent` to keep the user to only access the pages the system will be redirected. How about PHP? for example process. 1. Lo...
2021/03/01
[ "https://Stackoverflow.com/questions/66415668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13403537/" ]
``` subqueries1 = ['name','name2','name3'] def sub_view(qry, subqueries): qry_list = [] for sub in subqueries: qry_list.append(qry + """SELECT * FROM""" + sub + """ WHERE id=weather""") return qry_list x=sub_view('qry',subqueries1) for i in x: print(i) ```
It's not clear what your objective is because the query strings don't look that useful, however, you can create a list of queries containing the substitutions using a list comprehension: ``` def sub_view(qry, subqueries): return [f"{qry} SELECT * FROM {table} WHERE id='weather'" for table in subqueries] >>> subqu...
12,447,726
If I use `from time import time`, the Python 2.7.3 does not recognize `time.sleep(60)`. But if I use `import time`, then Python does not recognize `t=time()`. Why does this happen? Is there any way I can use `time()` and `time.sleep(x)` in the same program? ``` from time import time #import time intervalInMinute = 1 ...
2012/09/16
[ "https://Stackoverflow.com/questions/12447726", "https://Stackoverflow.com", "https://Stackoverflow.com/users/453673/" ]
You need to decide what you want the name `time` to refer to, the module or the function called `time` in the module. You can write: ``` >>> from time import time, sleep >>> time() 1347806075.148084 >>> sleep(3) >>> ``` or ``` >>> import time >>> time.time() 1347806085.739065 >>> time.sleep(2) >>> ```
`from time import time` imports the method `time()` from the module `time`. `import time`, on the other hand, imports the module `time`. `import time` and use `time.time()` instead of `time()`.
72,281,305
I'm using the following function to sort an object by keys. The problem is when I have to sort '05' and '10', the '10' is sorted before the '05' ```js function sortObj(obj) { return Object.keys(obj).sort().reduce(function(result, key) { result[key] = obj[key]; return result; }, {}); } let list = { '10'...
2022/05/17
[ "https://Stackoverflow.com/questions/72281305", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2255168/" ]
A control should never depend on an explicit or internal view model. It must depend on its own members, like public properties, alone. Then the data context can later bind to this public properties. This will enable reusability independent from the actual `DataContext` type and eliminates redundant code (and redundant...
It's sure not pretty, and it doesn't smell great- but if this is your only option, here is how this could work. I added an `Action` to the ViewModel, to set the DP in the code behind- note that it's only calling SetValue, and not directly setting the SelectedMyItem, which prevents the setter loop I was worried about. ...
849,746
Well, the internet is working flawless, all the sites are fine, and I can use my webmail from the provider website, althought I can't **send** anything from Outlook, funnily I receive everything, and all computers here use Outlook, also, tried Thunderbird, same happens. I tried to ping and do tracert's from the comma...
2017/05/12
[ "https://serverfault.com/questions/849746", "https://serverfault.com", "https://serverfault.com/users/415066/" ]
some ISPs will block outbound mail to everything but their mailservers to stop people from sending spam from their local connection. I'd call your ISP and ask them if they are blocking outbound email.
Having another, external site show the same behavior does not prove your provider is not at fault. Having some work while others do not would point the finger away from them, but not completely. @Mike is right in the answer below. Having no working examples of sending SMTP is actually indicative of possible provider bl...
24,905,477
Prior to my main select statement, I first have to create a temporary table with thousands of lines (using a select statement to get these lines automatically is not feasible in my SQL Server environment), but working in that SQL query is a nightmare of readability, as my .sql file has thousands of lines :( Is is poss...
2014/07/23
[ "https://Stackoverflow.com/questions/24905477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3848456/" ]
As mention in my comment you have to make `ul` `display: inline-block;` like this: ``` ul{ display: inline-block; } ``` [fiddle](http://jsfiddle.net/SyKnv/4/)
**CSS** ``` ul{ display: inline-block; } ``` **Inline-Block** Basically, it’s a way to make elements inline, but preserving their block capabilities such as setting width and height, top and bottom margins and paddings etc. [More Info Regarding Inline-block](http://www.impressivewebs.com/inline-blo...
24,905,477
Prior to my main select statement, I first have to create a temporary table with thousands of lines (using a select statement to get these lines automatically is not feasible in my SQL Server environment), but working in that SQL query is a nightmare of readability, as my .sql file has thousands of lines :( Is is poss...
2014/07/23
[ "https://Stackoverflow.com/questions/24905477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3848456/" ]
As mention in my comment you have to make `ul` `display: inline-block;` like this: ``` ul{ display: inline-block; } ``` [fiddle](http://jsfiddle.net/SyKnv/4/)
try this code [DEMO](http://jsfiddle.net/SyKnv/11/) ``` div{ width: 40%; min-height: 50%; border:1px solid black; } ul { margin:0; padding:0; } li{ border:1px solid black; list-style:inside; } ```
24,905,477
Prior to my main select statement, I first have to create a temporary table with thousands of lines (using a select statement to get these lines automatically is not feasible in my SQL Server environment), but working in that SQL query is a nightmare of readability, as my .sql file has thousands of lines :( Is is poss...
2014/07/23
[ "https://Stackoverflow.com/questions/24905477", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3848456/" ]
try this code [DEMO](http://jsfiddle.net/SyKnv/11/) ``` div{ width: 40%; min-height: 50%; border:1px solid black; } ul { margin:0; padding:0; } li{ border:1px solid black; list-style:inside; } ```
**CSS** ``` ul{ display: inline-block; } ``` **Inline-Block** Basically, it’s a way to make elements inline, but preserving their block capabilities such as setting width and height, top and bottom margins and paddings etc. [More Info Regarding Inline-block](http://www.impressivewebs.com/inline-blo...
3,524,039
I was wondering how I would style the p class="visit" on the code below because it won't allow me to just use p.class { color: white } ``` <div class="OW_Container"> <div class="text_wrap"> <h1>Finding Nemo</h1> <p class="info">Lorem ipsum dolor sit amet, co...
2010/08/19
[ "https://Stackoverflow.com/questions/3524039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/400252/" ]
You don't use "class" in the css. ``` p.visit { color: white } ``` Also, you generally need to target A tags more specifically: ``` p.visit a { color: white } ```
``` p.class { color: white } ``` will color all text white in `p` tags with a class called `class` like: ``` <p class="class">white text</p> ``` Try something like: ``` p.visit { color: white } ```
3,524,039
I was wondering how I would style the p class="visit" on the code below because it won't allow me to just use p.class { color: white } ``` <div class="OW_Container"> <div class="text_wrap"> <h1>Finding Nemo</h1> <p class="info">Lorem ipsum dolor sit amet, co...
2010/08/19
[ "https://Stackoverflow.com/questions/3524039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/400252/" ]
You don't use "class" in the css. ``` p.visit { color: white } ``` Also, you generally need to target A tags more specifically: ``` p.visit a { color: white } ```
``` .text_wrap p{color:#fff} ```
3,524,039
I was wondering how I would style the p class="visit" on the code below because it won't allow me to just use p.class { color: white } ``` <div class="OW_Container"> <div class="text_wrap"> <h1>Finding Nemo</h1> <p class="info">Lorem ipsum dolor sit amet, co...
2010/08/19
[ "https://Stackoverflow.com/questions/3524039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/400252/" ]
You don't use "class" in the css. ``` p.visit { color: white } ``` Also, you generally need to target A tags more specifically: ``` p.visit a { color: white } ```
What you are looking for is the cascading bit of CSS. Try: ``` div.class p.visit { color: white; } ``` That will style all p elements with class="visit" white but only inside of div.class.
1,233,128
I have a CSV file like this: ``` SUPPORT 07/30/2008-10:59:54 Eastern Daylight Time 123 07/03/2009-08:56:42 Eastern Daylight Time DC321 07/10/2009-20:16:56 Eastern Daylight Time ``` where the date is an entire column. how can i remove the entire "Eastern Daylight Time" part of the string with awk?
2009/08/05
[ "https://Stackoverflow.com/questions/1233128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Based on your comment in piotrsz's answer, this is how you could remove the EDT part: ``` awk '{gsub("Eastern Daylight Time", "");print}' file.csv ```
So you want only the 1st and 2nd column? If yes ``` awk '{print $1"\t"$2}' file.csv ```
1,233,128
I have a CSV file like this: ``` SUPPORT 07/30/2008-10:59:54 Eastern Daylight Time 123 07/03/2009-08:56:42 Eastern Daylight Time DC321 07/10/2009-20:16:56 Eastern Daylight Time ``` where the date is an entire column. how can i remove the entire "Eastern Daylight Time" part of the string with awk?
2009/08/05
[ "https://Stackoverflow.com/questions/1233128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I don't know awk, but a sed version would be ``` sed "s/ Eastern Daylight Time//" file.csv ```
So you want only the 1st and 2nd column? If yes ``` awk '{print $1"\t"$2}' file.csv ```
1,233,128
I have a CSV file like this: ``` SUPPORT 07/30/2008-10:59:54 Eastern Daylight Time 123 07/03/2009-08:56:42 Eastern Daylight Time DC321 07/10/2009-20:16:56 Eastern Daylight Time ``` where the date is an entire column. how can i remove the entire "Eastern Daylight Time" part of the string with awk?
2009/08/05
[ "https://Stackoverflow.com/questions/1233128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Based on your comment in piotrsz's answer, this is how you could remove the EDT part: ``` awk '{gsub("Eastern Daylight Time", "");print}' file.csv ```
I don't know awk, but a sed version would be ``` sed "s/ Eastern Daylight Time//" file.csv ```
1,233,128
I have a CSV file like this: ``` SUPPORT 07/30/2008-10:59:54 Eastern Daylight Time 123 07/03/2009-08:56:42 Eastern Daylight Time DC321 07/10/2009-20:16:56 Eastern Daylight Time ``` where the date is an entire column. how can i remove the entire "Eastern Daylight Time" part of the string with awk?
2009/08/05
[ "https://Stackoverflow.com/questions/1233128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Based on your comment in piotrsz's answer, this is how you could remove the EDT part: ``` awk '{gsub("Eastern Daylight Time", "");print}' file.csv ```
using just the shell ``` while read -r line do case "$line" in *Eastern* ) echo "${line%%Eastern*}" ;; *) echo "${line}" esac done < "file" ```
1,233,128
I have a CSV file like this: ``` SUPPORT 07/30/2008-10:59:54 Eastern Daylight Time 123 07/03/2009-08:56:42 Eastern Daylight Time DC321 07/10/2009-20:16:56 Eastern Daylight Time ``` where the date is an entire column. how can i remove the entire "Eastern Daylight Time" part of the string with awk?
2009/08/05
[ "https://Stackoverflow.com/questions/1233128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I don't know awk, but a sed version would be ``` sed "s/ Eastern Daylight Time//" file.csv ```
using just the shell ``` while read -r line do case "$line" in *Eastern* ) echo "${line%%Eastern*}" ;; *) echo "${line}" esac done < "file" ```
9,355
Sometimes you have to load user preferences stored in a Hierarchy custom setting when a Visualforce page loads. If the preferences exist, then retrieve them, otherwise create them and insert them. Something like ``` if(My_Preferences__c.getValues(UserInfo.getUserId()) != null){ prefs = My_Preferences__c.getValues(Us...
2013/03/07
[ "https://salesforce.stackexchange.com/questions/9355", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/227/" ]
This isn't a direct answer to your question, but it may help. With hierarchical settings, if you're program is defaulting the value for the user if they don't already have one you're losing the awesome power of hierarchical settings which is you can set the defaults at the Org and Profile level so that you don't need ...
I have not ran into that particular problem, but one thing you could do is create a [Remote Action](http://www.salesforce.com/us/developer/docs/pages/Content/pages_js_remoting.htm) method in your controller that you can call in you **$(document).ready()** function to handle the custom settings. This way you don't have ...
9,355
Sometimes you have to load user preferences stored in a Hierarchy custom setting when a Visualforce page loads. If the preferences exist, then retrieve them, otherwise create them and insert them. Something like ``` if(My_Preferences__c.getValues(UserInfo.getUserId()) != null){ prefs = My_Preferences__c.getValues(Us...
2013/03/07
[ "https://salesforce.stackexchange.com/questions/9355", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/227/" ]
This isn't a direct answer to your question, but it may help. With hierarchical settings, if you're program is defaulting the value for the user if they don't already have one you're losing the awesome power of hierarchical settings which is you can set the defaults at the Org and Profile level so that you don't need ...
You could make a strong case that there isn't a significant security risk inserting a custom setting for a user if you aren't taking query string parameters to populate it. Alternatively, could you delay the insertion of the users custom setting until you have a value other than the default? I usually wrap custom set...
9,355
Sometimes you have to load user preferences stored in a Hierarchy custom setting when a Visualforce page loads. If the preferences exist, then retrieve them, otherwise create them and insert them. Something like ``` if(My_Preferences__c.getValues(UserInfo.getUserId()) != null){ prefs = My_Preferences__c.getValues(Us...
2013/03/07
[ "https://salesforce.stackexchange.com/questions/9355", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/227/" ]
This isn't a direct answer to your question, but it may help. With hierarchical settings, if you're program is defaulting the value for the user if they don't already have one you're losing the awesome power of hierarchical settings which is you can set the defaults at the Org and Profile level so that you don't need ...
The security risk is flagged because of the potential for cross site request forgery — i.e. someone could call the URL with dubious parameters and your code then uses values from them when modifying the database. I encountered the same thing submitting a managed package fore security review, but I knew that what was b...
51,948,795
I am trying to implement Caesar cipher in Python where my program would take input from a text file i.e. `input_file.txt`, and write the encrypted text as an output to another text file named `output_file.txt`. The input file contains: > > > ``` > Attack On Titans > 4 > > ``` > > where `"Attack On Titan"` is the...
2018/08/21
[ "https://Stackoverflow.com/questions/51948795", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4686772/" ]
`data.readline()` will give you the trailing newline character `\n`. You need to call `text.strip()` before passing to the `encrypt` function to get arid of it.
data.readline() keeps the '\n' (newline) character at the end of the line. It's the reason why you have an extra character in your output. To remove it you can replace ``` text = data.readline() ``` by ``` text = data.readline().rstrip('\n') ``` which will remove the '\n' at the end. text.strip() (see other ans...
51,948,795
I am trying to implement Caesar cipher in Python where my program would take input from a text file i.e. `input_file.txt`, and write the encrypted text as an output to another text file named `output_file.txt`. The input file contains: > > > ``` > Attack On Titans > 4 > > ``` > > where `"Attack On Titan"` is the...
2018/08/21
[ "https://Stackoverflow.com/questions/51948795", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4686772/" ]
It look like you have a trailing newline character in the file you are reading in. Testing it in the python interpreter: ``` >>> a = '\n' >>> (ord(a)+4-97) % 26 + 97 118 >>> chr(118) 'v' ``` Remove trailing and beginning whitespace by calling `test.strip()` before passing it to your encrypt function. As an aside, ...
data.readline() keeps the '\n' (newline) character at the end of the line. It's the reason why you have an extra character in your output. To remove it you can replace ``` text = data.readline() ``` by ``` text = data.readline().rstrip('\n') ``` which will remove the '\n' at the end. text.strip() (see other ans...
45,064,637
I have some code in my main Activity which calls My facebook Login activity class if AccessToken.getCurrentAccessToken() is null: ``` import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.widget.Toast; import com.facebook.Acce...
2017/07/12
[ "https://Stackoverflow.com/questions/45064637", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1224300/" ]
You need to move the "startActivity" line inside your "onSuccess" callback like this: ``` LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() { @Override public void onSuccess(LoginResult loginResult) { Log.d(...
I am using `Fb SDK 4.1` and this code snippet is working for me : And as @Duda mentioned You need to move the "startActivity" line inside your "onSuccess" callback ``` @Override public void onSuccess(LoginResult loginResult) { AccessToken accessToken = loginResult.getAccessToken(); Log.d("facebook", "Done s...
33,432,810
I am creating layout. I included hyperlink but it doesn't work. I wrote my 'href' in this format. ``` href="C:/Users/Dmitry/PycharmProjects/save&edit/templates/form_action.html" ``` Of course I took it in tags. After clicking on this link it doesn't react.
2015/10/30
[ "https://Stackoverflow.com/questions/33432810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4647923/" ]
**Try this:** ``` <a href="C:\Users\Dmitry\PycharmProjects\save&edit\templates\form_action.html">My Link</a> ```
Defined relative path `<a href="templates/form_action.html">My Link</a>`. Finally it works.
63,980,105
I am building an ecommerce shop and I'm fectching items from database and rendering on the template. But i have this issue. i am trying to render a dynamic url and its throwing back some errors. i have tried debugging it but no avail. This is the error it displays (on the browser): ``` OperationalError at / no such ...
2020/09/20
[ "https://Stackoverflow.com/questions/63980105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12875131/" ]
The [Circuit Breaker Pattern](https://microservices.io/patterns/reliability/circuit-breaker.html) is mostly applicable for synchronous service communication. It is meant to avoid that a service is becoming overwhelmed with requests, and that the clients start to retry the requests so that the situation gets even worse....
Though circuit breaker is mainly applicable for synchronous applications, however, this can also be applied to asynchronous communications. This could be achieved by putting all requests on a queue, which one application consumes at its speed - a useful technique to avoid overloading servers. In this case the circuit b...
63,734,234
I have a list of dicts with the same structure ``` [{"Program Name": "Bulldozer", "Level": 3}, {"Program Name": "Robot", "Level": 1}, {"Program Name": "Bulldozer", "Level": 4}] ``` What I want is duplicate keys of "Program Name" that have the same value (ex: "Bulldozer" appearing 2x) to be renamed as "Bulldozer (1)"...
2020/09/04
[ "https://Stackoverflow.com/questions/63734234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9568690/" ]
An Efficient way is to use `defaultdict` to count the `"Program Name"`, the time complexity is `O(n)`: ``` from collections import defaultdict l = [{"Program Name": "Bulldozer", "Level": 3}, {"Program Name": "Robot", "Level": 1}, {"Program Name": "Bulldozer", "Level": 4}, {"Program Name": "Bulldozer", "Level": 4...
Hope this helps: ``` input = [{"Program Name": "Bulldozer", "Level": 3}, {"Program Name": "Robot", "Level": 1}, {"Program Name": "Bulldozer", "Level": 4}] def update_input(input): existing_program_names = {} for i, d in enumerate(input): current_list_program_name = d['Program Name'] try: ...
63,734,234
I have a list of dicts with the same structure ``` [{"Program Name": "Bulldozer", "Level": 3}, {"Program Name": "Robot", "Level": 1}, {"Program Name": "Bulldozer", "Level": 4}] ``` What I want is duplicate keys of "Program Name" that have the same value (ex: "Bulldozer" appearing 2x) to be renamed as "Bulldozer (1)"...
2020/09/04
[ "https://Stackoverflow.com/questions/63734234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9568690/" ]
An Efficient way is to use `defaultdict` to count the `"Program Name"`, the time complexity is `O(n)`: ``` from collections import defaultdict l = [{"Program Name": "Bulldozer", "Level": 3}, {"Program Name": "Robot", "Level": 1}, {"Program Name": "Bulldozer", "Level": 4}, {"Program Name": "Bulldozer", "Level": 4...
You can try this too: ``` data = [ {"Program Name": "Bulldozer", "Level": 3}, {"Program Name": "Robot", "Level": 1}, {"Program Name": "Bulldozer", "Level": 4}, {"Program Name": "Rozer", "Level": 3}, {"Program Name": "Robot", "Level": 1}, {"Program Name": "Rozer", "Level": 3}, {"Program Name...
63,734,234
I have a list of dicts with the same structure ``` [{"Program Name": "Bulldozer", "Level": 3}, {"Program Name": "Robot", "Level": 1}, {"Program Name": "Bulldozer", "Level": 4}] ``` What I want is duplicate keys of "Program Name" that have the same value (ex: "Bulldozer" appearing 2x) to be renamed as "Bulldozer (1)"...
2020/09/04
[ "https://Stackoverflow.com/questions/63734234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9568690/" ]
An Efficient way is to use `defaultdict` to count the `"Program Name"`, the time complexity is `O(n)`: ``` from collections import defaultdict l = [{"Program Name": "Bulldozer", "Level": 3}, {"Program Name": "Robot", "Level": 1}, {"Program Name": "Bulldozer", "Level": 4}, {"Program Name": "Bulldozer", "Level": 4...
Thanks to @jizhihaoSAMA I have managed to find a solution to my problem with a small edit ``` machines = [{"Program Name": "Bulldozer", "Level": 3}, {"Program Name": "Robot", "Level": 1}, {"Program Name": "Bulldozer", "Level": 4}] tmp = defaultdict(int) for i in machines: name = i["Program ...
5,582,840
I'm trying to learn functional programming using Lua. I have a Java background. I want to build a Chain using a recursive method. In Java I would do it somehow like this: ``` //Java public Link buildChain() { return buildChain(null, 0, 100); } private Link buildChain(Link parentLink, int count, int length) { ...
2011/04/07
[ "https://Stackoverflow.com/questions/5582840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/696910/" ]
I don't think there is anything 'functional' about this answer, but here is how I would do it in Lua. The 'id' field in each link is just there to provide a unique id: ``` function buildChain(link, cnt, len) cnt = cnt or some_global_default_cnt or 0 len = len or some_global_default_len or 100 link = link or { pa...
Unsure of how the lua syntax is, but you have 2 options, depending on whether you want the worker function to be used in other contexts also or not. If the worker function (the 2nd one) could be useful on its own, write 2 independent functions. Depending on the language, that may mean using 2 different names. Or else...
31,817
Всё время путаюсь в не-ни. Вопрос: Сколько не называй или сколько ни называй? Мне больше нравится первый вариант, а на правильный больше похож второй.
2014/03/24
[ "https://rus.stackexchange.com/questions/31817", "https://rus.stackexchange.com", "https://rus.stackexchange.com/users/1747/" ]
Конечно, "сколько ни называй". Здесь пишется усилительная частица "ни" согласно элементарной логике (много раз называй)и правилу о частице "ни" в придаточных уступительных
"Ни" конечно. "Не" - отрицает. Проверить легко)
31,817
Всё время путаюсь в не-ни. Вопрос: Сколько не называй или сколько ни называй? Мне больше нравится первый вариант, а на правильный больше похож второй.
2014/03/24
[ "https://rus.stackexchange.com/questions/31817", "https://rus.stackexchange.com", "https://rus.stackexchange.com/users/1747/" ]
Конечно, "сколько ни называй". Здесь пишется усилительная частица "ни" согласно элементарной логике (много раз называй)и правилу о частице "ни" в придаточных уступительных
Эта тема не так проста, так как встречаются парные варианты, например: а) Сколько ни назовешь городов, я назову больше - СПП с придаточным уступительным, усилительная частица НИ относится к союзному слову СКОЛЬКО, нет отрицания, но есть усиление утвердительного значения. б) Я назову столько городов, сколько ты не наз...
24,505
As we all know, werewolves are humans that are transformed into ravenous flesh eating monsters. Some are [sentient](http://en.wikipedia.org/wiki/The_Wolf%27s_Hour), but most appear to be feral hunters of humans. Is there such a thing as reverse Lycanthropy? If so, what is the first story of an animal cyclicly turning i...
2012/10/09
[ "https://scifi.stackexchange.com/questions/24505", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/4356/" ]
In the Terry Pratchett Discworld Novel Reaper Man, the character [Lupine](http://wiki.lspace.org/wiki/Lupine) is a wolf who, under the full moon, turns into a wolf-man.
If you count role playing games, then yes. Both the 1st Edition of Dungeons and Dragons and in more recent versions, there were creatures known as [wolfweres](http://en.wikipedia.org/wiki/Wolfwere_%28Dungeons_&_Dragons%29). These were wolves that gained the ability to turn into humans. I don't know if they have any pre...
24,505
As we all know, werewolves are humans that are transformed into ravenous flesh eating monsters. Some are [sentient](http://en.wikipedia.org/wiki/The_Wolf%27s_Hour), but most appear to be feral hunters of humans. Is there such a thing as reverse Lycanthropy? If so, what is the first story of an animal cyclicly turning i...
2012/10/09
[ "https://scifi.stackexchange.com/questions/24505", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/4356/" ]
Likely not what you're looking for, but the nature of "first appearance" questions typically warrants this token "ancient legend" response: I can't give an accurate date, but these stories are typically over 1000 years old, for fun. Most are likely 2000 or more years old. In many ancient Asian legends there are stori...
If you count role playing games, then yes. Both the 1st Edition of Dungeons and Dragons and in more recent versions, there were creatures known as [wolfweres](http://en.wikipedia.org/wiki/Wolfwere_%28Dungeons_&_Dragons%29). These were wolves that gained the ability to turn into humans. I don't know if they have any pre...
24,505
As we all know, werewolves are humans that are transformed into ravenous flesh eating monsters. Some are [sentient](http://en.wikipedia.org/wiki/The_Wolf%27s_Hour), but most appear to be feral hunters of humans. Is there such a thing as reverse Lycanthropy? If so, what is the first story of an animal cyclicly turning i...
2012/10/09
[ "https://scifi.stackexchange.com/questions/24505", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/4356/" ]
Likely not what you're looking for, but the nature of "first appearance" questions typically warrants this token "ancient legend" response: I can't give an accurate date, but these stories are typically over 1000 years old, for fun. Most are likely 2000 or more years old. In many ancient Asian legends there are stori...
In the Terry Pratchett Discworld Novel Reaper Man, the character [Lupine](http://wiki.lspace.org/wiki/Lupine) is a wolf who, under the full moon, turns into a wolf-man.
24,505
As we all know, werewolves are humans that are transformed into ravenous flesh eating monsters. Some are [sentient](http://en.wikipedia.org/wiki/The_Wolf%27s_Hour), but most appear to be feral hunters of humans. Is there such a thing as reverse Lycanthropy? If so, what is the first story of an animal cyclicly turning i...
2012/10/09
[ "https://scifi.stackexchange.com/questions/24505", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/4356/" ]
In the Terry Pratchett Discworld Novel Reaper Man, the character [Lupine](http://wiki.lspace.org/wiki/Lupine) is a wolf who, under the full moon, turns into a wolf-man.
In The Harry Dresden series, there is a book where a character is actually a wolf who takes human form by choice. (Spoilers): > > In Fool Moon, Tera advises the Alphas, whom she met via the Northwest Passage Project, and agreed to teach them the ways of being a wolf. > At the end of Fool Moon, she left civilizatio...
24,505
As we all know, werewolves are humans that are transformed into ravenous flesh eating monsters. Some are [sentient](http://en.wikipedia.org/wiki/The_Wolf%27s_Hour), but most appear to be feral hunters of humans. Is there such a thing as reverse Lycanthropy? If so, what is the first story of an animal cyclicly turning i...
2012/10/09
[ "https://scifi.stackexchange.com/questions/24505", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/4356/" ]
In the Terry Pratchett Discworld Novel Reaper Man, the character [Lupine](http://wiki.lspace.org/wiki/Lupine) is a wolf who, under the full moon, turns into a wolf-man.
We have an accepted answer which is definitely older, but for future querents, I want to mention Peter David's 1989 novel, *[Howling Mad](http://www.goodreads.com/book/show/175935.Howling_Mad)*, features a wolf bitten by a werewolf who's cursed to turn human under the full moon. It's a romance novel, of sorts.
24,505
As we all know, werewolves are humans that are transformed into ravenous flesh eating monsters. Some are [sentient](http://en.wikipedia.org/wiki/The_Wolf%27s_Hour), but most appear to be feral hunters of humans. Is there such a thing as reverse Lycanthropy? If so, what is the first story of an animal cyclicly turning i...
2012/10/09
[ "https://scifi.stackexchange.com/questions/24505", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/4356/" ]
Likely not what you're looking for, but the nature of "first appearance" questions typically warrants this token "ancient legend" response: I can't give an accurate date, but these stories are typically over 1000 years old, for fun. Most are likely 2000 or more years old. In many ancient Asian legends there are stori...
In The Harry Dresden series, there is a book where a character is actually a wolf who takes human form by choice. (Spoilers): > > In Fool Moon, Tera advises the Alphas, whom she met via the Northwest Passage Project, and agreed to teach them the ways of being a wolf. > At the end of Fool Moon, she left civilizatio...
24,505
As we all know, werewolves are humans that are transformed into ravenous flesh eating monsters. Some are [sentient](http://en.wikipedia.org/wiki/The_Wolf%27s_Hour), but most appear to be feral hunters of humans. Is there such a thing as reverse Lycanthropy? If so, what is the first story of an animal cyclicly turning i...
2012/10/09
[ "https://scifi.stackexchange.com/questions/24505", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/4356/" ]
Likely not what you're looking for, but the nature of "first appearance" questions typically warrants this token "ancient legend" response: I can't give an accurate date, but these stories are typically over 1000 years old, for fun. Most are likely 2000 or more years old. In many ancient Asian legends there are stori...
We have an accepted answer which is definitely older, but for future querents, I want to mention Peter David's 1989 novel, *[Howling Mad](http://www.goodreads.com/book/show/175935.Howling_Mad)*, features a wolf bitten by a werewolf who's cursed to turn human under the full moon. It's a romance novel, of sorts.
64,243,987
why does View::make() not exist in laravel docs? I have gone through on xVersion/views pages of all versions of Laravel docs, but I couldn't find any statement about View::make(). who can explain to me how it works? additional info, I'm learning Aimeos Laravel package. I don't think View::make is from Aimeos packages....
2020/10/07
[ "https://Stackoverflow.com/questions/64243987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12471661/" ]
You are adding the `onclick` click handler to the array of elements instead of the elements themselves - you need to add a click handler to *each* of the elements, like this (see comments for more info): ``` // 1. Use querySelectorAll to get a NodeList that we can add the listener to let options = document.querySelect...
you have to add each option the proper event like so: ```js let options = document.querySelectorAll('.container .option'); function unselectAll() { options.forEach(option => { option.style.backgroundColor = ""; }); } options.forEach(option => { option.addEventListener('click', event => { unselectAll();...
64,243,987
why does View::make() not exist in laravel docs? I have gone through on xVersion/views pages of all versions of Laravel docs, but I couldn't find any statement about View::make(). who can explain to me how it works? additional info, I'm learning Aimeos Laravel package. I don't think View::make is from Aimeos packages....
2020/10/07
[ "https://Stackoverflow.com/questions/64243987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12471661/" ]
You are adding the `onclick` click handler to the array of elements instead of the elements themselves - you need to add a click handler to *each* of the elements, like this (see comments for more info): ``` // 1. Use querySelectorAll to get a NodeList that we can add the listener to let options = document.querySelect...
You can achieve it with vanilla JS, but since you mentioned jQuery, here's my take: CSS class ``` .option-clicked{background-color: #333;} ``` JS ``` $(".option").on("click", function(){ $(".option").removeClass("option-clicked"); $(this).addClass("option-clicked"); }); ``` <https://jsfiddle.net/hv0qnwsx/9/>...
17,349,682
I am trying to parse a xml into a map of key-value pairs as follows. Sample xml document: ``` <Students> <StudentA> <Id>123</Id> <Address>123 W </Address> <Courses> <Course1>CS203</Course1> <Course2>CS206</Course2> </Courses> </StudentA> <StudentB> ...
2013/06/27
[ "https://Stackoverflow.com/questions/17349682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1631901/" ]
I haven't used them, but [bsontools](https://github.com/dwight/bsontools) can convert from json, xml, or csv
As @WiredPrarie points out, the conversion from BSON to JSON is lossy, and it makes no sense to want to go back the other way. Workarounds include using `mongoimport` instead of `mongorestore`, or just using the original BSON. See the comments for more deails (adding this answer mainly so I can close the question)
17,349,682
I am trying to parse a xml into a map of key-value pairs as follows. Sample xml document: ``` <Students> <StudentA> <Id>123</Id> <Address>123 W </Address> <Courses> <Course1>CS203</Course1> <Course2>CS206</Course2> </Courses> </StudentA> <StudentB> ...
2013/06/27
[ "https://Stackoverflow.com/questions/17349682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1631901/" ]
I haven't used them, but [bsontools](https://github.com/dwight/bsontools) can convert from json, xml, or csv
You can try [beesn](https://gitlab.com/monnef/beesn), it converts data both ways. For your variant - `JSON -> BSON` - use the `-x` switch. Example: ``` $ beesn -x -i test-data/01.json -o my.bson ``` Disclaimer: I am an author of this tool.
20,570,314
Language: C Hello, i am having an error in this line: ``` start_board(char Board[10][10],char simbol); ``` Function start\_board: ``` void start_board(char Board[10][10],char simbol) { char BoardJ1[9][COL_MAX]; char BoardJ2[9][COL_MAX]; create_board(BoardJ1); create_board(BoardJ2); for (int ...
2013/12/13
[ "https://Stackoverflow.com/questions/20570314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3099947/" ]
Your function prototype is missing return type `void`. In absence of any type, it will implicitly converted to `int` type. So your function return type is `int` type which doesn't match with the return type of the function definition.
Besides to the return type that is not mentioned in the declaration, you have another mistake. If you pass the 2D array like that the size would be unknown. You should pass the 2D array and the size of it as below. ``` void start_board(char Board[][10], size_t size, char symbol); ```
2,409,970
I've got a question about SimpleDateFormat class and the java.util.Date's compareto method: I'm constructing a Date object, then I format, finally I parse the formatted string and compare to the original date. ``` DateFormat df = new SimpleDateFormat("yyyy.MMMdd hh:mm:ss SSS"); Date originalDate = new Date(); Strin...
2010/03/09
[ "https://Stackoverflow.com/questions/2409970", "https://Stackoverflow.com", "https://Stackoverflow.com/users/289747/" ]
I think it's a 24h related problem, your original date it's 15, so 3PM, while your parsed one is in 12 hours format, this because you used **h** format specifier instead of **H** format specifier. You hour is then turned into the wrong string so you lose precision because when parsed back `03` is considered 3AM. Try wi...
It works if you add the Am/pm marker - `a` ``` DateFormat df = new SimpleDateFormat("yyyy.MMMdd hh:mm:ss SSS a"); ```
2,409,970
I've got a question about SimpleDateFormat class and the java.util.Date's compareto method: I'm constructing a Date object, then I format, finally I parse the formatted string and compare to the original date. ``` DateFormat df = new SimpleDateFormat("yyyy.MMMdd hh:mm:ss SSS"); Date originalDate = new Date(); Strin...
2010/03/09
[ "https://Stackoverflow.com/questions/2409970", "https://Stackoverflow.com", "https://Stackoverflow.com/users/289747/" ]
I think it's a 24h related problem, your original date it's 15, so 3PM, while your parsed one is in 12 hours format, this because you used **h** format specifier instead of **H** format specifier. You hour is then turned into the wrong string so you lose precision because when parsed back `03` is considered 3AM. Try wi...
If you wish to merely compare the dates, perhaps using getTime() to compare the two values would be a better idea...
43,994,108
my dialog inheritance dialogFragment. when I button click, show dialog. but I button Click multiple times. show multiple dialog.(overlap dialog) I want show only one dialog. I try this. ``` if (dialog.getDialog().isShowing()){ //not showing dialog } else { dialog.show(); } ``` but not work. how to sho...
2017/05/16
[ "https://Stackoverflow.com/questions/43994108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7749470/" ]
It seems you only need: ``` ruta2=ruta2.loc[:, ~(ruta2.columns.str[:4].str.startswith('Prev'))] #same as #ruta2=ruta2.loc[:, ~ruta2.columns.str.startswith('Prev')] print (ruta2) Current SAN Current TRE A 5 3 B 6 6 C 12 8 ``` Or: ``` cols = ruta2.c...
``` #filter the columns names starting with 'Current' ruta2[[e for e in ruta2.columns if e.startswith('Current')]] Out[383]: Current SAN Current TRE A 5 3 B 6 6 C 12 8 ``` Or you can use a mask array to filter columns: ``` ruta2.loc[:,ruta2.columns.str....
11,164,420
I have seen several similar posts of other attributes found but not this. New to Python and Django- I've done the first part of the several tutorials including Django's "Polls" tutorial and when it gets to the point where I syncdb for my app I invariably get 'AttributeError: 'module' object has no attribute CharField. ...
2012/06/22
[ "https://Stackoverflow.com/questions/11164420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1475955/" ]
change `charfield` to: ``` CharField(max_length = 10) ``` both `C` and `F` should be capitalized
This : ``` question = models.CharField(max_length=200) ``` Instead of : ``` question = models.Charfield(max_length=200) ```
11,164,420
I have seen several similar posts of other attributes found but not this. New to Python and Django- I've done the first part of the several tutorials including Django's "Polls" tutorial and when it gets to the point where I syncdb for my app I invariably get 'AttributeError: 'module' object has no attribute CharField. ...
2012/06/22
[ "https://Stackoverflow.com/questions/11164420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1475955/" ]
That is `CharField`, with uppercase 'f', and not `Charfield` as in your code.
Use this `from django.db import models`
11,164,420
I have seen several similar posts of other attributes found but not this. New to Python and Django- I've done the first part of the several tutorials including Django's "Polls" tutorial and when it gets to the point where I syncdb for my app I invariably get 'AttributeError: 'module' object has no attribute CharField. ...
2012/06/22
[ "https://Stackoverflow.com/questions/11164420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1475955/" ]
I think in forms.py you are using ``` from django.forms import forms ``` Please use this ``` from django import forms ```
Use this `from django.db import models`
11,164,420
I have seen several similar posts of other attributes found but not this. New to Python and Django- I've done the first part of the several tutorials including Django's "Polls" tutorial and when it gets to the point where I syncdb for my app I invariably get 'AttributeError: 'module' object has no attribute CharField. ...
2012/06/22
[ "https://Stackoverflow.com/questions/11164420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1475955/" ]
change `charfield` to: ``` CharField(max_length = 10) ``` both `C` and `F` should be capitalized
I have the same error but following code works for me: ``` from django.db import models #Create your models here. class Question(models.Model): question_text = models.CharField(max_length=100) pub_date = models.DateTimeField('date published') class Choice(models.Model): choice_text = models.CharField(max...
11,164,420
I have seen several similar posts of other attributes found but not this. New to Python and Django- I've done the first part of the several tutorials including Django's "Polls" tutorial and when it gets to the point where I syncdb for my app I invariably get 'AttributeError: 'module' object has no attribute CharField. ...
2012/06/22
[ "https://Stackoverflow.com/questions/11164420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1475955/" ]
That is `CharField`, with uppercase 'f', and not `Charfield` as in your code.
I think in forms.py you are using ``` from django.forms import forms ``` Please use this ``` from django import forms ```
11,164,420
I have seen several similar posts of other attributes found but not this. New to Python and Django- I've done the first part of the several tutorials including Django's "Polls" tutorial and when it gets to the point where I syncdb for my app I invariably get 'AttributeError: 'module' object has no attribute CharField. ...
2012/06/22
[ "https://Stackoverflow.com/questions/11164420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1475955/" ]
I think in forms.py you are using ``` from django.forms import forms ``` Please use this ``` from django import forms ```
I have the same error but following code works for me: ``` from django.db import models #Create your models here. class Question(models.Model): question_text = models.CharField(max_length=100) pub_date = models.DateTimeField('date published') class Choice(models.Model): choice_text = models.CharField(max...
11,164,420
I have seen several similar posts of other attributes found but not this. New to Python and Django- I've done the first part of the several tutorials including Django's "Polls" tutorial and when it gets to the point where I syncdb for my app I invariably get 'AttributeError: 'module' object has no attribute CharField. ...
2012/06/22
[ "https://Stackoverflow.com/questions/11164420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1475955/" ]
I think in forms.py you are using ``` from django.forms import forms ``` Please use this ``` from django import forms ```
This : ``` question = models.CharField(max_length=200) ``` Instead of : ``` question = models.Charfield(max_length=200) ```
11,164,420
I have seen several similar posts of other attributes found but not this. New to Python and Django- I've done the first part of the several tutorials including Django's "Polls" tutorial and when it gets to the point where I syncdb for my app I invariably get 'AttributeError: 'module' object has no attribute CharField. ...
2012/06/22
[ "https://Stackoverflow.com/questions/11164420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1475955/" ]
That is `CharField`, with uppercase 'f', and not `Charfield` as in your code.
I have the same error but following code works for me: ``` from django.db import models #Create your models here. class Question(models.Model): question_text = models.CharField(max_length=100) pub_date = models.DateTimeField('date published') class Choice(models.Model): choice_text = models.CharField(max...
11,164,420
I have seen several similar posts of other attributes found but not this. New to Python and Django- I've done the first part of the several tutorials including Django's "Polls" tutorial and when it gets to the point where I syncdb for my app I invariably get 'AttributeError: 'module' object has no attribute CharField. ...
2012/06/22
[ "https://Stackoverflow.com/questions/11164420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1475955/" ]
That is `CharField`, with uppercase 'f', and not `Charfield` as in your code.
This : ``` question = models.CharField(max_length=200) ``` Instead of : ``` question = models.Charfield(max_length=200) ```
11,164,420
I have seen several similar posts of other attributes found but not this. New to Python and Django- I've done the first part of the several tutorials including Django's "Polls" tutorial and when it gets to the point where I syncdb for my app I invariably get 'AttributeError: 'module' object has no attribute CharField. ...
2012/06/22
[ "https://Stackoverflow.com/questions/11164420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1475955/" ]
That is `CharField`, with uppercase 'f', and not `Charfield` as in your code.
change `charfield` to: ``` CharField(max_length = 10) ``` both `C` and `F` should be capitalized
45,829,834
this code below is working fine between two computers on the same network but it doesn't work between two computers on two different networks and i have tried to use the public IP address clint ``` import socket s = socket.socket() port = 10000 ip=input("what is ip : ") s.connect((ip, port))...
2017/08/23
[ "https://Stackoverflow.com/questions/45829834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6906605/" ]
Port forwarding is something you do at the router level. For example if the two computers you are trying to connect are behind two different WiFi routers at two different homes then you need to set both WiFi routers in both locations to forward port 10000 (the one you're using) to forward to the internal IP of the comp...
If you are feeling ambitious you can follow this tutorial that removes the need to configure your devices for port forwarding. Assuming you have uPNP capable routers. <https://www.electricmonk.nl/log/2016/07/05/exploring-upnp-with-python/> And there may even be a module that takes all the leg work out.(not checked ho...
33,220,792
Been having a problem on getting [bxSlider](http://bxslider.com/) to work. I went wrong I imagine around the last step--in calling the bxSlider. Everything is linked from the same folder. **[Fiddle](http://jsfiddle.net/fq23j3sr/1/)** HTML: ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://ww...
2015/10/19
[ "https://Stackoverflow.com/questions/33220792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3532380/" ]
There are two solutions to your problem: 1. Use a constructor ``` public class buttons1 implements ActionListener{ JLabel jlab; buttons1(){ JFrame j = new JFrame("HP"); j.setSize(300,300); j.setLayout(new FlowLayout()); j.setDefaul...
It is important to understand what a [static](https://docs.oracle.com/javase/tutorial/java/javaOO/classvars.html) variable is and how it works. Static variables can not be referenced from a non-static context. ``` import javax.swing.JLabel; import javax.swing.JFrame; import javax.swing.JButton; import java.awt.event....
69,753,424
When dealing with time series forecasting, I've seen most people follow these steps when using an LSTM model: 1. Obtain, clean, and pre-process data 2. Take out validation dataset for future comparison with model predictions 3. Initialise and train LSTM model 4. Use a copy of validation dataset to be pre-processed exa...
2021/10/28
[ "https://Stackoverflow.com/questions/69753424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5490188/" ]
To predict the ith value, your LSTM model need last N values. So if you want to forecast, you should use each prediction to predict the next one. In other terms you have to loop over something like ``` prediction = model.predict(X[-N:]) X.append(prediction) ``` As you can guess, you add your output in your input th...
You have to break your data into training and testing and then fit your mode. Finally, you make a prediction like this. ``` future_predictions = model.predict(X_test) ``` Check out the link below for all details. [Time-Series Forecasting: Predicting Stock Prices Using An LSTM Model](https://towardsdatascience.com/l...
62,764,677
Edit: I appreciate all the answers but could anyone tell me why my solution is not working? I wanted to try to do this without the .startswith() thank you! I am trying to complete this excercise: > > Implement an autocomplete system. That is, given a query string and a set of all possible query strings, > return all...
2020/07/06
[ "https://Stackoverflow.com/questions/62764677", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13710434/" ]
Here is how I would accomplish what you are trying to do: ``` import re strings = ['dog', 'deer', 'deal'] search = 'de' pattern = re.compile('^' + search) [x for x in strings if pattern.match(x)] ``` RESULT: `['deer', 'deal']` However in most cases with a use case such as this, you might want to ignore the case of ...
I notice the *hint*, but it's not stated as a requirement, so: ``` def autocomplete(string,set): return [s for s in set if s.startswith(string)] print(autocomplete("de", ["dog","deer","deal"])) ``` `str.startswith(n)` will return a boolean value, `True` if the str starts with `n`, otherwise, `False`.
62,764,677
Edit: I appreciate all the answers but could anyone tell me why my solution is not working? I wanted to try to do this without the .startswith() thank you! I am trying to complete this excercise: > > Implement an autocomplete system. That is, given a query string and a set of all possible query strings, > return all...
2020/07/06
[ "https://Stackoverflow.com/questions/62764677", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13710434/" ]
Here is how I would accomplish what you are trying to do: ``` import re strings = ['dog', 'deer', 'deal'] search = 'de' pattern = re.compile('^' + search) [x for x in strings if pattern.match(x)] ``` RESULT: `['deer', 'deal']` However in most cases with a use case such as this, you might want to ignore the case of ...
You can just use the `startswith` string function and avoid all those counters, like this: ```py def autocomplete(string, set): list_to_return = [] for word in set: if word.startswith(string): list_to_return.append(word) return list_to_return print(autocomplete("de", ["dog","deer","de...
62,764,677
Edit: I appreciate all the answers but could anyone tell me why my solution is not working? I wanted to try to do this without the .startswith() thank you! I am trying to complete this excercise: > > Implement an autocomplete system. That is, given a query string and a set of all possible query strings, > return all...
2020/07/06
[ "https://Stackoverflow.com/questions/62764677", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13710434/" ]
Here is how I would accomplish what you are trying to do: ``` import re strings = ['dog', 'deer', 'deal'] search = 'de' pattern = re.compile('^' + search) [x for x in strings if pattern.match(x)] ``` RESULT: `['deer', 'deal']` However in most cases with a use case such as this, you might want to ignore the case of ...
Simplify. ``` def autocomplete(string, set): back = [] for elem in set: if elem.startswith(string[0]): back.append(elem) return back print(autocomplete("de", ["dog","deer","deal","not","this","one","dasd"])) ```
17,281,313
Is there a simple way to use Durandal's transitions to fade out an old view immediately, and fade in the new one once its activate function has resolved? Here's some context: I have a Durandal 1.2 SPA where most of the views' activate functions make service calls and return a promise as appropriate. This all works gr...
2013/06/24
[ "https://Stackoverflow.com/questions/17281313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/609641/" ]
formatting option in `phpstorm 8` settings > Code Style > php > Wrapping and braces ![enter image description here](https://i.stack.imgur.com/nSZ9U.png) check both option Align fields in option and Align Constant now you can get what you want! :) Source [Jetbrains Blog](http://blog.jetbrains.com/phpstorm/2014/06/...
In my case i'm using PHPStorm 2021.2.3, > > `Settings -> Editor -> Code Style -> PHP -> Wrapping and Braces -> match expression -> Align 'match' arm bodies` > > > [![enter image description here](https://i.stack.imgur.com/f7sSf.png)](https://i.stack.imgur.com/f7sSf.png)
17,281,313
Is there a simple way to use Durandal's transitions to fade out an old view immediately, and fade in the new one once its activate function has resolved? Here's some context: I have a Durandal 1.2 SPA where most of the views' activate functions make service calls and return a promise as appropriate. This all works gr...
2013/06/24
[ "https://Stackoverflow.com/questions/17281313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/609641/" ]
Cmd+Alt+L (in Mac) or Ctrl+Alt+L (Win) and PHP Storm will format code depends of your Code style in Settings. TO set this code style go: File -> Settings -> Code style -> PHP(choose here your language) -> Other -> Align key-value pair - mark as checked. And then press Reformat code (Ctrl+Alt+L) and voila. You will get...
In PhpStorm 8 that option is in: ``` File -> Settings -> Code style -> PHP -> Wrapping and Braces -> Assignment statement ```
17,281,313
Is there a simple way to use Durandal's transitions to fade out an old view immediately, and fade in the new one once its activate function has resolved? Here's some context: I have a Durandal 1.2 SPA where most of the views' activate functions make service calls and return a promise as appropriate. This all works gr...
2013/06/24
[ "https://Stackoverflow.com/questions/17281313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/609641/" ]
In PhpStorm 8 that option is in: ``` File -> Settings -> Code style -> PHP -> Wrapping and Braces -> Assignment statement ```
A visual update for 2019.1 and newer versions on Mac: Go to `PHP Storm` > `Preferences` > `Editor` > `Code Style` > `PHP` > `Wrapping and Braces` > `Assignment Statement` > `Align consecutive assignments`. To activate it go to `Code` > `Reformat Code` or press `Cmd+Opt+L`. [![enter image description here](https://i....
17,281,313
Is there a simple way to use Durandal's transitions to fade out an old view immediately, and fade in the new one once its activate function has resolved? Here's some context: I have a Durandal 1.2 SPA where most of the views' activate functions make service calls and return a promise as appropriate. This all works gr...
2013/06/24
[ "https://Stackoverflow.com/questions/17281313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/609641/" ]
For me in PhpStorm 8.0.2 I found it here: > > Settings -> Editor -> Code Style -> PHP -> Wrapping and Braces -> Align consecutive assignments > > >
A visual update for 2019.1 and newer versions on Mac: Go to `PHP Storm` > `Preferences` > `Editor` > `Code Style` > `PHP` > `Wrapping and Braces` > `Assignment Statement` > `Align consecutive assignments`. To activate it go to `Code` > `Reformat Code` or press `Cmd+Opt+L`. [![enter image description here](https://i....
17,281,313
Is there a simple way to use Durandal's transitions to fade out an old view immediately, and fade in the new one once its activate function has resolved? Here's some context: I have a Durandal 1.2 SPA where most of the views' activate functions make service calls and return a promise as appropriate. This all works gr...
2013/06/24
[ "https://Stackoverflow.com/questions/17281313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/609641/" ]
Cmd+Alt+L (in Mac) or Ctrl+Alt+L (Win) and PHP Storm will format code depends of your Code style in Settings. TO set this code style go: File -> Settings -> Code style -> PHP(choose here your language) -> Other -> Align key-value pair - mark as checked. And then press Reformat code (Ctrl+Alt+L) and voila. You will get...
We have to check multiple options as below to get * Problem mentioned above * Key value pair alignment of array [![enter image description here](https://i.stack.imgur.com/ychyJ.png)](https://i.stack.imgur.com/ychyJ.png)
17,281,313
Is there a simple way to use Durandal's transitions to fade out an old view immediately, and fade in the new one once its activate function has resolved? Here's some context: I have a Durandal 1.2 SPA where most of the views' activate functions make service calls and return a promise as appropriate. This all works gr...
2013/06/24
[ "https://Stackoverflow.com/questions/17281313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/609641/" ]
We have to check multiple options as below to get * Problem mentioned above * Key value pair alignment of array [![enter image description here](https://i.stack.imgur.com/ychyJ.png)](https://i.stack.imgur.com/ychyJ.png)
In my case i'm using PHPStorm 2021.2.3, > > `Settings -> Editor -> Code Style -> PHP -> Wrapping and Braces -> match expression -> Align 'match' arm bodies` > > > [![enter image description here](https://i.stack.imgur.com/f7sSf.png)](https://i.stack.imgur.com/f7sSf.png)
17,281,313
Is there a simple way to use Durandal's transitions to fade out an old view immediately, and fade in the new one once its activate function has resolved? Here's some context: I have a Durandal 1.2 SPA where most of the views' activate functions make service calls and return a promise as appropriate. This all works gr...
2013/06/24
[ "https://Stackoverflow.com/questions/17281313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/609641/" ]
A visual update for 2019.1 and newer versions on Mac: Go to `PHP Storm` > `Preferences` > `Editor` > `Code Style` > `PHP` > `Wrapping and Braces` > `Assignment Statement` > `Align consecutive assignments`. To activate it go to `Code` > `Reformat Code` or press `Cmd+Opt+L`. [![enter image description here](https://i....
In my case i'm using PHPStorm 2021.2.3, > > `Settings -> Editor -> Code Style -> PHP -> Wrapping and Braces -> match expression -> Align 'match' arm bodies` > > > [![enter image description here](https://i.stack.imgur.com/f7sSf.png)](https://i.stack.imgur.com/f7sSf.png)
17,281,313
Is there a simple way to use Durandal's transitions to fade out an old view immediately, and fade in the new one once its activate function has resolved? Here's some context: I have a Durandal 1.2 SPA where most of the views' activate functions make service calls and return a promise as appropriate. This all works gr...
2013/06/24
[ "https://Stackoverflow.com/questions/17281313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/609641/" ]
formatting option in `phpstorm 8` settings > Code Style > php > Wrapping and braces ![enter image description here](https://i.stack.imgur.com/nSZ9U.png) check both option Align fields in option and Align Constant now you can get what you want! :) Source [Jetbrains Blog](http://blog.jetbrains.com/phpstorm/2014/06/...
In PhpStorm 8 that option is in: ``` File -> Settings -> Code style -> PHP -> Wrapping and Braces -> Assignment statement ```
17,281,313
Is there a simple way to use Durandal's transitions to fade out an old view immediately, and fade in the new one once its activate function has resolved? Here's some context: I have a Durandal 1.2 SPA where most of the views' activate functions make service calls and return a promise as appropriate. This all works gr...
2013/06/24
[ "https://Stackoverflow.com/questions/17281313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/609641/" ]
In PhpStorm 8 that option is in: ``` File -> Settings -> Code style -> PHP -> Wrapping and Braces -> Assignment statement ```
In my case i'm using PHPStorm 2021.2.3, > > `Settings -> Editor -> Code Style -> PHP -> Wrapping and Braces -> match expression -> Align 'match' arm bodies` > > > [![enter image description here](https://i.stack.imgur.com/f7sSf.png)](https://i.stack.imgur.com/f7sSf.png)
17,281,313
Is there a simple way to use Durandal's transitions to fade out an old view immediately, and fade in the new one once its activate function has resolved? Here's some context: I have a Durandal 1.2 SPA where most of the views' activate functions make service calls and return a promise as appropriate. This all works gr...
2013/06/24
[ "https://Stackoverflow.com/questions/17281313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/609641/" ]
Cmd+Alt+L (in Mac) or Ctrl+Alt+L (Win) and PHP Storm will format code depends of your Code style in Settings. TO set this code style go: File -> Settings -> Code style -> PHP(choose here your language) -> Other -> Align key-value pair - mark as checked. And then press Reformat code (Ctrl+Alt+L) and voila. You will get...
For me in PhpStorm 8.0.2 I found it here: > > Settings -> Editor -> Code Style -> PHP -> Wrapping and Braces -> Align consecutive assignments > > >
30,506
I'm looking for a tool/framework (preferably in Java if it involves coding) that allows me to load test a server. I need to be able to launch multiple EC2 instances, hit the server hard for a period of time, log the response times to something that can be graphed (i.e. CloudWatch?), and then shutdown the instances. Aut...
2017/11/10
[ "https://sqa.stackexchange.com/questions/30506", "https://sqa.stackexchange.com", "https://sqa.stackexchange.com/users/29017/" ]
Before anything, I would recommend you to think about an important point: What is the main purpose behind your test? Try to define your SLO/SLIs first (KPIs). For example if the KPI is "throughput", then you need to think about what should be your scaling policy and allow Autoscaling to do the Adding/Removing in...
There are several ways you can kick off and terminate an AWS instance, to wit: * [CreateInstance](http://docs.aws.amazon.com/opsworks/latest/APIReference/API_CreateInstance.html) and [TerminateInstances](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_TerminateInstances.html) methods of the [Amazon EC2 REST ...
20,022,618
I've got an array of characters which could contain a NULL character. The array is not null-terminated, but I do know it's length. **Question** How do I output this exact array (including null characters) and nothing else (no trailing \n) to stdout? Unfortunately, I am not allowed to output one character at a t...
2013/11/16
[ "https://Stackoverflow.com/questions/20022618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1554503/" ]
``` char buffer[SIZE]; if(fwrite(buffer, 1, SIZE, stdout) != SIZE) { perror("fwrite"); } ```
This should do the trick ``` size_t rt = write(STDOUT_FILENO, &yourCharArray, SIZE_OF_YOUR_ARRAY); ``` where `rt` is the number of the actual written bytes
20,022,618
I've got an array of characters which could contain a NULL character. The array is not null-terminated, but I do know it's length. **Question** How do I output this exact array (including null characters) and nothing else (no trailing \n) to stdout? Unfortunately, I am not allowed to output one character at a t...
2013/11/16
[ "https://Stackoverflow.com/questions/20022618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1554503/" ]
``` char buffer[SIZE]; if(fwrite(buffer, 1, SIZE, stdout) != SIZE) { perror("fwrite"); } ```
Here you go: ``` char arr[SIZE] fwrite(arr, sizeof(char), SIZE, stdout) ``` fwrite is in stdio.h