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
35,713,954
So I am writing a little program in batch, and I am hoping it will be able to run it on other's computers. My `cd` is to `C:\Users\%username%\Desktop\,\thing`, but that is not where other people may store it. How can I locate where it is and do a `cd` to it? Thanks!
2016/03/01
[ "https://Stackoverflow.com/questions/35713954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
`%cd%` is available either to a batch file or at the command prompt and expands to the drive letter and path of the current directory (which can change e.g. by using the CD command) `%~dp0` is only available within a batch file and expands to the drive letter and path in which that batch file is located (which cannot ...
Programs and documents can be added to the registry so typing their name without their path in the Start - Run dialog box or shortcut enables Windows to find them. This is a generic reg file. Copy the lines below to a new Text Document and save it as anyname.reg. Edit it with your programs or documents. In paths use ...
23,497
Specifically I am looking at a situation where: **Religion A is:** * Monotheistic * Hierarchical (single leader atop the organization) * At least slightly expansionist though not necessarily by force of arms **Religion B is:** * Polytheistic * Tribal in nature so each tribe has its own religious leader * Internally...
2015/07/13
[ "https://history.stackexchange.com/questions/23497", "https://history.stackexchange.com", "https://history.stackexchange.com/users/12935/" ]
An *exact* example which adheres to your definition might be hard to find, but I got one which is quite close. In [**Japan**](https://en.wikipedia.org/wiki/Religion_in_Japan), both **Buddhism** and **Shintoism** were practiced in parallel. Buddhism came to Japan in the 6th century. Buddhism focuses on the worship of...
Another example in **China** are Confucianism (formally treated as religion), Taoism and Buddhism, and in particular, with regard to your question, the two last ones.
23,497
Specifically I am looking at a situation where: **Religion A is:** * Monotheistic * Hierarchical (single leader atop the organization) * At least slightly expansionist though not necessarily by force of arms **Religion B is:** * Polytheistic * Tribal in nature so each tribe has its own religious leader * Internally...
2015/07/13
[ "https://history.stackexchange.com/questions/23497", "https://history.stackexchange.com", "https://history.stackexchange.com/users/12935/" ]
An *exact* example which adheres to your definition might be hard to find, but I got one which is quite close. In [**Japan**](https://en.wikipedia.org/wiki/Religion_in_Japan), both **Buddhism** and **Shintoism** were practiced in parallel. Buddhism came to Japan in the 6th century. Buddhism focuses on the worship of...
Many people have good examples of the Mongols, Japan, and other Asian countries, but in the western world other examples come to mind. West Africa is a good example. In Western Africa, many rulers and most merchants converted to Islam (e.g. the Dioula or Dyula), but the general population was still polytheistic. And ev...
23,497
Specifically I am looking at a situation where: **Religion A is:** * Monotheistic * Hierarchical (single leader atop the organization) * At least slightly expansionist though not necessarily by force of arms **Religion B is:** * Polytheistic * Tribal in nature so each tribe has its own religious leader * Internally...
2015/07/13
[ "https://history.stackexchange.com/questions/23497", "https://history.stackexchange.com", "https://history.stackexchange.com/users/12935/" ]
My general impression is that in most great empires of the past, where the population was mixed, most of the times religions coexisted peacefully, like in Persian empire, for example. Some other examples are: 1. In Khazar khaghanate, Judaism, Islam and Christianity apparently peacefully coexisted with paganism and wit...
Another example in **China** are Confucianism (formally treated as religion), Taoism and Buddhism, and in particular, with regard to your question, the two last ones.
23,497
Specifically I am looking at a situation where: **Religion A is:** * Monotheistic * Hierarchical (single leader atop the organization) * At least slightly expansionist though not necessarily by force of arms **Religion B is:** * Polytheistic * Tribal in nature so each tribe has its own religious leader * Internally...
2015/07/13
[ "https://history.stackexchange.com/questions/23497", "https://history.stackexchange.com", "https://history.stackexchange.com/users/12935/" ]
My general impression is that in most great empires of the past, where the population was mixed, most of the times religions coexisted peacefully, like in Persian empire, for example. Some other examples are: 1. In Khazar khaghanate, Judaism, Islam and Christianity apparently peacefully coexisted with paganism and wit...
Many people have good examples of the Mongols, Japan, and other Asian countries, but in the western world other examples come to mind. West Africa is a good example. In Western Africa, many rulers and most merchants converted to Islam (e.g. the Dioula or Dyula), but the general population was still polytheistic. And ev...
23,497
Specifically I am looking at a situation where: **Religion A is:** * Monotheistic * Hierarchical (single leader atop the organization) * At least slightly expansionist though not necessarily by force of arms **Religion B is:** * Polytheistic * Tribal in nature so each tribe has its own religious leader * Internally...
2015/07/13
[ "https://history.stackexchange.com/questions/23497", "https://history.stackexchange.com", "https://history.stackexchange.com/users/12935/" ]
* Mongols and any Christian territory ruled by them - such as Russia. While there was, of course, conflict (it was, after all, a war of conquest), it was NOT in any way, shape or form of a religious nature, but pure geopolitics. Mongols were explicitly, by design, very religiously tolerant and enforced that. * Another ...
Another example in **China** are Confucianism (formally treated as religion), Taoism and Buddhism, and in particular, with regard to your question, the two last ones.
23,497
Specifically I am looking at a situation where: **Religion A is:** * Monotheistic * Hierarchical (single leader atop the organization) * At least slightly expansionist though not necessarily by force of arms **Religion B is:** * Polytheistic * Tribal in nature so each tribe has its own religious leader * Internally...
2015/07/13
[ "https://history.stackexchange.com/questions/23497", "https://history.stackexchange.com", "https://history.stackexchange.com/users/12935/" ]
* Mongols and any Christian territory ruled by them - such as Russia. While there was, of course, conflict (it was, after all, a war of conquest), it was NOT in any way, shape or form of a religious nature, but pure geopolitics. Mongols were explicitly, by design, very religiously tolerant and enforced that. * Another ...
Many people have good examples of the Mongols, Japan, and other Asian countries, but in the western world other examples come to mind. West Africa is a good example. In Western Africa, many rulers and most merchants converted to Islam (e.g. the Dioula or Dyula), but the general population was still polytheistic. And ev...
23,497
Specifically I am looking at a situation where: **Religion A is:** * Monotheistic * Hierarchical (single leader atop the organization) * At least slightly expansionist though not necessarily by force of arms **Religion B is:** * Polytheistic * Tribal in nature so each tribe has its own religious leader * Internally...
2015/07/13
[ "https://history.stackexchange.com/questions/23497", "https://history.stackexchange.com", "https://history.stackexchange.com/users/12935/" ]
Many people have good examples of the Mongols, Japan, and other Asian countries, but in the western world other examples come to mind. West Africa is a good example. In Western Africa, many rulers and most merchants converted to Islam (e.g. the Dioula or Dyula), but the general population was still polytheistic. And ev...
Another example in **China** are Confucianism (formally treated as religion), Taoism and Buddhism, and in particular, with regard to your question, the two last ones.
57,174,623
So I want to add custom view markers in my android application, I am fetching the coordinates from an API request and I want to display the logo of the places on their respective marker. I am getting the URL of the marker from the same API request. Moreover, I want all the markers to be a part of the single symbol laye...
2019/07/24
[ "https://Stackoverflow.com/questions/57174623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9882934/" ]
I have solved this problem. First You Have to create a private class which will fetch a data for you then you store it in an array. ``` private class getgeo extends AsyncTask<Void, Void, Void> { @Override protected void onPreExecute() { super.onPreExecute(); // Showing progress dialog ...
Check out <https://docs.mapbox.com/android/maps/examples/symbol-layer-info-window>. `GenerateViewIconTask` in that example, uses a `View` to create a `Bitmap`. The `Bitmap`(s) are added to the map for usage as `SymbolLayer` icons. Alternatively, you could use the Mapbox Annotation Plugin for Android: <https://docs.map...
12,891,349
I have text box with datepicker and a custom validator under validation group meant for a Save button at the end of a web page. The problem is the javascrip function is being called on Save but not on this text box value change. What am I doing wrong? Text Box: ``` <td valign="middle"> <asp:TextBox ID="tx...
2012/10/15
[ "https://Stackoverflow.com/questions/12891349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1235303/" ]
You can use Client Side validation check in your TextBox value change event. ``` function textbox_change() { if(Page_ClientValidate('Save')) { //Your Code } else { //your code } } ``` `Page_ClientValidate` is function for validation from client side. you can pass your validatio...
The problem is that your asp.net control does not see the change when your control is manipulated by the datepicker. Adding this code should solve your problem: ``` <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <script type="text/javascrip...
18,426,970
I have a below method in dataService layer: ``` public DataTable retTable () { DataTable dt = new DataTable(); adap.Fill(dt); return dt; } ``` because I should add (using Data) name space in business layer. I wanna change it to: ``` pu...
2013/08/25
[ "https://Stackoverflow.com/questions/18426970", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1348721/" ]
This would solve the problem ``` lst.Add(dt); ``` By `AddRange(dt)` you can add a collection of `DataTable`s. **However `DataSet` itself is a collection of `DataTable`s. Then why reinventing the wheel by using `List`. Simply return `DataSet` like this** ``` public DataSet retSet() { DataSet ds = new DataSet()...
try below ``` public List<DataRow> retTable() { DataTable dt = new DataTable(); adap.Fill(dt); return dt.AsEnumerable().ToList(); } ``` but still you need `system.Data` because of `DataRow` you can use custom class in this case like below ``` List<MyClass> myClass= new List<MyClass>(); myClass = (fr...
18,426,970
I have a below method in dataService layer: ``` public DataTable retTable () { DataTable dt = new DataTable(); adap.Fill(dt); return dt; } ``` because I should add (using Data) name space in business layer. I wanna change it to: ``` pu...
2013/08/25
[ "https://Stackoverflow.com/questions/18426970", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1348721/" ]
because table is 2D matrix, so we should return 2D List: ``` public List<List<string >> retListTable() { DataTable dt = new DataTable(); adap.Fill(dt); List<List<string>> lstTable = new List<List<string>>(); foreach (DataRow row in dt.Rows) { List<string> lstR...
try below ``` public List<DataRow> retTable() { DataTable dt = new DataTable(); adap.Fill(dt); return dt.AsEnumerable().ToList(); } ``` but still you need `system.Data` because of `DataRow` you can use custom class in this case like below ``` List<MyClass> myClass= new List<MyClass>(); myClass = (fr...
21,688,725
I want to be able to compare two arrays of what they have in common and not show any duplicates. ``` array1 = ['1. walking to the park to find some ice cream'] array2 = ['2. walking to the park to find ice cream and find more ice cream'] ``` sample output: ``` walking to the park find ice cream ```
2014/02/10
[ "https://Stackoverflow.com/questions/21688725", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3263521/" ]
1. Start with two strings 2. Split them both on spaces 3. Do an array intersection on them --- ``` a = '1. walking to the park to find some ice cream' b = '2. walking to the park to find ice cream and find more ice cream' a1 = a.split(" ") b1 = b.split(" ") common = a1 & b1 #=> ["walking", "to", "the", "park", "fin...
I would do as : ``` a = '1. walking to the park to find some ice cream' b = '2. walking to the park to find ice cream and find more ice cream' match = Regexp.union(a.split(" ")) b.scan(match).uniq.join(" ") # => "walking to the park find ice cream" ```
913,630
I have a HTML email that I am sending and it contains images that are hosted on my website and not inside the email. For example: ``` <img src="http://www.mywebsite.com/a.jpg"/> ``` When I paste my HTML into Thunderbird (using Insert->HTML) and send it Thunderbird automatically turns those images into attachments o...
2015/05/12
[ "https://superuser.com/questions/913630", "https://superuser.com", "https://superuser.com/users/135490/" ]
Don't use Insert->HTML, use Insert->Image. Type/paste the URL into the Image Location box. Then uncheck "Attach this image to the message" (alt-S).
This should possibly be a comment, but it's too long. You could try to insert it as the Base64 data string. "Convert" your graphic to the string using this website <http://www.motobit.com/util/base64-decoder-encoder.asp> And in your HTML, use ``` <img src="data:image/jpg;base64,PutTheBase64DataStringHere" /> ```
1,555,882
Suppose that $(\mathcal X,d)$ and $(\mathcal Y, \rho)$ are two metric spaces. I am trying to show that if $f: (\mathcal X,d) \mapsto (\mathcal Y, \rho) $ is uniformly continuous and $(x\_n)\_n$ is a Cauchy Sequence in $\mathcal X$, show that $(f(x\_n))\_n$ is a Cauchy sequence in $\mathcal Y$. A sequence $X = (x\_n...
2015/12/02
[ "https://math.stackexchange.com/questions/1555882", "https://math.stackexchange.com", "https://math.stackexchange.com/users/71547/" ]
Given a finite sequence of numbers, it is impossible to answer the question what is the next number of the sequence. Such questions usually rely on there being a fairly simple recognizable pattern, but there is always an implicit assumption that the pattern will continue. However, there is no guarantee that this is tru...
You can calculate all of the digits of $\phi$ without having any of the previous digits by just evaluating $\frac{1+\sqrt{5}}{2}$. However, if you are trying to find a pattern in the digits, this is an unsolved problem. If the digits of a number are evenly distributed and every digit is just as likely as any other digi...
1,555,882
Suppose that $(\mathcal X,d)$ and $(\mathcal Y, \rho)$ are two metric spaces. I am trying to show that if $f: (\mathcal X,d) \mapsto (\mathcal Y, \rho) $ is uniformly continuous and $(x\_n)\_n$ is a Cauchy Sequence in $\mathcal X$, show that $(f(x\_n))\_n$ is a Cauchy sequence in $\mathcal Y$. A sequence $X = (x\_n...
2015/12/02
[ "https://math.stackexchange.com/questions/1555882", "https://math.stackexchange.com", "https://math.stackexchange.com/users/71547/" ]
Given a finite sequence of numbers, it is impossible to answer the question what is the next number of the sequence. Such questions usually rely on there being a fairly simple recognizable pattern, but there is always an implicit assumption that the pattern will continue. However, there is no guarantee that this is tru...
The Golden ratio is well-known for being written with repeating patterns, such as : $$\phi = 1 + \cfrac{1}{1 + \cfrac{1}{1 + \cfrac{1}{1 + \ddots}}}$$ or $$\phi = \sqrt{1 + \sqrt{1 + \sqrt{1 + \sqrt{1 + \cdots}}}}\,.$$ It can be written as a series: $$\phi=\frac{13}{8}+\sum\_{n=0}^{\infty}\frac{(-1)^{(n+1)}(2n+1)!}{(n+...
34,287,819
Let's say I have the following: ``` image_data = """iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==""" ``` This is just a dot image (from <https://en.wikipedia.org/wiki/Data_URI_scheme>). But I do not know if it is image or text etc. Is it possible...
2015/12/15
[ "https://Stackoverflow.com/questions/34287819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1029406/" ]
You can't, at least not without decoding, because the bytes that help identify the filetype are spread across the base64 characters, which don't directly align with whole bytes. Each character encodes 6 **bits**, which means that for every 4 characters, there are 3 bytes encoded. Identifying a filetype requires access...
Its a PNG image ``` import base64 encoded_string = 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==' decoded_string = base64.b64decode(encoded_string) print 'Decoded :', decoded_string ``` Output: ``` python base_decode.py Decoded : �PNG ```
34,287,819
Let's say I have the following: ``` image_data = """iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==""" ``` This is just a dot image (from <https://en.wikipedia.org/wiki/Data_URI_scheme>). But I do not know if it is image or text etc. Is it possible...
2015/12/15
[ "https://Stackoverflow.com/questions/34287819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1029406/" ]
You can't, at least not without decoding, because the bytes that help identify the filetype are spread across the base64 characters, which don't directly align with whole bytes. Each character encodes 6 **bits**, which means that for every 4 characters, there are 3 bytes encoded. Identifying a filetype requires access...
Of course, you can. There are few extremely easy approaches to the problem I can think of: Partial decode ============== Each base64 character encodes 6 bits of input, so you can relate them as follows: ``` Base64: AAAAAABBBBBBCCCCCCDDDDDDEEEEEEFFFFFFGGGGGGHHHHHH Data: xxxxxxxxyyyyyyyyzzzzzzzzqqqqqqqqwwwwwwwweeeee...
34,287,819
Let's say I have the following: ``` image_data = """iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==""" ``` This is just a dot image (from <https://en.wikipedia.org/wiki/Data_URI_scheme>). But I do not know if it is image or text etc. Is it possible...
2015/12/15
[ "https://Stackoverflow.com/questions/34287819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1029406/" ]
You can't, at least not without decoding, because the bytes that help identify the filetype are spread across the base64 characters, which don't directly align with whole bytes. Each character encodes 6 **bits**, which means that for every 4 characters, there are 3 bytes encoded. Identifying a filetype requires access...
i use this sample function ``` def detect_mime_type(base64): signatures = { "JVBERi0": "application/pdf", "R0lGODdh": "image/gif", "R0lGODlh": "image/gif", "iVBORw0KGgo": "image/png", "/9j/": "image/jpg" } for s in signatures: if(base64.find(s)!=-1): return signature...
34,287,819
Let's say I have the following: ``` image_data = """iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==""" ``` This is just a dot image (from <https://en.wikipedia.org/wiki/Data_URI_scheme>). But I do not know if it is image or text etc. Is it possible...
2015/12/15
[ "https://Stackoverflow.com/questions/34287819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1029406/" ]
You can't, at least not without decoding, because the bytes that help identify the filetype are spread across the base64 characters, which don't directly align with whole bytes. Each character encodes 6 **bits**, which means that for every 4 characters, there are 3 bytes encoded. Identifying a filetype requires access...
If you have base64 string, then the extension is written in the beginning of the data. You can use the following method: ```py def detect_image_type(base64_data): extensions = { "data:image/png;": "png", "data:image/jpeg;": "jpeg", "data:image/jpg;": "jpeg", } for ext in extensions:...
34,287,819
Let's say I have the following: ``` image_data = """iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==""" ``` This is just a dot image (from <https://en.wikipedia.org/wiki/Data_URI_scheme>). But I do not know if it is image or text etc. Is it possible...
2015/12/15
[ "https://Stackoverflow.com/questions/34287819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1029406/" ]
Of course, you can. There are few extremely easy approaches to the problem I can think of: Partial decode ============== Each base64 character encodes 6 bits of input, so you can relate them as follows: ``` Base64: AAAAAABBBBBBCCCCCCDDDDDDEEEEEEFFFFFFGGGGGGHHHHHH Data: xxxxxxxxyyyyyyyyzzzzzzzzqqqqqqqqwwwwwwwweeeee...
Its a PNG image ``` import base64 encoded_string = 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==' decoded_string = base64.b64decode(encoded_string) print 'Decoded :', decoded_string ``` Output: ``` python base_decode.py Decoded : �PNG ```
34,287,819
Let's say I have the following: ``` image_data = """iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==""" ``` This is just a dot image (from <https://en.wikipedia.org/wiki/Data_URI_scheme>). But I do not know if it is image or text etc. Is it possible...
2015/12/15
[ "https://Stackoverflow.com/questions/34287819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1029406/" ]
i use this sample function ``` def detect_mime_type(base64): signatures = { "JVBERi0": "application/pdf", "R0lGODdh": "image/gif", "R0lGODlh": "image/gif", "iVBORw0KGgo": "image/png", "/9j/": "image/jpg" } for s in signatures: if(base64.find(s)!=-1): return signature...
Its a PNG image ``` import base64 encoded_string = 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==' decoded_string = base64.b64decode(encoded_string) print 'Decoded :', decoded_string ``` Output: ``` python base_decode.py Decoded : �PNG ```
34,287,819
Let's say I have the following: ``` image_data = """iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==""" ``` This is just a dot image (from <https://en.wikipedia.org/wiki/Data_URI_scheme>). But I do not know if it is image or text etc. Is it possible...
2015/12/15
[ "https://Stackoverflow.com/questions/34287819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1029406/" ]
If you have base64 string, then the extension is written in the beginning of the data. You can use the following method: ```py def detect_image_type(base64_data): extensions = { "data:image/png;": "png", "data:image/jpeg;": "jpeg", "data:image/jpg;": "jpeg", } for ext in extensions:...
Its a PNG image ``` import base64 encoded_string = 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==' decoded_string = base64.b64decode(encoded_string) print 'Decoded :', decoded_string ``` Output: ``` python base_decode.py Decoded : �PNG ```
34,287,819
Let's say I have the following: ``` image_data = """iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==""" ``` This is just a dot image (from <https://en.wikipedia.org/wiki/Data_URI_scheme>). But I do not know if it is image or text etc. Is it possible...
2015/12/15
[ "https://Stackoverflow.com/questions/34287819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1029406/" ]
Of course, you can. There are few extremely easy approaches to the problem I can think of: Partial decode ============== Each base64 character encodes 6 bits of input, so you can relate them as follows: ``` Base64: AAAAAABBBBBBCCCCCCDDDDDDEEEEEEFFFFFFGGGGGGHHHHHH Data: xxxxxxxxyyyyyyyyzzzzzzzzqqqqqqqqwwwwwwwweeeee...
i use this sample function ``` def detect_mime_type(base64): signatures = { "JVBERi0": "application/pdf", "R0lGODdh": "image/gif", "R0lGODlh": "image/gif", "iVBORw0KGgo": "image/png", "/9j/": "image/jpg" } for s in signatures: if(base64.find(s)!=-1): return signature...
34,287,819
Let's say I have the following: ``` image_data = """iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==""" ``` This is just a dot image (from <https://en.wikipedia.org/wiki/Data_URI_scheme>). But I do not know if it is image or text etc. Is it possible...
2015/12/15
[ "https://Stackoverflow.com/questions/34287819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1029406/" ]
Of course, you can. There are few extremely easy approaches to the problem I can think of: Partial decode ============== Each base64 character encodes 6 bits of input, so you can relate them as follows: ``` Base64: AAAAAABBBBBBCCCCCCDDDDDDEEEEEEFFFFFFGGGGGGHHHHHH Data: xxxxxxxxyyyyyyyyzzzzzzzzqqqqqqqqwwwwwwwweeeee...
If you have base64 string, then the extension is written in the beginning of the data. You can use the following method: ```py def detect_image_type(base64_data): extensions = { "data:image/png;": "png", "data:image/jpeg;": "jpeg", "data:image/jpg;": "jpeg", } for ext in extensions:...
26,629,911
Currently i have a MVC 3 project and i am using {controller}/{action}/{id} as routing and manage to use the {id} as a list of ids in one string comma separated {"id1,id2,id3"} it works perfect but passing the ids in the URL do not sound good for me as it could be a list of 100 or more ids (in the URL that's not good or...
2014/10/29
[ "https://Stackoverflow.com/questions/26629911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1969599/" ]
Pointer arithmetic is not done in bytes, it's done in units of the object being pointed at. In your case, `unsigned long`. So this: ``` ((unsigned long *) GPIOB_BASE + 0x420 ``` will result in the address 0x40005000 + 0x420 \* `sizeof (unsigned long)`. Assuming a 32-bit `long`, that'd be 0x40006080 which is clearl...
In addition to the answer of `unwind` I would recommend to define registers in a different way. ``` #define GPIOB_BASE 0x40005000 #define GPIOB_REG(offset) (*(unsigned long)(GPIO_BASE + offset)) #define GPIOB_AFSEL_R GPIOB_REG(0x420) #define GPIOB_DEN_R GPIOB_REG(0x51C) #define GPIOB_PCTL_R GPIOB_REG(0x52C) ```...
18,469,419
When I run unit testing to serialize to an xml file, I keep getting error message: > > Could not load file or assembly > 'Company.Fin.Bank.Common.XmlSerializers.dll, Version=1.0.0.0, > Culture=neutral, PublicKeyToken=null' or one of its dependencies. The > system cannot find the file specified. > > > I guess ...
2013/08/27
[ "https://Stackoverflow.com/questions/18469419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2564058/" ]
That assembly is [dynamically](https://stackoverflow.com/a/934441/1167867) generated by the framework (XMLSerializer) > > In .Net implementation, the XmlSerializer generates a temporary > assembly for serializing/deserializing your classes (for performance > reasons). > > > Also, this may be [normal](https://st...
> > even though i don't need that dll > > > Visual Studio will usually remove unneeded DLLs. Typically this is caused by dependencies (which are harder to keep track of). > > I want to remove it. > > > Check in the References of the project in the Solution Explorer. If any of them have a yellow triangle that...
729,891
I was doing a basic shell script and got a datafile that I need to edit a bit to work with it. The thing is it has multiple lines repeated and even words, so I wanted to fast-edit with vim's substitution commands or just a sed. The thing is I did not achieve to match the path I want to substitute to 'nothing' basically...
2022/12/28
[ "https://unix.stackexchange.com/questions/729891", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/554656/" ]
Use cut command with " as delimiter: ``` cut -d\" -f1 input-file ```
You may not need to dig in regex, sample `awk` script can do the work: ``` awk -F\" '{print $1}' input_file ``` use `"` as delimiter and print only first token.
729,891
I was doing a basic shell script and got a datafile that I need to edit a bit to work with it. The thing is it has multiple lines repeated and even words, so I wanted to fast-edit with vim's substitution commands or just a sed. The thing is I did not achieve to match the path I want to substitute to 'nothing' basically...
2022/12/28
[ "https://unix.stackexchange.com/questions/729891", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/554656/" ]
You've made a couple of mistakes with your regex both in sed as well as vim. Others have given some good alternatives but I'd like to address why the commands you've given didn't work and how you could fix them. ### Sed Your command: `sed "s/\">[A-z]+.php//g"` Firstly, your [character class](https://www.regular-expr...
You may not need to dig in regex, sample `awk` script can do the work: ``` awk -F\" '{print $1}' input_file ``` use `"` as delimiter and print only first token.
729,891
I was doing a basic shell script and got a datafile that I need to edit a bit to work with it. The thing is it has multiple lines repeated and even words, so I wanted to fast-edit with vim's substitution commands or just a sed. The thing is I did not achieve to match the path I want to substitute to 'nothing' basically...
2022/12/28
[ "https://unix.stackexchange.com/questions/729891", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/554656/" ]
Use cut command with " as delimiter: ``` cut -d\" -f1 input-file ```
Assuming you are working with some XML document like ```xml <?xml version="1.0"?> <root> <node attr="Category.php">category.php</node> <node attr="Copyright.php">Copyright.php</node> <node attr="Core.php">Core.php</node> <node attr="Credit.php">Credit.php</node> </root> ``` ... and assuming you want to delet...
729,891
I was doing a basic shell script and got a datafile that I need to edit a bit to work with it. The thing is it has multiple lines repeated and even words, so I wanted to fast-edit with vim's substitution commands or just a sed. The thing is I did not achieve to match the path I want to substitute to 'nothing' basically...
2022/12/28
[ "https://unix.stackexchange.com/questions/729891", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/554656/" ]
Use cut command with " as delimiter: ``` cut -d\" -f1 input-file ```
You've made a couple of mistakes with your regex both in sed as well as vim. Others have given some good alternatives but I'd like to address why the commands you've given didn't work and how you could fix them. ### Sed Your command: `sed "s/\">[A-z]+.php//g"` Firstly, your [character class](https://www.regular-expr...
729,891
I was doing a basic shell script and got a datafile that I need to edit a bit to work with it. The thing is it has multiple lines repeated and even words, so I wanted to fast-edit with vim's substitution commands or just a sed. The thing is I did not achieve to match the path I want to substitute to 'nothing' basically...
2022/12/28
[ "https://unix.stackexchange.com/questions/729891", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/554656/" ]
You've made a couple of mistakes with your regex both in sed as well as vim. Others have given some good alternatives but I'd like to address why the commands you've given didn't work and how you could fix them. ### Sed Your command: `sed "s/\">[A-z]+.php//g"` Firstly, your [character class](https://www.regular-expr...
Assuming you are working with some XML document like ```xml <?xml version="1.0"?> <root> <node attr="Category.php">category.php</node> <node attr="Copyright.php">Copyright.php</node> <node attr="Core.php">Core.php</node> <node attr="Credit.php">Credit.php</node> </root> ``` ... and assuming you want to delet...
25,941,625
Well, I'm trying to make a little animation with a for loop and the code is the next one: ``` private class Listen4 implements ActionListener{ int i ; for (i = 0; i<5 ; i++){ try{ if (i == 0){ imglabel.setIcon(new ImageIcon("1.png")); } if (i == 1){ imglabel....
2014/09/19
[ "https://Stackoverflow.com/questions/25941625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4059716/" ]
The problem you've got is that your code is running on the GUI thread, which is what talks to the GUI and renders it to the screen. You call the method to set the icon, but that doesn't actually redraw the screen, it just queues things so that the screen will be redrawn next time the GUI thread gets a spare moment. But...
The problem is that your loop is running on the Event Dispatch Thread which is responsible for updating the image when you change it. So when you sleep the current, you stop the Event Dispatch Thread which then cannot update the image. The solution is to create a separate thread to run your loop which sends a message ...
25,941,625
Well, I'm trying to make a little animation with a for loop and the code is the next one: ``` private class Listen4 implements ActionListener{ int i ; for (i = 0; i<5 ; i++){ try{ if (i == 0){ imglabel.setIcon(new ImageIcon("1.png")); } if (i == 1){ imglabel....
2014/09/19
[ "https://Stackoverflow.com/questions/25941625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4059716/" ]
The problem you've got is that your code is running on the GUI thread, which is what talks to the GUI and renders it to the screen. You call the method to set the icon, but that doesn't actually redraw the screen, it just queues things so that the screen will be redrawn next time the GUI thread gets a spare moment. But...
``` ActionLister al = new ActionListener() { public void actionPerformed(ActionEvent ae) { ... // You will have to keep a counter or check the image already in the label //to know which one to switch it to } } ```
28,620
Recently, I applied for an advertised post-doctoral position with a researcher in an well-known institution. After two weeks of not getting a reply, I sent him a reminder, and he replied "Oh, thanks for getting in touch again, I hadn't seen your previous email. Can we have a chat on Skype tomorrow at X?" He never s...
2014/09/17
[ "https://academia.stackexchange.com/questions/28620", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/20011/" ]
If this is a high-profile researcher, they are likely quite overcommitted and may have indeed legitimately accidentally missed connections. When dealing with somebody like this, you also need assume that you need to be the one taking the initiative in contact until you've have an established working relationship. But ...
I suggest you to give **a phone call**. International phone calls have become very cheap nowadays, you could use for example Skype, MegaVoip or Google Voice. Obviously you have to be very polite, don't become angry or upset. Explain clearly the situation and ask about news. G-Luck!
42,549,714
I can not give much explanation because my English is bad. The example of what I want to do is below; try.sh ``` #!/bin/sh echo -n "Enter the port:" read ports if [ ! -d "$ports" ]; then mkdir -p /root/port$ports echo "The folder was created for $ports" wget -q www.example.com/example.tar.bz2 tar -xjf example.tar.bz...
2017/03/02
[ "https://Stackoverflow.com/questions/42549714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5698079/" ]
``` #!/bin/bash IFS=, read -p "Enter the Hosts: " -ra hosts </dev/tty IFS=, read -p "Enter the Port: " -ra ports </dev/tty for host in "${hosts[@]}"; do for port in "${ports[@]}"; do nc -vz $host $port done done ``` Runtime: ``` bash try.sh Enter the Port: 80 Enter the Hosts: 127.0.0.1 localhost [12...
use $\* to read arguments: ``` echo $* | awk '{ i=1; while(i<=NF) { print $i; i++; } }' ``` or ``` for i in $*; do echo $i done ```
61,793,646
I use **Android Studio Version 4.0 RC** version, and it seems it removed the **offline work** mode. [![enter image description here](https://i.stack.imgur.com/FhKjh.png)](https://i.stack.imgur.com/FhKjh.png) Where can I find this item in the android studio?
2020/05/14
[ "https://Stackoverflow.com/questions/61793646", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2652368/" ]
You can find the gradle offline mode toggle in the gradle tab on the right side of the Android Studio,[![Gradle Offline Toggle](https://i.stack.imgur.com/T9BGt.png)](https://i.stack.imgur.com/T9BGt.png)
You can activate/deactivate this from Gradle Tab (Top Right) by clicking the icon to **toggle offline mode** [![enter image description here](https://i.stack.imgur.com/0gfOs.png)](https://i.stack.imgur.com/0gfOs.png)
61,793,646
I use **Android Studio Version 4.0 RC** version, and it seems it removed the **offline work** mode. [![enter image description here](https://i.stack.imgur.com/FhKjh.png)](https://i.stack.imgur.com/FhKjh.png) Where can I find this item in the android studio?
2020/05/14
[ "https://Stackoverflow.com/questions/61793646", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2652368/" ]
You can find the gradle offline mode toggle in the gradle tab on the right side of the Android Studio,[![Gradle Offline Toggle](https://i.stack.imgur.com/T9BGt.png)](https://i.stack.imgur.com/T9BGt.png)
Outside android-studio you can also use **settings.gradle** file: startParameter.offline=true
61,793,646
I use **Android Studio Version 4.0 RC** version, and it seems it removed the **offline work** mode. [![enter image description here](https://i.stack.imgur.com/FhKjh.png)](https://i.stack.imgur.com/FhKjh.png) Where can I find this item in the android studio?
2020/05/14
[ "https://Stackoverflow.com/questions/61793646", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2652368/" ]
You can activate/deactivate this from Gradle Tab (Top Right) by clicking the icon to **toggle offline mode** [![enter image description here](https://i.stack.imgur.com/0gfOs.png)](https://i.stack.imgur.com/0gfOs.png)
Outside android-studio you can also use **settings.gradle** file: startParameter.offline=true
72,132,086
How can I read the user auth states from my bloc? I am trying to use BlocBuilder, but not sure how do I get the data from AuthenticationState. I am trying to access the state and user. So the state should check for all the constructors, if authenticated then I want to display user data. Also in my app, I would like to ...
2022/05/05
[ "https://Stackoverflow.com/questions/72132086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13381244/" ]
To be able to rollback to a previous version don't forget to append the **--record** parameter to your kubectl command, for example: ``` kubectl apply -f DEPLOYMENT.yaml --record ``` Then you should be able to see the history as you know with: ``` kubectl rollout history deployment DEPLOYMENT_NAME ``` And your ro...
I experienced a similar situation and it was more an own mistake rather than a configuration issue with my K8s manifests. At my Docker image creation workflow, I forgot to update the version of my Docker image. I have a GitHub Action workflow that pushes the image to DockerHub. Not updating the image version, overwrot...
4,056,234
I am using .NET 2.0 and the finally block does not seem to be getting executed if the Thread times out. For example, if I see the message "Child Thread Timed Out...", I will not see the message "Finally block started...". This means that the database objects (Oracle.DataAccess) may not be getting cleaned up properly. I...
2010/10/29
[ "https://Stackoverflow.com/questions/4056234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/491818/" ]
You should only Abort a thread if that thread has nothing of importance to do any more. In other cases I'd recommend setting some kind of notification (i.e. setting a boolean property on the thread) that causes your thread to shut down gracefully. Having said that according to the [documentation](http://msdn.microsoft....
You can only interrupt a thread when it's in managed code. If it's in native code, then the runtime schedules the `ThreadAbortException` to be thrown when the native code returns. And `finally` blocks would execute after that. The finally block will not run until the native function returns and managed execution resume...
4,056,234
I am using .NET 2.0 and the finally block does not seem to be getting executed if the Thread times out. For example, if I see the message "Child Thread Timed Out...", I will not see the message "Finally block started...". This means that the database objects (Oracle.DataAccess) may not be getting cleaned up properly. I...
2010/10/29
[ "https://Stackoverflow.com/questions/4056234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/491818/" ]
You should only Abort a thread if that thread has nothing of importance to do any more. In other cases I'd recommend setting some kind of notification (i.e. setting a boolean property on the thread) that causes your thread to shut down gracefully. Having said that according to the [documentation](http://msdn.microsoft....
Thanks - The problem does seem to be one of timing. If I check the threadHelper.IsAlive property repeatedly and keep the main thread running, the finally block does execute. So, I think the code hangs on dr = oraCmd.ExecuteReader(); The Thread.Join() returns, attempts to Abort() - but can't at that time, and then the m...
4,056,234
I am using .NET 2.0 and the finally block does not seem to be getting executed if the Thread times out. For example, if I see the message "Child Thread Timed Out...", I will not see the message "Finally block started...". This means that the database objects (Oracle.DataAccess) may not be getting cleaned up properly. I...
2010/10/29
[ "https://Stackoverflow.com/questions/4056234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/491818/" ]
You can only interrupt a thread when it's in managed code. If it's in native code, then the runtime schedules the `ThreadAbortException` to be thrown when the native code returns. And `finally` blocks would execute after that. The finally block will not run until the native function returns and managed execution resume...
Thanks - The problem does seem to be one of timing. If I check the threadHelper.IsAlive property repeatedly and keep the main thread running, the finally block does execute. So, I think the code hangs on dr = oraCmd.ExecuteReader(); The Thread.Join() returns, attempts to Abort() - but can't at that time, and then the m...
38,344,699
I need to maintain a count of replacements made before implementing the Worksheets(...).Columns(...).Replace function using Excel VBA. Can anyone guide me regarding code that I probably need to insert in \*\*\* below for counting the replacements that are about to occur in the next line of code? Thanks. ``` Function ...
2016/07/13
[ "https://Stackoverflow.com/questions/38344699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6582911/" ]
> > **Privacy** > > > The unified logging system considers dynamic strings and complex dynamic objects to be **private**, and does not collect them automatically. To ensure the privacy of users, it is recommended that log messages consist strictly of **static strings** and **numbers**. In situations where it is nece...
It's a new feature in MacOS 10.12 (Sierra), a unified [logging system](https://developer.apple.com/reference/os/1891852-logging) that > > implements global settings that govern logging behavior and persistence, while at the same time providing fine-grained control during debugging via the log command-line tool and th...
38,344,699
I need to maintain a count of replacements made before implementing the Worksheets(...).Columns(...).Replace function using Excel VBA. Can anyone guide me regarding code that I probably need to insert in \*\*\* below for counting the replacements that are about to occur in the next line of code? Thanks. ``` Function ...
2016/07/13
[ "https://Stackoverflow.com/questions/38344699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6582911/" ]
> > **Privacy** > > > The unified logging system considers dynamic strings and complex dynamic objects to be **private**, and does not collect them automatically. To ensure the privacy of users, it is recommended that log messages consist strictly of **static strings** and **numbers**. In situations where it is nece...
The per-bundle-id console command shown in the other answer was not working for me. This worked: ``` sudo log config --mode "private_data:on" ``` <https://superuser.com/questions/1311578/in-console-app-how-can-i-reveal-to-what-private-tags-are-actually-referring>
43,763,556
We are doing a VR / Stereoscopic web application with three.js where we would like to display the angle at which the camera is looking. Example: We have a "room" setup. Camera in the center, at which point rotation of the camera is tied to the orbital controls. ``` # create a camera and place it in the scene camera =...
2017/05/03
[ "https://Stackoverflow.com/questions/43763556", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7958200/" ]
So, we managed to dig deeper into this. We build a cnc rotating table, and measured angles on the phones, and compared with the input we gave to the computer controlled rotating table. Conclusion: Chrome is piece of crap. It cannot and will not produce even nearly useful data. Nor will it produce anything even remotel...
You can call `camera.getWorldRotation()` to get [euler](https://github.com/mrdoob/three.js/blob/4779db2dd2200e00905b9d248e938b9b54a82e53/src/math/Euler.js) angles.
4,678,701
I am new to JavaScript and jQuery. I have to develop a website in which an image gallery with similar effects as in google image search needs to be implemented. I am searching for ready-made scripts to incorporate with my project. Where can I find something like this for free or how would I go about implementing it usi...
2011/01/13
[ "https://Stackoverflow.com/questions/4678701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/385145/" ]
This is a pretty specific example, and I would guess most plugins would be more "widgety". If I was creating this I would create the page layout first, wrapping each "page of results" in a single `div`. Then when the user clicks "Show More Results" you can use [one of jQuery's AJAX methods](http://api.jquery.com/categ...
I assume you have paginate the image search result, you could try by doing: * assign each image in a div tag (e.g * Bind the function by using jquery ".each" and ".hover" function (when mouse-over, enlarge it by set the css's width and height) * There are alot more... I cant type it all...
4,678,701
I am new to JavaScript and jQuery. I have to develop a website in which an image gallery with similar effects as in google image search needs to be implemented. I am searching for ready-made scripts to incorporate with my project. Where can I find something like this for free or how would I go about implementing it usi...
2011/01/13
[ "https://Stackoverflow.com/questions/4678701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/385145/" ]
I assume you have paginate the image search result, you could try by doing: * assign each image in a div tag (e.g * Bind the function by using jquery ".each" and ".hover" function (when mouse-over, enlarge it by set the css's width and height) * There are alot more... I cant type it all...
Hi you can have a look here: <http://forum.yola.com/yola/topics/awesome_photo_gallery_code_for_your_website> It also links an example test page... hope it helps
4,678,701
I am new to JavaScript and jQuery. I have to develop a website in which an image gallery with similar effects as in google image search needs to be implemented. I am searching for ready-made scripts to incorporate with my project. Where can I find something like this for free or how would I go about implementing it usi...
2011/01/13
[ "https://Stackoverflow.com/questions/4678701", "https://Stackoverflow.com", "https://Stackoverflow.com/users/385145/" ]
This is a pretty specific example, and I would guess most plugins would be more "widgety". If I was creating this I would create the page layout first, wrapping each "page of results" in a single `div`. Then when the user clicks "Show More Results" you can use [one of jQuery's AJAX methods](http://api.jquery.com/categ...
Hi you can have a look here: <http://forum.yola.com/yola/topics/awesome_photo_gallery_code_for_your_website> It also links an example test page... hope it helps
12,141,626
[In this slides](http://www.slideshare.net/DICEStudio/introduction-to-data-oriented-design) (after slide 15) it is suggested to use ``` void updateAims(float* aimDir, const AimingData* aim, vec3 target, uint count) { for(uint i = 0; i < count; i++) { aimDir[i] = dot3(aim->positions[i], target) * ...
2012/08/27
[ "https://Stackoverflow.com/questions/12141626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/419921/" ]
Modern cache architectures are usually structured as *lines* of data, each large enough to hold several words; 64 bytes is a typical line size. When you try to read data that's not in the cache, a whole line is fetched, not just the word that you need. When writing, data in the cache is updated if it's there, but typic...
The memory layout differs quite a lot and the benefit of the first approach will be destroyed if you use an array of Bots. In the first approach, all the `aimDir` data is stored in a non-fragmented block of memory. So if you processed the first you can immediately proceed to the next item since it is stored in the nex...
2,684,755
I have a GWT app that when launched it takes you to a page with just a menu. So as a shortcut type thing I would like the users to be able to go straight to the page they want. So if the default start page is x, the should be able to say x/add and it will take them to the add page. How would I get that in gwt? Do I nee...
2010/04/21
[ "https://Stackoverflow.com/questions/2684755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22763/" ]
To accomplish this, you should use the URL's "fragment", which is the part after the #. For example, if your app is at /x, you could have a different UI displayed when someone navigates to /x#add If you don't want to write this logic yourself, you should look into the [gwt-presenter](http://code.google.com/p/gwt-prese...
Seems like a discussion we already had so I'll just link to [the related question.](https://stackoverflow.com/questions/2542395/how-to-provide-hyperlink-in-email-pointing-to-a-specific-method-inside-gwt-app-b) Please see the answers and comments there. Basically, it might be advantageous to just interact with the [Hist...
54,896,540
I'm trying to create a singleton class that will be responsible for playing game sounds. I created a singleton class `GameSounds` with a method `playSound()`. In the res folder I have a a subfolder 'raw' with a file `letter_found.mp3`. This is the source code of the `GameSounds` class I wrote: ``` import android.app....
2019/02/27
[ "https://Stackoverflow.com/questions/54896540", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10726350/" ]
This is exactly what I do in my apps, I don't want to use mediacontext too(as sometimes I don't have the context), take a look at the following example: <https://github.com/lhcdims/statemanagement02> Try to look at the class 'sv' inside lib/ScreenVariables.dart And call sv.init() inside main.dart, then you can use s...
You can't access the Context object outside the build method directly. You can either pass the Context object through from inside the build method to the separate build function. ``` Widget build(BuildContext context){ return Container( children: buildChildren(context) ); } Widget buildChildren(BuildContext c...
54,896,540
I'm trying to create a singleton class that will be responsible for playing game sounds. I created a singleton class `GameSounds` with a method `playSound()`. In the res folder I have a a subfolder 'raw' with a file `letter_found.mp3`. This is the source code of the `GameSounds` class I wrote: ``` import android.app....
2019/02/27
[ "https://Stackoverflow.com/questions/54896540", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10726350/" ]
It is simple to do that. This is how I do it in a StatefulWidget: ``` class MyPage extends StatefulWidget { @override _MyPageState createState() => _MyPageState(); } class _MyPageState extends State<MyPage> { var screenHeight = window.physicalSize.height / window.devicePixelRatio; var screenWidth = window...
You can't access the Context object outside the build method directly. You can either pass the Context object through from inside the build method to the separate build function. ``` Widget build(BuildContext context){ return Container( children: buildChildren(context) ); } Widget buildChildren(BuildContext c...
8,873,219
I would like to know how to draw images using pygame. I know how to load them. I have made a blank window. When I use `screen.blit(blank, (10,10))`, it does not draw the image and instead leaves the screen blank.
2012/01/15
[ "https://Stackoverflow.com/questions/8873219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1008684/" ]
``` import pygame, sys, os from pygame.locals import * pygame.init() screen = pygame.display.set_mode((100, 100)) player = pygame.image.load(os.path.join("player.png")) player.convert() while True: screen.blit(player, (10, 10)) pygame.display.flip() pygame.quit() ``` Loads the file `player.png`. Run this a...
After using `blit` or any other update on your drawing surface, you have to call `pygame.display.flip()` to actually update what is displayed.
8,873,219
I would like to know how to draw images using pygame. I know how to load them. I have made a blank window. When I use `screen.blit(blank, (10,10))`, it does not draw the image and instead leaves the screen blank.
2012/01/15
[ "https://Stackoverflow.com/questions/8873219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1008684/" ]
This is a typical layout: ``` myimage = pygame.image.load("myimage.bmp") imagerect = myimage.get_rect() while 1: your_code_here screen.fill(black) screen.blit(myimage, imagerect) pygame.display.flip() ```
After using `blit` or any other update on your drawing surface, you have to call `pygame.display.flip()` to actually update what is displayed.
8,873,219
I would like to know how to draw images using pygame. I know how to load them. I have made a blank window. When I use `screen.blit(blank, (10,10))`, it does not draw the image and instead leaves the screen blank.
2012/01/15
[ "https://Stackoverflow.com/questions/8873219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1008684/" ]
This is a typical layout: ``` myimage = pygame.image.load("myimage.bmp") imagerect = myimage.get_rect() while 1: your_code_here screen.fill(black) screen.blit(myimage, imagerect) pygame.display.flip() ```
``` import pygame, sys, os from pygame.locals import * pygame.init() screen = pygame.display.set_mode((100, 100)) player = pygame.image.load(os.path.join("player.png")) player.convert() while True: screen.blit(player, (10, 10)) pygame.display.flip() pygame.quit() ``` Loads the file `player.png`. Run this a...
8,873,219
I would like to know how to draw images using pygame. I know how to load them. I have made a blank window. When I use `screen.blit(blank, (10,10))`, it does not draw the image and instead leaves the screen blank.
2012/01/15
[ "https://Stackoverflow.com/questions/8873219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1008684/" ]
``` import pygame, sys, os from pygame.locals import * pygame.init() screen = pygame.display.set_mode((100, 100)) player = pygame.image.load(os.path.join("player.png")) player.convert() while True: screen.blit(player, (10, 10)) pygame.display.flip() pygame.quit() ``` Loads the file `player.png`. Run this a...
Images are represented by ["pygame.Surface"](https://www.pygame.org/docs/ref/surface.html) objects. A *Surface* can be created from an image with [`pygame.image.load`](https://www.pygame.org/docs/ref/image.html): ```py my_image_surface = pygame.load.image('my_image.jpg') ``` However, the pygame documentation notes t...
8,873,219
I would like to know how to draw images using pygame. I know how to load them. I have made a blank window. When I use `screen.blit(blank, (10,10))`, it does not draw the image and instead leaves the screen blank.
2012/01/15
[ "https://Stackoverflow.com/questions/8873219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1008684/" ]
This is a typical layout: ``` myimage = pygame.image.load("myimage.bmp") imagerect = myimage.get_rect() while 1: your_code_here screen.fill(black) screen.blit(myimage, imagerect) pygame.display.flip() ```
Images are represented by ["pygame.Surface"](https://www.pygame.org/docs/ref/surface.html) objects. A *Surface* can be created from an image with [`pygame.image.load`](https://www.pygame.org/docs/ref/image.html): ```py my_image_surface = pygame.load.image('my_image.jpg') ``` However, the pygame documentation notes t...
56,334,470
I've never really found out when exactly a variable declaration is actually ran in a program, when the variable resides in another class. For instance: ```java public static void main(String[] args) { int x = 1; System.out.println(x); } ``` This program seems fairly simplistic to understand i...
2019/05/28
[ "https://Stackoverflow.com/questions/56334470", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11546796/" ]
You can use `map` on your input. Something like: ``` >>> coords = '1,2' >>> split = coords.split(',') >>> split ['1', '2'] >>> ints = map(int, split) >>> ints <map object at 0x0000000002476978> >>> list(ints) [1, 2] ``` Apply accordingly to your code.
What you need is a while loop with try except to keep asking the user to input the right `player location format`, and it will quit the loop and print player location in case entries are valid integers comma separated: ``` while True: try: x, y = input("Player location: ").split(',') player_locatio...
63,689,823
I was making something similar to tic tac toe and everything is working and all but this play again button is not working and crashes the whole app. I tried making it again and I tried making a separate method to log it when pressed and it was working but it is not working with play again button. My play button code i...
2020/09/01
[ "https://Stackoverflow.com/questions/63689823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13406683/" ]
The view has androidx GridLayout but inside the activity, android GridLayout is being used to get the view which leads to crash due to casting error. I agree that changing the import in Activity will fix your problem but make sure that you want to use androidx GridLayout and not Android GridLayout according to your ne...
Just replace **import android.widget.GridLayout;** by **import androidx.gridlayout.widget.GridLayout;**
516,520
I understand that when 2 electrons are confined into a very small volume of space slightly bigger than their debroglie wavelength, one of the pair must jiggle with increase momentum due to pauli exclusion principle. But looking at G. Smith's [comment](https://physics.stackexchange.com/questions/516500/in-electron-dege...
2019/11/28
[ "https://physics.stackexchange.com/questions/516520", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/75502/" ]
Electrons, in general, don't necessarily have well-defined positions, so the idea that they are "separated with a vast distance of space" is nebulous, at best. I'm going to assume that when you say > > 2 electrons separated with a vast distance of space > > > you mean > > 2 electrons whose wavefunctions are ...
The Pauli Exclusion Principle is equivalent to the statement that any multi-electron wavefunction must be totally antisymmetric because electrons are identical fermions. This antisymmetry requirement holds regardless of the size of the domain of the wavefunction (e.g., it can be defined on infinite Euclidean space) and...
516,520
I understand that when 2 electrons are confined into a very small volume of space slightly bigger than their debroglie wavelength, one of the pair must jiggle with increase momentum due to pauli exclusion principle. But looking at G. Smith's [comment](https://physics.stackexchange.com/questions/516500/in-electron-dege...
2019/11/28
[ "https://physics.stackexchange.com/questions/516520", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/75502/" ]
Electrons, in general, don't necessarily have well-defined positions, so the idea that they are "separated with a vast distance of space" is nebulous, at best. I'm going to assume that when you say > > 2 electrons separated with a vast distance of space > > > you mean > > 2 electrons whose wavefunctions are ...
I thought I'd add one additional comment based on the comment from G Smith. If there were a box that was a billion meters across, all of the quantum eigenstates would be delocalized over the entire box, so even though the box was really big, the electrons in the same states wouldn't actually be separated. Now, you coul...
516,520
I understand that when 2 electrons are confined into a very small volume of space slightly bigger than their debroglie wavelength, one of the pair must jiggle with increase momentum due to pauli exclusion principle. But looking at G. Smith's [comment](https://physics.stackexchange.com/questions/516500/in-electron-dege...
2019/11/28
[ "https://physics.stackexchange.com/questions/516520", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/75502/" ]
I thought I'd add one additional comment based on the comment from G Smith. If there were a box that was a billion meters across, all of the quantum eigenstates would be delocalized over the entire box, so even though the box was really big, the electrons in the same states wouldn't actually be separated. Now, you coul...
The Pauli Exclusion Principle is equivalent to the statement that any multi-electron wavefunction must be totally antisymmetric because electrons are identical fermions. This antisymmetry requirement holds regardless of the size of the domain of the wavefunction (e.g., it can be defined on infinite Euclidean space) and...
20,192,225
I am looking for some high level thoughts/ideas help me building a data structure for Dictionary. I have a legacy 'product (medicine) search system' which is very slow and complex in nature. We would need to completely re-architect the system for efficient and maintainable solution. To simplify the question, I take a...
2013/11/25
[ "https://Stackoverflow.com/questions/20192225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/815566/" ]
It appears that you're not fetching a JSONArray at the right level. The JSONArray arrayAngels that you get is actually an array containing only one element. To get an array containing the angels, you need to go deeper: ``` JSONArray allAngels = arrayAngels.getJSONObject(0).getJSONArray("angelList"); ``` The first ...
Try this.. ``` for (int i = 0; i < arrayAngels.length(); i++) { JSONObject c = arrayAngels.getJSONObject(i); // Storing each json item values in variable String name = c.getString(ANGEL_NAME); JSONArray angels = c.getJSONArray("angelList"); for (int j = 0; j < angels.length(); ...
20,192,225
I am looking for some high level thoughts/ideas help me building a data structure for Dictionary. I have a legacy 'product (medicine) search system' which is very slow and complex in nature. We would need to completely re-architect the system for efficient and maintainable solution. To simplify the question, I take a...
2013/11/25
[ "https://Stackoverflow.com/questions/20192225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/815566/" ]
Try this, ``` protected String doInBackground(String... args) { List<NameValuePair> params = new ArrayList<NameValuePair>(); // getting JSON string from URL String json = jsonParser.makeHttpRequest(EventsActivity.URL_CATEGORIES, "GET", params); ...
Try this.. ``` for (int i = 0; i < arrayAngels.length(); i++) { JSONObject c = arrayAngels.getJSONObject(i); // Storing each json item values in variable String name = c.getString(ANGEL_NAME); JSONArray angels = c.getJSONArray("angelList"); for (int j = 0; j < angels.length(); ...
20,192,225
I am looking for some high level thoughts/ideas help me building a data structure for Dictionary. I have a legacy 'product (medicine) search system' which is very slow and complex in nature. We would need to completely re-architect the system for efficient and maintainable solution. To simplify the question, I take a...
2013/11/25
[ "https://Stackoverflow.com/questions/20192225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/815566/" ]
It appears that you're not fetching a JSONArray at the right level. The JSONArray arrayAngels that you get is actually an array containing only one element. To get an array containing the angels, you need to go deeper: ``` JSONArray allAngels = arrayAngels.getJSONObject(0).getJSONArray("angelList"); ``` The first ...
you have to frist get Json array "angelList" after that you can get angelName value. ``` JSONArray arra = new JSONArray(json); JSONObject jobj=arra.getJSONObject(0); arrayAngels = jobj.getJSONArray("angelList"); ```
20,192,225
I am looking for some high level thoughts/ideas help me building a data structure for Dictionary. I have a legacy 'product (medicine) search system' which is very slow and complex in nature. We would need to completely re-architect the system for efficient and maintainable solution. To simplify the question, I take a...
2013/11/25
[ "https://Stackoverflow.com/questions/20192225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/815566/" ]
Try this, ``` protected String doInBackground(String... args) { List<NameValuePair> params = new ArrayList<NameValuePair>(); // getting JSON string from URL String json = jsonParser.makeHttpRequest(EventsActivity.URL_CATEGORIES, "GET", params); ...
It appears that you're not fetching a JSONArray at the right level. The JSONArray arrayAngels that you get is actually an array containing only one element. To get an array containing the angels, you need to go deeper: ``` JSONArray allAngels = arrayAngels.getJSONObject(0).getJSONArray("angelList"); ``` The first ...
20,192,225
I am looking for some high level thoughts/ideas help me building a data structure for Dictionary. I have a legacy 'product (medicine) search system' which is very slow and complex in nature. We would need to completely re-architect the system for efficient and maintainable solution. To simplify the question, I take a...
2013/11/25
[ "https://Stackoverflow.com/questions/20192225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/815566/" ]
Try this, ``` protected String doInBackground(String... args) { List<NameValuePair> params = new ArrayList<NameValuePair>(); // getting JSON string from URL String json = jsonParser.makeHttpRequest(EventsActivity.URL_CATEGORIES, "GET", params); ...
you have to frist get Json array "angelList" after that you can get angelName value. ``` JSONArray arra = new JSONArray(json); JSONObject jobj=arra.getJSONObject(0); arrayAngels = jobj.getJSONArray("angelList"); ```
51,054,789
If I used the example from the [docs](https://kotlinlang.org/docs/reference/sealed-classes.html), ``` class SomeActivity : AppCompatActivity() { sealed class Expr data class Const(val number: Double) : Expr() data class Sum(val e1: Expr, val e2: Expr) : Expr() object NotANumber : Expr() } ``` it doe...
2018/06/27
[ "https://Stackoverflow.com/questions/51054789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11238/" ]
Yes, it turns out to be intended behavior. According to [the proposal allowing non-nested subclasses](https://github.com/Kotlin/KEEP/blob/master/proposals/sealed-class-inheritance.md): > > Proposal: allow top-level subclasses **for a top-level sealed class** in the same file. > > > For a non top-level sealed class ...
From the documentation: > > A sealed class is abstract by itself, it cannot be instantiated > directly and can have abstract members. > > > Sealed classes are not allowed to have non-private constructors (their > constructors are private by default). > > > I guess the way you should use the example is like: ...
51,054,789
If I used the example from the [docs](https://kotlinlang.org/docs/reference/sealed-classes.html), ``` class SomeActivity : AppCompatActivity() { sealed class Expr data class Const(val number: Double) : Expr() data class Sum(val e1: Expr, val e2: Expr) : Expr() object NotANumber : Expr() } ``` it doe...
2018/06/27
[ "https://Stackoverflow.com/questions/51054789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11238/" ]
Yes, it turns out to be intended behavior. According to [the proposal allowing non-nested subclasses](https://github.com/Kotlin/KEEP/blob/master/proposals/sealed-class-inheritance.md): > > Proposal: allow top-level subclasses **for a top-level sealed class** in the same file. > > > For a non top-level sealed class ...
In Kotlin 1.0, the sealed functionality is rather restricted. For instance, all the subclasses must be nested, and a subclass can’t be made a data class ( data classes are covered later in this chapter). Kotlin 1.1 relaxes the restrictions and lets you define subclasses of sealed classes anywhere in the same file. In t...
343,471
I'm out of gold. I spent it all on tickets and Mii outfits in the shop. At the rate of normal matches I'm seeing about 180-220 GP per match. This is pretty slow, especially with some pricey items like: * 3 star support spirits: 6k GP * Tickets for Classic Mode: 5k GP * Mii Outfits: 300-1500 GP * etc. [![enter image d...
2018/12/15
[ "https://gaming.stackexchange.com/questions/343471", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/18916/" ]
Use this [tutorial](https://www.youtube.com/watch?v=1YZDUCIKW2o). In text form, * Make a new ruleset that's based on stocks * Set stocks to 1 * Set time limit to 1 minute * Set CPU level to 1 * Turn off stage hazards * Turn off items * Set launch rate (under advanced options) to 0.5% * Save ruleset * Choose any chara...
Here’s a long way, but it’s kinda worth it. Stock = up to 99 (the higher the better) CPU’s = 8 (I’d recommend lv 6) Any map (or two if you want to spice it up) No time limit It’s long, but for 20 stocks I got 974 gold in one battle.
343,471
I'm out of gold. I spent it all on tickets and Mii outfits in the shop. At the rate of normal matches I'm seeing about 180-220 GP per match. This is pretty slow, especially with some pricey items like: * 3 star support spirits: 6k GP * Tickets for Classic Mode: 5k GP * Mii Outfits: 300-1500 GP * etc. [![enter image d...
2018/12/15
[ "https://gaming.stackexchange.com/questions/343471", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/18916/" ]
Use this [tutorial](https://www.youtube.com/watch?v=1YZDUCIKW2o). In text form, * Make a new ruleset that's based on stocks * Set stocks to 1 * Set time limit to 1 minute * Set CPU level to 1 * Turn off stage hazards * Turn off items * Set launch rate (under advanced options) to 0.5% * Save ruleset * Choose any chara...
I just did a Century Smash with my brother. It took us 2 minutes and 45 seconds to finish and netted like 530 gold. I've only done one of these but it was very easy with two players and seemed like a good gold for time spent ratio while not getting boring like spamming duck for a solid minute.
343,471
I'm out of gold. I spent it all on tickets and Mii outfits in the shop. At the rate of normal matches I'm seeing about 180-220 GP per match. This is pretty slow, especially with some pricey items like: * 3 star support spirits: 6k GP * Tickets for Classic Mode: 5k GP * Mii Outfits: 300-1500 GP * etc. [![enter image d...
2018/12/15
[ "https://gaming.stackexchange.com/questions/343471", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/18916/" ]
Jeremiah is right but you can increase the gold even further by picking Ice Climbers and if you have to controllers do 2 player ice climbers gets you 500 to 600 each game
If you have some "Rematch" items, I think you can get away with fighting a "Legend" (4-star) spirit character on the spirit board during an "Event", and get some good coins. I got ~1500 from Pauline for example, during the "Sleve-Free Zone" event right now. Then use "Rematch" item, and rinse and repeat. More fun than t...
343,471
I'm out of gold. I spent it all on tickets and Mii outfits in the shop. At the rate of normal matches I'm seeing about 180-220 GP per match. This is pretty slow, especially with some pricey items like: * 3 star support spirits: 6k GP * Tickets for Classic Mode: 5k GP * Mii Outfits: 300-1500 GP * etc. [![enter image d...
2018/12/15
[ "https://gaming.stackexchange.com/questions/343471", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/18916/" ]
I managed to get 55k gold after a party with a bunch of people playing Smash all night, but that dried out pretty quick... The 1-minute test game as mentioned above just netted me 338g on first game, then I did two player, and netted 459g with same ruleset. It's very grindy, but without a party lasting hours, it may w...
Jeremiah is right but you can increase the gold even further by picking Ice Climbers and if you have to controllers do 2 player ice climbers gets you 500 to 600 each game
343,471
I'm out of gold. I spent it all on tickets and Mii outfits in the shop. At the rate of normal matches I'm seeing about 180-220 GP per match. This is pretty slow, especially with some pricey items like: * 3 star support spirits: 6k GP * Tickets for Classic Mode: 5k GP * Mii Outfits: 300-1500 GP * etc. [![enter image d...
2018/12/15
[ "https://gaming.stackexchange.com/questions/343471", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/18916/" ]
I managed to get 55k gold after a party with a bunch of people playing Smash all night, but that dried out pretty quick... The 1-minute test game as mentioned above just netted me 338g on first game, then I did two player, and netted 459g with same ruleset. It's very grindy, but without a party lasting hours, it may w...
If you have some "Rematch" items, I think you can get away with fighting a "Legend" (4-star) spirit character on the spirit board during an "Event", and get some good coins. I got ~1500 from Pauline for example, during the "Sleve-Free Zone" event right now. Then use "Rematch" item, and rinse and repeat. More fun than t...
343,471
I'm out of gold. I spent it all on tickets and Mii outfits in the shop. At the rate of normal matches I'm seeing about 180-220 GP per match. This is pretty slow, especially with some pricey items like: * 3 star support spirits: 6k GP * Tickets for Classic Mode: 5k GP * Mii Outfits: 300-1500 GP * etc. [![enter image d...
2018/12/15
[ "https://gaming.stackexchange.com/questions/343471", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/18916/" ]
Jeremiah is right but you can increase the gold even further by picking Ice Climbers and if you have to controllers do 2 player ice climbers gets you 500 to 600 each game
I just did a Century Smash with my brother. It took us 2 minutes and 45 seconds to finish and netted like 530 gold. I've only done one of these but it was very easy with two players and seemed like a good gold for time spent ratio while not getting boring like spamming duck for a solid minute.
343,471
I'm out of gold. I spent it all on tickets and Mii outfits in the shop. At the rate of normal matches I'm seeing about 180-220 GP per match. This is pretty slow, especially with some pricey items like: * 3 star support spirits: 6k GP * Tickets for Classic Mode: 5k GP * Mii Outfits: 300-1500 GP * etc. [![enter image d...
2018/12/15
[ "https://gaming.stackexchange.com/questions/343471", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/18916/" ]
I managed to get 55k gold after a party with a bunch of people playing Smash all night, but that dried out pretty quick... The 1-minute test game as mentioned above just netted me 338g on first game, then I did two player, and netted 459g with same ruleset. It's very grindy, but without a party lasting hours, it may w...
I just did a Century Smash with my brother. It took us 2 minutes and 45 seconds to finish and netted like 530 gold. I've only done one of these but it was very easy with two players and seemed like a good gold for time spent ratio while not getting boring like spamming duck for a solid minute.
343,471
I'm out of gold. I spent it all on tickets and Mii outfits in the shop. At the rate of normal matches I'm seeing about 180-220 GP per match. This is pretty slow, especially with some pricey items like: * 3 star support spirits: 6k GP * Tickets for Classic Mode: 5k GP * Mii Outfits: 300-1500 GP * etc. [![enter image d...
2018/12/15
[ "https://gaming.stackexchange.com/questions/343471", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/18916/" ]
Jeremiah is right but you can increase the gold even further by picking Ice Climbers and if you have to controllers do 2 player ice climbers gets you 500 to 600 each game
Here’s a long way, but it’s kinda worth it. Stock = up to 99 (the higher the better) CPU’s = 8 (I’d recommend lv 6) Any map (or two if you want to spice it up) No time limit It’s long, but for 20 stocks I got 974 gold in one battle.
343,471
I'm out of gold. I spent it all on tickets and Mii outfits in the shop. At the rate of normal matches I'm seeing about 180-220 GP per match. This is pretty slow, especially with some pricey items like: * 3 star support spirits: 6k GP * Tickets for Classic Mode: 5k GP * Mii Outfits: 300-1500 GP * etc. [![enter image d...
2018/12/15
[ "https://gaming.stackexchange.com/questions/343471", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/18916/" ]
I managed to get 55k gold after a party with a bunch of people playing Smash all night, but that dried out pretty quick... The 1-minute test game as mentioned above just netted me 338g on first game, then I did two player, and netted 459g with same ruleset. It's very grindy, but without a party lasting hours, it may w...
Here’s a long way, but it’s kinda worth it. Stock = up to 99 (the higher the better) CPU’s = 8 (I’d recommend lv 6) Any map (or two if you want to spice it up) No time limit It’s long, but for 20 stocks I got 974 gold in one battle.
343,471
I'm out of gold. I spent it all on tickets and Mii outfits in the shop. At the rate of normal matches I'm seeing about 180-220 GP per match. This is pretty slow, especially with some pricey items like: * 3 star support spirits: 6k GP * Tickets for Classic Mode: 5k GP * Mii Outfits: 300-1500 GP * etc. [![enter image d...
2018/12/15
[ "https://gaming.stackexchange.com/questions/343471", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/18916/" ]
Use this [tutorial](https://www.youtube.com/watch?v=1YZDUCIKW2o). In text form, * Make a new ruleset that's based on stocks * Set stocks to 1 * Set time limit to 1 minute * Set CPU level to 1 * Turn off stage hazards * Turn off items * Set launch rate (under advanced options) to 0.5% * Save ruleset * Choose any chara...
If you have some "Rematch" items, I think you can get away with fighting a "Legend" (4-star) spirit character on the spirit board during an "Event", and get some good coins. I got ~1500 from Pauline for example, during the "Sleve-Free Zone" event right now. Then use "Rematch" item, and rinse and repeat. More fun than t...
336,239
new Linux user here, I am using chaletOS. I'm trying to install and run android-studio. After I try to run studio.sh, an error window pops up that reads: Unsupported Java Version: Cannot start under Java 1.7.0\_121-b00: Java 1.8 or later is required. Unsupported Java Version: Cannot start under Java 1.7.0\_121-b Howe...
2017/01/10
[ "https://unix.stackexchange.com/questions/336239", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/209610/" ]
I too encountered the same issue recently and i found the solution as : --- ``` $ sudo vim /etc/apt/sources.list.d/java-8-debian.list ``` and add these two lines: ``` deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main ``` --- ``...
I'm using the lastest android studio, i didn't install jdk and it worked. See [here](https://developer.android.com/studio/intro/studio-config.html#jdk): > > A copy of the latest OpenJDK comes bundled with Android Studio 2.2 and > higher, and this is the JDK version we recommend you use for your > Android projects....
23,866
I have developed an iso engine for a farm game. In general it works fine, but the problem is that it is not always accurate when pressing the tiles, so the tile I wanted to select is not the one picked. Anybody has some ideas how to improve this?
2012/02/14
[ "https://gamedev.stackexchange.com/questions/23866", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/13469/" ]
You should use a transform matrix. Check out this tutorial: <http://www.alcove-games.com/isometric_tile_picking.php>
In [this answer](https://gamedev.stackexchange.com/questions/14274/finding-out-which-tile-a-mouse-click-landed-in/14291#14291) the ratio between the projected diagonal of a square laying on the ground are 70:30. You can generalize with ease for the particular perspective you are using.
17,262,894
I am using HtmlUnit with java. In my page I have many tables but 4 tables are with the same name and same attributes. I want to process through these 4 tables separately. How can I get second table and third table among these 4 tables?
2013/06/23
[ "https://Stackoverflow.com/questions/17262894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1842050/" ]
> > If I am not wrong, the private key of an End Entity certificate (certificate issued by trusted CA like Verisign) is used to decrypt the information sent by the client > > > You are wrong. It isn't. The peer's own private key is used to sign the certificate so the client can verify that the peer owns the certif...
The root certificate's private key is (normally) only used to sign the intermediate certificates. Compromising it allows you to create new intermediate certificates, and by extension, certificates for any domain.
17,262,894
I am using HtmlUnit with java. In my page I have many tables but 4 tables are with the same name and same attributes. I want to process through these 4 tables separately. How can I get second table and third table among these 4 tables?
2013/06/23
[ "https://Stackoverflow.com/questions/17262894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1842050/" ]
> > If I am not wrong, the private key of an End Entity certificate (certificate issued by trusted CA like Verisign) is used to decrypt the information sent by the client > > > You are wrong. It isn't. The peer's own private key is used to sign the certificate so the client can verify that the peer owns the certif...
A root certificate is the top-most certificate of the tree, the private key of which is used to "sign" other certificates. All certificates immediately below the root certificate inherit the trustworthiness of the root certificate - a signature by a root certificate is somewhat analogous to "notarizing" an identity in ...
8,103,485
I want to split articles (= HTML content) that I receive from a webservice in different DIVs, based on a HR tag. I explain with an example, this is what I receive from the service: ``` <p>This is an article bla bla</p> <hr/> <p>this is the next page of the article blabla ...</p> ``` I want to make, based on the HR...
2011/11/12
[ "https://Stackoverflow.com/questions/8103485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1042945/" ]
Use split to create and array and loop through to create the divs. ``` var html = "<p>This is an article bla bla</p> <hr/> <p>this is the next page of the article blabla ...</p>"; $(html.split('<hr/>')).each(function(){ $('#test').append('<div>'+this+'</div>') }) ``` [Demo](http://jsfiddle.net/4tLQg/)
Try - ``` var html = '<p>This is an article bla bla</p> <hr/> <p>this is the next page of the article blabla ...</p>' var htmlarr = html.split('<hr/>'); html = html.replace(/<hr\/>/g,''); $('body').append(html); ``` This will just remove all the `<hr/>`s then append the remaining contnet to the page.Which I think wi...
55,498,263
Let's consider this specific case in which I want to pass a set of some object's statuses. For convenience and flexibility (or perhaps arbitrarily) I chose to use binary statuses which will be then concatenated using bitwise or "|" before I pass them around: ``` status_a = 0b1 status_b = 0b10 status_c = 0b100 statuse...
2019/04/03
[ "https://Stackoverflow.com/questions/55498263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9564645/" ]
Experiments with `timeit` suggest that adding is faster in these cases: ``` import timeit import statistics times = {"+": [], "|": []} for x in range(10): for y in range(x+1, 10): for op in "+|": t = timeit.timeit(stmt="x {} y".format(op), setup="x=2**{};y=2**{}".format(x, y)) time...
Since Python 3.6 you want to use Flag enums: ``` from enum import Flag, auto class Status(Flag): R = auto() W = auto() X = auto() FULL = R | W | X READONLY = R | X a = Status.R b = Status.W c = Status.X print(list(Status)) print(a,b,c) perms1 = a | b | c print(perms1) # removing W permission r...
55,498,263
Let's consider this specific case in which I want to pass a set of some object's statuses. For convenience and flexibility (or perhaps arbitrarily) I chose to use binary statuses which will be then concatenated using bitwise or "|" before I pass them around: ``` status_a = 0b1 status_b = 0b10 status_c = 0b100 statuse...
2019/04/03
[ "https://Stackoverflow.com/questions/55498263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9564645/" ]
Experiments with `timeit` suggest that adding is faster in these cases: ``` import timeit import statistics times = {"+": [], "|": []} for x in range(10): for y in range(x+1, 10): for op in "+|": t = timeit.timeit(stmt="x {} y".format(op), setup="x=2**{};y=2**{}".format(x, y)) time...
I've been playing with bitwise and addition operation to figure out if there is any performance difference: 1) 0-10 random powers of 2 ``` # number of operations btw 1-100 import pandas as pd import timeit import numpy as np from random import choice scale = 100 df = pd.DataFrame({'num_operations' : np.arange(1, ...
55,498,263
Let's consider this specific case in which I want to pass a set of some object's statuses. For convenience and flexibility (or perhaps arbitrarily) I chose to use binary statuses which will be then concatenated using bitwise or "|" before I pass them around: ``` status_a = 0b1 status_b = 0b10 status_c = 0b100 statuse...
2019/04/03
[ "https://Stackoverflow.com/questions/55498263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9564645/" ]
When we take a further look at the Python source code, we notice that the operators call different functions. The addition operator calls `binary_op1()` while the OR operator calls `binary_op()`. **Python addition operator** (line 955) ```cpp PyObject * PyNumber_Add(PyObject *v, PyObject *w) { PyObject *result = ...
Since Python 3.6 you want to use Flag enums: ``` from enum import Flag, auto class Status(Flag): R = auto() W = auto() X = auto() FULL = R | W | X READONLY = R | X a = Status.R b = Status.W c = Status.X print(list(Status)) print(a,b,c) perms1 = a | b | c print(perms1) # removing W permission r...
55,498,263
Let's consider this specific case in which I want to pass a set of some object's statuses. For convenience and flexibility (or perhaps arbitrarily) I chose to use binary statuses which will be then concatenated using bitwise or "|" before I pass them around: ``` status_a = 0b1 status_b = 0b10 status_c = 0b100 statuse...
2019/04/03
[ "https://Stackoverflow.com/questions/55498263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9564645/" ]
When we take a further look at the Python source code, we notice that the operators call different functions. The addition operator calls `binary_op1()` while the OR operator calls `binary_op()`. **Python addition operator** (line 955) ```cpp PyObject * PyNumber_Add(PyObject *v, PyObject *w) { PyObject *result = ...
I've been playing with bitwise and addition operation to figure out if there is any performance difference: 1) 0-10 random powers of 2 ``` # number of operations btw 1-100 import pandas as pd import timeit import numpy as np from random import choice scale = 100 df = pd.DataFrame({'num_operations' : np.arange(1, ...
47,933,755
I am working with junit5 and I want to create Parameterized Test in nested class. For example: ``` class CardTest { @Nested class Cost { Stream<Arguments> cards() { return Stream.of( Arguments.of(Card.common(0, Color.RED), 0), /** Other Data **/ ...
2017/12/21
[ "https://Stackoverflow.com/questions/47933755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3058413/" ]
**@TestInstance(PER\_CLASS)** You may select the "single test instance per class" mode annotating the nested class with `@TestInstance(TestInstance.Lifecycle.PER_CLASS)`: ``` class ColorTest { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) class Inner { @ParameterizedTest @Metho...
A bit late to this game, but... You can implement the provider, as a static, in the outer class. Then, in @MethodSource, you simply need to provide the fully qualified name of the parameter (i.e., com.biz.pckg#colors). This is documented in the JUnit user guide.
47,933,755
I am working with junit5 and I want to create Parameterized Test in nested class. For example: ``` class CardTest { @Nested class Cost { Stream<Arguments> cards() { return Stream.of( Arguments.of(Card.common(0, Color.RED), 0), /** Other Data **/ ...
2017/12/21
[ "https://Stackoverflow.com/questions/47933755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3058413/" ]
**@TestInstance(PER\_CLASS)** You may select the "single test instance per class" mode annotating the nested class with `@TestInstance(TestInstance.Lifecycle.PER_CLASS)`: ``` class ColorTest { @Nested @TestInstance(TestInstance.Lifecycle.PER_CLASS) class Inner { @ParameterizedTest @Metho...
Another variation based on [JUnit 5.2.0](http://Factory%20methods%20in%20external%20classes%20must%20be%20referenced%20by%20fully%20qualified%20method%20name%20%E2%80%94%20for%20example,%20com.example.StringsProviders#blankStrings.) is this. ``` class ColorTest { public static Stream<Arguments> provideColors() { ...
47,933,755
I am working with junit5 and I want to create Parameterized Test in nested class. For example: ``` class CardTest { @Nested class Cost { Stream<Arguments> cards() { return Stream.of( Arguments.of(Card.common(0, Color.RED), 0), /** Other Data **/ ...
2017/12/21
[ "https://Stackoverflow.com/questions/47933755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3058413/" ]
Another variation based on [JUnit 5.2.0](http://Factory%20methods%20in%20external%20classes%20must%20be%20referenced%20by%20fully%20qualified%20method%20name%20%E2%80%94%20for%20example,%20com.example.StringsProviders#blankStrings.) is this. ``` class ColorTest { public static Stream<Arguments> provideColors() { ...
A bit late to this game, but... You can implement the provider, as a static, in the outer class. Then, in @MethodSource, you simply need to provide the fully qualified name of the parameter (i.e., com.biz.pckg#colors). This is documented in the JUnit user guide.
38,659,998
I am trying to do something that I'm not sure is possible or not? The user opens the website. If they try to reopen the link in a new tab I need to redirect them to another page. I've tried using `c#` to see if I can detect a page reload. This works, but if I put my code in the page load event for some reason it runs...
2016/07/29
[ "https://Stackoverflow.com/questions/38659998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2413993/" ]
You can use cookies. When the user first open the page you send a cookie to the computer saying `PageOpened=true` , when the user opens it in the new tab check if there is a `cookie with PageOpened=true`, if there is, open your other link in the browser. You can give your cookies a time limit or destroy them when the...
you can try this ``` if(Request.Cookies["isPageRefresh"] == null) { Response.Cookies["isPageRefresh"].Value = "true"; Response.Cookies["isPageRefresh"].Expires = DateTime.Now.AddDays(1); } if (!IsPostBack) { if (Server.HtmlEncode(Request.Cookies["isPageRefresh"].Value== "false") { Resp...
6,008,956
I'm trying to get a function to start up another thread, and then return, with the thread still running. It seems like pthread\_detach() would take care of the memory and whatnot for me, although I'm not entirely sure. This is the code for the function: ``` void function() { pthread_mutex_lock(&state.continueLoopi...
2011/05/15
[ "https://Stackoverflow.com/questions/6008956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/288439/" ]
I don't see anything wrong. Yes the `pthread_detach` will take care to release the resources of the thread.
If you only want the threads continue to run simultaneously, it won't make a difference whether you detach the thread or not. But it will be harder or less idiomatic to collect resource (like a return value) from a detached thread. And yes, this piece of code does not expose any memory leaks.
55,213,902
How to print the value of 'a' and 'b' in the output instead of variable using formatting? ``` a = 1 b = 2 c = a+b OUTPUT = Sum of 1 and 2 = 3 ```
2019/03/18
[ "https://Stackoverflow.com/questions/55213902", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11218331/" ]
You can use [array-reduce](http://php.net/manual/en/function.array-reduce.php). Consider the following: ``` function mergeByDateAndPlace($carry, $item) { $key = $item["place_id"] . $item["date"]; // creating key matching exact place and date if (!isset($carry[$key])) { $carry[$key]["name"] = $item["na...
**Here is my data from my database:** var\_export($ArraySchedule) ``` array ( 0 => array ( 'id' => '225', 'place_id' => 'Alviks Kulturhus', 'name' => 'BarraBazz', 'date' => '2019-03-19', 'placeadress' => 'Gustavslundsvägen 1', ), 1 => array ( 'id' => '229', 'place_id' => 'Axelhuset Göteborg', 'name' => 'Anders Bj...
10,212,563
``` PhonebookEntry pb1("olaNormann"); pb1.add("Home","11234567"); pb1.add("Work","11065432"); cout << pb1.getNumbers()["Home"] << endl; cout << pb1.getNumbers()["Work"] << endl; map<string,string>::iterator it; for(it = pb1.getNumbers().begin(); it != pb1.getNumbers().end(); ++it){ cout << (*it).first << ": " << (...
2012/04/18
[ "https://Stackoverflow.com/questions/10212563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/325075/" ]
`getNumbers()` is returning a copy of the map, rather than a reference to it. That copy is destroyed at the end of the expression containing the function call, and so during the loop the iterator is invalid, and doing anything with it will give undefined behaviour. It should look something like: ``` map<string,string...
If this is your method: ``` std::map<std::string, std::string> getNumbers() const {return numbers;} ``` then it is returning a copy of the `numbers` map. So in your loop, the iterators are all messed up: ``` for(it = pb1.getNumbers().begin(); it != pb1.getNumbers().end(); ++it) { ... } ``` First, it gets initial...
10,212,563
``` PhonebookEntry pb1("olaNormann"); pb1.add("Home","11234567"); pb1.add("Work","11065432"); cout << pb1.getNumbers()["Home"] << endl; cout << pb1.getNumbers()["Work"] << endl; map<string,string>::iterator it; for(it = pb1.getNumbers().begin(); it != pb1.getNumbers().end(); ++it){ cout << (*it).first << ": " << (...
2012/04/18
[ "https://Stackoverflow.com/questions/10212563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/325075/" ]
`getNumbers()` is returning a copy of the map, rather than a reference to it. That copy is destroyed at the end of the expression containing the function call, and so during the loop the iterator is invalid, and doing anything with it will give undefined behaviour. It should look something like: ``` map<string,string...
There are two separate issues going on here: 1. Inserting a value into a temporary and printing it 2. Using an iterator of a temporary after its destruction Issue 1 ------- ``` cout << pb1.getNumbers()["Home"] << endl; ``` You see output because `std::map<T,U>::operator[]` returns `U&`, which is still valid when `...
10,212,563
``` PhonebookEntry pb1("olaNormann"); pb1.add("Home","11234567"); pb1.add("Work","11065432"); cout << pb1.getNumbers()["Home"] << endl; cout << pb1.getNumbers()["Work"] << endl; map<string,string>::iterator it; for(it = pb1.getNumbers().begin(); it != pb1.getNumbers().end(); ++it){ cout << (*it).first << ": " << (...
2012/04/18
[ "https://Stackoverflow.com/questions/10212563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/325075/" ]
If this is your method: ``` std::map<std::string, std::string> getNumbers() const {return numbers;} ``` then it is returning a copy of the `numbers` map. So in your loop, the iterators are all messed up: ``` for(it = pb1.getNumbers().begin(); it != pb1.getNumbers().end(); ++it) { ... } ``` First, it gets initial...
There are two separate issues going on here: 1. Inserting a value into a temporary and printing it 2. Using an iterator of a temporary after its destruction Issue 1 ------- ``` cout << pb1.getNumbers()["Home"] << endl; ``` You see output because `std::map<T,U>::operator[]` returns `U&`, which is still valid when `...
55,582,634
In ORACLE APEX, I need to pass an item value from one page to another that is not directly related to so I cannot use neither a link column nor a button that redirect to that page. Is there other way to do it?
2019/04/08
[ "https://Stackoverflow.com/questions/55582634", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9448737/" ]
"Another page" (for example, page 2) can reference item value from "one page" (for example, page 1), such as ``` :P2_ITEM := :P1_ITEM; ``` See page 2 item's * source * default value * on load dynamic action Page 1 item's value has to be in session state (which doesn't mean that you can see it on the screen), other...
When or in what event will that value have to pass? For example, when you change the value of an item, when you load the page, etc.
2,128,632
I thought this code should work but it didnt, can someone explain? ``` $("#addLinkLayout input.comment, #addLinkLayout input.link").each(function() { $(this).val().appendTo('div#links'); }); ``` It says `$(this).val().appendTo()` is not a function.
2010/01/24
[ "https://Stackoverflow.com/questions/2128632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/206446/" ]
`val()` doesn't return a DOM element. It returns the `value` attribute from a DOM element. So if you have something like `<input value="foo" />`, calling val() on that node will give you a string `"foo"`. Since javascript's string class doesn't have a method `appendTo`, you're getting an error. You probably want somet...
val returns a string, not a jQuery object, try: ``` $('div#links').append($(this).val()); ```