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
23,643
I draw on [this question](https://mathoverflow.net/questions/23614/math-history-books) to ask something that has always been a pet peeve of mine. It is very easy to find books about the history of mathematics, much less so if one wants books about the recent (say > 1850) one. Of course I know that this is difficult be...
2010/05/05
[ "https://mathoverflow.net/questions/23643", "https://mathoverflow.net", "https://mathoverflow.net/users/828/" ]
Here are a few books on the history of recent mathematics that I recommend: *A History of Algebraic and Differential Topology, 1900 - 1960* by Jean Dieudonne. *History of Topology* by I.M. James. *Reciprocity Laws: From Euler to Eisenstein* by Franz Lemmermeyer. *The Shaping of Arithmetic after C.F. Gauss's Disqui...
Mark Ronan's book, *Symmetry and the Monster*, deserves a mention. It is a very well-written, popular account of the classification of finite simple groups which even the experts can learn from.
23,643
I draw on [this question](https://mathoverflow.net/questions/23614/math-history-books) to ask something that has always been a pet peeve of mine. It is very easy to find books about the history of mathematics, much less so if one wants books about the recent (say > 1850) one. Of course I know that this is difficult be...
2010/05/05
[ "https://mathoverflow.net/questions/23643", "https://mathoverflow.net", "https://mathoverflow.net/users/828/" ]
Other examples (just to give an idea of the choice), thematic sample, with scholarly work, popular science, and other types : **Recent theorems** Four Colours Suffice: How the Map Problem Was Solved de Robin J. Wilson Proofs and Confirmations: The Story of the Alternating Sign Matrix Conjecture de David M. Bressoud,...
*The Nature and Growth of Modern Mathematics* written in 1970 by Edna E. Kramer is a good book that touches on a wide selection of topics - very similar to Kolmogorov, Aleksandrov, and Lavrent'ev's *Mathematics: its Content, Methods, and Meaning*.
40,243,348
I'm trying to extract data and write it directly in a database I created by phpmyadmin (wampServer). The data is growing each day and I must keep it uptoday, so I will run my prorammcode in a period of some days. And now my problem: how can I prevent identically entries? I tried it by names, ID, and URL. The proble...
2016/10/25
[ "https://Stackoverflow.com/questions/40243348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7056281/" ]
You have to find the very unique identifier of a game. You should have a look if steam provides a very unique id for games and use this id as identifier for a game. When I check the steam link of your url in code I can see an app ID per listed entry. The app id exists as tag-attribute in the top link `<a>` of a game en...
This is my Code-extract to check whether a game is already in the database: ``` String search = "SELECT * FROM spiel WHERE URL LIKE \"" + href + "\""; Statement checkIfAlreadyThere = conn.createStatement(); ResultSet rs = checkIfAlreadyThere.executeQuery(search); if(rs.next()) { System.out.println("Game already in...
40,243,348
I'm trying to extract data and write it directly in a database I created by phpmyadmin (wampServer). The data is growing each day and I must keep it uptoday, so I will run my prorammcode in a period of some days. And now my problem: how can I prevent identically entries? I tried it by names, ID, and URL. The proble...
2016/10/25
[ "https://Stackoverflow.com/questions/40243348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7056281/" ]
You have to find the very unique identifier of a game. You should have a look if steam provides a very unique id for games and use this id as identifier for a game. When I check the steam link of your url in code I can see an app ID per listed entry. The app id exists as tag-attribute in the top link `<a>` of a game en...
Ok, I made it, thanks to @Erik B from B, you gave me the right hint. And here is my solution code -extract: ``` String href = childNodes.get(j).attr("href"); String cutFirstpart = href.replaceAll("http://store.steampowered.com/app/", ""); String[] hrefSplit = cutFirstpart.split("/"); String uniqueID = hrefSplit[0]; in...
58,441,372
I have a delimited file in the below format: text1|12345|email@email.com|01-01-2020|1 Considering all the fields are sensitive data, i had written the following awk command to mask the first field with random data. ``` awk -F'|' -v cmd="strings /dev/urandom | tr -dc '0-9' | fold -w 5" 'BEGIN {OFS=FS} {cmd | getline ...
2019/10/17
[ "https://Stackoverflow.com/questions/58441372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12235396/" ]
Seems like you want to set the weight on the TextView so that it fills all available space. Can you try something like this? ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" xmlns:tools="http://schemas.andr...
Use `ImageView` with fix size and `TextView` with weight like this - ``` <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:layout_width="0dp" android:layout_height="wrap_content"...
58,441,372
I have a delimited file in the below format: text1|12345|email@email.com|01-01-2020|1 Considering all the fields are sensitive data, i had written the following awk command to mask the first field with random data. ``` awk -F'|' -v cmd="strings /dev/urandom | tr -dc '0-9' | fold -w 5" 'BEGIN {OFS=FS} {cmd | getline ...
2019/10/17
[ "https://Stackoverflow.com/questions/58441372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12235396/" ]
Seems like you want to set the weight on the TextView so that it fills all available space. Can you try something like this? ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" xmlns:tools="http://schemas.andr...
You have a few options to solve this problem: 1. Set weight to your `TextView`, optionally set fix width for `Space`, and optionally set fix width, height for `ImageView` ``` <TextView android:id="@+id/text" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_margin="20sp" ...
62,646,409
Why method f() is ambiguous in Derived? ``` class Base<T> { void f(T arg) { } } class Derived<S extends CharSequence> extends Base<String> { void f(S arg) { } // compiles OK so far !!! } Derived<String> obj = new Derived<>(); obj.f("hi"); // c.ERR: The method f(String) is ambiguous for the type Deri...
2020/06/29
[ "https://Stackoverflow.com/questions/62646409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8339668/" ]
The definition of the class `Base` means that method `f()` can accept parameters of any type. It can be not only String, but also Integer, Long, and actually an instance of any class. What class, it depends on generic parameter used when an instance of class `Base` is created. The definition of the class `Derived` all...
For the given case of `Base` class, ``` class Base<T> { void f(T arg) { } } ``` Your `Derived` class, ``` class Derived<S extends CharSequence> extends Base<String> { void f(S arg) { } } ``` doesn't override the `f()` method, but rather overloads the `f()` method because of type erasure. Hence, the `Derived...
1,245,617
I have a ajax javascript method that pulls data from a page etc. I want this process to run on a timed interval, say every minute. But I don't want it to loop forever, so max out at 3 times. What is the best way to implement this?
2009/08/07
[ "https://Stackoverflow.com/questions/1245617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68183/" ]
you can do with setInterval ``` var count = 0; var interval = setInterval(yourFunction(), 1000); function yourFunction (){ clearInterval(interval); if(count < 3){ count ++; interval = setInterval(yourFunction(), 1000); } // your code } ```
``` var testTimeInt = 3; function testTime(){ testTimeInt--; if(testTimeInt>0) setTimeOut("testTime()", 1000); } setTimeOut("testTime()", 1000); ```
1,245,617
I have a ajax javascript method that pulls data from a page etc. I want this process to run on a timed interval, say every minute. But I don't want it to loop forever, so max out at 3 times. What is the best way to implement this?
2009/08/07
[ "https://Stackoverflow.com/questions/1245617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68183/" ]
Like this: ``` var runCount = 0; function timerMethod() { runCount++; if(runCount > 3) clearInterval(timerId); //... } var timerId = setInterval(timerMethod, 60000); //60,000 milliseconds ```
Use setInterval, be sure to get a reference. ``` var X=setInterval(....); ``` Also, have a global counter ``` var c=0; ``` Inside the function called by the setIntervale do: ``` c++; if(c>3) window.clearInterval(X); ```
1,245,617
I have a ajax javascript method that pulls data from a page etc. I want this process to run on a timed interval, say every minute. But I don't want it to loop forever, so max out at 3 times. What is the best way to implement this?
2009/08/07
[ "https://Stackoverflow.com/questions/1245617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68183/" ]
Like this: ``` var runCount = 0; function timerMethod() { runCount++; if(runCount > 3) clearInterval(timerId); //... } var timerId = setInterval(timerMethod, 60000); //60,000 milliseconds ```
A closure-based solution, using `setInterval()` and `clearInterval()`: ``` // define a generic repeater var repeater = function(func, times, interval) { var ID = window.setInterval( function(times) { return function() { if (--times <= 0) window.clearInterval(ID); func(); } }(times), interval); ...
1,245,617
I have a ajax javascript method that pulls data from a page etc. I want this process to run on a timed interval, say every minute. But I don't want it to loop forever, so max out at 3 times. What is the best way to implement this?
2009/08/07
[ "https://Stackoverflow.com/questions/1245617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68183/" ]
To extend [Tomalak](https://stackoverflow.com/questions/1245617/want-a-javascript-function-to-run-every-minute-but-max-3-times/1245737#1245737) function: If you want to know how many cycles are left: ``` var repeater = function(func, times, interval) { window.setTimeout( function(times) { return function() { ...
``` var testTimeInt = 3; function testTime(){ testTimeInt--; if(testTimeInt>0) setTimeOut("testTime()", 1000); } setTimeOut("testTime()", 1000); ```
1,245,617
I have a ajax javascript method that pulls data from a page etc. I want this process to run on a timed interval, say every minute. But I don't want it to loop forever, so max out at 3 times. What is the best way to implement this?
2009/08/07
[ "https://Stackoverflow.com/questions/1245617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68183/" ]
Like this: ``` var runCount = 0; function timerMethod() { runCount++; if(runCount > 3) clearInterval(timerId); //... } var timerId = setInterval(timerMethod, 60000); //60,000 milliseconds ```
you can do with setInterval ``` var count = 0; var interval = setInterval(yourFunction(), 1000); function yourFunction (){ clearInterval(interval); if(count < 3){ count ++; interval = setInterval(yourFunction(), 1000); } // your code } ```
1,245,617
I have a ajax javascript method that pulls data from a page etc. I want this process to run on a timed interval, say every minute. But I don't want it to loop forever, so max out at 3 times. What is the best way to implement this?
2009/08/07
[ "https://Stackoverflow.com/questions/1245617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68183/" ]
A reusable approach ``` function setMaxExeuctionInterval( callback, delay, maxExecutions ) { var intervalCallback = function() { var self = intervalCallback; if ( 'undefined' == typeof self.executedIntervals ) { self.executedIntervals = 1; } if ( self.executedIntervals == maxExecutions ) ...
``` var testTimeInt = 3; function testTime(){ testTimeInt--; if(testTimeInt>0) setTimeOut("testTime()", 1000); } setTimeOut("testTime()", 1000); ```
1,245,617
I have a ajax javascript method that pulls data from a page etc. I want this process to run on a timed interval, say every minute. But I don't want it to loop forever, so max out at 3 times. What is the best way to implement this?
2009/08/07
[ "https://Stackoverflow.com/questions/1245617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68183/" ]
Like this: ``` var runCount = 0; function timerMethod() { runCount++; if(runCount > 3) clearInterval(timerId); //... } var timerId = setInterval(timerMethod, 60000); //60,000 milliseconds ```
You can use setInterval() and then inside the called function keep a count of how many times you've run the function and then clearInterval(). Or you can use setTimeout() and then inside the called function call setTimeout() again until you've done it 3 times.
1,245,617
I have a ajax javascript method that pulls data from a page etc. I want this process to run on a timed interval, say every minute. But I don't want it to loop forever, so max out at 3 times. What is the best way to implement this?
2009/08/07
[ "https://Stackoverflow.com/questions/1245617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68183/" ]
A closure-based solution, using `setInterval()` and `clearInterval()`: ``` // define a generic repeater var repeater = function(func, times, interval) { var ID = window.setInterval( function(times) { return function() { if (--times <= 0) window.clearInterval(ID); func(); } }(times), interval); ...
Use setInterval, be sure to get a reference. ``` var X=setInterval(....); ``` Also, have a global counter ``` var c=0; ``` Inside the function called by the setIntervale do: ``` c++; if(c>3) window.clearInterval(X); ```
1,245,617
I have a ajax javascript method that pulls data from a page etc. I want this process to run on a timed interval, say every minute. But I don't want it to loop forever, so max out at 3 times. What is the best way to implement this?
2009/08/07
[ "https://Stackoverflow.com/questions/1245617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68183/" ]
A closure-based solution, using `setInterval()` and `clearInterval()`: ``` // define a generic repeater var repeater = function(func, times, interval) { var ID = window.setInterval( function(times) { return function() { if (--times <= 0) window.clearInterval(ID); func(); } }(times), interval); ...
A reusable approach ``` function setMaxExeuctionInterval( callback, delay, maxExecutions ) { var intervalCallback = function() { var self = intervalCallback; if ( 'undefined' == typeof self.executedIntervals ) { self.executedIntervals = 1; } if ( self.executedIntervals == maxExecutions ) ...
1,245,617
I have a ajax javascript method that pulls data from a page etc. I want this process to run on a timed interval, say every minute. But I don't want it to loop forever, so max out at 3 times. What is the best way to implement this?
2009/08/07
[ "https://Stackoverflow.com/questions/1245617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68183/" ]
A reusable approach ``` function setMaxExeuctionInterval( callback, delay, maxExecutions ) { var intervalCallback = function() { var self = intervalCallback; if ( 'undefined' == typeof self.executedIntervals ) { self.executedIntervals = 1; } if ( self.executedIntervals == maxExecutions ) ...
You can use setInterval() and then inside the called function keep a count of how many times you've run the function and then clearInterval(). Or you can use setTimeout() and then inside the called function call setTimeout() again until you've done it 3 times.
201,525
I am making a 2D platformer in Unity and I programmed one of the enemies to move back and forth with the ping pong function. I would like to change the local scale depending on which direction the character is moving. I have tried using two if statements where if the x value of the transform is below or above a certa...
2022/06/29
[ "https://gamedev.stackexchange.com/questions/201525", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/163315/" ]
I am not a fan of coroutines, because they make it hard to reason what actually goes on in the code. I prefer to use a pattern like this: ``` public class MoveOnTrigger : MonoBehaviour { private bool isGoing; private float elapsedTime; public float desiredTime; void Update() { if (isGo...
Sounds like what you are looking for is [Coroutines](https://docs.unity3d.com/Manual/Coroutines.html). Basically, you would write whatever code you want to execute in a function that returns `IEnumerator`, like this: ``` public IEnumerator LetsGO() { elapsedTime = 0; float percentageComplete = elapsedTime / de...
6,115,580
I have this code: ``` FILE *f = fopen(intPath, "r"); Node *n; if (f) { try { n = parse(f, intPath); } catch (SyntaxError e) { fclose(f); /***** line 536 *****/ throw LangException( builtin_classes::exception_class::create_ImportError( String::fromAscii(e.file...
2011/05/24
[ "https://Stackoverflow.com/questions/6115580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1547225/" ]
``` throw LangException( builtin_classes::exception_class::create_ImportError( String::fromAscii(e.filename)-> append(String::fromAscii(":"))-> append(String::fromInt(e.line))-> append(String::fromAscii(":"))-> append(String::fromInt(e.col))-> append(String::fromAscii(": syntax er...
Your `(` and your `)` don't match in that large, first `throw LangException` block.
6,115,580
I have this code: ``` FILE *f = fopen(intPath, "r"); Node *n; if (f) { try { n = parse(f, intPath); } catch (SyntaxError e) { fclose(f); /***** line 536 *****/ throw LangException( builtin_classes::exception_class::create_ImportError( String::fromAscii(e.file...
2011/05/24
[ "https://Stackoverflow.com/questions/6115580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1547225/" ]
``` throw LangException( builtin_classes::exception_class::create_ImportError( String::fromAscii(e.filename)-> append(String::fromAscii(":"))-> append(String::fromInt(e.line))-> append(String::fromAscii(":"))-> append(String::fromInt(e.col))-> append(String::fromAscii(": syntax er...
The compiler tells you what is wrong. The `throw LangException(` doesn't have a `)`.
6,115,580
I have this code: ``` FILE *f = fopen(intPath, "r"); Node *n; if (f) { try { n = parse(f, intPath); } catch (SyntaxError e) { fclose(f); /***** line 536 *****/ throw LangException( builtin_classes::exception_class::create_ImportError( String::fromAscii(e.file...
2011/05/24
[ "https://Stackoverflow.com/questions/6115580", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1547225/" ]
``` throw LangException( builtin_classes::exception_class::create_ImportError( String::fromAscii(e.filename)-> append(String::fromAscii(":"))-> append(String::fromInt(e.line))-> append(String::fromAscii(":"))-> append(String::fromInt(e.col))-> append(String::fromAscii(": syntax er...
Exactly what it says. You are missing a `‘)’` before `‘;’` token on that line. ``` LangException(... ``` is not closed.
402,675
Are hard waves *crashing* on rocks? Do waves *collide* in the ocean?
2017/07/25
[ "https://english.stackexchange.com/questions/402675", "https://english.stackexchange.com", "https://english.stackexchange.com/users/249346/" ]
Crash as a transitive verb means "to break violently," MW. As an intransitive verb it means "to break or go to pieces with." Crash is an apt description of waves meeting rocks, and is commonly used. Collide means "to come together with solid impact," MW. Waves coming from two or more directions (wind conditions or a po...
Technically waves **pass through each other** in the ocean, its called "superimposition". They dont "collide", which also carries a sense that they impact and stop, or are broken, etc. There's no collision. But that may not be much help in writing nontechnically.
32,109,964
I am unable to install `.msi` files on any other computer or remote server. Is there any access type that should be given there? I am trying to copy then invoke command to run MSI file on the target system, but my path is not recognized. Copy folder from one to another setup: ``` Copy-Item "E:\tfs-13\Auto Upgrader S...
2015/08/20
[ "https://Stackoverflow.com/questions/32109964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5245961/" ]
Creating multiple threads helps performance only up to the number of cores you have since each thread can run in its own core and not affect the other. However you said they `do_work()` function writes to a record. If that variable is shared between the threads using a `mutex` in this case will horribly degrade perform...
Can you use OpenMP? Just add `#pragma omp parallel for` before loop and enable openmp support for the compiler
32,109,964
I am unable to install `.msi` files on any other computer or remote server. Is there any access type that should be given there? I am trying to copy then invoke command to run MSI file on the target system, but my path is not recognized. Copy folder from one to another setup: ``` Copy-Item "E:\tfs-13\Auto Upgrader S...
2015/08/20
[ "https://Stackoverflow.com/questions/32109964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5245961/" ]
Creating multiple threads helps performance only up to the number of cores you have since each thread can run in its own core and not affect the other. However you said they `do_work()` function writes to a record. If that variable is shared between the threads using a `mutex` in this case will horribly degrade perform...
This is a perfect candidate for threadpool. If you don't need to wait on the results, simple threadpool would suffice. If you need to wait on the results and do other stuff based on the results you need a future based pool. I wrote both versions of it in C++ for my work and I would be happy to share if you would like. ...
32,109,964
I am unable to install `.msi` files on any other computer or remote server. Is there any access type that should be given there? I am trying to copy then invoke command to run MSI file on the target system, but my path is not recognized. Copy folder from one to another setup: ``` Copy-Item "E:\tfs-13\Auto Upgrader S...
2015/08/20
[ "https://Stackoverflow.com/questions/32109964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5245961/" ]
A good approach would be to use a parallel algorithm, such as [TBB `parallel_for_each`](http://www.threadingbuildingblocks.org/docs/help/index.htm#reference/algorithms/parallel_for_each_func.htm). Under the hood it is going to create a (global) thread pool for you and schedule chunks-of-work/tasks across all available ...
Can you use OpenMP? Just add `#pragma omp parallel for` before loop and enable openmp support for the compiler
32,109,964
I am unable to install `.msi` files on any other computer or remote server. Is there any access type that should be given there? I am trying to copy then invoke command to run MSI file on the target system, but my path is not recognized. Copy folder from one to another setup: ``` Copy-Item "E:\tfs-13\Auto Upgrader S...
2015/08/20
[ "https://Stackoverflow.com/questions/32109964", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5245961/" ]
A good approach would be to use a parallel algorithm, such as [TBB `parallel_for_each`](http://www.threadingbuildingblocks.org/docs/help/index.htm#reference/algorithms/parallel_for_each_func.htm). Under the hood it is going to create a (global) thread pool for you and schedule chunks-of-work/tasks across all available ...
This is a perfect candidate for threadpool. If you don't need to wait on the results, simple threadpool would suffice. If you need to wait on the results and do other stuff based on the results you need a future based pool. I wrote both versions of it in C++ for my work and I would be happy to share if you would like. ...
237,378
For practicing purposes, I had the idea of making a sorting algorithm in Python. My approach to it was to iterate through a given unsorted list to find the shortest number in it, add the number to a second list, remove shortest number from unsorted list, do that until the unsorted list is empty and return the sorted l...
2020/02/16
[ "https://codereview.stackexchange.com/questions/237378", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/216350/" ]
Since the goal is the best possible implementation of this algorithm, I'd suggest the following. However, faster [algorithms](https://en.wikipedia.org/wiki/Sorting_algorithm) do exist. 1. To conform to [PEP8](https://www.python.org/dev/peps/pep-0008/) make sure you have two blank lines after your imports and surroundi...
Your code looks well-formatted, it's easy to read and to follow, and the explanation you gave matches the code exactly. Well done. :) ``` for item in my_list: ``` This statement looks strange since in the body of this `for` loop, you neither use `item` nor `my_list`. You can express the idea of that code more direct...
237,378
For practicing purposes, I had the idea of making a sorting algorithm in Python. My approach to it was to iterate through a given unsorted list to find the shortest number in it, add the number to a second list, remove shortest number from unsorted list, do that until the unsorted list is empty and return the sorted l...
2020/02/16
[ "https://codereview.stackexchange.com/questions/237378", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/216350/" ]
Since the goal is the best possible implementation of this algorithm, I'd suggest the following. However, faster [algorithms](https://en.wikipedia.org/wiki/Sorting_algorithm) do exist. 1. To conform to [PEP8](https://www.python.org/dev/peps/pep-0008/) make sure you have two blank lines after your imports and surroundi...
First I got same approach than previous answers (@Roland Illig & Luapulu) that are very similar. But then I remembered Item 72 of [Effective Python (Brett Slatkin's book)](https://effectivepython.com): > > 72: Consider Searching Sorted Sequences with bisect. Python’s built-in bisect module provides better ways to ac...
44,034,591
In Haskell there is a term `undefined :: a`, which is said to be a term representation of a bad computation or endless loop. Since `undefined` has type `a`, them it's possible to create any syntactic correct type by applying type substitutions. So `undefined` has any type and the o inverse is also true: any type has `...
2017/05/17
[ "https://Stackoverflow.com/questions/44034591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2638146/" ]
Yes, the logic is inconsistent. However, that does not mean that the type system is useless. For instance, the type system ensures we will never attempt to add integers and strings, or to project the first component out of a boolean. These usually are runtime type errors in some untyped languages. We still do have so...
> > If Haskell's type system is a inconsistent proof system, then we can't trust it? > > > As @chi alluded to, *type safety* is a much weaker condition than *logical consistency*. Quoting [*Types and Programming Languages*](https://www.cis.upenn.edu/~bcpierce/tapl/) (a good read if you're interested in this sort o...
47,792,596
I have about 700 .txt files scattered in 300 directories and sub-directories. I would like to open each of them, convert all text inside to lowercase, including Unicode characters (such as `É` to `é`), then save and close them. Can you advise how it could be done through PowerShell? It is my own computer and I have a...
2017/12/13
[ "https://Stackoverflow.com/questions/47792596", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4201845/" ]
Simple script, with your requirements: ``` $path=".\test\*.txt" #With Default system encoding Get-ChildItem $path -Recurse | foreach{ (Get-Content $_.FullName).ToLower() | Out-File $_.FullName } #Or with specified encoding Get-ChildItem $path -Recurse | foreach{ (Get-Content $_.FullName -Encoding Uni...
You need to use : ``` # Reading the file content and converting it to lowercase and finally putting the content back to the file with the same filename. (Get-Content C:\path\file.txt -Raw).ToLower() | Out-File C:\path\file.txt -Force ``` inside the foreach and then change the case to lower. If you want to iterate ...
64,369,919
I have this code but it looks weird. Authors and date are shifted a bit to the left and I want to center them. To center them using this element but I had no luck. ``` style="text-align: center;" ``` What can I do? ```html <base href="https://acanhs.org/" /> <style> img.article { float: left; width: ...
2020/10/15
[ "https://Stackoverflow.com/questions/64369919", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14449673/" ]
Your `<ul>` with class post-info seems to have a `default-padding` on the left. Just add `padding-left: 0;` to this class.
Your `ul` element is implementing a default left padding of 40px, causing the offset. Simply add a style to your `post-info` class that removes this: ``` ul.post-info { padding-left: 0; } ``` This SO post describes the same issue with the default padding on the `ul`: [Does UL have default margin or padding](htt...
64,369,919
I have this code but it looks weird. Authors and date are shifted a bit to the left and I want to center them. To center them using this element but I had no luck. ``` style="text-align: center;" ``` What can I do? ```html <base href="https://acanhs.org/" /> <style> img.article { float: left; width: ...
2020/10/15
[ "https://Stackoverflow.com/questions/64369919", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14449673/" ]
Your `<ul>` with class post-info seems to have a `default-padding` on the left. Just add `padding-left: 0;` to this class.
I went through your code and you want that div in the center, so I suggest you just add two more div beside your column div. it'll be in the center. ``` <div class=col-lg-2></div> <div class=col-lg-4></div> <div class=col-lg-4></div> <div class=col-lg-2></div> ```
172,059
I am working on a project which requires three different voltage levels - Motor that can run at 7-12 V. Hall sensor that can run at 5-25 V. nRF24L01+ that can run at 2-3.6 V and AVR (arduino) which can run at 2-5 V. Since battery life is a major concern, I think voltage regulators (specially the linear ones) will be a...
2015/05/23
[ "https://electronics.stackexchange.com/questions/172059", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/68606/" ]
In the end, the most simple solution is usually the best. Let's try to sort your needs out. 1) You need a beefy power supply for a motor, 12V-ish. Fine, you have this sorted out already. 2) You need to power the Hall sensor. Why not power it directly from 12V, if it's 5-25V rated? There can be 2 minor difficulties th...
If your hall-effect sensor is (are) digital (as opposed to linear), you can power it directly from the motor supply. Current consumption is very low and most digital hall-effect sensors have an open-drain output that goes LOW when the sensor is active. I'm assuming that your motor current is significantly higher than ...
21,286
I have a question about creating digital signatures for pdf files. I want to have a certificate for my company and have children certificates as many as the number of company's employees who can validate their signatures in pdf files. If I have a company certificate signed by, e.g., Verisign, can I use that certificat...
2012/10/08
[ "https://security.stackexchange.com/questions/21286", "https://security.stackexchange.com", "https://security.stackexchange.com/users/13837/" ]
AES only takes a key and an IV. The IV should be random and different for each encryption. Just prepend it to the ciphertext. I also strongly recommend adding authentication. Concerning passphrases, I'd avoid them where possible in favour of a simple random key. Keys are simple secure and avoid the cost of key derivat...
You should not be implementing the crypto yourself. Given your questions, there are too many things you could get wrong. Instead, [use a high-level library](https://security.stackexchange.com/a/2210/971) like GPG (to encrypt data at rest) or TLS (for data in motion). (If you were implementing your own, you [shouldn't ...
21,286
I have a question about creating digital signatures for pdf files. I want to have a certificate for my company and have children certificates as many as the number of company's employees who can validate their signatures in pdf files. If I have a company certificate signed by, e.g., Verisign, can I use that certificat...
2012/10/08
[ "https://security.stackexchange.com/questions/21286", "https://security.stackexchange.com", "https://security.stackexchange.com/users/13837/" ]
AES only takes a key and an IV. The IV should be random and different for each encryption. Just prepend it to the ciphertext. I also strongly recommend adding authentication. Concerning passphrases, I'd avoid them where possible in favour of a simple random key. Keys are simple secure and avoid the cost of key derivat...
The existing answers are great, but ignore one important aspect of your question: migration to new IVs, modes, and keys. The most straightforward way to do this is to add new columns to your database. One for an encryption key ID (a unique value to identify the encryption key used), one for the encryption algorithm, a...
21,286
I have a question about creating digital signatures for pdf files. I want to have a certificate for my company and have children certificates as many as the number of company's employees who can validate their signatures in pdf files. If I have a company certificate signed by, e.g., Verisign, can I use that certificat...
2012/10/08
[ "https://security.stackexchange.com/questions/21286", "https://security.stackexchange.com", "https://security.stackexchange.com/users/13837/" ]
AES only takes a key and an IV. The IV should be random and different for each encryption. Just prepend it to the ciphertext. I also strongly recommend adding authentication. Concerning passphrases, I'd avoid them where possible in favour of a simple random key. Keys are simple secure and avoid the cost of key derivat...
Generally, you create a new salt every time you re-encrypt whatever it is you're protecting with the salt (typically, a password). A new IV should be used *every* time you encrypt a message. Duplicate IVs should *never* be used, i.e., every encrypted message should use a different IV value. Passphrases are changed pe...
21,286
I have a question about creating digital signatures for pdf files. I want to have a certificate for my company and have children certificates as many as the number of company's employees who can validate their signatures in pdf files. If I have a company certificate signed by, e.g., Verisign, can I use that certificat...
2012/10/08
[ "https://security.stackexchange.com/questions/21286", "https://security.stackexchange.com", "https://security.stackexchange.com/users/13837/" ]
You should not be implementing the crypto yourself. Given your questions, there are too many things you could get wrong. Instead, [use a high-level library](https://security.stackexchange.com/a/2210/971) like GPG (to encrypt data at rest) or TLS (for data in motion). (If you were implementing your own, you [shouldn't ...
Generally, you create a new salt every time you re-encrypt whatever it is you're protecting with the salt (typically, a password). A new IV should be used *every* time you encrypt a message. Duplicate IVs should *never* be used, i.e., every encrypted message should use a different IV value. Passphrases are changed pe...
21,286
I have a question about creating digital signatures for pdf files. I want to have a certificate for my company and have children certificates as many as the number of company's employees who can validate their signatures in pdf files. If I have a company certificate signed by, e.g., Verisign, can I use that certificat...
2012/10/08
[ "https://security.stackexchange.com/questions/21286", "https://security.stackexchange.com", "https://security.stackexchange.com/users/13837/" ]
The existing answers are great, but ignore one important aspect of your question: migration to new IVs, modes, and keys. The most straightforward way to do this is to add new columns to your database. One for an encryption key ID (a unique value to identify the encryption key used), one for the encryption algorithm, a...
Generally, you create a new salt every time you re-encrypt whatever it is you're protecting with the salt (typically, a password). A new IV should be used *every* time you encrypt a message. Duplicate IVs should *never* be used, i.e., every encrypted message should use a different IV value. Passphrases are changed pe...
20,545,282
I have a table in my database called `Citites`. I want to retrieve all cities whose name contain any of the values from the `strings` list. ``` List<string> strings = new List<string>(new string[] {"burg", "wood", "town"} ); ``` I tried this but it will only match the exact value from the strings list. I need to fin...
2013/12/12
[ "https://Stackoverflow.com/questions/20545282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/536610/" ]
This will do what you need, assuming your LINQ provider supports it - since you did not mention what are you using, we can't test it. ``` List<City> cities = db.Cities.Where(c => strings.Any(s => c.name.Contains(s))); ``` --- In detail: for a single value (like `Capetown`) you would write ``` strings.Any(s => "Cap...
I'm not sure if it is supported by your LINQ-provider, but at least in LINQ-To-Objects this works: ``` List<City> cities = db.Cities.Where(c => strings.Any(s=> c.Name.Contains(s))); ```
20,545,282
I have a table in my database called `Citites`. I want to retrieve all cities whose name contain any of the values from the `strings` list. ``` List<string> strings = new List<string>(new string[] {"burg", "wood", "town"} ); ``` I tried this but it will only match the exact value from the strings list. I need to fin...
2013/12/12
[ "https://Stackoverflow.com/questions/20545282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/536610/" ]
Since you mention that your LINQ provider does not support .Any() in this context, here is a much more complicated code that builds the query expression dynamically. ``` var strings = new [] { "burg", "wood", "town" }; // just some sample data var cities = new[] { new City("Capetown"), new City("Hamburg"), new City("N...
I'm not sure if it is supported by your LINQ-provider, but at least in LINQ-To-Objects this works: ``` List<City> cities = db.Cities.Where(c => strings.Any(s=> c.Name.Contains(s))); ```
20,545,282
I have a table in my database called `Citites`. I want to retrieve all cities whose name contain any of the values from the `strings` list. ``` List<string> strings = new List<string>(new string[] {"burg", "wood", "town"} ); ``` I tried this but it will only match the exact value from the strings list. I need to fin...
2013/12/12
[ "https://Stackoverflow.com/questions/20545282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/536610/" ]
This will do what you need, assuming your LINQ provider supports it - since you did not mention what are you using, we can't test it. ``` List<City> cities = db.Cities.Where(c => strings.Any(s => c.name.Contains(s))); ``` --- In detail: for a single value (like `Capetown`) you would write ``` strings.Any(s => "Cap...
You need to check if the City name contains any of the string in the list, not the other way around: ``` protected bool ContainsSubstring(string cityName, List<string> strings) { foreach(string subString in strings) { if (cityName.Contains(subString)) return true; } return false; } ``` ... ``` List<City> citi...
20,545,282
I have a table in my database called `Citites`. I want to retrieve all cities whose name contain any of the values from the `strings` list. ``` List<string> strings = new List<string>(new string[] {"burg", "wood", "town"} ); ``` I tried this but it will only match the exact value from the strings list. I need to fin...
2013/12/12
[ "https://Stackoverflow.com/questions/20545282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/536610/" ]
This will do what you need, assuming your LINQ provider supports it - since you did not mention what are you using, we can't test it. ``` List<City> cities = db.Cities.Where(c => strings.Any(s => c.name.Contains(s))); ``` --- In detail: for a single value (like `Capetown`) you would write ``` strings.Any(s => "Cap...
If you find it with a lot of loops, try using FUNC<> which will be better (in performance). I have a sample for that : ``` List<string> _lookup = new List<string>() { "dE", "SE","yu" }; IEnumerable<string> _src = new List<string> { "DER","SER","YUR" }; Func<string, List<string>, bo...
20,545,282
I have a table in my database called `Citites`. I want to retrieve all cities whose name contain any of the values from the `strings` list. ``` List<string> strings = new List<string>(new string[] {"burg", "wood", "town"} ); ``` I tried this but it will only match the exact value from the strings list. I need to fin...
2013/12/12
[ "https://Stackoverflow.com/questions/20545282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/536610/" ]
This will do what you need, assuming your LINQ provider supports it - since you did not mention what are you using, we can't test it. ``` List<City> cities = db.Cities.Where(c => strings.Any(s => c.name.Contains(s))); ``` --- In detail: for a single value (like `Capetown`) you would write ``` strings.Any(s => "Cap...
``` var cities = from c in db.Cities.AsEnumerable() from s in strings where c.name.ToLower().Contains(s.ToLower()) select c.name; ```
20,545,282
I have a table in my database called `Citites`. I want to retrieve all cities whose name contain any of the values from the `strings` list. ``` List<string> strings = new List<string>(new string[] {"burg", "wood", "town"} ); ``` I tried this but it will only match the exact value from the strings list. I need to fin...
2013/12/12
[ "https://Stackoverflow.com/questions/20545282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/536610/" ]
This will do what you need, assuming your LINQ provider supports it - since you did not mention what are you using, we can't test it. ``` List<City> cities = db.Cities.Where(c => strings.Any(s => c.name.Contains(s))); ``` --- In detail: for a single value (like `Capetown`) you would write ``` strings.Any(s => "Cap...
Do you have the ability to call a stored proc or sql? - you could use SQL fulltextsearch, especially if you're searching multiple terms. It'd probably be a lot quicker than doing string comparisons in SQL. <http://technet.microsoft.com/en-us/library/ms142583.aspx> You could create your search terms by doing `string.J...
20,545,282
I have a table in my database called `Citites`. I want to retrieve all cities whose name contain any of the values from the `strings` list. ``` List<string> strings = new List<string>(new string[] {"burg", "wood", "town"} ); ``` I tried this but it will only match the exact value from the strings list. I need to fin...
2013/12/12
[ "https://Stackoverflow.com/questions/20545282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/536610/" ]
Since you mention that your LINQ provider does not support .Any() in this context, here is a much more complicated code that builds the query expression dynamically. ``` var strings = new [] { "burg", "wood", "town" }; // just some sample data var cities = new[] { new City("Capetown"), new City("Hamburg"), new City("N...
You need to check if the City name contains any of the string in the list, not the other way around: ``` protected bool ContainsSubstring(string cityName, List<string> strings) { foreach(string subString in strings) { if (cityName.Contains(subString)) return true; } return false; } ``` ... ``` List<City> citi...
20,545,282
I have a table in my database called `Citites`. I want to retrieve all cities whose name contain any of the values from the `strings` list. ``` List<string> strings = new List<string>(new string[] {"burg", "wood", "town"} ); ``` I tried this but it will only match the exact value from the strings list. I need to fin...
2013/12/12
[ "https://Stackoverflow.com/questions/20545282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/536610/" ]
Since you mention that your LINQ provider does not support .Any() in this context, here is a much more complicated code that builds the query expression dynamically. ``` var strings = new [] { "burg", "wood", "town" }; // just some sample data var cities = new[] { new City("Capetown"), new City("Hamburg"), new City("N...
If you find it with a lot of loops, try using FUNC<> which will be better (in performance). I have a sample for that : ``` List<string> _lookup = new List<string>() { "dE", "SE","yu" }; IEnumerable<string> _src = new List<string> { "DER","SER","YUR" }; Func<string, List<string>, bo...
20,545,282
I have a table in my database called `Citites`. I want to retrieve all cities whose name contain any of the values from the `strings` list. ``` List<string> strings = new List<string>(new string[] {"burg", "wood", "town"} ); ``` I tried this but it will only match the exact value from the strings list. I need to fin...
2013/12/12
[ "https://Stackoverflow.com/questions/20545282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/536610/" ]
Since you mention that your LINQ provider does not support .Any() in this context, here is a much more complicated code that builds the query expression dynamically. ``` var strings = new [] { "burg", "wood", "town" }; // just some sample data var cities = new[] { new City("Capetown"), new City("Hamburg"), new City("N...
``` var cities = from c in db.Cities.AsEnumerable() from s in strings where c.name.ToLower().Contains(s.ToLower()) select c.name; ```
20,545,282
I have a table in my database called `Citites`. I want to retrieve all cities whose name contain any of the values from the `strings` list. ``` List<string> strings = new List<string>(new string[] {"burg", "wood", "town"} ); ``` I tried this but it will only match the exact value from the strings list. I need to fin...
2013/12/12
[ "https://Stackoverflow.com/questions/20545282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/536610/" ]
Since you mention that your LINQ provider does not support .Any() in this context, here is a much more complicated code that builds the query expression dynamically. ``` var strings = new [] { "burg", "wood", "town" }; // just some sample data var cities = new[] { new City("Capetown"), new City("Hamburg"), new City("N...
Do you have the ability to call a stored proc or sql? - you could use SQL fulltextsearch, especially if you're searching multiple terms. It'd probably be a lot quicker than doing string comparisons in SQL. <http://technet.microsoft.com/en-us/library/ms142583.aspx> You could create your search terms by doing `string.J...
50,738,756
I am trying to write a Handler in an Activity that needs a reference to the activity. If I write like this ``` class MainActivity : AppCompatActivity() { private val mHandler = MainActivityHandler(this) class MainActivityHandler(val activity: MainActivity) : Handler() { override fun handleMessage(msg:...
2018/06/07
[ "https://Stackoverflow.com/questions/50738756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7171655/" ]
Its because the return type of `activity?.tv_logged` is (assuming its a `TextView` ) , TextView? . In Kotlin docs , where an alternative is proposed to checking `null` via `if` condition > > Your second option is the safe call operator, written ?. > b?.length > This returns b.length if b is not null, and null oth...
I understood this when I read the whole text at <https://kotlinlang.org/docs/reference/null-safety.html#safe-calls> This has nothing to do with WeakReference as I suspected. It happens because safe call operator returns a nullable type even when accessing non-nullable type properties. (The doc doesn't really specify t...
17,397,259
Is there any way of creating a loop that would do the task every 3 secs without using a sleep function For eg: ``` try { while (true) { System.out.println(new Date()); Thread.sleep(5 * 1000); } } catch (InterruptedException e) { e.printStackTrace(); } ``` But the problem while using sl...
2013/07/01
[ "https://Stackoverflow.com/questions/17397259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2471839/" ]
Use `java.util.TimerTask` ``` java.util.Timer t = new java.util.Timer(); t.schedule(new TimerTask() { @Override public void run() { System.out.println("This will run every 5 seconds"); } }, 5000, 5000); ``` If you are using a GUI, you can use the `javax.s...
Are you using some kind of UI? There are at least two timers available in Java; * [`javax.swing.Timer`](http://docs.oracle.com/javase/7/docs/api/javax/swing/Timer.html) * [`java.util.Timer`](http://docs.oracle.com/javase/7/docs/api/java/util/Timer.html) Which should be capable of achieving what you want There are ...
17,397,259
Is there any way of creating a loop that would do the task every 3 secs without using a sleep function For eg: ``` try { while (true) { System.out.println(new Date()); Thread.sleep(5 * 1000); } } catch (InterruptedException e) { e.printStackTrace(); } ``` But the problem while using sl...
2013/07/01
[ "https://Stackoverflow.com/questions/17397259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2471839/" ]
Use `java.util.TimerTask` ``` java.util.Timer t = new java.util.Timer(); t.schedule(new TimerTask() { @Override public void run() { System.out.println("This will run every 5 seconds"); } }, 5000, 5000); ``` If you are using a GUI, you can use the `javax.s...
You may use one of the implementation of [ScheduledExecutorService](http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ScheduledExecutorService.html) if you are Ok to move logic which you want to execute repeatedly inside a thread. Here is example from the link: ``` import static java.util.concurrent.Time...
52,509,206
I am using Spring-boot to develop an application. The reason I need to specify multiple main classes is that, my program runs as a 'tool'. By starting with different main classes, I can finish tasks. I currently specify one main class in this way: ``` <plugin> <groupId>org.codehaus.mojo</gr...
2018/09/26
[ "https://Stackoverflow.com/questions/52509206", "https://Stackoverflow.com", "https://Stackoverflow.com/users/697911/" ]
You can accomplish this with some tidy code. First, some dot-less data (I took the dots to be not necessary, correct me if I'm wrong): ``` x1 <- read.table(header=TRUE, stringsAsFactors=FALSE, text=' User Product A 1 A 2 A 3 B 1 B 3 B 4') x2 <- read.table(header=TRUE, stringsAsFactors=FALSE, text=' ...
Another answer that uses `dplyr` only and a loop would be: ``` library(dplyr) myFunction = function(df1, df2, user, group, product){ user = deparse(substitute(user)) product = deparse(substitute(product)) group = deparse(substitute(group)) answer = data.frame(User = as.character(df1[1, user])) for(i in uniqu...
52,509,206
I am using Spring-boot to develop an application. The reason I need to specify multiple main classes is that, my program runs as a 'tool'. By starting with different main classes, I can finish tasks. I currently specify one main class in this way: ``` <plugin> <groupId>org.codehaus.mojo</gr...
2018/09/26
[ "https://Stackoverflow.com/questions/52509206", "https://Stackoverflow.com", "https://Stackoverflow.com/users/697911/" ]
You can accomplish this with some tidy code. First, some dot-less data (I took the dots to be not necessary, correct me if I'm wrong): ``` x1 <- read.table(header=TRUE, stringsAsFactors=FALSE, text=' User Product A 1 A 2 A 3 B 1 B 3 B 4') x2 <- read.table(header=TRUE, stringsAsFactors=FALSE, text=' ...
Here's a solution using only `dplyr` and `tidyr` - ``` library(dplyr) library(tidyr) user_product <- data.frame(User = rep(LETTERS[1:2], each = 3), Product = c(1:3, 1, 3, 4)) group_product <- data.frame(Group = c("x1", "x1", "x1", "x2", "x2"), Product = c(1,2,4,1,3)) left_join(user_product, group_product, by = "Prod...
378,787
I Have a vector of n values and I have event that occurs occasionally throughout this vector. So I have ``` V1 = [300, 120, 450, 700, 880, 400, 100, 60, 44, 91] ``` and the indexes of the start and end of the event. So `indexes = [(2,4)]` means that the event start at position #2 (when the value was 450) and ended ...
2018/11/26
[ "https://stats.stackexchange.com/questions/378787", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/167757/" ]
If your data are continuous, then you can use a [Kolmogorov-Smirnov](https://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test) 2-sample test to test the hypothesis that they are the same. If your data are discrete, you can try the [Anderson-Darling](https://en.wikipedia.org/wiki/Anderson%E2%80%93Darling_test) test...
I took your data [![enter image description here](https://i.stack.imgur.com/Rmh5R.png)](https://i.stack.imgur.com/Rmh5R.png) and added an indicator series appropriately populated according to your hypothesis [![enter image description here](https://i.stack.imgur.com/muQA0.png)](https://i.stack.imgur.com/muQA0.png) . I ...
60,669,600
I'm building a spring boot project without web server,because I don't need it. I have run it by using `terminal` java -jar ) I wrote some method with annotation @Schedule like: ``` @Scheduled(initialDelay = 1000, fixedRate = 10000) public void goGetAll() { log.info("HELLO I AM RUNNING THIS SCHEDULE "); ...
2020/03/13
[ "https://Stackoverflow.com/questions/60669600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13056600/" ]
The problem with your code is you are continuing with the loop even when `visited[j]` is changed to `true` whereas you need to break the inner loop at this point. Do it as follows: ``` for (int j = 0; j < d.length(); j++) { if (c.charAt(i) == d.charAt(j) && visited[j] == false) { isAnagram = true; ...
In your code you should break the inner for loop when the condition "if (c.charAt(i) == d.charAt(j) && Visited[j]==false)" has been meet. Because it is still looping through the second stiring and if it will meet the same char one angain it will change the value of Visited[] to true two times, leading to an error. It t...
2,543,451
Recently I switched hosting from one provider to the other and I have problems displaying Cyrillic characters. The characters which are read from the database are displayed correctly, but characters which are hardcoded in the php file aren't (they are displayed as question marks). The files which contain the php sourc...
2010/03/30
[ "https://Stackoverflow.com/questions/2543451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295502/" ]
It had something to do with the encoding of the php files. The files were created using Windows Notepad and saved with utf-8 encoding. When I used Notepad2 to open the files, the encoding of the files was "utf-8 with signature". When I changed encoding to "utf-8", the text displayed correctly.
I have been fighting with this exact same problem as I'm trying to add a bit of french/german internationalization to a few controls on a widget. Characters with accents that are stored in my db print fine as UTF-8. However, characters that are hardcoded into arrays in PHP files either display as the black diamond wit...
2,543,451
Recently I switched hosting from one provider to the other and I have problems displaying Cyrillic characters. The characters which are read from the database are displayed correctly, but characters which are hardcoded in the php file aren't (they are displayed as question marks). The files which contain the php sourc...
2010/03/30
[ "https://Stackoverflow.com/questions/2543451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295502/" ]
It had something to do with the encoding of the php files. The files were created using Windows Notepad and saved with utf-8 encoding. When I used Notepad2 to open the files, the encoding of the files was "utf-8 with signature". When I changed encoding to "utf-8", the text displayed correctly.
The reason for your problem is often accidental re-encoding the script files by a programmer's editor. It isn't a good practice to hardcode strings which rely on encoding in your php files. Try switching your browser's encoding to find what encoding is used for hardcoded text, it might help you address the issue. Also...
2,543,451
Recently I switched hosting from one provider to the other and I have problems displaying Cyrillic characters. The characters which are read from the database are displayed correctly, but characters which are hardcoded in the php file aren't (they are displayed as question marks). The files which contain the php sourc...
2010/03/30
[ "https://Stackoverflow.com/questions/2543451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295502/" ]
Try placing a meta tag indicating the encoding in the head section: ``` <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ```
The problem seems quite strange. What's the form of these question marks? Is it black diamonds with questions or just plain question marks? First of all double check if your files are really `utf-8` encoded. Try to add this header to your code (above all output) ``` header('Content-Type: text/html; charset=ut...
2,543,451
Recently I switched hosting from one provider to the other and I have problems displaying Cyrillic characters. The characters which are read from the database are displayed correctly, but characters which are hardcoded in the php file aren't (they are displayed as question marks). The files which contain the php sourc...
2010/03/30
[ "https://Stackoverflow.com/questions/2543451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295502/" ]
Try placing a meta tag indicating the encoding in the head section: ``` <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ```
put this after connecting database: ``` mysql_query("SET NAMES UTF8"); ``` for mysqli ``` mysqli_query($connecDB,"SET NAMES UTF8"); ``` and in the header of the page: ``` <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ```
2,543,451
Recently I switched hosting from one provider to the other and I have problems displaying Cyrillic characters. The characters which are read from the database are displayed correctly, but characters which are hardcoded in the php file aren't (they are displayed as question marks). The files which contain the php sourc...
2010/03/30
[ "https://Stackoverflow.com/questions/2543451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295502/" ]
Try placing a meta tag indicating the encoding in the head section: ``` <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ```
My PHP module was exactly with same problem all text was like "?????????????????" And my code was written with Notepad++. I found the solution for the problem. The problem wasn't in the header charset or meta tag because the browser actually knows that it is the UTF-8 charset. I tried all encodings from the browser an...
2,543,451
Recently I switched hosting from one provider to the other and I have problems displaying Cyrillic characters. The characters which are read from the database are displayed correctly, but characters which are hardcoded in the php file aren't (they are displayed as question marks). The files which contain the php sourc...
2010/03/30
[ "https://Stackoverflow.com/questions/2543451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295502/" ]
My PHP module was exactly with same problem all text was like "?????????????????" And my code was written with Notepad++. I found the solution for the problem. The problem wasn't in the header charset or meta tag because the browser actually knows that it is the UTF-8 charset. I tried all encodings from the browser an...
I have been fighting with this exact same problem as I'm trying to add a bit of french/german internationalization to a few controls on a widget. Characters with accents that are stored in my db print fine as UTF-8. However, characters that are hardcoded into arrays in PHP files either display as the black diamond wit...
2,543,451
Recently I switched hosting from one provider to the other and I have problems displaying Cyrillic characters. The characters which are read from the database are displayed correctly, but characters which are hardcoded in the php file aren't (they are displayed as question marks). The files which contain the php sourc...
2010/03/30
[ "https://Stackoverflow.com/questions/2543451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295502/" ]
My PHP module was exactly with same problem all text was like "?????????????????" And my code was written with Notepad++. I found the solution for the problem. The problem wasn't in the header charset or meta tag because the browser actually knows that it is the UTF-8 charset. I tried all encodings from the browser an...
The reason for your problem is often accidental re-encoding the script files by a programmer's editor. It isn't a good practice to hardcode strings which rely on encoding in your php files. Try switching your browser's encoding to find what encoding is used for hardcoded text, it might help you address the issue. Also...
2,543,451
Recently I switched hosting from one provider to the other and I have problems displaying Cyrillic characters. The characters which are read from the database are displayed correctly, but characters which are hardcoded in the php file aren't (they are displayed as question marks). The files which contain the php sourc...
2010/03/30
[ "https://Stackoverflow.com/questions/2543451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295502/" ]
put this after connecting database: ``` mysql_query("SET NAMES UTF8"); ``` for mysqli ``` mysqli_query($connecDB,"SET NAMES UTF8"); ``` and in the header of the page: ``` <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> ```
The reason for your problem is often accidental re-encoding the script files by a programmer's editor. It isn't a good practice to hardcode strings which rely on encoding in your php files. Try switching your browser's encoding to find what encoding is used for hardcoded text, it might help you address the issue. Also...
2,543,451
Recently I switched hosting from one provider to the other and I have problems displaying Cyrillic characters. The characters which are read from the database are displayed correctly, but characters which are hardcoded in the php file aren't (they are displayed as question marks). The files which contain the php sourc...
2010/03/30
[ "https://Stackoverflow.com/questions/2543451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295502/" ]
It had something to do with the encoding of the php files. The files were created using Windows Notepad and saved with utf-8 encoding. When I used Notepad2 to open the files, the encoding of the files was "utf-8 with signature". When I changed encoding to "utf-8", the text displayed correctly.
For me, the line that made the difference is the following: ``` $mysqli->set_charset("utf8") ``` Straight from the [PHP documentation page](http://php.net/manual/en/mysqli.set-charset.php). The server was returning latin, after setting the charset to utf8 now works fine.
2,543,451
Recently I switched hosting from one provider to the other and I have problems displaying Cyrillic characters. The characters which are read from the database are displayed correctly, but characters which are hardcoded in the php file aren't (they are displayed as question marks). The files which contain the php sourc...
2010/03/30
[ "https://Stackoverflow.com/questions/2543451", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295502/" ]
The problem seems quite strange. What's the form of these question marks? Is it black diamonds with questions or just plain question marks? First of all double check if your files are really `utf-8` encoded. Try to add this header to your code (above all output) ``` header('Content-Type: text/html; charset=ut...
The reason for your problem is often accidental re-encoding the script files by a programmer's editor. It isn't a good practice to hardcode strings which rely on encoding in your php files. Try switching your browser's encoding to find what encoding is used for hardcoded text, it might help you address the issue. Also...
66,522,416
I have the following loop: ``` for(register size_t j=i-1;j>=0;--j){ } ``` I want the loop to go until 0, but counting 0 as a new loop. The compiler issues the following warning: > > warning: comparison of unsigned expression >= 0 is always true > > > Per [this](https://stackoverflow.com/questions/20074073/wa...
2021/03/07
[ "https://Stackoverflow.com/questions/66522416", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Try ``` for(register size_t j=i;j-- > 0;) ``` The loop will start for j equal to i-1 and the last iteration will run for j equal to zero.
One option would be to *decrement* inside the loop: ``` for (size_t j = i; j > 0; ){ j--; } ``` `int` is not a proper substitute for `size_t`. POSIX has `ssize_t` (the signed counterpart) that is slightly more appropriate. The `register` keyword is most likely useless.
64,705,661
I have 2 services that I want to call back to back in a sequential fashion. Neither of them produces any data. What would be the best way to chain them in a webflux pipeline. I want to call subscribe on the last service call to trigger the whole flow. Something like: ``` serviceA.methodX() .then() serviceB.methodY()....
2020/11/05
[ "https://Stackoverflow.com/questions/64705661", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3005591/" ]
This is what I figured as an alternative: ``` Mono.just(Boolean.TRUE) .flatMap( success -> { serviceA.methodX(); return true; } ) .flatMap( success -> { serviceB.methodY(); return true; } ) .subscribe(); ```
``` Mono<OfSomeThing> executeFirst = ... ; Mono<OfSomeThing> onceFirstIsCompletedExcecuteSecond = ... ; Mono<OfSomeThing> plan = executeFirst.then(onceFirstIsCompletedExcecuteSecond); plan.block(); ```
60,319,472
I seem to have some troubles with the TextColor of my Entry on iOS when Dark Mode is enabled. Whenever I set the Entry's Enabled state to false, the TextColor turns white and it's not possible to change. I used the following simple code to reproduce this. ``` Page.xaml <Entry x:Name="TestEntry" /> ``` ``` Page....
2020/02/20
[ "https://Stackoverflow.com/questions/60319472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7214277/" ]
In the meanwhile I have found the fix necessary to my question. Apparently the EntryRenderer on iOS uses uses the default color when legacy color management is enabled and the Entry is disabled. Setting the legacyColorManagement to False on the Entry solves this issue. **XF check for legacycolormanagement** <https://...
The reason that is happening because of how iOS works with the dark mode for you to handle this you have to add the following in your `Info.Plist` ``` <key>UIUserInterfaceStyle</key> <string>Light</string> ``` What this will do is stop your app from changing anything when Dark mode is turned on i.e. it is sort of an...
61,054,425
I have a FlatList with two items. I need to append this list with another elements. When the user clicks on the button, the data from the text inputs should appear in the end of the FlatList. So, I've tried to push data object to the end of the list's array, but new item replaces the last one. ``` import React, { use...
2020/04/06
[ "https://Stackoverflow.com/questions/61054425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12591646/" ]
```html import React, { useState } from 'react'; import { Text, View, StyleSheet, Button } from 'react-native'; import { FlatList } from 'react-native-gesture-handler'; export default function HomeScreen() { var initialElements = [ { id : "0", text : "Object 1"}, { id : "1", text : "Object 2"}, ] ...
i fixed it by defining the array outside the export function ``` import React, { useState } from 'react' import { StyleSheet, View, TextInput, TouchableOpacity, Text, FlatList } from 'react-native' let tipArray = [ {key: '1', tip: 20}, {key: '2', tip: 12} ] const screen = function tipInputScreen( {navigation...
61,054,425
I have a FlatList with two items. I need to append this list with another elements. When the user clicks on the button, the data from the text inputs should appear in the end of the FlatList. So, I've tried to push data object to the end of the list's array, but new item replaces the last one. ``` import React, { use...
2020/04/06
[ "https://Stackoverflow.com/questions/61054425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12591646/" ]
I fixed the problem of replacing elements by changing array into a state variable. ``` import React, { useState } from 'react'; import { Text, View, StyleSheet, Button } from 'react-native'; import { FlatList } from 'react-native-gesture-handler'; export default function HomeScreen() { const [initialElements, chan...
i fixed it by defining the array outside the export function ``` import React, { useState } from 'react' import { StyleSheet, View, TextInput, TouchableOpacity, Text, FlatList } from 'react-native' let tipArray = [ {key: '1', tip: 20}, {key: '2', tip: 12} ] const screen = function tipInputScreen( {navigation...
706,532
Is it possible to recreate a file if you have the files md5sum? Or is it only possible through brute-force? Is it any differences between the different algorithms?
2014/01/24
[ "https://superuser.com/questions/706532", "https://superuser.com", "https://superuser.com/users/293047/" ]
Generating a hash of any kind could be thought of as a form of "[Lossy Compression](http://en.wikipedia.org/wiki/Lossy_compression)", during the creation of the output you loose data about the input. The only way to get that data back is by "guessing" and trying the lossy operation again to see if you get the same res...
While MD5 is not considered secure for verifying the integrity of a file, it is still pretty much impossible to recreate the file from the hash. [Here](http://en.wikipedia.org/wiki/Comparison_of_cryptographic_hash_functions) is a comparison of cryptographic hash functions on Wikipedia.
7,369,059
In my web app after a user logs in a new session is created so until he closes the browser he stays logged in. The problem appears when admin wants to ban the user who's browser is still open. Even though the user is banned and cannot log in anymore, he still stays logged in until he closes the browser or manually logs...
2011/09/10
[ "https://Stackoverflow.com/questions/7369059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/672018/" ]
add the following to your application controller: ``` before_filter :sign_out_banned_user def sign_out_banned_user if current_user.banned? session[:current_user_id] = nil redirect_to root_path, :notice => "You are banned" return false end end ```
You must reset the session also i think.
34,951,023
I have a macro (code attached) which writes the data from two sheets into two variant arrays. It then uses a nested loop to look for all possible matches in the 2nd sheet on a piece of data in the 1st sheet. When the first match is found one of the variant arrays appears to get wiped and I get a 'Subscript out of rang...
2016/01/22
[ "https://Stackoverflow.com/questions/34951023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5827000/" ]
I've reduced your problem to a Minimum, Verifiable and Complete Example. The problem occurs when you assign the *implicit* default value of a range to a Variant variable that was passed as a Variant array. ``` Sub VariantArrayWTF() Dim aBar() As Variant Dim aFoo() As Variant GetArray aBar GetArray aFoo D...
I have found the lines of code which were causing the problem. However, I cannot explain why it would necessarily cause a crash so I would appreciate other input on why this is happening. When passing the RL and CK arrays to the getRange\_Build Array sub I left out the brackets that would have denoted these variables ...
71,861,770
[image example - text is moving](https://i.stack.imgur.com/COvhL.gif) My HTML page is empty, with only 3 span elements. Here is my javascript code how i insert my images: ```js if (fahrenheitTemperature < 60) { let coldPicture = "./images/cold.png" let temperatureIcon = document.getElementById("temperatureIcon")....
2022/04/13
[ "https://Stackoverflow.com/questions/71861770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18236555/" ]
You can let a regex do all the state-machine hard work... To prepend `'X'` to any number of consecutive vowels: ```py import re s = 'speeding' >>> re.sub(r'([aeiou]+)', r'X\1', s) 'spXeedXing' ``` To prepend `'X'` only to the same repeating vowel: ```py s = 'speeding' >>> re.sub(r'(([aeiou])\2*)', r'X\1', s) 'spX...
you should try checking the previous letter in the string to see if it is the same letter as the current index ``` def vowels(string): newString = "" for i in range(len(string)): if string[i] in "aeiou": if string[i - 1] == string[i]: newString += string[i] else:...
71,861,770
[image example - text is moving](https://i.stack.imgur.com/COvhL.gif) My HTML page is empty, with only 3 span elements. Here is my javascript code how i insert my images: ```js if (fahrenheitTemperature < 60) { let coldPicture = "./images/cold.png" let temperatureIcon = document.getElementById("temperatureIcon")....
2022/04/13
[ "https://Stackoverflow.com/questions/71861770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18236555/" ]
``` >>> import re >>> re.sub('([aeiou]+)','X\g<1>','speeding') 'spXeedXing' >>> ```
You can let a regex do all the state-machine hard work... To prepend `'X'` to any number of consecutive vowels: ```py import re s = 'speeding' >>> re.sub(r'([aeiou]+)', r'X\1', s) 'spXeedXing' ``` To prepend `'X'` only to the same repeating vowel: ```py s = 'speeding' >>> re.sub(r'(([aeiou])\2*)', r'X\1', s) 'spX...
71,861,770
[image example - text is moving](https://i.stack.imgur.com/COvhL.gif) My HTML page is empty, with only 3 span elements. Here is my javascript code how i insert my images: ```js if (fahrenheitTemperature < 60) { let coldPicture = "./images/cold.png" let temperatureIcon = document.getElementById("temperatureIcon")....
2022/04/13
[ "https://Stackoverflow.com/questions/71861770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18236555/" ]
You should create a new variable to track the previous letter in `string`. Check if the letters are continuous and only add `X` if the previous `char` is not the same as the current `char`. ``` def vowels(string): newString = "" i = 0 # Create a counter variable for letter in string: if (letter in ...
You can let a regex do all the state-machine hard work... To prepend `'X'` to any number of consecutive vowels: ```py import re s = 'speeding' >>> re.sub(r'([aeiou]+)', r'X\1', s) 'spXeedXing' ``` To prepend `'X'` only to the same repeating vowel: ```py s = 'speeding' >>> re.sub(r'(([aeiou])\2*)', r'X\1', s) 'spX...
71,861,770
[image example - text is moving](https://i.stack.imgur.com/COvhL.gif) My HTML page is empty, with only 3 span elements. Here is my javascript code how i insert my images: ```js if (fahrenheitTemperature < 60) { let coldPicture = "./images/cold.png" let temperatureIcon = document.getElementById("temperatureIcon")....
2022/04/13
[ "https://Stackoverflow.com/questions/71861770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18236555/" ]
``` >>> import re >>> re.sub('([aeiou]+)','X\g<1>','speeding') 'spXeedXing' >>> ```
you should try checking the previous letter in the string to see if it is the same letter as the current index ``` def vowels(string): newString = "" for i in range(len(string)): if string[i] in "aeiou": if string[i - 1] == string[i]: newString += string[i] else:...
71,861,770
[image example - text is moving](https://i.stack.imgur.com/COvhL.gif) My HTML page is empty, with only 3 span elements. Here is my javascript code how i insert my images: ```js if (fahrenheitTemperature < 60) { let coldPicture = "./images/cold.png" let temperatureIcon = document.getElementById("temperatureIcon")....
2022/04/13
[ "https://Stackoverflow.com/questions/71861770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18236555/" ]
You should create a new variable to track the previous letter in `string`. Check if the letters are continuous and only add `X` if the previous `char` is not the same as the current `char`. ``` def vowels(string): newString = "" i = 0 # Create a counter variable for letter in string: if (letter in ...
you should try checking the previous letter in the string to see if it is the same letter as the current index ``` def vowels(string): newString = "" for i in range(len(string)): if string[i] in "aeiou": if string[i - 1] == string[i]: newString += string[i] else:...
71,861,770
[image example - text is moving](https://i.stack.imgur.com/COvhL.gif) My HTML page is empty, with only 3 span elements. Here is my javascript code how i insert my images: ```js if (fahrenheitTemperature < 60) { let coldPicture = "./images/cold.png" let temperatureIcon = document.getElementById("temperatureIcon")....
2022/04/13
[ "https://Stackoverflow.com/questions/71861770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18236555/" ]
Here is a simple non-regex version: ``` def vowels(word): new_word = "" prev = "" # no previous letter at first for letter in word: if letter in "aeiou" and letter != prev: new_word += "X" + letter else: new_word += letter prev = letter # keep to avoid ins...
you should try checking the previous letter in the string to see if it is the same letter as the current index ``` def vowels(string): newString = "" for i in range(len(string)): if string[i] in "aeiou": if string[i - 1] == string[i]: newString += string[i] else:...
71,861,770
[image example - text is moving](https://i.stack.imgur.com/COvhL.gif) My HTML page is empty, with only 3 span elements. Here is my javascript code how i insert my images: ```js if (fahrenheitTemperature < 60) { let coldPicture = "./images/cold.png" let temperatureIcon = document.getElementById("temperatureIcon")....
2022/04/13
[ "https://Stackoverflow.com/questions/71861770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18236555/" ]
``` >>> import re >>> re.sub('([aeiou]+)','X\g<1>','speeding') 'spXeedXing' >>> ```
Here is a simple non-regex version: ``` def vowels(word): new_word = "" prev = "" # no previous letter at first for letter in word: if letter in "aeiou" and letter != prev: new_word += "X" + letter else: new_word += letter prev = letter # keep to avoid ins...
71,861,770
[image example - text is moving](https://i.stack.imgur.com/COvhL.gif) My HTML page is empty, with only 3 span elements. Here is my javascript code how i insert my images: ```js if (fahrenheitTemperature < 60) { let coldPicture = "./images/cold.png" let temperatureIcon = document.getElementById("temperatureIcon")....
2022/04/13
[ "https://Stackoverflow.com/questions/71861770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18236555/" ]
You should create a new variable to track the previous letter in `string`. Check if the letters are continuous and only add `X` if the previous `char` is not the same as the current `char`. ``` def vowels(string): newString = "" i = 0 # Create a counter variable for letter in string: if (letter in ...
Here is a simple non-regex version: ``` def vowels(word): new_word = "" prev = "" # no previous letter at first for letter in word: if letter in "aeiou" and letter != prev: new_word += "X" + letter else: new_word += letter prev = letter # keep to avoid ins...
19,831,645
My web view loads a url that - after completing loading - gets changed to another url. how can I catch the new url. `getURL()` always returns the 1st url not the second. I can see the new URL if i use a browser but I can't get if from the webview.
2013/11/07
[ "https://Stackoverflow.com/questions/19831645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1130044/" ]
You could use a webClient and implement **shouldOverrideUrlLoading** to intercept all the urls before the WebView loads them. ``` mWebView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { // Here put your code ...
Use ``` getOriginalUrl () ``` It returns the URL that was originally requested for the current page `getUrl ()` is not always the same as the URL passed to `WebViewClient.onPageStarted` because although the load for that URL has begun, the current page may not have changed. `getOriginalUrl ()` gets the original U...
19,831,645
My web view loads a url that - after completing loading - gets changed to another url. how can I catch the new url. `getURL()` always returns the 1st url not the second. I can see the new URL if i use a browser but I can't get if from the webview.
2013/11/07
[ "https://Stackoverflow.com/questions/19831645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1130044/" ]
Use ``` getOriginalUrl () ``` It returns the URL that was originally requested for the current page `getUrl ()` is not always the same as the URL passed to `WebViewClient.onPageStarted` because although the load for that URL has begun, the current page may not have changed. `getOriginalUrl ()` gets the original U...
In my case WebViewClient wasn't showing if there was changes on the webview, I supposed that is something about the web that is been running. I could get that information from the WebChromeClient with OnProgressChanged, I don't know if this would help people anyway, but here is the code: ``` webview.webChromeClient =...
19,831,645
My web view loads a url that - after completing loading - gets changed to another url. how can I catch the new url. `getURL()` always returns the 1st url not the second. I can see the new URL if i use a browser but I can't get if from the webview.
2013/11/07
[ "https://Stackoverflow.com/questions/19831645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1130044/" ]
You could use a webClient and implement **shouldOverrideUrlLoading** to intercept all the urls before the WebView loads them. ``` mWebView.setWebViewClient(new WebViewClient() { @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { // Here put your code ...
In my case WebViewClient wasn't showing if there was changes on the webview, I supposed that is something about the web that is been running. I could get that information from the WebChromeClient with OnProgressChanged, I don't know if this would help people anyway, but here is the code: ``` webview.webChromeClient =...
39,843,647
I'm trying to build a simple chrome extension that inserts/hides a div when the browser action (extension icon) is toggled. I've got the basics working but I would like the extension to remain in it's **'on-state'** (i.e div inserted) when the page reloads. It should only be removed when toggled off. Currently on each...
2016/10/04
[ "https://Stackoverflow.com/questions/39843647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5309673/" ]
I did eventually figure out that I needed to add a listener for [chrome.tabs.onUpdated](https://developer.chrome.com/extensions/tabs#event-onUpdated) as @ViewSource's excellent answer also stated. Here's the final working example: **manifest.json** ``` { "name": "My Extension", "version": "0.0.1", "manife...
I had the same problame myself. After the page reload, you need to toggle the extension again, as you did when the user push the browserAction button, just without the - `toggle = !toggle;` because the user didn't change the extension's state. So, how do you know when the tab reload? using `tabs.onUpdated` Your new ...
2,901,664
I've added PresentationFramework.Aero to my App.xaml merged dictionaries, as in... ``` <Application x:Class="TestApp.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Application.Resources> <ResourceDictionary> ...
2010/05/25
[ "https://Stackoverflow.com/questions/2901664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/129164/" ]
I hope you've found a solution in the meantime. For everyone else, [here is one](https://stackoverflow.com/questions/927251/wpf-extend-themes-style-stackoverflowexception/1542805#1542805) workaround, and [here is another](https://stackoverflow.com/questions/1780817/wpf-override-standard-theme-in-app-xaml/2223751#222375...
Use the BasedOn attribute to inherit the properties from the Aero Style. This should solve your problem. ``` <Style BasedOn="{StaticResource {x:Type Button}}" TargetType="{x:Type Button}"> <Setter Property="Padding" Value="3" /> <Setter Property="FontWeight" Value="Bold" /> </Style> ```
2,901,664
I've added PresentationFramework.Aero to my App.xaml merged dictionaries, as in... ``` <Application x:Class="TestApp.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Application.Resources> <ResourceDictionary> ...
2010/05/25
[ "https://Stackoverflow.com/questions/2901664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/129164/" ]
I hope you've found a solution in the meantime. For everyone else, [here is one](https://stackoverflow.com/questions/927251/wpf-extend-themes-style-stackoverflowexception/1542805#1542805) workaround, and [here is another](https://stackoverflow.com/questions/1780817/wpf-override-standard-theme-in-app-xaml/2223751#222375...
Based on your updates, you could do this (admittedly it is hideously ugly): ``` <Style x:Key="_buttonStyleBase" BasedOn="{StaticResource {x:Type Button}}" TargetType="{x:Type Button}"> <Setter Property="Padding" Value="3" /> <Setter Property="FontWeight" Value="Bold" /> </Style> <Style Target...
69,307
This is a two part question and pertains to power generation: * What prevents a larger plant (say nuclear) from turning an itsy-bitsy gas generator into an electric motor and *drive* current through it? (obnoxiously large diodes?) * How does the entire portfolio of power generators stay in sync/phase with the grid to ...
2013/05/14
[ "https://electronics.stackexchange.com/questions/69307", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/4642/" ]
Short Answer: Synchronizers --------------------------- Basically, feedback is used to keep the generator and grid in sync. There are many ways to do this. A nice overview is [here](http://en.wikipedia.org/wiki/Synchronization_(alternating_current)). Virtually all modern power generation systems use some form of dig...
There are no diodes, not in the normal AC system. I'm not sure you could build them that big. As to the large plant versus small plant, the normal operation of the system keeps them in phase; if your generator is leading slightly, it will encounter more resistance and back EMF, which will tend to slow it down. If you'...
1,064,651
This has been annoying me for a long time. Here's the situation: I have multiple accounts in Thunderbird. I use a master password to access them. Upon launching Thunderbird I get multiple prompts asking for the master password. If I am not mistaken the number of prompts = number of accounts I have. My question is wh...
2018/08/12
[ "https://askubuntu.com/questions/1064651", "https://askubuntu.com", "https://askubuntu.com/users/110181/" ]
I had to enable universe in my sources.list =========================================== ``` sudo vi /etc/apt/sources.list ``` change the file to look like this: ================================== ``` deb http://archive.ubuntu.com/ubuntu bionic main universe deb http://archive.ubuntu.com/ubuntu bionic-security main ...
I had the same trouble in Ubuntu 18.04 #Edit the file /etc/apt/sources.list with the next lines: ``` deb http://archive.ubuntu.com/ubuntu bionic main multiverse restricted universe deb http://archive.ubuntu.com/ubuntu bionic-security main multiverse restricted universe deb http://archive.ubuntu.com/ubuntu bionic-updat...
1,064,651
This has been annoying me for a long time. Here's the situation: I have multiple accounts in Thunderbird. I use a master password to access them. Upon launching Thunderbird I get multiple prompts asking for the master password. If I am not mistaken the number of prompts = number of accounts I have. My question is wh...
2018/08/12
[ "https://askubuntu.com/questions/1064651", "https://askubuntu.com", "https://askubuntu.com/users/110181/" ]
I had to enable universe in my sources.list =========================================== ``` sudo vi /etc/apt/sources.list ``` change the file to look like this: ================================== ``` deb http://archive.ubuntu.com/ubuntu bionic main universe deb http://archive.ubuntu.com/ubuntu bionic-security main ...
Simply Use: ``` sudo apt-get install php-mbstring ``` Then you must restart Apache Service, Use: ``` sudo service apache2 restart ```
1,064,651
This has been annoying me for a long time. Here's the situation: I have multiple accounts in Thunderbird. I use a master password to access them. Upon launching Thunderbird I get multiple prompts asking for the master password. If I am not mistaken the number of prompts = number of accounts I have. My question is wh...
2018/08/12
[ "https://askubuntu.com/questions/1064651", "https://askubuntu.com", "https://askubuntu.com/users/110181/" ]
I had to enable universe in my sources.list =========================================== ``` sudo vi /etc/apt/sources.list ``` change the file to look like this: ================================== ``` deb http://archive.ubuntu.com/ubuntu bionic main universe deb http://archive.ubuntu.com/ubuntu bionic-security main ...
All I had to do was ``` sudo apt-get update ``` and it was available for install after this.
1,064,651
This has been annoying me for a long time. Here's the situation: I have multiple accounts in Thunderbird. I use a master password to access them. Upon launching Thunderbird I get multiple prompts asking for the master password. If I am not mistaken the number of prompts = number of accounts I have. My question is wh...
2018/08/12
[ "https://askubuntu.com/questions/1064651", "https://askubuntu.com", "https://askubuntu.com/users/110181/" ]
I had to enable universe in my sources.list =========================================== ``` sudo vi /etc/apt/sources.list ``` change the file to look like this: ================================== ``` deb http://archive.ubuntu.com/ubuntu bionic main universe deb http://archive.ubuntu.com/ubuntu bionic-security main ...
Try this I had the same issue for php8.0 in ubuntu 18.04 **This will remove (all php7.0, 7.1, 7.2 etc)** ``` sudo apt-get purge php7.* sudo add-apt-repository ppa:ondrej/php sudo apt update sudo apt upgrade sudo apt install php-mbstring ```
1,064,651
This has been annoying me for a long time. Here's the situation: I have multiple accounts in Thunderbird. I use a master password to access them. Upon launching Thunderbird I get multiple prompts asking for the master password. If I am not mistaken the number of prompts = number of accounts I have. My question is wh...
2018/08/12
[ "https://askubuntu.com/questions/1064651", "https://askubuntu.com", "https://askubuntu.com/users/110181/" ]
I had the same trouble in Ubuntu 18.04 #Edit the file /etc/apt/sources.list with the next lines: ``` deb http://archive.ubuntu.com/ubuntu bionic main multiverse restricted universe deb http://archive.ubuntu.com/ubuntu bionic-security main multiverse restricted universe deb http://archive.ubuntu.com/ubuntu bionic-updat...
Simply Use: ``` sudo apt-get install php-mbstring ``` Then you must restart Apache Service, Use: ``` sudo service apache2 restart ```
1,064,651
This has been annoying me for a long time. Here's the situation: I have multiple accounts in Thunderbird. I use a master password to access them. Upon launching Thunderbird I get multiple prompts asking for the master password. If I am not mistaken the number of prompts = number of accounts I have. My question is wh...
2018/08/12
[ "https://askubuntu.com/questions/1064651", "https://askubuntu.com", "https://askubuntu.com/users/110181/" ]
I had the same trouble in Ubuntu 18.04 #Edit the file /etc/apt/sources.list with the next lines: ``` deb http://archive.ubuntu.com/ubuntu bionic main multiverse restricted universe deb http://archive.ubuntu.com/ubuntu bionic-security main multiverse restricted universe deb http://archive.ubuntu.com/ubuntu bionic-updat...
All I had to do was ``` sudo apt-get update ``` and it was available for install after this.
1,064,651
This has been annoying me for a long time. Here's the situation: I have multiple accounts in Thunderbird. I use a master password to access them. Upon launching Thunderbird I get multiple prompts asking for the master password. If I am not mistaken the number of prompts = number of accounts I have. My question is wh...
2018/08/12
[ "https://askubuntu.com/questions/1064651", "https://askubuntu.com", "https://askubuntu.com/users/110181/" ]
I had the same trouble in Ubuntu 18.04 #Edit the file /etc/apt/sources.list with the next lines: ``` deb http://archive.ubuntu.com/ubuntu bionic main multiverse restricted universe deb http://archive.ubuntu.com/ubuntu bionic-security main multiverse restricted universe deb http://archive.ubuntu.com/ubuntu bionic-updat...
Try this I had the same issue for php8.0 in ubuntu 18.04 **This will remove (all php7.0, 7.1, 7.2 etc)** ``` sudo apt-get purge php7.* sudo add-apt-repository ppa:ondrej/php sudo apt update sudo apt upgrade sudo apt install php-mbstring ```
1,064,651
This has been annoying me for a long time. Here's the situation: I have multiple accounts in Thunderbird. I use a master password to access them. Upon launching Thunderbird I get multiple prompts asking for the master password. If I am not mistaken the number of prompts = number of accounts I have. My question is wh...
2018/08/12
[ "https://askubuntu.com/questions/1064651", "https://askubuntu.com", "https://askubuntu.com/users/110181/" ]
Simply Use: ``` sudo apt-get install php-mbstring ``` Then you must restart Apache Service, Use: ``` sudo service apache2 restart ```
Try this I had the same issue for php8.0 in ubuntu 18.04 **This will remove (all php7.0, 7.1, 7.2 etc)** ``` sudo apt-get purge php7.* sudo add-apt-repository ppa:ondrej/php sudo apt update sudo apt upgrade sudo apt install php-mbstring ```
1,064,651
This has been annoying me for a long time. Here's the situation: I have multiple accounts in Thunderbird. I use a master password to access them. Upon launching Thunderbird I get multiple prompts asking for the master password. If I am not mistaken the number of prompts = number of accounts I have. My question is wh...
2018/08/12
[ "https://askubuntu.com/questions/1064651", "https://askubuntu.com", "https://askubuntu.com/users/110181/" ]
All I had to do was ``` sudo apt-get update ``` and it was available for install after this.
Try this I had the same issue for php8.0 in ubuntu 18.04 **This will remove (all php7.0, 7.1, 7.2 etc)** ``` sudo apt-get purge php7.* sudo add-apt-repository ppa:ondrej/php sudo apt update sudo apt upgrade sudo apt install php-mbstring ```
4,776,396
I was looking at this tutorial <http://asp-umb.neudesic.com/mvc/tutorials/validating-with-a-service-layer--cs> on how to wrap my validation data around a wrapper. I would like to use dependency inject though. I am using ninject 2.0 ``` namespace MvcApplication1.Models { public interface IValidationDictionary ...
2011/01/23
[ "https://Stackoverflow.com/questions/4776396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130015/" ]
The solution given by that article mixes validation logic with the service logic. These are two concerns and they should be separated. When your application grows you will quickly find out that validation logic gets complicated and gets duplicated throughout the service layer. I, therefore, like to suggest a different ...
I would like to extend Stevens fantastic answer where he wrote: > > The last thing that's missing now is automatic registration (or batch > registration). This will save you from having to add a registration > per Validator implementation and let Ninject search your assemblies > dynamically for you. I couldn't fin...
18,621
My competitor has a forum where its customer post. I want to use all those threads to determine which keywords I should use on my own site, because forums have terms customers use and search for. I can pick a page and analyse it to find which keyword and phrase are popular, but how do I analyse the whole site ?
2011/08/22
[ "https://webmasters.stackexchange.com/questions/18621", "https://webmasters.stackexchange.com", "https://webmasters.stackexchange.com/users/9377/" ]
I found this the other day which seemed blinding for a free tool although I haven't had any time to install and get to grips with; <http://www.link-assistant.com/website-auditor/features.html>
If your competitor's site has a feed, you can try out [Wordle](http://www.wordle.net). Wordle can take the URL of any blog, blog feed, or any other web page that has an Atom or RSS feed & build a word cloud which gives greater prominence to words that appear more frequently in the source text. It may not be compreh...
32,139,500
My main.js file is loaded within index.html, and starts with ``` console.clear(); ``` So I get a clean console before the project starts. Strangely, any logs that follow console.clear aren't shown anymore either! ``` console.clear(); console.log("starting the project"); console.log("but these logs are not shown..."...
2015/08/21
[ "https://Stackoverflow.com/questions/32139500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1083572/" ]
Works good for me <http://jsfiddle.net/3rd26za5/> ``` console.log("before clear"); console.clear(); console.log("starting the project"); console.log("but these logs are not shown..."); ```
Code: ``` console.clear(); console.log("This prints normally."); ``` Output: ``` This prints normally. ``` Works for me. Must be a bug in the software you are using.