INSTRUCTION
stringlengths
25
999
RESPONSE
stringlengths
0
999
SOURCE
stringlengths
16
38
METADATA
dict
Mass tag update on bookmarks My Delicious account has a great many bookmarks tagged "Bookmarks" - this would have happened when I imported my browser bookmarks into the service. The tag is redundant, and I've worked on eliminating its use. It's a matter of a few clicks to edit a single bookmark and remove the tag; the problem is that I have over 700 bookmarks with the "Bookmarks" tag. Ugh. Is there any easy or automated way to mass edit bookmark tags, or even to remove a particular tag altogether?
Log into < At the top there should be `Home Bookmarks People Tags`, click on `Tags`, `My Tags` On the right hand side, underneath the search bar, highlighted in blue click on `Delete Tags` Choose a tag from the dropdown. This will remove that tag from your bookmarks, and delete the tag. * * * To just remove the tag from certain bookmarks without deleting it, select `Bookmarks` at the top. On the right hand side under the search bar, select `Bulk Edit`. Select the bookmarks you wish to edit and go to `Remove Tag` under the thick blue line.
stackexchange-webapps
{ "answer_score": 3, "question_score": 4, "tags": "delicious, delicious tags" }
SQL query join not working I have three tables.`tooth,toothchart and tblpatient` following are `column` names tooth-Tid,toothName toothchart-patientId,stage, TeethCode,note tblpatient-patientId,fname I want to get all the values from '`tooth`' table and '`teethchart`' table for a given patient values from '`tblpatient`' table,but my query doesn't give all the values of `tooth` table. Here is my query. SELECT tooth.*,teethchart.*,fname FROM tooth LEFT JOIN teethchart ON tooth.toothName = teethchart.TeethCode left join tblpatient on teethchart.patientId=tblpatient.patientId where teethchart.patientId = 'P0001' Can anyone help me to solve this problem?
The following query will pull all the items from the tooth chart, and only those matching from teethchart and tblpatient SELECT t.*, p.fname, tc.* From tooth t left join teethchart tc on t.toothName = tc.TeethCode left join tblpatient p on tc.patientId = p.patientId and p.patientId = 'P0001';
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 2, "tags": "sql, join" }
Почему ifstream не воспринимает абсолютный путь к файлу в linux? Так работает: ifstream list("../../../.Alarm_clock/output.txt"); Так - нет: ifstream list("$HOME/.Alarm_clock/output.txt");
Насколько я могу судить о Linux (я в нем не слишком знаток), `$HOME` \- указание для оболочки подставить значение переменной среды `HOME`. Что конструктор `ifstream`, естественно, не делает. Воспользуйтесь соответствующей функцией - как я понимаю, `getenv("HOME")`, и соберите полный путь к файлу.
stackexchange-ru_stackoverflow
{ "answer_score": 8, "question_score": 3, "tags": "c++, linux, файловая система" }
It is possible to stack two different Add-Ons in Raspberry Pi 3? I need to create a project that has GPRS/GSM and GPS, but there are no products with both functionalities. I found some Add-Ons that may work but I'm not sure if there is any way to stack both. I know that is impossible to put one on top of each other because there aren't compatible. The products are: * GPS -> < * GSM/GPRS -> < OR < **There is any way to stack this Add-Ons in Raspberry Pi 3 Model B?**
With these particular add-ons, no, because they both expect exclusive access to the serial port. You can get GPIO stacking headers for adding multiple HATs, but you always have to check if there's pin contention. pinout.xyz is a good resource. Boards based on other chipsets such as the SIM908 combine GSM/GPRS and GPS on one module.
stackexchange-raspberrypi
{ "answer_score": 1, "question_score": 0, "tags": "pi 3, gps, modules, gsm" }
Printing hex-string format variable in python I'm retrieving a hex-string format IP address of CDP neighboor from the router using NET-SNMP. However, I get instead something weird thing. Any help? Thank you
As alecxe mentioned, you really need to provide more details when asking questions. Fortunately, I've used the NET-SNMP bindings for Python and already know what you are talking about. To convert the binary data you receive from the NET-SNMP bindings to a hex representation, use the Python binascii module. The b2a_hex function is what you are looking for. The following is mostly from memory, so it may not be exactly correct, but probably close enough to give you an idea. import netsnmp import binascii session = netsnmp.Session(Community='public', DestHost='myagentip', Version=1) vbwithbinarydata = netsnmp.VarBind('oid_to_binary_data') varlist = netsnmp.Varlist(vbwithbinarydata) session.get(varlist) print binascii.b2a_hex(vbwithbinarydata.val)
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "python, snmp" }
In Spring MVC, do I need to unbind bean objects bound to the session when I am done using the session scoped bean? If yes, how? I am using few session scoped beans in the app context xml of my spring mvc app. I have seen `invalidate()` method in `HTTPSession` class which does the detaching thing. Do I need to call this method somewhere in my spring app also to free up the session from the session scoped beans when those beans are mo more in use? Or does Spring internally take care of this?
No, you don't need to call `Session#invalidate()` for session scoped beans as `DispatcherServlet` takes care of these things. It use 'org.springframework.web.context.request.RequestAttributes#registerDestructionCallback callback list functionality to register all these scoped beans. Link : <
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 1, "tags": "java, session, spring mvc, javabeans" }
Buffer overflow exploit not working for kernel module I have done buffer overflow exploits for user level processes in the past. However this does not seem to work good if I try to overflow the buffer of a vulnerable kernel module. Here's what I do: There is a vulnerable kernel module which I can open as a file and read/write to it. The write operation is done without bounds checking. So I do a write operation and overflow the buffer and overwrite the return address as the address of an environment variable that has my shellcode. But something is going wrong. The kernel crashes and after rebooting I opened /var/log/messages and find that the eip is correctly pointing to the address I overwrote. But still it crashes saying "Unable to handle kernel null pointer dereference at virtual address" Any reason why this would happen? Why wouldn't the control be redirected to a overwritten return address? Note: I ran this on redhat enterprise linux with exec-shield and ASLR turned off.
The kernel can't jump to user addresses without performing a kernel exit, since it is running in a privileged mode with a different configuration than userspace (e.g. different paging tables, CPU permission bits, etc.). So, in order to get shellcode into the kernel, you'd have to pack the shellcode into the buffer written to the driver (and copied to the kernel), and somehow get the address of it. This is not so hard if you have access to the kernel map, but recently Linux distributions have begun locking access to such sensitive information to make it harder to exploit kernel bugs.
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 2, "tags": "kernel module, buffer overflow, exploit" }
Inversion in one to one region of a polynomial Suppose I have a polynomial: $P(x)=x-x^3$ defined for $x\in[0,1]$. Plot of $P(x)$ over this range of $x$ shows that each value of $P$ corresponds to two different values of $x$ (the curve is concave downward, beginning and ending at zero), except at the peak value of the curve, $\hat{P}$, which occurs at $x=1/\sqrt{3}$. Now if I limit $x$ to the interval $[0,1/\sqrt{3}]$, I have a one-to-one correspondence between $P$ and $x$. I was wondering if I can invert the polynomial in this limited region to obtain $x(P)$. My ultimate aim is to obtain $\frac{dx}{dP}$ in this region. Any help is appreciated. Thanks in advance.
$x-x^3=y$ is a cubic equation. It can be solved by algebraic means, but the answer does not look pretty: $$ x=-\frac{\sqrt[3]{2} \left(\sqrt{81 y^2-12}+9 y\right)^{2/3}+2 \sqrt[3]{3}}{6^{2/3} \sqrt[3]{\sqrt{81 y^2-12}+9 y}}. $$ You can find the derivative by implicit differentiation: $$ (3\,x^2-1)\,\frac{dx}{dy}=1. $$
stackexchange-math
{ "answer_score": 2, "question_score": 1, "tags": "polynomials, inverse, monotone functions" }
Enthought Canopy (python) does not scroll to bottom of output automatically I have just started using Enthought Canopy (v1.4.9 64 bit for Windows) instead of IDLE. I am a complete beginner and teaching myself python from various online courses. When I run scripts in IDLE the output scrolls to the bottom of the IDLE screen, so if I am asking for raw_input multiple times the user can see what input is being asked for each time and just enter it without having to manually scroll down to the bottom of the output before entering their input. However, in Canopy the output does not scroll all the way to the bottom of the 'Python' window. Is there any command I can put in a script to tell if to automatically scroll to the bottom? I've tried to search for how to do this online but could only find tutorials on setting up scroll bars.
Sorry for the trouble. Canopy's IPython _is_ IPython's QtConsole; the same behavior appears in a plain (non-Canopy) QtConsole. We'll see if we can find a fix. Meanwhile, a workaround is to run plain (non-QtConsole) IPython: from Canopy's Tools menu, open a Canopy Command Prompt, then type `ipython --pylab qt` (or just `ipython` if you don't want pylab behavior), and run your script from there.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 1, "tags": "python, python idle, canopy" }
How to remove \r\n from string at : Hey im trying to split a line read from a file, the file contains several lines that read like username:password\r\n username:password\r\n username:password\r\n And so on im not sure how to do them all at the same time and split them into 2 different vars one for username and one for password.
Using a regex and `matchAll()`, and passing the returned iterator to `Array.from()` and using the built in `map()` to return objects. (Has the added benefit of allowing `:` in passwords) const input = 'user1:password1\r\nuser2:password2\r\nuser3:password3\r\n'; const result = Array.from( input.matchAll(/(.+?):(.+?)\r\n/g), ([, username, password]) => ({ username, password }) ); console.log(result);
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": -2, "tags": "javascript, node.js, split" }
How can I parse an IP address I have to parse to get an IP address. $Currentpath = Split-Path -Parent $MyInvocation.MyCommand.Definition $CheminCSV = $currentpath + '\LesIP.csv' $csv = Import-Csv $CheminCSV $MyIPS = $csv | select IP $MyHostnames = $csv | select HostName Write-Host($MyIPS[1]) The actual results are: @{IP=192.168.1.10} and I expect: 192.168.1.10
This is not a parsing issue. Your CSV has a header for "IP". If you import this CSV, you get an object with a property "IP", which you assign to `$MyIPS`. You can get your expected output by `$MyIPS[1].IP`. Or you simple change your `select` (i.e. `select-object -Property`) to `Select-Object -ExpandProperty IP`.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "powershell, csv, parsing" }
How to make a time series start at 0 (in hours) I have a series: x-values in datetime format and y-values are just numbers. I need to make the graph start at 0, and increment in hours. So if my series started at 12pm tuesday and went until 5am thursday, 12pm tuesday would be 0 and 5am thursday would be 41. No clue on how to convert this.
The answer I came up with: dim startDate as integer = DateTime.now dim startDay as integer = startDate.dayOfYear dim startHour as integer = startDate.hour dim startMinute as integer = startDate.minute dim startSecond as integer = startDate.second For extra precision I also included milliseconds dim startMillisecond as integer = startDate.millisecond When it was time to calculate the time difference in hours: timeDifference = ((thisDay - startDay) * 24) + (thisHour - startHour) + ((thisMinute - startMinute) / 60) + ((thisSecond - startSecond) / 3600) + ((thisMillisecond - startMillisecond) / 3600000) `thisDay`, `thisHour`, `thisMinute`, `thisSecond`, `thisMillisecond` were all calculated the same way as the start variables.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "vb.net" }
Host Client-Side web part from SharePoint Library I'm following the SPFx Getting started guide for web parts and I'm at part 4. In the note at the top of the page, there is mention of hosting from a SharePoint Library from your tenant (immediately after the "Azure CDN" link), but there is no reference of how to do this. Are there any guides out there that I could follow to try this method?
While CDNs are good for performance, you dont need to necessarily enable them just to use `SPFx` webparts. Just modify the `Config > write-manifests.json` and add your SharePoint location as below: { "$schema": " "cdnBasePath": " } Upload your artefacts in the Site Assets or any other document library. After that, run the `gulp bundle --ship` and `gulp package-solution --ship` and follow the instructions mentioned in the link that you shared and upload the app in app catalog. Using this `cdnBasePath` you can consume files directly from SharePoint library itself instead of enabling Office 365 CDN or using Azure or another CDN provider.
stackexchange-sharepoint
{ "answer_score": 4, "question_score": 0, "tags": "sharepoint online, spfx, spfx webparts" }
Combine 2 sections of aws ec2 describe-instance output I am trying to combine the following 2 commands into 1 aws ec2 describe-instances --query Reservations[].Instances[].State[].{InstanceState:Name} --output table aws ec2 describe-instances --query Reservations[].Instances[].Tags[].{InstanceName:Value} --output table My last ditch plan is to call both separately but I am sure there is a way to do this in 1 line. The closet I got was 1 table with the incorrect instance name using the command below. aws ec2 describe-instances --query Reservations[].Instances[].State[].{InstanceState:Name,InstanceName:Tags.Value} --output table Sample output Describe Instances InstanceName | InstanceState Name A | running Name B | stopped Does anyone know what I am missing?
There can be more than one tag but only one value for other attributes like instance state, so get the first element in the tags assuming it always has the name for all instances. I tried the following and it worked fine for me: aws ec2 describe-instances --query Reservations[].Instances[].[State.Name,Tags[0].Value] --output table
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "amazon web services, aws cli, amazon ec2" }
Epsilon Delta Limit Proofs at and going to infinity. So I understand the concept of epsilon delta limit proofs with linear functions, easy enough, and I am still shaky about doing it with non linear but I am slowly understanding that. I don't quite understand how to tackle them with you have infinity involved. My professor uses M's and N's and I really don't know what these are supposed to represent in terms of the technical definition we are using here. One of the problems I have to look at is: $\lim_{x \to \infty} e^x = \infty$ Can anyone give me some other similar examples, not necessarily with $f(x) =e^x$, but any of these proofs that involve infinity, because the normal definition no longer works as written and I don't really know where to begin. Any resources you can provide me to learn more about this would be greatly appreciated!
Here, you need to prove that $e^x$ is unbounded. see < Given any $\epsilon\gt 0, \exists x_0\gt 0$ such that $|f(x)|\gt \epsilon$ $\forall x\gt x_0$. Choose $\epsilon\gt 0$. Now, we need to find corresponding $x_0$ such that $|e^x|\gt \epsilon $ $\forall x\gt x_0$. If we take $x_0=\ln\epsilon$, then $|e^x|\gt|e^{x_0}|(=\epsilon)\implies |e^x|\gt \epsilon$ $\forall x\gt \ln\epsilon$, Hence $e^x$ is unbounded and positive and thus $\lim_{x\to\infty}e^x=\infty$
stackexchange-math
{ "answer_score": 7, "question_score": 4, "tags": "limits" }
Formal Language vs First Order Language My book, when speaks about the "First Order Logic" calls it "language". This term can be used also to denote a sub-set of this language or it can only be used to denote things like: -First order language -propositional language -second order language ??
A Formal system is made of: > _(i)_ a _language_ , made of > >> _(i.a)_ an _alphabet_ : a set (usually finite) of _symbols_ , and >> >> _(i.b)_ a _grammar_ : a set of rules which tell how some expressions are _well-formed_ (i..e. meaningful); and: > _(ii)_ a _proof system_ (or _calculus_ ), made of > >> _(ii.a)_ a set of "special" formulas: the _axioms_ , and >> >> _(ii.b)_ a set of _inference rules_. First-order logic (or _predicate calculus_ ) is a proof system based on first-order language, i.e. the language having as _logical symbols_ , in addition to the (propositional) _connectives_ , also the _quantifiers_ and the (individual) _variables_. It is called "first-order" because quantification is allowed on individual variables only. When quantification is allowed also on predicate variables, we call it Higher-order logic.
stackexchange-math
{ "answer_score": 2, "question_score": -1, "tags": "logic, first order logic" }
How do I move h1 text to the bottom of box? I want to move the h1 text (You say tag ) to the bottom, however I could not do it. Sorry , pardon for asking such a simple question but I need help as it is my 1st day ! So far I Thank you ! here is the pic This was the mistake I made, before asking here. I tried to use CSS to align them by the position or align. However, it still didn't worked. Therefore, the way I solved it was by just putting the h1 (YOU SAY TAG) under the div . <div class="box1"> <H1> YOU SAY TAG </H1> <div class="box2"> <h1> WHEN I SAY DIV...</h1></div> </div>
Just put your `<h1>` text _under_ the `child` `div` inside your `parent` `div` <style> .parent { background-color: grey; width: 50%; } .child { background-color: yellow; width: 80%; height: 200; } </style> <div class="parent"> <div class="child"> <h1>When I say div... </h1> </div> <h1>You say tag </h1> </div>
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 1, "tags": "html, css" }
If $g=(f\cdot a+g\cdot b) G-J\cdot g\mod m^{i+1}[x]$ is $g$ a multiple of $G$? Let $R$ be a local ring with maximal ideal $m$. If we have polynomials * $f,g\in m^i[x]$ * $a,b, G\in R[x]$ * $J\in m[x]$ such that $$g=(f\cdot a+g\cdot b) G-J\cdot g\bmod m^{i+1}[x].$$ Then is it correct that $g$ is a multiple of $G$ in $m^{i+1}[x]$? I know we can write $$(1+J)g=(f\cdot a+g\cdot b)G\bmod m^{i+1}[x]$$ but why does this necessarily mean that $g$ is a multiple of $G$ and not the other way around?
Note that $J \cdot g \in m^{i+1}[x]$, so $g = (f \cdot a + g \cdot b)G \bmod m^{i+1}[x]$.
stackexchange-math
{ "answer_score": 1, "question_score": 3, "tags": "commutative algebra" }
Finding source code for login I set "user1 hard maxlogins 2" i found "logged in as user1 twice" While logging for third time it said "Too many logins" - So i logged out "logout" from previous two logins ...even now it says the same error msg I can verify this using "who" command running as root and check pam.d/login looks fine too. I think ,its bug with login binary where can i found source for both login and limits.conf
On my ubuntu system: apt-file search /bin/login gives: gforge-web-apache2: /usr/share/gforge/www/scm/viewvc/bin/loginfo-handler login: /bin/login userful-multiplier: /opt/userful/bin/login-server so, on debian based distros, you can get the source for the "login" package: apt-get source login **Edit** Seems the actual package name is "shadow".
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "linux, authentication" }
Good idea to remove uncommon tags from questions? As a result of tagging guidelines and the long list of tags that are only used last (just go to the Tags list and jump to last page), I've started editing some of those out of existence. Is it a good idea? Should I bother? When should I avoid removing the tag?
Just because a tag is rarely used does not mean it shouldn't be there. Typos are one thing, those should be deleted. But some tags really are uncommon. They don't really add noise, they might actually help when searching. For instance, on the last page is the ripemd tag, with only 1 question. It's not a typo, it's not a duplicate, there's no alternative way of spelling it. There simply are no other questions tagged ripemd; it should not be deleted, because it either has or will have value. It's not always that easy to determine what's useful.
stackexchange-meta
{ "answer_score": 11, "question_score": 3, "tags": "discussion, tags" }
Mutt, empty email account from command-line trying to figure out a cli way to empty all email from a specific email account. It is certainly possible to type: mutt -f account D ~s .* then quit.... Is there a way to do this all from cli/cron?
But `echo -n > /var/spool/mail/account` does the trick.
stackexchange-serverfault
{ "answer_score": 4, "question_score": -2, "tags": "command line interface, cron, mutt" }
TeamCity can't locate any artifacts after a build I have a build in TeamCity which runs against a project file names Web.csproj (inside a "Web" folder in the root) and targets "Package". It runs just fine and I get a nice Web\obj\Debug\Package folder with all the expected content. I then have a second build with an artifact dependency on the above path which is intended to run the deploy command. However, no matter what I do I always get a "Failed to download artifact dependency" error message followed by "No files matched for pattern "Web/obj/Debug/Package"". Even if I set the artifacts path to just ** and try to pull everything from the root, it fails. Looking on the server, there are clearly files in the working directory. Does anyone have any guidance for troubleshooting this?
For the sake of completeness, the answer was that I hadn't defined an artefact path in the first build. Without specifying the output to save from this build, it won't be available in dependent builds.
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 11, "tags": ".net, msbuild, teamcity" }
Can land lord prevent room sharing overnight due to religious reasons? We both pay rent separately and have two separate rooms Landlord is trying to prevent bf and I from sleeping in one room overnight. We both have our own rooms. However I mostly just use it to change and store my stuff. He made a written agreement after I moved in and asked me to sign it. !enter image description here
The landlord cannot terminate the lease before the end of the current lease period (the month, on whatever day is the anniversary of starting the lease), since this was not a condition of the lease. You have been notified of this new term, so starting with the next month, it is part of the conditions constituting the lease, whether you sign or not. (However, you could explicitly "decline" this clause, i.e. overtly not agree to that term, then the landlord would decide whether to renew the lease without the objectionable clause). By continuing to reside there, having been notified of this condition you accept that term, so you are bound by that condition, which is not prohibited by Texas law. After the end of this month, the new term would apply, and eviction for violating the lease could proceed.
stackexchange-law
{ "answer_score": 1, "question_score": 1, "tags": "united states, real estate, landlord, texas, tenant" }
Pelican site on Netlify I am using pelican to create myself a static site. I'm trying to build the site in Netlify. I am using the following image in Netligy: > Ubuntu Xenial 16.04 (default) Current default build image for all new sites And am trying to build using the command: pelican However I get the following error: pelican: Command not found I have a **runtime.txt** file with **3.5.2** Has anyone managed to set up a site using pelican in Netlify? How do I set up my site as continuous deployment?
If you setup everything correctly, you can use the command `make publish` and publish would be `output`. Those are the typical defaults for pelican the last time I tested it. If you do not have a `requirements.txt` file, you can run: pip freeze > requirements.txt You can include a `netlify.toml` file in your project (repository) root. `netlify.toml` [build] command = "make publish" publish = "output" **_Note:_** the two publish command names are not related. The makefile publish is usually a default. The `build.publish` tells Netlify where to get the site for publishing to the CDN.
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 1, "tags": "netlify, pelican" }
showing error while configuring the secret key in flask [see in this app.config(SECRET_KEY)=' '] shoing error that is Expression cannot be assignment target1
Should be changed to the following: app.config['SECRET_KEY'] = "YOUR_KEY_VALUE"
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": -2, "tags": "python" }
Blender smoothed everything I am new to Blender and started to create a low-poly character. I was working on the hands when suddenly Blender smoothed everything out. I googled a bit but i couldn't really find a solution to this. I wanted to extrude and i don't know what i accidently pressed but this happned: ![enter image description here]( How can i undo this ?
Did u accidentally add a modifier? if that's the case remove it. If that's not the case then try decimating its geometry. To decimate: Properties -> Modifiers. Then click on Add modifier and select Decimate\ hopefully, that should work
stackexchange-blender
{ "answer_score": 0, "question_score": 0, "tags": "modeling" }
$\sigma$-Algebra generated by a simple characteristic function Suppose that $X:\Omega \rightarrow \mathbb{R}$. Let $A \in \mathcal{B}$ be a Borel set. Suppose that $X = \sum_i a_i\chi_{A_i}$ is a simple random variable defined on the probability space $(\Omega,\mathcal{F},\mathbb{P})$. Show that $A_i \in \sigma(X)$.
$$\begin{equation} \begin{split} \sigma(X) & = X^{-1}(\mathscr{B}(\mathbb{R})) \\\ & = \sigma(\\{A_1,A_2,...,A_n\\}) \end{split} \end{equation}$$ Hence, $A_i \in \sigma(X)$
stackexchange-math
{ "answer_score": 0, "question_score": 0, "tags": "measure theory, characteristic functions" }
When should I use 'Cheer!', 'Cheers!'? May be it's simple but I'm stuck. I'm using "Cheers!" for a toast or valediction on any internet forums. When I'm writing "Cheers!" I want say 'Thanks for the communication! Goodbye!' Can I use "Cheer!" for the same? Or does "Cheer!" have a different meaning?
Very good question. I think 'Cheer' on its own does not stand as an expression. You need to have a phrase. > I cheered up when she arrived > To cheer her up, I took her on a long drive On the other hand, if you want to express your 'joy' the way you explained, **in a single word** , it's _Cheers!_ However, you can use multiple 'cheers' to augment your expression! However, it then becomes an idiom. > _'Three cheers for the winners'_
stackexchange-ell
{ "answer_score": 3, "question_score": 5, "tags": "meaning" }
Divide two values from same column and then show only values between 0 and 3 I am not sure if this is even possible but I am trying to filter "results" after dividing two values from the same column (which already works). SELECT "Business Name", (sum(CASE WHEN "Source Indicator" = 'Month end cash balance' THEN "EUR AMOUNT" END) / sum(CASE WHEN "Source Indicator" = 'Total OPEX' THEN "EUR AMOUNT" END)) AS "Run Rate" FROM "Steering_database_eur" WHERE MONTH("End Date") = (MONTH(GETDATE()) - 1) GROUP BY "Business Name" Now all I need is to show only values between -10 and 3 in the "Run Rate" column. Thanks a lot in advance
Not sure if this is what you are after: SELECT "Business Name", (sum(case when "Source Indicator" = 'Month end cash balance' then "EUR AMOUNT" end) / sum(case when "Source Indicator" = 'Total OPEX' then "EUR AMOUNT" end)) as "Run Rate" FROM "Steering_database_eur" WHERE MONTH("End Date") = (MONTH(GETDATE()) -1) GROUP BY "Business Name" HAVING (sum(case when "Source Indicator" = 'Month end cash balance' then "EUR AMOUNT" end) / sum(case when "Source Indicator" = 'Total OPEX' then "EUR AMOUNT" end)) BETWEEN 0 AND 3
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "sql" }
Find the sum explicitly in the interval of convergence of the series Find the sum explicitly in the interval of convergence of the series. $\sum _{n=1}^{\infty }\:\frac{n}{n+1}\left(2x-1\right)^n$ Here is the work that I did: $let\:t\:=\:2x-1$ $\frac{n}{n+1}\:=\:1\:-\:\frac{1}{n+1}$ $\sum _{n=1}^{\infty }\:\frac{n}{n+1}t^n\:=\:\sum _{n=1}^{\infty }\:t^n\:-\:\sum \:_{n=1}^{\infty \:}\:\frac{1}{n+1}t^n\:=\:\frac{1}{1-t}-\sum _{n=1}^{\infty }\:\frac{1}{n+1}t^n$ $f\left(t\right)\:=\:\sum _{n=1}^{\infty }\:\frac{1}{n+1}t^n$ $tf\left(t\right)\:=\:\sum _{n=1}^{\infty }\:\frac{1}{n+1}t^{n+1}$ And here is where my work differs from the solution of the problem. While I do: $\frac{d}{dx}\left(tf\left(t\right)\right)\:=\:\sum _{n=1}^{\infty }\:t^n\:=\:\frac{1}{1-t}$ The solution says: $\frac{d}{dx}\left(tf\left(t\right)\right)\:=\:\sum _{n=1}^{\infty }\:t^n\:=\:\frac{t}{1-t}$ Following by an integration step and dividing by t. Which one is the correct approach and why?
$\sum _{n=1}^{\infty }\:t^n = t+t^2+\cdots \implies \sum _{n=1}^{\infty }\:t^n= t (1+t+t^2+\cdots)=t + t\sum _{n=1}^{\infty }\:t^n \implies \sum _{n=1}^{\infty }\:t^n = \frac{t}{1-t}$. It seems you misread the sum as $\sum _{n=0}^{\infty }\cdots$
stackexchange-math
{ "answer_score": 0, "question_score": 0, "tags": "sequences and series, convergence divergence, power series" }
silverlight business application - mysql/net 6.5.4 connector - object reference not set I have created a new silverlight business application. I have added mysql.data, mysql.web, mysql.data.entity dll's of version 6.5.4 mysql/net connector. I built the solution. Then I got the blue icon, where i can configure connector to mysql db for role providers and connection string. but thats not happening. When I clicked the icon, I am getting error saying "Object reference not set to instance of object" What could be the problem? KIndly help me with workaround MY ENVIRONMENT VS2010, Silverlight4, silverlight toolkit APR2010, mysql server installed, mysql connector 6.5.4, Windows 7 64bit. thanks EDIT 1:: all the connectors are added to silverlight host web application, but not to silverlight application directly. All the connector dll's are added to the host application to consume in web services.
Uff.... some relief. I made a mistake. We should click the blue icon of net/mysql connector in the solution explorer, after selecting the web hosting project but not the actual silverlight project. This is working only with few of my solutions though. Edit:: Working fine. I completely messed up web.config of both silverlight application and web hosting project. Cleaned the code, removed the references, added them again. Now, the mysql connector wizard works like a charm.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "silverlight, visual studio 2010" }
How to parse a Lua data table into C# dictionary or other usable class? I have this Lua file which contains the following code: options = { ["VR"] = { ["box_mouse_cursor"] = false, ["custom_IPD"] = 63.5, ["custom_IPD_enable"] = true, ["enable"] = false, ["hand_controllers"] = false, ["pixel_density"] = 2, ["prefer_built_in_audio"] = true, ["use_mouse"] = true, } } I am trying to find an assembly that will parse this into something usable by my .Net Framework 4.5.1 C# project. LuaInterface is .NET standard 2.0 project which can't be used in .Net Framework 4.5.1, so that's off the table. Are there any tools available that can parse this information, and hopefully serialize it back again?
I would consider using Lua to encode the nested table structure that you have into JSON. That would give you a standard format to write to disk and/or easily pass into another code base. There are quite a few options available when you search for that online (`lua table encode json`) or even here on SO people are trying to pedal their JSON encode/decode Lua libraries when similar questions were asked. Here, for example, is the reverse case.
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 2, "tags": "c#, lua" }
Determining whether a linear operator is bounded Let $A\in\mathbb{R}^{n\times n}$, $B\in\mathbb{R}^{n\times m}$ and let $T:\mathcal{L}^{2}([0,t];\mathbb{R}^{m})\to\mathbb{R}^{n}$ (for some fixed $t>0$) be defined by \begin{equation*} Tx=\int_{0}^{t}\mathrm{e}^{A(t-\tau)}Bx(\tau)\,\mathrm{d}\tau. \end{equation*} Here, $\mathrm{e}^{A}$ refers to the matrix exponential. Why is it that $T$ is a bounded linear operator? Linearity seems clear to me, but how do I estimate the integral to show the boundedness of $T$?
Using the series representation of $e^{At}$, one immediately gets (by triangle inequality) $$ \|e^{A(t-\tau)}\| \le e^{\|A\|(t-\tau)} \le e^{\|A\|t}, $$ which is independent of the integration variable $\tau$.
stackexchange-math
{ "answer_score": 0, "question_score": 1, "tags": "real analysis, functional analysis" }
create size categories without nested ifelse in R Basically I got the problem solved, but I am trying to find a more elegant solution since the code gets a little bit hard to read. Here´s what I got: mydf$size_class = ifelse(mydf$absolute_number <= 5,"1-5",ifelse(mydf$absolute_number > 6 & mydf$absolute_number <= 10,"6-10","x")) Maybe I need rather some formatting help / hints, convention than a new code :) – those are also very welcome ;)
Try the `cut` function: R> x <- 1:10 R> cut(x, breaks = c(0, 5, 10), labels=c("1-5", "6-10")) [1] 1-5 1-5 1-5 1-5 1-5 6-10 6-10 6-10 6-10 6-10 Levels: 1-5 6-10
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 1, "tags": "r, if statement" }
Dynamically accessing multidimensional array value I'm trying to find (or create) a function. I have a multidimensional array: $data_arr = [ "a" => [ "aa" => "abfoo", "ab" => [ "aba" => "abafoo", "abb" => "abbfoo", "abc" => "abcfoo" ], "ac" => "acfoo" ], "b" => [ "ba" => "bafoo", "bb" => "bbfoo", "bc" => "bcfoo" ], "c" => [ "ca" => "cafoo", "cb" => "cbfoo", "cc" => "ccfoo" ] ]; And I want to access a value using a single-dimentional array, like this: $data_arr_call = ["a", "ab", "abc"]; someFunction( $data_arr, $data_arr_call ); // should return "abcfoo" This seems like there's probably already a function for this type of thing, I just don't know what to search for.
Try this function flatCall($data_arr, $data_arr_call){ $current = $data_arr; foreach($data_arr_call as $key){ $current = $current[$key]; } return $current; } ### OP's Explanation: The `$current` variable gets iteratively built up, like so: flatCall($data_arr, ['a','ab','abc']); 1st iteration: $current = $data_arr['a']; 2nd iteration: $current = $data_arr['a']['ab']; 3rd iteration: $current = $data_arr['a']['ab']['abc']; You could also do `if ( isset($current) ) ...` in each iteration to provide an error-check.
stackexchange-stackoverflow
{ "answer_score": 9, "question_score": 6, "tags": "php, function, multidimensional array" }
Is there a permutation on $\mathbb{N}$ that, if repeated often enough, eventually shuffles the whole set? Does there exist a computable $\pi : \mathbb{N} \to \mathbb{N}$, bijective† and such that for all $i,j\in\mathbb{N}$ there is a $k\in\mathbb{N}$ with $$ \pi^k(i) > j, $$ and, if yes, what is a natural example? * * * †I'm reasonably sure that at least the inverse will have to be uncomputable, but I would need only $\pi$ itself to be computable.
A simple example is the permutation $\pi$ given by $\pi(n)=n+2$ if $n$ is even, $\pi(1)=0$, and otherwise $\pi(n)=n−2$. It should be clear that $\pi$ is computable and has the desired property. By the way, regarding the footnote: if a bijection is computable, so is its inverse, so $\pi^{-1}$ is computable as well. In general, given a computable bijection $\sigma$, a simple algorithm to compute $\sigma^{−1}$ is as follows: Given $n$, to compute $\sigma^{-1}(n)$, compute in succession $\sigma(0),\sigma(1),\dots$, until you reach a $k$ such that $\sigma(k)=n$, which must happen since $\sigma$ is a bijection. This tells us that $\sigma^{−1}(n)=k$.
stackexchange-math
{ "answer_score": 3, "question_score": 8, "tags": "elementary set theory, permutations, computability" }
Python: Loop through multiple lists and create a tuple I have 2 lists of data and I would like to create a tuple for this lists that looks like ttuple=(1,[4,6,counter]) listA=[1,2,3,4,5,6,7,8,9] listB=[3,4,5,7,8,9,0,-4,5] counter=0 for i in range(len(listA)): for lista in listA: for listb in listB: data=(i,[lista,listb,counter]) myList.append(data) print(data) Only the last value is printed. Can someone point to me what I am doing wrong. Its supposed to print tuple list of 9 values like the following. The last number is a counter that increments by 1 (0,[1,3,0),(1,[2,4,0]),(2,[3,5,0]) All i get is the following: (0,[1,1]),(0,[1,1]),(0,[1,1]), (1,[2,2]),(1,[2,2]),(1,[2,2])
You can use enumerate and zip in conjunction to get what you want: >>> listA=[1,2,3,4,5,6,7,8,9] >>> listB=[3,4,5,7,8,9,0,-4,5] >>> output = [] >>> for i, a in enumerate(zip(listA, listB)): ... output.append((i, [a[0], a[1], 0])) ... >>> output [(0, [1, 3, 0]), (1, [2, 4, 0]), (2, [3, 5, 0]), (3, [4, 7, 0]), (4, [5, 8, 0]), (5, [6, 9, 0]), (6, [7, 0, 0]), (7, [8, -4, 0]), (8, [9, 5, 0])]
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 1, "tags": "python" }
Using the BindAttribute Globally In a ASP.NET MVC (4) application, I am using a 3rd party Javascript library that auto-magically sends back a query string parameter with a poor name (IMO). I can intercept this value in model binding with the following: public ActionResult MyAction([Bind(Prefix="rp")] int pageSize = 50) { } However, this code inside all the places where I use paging gets tiresome pretty quickly. **Is it possible inside ASP.NET MVC to globally set a [BindAttribute] with a specific prefix/replacement combination?** A workaround would be to modify the Javascript library (undesirable); or get the parameter out of the `Request.QueryString` property manually; but I was hoping to keep things cleaner.
You could use a view model: public class MyViewModel { public int PageSize { get; set; } } in your controller action(s): public ActionResult MyAction(MyViewModel model) { ... } and then write a custom model binder for this view model: public class MyViewModelBinder: DefaultModelBinder { protected override void BindProperty(ControllerContext controllerContext, ModelBindingContext bindingContext, PropertyDescriptor propertyDescriptor) { bindingContext.ModelName = "rp"; base.BindProperty(controllerContext, bindingContext, propertyDescriptor); } } that will be registered in `Application_Start`: ModelBinders.Binders.Add(typeof(MyViewModel), new MyViewModelBinder());
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "asp.net mvc, asp.net mvc 4" }
How can I use the paintComponent method with a layout manager I want to use a layout manager to layout several JButtons, JComboBoxes, etc.. I also want to use the paintComponent method to make a custom background for the JFrame rather than just the normal solid color background. For some reason, the JButtons and other component that have been added to the layout manager show correctly but the shapes that I have drawn in the background with paintComponent do not show up. How can I fix this?
If you want to be able to use paintComponent with a layout manager you are not going to be able to do it from withing the class that extends the JFrame. I would recommend adding a JPanel to the JFrame and having the paintComponent method in the JPanel. The JPanel should have no problem using the paintComponent method with the layout manager. If you use setLayout with the JPanel then you should be able to exclude it from the layout manager. I hope that this answers your question.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": -1, "tags": "java, swing, graphics, layout manager, paintcomponent" }
Razor Syntax / WebMatrix - C# I'm just starting out with WebMatrix and would like to know how to style a `@Html.TextBox("email")` and `@Html.Password("password")` control? I've tried (in my CSS file): .email{ /* styles here */ } .password{ /* styles here */ } But that has no effect at all. How can we style these types of controls?
You can indicate what class to use when creating the text box with an anonymous type like so: `@Html.TextBox("Email", null, new { @class="email" })`
stackexchange-stackoverflow
{ "answer_score": 6, "question_score": 2, "tags": "c#, asp.net, css, razor, webmatrix" }
What do I need to declare about data collection and analytics tools if I only use admob? I have an app that is a basic game with admob implementation. I collect no data myself. Most policy generators ask questions like: \- "What kind of personal information you collect from users?" \- "Do you use tracking and/or analytics tools" What kind of personal info does AdMob collect? Does AdMob use any tracking or analytics stuff?
You’re asking the right questions. You are the data controller, and admob is one of your data processors, so it’s your responsibility to ensure that admob treats your users data appropriately. So that means you need to answer those questions, which hopefully will be covered in admob’s own privacy policy and terms & conditions, so I recommend you go find them! You can’t safely gloss over this because if admob does anything wrong (e.g. they have a data breach), it’s you that will be held responsible, as far as your users are concerned.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "admob, privacy, privacy policy" }
Find basis to $\begin{bmatrix}1&-4&3&-1\cr2&-8&6&-2\end{bmatrix}$ I want to find the basis to $$x_1-4x_2+3x_3-x_4=0$$ $$2x_1-8x_2+6x_3-2x_4=0$$ so I set up the matrix: $\begin{bmatrix}1&-4&3&-1\cr2&-8&6&-2\end{bmatrix}$ to get $\begin{bmatrix}1&-4&3&-1\cr0&0&0&0\end{bmatrix}$ Then I would get $\begin{bmatrix}x_1\cr x_2\cr x_3\cr x_4\end{bmatrix}=\begin{bmatrix}4b-3c+d \cr b\cr c\cr d\end{bmatrix}$. The issue is that I don't know how to then find the basis afterwards. Somone said I have to get $=b\begin{bmatrix}4\cr 1\cr 0\cr 0\end{bmatrix}+c\begin{bmatrix}-3\cr 0\cr 1\cr 0\end{bmatrix}+d\begin{bmatrix}1\cr 0\cr 0\cr 1\end{bmatrix}$ and each of the matrices are the vectors of the basis set. But I wasn't sure howe we get the last step?
You find a basis for a _vector space_ , not for a linear equation. According to what you did, you are looking for a basis for the _kernel_ of the coefficient matrix, or equivalently, a basis for the _solution space_ of the homogeneous linear equation. You have already found an answer: $\left\\{\begin{bmatrix}4\cr 1\cr 0\cr 0\end{bmatrix}, \begin{bmatrix}-3\cr 0\cr 1\cr 0\end{bmatrix}, \begin{bmatrix}1\cr 0\cr 0\cr 1\end{bmatrix}\right\\}$
stackexchange-math
{ "answer_score": 1, "question_score": 2, "tags": "linear algebra, matrices, solution verification" }
How to mix drawing with and without VBOs Since the OpenGL drawing calls are affected by a recently bound VBO, how do you unbind a VBO if you also want to draw vertices you have dynamically created on the spot that are not in VBO? None of the examples I have looked at show how to disable a VBO buffer, like you would an attribute array pointer. Perhaps this is not particularly common since most applications are either going to have everything in a VBO, or nothing, perhaps mixing the two scenarios is not common.
To unbind a VBO you simply call `glBindBuffer` with second parameter set to 0. > The value zero is reserved, but there is no default buffer object for each buffer object target. Instead, buffer set to zero effectively unbinds any buffer object previously bound, and restores client memory usage for that buffer object target. And then you have to bind another VBO or draw from the client memory.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "opengl es 2.0" }
Regexp that ignores everything after a question mark symbol This is the full string I'm trying to parse with regular expressions: example.com/newsite.com.html?var=/newsite.com&var=newsite.com I would like to be able to match `newsite.com` part of the string but only if it does not appear after the `?` symbol. Currently, I've only gotten so far: /newsite.com/g Which selects all the instances of `newsite.com` instead of just the first one. Link to the regexp playground < **EDIT:** Here `*` represents everything I would like to ignore, essentially matching only the first occurrence of `newsite.com` : example.com/newsite.com.html?****************************
This is the solution I came up with, it's not bullet-proof but works for the most part: (?<=[^=]\/)newsite\.com It ignores anything that starts with `=` and doesn't have a `/` in the beginning. Note that this only works with regex implementations that support "positive lookbehind".
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "regex, apache, url, mod rewrite" }
Artifacts in Render which actually don't exists geometrically I have a plane which had a Boolean with a text converted to mesh. This is the render There are visible imperfections in this which i think are called artifacts but i can be wrong ![enter image description here]( These imperfections don't exist in the geometrical form , which means there is no geometry there , just a flat plain **All modifiers on the planes are applied** im using the Cycles rendering engine ![enter image description here]( Also visible there are no other objects in the scene causing any interceptions , so how is this happening. Imerfections are also not visible in the render mode in blender
This could come from having to little geometry on your plane. Basically Blender shows you editable points which we consider geo but uses triangles to compute the mesh. (not the most accurate description but oh well...) Your boolean creates very long triangles which aren't displayed in the viewport but create problems in the render. To fix this you can just subdivide the plane a bunch of times before applying the boolean. Hope this helps :)
stackexchange-blender
{ "answer_score": 4, "question_score": 0, "tags": "rendering, cycles render engine, geometry" }
Can I identify this black ant queen? I have an ant queen in a jar. This is what she looks like: !black ant queen captured in jar Because I'm planning to start an artificial ant nest, I'd like to learn something about that specific species of ant. This particular queen is very common in the Czech Republic, central Europe. It's also very common in cities. 1. Could you tell what kind of queen is that? 2. Is there any image reference that would help me find out? Ideally with some location search possibility.
This cannot be a Lasius queen, it is a Formica queen. Although one of the main characteristic is the shape of the first segment of the funicula which cannot be seen on this picture, the general aspect of this queen (elongated, with red legs, does not have a bulky aspect) indicates this queen is from the genus Formica. It is similar in shape and coloration to many queens in the subgenus Serviformica, for example Formica cunicularia, Formica cinerea.
stackexchange-biology
{ "answer_score": 1, "question_score": 2, "tags": "species identification, ant" }
Front-to-Back Analogue for "Lateral" If "lateral" can be phrased as "side-to-side", what would be the adjective for "front-to-back"? For example, in a car, you feel _lateral_ acceleration in a sharp turn, and _______ acceleration when hitting the brakes.
I'm used to hearing it referred to as _longitudinal_ in reference to things like acceleration. > Longitudinal acceleration refers to acceleration in a straight line, with a positive value to indicate what we normally call acceleration and a negative value for braking. Lateral acceleration is an effective measure of cornering performance and what automotive people test on a skidpad. From Inside Motorcycles
stackexchange-english
{ "answer_score": 2, "question_score": 2, "tags": "single word requests" }
Proof that the polynomial ring over a field is catenary. Let $K$ be a field, $A=K[X_1,\dots,X_n]$. The following well known theorem shows $A$ is catenary; > _Every Cohen-Macaulay ring is catenary._ However, I want to know if we could prove that $A$ is catenary without theory of Cohen-Macaulay rings.
There is a proof in Chapter 13 of Eisenbud's Commutative Algebra with a view toward algebraic geometry. The first part is a slight strengthening of the Noether Normalisation Lemma (Eisenbud's Theorem 13.3), but then to show that all maximal chains of primes have the same length, one also needs the Going-Down Theorem (Eisenbud's Theorem 13.9).
stackexchange-math
{ "answer_score": 4, "question_score": 4, "tags": "abstract algebra, polynomials, ring theory, commutative algebra" }
rails routing does not work I have following route explicitly defined in my routes.rb map.book_preview_v2 '/books/v2/:id', :controller => 'books', :action => 'show_v2' But, in the logs, I see following message: 2015-09-25 16:49:04 INFO (session: f561ebeab121cd1c8af38e0482f176b8) method /books/v2/519869.json (user: xxx:669052) params: {"controller"=>"books", "action"=>"v2", "id"=>"519869", "format"=>"json"} ActionController::UnknownAction (No action responded to v2. Actions: some_method_1, some_method_2, some_method_3, some_method_4, some_method_5, **show_v2**, some_method_6, and some_method_7): Am I missing some convention over configuration thing? Why in the logs I see action as "v2" instead of "show_v2"?
> ActionController::UnknownAction (No action responded to v2. Actions: some_method_1, some_method_2, some_method_3, some_method_4, some_method_5, **show_v2** , some_method_6, and some_method_7): > > Why in the logs I see action as "v2" instead of "show_v2"? As per the **_Rails 2_** default route map.connect ':controller/:action/:id' it expects `v2` as `action` but you defined `show_v2` as `action` in the route. Changing your `route` to below should work map.connect '/books/show_v2/:id', :controller => 'books', :action => 'show_v2'
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "ruby on rails, ruby, routes, ruby on rails 2" }
How to remove gap between line number and body in PhpStorm Why there is a gap between line number and body. I am not using Distraction Free mode? ![There is image of space between line number and body](
Known issue, < Just restart the IDE to restore the tree layout
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "phpstorm, jetbrains ide" }
Perl - Array reference, using strict I have the following code: my @array = ('a', 'b', 'c'); my $region = \@array; # Returns an array reference my $Value = ${@{$region}}[3]; I am using strict; This code passed smoothly in Perl v5.8.6, and now that I installed v5.10.1, I get a runtime error: > Can't use string ("4") as an ARRAY ref while "strict refs" in use at ... I changed the code to the following, and that solved the issue: my @array = ('a', 'b', 'c'); my $region = \@Array; my @List = @{$region}; my $Value = $List[3]; my question is, what's wrong with the previous way? What has changed between these two versions? What am I missing here? Thanks, Gal
`${@{$region}}[3]` was never the correct way to access an arrayref. I'm not quite sure what it does mean, and I don't think Perl is either (hence the different behavior in different versions of Perl). The correct ways are explained in perlref: my $Value = ${$region}[3]; # This works with any expression returning an arrayref my $Value = $$region[3]; # Since $region is a simple scalar variable, # the braces are optional my $Value = $region->[3]; # This is the way I would do it
stackexchange-stackoverflow
{ "answer_score": 11, "question_score": 4, "tags": "arrays, perl, reference, strict" }
Set width for ComboBox I have a ComboBox as follows: ![enter image description here]( How can I set the width of both 1 and 2 the same? ![enter image description here](
ComboBox has a property called `useComboBoxAsMenuWidth` when you set it will make sure it matches the menu width. Here is a codepen <
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 0, "tags": "office ui fabric" }
string concatenation in c++ Previously, I was using append function to concatenate strings. However, since doing so requires multiple lines of unnecessary codes, I wanted to try out '+' operator instead. Unfortunately, it didn't go well... bool Grid::is_available(int x, int y) const { if (x < 0 || x >= dim[1] || y < 0 || y >= dim[0]) throw std::invalid_argument("is_available(" + x + ", " + y + "): Invalid coordinate input."); return occupancy[x][y] == AVAILABLE; } The error that I got was "'+': cannot add two pointers" with the code C2110. All the solutions for this problem said to concatenate one on each line. Are there actually no way to concatenate multiple strings in C++ in one line? I had no problem with this in C# before.
You can use `std::to_string()` to convert your integers: bool Grid::is_available(int x, int y) const { if (x < 0 || x >= dim[1] || y < 0 || y >= dim[0]) throw std::invalid_argument( "is_available(" + std::to_string(x) + ", " + std::to_string(y) + "): Invalid coordinate input."); return occupancy[x][y] == AVAILABLE; }
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 2, "tags": "c++, string, concatenation" }
NServiceBus: Remove Deferred messages when calling MarkAsComplete() Using NServiceBus 3.2.7. When calling MarkAsComplete (A person cancels their order while there are deferred messages out.) It appears that calling MarkAsComplete does eliminate the saga, but the messages that were previously deferred are still in the timeout queue. When they finally process, they get caught in a SagaNotFound exception. I would like to be able to notably tell the difference between a legitimate saga not found and one that was thrown because the saga had been removed due to a cancelled order. How can you remove the deferred messages from Raven?
There is an inherent race condition here between the timeout and the cancellation. It could be that the timeout is already on its way to be delivered when the cancellation happens, so it cannot be cleared. It is for exactly this reason that NServiceBus raises SagaNotFound as an event and not an exception. Hope that helps.
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 1, "tags": "c#, nservicebus" }
Reliably identifying any window's client area I am working on a program that will replicate, and then extend the functionality of Aero Snap. Aero Snap restores a maximized window, if the user "grabs" it's title bar, and I am having difficulties identifying this action. Given a cursor position in screen coordinates, how would I check if the position is within the window's title bar? I am not really at home in the Win32 API, and could not find a way that works reliably for complicated scenarios such as: !example for a difficult title bar Note that tabs that chrome inserts into the title bar. Office does something similar with the quick launch menu.
title bar hits are via the message "non client" messages - ie the area of a window that is not the client (or inner) window. WM_NCLBUTTONDOWN is probably the message you want to trap. You also probably want to set a window hook to hook mouse messages, if its the NC message you want, you handle it your way, if not - pass it on to the message chain. Edit: if Chrome is using the DwmExtendFrameIntoClientArea calls to draw the tabs, then you will need to use WM_NCHITTEST.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "c++, winapi" }
Working with Windows registry using java.util.prefs.Preferences I have some questions about the registry. We have Preferences p = Preferences.userRoot(); If we execute p.nodeExists("/HKEY_CURRENT_USER/Software/Policies/Microsoft") it will return true. After it: p = p.node("/HKEY_CURRENT_USER/Software/Policies"); for(String s : p.childrenNames()){ System.out.println(">" + s); } We see that it has one child: "Windows". But p.nodeExists("/HKEY_CURRENT_USER/Software/Policies/Microsoft/Windows") returns false. Why? Thanks. **UPDATE** Ok. I have some mistakes. Let me try again: Why does p.nodeExists("/HKEY_CURRENT_USER/Software/Policies/Microsoft/Windows") return false?
If you execute the code lines shown, in the order shown, when you get to the line p.nodeExists("/HKEY_CURRENT_USER/Software/Policies/Microsoft/Windows") `p` does not anymore point to the user root, but to "/HKEY_CURRENT_USER/Software/Policies". Btw you have a probable omission in your third code sample: p = p.node("/HKEY_CURRENT_USER/Software/Policies"); should be p = p.node("/HKEY_CURRENT_USER/Software/Policies/Microsoft");
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 1, "tags": "java, windows, registry, preferences" }
CVE-2016-5195 - impacts on virtualization I wonder if the recently found CVE-2016-5195 can be used to break out of KVM or OpenVZ virtualization to gain access to the host system? Basically, I believe that the local privileges can not be used for that because an attacker would need to have access to the host system. It's clear for me that the attack could be used inside of a container if the kernel isn't patched.
Looking at this github page and this RedHat page it seems that the attacker can write to /proc/self/mem and ptrace files. The ACL that will be affected is the ACL of the VM and not the host machine. This means that the files that are shared between the host machine and the VM (remember the VMWare file sharing bugs) will remain vulnerable. Apart from that, I don't think the host machines will get affected.
stackexchange-security
{ "answer_score": 2, "question_score": 2, "tags": "virtualization, cve, kvm" }
Скрипт автоматического перехода на страницу внутри BODY Доброго всем времени суток господа. Второй раз за сегодня В инете полно разных скриптов автоматического перехода по нужной ссылке. Часть из них нужно совать между тегами HEAD ( да и пусть будет так ) , кое что можно прописать прямо в BODY. Можно ли написать такой скрипт, что бы его можно было использовать только внутри BODY ? ( **Нет тоже ответ** ) p.s. прописать не лень, интересует будет ли так корректно работать
<script language="JavaScript" type="text/javascript"> location="ti_ploho_guglil.php" </script>
stackexchange-ru_stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "html, javascript" }
Notepad Path in VS2008 In my application, I have defined the following: `public static readonly string NOTEPAD = "%windir%\\notepad.exe";` I can type in the text value of NOTEPAD into the Run command on my Win7 machine, and Notepad will open. However, from within my Visual Studio C# project, the Write Line routine will fire every time: if (!File.Exists(NOTEPAD)) { Console.WriteLine("File Not Found: " + NOTEPAD); } Does Visual Studio not understand `%windir%`?
Instead of expanding the variable manually as suggested by the other answers so far, you can have the Environment class do this for you just like the `Run` command does: if (!File.Exists(Environment.ExpandEnvironmentVariables(NOTEPAD))) { Console.WriteLine("File Not Found: " + NOTEPAD); } See <
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 4, "tags": "c#, notepad" }
How to get a Telerik Grid to display only records with todays date on? I need a Telerik grid to only display records where the date recorded matches today's date. **Edit** \- Presently I have the db connected up to my project via an edmx but the only kind of filtering I've done before on the tables has been in viewmodels to work with drop downs, so I'm unsure what steps I need to take with a Telerik grid.
You can simply filter the datasource before binding. **EDIT:** Supposedly you are using the MVC extensions from Telerik then you might do something like: <%= Html.Telerik().Grid(Model) .Name("Grid") .Filterable(filtering => filtering.Filters(filters => { filters.Add(o => o.ContactName).StartsWith("Paul").And().EndsWith("Wilson"); })) %> As seen on the Telerik demos: < I've only used the Telerik library with WebForms and it's a bit different there.
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 0, "tags": "c#, asp.net mvc, asp.net mvc 3, telerik, telerik grid" }
Undo zfs create I have a problem. I created a pool consisting of single volume of 1 file 2.5Tb just to fight with file duplicates. I copied a folder with photos. Some of the photos were not backed up. Just now I see my pool folder is empty. When I checked with 'sudo zfs list' it said 'No datasets available'. I thought it was detached and to attach I started again all these commands. sudo zpool create singlepool -f /home/john/zfsvolumes/zfs_single_volume.dat -m /home/share/zfssinglepool sudo zfs set dedup=on singlepool sudo zpool get dedupratio singlepool sudo zfs set compression=lz4 singlepool sudo chown -R writer:writer /home/share/zfssinglepool I see now empty pool! May I get my folders back which I copied to the pool before I started create pool again?
Unfortunately, use of `zpool create -f` will recreate the pool from scratch even if ZFS recognizes that a pool has already been created using that storage: -f Forces use of vdevs, even if they appear in use or specify a conflicting replication level. Not all devices can be over- ridden in this manner. This is similar to reformatting a partition with other file systems, which will leave whatever data is there written in place, but still erase the references the file system needs to find the data. You may be able to pay an expert to reconstruct your data, but otherwise I'm afraid the data will be very hard to get back from your pool. As in any data recovery mission, I'd advise making a copy of the data ASAP on some external media that you can use to do the recovery from, in case further attempts at recovery accidentally corrupt the data even worse.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 2, "tags": "undo, zfs" }
Twenty nine-letter words I took twenty 9-letter everyday English words from the Merriam-Webster dictionary, broke them into sixty 3-letter pieces and ordered the sixty pieces alphabetically: acc all ant but day dif eap eid ent ent ent eph equ erd erf ess eth far fer fly gar hol imp ine ing ion ipm lio lpo mar mho myt nes new nut ogy one ort ory own pin ple por rec rel rit row sag sca sco som tel ter tfo und use wat wed wer wil What are the twenty 9-letter words?
These should be all twenty: > different mythology telephone equipment portfolio > pineapple willpower margarine wednesday important > waterfall butterfly scarecrow accessory nutrition > scoundrel eiderdown farmhouse something newsagent > I found about half of them myself, so credit to the other answers as well. I think they only missed one between them (last one in my list).
stackexchange-puzzling
{ "answer_score": 7, "question_score": 9, "tags": "word, english" }
Creating a custom pop up for Umbraco back office [Final EDIT] Here is a link to the code I wrote in case it helps anyone. > I think I have a solution. Umbraco uses asp.net files for their popups which is something I haven't used yet but I think I can get the hang of it. I don't know how to access the aspx from within my class, should I make a code behind partial class? > > Thanks for any help. I am developing a multi-lingual site, using Umbraco, where content nodes are automatically copied to each language as they are created. Is there any way to implement a custom popup to confirm that it should be copied to all instead? This wouldn't actually be on the site, rather in the back office. Or is it possible to open a browser popup with c# as all I really need is a bool value from a message box? [EDIT: added possible solution]
I sorted this by adapting Umbraco's own create function. I made a new .aspx file and added the functionality that I needed to the code behind. I was able to add a context menu item that allowed me to call my new page and from there called a method to duplicate the content. From the method, I pass the new node and get the parent id. Then I compare all the node names for those that match and use the umbraco `document.copy()` method to recreate the content under each language at the correct position. If I can make the code more generic then I will upload it as a package to Umbraco.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "c#, popup, umbraco" }
Are there photosensitive/light-sensitive glasses that use visible light to expose an image? For instance, im wondering if there were a glass I could expose an image using an enlarger, and fix the glass without using heat. I doubt it, just curious to know if UV exposed, heat-cured photosensitive glasses are the only type. Sorry if this is the wrong place to post. Let me know if there is a better place. (tried chemistry and photography already)
There are photopolymers that can store an image when exposed to visible light. If you need glass specifically, I suspect it's possible but only know for sure that there are UV sensitive glasses. With sufficient intensity, visible light can induce damage in many kinds of glass.- e.g., a femtosecond laser can do it.
stackexchange-physics
{ "answer_score": 1, "question_score": 1, "tags": "visible light, glass" }
Which Unity version deprecated PostProcessBuildplayer? It seems that PostProcessBuildPlayer is not working anymore in Unity 4.5, it must have been deprecated. Which version was the last one to support PostprocessBuildPlayer script?
Are you in a Mac environment? It hasn't been deprecated AFAIK. It is working for me on 4.5.5f1: $ vi Assets/Editor/PostProcessBuildPlayer #!/bin/sh open " $ chmod +x A When I build I see it open up my web browser. For a cross-platform build solution Unity recommends using the Build Player Pipeline
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "unity3d" }
Issue while formatting date I'm trying to format the following value 01/08/2020 Dim value1 as string = '01/08/2020' Response.Write(Format(CDate(value1),"yyyy-MMM-dd")) The result returned as 2020-Jan-08 instead of 2020-Aug-01
There is an easier method for formatting dates. Try this: Response.Write(DateTime.ParseExact(value1, "dd/MM/yyyy", null).ToString("yyyy-MMM-dd")) See < for the various possible date formats.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "asp.net, vb.net" }
Rails 2.3.8 tiny mce issue - undefined method `uses_tiny_mce' I am facing an issue in my application with tiny mce. All the gem version & ruby version is OK on my system, but it is giving me error = undefined method `uses_tiny_mce' Here i installed the tiny_mce gem. COnfigured it correctely, but still there is an issue. Please help. !enter image description here
I was not using this as a plugin. I have followed the steps given in the, < Steps : script/plugin install git://github.com/kete/tiny_mce.git rake tiny_mce:install my issue got resolved.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "ruby on rails, tinymce" }
Container overflows the page (React) New to React. I wish to make the page grow and scrollable as the container gets bigger. But now the container overflows at the top, although I can scroll to see the bottom part. < In this sandbox, the back button at the top overflows the page. If I add one more `{test}`, the button will be gone. Is there a way to fix this?
If You trying to ask to fix the Back button on the top. You can do that by giving your row, a className <Row className="pb-4 header"> <Button className="mt-4 letter" variant="outline-light"> {"< Back"} </Button> </Row> and set its property to .header{ position:fixed; } ![please check screenshot after adding for of {test}](
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "reactjs, bootstrap 4, containers, jsx" }
Nagios check_openmanage I've installed openmanage on my dell poweredge 2950 and wanted to integrate check_openmanage through nrpe in my nagios3 monitoring server. I can execute the check_nrpe!check_openmanage command manually (it returns output from the server I want to monitor when I execute it on my nagios server): ./check_nrpe -H example.com -c check_openmanage Controller 0 [PERC 5/i Integrated]: Firmware '5.2.1-0067' is out of date I've set up the service through: define service{ use some-service hostgroup_name dell-servers service_description dell servers check_command check_nrpe!check_openmanage } My problem is that on my webinterface I get `status: UNKNOWN` with `status information: (No output returned from plugin)`
The problem was the timeout period of the plugin on the remote host. So to increase the timeout I defined a custom command in nagios: define command{ command_name timeout_nrpe command_line /usr/lib/nagios/plugins/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -t $ARG2$ } and custom service: define service{ use openstack-service hostgroup_name dell-servers service_description OMSA checkk check_command timeout_nrpe!check_openmanage!30 } This seemed to fix the issue.
stackexchange-serverfault
{ "answer_score": 1, "question_score": 3, "tags": "nagios, dell openmanage" }
What's the meaning of "みたい" in the following context? To give a bit of context, this is a text found on a DS game where some options are shown on the lower screen. The full text is the following: > I understand that the general meaning of the text is "Please, choose one of the options below" or "Select your preferences below", but I have trouble understanding the function of "" in there. I looked up "" and it seems to be used to express similarity or comparing things, but it does not seem to have that function in here. To make a comparison with something I know, I was wondering if it is treated the same as "parezca" in Spanish as in "Elige la opción que te parezca mejor". "parecer" also expresses similarity but can be used to make the reader to choose. Thanks for any guidance.
This is the tai-form (a.k.a. desire-form) of the verb ("to see"). The sentence may be easier to read in kanji: > **** > Please choose the item **[you] want to see**. Note that a tai-form conjugates like an i-adjective, and thus it can directly modify the following noun. meaning "to look like " has nothing to do with this sentence. ( for similarity conjugates as a na-adjective, so it cannot directly modify .)
stackexchange-japanese
{ "answer_score": 3, "question_score": 1, "tags": "grammar, meaning, syntax" }
Get the last item from node list without using .length The following command `document.querySelectorAll('#divConfirm table')[1].querySelectorAll('tr')` gives a node list with 3 tablerow (tr) elements in it. If I know the list size, I can access the last element via`.item(2)`. Is there a way to get the last element directly without resorting to .length first?
There's at least one way var els = document.querySelectorAll('#divConfirm table')[1].querySelectorAll('tr'); var last = [].slice.call(els).pop(); but, the following statement > But if I do not know the length prior to running the script makes no sense, you already have the collection of elements, so you would always know the length var els = document.querySelectorAll('#divConfirm table')[1].querySelectorAll('tr'); var last = els[els.length - 1]; Another option as the8472's answer suggests would be document.querySelector('#divConfirm table:nth-child(2) tr:last-child');
stackexchange-stackoverflow
{ "answer_score": 19, "question_score": 11, "tags": "javascript" }
Filtration of data sent to the Internet I have the following question. Premises for this question are the following. I want to filter data that are sent to the Internet from any application. A user should have possibility to change these filters. Findings: I have found that I can put filters libcore/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java class. But the problem is that the filters are defined on the frameworks level (in my service) and I cannot send the information from this service to this class (I guess because this class is in the core.jar and my service is in the frameworks.jar). Does anybody have ideas how to do this? Is this possible in general or not? Any help is highly appreciated!
Ok. I've found an answer. There are two possibilities to do that: 1. IP tables 2. To use Java reflection API.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "android, android source" }
Solver library for matrix-free linear equation system I will have to solve a large linear system. I'm now looking for a solver that works "matrix-free" (So that I just have to specify a matrix-vector product, but not the matrix). As far as I understand (I'm not an expert.) LAPACK does not provide this option. Can you recommend any libraries? Or is my approach to implement this matrix-free not reasonable at all? Remark: I plan to use C++ and the matrix comes up from a FEM for a system of PDEs, but is not symmetric. The matrix is sparse, but as I plan to provide the matrix-vector product by myself, and the resulting vector will be dense, sparsity should not play a role here - as far as I understand. Regards, Michael
Using a matrix-free approach for a sufficiently large linear system sounds reasonable to me. You probably want to take a look at PETSc or Trilinos; those are the two main libraries that serve as abstraction layers for a number of different numerical methods (preconditioners, sparse linear solvers, scalable nonlinear equation solvers, time steppers, optimization). They also build in abstractions that make it easier to incorporate parallelism into an application than using bare MPI calls. You could also look at higher levels of abstraction, if that is of interest; there are a number of finite element libraries that build on PETSc or Trilinos.
stackexchange-scicomp
{ "answer_score": 2, "question_score": 1, "tags": "linear solver, libraries, matrix free" }
Синтаксическая ошибка в SQL-запросе Запрос: $query= "INSERT INTO girls_top_month (ID, FROM, TO) VALUES ('".$_REQUEST['id']."', '".date('d.m.y')."', '".date('d.m.y')."')"; $result = mysql_query($query) or die(mysql_error()); Ответ: > You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM, TO) VALUES ('7', '05.03.13', '05.03.13')' at line 1 Где я мог опечататься?
FROM - это конструкция SQL. Вероятно нужно сделать вот так girls_top_month (`ID`, `FROM`, `TO`)
stackexchange-ru_stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "php, mysql" }
Start explorer.exe remotely with a path specified in Powershell The problem I have is that I am able to Invoke-command explorer.exe on a remote machine without giving it any path parameters, yet when I enter: Invoke-Command -ComputerName PC01 -Credential $cred -ScriptBlock {explorer.exe "C:\Foldername"} Nothing happens, except for the fact that I get an error entry in the logs saying: The server {75DFF2B7-6936-4C06-A8BB-676A7B00B24B} did not register with DCOM within the required timeout.
First thing, If you are trying this directly on the local system, the GUI will pop up properly. Invoke-Command -ScriptBlock {C:\Windows\explorer.exe "C:\folder"} But the problem, is how powershell will open a GUI console invoked from the remote system. Basically, it does not have the session to hold. _You need a **desktop session** to do that_. In that case, you should use **PSEXEC** with **-i** psexec -i -d -s c:\windows\explorer.exe C:\folder Download it from Here: PSExec-v2.11. This link has all the explanations with examples on how to use each utility. Hope it helps.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "powershell, powershell remoting, dcom" }
9patch image and Android Studio build failing I have an interesting issue, and I dont know how to handle it. So, until now everything was fine, I was able to build my project. I just replaced an image with it`s 9patch version in three different sizes(mdpi, hdpi, xhdpi). tw.setBackgroundResource(R.drawable.tag_rotate) This is the line, where the building failing. It`s interesing, because the studio is able to show me the image on the left, and it is NOT marked as red. But the build is failing with the following message: Error:(196, 52) error: cannot find symbol variable tag_rotate **UPDATE:** if I remove the image from the code, and replace with a normal image, it works ! Im using the default 9patcher provided by SDK
What kind of nine-patch generator do you use? I recomend you to use this generator. I tried to use standart android 9patch generator, which delivered with android SDK, and I had the problems with it.
stackexchange-stackoverflow
{ "answer_score": 8, "question_score": 4, "tags": "android, android studio, nine patch" }
How do you subtract the current time from the time five minutes ago? I have a time from five minutes ago, using `datetime.time.now()` and I need to know what the time would be if I subtracted that time from the current time. Try 1 - Didn't Work: from datetime import datetime, timedelta time1 = datetime.now() time2 = datetime.now() + timedelta(minutes=5) print(time1 - time2) This gave me "-1 day, 23:54:59.999987". Try 2 - Worked, but is there a better way?: time1 = datetime.now() time2 = datetime.now() + timedelta(minutes=5) print(str(time1 - time2).split(',')[1]) This gave me the desired result, but is there a method besides string manipulation?
You wanted to take an advice how to use a `time` object? Well, if you want to specify a format of string representation of your time, just use strftime Example below: from datetime import datetime, timedelta time1 = datetime.now() time2 = datetime.now() + timedelta(minutes=5) print((time1 - time2).strftime('%H:%M:%S'))
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": -4, "tags": "python, python 3.x, datetime" }
Saving a django project in OSX Mavericks I'm new to Django and have been trying to learn the framework using a course in plurlsight. The author creates a django project in this way. virtualenv -p /usr/local/bin/python3 demo Now if I try to create a project and save it somewhere else like in the envs folder in my Documents directory here's what I get. virtualenv -p /Documents/envs boardgames The executable /Documents/envs (from --python=/Documents/envs) does not exist So does this mean I have to keep all my django projects inside /usr/local/bin/python3 ?
The `-p` flag tells virtualenv to use a different executable for python instead of installing a brand new copy in `demo`. So obviously that folder must exist and have python executable in it (`usr/local/bin/python3` in this case). What you want to do is use `virtualenv demo`. This will create a folder with a python distribution in `demo` in the current folder. You then create your project in the current folder.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "python, django, virtualenv, python 3.4" }
representing an improper integral as a power series in the lower bound > Let $y\in \mathbb{R}$ and $y>1$. How can I prove that: $$\int_{y}^{\infty}\frac{1}{x^{3}-1}dx=\sum_{n=1}^{\infty}\frac{y^{1-3n}}{3n-1}?$$ So far, I have rewritten the integrand $\frac{1}{x^{3}-1}$ as a rational function by applying the partial fraction decomposition method. I get the primitive $$\frac{1}{3}\ln|x-1|-\frac{1}{6}\ln(x^2+x+1)-\frac{1}{\sqrt 3}\tan^{-1}(\frac{(2x+1)}{\sqrt 3})$$ at the end. Though, I haven't seen any possibility here to rewrite the primitive function as a power series. Is there any trick to apply ?
The trick to apply involves writing the function as a sum _before_ integrating it. In particular, you can write $$\frac{1}{x^3-1} = \frac{1}{x^3}\frac{1}{1-x^{-3}}$$ and then use the fact that $$\frac{1}{1-a}=\sum_{n=0}^{\infty} a^n.$$ Substituting $a=x^{-3}$, and joining the equations, gives $$\frac{1}{x^3 - 1} = \frac{1}{x^3}\sum_{n=0}^\infty x^{-3n} = \sum_{n=0}^\infty{x^{-3n-3}}.$$ It is now a simple matter of changing the integral of a series into a series of integrals. * * * Note that there are some things you should be careful of in the steps I performed above, in particular: 1. The infinite sum $$\frac{1}{1-a}=\sum_{n=0}^{\infty} a^n$$ only holds for $|a|<1$. You must show that this is so in your case. 2. An integral of a series is not always equal to the sum of individual integrals. There are conditions under which the equality holds, and you must show that one such condition is met.
stackexchange-math
{ "answer_score": 1, "question_score": 2, "tags": "calculus, power series, improper integrals" }
How to capture within html attributes <p <%=foo1%> <%=foo2%> > <h3><%=bar1%></h3> <h4><%=bar2%></h4> </p> I am looking for a regular experssion the result of which should be foo1 and foo2 because those are the values declared as attributes. bar1 and bar2 should not be captured because they are not declared as attributes. I am using ruby 1.8.7.
This is a case where I think you're better off doing two passes. First, extract all the <% %> data values that are attributes inside tags. Then, go through and extract off the <% and %>. For example: <[^>]*?((?:<%=[^%]*%>\s*)+)[^<]*> Gives you: <%=foo1%> <%=foo2%> Then, a simple <%=(.*?)%> on the output from the first regex, gives you foo1, foo2, etc. I've been trying to construct a combined one, but the only way I can see to do that is to use a look-behind operation. I don't think that's supported in Ruby, and regardless since the look-behind would have to match at the same point multiple times, I believe most engines would kick it out.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "ruby, regex" }
Stalks of etale sheaves Let $\pi:X \rightarrow Y$ be a finite morphism of schemes and $\mathfrak{F}$ be an etale sheaf on $X$. Then for a $y \in Y$ we have the stalk $(\pi_{*}\mathfrak{F})_{y}=\prod_{\pi(x)=y}\mathfrak{F}_{x}^{d(x)}$ where $d(x)$ is the separable degree of the field extension $k(x)/k(y)$ (Corollary 3.5.(c) in Chapter II. in Milne: Etale cohomology). The proof in the book would be completely clear for me, if there were no separable degrees (and Milne does not mention either why are they there)....So my question is where from these separable degrees come into the picture?
It is enough to prove this in the case where $Y$ is $Spec$ of a strictly Henselian ring. I think, one sees the main point in the argument already in the following special case: Let $Y=Spec(K)$ and $X=Spec(E)$ where $E/K$ is a finite separable extension of fields. Denote $\pi: X\to Y$ the canonical map. Let $\overline{E}$ be an algebraic closure of $E$ and $\overline{x}$ (resp. $\overline{y}$) be the corresponding geometric point of $X$ (resp $Y$). Let $L/K$ be a finite separable extension contained in $\overline{E}$ and containing the Galois closure of $E$. If $F$ is a sheaf on $X$, then $\pi_*F(Spec(L))=F(Spec(L\otimes_K E))$ and $Spec(L\otimes_K E)= \coprod_{i=1}^d Spec(L)$, where $d=[E:K]$. Hence $\pi_* F(Spec(L))=F(Spec(L))^d$. Now take an inductive limit over such $L$, in order to obtain $\pi_*F_{\overline{y}}=F_{\overline{x}}^d$. Hope this is of some use...
stackexchange-mathoverflow_net_7z
{ "answer_score": 3, "question_score": 4, "tags": "etale cohomology, ag.algebraic geometry" }
What does "compression of spreads on high-yield debt" mean? What did Federal Reserve Chair Janet Yellen mean when she said the following? > "We’ve also seen the compression of spreads on high-yield debt, which certainly looks like a reach for yield type of behavior." Source
Investopedia does a perfectly fine job of explaining it: > The percentage difference in current yields of various classes of high-yield bonds (often junk bonds) compared against investment-grade corporate bonds, Treasury bonds or another benchmark bond measure. So ... if a lot of people are buying junk bonds (i.e. **reach[ing] for yield** ), those bonds' prices go up (due to supply-and-demand) and their yields go down (by definition), meaning the difference ( **spread** ) between investment-grade bond yields (which have presumably not changed) and junk bond yields is reduced ( **compressed** ). Therefore, the compression in the yield spread means that a lot of people are so hungry for high returns that they're ignoring the high risk of junk bonds and buying them anyway.
stackexchange-money
{ "answer_score": 4, "question_score": 3, "tags": "bonds, terminology, yield, spreads" }
problem in pandas 'apply' function to replace missing values I want to replace `np.nan` values with other value in `pandas.DataFrame` using 'apply' function. And I will use `replace` method that where NaN is replaced with max value of each column (axis=0). You better understand below. import pandas as pd df = pd.DataFrame({'a':[1, np.nan, 3], 'b':[np.nan,5,6], 'c':[7,8,np.nan]}) result = df.apply(lambda c: c.replace(np.nan, max(c)), axis=0) print(result) There are three `np.nan` values. Two of them is replaced with appropriate values, but just one value is still `np.nan`(below picture) ![enter image description here]( After setting argument `axis` to `1`, there is still one value that isn't replaced. What's the reason?
Python's `max` doesn't work if a list starts with NaN; so `max(df['b'])`returns `NaN` and it cannot fill the NaN value in that column. Use `c.max()` instead (which works because by default `Series.max` skips NaNs). So: df = df.apply(lambda c: c.replace(np.nan, c.max()), axis=0) But instead of `replace`, you could use `fillna` on axis: df = df.fillna(df.max(), axis=0) Output: a b c 0 1.0 6.0 7.0 1 3.0 5.0 8.0 2 3.0 6.0 8.0
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "python, pandas, dataframe, numpy, fillna" }
What to add to SELECT to output 10 RANDOM entries QUICKLY? How to make SELECT w1.wort AS column1, w2.wort AS column2, w3.wort AS column3 FROM woerter AS w1, woerter AS w2, woerter AS w3 WHERE w1.wort LIKE 'a%' AND w2.wort LIKE 'm%' AND w3.wort LIKE 'o%' output 10 **random** entries **quickly**?
If you want quick, then `order by random()` isn't going to be fast. Perhaps this will speed things up: SELECT w1.wort AS column1, w2.wort AS column2, w3.wort AS column3 FROM (select w1.* from woerter w1 where w1.wort LIKE 'a%' order by random() limit 10) w1 cross join (select w2.* from woerter w2 where w2.wort LIKE 'm%' order by random() limit 10) w2 cross join (select w3.* from woerter w3 where w3.wort LIKE 'o%' order by random() limit 10) w3 ORDER BY random() LIMIT 10; This limits the final `order by` to no more than 1000 rows and prevents an `order by` on a full cartesian product. * * *
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "sql, sqlite, android sqlite" }
How to interrupt a Python program which calls a shell script? I have a Python script which has a loop to execute a local shell script, and if I want to interrupt it when it is running I have to press CTRL+C the number of times remaining in the loop. Are there any easier ways to shut it down?
You need to check the value returned after the script execution - it should be 2 if script was interrupted, in which case you should perhaps raise an exception to stop the execution: import os for _ in range(10): status = os.system('sleep 1') if status == 2: raise KeyboardInterrupt
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "python, bash, shell" }
ImportError: cannot import name 'Bar' Getting same error for below all three line, please help me to import Bar from bokeh library. I spent almost 3 hours but no solution. -> from bokeh.plotting import Bar -> from bokeh.io import Bar -> from bokeh.charts import Bar ImportError: cannot import name 'Bar'
The module `bokeh.charts` for long time has been removed and deprecated. Use `bokeh.plotting` instead. Try this. Let me know if it works. from bokeh.plotting import figure, show region = ["Global", "Asia", "Europe", "Latin America"] volume = [3010, 1642, 716, 844] p = figure(x_range=region) p.vbar(x=region, top=volume, width=0.9) show(p)
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "python, pandas, bokeh" }
Show all records except a few in MySQL I want to ask how to display all records except for TRX0613-021 Here's is my table ![table]( So I need to know how to do that for my assignment. "Display data in the transaction details table whose transaction ID is not TRX0613-021"
You could use the SQL `<>` ("not equal to") operator, _i.e._ SELECT * FROM table_name WHERE id_transaksi <> 'TRX0613-021'
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": -3, "tags": "php, mysql, sql" }
Ant IncludeTask I'm writing a `MyTask` that extends `org.apache.tools.ant.Task` In the `execute()` method of `MyTask` i need to include a file. I mean i would call the `<include>` task in the execute() method of MyTask. I looked at the Apache Ant API but i didn't found the class `IncludeTask` that implements the `<include>` task Where can i find the Include java class?
It seems that `<include>` isn't implemented as `Task` class in the normal way. The logic seems baked into `org.apache.tools.ant.ProjectHelper`, as though `<include>` is handled in a special way. You may not have much luck trying to leverage that functionality.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "java, ant" }
How to send external e-mail from device? (Exchange 2003) I'd like to get external notifications on my iPhone from service monitors inside the network. The easiest way to do this is to have the devices send e-mails to my ATT SMS email ([email protected]). However, while internal notifications work fine, it doesn't seem as if Exchange is allowing the relay of these messages to the outside world. How can I have these devices (APC Matrix, Servers Alive, et al.) alert me anytime? Thanks. (Exchange 2003 SP2 on Windows Server 2003)
What you're trying to get done is referred as allow SMTP relay. Normally exchange SMTP Virtual Server is configured to allow relay only from authenticated senders and quite often the devices sending out e-mails don't authenticate with the server they're relaying through. There's quite an easy way to achieve this, and that's called allowing IP relay on Exchange. * Open Exchange ESM, navigate down to the SMTP Virtual Server that'll be used to relay * Open the properties of that SMTP Virtual Server, and then on Access Tab locate the section about 'Relay'. * There you'll need to list down IP Addresses of devices and servers that'll need to relay out to external e-mail domains Once exchange is configured on the devices you can use the exchange server IP/FQDN as a relay host for these outgoing emails.
stackexchange-serverfault
{ "answer_score": 2, "question_score": 0, "tags": "email, exchange, exchange 2003" }
How to Replace an element with another element entirely with data and events? I have cloned an element like this var myVar = null; myVar = $(someOtherVar).clone(true, true) Now I want to replace `anotherVar` entirely with `myVar`. How to do that? I tried `$(anotherVar).replaceWith(myVar)` But that doesn't work. Any other way to replace `anotherVar` entirely with data and events of `myVar`?
**Update** Since you want two references: var myVar = $(someOtherVar).clone(true, true); var anotherVar = $(myVar).clone(true, true);; If you need two clones, you have to clone twice. There's no way around it.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "javascript, jquery, clone" }
add meteor packages in angular-meteor I'm relatively new to meteor, but have already some experience in AngularJS. Therefore I have "angular-meteor" installed. I also have a bit played around with it and am very happy with it. Now I have only the problem that if I, for example, wants the package "meteor-uploads" use, I always receive the error message: Token '>' not a primary expression at column 1 of the expression [> upload_bootstrap] starting at [> upload_bootstrap]. if I want to use the package, by `{{> upload_bootstrap}}`. What am I doing wrong? ## Update I can access the package with: import upload_bootstrap from 'meteor/tomi:upload_bootstrap'; How can I now render it to my view?
The client package for meteor-uploads was designed to be used with Blaze only (it has a dependency on Blaze). You won't be able to use it with Angular unless you're willing to port a lot of the code over yourself. If you're looking for a popular Meteor based file upload solution (that isn't tied to a specific view layer which means it can be used with Angular), take a look at edgee:slingshot.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "meteor, angular meteor" }
Ajax Random characters in text input by click button This is random **PHP** code: $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $length = 5; $charactersLength = strlen($characters); $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, $charactersLength - 1)]; }//end loop Form <form> <input type="text" id="show_random"> <button onclick="genCode()">gen</button> </form>
Using jQuery, var genCode = function() { 'use strict'; $.ajax('/path/to/your/file.php', { success: function(response) { $('#show_random').val(response); } }); }
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": -3, "tags": "javascript, php, ajax" }
SVG animation hover animation not working on Wordpress I got this SVG that i animated on hover: This svg But when I'm using it on my site, it doesn't animate? Do anyone got any suggestions why this is? The page that it's not working on is this
You are including it via an `<img>` tag and SVG when displayed as an image is not interactive. You'd need to include it via an `<object>` or `<iframe>` tag instead.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "css, animation, svg, css animations" }
What devices is supported by getusermedia I am using `getusermedia()` to use webcams for an online application. I am using a Logitech C615 webcam (plug and play) and it works great. Will `getusermedia()` only work with plug and play webcams or will it also work with webcams with drivers. In my opinion webcams with drivers will have DLL files andyou will need to include DLL files in the code to work, so any webcam with driver will not be detected by `getusermedia()`. Am I correct?
getUserMedia works through your local web browser. The browser code enumerates the video devices on your machine using the operating system's device enumeration API. Webcams that work with browsers, when their drivers are installed correctly, show up in that enumeration. If the cam's driver requires the software using it to bind to a particular custom DLL, then it doesn't work with web browsers. But then it's not much of a webcam, eh? You may have a special purpose camera device, for machine vision or some such thing. But it it doesn't have standalone driver, browsers cant't use it.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "javascript, webcam, getusermedia" }
Query joins on 3 columns I apologize for not knowing the correct terminology for what I'm trying to do. I can't paste exact code because I have an air gap and my working system is not on the internet so I will pseudo code here. I have two tables, lets call them TopDogs and BottomDogs. I need a query that returns results from TopDogs that don't match 3 of the columns of Bottom Dogs. Lets say TopDogs has columns A, B, C, D, E, F and G. BottomDogs has A, B, C, M, Q, R, S I need a query that will return a list of all the rows of TopDogs that don't match BottomDogs A, B, and C.
You can use the `not exists` operator: SELECT * FROM TopDogs td WHERE NOT EXISTS (SELECT * FROM BottomDogs bd WHERE td.a = bd.a AND td.b = bd.b AND td.c = bd.c)
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 2, "tags": "sql, postgresql" }
python как узнать id диска как узнать id диска или пк на котором запускается программа?
используйте wmic wmic diskdrive get model,name,serialnumber
stackexchange-ru_stackoverflow
{ "answer_score": 3, "question_score": 2, "tags": "python, python 3.x" }
Empty value in NSArray I can't believe I forgot this, what is in an `NSArray` if there's no value in the field (this is being determined by loading a .plist file). I know I should know this, but right now I'm having a serious brain fart
An empty value is represented by `NSNull`.
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 0, "tags": "objective c, cocoa, nsarray" }
"Paintings on walls and ceilings" and "painting of portraits, landscapes" I am creating a portfolio of painter's works and I need to categorize them. There will be two global categories: 1. Paintings on canvas 2. Painting on walls and ceilings The paintings on canvas divide into "Portraits", "Landscapes", and so on. How should I call paintings of walls and ceilings in English? Maybe there is some precise word? I haven't found it, using translators from Russian.
They are called murals. > A mural is any piece of artwork painted or applied directly on a wall, ceiling or other large permanent surface. A particularly distinguishing characteristic of mural painting is that the architectural elements of the given space are harmoniously incorporated into the picture.
stackexchange-english
{ "answer_score": 7, "question_score": 3, "tags": "single word requests, terminology, hypernyms" }
How to create date from a specified format in JavaScript similar to DateTime::createFromFormat I expect to get a date from my database in `Ymd` format. This gives me values like `20200202`. This is fine for php applications but I'm using JavaScript for the frontend. In php, we could do something like $date = DateTime::createFromFormat('Ymd', '20200202'); meaning I get a date object as long as the formats match. Is there a way for JavaScript to do this?
If you are sure this date will always come in the format `yyyymmdd`, you can use RegEx to extract the date : function getDate(inputDate) { // TODO : Check if the format is valid const pattern = /(\d{4})(\d{2})(\d{2})/ const parts = inputDate.match(pattern); // months start with 0 in js, that's why you need to substract 1 // -----------------------v----------v return new Date(parts[1], parts[2] - 1, parts[3]); } console.log(getDate("20200202").toString()); console.log(getDate("20200213").toString()); console.log(getDate("20201231").toString());
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 1, "tags": "javascript, php, date" }
How do I mount my Samsung galaxy s4 on ubuntu? I'm running ubuntu 12.04 and have a rooted samsung galaxy s4. The s4 is still 2 software versions back since I need to unroot to update and just havent had the time or energy to do all of the work to get back to where I'm setup. I think it is 4.2.something. So when I plug my S4 into ubuntu via usb I get an error message "Unable to mount SAMSUNG_Android Error initializing camera:-60: could not lock the device" With my rooted kindle I run gMTP and that gets me access so I tried it with the S4 and it says nothing is available to connect. With my old evo I had no trouble. Even when it wasn't rooted I had access to the sd card just like any other drive being mounted. What's the deal with this s4? I do have usb debugging enabled.
Open a terminal in ubuntu(ctrl+alt+t) and type this commands: sudo add-apt-repository ppa:langdalepl/gvfs-mtp sudo apt-get update Then, launch Software Updater (previously known as Update Manager) and install the available updates. Afther you pdate everything restart pc. if you want to revert back before making any changes: sudo ppa-purge ppa:langdalepl/gvfs-mtp Next time, I think you should ask this is askubuntu.com since it is more of a linux specific problem then android.
stackexchange-android
{ "answer_score": 5, "question_score": 5, "tags": "usb connection mode, samsung galaxy s 4, mount" }