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 |
|---|---|---|---|---|---|
550,374 | 1) "If interest rates are low, then housing starts are up. If housing starts are up, then marriage rates are high. If interest rates are low, then the economy is good. The economy is not good. Therefore marriage rates are not high."
2) "If Sajee is not on team A, then Marlon is on team B. If Marlon is not on team B, t... | 2013/11/03 | [
"https://math.stackexchange.com/questions/550374",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/105096/"
] | **Hint:** If $n=p\_1^{k\_1} ...p\_i^{k\_i}$ then you can prove that $n$ is a perfect power if and only if $k\_1,..,k\_i$ have a common divisor $ b >1$.
This is the same as asking $gcd(k\_1,..,k\_i) \neq 1$. | The best way would be to factor the integer. You already know this for the first three. You should have noticed that $125=5 \times 5 \times 5$ so $125=5^3$. This method is very easy when the number is a power of a prime.
Now what about when a number isn't a prime power? Take the number $2500$.
$$2500=2^2 5^4$$
We ... |
1,170 | What would be a good way to express empathetic sorrow in Portuguese? For example, if my friend's puppy dies and it's not my fault I wouldn't say "Desculpe!" right? "Desculpar" would have a meaning closer to "remove the guilt." I'm looking for a word or phrase that means something similar to "lo siento" in Spanish—a wor... | 2015/09/17 | [
"https://portuguese.stackexchange.com/questions/1170",
"https://portuguese.stackexchange.com",
"https://portuguese.stackexchange.com/users/447/"
] | There are several ways of expressing your sympathy.
* "Sinto muito"
* "Sinto muito por você"
* "Lamento" (sounds formal)
* "Meus pêsames" (too strong for the death of a puppy. Used for people.)
* "Que pena!" ("seu gato morreu? Ah, que pena!!!)
* "Ah, que tristeza!"
Edit - As @Jorg B commented, "as minhas condolências... | You're right about "desculpe": it means *forgive me*, so it would be nonsensical in the situation you describe.
In addition to the phrases in Centaurus’ answer, there are some that, at least in Portugal, would be quite appropriate to express sympathy for a friend whose puppy has die or suffered injury:
>
> Coitado,... |
41,177,370 | I need to include some scripts in to my service worker. Normally we are appending scripts to DOM using document object. But in the case of service workers there is no DOM. So how can we do this using JS codes?
Thanks.. | 2016/12/16 | [
"https://Stackoverflow.com/questions/41177370",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1568035/"
] | Use the importScripts function.
you can host your js files on an https domain and do something like this:
```
importScripts("//cdn.jsdelivr.net/pouchdb/5.3.1/pouchdb.min.js");
``` | There is a [importScripts()](https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/importScripts) method for that. |
8,854,904 | I have a php code below where it is suppose to display my buttons, 7 buttons in a row. Now these buttons are displayed in a block which fades in and out. But problem is that the first 7 buttons are not displayed in the block but displayed seperatly and the other buttons are displayed in the block. Why is this happening... | 2012/01/13 | [
"https://Stackoverflow.com/questions/8854904",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1096892/"
] | ATK4 is distributed with simple usable basic types which is limited to the following list:
* string
* date
* datetime
* text
* int
* real
* boolean
* password
* list
As for the `set` type, the nearest would be that of a `list` type.
example:
```
$this->addField('month')->type('list')->caption('Month')
->listDa... | The best source for types of fields that I have found is here:
[ATK4 API Reference](http://agiletoolkit.org/doc/ref)
Of course, I am less that a month into ATK4 and is a good starting point. The examples supplied with ATK4 are helpful and the Jobeet example has some good info. Dive in! |
267,639 | In Kassel's book on Quantum groups, it is defined that:
"We define $U\_q=U\_q(\mathfrak{sl}(2) )$ as the algebra generated by the four variables $E$, $F$, $K$, $K^{-1}$ with the relations
\begin{eqnarray\*}
&&KK^{-1}=K^{-1}K=1\\
&&KEK^{-1}=q^2 E,\ KFK^{-1}=q^{-2} F\\
and &&[E,F]=\frac{K-K^{-1}}{q-q^{-1}}
\end{eqnarra... | 2012/12/30 | [
"https://math.stackexchange.com/questions/267639",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/28012/"
] | On the one hand, I'd suggest taking that description of $U\_q(\mathfrak{sl}\_2)$ as a formal definition. That is, think of $U\_q(\mathfrak{sl}\_2)$ as being the free associative algebra $k\langle E, F, K, K^{-1}\rangle$ modulo the relations you gave. $E$, $F$, $K$ are just formal symbols. You can just as well call them... | The answer given by mebassett seems to take away the meaning of the elements $E,K,K^{-1},F$ and reduce them to formal symbols $x,y,z$ rather than providing meaning. That is one way to look at them of course; as formal symbols.
To get a better feeling of what these elements mean, you can turn to representation theory. ... |
51,791,310 | Taking an example from [their GitHub](https://github.com/RSuter/NJsonSchema), if I knew at runtime the First name could ONLY be "Bob" OR "Bill" could I validate against this?
```
public class Person
{
[Required]
public string FirstName { get; set; }
public string MiddleName { get; set; }
[Required]
... | 2018/08/10 | [
"https://Stackoverflow.com/questions/51791310",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10209712/"
] | **Change that `.valueChanges()` to a `.snapshotChanges()` then you can apply a filter. See the example below.**
I dont like changing default behavior (default configurations). **I saw it's a desired behavior and the good practice is to show the data as soon as possible to the user**, even if you refresh twice the scre... | if using AngularFire2 you can try:
1. I read on the Internet that you can disable offline persistence - which caches your results -by not calling enablePersistence() on AngularFireStoreModule.
2. I have done the first and still had no success, but try it first. What I managed to do to get rid of caching results was to... |
51,791,310 | Taking an example from [their GitHub](https://github.com/RSuter/NJsonSchema), if I knew at runtime the First name could ONLY be "Bob" OR "Bill" could I validate against this?
```
public class Person
{
[Required]
public string FirstName { get; set; }
public string MiddleName { get; set; }
[Required]
... | 2018/08/10 | [
"https://Stackoverflow.com/questions/51791310",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10209712/"
] | **Change that `.valueChanges()` to a `.snapshotChanges()` then you can apply a filter. See the example below.**
I dont like changing default behavior (default configurations). **I saw it's a desired behavior and the good practice is to show the data as soon as possible to the user**, even if you refresh twice the scre... | Persistence and caching should be disabled for angular/fire by default but it is not and there is no way to turn it off. As such, @BorisD's answer is correct but he hasn't explained it too well. Here's a full example for converting `valueChanges` to `snapshotChanges`.
```
constructor(private afs: AngularFirestore) {}
... |
116,887 | I seem to be getting a strange error when I run my tests in rails, they are all failing for the same reason and none of the online documentation seems particularly helpful in regards to this particular error:
```
SQLite3::SQLException: cannot rollback - no transaction is active
```
This error is crippling my ability... | 2008/09/22 | [
"https://Stackoverflow.com/questions/116887",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2594/"
] | Check <http://dev.rubyonrails.org/ticket/4403> which shows a workaround. Could that be the problem you are encountering? | I had this problem once but with MySQL. Turned out I hadn't created the test database. Doh! Rails and sqlite creates them automatically I believe (at least it does in windows).
Are trying to do in memory testing? If not does the test database exist? |
116,887 | I seem to be getting a strange error when I run my tests in rails, they are all failing for the same reason and none of the online documentation seems particularly helpful in regards to this particular error:
```
SQLite3::SQLException: cannot rollback - no transaction is active
```
This error is crippling my ability... | 2008/09/22 | [
"https://Stackoverflow.com/questions/116887",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2594/"
] | Check <http://dev.rubyonrails.org/ticket/4403> which shows a workaround. Could that be the problem you are encountering? | Thanks for the help. I actually ended up just deleting the rails folder and checking back out the last working copy from version control. I've made the identical changes and this problem hasn't reappeared, so either I messed up or rails had some sort of hiccup. Thankfully I had version control :-) |
116,887 | I seem to be getting a strange error when I run my tests in rails, they are all failing for the same reason and none of the online documentation seems particularly helpful in regards to this particular error:
```
SQLite3::SQLException: cannot rollback - no transaction is active
```
This error is crippling my ability... | 2008/09/22 | [
"https://Stackoverflow.com/questions/116887",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2594/"
] | Check <http://dev.rubyonrails.org/ticket/4403> which shows a workaround. Could that be the problem you are encountering? | I got this error when running a test with the last statement being a click on a form submit. Once I did an assertion or should test, the test closed properly, and I didn't have to rerun the rake db:test:prepare |
71,577,775 | I have a django view that generates a form depending on POST or GET. It works well with little data on the Student model but stagnates when the data gets big. Is there a remedy I can apply??
Here's the `view`
```
def My_View(request,pk):
if request.method == 'POST':
try:
form = NewIssueForm(req... | 2022/03/22 | [
"https://Stackoverflow.com/questions/71577775",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13553405/"
] | The reason this happens is because when you render the `Student`, it will need to fetch the *related* `Klass` and `Stream` objects, and will make a query *per* `Student` object. This problem is called an *N+1 problem* since fetching *n* student requires one query to fetch all the `Student`s, and then one query per `Stu... | Can't guess your model but it seems like select\_related may play a trick. |
63,680,406 | I have created an array and displayed in the homepage component, Now I want to when I click one of the Images, I want to get the details of that element on the item details component, how to do that? thank you!
**[homepage component view](https://i.stack.imgur.com/d1iOY.png)**
**homepage component code**
Button Clic... | 2020/09/01 | [
"https://Stackoverflow.com/questions/63680406",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10854447/"
] | Check this working example.
```
import discord
import youtube_dl
from discord.ext import commands
ydl_opts = {
'format': 'bestaudio/best',
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
'preferredquality': '192',
}],
}
def endSong(guild, path):
... | Try to replace `if not ctx.message.author.voice:` with `if 'voice' not in ctx.message.author:` |
207,518 | >
> HTML 4 supports a "title" attribute that can be inserted inside any HTML tag. Inserting this attribute effectively gives the element a tooltip that pops up when the mouse moves over it.
>
>
>
It just seems like a bad word choice.. or am I missing something? | 2013/08/07 | [
"https://softwareengineering.stackexchange.com/questions/207518",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/91451/"
] | Why? It's a historical artifact from the early days of the internet. It originated with the HTML 1.2 draft (1993) and was integrated with the HTML 2.0 specification. It's purpose was to indicate the title of the document--as simple as that.
**Deeper dive:**
In the beginning, the purpose of HTML was to provide a marku... | I think the tooltip is an implementation decision of browsers, not the intended used expressed in the specification.
I'm inclined to believe that the title attribute was intended for screen readers other and DOM parsers. |
207,518 | >
> HTML 4 supports a "title" attribute that can be inserted inside any HTML tag. Inserting this attribute effectively gives the element a tooltip that pops up when the mouse moves over it.
>
>
>
It just seems like a bad word choice.. or am I missing something? | 2013/08/07 | [
"https://softwareengineering.stackexchange.com/questions/207518",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/91451/"
] | The [W3C HTML standard](http://www.w3.org/TR/html401/struct/global.html#h-7.4.3) on the `title` attribute:
>
> This attribute offers advisory information about the element for which it is set...
>
>
> Values of the title attribute may be rendered by user agents in a variety of ways. For instance, visual browsers fr... | I think the tooltip is an implementation decision of browsers, not the intended used expressed in the specification.
I'm inclined to believe that the title attribute was intended for screen readers other and DOM parsers. |
207,518 | >
> HTML 4 supports a "title" attribute that can be inserted inside any HTML tag. Inserting this attribute effectively gives the element a tooltip that pops up when the mouse moves over it.
>
>
>
It just seems like a bad word choice.. or am I missing something? | 2013/08/07 | [
"https://softwareengineering.stackexchange.com/questions/207518",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/91451/"
] | I think the tooltip is an implementation decision of browsers, not the intended used expressed in the specification.
I'm inclined to believe that the title attribute was intended for screen readers other and DOM parsers. | There is no good reason for the choice of the attribute name `title`. The name has been fixed now, anyway, so the choice is practically irrelevant, except in teaching.
Historically, `title` was first defined for links only, and it was seen as specifying an “advisory title” for the linked document – a bit extravagant f... |
207,518 | >
> HTML 4 supports a "title" attribute that can be inserted inside any HTML tag. Inserting this attribute effectively gives the element a tooltip that pops up when the mouse moves over it.
>
>
>
It just seems like a bad word choice.. or am I missing something? | 2013/08/07 | [
"https://softwareengineering.stackexchange.com/questions/207518",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/91451/"
] | The [W3C HTML standard](http://www.w3.org/TR/html401/struct/global.html#h-7.4.3) on the `title` attribute:
>
> This attribute offers advisory information about the element for which it is set...
>
>
> Values of the title attribute may be rendered by user agents in a variety of ways. For instance, visual browsers fr... | Why? It's a historical artifact from the early days of the internet. It originated with the HTML 1.2 draft (1993) and was integrated with the HTML 2.0 specification. It's purpose was to indicate the title of the document--as simple as that.
**Deeper dive:**
In the beginning, the purpose of HTML was to provide a marku... |
207,518 | >
> HTML 4 supports a "title" attribute that can be inserted inside any HTML tag. Inserting this attribute effectively gives the element a tooltip that pops up when the mouse moves over it.
>
>
>
It just seems like a bad word choice.. or am I missing something? | 2013/08/07 | [
"https://softwareengineering.stackexchange.com/questions/207518",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/91451/"
] | Why? It's a historical artifact from the early days of the internet. It originated with the HTML 1.2 draft (1993) and was integrated with the HTML 2.0 specification. It's purpose was to indicate the title of the document--as simple as that.
**Deeper dive:**
In the beginning, the purpose of HTML was to provide a marku... | There is no good reason for the choice of the attribute name `title`. The name has been fixed now, anyway, so the choice is practically irrelevant, except in teaching.
Historically, `title` was first defined for links only, and it was seen as specifying an “advisory title” for the linked document – a bit extravagant f... |
207,518 | >
> HTML 4 supports a "title" attribute that can be inserted inside any HTML tag. Inserting this attribute effectively gives the element a tooltip that pops up when the mouse moves over it.
>
>
>
It just seems like a bad word choice.. or am I missing something? | 2013/08/07 | [
"https://softwareengineering.stackexchange.com/questions/207518",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/91451/"
] | The [W3C HTML standard](http://www.w3.org/TR/html401/struct/global.html#h-7.4.3) on the `title` attribute:
>
> This attribute offers advisory information about the element for which it is set...
>
>
> Values of the title attribute may be rendered by user agents in a variety of ways. For instance, visual browsers fr... | There is no good reason for the choice of the attribute name `title`. The name has been fixed now, anyway, so the choice is practically irrelevant, except in teaching.
Historically, `title` was first defined for links only, and it was seen as specifying an “advisory title” for the linked document – a bit extravagant f... |
1,365,184 | Is there a way to see whether any one application was installed via Snap, from a PPA, via downloaded deb or from a standard repository?
At the moment, I have Zoom installed on my Focal 20.04 laptop. I'm trying to figure out how I initially installed it, but I have this problem fairly often. Either it's a proprietary a... | 2021/09/22 | [
"https://askubuntu.com/questions/1365184",
"https://askubuntu.com",
"https://askubuntu.com/users/13049/"
] | Start with `which zoom` or `which zoom-client`. That will return the file-path to the executable. (Hint: `tab` completion is your friend)
Anything that starts with `/snap` was installed by Snap (Or the Ubuntu Software Center) so you can find out more by opening the software center or running `snap list | grep -i zoom`... | Install Synaptic Package Manager (you can install it from Ubuntu Software, or from command line using `sudo apt install synaptic`). It is a great tool to manage `.deb` packages. On the main screen, it shows you packages divided into groups, as you can see in the screenshot below. Look at group called "Installed (local ... |
12,428,574 | I have Java GUI application in **Java SE version 7** which I run on Windows 7 64 bits. When I try to run it clicking on jar file the pop up Window is saying '**Cannot find the main class or load it:...**'. When I run the same jar file via command line in this way: **java -jar app.jar' it works fine**. If you try to run... | 2012/09/14 | [
"https://Stackoverflow.com/questions/12428574",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1197712/"
] | Sounds like on your system the `.jar` extension is registered to run with Java6 and your application needs Java7.
On the commandline type the following command to find out how the `.jar` extension is registered:
```
assoc .jar
```
It will show something like this:
```
.jar=jarfile
```
(Note: on your system it ... | You need to make a manifest file, under the Meta-INF folder. If there's already one there, add the line
```
main-class: [class name].class
```
And try that (not sure if there's supposed to be a space after the colon) |
12,789,873 | I'm trying to put a file link with a partial render, something like this:
```
#Main haml file
= render :partial => 'file_upload', :locals => {:f => f, :file_download => 'residence_cert'}
#Inside the partial
%a{:href => @postulant_info[file_download]}
```
But this is making a link just with the file name, not the ful... | 2012/10/08 | [
"https://Stackoverflow.com/questions/12789873",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/895789/"
] | Think I see the issue... When you do `Array.newInstance(...)`, it takes in the component type (in your case, you want it to be String). However, you're handing the array class (arr1 is of type String[], and you're doing `arr1.getClass()`). Instead, do
```
arr1.getClass().getComponentType()
```
to get the `String` c... | I copied and pasted the code you gave and it doesn't even compile. After doing some fixes, I came to this:
```
public class Test {
public <T extends Comparable> void mergeSort(T[] arr) {
T[] merged = merge(Arrays.copyOfRange(arr, 0, arr.length / 2), Arrays.copyOfRange(arr, arr.length / 2 + 1, arr.length - 1));
... |
11,024,508 | I've searched for the last half an hour trying to find a way to update a div with HTML content every ten seconds. Everything either is to with loading a file or just plain text. Heres what I have done so far but I think it is way off.
```
<script type="text/javascript">
var refreshId = setInterval(function()
{
$(... | 2012/06/13 | [
"https://Stackoverflow.com/questions/11024508",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1321941/"
] | if `myad` is class do `$(".myad")` if id do `$("#myad")`
```
<script type="text/javascript">
$(document).ready(function(){
var refreshId = setInterval(function()
{
$(".myad").html('<iframe height="98px" width="732px" src="www.eg.com/eg.html"></iframe>');
// or $("#myad")....
... | Try `$('#myad')` instead of `$('myad')` and you should be just fine.
Edit: Actually, `$('#myad iframe').get()[0].contentWindow.location.reload(true);` would probably be a nicer solution for the reload. |
11,024,508 | I've searched for the last half an hour trying to find a way to update a div with HTML content every ten seconds. Everything either is to with loading a file or just plain text. Heres what I have done so far but I think it is way off.
```
<script type="text/javascript">
var refreshId = setInterval(function()
{
$(... | 2012/06/13 | [
"https://Stackoverflow.com/questions/11024508",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1321941/"
] | if `myad` is class do `$(".myad")` if id do `$("#myad")`
```
<script type="text/javascript">
$(document).ready(function(){
var refreshId = setInterval(function()
{
$(".myad").html('<iframe height="98px" width="732px" src="www.eg.com/eg.html"></iframe>');
// or $("#myad")....
... | If you're just trying to reload the iFrame, an easier way would be to just give the iframe an ID.
```
document.getElementById("myframe").src = document.getElementById("myframe").src
``` |
242 | There are nice community wiki post on [stackoverflow](https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list), which I find very usefull.
Does this site need something like this? Collection of good books on puzzles? Articles? Puzzles themselves? Solutions? (I dislike presenting solutions for g... | 2014/06/07 | [
"https://puzzling.meta.stackexchange.com/questions/242",
"https://puzzling.meta.stackexchange.com",
"https://puzzling.meta.stackexchange.com/users/28/"
] | Community reference questions aren't unheard of on Stack Exchange, and I won't preclude the possibility that we encounter a use for such a community wiki question. However, they're *exceedingly* rare, and I've only ever seen them used when there's strong community support for it. It's really up to the community as a wh... | There are, or were, many, many more similar community wiki posts on Stack Overflow that do not remotely quality as nice. Indeed, the [C++ book list](https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list) was often touted in meta discussions on this topic as the example of how such questions wo... |
13,031 | In the French translation of Harry Potter a l'ecole des sorciers, the sentence “*Make Harry get it!*” (it being the post, i.e. letters) is translated as
>
> Harry n'a qu'à y aller.
>
>
>
This seems to me to say something like “Harry has to go there” but that is a very loose translation and seems to ignore the *n'... | 2015/02/03 | [
"https://french.stackexchange.com/questions/13031",
"https://french.stackexchange.com",
"https://french.stackexchange.com/users/6612/"
] | From [le Trésor de la Langue Française](http://www.cnrtl.fr/definition/avoir), entry *avoir* III, A, 2:
>
> *N'avoir qu'à + inf.Il suffit de...*
>
>
>
i.e., *n’avoir qu’à* followed by an infinitive means “to just have to”. Here, a (poor, literal) translation from French to English could be:
>
> Harry just has t... | "N'avoir qu'à [verbe]" means X can do something himself. This is often a bit judgmental. The presence of "que" implies that the action is easy to do.
"Tu n'as qu'à le manger" = "eat it yourself" (implying "instead of me")
"Tu n'as qu'à y aller" = "You can go" (instead of asking me to do it)
"Tu n'as qu'à le faire" = "... |
54,304,330 | I am new to woocommerce and I'm try for a week to display below a variable price a proposal for a payment in 4x.
I tried several techniques and code found on the net but none with good results.
The best I could do and this:
```html
//Afficher paiement 3xcb//
add_filter('woocommerce_get_price_suffix', 'display_3xc... | 2019/01/22 | [
"https://Stackoverflow.com/questions/54304330",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10941749/"
] | For product variations addition suffix to the selected price use instead:
```
add_filter( 'woocommerce_available_variation', 'custom_variation_price_addition', 10, 3 );
function custom_variation_price_addition( $data, $product, $variation ) {
$price = wc_get_price_to_display( $variation );
$suffix = sprintf( ... | ```
function the_product_price() {
global $product;
global $woocommerce;
$regular_price = get_post_meta(get_the_ID(), '_regular_price', true);
if ($regular_price == "") {
$available_variations = $product->get_available_variations();
if ($available_variations) {
$variation_id ... |
32,706,881 | On my program for java programming is not running right. My professor had us download a console.java to help use make a console to display our outputs of the program. I think the program is getting stuck when I am calling the update method and checkCells. My professor said that calling matrix.length for both rows and c... | 2015/09/22 | [
"https://Stackoverflow.com/questions/32706881",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5361426/"
] | The problem here is that you assume that the inline script is executed after your script has finished loading jQuery, but that is not the case. Here is the sequence of actions that is actually happening:
1. embed.js script is executed and initiate jQuery loading **in the background**
2. your inline script is executed ... | You can't call your render method until `jQuery.js` is loaded
Instead of calling it right after `init()` in global space, call it internally after you have the load complete and `scriptLoadHandler()` has been called since that's where you are defining your local `jQuery` variable |
74,113,915 | Any data, string/long/dobule or in saved in memory as hex or decimal values.
Based on my point, **I want to get the double value of the string** and sent it over transmission and **decode the received double value to string**.
In C, I can get following working.
TX
==
```
char name[6] = "me123"//underline decimal va... | 2022/10/18 | [
"https://Stackoverflow.com/questions/74113915",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2146837/"
] | Ordinary strings in Python represent Unicode objects - and they have to be converted *first* to a concrete bytes representation by an specific codec using the `.encode(...)` method. By default, `utf-8` is used, but any encoding can be used, and it is necessary if the text you get goes outside the ASCII correspondence t... | Following worked for me up to 6 bytes. I am still having issues coping over 6 bytes here.
**c**
```
char temp_id[8] = "smg123";
char dbl_to_str[8];
uint64_t id = 0;
memcpy(&id, temp_id, 8);
memcpy(dbl_to_str, &id, 8);
printf("Double to String %s\n", dbl_to_str);
```
**python**
print(message.... |
555,296 | I have the following SQL result set (as result of a join FWIW):
```
A,C
B,E
C,A
D,A
```
Every value represents a node. So the total set of nodes involved is A,B,C,D,E. Every row describes a directed edge.
```
A -> C
B -> E
C -> A
D -> A
```
Of course this can be simplified to
```
A <-> C
B -> E
D -> A
```
Now ... | 2009/02/17 | [
"https://Stackoverflow.com/questions/555296",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33165/"
] | Imagine a table Nodes with columns Node1 and Node2.
```
SELECT node1, node2
FROM nodes n
WHERE EXISTS (SELECT 1 FROM nodes WHERE node1 = n.node2 AND node2 = n.node1)
```
Of course you'll want to make sure its appropriate indexed, namely:
```
(node1, node2)
```
and
```
(node2, node1)
```
This will still get you... | ```
-- Temp table creating to insert example rows
SELECT
'A' AS Col1, 'C' AS Col2
INTO #TEMP
UNION
SELECT 'B', 'E'
UNION
SELECT 'C', 'A'
UNION
SELECT 'D', 'A'
SELECT A.* FROM #TEMP A, #TEMP B
WHERE (A.COL1 = B.COL2 AND A.COL2 = B.COL1)
``` |
555,296 | I have the following SQL result set (as result of a join FWIW):
```
A,C
B,E
C,A
D,A
```
Every value represents a node. So the total set of nodes involved is A,B,C,D,E. Every row describes a directed edge.
```
A -> C
B -> E
C -> A
D -> A
```
Of course this can be simplified to
```
A <-> C
B -> E
D -> A
```
Now ... | 2009/02/17 | [
"https://Stackoverflow.com/questions/555296",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/33165/"
] | Imagine a table Nodes with columns Node1 and Node2.
```
SELECT node1, node2
FROM nodes n
WHERE EXISTS (SELECT 1 FROM nodes WHERE node1 = n.node2 AND node2 = n.node1)
```
Of course you'll want to make sure its appropriate indexed, namely:
```
(node1, node2)
```
and
```
(node2, node1)
```
This will still get you... | Inner-join the node pairs to themself?
```
select node1, node2
from nodes n
inner join nodes n2
on n.node1 = n2.node2 and n.node2 = n2.node1
```
(replace 'nodes' with your subquery) |
53,106,039 | I'm starting with RegEx and I need help, I want to validate that there are two equal characters followed by A, or that they are separated (but remain the same) and in the middle A. I explain with examples:
```
BBA -> true
ABB -> true
BAB -> true
CCA -> true
ABC -> false
BAC -> false
BBBA -> false (there have to be onl... | 2018/11/01 | [
"https://Stackoverflow.com/questions/53106039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10591814/"
] | Use `\b` to match only words, and back references for each `|`.
```
\b([B-Z])\1A|([B-Z])A\2|A([B-Z])\3\b
```
Check: <https://regexr.com/42bp0> | ```
Pattern pattern = Pattern.compile("([B-Z])\\1A|A([B-Z])\\2|([B-Z])A\\3")
```
back references run through the whole pattern and crosses OR operator. In general it is not a good fit for regex solution though as others mentioned.
Note that you have to add ^ and $ as needed to match only this pattern like so:
```
"... |
53,106,039 | I'm starting with RegEx and I need help, I want to validate that there are two equal characters followed by A, or that they are separated (but remain the same) and in the middle A. I explain with examples:
```
BBA -> true
ABB -> true
BAB -> true
CCA -> true
ABC -> false
BAC -> false
BBBA -> false (there have to be onl... | 2018/11/01 | [
"https://Stackoverflow.com/questions/53106039",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10591814/"
] | This can be done rather elegantly:
`\b(?=[A-Z]{3}\b)A?([B-Z])A?\1A?\b`
[Demo on regex101](https://regex101.com/r/rX4Pxj/1)
The `[A-Z]{3}` inside the lookahead asserts that the sequence is exactly 3 letters in length, thanks to having `\b` on both sides. The `A?([B-Z])A?\1A?` asserts that there are two identical inst... | ```
Pattern pattern = Pattern.compile("([B-Z])\\1A|A([B-Z])\\2|([B-Z])A\\3")
```
back references run through the whole pattern and crosses OR operator. In general it is not a good fit for regex solution though as others mentioned.
Note that you have to add ^ and $ as needed to match only this pattern like so:
```
"... |
9,909,995 | All
Here i want to run .sh file via system call in android NDK.
I able to run `cp,rm` command via system call. but sh command is not working via system call.
I also installed busy-box on android.I am using below code.I set all permission on `test.sh`.
Code :
```
#include <stdlib.h>
#include <stdio.h>
#include <and... | 2012/03/28 | [
"https://Stackoverflow.com/questions/9909995",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1089679/"
] | Where are you expecting to see the "echo"? By default, android sends stdout to /dev/null.
According to the [documentation](http://developer.android.com/guide/developing/tools/adb.html#stdout) you can redirect stdout and stderr to the log (so it will show up in logcat) using the following commands:
```
$ adb shell st... | You might want to try `sh -c /full/path/to/test.sh` |
72,791,858 | FedEx Address Validation API is returning encoded characters and a 400 bad request error. Here is my request body with the secret key blocked out for obvious reasons:
```
POST /address/v1/addresses/resolve HTTP/1.1
Content-Type: application/json
x-customer-transaction-id:
x-locale: en_US
authorization: Bearer {my sec... | 2022/06/28 | [
"https://Stackoverflow.com/questions/72791858",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15993055/"
] | The answer was looking up how to decompress gzip in the language I was using. With Outsystems, I downloaded a forge component called gzip that compresses and decompresses binary to and from plaintext. | Sample syntax to decompress fedex api error messages in java
```
Public apiCall()
{
try{
// api call
}catch(Exception e)
{
String errorMessage = deCompress(e.getResponseBodyAsByteArray());
}
}
private static String deCompress(byte[] str) throws IOException{
String decodedString= null;
B... |
1,711,403 | Consider the quadratic equation $(a+c-b)x^2 + 2cx + b+c-a = 0 $ , where a,b,c are distinct real numbers and a+c-b is not equal to 0. Suppose that both the roots of the equation are rational . Then
a) a,b, and c are rational
b)$c/(a-b)$ is rational
c)$b/(c-a)$ is rational
d)$a/(b-c)$ is rational
My attempt - I ... | 2016/03/24 | [
"https://math.stackexchange.com/questions/1711403",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/312575/"
] | Notice that your polynomial $$(a+c-b)x^2 +2cx +(b+c-a) = (a+c-b) (x - \alpha)(x - \beta) =$$
$$=(a+c-b)x^2 - (a+c-b)(\alpha + \beta) x + (a+c-b)\alpha \beta$$
where $\alpha, \beta$ are the rational roots.
Now, the coefficient of $x$ must be equal
$$2c = -(a+c-b)(\alpha + \beta)$$
and with some algebra you get
$$\frac{... | Reduce this to a monic form:
$$
x^2+\frac{2c}{a+c-b}x+\frac{b+c-a}{a+c-b}
$$
then as the roots are rational so are the sum and product of the roots, so both $\frac{2c}{a+c-b}$ and $\frac{b+c-a}{a+c-b}$ are rational and so $\frac{c}{b+c-a}$ is also rational, and you should be able to take it from there. |
1,711,403 | Consider the quadratic equation $(a+c-b)x^2 + 2cx + b+c-a = 0 $ , where a,b,c are distinct real numbers and a+c-b is not equal to 0. Suppose that both the roots of the equation are rational . Then
a) a,b, and c are rational
b)$c/(a-b)$ is rational
c)$b/(c-a)$ is rational
d)$a/(b-c)$ is rational
My attempt - I ... | 2016/03/24 | [
"https://math.stackexchange.com/questions/1711403",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/312575/"
] | Notice that your polynomial $$(a+c-b)x^2 +2cx +(b+c-a) = (a+c-b) (x - \alpha)(x - \beta) =$$
$$=(a+c-b)x^2 - (a+c-b)(\alpha + \beta) x + (a+c-b)\alpha \beta$$
where $\alpha, \beta$ are the rational roots.
Now, the coefficient of $x$ must be equal
$$2c = -(a+c-b)(\alpha + \beta)$$
and with some algebra you get
$$\frac{... | Note that, when $x=-1$, we get
$$
(a+c-b)-2c+(b+c-a)=0
$$
so $-1$ is a root for every choice of the parameters $a$, $b$ and $c$. Even if $a+c-b=0$, that would give $c/(a-b)=-1$.
This leads into checking option b. So, suppose $a+c-b\ne0$. The factorization of the polynomial is
$$
(x+1)\bigl((a+c-b)x+c-a+b\bigr)
$$
so t... |
1,711,403 | Consider the quadratic equation $(a+c-b)x^2 + 2cx + b+c-a = 0 $ , where a,b,c are distinct real numbers and a+c-b is not equal to 0. Suppose that both the roots of the equation are rational . Then
a) a,b, and c are rational
b)$c/(a-b)$ is rational
c)$b/(c-a)$ is rational
d)$a/(b-c)$ is rational
My attempt - I ... | 2016/03/24 | [
"https://math.stackexchange.com/questions/1711403",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/312575/"
] | Notice that your polynomial $$(a+c-b)x^2 +2cx +(b+c-a) = (a+c-b) (x - \alpha)(x - \beta) =$$
$$=(a+c-b)x^2 - (a+c-b)(\alpha + \beta) x + (a+c-b)\alpha \beta$$
where $\alpha, \beta$ are the rational roots.
Now, the coefficient of $x$ must be equal
$$2c = -(a+c-b)(\alpha + \beta)$$
and with some algebra you get
$$\frac{... | We know that your two roots are rational:
$$
r\_1 = \frac{-2c + (a - b)}{2(a - b + c)} \in \mathbb Q \qquad\text{and}\qquad
r\_2 = \frac{-2c - (a - b)}{2(a - b + c)} \in \mathbb Q
$$
Hence, their sum and difference are also rational:
$$
r\_1 + r\_2 = \frac{c}{a - b + c} \in \mathbb Q \qquad\text{and}\qquad
r\_1 - r\_2 ... |
1,711,403 | Consider the quadratic equation $(a+c-b)x^2 + 2cx + b+c-a = 0 $ , where a,b,c are distinct real numbers and a+c-b is not equal to 0. Suppose that both the roots of the equation are rational . Then
a) a,b, and c are rational
b)$c/(a-b)$ is rational
c)$b/(c-a)$ is rational
d)$a/(b-c)$ is rational
My attempt - I ... | 2016/03/24 | [
"https://math.stackexchange.com/questions/1711403",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/312575/"
] | Notice that your polynomial $$(a+c-b)x^2 +2cx +(b+c-a) = (a+c-b) (x - \alpha)(x - \beta) =$$
$$=(a+c-b)x^2 - (a+c-b)(\alpha + \beta) x + (a+c-b)\alpha \beta$$
where $\alpha, \beta$ are the rational roots.
Now, the coefficient of $x$ must be equal
$$2c = -(a+c-b)(\alpha + \beta)$$
and with some algebra you get
$$\frac{... | The roots are
$$\frac{-2c\pm \sqrt{4c^2 - 4(c+(a-b))(c-(a-b))}}{2(a+c-b)}$$
$$=\frac{-c\pm (a-b)}{a+c-b}$$
$=\frac{a-b-c}{a-b+c}$ or $\frac{-a+b-c}{a-b+c}=-1$
For the first root,
$$=\frac{a-b+c-2c}{a-b+c}=1-\frac{2c}{a-b+c}$$
So $\frac{2c}{a-b+c}$ is rational, so its inverse is also rational
$\frac{a-b+c}{2c}=\f... |
1,711,403 | Consider the quadratic equation $(a+c-b)x^2 + 2cx + b+c-a = 0 $ , where a,b,c are distinct real numbers and a+c-b is not equal to 0. Suppose that both the roots of the equation are rational . Then
a) a,b, and c are rational
b)$c/(a-b)$ is rational
c)$b/(c-a)$ is rational
d)$a/(b-c)$ is rational
My attempt - I ... | 2016/03/24 | [
"https://math.stackexchange.com/questions/1711403",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/312575/"
] | Note that, when $x=-1$, we get
$$
(a+c-b)-2c+(b+c-a)=0
$$
so $-1$ is a root for every choice of the parameters $a$, $b$ and $c$. Even if $a+c-b=0$, that would give $c/(a-b)=-1$.
This leads into checking option b. So, suppose $a+c-b\ne0$. The factorization of the polynomial is
$$
(x+1)\bigl((a+c-b)x+c-a+b\bigr)
$$
so t... | Reduce this to a monic form:
$$
x^2+\frac{2c}{a+c-b}x+\frac{b+c-a}{a+c-b}
$$
then as the roots are rational so are the sum and product of the roots, so both $\frac{2c}{a+c-b}$ and $\frac{b+c-a}{a+c-b}$ are rational and so $\frac{c}{b+c-a}$ is also rational, and you should be able to take it from there. |
1,711,403 | Consider the quadratic equation $(a+c-b)x^2 + 2cx + b+c-a = 0 $ , where a,b,c are distinct real numbers and a+c-b is not equal to 0. Suppose that both the roots of the equation are rational . Then
a) a,b, and c are rational
b)$c/(a-b)$ is rational
c)$b/(c-a)$ is rational
d)$a/(b-c)$ is rational
My attempt - I ... | 2016/03/24 | [
"https://math.stackexchange.com/questions/1711403",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/312575/"
] | We know that your two roots are rational:
$$
r\_1 = \frac{-2c + (a - b)}{2(a - b + c)} \in \mathbb Q \qquad\text{and}\qquad
r\_2 = \frac{-2c - (a - b)}{2(a - b + c)} \in \mathbb Q
$$
Hence, their sum and difference are also rational:
$$
r\_1 + r\_2 = \frac{c}{a - b + c} \in \mathbb Q \qquad\text{and}\qquad
r\_1 - r\_2 ... | Reduce this to a monic form:
$$
x^2+\frac{2c}{a+c-b}x+\frac{b+c-a}{a+c-b}
$$
then as the roots are rational so are the sum and product of the roots, so both $\frac{2c}{a+c-b}$ and $\frac{b+c-a}{a+c-b}$ are rational and so $\frac{c}{b+c-a}$ is also rational, and you should be able to take it from there. |
1,711,403 | Consider the quadratic equation $(a+c-b)x^2 + 2cx + b+c-a = 0 $ , where a,b,c are distinct real numbers and a+c-b is not equal to 0. Suppose that both the roots of the equation are rational . Then
a) a,b, and c are rational
b)$c/(a-b)$ is rational
c)$b/(c-a)$ is rational
d)$a/(b-c)$ is rational
My attempt - I ... | 2016/03/24 | [
"https://math.stackexchange.com/questions/1711403",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/312575/"
] | The roots are
$$\frac{-2c\pm \sqrt{4c^2 - 4(c+(a-b))(c-(a-b))}}{2(a+c-b)}$$
$$=\frac{-c\pm (a-b)}{a+c-b}$$
$=\frac{a-b-c}{a-b+c}$ or $\frac{-a+b-c}{a-b+c}=-1$
For the first root,
$$=\frac{a-b+c-2c}{a-b+c}=1-\frac{2c}{a-b+c}$$
So $\frac{2c}{a-b+c}$ is rational, so its inverse is also rational
$\frac{a-b+c}{2c}=\f... | Reduce this to a monic form:
$$
x^2+\frac{2c}{a+c-b}x+\frac{b+c-a}{a+c-b}
$$
then as the roots are rational so are the sum and product of the roots, so both $\frac{2c}{a+c-b}$ and $\frac{b+c-a}{a+c-b}$ are rational and so $\frac{c}{b+c-a}$ is also rational, and you should be able to take it from there. |
3,865,090 | The height of something at point $(x,y)$ is given by a function $z(x,y)$
$z(x,y)=z\_0exp(-\alpha (x^2+y^2))$ where $z\_0$ and $\alpha$ are positive constants
a) At what location in the plane is the height the greatest.
My solution:
$grad (z) = -2az\_0 xexp(-\alpha (x^2+y^2)) \hat{e}\_x-2az\_0 yexp(-\alpha (x^2+y^2)... | 2020/10/14 | [
"https://math.stackexchange.com/questions/3865090",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/823725/"
] | Clearly, constant $g\equiv 0$ or $g\equiv 1$ both satisfy this relation.
Assume $g$ is not constant.
If $g(z)=g^2(-z)$, then $g(0)=g^2(0)$, and hence $g(0)=0$ or $1$.
A. If $g(0)=0$, then $g(z)=z^kf(z)$, for some positive integer $k$ and $f$ analytic in the unit disk, with $f(0)=a\ne 0$. In such case we have
$$
n^{-... | Iterating $g(z)=g^{2}(-z)$ we get $g(z)=g^{2^{n}}((-1)^{n} z)$. If $|g(z)| >1$ we get $|g(z)|=|g^{2^{n}}((-1)^{n} z)| \to \infty$ as $n \to \infty$ through even values , a contradiction. Hence $|g(z)| \leq 1$ for all $z$ Similarly, $|g(z)| <1$ would imply $g(z)=0$. If $|g(z)|=1$ for all $z$ then $g$ is a constant by MM... |
53,568 | What package can I use to make a table that looks like this one?
 | 2012/04/27 | [
"https://tex.stackexchange.com/questions/53568",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/379/"
] | David posted while I was working out my solution, which is very similar to his. Here is my contribution:

```
\documentclass{article}
\usepackage{colortbl}
\usepackage{MnSymbol}
\begin{document}
\sffamily
% --- define colors
\definecolor{dark}{rgb}{0.5,0.5,0.5}
\definecolor{light}... | This may get you started:

```
\documentclass{article}
\usepackage{colortbl}
\begin{document}
\begin{tabular}{
>{\columncolor[gray]{0.3}}l
>{\columncolor[gray]{0.9}}l
ll}
\multicolumn{4}{>{\columncolor[gray]{0.3}}l}{\color{white}Something}\\
a&\mu... |
52,886,322 | I tried to access my simple API call through POSTMAN. It didn't work whereas it is working in browser.
Tried after making changes in Database connection URL as below.
jdbc:mysql://localhost:3306/BLOG\_ERA?useSSL=false
Even it didn't work.
>
> WARN: Establishing SSL connection without server's identity
> verificat... | 2018/10/19 | [
"https://Stackoverflow.com/questions/52886322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10503545/"
] | This is a late answer but I struggled to replace "\u{ef}" in string as well. During debugging when hovered over string it showed presence of \u{ef} but when print in description it only showed space.
```
let str = "\u{ef} Some Title"
print(str) //" Some Title"
```
I tried `replacingOccurrences(of: "\u{ef}", with: "... | e.g. 1
```
let text = "\u{ef}\u{ef}\u{ef}\u{ef}哦哦哦"
let text1 = text.replacingOccurrences(of: "\u{fffc}", with: "", options: String.CompareOptions.literal, range: nil)
let text2 = text.replacingOccurrences(of: "\u{ef}", with: "", options: String.CompareOptions.literal, range: nil).trimmingCharacters(in: .whitespaces... |
52,886,322 | I tried to access my simple API call through POSTMAN. It didn't work whereas it is working in browser.
Tried after making changes in Database connection URL as below.
jdbc:mysql://localhost:3306/BLOG\_ERA?useSSL=false
Even it didn't work.
>
> WARN: Establishing SSL connection without server's identity
> verificat... | 2018/10/19 | [
"https://Stackoverflow.com/questions/52886322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10503545/"
] | In Xcode 10 Playground, string replaces for `\u{00EF}` is working.
```
var a = "#bb #cccc #ddddd\u{ef}"
a = a.replacingOccurrences(of: "\u{00EF}", with: "")
```
I hope that will work for you. | It,s working Please check again:
```
let a = "#bb #cccc #ddddd\u{ef}"
let text = a.trimmingCharacters(in: .whitespacesAndNewlines)
let textRemoved = text.replacingOccurrences(of: "\u{ef}", with: "", options: NSString.CompareOptions.literal, range:nil)
print(textRemoved)
```
[ //" Some Title"
```
I tried `replacingOccurrences(of: "\u{ef}", with: "... | i also faced same issue for **"\u{e2}"**. i have searched a lot but unable to find any answer. then i have tried below code , which works for me.
```
var newString = ""
for char in strMainString.unicodeScalars{
if char.isASCII{
newString += String(char)
}
}
```
Hope that will also work for you too. |
52,886,322 | I tried to access my simple API call through POSTMAN. It didn't work whereas it is working in browser.
Tried after making changes in Database connection URL as below.
jdbc:mysql://localhost:3306/BLOG\_ERA?useSSL=false
Even it didn't work.
>
> WARN: Establishing SSL connection without server's identity
> verificat... | 2018/10/19 | [
"https://Stackoverflow.com/questions/52886322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10503545/"
] | Similar to question but with `\u{e2}` symbol (fix is the same):
`\u{e2}` is not a character rather subset of UTF8 plane which starts with `0xE2` byte.
So look [here](https://www.utf8-chartable.de/unicode-utf8-table.pl?start=8192&number=128), E2 are general punctuation symbols.
There many symbols actually which starte... | It,s working Please check again:
```
let a = "#bb #cccc #ddddd\u{ef}"
let text = a.trimmingCharacters(in: .whitespacesAndNewlines)
let textRemoved = text.replacingOccurrences(of: "\u{ef}", with: "", options: NSString.CompareOptions.literal, range:nil)
print(textRemoved)
```
[ //" Some Title"
```
I tried `replacingOccurrences(of: "\u{ef}", with: "... | It,s working Please check again:
```
let a = "#bb #cccc #ddddd\u{ef}"
let text = a.trimmingCharacters(in: .whitespacesAndNewlines)
let textRemoved = text.replacingOccurrences(of: "\u{ef}", with: "", options: NSString.CompareOptions.literal, range:nil)
print(textRemoved)
```
[ //" Some Title"
```
I tried `replacingOccurrences(of: "\u{ef}", with: "... | Similar to question but with `\u{e2}` symbol (fix is the same):
`\u{e2}` is not a character rather subset of UTF8 plane which starts with `0xE2` byte.
So look [here](https://www.utf8-chartable.de/unicode-utf8-table.pl?start=8192&number=128), E2 are general punctuation symbols.
There many symbols actually which starte... |
52,886,322 | I tried to access my simple API call through POSTMAN. It didn't work whereas it is working in browser.
Tried after making changes in Database connection URL as below.
jdbc:mysql://localhost:3306/BLOG\_ERA?useSSL=false
Even it didn't work.
>
> WARN: Establishing SSL connection without server's identity
> verificat... | 2018/10/19 | [
"https://Stackoverflow.com/questions/52886322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10503545/"
] | i also faced same issue for **"\u{e2}"**. i have searched a lot but unable to find any answer. then i have tried below code , which works for me.
```
var newString = ""
for char in strMainString.unicodeScalars{
if char.isASCII{
newString += String(char)
}
}
```
Hope that will also work for you too. | It,s working Please check again:
```
let a = "#bb #cccc #ddddd\u{ef}"
let text = a.trimmingCharacters(in: .whitespacesAndNewlines)
let textRemoved = text.replacingOccurrences(of: "\u{ef}", with: "", options: NSString.CompareOptions.literal, range:nil)
print(textRemoved)
```
[ //" Some Title"
```
I tried `replacingOccurrences(of: "\u{ef}", with: "... | In Xcode 10 Playground, string replaces for `\u{00EF}` is working.
```
var a = "#bb #cccc #ddddd\u{ef}"
a = a.replacingOccurrences(of: "\u{00EF}", with: "")
```
I hope that will work for you. |
52,886,322 | I tried to access my simple API call through POSTMAN. It didn't work whereas it is working in browser.
Tried after making changes in Database connection URL as below.
jdbc:mysql://localhost:3306/BLOG\_ERA?useSSL=false
Even it didn't work.
>
> WARN: Establishing SSL connection without server's identity
> verificat... | 2018/10/19 | [
"https://Stackoverflow.com/questions/52886322",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10503545/"
] | e.g. 1
```
let text = "\u{ef}\u{ef}\u{ef}\u{ef}哦哦哦"
let text1 = text.replacingOccurrences(of: "\u{fffc}", with: "", options: String.CompareOptions.literal, range: nil)
let text2 = text.replacingOccurrences(of: "\u{ef}", with: "", options: String.CompareOptions.literal, range: nil).trimmingCharacters(in: .whitespaces... | It,s working Please check again:
```
let a = "#bb #cccc #ddddd\u{ef}"
let text = a.trimmingCharacters(in: .whitespacesAndNewlines)
let textRemoved = text.replacingOccurrences(of: "\u{ef}", with: "", options: NSString.CompareOptions.literal, range:nil)
print(textRemoved)
```
[ //" Some Title"
```
I tried `replacingOccurrences(of: "\u{ef}", with: "... | I tried the following and it worked like a charm:
```
replacingOccurrences(of: "�", with: " ", options: NSString.CompareOptions.literal, range: nil)
``` |
21,471,604 | I like `dplyr` for data manipulation, but I don't understand how to use it for programming. For example, to rescale some variables, we could do:
```
mutate(cars, speed.scaled = scale(speed), dist.scaled = scale(dist))
```
Very cool. But now suppose I want to write a function that uses `mutate` to scale all variables... | 2014/01/31 | [
"https://Stackoverflow.com/questions/21471604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/318752/"
] | Easy peasy: use `mutate_each(cars, funs(scale))` or `apply(cars, 2, scale)`. | This can be done in base R like this:
```
cars.scaled <- as.data.frame(scale(cars))
```
or
```
cars.scaled <- replace(cars, TRUE, lapply(cars, scale))
```
or
```
cars.scaled <- cars
cars.scaled[] <- lapply(cars, scale)
```
The first one above can be translated to work with `%>%` like this:
```
cars.scaled <- ... |
28,616,285 | I created two `GridViews: Members and Sponsors` respectively and provided a `total count` of these two groups of people. My problem is I have two buttons which open in Excel: **MemSpreadshtBTN** (Member) and **SPSpreadshtBTN** (Sponsor) and I could not figure out how to get the count just for Members and the other just... | 2015/02/19 | [
"https://Stackoverflow.com/questions/28616285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4550769/"
] | I can think of 4 things:
1. The browsers use a technique called JIT (Just In Time compilation) to accelerate the speed of execution for the most-used parts of your code. However, to detect which part is most used, browsers give it some time.
2. Laptops usually run the CPU at a lower speed to preserve battery. However,... | I doubt there is anything you could do but ... you could use each WebGL shader program at least once and draw each buffer once and that *might* help. See Alex's answer for reasons why it might not.
WebGL has lots of validation to do. Much of that validating happens lazily. One example is anytime you draw using `gl.dra... |
28,616,285 | I created two `GridViews: Members and Sponsors` respectively and provided a `total count` of these two groups of people. My problem is I have two buttons which open in Excel: **MemSpreadshtBTN** (Member) and **SPSpreadshtBTN** (Sponsor) and I could not figure out how to get the count just for Members and the other just... | 2015/02/19 | [
"https://Stackoverflow.com/questions/28616285",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4550769/"
] | I can think of 4 things:
1. The browsers use a technique called JIT (Just In Time compilation) to accelerate the speed of execution for the most-used parts of your code. However, to detect which part is most used, browsers give it some time.
2. Laptops usually run the CPU at a lower speed to preserve battery. However,... | Is it slow due to some network load issue ? ... or maxing out CPU ?
Distinguish between these causes by running top or some resource usage utility during this initial slow period
If your CPU is running hot you may be synthesizing vertices inefficiently. |
29,312 | If I have 8-bit parallel data being clocked out of a chip at 250MHz, is there some way I can buffer it? I only need to store about 1kB. Preferably this would be a FIFO. Does such a fast FIFO exist at a reasonable price ( | 2012/04/04 | [
"https://electronics.stackexchange.com/questions/29312",
"https://electronics.stackexchange.com",
"https://electronics.stackexchange.com/users/1024/"
] | You should be able to implement that in a suitable FPGA, using the internal block RAM. Xilinx has this app note:
<http://www.xilinx.com/support/documentation/white_papers/wp333.pdf>
It could probably be implemented in a cheaper device, with more work. | Even on FPGA, 250MHz (2Gbps in this case) is a very hard task to achieve. Better tell us what's the application and why do You need such speeds? It would be easier to construct 32bit words by taking 4x 8bit and lowering the clock speed 4 times. This would guarantee possible Fmax at the same cost of the internal memory.... |
34,602,794 | I want to change the color of my right bar button item from black to white. It is a button as a search icon. I have not coded the search implementation yet as I want to get the main interface completed first. I thought that I'd written the correct codes so it should appear as white, but it seems to still appear as blac... | 2016/01/05 | [
"https://Stackoverflow.com/questions/34602794",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | The problem was that the button was automatically set as custom. I refigured it to system. | **Setting Text Color For Normal Text:**
```
let uiBarButton = UIBarButtonItem(title: "Logout", style: .plain, target: self, action: #selector(logOutTapped))
uiBarButton.tintColor = UIColor.appColor
navigationItem.rightBarButtonItems = [uiBarButton]
```
**Setting Text Color For Attributed Text:**
```
let uiBarButton... |
34,602,794 | I want to change the color of my right bar button item from black to white. It is a button as a search icon. I have not coded the search implementation yet as I want to get the main interface completed first. I thought that I'd written the correct codes so it should appear as white, but it seems to still appear as blac... | 2016/01/05 | [
"https://Stackoverflow.com/questions/34602794",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | **SWIFT 4**
After you declare your custom barbuttonitem as an outlet:
```
@IBOutlet weak var yourBarButtonItem: UIBarButtonItem!
```
You can define your color however you like.
```
yourBarButtonItem.tintColor = .red
``` | **Setting Text Color For Normal Text:**
```
let uiBarButton = UIBarButtonItem(title: "Logout", style: .plain, target: self, action: #selector(logOutTapped))
uiBarButton.tintColor = UIColor.appColor
navigationItem.rightBarButtonItems = [uiBarButton]
```
**Setting Text Color For Attributed Text:**
```
let uiBarButton... |
73,738 | How can I get something like this to work?
```
// in a plugin / theme:
// This imaginary function will make WordPress think that the
// current request is a 404.
// Ideally this function could be ran anywhere, but realistically it
// will probably have to be before the template_redirect hook runs.
generate_404_someh... | 2012/11/23 | [
"https://wordpress.stackexchange.com/questions/73738",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/8305/"
] | ```
function generate_404_somehow() {
global $wp_query;
$wp_query->is_404 = true;
}
add_action('wp','generate_404_somehow');
```
Of course, that will send all of you page to the 404 template. I don't know what the conditions are that this should fire or not fire.
Or to be more cautious (see comments) ...
```
... | What seems to work:
```
global $wp_query;
$wp_query->set_404();
$wp_query->max_num_pages = 0; // stop theme from showing Next/Prev links
```
This seems to set the HTTP headers and load the right template (with `is_404()` being true). |
73,738 | How can I get something like this to work?
```
// in a plugin / theme:
// This imaginary function will make WordPress think that the
// current request is a 404.
// Ideally this function could be ran anywhere, but realistically it
// will probably have to be before the template_redirect hook runs.
generate_404_someh... | 2012/11/23 | [
"https://wordpress.stackexchange.com/questions/73738",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/8305/"
] | The other by s\_ha\_dum answers doesn't set the HTTP Header Status to *404 Not Found*. To do this adds `status_header( 404 )` to the function.
```
function generate_404_somehow() {
global $wp_query;
$wp_query->set_404();
status_header( 404 );
}
add_action('wp','generate_404_somehow');
```
* [WordPress Co... | What seems to work:
```
global $wp_query;
$wp_query->set_404();
$wp_query->max_num_pages = 0; // stop theme from showing Next/Prev links
```
This seems to set the HTTP headers and load the right template (with `is_404()` being true). |
73,738 | How can I get something like this to work?
```
// in a plugin / theme:
// This imaginary function will make WordPress think that the
// current request is a 404.
// Ideally this function could be ran anywhere, but realistically it
// will probably have to be before the template_redirect hook runs.
generate_404_someh... | 2012/11/23 | [
"https://wordpress.stackexchange.com/questions/73738",
"https://wordpress.stackexchange.com",
"https://wordpress.stackexchange.com/users/8305/"
] | ```
function generate_404_somehow() {
global $wp_query;
$wp_query->is_404 = true;
}
add_action('wp','generate_404_somehow');
```
Of course, that will send all of you page to the 404 template. I don't know what the conditions are that this should fire or not fire.
Or to be more cautious (see comments) ...
```
... | The other by s\_ha\_dum answers doesn't set the HTTP Header Status to *404 Not Found*. To do this adds `status_header( 404 )` to the function.
```
function generate_404_somehow() {
global $wp_query;
$wp_query->set_404();
status_header( 404 );
}
add_action('wp','generate_404_somehow');
```
* [WordPress Co... |
30,119,205 | I have the following HQL:
```
select r from Route r where r.startingStop.description = 'Railway Station'
```
Now, I have modified my HQL to:
```
select r from Route r where r.startingStop.description = 'Railway Station' or r.destinationStop.description = 'Railway Station'
```
And I get the following exception:
`... | 2015/05/08 | [
"https://Stackoverflow.com/questions/30119205",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3726217/"
] | Customise the caret to always update its position.
```
final DefaultCaret caret = new DefaultCaret();
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
text.setCaret(caret);
```
From the DefaultCaret JavaDoc
>
> The following update policies are allowed:
>
>
> NEVER\_UPDATE: the caret stays at the same absolute... | Steve's solution with changing the default caret works very well, but there is also another solution and that is to execute all the key presses in the main thread like this:
```
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
// dispatch the event now
text.dispatchEvent(new KeyEvent(text... |
54,039 | I have seen two metrics used to measure the sharpness of a camera:
* [Perceptual megapixels](http://www.dxomark.com/Reviews/Looking-for-new-photo-gear-DxOMark-s-Perceptual-Megapixel-can-help-you), used on Dxomark.
* Number of lines the camera can resolve in a resolution chart.
However, these two sometimes give comple... | 2014/09/05 | [
"https://photo.stackexchange.com/questions/54039",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/22575/"
] | I'll just add, the two numbers measures different aspects.
Dxomark's "perceptual megapixel" are measuring both resolution and contrast, hence the use of the word "perceptual". It's not the actually detail sharpness but how we as humans sees it on print in the size they uses for the measurements.
Dxomark is basically ... | Neither. MTF50 (The spatial frequency at which MTF drops to 50%) is.
find a source of test datathat uses the program Imatest for its measurements, because that uses MTF directly.
As for the measures you mentioned, to properly compare "perceptual megapixels" wrt sharpness/resolustion you need to take the square root b... |
54,039 | I have seen two metrics used to measure the sharpness of a camera:
* [Perceptual megapixels](http://www.dxomark.com/Reviews/Looking-for-new-photo-gear-DxOMark-s-Perceptual-Megapixel-can-help-you), used on Dxomark.
* Number of lines the camera can resolve in a resolution chart.
However, these two sometimes give comple... | 2014/09/05 | [
"https://photo.stackexchange.com/questions/54039",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/22575/"
] | >
> However, these two sometimes give completely different results. For example, the Lumix LF1 has a perceptual megapixel count of 3MP, while the Sony RX1 boasts 18MP -- a 6x difference.
>
>
> But when we compare the number of lines the camera can resolve on a resolution chart, a completely different picture emerges... | Neither. MTF50 (The spatial frequency at which MTF drops to 50%) is.
find a source of test datathat uses the program Imatest for its measurements, because that uses MTF directly.
As for the measures you mentioned, to properly compare "perceptual megapixels" wrt sharpness/resolustion you need to take the square root b... |
73,095 | I'd like to implement a simple class (in Java) that would allow me to register and deregister strings, and on the basis of the current set of strings auto-complete a given string. So, the interface would be:
* void add(String)
* void remove(String)
* String complete(String)
What's the best way to do this in terms of ... | 2008/09/16 | [
"https://Stackoverflow.com/questions/73095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12547/"
] | It would have to be some kind of a List that you can maintain in sorted order. You would also have to write your own search algorithm that would give you the index of the first element in the list that matches your search pattern. Then iterate from that index until the first element that doesn't match and you have your... | Regular expressions. |
73,095 | I'd like to implement a simple class (in Java) that would allow me to register and deregister strings, and on the basis of the current set of strings auto-complete a given string. So, the interface would be:
* void add(String)
* void remove(String)
* String complete(String)
What's the best way to do this in terms of ... | 2008/09/16 | [
"https://Stackoverflow.com/questions/73095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12547/"
] | The datastructure you are after is called a Ternary Search Tree.
There's a great JavaWorld example at www.javaworld.com/javaworld/jw-02-2001/jw-0216-ternary.html | I have created a JQuery plugin called Simple AutoComplete, that allows you to add many autocomplete as you want on the same page, and to add filters with extra param, and execute a callback function to bring other params, like the id of the item.
See it at <http://www.idealmind.com.br/projetos/simple-autocomplete-jque... |
73,095 | I'd like to implement a simple class (in Java) that would allow me to register and deregister strings, and on the basis of the current set of strings auto-complete a given string. So, the interface would be:
* void add(String)
* void remove(String)
* String complete(String)
What's the best way to do this in terms of ... | 2008/09/16 | [
"https://Stackoverflow.com/questions/73095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12547/"
] | The datastructure you are after is called a Ternary Search Tree.
There's a great JavaWorld example at www.javaworld.com/javaworld/jw-02-2001/jw-0216-ternary.html | For those who stumble upon this question...
I just posted a [server-side autocomplete implementation](http://code.google.com/p/autocomplete-server/) on Google Code. The project includes a java library that can be integrated into existing applications and a standalone HTTP AJAX autocomplete server.
My hope is that en... |
73,095 | I'd like to implement a simple class (in Java) that would allow me to register and deregister strings, and on the basis of the current set of strings auto-complete a given string. So, the interface would be:
* void add(String)
* void remove(String)
* String complete(String)
What's the best way to do this in terms of ... | 2008/09/16 | [
"https://Stackoverflow.com/questions/73095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12547/"
] | you should consider to use a PATRICIA trie for the data structure. Search for 'patricia trie' on google and you'll find a lot of information... | Regular expressions. |
73,095 | I'd like to implement a simple class (in Java) that would allow me to register and deregister strings, and on the basis of the current set of strings auto-complete a given string. So, the interface would be:
* void add(String)
* void remove(String)
* String complete(String)
What's the best way to do this in terms of ... | 2008/09/16 | [
"https://Stackoverflow.com/questions/73095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12547/"
] | you should consider to use a PATRICIA trie for the data structure. Search for 'patricia trie' on google and you'll find a lot of information... | I have created a JQuery plugin called Simple AutoComplete, that allows you to add many autocomplete as you want on the same page, and to add filters with extra param, and execute a callback function to bring other params, like the id of the item.
See it at <http://www.idealmind.com.br/projetos/simple-autocomplete-jque... |
73,095 | I'd like to implement a simple class (in Java) that would allow me to register and deregister strings, and on the basis of the current set of strings auto-complete a given string. So, the interface would be:
* void add(String)
* void remove(String)
* String complete(String)
What's the best way to do this in terms of ... | 2008/09/16 | [
"https://Stackoverflow.com/questions/73095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12547/"
] | The datastructure you are after is called a Ternary Search Tree.
There's a great JavaWorld example at www.javaworld.com/javaworld/jw-02-2001/jw-0216-ternary.html | Regular expressions. |
73,095 | I'd like to implement a simple class (in Java) that would allow me to register and deregister strings, and on the basis of the current set of strings auto-complete a given string. So, the interface would be:
* void add(String)
* void remove(String)
* String complete(String)
What's the best way to do this in terms of ... | 2008/09/16 | [
"https://Stackoverflow.com/questions/73095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12547/"
] | you should consider to use a PATRICIA trie for the data structure. Search for 'patricia trie' on google and you'll find a lot of information... | For those who stumble upon this question...
I just posted a [server-side autocomplete implementation](http://code.google.com/p/autocomplete-server/) on Google Code. The project includes a java library that can be integrated into existing applications and a standalone HTTP AJAX autocomplete server.
My hope is that en... |
73,095 | I'd like to implement a simple class (in Java) that would allow me to register and deregister strings, and on the basis of the current set of strings auto-complete a given string. So, the interface would be:
* void add(String)
* void remove(String)
* String complete(String)
What's the best way to do this in terms of ... | 2008/09/16 | [
"https://Stackoverflow.com/questions/73095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12547/"
] | The datastructure you are after is called a Ternary Search Tree.
There's a great JavaWorld example at www.javaworld.com/javaworld/jw-02-2001/jw-0216-ternary.html | It would have to be some kind of a List that you can maintain in sorted order. You would also have to write your own search algorithm that would give you the index of the first element in the list that matches your search pattern. Then iterate from that index until the first element that doesn't match and you have your... |
73,095 | I'd like to implement a simple class (in Java) that would allow me to register and deregister strings, and on the basis of the current set of strings auto-complete a given string. So, the interface would be:
* void add(String)
* void remove(String)
* String complete(String)
What's the best way to do this in terms of ... | 2008/09/16 | [
"https://Stackoverflow.com/questions/73095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12547/"
] | you should consider to use a PATRICIA trie for the data structure. Search for 'patricia trie' on google and you'll find a lot of information... | The datastructure you are after is called a Ternary Search Tree.
There's a great JavaWorld example at www.javaworld.com/javaworld/jw-02-2001/jw-0216-ternary.html |
73,095 | I'd like to implement a simple class (in Java) that would allow me to register and deregister strings, and on the basis of the current set of strings auto-complete a given string. So, the interface would be:
* void add(String)
* void remove(String)
* String complete(String)
What's the best way to do this in terms of ... | 2008/09/16 | [
"https://Stackoverflow.com/questions/73095",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12547/"
] | For those who stumble upon this question...
I just posted a [server-side autocomplete implementation](http://code.google.com/p/autocomplete-server/) on Google Code. The project includes a java library that can be integrated into existing applications and a standalone HTTP AJAX autocomplete server.
My hope is that en... | Regular expressions. |
18,264,715 | I'm creating a django app. Users login and are shown a static web page that is managed by the flatpages app.
Here are typical status messages from the dev server:
```
[15/Aug/2013 18:43:16] "GET / HTTP/1.1" 200 1263
[15/Aug/2013 18:43:23] "POST / HTTP/1.1" 302 0
[15/Aug/2013 18:43:23] "GET /home HTTP/1.1" 301 0
[... | 2013/08/16 | [
"https://Stackoverflow.com/questions/18264715",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1009063/"
] | I can't see your url pattern for the home view. But it's probably the missing slash which makes django send out a auto-redirect:
<https://docs.djangoproject.com/en/dev/ref/settings/#append-slash>
>
> Is my web client sending the request underling the fourth line? How
> does it know to do this?
>
>
>
Yes, [Statu... | Based on user640916's hint, here's how I cleaned up the errors.
To urls.py, I added:
```
url(r'^home$', 'guide.views.home'),
```
To views.py, I added:
```
from django.contrib.flatpages.views import flatpage
def home(request):
return flatpage(request, "/home/")
```
My server status messages for login now loo... |
18,264,715 | I'm creating a django app. Users login and are shown a static web page that is managed by the flatpages app.
Here are typical status messages from the dev server:
```
[15/Aug/2013 18:43:16] "GET / HTTP/1.1" 200 1263
[15/Aug/2013 18:43:23] "POST / HTTP/1.1" 302 0
[15/Aug/2013 18:43:23] "GET /home HTTP/1.1" 301 0
[... | 2013/08/16 | [
"https://Stackoverflow.com/questions/18264715",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1009063/"
] | I can't see your url pattern for the home view. But it's probably the missing slash which makes django send out a auto-redirect:
<https://docs.djangoproject.com/en/dev/ref/settings/#append-slash>
>
> Is my web client sending the request underling the fourth line? How
> does it know to do this?
>
>
>
Yes, [Statu... | I can't comment or upvote, but wanted to add for others that [beluga.me](https://stackoverflow.com/users/640916/beluga-me) at <https://stackoverflow.com/a/18265990/4651336> was spot on and I was missing a trailing slash after my success\_url.
This:
```
success_url = 'step-two'
```
changed to:
```
success_url = 'st... |
4,196,080 | I'm developing a Java desktop app and was wondering what are the best practices for logging bugs and exceptions. I'd like to log the exceptions in a file that's sent to me when there's a problem.
Are there any good frameworks for doing this or is it a retarded idea?
Thanks a lot
Elsanto 696 | 2010/11/16 | [
"https://Stackoverflow.com/questions/4196080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/509720/"
] | [log4j](http://logging.apache.org/log4j/index.html) is the de facto standard (with the standard [Java logging framework](http://download.oracle.com/javase/6/docs/technotes/guides/logging/) a close second).
You should use Version 1.2.x for production use.
You can configure log4j via code (at runtime) or via a configur... | Java4 Logging works pretty well, though it lacks some of the features in Log4j. The real problem is sending data from a user's PC to you directly - you would probably have to get their permission for this. The usual approach is to log to a file, and have the user give you that file in the event that there is a problem. |
4,196,080 | I'm developing a Java desktop app and was wondering what are the best practices for logging bugs and exceptions. I'd like to log the exceptions in a file that's sent to me when there's a problem.
Are there any good frameworks for doing this or is it a retarded idea?
Thanks a lot
Elsanto 696 | 2010/11/16 | [
"https://Stackoverflow.com/questions/4196080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/509720/"
] | [log4J is better framework to log](http://logging.apache.org/log4j/)
[Here is good tutorial and article on log4j](http://www.java-tips.org/java-tutorials/tutorials/log4j-revealing-the-full-power-part2.html) | Java4 Logging works pretty well, though it lacks some of the features in Log4j. The real problem is sending data from a user's PC to you directly - you would probably have to get their permission for this. The usual approach is to log to a file, and have the user give you that file in the event that there is a problem. |
4,196,080 | I'm developing a Java desktop app and was wondering what are the best practices for logging bugs and exceptions. I'd like to log the exceptions in a file that's sent to me when there's a problem.
Are there any good frameworks for doing this or is it a retarded idea?
Thanks a lot
Elsanto 696 | 2010/11/16 | [
"https://Stackoverflow.com/questions/4196080",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/509720/"
] | There are various [Java Logging Frameworks](http://en.wikipedia.org/wiki/Java_logging_framework) out there. Pick one!
* [Log4J](http://logging.apache.org/log4j/).
* [SLF4J](http://www.slf4j.org/).
* [LogBack](http://logback.qos.ch/).
* [java.util.logging](http://download.oracle.com/javase/6/docs/api/java/util/logging/... | Java4 Logging works pretty well, though it lacks some of the features in Log4j. The real problem is sending data from a user's PC to you directly - you would probably have to get their permission for this. The usual approach is to log to a file, and have the user give you that file in the event that there is a problem. |
50,704,772 | My Android app uses Firebase Cloud Messaging for notifications. When notifications come in, the icon isn't turned white like the other icons.
[](https://i.stack.imgur.com/H4nWL.png)
I'm using `targetSdkVersion 23`.
I have this in my manifest:
```
... | 2018/06/05 | [
"https://Stackoverflow.com/questions/50704772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/980059/"
] | Take a look at the icon in the SVG designer. Have you assigned a colour to it or is it showing white there? | Try [this](https://stackoverflow.com/a/37332514/5544859).
then set your resource to white: android:resource="@color/google\_white" |
50,704,772 | My Android app uses Firebase Cloud Messaging for notifications. When notifications come in, the icon isn't turned white like the other icons.
[](https://i.stack.imgur.com/H4nWL.png)
I'm using `targetSdkVersion 23`.
I have this in my manifest:
```
... | 2018/06/05 | [
"https://Stackoverflow.com/questions/50704772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/980059/"
] | As suggested by Will Jones, the solution was to use a SVG file and convert it to XML using this: <http://inloop.github.io/svg2android/>. I then copied the file to `android/app/src/main/res/drawable/notification_icon.xml` and deleted the old PNG file.
The icon now renders properly. | Take a look at the icon in the SVG designer. Have you assigned a colour to it or is it showing white there? |
50,704,772 | My Android app uses Firebase Cloud Messaging for notifications. When notifications come in, the icon isn't turned white like the other icons.
[](https://i.stack.imgur.com/H4nWL.png)
I'm using `targetSdkVersion 23`.
I have this in my manifest:
```
... | 2018/06/05 | [
"https://Stackoverflow.com/questions/50704772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/980059/"
] | Take a look at the icon in the SVG designer. Have you assigned a colour to it or is it showing white there? | One option is to use the [Notification icon generator](https://romannurik.github.io/AndroidAssetStudio/icons-notification.html#source.type=clipart&source.clipart=ac_unit&source.space.trim=1&source.space.pad=0&name=ic_stat_ac_unit) |
50,704,772 | My Android app uses Firebase Cloud Messaging for notifications. When notifications come in, the icon isn't turned white like the other icons.
[](https://i.stack.imgur.com/H4nWL.png)
I'm using `targetSdkVersion 23`.
I have this in my manifest:
```
... | 2018/06/05 | [
"https://Stackoverflow.com/questions/50704772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/980059/"
] | Take a look at the icon in the SVG designer. Have you assigned a colour to it or is it showing white there? | I'm a bit late but try to add this to your manifest
```
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/notification_icon_color" />
``` |
50,704,772 | My Android app uses Firebase Cloud Messaging for notifications. When notifications come in, the icon isn't turned white like the other icons.
[](https://i.stack.imgur.com/H4nWL.png)
I'm using `targetSdkVersion 23`.
I have this in my manifest:
```
... | 2018/06/05 | [
"https://Stackoverflow.com/questions/50704772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/980059/"
] | Take a look at the icon in the SVG designer. Have you assigned a colour to it or is it showing white there? | In my case I have an ionic project, so the answer of [@Flavien](https://stackoverflow.com/a/50705271/3026105) is correct but instead of:
```
android/app/src/main/res/drawable/notification_icon.xml
```
You need to write without the .xml suffix, like this:
```
android/app/src/main/res/drawable/notification_icon
``` |
50,704,772 | My Android app uses Firebase Cloud Messaging for notifications. When notifications come in, the icon isn't turned white like the other icons.
[](https://i.stack.imgur.com/H4nWL.png)
I'm using `targetSdkVersion 23`.
I have this in my manifest:
```
... | 2018/06/05 | [
"https://Stackoverflow.com/questions/50704772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/980059/"
] | As suggested by Will Jones, the solution was to use a SVG file and convert it to XML using this: <http://inloop.github.io/svg2android/>. I then copied the file to `android/app/src/main/res/drawable/notification_icon.xml` and deleted the old PNG file.
The icon now renders properly. | Try [this](https://stackoverflow.com/a/37332514/5544859).
then set your resource to white: android:resource="@color/google\_white" |
50,704,772 | My Android app uses Firebase Cloud Messaging for notifications. When notifications come in, the icon isn't turned white like the other icons.
[](https://i.stack.imgur.com/H4nWL.png)
I'm using `targetSdkVersion 23`.
I have this in my manifest:
```
... | 2018/06/05 | [
"https://Stackoverflow.com/questions/50704772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/980059/"
] | As suggested by Will Jones, the solution was to use a SVG file and convert it to XML using this: <http://inloop.github.io/svg2android/>. I then copied the file to `android/app/src/main/res/drawable/notification_icon.xml` and deleted the old PNG file.
The icon now renders properly. | One option is to use the [Notification icon generator](https://romannurik.github.io/AndroidAssetStudio/icons-notification.html#source.type=clipart&source.clipart=ac_unit&source.space.trim=1&source.space.pad=0&name=ic_stat_ac_unit) |
50,704,772 | My Android app uses Firebase Cloud Messaging for notifications. When notifications come in, the icon isn't turned white like the other icons.
[](https://i.stack.imgur.com/H4nWL.png)
I'm using `targetSdkVersion 23`.
I have this in my manifest:
```
... | 2018/06/05 | [
"https://Stackoverflow.com/questions/50704772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/980059/"
] | As suggested by Will Jones, the solution was to use a SVG file and convert it to XML using this: <http://inloop.github.io/svg2android/>. I then copied the file to `android/app/src/main/res/drawable/notification_icon.xml` and deleted the old PNG file.
The icon now renders properly. | I'm a bit late but try to add this to your manifest
```
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/notification_icon_color" />
``` |
50,704,772 | My Android app uses Firebase Cloud Messaging for notifications. When notifications come in, the icon isn't turned white like the other icons.
[](https://i.stack.imgur.com/H4nWL.png)
I'm using `targetSdkVersion 23`.
I have this in my manifest:
```
... | 2018/06/05 | [
"https://Stackoverflow.com/questions/50704772",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/980059/"
] | As suggested by Will Jones, the solution was to use a SVG file and convert it to XML using this: <http://inloop.github.io/svg2android/>. I then copied the file to `android/app/src/main/res/drawable/notification_icon.xml` and deleted the old PNG file.
The icon now renders properly. | In my case I have an ionic project, so the answer of [@Flavien](https://stackoverflow.com/a/50705271/3026105) is correct but instead of:
```
android/app/src/main/res/drawable/notification_icon.xml
```
You need to write without the .xml suffix, like this:
```
android/app/src/main/res/drawable/notification_icon
``` |
3,361,964 | I don't know what I have done wrong but it seems pretty major yet I can't figure it out. I'm using Eclipse Helios to create a RCP / RAP application. I downloaded and installed the RCP / RAP IDE and I could previously launch RAP applications (although there were some runtime exceptions about something missing). Now when... | 2010/07/29 | [
"https://Stackoverflow.com/questions/3361964",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/367796/"
] | by the looks of it, the RAP/RCP eclipse download did not include the required RAP target. I searched for the org.eclipse.rap.ui plugin, and its not in there. I would have expected it to be in a separate folder or something.
The RAP target can be obtained from here;
<http://www.eclipse.org/rap/downloads/>
I had to down... | It seems the RAP UI plugin is missing from your install.
First look at the plugins folder of your Helios install and check the presence of the `org.eclipse.rap.ui` plugin.
If not present, download again Helios RCP / RAP ide. It must be present otherwise there is a problem at eclipse.org but I am sure this is almost i... |
20,728,355 | ### Jasmine AngularJS test (passes in `karma start configs/karma.conf.js`)
```
describe('IndexController', function () {
beforeEach(module('myApp'));
var ctrl, scope;
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$new();
ctrl = $controller('IndexController', {
... | 2013/12/22 | [
"https://Stackoverflow.com/questions/20728355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/587021/"
] | uninstall the app from the emulator and check in your run configuration about the running app and try with new emulator | Be sure you have selected in package explorer the app you want to run. Try to unistall the app from the emulator or create a new device on emulator. Hope this help. |
20,728,355 | ### Jasmine AngularJS test (passes in `karma start configs/karma.conf.js`)
```
describe('IndexController', function () {
beforeEach(module('myApp'));
var ctrl, scope;
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$new();
ctrl = $controller('IndexController', {
... | 2013/12/22 | [
"https://Stackoverflow.com/questions/20728355",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/587021/"
] | uninstall the app from the emulator and check in your run configuration about the running app and try with new emulator | 1. Check the Run configuration: Run->Run configuration. Under the Android tab, choose your project. If you run in Debug, you have similar option too.
2. Another similar case I saw, is that some application was installed, but the name was not updated. Verify the names of your application in both the strings.xml and the ... |
234,077 | I'm newbie in [Automator](https://en.wikipedia.org/wiki/Automator_(software)). There are many [examples](https://www.raywenderlich.com/58986/automator-for-mac-tutorial-and-examples) for simple actions.
But I could not find examples or [documentation](https://support.apple.com/en-us/HT2488) for launching some applicati... | 2016/04/07 | [
"https://apple.stackexchange.com/questions/234077",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/178767/"
] | Problem was solved using [this](https://stackoverflow.com/a/36475943/3226984) great answer.
Just follow 4 simple steps. | Open Automator and create a new folder action.
Choose a folder to watch. In my example it's a Mavericks installer thumb drive with the name *SystemUSBMav*.
Then add *Launch Application* from the Automator's library and choose an application to launch.
Save the folder action as *Launch on Mount*.
[). There are many [examples](https://www.raywenderlich.com/58986/automator-for-mac-tutorial-and-examples) for simple actions.
But I could not find examples or [documentation](https://support.apple.com/en-us/HT2488) for launching some applicati... | 2016/04/07 | [
"https://apple.stackexchange.com/questions/234077",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/178767/"
] | Elaborating on ShooTerKo's answer on Stack Overflow (the one Volodymyr Kulyk links to) I've written the following script that continues the Workflow if the triggeringVolumeName is found. That way the actual launch (or any other Workflow action) can be moved outside the Applescript:
1. Create a new Automator action of ... | Open Automator and create a new folder action.
Choose a folder to watch. In my example it's a Mavericks installer thumb drive with the name *SystemUSBMav*.
Then add *Launch Application* from the Automator's library and choose an application to launch.
Save the folder action as *Launch on Mount*.
[). There are many [examples](https://www.raywenderlich.com/58986/automator-for-mac-tutorial-and-examples) for simple actions.
But I could not find examples or [documentation](https://support.apple.com/en-us/HT2488) for launching some applicati... | 2016/04/07 | [
"https://apple.stackexchange.com/questions/234077",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/178767/"
] | Elaborating on ShooTerKo's answer on Stack Overflow (the one Volodymyr Kulyk links to) I've written the following script that continues the Workflow if the triggeringVolumeName is found. That way the actual launch (or any other Workflow action) can be moved outside the Applescript:
1. Create a new Automator action of ... | Problem was solved using [this](https://stackoverflow.com/a/36475943/3226984) great answer.
Just follow 4 simple steps. |
7,831,943 | I am working on a project with parsing JSON from url to ExpandableListView. Depending on the "status" tag value (active or pending) , will be placing records accordingly to to different groups "Active" and "Pending". Everything is working fine.
My Problem is when I click on a child inside the second group which shoul... | 2011/10/20 | [
"https://Stackoverflow.com/questions/7831943",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/526345/"
] | You have to use Adapter's `getChild(groupPosition, childPosition)` method to retrieve the instance of child and the cast it to your Map and get it working.
```
@Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
Toast.makeText(this, (St... | Try This:
```
@Override
public boolean onContextItemSelected(MenuItem item) {
ExpandableListContextMenuInfo info = (ExpandableListContextMenuInfo) item.getMenuInfo();
String title = ((TextView) info.targetView).getText().toString();
int type = ExpandableListView.getPackedPositionType(info.packedPosition)... |
7,831,943 | I am working on a project with parsing JSON from url to ExpandableListView. Depending on the "status" tag value (active or pending) , will be placing records accordingly to to different groups "Active" and "Pending". Everything is working fine.
My Problem is when I click on a child inside the second group which shoul... | 2011/10/20 | [
"https://Stackoverflow.com/questions/7831943",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/526345/"
] | You have to use Adapter's `getChild(groupPosition, childPosition)` method to retrieve the instance of child and the cast it to your Map and get it working.
```
@Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
Toast.makeText(this, (St... | The below isn't perfect but it works. It might be helpful to those who need to access the view without overriding the onChildClick method such as a custom dialog with an ExpandableListView.
```
ExpandableListView ellQuickKeys = (ExpandableListView) layout.findViewById(R.id.ellQuickKeys);
SimpleExpandableListA... |
118,839 | Does technology exist which allows you to take an instantanious snapshot of a drive?
At the moment, I am using `dd` which takes a few minutes to create an image of a usb drive to my hdd. Is it possible to somehow take a snapshot instead?
Not sure if this is technologically possible, but thought I should ask. | 2014/03/09 | [
"https://unix.stackexchange.com/questions/118839",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/4430/"
] | Such technology exists, but it you would have to format your USB device either with ZFS file system, or use a LVM instead of normal partitioning. Both of these solutions are incompatible with Windows use, so you wouldn't be able to use your USB stick on Windows computers anymore. | There are filesystems that have snapshot possibility (zfs or btrfs), but that doesn't copy any data at first. It creates a copy-on-write (lazy copy) on THE SAME drive.
So if you do want a copy on another drive, then `dd` is the most exact definition of a snapshot I can think of. Also, `dd` is loop-back mountable, so i... |
156,309 | My question is to print all possible codes for the string.
**Assume that value of a=1, b=2, c=3, d=4, .... z=26.**
**E.g. for *“1123”* possible codes are *aabc*, *kbc*, *alc*, *aaw*, *kw***
Here's what I could come up with.
```
private static void printCodes(String str, String ans) {
if (str.length() == 0) ... | 2017/02/25 | [
"https://codereview.stackexchange.com/questions/156309",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/-1/"
] | Your code is a reasonably neat use of recursion to solve the problem, and recursion is a good solution to this problem. I prefer it for people to make it obvious that a function is used recursively to prepare myself for what to expect, I tend to use "recursive" in the name. You don't show how you set up the recursive m... | Consider
```
private static void printCodes(String str, String ans) {
if (str.length() == 0) {
System.out.println(ans);
return;
}
char ch1 = str.charAt(0);
char code = (char) (ch1 - '1' + 'a');
printCodes(str.substring(1), ans + code);
if (... |
53,324 | Just wondering if ultralight aircraft in the United States have tail numbers like the larger general aviation aircraft have? | 2018/07/09 | [
"https://aviation.stackexchange.com/questions/53324",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/25068/"
] | Assuming that you mean an ultralight [as defined in part 103](https://aviation.stackexchange.com/q/38784/62), there is no requirement to be registered or have a tail number. [14 CFR 103.7(c) says](https://www.ecfr.gov/cgi-bin/text-idx?SID=ceced45748a48f2b57c3c6fe938f6067&mc=true&node=se14.2.103_17&rgn=div8):
>
> Notw... | In the USA: "ultralight aircraft" as in having an engine or two? Yes they do. Pretty sure anything larger than an 8 oz drone needs to be registered to fly in the US airspace. Hang gliders and parachutes are about the only thing not needing a tail number. I'm sure someone here can find the appropriate FAR paragraphs wit... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.