qid int64 10 74.7M | question stringlengths 15 26.2k | date stringlengths 10 10 | metadata list | response_j stringlengths 27 28.1k | response_k stringlengths 23 26.8k |
|---|---|---|---|---|---|
9,173,810 | We develop a lot of systems that have an input that should have a related text label after them for a unit of measure. e.g. Meter square, meter cubed, tonnes, ft cubed etc. I don't need to do anything clever like scale between units of measure. Just ensure that it is easy to update and good practice.
Was looking for s... | 2012/02/07 | [
"https://Stackoverflow.com/questions/9173810",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/629323/"
] | Use display templates and more specific types.
For instance, create `Currency` class which is used to handle currencies. By doing so you know if it's cents, dollars or whatever and which currency the user uses.
More work, sure. But the code is more robust and it's easier to tell what unit should be used.
That's why... | My thinking is presently to add an attribute e.g.
```
[Unit(UnitOfMeasure.Mph)]
[Display(Name="Top Speed"]
public float TopSpeed {get;set}
```
Then do something either create a Html.UnitOfMeasureDisplay helper, or try to do something with EditorTemplates to automatically include it. |
35,442,329 | I want to visualize README.md files from a project in github, in my website.
What is the best way to do this? Like fetch the markdown code and process the mark down locally? Or there is a way to fetch the already processed markdown from github? | 2016/02/16 | [
"https://Stackoverflow.com/questions/35442329",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1164246/"
] | One possible solution is to use a javascript-based markdown parser, such as <https://github.com/evilstreak/markdown-js>.
That library can be loaded from the browser and can display the markdown. In this example (taken from the aforementioned site), you would need to fetch and insert the markdown in the output of your ... | <https://github.com/zhlicen/md.htm>
An example of zeromd.js
Just serve the md.htm file and md files, and visit directly by url: /md.htm?src=README.md
Or directly use my github page, Example:
<https://b.0-0.plus/blog/md.htm?src=https://raw.githubusercontent.com/microsoft/vscode/main/README.md> |
61,490,876 | I am looking into the Oracle SQL Model clause. I am trying to write dynamic Oracle SQL which can be adapted to run for a varying number of columns each time, using this model clause. However I am struggling to see how I could adapt this (even using PL/SQL) to a dynamic/generic query or procedure
here is a rough view o... | 2020/04/28 | [
"https://Stackoverflow.com/questions/61490876",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11979838/"
] | I've created a demo and it somewhat does what you want. The two issues it has are-
1. User has to click twice(double click) to input values(I can't to make it work on a single click)
2. The position of the `label` overlaps the selected value(Even after giving another class or styling it dynamically)
>
> **If anybod... | Based on the answers here, I created my own function. Also the Material Design for Web Versions in the answers are quite old. Hope this helps for those looking for something like this.
At first, instead of using MDCSelect, I used MDCTextField and MDCMenu components. I thought everything would be easier this way. It to... |
9,880 | While studying the etymology of the word, I found that it comes from ***gryphus***, the Latin for *griffin*. In fact *griffin* also happens to be one meaning of **grifo**. And as we all know, *griffin* is a mythical beast with the body of a lion and the head of an eagle. *Griffin* is also the name of a species of vultu... | 2014/10/16 | [
"https://spanish.stackexchange.com/questions/9880",
"https://spanish.stackexchange.com",
"https://spanish.stackexchange.com/users/1979/"
] | The most probable cause is that drains in antique buildings, especially churches had different forms of fantastic animals, people or normal animals, and here is where griffins appears. In Italian there is *rubinetto* and French has *robinet*. Both with faucet meaning because of the same origin, fonts had sheep sculptur... | The term grifo is relatively new regarding faucets. It looks like it started to be called like this when faucet makers started to build them representing a griffin, in the 18th century. |
578,505 | What's it called when you get a type of award because you didn't get the award you were supposed to get? Let's say someone was trying to get an award, and they tried really hard, but they didn't get it, but because people felt bad that they didn't get it, they got a different award called a(n) \_\_\_ award, meaning "He... | 2021/11/14 | [
"https://english.stackexchange.com/questions/578505",
"https://english.stackexchange.com",
"https://english.stackexchange.com/users/241628/"
] | This is a participation award/trophy/ribbon. According to [Wikipedia](https://en.wikipedia.org/wiki/Participation_trophy):
>
> A participation trophy is a trophy given to children (usually) who participate in a sporting event but do not finish in first, second or third place, and so would not normally be eligible for... | Bauble
------
An award that is given which is nevertheless lacking in real weight and significance is sometimes referred to as a 'Bauble'. For example, in [this news article](https://www.bbc.co.uk/news/uk-politics-58575894) Dominic Raab was reported to be appointed to the constitutionally almost meaningless role of 'D... |
1,805,012 | I'm using Visual Studio 2008 with Microsoft test tools. I need to access a text file from within the unit test.
I've already configured the file with build action set to 'Content' and copy to output directory to 'Copy Always', but the file is not being copied to the output directory, which according to `System.Enviro... | 2009/11/26 | [
"https://Stackoverflow.com/questions/1805012",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/60810/"
] | You have to add the `DeploymentItem` attribute to your test class. With this attribute you specify the files which are copied into the out directory for the test run.
For example:
```cs
[TestMethod]
[DeploymentItem(@"myfile.txt", "optionalOutFolder")]
public void MyTest()
{
...
}
```
See also: <http://msdn.micr... | How are you running your tests?
We use (TestDriven.net -> Run Tests).
From my experience, some test runners (like Junit in Netbeans) won't automatically copy any additional text files that you might need for testing. So in your case you might have to do a full build, and then try running the tests again.
And the ... |
28,111,722 | I've got one question . Is there anybody how has idea how to invoke function in controller only for the first li object in ul when ul has a ng-repeat?
Lets say ive got function in my controller like:
```
var init = function () {
var a = this;
};
```
And my ul repeater seams like lets say:
```
<ul ng-repeat="up ... | 2015/01/23 | [
"https://Stackoverflow.com/questions/28111722",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1282272/"
] | From what I understand, you want to remove the first letter if it is not a digit. So you may make this function simpler:
```
CString GAbsMeterCalibration::TrimMeterSNString(CString meterSN)
{
meterSN.MakeUpper();
int length = meterSN.GetLength();
// just check the first character is always a digit else r... | I don't know if you've tried this, but, it should work.
```
CString str = _T("#12000895236GF");
// check string to see if it starts with digit.
CString result = str.SpanIncluding(_T("0123456789"));
// if result is empty, string does not start with a number
// and we can remove the first character. Otherwise, strin... |
15,430,413 | Why is this code throwing a `NullReferenceException`?
**Exception:**
`System.NullReferenceException: Object reference not set to an instance of an object.`
**Code:**
```
if ((string.IsNullOrEmpty(Request.QueryString["Sno"].ToString()))
&& (string.IsNullOrEmpty(Request.QueryString["Name"].ToString())))
{
lbl... | 2013/03/15 | [
"https://Stackoverflow.com/questions/15430413",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1787471/"
] | I would recommend doing the following.
```
if (Request.QueryString["Sno"] == null || Request.QueryString["Name"] == null)
{
lblBookedBy.Text = "";
lblSno.Text = "";
}
else
{
lblBookedBy.Text = Request.QueryString["Name"].ToString();
lblSno.Text = Request.QueryString["Sno"].ToString();
}
```
You are m... | You are trying to cast `Request.QueryString["Sno"]` to string while it's value is `null` |
21,939,324 | I want to know in detail about the difference between alt and opt fragment in sequence diagram, they seem similar, I can't distinguish them. Anyone knows about this thing? | 2014/02/21 | [
"https://Stackoverflow.com/questions/21939324",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3338003/"
] | **Alt** is alternative flow (SWITCH or if. IF with two paths) **Opt** is IF with one flow. If you use Opt, code will be executed or not ! | They are basically the same.
`alt` is more used for several choices, like a `switch` sentence group in C programming language. While `opt` is more used for only two choices, like a `if` sentence.
But, don't get surprised, if you see both concepts used interchangeably. |
2,403,458 | ```
public abstract class Master
{
public void printForAllMethodsInSubClass()
{
System.out.println ("Printing before subclass method executes");
System.out.println ("Parameters for subclass method were: ....");
}
}
public class Owner extends Master {
public void printSomething () {
... | 2010/03/08 | [
"https://Stackoverflow.com/questions/2403458",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/289035/"
] | To answer the "any other programming language": It's easily possible in Ruby:
```
class Master
REDEFINED = []
def printForAllMethodsInSubClass
puts 'Printing before subclass method executes'
end
def self.method_added(meth)
if self < Master and not Master::REDEFINED.include? meth
new_name = "MAST... | This is possible in aspect-oriented programming languages, such as [AspectJ](http://eclipse.org/aspectj/). |
18,622 | I am new Ubuntu and Ask Ubuntu.
I asked a question today concerning how to make a desktop icon in GNOME, but do not know how I get back to the question, to see if anybody has offered a suggestion. | 2019/05/15 | [
"https://meta.askubuntu.com/questions/18622",
"https://meta.askubuntu.com",
"https://meta.askubuntu.com/users/956403/"
] | [Jacob's answer](https://meta.askubuntu.com/a/18627/527764) explains how to search among your posts, which is especially useful if you have many posts and a great tip for us all. However, I think in your particular case, you just don't know your way around the place yet and don't know where to find any of your posts in... | In the absence of any supplied information, the following assumes a
default Ubuntu Gnome 18.04 desktop. In the title bar at the top right
of the screen, left mouse click the section with your picture,
reputation, and awards. This brings up your profile. At the top left,
select "Activity", and from the list in the middl... |
59,940,644 | I have React Native project which stops working after Xcode upgrade to version 11.3.1. The error is following
```
Could not install at this time.
Failed to load Info.plist from bundle at path /Users/dmytro/Library/Developer/CoreSimulator/Devices/F0BD5650-04A4-4534-B3F6-56B74ED1B0C2/data/Library/Caches/com.apple.mobil... | 2020/01/28 | [
"https://Stackoverflow.com/questions/59940644",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/923497/"
] | Using CocoaPods v1.9+, if you can't remove `use_frameworks!` from `Podfile`, you can set:
```
use_frameworks! :linkage => :static
```
>
> Now that Swift supports static linking, CocoaPods has expanded this
> DSL to allow specifying the type of linkage preferred.
>
>
>
Source: <https://blog.cocoapods.org/CocoaP... | Go to `YourTarget` > `Build Settings` > `Packaging` > `Info.plist File` and check here the path to your `.plist` file.
Also it would be helpful to clear your `derived data` folder, and re-build project again. |
10,097 | I just noticed that the Windows Registry on one of our computers is 180 MB (when exported to a .reg file). That seem large enough to cause a performance issue. That registry is probably 4 years old.
I'm thinking of using a Registry Cleaner, assuming I can find a good one. | 2009/05/19 | [
"https://serverfault.com/questions/10097",
"https://serverfault.com",
"https://serverfault.com/users/2181/"
] | New rule: everyone must stop cleaning their registries. It is completely unnecessary and can inadvertently cause problems. Registry scanning as part of malware detection is one thing, but letting software "clean up" erroneous entries is risky. Address specific problems individually.
Rant over. ;) | Agreeing with Thoreau, CCleaner is probably your best bet and a trusted solution.
However, after 4 years, you might want to start thinking of just rebuilding to PC, it is a huge pain for some computers, but the results in the end exceed whatever registry cleaning or PC cleanup that you can do. |
7,066,132 | I'm having a problem with a boolean expression and when I did a logger.debug I had strange results, so I simplified my logging code to the following and was surprised not to see any 'false' being printed.
Logging code in my controller:
```
logger.debug 'true'
logger.debug true
logger.debug
logger.debug 'false'
logger... | 2011/08/15 | [
"https://Stackoverflow.com/questions/7066132",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/29043/"
] | Rails Logger uses `||` in the code before running `.to_s`, which fails for nil and false.
<https://github.com/rails/rails/blob/master/activesupport/lib/active_support/buffered_logger.rb#L65>
```
def add(severity, message = nil, progname = nil, &block)
return if @level > severity
message = (message || (block && bl... | Logger has got a condition somewhere (`if value`), which fails for nil and false. You want `logger.debug value.inspect`. |
11,439,139 | I have two questions for you:
1. [SOLVED] - In java, I have the ability to move around an image using the mouse listeners. Instead of moving the image exactly where my pointer is, how do I make it so if I click and move up the mouse, it just moves the image up. Not make the image jump to where my mouse pointer is.
2. ... | 2012/07/11 | [
"https://Stackoverflow.com/questions/11439139",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1215080/"
] | >
> I am actually using `Graphics` to draw an image.
>
>
>
This has been a user interface problem going back to the earliest, widely-available [object drawing programs](http://en.wikipedia.org/wiki/MacDraw). The common approach is to implement two basic operations that enable the user to expose a hidden object by ... | One type of solution is how I've solved this for a chess board. The board is composed of a grid of JPanels that each can hold one or 0 JLabels (that hold the chess piece with an image). If I click on a JPanel that holds a JLabel, the JLabel is kicked up onto the top level window's glasspane and then dragged with the mo... |
7,277,463 | When I run the following program in Python, the function takes the variables in, but completely skips over the rest and re-shows the main menu for the program without doing anything. Plus, it skips the qualifying "if" statements and asks for all the variables even if the first or second options are chosen (which don't ... | 2011/09/01 | [
"https://Stackoverflow.com/questions/7277463",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/924358/"
] | Your function is defined as `counting (x, y, z, countingSubmenu, q)`, but when you're calling it, you're argument list is `counting(countingSubmenu, x, y, z, q)`. | You didn't mention which version of Python you are using, but I suspect it's from the 3.x series. [Python 3 changed the behavior of input()](http://www.python.org/dev/peps/pep-3111/) to match what was previously raw\_input() in the 2.x series.
So, input() now always returns a string. So you either need to call int() o... |
2,430,084 | Is there a straightforward way of determining the number of decimal places in a(n) integer/double value in PHP? (that is, without using `explode`) | 2010/03/12 | [
"https://Stackoverflow.com/questions/2430084",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/243231/"
] | ```
$str = "1.23444";
print strlen(substr(strrchr($str, "."), 1));
``` | Int
---
Integers do not have decimal digits, so the answer is always zero.
Double/Float
------------
Double or float numbers are approximations. So they do not have a defined count of decimal digits.
A small example:
```
$number = 12.00000000012;
$frac = $number - (int)$number;
var_dump($number);
var_dump($frac);... |
2,954,879 | Any body can explain me how session works in PHP. for eg. 3 users logged into gmail. how the server identifies these 3 uers. what are the internel process behind that. | 2010/06/02 | [
"https://Stackoverflow.com/questions/2954879",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/669388/"
] | Gmail uses Python I think, not PHP.
PHP by default writes its sessions to the `/tmp` directory. It can be configured to store the sessions in the database.
It identifies the sessions via a cookie, but can also be configured to pass a query string but it is very ugly. | **How Does PHP Session Works**
* Firstly PHP creates a unique identifier number (a random string of 32
hexadecimal number, e.g 3c7foj34c3jj973hjkop2fc937e3443) for an
individual session.
* PHPSESSID cookie passed that unique identification number to users browser to save that number.
* A new file is creating to the se... |
14,715,099 | And also, why is it not necessary for, eg:
```
printf ("abc")
``` | 2013/02/05 | [
"https://Stackoverflow.com/questions/14715099",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2000809/"
] | `NSLog` takes an `NSString` as argument. `@"abc"` denotes an `NSString` because of the @ sign, so that is a valid argument for `NSLog`. `printf` is a normal C function that takes a C string, which is simply created using "". | Because it requires NSString. Adding @declares value as type of NSObject (simplification). |
2,312,516 | **Edit 2.** Since the question below appears to be open for degree seven and above, I have re-tagged appropriately, and also suggested this on MathOverflow ([**link**](https://mathoverflow.net/a/271653)) as a potential **polymath project**.
**Edit 1.** A re-phrasing thanks to a comment below:
>
> Is it true that, fo... | 2017/06/06 | [
"https://math.stackexchange.com/questions/2312516",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/37122/"
] | Generalizing Will Jagy's quartic solution as follows.
If $a$ and $n$ satisfy the Pell equation
$$
a^2+1=2n^2,
$$
then the quartic
$$P(x)=(x^2-1)(x^2-a^2)$$
works as its derivative is
$$
P'(x)=4x(x^2-n^2).
$$
Solutions to this Pell equation are found as follows. Let
$$
(1+\sqrt2)^{2k+1}=A\_k+N\_k\sqrt2.
$$
Then
$$
A\_k... | Try working backwards: find an integer polynomial $F$ of degree $n-1$ with all integer roots, such that its antiderivative has $n$ distinct roots. One way to check for this by looking for $n$ sign changes. [Here](https://www.wolframalpha.com/input/?i=(antiderivative%205!(x-1)(x-2)(x-3)(x-4))-950)'s an example for $n-4$... |
17,538,558 | Please visit my fiddle 1st: <http://jsfiddle.net/vHLXX/>
This is phone no. input field, if the length is 11 (value of the text input field) on click on the submit button alerts "yes" else "no".
Now, I want if the 1st three string isn't 011 i want alert "invalid!"
How can I get this (with jquery)?
here is the html:
... | 2013/07/09 | [
"https://Stackoverflow.com/questions/17538558",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1218931/"
] | ```
if (values.indexOf("011") != 0)
alert("invalid!");
``` | ```
$('.main-input').on('keyup', function () {
values = $(this).val();
newValue = values.substring();
});
$('.Create').click(function () {
if(values.indexOf("011") !== 0){
alert("invalid!");
return;
}
if (values.length === 11) {
alert("yes");
} else {
alert("no"... |
3,541,963 | consider this string
```
prison break: proof of innocence (2006) {abduction (#1.10)}
```
i just want to know whether there is `(# floating point value )}` in the string or not
i tried few regular expressions like
```
re.search('\(\#+\f+\)\}',xyz)
```
and
```
re.search('\(\#+(\d\.\d)+\)\}',xyz)
```
nothing ... | 2010/08/22 | [
"https://Stackoverflow.com/questions/3541963",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/426791/"
] | On some systems, the `delete` key is defined as an alias to `C-d`. This is done through `function-key-map` on GNU Emacs <23 and `local-function-key-map` on GNU Emacs 23. (I've observed this behavior on Debian and Ubuntu 10.04 under X.) The purpose of such translations is to isolate people who code modes from the termin... | You might want to call `global-set-key` interactively to see how it interprets meta-delete. Also try `local-set-key` to ensure the strange binding is not mode-specific. |
440,343 | I try to fine-tune a macro depending on whether it is following a specific character/text. E.g.,
```
This is it! \great! Wait, what is \great?
```
should become
```
This is it! Grrreeeaaat! Wait, what is great?
```
because the first occurence of `\great` was after an exclamation mark, the second just in the middl... | 2018/07/12 | [
"https://tex.stackexchange.com/questions/440343",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/97512/"
] | Use the current space factor code. I also load `amsthm` because
```
\documentclass{article}
% not needed if amsthm is loaded
\def\frenchspacing{\sfcode`\.1006\sfcode`\?1005\sfcode`\!1004%
\sfcode`\:1003\sfcode`\;1002\sfcode`\,1001 }
%%%
\makeatletter
\newcommand{\afterbigpunctornot}{%
\ifnum\spacefactor>\sfcode`... | ```
\documentclass[10pt]{report}
\sfcode`\!=1001
\newcommand\great{\ifnum\spacefactor=1001 Grrreeeaaat\else great\fi}
\begin{document}
This is it! \great! Wait, what is \great?
\end{document}
```
[](https://i.stack.imgur.com/c6qCe.png)
See also... |
8,019,798 | I have tried following the FB mobile web "getting started guide" at:
<https://developers.facebook.com/docs/guides/mobile/web/>
for a web app that I open full-screen on my iphone.
but when I try to login using the fb login page that opens up, I get a blank white screen after I click the "login" button. The user IS logg... | 2011/11/05 | [
"https://Stackoverflow.com/questions/8019798",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/389023/"
] | I found a better answer on this post: [FB.login broken flow for iOS WebApp](https://stackoverflow.com/questions/11197668/fb-login-broken-flow-for-ios-webapp)
```
var permissions = 'email,publish_stream,manage_pages,read_stream';
var permissionUrl = "https://m.facebook.com/dialog/oauth?client_id=" + m_appId + "&respons... | I have found a workaround to the issue... seems there is an undocumented 'redirect\_uri' attribute I can use in the login() method, e.g.
```
login({scope:'email', redirect_uri:'where_to_go_when_login_ends'})
```
It IS documented for fb desktop SDKs, so I gave it a go and it sort of works. When I say "sort of", I me... |
44,726,664 | I have two MySQL tables, one named "stations" and another named "records." "stations" is related to the records listed in "records" by **stations.id=records.stationID**.
Many of my "stations" are not related to any data which appears in the "records" table, and I would like to delete the rows of "stations" in which t... | 2017/06/23 | [
"https://Stackoverflow.com/questions/44726664",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6382627/"
] | Try to use this:
```
DELETE stations FROM stations
LEFT JOIN records on stations.id=records.stationID
WHERE records.stationID IS NULL;
```
Also check do you set index for `records.stationID`. | Try a **LEFT OUTER JOIN :**
```
SELECT * FROM stations
LEFT OUTER JOIN records
ON stations.stationID= records.stationID
WHERE records.stationID IS null
``` |
23,245 | I hesitate between which and that after because:
>
> I prefer orange cars because blue cars would be thought of as the police(,) **which/that** is always aggressive.
>
>
>
Is it a restrictive/non-restrictive issue here? | 2014/05/12 | [
"https://ell.stackexchange.com/questions/23245",
"https://ell.stackexchange.com",
"https://ell.stackexchange.com/users/6391/"
] | There are two issues here:
* The relative clause is non-restrictive clause, and only *wh-* forms may head non-restrictive relative clauses. Both *wh-* and *that* may head restrictive relative clauses. In restrictive clauses, but not non-restrictive clauses, the relativizer may be omitted if it does not stand for the s... | 'which' is used before non-restrictive clause whereas 'that' is used before restrictive clause. Restrictive clause forms unavoided part of the sentence which cannot be left off and non-restrictive clauses are avoidable clauses which cannot be peeled off the sentence. Here police which normally is considered aggressive ... |
56,271,938 | ```
(async function iife () {
const numbers = [1, 2, 3, 4]
let count = 0
async function returnNumberAsync (number) {
return new Promise(resolve => {
setTimeout(() => resolve(number), 0)
})
}
await Promise.all(numbers.map(async number => {
count += await returnNumberAsync(number)
}))
cons... | 2019/05/23 | [
"https://Stackoverflow.com/questions/56271938",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2072165/"
] | When you do `count += await <expression>`, the initial value of `count` to be added to the resolve value is saved *before* the `await` part is resolved. So
```
count += await returnNumberAsync(number)
```
is like
```
count = count + await returnNumberAsync(number)
```
as you can see:
```js
(async function iife (... | It would be more clear what is happening if you rewrite the `async/await` inside the `map()` to `.then`.
```js
function returnNumberAsync(number) {
return new Promise(resolve => {
setTimeout(() => resolve(number), 0);
});
}
(async function iife() {
const numbers = [1, 2, 3, 4];
let count = 0;
await Pro... |
34,310,679 | When I push up to bitbucket using Sourcetree app I get the following code placed into my files. Is there a way I can stop this from happening, My merges are fine when I commit my changes.
```
<<<<<<< HEAD
>>>>>>> de31d33546973a5ebe11787596ffbb4a8000d6fe
```
Thanks | 2015/12/16 | [
"https://Stackoverflow.com/questions/34310679",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5138922/"
] | Those mean you have conflicts in your files and you should resolve them. Go through all files having that and compare between code under `HEAD` and code under `de31d33546973a5ebe11787596ffbb4a8000d6fe`, then keep only what you need.
>
>
> ```
> <<<<<<< HEAD
>
> ```
>
> code of HEAD
>
>
>
> ```
> >>>>>>> de31d33... | When I face the same problem. the best way to get rid of is to **reset all changes,** and to push the last commit to repository. Or you have to solve all the conflicts in the files before pushing them to repository. |
33,366,624 | I'm trying to launch Jupyter with a base directory being the root of my second hard drive. I used to be able to do that just fine with Ipython 3.x until I upgraded to the latest version.
If I cd to D:\ and type `jupyter notebook --debug` the end of the trace I get is:
```
[I 12:15:14.792 NotebookApp] Refusing to serv... | 2015/10/27 | [
"https://Stackoverflow.com/questions/33366624",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2543372/"
] | I am able to see hidden files and folders by launching `jupyter lab` from the command line with the following command:
`jupyter lab --ContentsManager.allow_hidden=True`
To do this I:
* Click the `Anaconda3 (64-bit) menu, then
* Click the `Anaconda3 Prompt (anaconda3)` from the Windows menu.
* I pasted in the command... | a few days ago i had same problem . When you arrange files sharing rules in windows machine , python files can be being hidden unknowingly while you want to hide another files , too .
if jupyter files are in the hidden files like i mentioned above , it has solved by doing this steps;
1. Go to computer ,
2. Hit Alt on... |
58,345,027 | there is a number like
```
int a = 12345;
```
I need to do it separately
```
int arr[4]{1,2,3,4,5};
```
But the fact is, I don’t know what the number will be
it can be long or short. | 2019/10/11 | [
"https://Stackoverflow.com/questions/58345027",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11209230/"
] | Think about what happens when you divide a number by 10.
What is 12345 divided by 10? It is 1234. How much is the remainder of that division? It is 5. You've now split the least significant digit from the rest. How might you get the next digit? Keep in mind that you already have 1234. Well, you repeat the division by ... | Here is my code.
```
// num is input number
void split(long long num)
{
int i;
vector<long long> ve;
ve.clear();
while(num>0){
long long rem=num%10;
ve.pb(rem);
num/=10;
}
//for output array
reverse(ve.begin(),ve.end());
for(i=0;i<ve.size();i++)
co... |
8,602,949 | I have a question about Url.Action.
My position is on <http://localhost/User/Edit> and for some case I have to generate a link with a javascript function, so it would be like this:
```
return '<a href="@Url.Action("Group","Edit")/' +myParameterInJavascript +'>link</a>';
```
If I look to the link, it would be ok, I... | 2011/12/22 | [
"https://Stackoverflow.com/questions/8602949",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/865343/"
] | Try using routing:
```
var url = '@Url.Action("Group", "Edit", new { id = "__id__" })'.replace('__id__', myParameterInJavascript);
return '<a href="' + url + '">link</a>';
``` | Try to use something like that:
```
<a href="@Url.Action("Edit", "Group", new { EditParam = myParameterInJavascript })">
```
When You put parameter use "?" not "/"
```
http://localhost/Group/Edit?ParameterFromJs
``` |
14,341,782 | Is there any way to implement cross database querying in Entity Framework? Let's imagine I've two Entities User and Post, User entity is in database1 and Post is in database2, which means those entities are in separate databases. How should I get user's posts in Entity Framework ? | 2013/01/15 | [
"https://Stackoverflow.com/questions/14341782",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/560153/"
] | I know this is an old question, but this is actually possible. If the databases are on the same server, then all you need to do is use a `DbCommandInterceptor`.
As an example, if I attach a `DbCommandInterceptor` to `MyContext`, I can intercept all command executions and replace the specified table(s) in the query wit... | No, you can't. You will have to create to contexts and do the joining your self. See [here](https://stackoverflow.com/questions/7404690/can-you-have-a-dbcontext-that-is-associated-with-multiple-databases).
You could resolve to database trickery, creating a view in one database the reflects a table in the other one. |
1,217,460 | I have a multiline Bash variable: `$WORDS` containing one word on each line.
I have another multiline Bash variable: `$LIST` also containing one word on each line.
I want to purge `$LIST` from any word present into `$WORDS`.
I currently do that with a `while read` and `grep` but this is not sexy.
```
WORDS=$(ec... | 2017/06/08 | [
"https://superuser.com/questions/1217460",
"https://superuser.com",
"https://superuser.com/users/124122/"
] | This should accomplish what you're trying to do.
```
WORDS=$(echo -e 'cat\ntree\nearth\nred')
LIST=$(echo -e 'abcd\n1234\nred\nwater\npage\ncat')
echo "$LIST" | awk -v WORDS="$WORDS" '
BEGIN {
split(WORDS,w1,"\n")
for (w in w1) { w2[w1[w]] = 1 }
}
{
if (w2[$0] != 1) { print $0 }
}'
```
Here's how it works. Fi... | I suggest
```
echo "$LIST" | grep -vf <(echo "$WORDS")
``` |
4,408,813 | I'm converting an image from .png to .eps and it hugely increases the file size.
Can anyone explain why this is, and how to prevent it increasing so much.
I'm using Unix [convert](http://www.imagemagick.org/script/convert.php): `convert image.png image.eps`
Thanks for any help | 2010/12/10 | [
"https://Stackoverflow.com/questions/4408813",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/418810/"
] | Converting a PNG file (designed for bitmap data) into an EPS (designed for vector data) is always going to result in a larger file size, as the EPS is effectively just wrapping an EPS data structure around the original image data (which it most likely won't store in anywhere near as effective a manner as a PNG file).
... | It is possible that the problem is that the `convert` application you use just does not support embedding PNG into EPS. When using properly configured Adobe Acrobat Professional I newer got unexpectedly huge increase of the file size. But you should properly configure first your "PNG to PDF" conversion settings. Then y... |
187,415 | I try to launch Firefox over SSH, using
```
ssh -X user@hostname
```
and then
```
firefox -no-remote
```
but it's very very slow.
How can I fix this? Is it a connection problem? | 2015/02/28 | [
"https://unix.stackexchange.com/questions/187415",
"https://unix.stackexchange.com",
"https://unix.stackexchange.com/users/90717/"
] | X11 is an outdated protocol. For example if a software writes the letter "A" over and over into the same spot it will be retransmitted over and over again. A lot of modern GUIs tend to redraw stuff which didn't change and X11 will happily retransmit every atomic screen-output. In other words, it does not transmit pixel... | Also we got a good solution with Xvfb (X virtual framebuffer)
on remote server as admin (Centos 7 example)
```
yum install Xvfb xauth x11vnc firefox
```
on remote server as normal user
```
Xvfb :1 &
x11vnc -display :1 --localhost &
export DISPLAY=:1
firefox
```
on local computer:
```
vncviewer -via www.example... |
223,075 | On all web services that require passwords, like gmail, you are asked to set a long password. Like 8 characters or more.
The reason being higher security.
But the same services limit the number of login attempts to 3-4 tries before locking your account and asking for more info. Something which I find very annoying, b... | 2019/12/21 | [
"https://security.stackexchange.com/questions/223075",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/187422/"
] | It's not as simple...
### About online brute force
If an account becomes completely locked after 3 attempts, it will be easy to make a [*`DOS`* (Denial Of Service) attack](https://en.wikipedia.org/wiki/Denial-of-service_attack) by locking all accounts!
Servers have to base locking decision not only on number of bad ... | To prevent "password spraying" where someone tries a common password against many accounts. |
2,834,263 | I want to change an image periodically in a `UIImageView` in my application, and the image will come from the web. Can I run JavaScript enabled pages in a `UIWebView`? Or are there any other ways to implement this? | 2010/05/14 | [
"https://Stackoverflow.com/questions/2834263",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/221325/"
] | Fully qualify the exception type.
```
public void insertIntoCell.. throws com.sun.star.lang.IndexOutOfBoundsException {
}
```
I'm presuming here that you do not intend to throw `java.lang.IndexOutOfBoundsException`, which is an unchecked `RuntimeException`, but I could be wrong.
You can also use a [single-type impo... | IndexOutOfBoundsException is ambiguous because there are two classes named IndexOutOfBoundsException within two different packages (com.sun.star.lang and java.lang). You need to tell the compiler which one you mean by prefixing IndexOutOfBoundsException with the correct package name. |
36,765,142 | I have an xElement data `<a><item><item1/><item2/></item></a>`
Need to replace item node with another node .
How can we achieve this?
I just need to replace item node with some other node say `<b><b1/></b>`
I want output as `<a><b><b1/></b></a>` | 2016/04/21 | [
"https://Stackoverflow.com/questions/36765142",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3913587/"
] | This never worked for me on Windows 10 even if it is a linux container:
```
-v /var/run/docker.sock:/var/run/docker.sock
```
But this did:
```
-v /usr/local/bin/docker:/usr/bin/docker
```
Solution taken from this issue i opened: <https://github.com/docker/for-win/issues/4642> | This is what actually made it work for me
```
docker run -p 8080:8080 -p 50000:50000 -v D:\docker-data\jenkins:/var/jenkins_home -v /usr/local/bin/docker:/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock -u root jenkins/jenkins:lts
``` |
53,691,618 | I'm building a React Native app using TypeScript. I'm trying to use a [`SectionList`](https://facebook.github.io/react-native/docs/sectionlist). I followed the docs, and here is my code:
```
renderSectionHeader = ({ section: { title } }: { section: { title: string } }) => (
<ListItem title={title} />
);
ren... | 2018/12/09 | [
"https://Stackoverflow.com/questions/53691618",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8331756/"
] | This is the `SectionListData` declaration, so you just need to remove the `title` property, and replace it with `key`, then `TSLint Error` will disappear.
```
export interface SectionBase<ItemT> {
data: ReadonlyArray<ItemT>;
key?: string;
renderItem?: SectionListRenderItem<ItemT>;
ItemSeparatorCompo... | The following works for me
```
interface Group {
title: string;
data: readonly Item[]; // Important to add readonly
}
private scroll: RefObject<SectionList<Item>>;
public renderItem = ({ item }: ListRenderItemInfo<Item>): ReactElement => (
<ReactItem />
);
public renderSectionHeader = ({
section,
}: {
se... |
32,184 | If a layer 2 managed switch supports management functions and entails a "management plan" it must require an OS.
If it is a typical network operating system, \*nix based, does is have a full file system?
Would I be able to write an application and run it on the cpu of the switch? | 2016/06/12 | [
"https://networkengineering.stackexchange.com/questions/32184",
"https://networkengineering.stackexchange.com",
"https://networkengineering.stackexchange.com/users/21360/"
] | I think it depends what brand and what OS it is running.
Cisco devices run their own proprietary version of IOS, which as far as I know doesn't support custom applications.
Juniper, on the other hand, is running JunOS based on FreeBSD, so there might be some chance, but I think it will be limited at best.
Some small... | As a philosophy ARISTA encourages customers and partners to run standard Linux applications on their switches, publishing all necessary APIs etc.
As for resources, ARISTA is making very low latency-switches with high port density for 10G/40G/100G, and therefore high CPU power and ample memory is provided. One exampl... |
7,456,148 | I'm looking for an algorithm to overlay a color on top of existing picture. Something similar to the following app (wall painter): <http://itunes.apple.com/us/app/wall-painter/id396799182?mt=8>
I want a similar functionality so I can paint walls in an existing picture and change them to a different color.
I can work ... | 2011/09/17 | [
"https://Stackoverflow.com/questions/7456148",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/306764/"
] | Look at the [time](http://linux.die.net/man/7/time) command. It tracks both the CPU time a process uses and the wall-clock time. You can also use something like [gprof](http://sourceware.org/binutils/docs/gprof/) for profiling your code to find the parts of your program that are actually taking the most time. You could... | What do you use for timing execution time so far? There's C89 `clock()` in `time.h` for starters. On unixoid systems you might find `getitimer()` for `ITIMER_VIRTUAL` to measure process CPU time. See the respective manual pages for details.
You can also use a POSIX shell's `times` utility to benchmark the processor ti... |
32,919,631 | Ionic modal comes with the standard animation of `slide-in-up`. Is it possible that we can change the animation to `fade-in`? | 2015/10/03 | [
"https://Stackoverflow.com/questions/32919631",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1995781/"
] | In order to add custom transitions for Ionic Modal We will be using Ionic Modal Options `enterAnimation` and `leaveAnimationfrom` ModalOptions interface. For a modal there are transition states: On Enter of modal and and On Leave of modal when we close it. If you look at the Ionic Modal options interface you will find ... | You can add your own animation css, ex:
```
.slide-in-right {
-webkit-transform: translateX(100%);
transform: translateX(100%); }
.slide-in-right.ng-enter, .slide-in-right > .ng-enter {
-webkit-transition: all cubic-bezier(0.1, 0.7, 0.1, 1) 400ms;
transition: all cubic-bezier(0.1, 0.7, 0.1, 1) 400ms; }
.sl... |
690,176 | Have a look at this code:
```
#include <iostream>
using namespace std;
int main()
{
const char* str0 = "Watchmen";
const char* str1 = "Watchmen";
char* str2 = "Watchmen";
char* str3 = "Watchmen";
cerr << static_cast<void*>( const_cast<char*>( str0 ) ) << endl;
cerr << static_cast<void*>( cons... | 2009/03/27 | [
"https://Stackoverflow.com/questions/690176",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1630/"
] | You surely *should not* rely on that behavior, but most compilers will do this. Any literal value ("Hello", 42, etc.) will be stored once, and any pointers to it will naturally resolve to that single reference.
If you find that you need to rely on that, then be safe and recode as follows:
```
char *watchmen = "Watchm... | No, it can't be relied on, but storing read-only string constants in a pool is a pretty easy and effective optimization. It's just a matter of storing an alphabetical list of strings, and then outputting them into the object file at the end. Think of how many "\n" or "" constants are in an average code base.
If a com... |
53,507,437 | I'm creating an app with React, Redux, Ant-Design, LESS and many other modules.
I have to fetch the Primary color from the DB and I assign it to a CSS variable (--primary-color). I darken the color and assign it to an other CSS variable (--primary-color-darken). I use CSS variables instead of LESS variables because the... | 2018/11/27 | [
"https://Stackoverflow.com/questions/53507437",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Wrap in `:global` like so:
```css
:global(.ant-btn-primary) {
background-color: var(--secondary-color);
&:hover {
background-color: var(--secondary-hover-color) !important;
border-color: var(--secondary-hover-color) !important;
}
}
``` | Just add the atribute :hover on the CCS class
```css
.ant-btn-primary {
background: #yourColor;
border-color: #yourColor;
}
.ant-btn-primary:hover {
background: #yourColor;
border-color: #yourColor;
}
``` |
257 | I am looking for video lectures to go through to guide my reading in intro molecular and cellular biology. I've had intro bio and I study evolutionary theory, but my molecule- and cell-level knowledge is weak.
I'm finding it impossible to know where to look in a big book like Alberts, or to read Lodish without a guid... | 2011/12/21 | [
"https://biology.stackexchange.com/questions/257",
"https://biology.stackexchange.com",
"https://biology.stackexchange.com/users/16/"
] | While not exclusively cell and molecular biology, I would also like to add the [Journal of Visualized Experiments](http://www.jove.com/). It's like Youtube for experiments. :) | The Journal of Visualized Experiments ([jove.com](http://www.jove.com/)) is excellent but based on experimental protocols.
[ItunesU](https://www.apple.com/apps/itunes-u/) also has great resources. Stay away from youtube - a lot of people there don't know what they are talking about. |
476,446 | If f is differentiable at $x$ then for $\alpha\neq1$ $$f'(x)=\lim\_{c\to 0} {{f(x+c)-f(x+\alpha c)}\over{c-\alpha c}}.$$ I am not really sure what it is I need to even show to prove the statement. | 2013/08/26 | [
"https://math.stackexchange.com/questions/476446",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/91800/"
] | Using just the derivative definition:
$$ \lim\_{c\to0}{{f(x+c)-f(x+\alpha c)}\over{c-\alpha c}}=\frac{1}{1-\alpha}\lim\_{c\to0}{{f(x+c)-f(x)}\over{c}}-\frac{\alpha}{1-\alpha}\lim\_{\alpha c\to0}{{f(x+\alpha c)-f(x)}\over{\alpha c}}\\=\frac{f'(x)}{1-\alpha}-\frac{\alpha f'(x)}{1-\alpha}=f'(x)
$$ | Hint: try with
$$\frac{f(x+c)-f(x+\alpha c)}{c(1-\alpha)}=\frac{f(x+c)-f(x)+f(x)-f(x+\alpha c)}{c(1-\alpha)}=\\\frac{1}{1-\alpha}\frac{f(x+c)-f(x)}{c}-\frac{1}{1-\alpha}\frac{f(x+\alpha c)-f(x)}{c};$$
Now
$$f(x+\alpha c)-f(x)=f'(x)\alpha c+O(c^2),$$
and so
$$\lim\_{c\rightarrow 0}\frac{f(x+c)-f(x+\alpha c)}{c(1-\a... |
84,842 | Does anyone here know how I can create tileable images like this one:
[](https://i.stack.imgur.com/ewXV1.jpg)
Can I use photoshop? any good tutorial?
I am a novice when it comes to design. | 2017/02/08 | [
"https://graphicdesign.stackexchange.com/questions/84842",
"https://graphicdesign.stackexchange.com",
"https://graphicdesign.stackexchange.com/users/85988/"
] | This is an ordinary black and white image clouds or a desaturated color image. This clouds, for example, is an inverted to a negative. I suggest you to invert it back and you can see:
[](https://i.stack.imgur.com/zNizB.jpg)
Quite dark! Probably the n... | So these days there are tile plugins etc, but the way to do this manually is, at its most basic:
Take an image.
Make a selection that is exactly 1/2 the width and 1/2 the height, copy it, and then paste it into a new layer or doucment such that it is in the opposite quadrant of the image (if it is the upper left, pas... |
46,967,067 | i am new to ionic and there are some problems i am facing like the file structure is very different. like there is no `lib` folder no `app.js` file there is no `angular.module('myApp')` code anywhere.
help me out with it my whole work is pending.
i have tried re-installing ionic and cordove but didn't made any differen... | 2017/10/27 | [
"https://Stackoverflow.com/questions/46967067",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4826930/"
] | In python 3, using dictionary.items() returns an iterator of key-value pairs. You can print through them like this.
```
for key, value in d.items():
print(key, value)
```
you can also print them directly:
```
for i in d:
print (i, d[i])
```
You can add the numbering and format this however you want
... | I did the following code. it uses pandas
```
import pandas as pd
ast = {
"number":6,"message":"success","people":
[{"name":"Sergey Ryazanskiy","craft":"ISS"},{"name":"Randy Bresnik",
"craft":"ISS"}, {"name":"Paolo Nespoli","craft":"ISS"}, {"name" :
"Alexander Misurkin","craft":"ISS"},{"name":"Mark Van... |
52,948,611 | I am creating Binding DLL for Xamarin.Mac using the Binding project in visual studio Mac.
I am able to build Binding DLL successfully, However while going to use that binding DLL in Xamarin.Mac project then it returns bellow error.
MMP : error MM5109: Native linking failed with error code 1. Check build log for detai... | 2018/10/23 | [
"https://Stackoverflow.com/questions/52948611",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10489885/"
] | You will need to use `getComputedStyle()` for that:
```
var navColor = getComputedStyle(nav).color;
``` | You can query the applied css rule by calling `getComputedStyle(document.querySelector("nav")).color` |
65,628,070 | How to get UTC from timezone with python?
Timezone: `Asia/Pontianak`
From timezone (Asia/Pontianak), will resulted `+7`, `+8` or something like that. | 2021/01/08 | [
"https://Stackoverflow.com/questions/65628070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13717698/"
] | In `test`, the `println` that prints the thread ID is executed outside of the future, therefore it's executed synchronously. The code inside the future will get executed on a thread of the `ExecutionContext` (in this case the actor system's dispatcher). It's worth noting that some parallel execution happened: the threa... | The computation in your example does run in parallel, the reason why it shows the same thread is because the items from `Source(1 to 10)` are dispatched to one actor that this whole stream is run by. If you change your `test` to be say:
```
private def test(a: Int) = {
println(s"Flow A : ${Thread.currentThread().g... |
58,917,530 | I'd bind a button to input using v-bind with a function :
The code inside my **template** :
```
<template>
<input
type="email"
v-model="email"
v-bind:placeholder="$t('fields.email_place_holder')"
/>
<input
v-bind:disabled="{ isDisable }"
type="submit"
v-bind:value="$t('buttons.notify_me'... | 2019/11/18 | [
"https://Stackoverflow.com/questions/58917530",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7551963/"
] | The easy way to do it is to check if the value exists or not.
For example:
```
<input type="text" v-model="user.name" required />
```
For the submit button just use disable
```
<button type="submit" :disabled="!user.name">Submit</button>
```
Only when the field is filled then the submit button is enabled for subm... | Try this:
```html
<button type="button" class="btn btn-primary btn-sm ripple-surface" v-
bind:disabled='!isDisabled'>Save</button>
```
```js
computed: {
isDisabled() {
return this.categoryName.length > 0;
}
},
``` |
54,131,363 | I have a JSON data which looks like this:
```
{
"status": "status",
"date": "01/10/2019",
"time": "10:30 AM",
"labels": {
"field1": "value1",
"field2": "value2",
...
"field100": "value100"
}
"description": "some description"
}
```
In my Java code, I have two classes:
1. `Alerts` class whic... | 2019/01/10 | [
"https://Stackoverflow.com/questions/54131363",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1244329/"
] | You can use TypeToken to directly specify labels.
```
import java.lang.reflect.Type;
import com.google.gson.reflect.TypeToken;
Type mapType = new TypeToken<Map<String, String>>(){}.getType();
Map<String, String> myMap = gson.fromJson("{'field1':'value1','field2':'value2'}", mapType);
``` | For general cases - some more flexible way: gson can register type adapters:
```
Gson gson = new GsonBuilder().registerTypeAdapter(Labels.class, new LabelsDeserializer()).create();
```
And deserializer for your case is:
```
public class LabelsDeserializer implements JsonDeserializer<Labels>
{
@Override
publ... |
71,305,004 | Unhandled Exception: type '(dynamic) => Store' is not a subtype of type '(String, dynamic) => MapEntry<dynamic, dynamic>' of 'transform'
The Json Data its on Object type How Can we Access the Datum and Return List of Datum Values
The Below Code is Model of Json Data
```
List<Store> storeFromJson(String str) =>
L... | 2022/03/01 | [
"https://Stackoverflow.com/questions/71305004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | You can **not** update the style of the browser picker at the moment. | There isn't (currently) a way to modify it.
This is one of the browser special permissions dialogs (See <https://permission.site/> for more). I believe it is vital that these dialogs cannot be forged or be misleading to maintain trust with the users- although I wasn't able to find anything in the spec calling this out... |
36,383,965 | I'm using the latest [Django OAuth2 Toolkit (0.10.0)](https://github.com/evonove/django-oauth-toolkit) with Python 2.7, Django 1.8 and Django REST framework 3.3
While using the `grant_type=password`, I noticed some weird behavior that any time the user asks for a new access token:
```
curl -X POST -d "grant_type=pass... | 2016/04/03 | [
"https://Stackoverflow.com/questions/36383965",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5601726/"
] | If you like to remove all previous access tokens before issuing a new one, there is a simple solution for this problem: **Make your own token view provider!**
The code bellow will probably help you to achieve that kind of functionality:
```
from oauth2_provider.models import AccessToken, Application
from braces.views... | >
> What I need is that every time a user asks for a new access token, the
> old one will become invalid, unusable and will be removed.
>
>
>
Giving a new token when you ask for one seems like an expected behavior. Is it not possible for you to [revoke](https://django-oauth-toolkit.readthedocs.org/en/latest/tutor... |
1,256,191 | >
> Prove that $371\cdots 1$ is not prime.
>
>
>
I tried mathematical induction in order to prove this, but I am stuck.
My partial answer:
To be proved is that $37\underbrace{111\cdots 1}\_{n\text{ ones}}$ is never prime for $n\geq 1$. Let $P(n)$ be the statement that $37\underbrace{111\cdots 1}\_{n\text{ enen}}... | 2015/04/28 | [
"https://math.stackexchange.com/questions/1256191",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/221219/"
] | First note that $111111=3 \cdot 7 \cdot 11\cdot 13\cdot 37$.
If $371\cdots 1$ is divisible by any of these prime factors, so will be that number followed by six ones. It suffices to look at the factorizations of $371$, $3711$, $37111$, $371111$, $3711111$, and $37111111$.
$371 = \mathbf{7} \cdot 53$
$3711 = \mathbf... | **Hint** $\ $ Do a [covering congruence argument](https://math.stackexchange.com/a/1153492/242) mod $\color{#c00}6$ using the divisors $3,7,13,37\,$ of $\,10^{\color{#c00}6}-1$ |
46,775,309 | Im using EsLint with VsCode.
How can I have an error appear when trying to import a module that doesn't exist ?
for example
```
import foo from './this-path-doesnt-exist'
```
Should underline in red.
Does this require an eslint plugin ? | 2017/10/16 | [
"https://Stackoverflow.com/questions/46775309",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6797267/"
] | If you are using eslint as your linter, you can use [eslint-plugin-import](https://www.npmjs.com/package/eslint-plugin-import) .
>
> This plugin intends to support linting of ES2015+ (ES6+) import/export
> syntax, and prevent issues with misspelling of file paths and import
> names
>
>
> | In addition to the eslint plugin suggested, you can enable semantic checking for a JS file in VS Code by adding `// @ts-check` at the top of the file:
```
// @ts-check
import foo from './this-path-doesnt-exist'
```
[](https://i.stack.imgur.com/bVRYn... |
30,478,070 | When I'm trying to drop table then I'm getting error
```
SQL Error: ORA-00604: error occurred at recursive SQL level 2
ORA-01422: exact fetch returns more than requested number of rows
00604. 00000 - "error occurred at recursive SQL level %s"
*Cause: An error occurred while processing a recursive SQL statement
... | 2015/05/27 | [
"https://Stackoverflow.com/questions/30478070",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1162620/"
] | I noticed following line from error.
```
exact fetch returns more than requested number of rows
```
That means Oracle was expecting one row but It was getting multiple rows. And, only dual table has that characteristic, which returns only one row.
Later I recall, I have done few changes in dual table and when I exe... | One possible explanation is a database trigger that fires for each `DROP TABLE` statement. To find the trigger, query the `_TRIGGERS` dictionary views:
```
select * from all_triggers
where trigger_type in ('AFTER EVENT', 'BEFORE EVENT')
```
disable any suspicious trigger with
```
alter trigger <trigger_name> dis... |
45,381,783 | How do I get ARC onto its own line? I put them both in the same div to share a background, but I am having trouble separating the two. My menu bar is perfectly centered until I put in "ARC".
```css
.header{
background-image: url(https://static.pexels.com/photos/204495/pexels-photo-204495.jpeg);
background-size: ... | 2017/07/28 | [
"https://Stackoverflow.com/questions/45381783",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/8286358/"
] | Here's one way. The inner query gets the max date for each id. Then you can join that back to your main table to get the rows that match.
```
select
*
from
<your table>
inner join
(select id, max(<date col> as max_date) m
where yourtable.id = m.id
and yourtable.datecolumn = m.max_date)
``` | Have you tried the following:
```
SELECT ID, COUNT(*), max(date)
FROM table
GROUP BY ID;
``` |
8,756 | I recently bought a Canon 1000d DSLR. I'm just an amateur and don't use my camera daily. I use it once or twice a week. Is it okay if I leave the batteries in the camera during this idle time? | 2011/02/15 | [
"https://photo.stackexchange.com/questions/8756",
"https://photo.stackexchange.com",
"https://photo.stackexchange.com/users/2867/"
] | Yes, it is completely fine to leave your camera's batteries in for an extended period of time. As long as the camera is completely off, then you shouldn't have a problem. Hope this helps! | It's okay. I do it all the time. Just check if it turns on every day. |
58,310,570 | Having fun in c++ on CodeWars trying to reverse the letters of the words in a string, words delimited by spaces ie. "Hello my friend" --> "olleH ym dneirf", where extra spaces are not lost.
My answer is failing the tests, but when I diff my answer and the suggested answer there is no output. I also tried checking the ... | 2019/10/09 | [
"https://Stackoverflow.com/questions/58310570",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7696758/"
] | You're likely ending up with unprintable 'characters' in your string since you're trying to access off the end of a string.
```cpp
for(int j = word.length(); j >= 0; j--){
revWord.push_back(word[j]);
}
```
Here you set a variable to be equal to the word length, and then this variable is used to read one byte pas... | There is a much simpler way to implement your `reverse()` function, using the [`std::reverse()`](https://en.cppreference.com/w/cpp/algorithm/reverse) algorithm to modify the original `std::string` object inline and not use any additional `std::string` objects at all:
```cpp
std::string reverse(std::string str)
{
s... |
8,097,902 | Which of the two of these are preferable (and why) from the service installer, I've seen both mentioned on different websites (and here on stackoverflow [Automatically start a Windows Service on install](https://stackoverflow.com/questions/1036713/automatically-start-a-windows-service-on-install/1042986#1042986) and [H... | 2011/11/11 | [
"https://Stackoverflow.com/questions/8097902",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/353147/"
] | I consider the latter a little more proper (although a quick check of my codebase and I coded essentially the former). The difference I see is the chance of a Rollback happening. In the commit phase you are past the risk of a rollback. But if you start your service in the AfterInstall (which is just part of the overall... | In C# in your service project you will have an installer class called ProjectInstaller.cs, modify it to override the AfterInstall event handler to autostart the service like the code below
```
[RunInstaller(true)]
public partial class ProjectInstaller : System.Configuration.Install.Installer
{
public ProjectInstal... |
19,471,495 | I want to know what is exactly CLSID data type, as it is used in C++, and I want to use it in delphi.
* what is CLSID? | 2013/10/19 | [
"https://Stackoverflow.com/questions/19471495",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2896601/"
] | A CLSID is a GUID that identifies a COM object. In order to instantiate a registered COM object, you need to know its CLSID.
Typically in Delphi you would be calling `CoCreateInstance`. You simply call the function and pass a CLSID. The declaration of `CoCreateInstance` declares the class ID parameter as having type `... | >
> **What is a CLSID?** A Class ID (CLSID) is a 128 bit (large) number that represents a unique id for a software application or application
> component. Typically they are displayed like this
> "{AE7AB96B-FF5E-4dce-801E-14DF2C4CD681}".
>
>
> You can think of a CLSID as a "social security number" for a piece of
>... |
28,275,450 | I want java to look for .properties file in same folder with jar which is running. How can I do it and how can I determine if app is running in IDE or as explicit jar file | 2015/02/02 | [
"https://Stackoverflow.com/questions/28275450",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4393559/"
] | Firstly I have to say that this is inherently a bad practice, though life often is not perfect and sometimes we have to roll with the bad design punches.
This is the class I mustered up for a pet project of mine that required such functionality:
```
public class ArbitraryPath {
private static Logger logger = Log... | ```
String absolutePath = null;
try {
absolutePath = (new File(Utils.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath())).getCanonicalPath();
absolutePath = absolutePath.substring(0, absolutePath.lastIndexOf(File.separator))+File.separator;
} catch (URISyntaxException ex) {
Logger.g... |
1,283 | I started looking at one of the rather [complicated questions](https://puzzling.stackexchange.com/questions/548/fastest-way-to-collect-an-arbitrary-army) and began formulating answers based on compartmentalizing the problem into smaller, simpler problems. I need a place to write down the current progress but since I ha... | 2014/06/24 | [
"https://puzzling.meta.stackexchange.com/questions/1283",
"https://puzzling.meta.stackexchange.com",
"https://puzzling.meta.stackexchange.com/users/1622/"
] | Here are two separate points:
1. **Are answers, which doesn't fully answer the question acceptable?**
I think yes, because:
1. Many questions here are not about facts, but solutions, sometimes of a complicated problems, so any help can be appreciated by the user who ask.
2. They can contain useful and related to... | While I hesitate to suggest posting an incomplete answer, I have seen a number of such answers posted and upvoted, so I'd say post one or two and see what the community has to say about them. I think it's much more reasonable and accepted here than elsewhere on the network. |
37,219,819 | I know I must missed something because none of the example of works in my computer.
Take the simplest first [example](http://semantic-ui.com/modules/dropdown.html#/usage) at the website.
I copied the code AS IS and it doesn't work at all for me. I included the *semantic.min.css* and *semantic.min.js* also just in cas... | 2016/05/13 | [
"https://Stackoverflow.com/questions/37219819",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5736676/"
] | i use this order of linking js files and work fine
```
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="../bower_components/jquery/dist/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="../bower_components/semantic/di... | I need to include jQuery before including .js and .css |
17,469,682 | I'm working on a Django 1.5 project and I have a custom user model (let's call it `CustomUser`). Another app (SomeApp) needs to reference this custom user model. For the purposes of ForeignKey and such, the Django documentation says to use
```
User = settings.AUTH_USER_MODEL
```
However, some functions in SomeApp.m... | 2013/07/04 | [
"https://Stackoverflow.com/questions/17469682",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/224511/"
] | The Django documentation has the answer: <https://docs.djangoproject.com/en/dev/topics/auth/customizing/#django.contrib.auth.get_user_model>
The most relevant section: *Generally speaking, you should reference the User model with the AUTH\_USER\_MODEL setting in code that is executed at import time. get\_user\_model()... | Are you running South 0.8.3?
Ensure that you running South at least **0.8.4**
GitHub [issue](https://github.com/pennersr/django-allauth/issues/449#issuecomment-28977159)
South Release [Notes](http://south.readthedocs.org/en/latest/releasenotes/0.8.4.html#release-notes) |
283,170 | We already had multiple questions about unbalanced data when using [logistic regression](https://stats.stackexchange.com/questions/6067/does-an-unbalanced-sample-matter-when-doing-logistic-regression), [SVM](https://stats.stackexchange.com/questions/94295/svm-for-unbalanced-data), [decision trees](https://stats.stackex... | 2017/06/02 | [
"https://stats.stackexchange.com/questions/283170",
"https://stats.stackexchange.com",
"https://stats.stackexchange.com/users/35989/"
] | Not a direct answer, but it's worth noting that in the statistical literature, some of the prejudice against unbalanced data has historical roots.
Many classical models simplify neatly under the assumption of balanced data, especially for methods like ANOVA that are closely related to experimental design—a traditional... | For me the most important problem with unbalanced data is the baseline estimator. For example, you have two classes with 90% and 10% sample distribution. But what does this mean for a dummy or naive classifier? You can infer this meaning by comparing it with a baseline’s performance. You can always predict the most fre... |
8,859 | The word for G-d in [Genesis 1:1](https://www.sefaria.org/Genesis.1.1?lang=bi&aliyot=0) is plural in all the manuscripts, there's no debating that it's plural.
So really it should read "In the Beginning Gods created the heavens and the earth."
Why is this plural?
... or, is there debating on what it says? | 2011/07/13 | [
"https://judaism.stackexchange.com/questions/8859",
"https://judaism.stackexchange.com",
"https://judaism.stackexchange.com/users/746/"
] | It's not in the plural form, see how the verb is.
Another example in Hebrew is the word "maim" (water), which has no singular or plural.
This may seem plural to you but it actually isn't, simply because God is one.
Your question is basically on the quality of the translation.
One can see (at least as a reflection) the... | The text in Hebrew is: (transliterated)
>
> "Bereshit bara Elohim et hashamayim ve'et ha'aretz"
>
>
>
Grammatically, there are 3 nouns, 1 verb and one adverb. The one verb is singular, 2 of the nouns have a plural suffix, and one of the nouns is singular, and the adverb "Bereshit" is also singular.
Since there ... |
39,883 | What are the differences between Ethereum Sharding Proposal and Plasma? I know plasma can run on top of sharding, but what are the differences innterms of paradigm and technology? | 2018/02/16 | [
"https://ethereum.stackexchange.com/questions/39883",
"https://ethereum.stackexchange.com",
"https://ethereum.stackexchange.com/users/22865/"
] | The first phase implementation of sharding and Plasma are both essentially sidechains that tie into the main chain via smart contracts. However, the responsibilities of these smart contracts and properties of the sidechains is different for each project.
Plasma sidechains are somewhat similar to state channels (e.g. L... | The above answer is outdated on sharding, notaries are used instead of validators. See <https://github.com/ethereum/wiki/wiki/Sharding-FAQ#how-does-plasma-state-channels-and-other-layer-2-technologies-fit-into-the-trilemma>.
After editing the above post, it is outdated again with the [latest spec](https://notes.ethere... |
3,305,004 | As an answer to a question I asked yesterday ([New Core Data entity identical to existing one: separate entity or other solution?](https://stackoverflow.com/questions/3293832/new-core-data-entity-identical-to-existing-one-separate-entity-or-other-solution)), someone recommended I index an attribute.
After much searchi... | 2010/07/22 | [
"https://Stackoverflow.com/questions/3305004",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/196760/"
] | Simplistically, indexing is a kind of presorting. If you have a numerical attribute index, the store maintains linked list in numerical order. If you have a text attribute, it maintains a linked list in alphabetical order. Depending on the algorithm, it can maintain other kinds of information about the attributes as we... | All these answers are good, but overly technical.
An index is pretty much identical to the index you'd find in the back of a book. Thus if you wanted to find which page a certain word occurred at, you'd go through it alphabetically and thus quickly find the all the pages where that word occurred.
If you didn't have a... |
29,005,275 | **Important note**
The focus of this question is on API endpoints that differentiate *which resources are returned depending who authenticates*, e.g. Alice gets resource A and B returned, and Bob gets resource X and Y.
It is **NOT** about differentiating the representation of resources returned.
All the endpoints ... | 2015/03/12 | [
"https://Stackoverflow.com/questions/29005275",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/889617/"
] | UPDATED 18 March 2015 13:05 CET to include feedback in the comments of the question and answers given.
**RESTfulness**
From a purist point of view non of the endpoints are RESTful. For instance, the question doesn't state if the responses contain links to the resources such that the client can retrieve the resources ... | Well, first of all, in HTTP the representation of a resource is handled by the header Content-Type and Accept.
But the clients can only suggest the format they prefer. The server is in charge of serve the representation that he wants.
Talking about security, it's perfectly right for me to return a representation base... |
383,272 | I'm am looking to create a vehicle that can break sand block, although I don't know how. I have the body, the last thing I need is a contraption that can brake sand blocks in Minecraft | 2021/03/11 | [
"https://gaming.stackexchange.com/questions/383272",
"https://gaming.stackexchange.com",
"https://gaming.stackexchange.com/users/268517/"
] | Frits34000 and a couple other redditors for a good while worked on 'sand quarry' machines - you can find the assorted designs on [r/redstone](https://www.reddit.com/r/redstone/search?q=sand+quarry&restrict_sr=on&include_over_18=on).
The gist of it is to lift the sand block using a sticky piston, and while it is still ... | So your trying to make a “bulldozer” vehicle. If sand falls on slabs or anything with a height of less than a block. BUT the only one that is pushable is a slab. So you can simply put slabs in front of the vehicle and move it. Note that any sand NOT above the slabs will not break. |
58,009,403 | What I tried so far is as follow:

kindly describe in details how many ways you can read .csv, what I learned so far you need to provide a schema name for the file and then define a schema in the form of .avro or text.
is it necessary to provide sc... | 2019/09/19 | [
"https://Stackoverflow.com/questions/58009403",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10196724/"
] | Instead of split You could consider using regex to extract a number from string
```
console.log(/\d+/.exec('test1')) --> ["1"]
``` | Just replace `Number(test[0].split('test')[1])`
with
`Number(test[0].split('').filter(x => !isNaN(parseInt(x, 10))))`
Try like this:
```
this.data.forEach(test => {
this.result.run.data.push([
Number(test[0].split('').filter(x => !isNaN(parseInt(x, 10)))),
Number(test[1])
]);
...
});
```
**See [Wo... |
5,522,432 | I have a piece of C# code that validates a textbox field to be positive numeric
```
Regex isPositiveInt = new Regex("[^0-9]");
return !isPositiveInt.IsMatch(textbox1.Text)
```
I found if the regex matches, it gives "false" and when it doesn't match, it gives "true". So I have to add a "!" to the return value. There ... | 2011/04/02 | [
"https://Stackoverflow.com/questions/5522432",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/529310/"
] | The `^` meta-character has two meanings in regexes - to mark the start of the string when used by itself, and as part of the `[^...]` pattern meaning "don't match any of the characters in the `[...]` block". I think perhaps you intended `^[0-9]` instead, which will match any string that starts with a digit. It won't ma... | The `^` in the regex character class means: is NOT in the set of `0` to `9`. To match positive integers you want:
```
[0-9]+
```
meaning one or more characters from the set of 0 to 9.
Note: this will also match 0 which, strictly speaking, is not a positive integer. The expression actually matches non-negative integ... |
6,919,275 | Is there any feature in IIS 7 that automatically deletes the logs files older than a specified amt of days?
I am aware that this can be accomplished by writing a script(and run it weekly) or a windows service, but i was wondering if there is any inbuilt feature or something that does that.
Also, Currently we turned l... | 2011/08/02 | [
"https://Stackoverflow.com/questions/6919275",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/814352/"
] | You can create a task that runs daily using Administrative Tools > Task Scheduler.
Set your task to run the following command:
```
forfiles /p "C:\inetpub\logs\LogFiles" /s /m *.* /c "cmd /c Del @path" /d -7
```
This command is for IIS7, and it deletes all the log files that are one week or older.
You can adjust ... | Similar solution but in powershell.
I've set a task to run powershell with the following line as an Argument..
```
dir D:\IISLogs |where { ((get-date)-$_.LastWriteTime).days -gt 15 }| remove-item -force
```
It removes all files in the D:\IISLOgs folder older than 15 days. |
151,867 | Given:
```
*Main> :t text
text
:: (Selectable s, StringLike str, Ord str) => s -> Scraper str str
```
I need to perform "second level" `fmap` operation:
```
*Main> let z = fmap (fmap (:[])) text
*Main> :t z
z :: (Selectable s, StringLike a, Ord a) => s -> Scraper a [a]
```
On one hand `z` follows API structure,... | 2017/01/06 | [
"https://codereview.stackexchange.com/questions/151867",
"https://codereview.stackexchange.com",
"https://codereview.stackexchange.com/users/57999/"
] | Sometimes you can wrap the "nested functors" in a newtype which is itself a functor, use a single `fmap` on the newtype, and unwrap. In your case:
```
import Data.Functor.Compose
let z = getCompose . fmap (:[]) . Compose $ text
```
We are composing the `((->) s)` and `Scraper a` functors.
The problem with this is ... | Nested fmaps are very normal in haskell and extremely common, consider:
```
myList = [Just 13, Just 7, Just 33, Nothing, Just 23]
exampleFunc :: [Maybe Int] -> [Maybe Int]
exampleFunc li = map (\el -> fmap (+1) el) li
```
The prelude map function is a child of the fmap type, so this simple function is using neste... |
17,301,040 | I am using Java with Jersey 2.0 client to make a REST call to the paypal REST API. According to the API doc, I should be making a post to: <https://api.sandbox.paypal.com/v1/oauth2/token> with the Accept: application/json and Accept-Language: en\_US. It also indicates that I should pass in the body grant\_type=client\_... | 2013/06/25 | [
"https://Stackoverflow.com/questions/17301040",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2520618/"
] | First, I'll move rewrite the code in a form that's probably easier for you to
understand, with the internal function definitions moved outside the main function. Note that I had to add some parameters to `interleave` and
`interleave'` so that they could "see" all the same variables they had
access to when they were def... | Try to think of any recursive call as simply a call to the same function but with different parameters (hopefully, otherwise you may have an infinite loop), then try to follow the logic of a very simple example, like `permutations []`, `permutations [1]` or `permutations [1,2]`.
Look for when the inner expressions red... |
53,442,231 | I have a simple asp.net-core app using version 2.1. The HomeController has a page with the authorized attribute. When I click on the About page that needs authorization I get to the Login page and after typing my username and password the following happens:
* the user is successfully logged in
* the user is redirecte... | 2018/11/23 | [
"https://Stackoverflow.com/questions/53442231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/260/"
] | You haven't used this middleware in Configure method of startup class.
```
app.UseAuthorization();
```
Place this middleware after `app.UseAuthentication();` | You should also call `services.AddAuthentication` in the `ConfigureServices` method in you start-up file.
The call to `AddAuthentication` should be configured to your application needs. (Cookie, External Logins, etc.)
Even though you are not migrating from 1.x to 2.x the following article I find it very useful: [Migr... |
168,923 | In Russia we have something like a tradition: we like to look for lucky tickets.
Here's what a regular ticket looks like:
[](https://i.stack.imgur.com/0bqM1m.jpg)
As you can see, the ticket has a six-digit number.
A six-digit number is considered **lucky** if the ... | 2018/07/20 | [
"https://codegolf.stackexchange.com/questions/168923",
"https://codegolf.stackexchange.com",
"https://codegolf.stackexchange.com/users/72497/"
] | [Husk](https://github.com/barbuz/Husk), 12 bytes
================================================
```
#ȯ§¤=Σ↓↑3↔d…
```
[Try it online!](https://tio.run/##yygtzv7/X/nE@kPLDy2xPbf4UdvkR20TjR@1TUl51LDs////hgYg8N8ITAEA "Husk – Try It Online")
Explanation
-----------
```
#(§¤=Σ↓↑3↔d)… -- example input: 100000 101000
... | [Java (OpenJDK 8)](http://openjdk.java.net/), 162 bytes
=======================================================
... borrows from the Kotlin example above.
```java
import java.util.stream.IntStream;
(a,b)->IntStream.range(a,b+1).mapToObj(i->String.format("%06d",i).getBytes()).filter(c->c[0]+c[1]+c[2]==c[3]+c[4]+c[5])... |
36,483 | Is there a free broswer that will hide your IP address when surfing and downloading on the Internet? | 2009/09/06 | [
"https://superuser.com/questions/36483",
"https://superuser.com",
"https://superuser.com/users/10625/"
] | Due to the way the internet works, it is impossible to 'disable' your IP address from others seeing it.
One possible solution is to use an anonymous proxy, such as TOR, an SSH tunnel, or a PHProxy.
The quickest solution would have to a PHProxy. You can find plenty using a quick [Google search](http://www.google.com/s... | I find TOR to be very slow. Try [Ultrasurf](http://www.ultrareach.com/). It was designed to get around the [great firewall of china](http://en.wikipedia.org/wiki/Golden_Shield_Project).
If you use firefox you should also download the plugin. <http://www.ultrareach.net/download_en.htm> |
210,173 | I've searched on the internet for a while and asked my question on apples website discussions.apple.com as well, however I haven't found and answer yet and people aren't responding on apple's site so I'd though I'd give it a go here.
So, I have an external drive (1TB) that I made journaled encrypted when I first start... | 2015/10/09 | [
"https://apple.stackexchange.com/questions/210173",
"https://apple.stackexchange.com",
"https://apple.stackexchange.com/users/151551/"
] | It might be tricky to pick apart the failure with caches being deleted.
One thing that always works for me is to boot to a USB drive with a clean OS and sign in to the App Store. If I get a failure there, I know the problem is on Apple's side or in the network.
If not, I have the app and know my system / library ar... | Below works from me.
Using `Terminal` run below command
```
open $TMPDIR../C/
```
Above command will open `Finder` window. In this window, find folder `com.apple.appstore` and delete it. |
13,294,952 | I'm using ggplot and have two graphs that I want to display on top of each other. I used `grid.arrange` from gridExtra to stack them. The problem is I want the left edges of the graphs to align as well as the right edges regardless of axis labels. (the problem arises because the labels of one graph are short while the ... | 2012/11/08 | [
"https://Stackoverflow.com/questions/13294952",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1000343/"
] | I know this is an old post, and that it has already been answered, but may I suggest combining @baptiste's approach with `purrr` to make it nicer-looking:
```
library(purrr)
list(A, B) %>%
map(ggplotGrob) %>%
do.call(gridExtra::gtable_rbind, .) %>%
grid::grid.draw()
``` | At best this is a hack:
```
library(wq)
layOut(list(A, 1, 2:16), list(B, 2:3, 1:16))
```
It feels really wrong though. |
48,090,119 | I recently installed jupyter notebooks on my macbook pro.
When I create a new notebook, I see the following exception coming continuously on the terminal where I started the notebook.
```
Monideeps-MacBook-Pro:PythonNotebooks monideepde$ jupyter-notebook
[I 12:18:43.675 NotebookApp] Serving notebooks from local direc... | 2018/01/04 | [
"https://Stackoverflow.com/questions/48090119",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4441239/"
] | Downgrade tornado, this worked for me.
`pip install tornado==4.5.3`
based on: <https://github.com/liftoff/GateOne/issues/689> | It is a version incompatibility issue. Upgrading Jupyter solves it. Here is what you should try in macOS:
```
pip install --upgrade jupyter
``` |
1,744,340 | I was going over a Perl script written by someone else and I am not too familiar with Perl so could someone let me know what do the first three lines do?
```
my $ref = do($filename);
$ref != 0 or die "unable to read/parse $filename\n";
@varLines=@{$ref};
foreach $ord (@varLines)
{
# code here
}
```
This is in th... | 2009/11/16 | [
"https://Stackoverflow.com/questions/1744340",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/178437/"
] | It does this:
* `my $ref = do($filename)` executes the Perl code in the file whose name is `$filename` ([ref](http://perldoc.perl.org/5.8.8/functions/do.html)) and assignes to `$ref` the value of the last command in the file
* `$ref != 0 or die …` is intended to abort if that last command in `$filename` wasn't success... | [perldoc -f do](http://perldoc.perl.org/functions/do.html)
>
> * **do EXPR**
>
>
> Uses the value of EXPR as a filename and executes the contents of the file as a Perl script.
>
>
>
> ```
> do 'stat.pl';
>
> ```
>
> is just like
>
>
>
> ```
> eval `cat stat.pl`;
>
> ```
>
> except that it's more efficient... |
52,269,451 | i have to validate if given input string is valid cordinate or not
```
string s1 = "78;58|98;52";
```
This is valid cordinate is "78;58|98;52" => "Width;Height|X,Y" | 2018/09/11 | [
"https://Stackoverflow.com/questions/52269451",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1481713/"
] | Try this pattern: `(\d+(?:\.\d+)?);(?1)\|(?1);(?1)`.
`(\d+(?:\.\d+)?)` matches numbers: integers or decimal numbers, where decimal character is `.` (dot).
`(?1)` - references above pattern to match it four times.
[Demo](https://regex101.com/r/evqZEV/1)
Try this code:
```
string[] coords = { "78;58|98;54", "78.1;58... | Try this
```
(\d+;\d+)\|(\d+;\d+)
```
[Demo](https://regex101.com/r/rfrUrg/2) |
175,664 | ISTQB, Wikipedia or other sources classify verification acitivities (reviews etc.) as a static testing, yet other do not. If we can say that peer reviews and inspections are actually a kind of a testing, then a lot of standards do not make sense (consider e.g. ISO which say that validation is done by testing, while ver... | 2012/11/13 | [
"https://softwareengineering.stackexchange.com/questions/175664",
"https://softwareengineering.stackexchange.com",
"https://softwareengineering.stackexchange.com/users/60327/"
] | I've never heard of the term "static testing". I have only heard of the term "static analysis", which refers to any time a work product is examined without being used. This includes code reviews as well as using tools such as lint, FindBugs, PMD, and FxCop.
Here is some information from sources that I have available:
... | Code reviews nowadays may, on occasion, pick up bugs. But they are more about reviewing the quality of the code rather than the quality of the product.
But there was a time when static testing -- stepping through the code with an eye to catching bugs -- was a justifiable technique. That time was when compilation was s... |
9,971,506 | I've got this in my XAML:
```
<Grid.Resources>
<Storyboard x:Name="Storyboard_Animation">
<DoubleAnimation
Storyboard.TargetName="button_Submit"
Storyboard.TargetProperty="Angle"
From=... | 2012/04/02 | [
"https://Stackoverflow.com/questions/9971506",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/32892/"
] | You can try with Z-index: just google it about Z-index: You can get online example in W3schools
See here: **<http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_style_zindex>** | @user1307242 try this
```
<div>
<div style="position:absolute; z-index:-1">
<img url='image path'/>
</div>
<div style="z-index:2">
<Text box>
</div>
</div>
``` |
4,345 | I picked up one of those cheap canvas garages from Costco, to keep a few things out of the weather. It's 10' wide, 20' long, and maybe 11' high at the peak.
Our area is a bit prone to windstorms. I'm in the woods, so it's largely protected from the wind, but I still want to make sure it stays put.
It comes with tent ... | 2011/02/01 | [
"https://diy.stackexchange.com/questions/4345",
"https://diy.stackexchange.com",
"https://diy.stackexchange.com/users/80/"
] | >
> I'm in the woods, so it's largely protected from the wind, but I still want to make sure it stays put.
>
>
>
Tie it to the trees. If you're willing to dig a little find a root, rope under the root, and tie the tarp to that.
For a no-cement job try something like a 'snow anchor'. Tie your tarp down to a metal... | I purchased two very similar shelters with similar site features but decided the shelters would be permanently located. One site had the added benefit of asphalt which made anchoring very easy. The second site was a clearing in woods much the same as the other writer, which we further cleared of all weak/sickly trees i... |
2,743,758 | For example, i downloaded [Gecko 1.9.1](http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/1.9.1.7/sdk/xulrunner-1.9.1.7.en-US.win32.sdk.zip) SDK.
It contains js3250.dll.
How i can be sure that this dll is thread-safe?
Advance Thanks
-Parimal Das | 2010/04/30 | [
"https://Stackoverflow.com/questions/2743758",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/255865/"
] | You'll have to read the documentation of the particular library. | If there was such a tool then we would all be using it on our threaded code. Such a tool is impossible to write. You can flag questionable features, so you can say that a particular piece of code is *not* thread safe, but cannot guarantee that it is. Working at the object code level in a dll would make the problem even... |
10,232,766 | I need to implement a template tag that will return a string with a collection of items from an object.
I had created the following structure:
```
produtos/
templatetags/
__init__.py
produto_tags.py
```
produto\_tags.py:
```
# -*- coding: utf-8 -*-
from django import template
from d... | 2012/04/19 | [
"https://Stackoverflow.com/questions/10232766",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1245255/"
] | That was tricky, even though simple:
First, there was another 'produto\_tags.py' in another folder elsewhere in the project:
```
project/
common/
templatetags/
produtos_tags.py
produtos/
templatetags/
produtos_tags.py
```
So, at first I have moved all code from produ... | Follow Daniel and Ignacio's suggestions first. Also, its weird that you have `{% load produto_tags %}` in the top of the template but got an invalid block error: if `produto_tags` cannot be loaded, the error should be something like 'produto\_tags is not a valid tag' blahblah. Could you please check the code and path s... |
33,293 | Может ли шок быть позитивным,иметь положительный характер?
Мой учитель по русскому языку,при разборе одного из заданий пробного ЕГЭ, объяснил мне,что шок может носить только негативный характер.Т.е. нельзя быть шокированным из-за чего то приятного,позитивного.Так ли это?
(к слову,вот тот самый вариант из задания ЕГЭ.
... | 2014/05/12 | [
"https://rus.stackexchange.com/questions/33293",
"https://rus.stackexchange.com",
"https://rus.stackexchange.com/users/3793/"
] | Честно говоря, терпеть не могу модное выражение, особо любимое блондинками (не по цвету волос, а по IQ), по любому поводу "я в шоке". Шок - это тяжелое состояние, наступающее от сильнейшего психологического или физического потрясения.
Поэтому, думаю, в данном случае уместнее сказать "приятно удивлены" или, если необ... | Ближайшим синонимом "шокировать" будет "эпатировать". В отличии от "потрясения",которое может произойти самопроизвольно, независимо от воли "потрясающего", шокируют вполне осознано выходя за рамки принятых в обществе норм. Как правило красивые и тем более прекрасные вещи в рамки общества вписываются и поэтому даже если... |
64,015,175 | I know there is a lot of answers for this already but it just doesn't work.
I am trying to make my php script to create a folder on my ubuntu apache server.
```
if (!@mkdir($url, 0700, true)) {
$error = error_get_last();
echo $error['message'];
}
```
Now I have changed the permission for `www-data` to `777`... | 2020/09/22 | [
"https://Stackoverflow.com/questions/64015175",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Just don't use `svn2git`, because
* even mentioned `git-svn` allow more flexibility in initial SVN-tree
* *if* core `git-svn` will not be able to handle your tree correctly (but I don't think so) your can use SubGit, which cover (with [properly configured options](https://subgit.com/documentation/import-book.html)) ev... | >
> with corresponding subdirectories as svn2git expect
>
>
>
I don't know about [`svn2git`](https://stackoverflow.com/questions/43843107/how-to-use-svn2git-on-repository) (never used it even once), but **[`git-svn`](https://git-scm.com/docs/git-svn)** itself is very flexible and accepts many sorts of weird nonsta... |
8,290,396 | I have a text like: Sentence one. Sentence two. Sentence three.
I want it to be:
* Sentence one.
* Sentence two.
* Sentence three.
I assume I can replace `'.'` with `'.' + char(10) + char(13)`, but how can I go about bullets? '•' character works fine if printed manually I just do not know how to bullet every sentenc... | 2011/11/28 | [
"https://Stackoverflow.com/questions/8290396",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/194076/"
] | ```
-- Initial string
declare @text varchar(100)
set @text = 'Sentence one. Sentence two. Sentence three.'
-- Setting up replacement text - new lines (assuming this works) and bullets ( char(149) )
declare @replacement varchar(100)
set @replacement = '.' + char(10) + char(13) + char(149)
-- Adding a bullet at the beg... | select '• On '+ cast(getdate() as varchar)+' I discovered how to do this '
[Sample](https://i.stack.imgur.com/qx6hA.png) |
3,691,061 | what is wrong with this? I really don't understand some important parts for UIImagePickerController....
here's the source:
```
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePickerCont... | 2010/09/11 | [
"https://Stackoverflow.com/questions/3691061",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/232798/"
] | If you're using the photo library, do you need to set `cameraCaptureMode`? | I had this exact same exception, however I wasn't using an instance of UIImagePickerController control, instead I was showing a web page inside of a UIWebView that had an input w/ HTML Media Access attributes to enable camera access.
The problem is that it seems the UIWebView does not handle the HTML Media Access att... |
5,924,734 | I am aware that a CALayer's shadowPath is only animatable using explicit animations, however I still cannot get this to work. I suspect that I am not passing the `toValue` properly - as I understand this has to be an `id`, yet the property takes a CGPathRef. Storing this in a `UIBezierPath` does not seem to work. I am ... | 2011/05/07 | [
"https://Stackoverflow.com/questions/5924734",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/429427/"
] | ```
let cornerRadious = 10.0
//
let shadowPathFrom = UIBezierPath(roundedRect: rect1, cornerRadius: cornerRadious)
let shadowPathTo = UIBezierPath(roundedRect: rect2, cornerRadius: cornerRadious)
//
layer.masksToBounds = false
layer.shadowColor = UIColor.yellowColor().CGC... | Although not directly answer this question, if you just needs a view can drop shadow, you can use my class directly.
```swift
/*
Shadow.swift
Copyright © 2018, 2020-2021 BB9z
https://github.com/BB9z/iOS-Project-Template
The MIT License
https://opensource.org/licenses/MIT
*/
/**
A view drops shadow.
*/
@IBDe... |
21,488,501 | I came across too strange behaviour of pointer arithmetic. I am developing a program to develop SD card from LPC2148 using ARM GNU toolchain (on Linux). My SD card a sector contains data (in hex) like (checked from linux "xxd" command):
fe 2a 01 34 21 45 aa 35 90 75 52 78
While printing individual byte, it is printing ... | 2014/01/31 | [
"https://Stackoverflow.com/questions/21488501",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3258584/"
] | Your CPU architecture must support unaligned load and store operations.
To the best of my knowledge, it doesn't (and I've been using STM32, which is an ARM-based cortex).
If you try to read a `uint32_t` value from an address which is not divisible by the size of `uint32_t` (i.e. not divisible by 4), then in the "good... | `LDR` is the ARM instruction to load data. You have lied to the compiler that the pointer is a 32bit value. It is not aligned properly. You pay the price. Here is the `LDR` documentation,
>
> If the address is not word-aligned, the loaded value is rotated right by 8 times the value of bits [1:0].
>
>
>
See: [**4.... |
29,803,253 | Is it only me who have the problem with extracting coordinates of a polygon from `SpatialPolygonsDataFrame` object? I am able to extract other slots of the object (`ID`,`plotOrder`) but not coordinates (`coords`). I don't know what I am doing wrong. Please find below my R session where `bdryData` being the `SpatialPoly... | 2015/04/22 | [
"https://Stackoverflow.com/questions/29803253",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3420448/"
] | Finally, I figured out that I didn't parse the output correctly. The correct way to do is `bdryData@polygons[[2]]@Polygons[[1]]@coords`. Mind the difference in command `polygons`(`Polygons` and `polygons`) and it took me ages to find out. | The only valid answer on this posting was provided by the author "repres\_package" above. See that author's recommended solutions if you want to get the right answer. If you want to obtain the geometry of a polygon dataset, you are seeking the long and lat for every single vertex in the polygon feature class. The autho... |
35,258,180 | I am using pjax with Yii2 and I have faced a problem with pjax.
All scripts are working correctly and fine only the first time and after sending a pjax request and updating the table content, scripts and pjax not working. If I remove the line `$.pjax.reload({container:'#products-table'});` all scripts are working. And ... | 2016/02/07 | [
"https://Stackoverflow.com/questions/35258180",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1134320/"
] | Just Change this line `$(".product-edit-submit").on('click', function(){`
**to :**
```
$(document).on('click', '.product-edit-submit', function () {
```
Then It will work | if your code stops after adding extra libraries try registering it in view to make sure it will execute after all libraries included:
```
<?php
$js = <<< 'JAVASCRIPT'
$(document).on('ready pjax:success', function(){
$(".product-edit-submit").on('click', function(){
$.ajax({
type : "POST",
... |
9,063,344 | What happens if the first file this code encounters is a dir. Why does it not ignore all other files in that dir (therefore obscuring the results)?
This is taken from [How do I iterate through the files in a directory in Java?](https://stackoverflow.com/questions/3154488/best-way-to-iterate-through-a-directory-in-java... | 2012/01/30 | [
"https://Stackoverflow.com/questions/9063344",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/470184/"
] | When the first entry it encounters is a directory, it **recursively** calls `showFiles()` to work through the contents of that directory. When this call returns, the loop continues on with the entries from the first call to `showFiles()`. | It works because the variable `files` is a local variable, i.e. there is one instance for each invocation of the method `showFiles`. This way all method executions are independent from one another and do not clobber their `files` variables. |
13,402,847 | There is large python project where one attribute of one class just have wrong value in some place.
It should be sqlalchemy.orm.attributes.InstrumentedAttribute, but when I run tests it is constant value, let's say string.
There is some way to run python program in debug mode, and run some check (if variable changed ... | 2012/11/15 | [
"https://Stackoverflow.com/questions/13402847",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/816449/"
] | Well, here is a sort of *slow* approach. It can be modified for watching for local variable change (just by name). Here is how it works: we do sys.settrace and analyse the value of obj.attr each step. The tricky part is that we receive `'line'` events (that some line was executed) before line is executed. So, when we n... | A simpler way to watch for an object's attribute change (which can also be a module-level variable or anything accessible with `getattr`) would be to leverage [`hunter`](https://pypi.org/project/hunter/) library, *a flexible code tracing toolkit*. To detect state changes we need a predicate which can look like the foll... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.