qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
42,466,748
I have an odd problem. I am attempting to create a quote generator that has a dictionary of sections of a quote (each value is a list), pulls a random item from that list for each key and appends that to another list. That list will then be printed to show the final quote. However, I am getting the quote's sections in...
2017/02/26
[ "https://Stackoverflow.com/questions/42466748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can use an [`OrderedDict`](https://docs.python.org/2/library/collections.html#collections.OrderedDict)! In a common [`dict`](https://docs.python.org/2/library/stdtypes.html#dict) there is no guarantee about the `keys`' or `items`' order: ``` from collections import OrderedDict quoteWords = OrderedDict([ ("one"...
I guess you are using Python2. In Python, the dict is not ordered though your code runs correctly in Python3 (thanks @schwobaseggl): ``` (ins)>>> quoteWords = { (ins)... "one": ["Sometimes ", "Often ", "Occasionally ", "Usually "], (ins)... "two": ["it's best to ", "you should ", "you shouldn't ", "it's easy t...
42,466,748
I have an odd problem. I am attempting to create a quote generator that has a dictionary of sections of a quote (each value is a list), pulls a random item from that list for each key and appends that to another list. That list will then be printed to show the final quote. However, I am getting the quote's sections in...
2017/02/26
[ "https://Stackoverflow.com/questions/42466748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Dictionaries don't have order. `for key in quoteWords` has no guaranteed order in which the `keys` will be returned. You should use an `OrderedDict`: ``` from random import choice from collections import OrderedDict quoteWords = OrderedDict() quoteWords['one'] = ["Sometimes ", "Often ", "Occasionally ", "Usually...
I guess you are using Python2. In Python, the dict is not ordered though your code runs correctly in Python3 (thanks @schwobaseggl): ``` (ins)>>> quoteWords = { (ins)... "one": ["Sometimes ", "Often ", "Occasionally ", "Usually "], (ins)... "two": ["it's best to ", "you should ", "you shouldn't ", "it's easy t...
310,159
I'm diving into the world of functional programming and I keep reading everywhere that functional languages are better for multithreading/multicore programs. I understand how functional languages do a lot of things differently, such as [recursion](https://softwareengineering.stackexchange.com/questions/149167/are-funct...
2016/02/15
[ "https://softwareengineering.stackexchange.com/questions/310159", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/46143/" ]
The reason people say functional languages are better for parallel processing is due to the fact that they ***usually*** avoid mutable state. Mutable state is the "root of all evil" in the context of parallel processing; they make it really easy to run into race conditions when they are shared between concurrent proces...
In Haskell, modification is literally impossible without getting special modifiable variables through a modification library. Instead, functions create the variables they need at the same time as their values (which are computed lazily), and garbage collected when no longer needed. Even when you do need modification v...
310,159
I'm diving into the world of functional programming and I keep reading everywhere that functional languages are better for multithreading/multicore programs. I understand how functional languages do a lot of things differently, such as [recursion](https://softwareengineering.stackexchange.com/questions/149167/are-funct...
2016/02/15
[ "https://softwareengineering.stackexchange.com/questions/310159", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/46143/" ]
The reason people say functional languages are better for parallel processing is due to the fact that they ***usually*** avoid mutable state. Mutable state is the "root of all evil" in the context of parallel processing; they make it really easy to run into race conditions when they are shared between concurrent proces...
Sort of both. It's faster because it's easier to write your code in a way that's easier to compile faster. You won't necessarily get a speed difference by switching languages, but if you had started with a functional language, you could have probably done the multithreading with a lot less *programmer* effort. Along th...
310,159
I'm diving into the world of functional programming and I keep reading everywhere that functional languages are better for multithreading/multicore programs. I understand how functional languages do a lot of things differently, such as [recursion](https://softwareengineering.stackexchange.com/questions/149167/are-funct...
2016/02/15
[ "https://softwareengineering.stackexchange.com/questions/310159", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/46143/" ]
The reason people say functional languages are better for parallel processing is due to the fact that they ***usually*** avoid mutable state. Mutable state is the "root of all evil" in the context of parallel processing; they make it really easy to run into race conditions when they are shared between concurrent proces...
Functional programming doesn't make for faster programs, as a general rule. What it makes is for **easier** parallel and concurrent programming. There are two main keys to this: 1. The avoidance of mutable state tends to reduce the number of things that can go wrong in a program, and even more so in a concurrent progr...
310,159
I'm diving into the world of functional programming and I keep reading everywhere that functional languages are better for multithreading/multicore programs. I understand how functional languages do a lot of things differently, such as [recursion](https://softwareengineering.stackexchange.com/questions/149167/are-funct...
2016/02/15
[ "https://softwareengineering.stackexchange.com/questions/310159", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/46143/" ]
Sort of both. It's faster because it's easier to write your code in a way that's easier to compile faster. You won't necessarily get a speed difference by switching languages, but if you had started with a functional language, you could have probably done the multithreading with a lot less *programmer* effort. Along th...
In Haskell, modification is literally impossible without getting special modifiable variables through a modification library. Instead, functions create the variables they need at the same time as their values (which are computed lazily), and garbage collected when no longer needed. Even when you do need modification v...
310,159
I'm diving into the world of functional programming and I keep reading everywhere that functional languages are better for multithreading/multicore programs. I understand how functional languages do a lot of things differently, such as [recursion](https://softwareengineering.stackexchange.com/questions/149167/are-funct...
2016/02/15
[ "https://softwareengineering.stackexchange.com/questions/310159", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/46143/" ]
Functional programming doesn't make for faster programs, as a general rule. What it makes is for **easier** parallel and concurrent programming. There are two main keys to this: 1. The avoidance of mutable state tends to reduce the number of things that can go wrong in a program, and even more so in a concurrent progr...
In Haskell, modification is literally impossible without getting special modifiable variables through a modification library. Instead, functions create the variables they need at the same time as their values (which are computed lazily), and garbage collected when no longer needed. Even when you do need modification v...
72,467,744
Hello I have a datagram on the following format: ``` set.seed(42) df = data_frame(contigs = sprintf("k141_%s",floor(runif(100, min = 20, max = 200))), start = floor(runif(100, min = 100, max = 115)), end = floor(runif(100, min = 800, max = 830))) df ``` [![i...
2022/06/01
[ "https://Stackoverflow.com/questions/72467744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14387264/" ]
Asteroid is on the right track, but couple other issues... You are not giving the views of the child controllers any constraints, so they load at their "native" size. Changing your `addViewController(...)` func as advised by Asteroid solves the `A` and `B` missing constraints, but... You are calling that same func f...
Update as following: ``` func addViewController(_ child: UIViewController) { addChild(child) view.addSubview(child.view) child.didMove(toParent: self) child.view.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ child.view.leadingAnchor.constraint(equalTo: vi...
2,383
If you have an at home draft system, how do you check for leaks in the CO2 side of the set up? How often do you need to check for leaks?
2010/07/23
[ "https://homebrew.stackexchange.com/questions/2383", "https://homebrew.stackexchange.com", "https://homebrew.stackexchange.com/users/419/" ]
Drip soapy water on connections and areas of the system that are likely to leak and look for suds (that indicates a leak). This is how you test natural gas lines for leaks, so I imagine it would work with CO2.
When I had my kegging setup set up I don't know that I ever checked for leaks. But, it appeared to be working just fine. My guess would be to drop any connection point into water while the system is operating, if that is a possibility, and look for bubbles. Otherwise, take soapy water and rub it all over connection po...
70,724,981
I have a table that contains users of my system. The `order` table has columns: ``` id | user_id | price ``` Where `user_id` is foreign key. Problem is that if user not registered there is no `user_id`. It means order cannot be placed because violates the integrity.
2022/01/15
[ "https://Stackoverflow.com/questions/70724981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Make `user_id` nullable and insert a `NULL`, if there's no user associated with an order.
add a column to your user table where you mark if he is registered or not. With this you can make the whole registration process, if need be, else you keep the unregistered users, till taxes and law it requires and the delete the users whenit is proper.
16,983,996
If I have a 6 length list like this: `l = ["AA","BB","CC","DD"]` I can print it with: `print "%-2s %-2s %-2s %-2s" % tuple(l)` The output will be: `AA BB CC DD` But what if the list l could be in any length? Is there a way to print the list in the same format with unknown number of elements?
2013/06/07
[ "https://Stackoverflow.com/questions/16983996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1692261/" ]
Generate separate snippets and join them: ``` print ' '.join(['%-2s' % (i,) for i in l]) ``` Or you can use string multiplication: ``` print ('%-2s ' * len(l))[:-1] % tuple(l) ``` The `[:-1]` removes the extraneous space at the end; you could use `.rstrip()` as well. Demo: ``` >>> print ' '.join(['%-2s' % (i,) ...
``` tests = [ ["AA"], ["AA", "BB"], ["AA", "BBB", "CCC"] ] for test in tests: format_str = "%-2s " * len(test) print format_str --output:-- %-2s %-2s %-2s %-2s %-2s %-2s ```
16,983,996
If I have a 6 length list like this: `l = ["AA","BB","CC","DD"]` I can print it with: `print "%-2s %-2s %-2s %-2s" % tuple(l)` The output will be: `AA BB CC DD` But what if the list l could be in any length? Is there a way to print the list in the same format with unknown number of elements?
2013/06/07
[ "https://Stackoverflow.com/questions/16983996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1692261/" ]
Generate separate snippets and join them: ``` print ' '.join(['%-2s' % (i,) for i in l]) ``` Or you can use string multiplication: ``` print ('%-2s ' * len(l))[:-1] % tuple(l) ``` The `[:-1]` removes the extraneous space at the end; you could use `.rstrip()` as well. Demo: ``` >>> print ' '.join(['%-2s' % (i,) ...
Another approach ``` ' '.join(['%-2s' for i in l])%tuple(l) ``` I found this to be more than twice as fast as using a generator expression ``` ' '.join('%-2s' for i in l)%tuple(l) ``` This is faster still ``` '%-2s '*len(l)%tuple(l) # leaves an extra trailing space though ```
16,983,996
If I have a 6 length list like this: `l = ["AA","BB","CC","DD"]` I can print it with: `print "%-2s %-2s %-2s %-2s" % tuple(l)` The output will be: `AA BB CC DD` But what if the list l could be in any length? Is there a way to print the list in the same format with unknown number of elements?
2013/06/07
[ "https://Stackoverflow.com/questions/16983996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1692261/" ]
Another approach ``` ' '.join(['%-2s' for i in l])%tuple(l) ``` I found this to be more than twice as fast as using a generator expression ``` ' '.join('%-2s' for i in l)%tuple(l) ``` This is faster still ``` '%-2s '*len(l)%tuple(l) # leaves an extra trailing space though ```
``` tests = [ ["AA"], ["AA", "BB"], ["AA", "BBB", "CCC"] ] for test in tests: format_str = "%-2s " * len(test) print format_str --output:-- %-2s %-2s %-2s %-2s %-2s %-2s ```
50,029,511
I'm trying to create a trigger for a class that updates customer balance depending on how many days late or early the item was returned. I have a charter table that has a due date and return date, the trigger is designed to only fire when the return date is being updated. The trigger then takes the difference between r...
2018/04/25
[ "https://Stackoverflow.com/questions/50029511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9252517/" ]
There are some little formatting errors. The following may be used, alternatively : ``` CREATE OR REPLACE TRIGGER Fee_Trigger AFTER UPDATE ON CHARTER FOR EACH ROW WHEN ((NEW.Return_Date <> OLD.Return_Date AND NEW.Return_Date IS NOT NULL)) DECLARE Fee NUMBER; BEGIN Fee := :NEW.Return_Date - :NEW.Due_Date; IF ...
I suggest replacing the `IF/ELSIF` statements with a CASE expression in the UPDATE statement: ``` CREATE OR REPLACE TRIGGER Fee_Trigger AFTER UPDATE ON CHARTER FOR EACH ROW WHEN ((:NEW.Return_Date <> :OLD.Return_Date AND :NEW.Return_Date IS NOT NULL)) DECLARE Due_Date DATE := TRUNC(SYSDAT...
48,318
I was working on a programmed simulation of an FMC. I was wondering, regarding airways, if there can be more than one airway with the same name in the world. i.e can there be more than one airway named UL602?
2018/02/06
[ "https://aviation.stackexchange.com/questions/48318", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/28799/" ]
No. From ICAO SARPs Annex 11 'Air Traffic Services' Appendix 1: > > 3.1.3 A basic designator assigned to one route **shall not** > be assigned to any other route. > > > And to clarify what is meant by designator for the ATS routes (airways): a designator is a letter followed by 1 to 3 digits (1 to 999). In your...
Yes. It may not be ICAO, but there are several military aerial refueling routes with same-name civilian routes. AR11, AR14, and AR24 are the ones I've worked with. These are aerial refueling routes in Nebraska and Wyoming. There are civilian routes with the same names in Canadian airspace. These names confused our s...
24,978,420
I can't get event tracking to work for a submit button press on a site. The relevant code is button class="btn-submit validate contact-btn " type="submit" onclick="\_gaq.push(['\_trackEvent', 'ClutchEnquiry', 'Submit']);" >SUBMIT Is this syntax correct?
2014/07/27
[ "https://Stackoverflow.com/questions/24978420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3881131/" ]
<https://developers.google.com/analytics/devguides/collection/analyticsjs/sending-hits> ``` // Gets a reference to the form element, assuming // it contains the id attribute "signup-form". var form = document.getElementById('signup-form'); // Adds a listener for the "submit" event. form.addEventLi...
Are you using the correct analytics object (ie. \_gaq or ga)? It would depend on whether you are using Universal Analytics (analytics.js) or classic Google Analytics (ga.js) in your snippet. From you onclick handler, it looks like you may be using classic, but I've seen situations where the user mixes up the \_gaq and ...
24,978,420
I can't get event tracking to work for a submit button press on a site. The relevant code is button class="btn-submit validate contact-btn " type="submit" onclick="\_gaq.push(['\_trackEvent', 'ClutchEnquiry', 'Submit']);" >SUBMIT Is this syntax correct?
2014/07/27
[ "https://Stackoverflow.com/questions/24978420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3881131/" ]
Are you using the correct analytics object (ie. \_gaq or ga)? It would depend on whether you are using Universal Analytics (analytics.js) or classic Google Analytics (ga.js) in your snippet. From you onclick handler, it looks like you may be using classic, but I've seen situations where the user mixes up the \_gaq and ...
Nyuen is correct. You most likely are using Universal analytics so the JS object you want to use is below: New syntax: ``` ga('send', 'event', 'button', 'click', 'ClutchEnquiry') ``` Old Syntax: ``` _gaq.push['_trackEvent', 'ClutchEnquiry', 'Submit']) ```
24,978,420
I can't get event tracking to work for a submit button press on a site. The relevant code is button class="btn-submit validate contact-btn " type="submit" onclick="\_gaq.push(['\_trackEvent', 'ClutchEnquiry', 'Submit']);" >SUBMIT Is this syntax correct?
2014/07/27
[ "https://Stackoverflow.com/questions/24978420", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3881131/" ]
<https://developers.google.com/analytics/devguides/collection/analyticsjs/sending-hits> ``` // Gets a reference to the form element, assuming // it contains the id attribute "signup-form". var form = document.getElementById('signup-form'); // Adds a listener for the "submit" event. form.addEventLi...
Nyuen is correct. You most likely are using Universal analytics so the JS object you want to use is below: New syntax: ``` ga('send', 'event', 'button', 'click', 'ClutchEnquiry') ``` Old Syntax: ``` _gaq.push['_trackEvent', 'ClutchEnquiry', 'Submit']) ```
4,182,683
I try to pass a template variable to a tag as parameter, not sure how it works. For instance in template html ``` {{ question.author_id }} {% monetize_slot question.author_id "questioner" %} ``` Here I can see the webpage show question.author\_id as "2", but when I try to pass it via the tag monetize\_slot, it tr...
2010/11/15
[ "https://Stackoverflow.com/questions/4182683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/257208/" ]
The code for the plugin *acts* like it handles any number at once, but [it basically comes down to this](https://github.com/malsup/form/blob/master/jquery.form.js#L170): ``` $.ajax(options); ``` And the [`data` in that option set](https://github.com/malsup/form/blob/master/jquery.form.js#L122) [comes from](https://g...
as far as I see it ajaxSubmit does not handle each result from the selector.
23,722,335
Hi i have this problem: I want to click on div which will flipped (this is work) but next step is flipp div back on click on "x" (this is my problem). HTML code: ``` <div class="col-md-4"> <div class="balik"> <div class="panel panel-default panel-cube"> <div class=" flip"> <div...
2014/05/18
[ "https://Stackoverflow.com/questions/23722335", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3355351/" ]
Your input appears sorted. You could use `join`; specify the value for the missing fields: ``` join -e "NaN" -a1 -a2 -o 1.1 2.2 first second ``` For your sample input, it'd produce: ``` comp10604_c0_seq1 AB491617.1 comp108_c0_seq1 NaN comp11450_c0_seq1 AM920464.1 comp11655_c0_seq1 HQ865168.1 comp11804_c0_seq1 KC900...
If your file is sorted and you wish to compare just one column, then [devnull](https://stackoverflow.com/a/23722428/970195) has the right answer. Here is another way using `awk`: ``` awk 'NR==FNR{seq[$1]=$2;next}{print $1,($1 in seq?seq[$1]:"NaN")}' file2 file1 comp10604_c0_seq1 AB491617.1 comp108_c0_seq1 NaN comp1...
69,513
The tooltip for Spirit Walk hints at a single effect: > > "While in the spirit realm, your movement is unhindered" > > > Which I believe references the fact that you can use it to break effects like "jailed." You can also pass through a [variety of other things.](https://gaming.stackexchange.com/questions/67387/w...
2012/05/24
[ "https://gaming.stackexchange.com/questions/69513", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/13845/" ]
[Spirit Walk](http://us.battle.net/d3/en/class/witch-doctor/active/spirit-walk) renders you invisible for the duration, although your "old" body stays where it was, and monsters can continue to attack it. If your "old" body suffers damage equal to 50% of your life, the spell ends early. In addition to the invisibility...
It grants 50% movement speed You can't avoid Diablo Claws from the floor u can pass through the walls of the champions For an other exemple of dodging damages when you got grabbed by the butcher he will hit you very bad just after and with spirit walk you can dodge this hit but it ends it instantly the walk :-p Quest...
17,390,055
As you know in `WPF` applications if you want to bind some property of specific class to a control's property, you must implement `INotifyPropertyChanged` interface to that class. Now consider that we have many normal classes which didn't implement `INotifyPropertyChanged`. they are very simple class as this example: ...
2013/06/30
[ "https://Stackoverflow.com/questions/17390055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1249792/" ]
If you are unable to modify the source classes, you can investigate the 'Behavioural Injection' features in the new release of Unity. The 'Behavioural Injection' feature permits you to wire up a class to BEHAVE as though it inherits from INotifyPropertyChanged without modifying the class itself. There is a very simila...
Move your InNotifyPropertyChanged implementation to a base class and let your view models to inherit that base class. > > Base Class > > > ``` public class BaseNotify { public event PropertyChangedEventHandler PropertyChanged; protected void OnPropertyChanged(string propertyName) { if (Property...
17,390,055
As you know in `WPF` applications if you want to bind some property of specific class to a control's property, you must implement `INotifyPropertyChanged` interface to that class. Now consider that we have many normal classes which didn't implement `INotifyPropertyChanged`. they are very simple class as this example: ...
2013/06/30
[ "https://Stackoverflow.com/questions/17390055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1249792/" ]
If you are unable to modify the source classes, you can investigate the 'Behavioural Injection' features in the new release of Unity. The 'Behavioural Injection' feature permits you to wire up a class to BEHAVE as though it inherits from INotifyPropertyChanged without modifying the class itself. There is a very simila...
I have no working IDE at hand currently but I think this might work (I'm unsure about the generics) **Helper** ``` public class Bindable<T>: RealProxy, INotifyPropertyChanged { private T obj; private Bindable(T obj) : base(typeof(T)) { this.obj = obj; } // not sure if this comp...
50,223,536
I'm trying to write a function that will capitalize the first letter of the first and last name only... any ideas on how to approach this? ``` const namesHardest = ['emIly sMith', 'angeliNA Jolie', 'braD piTt']; function capitalizeNames(peopleArray) { return peopleArray.toString().toLowerCase().split('').map(fun...
2018/05/07
[ "https://Stackoverflow.com/questions/50223536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8227859/" ]
One issue is using array.toString - that results in a string like ``` 'emIly sMith angeliNA Jolie braD piTt' ``` so, you've lost your array elements You need to work on each element individually, by using array.map ``` function capitalizeNames(peopleArray) { return peopleArray.map(function(name) { /* ...
```js let namesHardest = ['emIly sMith', 'angeliNA Jolie', 'braD piTt']; namesHardest = namesHardest.map(val => { let [first, last] = val.toLowerCase().split(' '); first = first.replace(first[0], first[0].toUpperCase()); last = last.replace(last[0], last[0].toUpperCase()); return `${first} ${last}` ...
50,223,536
I'm trying to write a function that will capitalize the first letter of the first and last name only... any ideas on how to approach this? ``` const namesHardest = ['emIly sMith', 'angeliNA Jolie', 'braD piTt']; function capitalizeNames(peopleArray) { return peopleArray.toString().toLowerCase().split('').map(fun...
2018/05/07
[ "https://Stackoverflow.com/questions/50223536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8227859/" ]
Sorry I am late to party, I'd rather use array.from with closure ```js const namesHardest = ['emIly jack sMith', 'angeliNA Jolie', 'braD piTt']; let conv=Array.from(namesHardest,a=>a.toLowerCase().replace(/\b[a-z]/g, function(letter) { return letter.toUpperCase(); })) console.log(conv); ```
```js let namesHardest = ['emIly sMith', 'angeliNA Jolie', 'braD piTt']; namesHardest = namesHardest.map(val => { let [first, last] = val.toLowerCase().split(' '); first = first.replace(first[0], first[0].toUpperCase()); last = last.replace(last[0], last[0].toUpperCase()); return `${first} ${last}` ...
50,223,536
I'm trying to write a function that will capitalize the first letter of the first and last name only... any ideas on how to approach this? ``` const namesHardest = ['emIly sMith', 'angeliNA Jolie', 'braD piTt']; function capitalizeNames(peopleArray) { return peopleArray.toString().toLowerCase().split('').map(fun...
2018/05/07
[ "https://Stackoverflow.com/questions/50223536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8227859/" ]
One issue is using array.toString - that results in a string like ``` 'emIly sMith angeliNA Jolie braD piTt' ``` so, you've lost your array elements You need to work on each element individually, by using array.map ``` function capitalizeNames(peopleArray) { return peopleArray.map(function(name) { /* ...
Your logic is a bit off. First, for each string, you need to split it by spaces to get the first and last name. Then, you can upcase the first character of each string. See below: ```js const namesHardest = ['emIly sMith', 'angeliNA Jolie', 'braD piTt']; const capitalizeName = (name) => `${name[0].toUpperCase()}${na...
50,223,536
I'm trying to write a function that will capitalize the first letter of the first and last name only... any ideas on how to approach this? ``` const namesHardest = ['emIly sMith', 'angeliNA Jolie', 'braD piTt']; function capitalizeNames(peopleArray) { return peopleArray.toString().toLowerCase().split('').map(fun...
2018/05/07
[ "https://Stackoverflow.com/questions/50223536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8227859/" ]
Sorry I am late to party, I'd rather use array.from with closure ```js const namesHardest = ['emIly jack sMith', 'angeliNA Jolie', 'braD piTt']; let conv=Array.from(namesHardest,a=>a.toLowerCase().replace(/\b[a-z]/g, function(letter) { return letter.toUpperCase(); })) console.log(conv); ```
Your logic is a bit off. First, for each string, you need to split it by spaces to get the first and last name. Then, you can upcase the first character of each string. See below: ```js const namesHardest = ['emIly sMith', 'angeliNA Jolie', 'braD piTt']; const capitalizeName = (name) => `${name[0].toUpperCase()}${na...
50,223,536
I'm trying to write a function that will capitalize the first letter of the first and last name only... any ideas on how to approach this? ``` const namesHardest = ['emIly sMith', 'angeliNA Jolie', 'braD piTt']; function capitalizeNames(peopleArray) { return peopleArray.toString().toLowerCase().split('').map(fun...
2018/05/07
[ "https://Stackoverflow.com/questions/50223536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8227859/" ]
One issue is using array.toString - that results in a string like ``` 'emIly sMith angeliNA Jolie braD piTt' ``` so, you've lost your array elements You need to work on each element individually, by using array.map ``` function capitalizeNames(peopleArray) { return peopleArray.map(function(name) { /* ...
Sorry I am late to party, I'd rather use array.from with closure ```js const namesHardest = ['emIly jack sMith', 'angeliNA Jolie', 'braD piTt']; let conv=Array.from(namesHardest,a=>a.toLowerCase().replace(/\b[a-z]/g, function(letter) { return letter.toUpperCase(); })) console.log(conv); ```
16,071,087
In SQLite I need to update row counts of a related table. The query below does what I want but it walks the table multiple times to get the counts: ``` UPDATE overallCounts SET total = (count(*) FROM widgets WHERE joinId=1234), totalC = (count(*) FROM widgets WHERE joinId=1234 AND source=0), totalL = (count(*) ...
2013/04/17
[ "https://Stackoverflow.com/questions/16071087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2292720/" ]
SQLite does not support JOINs in UPDATE queries. It is a limitation of SQLIte by design. However, you can still do it in SQLite using its powerful INSERT OR REPLACE syntax. The only disadvantage of this is that you will always have an entry in your overallCounts (if you did not have an entry it will be inserted). The s...
In the given statement, both ItemName and ItemCategoryName are updated in a single statement with UPDATE. It worked in my SQLite. ``` UPDATE Item SET ItemName='Tea powder', ItemCategoryName='Food' WHERE ItemId='1'; ```
16,071,087
In SQLite I need to update row counts of a related table. The query below does what I want but it walks the table multiple times to get the counts: ``` UPDATE overallCounts SET total = (count(*) FROM widgets WHERE joinId=1234), totalC = (count(*) FROM widgets WHERE joinId=1234 AND source=0), totalL = (count(*) ...
2013/04/17
[ "https://Stackoverflow.com/questions/16071087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2292720/" ]
SQLite does not support JOINs in UPDATE queries. It is a limitation of SQLIte by design. However, you can still do it in SQLite using its powerful INSERT OR REPLACE syntax. The only disadvantage of this is that you will always have an entry in your overallCounts (if you did not have an entry it will be inserted). The s...
@cha why not check if exists? ``` INSERT OR REPLACE INTO overallCounts (total, totalC, totalL, iic, il) SELECT count(*) as total, sum(case when source=0 then 1 else 0 end) as totalC, sum(case when source=2 then 1 else 0 end) as totalL, case when source=0 then 1 else 0 end as iic, case when source=2 then 1 el...
16,071,087
In SQLite I need to update row counts of a related table. The query below does what I want but it walks the table multiple times to get the counts: ``` UPDATE overallCounts SET total = (count(*) FROM widgets WHERE joinId=1234), totalC = (count(*) FROM widgets WHERE joinId=1234 AND source=0), totalL = (count(*) ...
2013/04/17
[ "https://Stackoverflow.com/questions/16071087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2292720/" ]
SQLite does not support JOINs in UPDATE queries. It is a limitation of SQLIte by design. However, you can still do it in SQLite using its powerful INSERT OR REPLACE syntax. The only disadvantage of this is that you will always have an entry in your overallCounts (if you did not have an entry it will be inserted). The s...
``` UPDATE overallCounts SET (total, totalC, totalL, iic, il) = (SELECT count(*) as total, sum(case when source=0 then 1 else 0 end) as totalC, sum(case when source=2 then 1 else 0 end) as totalL, case when source=0 then 1 else 0 end as iic, case when source=2 then 1 else 0 end as il FROM widget...
16,071,087
In SQLite I need to update row counts of a related table. The query below does what I want but it walks the table multiple times to get the counts: ``` UPDATE overallCounts SET total = (count(*) FROM widgets WHERE joinId=1234), totalC = (count(*) FROM widgets WHERE joinId=1234 AND source=0), totalL = (count(*) ...
2013/04/17
[ "https://Stackoverflow.com/questions/16071087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2292720/" ]
In the given statement, both ItemName and ItemCategoryName are updated in a single statement with UPDATE. It worked in my SQLite. ``` UPDATE Item SET ItemName='Tea powder', ItemCategoryName='Food' WHERE ItemId='1'; ```
@cha why not check if exists? ``` INSERT OR REPLACE INTO overallCounts (total, totalC, totalL, iic, il) SELECT count(*) as total, sum(case when source=0 then 1 else 0 end) as totalC, sum(case when source=2 then 1 else 0 end) as totalL, case when source=0 then 1 else 0 end as iic, case when source=2 then 1 el...
16,071,087
In SQLite I need to update row counts of a related table. The query below does what I want but it walks the table multiple times to get the counts: ``` UPDATE overallCounts SET total = (count(*) FROM widgets WHERE joinId=1234), totalC = (count(*) FROM widgets WHERE joinId=1234 AND source=0), totalL = (count(*) ...
2013/04/17
[ "https://Stackoverflow.com/questions/16071087", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2292720/" ]
``` UPDATE overallCounts SET (total, totalC, totalL, iic, il) = (SELECT count(*) as total, sum(case when source=0 then 1 else 0 end) as totalC, sum(case when source=2 then 1 else 0 end) as totalL, case when source=0 then 1 else 0 end as iic, case when source=2 then 1 else 0 end as il FROM widget...
@cha why not check if exists? ``` INSERT OR REPLACE INTO overallCounts (total, totalC, totalL, iic, il) SELECT count(*) as total, sum(case when source=0 then 1 else 0 end) as totalC, sum(case when source=2 then 1 else 0 end) as totalL, case when source=0 then 1 else 0 end as iic, case when source=2 then 1 el...
25,378,985
I have upgrade my gstreamer to the lastest version 1.4.0 on Linux, including the gst-plugins-base/good/bad/ugly. But when I try to play a video, I cannot find many elements, such as xvimagesink, videotestsrc and autovideosink. I want to know how can I add these elements? ``` gst-launch --gst-debug-level=3 !filesrc loc...
2014/08/19
[ "https://Stackoverflow.com/questions/25378985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2125846/" ]
Post the result of `gst-inspect` of the three plugins which you have mentioned. Try to locate below three files, these are libraries for the mentioned plugins. Please change the folder name of gstreamer version according to what you have in your machine Filename: /usr/lib/i386-linux-gnu/gstreamer-0.10/**libgstvideot...
Since most of these plugins and their names keep changing with the various versions, if not specifically required, I'd recommend using the 'autoaudiosink','autovideosink', .....'auto\*src' etc. Takes out most complications (beginner point of view)
25,378,985
I have upgrade my gstreamer to the lastest version 1.4.0 on Linux, including the gst-plugins-base/good/bad/ugly. But when I try to play a video, I cannot find many elements, such as xvimagesink, videotestsrc and autovideosink. I want to know how can I add these elements? ``` gst-launch --gst-debug-level=3 !filesrc loc...
2014/08/19
[ "https://Stackoverflow.com/questions/25378985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2125846/" ]
If you're using gstreamer 1.x you probably want to use gst-launch-1.0 and gst-inspect-1.0. It's just a guess, but maybe you installed gstreamer 1.x plugins but are using the tools from 0.10 that will look for 0.10 plugins.
Since most of these plugins and their names keep changing with the various versions, if not specifically required, I'd recommend using the 'autoaudiosink','autovideosink', .....'auto\*src' etc. Takes out most complications (beginner point of view)
25,378,985
I have upgrade my gstreamer to the lastest version 1.4.0 on Linux, including the gst-plugins-base/good/bad/ugly. But when I try to play a video, I cannot find many elements, such as xvimagesink, videotestsrc and autovideosink. I want to know how can I add these elements? ``` gst-launch --gst-debug-level=3 !filesrc loc...
2014/08/19
[ "https://Stackoverflow.com/questions/25378985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2125846/" ]
Hopefully, you will find a solution following one of the steps provided in this [thread](https://stackoverflow.com/a/61634481/11923286). In my case, runnig `export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib` made it work.
Since most of these plugins and their names keep changing with the various versions, if not specifically required, I'd recommend using the 'autoaudiosink','autovideosink', .....'auto\*src' etc. Takes out most complications (beginner point of view)
27,145,476
I'm trying to integrate the [oovoosdk](https://developer.oovoo.com) into a new Swift project. The oovoosdk is a framework written in Objective-C. I've created a bridging header and that seems to be working, because I can call this in the AppDelegate and I get back a result (the ooVooController is an interface that form...
2014/11/26
[ "https://Stackoverflow.com/questions/27145476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4295102/" ]
I eventually managed to resolve the issue. The affected view controller had a target membership (found under File Inspector) to my test suite which didn't have a bridging header configured. After removing this membership my project compiled and ran.
`ooVooController` looks like a variable you defined previously. Search the `AppDelegate` class for something like `let ooVooController = ...`. The error you get is not because the class or framework itself isn't visible but the compiler does not know the variable `ooVooController`.
35,811,053
According to [this talk](https://www.youtube.com/watch?v=Ov7s0GgBbOQ&list=PLRyNF2Y6sca0UKKZ2PTSwF3WrDjABQdcL&index=27) there is a certain pitfall when using C++11 range base `for` on Qt containers. Consider: ``` QList<MyStruct> list; for(const MyStruct &item : list) { //... } ``` The pitfall, according to the t...
2016/03/05
[ "https://Stackoverflow.com/questions/35811053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2194193/" ]
``` template<class T> std::remove_reference_t<T> const& as_const(T&&t){return t;} ``` might help. An implicitly shared object returned an rvalue can implicitly detect write-shraring (and detatch) due to non-const iteration. This gives you: ``` for(auto&&item : as_const(foo())) { } ``` which lets you iterate in a ...
Qt has an implementation to resolve this, qAsConst (see <https://doc.qt.io/qt-5/qtglobal.html#qAsConst>). The documentation says that it is Qt's version of C++17's std::as\_const().
34,133
After I ran `man ls`, it shows: > > Man: find all matching manual pages > > \* ls (1) > > ls (1p) > > Man: What manual page do you want? > > Man: > > > After I entered "1", it shows nothing but "*Manual page ls(1) line ?/? (END)*" on the status bar. I guess that I haven't installed manual page f...
2012/03/14
[ "https://unix.stackexchange.com/questions/34133", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/12224/" ]
Thanks all for your suggestions. I finally solved the problem and now `man` works. ### Answer Somebody installed both 64bit and 32bit version of `glibc`, which brings chaos I guess. After uninstall the 32bit version and reinstall 64bit version of `glibc`, `man` works. == Detailed process == * Ran `mandb -t`, lots ...
Finally the **correct** answer to this error as well: ``` QIconvCodec::convertToUnicode: using Latin-1 for conversion, iconv_open failed QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv_open failed ``` It does **not** have anything to do with your installed fonts, but with missing glibc-packages.
6,074,915
My Rails app has complicated rules about when a bit of content should be displayed on a page or not. I've decided to implement this by writing predicates (simple 'yes/no' functions) in Ruby and storing them in the db for subsequent eval'ing. It it pretty straightforward. My main concern is security: if a malicious som...
2011/05/20
[ "https://Stackoverflow.com/questions/6074915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/558639/" ]
You might want to check the 'taint' method and related stuff. This is a good reference: <http://ruby-doc.com/docs/ProgrammingRuby/html/taint.html> Despite that, I can't advise you enough against storing code and evaluating it, it's a security risk that should be avoided and most times there's a simpler way of solving...
If you want to remove some methods from your object, you can check this: [remove\_method](http://apidock.com/ruby/Module/remove_method) or [undef\_method](http://apidock.com/ruby/Module/undef_method)
6,074,915
My Rails app has complicated rules about when a bit of content should be displayed on a page or not. I've decided to implement this by writing predicates (simple 'yes/no' functions) in Ruby and storing them in the db for subsequent eval'ing. It it pretty straightforward. My main concern is security: if a malicious som...
2011/05/20
[ "https://Stackoverflow.com/questions/6074915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/558639/" ]
You might want to check the 'taint' method and related stuff. This is a good reference: <http://ruby-doc.com/docs/ProgrammingRuby/html/taint.html> Despite that, I can't advise you enough against storing code and evaluating it, it's a security risk that should be avoided and most times there's a simpler way of solving...
Assuming you're on at least ruby 1.8, you can run a proc at a different safe level. ``` def my_unsafe_function # possible unsafe stuff end proc { $SAFE = 4 # change level only inside this proc my_unsafe_function }.call ``` However, you should rethink whether you really need to store ruby code in the DB. Are ...
6,074,915
My Rails app has complicated rules about when a bit of content should be displayed on a page or not. I've decided to implement this by writing predicates (simple 'yes/no' functions) in Ruby and storing them in the db for subsequent eval'ing. It it pretty straightforward. My main concern is security: if a malicious som...
2011/05/20
[ "https://Stackoverflow.com/questions/6074915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/558639/" ]
You might want to check the 'taint' method and related stuff. This is a good reference: <http://ruby-doc.com/docs/ProgrammingRuby/html/taint.html> Despite that, I can't advise you enough against storing code and evaluating it, it's a security risk that should be avoided and most times there's a simpler way of solving...
you can do that with a sandboxing gem, <https://github.com/tario/shikashi>, which allows you to whitelist methods. credit to <https://stackoverflow.com/a/8704768/188355>
6,074,915
My Rails app has complicated rules about when a bit of content should be displayed on a page or not. I've decided to implement this by writing predicates (simple 'yes/no' functions) in Ruby and storing them in the db for subsequent eval'ing. It it pretty straightforward. My main concern is security: if a malicious som...
2011/05/20
[ "https://Stackoverflow.com/questions/6074915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/558639/" ]
Assuming you're on at least ruby 1.8, you can run a proc at a different safe level. ``` def my_unsafe_function # possible unsafe stuff end proc { $SAFE = 4 # change level only inside this proc my_unsafe_function }.call ``` However, you should rethink whether you really need to store ruby code in the DB. Are ...
If you want to remove some methods from your object, you can check this: [remove\_method](http://apidock.com/ruby/Module/remove_method) or [undef\_method](http://apidock.com/ruby/Module/undef_method)
6,074,915
My Rails app has complicated rules about when a bit of content should be displayed on a page or not. I've decided to implement this by writing predicates (simple 'yes/no' functions) in Ruby and storing them in the db for subsequent eval'ing. It it pretty straightforward. My main concern is security: if a malicious som...
2011/05/20
[ "https://Stackoverflow.com/questions/6074915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/558639/" ]
you can do that with a sandboxing gem, <https://github.com/tario/shikashi>, which allows you to whitelist methods. credit to <https://stackoverflow.com/a/8704768/188355>
If you want to remove some methods from your object, you can check this: [remove\_method](http://apidock.com/ruby/Module/remove_method) or [undef\_method](http://apidock.com/ruby/Module/undef_method)
690,432
I have a custom Task that I want to execute when building my C# projects. This task is located in MyTask.dll, which references another assembly, MyCommon.DLL. The problem is that MyCommon.dll is located at "..\Common\MyCommon.dll" relative to MyTask.dll, which puts it outside the AppBase dir for MSBuild process. I've ...
2009/03/27
[ "https://Stackoverflow.com/questions/690432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82121/" ]
So copy it instead? Just a thought. Have a copy there just to support the build that you delete once you're done with it.
I see multiple solutions : **1st :** Add the assembly in the GAC (your assembly must have a strong name) ``` gacutil /I <assembly name> ``` **2nd :** Locate the assembly through [Codebases or Probing](http://msdn.microsoft.com/en-us/library/15hyw9x3.aspx), in your [machine.config](http://msdn.microsoft.com/en-us/l...
690,432
I have a custom Task that I want to execute when building my C# projects. This task is located in MyTask.dll, which references another assembly, MyCommon.DLL. The problem is that MyCommon.dll is located at "..\Common\MyCommon.dll" relative to MyTask.dll, which puts it outside the AppBase dir for MSBuild process. I've ...
2009/03/27
[ "https://Stackoverflow.com/questions/690432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82121/" ]
So copy it instead? Just a thought. Have a copy there just to support the build that you delete once you're done with it.
All of these "solutions" create more dependencies which complicate the environment. There should be an easier way to update the probing path at runtime.. Specifically MSBuild should allow you to add probing paths in your .proj file, or to specify the dependant dlls You can define a custom UsingTask: `<UsingTask Task...
690,432
I have a custom Task that I want to execute when building my C# projects. This task is located in MyTask.dll, which references another assembly, MyCommon.DLL. The problem is that MyCommon.dll is located at "..\Common\MyCommon.dll" relative to MyTask.dll, which puts it outside the AppBase dir for MSBuild process. I've ...
2009/03/27
[ "https://Stackoverflow.com/questions/690432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82121/" ]
So copy it instead? Just a thought. Have a copy there just to support the build that you delete once you're done with it.
An option is to use [ILMerge](http://www.microsoft.com/en-us/download/details.aspx?id=17630) to merge the dependency into the task assembly.
690,432
I have a custom Task that I want to execute when building my C# projects. This task is located in MyTask.dll, which references another assembly, MyCommon.DLL. The problem is that MyCommon.dll is located at "..\Common\MyCommon.dll" relative to MyTask.dll, which puts it outside the AppBase dir for MSBuild process. I've ...
2009/03/27
[ "https://Stackoverflow.com/questions/690432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82121/" ]
I see multiple solutions : **1st :** Add the assembly in the GAC (your assembly must have a strong name) ``` gacutil /I <assembly name> ``` **2nd :** Locate the assembly through [Codebases or Probing](http://msdn.microsoft.com/en-us/library/15hyw9x3.aspx), in your [machine.config](http://msdn.microsoft.com/en-us/l...
All of these "solutions" create more dependencies which complicate the environment. There should be an easier way to update the probing path at runtime.. Specifically MSBuild should allow you to add probing paths in your .proj file, or to specify the dependant dlls You can define a custom UsingTask: `<UsingTask Task...
690,432
I have a custom Task that I want to execute when building my C# projects. This task is located in MyTask.dll, which references another assembly, MyCommon.DLL. The problem is that MyCommon.dll is located at "..\Common\MyCommon.dll" relative to MyTask.dll, which puts it outside the AppBase dir for MSBuild process. I've ...
2009/03/27
[ "https://Stackoverflow.com/questions/690432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82121/" ]
I see multiple solutions : **1st :** Add the assembly in the GAC (your assembly must have a strong name) ``` gacutil /I <assembly name> ``` **2nd :** Locate the assembly through [Codebases or Probing](http://msdn.microsoft.com/en-us/library/15hyw9x3.aspx), in your [machine.config](http://msdn.microsoft.com/en-us/l...
An option is to use [ILMerge](http://www.microsoft.com/en-us/download/details.aspx?id=17630) to merge the dependency into the task assembly.
13,847,256
I'm a beginner in programming, and i'm really wondering what's my mistake here : ``` static void Main(string[] args) { int a = int.Parse(Console.ReadLine()); int b = int.Parse(Console.ReadLine()); int c = int.Parse(Console.ReadLine()); if ((a > b) && (a > c)) { Console.WriteLine(a); } ...
2012/12/12
[ "https://Stackoverflow.com/questions/13847256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1866925/" ]
``` if ((b > a) && (b > c)) ; ``` Remove the `;`
You can't use in your if condition `;`. Remove it. ``` if ((b > a) && (b > c)) { Console.WriteLine(b); } ``` And you need one more `}` end of you code. **Edit**: Actually you can use `;` with your if condition. For example; ``` if ((b > a) && (b > c)); ``` is equal ``` if ((b > a) && (b > c)) { } ```
15,744,751
So I have got this demo navigation, which has a small button on the side and when you hover the button, it slides the menu into the window. though I have got the hover working, but now when the mouse leaves, it's still open. how to fix this? I'm pretty new to jQuery by the way here's the html: ``` <div id="demoNav"> ...
2013/04/01
[ "https://Stackoverflow.com/questions/15744751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814458/" ]
You haven't actually told it to hide again. That said, I'd like to suggest this CSS alternative: ``` #demoNav { transition:margin-left 0.5s ease; -webkit-transition:margin-left 0.5s ease; } #demoNav:hover { margin-left:0; } ```
Add a mouseleave event - ``` $('#demoNav').mouseleave(function(){ $("#demoNav").animate({marginLeft:'50px'}, 500) }); ```
15,744,751
So I have got this demo navigation, which has a small button on the side and when you hover the button, it slides the menu into the window. though I have got the hover working, but now when the mouse leaves, it's still open. how to fix this? I'm pretty new to jQuery by the way here's the html: ``` <div id="demoNav"> ...
2013/04/01
[ "https://Stackoverflow.com/questions/15744751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814458/" ]
Try this: ``` $("#demoNav").hover( function () { $(this).animate({ marginLeft: '0px' }, 500) }, function () { $(this).animate({ marginLeft: '50px' }, 500) }); ```
Add a mouseleave event - ``` $('#demoNav').mouseleave(function(){ $("#demoNav").animate({marginLeft:'50px'}, 500) }); ```
15,744,751
So I have got this demo navigation, which has a small button on the side and when you hover the button, it slides the menu into the window. though I have got the hover working, but now when the mouse leaves, it's still open. how to fix this? I'm pretty new to jQuery by the way here's the html: ``` <div id="demoNav"> ...
2013/04/01
[ "https://Stackoverflow.com/questions/15744751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814458/" ]
You haven't actually told it to hide again. That said, I'd like to suggest this CSS alternative: ``` #demoNav { transition:margin-left 0.5s ease; -webkit-transition:margin-left 0.5s ease; } #demoNav:hover { margin-left:0; } ```
Use jQuery: ``` $("#demoNav").hover(function(){ // do something when mouse hover },function(){ //do some thing when mouseout }); ```
15,744,751
So I have got this demo navigation, which has a small button on the side and when you hover the button, it slides the menu into the window. though I have got the hover working, but now when the mouse leaves, it's still open. how to fix this? I'm pretty new to jQuery by the way here's the html: ``` <div id="demoNav"> ...
2013/04/01
[ "https://Stackoverflow.com/questions/15744751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814458/" ]
Try this: ``` $("#demoNav").hover( function () { $(this).animate({ marginLeft: '0px' }, 500) }, function () { $(this).animate({ marginLeft: '50px' }, 500) }); ```
Use jQuery: ``` $("#demoNav").hover(function(){ // do something when mouse hover },function(){ //do some thing when mouseout }); ```
15,744,751
So I have got this demo navigation, which has a small button on the side and when you hover the button, it slides the menu into the window. though I have got the hover working, but now when the mouse leaves, it's still open. how to fix this? I'm pretty new to jQuery by the way here's the html: ``` <div id="demoNav"> ...
2013/04/01
[ "https://Stackoverflow.com/questions/15744751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814458/" ]
You haven't actually told it to hide again. That said, I'd like to suggest this CSS alternative: ``` #demoNav { transition:margin-left 0.5s ease; -webkit-transition:margin-left 0.5s ease; } #demoNav:hover { margin-left:0; } ```
you coded for `mouseenter` but forgot to code for `mouseleave event` add these lines in jQuery ``` $("#demoNav").mouseleave(function(){ $("#demoNav").animate({'marginLeft':'50px'}, 500) }); ``` working example here: <http://jsfiddle.net/EP6wR/> but i will suggest use hover method which is cleaner ``` synt...
15,744,751
So I have got this demo navigation, which has a small button on the side and when you hover the button, it slides the menu into the window. though I have got the hover working, but now when the mouse leaves, it's still open. how to fix this? I'm pretty new to jQuery by the way here's the html: ``` <div id="demoNav"> ...
2013/04/01
[ "https://Stackoverflow.com/questions/15744751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814458/" ]
Try this: ``` $("#demoNav").hover( function () { $(this).animate({ marginLeft: '0px' }, 500) }, function () { $(this).animate({ marginLeft: '50px' }, 500) }); ```
You haven't actually told it to hide again. That said, I'd like to suggest this CSS alternative: ``` #demoNav { transition:margin-left 0.5s ease; -webkit-transition:margin-left 0.5s ease; } #demoNav:hover { margin-left:0; } ```
15,744,751
So I have got this demo navigation, which has a small button on the side and when you hover the button, it slides the menu into the window. though I have got the hover working, but now when the mouse leaves, it's still open. how to fix this? I'm pretty new to jQuery by the way here's the html: ``` <div id="demoNav"> ...
2013/04/01
[ "https://Stackoverflow.com/questions/15744751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814458/" ]
You haven't actually told it to hide again. That said, I'd like to suggest this CSS alternative: ``` #demoNav { transition:margin-left 0.5s ease; -webkit-transition:margin-left 0.5s ease; } #demoNav:hover { margin-left:0; } ```
might be this solution works ``` $('#demoNav .open').on("mouseenter", function(){ $(this).parent().animate({marginLeft:'0px'}, 500); }); $('#demoNav').on("mouseleave", function(){ $(this).animate({marginLeft:'50px'}, 500); }); ``` this will activate the pane on hover of button, but when you leave the div, it'll ...
15,744,751
So I have got this demo navigation, which has a small button on the side and when you hover the button, it slides the menu into the window. though I have got the hover working, but now when the mouse leaves, it's still open. how to fix this? I'm pretty new to jQuery by the way here's the html: ``` <div id="demoNav"> ...
2013/04/01
[ "https://Stackoverflow.com/questions/15744751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814458/" ]
Try this: ``` $("#demoNav").hover( function () { $(this).animate({ marginLeft: '0px' }, 500) }, function () { $(this).animate({ marginLeft: '50px' }, 500) }); ```
you coded for `mouseenter` but forgot to code for `mouseleave event` add these lines in jQuery ``` $("#demoNav").mouseleave(function(){ $("#demoNav").animate({'marginLeft':'50px'}, 500) }); ``` working example here: <http://jsfiddle.net/EP6wR/> but i will suggest use hover method which is cleaner ``` synt...
15,744,751
So I have got this demo navigation, which has a small button on the side and when you hover the button, it slides the menu into the window. though I have got the hover working, but now when the mouse leaves, it's still open. how to fix this? I'm pretty new to jQuery by the way here's the html: ``` <div id="demoNav"> ...
2013/04/01
[ "https://Stackoverflow.com/questions/15744751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1814458/" ]
Try this: ``` $("#demoNav").hover( function () { $(this).animate({ marginLeft: '0px' }, 500) }, function () { $(this).animate({ marginLeft: '50px' }, 500) }); ```
might be this solution works ``` $('#demoNav .open').on("mouseenter", function(){ $(this).parent().animate({marginLeft:'0px'}, 500); }); $('#demoNav').on("mouseleave", function(){ $(this).animate({marginLeft:'50px'}, 500); }); ``` this will activate the pane on hover of button, but when you leave the div, it'll ...
40,214,437
I quite new in Android developing platform (I'm frontender who has been using jQuery and now Angular2 (for 5 months) with RxJs ). I used to code in core-Java in past for one year (6 years ago), so I'm little familiar with Java. As I'm familiar with consuming REST API by using jQuery/Angular2 (which is really easy thin...
2016/10/24
[ "https://Stackoverflow.com/questions/40214437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1228333/" ]
**Retrofit** is your best choice if you want a direct mapping between api endpoints and Java Objects. You simply create DTOs and annotate each field with the corresponding json name. Depending on the size and purpose of the api you may want to have a deeper control over what you send and receive, i.e. direct access to...
1) Retrofit use for best way coz its internally used OK HTTP . 2) Volley Used but retrofit is much better . 3) Client -server communication purpose made own HTTP Code .
128,922
I have some Kodak Gold 200 shot on a Canon AV-1 where one exposure in the middle of the roll (#17) has a portion of the exposure missing with sharp line. None of the other exposured (on this or any other roll) have this issue. What might cause this? [![damaged image of a lake](https://i.stack.imgur.com/eKMdR.jpg)](htt...
2022/03/24
[ "https://photo.stackexchange.com/questions/128922", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/105486/" ]
The black areas are hard-edged, so they're right in front of the film. I think your shutter might have malfunctioned. With no film in the camera, take off the lens and watch the shutter as you wind and release it. Does it move side-to-side? Does it have the irregular edge you see in the picture?
I think the film was improperly advanced, so that only part of it was exposed. I prefer this account over the next one only because the region is black, not white. Otherwise I think it could be the film door was opened slightly while the roll was still being used. The film could have been partially advanced and then a...
62,176,933
I am using navigationcontroller to navigate to another fragment Navigate to second fragment ``` private fun moveToNextScreen(userId: String) { val bundle = bundleOf("userId" to userId) binding.googleLogin.findNavController().navigate( R.id.action_loginFragment_to_signupFragment, bundle ) } ``` ...
2020/06/03
[ "https://Stackoverflow.com/questions/62176933", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2569793/" ]
You cannot access `resources` until the fragment will be attached to an activity. So you have to delay instantiation of `optionsList` ```kotlin class UserSetupFragment : Fragment() { lateinit var optionsList: List<String> override fun onAttach(context: Context) { super.onAttach(context) option...
You cannot access resources from FragmentClass. You should define, whatever you want, in onCreateView or onCreate. Example : ``` class ExampleFragment : Fragment(){ private lateinit var example : String } override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState...
8,984,608
I have the following issue. My customer paid for the product that costs 13,60 € but when he paid in Paypal it was 13,60 $, it didn't convert the price into $. So that is the odd thing...because my prices on my site are in EUROS. My paypal account's main currency is set to € as I created it in Spain and my bank account...
2012/01/24
[ "https://Stackoverflow.com/questions/8984608", "https://Stackoverflow.com", "https://Stackoverflow.com/users/864951/" ]
You must include CURRENCYCODE (or PAYMENTREQUEST\_0\_CURRENCYCODE, depending on your API version) in your SetExpressCheckout and DoExpressCheckoutPayment API calls. If you don't specify the currency code in the API call, it defaults to USD.
Good Day! This has been 4 years ago, does it still apply today? It seems this is still recurring. Here is what I have but the currency still defaults to USD is there a policy change in PayPal i.e. new fee, new membership type to get this to change for Express Checkout using NVP? I have tried both but no luck so far: ...
23,994,396
I know that repeated use of identical IDs in one HTML document is a bad practice. How can I avoid this, if I have elements performing the same functions, and to which I need to get quick access? For example: ``` <form id='dialog_setting_dns-form'> <label>Address:</label> <input name="address" id="address"/> ...
2014/06/02
[ "https://Stackoverflow.com/questions/23994396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3247925/" ]
use class instead of id in that situation ``` <form id='dialog_setting_dns-form'> <label>Address:</label> <input name="address" class="address" /> </form> <form id='dialog_static'> <label>Address:</label> <input name="address" class="address" /> </form> ``` You would select by class in jQuery with `...
Well this is why classes are for in html tags. With jquery select them by class and iterate through them.
23,994,396
I know that repeated use of identical IDs in one HTML document is a bad practice. How can I avoid this, if I have elements performing the same functions, and to which I need to get quick access? For example: ``` <form id='dialog_setting_dns-form'> <label>Address:</label> <input name="address" id="address"/> ...
2014/06/02
[ "https://Stackoverflow.com/questions/23994396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3247925/" ]
use class instead of id in that situation ``` <form id='dialog_setting_dns-form'> <label>Address:</label> <input name="address" class="address" /> </form> <form id='dialog_static'> <label>Address:</label> <input name="address" class="address" /> </form> ``` You would select by class in jQuery with `...
Use a class instat on all of these elements and select it then. *Pure JavaScript:* ``` var elems = document.getElementsByClassName("MyClassName"); ``` *jQuery:* ``` var elemens = $(".MyClassName"); ```
161,134
I'm at loss with this. What would be the simples way to achieve this? I have "Customers" table like this: ``` USER_ID| NAME | J_ID |K_ID |Y_ID ----------------------------------------- 1 | CUST1 | A | 1 | AB 2 | CUST2 | B | 2 | NULL 3 | CUST3 | C | 3 | EF ...
2017/01/15
[ "https://dba.stackexchange.com/questions/161134", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/101688/" ]
One way to accomplish this is to use [LEFT OUTER JOIN](https://technet.microsoft.com/en-us/library/ms187518(v=sql.105).aspx) along with [COALESCE](https://msdn.microsoft.com/en-us/library/ms190349.aspx). To get the missing values in the `J_ID` and `K_ID` column you can join to `R_ID` and `JK_ID`. To get the missing val...
``` select c.user_id,c.name ,coalesce(c.j_id,jk.j_id) as j_id ,coalesce(c.k_id,jk.k_id) as k_id ,coalesce(c.y_id,r.y_id) as y_id from customers c left join jk_id jk join r_id r on r.r_id = jk.r_id on r.y_id = c.y_i...
4,015,134
I'd like to develop a web sample application that can send and read audio on the fly. The idea is to develop a website with HTML5/JS. So, the admin part (in php or whatever server side language) will allow me to send audio from a mic. Then, on the client side, the user can listen to the stream with the `<audio>` tag ...
2010/10/25
[ "https://Stackoverflow.com/questions/4015134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/644669/" ]
<http://web.psung.name/zeya/> - this app transcodes your music on the fly and streams it using HTML5. Maybe this will help a little bit ;)
There is a specification for [interacting with devices](http://www.whatwg.org/specs/web-apps/current-work/complete/commands.html#devices), such as microphones, but it is early days and I'm not aware of any support for it. If you want something that can interact with a mic today, look to Adobe Flash.
4,015,134
I'd like to develop a web sample application that can send and read audio on the fly. The idea is to develop a website with HTML5/JS. So, the admin part (in php or whatever server side language) will allow me to send audio from a mic. Then, on the client side, the user can listen to the stream with the `<audio>` tag ...
2010/10/25
[ "https://Stackoverflow.com/questions/4015134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/644669/" ]
<http://web.psung.name/zeya/> - this app transcodes your music on the fly and streams it using HTML5. Maybe this will help a little bit ;)
I think that what you are proposing is doable in theory, but in practice web clients and standards are still not really mature enough yet. For instance, check out this interesting blog about [audio synthesis in JavaScript](http://acko.net/blog/javascript-audio-synthesis-with-html-5). Now, for the theory: Alternative ...
4,015,134
I'd like to develop a web sample application that can send and read audio on the fly. The idea is to develop a website with HTML5/JS. So, the admin part (in php or whatever server side language) will allow me to send audio from a mic. Then, on the client side, the user can listen to the stream with the `<audio>` tag ...
2010/10/25
[ "https://Stackoverflow.com/questions/4015134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/644669/" ]
Pretty much any solution you choose will suffer from bad acceptance on one device or another, and web-based solution is even worse (as extensively pointed out by everybody). If you want to cover the largest audience possible, set up a streaming server like [Icecast](http://www.icecast.org/) and broadcast over MP3 and/...
There is a specification for [interacting with devices](http://www.whatwg.org/specs/web-apps/current-work/complete/commands.html#devices), such as microphones, but it is early days and I'm not aware of any support for it. If you want something that can interact with a mic today, look to Adobe Flash.
4,015,134
I'd like to develop a web sample application that can send and read audio on the fly. The idea is to develop a website with HTML5/JS. So, the admin part (in php or whatever server side language) will allow me to send audio from a mic. Then, on the client side, the user can listen to the stream with the `<audio>` tag ...
2010/10/25
[ "https://Stackoverflow.com/questions/4015134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/644669/" ]
<http://web.psung.name/zeya/> - this app transcodes your music on the fly and streams it using HTML5. Maybe this will help a little bit ;)
The HTML audio tag does not specify any particular codec, so browser vendors are free to choose their own. Currently, none support a streaming format, although that could happen. As to recording, I'm not sure you'd really want to support unlimited recording from the browser, because you'd have concurrency issues? Would...
4,015,134
I'd like to develop a web sample application that can send and read audio on the fly. The idea is to develop a website with HTML5/JS. So, the admin part (in php or whatever server side language) will allow me to send audio from a mic. Then, on the client side, the user can listen to the stream with the `<audio>` tag ...
2010/10/25
[ "https://Stackoverflow.com/questions/4015134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/644669/" ]
<http://web.psung.name/zeya/> - this app transcodes your music on the fly and streams it using HTML5. Maybe this will help a little bit ;)
It would be possible to manipulate audio tags to "stream" content, but there'd have to be a buffer of a couple seconds (at least). Re-set the source of the tag to a URL which provides the next couple seconds every couple seconds (not static files of course, but served dynamically from the stream). Admin side I think yo...
4,015,134
I'd like to develop a web sample application that can send and read audio on the fly. The idea is to develop a website with HTML5/JS. So, the admin part (in php or whatever server side language) will allow me to send audio from a mic. Then, on the client side, the user can listen to the stream with the `<audio>` tag ...
2010/10/25
[ "https://Stackoverflow.com/questions/4015134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/644669/" ]
<http://web.psung.name/zeya/> - this app transcodes your music on the fly and streams it using HTML5. Maybe this will help a little bit ;)
I don't think that you can do something like this with *just* JavaScript and HTML5. And if we could, we would most likely have to wait a long while before clients could use it in there browser. Like David said, Flash would work, the problem with that is: A) a lot of devices wouldn't support it and B) Flash is far from ...
4,015,134
I'd like to develop a web sample application that can send and read audio on the fly. The idea is to develop a website with HTML5/JS. So, the admin part (in php or whatever server side language) will allow me to send audio from a mic. Then, on the client side, the user can listen to the stream with the `<audio>` tag ...
2010/10/25
[ "https://Stackoverflow.com/questions/4015134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/644669/" ]
Pretty much any solution you choose will suffer from bad acceptance on one device or another, and web-based solution is even worse (as extensively pointed out by everybody). If you want to cover the largest audience possible, set up a streaming server like [Icecast](http://www.icecast.org/) and broadcast over MP3 and/...
I think that what you are proposing is doable in theory, but in practice web clients and standards are still not really mature enough yet. For instance, check out this interesting blog about [audio synthesis in JavaScript](http://acko.net/blog/javascript-audio-synthesis-with-html-5). Now, for the theory: Alternative ...
4,015,134
I'd like to develop a web sample application that can send and read audio on the fly. The idea is to develop a website with HTML5/JS. So, the admin part (in php or whatever server side language) will allow me to send audio from a mic. Then, on the client side, the user can listen to the stream with the `<audio>` tag ...
2010/10/25
[ "https://Stackoverflow.com/questions/4015134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/644669/" ]
<http://web.psung.name/zeya/> - this app transcodes your music on the fly and streams it using HTML5. Maybe this will help a little bit ;)
This document on the Apple website might be what you are looking for. It recommends using HTTP Live Streaming for devices like the iPad, iPhone and the iPod Touch: <https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/Introduction/Introduction.html> Might be what ...
4,015,134
I'd like to develop a web sample application that can send and read audio on the fly. The idea is to develop a website with HTML5/JS. So, the admin part (in php or whatever server side language) will allow me to send audio from a mic. Then, on the client side, the user can listen to the stream with the `<audio>` tag ...
2010/10/25
[ "https://Stackoverflow.com/questions/4015134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/644669/" ]
Pretty much any solution you choose will suffer from bad acceptance on one device or another, and web-based solution is even worse (as extensively pointed out by everybody). If you want to cover the largest audience possible, set up a streaming server like [Icecast](http://www.icecast.org/) and broadcast over MP3 and/...
This document on the Apple website might be what you are looking for. It recommends using HTTP Live Streaming for devices like the iPad, iPhone and the iPod Touch: <https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/Introduction/Introduction.html> Might be what ...
4,015,134
I'd like to develop a web sample application that can send and read audio on the fly. The idea is to develop a website with HTML5/JS. So, the admin part (in php or whatever server side language) will allow me to send audio from a mic. Then, on the client side, the user can listen to the stream with the `<audio>` tag ...
2010/10/25
[ "https://Stackoverflow.com/questions/4015134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/644669/" ]
Pretty much any solution you choose will suffer from bad acceptance on one device or another, and web-based solution is even worse (as extensively pointed out by everybody). If you want to cover the largest audience possible, set up a streaming server like [Icecast](http://www.icecast.org/) and broadcast over MP3 and/...
I don't think that you can do something like this with *just* JavaScript and HTML5. And if we could, we would most likely have to wait a long while before clients could use it in there browser. Like David said, Flash would work, the problem with that is: A) a lot of devices wouldn't support it and B) Flash is far from ...
49,184,635
I have a text file which contains day of year as a column and a value associated to it. something like this ``` day value 59 0.2 60 0.6 63 5.07 ``` Here the day column represents the day in a year i.e, 59/365, 60/365, 63/365. ``` dataPoints.push({x: parseFloat(x1), y: parseFloat(y1)});// x1 and y1 are variab...
2018/03/09
[ "https://Stackoverflow.com/questions/49184635", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9464943/" ]
Why document when you can just [read code](https://github.com/paritytech/parity/blob/master/parity/informant.rs#L302)? (bleh) > > 2018-03-09 00:05:12 UTC(1) Syncing #4896969(2) 61ee…bdad(3) 2 blk/s(4) 508 tx/s(5) 16 Mgas/s(6) 645+(7) 1(8) Qed #4897616(9) 17/25 peers(10) 4 MiB chain(11) 135 MiB db(12) 42 MiB queue(13)...
Now the answer to this question is also included in Parity's FAQ. It provides a comprehensive explanation of different command line output: [What does Parity's command line output mean?](https://openethereum.github.io/wiki/FAQ#what-does-paritys-command-line-output-mean)
54,922,296
How can I remove the null rows in the table? [![enter image description here](https://i.stack.imgur.com/sgC3r.png)](https://i.stack.imgur.com/sgC3r.png) I've written a query to join several columns from different tables (It works). However, there are many null rows at the bottom of the table which I would like to re...
2019/02/28
[ "https://Stackoverflow.com/questions/54922296", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11122688/" ]
The StrSafe API is a bit strange because it does not have its own .DLL nor its own exported functions. I assume it was developed this way because it needed to support older versions of Windows that had already been released. It was created during the WinXP service pack security push: > > During February and March 200...
If it's not implemented in Windows and exported from one of its DLLs (as e.g. CreateFile() or CloseHandle() from kernel32.dll), I'd say it's not part of the WinAPI, even if it ends up calling things that are implemented in Windows.
5,334,981
For a game I am currently making I am in need of encrypting a variable length string (this could be a short as 10 characters or a full XML document) in C# and then sending this to a PHP script which decrypts and processes the information. I am unfortunately completely in the dark when it comes to cryptography and am ha...
2011/03/17
[ "https://Stackoverflow.com/questions/5334981", "https://Stackoverflow.com", "https://Stackoverflow.com/users/312328/" ]
[AES](http://en.wikipedia.org/wiki/Advanced_Encryption_Standard), sometimes called Rijndael, might be a choice for you. It's a standard created by the National Institute of Standards and Technology, an agency of the US government. It's available in PHP using the [mcrypt](http://php.net/manual/en/book.mcrypt.php) exten...
For the C# part, you could use the `System.Security.Cryptography` namespace. Eg: ``` System.Security.Cryptography.Aes aes = System.Security.Cryptography.Aes.Create(); System.Security.Cryptography.ICryptoTransform enc = aes.CreateEncryptor(); // byte[] input; // byte[] output = new output[512] int size = enc.TransformB...
37,452,950
How to recover partitions in easy fashion. Here is the scenario : > > 1. Have 'n' partitions on existing external table 't' > 2. Dropped table 't' > 3. Recreated table 't' ***// Note : same table but with excluding some column*** > 4. How to recover the 'n' partitions that existed for table 't' in step #1 ? > > > ...
2016/05/26
[ "https://Stackoverflow.com/questions/37452950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2101290/" ]
When the partitions directories still exist in the HDFS, simply run this command: ``` MSCK REPAIR TABLE table_name; ``` It adds the partitions definitions to the metastore based on what exists in the table directory.
Metadata is not saved in the trash and is removed permanently; you will not be able to restore the metadata of dropped tables, partitions, etc. Reference: <http://www.cloudera.com/documentation/archive/cdh/4-x/4-7-1/CDH4-Installation-Guide/cdh4ig_hive_trash.html>
11,204,221
I have an issue where I'm updating millions of rows in my DB, so rather than updating each one individually I want to join groups of ~1000 statements into a single query. I have enabled MULTI\_STATEMENTS like so ``` client = Mysql2::Client.new(:host => 'localhost', :database => 'mehdb', :username => "root", :password...
2012/06/26
[ "https://Stackoverflow.com/questions/11204221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/86030/" ]
Short answer to this problem is when MULTI\_STATEMENTS are enabled mysql expects you to handle the result of your query. A quick fix is to do something similar to this after each set of multiple update statements ``` while db_write.next_result db_write.store_result rescue '' end ```
Why Dont you just :: No need to run it multiple times .... ``` UPDATE pew SET x = 10 WHERE x IS NULL ```
11,204,221
I have an issue where I'm updating millions of rows in my DB, so rather than updating each one individually I want to join groups of ~1000 statements into a single query. I have enabled MULTI\_STATEMENTS like so ``` client = Mysql2::Client.new(:host => 'localhost', :database => 'mehdb', :username => "root", :password...
2012/06/26
[ "https://Stackoverflow.com/questions/11204221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/86030/" ]
Short answer to this problem is when MULTI\_STATEMENTS are enabled mysql expects you to handle the result of your query. A quick fix is to do something similar to this after each set of multiple update statements ``` while db_write.next_result db_write.store_result rescue '' end ```
As I understand it, this is a result Mysql internal protection - You are in the midst of querying DB, and streaming the results, if during that you'll also update the results, you can not guarantee any level of consistency. If you KNOW you are safe to make changes as part of the flow, you could work around that by sim...
11,204,221
I have an issue where I'm updating millions of rows in my DB, so rather than updating each one individually I want to join groups of ~1000 statements into a single query. I have enabled MULTI\_STATEMENTS like so ``` client = Mysql2::Client.new(:host => 'localhost', :database => 'mehdb', :username => "root", :password...
2012/06/26
[ "https://Stackoverflow.com/questions/11204221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/86030/" ]
Short answer to this problem is when MULTI\_STATEMENTS are enabled mysql expects you to handle the result of your query. A quick fix is to do something similar to this after each set of multiple update statements ``` while db_write.next_result db_write.store_result rescue '' end ```
Before the next SQL statement write the following command. ``` ActiveRecord::Base.connection.raw_connection.abandon_results! ``` It will enable a new SQL command execution.
28,581,393
I connect the debugger to my emulator and the idea console say : ``` Connected to the target VM, address: localhost:8612,transport:`socket` ``` But when i want to test my app it doesnt stop in Break points ! See this screen shot : ![enter image description here](https://i.stack.imgur.com/ChyLv.png) And this : ...
2015/02/18
[ "https://Stackoverflow.com/questions/28581393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2724418/" ]
First, make sure your IntellJ IDEA instance is up to date, there have been a couple of recent bugfixes related to this. (Ex: <https://youtrack.jetbrains.com/issue/IDEA-81769>) Otherwise: If android:process is set this may be your issue: <https://youtrack.jetbrains.com/issue/IDEA-64456> Else you might have the proble...
set the breakpoint on ``` your_view.setOnListItemSelectedListener(); ``` and on `if(...)` in OnListItemSelected
28,581,393
I connect the debugger to my emulator and the idea console say : ``` Connected to the target VM, address: localhost:8612,transport:`socket` ``` But when i want to test my app it doesnt stop in Break points ! See this screen shot : ![enter image description here](https://i.stack.imgur.com/ChyLv.png) And this : ...
2015/02/18
[ "https://Stackoverflow.com/questions/28581393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2724418/" ]
set the breakpoint on ``` your_view.setOnListItemSelectedListener(); ``` and on `if(...)` in OnListItemSelected
There're message "Suspend all" in info about breakpoint, it means that IDE will skip all breakpoints, you need to turn it off (usually somewhere in debugging window there is a button to suspend breakpoints) Or maybe it's build type. Did you check your build, is it debug?
28,581,393
I connect the debugger to my emulator and the idea console say : ``` Connected to the target VM, address: localhost:8612,transport:`socket` ``` But when i want to test my app it doesnt stop in Break points ! See this screen shot : ![enter image description here](https://i.stack.imgur.com/ChyLv.png) And this : ...
2015/02/18
[ "https://Stackoverflow.com/questions/28581393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2724418/" ]
First, make sure your IntellJ IDEA instance is up to date, there have been a couple of recent bugfixes related to this. (Ex: <https://youtrack.jetbrains.com/issue/IDEA-81769>) Otherwise: If android:process is set this may be your issue: <https://youtrack.jetbrains.com/issue/IDEA-64456> Else you might have the proble...
There're message "Suspend all" in info about breakpoint, it means that IDE will skip all breakpoints, you need to turn it off (usually somewhere in debugging window there is a button to suspend breakpoints) Or maybe it's build type. Did you check your build, is it debug?
28,581,393
I connect the debugger to my emulator and the idea console say : ``` Connected to the target VM, address: localhost:8612,transport:`socket` ``` But when i want to test my app it doesnt stop in Break points ! See this screen shot : ![enter image description here](https://i.stack.imgur.com/ChyLv.png) And this : ...
2015/02/18
[ "https://Stackoverflow.com/questions/28581393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2724418/" ]
First, make sure your IntellJ IDEA instance is up to date, there have been a couple of recent bugfixes related to this. (Ex: <https://youtrack.jetbrains.com/issue/IDEA-81769>) Otherwise: If android:process is set this may be your issue: <https://youtrack.jetbrains.com/issue/IDEA-64456> Else you might have the proble...
Did you by any chance activated ProGuard for your build? Try to turn it off. It may destroy your Breakpoints. Also try: * Build -> Clean Build * File -> Invalidate Caches / Restart
28,581,393
I connect the debugger to my emulator and the idea console say : ``` Connected to the target VM, address: localhost:8612,transport:`socket` ``` But when i want to test my app it doesnt stop in Break points ! See this screen shot : ![enter image description here](https://i.stack.imgur.com/ChyLv.png) And this : ...
2015/02/18
[ "https://Stackoverflow.com/questions/28581393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2724418/" ]
First, make sure your IntellJ IDEA instance is up to date, there have been a couple of recent bugfixes related to this. (Ex: <https://youtrack.jetbrains.com/issue/IDEA-81769>) Otherwise: If android:process is set this may be your issue: <https://youtrack.jetbrains.com/issue/IDEA-64456> Else you might have the proble...
Read these similar questions [Can't reach some lines debugging android app](https://stackoverflow.com/questions/21743442/cant-reach-some-lines-debugging-android-app) [Cannot set Java breakpoint in Intellij IDEA](https://stackoverflow.com/questions/11591662/cannot-set-java-breakpoint-in-intellij-idea) All your break...
28,581,393
I connect the debugger to my emulator and the idea console say : ``` Connected to the target VM, address: localhost:8612,transport:`socket` ``` But when i want to test my app it doesnt stop in Break points ! See this screen shot : ![enter image description here](https://i.stack.imgur.com/ChyLv.png) And this : ...
2015/02/18
[ "https://Stackoverflow.com/questions/28581393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2724418/" ]
Did you by any chance activated ProGuard for your build? Try to turn it off. It may destroy your Breakpoints. Also try: * Build -> Clean Build * File -> Invalidate Caches / Restart
There're message "Suspend all" in info about breakpoint, it means that IDE will skip all breakpoints, you need to turn it off (usually somewhere in debugging window there is a button to suspend breakpoints) Or maybe it's build type. Did you check your build, is it debug?
28,581,393
I connect the debugger to my emulator and the idea console say : ``` Connected to the target VM, address: localhost:8612,transport:`socket` ``` But when i want to test my app it doesnt stop in Break points ! See this screen shot : ![enter image description here](https://i.stack.imgur.com/ChyLv.png) And this : ...
2015/02/18
[ "https://Stackoverflow.com/questions/28581393", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2724418/" ]
Read these similar questions [Can't reach some lines debugging android app](https://stackoverflow.com/questions/21743442/cant-reach-some-lines-debugging-android-app) [Cannot set Java breakpoint in Intellij IDEA](https://stackoverflow.com/questions/11591662/cannot-set-java-breakpoint-in-intellij-idea) All your break...
There're message "Suspend all" in info about breakpoint, it means that IDE will skip all breakpoints, you need to turn it off (usually somewhere in debugging window there is a button to suspend breakpoints) Or maybe it's build type. Did you check your build, is it debug?
65,378,079
So I made a program which asks the user the amount of numbers he wants, which numbers he wants and creates a list. I now want to make it so that if the user puts in the number 0 the program will stop there and print the previous numbers he has put if it's possible (note: I want the 0 to not be printed only the previous...
2020/12/20
[ "https://Stackoverflow.com/questions/65378079", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14858808/" ]
You can use linq to get the dates like ``` private void BindDatesToComboBox() { List<string> datesOfMonth = new List<string>(); datesOfMonth.AddRange(Enumerable.Range(1, DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month)) // Days: 1, 2 ... 31 etc. .Select(d...
Hi you can achieve that by using the following code in the codebehind file: There is a method that takes the year and a month as input and returns a list of dates. ``` public MainWindow() { InitializeComponent(); var dates = GetDates(2020, 12); cob_date_select.ItemsSource = dates; ...
65,378,079
So I made a program which asks the user the amount of numbers he wants, which numbers he wants and creates a list. I now want to make it so that if the user puts in the number 0 the program will stop there and print the previous numbers he has put if it's possible (note: I want the 0 to not be printed only the previous...
2020/12/20
[ "https://Stackoverflow.com/questions/65378079", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14858808/" ]
You can use linq to get the dates like ``` private void BindDatesToComboBox() { List<string> datesOfMonth = new List<string>(); datesOfMonth.AddRange(Enumerable.Range(1, DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month)) // Days: 1, 2 ... 31 etc. .Select(d...
You have to generate a collection to feed combo box. It's worth to mention that UI part needs representation of the date (you want to use `ToLongDateString()` which uses application current culture), but from other side probably you will need to manipulate on selected date (using string representation will be cumbersom...
32,360,151
Take a look at this picture: [![enter image description here](https://i.stack.imgur.com/9du5a.png)](https://i.stack.imgur.com/9du5a.png) This is a JLabel with a height that is not allowed to vary. However when there is too much text to fit in its given size it attempts to display both lines. I do not want this, how d...
2015/09/02
[ "https://Stackoverflow.com/questions/32360151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3079259/" ]
Here is a small console app application that continuously (so you can test it easily selecting different windows on your desktop) display information about the current foreground window process and store process, if any. Apps can have a window hierarchy that can span multiple processes. What I do here is search the fi...
Does taking snapshot of running processes and pulling the name out of it by comparing process id not work? Full reference here: <https://msdn.microsoft.com/en-us/library/windows/desktop/ms686837(v=vs.85).aspx> But you fix the snapshot with CreateToolhelp32Snapshot(). Or from WTSEnumerateProcesses() and surrounding A...
32,360,151
Take a look at this picture: [![enter image description here](https://i.stack.imgur.com/9du5a.png)](https://i.stack.imgur.com/9du5a.png) This is a JLabel with a height that is not allowed to vary. However when there is too much text to fit in its given size it attempts to display both lines. I do not want this, how d...
2015/09/02
[ "https://Stackoverflow.com/questions/32360151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3079259/" ]
Be sure to use the Spy++ utility when you want to reverse-engineer something like this. Included with Visual Studio, you need the 64-bit version in Common7\Tools\spyxx\_amd64.exe. Use Search > Find Window and drag the bullseye to a UWP app, like Weather. You'll see the window you'll find with GetForegroundWindow(), it...
Here is a small console app application that continuously (so you can test it easily selecting different windows on your desktop) display information about the current foreground window process and store process, if any. Apps can have a window hierarchy that can span multiple processes. What I do here is search the fi...
32,360,151
Take a look at this picture: [![enter image description here](https://i.stack.imgur.com/9du5a.png)](https://i.stack.imgur.com/9du5a.png) This is a JLabel with a height that is not allowed to vary. However when there is too much text to fit in its given size it attempts to display both lines. I do not want this, how d...
2015/09/02
[ "https://Stackoverflow.com/questions/32360151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3079259/" ]
Here is a small console app application that continuously (so you can test it easily selecting different windows on your desktop) display information about the current foreground window process and store process, if any. Apps can have a window hierarchy that can span multiple processes. What I do here is search the fi...
Starting from Win10 Anniversary Update ApplicationFrameHost child window return anything but UWP application. It worked only in Tablet mode after relogon.
32,360,151
Take a look at this picture: [![enter image description here](https://i.stack.imgur.com/9du5a.png)](https://i.stack.imgur.com/9du5a.png) This is a JLabel with a height that is not allowed to vary. However when there is too much text to fit in its given size it attempts to display both lines. I do not want this, how d...
2015/09/02
[ "https://Stackoverflow.com/questions/32360151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3079259/" ]
Be sure to use the Spy++ utility when you want to reverse-engineer something like this. Included with Visual Studio, you need the 64-bit version in Common7\Tools\spyxx\_amd64.exe. Use Search > Find Window and drag the bullseye to a UWP app, like Weather. You'll see the window you'll find with GetForegroundWindow(), it...
Does taking snapshot of running processes and pulling the name out of it by comparing process id not work? Full reference here: <https://msdn.microsoft.com/en-us/library/windows/desktop/ms686837(v=vs.85).aspx> But you fix the snapshot with CreateToolhelp32Snapshot(). Or from WTSEnumerateProcesses() and surrounding A...
32,360,151
Take a look at this picture: [![enter image description here](https://i.stack.imgur.com/9du5a.png)](https://i.stack.imgur.com/9du5a.png) This is a JLabel with a height that is not allowed to vary. However when there is too much text to fit in its given size it attempts to display both lines. I do not want this, how d...
2015/09/02
[ "https://Stackoverflow.com/questions/32360151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3079259/" ]
Does taking snapshot of running processes and pulling the name out of it by comparing process id not work? Full reference here: <https://msdn.microsoft.com/en-us/library/windows/desktop/ms686837(v=vs.85).aspx> But you fix the snapshot with CreateToolhelp32Snapshot(). Or from WTSEnumerateProcesses() and surrounding A...
Starting from Win10 Anniversary Update ApplicationFrameHost child window return anything but UWP application. It worked only in Tablet mode after relogon.
32,360,151
Take a look at this picture: [![enter image description here](https://i.stack.imgur.com/9du5a.png)](https://i.stack.imgur.com/9du5a.png) This is a JLabel with a height that is not allowed to vary. However when there is too much text to fit in its given size it attempts to display both lines. I do not want this, how d...
2015/09/02
[ "https://Stackoverflow.com/questions/32360151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3079259/" ]
Be sure to use the Spy++ utility when you want to reverse-engineer something like this. Included with Visual Studio, you need the 64-bit version in Common7\Tools\spyxx\_amd64.exe. Use Search > Find Window and drag the bullseye to a UWP app, like Weather. You'll see the window you'll find with GetForegroundWindow(), it...
Starting from Win10 Anniversary Update ApplicationFrameHost child window return anything but UWP application. It worked only in Tablet mode after relogon.
10,985,737
My MacOS version of Emacs inserts contents of the file into current buffer instead of opening it as a new buffer. I want it to open a new buffer on file drag-and-drop, any idea how to fix that? GNU Emacs 23.3.1 (x86\_64-apple-darwin, NS apple-appkit-1038.35)
2012/06/11
[ "https://Stackoverflow.com/questions/10985737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/419116/" ]
upgrade to emacs 24.1, just released, whose drag&drop behavior has changed as you desire.
You can set drag and drop to do anything you want by binding `ns-drag-file`. It will of course be a different event on different platforms. Perhaps surprisingly you can find this by `C-h k` and then dragging a file to emacs.
36,527,873
My Request looks something like this: User-Agent: Fiddler Content-Type: application/json; charset=utf-8 Host: localhost:12841 Content-Length: 4512954 Inside Body I have--> "*base64encoded String*" API Controller contains a method : ``` [HttpPost] public bool SaveProductImage([FromBody]string image) ...
2016/04/10
[ "https://Stackoverflow.com/questions/36527873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4711916/" ]
Be sure to allow the application to receive large POSTs in your **web.config**. Here's an example for **10mb**. For **ASP.NET**. ```xml <system.web> <httpRuntime targetFramework="4.6" maxRequestLength="102400" executionTimeout="3600" /> </system.web> ``` For **IIS** ```xml <security> <requestFiltering> <r...
this is my solution. in your web.config(in server) ``` ---------- <system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> <standardEndpoints> <webHttpEndpoint> <standardEndpoint name="" helpEnabled="true"automaticFormatSelectionEnabled="false" defaultOutgoingRespon...