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
995,760
For example, if the match is `<div class="class1">Hello world</div>`, I need to return ``` <div class="class1">Hello world</div> ``` not just "Hello world". Thanks!
2009/06/15
[ "https://Stackoverflow.com/questions/995760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/111265/" ]
There's no built-in function for getting the outerHTML, but you can use this: ``` jQuery.fn.outerHTML = function(s) { return (s) ? this.before(s).remove() : jQuery("<p>").append(this.eq(0).clone()).html(); } ``` Then in your selector: `$('.class1').outerHTML()` will give you what you are looking for. [Sourc...
[@Jose Basilio's answer](https://stackoverflow.com/questions/995760/in-jquery-are-there-any-function-that-similar-to-html-or-text-but-return-the/995796#995796) is great. But Brian Grinstead found a problem in this function when using IFrames: <http://www.briangrinstead.com/blog/jquery-outerhtml-snippet> Here I put tog...
995,760
For example, if the match is `<div class="class1">Hello world</div>`, I need to return ``` <div class="class1">Hello world</div> ``` not just "Hello world". Thanks!
2009/06/15
[ "https://Stackoverflow.com/questions/995760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/111265/" ]
There's no built-in function for getting the outerHTML, but you can use this: ``` jQuery.fn.outerHTML = function(s) { return (s) ? this.before(s).remove() : jQuery("<p>").append(this.eq(0).clone()).html(); } ``` Then in your selector: `$('.class1').outerHTML()` will give you what you are looking for. [Sourc...
I used .andSelf() with success: <http://api.jquery.com/andSelf/>
995,760
For example, if the match is `<div class="class1">Hello world</div>`, I need to return ``` <div class="class1">Hello world</div> ``` not just "Hello world". Thanks!
2009/06/15
[ "https://Stackoverflow.com/questions/995760", "https://Stackoverflow.com", "https://Stackoverflow.com/users/111265/" ]
[@Jose Basilio's answer](https://stackoverflow.com/questions/995760/in-jquery-are-there-any-function-that-similar-to-html-or-text-but-return-the/995796#995796) is great. But Brian Grinstead found a problem in this function when using IFrames: <http://www.briangrinstead.com/blog/jquery-outerhtml-snippet> Here I put tog...
I used .andSelf() with success: <http://api.jquery.com/andSelf/>
34,677,618
I'm a newbie to AngularJS. I need to validate the `fields` so when the user types `empty` information, the error is shown and data still does not save into `DB`. If information is valid then ofcourse it must be saved into my `DB` The `messages` works fine, however content still gets saved if the user leaves `empty` fi...
2016/01/08
[ "https://Stackoverflow.com/questions/34677618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5694843/" ]
I would recommend to use `.each()` with the index as parameter as: ```js $('#tableresult tr').click(function(event) { $('td', this).each(function(i) { $('.inputWrapper input').eq(i).val(this.textContent); }); }); ``` ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/2....
Another alternative to the answer: ``` $('#tableresult tr').click(function(event) { $(this).find("td").each(function(index) { $($("input").get(index)).val($(this).text()); }); }); ``` [Here is the **JSFiddle** demo :D](https://jsfiddle.net/z5e6cq3e/)
65,642,799
I created several date-based views in Django, and while views for year and month function as expected, the view to display days is not detected. For instance, if I try to get <http://127.0.0.1:8000/blog/archive/2021/>, or <http://127.0.0.1:8000/blog/archive/2021/01> the views will be displayed, <http://127.0.0.1:8000/b...
2021/01/09
[ "https://Stackoverflow.com/questions/65642799", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11589677/" ]
Your URL pattern is matching correctly, specifically `'archive/<int:year>/<str:month>/<int:day>/'` will be matched for URL <http://127.0.0.1:8000/blog/archive/2021/01/07>. The error message indicates an invalid date string. It expects that the month field, specified as `%b`, be an abbreviated month *name*. So your URL...
You can try getting the date in this way ->`http://127.0.0.1:8000/blog/archive/2021-01-07` instead of this -> `http://127.0.0.1:8000/blog/archive/2021/01/07`. This will be a more easy way to handle things what you want ``` from django.urls import path, register_converter from datetime import datetime from . import vie...
45,191,875
I stuck. I have a folder with files with names: ``` individual_1_side1.jpg individual_1_side2.jpg individual_98_side1.jpg individual_98_side2.jpg ``` These are two photos of one individual, so files with the same number ending on \_side1.jpg and \_side2.jpg are paired. However, I need to change the numbers to other...
2017/07/19
[ "https://Stackoverflow.com/questions/45191875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8285649/" ]
let's try something like: ``` import os, random individuals = set() # keep only unique individuals for filename in os.listdir('/path/to/folder'): individuals.add( int(filename.split('_')[1]) ) # get the integer "individual number" individuals = list(individuals) # cast to list type random.shuffle(individuals) # ...
If you are trying to figure out how to pair the files, I would use a dictionary. The keys for the dictionary would be the individual numbers, and the values would be a list of the photos/filenames. Something like this: ``` list_of_filenames = [] pairs = {} for element in list_of_filenames: parts_of_filename = elem...
45,191,875
I stuck. I have a folder with files with names: ``` individual_1_side1.jpg individual_1_side2.jpg individual_98_side1.jpg individual_98_side2.jpg ``` These are two photos of one individual, so files with the same number ending on \_side1.jpg and \_side2.jpg are paired. However, I need to change the numbers to other...
2017/07/19
[ "https://Stackoverflow.com/questions/45191875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8285649/" ]
You can use `itertools.groupby`. ``` import os from itertools import groupby filenames = [filename for filename in os.listdir("path/2/dir")] for _, group in groupby(filenames, key=lambda item: item[:-5]): for filename in group: # genreate random numbner # rename old name to new name ```
If you are trying to figure out how to pair the files, I would use a dictionary. The keys for the dictionary would be the individual numbers, and the values would be a list of the photos/filenames. Something like this: ``` list_of_filenames = [] pairs = {} for element in list_of_filenames: parts_of_filename = elem...
45,191,875
I stuck. I have a folder with files with names: ``` individual_1_side1.jpg individual_1_side2.jpg individual_98_side1.jpg individual_98_side2.jpg ``` These are two photos of one individual, so files with the same number ending on \_side1.jpg and \_side2.jpg are paired. However, I need to change the numbers to other...
2017/07/19
[ "https://Stackoverflow.com/questions/45191875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8285649/" ]
let's try something like: ``` import os, random individuals = set() # keep only unique individuals for filename in os.listdir('/path/to/folder'): individuals.add( int(filename.split('_')[1]) ) # get the integer "individual number" individuals = list(individuals) # cast to list type random.shuffle(individuals) # ...
To randomly change the number assigned to each individual: ``` import random l = ["individual_1_side1.jpg","individual_1_side2.jpg", "individual_98_side1.jpg", "individual_98_side2.jpg"] numbers = [int(i.split("_")[1]) for i in l] new_numbers = {} for i in set(numbers): new_val = None while True: new_v...
45,191,875
I stuck. I have a folder with files with names: ``` individual_1_side1.jpg individual_1_side2.jpg individual_98_side1.jpg individual_98_side2.jpg ``` These are two photos of one individual, so files with the same number ending on \_side1.jpg and \_side2.jpg are paired. However, I need to change the numbers to other...
2017/07/19
[ "https://Stackoverflow.com/questions/45191875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8285649/" ]
You can use `itertools.groupby`. ``` import os from itertools import groupby filenames = [filename for filename in os.listdir("path/2/dir")] for _, group in groupby(filenames, key=lambda item: item[:-5]): for filename in group: # genreate random numbner # rename old name to new name ```
To randomly change the number assigned to each individual: ``` import random l = ["individual_1_side1.jpg","individual_1_side2.jpg", "individual_98_side1.jpg", "individual_98_side2.jpg"] numbers = [int(i.split("_")[1]) for i in l] new_numbers = {} for i in set(numbers): new_val = None while True: new_v...
40,513,000
I want to create elastic search indexes on neo4j data. I reffered <https://github.com/neo4j-contrib/neo4j-elasticsearch> and <https://www.youtube.com/watch?v=SJLSFsXgOvA&ab_channel=AnmolAgrawal> to create elasticsearch index from neo4j. But after that, im getting below error in neo4j.log file. ``` 2016-11-08 12:...
2016/11/09
[ "https://Stackoverflow.com/questions/40513000", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3748666/" ]
As this is one of the very few page that appears when you search Google for this string, I wanted to post a clear (one that J. Dimeo's answer above alludes to, but is far from specific). In your graylog config (`/etc/graylog/server/server.conf` for me), set `elasticsearch_discovery_enabled` to `false`, and resart the ...
Are you using AWS ElasticSearch? They do not allow connecting to individual nodes. I read elsewhere (from the AWS team): "Looking over the logs, it seems that 'i.s.c.config.discovery.NodeChecker' is trying to auto discover and connect to the individual nodes of the cluster. Amazon is continuously working hard on improv...
9,001,890
How do i stop the browser following to the file in jquery? i want the file to just be downloaded? ``` $('#4').change(function () { var name = this.value; if (name !== "") { if (confirm("Are you sure you want to download " + name)) { $.ajax({ url: '/uplo...
2012/01/25
[ "https://Stackoverflow.com/questions/9001890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/569654/" ]
You can create functions which return expressions such as this as a simple example in a predicate builder: ``` public static Expression<Func<T, bool>> True<T>() { return param => true; } ``` or this expression builder: ``` static Expression<T> Compose<T>(this Expression<T> first, Expression<T> second, Func<Expressi...
``` public Expression<Func<TypeOflistElement,bool>> GetLambdaExpression(string name) { return listElement => listElement.Name == name; } ```
9,001,890
How do i stop the browser following to the file in jquery? i want the file to just be downloaded? ``` $('#4').change(function () { var name = this.value; if (name !== "") { if (confirm("Are you sure you want to download " + name)) { $.ajax({ url: '/uplo...
2012/01/25
[ "https://Stackoverflow.com/questions/9001890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/569654/" ]
``` public Expression<Func<TypeOflistElement,bool>> GetLambdaExpression(string name) { return listElement => listElement.Name == name; } ```
You can return `Func<bool, T>` type like this ``` // Executed code var filteredList = listWithNames.Where(GetLambdaExpression("Adam")); // method public Func<bool, ListElementTypeName> GetLambdaExpression(string name) { return listElement => listElement.Name == name; } ``` But I can't understand what exactly yo...
9,001,890
How do i stop the browser following to the file in jquery? i want the file to just be downloaded? ``` $('#4').change(function () { var name = this.value; if (name !== "") { if (confirm("Are you sure you want to download " + name)) { $.ajax({ url: '/uplo...
2012/01/25
[ "https://Stackoverflow.com/questions/9001890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/569654/" ]
``` public Expression<Func<TypeOflistElement,bool>> GetLambdaExpression(string name) { return listElement => listElement.Name == name; } ```
You have to return Func<> since IEnumerable expects one, as in your example it would be: ``` public Func<String,Bool> (string name){..} ```
9,001,890
How do i stop the browser following to the file in jquery? i want the file to just be downloaded? ``` $('#4').change(function () { var name = this.value; if (name !== "") { if (confirm("Are you sure you want to download " + name)) { $.ajax({ url: '/uplo...
2012/01/25
[ "https://Stackoverflow.com/questions/9001890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/569654/" ]
``` public Expression<Func<TypeOflistElement,bool>> GetLambdaExpression(string name) { return listElement => listElement.Name == name; } ```
Where method for `IEnumerable<T>` expects delegate for `Func<T, bool>` method, so `GetLambdaExpression()` must return `Func<T, bool>` Where method for `IQueryable<T>` expects `Expression<Func<T, bool>>`, so `GetLambdaExpression()` must return `Expression<Func<T, bool>>`. `Expression` can be converted to delegate by ...
9,001,890
How do i stop the browser following to the file in jquery? i want the file to just be downloaded? ``` $('#4').change(function () { var name = this.value; if (name !== "") { if (confirm("Are you sure you want to download " + name)) { $.ajax({ url: '/uplo...
2012/01/25
[ "https://Stackoverflow.com/questions/9001890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/569654/" ]
You can create functions which return expressions such as this as a simple example in a predicate builder: ``` public static Expression<Func<T, bool>> True<T>() { return param => true; } ``` or this expression builder: ``` static Expression<T> Compose<T>(this Expression<T> first, Expression<T> second, Func<Expressi...
You can return `Func<bool, T>` type like this ``` // Executed code var filteredList = listWithNames.Where(GetLambdaExpression("Adam")); // method public Func<bool, ListElementTypeName> GetLambdaExpression(string name) { return listElement => listElement.Name == name; } ``` But I can't understand what exactly yo...
9,001,890
How do i stop the browser following to the file in jquery? i want the file to just be downloaded? ``` $('#4').change(function () { var name = this.value; if (name !== "") { if (confirm("Are you sure you want to download " + name)) { $.ajax({ url: '/uplo...
2012/01/25
[ "https://Stackoverflow.com/questions/9001890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/569654/" ]
You can create functions which return expressions such as this as a simple example in a predicate builder: ``` public static Expression<Func<T, bool>> True<T>() { return param => true; } ``` or this expression builder: ``` static Expression<T> Compose<T>(this Expression<T> first, Expression<T> second, Func<Expressi...
You have to return Func<> since IEnumerable expects one, as in your example it would be: ``` public Func<String,Bool> (string name){..} ```
9,001,890
How do i stop the browser following to the file in jquery? i want the file to just be downloaded? ``` $('#4').change(function () { var name = this.value; if (name !== "") { if (confirm("Are you sure you want to download " + name)) { $.ajax({ url: '/uplo...
2012/01/25
[ "https://Stackoverflow.com/questions/9001890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/569654/" ]
You can create functions which return expressions such as this as a simple example in a predicate builder: ``` public static Expression<Func<T, bool>> True<T>() { return param => true; } ``` or this expression builder: ``` static Expression<T> Compose<T>(this Expression<T> first, Expression<T> second, Func<Expressi...
Where method for `IEnumerable<T>` expects delegate for `Func<T, bool>` method, so `GetLambdaExpression()` must return `Func<T, bool>` Where method for `IQueryable<T>` expects `Expression<Func<T, bool>>`, so `GetLambdaExpression()` must return `Expression<Func<T, bool>>`. `Expression` can be converted to delegate by ...
46,523,884
I want to get the first date and last date of the month if given I have a numeric number of the month. For example January = 01, October = 10, November = 11 So if I pass 10 as parameter I should get the first and last date of October. I tried to implement it using [Carbon](http://carbon.nesbot.com/docs/). But I giv...
2017/10/02
[ "https://Stackoverflow.com/questions/46523884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1896108/" ]
The first day of any month is the first. use [createFromFormat](http://carbon.nesbot.com/docs/) ``` $dt = Carbon::createFromFormat('m', 10); echo $dt->endOfMonth(); ```
The issue is with this line: ``` Carbon::create(10); ``` Carbon's `create` method takes the following list of parameters: ``` $year, $month, $day, $hour, $minute, $second, $tz ``` And you're only providing the first one. So you end up with an object representing today's date, but in the year **10**. If you want ...
13,847,623
Considering the following objects and a corresponding view: ``` class first_object(osv.osv): _name = "first.object" _columns = { 'id': fields.integer ('First ID'), 'flag': fields.boolean ('Flag'), 'second_object_id': fields.one2many('second.object','first_object_...
2012/12/12
[ "https://Stackoverflow.com/questions/13847623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1278645/" ]
please look in stock\_move\_tree from stock.move ``` <field name="prodlot_id" groups="base.group_extended"/> <button name="%(track_line)d" string="Split in production lots" type="action" icon="terp-stock_effects-object-colorize" attrs="{'invisible': [('prodlot_id','&lt;&gt;',False)]}" states="draft,waiting,confi...
add a related field to flag in second.oject ``` class second_object(osv.osv): _name = "second.object" _columns = { 'id': fields.integer ('Second ID'), 'flag': fields.related('first_object_id', 'flag', type='boolean', relation='first.object', string='Flag'), 'first_object_id': field...
13,847,623
Considering the following objects and a corresponding view: ``` class first_object(osv.osv): _name = "first.object" _columns = { 'id': fields.integer ('First ID'), 'flag': fields.boolean ('Flag'), 'second_object_id': fields.one2many('second.object','first_object_...
2012/12/12
[ "https://Stackoverflow.com/questions/13847623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1278645/" ]
it seems trying to set an conditional invisible attribute will not affect the true view. only invisible="1". which makes sense since i can't imagine a tree view with some invisible field of which the entire column itself is not invisible.
add a related field to flag in second.oject ``` class second_object(osv.osv): _name = "second.object" _columns = { 'id': fields.integer ('Second ID'), 'flag': fields.related('first_object_id', 'flag', type='boolean', relation='first.object', string='Flag'), 'first_object_id': field...
13,847,623
Considering the following objects and a corresponding view: ``` class first_object(osv.osv): _name = "first.object" _columns = { 'id': fields.integer ('First ID'), 'flag': fields.boolean ('Flag'), 'second_object_id': fields.one2many('second.object','first_object_...
2012/12/12
[ "https://Stackoverflow.com/questions/13847623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1278645/" ]
please look in stock\_move\_tree from stock.move ``` <field name="prodlot_id" groups="base.group_extended"/> <button name="%(track_line)d" string="Split in production lots" type="action" icon="terp-stock_effects-object-colorize" attrs="{'invisible': [('prodlot_id','&lt;&gt;',False)]}" states="draft,waiting,confi...
You have take 1 extra new field (i.e boolean type field) in Object2. and create onchnage on "flag" field of object1. in that onchnage you set-reset the value of this new field according to value of Flag field. and put attrs on this new\_field instead of Flag. Hope This will help you
13,847,623
Considering the following objects and a corresponding view: ``` class first_object(osv.osv): _name = "first.object" _columns = { 'id': fields.integer ('First ID'), 'flag': fields.boolean ('Flag'), 'second_object_id': fields.one2many('second.object','first_object_...
2012/12/12
[ "https://Stackoverflow.com/questions/13847623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1278645/" ]
please look in stock\_move\_tree from stock.move ``` <field name="prodlot_id" groups="base.group_extended"/> <button name="%(track_line)d" string="Split in production lots" type="action" icon="terp-stock_effects-object-colorize" attrs="{'invisible': [('prodlot_id','&lt;&gt;',False)]}" states="draft,waiting,confi...
Please define the view for the model 'second.object' seperately. The same example is in stock\_partial\_picking.py file inside wizard folder in stock module. please check that. you may need to define a field as user [user1888049](https://stackoverflow.com/users/1888049/user1888049) told in his answer
13,847,623
Considering the following objects and a corresponding view: ``` class first_object(osv.osv): _name = "first.object" _columns = { 'id': fields.integer ('First ID'), 'flag': fields.boolean ('Flag'), 'second_object_id': fields.one2many('second.object','first_object_...
2012/12/12
[ "https://Stackoverflow.com/questions/13847623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1278645/" ]
it seems trying to set an conditional invisible attribute will not affect the true view. only invisible="1". which makes sense since i can't imagine a tree view with some invisible field of which the entire column itself is not invisible.
please look in stock\_move\_tree from stock.move ``` <field name="prodlot_id" groups="base.group_extended"/> <button name="%(track_line)d" string="Split in production lots" type="action" icon="terp-stock_effects-object-colorize" attrs="{'invisible': [('prodlot_id','&lt;&gt;',False)]}" states="draft,waiting,confi...
13,847,623
Considering the following objects and a corresponding view: ``` class first_object(osv.osv): _name = "first.object" _columns = { 'id': fields.integer ('First ID'), 'flag': fields.boolean ('Flag'), 'second_object_id': fields.one2many('second.object','first_object_...
2012/12/12
[ "https://Stackoverflow.com/questions/13847623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1278645/" ]
it seems trying to set an conditional invisible attribute will not affect the true view. only invisible="1". which makes sense since i can't imagine a tree view with some invisible field of which the entire column itself is not invisible.
You have take 1 extra new field (i.e boolean type field) in Object2. and create onchnage on "flag" field of object1. in that onchnage you set-reset the value of this new field according to value of Flag field. and put attrs on this new\_field instead of Flag. Hope This will help you
13,847,623
Considering the following objects and a corresponding view: ``` class first_object(osv.osv): _name = "first.object" _columns = { 'id': fields.integer ('First ID'), 'flag': fields.boolean ('Flag'), 'second_object_id': fields.one2many('second.object','first_object_...
2012/12/12
[ "https://Stackoverflow.com/questions/13847623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1278645/" ]
it seems trying to set an conditional invisible attribute will not affect the true view. only invisible="1". which makes sense since i can't imagine a tree view with some invisible field of which the entire column itself is not invisible.
Please define the view for the model 'second.object' seperately. The same example is in stock\_partial\_picking.py file inside wizard folder in stock module. please check that. you may need to define a field as user [user1888049](https://stackoverflow.com/users/1888049/user1888049) told in his answer
8,156,625
I had insert an image in the right sidebar and it is working fine in the front page but in other pages (there is a page called city in my site), images are not getting displayed including sidebar image. Same path and everything is same, still images are not getting displayed where in same images are displayed in front/...
2011/11/16
[ "https://Stackoverflow.com/questions/8156625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1035492/" ]
Here is a simple C# class that programatically creates an Excel WorkBook and adds two sheets to it, and then populates both sheets. Finally, it saves the WorkBook to a file in the application root directory so that you can inspect the results... ``` public class Tyburn1 { object missing = Type.Missing; public ...
``` var groupedSheetList = UserData .GroupBy (u => u.date) .Select (grp => grp.ToList ()) .ToList (); ``` You can try this ``` using (var package = new ExcelPackage ()) { foreach (var item in groupedSheetList) { var workSheet = package.Workbook.Worksheets.Add (item[0].date); ...
3,060,221
The following is an example calculation from Wikipedia's page on Percentage: [![enter image description here](https://i.stack.imgur.com/jSl9z.png)](https://i.stack.imgur.com/jSl9z.png) I understand everything up to the point where 3% is divided by 10%. I cannot seem to understand why these two percentages are divided...
2019/01/03
[ "https://math.stackexchange.com/questions/3060221", "https://math.stackexchange.com", "https://math.stackexchange.com/users/353330/" ]
Since $f$ is Riemann integrable, it is bounded and there exist finite numbers $m = \inf\_{x \in [a,b]}\, f(x)$ and $M = \sup\_{x \in [a,b]}\, f(x)$. Since $mg(x) \leqslant f(x)g(x) \leqslant Mg(x)$ for all $x \in [a,b]$ we have $$m\int\_a^b g(x) \, dx \leqslant \int\_a^b f(x) \, g(x) \, dx \leqslant M \int\_a^b g(x) \...
Let $m$ be the minimum and $M$ the maximum of $f.$ Then $m \int g \leq \int fg \leq M \int g;$ hence the result for $\xi \in [a, b].$ *Assume $\int g > 0.$* Assume what you want to be false, that means $\int fg = f(a) \int g$ or else $\int fg = f(b) \int g;$ suppose the first case. Then, $f(\xi) \int g > f(a) \int g$ o...
18,161,083
I want to filter the list without case sensitive. I want to match only character not match upper case or lower case. 1. XXXXXXX 2. yyyyyyy 3. XXxxx If I enter "X" in search box it displays both 1 and 3. I added the code below but it match the case sensitive also. ``` <!DOCTYPE html> <html> <head> <script src="http:/...
2013/08/10
[ "https://Stackoverflow.com/questions/18161083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2245006/" ]
You need to use `indexOf` ``` $(this).text().search(value) ``` supposed to be ``` $(this).text().indexOf(value) ``` And why do you want to attach your event using the attribute tag.It is a bad practice and should be avoided. You can use jQuery to attach the event. ``` $('input').keyup(function() { filter(th...
Try this : ``` function filter(element) { var value = $(element).val(); $("#theList > li").hide(); $("#theList > li:contains('" + value + "')").show(); } ```
18,161,083
I want to filter the list without case sensitive. I want to match only character not match upper case or lower case. 1. XXXXXXX 2. yyyyyyy 3. XXxxx If I enter "X" in search box it displays both 1 and 3. I added the code below but it match the case sensitive also. ``` <!DOCTYPE html> <html> <head> <script src="http:/...
2013/08/10
[ "https://Stackoverflow.com/questions/18161083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2245006/" ]
You need to use `indexOf` ``` $(this).text().search(value) ``` supposed to be ``` $(this).text().indexOf(value) ``` And why do you want to attach your event using the attribute tag.It is a bad practice and should be avoided. You can use jQuery to attach the event. ``` $('input').keyup(function() { filter(th...
Just replace ``` $(this).text().search(value) > -1 ``` with: ``` $(this).text().search(new RegExp(value, "i")) > -1 ``` and that should do the trick. Here is a working **[FIDDLE](http://jsfiddle.net/EX3dp/)**
18,161,083
I want to filter the list without case sensitive. I want to match only character not match upper case or lower case. 1. XXXXXXX 2. yyyyyyy 3. XXxxx If I enter "X" in search box it displays both 1 and 3. I added the code below but it match the case sensitive also. ``` <!DOCTYPE html> <html> <head> <script src="http:/...
2013/08/10
[ "https://Stackoverflow.com/questions/18161083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2245006/" ]
You need to use `indexOf` ``` $(this).text().search(value) ``` supposed to be ``` $(this).text().indexOf(value) ``` And why do you want to attach your event using the attribute tag.It is a bad practice and should be avoided. You can use jQuery to attach the event. ``` $('input').keyup(function() { filter(th...
Just Add `jQuery.expr[":"].contains = function (a, i, m) { return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase())>=0;};`
18,161,083
I want to filter the list without case sensitive. I want to match only character not match upper case or lower case. 1. XXXXXXX 2. yyyyyyy 3. XXxxx If I enter "X" in search box it displays both 1 and 3. I added the code below but it match the case sensitive also. ``` <!DOCTYPE html> <html> <head> <script src="http:/...
2013/08/10
[ "https://Stackoverflow.com/questions/18161083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2245006/" ]
Just replace ``` $(this).text().search(value) > -1 ``` with: ``` $(this).text().search(new RegExp(value, "i")) > -1 ``` and that should do the trick. Here is a working **[FIDDLE](http://jsfiddle.net/EX3dp/)**
Try this : ``` function filter(element) { var value = $(element).val(); $("#theList > li").hide(); $("#theList > li:contains('" + value + "')").show(); } ```
18,161,083
I want to filter the list without case sensitive. I want to match only character not match upper case or lower case. 1. XXXXXXX 2. yyyyyyy 3. XXxxx If I enter "X" in search box it displays both 1 and 3. I added the code below but it match the case sensitive also. ``` <!DOCTYPE html> <html> <head> <script src="http:/...
2013/08/10
[ "https://Stackoverflow.com/questions/18161083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2245006/" ]
Just Add `jQuery.expr[":"].contains = function (a, i, m) { return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase())>=0;};`
Try this : ``` function filter(element) { var value = $(element).val(); $("#theList > li").hide(); $("#theList > li:contains('" + value + "')").show(); } ```
18,161,083
I want to filter the list without case sensitive. I want to match only character not match upper case or lower case. 1. XXXXXXX 2. yyyyyyy 3. XXxxx If I enter "X" in search box it displays both 1 and 3. I added the code below but it match the case sensitive also. ``` <!DOCTYPE html> <html> <head> <script src="http:/...
2013/08/10
[ "https://Stackoverflow.com/questions/18161083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2245006/" ]
Just replace ``` $(this).text().search(value) > -1 ``` with: ``` $(this).text().search(new RegExp(value, "i")) > -1 ``` and that should do the trick. Here is a working **[FIDDLE](http://jsfiddle.net/EX3dp/)**
Just Add `jQuery.expr[":"].contains = function (a, i, m) { return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase())>=0;};`
51,625,704
I'm trying to set up a local Laravel website to learn the new features and differences in Laravel 5.6. However, when trying to place a Font Awesome icon in the `navbar-brand` in Bootstrap 4 it won't seem to load. When I check out the element in the inspector in Chrome the elements dimensions are 0x0. I tried adding wid...
2018/08/01
[ "https://Stackoverflow.com/questions/51625704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8666851/" ]
`fa-laptop-code` is not available in the version of font-awesome you are loading. You are loading 4.7, but if you want to use that icon you need to load FontAwesome 5 Use this CDN instead: <https://use.fontawesome.com/releases/v5.2.0/css/all.css>
Try this, it will work ``` <i class="fa fa-laptop"></i> ```
51,625,704
I'm trying to set up a local Laravel website to learn the new features and differences in Laravel 5.6. However, when trying to place a Font Awesome icon in the `navbar-brand` in Bootstrap 4 it won't seem to load. When I check out the element in the inspector in Chrome the elements dimensions are 0x0. I tried adding wid...
2018/08/01
[ "https://Stackoverflow.com/questions/51625704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8666851/" ]
`fa-laptop-code` is not available in the version of font-awesome you are loading. You are loading 4.7, but if you want to use that icon you need to load FontAwesome 5 Use this CDN instead: <https://use.fontawesome.com/releases/v5.2.0/css/all.css>
```html <!DOCTYPE html> <html> <head> <title>App</title> <link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"> ...
51,760
To me, the sentence [*He held his daughter by the arm*](http://dictionary.cambridge.org/dictionary/british/the) implies holding a baby in the arm like this photo: ![enter image description here](https://i.stack.imgur.com/ee2zt.jpg) However is there any ambiguity here in the meaning? Can this mean *he kept his daughter...
2015/02/28
[ "https://ell.stackexchange.com/questions/51760", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/3630/" ]
The photo in your question shows a man holding a baby *in* his arm, or cradling a baby in his arm. We usually mean something like this when we say *hold **by** the arm.* ![enter image description here](https://i.stack.imgur.com/BwzaC.jpg) It often describes a method to keep someone from leaving, yes.
There's no real ambiguity. When we speak of *“holding someone by the arm”* we almost always mean ***restraining*** them, by firmly grasping **their** arm. So a native speaker might say the man in OP's picture is ***cradling*** his daughter [in/with/using one arm]. We wouldn't say he's holding her ***by*** the arm, bec...
51,760
To me, the sentence [*He held his daughter by the arm*](http://dictionary.cambridge.org/dictionary/british/the) implies holding a baby in the arm like this photo: ![enter image description here](https://i.stack.imgur.com/ee2zt.jpg) However is there any ambiguity here in the meaning? Can this mean *he kept his daughter...
2015/02/28
[ "https://ell.stackexchange.com/questions/51760", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/3630/" ]
The photo in your question shows a man holding a baby *in* his arm, or cradling a baby in his arm. We usually mean something like this when we say *hold **by** the arm.* ![enter image description here](https://i.stack.imgur.com/BwzaC.jpg) It often describes a method to keep someone from leaving, yes.
I would describe the picture in your question in this way: > > He held is daughter ***in*** his arm. > > > ![enter image description here](https://i.stack.imgur.com/msjsD.png) However, in the picture above, we might say: A: The father is holding his son **by the arm**. B: The brother and sister are **holdi...
52,649,479
As a leaner of Kubernetes concepts, their working, and deployment with it. I have a couple of cases which I don't know how to achieve. I am looking for advice or some guideline to achieve it. I am using the Google Cloud Platform. The current running flow is described below. A push to the google source repository trigg...
2018/10/04
[ "https://Stackoverflow.com/questions/52649479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6037999/" ]
1. Like the other answer use [Liveness and Readiness probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/). Basically, a new pod is added to the service pool then it will only serve traffic after the readiness probe has passed. The old pod is removed from the Service poo...
I can answer case 1 since Ive done it myself. Use Deployments with `readinessProbes` & `livelinessProbes`
11,115,102
My question is, why "text-overflow:ellipsis;" doesnt work for me? I have table on my page and i want to shorten some text inside cell(td). As you can see i have no width parameter in css. I get this value from json and then I set it with jquery. Maybe this is the problem? If so, how can i solve it? ``` #myTable2 td{ ...
2012/06/20
[ "https://Stackoverflow.com/questions/11115102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1269179/" ]
`text-overflow` works with `display: block` elements, while table cells are `display: table-cell` elements. Enclosing your text in a `<div>` [should work](http://jsfiddle.net/rAtY7/) (fiddle sets the width when you click on the text).
You need a width of the table and table-layout:fixed; <http://jsfiddle.net/CagPK/> ``` #myTable2 td{ white-space: nowrap; overflow: hidden; text-overflow:ellipsis; } #myTable2 { table-layout:fixed; width: 100px; } ​ ```
30,811,927
I've been following <https://github.com/opentok/learning-opentok-ios/tree/basics.step-7> to try and get a video app to work on iOS using the OpenTok SDK. I've already published an app called dongu using <https://dashboard.heroku.com/new?template=https%3A%2F%2Fgithub.com%2Fopentok%2Flearning-opentok-php&button-url=htt...
2015/06/12
[ "https://Stackoverflow.com/questions/30811927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2137485/" ]
Try > > heroku git:remote -a dongu > > > then > > git push heroku master > > >
Simply following the instructions in <https://dashboard.heroku.com/apps/dongu/deploy/heroku-git> did the trick, without me needing to know the remote URL, hopefully that's useful for anyone else having this problem.
30,811,927
I've been following <https://github.com/opentok/learning-opentok-ios/tree/basics.step-7> to try and get a video app to work on iOS using the OpenTok SDK. I've already published an app called dongu using <https://dashboard.heroku.com/new?template=https%3A%2F%2Fgithub.com%2Fopentok%2Flearning-opentok-php&button-url=htt...
2015/06/12
[ "https://Stackoverflow.com/questions/30811927", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2137485/" ]
It might not be a git repo yet. Run `git init` first.
Simply following the instructions in <https://dashboard.heroku.com/apps/dongu/deploy/heroku-git> did the trick, without me needing to know the remote URL, hopefully that's useful for anyone else having this problem.
19,897,727
In playing around with C#'s Speech Recognition, I've stumbled across a road block in the creation of an effective GrammerBuilder with Choices (more specifically, Choices of Choices). IE considering the following logical commands. ![](https://i.imgur.com/ZB3dnWg.png) One solution would to "hard code" every combinatio...
2013/11/11
[ "https://Stackoverflow.com/questions/19897727", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2210179/" ]
You can build a `Choices` object from a set of `GrammarBuilder` objects using the [`Choices.Add`](http://msdn.microsoft.com/en-us/library/ms576557%28v=vs.110%29.aspx) method: ``` // Create alternatives for female names and add a phrase. GrammarBuilder females = new Choices(new string[] { "Anne", "Mary" }); femal...
Work backwards appending grammarbuilder objects as opposed to choices objects. The choices object should only be used for the final tree options (red, blue) & (black, white).
38,881,266
I am not sure what I am doing wrong in the following code. The alert box does not render about 1 in 5 times when I click the "PRESS ME!" for the first time after I run the code. It renders fine every time I click the button after that. To test the code you may have to run this code multiple times. Can someone please go...
2016/08/10
[ "https://Stackoverflow.com/questions/38881266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3368518/" ]
You need to use the [`navbar-fixed-bottom`](http://getbootstrap.com/components/#navbar-fixed-bottom) class: ``` <div class="navbar navbar-default navbar-static-bottom navbar-fixed-bottom"> ... </div> ```
Try to wrap your code like this: HTML code: ``` <body> <div class="page-wrap"> . . . </div> <footer class="page-footer"> . . . </footer> </body> ``` CSS code: ``` * { margin: 0; } html, body { height: 100%; } .page-wrap { min-height: 100%; margin-bottom: -20p...
38,881,266
I am not sure what I am doing wrong in the following code. The alert box does not render about 1 in 5 times when I click the "PRESS ME!" for the first time after I run the code. It renders fine every time I click the button after that. To test the code you may have to run this code multiple times. Can someone please go...
2016/08/10
[ "https://Stackoverflow.com/questions/38881266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3368518/" ]
You need to use the [`navbar-fixed-bottom`](http://getbootstrap.com/components/#navbar-fixed-bottom) class: ``` <div class="navbar navbar-default navbar-static-bottom navbar-fixed-bottom"> ... </div> ```
You should be able to achieve a footer that sticks to the bottom of your page at all times by using something like this template in your HTML: ``` <!DOCTYPE html> <head> <title></title> </head> <body> <footer></footer> </body> </html> ``` And this in your CSS: ``` html { position: relative; ...
38,881,266
I am not sure what I am doing wrong in the following code. The alert box does not render about 1 in 5 times when I click the "PRESS ME!" for the first time after I run the code. It renders fine every time I click the button after that. To test the code you may have to run this code multiple times. Can someone please go...
2016/08/10
[ "https://Stackoverflow.com/questions/38881266", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3368518/" ]
You should be able to achieve a footer that sticks to the bottom of your page at all times by using something like this template in your HTML: ``` <!DOCTYPE html> <head> <title></title> </head> <body> <footer></footer> </body> </html> ``` And this in your CSS: ``` html { position: relative; ...
Try to wrap your code like this: HTML code: ``` <body> <div class="page-wrap"> . . . </div> <footer class="page-footer"> . . . </footer> </body> ``` CSS code: ``` * { margin: 0; } html, body { height: 100%; } .page-wrap { min-height: 100%; margin-bottom: -20p...
14,717,737
I have native select of Locales implemented like that: ``` NativeSelect selectLang = new NativeSelect(); for (Locale locale : localeProvider.getSupportedLocales()) { selectLang.setItemCaption(locale, localeProvider.getLabel(locale)); selectLang.addItem(locale); } select...
2013/02/05
[ "https://Stackoverflow.com/questions/14717737", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1892267/" ]
Instead using a giant `switch` statement, you can define a `Dictionary` to map each `MessageType` value to its defined `Message` derived class and creates an instance using this mapping data. **Dictionary definition:** ``` Dictionary<int, Type> mappings = new Dictionary<int, Type>(); mappings.Add(MessageType.ChatMsg,...
You're on a right track and using a dictionary is a good idea. If reflection is too slow you can use expressions, like this (I'm assuming you decorate the Messages classes with a MessageTypeAttribute). ``` public class Test { public Test() { var dict=new Dictionary<MessageType,Func<Buffer,Mesage>>(); var...
53,338
When developing an extension is there an reason other than simply "Best Practice" to include a `en_US` or extension base language translation file? **Example** I write an extension with some text where the default language is English. I then translate this to say German and Swedish so I obviously include these two as...
2015/01/26
[ "https://magento.stackexchange.com/questions/53338", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/158/" ]
The only reason I see is to allow the extension users to change the texts. So if they are not OK with ``` "My cool text","My cool text" ``` they can change it to ``` "My cool text","My text is cool" ``` I know this can be done even if the en\_US file does not exist. Anyone can just create it, but it's nice t...
There is exactly no technical reason because Magento completely ignores translations where the original text equals the translated text (resulting in unexpected behavior if you want to change an english translation for one module but not for another, but that's another topic). But it's a service for everybody who need...
58,902,747
version 1.10 , Apache geode exampples of clientSecurity when I build the project and execute the 'start' task, the GemFireSecurityException always occurs when start the server. even I can find the file "example\_security.json" in the dir build/resources/main/. and locator can find the file but server can't, why? ```...
2019/11/17
[ "https://Stackoverflow.com/questions/58902747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9122063/" ]
Create a second wrapping type that when it is provided a type it doesn't omit data but when there is no type provided, then data field is omitted. As you stated, making data optional won't be the right thing as you need the field to not exist at all when you don't need it. ``` export interface IInterationData<T> { ...
You can try something like this ``` export interface AlertInteraction<T = any> { id: AlertId; data?: T; buttonId: AlertButtonId; } // those are valid: const x: AlertInteraction = {id: 'AlertId', buttonId: 'AlertButtonId'}; // Accept the data property as number only. const x: AlertInteraction<number> = {id: 'A...
58,902,747
version 1.10 , Apache geode exampples of clientSecurity when I build the project and execute the 'start' task, the GemFireSecurityException always occurs when start the server. even I can find the file "example\_security.json" in the dir build/resources/main/. and locator can find the file but server can't, why? ```...
2019/11/17
[ "https://Stackoverflow.com/questions/58902747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9122063/" ]
In order to achieve that we need to use conditional types. ``` type AlertId = string; // just example type alias type AlertButtonId = string; // just example type alias type AlertInteraction<T = undefined> = { id: AlertId; buttonId: AlertButtonId; } & (T extends undefined ? {} : { data: T; }) // example usage /...
You can try something like this ``` export interface AlertInteraction<T = any> { id: AlertId; data?: T; buttonId: AlertButtonId; } // those are valid: const x: AlertInteraction = {id: 'AlertId', buttonId: 'AlertButtonId'}; // Accept the data property as number only. const x: AlertInteraction<number> = {id: 'A...
58,902,747
version 1.10 , Apache geode exampples of clientSecurity when I build the project and execute the 'start' task, the GemFireSecurityException always occurs when start the server. even I can find the file "example\_security.json" in the dir build/resources/main/. and locator can find the file but server can't, why? ```...
2019/11/17
[ "https://Stackoverflow.com/questions/58902747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9122063/" ]
In order to achieve that we need to use conditional types. ``` type AlertId = string; // just example type alias type AlertButtonId = string; // just example type alias type AlertInteraction<T = undefined> = { id: AlertId; buttonId: AlertButtonId; } & (T extends undefined ? {} : { data: T; }) // example usage /...
Create a second wrapping type that when it is provided a type it doesn't omit data but when there is no type provided, then data field is omitted. As you stated, making data optional won't be the right thing as you need the field to not exist at all when you don't need it. ``` export interface IInterationData<T> { ...
34,680,575
I am creating an Android app which will allow users to upload video files to dropbox. I want the app to display a pop up message when the upload has completed which shows the user the URL to re-download their file. I'm using the Dropbox API V2 but I can't find anything relating to this. Looking online I can find mentio...
2016/01/08
[ "https://Stackoverflow.com/questions/34680575", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5763502/" ]
The standard way of getting a file's data from the Dropbox API is by directly downloading the data from a file download endpoint, and not by returning a URL the user can access. In the Dropbox API v2 Java SDK, you can use the [`downloadBuilder`](https://dropbox.github.io/dropbox-sdk-java/api-docs/v2.0.x/com/dropbox/cor...
Maybe before get an answer for this question, you need to clarify what kind of solution you are seeking for. There are three kinds of potential solutions for this task. (1) Using the Acitivties or Dialog provided by Dropbox SDK, you use Intent to interact with them and get response in onActivityResult() call. (2)...
7,066,466
I'm trying to create a form where the background of the input fields are styled with a gradient background. It succeds for all `<input>` tags, but not for the `<select>` tag. Can this be done? Am I doing something wrong? The CSS I'm using: ``` form#contact input[type="text"], input[type="url"], input[type="email"], ...
2011/08/15
[ "https://Stackoverflow.com/questions/7066466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/591935/" ]
You may have a problem with this due to the operating system and Internet Browser you are using. One easy way of getting round this is by using a JQuery library called Uniform. It allows you to style form elements how you want and is cross-browser compatible. You can find more information on this here: <http://unifor...
Have you tried to debug that in firebug? How about making the backgrounds important? ``` form#contact input[type="text"], input[type="url"], input[type="email"], input[type="tel"], textarea, select { margin: 3px 0 0 0; padding: 6px; width: 260px; font-family: arial, sans-serif;...
7,066,466
I'm trying to create a form where the background of the input fields are styled with a gradient background. It succeds for all `<input>` tags, but not for the `<select>` tag. Can this be done? Am I doing something wrong? The CSS I'm using: ``` form#contact input[type="text"], input[type="url"], input[type="email"], ...
2011/08/15
[ "https://Stackoverflow.com/questions/7066466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/591935/" ]
Styling `<select>` is difficult since browsers try and render the control to match the OS. You could add `-webkit-appearance: none;` to enable the gradient but that will also remove the *arrow*. See [Add gradient to select box w/ CSS3 in chrome?](https://stackoverflow.com/questions/3831957/add-gradient-to-select-box-w...
Have you tried to debug that in firebug? How about making the backgrounds important? ``` form#contact input[type="text"], input[type="url"], input[type="email"], input[type="tel"], textarea, select { margin: 3px 0 0 0; padding: 6px; width: 260px; font-family: arial, sans-serif;...
7,066,466
I'm trying to create a form where the background of the input fields are styled with a gradient background. It succeds for all `<input>` tags, but not for the `<select>` tag. Can this be done? Am I doing something wrong? The CSS I'm using: ``` form#contact input[type="text"], input[type="url"], input[type="email"], ...
2011/08/15
[ "https://Stackoverflow.com/questions/7066466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/591935/" ]
Styling `<select>` is difficult since browsers try and render the control to match the OS. You could add `-webkit-appearance: none;` to enable the gradient but that will also remove the *arrow*. See [Add gradient to select box w/ CSS3 in chrome?](https://stackoverflow.com/questions/3831957/add-gradient-to-select-box-w...
You may have a problem with this due to the operating system and Internet Browser you are using. One easy way of getting round this is by using a JQuery library called Uniform. It allows you to style form elements how you want and is cross-browser compatible. You can find more information on this here: <http://unifor...
48,209,671
Attached you'll find an image explaining what i'd like to accomplish. I would like to have my background set, over that I would like to have a border that's a bit offset from the background. In some way I need to find a way to animate every single side of the border by it's own. I would like the top border to animate ...
2018/01/11
[ "https://Stackoverflow.com/questions/48209671", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7567503/" ]
A bash for loop will not fail if part of its body returns non-zero. You have to explicitly test for it, and handle it. For example: ``` for role in $user_roles do expect_scripts/users.exp $role"1" $role $user_email $password if [ $? -ne 0 ]; then exit 1; fi ...
at the top use `set -e` in the expect script
18,487
I want to display E.coli BW25113 (GenBank: CP009273.1) strain in UCSC browser. This strain is not listed in <http://microbes.ucsc.edu/> browser. How can I display E.coli BW25113 assembly in the browser?
2022/02/04
[ "https://bioinformatics.stackexchange.com/questions/18487", "https://bioinformatics.stackexchange.com", "https://bioinformatics.stackexchange.com/users/14180/" ]
I found two methods: 1. You want to visit this page for instructions for novel assemblies: <http://genomewiki.ucsc.edu/index.php/Assembly_Hubs> . 2. However, before doing that I highly recommend that you check Genome Assembly Hub first: <https://genome-test.gi.ucsc.edu/gbdb/hubs/genbank/> . There is a good chance that...
I am not sure if this qualifies as an official answer. I have contacted UCSC bioinformatics team. They were were very kind and told me that they would add any track that was requested by users. After my request, they kindly added the track for E.coli BW25113. If you want your reference tracks to be added you could subm...
6,505,392
In a few of my `UIView`s, I have a few `UIImageView`s and `UILabel`s. They are in a good position when the `UIView` is in portrait mode, but the positioning on the `UIImageView`s and `UILabel`s are messed up when the `UIView` becomes landscape mode. How can I make sure that the `UIImageView`s and `UILabel`s are in the...
2011/06/28
[ "https://Stackoverflow.com/questions/6505392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/735746/" ]
Check out Aptana (<http://www.aptana.com/>). It's free and has almost everything you will ever need as well as an awesome debugger. Also, grab yourself a copy of FireFox with FireBug extension. It's amazing for real time debugging in the browser and allows you to make changes to live code to see how it might look/work...
**HTML5/Javascript framework** : I would recommend [Sencha](http://www.sencha.com/) . I've used extjs library in the past which is part of this framework now. The tool set is also useful. **IDE** : Eclipse or Aptana IDE (both are free) Also see this question on SO : [Any good, visual HTML5 Editor or IDE?](https://st...
6,505,392
In a few of my `UIView`s, I have a few `UIImageView`s and `UILabel`s. They are in a good position when the `UIView` is in portrait mode, but the positioning on the `UIImageView`s and `UILabel`s are messed up when the `UIView` becomes landscape mode. How can I make sure that the `UIImageView`s and `UILabel`s are in the...
2011/06/28
[ "https://Stackoverflow.com/questions/6505392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/735746/" ]
Check out Aptana (<http://www.aptana.com/>). It's free and has almost everything you will ever need as well as an awesome debugger. Also, grab yourself a copy of FireFox with FireBug extension. It's amazing for real time debugging in the browser and allows you to make changes to live code to see how it might look/work...
I suppose, technically if you're just coding HTML and JavaScript then any IDE or text editor would do, even Notepad. You can save files locally and everything would work because HTML and JS don't require a server to run anything, just a browser. One thing to note is, if you're using ajax at all in your development env...
6,505,392
In a few of my `UIView`s, I have a few `UIImageView`s and `UILabel`s. They are in a good position when the `UIView` is in portrait mode, but the positioning on the `UIImageView`s and `UILabel`s are messed up when the `UIView` becomes landscape mode. How can I make sure that the `UIImageView`s and `UILabel`s are in the...
2011/06/28
[ "https://Stackoverflow.com/questions/6505392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/735746/" ]
Check out Aptana (<http://www.aptana.com/>). It's free and has almost everything you will ever need as well as an awesome debugger. Also, grab yourself a copy of FireFox with FireBug extension. It's amazing for real time debugging in the browser and allows you to make changes to live code to see how it might look/work...
To answer the follow up first. Yes. JavaScript is the way to manipulate the DOM. Not that it is the only way to parse a DOM, but it is the only widely accepted way to do it in a browser. That goes for both desktop versions as well as the mobile browsers. As for IDE's. I personally use a mix of Visual Studio 2010( i...
6,505,392
In a few of my `UIView`s, I have a few `UIImageView`s and `UILabel`s. They are in a good position when the `UIView` is in portrait mode, but the positioning on the `UIImageView`s and `UILabel`s are messed up when the `UIView` becomes landscape mode. How can I make sure that the `UIImageView`s and `UILabel`s are in the...
2011/06/28
[ "https://Stackoverflow.com/questions/6505392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/735746/" ]
**HTML5/Javascript framework** : I would recommend [Sencha](http://www.sencha.com/) . I've used extjs library in the past which is part of this framework now. The tool set is also useful. **IDE** : Eclipse or Aptana IDE (both are free) Also see this question on SO : [Any good, visual HTML5 Editor or IDE?](https://st...
To answer the follow up first. Yes. JavaScript is the way to manipulate the DOM. Not that it is the only way to parse a DOM, but it is the only widely accepted way to do it in a browser. That goes for both desktop versions as well as the mobile browsers. As for IDE's. I personally use a mix of Visual Studio 2010( i...
6,505,392
In a few of my `UIView`s, I have a few `UIImageView`s and `UILabel`s. They are in a good position when the `UIView` is in portrait mode, but the positioning on the `UIImageView`s and `UILabel`s are messed up when the `UIView` becomes landscape mode. How can I make sure that the `UIImageView`s and `UILabel`s are in the...
2011/06/28
[ "https://Stackoverflow.com/questions/6505392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/735746/" ]
It's a tricky question to answer as it's very much down to personal preference. It sounds as though you are starting out, so to guess a couple of requirements I'm guessing you'll probably want it to be free (or cheap), easy to use, easy to install? If so I'd reccomend checking out either [Mirosoft WebMatrix](http://w...
**HTML5/Javascript framework** : I would recommend [Sencha](http://www.sencha.com/) . I've used extjs library in the past which is part of this framework now. The tool set is also useful. **IDE** : Eclipse or Aptana IDE (both are free) Also see this question on SO : [Any good, visual HTML5 Editor or IDE?](https://st...
6,505,392
In a few of my `UIView`s, I have a few `UIImageView`s and `UILabel`s. They are in a good position when the `UIView` is in portrait mode, but the positioning on the `UIImageView`s and `UILabel`s are messed up when the `UIView` becomes landscape mode. How can I make sure that the `UIImageView`s and `UILabel`s are in the...
2011/06/28
[ "https://Stackoverflow.com/questions/6505392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/735746/" ]
I suppose, technically if you're just coding HTML and JavaScript then any IDE or text editor would do, even Notepad. You can save files locally and everything would work because HTML and JS don't require a server to run anything, just a browser. One thing to note is, if you're using ajax at all in your development env...
To answer the follow up first. Yes. JavaScript is the way to manipulate the DOM. Not that it is the only way to parse a DOM, but it is the only widely accepted way to do it in a browser. That goes for both desktop versions as well as the mobile browsers. As for IDE's. I personally use a mix of Visual Studio 2010( i...
6,505,392
In a few of my `UIView`s, I have a few `UIImageView`s and `UILabel`s. They are in a good position when the `UIView` is in portrait mode, but the positioning on the `UIImageView`s and `UILabel`s are messed up when the `UIView` becomes landscape mode. How can I make sure that the `UIImageView`s and `UILabel`s are in the...
2011/06/28
[ "https://Stackoverflow.com/questions/6505392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/735746/" ]
It's a tricky question to answer as it's very much down to personal preference. It sounds as though you are starting out, so to guess a couple of requirements I'm guessing you'll probably want it to be free (or cheap), easy to use, easy to install? If so I'd reccomend checking out either [Mirosoft WebMatrix](http://w...
I suppose, technically if you're just coding HTML and JavaScript then any IDE or text editor would do, even Notepad. You can save files locally and everything would work because HTML and JS don't require a server to run anything, just a browser. One thing to note is, if you're using ajax at all in your development env...
6,505,392
In a few of my `UIView`s, I have a few `UIImageView`s and `UILabel`s. They are in a good position when the `UIView` is in portrait mode, but the positioning on the `UIImageView`s and `UILabel`s are messed up when the `UIView` becomes landscape mode. How can I make sure that the `UIImageView`s and `UILabel`s are in the...
2011/06/28
[ "https://Stackoverflow.com/questions/6505392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/735746/" ]
It's a tricky question to answer as it's very much down to personal preference. It sounds as though you are starting out, so to guess a couple of requirements I'm guessing you'll probably want it to be free (or cheap), easy to use, easy to install? If so I'd reccomend checking out either [Mirosoft WebMatrix](http://w...
To answer the follow up first. Yes. JavaScript is the way to manipulate the DOM. Not that it is the only way to parse a DOM, but it is the only widely accepted way to do it in a browser. That goes for both desktop versions as well as the mobile browsers. As for IDE's. I personally use a mix of Visual Studio 2010( i...
24,011,746
Am working on form validations for newsletter for a project am on, the news letter form appears on every page so it will also appear on the longin and registration page so i decided to make use of Laravel Message Bags to store the news letter errors but it keeps giving me an undefined property error on the actual page ...
2014/06/03
[ "https://Stackoverflow.com/questions/24011746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1134317/" ]
The `RedirectResponse` class function `withErrors()` doesn't have a second parameter.. The function `vendor\laravel\framework\src\Illuminate\Http\RedirectResponse.php -> withErrors()`: ``` /** * Flash a container of errors to the session. * * @param \Illuminate\Support\Contracts\MessageProviderInterface|array $...
`withErrors` should receive the messages from validator object. After your validation process something like: ``` $validation = Validator::make(Input::all(), $validation_rules); if (!$validation->passes()){ return Redirect::back()->withInput()->withErrors($validation->messages()); } ``` I hope it works...
24,011,746
Am working on form validations for newsletter for a project am on, the news letter form appears on every page so it will also appear on the longin and registration page so i decided to make use of Laravel Message Bags to store the news letter errors but it keeps giving me an undefined property error on the actual page ...
2014/06/03
[ "https://Stackoverflow.com/questions/24011746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1134317/" ]
**Code in controller:** ``` $post_data = Input::all(); $validator = Validator::make(Input::all(), array( 'email' => 'required', 'password' => 'required' )); if ($validator->fails()) { return Redirect::back() ->withInput() ->wit...
`withErrors` should receive the messages from validator object. After your validation process something like: ``` $validation = Validator::make(Input::all(), $validation_rules); if (!$validation->passes()){ return Redirect::back()->withInput()->withErrors($validation->messages()); } ``` I hope it works...
24,011,746
Am working on form validations for newsletter for a project am on, the news letter form appears on every page so it will also appear on the longin and registration page so i decided to make use of Laravel Message Bags to store the news letter errors but it keeps giving me an undefined property error on the actual page ...
2014/06/03
[ "https://Stackoverflow.com/questions/24011746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1134317/" ]
`withErrors` should receive the messages from validator object. After your validation process something like: ``` $validation = Validator::make(Input::all(), $validation_rules); if (!$validation->passes()){ return Redirect::back()->withInput()->withErrors($validation->messages()); } ``` I hope it works...
You can write a function like this ``` if(!function_exists('errors_for')) { function errors_for($attribute = null, $errors = null) { if($errors && $errors->any()) { return '<p class="text-danger">'.$errors->first($attribute).'</p>'; } } } ``` then in your View ``` <div class="form-group"...
24,011,746
Am working on form validations for newsletter for a project am on, the news letter form appears on every page so it will also appear on the longin and registration page so i decided to make use of Laravel Message Bags to store the news letter errors but it keeps giving me an undefined property error on the actual page ...
2014/06/03
[ "https://Stackoverflow.com/questions/24011746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1134317/" ]
The `RedirectResponse` class function `withErrors()` doesn't have a second parameter.. The function `vendor\laravel\framework\src\Illuminate\Http\RedirectResponse.php -> withErrors()`: ``` /** * Flash a container of errors to the session. * * @param \Illuminate\Support\Contracts\MessageProviderInterface|array $...
You can write a function like this ``` if(!function_exists('errors_for')) { function errors_for($attribute = null, $errors = null) { if($errors && $errors->any()) { return '<p class="text-danger">'.$errors->first($attribute).'</p>'; } } } ``` then in your View ``` <div class="form-group"...
24,011,746
Am working on form validations for newsletter for a project am on, the news letter form appears on every page so it will also appear on the longin and registration page so i decided to make use of Laravel Message Bags to store the news letter errors but it keeps giving me an undefined property error on the actual page ...
2014/06/03
[ "https://Stackoverflow.com/questions/24011746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1134317/" ]
**Code in controller:** ``` $post_data = Input::all(); $validator = Validator::make(Input::all(), array( 'email' => 'required', 'password' => 'required' )); if ($validator->fails()) { return Redirect::back() ->withInput() ->wit...
You can write a function like this ``` if(!function_exists('errors_for')) { function errors_for($attribute = null, $errors = null) { if($errors && $errors->any()) { return '<p class="text-danger">'.$errors->first($attribute).'</p>'; } } } ``` then in your View ``` <div class="form-group"...
2,389,623
I am looking to build a static KML (Google Earth markup) file which displays a heatmap-style rendering of a few given data sets in the form of [lat, lon, density] tuples. A very straightforward data set I have is for population density. My requirements are: * Must be able to feed in data for a given lat, lon * Must ...
2010/03/05
[ "https://Stackoverflow.com/questions/2389623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/246606/" ]
Hey Will, [heatmap.py](http://jjguy.com/heatmap/) is me. Your request is a common-enough one and is on my list of things to address. I'm not quite sure yet how to do so in a general fashion; in heatmap.py parlance, it would be straightforward to have a per-point `dotsize` instead of a global dotsize as it is now, but I...
I think one way to do this is to create a (larger) list of tuples with each point repeated according to the density at that point. A point with a high density is represented by lots of points on top of each other while a point with a low density has few points. So instead of: `[(120.7, 82.5, 2), (130.6, 81.5, 1)]` you ...
2,389,623
I am looking to build a static KML (Google Earth markup) file which displays a heatmap-style rendering of a few given data sets in the form of [lat, lon, density] tuples. A very straightforward data set I have is for population density. My requirements are: * Must be able to feed in data for a given lat, lon * Must ...
2010/03/05
[ "https://Stackoverflow.com/questions/2389623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/246606/" ]
I updated the `heatmap.py` script so you can specify a density for each point. I [uploaded my changes to my blog](http://alexlittle.net/blog/2010/09/08/applying-weighting-to-heatmaps/). Not sure if it'll do exactly what you want though! Cheers, Alex **Update [13 Nov 2020]** I archived my blog a while back, so the lin...
I think one way to do this is to create a (larger) list of tuples with each point repeated according to the density at that point. A point with a high density is represented by lots of points on top of each other while a point with a low density has few points. So instead of: `[(120.7, 82.5, 2), (130.6, 81.5, 1)]` you ...
2,389,623
I am looking to build a static KML (Google Earth markup) file which displays a heatmap-style rendering of a few given data sets in the form of [lat, lon, density] tuples. A very straightforward data set I have is for population density. My requirements are: * Must be able to feed in data for a given lat, lon * Must ...
2010/03/05
[ "https://Stackoverflow.com/questions/2389623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/246606/" ]
Hey Will, [heatmap.py](http://jjguy.com/heatmap/) is me. Your request is a common-enough one and is on my list of things to address. I'm not quite sure yet how to do so in a general fashion; in heatmap.py parlance, it would be straightforward to have a per-point `dotsize` instead of a global dotsize as it is now, but I...
I updated the `heatmap.py` script so you can specify a density for each point. I [uploaded my changes to my blog](http://alexlittle.net/blog/2010/09/08/applying-weighting-to-heatmaps/). Not sure if it'll do exactly what you want though! Cheers, Alex **Update [13 Nov 2020]** I archived my blog a while back, so the lin...
5,886,987
Is there a standard function for Python which outputs True or False probabilistically based on the input of a random number from 0 to 1? example of what I mean: ``` def decision(probability): ...code goes here... return ...True or False... ``` the above example if given an input of, say, 0.7 will return Tru...
2011/05/04
[ "https://Stackoverflow.com/questions/5886987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/592235/" ]
``` import random def decision(probability): return random.random() < probability ```
Given a function `rand` that returns a number between 0 and 1, you can define `decision` like this: ``` bool decision(float probability) { return rand()<probability; } ``` Assuming that rand() returns a value in the range `[0.0, 1.0)` (so can output a 0.0, will never output a 1.0).
5,886,987
Is there a standard function for Python which outputs True or False probabilistically based on the input of a random number from 0 to 1? example of what I mean: ``` def decision(probability): ...code goes here... return ...True or False... ``` the above example if given an input of, say, 0.7 will return Tru...
2011/05/04
[ "https://Stackoverflow.com/questions/5886987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/592235/" ]
``` import random def decision(probability): return random.random() < probability ```
If you want to amass a lot of data, I would suggest using a map: ``` from numpy import random as rn p = 0.15 data = rn.random(100) final_data = list(map(lambda x: x < p, data)) ```
5,886,987
Is there a standard function for Python which outputs True or False probabilistically based on the input of a random number from 0 to 1? example of what I mean: ``` def decision(probability): ...code goes here... return ...True or False... ``` the above example if given an input of, say, 0.7 will return Tru...
2011/05/04
[ "https://Stackoverflow.com/questions/5886987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/592235/" ]
``` import random def decision(probability): return random.random() < probability ```
I use this to generate a random boolean in python with a probability: ```py from random import randint n=8 # inverse of probability rand_bool=randint(0,n*n-1)%n==0 ``` so to expand that : ```py def rand_bool(prob): s=str(prob) p=s.index('.') d=10**(len(s)-p) return randint(0,d*d-1)%d<int(s[p+1:]) `...
5,886,987
Is there a standard function for Python which outputs True or False probabilistically based on the input of a random number from 0 to 1? example of what I mean: ``` def decision(probability): ...code goes here... return ...True or False... ``` the above example if given an input of, say, 0.7 will return Tru...
2011/05/04
[ "https://Stackoverflow.com/questions/5886987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/592235/" ]
``` import random def decision(probability): return random.random() < probability ```
Just use [PyProbs](https://pypi.org/project/pyprobs/) library. It is very easy to use. ```py >>> from pyprobs import Probability as pr >>> >>> # You can pass float (i.e. 0.5, 0.157), int (i.e. 1, 0) or str (i.e. '50%', '3/11') >>> pr.prob(50/100) False >>> pr.prob(50/100, num=5) [False, False, False, True, False] ``...
5,886,987
Is there a standard function for Python which outputs True or False probabilistically based on the input of a random number from 0 to 1? example of what I mean: ``` def decision(probability): ...code goes here... return ...True or False... ``` the above example if given an input of, say, 0.7 will return Tru...
2011/05/04
[ "https://Stackoverflow.com/questions/5886987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/592235/" ]
Given a function `rand` that returns a number between 0 and 1, you can define `decision` like this: ``` bool decision(float probability) { return rand()<probability; } ``` Assuming that rand() returns a value in the range `[0.0, 1.0)` (so can output a 0.0, will never output a 1.0).
If you want to amass a lot of data, I would suggest using a map: ``` from numpy import random as rn p = 0.15 data = rn.random(100) final_data = list(map(lambda x: x < p, data)) ```
5,886,987
Is there a standard function for Python which outputs True or False probabilistically based on the input of a random number from 0 to 1? example of what I mean: ``` def decision(probability): ...code goes here... return ...True or False... ``` the above example if given an input of, say, 0.7 will return Tru...
2011/05/04
[ "https://Stackoverflow.com/questions/5886987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/592235/" ]
Given a function `rand` that returns a number between 0 and 1, you can define `decision` like this: ``` bool decision(float probability) { return rand()<probability; } ``` Assuming that rand() returns a value in the range `[0.0, 1.0)` (so can output a 0.0, will never output a 1.0).
I use this to generate a random boolean in python with a probability: ```py from random import randint n=8 # inverse of probability rand_bool=randint(0,n*n-1)%n==0 ``` so to expand that : ```py def rand_bool(prob): s=str(prob) p=s.index('.') d=10**(len(s)-p) return randint(0,d*d-1)%d<int(s[p+1:]) `...
5,886,987
Is there a standard function for Python which outputs True or False probabilistically based on the input of a random number from 0 to 1? example of what I mean: ``` def decision(probability): ...code goes here... return ...True or False... ``` the above example if given an input of, say, 0.7 will return Tru...
2011/05/04
[ "https://Stackoverflow.com/questions/5886987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/592235/" ]
Given a function `rand` that returns a number between 0 and 1, you can define `decision` like this: ``` bool decision(float probability) { return rand()<probability; } ``` Assuming that rand() returns a value in the range `[0.0, 1.0)` (so can output a 0.0, will never output a 1.0).
Just use [PyProbs](https://pypi.org/project/pyprobs/) library. It is very easy to use. ```py >>> from pyprobs import Probability as pr >>> >>> # You can pass float (i.e. 0.5, 0.157), int (i.e. 1, 0) or str (i.e. '50%', '3/11') >>> pr.prob(50/100) False >>> pr.prob(50/100, num=5) [False, False, False, True, False] ``...
5,886,987
Is there a standard function for Python which outputs True or False probabilistically based on the input of a random number from 0 to 1? example of what I mean: ``` def decision(probability): ...code goes here... return ...True or False... ``` the above example if given an input of, say, 0.7 will return Tru...
2011/05/04
[ "https://Stackoverflow.com/questions/5886987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/592235/" ]
I use this to generate a random boolean in python with a probability: ```py from random import randint n=8 # inverse of probability rand_bool=randint(0,n*n-1)%n==0 ``` so to expand that : ```py def rand_bool(prob): s=str(prob) p=s.index('.') d=10**(len(s)-p) return randint(0,d*d-1)%d<int(s[p+1:]) `...
If you want to amass a lot of data, I would suggest using a map: ``` from numpy import random as rn p = 0.15 data = rn.random(100) final_data = list(map(lambda x: x < p, data)) ```
5,886,987
Is there a standard function for Python which outputs True or False probabilistically based on the input of a random number from 0 to 1? example of what I mean: ``` def decision(probability): ...code goes here... return ...True or False... ``` the above example if given an input of, say, 0.7 will return Tru...
2011/05/04
[ "https://Stackoverflow.com/questions/5886987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/592235/" ]
Just use [PyProbs](https://pypi.org/project/pyprobs/) library. It is very easy to use. ```py >>> from pyprobs import Probability as pr >>> >>> # You can pass float (i.e. 0.5, 0.157), int (i.e. 1, 0) or str (i.e. '50%', '3/11') >>> pr.prob(50/100) False >>> pr.prob(50/100, num=5) [False, False, False, True, False] ``...
If you want to amass a lot of data, I would suggest using a map: ``` from numpy import random as rn p = 0.15 data = rn.random(100) final_data = list(map(lambda x: x < p, data)) ```
5,886,987
Is there a standard function for Python which outputs True or False probabilistically based on the input of a random number from 0 to 1? example of what I mean: ``` def decision(probability): ...code goes here... return ...True or False... ``` the above example if given an input of, say, 0.7 will return Tru...
2011/05/04
[ "https://Stackoverflow.com/questions/5886987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/592235/" ]
Just use [PyProbs](https://pypi.org/project/pyprobs/) library. It is very easy to use. ```py >>> from pyprobs import Probability as pr >>> >>> # You can pass float (i.e. 0.5, 0.157), int (i.e. 1, 0) or str (i.e. '50%', '3/11') >>> pr.prob(50/100) False >>> pr.prob(50/100, num=5) [False, False, False, True, False] ``...
I use this to generate a random boolean in python with a probability: ```py from random import randint n=8 # inverse of probability rand_bool=randint(0,n*n-1)%n==0 ``` so to expand that : ```py def rand_bool(prob): s=str(prob) p=s.index('.') d=10**(len(s)-p) return randint(0,d*d-1)%d<int(s[p+1:]) `...
59,038
I have a list of 25 air pollutants many of which are strongly correlated. I was hoping to reduce down to a short list of eigenvectors which would each be composed of a small number of the pollutants. I mostly followed this [tutorial video](http://www.youtube.com/watch?v=oZ2nfIPdvjY) so far. When I tried varimax rotat...
2013/05/14
[ "https://stats.stackexchange.com/questions/59038", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/23681/" ]
If you do a bunch of tests, the chances of at least one Type I error (*when the null hypothesis is true*) will go up, sometimes dramatically. A Bonferroni adjustment (as with most other multiple comparison procedures) is an attempt to hold the overall Type I error rate from the collection of pairwise comparisons to no...
@Glen\_b & @Peter Flom have provided good answers. Let me add one more detail: It is not simply that we lose power when we make an adjustment to control the familywise type I error rate. The existence of multiple comparisons means that power is *already* compromised. Discussions of the problem of multiple compariso...
59,038
I have a list of 25 air pollutants many of which are strongly correlated. I was hoping to reduce down to a short list of eigenvectors which would each be composed of a small number of the pollutants. I mostly followed this [tutorial video](http://www.youtube.com/watch?v=oZ2nfIPdvjY) so far. When I tried varimax rotat...
2013/05/14
[ "https://stats.stackexchange.com/questions/59038", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/23681/" ]
In addition to @Glen\_b 's excellent answer (+1) I'd add 1) "Familywise" begs the question of what a family is. All the analyses in one paper? All the analyses on one data set? All the analyses related to one question? All the analyses you do in your life? What about analyses that *other* people do on the same data? ...
@Glen\_b & @Peter Flom have provided good answers. Let me add one more detail: It is not simply that we lose power when we make an adjustment to control the familywise type I error rate. The existence of multiple comparisons means that power is *already* compromised. Discussions of the problem of multiple compariso...
66,119
I suppose this is related to [What is an intermediate certificate authority?](https://security.stackexchange.com/questions/1826/what-is-an-intermediate-certificate-authority) but I think my question is a bit different so I'll ask it anyway. Why do most modern certificate authorities (e.g. VeriSign) require two interm...
2014/08/25
[ "https://security.stackexchange.com/questions/66119", "https://security.stackexchange.com", "https://security.stackexchange.com/users/2075/" ]
I think it's more of a security concern as highlighted in [1](http://technet.microsoft.com/en-us/library/dn786436.aspx). CAs like VeriSign uses the two-tier hierarchy (or trust chain) concept to provide more security. This is because the roles of the primary and secondary CAs are separated and may be hosted in differ...
I found a good explanation here: <https://technet.microsoft.com/en-us/library/dn786436.aspx> To summarize it: In case of 1 layer design (RootCA issues endpoint certificates) - it´s not recommended due to obvious reasons. In case of large and expensive 3-layer design, you get great scalability, you can enforce differe...
94,711
Can I use 2 different User Journeys for the same Persona to show the flow of 2 different tasks that the user performs? My user has to perform 2 main tasks in the platform, and the tasks are a bit different in structures. My user has 2 main goals to fulfill.
2016/05/24
[ "https://ux.stackexchange.com/questions/94711", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/84209/" ]
You user is functioning under two separate personas and each persona has a journey. When they switch persona, the journey switches as well. The challenge is designing the functionality. Ideally, each personas set of tasks can puzzle-piece with the other. Usually this is where a new design pattern will emerge.
We recently did a high level journey that crosses multiple personas and then had "drill down " journey at the persona level. Those Journeys had even further drill down because the journey can reflect a switch in mental models.
94,711
Can I use 2 different User Journeys for the same Persona to show the flow of 2 different tasks that the user performs? My user has to perform 2 main tasks in the platform, and the tasks are a bit different in structures. My user has 2 main goals to fulfill.
2016/05/24
[ "https://ux.stackexchange.com/questions/94711", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/84209/" ]
I treat personas as individuals who can have more than one task to accomplish on the site. Therefore, they can each have multiple user flows. I just completed a set of personas, each with 4-5 user flows. For example, one persona needs to register for the site, look up claim information, and dispute a claim. One person,...
We recently did a high level journey that crosses multiple personas and then had "drill down " journey at the persona level. Those Journeys had even further drill down because the journey can reflect a switch in mental models.
1,593,118
I came across the question in the picture on the net. I couldn't figure out the solution given. But what I got is total number of such $5$ digit numbers using the given digits will be $5.5!$. Half of them will be divisible by $2$. And $1/3$ of them will be divisible by $3$. (Not sure though) What's next? I couldn't dec...
2015/12/29
[ "https://math.stackexchange.com/questions/1593118", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Any solution with $n$ even can be used to give a solution with exponent $2$. So it suffices to study $n$ odd. Since $\log\_2 2015 \approx 10.97 < 11$, we can ignore all exponents larger than $9$. This reduces it to $3, 5, 7, 9$. * Exponent $9$: $2015 - 2^9 = 1503$ is not a ninth power and $3^9$ is larger than $2015$, ...
Since $2015=5\cdot 13\cdot 31$, and the multiplicities of the primes congruent $3$ modulo $4$ are odd (only $p=31$ to consider here), it follows that $2015$ cannot be represented as the sum $x^2+y^2$, by Fermat's theorem. This does not only work for $2015$. Also, characterisation of two cubes is known, see [here](https...
1,593,118
I came across the question in the picture on the net. I couldn't figure out the solution given. But what I got is total number of such $5$ digit numbers using the given digits will be $5.5!$. Half of them will be divisible by $2$. And $1/3$ of them will be divisible by $3$. (Not sure though) What's next? I couldn't dec...
2015/12/29
[ "https://math.stackexchange.com/questions/1593118", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Any solution with $n$ even can be used to give a solution with exponent $2$. So it suffices to study $n$ odd. Since $\log\_2 2015 \approx 10.97 < 11$, we can ignore all exponents larger than $9$. This reduces it to $3, 5, 7, 9$. * Exponent $9$: $2015 - 2^9 = 1503$ is not a ninth power and $3^9$ is larger than $2015$, ...
Hint: $n<12$ because $1^{12}+2^{12}>2015$
1,593,118
I came across the question in the picture on the net. I couldn't figure out the solution given. But what I got is total number of such $5$ digit numbers using the given digits will be $5.5!$. Half of them will be divisible by $2$. And $1/3$ of them will be divisible by $3$. (Not sure though) What's next? I couldn't dec...
2015/12/29
[ "https://math.stackexchange.com/questions/1593118", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Piggybacking off user's answer that we need only concern ourselves with a few odd exponents, with $x\lt y$ also pretty small, let's use the fact that $x+y$ divides $x^n+y^n$ for odd $n$ and $x^p\equiv x$ mod $p$ for prime $p$. Note that $2014$ is not an $n$th power for any $n\gt1$, so we can assume $1\lt x\lt y$. Not...
Since $2015=5\cdot 13\cdot 31$, and the multiplicities of the primes congruent $3$ modulo $4$ are odd (only $p=31$ to consider here), it follows that $2015$ cannot be represented as the sum $x^2+y^2$, by Fermat's theorem. This does not only work for $2015$. Also, characterisation of two cubes is known, see [here](https...
1,593,118
I came across the question in the picture on the net. I couldn't figure out the solution given. But what I got is total number of such $5$ digit numbers using the given digits will be $5.5!$. Half of them will be divisible by $2$. And $1/3$ of them will be divisible by $3$. (Not sure though) What's next? I couldn't dec...
2015/12/29
[ "https://math.stackexchange.com/questions/1593118", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
Piggybacking off user's answer that we need only concern ourselves with a few odd exponents, with $x\lt y$ also pretty small, let's use the fact that $x+y$ divides $x^n+y^n$ for odd $n$ and $x^p\equiv x$ mod $p$ for prime $p$. Note that $2014$ is not an $n$th power for any $n\gt1$, so we can assume $1\lt x\lt y$. Not...
Hint: $n<12$ because $1^{12}+2^{12}>2015$
9,106,301
Is it possible to retrieve data from web service while launch image is being shown? Or I will not show a launch image but I'll just use a view controller with an image (launch image), and retrieve data when that view controller is currently viewed?
2012/02/02
[ "https://Stackoverflow.com/questions/9106301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/864762/" ]
Okay, based on Kane's suggestion, I've modified my sample code as such and it now seems to work as I wanted. The index.html page in my example site root folder (i.e. `/index.html`) now looks like this: ``` <!DOCTYPE html> <html> <head> <title>Home Page</title> <meta http-equiv="content-type" content="text/html;...
I have a similar situation where I use some server-side processing to determine whether to render the content in my site template for new requests or just the content on its own for requests from ajax. Basically, I just add a post or get variable called 'partial' to my ajax requests and that decides whether to include...
9,106,301
Is it possible to retrieve data from web service while launch image is being shown? Or I will not show a launch image but I'll just use a view controller with an image (launch image), and retrieve data when that view controller is currently viewed?
2012/02/02
[ "https://Stackoverflow.com/questions/9106301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/864762/" ]
Thank you very much for this solution. It was giving me some errors so I simplified it a bit and it seems to be working for me now: ``` /** * fixes the problem where a subpage in jquerymobile will lose its back button after a refresh. Instead a refresh takes you back to the top page * http://stackoverflow.com/questi...
I have a similar situation where I use some server-side processing to determine whether to render the content in my site template for new requests or just the content on its own for requests from ajax. Basically, I just add a post or get variable called 'partial' to my ajax requests and that decides whether to include...
9,106,301
Is it possible to retrieve data from web service while launch image is being shown? Or I will not show a launch image but I'll just use a view controller with an image (launch image), and retrieve data when that view controller is currently viewed?
2012/02/02
[ "https://Stackoverflow.com/questions/9106301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/864762/" ]
the easiest way is to redirect to the main page: Example subapge: login.htm ``` <script type="text/javascript"> window.location="index.htm"; </script> <div data-role="page" id='login'> Ur sub page </div><!-- /page --> ``` The js code will only be fired, when the page is reloaded, because only the code with ...
I have a similar situation where I use some server-side processing to determine whether to render the content in my site template for new requests or just the content on its own for requests from ajax. Basically, I just add a post or get variable called 'partial' to my ajax requests and that decides whether to include...
9,106,301
Is it possible to retrieve data from web service while launch image is being shown? Or I will not show a launch image but I'll just use a view controller with an image (launch image), and retrieve data when that view controller is currently viewed?
2012/02/02
[ "https://Stackoverflow.com/questions/9106301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/864762/" ]
Okay, based on Kane's suggestion, I've modified my sample code as such and it now seems to work as I wanted. The index.html page in my example site root folder (i.e. `/index.html`) now looks like this: ``` <!DOCTYPE html> <html> <head> <title>Home Page</title> <meta http-equiv="content-type" content="text/html;...
Thank you very much for this solution. It was giving me some errors so I simplified it a bit and it seems to be working for me now: ``` /** * fixes the problem where a subpage in jquerymobile will lose its back button after a refresh. Instead a refresh takes you back to the top page * http://stackoverflow.com/questi...
9,106,301
Is it possible to retrieve data from web service while launch image is being shown? Or I will not show a launch image but I'll just use a view controller with an image (launch image), and retrieve data when that view controller is currently viewed?
2012/02/02
[ "https://Stackoverflow.com/questions/9106301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/864762/" ]
Okay, based on Kane's suggestion, I've modified my sample code as such and it now seems to work as I wanted. The index.html page in my example site root folder (i.e. `/index.html`) now looks like this: ``` <!DOCTYPE html> <html> <head> <title>Home Page</title> <meta http-equiv="content-type" content="text/html;...
the easiest way is to redirect to the main page: Example subapge: login.htm ``` <script type="text/javascript"> window.location="index.htm"; </script> <div data-role="page" id='login'> Ur sub page </div><!-- /page --> ``` The js code will only be fired, when the page is reloaded, because only the code with ...
54,297,615
I have a running and detached container. I want to create a command alias there before attaching to that container. When I am attached to the container and I type: ``` alias bar='foo' ``` an alias is created, and might be checked by: ``` alias ``` command. but if I want to do the same by **docker exec** command...
2019/01/21
[ "https://Stackoverflow.com/questions/54297615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1174405/" ]
The `alias` built-in creates an alias in the current shell. Aliases, like environment variables, are not persisted, only loaded. You need to update your .bashrc or whatever inside the container to have the desired alias so that it can be loaded on each start of bash.
add into your Dockerfile something like `RUN echo alias bar='foo' >> ~/.bashrc` Actually, if you running your container under a user other than `root` you need to put this command into the correct `.bashrc`
54,297,615
I have a running and detached container. I want to create a command alias there before attaching to that container. When I am attached to the container and I type: ``` alias bar='foo' ``` an alias is created, and might be checked by: ``` alias ``` command. but if I want to do the same by **docker exec** command...
2019/01/21
[ "https://Stackoverflow.com/questions/54297615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1174405/" ]
Alias in your bashrc file does not directly accept parameters. Although in your case you will have to create a function and alias that. You can add following on your ~/.bashrc ```sh dexec() { docker exec -it "$1" /bin/bash echo "$1" } ``` you can also use `/bin/sh` instead of `/bin/bash` and don't forget t...
add into your Dockerfile something like `RUN echo alias bar='foo' >> ~/.bashrc` Actually, if you running your container under a user other than `root` you need to put this command into the correct `.bashrc`
375,407
This happens to me quite often, where a layer will "disappear" off canvas and I spend precious time trying to "drag" it back into view. Its swimming around in the vast gray expanse somewhere. The layer is set as visible per the layers window/list. Is there a faster way to locate where the missing layer is?
2012/01/06
[ "https://superuser.com/questions/375407", "https://superuser.com", "https://superuser.com/users/44531/" ]
Press `CTRL`+`T`(transform) or Edit > Transform. This will put a box around the object that is off the page and you should be able to see the box to bring it back into view. In combination with zooming out this should work.
I use the "Edit --> Transform" method myself. Have also found out that if doing that doesn't show the bounding box, select "View--> Fit On Screen" to rectify.
375,407
This happens to me quite often, where a layer will "disappear" off canvas and I spend precious time trying to "drag" it back into view. Its swimming around in the vast gray expanse somewhere. The layer is set as visible per the layers window/list. Is there a faster way to locate where the missing layer is?
2012/01/06
[ "https://superuser.com/questions/375407", "https://superuser.com", "https://superuser.com/users/44531/" ]
I use the "Edit --> Transform" method myself. Have also found out that if doing that doesn't show the bounding box, select "View--> Fit On Screen" to rectify.
@Banjer, I solve the problem by: * Creating a new layer above all other layers (to ensure I can see it) * Selecting an area of that layer with the marquee tool * Pasting into the selected area The pasted graphic will appear in the new layer.