qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
132,033
I started working at my first real job (not student work) in autumn of last year. In my job there are mostly male employees. I am a (like I want to believe, good looking) female – age 25. We have two work groups and one boss, age around 60, for both. In other groups, there are few “younger” men – average age 30 maximum...
2019/03/20
[ "https://workplace.stackexchange.com/questions/132033", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/101585/" ]
This is probably a case for HR, but remember, HR represents the company's interests so you can't just run to them without demonstrating that you have a case that they can investigate. Take the same attitude and actions you would take if you were going to build a case for court. It could possibly come to that if you are...
First I would like to point out / sum up some obvious facts, we all can get out of OP's answers: 1. OP doesn't want to talk to Jeremy 2. OP wants for him to get a second chance - she believes he deserves second chance 3. OP wants to get evidence of him taking photos of her - and OP even asked in one comment that she i...
132,033
I started working at my first real job (not student work) in autumn of last year. In my job there are mostly male employees. I am a (like I want to believe, good looking) female – age 25. We have two work groups and one boss, age around 60, for both. In other groups, there are few “younger” men – average age 30 maximum...
2019/03/20
[ "https://workplace.stackexchange.com/questions/132033", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/101585/" ]
His behavior is similar to a predator stalking his pray. He's just trying to see what he can get away with and soon he might escalate and even become dangerous. In the end of the day, you didn't stop him so might even think you're enjoying the attention if he's being more and more obvious about it. This situation can ...
Either Jeremy knows this behaviour is unacceptable, or he doesn't know. This answer covers the second case, which I consider possible, because I've been there (not exactly there, but close enough, and I had a [not fully developed brain](https://www.bbc.com/news/newsbeat-47622059)). The first case (which is probably mor...
132,033
I started working at my first real job (not student work) in autumn of last year. In my job there are mostly male employees. I am a (like I want to believe, good looking) female – age 25. We have two work groups and one boss, age around 60, for both. In other groups, there are few “younger” men – average age 30 maximum...
2019/03/20
[ "https://workplace.stackexchange.com/questions/132033", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/101585/" ]
Pull him aside and ask him if he is taking pictures of you. Then politely tell him to stop doing that. That should be enough to make him ashamed and stop. But if he still continues after that, ask one more colleague to check if they also notice him taking pictures. Then go to HR with the two colleagues, and explain the...
First I would like to point out / sum up some obvious facts, we all can get out of OP's answers: 1. OP doesn't want to talk to Jeremy 2. OP wants for him to get a second chance - she believes he deserves second chance 3. OP wants to get evidence of him taking photos of her - and OP even asked in one comment that she i...
132,033
I started working at my first real job (not student work) in autumn of last year. In my job there are mostly male employees. I am a (like I want to believe, good looking) female – age 25. We have two work groups and one boss, age around 60, for both. In other groups, there are few “younger” men – average age 30 maximum...
2019/03/20
[ "https://workplace.stackexchange.com/questions/132033", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/101585/" ]
This is probably a case for HR, but remember, HR represents the company's interests so you can't just run to them without demonstrating that you have a case that they can investigate. Take the same attitude and actions you would take if you were going to build a case for court. It could possibly come to that if you are...
The simple fact that you are unable to confront him, unable to have a eye to eye conversation, this alone is a strong sign of the effects of this continuous harassment you've experiencing. **No one should live under fear**. If you let this continue, it will break your strength, undermine your spirit and make you ill...
132,033
I started working at my first real job (not student work) in autumn of last year. In my job there are mostly male employees. I am a (like I want to believe, good looking) female – age 25. We have two work groups and one boss, age around 60, for both. In other groups, there are few “younger” men – average age 30 maximum...
2019/03/20
[ "https://workplace.stackexchange.com/questions/132033", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/101585/" ]
You are in a bad situation, and it is *not your fault*. You note that "Jeremy" is "really nice", but in fact, his actual behavior shows that he is ***not nice at all***. He is acting predatory and inappropriately. He may or may not be self-aware enough to realize this, but "nice guy" is a mask covering this, no matter ...
Either Jeremy knows this behaviour is unacceptable, or he doesn't know. This answer covers the second case, which I consider possible, because I've been there (not exactly there, but close enough, and I had a [not fully developed brain](https://www.bbc.com/news/newsbeat-47622059)). The first case (which is probably mor...
132,033
I started working at my first real job (not student work) in autumn of last year. In my job there are mostly male employees. I am a (like I want to believe, good looking) female – age 25. We have two work groups and one boss, age around 60, for both. In other groups, there are few “younger” men – average age 30 maximum...
2019/03/20
[ "https://workplace.stackexchange.com/questions/132033", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/101585/" ]
I disagree with these answers that suggest firmly telling him to stop. The time to go to HR is now. Taking surreptitious pictures of colleagues in the office is something that's *never* OK. It's not something that's OK as long as no one objects. This is not behavior that he didn't realize was offensive. If he didn't ...
You are in a bad situation, and it is *not your fault*. You note that "Jeremy" is "really nice", but in fact, his actual behavior shows that he is ***not nice at all***. He is acting predatory and inappropriately. He may or may not be self-aware enough to realize this, but "nice guy" is a mask covering this, no matter ...
36,935,563
I am trying to create a popup menu with JQuery. This menu shows when a certain element is clicked, and of course, when the same element is clicked again, it collapses. Now what I want, is that after this menu has been opened up, when the user clicks anywhere on the web page, the menu should close. I am using the follo...
2016/04/29
[ "https://Stackoverflow.com/questions/36935563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6128518/" ]
``` <div class='menu'></div> $('body').on('click',function(){ if(!$(this).hasClass('menu')) $('#div-header-submenu').collapse('hide'); }); ```
you can use a not selector because right now your condition itself is " click anywhere on the document" so you may try something like this ``` $("body:not(#div-header-submenu").on('click',function(){ $('#div-header-submenu').collapse('hide'); }); ``` you may try this and see what happens
36,935,563
I am trying to create a popup menu with JQuery. This menu shows when a certain element is clicked, and of course, when the same element is clicked again, it collapses. Now what I want, is that after this menu has been opened up, when the user clicks anywhere on the web page, the menu should close. I am using the follo...
2016/04/29
[ "https://Stackoverflow.com/questions/36935563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6128518/" ]
Hy, @Dhaval Chhenda answer should work. Another way of thinking is to wrap all the page content in a `<div id="main">...</div> <menu>...</menu>` with you menu outside of it. And then call the `on('click')` method on main tag as shown here : <https://api.jquery.com/click/> that will give you something like html :...
you can use a not selector because right now your condition itself is " click anywhere on the document" so you may try something like this ``` $("body:not(#div-header-submenu").on('click',function(){ $('#div-header-submenu').collapse('hide'); }); ``` you may try this and see what happens
36,935,563
I am trying to create a popup menu with JQuery. This menu shows when a certain element is clicked, and of course, when the same element is clicked again, it collapses. Now what I want, is that after this menu has been opened up, when the user clicks anywhere on the web page, the menu should close. I am using the follo...
2016/04/29
[ "https://Stackoverflow.com/questions/36935563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6128518/" ]
``` <div class='menu'></div> $('body').on('click',function(){ if(!$(this).hasClass('menu')) $('#div-header-submenu').collapse('hide'); }); ```
Instead of connecting the click event to the entire document, you could connect the click to an element inside the body (see example below). As long as your header-submenu (when opened) is placed 'on top' of that element (think in layers), it will only 'record' clicks 'outside' of you header-submenu. So clicks inside...
36,935,563
I am trying to create a popup menu with JQuery. This menu shows when a certain element is clicked, and of course, when the same element is clicked again, it collapses. Now what I want, is that after this menu has been opened up, when the user clicks anywhere on the web page, the menu should close. I am using the follo...
2016/04/29
[ "https://Stackoverflow.com/questions/36935563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6128518/" ]
Hy, @Dhaval Chhenda answer should work. Another way of thinking is to wrap all the page content in a `<div id="main">...</div> <menu>...</menu>` with you menu outside of it. And then call the `on('click')` method on main tag as shown here : <https://api.jquery.com/click/> that will give you something like html :...
Instead of connecting the click event to the entire document, you could connect the click to an element inside the body (see example below). As long as your header-submenu (when opened) is placed 'on top' of that element (think in layers), it will only 'record' clicks 'outside' of you header-submenu. So clicks inside...
3,760,844
I want to find records in ActiveRecord that have an attribute that is either `nil` or some value: ``` class Model < ActiveRecord::Base end class CreateModels < ActiveRecord::Migration def self.up create_table :models do |t| t.string :some_property end end def self.down drop_table :models...
2010/09/21
[ "https://Stackoverflow.com/questions/3760844", "https://Stackoverflow.com", "https://Stackoverflow.com/users/169992/" ]
``` $("input").each(function() { name = $(this).attr("name"); name = name.replace(/^t\[\d+\]/, "t[your number]"); $(this).attr("name", name); }); ```
If it will always be the patten "t[number][..." you should create a regular expression and replace it that way.
10,314,321
I'm looking for some algorithm (preferably if source code available) for image registration. Image deformation can't been described by homography matrix(because I think that distortion not symmetrical and not homogeneous),more specifically deformations are like barrel/distortion and trapezoid distortion, maybe some ro...
2012/04/25
[ "https://Stackoverflow.com/questions/10314321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1179925/" ]
What you are looking for is "optical flow". Searching for these terms will yield you numerous results. In OpenCV, there is a function called calcOpticalFlowFarneback() (in the video module) that does what you want. The C API does still have an implementation of the classic paper by Horn & Schunck (1981) called "Dete...
i found some software medical specific, but it's complicate and it's not work with simple image formats, but seems that it do that I need. <http://www.csd.uoc.gr/~komod/FastPD/index.html> Drop - Deformable Registration using Discrete Optimization
50,115,483
I have a grid view which is like this. The columns are calculated with the help of MySQL query and displayed accordingly. ``` <?php $subquery = Adanalytics::find()-> select('id,ad_id,date_event,max(cpc) cpclick,max(cpv) cpview,max(impression) impression,max(view) view,max(clicks) clicks,visitor_ip,p...
2018/05/01
[ "https://Stackoverflow.com/questions/50115483", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9703318/" ]
You can calculate the variance per row using `apply`: ``` apply(observations, 1, var) ``` Or use `rowVars` from the `matrixStats` package. Note that `matrixStats::rowVars` will be slightly *much* faster (see @HenrikB's comment below) than `apply(..., 1, var)`, in the same way that `rowMeans` is faster than `apply(....
We can use `pmap` to apply the function on each row of the `data.frame` ``` library(purrr) varS <- pmap_dbl(as.data.frame(observations), ~ var(c(...))) cbind(observations, varS) ``` ### data ``` observations <- matrix(lab6data, 10, 4) ```
286,060
ASP.Net 3.5 running under IIS 7 doesn't seem to allow this out of the box. ``` if (!EventLog.SourceExists("MyAppLog")) EventLog.CreateEventSource("MyAppLog", "Application"); EventLog myLog = new EventLog(); myLog.Source = "MyAppLog"; myLog.WriteEntry("Message"); ```
2008/11/13
[ "https://Stackoverflow.com/questions/286060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25372/" ]
This is part of windows security since windows 2003. You need to create an entry in the registry under HKEY\_LOCAL\_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application Make sure that network service or the account you impersonate has permission to this registry key. @CheGueVerra's link: [Requested Registry...
I've copied this answer from [here](https://stackoverflow.com/questions/2587453/log4net-eventlogappender-does-not-work-for-asp-net-2-0-website) (the question was Log4Net but the answer still applies). The technet link misses a vital step. ### Create a registry key `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services...
286,060
ASP.Net 3.5 running under IIS 7 doesn't seem to allow this out of the box. ``` if (!EventLog.SourceExists("MyAppLog")) EventLog.CreateEventSource("MyAppLog", "Application"); EventLog myLog = new EventLog(); myLog.Source = "MyAppLog"; myLog.WriteEntry("Message"); ```
2008/11/13
[ "https://Stackoverflow.com/questions/286060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25372/" ]
This is part of windows security since windows 2003. You need to create an entry in the registry under HKEY\_LOCAL\_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application Make sure that network service or the account you impersonate has permission to this registry key. @CheGueVerra's link: [Requested Registry...
Right click the application and choose "Run as Administrator"
286,060
ASP.Net 3.5 running under IIS 7 doesn't seem to allow this out of the box. ``` if (!EventLog.SourceExists("MyAppLog")) EventLog.CreateEventSource("MyAppLog", "Application"); EventLog myLog = new EventLog(); myLog.Source = "MyAppLog"; myLog.WriteEntry("Message"); ```
2008/11/13
[ "https://Stackoverflow.com/questions/286060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25372/" ]
I've copied this answer from [here](https://stackoverflow.com/questions/2587453/log4net-eventlogappender-does-not-work-for-asp-net-2-0-website) (the question was Log4Net but the answer still applies). The technet link misses a vital step. ### Create a registry key `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services...
Right click the application and choose "Run as Administrator"
58,310,642
How can i switch left px value with right based on a boolean ? I want to switch `[ngStyle]="{ 'left.px': offSetX }` with `[ngStyle]="{ 'right.px': offSetX }` based on a condition ``` import { Component, Input } from "@angular/core"; @Component({ selector: "hello", template: ` <div class="myDiv" [ngStyle]...
2019/10/09
[ "https://Stackoverflow.com/questions/58310642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5724889/" ]
Why not keep them both and reset based on a condition ? [Stackblitz](https://stackblitz.com/edit/angular-k63eb8?file=src/app/hello.component.ts) ``` import { Component, Input } from "@angular/core"; @Component({ selector: "hello", template: ` <div class="myDiv" [ngStyle]="{ 'left.px': !applyRightBoolean ? of...
``` public bgcolor = "red"; [style.backgroundColor]="bgcolor" second way used like that for multiple public bgcolor = { backgroundColor:"orange" }; [ngStyle]="bgcolor" ``` for your style used like that ``` [ngStyle]="{ backgroundColor:'#' + element.color }" <ng-container matColumnDef="color"> <th mat-head...
58,310,642
How can i switch left px value with right based on a boolean ? I want to switch `[ngStyle]="{ 'left.px': offSetX }` with `[ngStyle]="{ 'right.px': offSetX }` based on a condition ``` import { Component, Input } from "@angular/core"; @Component({ selector: "hello", template: ` <div class="myDiv" [ngStyle]...
2019/10/09
[ "https://Stackoverflow.com/questions/58310642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5724889/" ]
Why not keep them both and reset based on a condition ? [Stackblitz](https://stackblitz.com/edit/angular-k63eb8?file=src/app/hello.component.ts) ``` import { Component, Input } from "@angular/core"; @Component({ selector: "hello", template: ` <div class="myDiv" [ngStyle]="{ 'left.px': !applyRightBoolean ? of...
I think we will have to manage both styles. It would work with `ngStyle` as well but I like the `[style.xxx]` syntax: ``` @Component({ selector: "hello", template: ` <div class="myDiv" [style.left.px]="offSetLeft" [style.right.px]="offSetRight"></div> <button (click)="applyRightStyle()">Apply Right Style<...
58,310,642
How can i switch left px value with right based on a boolean ? I want to switch `[ngStyle]="{ 'left.px': offSetX }` with `[ngStyle]="{ 'right.px': offSetX }` based on a condition ``` import { Component, Input } from "@angular/core"; @Component({ selector: "hello", template: ` <div class="myDiv" [ngStyle]...
2019/10/09
[ "https://Stackoverflow.com/questions/58310642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5724889/" ]
Why not keep them both and reset based on a condition ? [Stackblitz](https://stackblitz.com/edit/angular-k63eb8?file=src/app/hello.component.ts) ``` import { Component, Input } from "@angular/core"; @Component({ selector: "hello", template: ` <div class="myDiv" [ngStyle]="{ 'left.px': !applyRightBoolean ? of...
UPDATE: ``` [ngStyle]="{ condition ? '\'left.px\': offSetX' : '\'right.px\': offSetX'} ```
58,310,642
How can i switch left px value with right based on a boolean ? I want to switch `[ngStyle]="{ 'left.px': offSetX }` with `[ngStyle]="{ 'right.px': offSetX }` based on a condition ``` import { Component, Input } from "@angular/core"; @Component({ selector: "hello", template: ` <div class="myDiv" [ngStyle]...
2019/10/09
[ "https://Stackoverflow.com/questions/58310642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5724889/" ]
I think we will have to manage both styles. It would work with `ngStyle` as well but I like the `[style.xxx]` syntax: ``` @Component({ selector: "hello", template: ` <div class="myDiv" [style.left.px]="offSetLeft" [style.right.px]="offSetRight"></div> <button (click)="applyRightStyle()">Apply Right Style<...
``` public bgcolor = "red"; [style.backgroundColor]="bgcolor" second way used like that for multiple public bgcolor = { backgroundColor:"orange" }; [ngStyle]="bgcolor" ``` for your style used like that ``` [ngStyle]="{ backgroundColor:'#' + element.color }" <ng-container matColumnDef="color"> <th mat-head...
58,310,642
How can i switch left px value with right based on a boolean ? I want to switch `[ngStyle]="{ 'left.px': offSetX }` with `[ngStyle]="{ 'right.px': offSetX }` based on a condition ``` import { Component, Input } from "@angular/core"; @Component({ selector: "hello", template: ` <div class="myDiv" [ngStyle]...
2019/10/09
[ "https://Stackoverflow.com/questions/58310642", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5724889/" ]
I think we will have to manage both styles. It would work with `ngStyle` as well but I like the `[style.xxx]` syntax: ``` @Component({ selector: "hello", template: ` <div class="myDiv" [style.left.px]="offSetLeft" [style.right.px]="offSetRight"></div> <button (click)="applyRightStyle()">Apply Right Style<...
UPDATE: ``` [ngStyle]="{ condition ? '\'left.px\': offSetX' : '\'right.px\': offSetX'} ```
1,920,388
Imwant to show that $\sum\limits\_{n\geq 0} \frac{z^n}{n!}$ converges in all the complex plane, without using ratio test. My approach was to prove that the series converges absolutely, and bounding the partial sums, i.e. Since $2^n\leq n!$, we can bound the partial sums like this: $$ S\_p = 1 + |z| + \frac{|z|^2}{2!...
2016/09/09
[ "https://math.stackexchange.com/questions/1920388", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
The notation $(A\_n)\_{n \in \mathbb{N}}$ means that $A\_n$ is defined for any $n \in \mathbb{N}$, not only parts of $\mathbb{N}$. It denotes indeed a sequence. To phrase it otherwise, for any $n$, there is always something called $A\_n$. I hope this answers your question, for it is not very clear.
If $X$ is any collection (possibly a collection of sets, or not), then the notation $(A\_n)\_{n\in\Bbb N}$ is used to denote a *function* $\Bbb N \to X$ such that $1 \mapsto A\_1, 2\mapsto A\_2,\ldots,$ and so on for each natural number. Formally, $(A\_n)\_{n\in\Bbb N}$ is called a *sequence of elements of $X$*, but i...
51,690,754
I am a bit confused by the numpy function random.randn() which returns random values from the standard normal distribution in an array in the size of your choosing. My question is that I have no idea when this would ever be useful in applied practices. For reference about me I am a complete programming noob but studi...
2018/08/05
[ "https://Stackoverflow.com/questions/51690754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10120211/" ]
The Python function randn is incredibly useful for adding in a random noise element into a dataset that you create for initial testing of a machine learning model. Say for example that you want to create a million point dataset that is roughly linear for testing a regression algorithm. You create a million data points ...
`np.random.randn(d0, d1, ..., dn)` Return a sample (or samples) from the “standard normal” distribution(mu=0, stdev=1). For random samples from ![](https://latex.codecogs.com/gif.latex?%5Cinline&space;N(%5Cmu,&space;%5Csigma%5E2)&space;$$ "N(\mu, \sigma^2) $$"), use: sigma \* np.random.randn(...) + mu This is because...
51,690,754
I am a bit confused by the numpy function random.randn() which returns random values from the standard normal distribution in an array in the size of your choosing. My question is that I have no idea when this would ever be useful in applied practices. For reference about me I am a complete programming noob but studi...
2018/08/05
[ "https://Stackoverflow.com/questions/51690754", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10120211/" ]
The Python function randn is incredibly useful for adding in a random noise element into a dataset that you create for initial testing of a machine learning model. Say for example that you want to create a million point dataset that is roughly linear for testing a regression algorithm. You create a million data points ...
This could be used in 3D programming to generate non-overlapping random values. This would be useful for optimization of graphical effects. Another possible use for statistical applications would be applying a formula in order to test against spacial factors affecting a given constant. Such as if you were measuring a ...
47,404
While I was reading about PAT i.e Port Address Translation.The router was configured to translate all the private IP addresses to one single public IP.Since router is a layer-3 device, it can do that translation by changing the source IP in the IP header. But how does it change the port number in the Transport Layer He...
2018/01/28
[ "https://networkengineering.stackexchange.com/questions/47404", "https://networkengineering.stackexchange.com", "https://networkengineering.stackexchange.com/users/42734/" ]
What you are calling PAT, is really NAPT (Network Address Port Translation). The term is defined by [*RFC 2663, IP Network Address Translator (NAT) Terminology and Considerations*](https://www.rfc-editor.org/rfc/rfc2663#section-4.1.2): > > 4.1.2. Network Address Port Translation (NAPT) > > > NAPT extends the notion...
When a Router (or any other device) is doing a [Static NAT](http://www.practicalnetworking.net/series/nat/static-nat/) or a [Dynamic NAT](http://www.practicalnetworking.net/series/nat/dynamic-nat/), it is only inspecting the packet up to Layer 3. When a Router (or any other device) is doing a [Static PAT](http://www.p...
47,404
While I was reading about PAT i.e Port Address Translation.The router was configured to translate all the private IP addresses to one single public IP.Since router is a layer-3 device, it can do that translation by changing the source IP in the IP header. But how does it change the port number in the Transport Layer He...
2018/01/28
[ "https://networkengineering.stackexchange.com/questions/47404", "https://networkengineering.stackexchange.com", "https://networkengineering.stackexchange.com/users/42734/" ]
What you are missing is that there is a difference between the functionality of a router as concieved by the people who designed the Internet protocol and the functionality of a modern device that says "router" on the box. A router as originally invisaged by the creators of the Internet only cared about layer 3 and be...
When a Router (or any other device) is doing a [Static NAT](http://www.practicalnetworking.net/series/nat/static-nat/) or a [Dynamic NAT](http://www.practicalnetworking.net/series/nat/dynamic-nat/), it is only inspecting the packet up to Layer 3. When a Router (or any other device) is doing a [Static PAT](http://www.p...
61,668,652
I have a bunch of imports like `import Navi from 'components/Navi'` These have a red error line under the `components/Navi` part until I add this to my `tsconfig.json` ``` "baseUrl": "./", "paths": { "components/*": ["src/components/*"], "layouts/*": ["src/layouts/*"], "pages/*": ["src/pages/*"], "templates/*...
2020/05/07
[ "https://Stackoverflow.com/questions/61668652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6331353/" ]
You need to add [`gatsby-plugin-root-import`](https://www.gatsbyjs.org/packages/gatsby-plugin-root-import/) to your gatsby-config.js in order to make use of absolute imports. Webpack 4 provided alias in its config whereby you can specify absolute imports from a specific folder. [`gatsby-plugin-root-import`](https://ww...
Shubham's solution still works as of June 2021 - if you want it automatically resolve all dirs under `src`, you can use a little two-liner I wrote for this: ```js const fs = require("fs"); const path = require("path"); const srcDirs = fs.readdirSync(path.resolve(__dirname, "src")); const rootDirsConfig = {}; srcDir...
129,186
Our WordPress installation runs only images within posts. Generally medium, lightweight images but we are also publishing larger images, sometimes gif animations which take enormous time to load. When a post has a description it is a bit different. The visitor has something to read and then the images pops out when lo...
2014/01/09
[ "https://wordpress.stackexchange.com/questions/129186", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/44946/" ]
Well the second bit of code is technically the correct way to do it. However, at the end of the `add_settings_field()` you can pass arguments. Please view the [WordPress Add\_Settings\_Field](http://codex.wordpress.org/Function_Reference/add_settings_field) function reference. This will help you in getting the best un...
Better way is use a wordpress options plugins. One of the best is Advanced Custom Fields. <http://www.advancedcustomfields.com/> If you buy a option page addon, then you can create a unlimited option page with lot of features. Please what out a video. <http://www.advancedcustomfields.com/add-ons/options-page/> Ve...
54,140,369
I have used `ItemTouchHelper` to implement drag and drop in `recyclerview`. It works fine. But it is working only on long press. I need to do it with `onTouch` ``` ItemTouchHelper.Callback itemTouchHelperCallback = new ItemTouchHelper.Callback() { public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewH...
2019/01/11
[ "https://Stackoverflow.com/questions/54140369", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8867002/" ]
1. Override `ItemTouchHelper`'s `isLongPressDragEnabled` and return false <https://developer.android.com/reference/android/support/v7/widget/helper/ItemTouchHelper.Callback#isLongPressDragEnabled()> `override fun isLongPressDragEnabled(): Boolean = false` 2. Add a callback to ViewHolder's implementation and use this ...
You can use following code inside onBindViewHolder to start drag by touch ``` holder.layout.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent event) { ClipData data = ClipData.newPlainText("", ""); View.DragShadowBuilder shadowBuilder = new...
48,914,627
I am creating a VM from a disk. But, I am unable to give the credentials to this VM such as Username and Password. ``` az vm create --resource-group RESOURCE-GRP-NAME --location eastus --name VM-NAME --os-type linux --attach-os-disk DISK-NAME ``` When the VM gets created it says, VM agent Unavailable and I am unab...
2018/02/21
[ "https://Stackoverflow.com/questions/48914627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7494282/" ]
You can do this for your TextViews: ``` @Override public void onCreate(Bundle savedInstanceState) { button1.setOnClickListener(onClickListener); button2.setOnClickListener(onClickListener); button3.setOnClickListener(onClickListener); } private OnClickListener onClickListener = new OnClickLis...
You can get all views from root view ``` public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); View v = findViewById(R.id.root); for(int index = 0; index<((ViewG...
48,914,627
I am creating a VM from a disk. But, I am unable to give the credentials to this VM such as Username and Password. ``` az vm create --resource-group RESOURCE-GRP-NAME --location eastus --name VM-NAME --os-type linux --attach-os-disk DISK-NAME ``` When the VM gets created it says, VM agent Unavailable and I am unab...
2018/02/21
[ "https://Stackoverflow.com/questions/48914627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7494282/" ]
You can do this for your TextViews: ``` @Override public void onCreate(Bundle savedInstanceState) { button1.setOnClickListener(onClickListener); button2.setOnClickListener(onClickListener); button3.setOnClickListener(onClickListener); } private OnClickListener onClickListener = new OnClickLis...
There is no need for a `switch` statement. You can just use a `Map` of resource ids to `TextView`s: ``` public class MainActivity extends AppCompatActivity { private static final int[] IDS = { R.id.option1, R.id.option2, R.id.option3, R.id.option4, R.id.option5, R.id.option6, R.id.option7, R.id.option8, R...
48,914,627
I am creating a VM from a disk. But, I am unable to give the credentials to this VM such as Username and Password. ``` az vm create --resource-group RESOURCE-GRP-NAME --location eastus --name VM-NAME --os-type linux --attach-os-disk DISK-NAME ``` When the VM gets created it says, VM agent Unavailable and I am unab...
2018/02/21
[ "https://Stackoverflow.com/questions/48914627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7494282/" ]
There is no need for a `switch` statement. You can just use a `Map` of resource ids to `TextView`s: ``` public class MainActivity extends AppCompatActivity { private static final int[] IDS = { R.id.option1, R.id.option2, R.id.option3, R.id.option4, R.id.option5, R.id.option6, R.id.option7, R.id.option8, R...
You can get all views from root view ``` public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); View v = findViewById(R.id.root); for(int index = 0; index<((ViewG...
34,251,058
In my application one block is loaded with the controls dynamically. After loading the dynamic controls the data is update by using the angular js. But the angular js is working with static placed controls. But not with dynamic controls. Here I placing the dynamic code What I tried to get. ``` <!DOCTYPE html> <html>...
2015/12/13
[ "https://Stackoverflow.com/questions/34251058", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5674518/" ]
With the way your data is structured I would add the level objects to an array and then filter by `chance`. `filter` returns an array so you need to take the first element `[0]` which is an object, and then the label value from that object. ``` var label = [level1, level2].filter(function (el) { return el[0] === cha...
First of all, you are could have made a constructor function to declare the object instances, secondly **level1** and **level2** are objects, So basically there are two ways you can access object properties: * Dot notation, eg. level1.lebel or level1.percentage * the [] notation. You need to put the key in, not the in...
133,284
I'm creating Third Person game with multiple switching cameras. I'm using the default Third Person Control asset provided with Unity, and it comes with a script that aligns the movement to the camera. The problem is, this script only seems to align with the "Main Camera" tagged camera. My game has multiple cameras wit...
2016/11/20
[ "https://gamedev.stackexchange.com/questions/133284", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/94243/" ]
Probably because that's how coordinate systems are traditionally set up when doing math. But to be honest, OpenGL can have its origin anywhere you want and its axes can point in any direction you want (well, so long as they are perpendicular to each other). If you want the origin in the top left and the Y-axis to point...
Perspective division performed on the Clip Coordinates produces Normalized Device Coordinates, ranging from -1 to 1 in all three axes. <https://www.opengl.org/archives/resources/faq/technical/transformations.htm>
133,284
I'm creating Third Person game with multiple switching cameras. I'm using the default Third Person Control asset provided with Unity, and it comes with a script that aligns the movement to the camera. The problem is, this script only seems to align with the "Main Camera" tagged camera. My game has multiple cameras wit...
2016/11/20
[ "https://gamedev.stackexchange.com/questions/133284", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/94243/" ]
Think back to the graphs you would draw in school. ![enter image description here](https://i.stack.imgur.com/I1xCu.gif) The (0,0) point is at bottom-left. Now, OpenGL is an old, old API and it's derived from an even older one. There were no gaming graphics then; 3D graphics required an expensive workstation with an ...
Perspective division performed on the Clip Coordinates produces Normalized Device Coordinates, ranging from -1 to 1 in all three axes. <https://www.opengl.org/archives/resources/faq/technical/transformations.htm>
1,686,406
I'm going round in circles at the moment trying to get the pattern right for using Dependency Injection with a number of IEnumerables. I have three types of object that I want to return from my database: Projects, Batches and Tasks. I want to create a Repository that has the following form: ``` public interface IRepo...
2009/11/06
[ "https://Stackoverflow.com/questions/1686406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15609/" ]
Use generics: ``` public class YourClass<T> { public YourClass(IRepository<T> repository) { var all = repository.GetAll(); } } ``` Of course, at some point you need to provide `T`, which might look like this: ``` var projectClass = yourDIContainer.Resolve<YourClass<Project>>; ``` In terms of r...
Hope this might help you in the way you want to make the code. ``` public class Repository : IRepository<Repository> { public Repository() { } #region IRepository<Repository> Members public IEnumerable<Repository> GetAll() { throw new Exception("The method or operation is not impleme...
1,686,406
I'm going round in circles at the moment trying to get the pattern right for using Dependency Injection with a number of IEnumerables. I have three types of object that I want to return from my database: Projects, Batches and Tasks. I want to create a Repository that has the following form: ``` public interface IRepo...
2009/11/06
[ "https://Stackoverflow.com/questions/1686406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15609/" ]
Use generics: ``` public class YourClass<T> { public YourClass(IRepository<T> repository) { var all = repository.GetAll(); } } ``` Of course, at some point you need to provide `T`, which might look like this: ``` var projectClass = yourDIContainer.Resolve<YourClass<Project>>; ``` In terms of r...
Given that you've defined the repository interface as returning a specific type, why do you think it's pointless to give the type you're expecting it to return in client code? It's only pointless if you don't care the return type,but then the whole generic interface design is pointless. If you want a repository obj...
58,261,142
I want to read in all csv files in my working directory and bind them by row. These data frames have different number of columns, I want to keep all columns. I tried ``` temp = list.files(pattern="*.csv.gz") for (i in 1:length(temp)) assign(temp[i], read.csv(temp[i])) library(dplyr) DF<-bind_rows(temp,.id = NULL) ...
2019/10/06
[ "https://Stackoverflow.com/questions/58261142", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3321515/" ]
So, I figured it out my problem. I wasn't using `node.js`. I was trying to call the functions from another file and display them in a `HTML` file. But `CORS` policy don't let me use them. What I did is, installed [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) extension on VS Co...
javascript modules works best if your project was created using npm i.e you are not loading script file at the bottom of your index.html. And if you did load script at the bottom you may have to do something like this ``` <script type="module"> import btn from './helper' </script> ```
252,376
Do Pico Projectors need replacement lasers / LEDs?
2011/03/02
[ "https://superuser.com/questions/252376", "https://superuser.com", "https://superuser.com/users/2293/" ]
In theory, yes. No bulb will last forever. In practice, no; pico projectors use LEDs, which have tens of thousands of hours of life. If everything else worked perfectly, that would mean the bulb could shine uninterrupted for **two years straight**. That's six years of life if used eight hours a day every day. In other ...
[This review](http://www.projectorreviews.com/pico_projectors/index.php) indicates that pico projectors use led or laser light sources and have a lamp life of 10,000-30,000 hours. Could there be premature failure? Probably.
15,693,655
I am developing a cross-platform MySQL administration software in JAVA, similar to phpMyAdmin, but more user-friendly, easier to use. So far, everything works. The software gains access to the MySQL server with the standard methods like every website: hostname, username, password, port. Do I need any special access to...
2013/03/28
[ "https://Stackoverflow.com/questions/15693655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1424766/" ]
There is nothing special about phpMyAdmin, its just a client.
phpmyadmin connects to the mysql database just as any other program would, too. However, you could add some features that would require accessing files on the harddisk directly – for example, it might be nice to be able to watch the server logfiles live. With something like that, you could let the user of your webinte...
322,454
[![enter image description here](https://i.stack.imgur.com/0VA1B.png)](https://i.stack.imgur.com/0VA1B.png) So I understand that the capacitor charges up to the peak voltage and remains there since it cannot discharge due to the diode. But when I reduce the voltage on the input, the capacitor voltage also reduces, but...
2017/08/05
[ "https://electronics.stackexchange.com/questions/322454", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/102212/" ]
> > But when I reduce the voltage on the input, the capacitor voltage also reduces, but it cannot discharge since there is no path. So how does it reduce its voltage ? > > > It can discharge, but very slowly, through the reverse leakage curent of the diode. Or possibly it can discharge through whatever circuit is...
The ADC needs some charge, to take a measurement. The charge per sample is Csample \* Vinput. Scaling that by the sample rate per second, we get current, thus $$ Current = Fsample \* Csample \* Vinput$$ To compute Rin, we used Ohms Law: Rin = Vin / Iin, or in this case $$Rin = Vinput / ( Fsample \* Csample \* Vinp...
322,454
[![enter image description here](https://i.stack.imgur.com/0VA1B.png)](https://i.stack.imgur.com/0VA1B.png) So I understand that the capacitor charges up to the peak voltage and remains there since it cannot discharge due to the diode. But when I reduce the voltage on the input, the capacitor voltage also reduces, but...
2017/08/05
[ "https://electronics.stackexchange.com/questions/322454", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/102212/" ]
> > But when I reduce the voltage on the input, the capacitor voltage also reduces, but it cannot discharge since there is no path. So how does it reduce its voltage? > > > It is not clear from your question whether you are observing this on a test setup or in a simulation. If you are using a multimeter with an im...
The ADC needs some charge, to take a measurement. The charge per sample is Csample \* Vinput. Scaling that by the sample rate per second, we get current, thus $$ Current = Fsample \* Csample \* Vinput$$ To compute Rin, we used Ohms Law: Rin = Vin / Iin, or in this case $$Rin = Vinput / ( Fsample \* Csample \* Vinp...
29,111
I want to see if anyone can provide me some pointers on the following issue: In my environment when PC users use a browser other than IE they must login to the various sharepoint web apps we have...so if they hit the web app that runs our site collections they log in...then when they try to hit the web app that runs o...
2012/02/12
[ "https://sharepoint.stackexchange.com/questions/29111", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/6781/" ]
With Firefox you can enable NTLM authentication to specified web addresses, [details here](http://sivel.net/2007/05/firefox-ntlm-sso/). Same with Chrome, [details here](http://ben-tech.blogspot.com/2011/09/chrome-and-ntlm-authentication.html). With Opera: opera:config -> Network -> Enable NTLM
This might not fix it. An additional setting should be changed as well. network.auth.force-generic-ntlm should be set to true. network.auth.force-generic-ntlm | user set | boolean | true -me
14,707,140
I am using following script to increase for size by 1 pixel script works fine when I bind it with `p` element but it increases font size two or three times if I use it with nested div and bind script to `div` element [example on fiddle](http://jsfiddle.net/WR3Am/2/) Sample script ``` <script type='text/javascript'...
2013/02/05
[ "https://Stackoverflow.com/questions/14707140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1122748/" ]
In `parseMethod`, change this: ``` MKPointAnnotation *annotation = [[MKPointAnnotation alloc] init]; for (int l=0; l<[locations count]; l++) { // HERE I CAN SEE ONLY A SINGLE LOCATION! annotation.coordinate = [locations[l] coordinate]; NSLog(@"%f - %f", annotation.coordinate.latitude, annotation.coordinate.lo...
What is also really important to note (because it was very hard to find that error and I sat the whole last night in front of this...) is to check if your object that conforms to MKAnnotation has some master base class that imlements the methods isEqual and / or hash on only the data of the base class and you do not ov...
2,835,786
Rails adds a `humanize()` method for strings that works as follows (from the Rails RDoc): ``` "employee_salary".humanize # => "Employee salary" "author_id".humanize # => "Author" ``` I want to go the other way. I have "pretty" input from a user that I want to 'de-humanize' for writing to a model's attribute: ...
2010/05/14
[ "https://Stackoverflow.com/questions/2835786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/340407/" ]
the `string.parameterize.underscore` will give you the same result ``` "Employee salary".parameterize.underscore # => employee_salary "Some Title: Sub-title".parameterize.underscore # => some_title_sub_title ``` or you can also use which is slightly more succinct (thanks @danielricecodes). * Rails < 5 `Employ...
There doesn't appear to be any such method in the Rail API. However, I did find this blog post that offers a (partial) solution: <http://rubyglasses.blogspot.com/2009/04/dehumanizing-rails.html>
2,835,786
Rails adds a `humanize()` method for strings that works as follows (from the Rails RDoc): ``` "employee_salary".humanize # => "Employee salary" "author_id".humanize # => "Author" ``` I want to go the other way. I have "pretty" input from a user that I want to 'de-humanize' for writing to a model's attribute: ...
2010/05/14
[ "https://Stackoverflow.com/questions/2835786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/340407/" ]
the `string.parameterize.underscore` will give you the same result ``` "Employee salary".parameterize.underscore # => employee_salary "Some Title: Sub-title".parameterize.underscore # => some_title_sub_title ``` or you can also use which is slightly more succinct (thanks @danielricecodes). * Rails < 5 `Employ...
In <http://as.rubyonrails.org/classes/ActiveSupport/CoreExtensions/String/Inflections.html> you have some methods used to prettify and un-prettify strings.
3,710,272
Let $f,g:[a,b]\to \mathbb{R}$ Riemann integrable and bounded. We then know that $fg$ is also integrable. I wonder if the statement remains true or not under the following weakenings of the hypotheses ($f$ and $g$ are always integrable): 1) $f$ bounded but $g$ unbounded? 2) $f,g$ bounded but defined on $\mathbb{R}$ ...
2020/06/07
[ "https://math.stackexchange.com/questions/3710272", "https://math.stackexchange.com", "https://math.stackexchange.com/users/359564/" ]
For 2), consider $f(x)=\frac1{\sqrt x}\sin x$ (for $x>1$ and $0$ for $x\le 1$). Then the convergence of $\int\_{\Bbb R}$ follows from the Leibniz criterion for alternating series. But with $g=f$, we see that the integral of $fg$ does not converge because it behaves like the harmonic series.
1) and 2) are both true by Holder's inequality if this holds also for Riemann integral. Let $\Omega$ be the domain of integration. Then $$||fg||\_{L^{1}(\Omega)}\leq ||f||\_{L^{\infty}(\Omega)}||g||\_{L^{1}(\Omega)}$$ This should hold also for Riemann integral (?)
40,492,620
Here's the relevant bit of my Web.Config: ``` <rule name="Force WWW and SSL" enabled="true" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAny"> <add input="{HTTP_HOST}" pattern="^[^www]" /> <add input="{HTTPS}" pattern="off" /> </conditions> <action type="Redirect" u...
2016/11/08
[ "https://Stackoverflow.com/questions/40492620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1772194/" ]
`npm i selenium-webdriver@3.0.0-beta-2` did the trick for me. P.S. also consider fixing that in your package.json if you have any.
Check your node version, you should be using version 6: ``` node --version ``` To install the latest node use: ``` nvm install v6.9.0 nvm use 6.9.0 ```
40,492,620
Here's the relevant bit of my Web.Config: ``` <rule name="Force WWW and SSL" enabled="true" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAny"> <add input="{HTTP_HOST}" pattern="^[^www]" /> <add input="{HTTPS}" pattern="off" /> </conditions> <action type="Redirect" u...
2016/11/08
[ "https://Stackoverflow.com/questions/40492620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1772194/" ]
Check your node version, you should be using version 6: ``` node --version ``` To install the latest node use: ``` nvm install v6.9.0 nvm use 6.9.0 ```
I have just had the same problem which I solved by updating to node 6.x following the [instructions](https://nodejs.org/en/download/package-manager/) on the node site. Upgrading solved the first error but then I realised that I did not have any of the "additional components" mentioned in the [selenium-webdriver instal...
40,492,620
Here's the relevant bit of my Web.Config: ``` <rule name="Force WWW and SSL" enabled="true" stopProcessing="true"> <match url="(.*)" /> <conditions logicalGrouping="MatchAny"> <add input="{HTTP_HOST}" pattern="^[^www]" /> <add input="{HTTPS}" pattern="off" /> </conditions> <action type="Redirect" u...
2016/11/08
[ "https://Stackoverflow.com/questions/40492620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1772194/" ]
`npm i selenium-webdriver@3.0.0-beta-2` did the trick for me. P.S. also consider fixing that in your package.json if you have any.
I have just had the same problem which I solved by updating to node 6.x following the [instructions](https://nodejs.org/en/download/package-manager/) on the node site. Upgrading solved the first error but then I realised that I did not have any of the "additional components" mentioned in the [selenium-webdriver instal...
35,958,446
In the program I am writing, it would be very convenient to disable the ability to jump to the end of a list by using negative numbers. What I mean is that I would want this: ``` list = [1, 2, 3, 4] number = list[-1] print(number) ``` NOT to output 4, but to for example give me an IndexError like it would if I tried...
2016/03/12
[ "https://Stackoverflow.com/questions/35958446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5878902/" ]
``` if index<0: value = l[0] else: value = l[index] ``` Also **list** is a keyword in python, so don't use it like you have in your example.
I'm not entirely sure what are you trying to accomplish by doing that but you may attempt to override `__getitem__` and `__setitem__` like so: ``` class NewList(list): def __getitem__(self, key): if isinstance(key, int) and key < 0: raise IndexError("Cannot index to values lower than 0.") ...
35,958,446
In the program I am writing, it would be very convenient to disable the ability to jump to the end of a list by using negative numbers. What I mean is that I would want this: ``` list = [1, 2, 3, 4] number = list[-1] print(number) ``` NOT to output 4, but to for example give me an IndexError like it would if I tried...
2016/03/12
[ "https://Stackoverflow.com/questions/35958446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5878902/" ]
I'm not entirely sure what are you trying to accomplish by doing that but you may attempt to override `__getitem__` and `__setitem__` like so: ``` class NewList(list): def __getitem__(self, key): if isinstance(key, int) and key < 0: raise IndexError("Cannot index to values lower than 0.") ...
Negative indexing `lst[-1]` is basicly the same as `lst[len(lst)-1]`, which is positive indexing. So what you want to do doesn't really make sense, as items at those places will still be accessible. But you can do it anyway like this: ``` class CustomList(list): def __getitem__(self, key): if isinstance(...
35,958,446
In the program I am writing, it would be very convenient to disable the ability to jump to the end of a list by using negative numbers. What I mean is that I would want this: ``` list = [1, 2, 3, 4] number = list[-1] print(number) ``` NOT to output 4, but to for example give me an IndexError like it would if I tried...
2016/03/12
[ "https://Stackoverflow.com/questions/35958446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5878902/" ]
``` if index<0: value = l[0] else: value = l[index] ``` Also **list** is a keyword in python, so don't use it like you have in your example.
Negative indexing `lst[-1]` is basicly the same as `lst[len(lst)-1]`, which is positive indexing. So what you want to do doesn't really make sense, as items at those places will still be accessible. But you can do it anyway like this: ``` class CustomList(list): def __getitem__(self, key): if isinstance(...
257,273
Are there any situations where rounding up by 3 or more decimal places is required? I have a computer system that is producing rounding errors if it rounds by only 2 decimal places. However, if i choose to round by 3 then the result is accurate. I cannot however figure out why i need to do this.
2012/12/12
[ "https://math.stackexchange.com/questions/257273", "https://math.stackexchange.com", "https://math.stackexchange.com/users/52838/" ]
Yes, your question is fundamental to a whole branch of applicable mathematics called numerical analysis. So there are plenty of situations where you might need to round to some particular number of decimal places (maybe three, maybe three hundred).
I am not exactly sure what you mean, but I recon this is answering your question: For example we want to calculate $0.12\*0.34$. the exact solution is $0.0408$, however, rounded to 2 decimal places, it is $0.04$ which is (obviously) inaccurate. The problem is: When you round, you lose accuraccy. This directly affects ...
257,273
Are there any situations where rounding up by 3 or more decimal places is required? I have a computer system that is producing rounding errors if it rounds by only 2 decimal places. However, if i choose to round by 3 then the result is accurate. I cannot however figure out why i need to do this.
2012/12/12
[ "https://math.stackexchange.com/questions/257273", "https://math.stackexchange.com", "https://math.stackexchange.com/users/52838/" ]
Yes, your question is fundamental to a whole branch of applicable mathematics called numerical analysis. So there are plenty of situations where you might need to round to some particular number of decimal places (maybe three, maybe three hundred).
It may be that your program is rounding the terms AND the product. For example, **.915 \* .335 = .306525** which rounds to **.31**, but **.92 \* .34 = .322** which rounds to **.32**. That would account for the $0.01 rounding error you're experiencing.
5,935,479
I am using Drupal 6.19 with quite a lot modules. Since I added another domain using Domain Access, added a panel variant and a node type, the cron first exhausted the memory limit of 512MB. I increased this limit to 1024MB. After I have done that, the "Maximum execution time" of 240 seconds is being exceeded. Any idea...
2011/05/09
[ "https://Stackoverflow.com/questions/5935479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/449944/" ]
Try to look for croon implementations in your modules. Disable each of these (separately) temporarily too see if it makes any difference. Maybe a module is running in some kind of loop. A possible candidate would be search.module, that lodas all comments of a single node. If you have nodes with thousands of comments (...
You should be able to raise the max execution time with `set_time_limit()` but I think it would be good to find out what your script is doing for four minutes! I don't know much about this drupal script but would suggest the following: * Keep an eye on the database while it's running, I'm guessing that slow MySQL que...
5,935,479
I am using Drupal 6.19 with quite a lot modules. Since I added another domain using Domain Access, added a panel variant and a node type, the cron first exhausted the memory limit of 512MB. I increased this limit to 1024MB. After I have done that, the "Maximum execution time" of 240 seconds is being exceeded. Any idea...
2011/05/09
[ "https://Stackoverflow.com/questions/5935479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/449944/" ]
Look inside: includes/common.inc Line: 2716 Change the set\_time\_limit to a higher number such as 400. Hope it will help someone. Finau
You should be able to raise the max execution time with `set_time_limit()` but I think it would be good to find out what your script is doing for four minutes! I don't know much about this drupal script but would suggest the following: * Keep an eye on the database while it's running, I'm guessing that slow MySQL que...
5,935,479
I am using Drupal 6.19 with quite a lot modules. Since I added another domain using Domain Access, added a panel variant and a node type, the cron first exhausted the memory limit of 512MB. I increased this limit to 1024MB. After I have done that, the "Maximum execution time" of 240 seconds is being exceeded. Any idea...
2011/05/09
[ "https://Stackoverflow.com/questions/5935479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/449944/" ]
Try to look for croon implementations in your modules. Disable each of these (separately) temporarily too see if it makes any difference. Maybe a module is running in some kind of loop. A possible candidate would be search.module, that lodas all comments of a single node. If you have nodes with thousands of comments (...
Look inside: includes/common.inc Line: 2716 Change the set\_time\_limit to a higher number such as 400. Hope it will help someone. Finau
435,022
I thought I left an express server open on localhost so I ran a Rustscan port scanner and got these result, ``` Open [::1]:5000 Open [::1]:5432 Open [::1]:7000 Open [::1]:55743 ``` For 5000 I noticed has always been open ever since I updated to macOS Monterey, for 55743 I assume is open because I am in a zoom call f...
2022/01/10
[ "https://apple.stackexchange.com/questions/435022", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/446643/" ]
[PortsMonitor](https://portsmonitor.com) is my favourite GUI tool for tracking network port usage. [![enter image description here](https://i.stack.imgur.com/BULjG.png)](https://i.stack.imgur.com/BULjG.png) Knowing which application or process is using a port (as shown by PortsMonitor) is the first step is understandi...
The `lsof` command can be used to check for processes which are listing to ports. ``` $ lsof -i @localhost:1024-65545 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME Notion 1048 pse 22u IPv4 0x1b47a08ea8bc5bc5 0t0 TCP localhost:63405->localhost:49158 (ESTABLISHED) Notion 1060 ...
45,405,450
I tried connecting to my database in WAMP, it first gave me `SQLSTATE[HY000] [1045] Access denied for user 'C:/wamp/www'@'localhost' (using password: NO).`I later changed the password but still getting `SQLSTATE[HY000] [1045] Access denied for user 'C:/wamp/www'@'localhost' (using password: YES)`. In phpmyadmin, I add...
2017/07/30
[ "https://Stackoverflow.com/questions/45405450", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7971266/" ]
Yes you can achieve the same, but it wont be automatic like on Android unless you write some native code as well. I have found that the best way to manage it is simply to do it yourself: 1) When your app starts you can get the [screen size](https://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/Graphics....
Most of the time you can use the largest image and use [`Viewports'](https://github.com/libgdx/libgdx/wiki/Viewports) to handle resolution and aspect ratio for you. The larger images will be scaled down and this will result in some loss of detail of course. Viewports will automatically scale the size you want to show ...
45,405,450
I tried connecting to my database in WAMP, it first gave me `SQLSTATE[HY000] [1045] Access denied for user 'C:/wamp/www'@'localhost' (using password: NO).`I later changed the password but still getting `SQLSTATE[HY000] [1045] Access denied for user 'C:/wamp/www'@'localhost' (using password: YES)`. In phpmyadmin, I add...
2017/07/30
[ "https://Stackoverflow.com/questions/45405450", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7971266/" ]
Yes you can achieve the same, but it wont be automatic like on Android unless you write some native code as well. I have found that the best way to manage it is simply to do it yourself: 1) When your app starts you can get the [screen size](https://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/Graphics....
This can be done using ``` com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver. ``` Here is [javadoc](https://libgdx.badlogicgames.com/ci/nightlies/docs/api/com/badlogic/gdx/assets/loaders/resolvers/ResolutionFileResolver.html) for it.
45,405,450
I tried connecting to my database in WAMP, it first gave me `SQLSTATE[HY000] [1045] Access denied for user 'C:/wamp/www'@'localhost' (using password: NO).`I later changed the password but still getting `SQLSTATE[HY000] [1045] Access denied for user 'C:/wamp/www'@'localhost' (using password: YES)`. In phpmyadmin, I add...
2017/07/30
[ "https://Stackoverflow.com/questions/45405450", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7971266/" ]
Most of the time you can use the largest image and use [`Viewports'](https://github.com/libgdx/libgdx/wiki/Viewports) to handle resolution and aspect ratio for you. The larger images will be scaled down and this will result in some loss of detail of course. Viewports will automatically scale the size you want to show ...
This can be done using ``` com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver. ``` Here is [javadoc](https://libgdx.badlogicgames.com/ci/nightlies/docs/api/com/badlogic/gdx/assets/loaders/resolvers/ResolutionFileResolver.html) for it.
22,386,975
I am trying to get cucumber working on my Mac for testing a ruby script. I use cucumber with rails and have never had an issue setting it up there, but seem to be having quite an issue creating it just for a ruby script that I want to test. Script background: I have created a script that serves mysql data via a TCPSer...
2014/03/13
[ "https://Stackoverflow.com/questions/22386975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2315861/" ]
That is called *integer division*. See [/ Operator (C# Reference)](http://msdn.microsoft.com/en-us/library/3b1ff23f.aspx): > > When you divide two integers, the result is always an integer. For > example, the result of 7 / 3 is 2. > > > Also C# Specification [7.7.2 Division operator](http://msdn.microsoft.com/en...
The compiler sees the constant (invariant) expression `3/2` and performs *constant folding*: the constant expression is evaluated during compilation and the result used to replace the constant expression. Your original statement is changed by the compiler from ``` object o = 3/2 ; ``` to: ``` object o = 1 ; ``` A...
22,386,975
I am trying to get cucumber working on my Mac for testing a ruby script. I use cucumber with rails and have never had an issue setting it up there, but seem to be having quite an issue creating it just for a ruby script that I want to test. Script background: I have created a script that serves mysql data via a TCPSer...
2014/03/13
[ "https://Stackoverflow.com/questions/22386975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2315861/" ]
"By Default" you are dividing two int32's since that's how the constants are evaluated. The result is the int32 1. 'o' then becomes a 'boxed int32' representing 1.
The compiler sees the constant (invariant) expression `3/2` and performs *constant folding*: the constant expression is evaluated during compilation and the result used to replace the constant expression. Your original statement is changed by the compiler from ``` object o = 3/2 ; ``` to: ``` object o = 1 ; ``` A...
18,075,928
I have a listview with a template containing a button. When the button get's clicked i want an event to fire and return me a value of the listview row, so i can use it to add it to a database. My problem is, i don't know how to bind my buttonevent to the itemtemplate. I've tried a few approaches but with no success so ...
2013/08/06
[ "https://Stackoverflow.com/questions/18075928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1759274/" ]
I've found the solution. The problem was the click binding. You should only refer to the action in the wrapper class and not both. Here are my wrapperclass & listview itemtemplate. **ItemTemplate:** ``` <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" ...
1. `MvxRelayCommand` in vNext got shortened to `MvxCommand` in v3 - just to save typing. 2. Your last problem seems to be that you are binding `Click btnClick.OrderBtnClick` - but your `MenuItemWrap` class doesn't have a `btnClick` property - so you actually want to bind `Click Click` ?
37,502,987
I can't figure out why the checkbox values are not saved in the database using helpers. Trying to save some customers ids from my module's setting : The array : ``` $custs = Customer::getCustomers(); foreach ($custs as $key => $value) { $options[] = array( 'id_customer' => (int)$value['id_customer'], ...
2016/05/28
[ "https://Stackoverflow.com/questions/37502987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5180509/" ]
Your code is correct, I tried it and this is result <http://screencast.com/t/wfsW86iJj> 1. You have to click at least one checkbox. 2. Show data on server : ``` print_r($_POST); die(); ```
a better could be using groupbox *but its quite difficult*, take a look to the AdminCustomers controller class in the controllers directory of the prestachop, this has a multiselect group that used a relational table event stored in single field If you want to be easy, using a single field to store in the database, ta...
37,502,987
I can't figure out why the checkbox values are not saved in the database using helpers. Trying to save some customers ids from my module's setting : The array : ``` $custs = Customer::getCustomers(); foreach ($custs as $key => $value) { $options[] = array( 'id_customer' => (int)$value['id_customer'], ...
2016/05/28
[ "https://Stackoverflow.com/questions/37502987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5180509/" ]
I don't think its in PS docs. But with a bit of code inspecting you can see in Backoffice/themes/default/template/helpers/form/form.tpl ``` <input type="checkbox" name="{$id_checkbox}" id="{$id_checkbox}" class="{if isset($input.class)}{$input.class}{/if}"{if isset($value.val)} value="{$value.val|escape:'...
Your code is correct, I tried it and this is result <http://screencast.com/t/wfsW86iJj> 1. You have to click at least one checkbox. 2. Show data on server : ``` print_r($_POST); die(); ```
37,502,987
I can't figure out why the checkbox values are not saved in the database using helpers. Trying to save some customers ids from my module's setting : The array : ``` $custs = Customer::getCustomers(); foreach ($custs as $key => $value) { $options[] = array( 'id_customer' => (int)$value['id_customer'], ...
2016/05/28
[ "https://Stackoverflow.com/questions/37502987", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5180509/" ]
I don't think its in PS docs. But with a bit of code inspecting you can see in Backoffice/themes/default/template/helpers/form/form.tpl ``` <input type="checkbox" name="{$id_checkbox}" id="{$id_checkbox}" class="{if isset($input.class)}{$input.class}{/if}"{if isset($value.val)} value="{$value.val|escape:'...
a better could be using groupbox *but its quite difficult*, take a look to the AdminCustomers controller class in the controllers directory of the prestachop, this has a multiselect group that used a relational table event stored in single field If you want to be easy, using a single field to store in the database, ta...
3,721,812
How do you make .h files globally accessible by for example #include ? If its compiler specific either migw or gcc. C++
2010/09/15
[ "https://Stackoverflow.com/questions/3721812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/448881/" ]
If I understand your question correctly, you want the "-I" option to the compiler -- this will add a directory to the include-file search path.
The thing I do, is install headers in > > /i686-pc-mingw32/include > > > libs in > > /i686-pc-mingw32/lib > > > and dll's in > > /i686-pc-mingw32/bin > > > and add that last one to PATH (so relevant dll's will be found by programs you build). For mingw-w64 switch `i686-pc-mingw32` with either `i686-w...
2,965,330
This is a part of the question. Which states Let K= $\mathbb{Z}$/2$\mathbb{Z}$[X]/(d)$\mathbb{Z}$/2$\mathbb{Z}$[X], where d=X$^3$+X+1 and let a be the class of X modulo d. This is the only part that i do not know how to solve. I have tried calculating the quotient and the remainder but i do not know if it has any m...
2018/10/21
[ "https://math.stackexchange.com/questions/2965330", "https://math.stackexchange.com", "https://math.stackexchange.com/users/593752/" ]
Here are the steps for polynomial long division $\mod 2$, where the notation $\dfrac{p(X)}{q(X)} \longrightarrow X^k \tag 0$ indicates the quotient of the leading terms is $X^k$: $\dfrac{X^7 + 1}{X^3 + X + 1} \longrightarrow X^4; \tag 1$ $X^7 + 1 - X^4(X^3 + X + 1) = X^7 + 1 - X^7 - X^5 - X^4 = X^5 + X^4 + 1; \tag ...
I suppose you mean $\;K=(\mathbb{Z}/2\mathbb{Z})[X]/d(\mathbb{Z}/2\mathbb{Z})[X]$. **Hint**: If you have to show that $X^3+X+1\mid X^7+1$ in $(\mathbb{Z}/2\mathbb{Z})[X]$, just perform the Euclidean division of the latter by the former in this polynomial ring. Don't forget that, since we're in characteristic $2$, sub...
2,965,330
This is a part of the question. Which states Let K= $\mathbb{Z}$/2$\mathbb{Z}$[X]/(d)$\mathbb{Z}$/2$\mathbb{Z}$[X], where d=X$^3$+X+1 and let a be the class of X modulo d. This is the only part that i do not know how to solve. I have tried calculating the quotient and the remainder but i do not know if it has any m...
2018/10/21
[ "https://math.stackexchange.com/questions/2965330", "https://math.stackexchange.com", "https://math.stackexchange.com/users/593752/" ]
$\bmod 2,\,\color{#c00}{x^{\large 3}\!+\!x\!+1}\!:\,\ x^{\large 7}\!\equiv x(\color{#c00}{x^{\large 3}})^{\large 2}\equiv x(\color{#c00}{x\!+\!1})^{\large 2}\equiv x^{\large 3}\!+x\equiv -1\ \ $ **QED**
I suppose you mean $\;K=(\mathbb{Z}/2\mathbb{Z})[X]/d(\mathbb{Z}/2\mathbb{Z})[X]$. **Hint**: If you have to show that $X^3+X+1\mid X^7+1$ in $(\mathbb{Z}/2\mathbb{Z})[X]$, just perform the Euclidean division of the latter by the former in this polynomial ring. Don't forget that, since we're in characteristic $2$, sub...
2,965,330
This is a part of the question. Which states Let K= $\mathbb{Z}$/2$\mathbb{Z}$[X]/(d)$\mathbb{Z}$/2$\mathbb{Z}$[X], where d=X$^3$+X+1 and let a be the class of X modulo d. This is the only part that i do not know how to solve. I have tried calculating the quotient and the remainder but i do not know if it has any m...
2018/10/21
[ "https://math.stackexchange.com/questions/2965330", "https://math.stackexchange.com", "https://math.stackexchange.com/users/593752/" ]
Here are the steps for polynomial long division $\mod 2$, where the notation $\dfrac{p(X)}{q(X)} \longrightarrow X^k \tag 0$ indicates the quotient of the leading terms is $X^k$: $\dfrac{X^7 + 1}{X^3 + X + 1} \longrightarrow X^4; \tag 1$ $X^7 + 1 - X^4(X^3 + X + 1) = X^7 + 1 - X^7 - X^5 - X^4 = X^5 + X^4 + 1; \tag ...
$\bmod 2,\,\color{#c00}{x^{\large 3}\!+\!x\!+1}\!:\,\ x^{\large 7}\!\equiv x(\color{#c00}{x^{\large 3}})^{\large 2}\equiv x(\color{#c00}{x\!+\!1})^{\large 2}\equiv x^{\large 3}\!+x\equiv -1\ \ $ **QED**
6,712,270
I want to try the Google Eclipse plug-in for the Google App Engine, but I get stuck in the tutorial... I want to start the web application from the Google tutorial, but when I click on "RUN AS > Web Application", I only see this message on the console: ``` Usage: <dev-appserver> [options] <war directory> Options: -...
2011/07/15
[ "https://Stackoverflow.com/questions/6712270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/847064/" ]
It is because your launch configuration file (location: WORKSPACE/.metadata/.plugins/org.eclipse.debug.core/.launches)is corrupt. All you need to do to solve this problem is to delete the existing launch configuration (in Run > Run configurations)
Some additional information to what's already been said. You need to install "m2eclipse" otherwise you will not have the "run as" option.
6,712,270
I want to try the Google Eclipse plug-in for the Google App Engine, but I get stuck in the tutorial... I want to start the web application from the Google tutorial, but when I click on "RUN AS > Web Application", I only see this message on the console: ``` Usage: <dev-appserver> [options] <war directory> Options: -...
2011/07/15
[ "https://Stackoverflow.com/questions/6712270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/847064/" ]
It is because your launch configuration file (location: WORKSPACE/.metadata/.plugins/org.eclipse.debug.core/.launches)is corrupt. All you need to do to solve this problem is to delete the existing launch configuration (in Run > Run configurations)
Check if your Eclipse Project or GAE SDK has spaces in the path.
6,712,270
I want to try the Google Eclipse plug-in for the Google App Engine, but I get stuck in the tutorial... I want to start the web application from the Google tutorial, but when I click on "RUN AS > Web Application", I only see this message on the console: ``` Usage: <dev-appserver> [options] <war directory> Options: -...
2011/07/15
[ "https://Stackoverflow.com/questions/6712270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/847064/" ]
It is because your launch configuration file (location: WORKSPACE/.metadata/.plugins/org.eclipse.debug.core/.launches)is corrupt. All you need to do to solve this problem is to delete the existing launch configuration (in Run > Run configurations)
The problem occurs when using blank spaces in the project name. "Run Configurations> Arguments > Program Arguments", insert quotation marks in the project path. i.e.: ``` --port=8888 --disable_update_check {PATH}\My Project ``` To: ``` --port=8888 --disable_update_check "{PATH}\My Project" ``` I found it from [...
6,712,270
I want to try the Google Eclipse plug-in for the Google App Engine, but I get stuck in the tutorial... I want to start the web application from the Google tutorial, but when I click on "RUN AS > Web Application", I only see this message on the console: ``` Usage: <dev-appserver> [options] <war directory> Options: -...
2011/07/15
[ "https://Stackoverflow.com/questions/6712270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/847064/" ]
Check if your Eclipse Project or GAE SDK has spaces in the path.
Some additional information to what's already been said. You need to install "m2eclipse" otherwise you will not have the "run as" option.
6,712,270
I want to try the Google Eclipse plug-in for the Google App Engine, but I get stuck in the tutorial... I want to start the web application from the Google tutorial, but when I click on "RUN AS > Web Application", I only see this message on the console: ``` Usage: <dev-appserver> [options] <war directory> Options: -...
2011/07/15
[ "https://Stackoverflow.com/questions/6712270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/847064/" ]
The problem occurs when using blank spaces in the project name. "Run Configurations> Arguments > Program Arguments", insert quotation marks in the project path. i.e.: ``` --port=8888 --disable_update_check {PATH}\My Project ``` To: ``` --port=8888 --disable_update_check "{PATH}\My Project" ``` I found it from [...
Some additional information to what's already been said. You need to install "m2eclipse" otherwise you will not have the "run as" option.
40,551,345
can anybody guide me to the best way to create a navigation bar with a centered logo and 2 links in each side just like this: [![enter image description here](https://i.stack.imgur.com/6Ak1u.jpg)](https://i.stack.imgur.com/6Ak1u.jpg) Ive read about different ways like splitting a ul into 2 and floating one left and t...
2016/11/11
[ "https://Stackoverflow.com/questions/40551345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3688945/" ]
Simply use Flexbox. Just replace the div #logo with your image. **HTML** ``` <nav> <a href="">Home</a> <a href="">Artwork</a> <div id="logo"></div> <a href="">Responses</a> <a href="">Contact</a> </nav> ``` **CSS** ``` html, body{ height: 100%; } body{ margin: 0; } nav{ display: flex; width: 10...
Accepted answer breaks if the links aren't EXACTLY the same size (not likely in the real world, obviously could set a fixed width but fiddly) If there are the same number of links on either side, this works (*as long as there is enough room either side for the links to have an even width*) ```css ul, li { list-styl...
28,805,155
Any idea why I am getting this error? It comes up after running through and accepting the l and r values. I do not get any errors when I compile, just when I run it. This is just the first half of my program. However, I do not want to proceed with this error hanging around. ``` #include <stdio.h> #include <math.h> #in...
2015/03/02
[ "https://Stackoverflow.com/questions/28805155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4622506/" ]
Change ``` scanf("%d, &l"); ``` to ``` scanf("%d", &l); ``` and do the same for the rest of the `scanf`s. Also,change ``` if (v = 0) ``` to ``` if (v == 0) ``` And the correct format specifier for a `double` is `%lf`. Also,change ``` main() ``` to ``` int main(void) ``` and move ``` return 0; ``` a...
You need to use `"%f"` as the format specifier when receiving floating point types. Otherwise the program behaviour is undefined. Although not the cause of any runtime crashes, you're on dangerous ground comparing `==` on floating point types that are the result of a polynomial calculation. You're *probably* fine in ...
13,823,712
> > **Possible Duplicate:** > > [console.log jquery element on chrome look strange](https://stackoverflow.com/questions/13329849/console-log-jquery-element-on-chrome-look-strange) > > > Assuming plain jQuery `console.log( $('form') )` example. A month before or so, Google Chrome console output was in format: ...
2012/12/11
[ "https://Stackoverflow.com/questions/13823712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1017201/" ]
You're logging a jQuery object; there's a lot more there than just the element. If you want to see only the element, do the following: ``` console.log( $("form").get() ); // .get() returns an array of elements ```
You can use `.get()` to convert the jQuery object into an array. ``` console.log($('form').get()) ``` Or you can loop through and log each element: ``` $('form').each(function(){ console.log(this); }); ```
13,823,712
> > **Possible Duplicate:** > > [console.log jquery element on chrome look strange](https://stackoverflow.com/questions/13329849/console-log-jquery-element-on-chrome-look-strange) > > > Assuming plain jQuery `console.log( $('form') )` example. A month before or so, Google Chrome console output was in format: ...
2012/12/11
[ "https://Stackoverflow.com/questions/13823712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1017201/" ]
Try this: ``` ​console.log($('form')[0])​ ```
You can use `.get()` to convert the jQuery object into an array. ``` console.log($('form').get()) ``` Or you can loop through and log each element: ``` $('form').each(function(){ console.log(this); }); ```
13,823,712
> > **Possible Duplicate:** > > [console.log jquery element on chrome look strange](https://stackoverflow.com/questions/13329849/console-log-jquery-element-on-chrome-look-strange) > > > Assuming plain jQuery `console.log( $('form') )` example. A month before or so, Google Chrome console output was in format: ...
2012/12/11
[ "https://Stackoverflow.com/questions/13823712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1017201/" ]
Try this: ``` ​console.log($('form')[0])​ ```
You're logging a jQuery object; there's a lot more there than just the element. If you want to see only the element, do the following: ``` console.log( $("form").get() ); // .get() returns an array of elements ```
14,479,237
You know in Java/PHP you can do something like this: ``` if (c.bigX == 1 || c.smallX == 2 || c.mediumX == 6) { something here } ``` How can I make it with CSS? I have 5 classes, and I want them to do the same thing. instead of making a lot of lines. Thanks
2013/01/23
[ "https://Stackoverflow.com/questions/14479237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1761494/" ]
Like this: `.class1, .class2, .class3 {}` etc.
Use commas in your selector: ``` .class1, .class2, .class3 {} ``` Bear in mind that each clause in such a list is a complete selector in its own right; that is ``` div .class1, .class2 {} ``` matches `class1` descendants of `div`s; and all `.class2` elements. If you wanted `class1` or `class2` descendants of `di...
14,479,237
You know in Java/PHP you can do something like this: ``` if (c.bigX == 1 || c.smallX == 2 || c.mediumX == 6) { something here } ``` How can I make it with CSS? I have 5 classes, and I want them to do the same thing. instead of making a lot of lines. Thanks
2013/01/23
[ "https://Stackoverflow.com/questions/14479237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1761494/" ]
Like this: `.class1, .class2, .class3 {}` etc.
``` .class1, .class2, .class3, .class4, .class5 { property:value; } ``` This will help
690,459
I sent a test email using the port25.com email verification tool and got back the results below in it's entirety. Can someone tell me what is missing and why SPF is failing? Many thanks! -sul. ``` This message is an automatic response from Port25's authentication verifier service at verifier.port25.com. The servi...
2015/05/07
[ "https://serverfault.com/questions/690459", "https://serverfault.com", "https://serverfault.com/users/287862/" ]
This one is a real pain to troubleshoot if you aren't familiar with the new `max-recursion-queries` option or why it was added. [CVE-2014-8500](https://kb.isc.org/article/AA-01216/) was identified in late 2014 as impacting multiple nameserver products, including BIND. The exploit allows a malicious nameservers to craf...
Check your logging directory permissions. I found in my logs: ``` Jun 5 18:46:38 xsystem named[1116]: isc_stdio_open '/var/log/named.debug.log' failed: permission denied Jun 5 18:46:38 xsystem named[1116]: configuring logging: permission denied Jun 5 18:46:38 xsystem named[1116]: loading configuration: permission ...
33,035,242
I am using [FSCalendar](https://github.com/WenchaoIOS/FSCalendar) What I want to do is change the way of showing events. I want to put a coloured rectangle border around the cell with events. I did that by editing the cell background layer and worked fine, but now I realized that it is the wrong place to put my code as...
2015/10/09
[ "https://Stackoverflow.com/questions/33035242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1066762/" ]
This method will draw a bordered rectangle. I would make it class method and put into UIImage category for convenient use. ``` - (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)imageSize andBorderWidth:(CGFloat)borderWidth fillWithColor:(BOOL)fillWithColor{ UIGraphicsBeginImageContext(imageSize); CGCo...
You can set border for UIImageView instead of set image as rectange border ``` cell.imageView.layer.borderColor = [[UIColor redColor] CGColor]; cell.imageView.layer.borderWidth = 1.0f; ```
8,038,252
we are developing an (JavaSE-) application which communicates to many clients via persistent tcp-connections. The client connects, performs some/many operations (which are updated to a SQL-Database) and closes the application / disconnects from server. We're using Hibernate-JPA and manage the EntityManager-lifecycle on...
2011/11/07
[ "https://Stackoverflow.com/questions/8038252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1033887/" ]
One possible way to get rid of `select` statements when reattaching detached entities is to use Hibernate-specific `update()` operation instead of `merge()`. `update()` unconditionally runs an `update` SQL statement and makes detached object persistent. If persistent object with the same identifier already exists in ...
One possible option would be to use [StatelessSession](http://docs.jboss.org/hibernate/core/3.6/javadocs/org/hibernate/StatelessSession.html) for the update statements. I've successfully used it in my 'write-heavy' application.
23,260
In Simulated Annealing, a worse solution is accepted with this probability: $$p=e^{-\frac{E(y)-E(x)}{kT}}.$$ If that understanding is correct: Why is this probability function used? This means that, the bigger the energy difference, the smaller the probability of accepting the new solution. I would say the bigger the...
2020/08/26
[ "https://ai.stackexchange.com/questions/23260", "https://ai.stackexchange.com", "https://ai.stackexchange.com/users/27777/" ]
Note that you can't really predict whether your escape from a local minimum will work or not - you might just wind up in another, worse local minimum. The probability function you describe increases the likelihood of this happening. By upweighting the likelihood of allowing small energy differences, you allow for the p...
Nice question! My guess is that, if the probability of acceptance increases the bigger the difference between the current and new solutions is, then there's the risk that you need to search a lot again to find a good solution, i.e. you may oscillate between different subspaces or you could actually often end up in sub...
35,738,118
I had some doubt regarding android app release, please respond me as soon as possible. **1.** How long it will take for app review in google play ? **2.** How soon my app will appear in play store after review ? **3.** Can i update my app while app is being reviewed ? **4.** How can let the user know about app sup...
2016/03/02
[ "https://Stackoverflow.com/questions/35738118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
1. Google Play doesn't review your app prior to release really like Apple does, so it's very rapid, like 2 to 3 hours after you submit the app. 2. See above: your app will appear in Google Play Store 2 to 3 hours after you submit it to Google Play. 3. If you're really that quick, sure! 4. Wut? If you mean the Android L...
> > How long it will take for app review in google play? > > > Usually just a few hours, there is no fixed amount of time, in my experience about 6 hours was the maximum > > How soon my app will appear in play store after review? > > > There will be no separate update to inform you that the review is done, i...
27,157,163
I have a user schema where I want to update some info, like this. ``` User.findOne({_id: idd}, function(err, usr){ usr.info = "some new info"; usr.save(function(err) { }); }); ``` But the model has a hook on save to hash the password ``` UserSchema.pre('save', function(next) { if (this.password && this...
2014/11/26
[ "https://Stackoverflow.com/questions/27157163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1930848/" ]
Use [Model.Update](http://mongoosejs.com/docs/2.7.x/docs/updating-documents.html) and move the creation of a new password to an independent function. ``` var salt = new Buffer(crypto.randomBytes(16).toString('base64'), 'base64');; var newPassword = this.hashPassword("someNew password"); User.update({_id: idd}, { i...
Did you try to use `isModified`? ``` UserSchema.pre('save', function(next) { if (this.password && this.password.length > 6 && MYMODEL.isModified('password')) { this.salt = new Buffer(crypto.randomBytes(16).toString('base64'), 'base64'); this.password = this.hashPassword(this.password); } n...
196,390
I am trying to figure out how to get my source information to compile smaller using encrypted text. This could potentially change the game in transferring large-chunked data and offer security at the same time. Are there any encryption types that change source to fewer letters and numbers? (for lack of a better word...
2018/10/25
[ "https://security.stackexchange.com/questions/196390", "https://security.stackexchange.com", "https://security.stackexchange.com/users/84041/" ]
Encrypted data should be indistinguishable from random noise. Random data cannot be compressed. Therefore, compress data first and then encrypt it.
*[Codes](https://en.wikipedia.org/wiki/Code_%28cryptography%29)* can do it: they use lookup tables ("*[Codebooks](https://en.wikipedia.org/wiki/Codebook)*") which map something (words, phrases or arbitrary byte sequences) to other symbols, and the latter can occupy less size than the former, thus achieving (possibly on...
196,390
I am trying to figure out how to get my source information to compile smaller using encrypted text. This could potentially change the game in transferring large-chunked data and offer security at the same time. Are there any encryption types that change source to fewer letters and numbers? (for lack of a better word...
2018/10/25
[ "https://security.stackexchange.com/questions/196390", "https://security.stackexchange.com", "https://security.stackexchange.com/users/84041/" ]
No, what you are trying to accomplish is impossible. Encryption tries to keep information confidential. For this it takes one input message out of all possible input messages and encrypts in such a way that the output doesn't leak any information about the input message. Obviously you do not want that messages encrypt...
*[Codes](https://en.wikipedia.org/wiki/Code_%28cryptography%29)* can do it: they use lookup tables ("*[Codebooks](https://en.wikipedia.org/wiki/Codebook)*") which map something (words, phrases or arbitrary byte sequences) to other symbols, and the latter can occupy less size than the former, thus achieving (possibly on...
1,011,183
I want to change my NSNumberformatter from displaying negative numbers with parenthesis around them to putting the minus sign in front (or whatever the localized standard is). I would assume I could do this with setNegativeFormat: but reading Apple's oh so thorough docs I am left scratching my head: --- **setNega...
2009/06/18
[ "https://Stackoverflow.com/questions/1011183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63761/" ]
If you take a look at the "Format Strings" section in the [Data Formatting Programming Guide For Cocoa](http://developer.apple.com/documentation/Cocoa/Conceptual/DataFormatting/Articles/dfNumberFormatting10_4.html#//apple_ref/doc/uid/TP40002368-SW5): > > The format string uses the format patterns from the [Unicode Te...
In this case it is looking for a format NSString. [Look here for format string details](http://developer.apple.com/documentation/Cocoa/Conceptual/DataFormatting/Articles/df100103.html). If you want the negative of `12,345.67` to display as `-12,345.67`, then I believe the correct NSString value is `@"-#,##0.00"` I al...
1,011,183
I want to change my NSNumberformatter from displaying negative numbers with parenthesis around them to putting the minus sign in front (or whatever the localized standard is). I would assume I could do this with setNegativeFormat: but reading Apple's oh so thorough docs I am left scratching my head: --- **setNega...
2009/06/18
[ "https://Stackoverflow.com/questions/1011183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63761/" ]
OK, so the answer that I got working is: ``` [currencyFormatter setNegativeFormat:@"-¤#,##0.00"]; ``` the key is this whatzit? character "¤". No idea what it's called? anyone? but it represents the localized currency in these format strings...
In this case it is looking for a format NSString. [Look here for format string details](http://developer.apple.com/documentation/Cocoa/Conceptual/DataFormatting/Articles/df100103.html). If you want the negative of `12,345.67` to display as `-12,345.67`, then I believe the correct NSString value is `@"-#,##0.00"` I al...
1,011,183
I want to change my NSNumberformatter from displaying negative numbers with parenthesis around them to putting the minus sign in front (or whatever the localized standard is). I would assume I could do this with setNegativeFormat: but reading Apple's oh so thorough docs I am left scratching my head: --- **setNega...
2009/06/18
[ "https://Stackoverflow.com/questions/1011183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63761/" ]
If you take a look at the "Format Strings" section in the [Data Formatting Programming Guide For Cocoa](http://developer.apple.com/documentation/Cocoa/Conceptual/DataFormatting/Articles/dfNumberFormatting10_4.html#//apple_ref/doc/uid/TP40002368-SW5): > > The format string uses the format patterns from the [Unicode Te...
OK, so the answer that I got working is: ``` [currencyFormatter setNegativeFormat:@"-¤#,##0.00"]; ``` the key is this whatzit? character "¤". No idea what it's called? anyone? but it represents the localized currency in these format strings...
1,011,183
I want to change my NSNumberformatter from displaying negative numbers with parenthesis around them to putting the minus sign in front (or whatever the localized standard is). I would assume I could do this with setNegativeFormat: but reading Apple's oh so thorough docs I am left scratching my head: --- **setNega...
2009/06/18
[ "https://Stackoverflow.com/questions/1011183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63761/" ]
If you take a look at the "Format Strings" section in the [Data Formatting Programming Guide For Cocoa](http://developer.apple.com/documentation/Cocoa/Conceptual/DataFormatting/Articles/dfNumberFormatting10_4.html#//apple_ref/doc/uid/TP40002368-SW5): > > The format string uses the format patterns from the [Unicode Te...
All of the answers given assume that the currency is to two decimal places and also uses commas as thousand separators. Obviously there are a number of currencies that don't conform to this standard, <http://en.wikipedia.org/wiki/Decimal_mark>, so I use the following technique ``` NSString * formattedBalance = [cu...
1,011,183
I want to change my NSNumberformatter from displaying negative numbers with parenthesis around them to putting the minus sign in front (or whatever the localized standard is). I would assume I could do this with setNegativeFormat: but reading Apple's oh so thorough docs I am left scratching my head: --- **setNega...
2009/06/18
[ "https://Stackoverflow.com/questions/1011183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63761/" ]
OK, so the answer that I got working is: ``` [currencyFormatter setNegativeFormat:@"-¤#,##0.00"]; ``` the key is this whatzit? character "¤". No idea what it's called? anyone? but it represents the localized currency in these format strings...
All of the answers given assume that the currency is to two decimal places and also uses commas as thousand separators. Obviously there are a number of currencies that don't conform to this standard, <http://en.wikipedia.org/wiki/Decimal_mark>, so I use the following technique ``` NSString * formattedBalance = [cu...
1,437,355
i just need a hand starting this question. I am asked to plot the direction field of $$y'=e^{-t}+y$$, and the $$\lim\_{t\to\infty}y(t)$$. My process so far: 1. Find the Equilibrium Solutions I know to set $y'=0$, but I don't know if this works since this is also dependent on $t$. $$y=-e^{-t}$$ [![enter image descr...
2015/09/16
[ "https://math.stackexchange.com/questions/1437355", "https://math.stackexchange.com", "https://math.stackexchange.com/users/230868/" ]
In my opinion, $$y'=e^{-t}+y$$is easy to solve, and the answer is $$y=-\frac{e^{-t}}{2}+Ce^{t}$$C is a constant, I plot the direction field by Mathematica: f[t\_,y\_]=E^-t+y StreamPlot[{1,f[t,y]},{t,-5,10},{y,-10,10},Frame->False,Axes->True,AspectRatio->1/GoldenRatio] [![enter image description here](https://i.stack...
Setting $y=e^tu$, we get $$ (D-I)\left(e^tu\right)=e^tu'\implies y=e^t\int e^{-t}(D-I)y\,\mathrm{d}t\tag{1} $$ The given equation says that $(D-I)y=e^{-t}$, so plugging into $(1)$ $$ \begin{align} y &=e^t\int e^{-t}e^{-t}\,\mathrm{d}t\\ &=e^t\left(C+\frac12-\frac12e^{-2t}\right)\\[6pt] &=Ce^t+\sinh(t)\\[12pt] &=y(0)\,e...
45,100,945
I want an array to store the data required to generate both quad and cubic curves. In order to do this, I have done the following: 1. Defined a CubicCurve struct with properties start, end, cp1 & cp2 2. Defined a QuadCurve struct with properties start, end and cp 3. Defined an enum called Path with a case of cubicCurv...
2017/07/14
[ "https://Stackoverflow.com/questions/45100945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1430420/" ]
Try to use ``` paths.append(.cubicCurve(curve)) ``` Because 'curve' is an instance of a CubicCurve type but 'Path.cubicCurve(curve)' is an instance of a Path.
`CubicPath` and `Path` are not compatible types. To properly add a new item to a `[Path]`, you need a `Path` value. Well, there are only two `case`s in `Path`, so it can only be one of them - `.cubicCurve` or `.quadCurve` Obviously what you want is a `. cubicCurve`. We also need to put an associated value in it. You'...
23,338
I want to train neural network on aesthetics. I am getting confused on how to go about for training data. Assume, I have large data set of landscapes, portraits, wildlife etc which are aesthetic according to humans. But, I want to train them for the quality, the kind of colours involved, contrast levels, background bl...
2017/09/26
[ "https://datascience.stackexchange.com/questions/23338", "https://datascience.stackexchange.com", "https://datascience.stackexchange.com/users/9003/" ]
Modeling aesthetics in media is an example of ordinal classification. One of the most actively maintained datasets for this can be found is [Jen Aesthetics](http://www.inf-cv.uni-jena.de/en/jenaesthetics) A relatively recent paper using deep learning towards aesthetics modeling is [this](http://hera.inf-cv.uni-jena.de:...
Your question is not properly framed. Deep learning optimizes a function that maps input variables to output variables. Your input variables are the pictures (specifically, the combination of RGB pixel values). What are your output variables? That is, what specifically do you want the network to predict? If you are tr...