INSTRUCTION
stringlengths
25
999
RESPONSE
stringlengths
0
999
SOURCE
stringlengths
16
38
METADATA
dict
How can I check if request was a POST or GET request in codeigniter? I just wondered if there is a very easy way to determine whether the request is a `$_POST` or a `$_GET` request. So does `Codeigniter` have something like this? $this->container->isGet();
I've never used codeigniter, but for this I check the `$_SERVER['REQUEST_METHOD']`. Looking at the docs maybe something like: if ($this->input->server('REQUEST_METHOD') === 'GET') { //its a get } elseif ($this->input->server('REQUEST_METHOD') === 'POST') { //its a post } If you're going to use it a lot then it's simple to roll your own `isGet()` function for it.
stackexchange-stackoverflow
{ "answer_score": 47, "question_score": 18, "tags": "php, codeigniter, request, http post, http get" }
Help! I sent coins to my bitcoin wallet before it was properly synced! I sent coins to my Bitcoin wallet not after installing it, but before it had fully synced! Then I closed and reopened it after sending the coins. It had generated a bitcoin address to send to, but is that address "officially mine" prior to the program actually having updated and being "officially on the network"?
Yes it is, worry not. The client can generate valid addresses without ever being connected to the internet. When the blockchain finishes downloading, you should see the incoming transaction.
stackexchange-bitcoin
{ "answer_score": 18, "question_score": 13, "tags": "wallet, synchronization" }
Get one before the last created table in MySQL Found out this code to give me the lateset created table, but how can I get the one before it? SELECT TABLE_NAME FROM information_schema.tables WHERE table_schema = 'data' ORDER BY create_time DESC LIMIT 1;
Instead of LIMIT 1, use LIMIT 1,1 this will give your second last created table
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "mysql" }
Winding number of closed curves > Let $c_1,c_2$ be closed curves in $\mathbb C^{\times}$ and we define $c(t):=\frac{c_1(t)}{c_2(t)}$. Proof the following for the winding number $win(c,0)=win(c_1,0)-win(c_2,0)$. I have no idea to solve this problem. I need some hints.
Answer (following Martin R. hint): $$win(c,0)=\frac{1}{2\pi i}\int_c\frac{dz}{z}=\frac{1}{2\pi i}\int_0^1\frac{c'(t)}{c(t)}dt$$ Since $c(t)=\frac{c_1(t)}{c_2(t)}$ the derivative is $c'(t)=\frac{c_1'(t)}{c_2(t)}-\frac{c_1(t)\cdot c_2'(t)}{c_2^2(t)}$. We get then:$$\frac{1}{2\pi i}\int_0^1\frac{c'(t)}{c(t)}dt=\frac{1}{2\pi i}\left(\int_0^1\frac{c_1'(t)}{c_2(t)\cdot c(t)}-\frac{c_1(t)\cdot c_2'(t)}{c_2^2(t)\cdot c(t)}dt\right)$$$$=\frac{1}{2\pi i}\left(\int_0^1\frac{c_1'(t)\cdot c_2(t)}{c_2(t)\cdot c_1(t)}-\frac{c_1(t)\cdot c_2'(t)\cdot c_2(t)}{c_2^2(t)\cdot c_1(t)}dt\right)$$$$=\frac{1}{2\pi i}\left(\int_0^1\frac{c_1'(t)}{c_1(t)}-\frac{c_2'(t)}{c_2(t)}dt\right)=\frac{1}{2\pi i}\int_0^1 \frac{c_1'(t)}{c_1(t)}dt-\frac{1}{2\pi i}\int_0^1 \frac{c_2'(t)}{c_2(t)}dt$$$$=\frac{1}{2\pi i}\int_{c_1} \frac{dz}{z}-\frac{1}{2\pi i}\int_{c_2} \frac{dz}{z}$$$$=win(c_1,0)-win(c_2,0)$$
stackexchange-math
{ "answer_score": 0, "question_score": 0, "tags": "complex analysis, analysis, complex integration" }
Calculating limits, can I do $ \infty - \infty = 0 $? When dealing with limits, we can do $\infty + \infty = \infty $ or $ \infty \cdot \infty = \infty$. But can I something similar for $\infty - \infty$ or $\frac{\infty}{\infty}$? I'm asking because I can't calculate this $$\lim_{x \to \infty} \sqrt{x^3+3x} \ -\sqrt{x^4-x^2}$$ I have tried to rationalize it, which would make it $$\frac{x^3+3x-x^4+x^2}{\sqrt{x^3+3x} \ +\sqrt{x^4-x^2}}$$ but I would always end up reaching $\infty - \infty$ or $\frac{\infty}{\infty}$. I'm pretty sure we can't do this, so any advice on how to calculate it?
$$\lim_{x \to \infty}\left(\sqrt{x^3+3x} \ -\sqrt{x^4-x^2}\right)=\lim_{x \to \infty}x^2\left(\sqrt{\frac1x+\frac3{x^3}} \ -\sqrt{1-\frac1{x^2}}\right).$$ The limit of the right factor is $-1$, but that of $x^2$ does not exist (the limit is $-\infty$ if you prefer).
stackexchange-math
{ "answer_score": 3, "question_score": 0, "tags": "limits" }
Is it possible to use an Apple Watch to authorise sudo in Catalina? MacOS Catalina let us do some higher privilege actions on our Mac by authorising through a press on our Apple Watch button. Would it be possible to use that feature to authorise a `sudo` command in the Terminal?
There is a PAM module for this on GitHub: < (This is forked from a TouchID PAM module, btw.)
stackexchange-apple
{ "answer_score": 8, "question_score": 9, "tags": "terminal, catalina, apple watch, sudo, authorization" }
Why do I get different results with almost the same command in docker with MySQL? I use centos7 and `Docker version 19.03.13, build 4484c46d9d` I want MySQL container's `/etc/mysql` bind mount to `/data/etc/my01` and I use the following command: docker run -d -p 3306:3306 \ -v /data/etc/my01/conf.d:/etc/mysql/conf.d \ -v /data/my01:/var/lib/mysql \ -e MYSQL_ROOT_PASSWORD=25802580 --name my01 mysql It's OK, the container run in the background. But, I delete this container and create another use follow command: docker run -d -p 3307:3306 \ -v /data/etc/my02:/etc/mysql \ -v /data/my02:/var/lib/mysql \ -e MYSQL_ROOT_PASSWORD=25802580 --name my02 mysql When I use `docker ps`, I find this container has stopped. I can't understand this behavior, because the principles of these two commands are almost the same. Why do I get different results with almost the same command? And how to correct the last command?
About your second command: docker run -d -p 3307:3306 \ -v /data/etc/my02:/etc/mysql \ -v /data/my02:/var/lib/mysql \ -e MYSQL_ROOT_PASSWORD=25802580 --name my02 mysql The first volume definition is different than from your first container: `-v /data/etc/my02:/etc/mysql \` vs `-v /data/etc/my01/conf.d:/etc/mysql/conf.d` There could be problems on startup of the container, e.g. if the config fails are invalid, so the container tries to boot up and then exits. You can easily debug issues like this by running the container not in background mode (removing the -d argument): docker run -p 3307:3306 \ -v /data/etc/my02:/etc/mysql \ -v /data/my02:/var/lib/mysql \ -e MYSQL_ROOT_PASSWORD=25802580 --name my02 mysql Then you will see the error output of your container in your console.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": -2, "tags": "docker" }
Convert Object Array Element in JSON Maybe a stupid question, but I can't do this. So: I have something like this: obj = {to:this.to,all:[]}; `all:[{},{},{},...]` but this is not important If I do `JSON.stringify(obj.all)` it returns only this `[]` without `all` . How to achive this `{ all: [] }` ?
Are you looking for something like this - let obj = {to:this.to,all:[]}; let objNew = Object.assign({}, {all: obj.all});
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "angular, typescript, ionic3" }
Elm compiler in Elm? Almost every compiled language has a version of its compiler written in the language. Is there not an Elm compiler written in Elm?
At the moment the only complete Elm compiler is the "official" one, therefore not named, and it's written in Haskell. I don't know of any implementation of an Elm compiler in Elm. Over the years that I've read the Elm mailing list(s) I've seen this question come up. Some people expressed interest in having the compiler written in Elm so it can be compiled to JavaScript, and therefore there would be a compiler for Elm in the browser. But so far that's the only compelling argument that's been brought up (IIRC). Which is not enough to make porting the Elm compiler to Elm a priority, the cost-benefit ratio is skewed by the huge effort it would take to port even half of the Haskell libraries that are currently used by elm-compiler.
stackexchange-stackoverflow
{ "answer_score": 21, "question_score": 10, "tags": "elm" }
how can i go back to the beginning when there is no next() how can i go back to the beginning when there is no next() $(function () { (function hideHeading() { setInterval(function () { $('.active').fadeOut(2000, function () { $(this).removeClass('active').next().addClass('active').fadeIn(2000); }); }, 2000); })(); }); example here <
You actually don't need setInterval since you could simply do a recursion as below. If the `.next()` isn't there, set the pointer to `first()`. $(function () { (function hideHeading() { $(".active").fadeOut(2000, function () { var $this = $(this).removeClass('active'); var $next = ($this.next().length && $this.next()) || ($this.siblings().first()); $next.addClass('active').fadeIn(2000, hideHeading); }); }()); }); **Updated Pen**
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": -3, "tags": "javascript, jquery" }
Find specific words on dataframe When I look for a word in a data frame it shows me every entry containing those letters but I really want for it to show me that specific word. Can you help me out? Here is and example: import pandas as pd d = {'col1': ['ROL', 'ROVER','ROL','ROLLER','ROL','TROLLER','rol','rolter','nan'] ,'col2': [1, 2,3,4,5,6,7,9,10]} df = pd.DataFrame(data=d) ROL = df[df['col1'].fillna(0).str.contains("ROL|rol",na=False)] The output is something like this ![current output image]( but what I really wanted was something without those entries ![desired output image](
The problem with your code is that your `str.contains("ROL|rol")` matches all values apart from `ROVER`. For example, `"ROLLER"` also contains `"ROL"`. Try this use of `str.contains`: import re ids = df.col1.str.contains('rol$|rol-|rol ', flags = re.IGNORECASE, regex = True, na = False) And then filter: df[ids] gives: Out[115]: col1 col2 0 ROL 1 2 ROL- 33 3 4 ROL -2 5 6 rol nº12 7
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 1, "tags": "python, pandas, dataframe" }
Font awesome and bootstrap button with icons syntax In bootstrap, buttons with icons are implemented using a combination of `<button>` and `<span>`: < <button type="button" class="btn btn-default" aria-label="Left Align"> <span class="glyphicon glyphicon-align-left" aria-hidden="true"></span> </button> In font awesome, buttons are implemented using combination of `<a>` and `<i>`: < <a class="btn btn-danger" href="#"> <i class="fa fa-trash-o fa-lg"></i> Delete</a> Is there a better way? Or are the selection of these tags completely arbitrary?
It completely depends upon the usage. In bootstrap you can implement buttons using combination of `<a>` and `<i>`. Similarly , in font-awesome buttons with icons can be implemented using a combination of `<button>` and `<span>`. For example: If we need to submit a form and the submit button contains a font-awesome icon then we do it like this-- <button type="button" class="btn btn-default" aria-label="Left Align"> <span class="fa fa-trash-o fa-lg" aria-hidden="true"></span> </button> Another example: If we need to use a normal link and the link contains a bootstrap glyphicon icon then we can do it like this-- <a class="btn btn-danger" href="#"> <i class="glyphicon glyphicon-align-left"></i> Delete</a>
stackexchange-stackoverflow
{ "answer_score": 42, "question_score": 26, "tags": "twitter bootstrap 3, font awesome" }
LPC17XX SPI: Implementing pulse-sensitive(edge-triggered) interrupts I would like to implement a pulse-sensitive, aka edge-triggered, interrupt on an LPC1759 microcontroller. In the UM10360.pdf datasheet and ARM Cortex-M3 user guide, it says that interrupts can be triggered based on level- or pulse-sensitive behavior, but I am unable to find how to set this to be pulse-sensitive. Can someone please tell me where to set this? For my particular application(interfacing the LPC1759 with an AD7794 ADC), I would like to trigger an interrupt based on the falling edge of the MISO pin. Although it is not explicitly stated that the interrupt is trigger on the MISO value, I am assuming this based on the fact that, of the four SPI signals, the MISO is the only input to the microcontroller. Please let me know if this is not correct.
See UM10360.pdf, chapter 9.5.6: "GPIO interrupt registers". You can enable rising and falling edge interrupts only on port 0 and 2 pins. The interrupt vector is the same as external interrupt 3.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 2, "tags": "c, arm, interrupt, spi, lpc" }
How to change the width of the html selector with javascript In my CSS I set the width of the html like this: html {width: 1000px; } I would like to be able to change this width dynamically with javascript similar to setting the style.width of an element. The window.document node doesn't have a style property and I can't find the width anywhere. Where in the DOM is the 1000px stored and can I change it dynamically?
You can always get it like: document.documentElement or: document.getElementsByTagName('html')[0] or even: document.body.parentElement * * * So to get the CSS width, just do: document.documentElement.style.width * * * Docs: < > Returns the Element that is the root element of the document (for example, the <html> element for HTML documents).
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 1, "tags": "javascript, html, css, dom" }
no "portlet producer application" in JDeveloper I downloaded JDeveloper 11g to do some WSRP portlet development (who knew it was so "big"). However All the turorials I refernce talk about "portlet producer application" wizard which I dont have in my JDeveloper. What am I doing wrong?
You need to install the WebCenter extensions to get the Portlet wizards. Also make sure you are using JDeveloper 11.1.1.* and not 11.1.2.* Use help->check for update to get the extension.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "jdeveloper" }
How can I make views page with unique dates? I've made views page with node titles and dates: Title Post date node1125 2016-08-09 node1137 2016-08-09 node1138 2016-08-09 node1139 2016-08-10 node1140 2016-08-10 node1141 2016-08-10 node1142 2016-08-13 node1143 2016-08-13 How can I make views page for these nodes with unique dates only: 2016-08-09 2016-08-10 2016-08-13 ?
I've made grouping (agregation) on date field. Then I override **views-view-unformatted.tpl.php** for the view with <?php print $title; ?>
stackexchange-drupal
{ "answer_score": 0, "question_score": 0, "tags": "7, views" }
Does convergence of arithmetic mean imply convergence of geometric mean? Let $x_n$ be a sequence of positive real numbers, which is not convergent. ($x_n$ does not converge to a finite number, nor to infinity). Define $$ A_n = \frac{x_1 + x_2 + \cdots + x_n}{n} \quad \text{ and }\quad G_n = \sqrt[n]{x_1x_2...x_n}.$$ > Does the convergence of $A_n$ imply the convergence of $G_n$ or vice versa? I know that if $x_n \to L \in \mathbb{R}\cup\\{\infty\\}$, then both $A_n,G_n$ converge to $L$. But here I assume $x_n$ is not convergent. I also wonder if adding a boundedness assumption on $x_n$ changes anything.
This is a partial negative answer. Consider $$a_n = \begin{cases} n & \text{if $n$ is odd}, \\\ \frac{1}{n-1} & \text{if $n$ is even}. \end{cases}$$ Then $$A_n \geq \frac{\frac{(n+1)^2}{4}}{n} \to \infty,$$ but $$G_n = \begin{cases} \sqrt[n]{n} & \text{if $n$ is odd}, \\\ 1 & \text{if $n$ is even} \end{cases} \to 1.$$ Also note that even if both limits exist, they do not need to be equal. This is easily seen by something simple such as $a_n = 2 + (-1)^n$.
stackexchange-math
{ "answer_score": 3, "question_score": 2, "tags": "real analysis, calculus, sequences and series, limits, means" }
CSS Variables and Angular 5 I'm trying to use css varible in my Angular application, inside a child component, and it's just not working. In the browser's Elements tool (I'm using Chrome latest version) the var() doesn't do anything. expamle: css file: :root { --width: 43.75%; } #content { display: grid; grid-template-columns: repeat(2, var(--width)); grid-auto-rows: 90%; grid-gap: 3px; align-content: center; justify-content: center; border: 2px solid black; width: 400px; height: 250px; margin: 0 auto; } And thats how it's shown in the browser: ![enter image description here]( Is CSS Variables can work with Angulat at all? Thank you
Your root selector probably gets also attribute with angular component id. Try this ::ng-deep :root { --width: 43.75%; }
stackexchange-stackoverflow
{ "answer_score": 21, "question_score": 10, "tags": "javascript, css, angular, css variables" }
Error when requesting the last page of results. When I try to view the following URL: > I get the error: { "error_id": 500, "error_name": "internal_error", "error_message": "this error has been logged" } Normally an invalid page returns an empty question set, not a 500 error. But this isn't even an invalid page. At the time of the request above, the API reports that Stack Overflow has `2813421` questions, so: 2813421 / 30 = 93780.7 (which rounds to 93781) There should be a page 93781.
The query backing that method, while not bad really, didn't look to be up to quite that much data/paging. It's been replaced with a better query in the latest build, which should be plenty fast.
stackexchange-stackapps
{ "answer_score": 0, "question_score": 0, "tags": "bug, status completed, api v2" }
Regex that picks up content in between In a large HTML document, I have multiple lines that look like this. The value 'TEST' can be different. I want to pick up `TEST` or whatever else is in its place. `<TD width=300 valign=top><FONT COLOR=800000 size=3>TEST</FONT><BR>` I have this regex: $regex = "/<FONT COLOR=800000 size=3>[\w.&,\s]*<\/FONT>/"; It picks up all the lines that look like the one I posted above. How can I, instead of the entire line, pick up only TEST.
$regex = "/<FONT COLOR=800000 size=3>([\w.&,\s]*)<\/FONT>/"; preg_match($regex, $string, $matches); you will have all matches in `$matches` array, `$matches[1]` should be your "TEST".
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "php, regex" }
How to get SonarQube working with SVN server v1.6.11? I'm trying to get SonarQube working for my first project and run into this error message now during analysis of C++ code: E200007: Retrieval of mergeinfo unsupported by ' I found this related answer, but we are running v1.6.11 on our server, not v1.7. I note that subversion 1.6 does support mergeinfo but perhaps SonarQube is querying using the wrong syntax for v1.6? How can I get mergeinfo to work with SonarQube v5.2 and SVN plugin v1.2 using svn server v1.6.11?
This usually mean your SVN server was not properly migrated. We collected some details on plugin documentation page: < Basically you should try to run `svnadmin upgrade` on your repository (on server side).
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "c++, sonarqube, svn server, mergeinfo" }
asp.net core websocket how many times ping fail will be closed in asp.net core 2.1, websocket middleware has a property KeepAliveInterval, to send "ping" and receive "pong" from client to keep connection alive. But i can not found how many times when the server send "ping" faild (can not receive "pong") and would close the websocket connection? any one know?
.net core websocket is not handle the received pong frames. see: < -> HandleReceivedPingPongAsync method.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 1, "tags": "asp.net core, websocket, ping, asp.net core 2.1, pong" }
Change background of entire website please visit this link : < I want to change the background for the entire website. NOw you can see some lines in the background. Is that lines are images? or what? And i want to put background-color for entire website.
The CSS for your background is being pushed to the `<head>` of your template, most likely by Joomla's `addStyleDeclaration` function. body.site { background-color: green; background-image: url("/templates/corpoboost/images/patterns/1.png"); border-top: 3px solid #db8000; } In this case, it's most likely being set in your template parameters. Go to **Extensions** >> **Template Manager** Then select your template and there should be some options
stackexchange-joomla
{ "answer_score": 0, "question_score": 0, "tags": "joomla 2.5" }
Vim command to delete all but selected lines I would like to do the inverse operation performed by :g/pattern/d i.e Delete all lines in a file which doesn't have `pattern`
You can use `v` to select all line without pattern : `:v/pattern/d` will achieve what you want to do. See `:help :v`
stackexchange-stackoverflow
{ "answer_score": 23, "question_score": 6, "tags": "vim, line" }
Latex ``helpfully" inserts missing $ for math mode, when I don't want math mode I'm trying to compile a document in overleaf where I need to quote a reviewer comment. The comment has underscores in a word i.e. Number_of_Nodes. For some reason I think the compiler sees the underscores and tries to be helpful by adding $ to enter inline math mode. Firstly, I don't want math mode, and secondly this conflicts with the quote environment. How can I stop this "helpful" behaviour? MWE: \documentclass{article} \begin{document} \begin{quote} \itshape (Number_of_Nodes_at_step(n)). \end{quote} \end{document}
Use `\textunderscore` instead, `_` switches to math mode Edit: You could also escape `_` character with `\_` Like this `(Number\_of\_Nodes\_at\_step(n))` Thanks Don Hosek and Zarko!
stackexchange-tex
{ "answer_score": 6, "question_score": 4, "tags": "math mode, errors" }
JUnit Thread Testing I have client and server threads in my applications. When I run these apps as standalone apps, these threads communicate properly. But when I run client as JUnit and server as standalone, client thread dies within few seconds. I couldn't get, why such different behavior.
When the JUnit runner terminates, all spawned threads etc. are killed too (as it is most likely run in a separate JVM instance). Here is a (rather old) article describing the problem you experienced (the GroboUtils library it is recommending seems to have been abandoned long time ago though). And another, recent one, with a more modern solution using the new Java concurrency framework. The gist of the latter solution is that it runs the threads via an executor, which publishes the results of the runs via `Future`s. And `Future.get` is blocking until the thread finishes with the task, automatically keeping the JUnit tests alive. You may be able to adapt this trick to your case.
stackexchange-stackoverflow
{ "answer_score": 8, "question_score": 3, "tags": "multithreading, unit testing, junit" }
Why do SSDs slower that 6 Gb/s use PCI-E A lot of SSDs on the market connect to the motherboard via PCI-E and have read/write speeds of less than 1000 Mb/s. Why don't they use SATA 6Gb/s? I assumed from the name that it supports speeds up to 6 Gb/s... Am I missing some limitations SATA has?
There's a few pieces that combine to make PCI-E a better alternative. When you access a file over SATA, it can either read or write, but not both at the same time while PCI-E can perform several operations simultaneously. Imagine reading a log file, adding a new line and saving it to the drive. Add more services that are writing logs and it doesn't scale well over SATA. The second is latency, usually for high performance computing, like Hoov said. Data sent to a drive must pass through a SATA controller, then over to the drive where the SSD controller formats it correctly for the drive. Using PCI-E removes a step as the SATA Controller is pulled from the line and the processor is talking straight to the SSD controller.
stackexchange-superuser
{ "answer_score": 3, "question_score": 2, "tags": "ssd, sata, pci express" }
Send button not retrieving friends bug? I'm trying to implement the Send button, but running into what may just be a user experience issue but certainly appears to be a bug. At least on my machine, the same is happening on my site as well as the demo in the link above. When you click the "To" field to enter a friend's name and start typing nothing shows up. It doesn't show the drop down of friends. Then if you click in the "Message" field and _go back_ to the "To" field the drop down works. Am I alone here?
Though I filed a Facebook bug report there was already an existing ticket. See this ticket for the best updates: <
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 1, "tags": "facebook, send" }
How does Scala know the difference between "def foo" and "def foo()"? I know about the usage difference between empty-parameter and parameterless methods in scala, and my question pertains to the class file generated. When I look at these two classes in javap, they look exactly the same: class Foo { def bar() = 123; } class Foo { def bar = 123; } But when I look at them in scalap, they accurately reflect the parameter lists. Where in the class file is scalac making this distinction known?
In the .class file, there is a class file attribute called `ScalaSig`, which contains all of the extra information needed by Scala. It's not really readable by humans, but it is there: $ javap -verbose Foo.class const #195 = Asciz ScalaSig; const #196 = Asciz Lscala/reflect/ScalaSignature;; const #197 = Asciz bytes; const #198 = Asciz ^F^A!3A!^A^B^A^S\t\tb)^7f^Y^Vtw\r^^5DQ^V^\7.^Z:^K^E\r!^ Q^A^B4jY^VT!!^B^D^B^UM^\^W\r\1tifdWMC^A^H^.... See also [How is the Scala signature stored? and scala.reflect.ScalaSignature, which isn't very interesting :-)
stackexchange-stackoverflow
{ "answer_score": 20, "question_score": 21, "tags": "scala" }
Example of Unit of System of Sets From this definition < : Let $\mathcal{S}$ be a system of sets. Let $U \in \mathcal{S}$ such that $\forall A \in \mathcal{S}: A \cap U = A$ Then $U$ is the unit of $\mathcal{S}$. Note that, for a given system of sets, if $U$ exists then it is unique. * * * What is a non-trivial example? Does is mean that $U$ has to contain all elements from all subsets of $\mathcal{S}$? E.g. $\mathcal{S} = \\{\\{1, 2\\}, \\{1, 3\\}\\}$ so $U = \\{1, 2, 3\\}$?
Notice that $A \cap U = A$ is equivalent to $A \subseteq U$. Thus $U$ is the unit for $\mathcal{S}$ means that $U \in \mathcal{S}$ and $A \subseteq U$ for every $A \in \mathcal{S}$. So $U$ must contain all the elements of each member of $\mathcal{S}$. Your example $\mathcal{S} = \\{\\{1, 2\\}, \\{1, 3\\}\\}$ does not have a unit, because there is no set _in $\mathcal{S}$_ that has each set in $\mathcal{S}$ as a subset. On the other hand, if $\mathcal{S}' = \\{\\{1, 2\\}, \\{1, 3\\}, \\{1, 2, 3\\}\\}$ then $\\{1, 2, 3\\}$ is the unit for $\mathcal{S}'$. For another example, if $\mathcal{S} = \\{\\{1, 2\\}, \\{1, 3\\}, \\{1, 2, 3, 4\\}\\}$ then $\\{1, 2, 3, 4\\}$ is the unit. Note how important it is that the unit is actually in the system for the claim about uniqueness!
stackexchange-math
{ "answer_score": 2, "question_score": 0, "tags": "elementary set theory" }
caracteres esquisitos ao imprimir na textarea não estou conseguindo imprimir corretamente os caracteres. se eu escrever qualquer coisa dentro da html, os caracteres ficam normais. `<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />` * se eu escrever um texto com caracteres especiais no javascript e mandar printar em uma textarea: **"Indicação"** , isso acaba retornando na textarea `Indicação` document.getElementById('textarea').value = "Indicação"; tem algum modo de printar isso certo? o único modo de printar "certo" é fazendo o que o rapaz deste blog falou? <
João, o problema é que os charsets dos seus arquivos estão incompatíveis. Não sei o editor que você está usando, mas para evitar problemas, você deve salvar todos os arquivos com o mesmo charset, de preferência UTF-8. E para garantir a compatibilidade com o browser, eu ainda costumo utilizar a tag `<meta charset="utf-8" />` logo após `<head>` no meu arquivo html. Você pode usar o Notepad++ [< para conferir o charset dos seus arquivos e até mesmo converter. (menu "Formatar").
stackexchange-pt_stackoverflow
{ "answer_score": 0, "question_score": 2, "tags": "javascript" }
Client-Server Chat application JAVA I have a simple java written client and server chat application(with sockets). When running on the same network/computer it works fine. However when i try to run the client from a different network it doesn't connect. I tried using the public IP address of the server to connect the client to the server but without luck. How would I be able to connect to the server app from a different network? any help would be appreciated.
It worked after I did port forwarding on router. Most of the ISP provided modem/routers wont let you manipulate ports so had to buy my own modem/router, forwarded the port and worked like a charm. Information on what port forwarding is can be found here : `
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "java, sockets, chat" }
Does homotopy equivalence to a wedge of spheres imply shellability? It's pretty clear that for a simplicial complex $\Delta$, shellability of the complex implies that it is homotopy equivalent to a wedge of spheres. However, does the converse hold? That is, does $\Delta$ being homotopy equivalent to a wedge of spheres imply shellability? Thanks!
No. There are unshellable n-spheres for all n≥3: _Lickorish, W. B. R._ , **Unshellable triangulations of spheres**80103-5), Eur. J. Comb. 12, No. 6, 527-530 (1991). ZBL0746.57007.
stackexchange-mathoverflow_net_7z
{ "answer_score": 13, "question_score": 7, "tags": "at.algebraic topology, homotopy theory, simplicial complexes" }
Need a pattern to call Verify method for every instance method pattern I have the following code: class Foo { public Foo() { Size = true; } private bool _size; protected bool Size { get { _size; } set { _size = value; } } } class CrazyFoo : Foo { public void First() { if (!Size) return; } public void Second() { if (!Size) return; } public void Finished() { if (!Size) return; } } What is the best way to implement this sort of pattern, as it drives me nuts to type if(!Size) return; perhaps I can do it with attributes or AOP? What is the best and simplest way? Thanks
From a "pattern" standpoint, though, this doesn't seem onerous to me. It seems perfectly reasonable to me to type: if(!Size) return; You're explicitly handling the cases you want. In your case, this check is pretty specific to what you are working with, from what I can tell (from your original + edits). I'd personally choose a more obvious name, since it does seem a little strange (even in your original), and not completely obvious what's happening. Even with AOP, you'd be adding some other information here on each method, to make sure your aspect was handled.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 4, "tags": "c#, .net, design patterns" }
JavaEEでトランザクションのリトライをしたい JavaEE7 `SQLTransactonRollbackException` `@Transactional` `@Transactional``TransactionRequiredException` ↓ @RequestScoped public class SomeFacade { @Inject private SomeTran someTran; public void run() try { this.someTran.execute(); } catch (SQLTransactonRollbackException ex) { this.someTran.execute(); // -> TransactionRequiredException } } } `SomeTran``@RequestScoped``@Transactional` @RequestScoped public class SomeTran { @Transactional public void execute() { ... } } 12
`@Transactional``value``REQUIRED` `REQUIRED` `execute()`12(`execute()`) 12 `REQUIRED``REQUIRES_NEW``execute()`() (`execute()``execute()`) * * * : * The Java EE 7 TutorialTransactions - kagamihoge * URLURL * 51.3.1 Transaction Attributes * JavaEE7(16) - CDI - (Enterprise Geeks)
stackexchange-ja_stackoverflow
{ "answer_score": 2, "question_score": 1, "tags": "java, java ee" }
ContextFreeGrammar ambiguity given a CFG: `S--> aS | Sa | b` I can not find any string that can be made from two different pars trees. the middle state has left recursion but without eliminating that is there any string that shows the CFG ambiguity ? can anyone help plz.
If you apply rules 1, 2 and 3, you get: S -> aS -> aSa -> aba And if you apply rules 2, 3 and 1, you get the same string: S -> Sa -> aSa -> aba There's the ambiguity. Found a tool that checks ambiguity: < Enter the grammar and check `analyze the grammar for potential ambiguity`: S : "a" S | S "a" | "b" Results: *** vertical ambiguity: S[#1] <--> S[#2] ambiguous string: "aba" the grammar is ambiguous!
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "context free grammar, ambiguous grammar" }
Microsoft proxy server not working with CNTLM and apt-get I'm trying to connect an ISA proxy server with CNTLM. But syntax of ISA proxy looks different. I can't find a way to set proxy for apt. my CNTLM is listening on `127.0.0.1:41040`, and `/etc/apt/apt.conf` is like this: Acquire::http::Proxy " Which `urmia.ac.ir` is the domain of ISA in my university. I'm getting 407 error. CNTLM says HEAD: HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )
You put the username and password (in hashed form, preferably) in CNTLM's configuration file. Apt doesn't need to know your username and password. Configuring cntlm can be a little finicky, you need to play around with "Auth" flags, until it works reliably. Here's a howto I wrote for users at my university.
stackexchange-askubuntu
{ "answer_score": 5, "question_score": 3, "tags": "apt, proxy" }
Checking to see if their zip code is eligible Hello I am working on a web page in drupal. One of the content is about a scholarship and there are certain zipcodes that are eligible for that scholarship. I was wondering if there is to have a search box within that web page were the user types in there zip code and than tells you if they are eligible or not I was thinking some javascript, but I was wondering if there is any better ideas. Thanks!
Sure, you could use javascript on the client side or php (as Drupal is in php) on the server side. The tradeoff with the javascript approach is you'll have to send all the valid zip codes (or some rule that computes them) to the client every time your page is loaded. But the upside is then it'll be very fast for the client to try various zip codes (since no server communication will be needed). And this may be easier for you to code. For your use, you'd probably get better overall performance doing this in php on the server. But then you'll need to be familiar with some form of client-server communication (ajax for instance) so that you can send the zip code back to the server and listen for a response.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "drupal" }
JPA 2.0 predicate condition lists in query builder Code: List<Predicate> conditionsList = new ArrayList<Predicate>(); Predicate onStart = criteriaBuilder.greaterThanOrEqualTo(criteriaRoot.get("insertDateTime"), startTradeDate); Predicate onEnd = criteriaBuilder.lessThanOrEqualTo(criteriaRoot.get("insertDateTime"), endTradeDate); conditionsList.add(onStart); conditionsList.add(onEnd); CriteriaBuilder criteriaBuilder = this.entityManager.getCriteriaBuilder(); CriteriaQuery<MyClass> criteriaQuery = criteriaBuilder.createQuery(MyClass.class); Root<MyClass> criteriaRoot = criteriaQuery.from(MyClass.class); criteriaQuery.select(criteriaRoot).where(conditionsList); The last line above doesn't compile because its expecting the `conditionsList` object to be a List of Boolean not list of Predicate. Please advise me on the correct way of adding predicates above to the `hibernate` criteria?
Convert the `List<Predicate>` into an array `Predicate[]` like this: criteriaQuery.select(criteriaRoot).where(conditionsList.toArray(new Predicate[] {}));
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "java, hibernate, jpa, criteria api" }
StringBuffer setLength vs substring To trim to a length in stringbuilder. What should I use? StringBuilder sb = new StringBuilder("203253/62331066 "); StringBuilder sb1 = new StringBuilder("203253/62331066 "); int newLen = Math.min(sb.length(), ACCT_LENGTH); sb = new StringBuilder(sb.substring(0, newLen)); sb1.setLength(newLen); System.out.println(sb); System.out.println(sb1); `setLength(newLength)` or `new StringBuilder` with `substring()`?
`setLength` is more efficient as it simply changes an internal counter that tracks the size of the StringBuilder without changing anything else (assuming the new length is smaller of course). `substring` creates a new String which implies an array copy.
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 2, "tags": "java, string, substring, stringbuilder" }
Firebug is too heavy When I work for a long time with Firebug, it makes the browser too heavy, is there a way to clear cache or something like that.
Firefox is naturally memory intensive and demonstrates a bit of a leaky symptom most of the time. I've had a beta build (4.0) seem to stabilize around 400MB, but FF 3.6 will grow to double that easily. That is most likely the issue, not Firebug. Though it could be Firebug's console (if that's open), net tab (if it's persisting) or anything else. I would try to measure memory consumption with Firebug on (over a period of a day) and off (over the same period).
stackexchange-superuser
{ "answer_score": 1, "question_score": 1, "tags": "firefox, firefox extensions, firebug" }
What does "bore" mean in "Athena's aegis bore the severed head of the monstrous Medusa"? What does "bore" mean in _Athena's aegis bore the severed head of the monstrous Medusa_? I looked it up in dictionaries and found a relevant meaning: > to make a long deep hole with a tool or by digging But this seems can't be applied here, as it basically is digging holes. How can one dig a hole on the aegis and the hole looks like Medusa's head? To me the _bore_ here means more like "carve", but I can't find this in the dictionary. So what does it really mean here?
In this sentence, **bore** is the simple past of **bear**. According to the Cambridge Dictionary, **bear** has several meanings- in this sentence, the most likely is > to have or continue to have something What this sentance means is that Athena wears an aegis (a protective animal skin) which has a likeness of a medusa's head on it. Here is a statue of Athena: note the gorgon's head featured on the aegis which is worn diagonally across her chest. ![enter image description here](
stackexchange-ell
{ "answer_score": 3, "question_score": 0, "tags": "meaning" }
Using an unique_ptr as a member of a struct So I have a struct like this: struct node { node_type type; StaticTokensContainer token_sc; std::unique_ptr<node> left; // here std::unique_ptr<node> right; // and here }; When I tried to write a recursive function to convert a `node` to string for printing like this: std::string node_to_string(node n) { return "<other members converted to strings>" + node_to_string(*(n.left)); } It gives me: `function "node::node(const node &)" (declared implicitly) cannot be referenced -- it is a deleted function` I don't understand why this error is showing up, I had no problem when I did `(*n)` when I tried passing n as `std::unique_ptr<node>`, so I don't see why doing `*(n.left)` is not allowed.
you pass `node` by value, and you cannot set one `std::unique_ptr` equal to another: int main() { std::unique_ptr<node> a = std::make_unique<node>(); std::unique_ptr<node> b = a; //Error C2280 } because who is now the _unique_ owner of the data? * * * To fix your error, simple take a `const` reference in your function. This way, you pass the reference and that won't create copies: std::string node_to_string(const node& n) { return "<other members converted to strings>" + node_to_string(*(n.left)); } (you should also think about exiting this function, otherwise you will get either get a stack overflow or a dereferenced nullptr, whichever comes first. For example, add `if (!n.left) return "";`)
stackexchange-stackoverflow
{ "answer_score": 5, "question_score": 1, "tags": "c++, reference, unique ptr, dereference" }
Setting up groovy SDK on Intellij 2017.1 I'm trying to run Spock tests with my project in IntelliJ 2017.1 community ed. While editing my spec file I get the error msg "Cannot resolve spock" on the import line with a "Configure Groovy SDK" link. When I click on that link I get the "Setup Library" dialog. It has a "Use library" folder search. So I locate my groovy-2.4.10 SDK folder and press Ok. Then I get this error msg: > Looks like Groovy distribution in specified path is broken. Cannot determine version. I've checked and double-checked the groovy SDK folder. It's a complete groovy SDK folder as un-zipped from the prestine download I did from < So I'm at a loss as to where to go next. Anyone run into this with IntelliJ 2017.1 community ed?
CrazyCoder's comment to my question is the answer. Upgrade to 2017.1.1 version of IDEA solved the issue. It's a known issue: * IDEA-170022 Cannot create Groovy project, because cannot create Groovy library (2.4.10 version) As a workaround you can use Groovy 2.4.9 or rename `groovy-2.4.10.jar` to `groovy-2.4.9.jar`. The problem is fixed for IntelliJ IDEA 2017.1.1 and 2016.3.6 versions.
stackexchange-superuser
{ "answer_score": 0, "question_score": 2, "tags": "intellij idea, groovy" }
biometric local authentication fingerprint index If I'm correct, you can store up to 5 finger prints in iOS. I have came across something like weak biometric, meaning the fingerprint may not necessarily be the fingerprint of a primary user, a secondary user can also set one, so we want to restrict the fingerprint indexing to a specific impression. Is there a way to find the index or know which finger print index was used to set up biometric to login into the application? localAuthenticationContext.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: reasonString) { // index of the finger print }
No. Every registered fingerprint is equally valid. If a user decides to add the finger print of another user, they give them equal access to everything as long as no passcode is required. But the majority of users register finger prints of multiple of their own fingers; depending how you grab your phone one finger print is more practical than another. I have left and right index finger and right thumb registered. If one or two of those didn't work with your app, I would be very, very, _very_ annoyed as a user.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "ios, swift, fingerprint, biometrics" }
SQL Server Add integer variable to end of string I want to generate some integers in SQL Server loop and add it to end of string that is a long number Declare @i int Set @i = 10 While @i < 45 Begin insert into AllowedStudents (GroupID, StudentNumber) values ('1', '9210410' + @i) SET @i = @i + 1 End but when insert process ends I see this result : 28240 1 9210420 28241 1 9210421 28242 1 9210422 28243 1 9210423 against 28240 1 921041020 28241 1 921041021 28242 1 921041022 28243 1 921041023
Convert `@i` from `int` to `varchar` Like this insert into AllowedStudents (GroupID, StudentNumber) values ('1', '9210410' + Convert(varchar(50), @i)) **SQLFIDDLE**
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 1, "tags": "sql server" }
How to use Youwave in place of Android Emulator I've tried for days and failed to run AVD on my PC. So I decided to look for an alternative and found out that Youwave can be used as an emulator. Here is my question: How can I run Android source (apps not finished so they are not .apk) on Youwave?
You can't run Android Source which is not finished to become .apk. The best alternative of emulator is Genymotion.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "android, android emulator, youwave for android" }
Image processing related discussion forum I am looking for discussion forum for Image processing related queries, Can someone direct me some discussion groups, Though I am a beginner, I am catching up fast ;-) ...
I think such questions fit well on Stack Overflow. Try us! :)
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 13, "tags": "image processing, forums" }
jQuery speed when referencing objects and their descendants With regards to speed and using resources, If i save the html of a page as a jquery object, such as: var meHTML = $('html') Should i then reference further objects as say var someID = meHTML.find('#someID') as opposed to var someID = $('#someID') Im sure its probably only minimal, but Im curious to find out what the differences may be. Thanks in advance for any advice.
If you take a look at the source for a `$("#id")` call, you can see they enhanced a single ID selector alot by directly using `document.getElementById` and setting the length of the set to `1` manually. The source for `.find`, however, is more expensive since the selector is passed through to Sizzle. Moreover, it checks for duplicates in the resulting set for example, which isn't necessary with an ID. It will come down to a longer and slower code path. So, `$("#id")` should be faster.
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 3, "tags": "javascript, jquery" }
How to show content loading progress bar in a browser? I loaded this website < on chrome browser and I can see a progres bar (a blue colored) below the address bar. anybody have an idea what is it ? this is progress bar of chrome or something this website made ?
Progress bars can be made a number of ways. I'd recommend using pace.js, which is what teamwork.com is using - it's as dead easy as they come: <
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": -1, "tags": "javascript, jquery, html, google chrome, web" }
Interpreting DHCP related message from rsyslog In **/var/log/messages** from an EC2 instance there are a lot of lines such as: <date/timestamp> ip-<IP_HERE> ec2net: [get_meta] Trying to get <date/timestamp> ip-<IP_HERE> ec2net: [rewrite_aliases] Rewriting aliases of eth0 <date/timestamp> ip-<IP_HERE> dhclient[2187]: XMT: Solicit on eth0, interval 112321ms. <date/timestamp> ip-<IP_HERE> dhclient[2187]: XMT: Solicit on eth0, interval 111231ms. .... and more XMT: Solicit messages (hundreds more) Why would there be hundreds of these solicit messages, and what does `XMT: Solicit on eth0`mean? How should I interpret this? Is this simply the log of a DHCP request (or many requests)? I haven't seen "XMT" previously.
An XMT Solicit is basically a DHCPv6 (IPv6 DHCP) request. If you're not using IPv6 at all disable it because your instance is trying to request an IPv6-IP. The problem seems to be that your instance is running an older version of dhclient which is logging with log-level "normal". Normally dhclient should only log from the log-level "warning" and above. You could also disable logging messages for dclient and ec2net by adding this code :programname,isequal,"dhclient" ~ :programname,isequal,"ec2net" ~ to a new file (e.g. "dhclient") under /etc/rsyslog.d/. See more here: <
stackexchange-serverfault
{ "answer_score": 11, "question_score": 10, "tags": "amazon ec2, dhcp, log files, rsyslog" }
If in array knockout js Is there a way to check if an array contains a certain value, using knockoutJS, within my HTML? I have the following checkbox: <td><input type="checkbox" name="group" data-bind="checked: $parent.name in groupList" /></td> It would be nice if a certain statement inside my `data-bind` attribute (`$parent.name in groupList`) would work, but obviously it doesn't. With twig it's easy: {% if myVar is in_array(array_keys(someOtherArray)) %} But I cannot find a way to do this with Knockout JS. `groupList` contains an array with names and I would like to check if it contains a certain name. If it does, the checkbox needs to be checked, else not.
You can use indexOf of an observable array: data-bind="checked: groupList().indexOf(ko.unwrap($parent.name)) !== -1"
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 2, "tags": "javascript, arrays, knockout.js" }
Remotely identify the version of a WordPress installation? How does DD32's tool determine the WordPress version of an installation. Its not working fine for WP 3.1 but it doesn't uses meta generator tag or the readme.txt of WP. So what else can it be?
I'm just assuming here but this is usually done by fingerprinting for specific version files/directory's/code and sometimes even size. For example you can remove all the meta versions tags ( isn't there like 12 places) and .txt file for 3.1 but since 3.1 is the only version to include the following new file by default, it is rather easy to fingerprint. wp-includes/js/l10n.js Since each release has many new additions, if you spend enough time writing a smart bot, it not very hard to find release specific data. Hiding all this info would be a lot of work for every release.
stackexchange-wordpress
{ "answer_score": 4, "question_score": 4, "tags": "wordpress version" }
Is FeatureCollection necessary for ol.layer.VectorTile layer in openlayers? I am looking to create a ol.layer.VectorTile layer from an array of GeoJSON Point objects in ol3. Right now the data that is being returned to me is an array of objects, with each object being a GeoJSON of type "Point". In examples I have seen, VectorTile layers were created from a "FeatureCollection" which contained all the Point objects as features. I am wondering if the api would need to return the data as a "FeatureCollection" or I would need to create one myself from the data being returned, in order to ultimately be able to create a vectorTile layer?
Your api just needs to return the geometries(ie. point,line, polygon). It could be in any parsable format like GeoJson/WKT.Then create OL3 feature from the geometries returned by your API. Create an instance of ol.Collection. Then add each feature in the newly created collection. And use this featurecollection as a source in a vector layer.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "openlayers 3, vector tiles" }
Cocoa Touch - Parsing Spread Sheets? Im working on some google doc spread sheets and I thought im not sure if cocoa can parsing the spread sheet data so I dont wanna do all this and find out its useless.. if it can be parsed what format should it be in? Thanks!
"Comma Separated Values"
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "cocoa touch, spread" }
In PHP fopen function, what's the difference between w and w+ mode? I have read the manaul, and knew that w+ write and read, w only write. But how to understand it? $file_name = $_SERVER['DOCUMENT_ROOT']."/../data/test.txt"; //file is exist $fp = fopen($file_name, 'w+'); fwrite($fp, 'hello, world!'); $len = filesize($file_name); echo $len; //13 $contents = fread($fp, $len); var_dump($contents);//string(0) "" why? fclose($fp);
Both options **w** and **w+** truncates file during opening with fopen. Difference is that you can read exactly that was written during current session working with file(I mean fopen->fwrite->fread(will not empty)->fclose). So if you try to read file opened with **w** and **w+** = the result in both case should be empty
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 2, "tags": "php" }
I want to use the "car" array , car[ : 250, :200, : ] to convert into image .Car array shape is (431, 575, 4) Please see the code here: ![enter image description here]( I want to use the packages already imported
If you want to show or display the image you can use imshow import matplotlib.pyplot as plt plt.imshow(car[:250, :200, :]) If you want to save a new image to disk you can use imsave. from matplotlib.image import imsave imsave("new_car_image.png", car[:250, :200, :])
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "python, numpy" }
"Die Wassermänner hüpfen!" im Hochdeutschen? Gibt es den Ausdruck "Die Wassermänner hüpfen!" im Hochdeutschen? Ich kenne den bayerischen Ausdruck "D'Wossamandln hupfan!", welcher benutzt wird um sehr starken Regen anzudeuten.
> Gibt es den Ausdruck "Die Wassermänner hüpfen!" im Hochdeutschen? Nein, den gibt es spezifisch für diesen Kontext im Hochdeutschen nicht. > Ich kenne den bayerischen Ausdruck "D'Wossamandln hupfan!", welcher benutzt wird um sehr starken Regen anzudeuten. Auch wenn ich als Oberbayer diesen Ausdruck noch nie gehört habe, kann ich mir vorstellen was damit sinnbildlich gemeint ist: Es beschreibt wie die Regentropfen auf den Boden treffen, und hüpfen um in weitere Tropfen zu zerspringen, die bei ganz starkem Regen nach oben spritzen. Die Tropfen, die nach oben spritzen ( _hupfan_ ), sind die Wassermänner ( _Wossamandln_ ). Ein schönes Bild.
stackexchange-german
{ "answer_score": 4, "question_score": 3, "tags": "standard german, bavarian" }
How to shrink the size of $\infty$ for subscripts When using `\infty` as a subscipt, the usual size is just too big for me, for example, I_\infty,J_\infty,K_\infty,\dots I tried `\scriptsize` or `\tiny` to shrink it, but does not work. Is there any way to do this (I prefer not to include extra package for this)?
The different 'sizes' for fonts in math-mode are: * `\displaystyle` * `\textstyle` * `\scriptstyle` * `\scriptscriptstyle` If you want to change their value, you could do: \DeclareMathSizes{d-size}{t-size}{s-size}{ss-size} In your example, I would just define a new command for your subscript: % arara: pdflatex \documentclass{article} \newcommand*{\myInfty}{{\scriptscriptstyle\infty}} \begin{document} \[I_\myInfty,J_\myInfty,K_\myInfty,\dots\] \end{document} !enter image description here
stackexchange-tex
{ "answer_score": 5, "question_score": 1, "tags": "fonts, symbols, fontsize" }
Accessing comment context menu in Adobe Acrobat Reader I have received a bunch of comments on a PDF document and I would like to efficiently navigate through them in Adobe Acrobat Reader DC. I have activated the single-key accelerators which are helpful, but I would really like to set the status of the comment in the context menu without touching the mouse. Any ideas how to access this using the keyboard only? !A bunch of triangles making a hexagon
> Any ideas how to access this using the keyboard only? 1. Press `Tab` to put the focus on the next comment, then 2. press the `context menu` key to open the context menu containing _Se̲t Status_ , then 3. press `e` to open _Se̲t Status_. !Acrobat Reader context menu ### Context menu key The `context menu` key is this one: !context menu key Source: < ### Keys for working with comments !Adobe Acrobat keyboard shortcuts for working with comments Source: <
stackexchange-superuser
{ "answer_score": 0, "question_score": 0, "tags": "keyboard shortcuts, pdf, adobe acrobat, context menu, adobe reader" }
How to trigger Operation.lineSegment with a button instead of a metronome in AudioKit? In the AudioKit Cookbook Example "SegmentOperation" there is an "Operation.lineSegment" that creates a linear ramp. It is triggered with a metronome, which in turn is a periodic impulse. How do I create that impulse from the outside world (by clicking a button for example)? let frequency = Operation.lineSegment(trigger: Operation.metronome(frequency: updateRate), start: start, end: 0, duration: duration) Thanks in advance.
Solved: Actually we don't need it to be exactly an impulse – any non-zero to zero transition will work. So I've just made a button to toggle the first parameter in the parameters array. This is how I've modified the operation conductor: let frequency = Operation.lineSegment(trigger: parameters[0], start: start, end: 0, duration: duration) And in the View: struct ContentView: View { @State var lineSeg = true var body: some View { Button("Toggle: \(lineSeg ? "On" : "Off")") { lineSeg.toggle() conductor.testEvent.parameter1 = lineSeg ? 1.0 : 0.0 } }
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "swift, audiokit" }
A problema about gamma distribution and convergence in distribution How can I solve this problem? > Let $Y_{n}\sim \textbf{Gamma}(n,1)$, $n\geq 1$. Prove that $$\frac{Y_{n}-n}{\sqrt{Y_{n}}}\overset{D}{\to}N(0,1)$$ **My approach:** First I think that since $Y_{n}$ is a sample so I can suppose that $Y_{i}$, $i=1,\ldots, n$ are independent random variables. Now, I think I need to prove that $Y_{n}-n \overset{D}{\to} N(0,1)$ also $\sqrt{Y_n} \overset{D}{\to} 1$. So, by Slutsky' theorem we can conclude that $\frac{Y_{n}-n}{\sqrt{Y_{n}}}\overset{D}{\to} N(0,1)$. But, can I continue from here? I think the central limit theorem is helful , but I don't know how to use the central limit theorem in this problem.
First observe that $Y_n=\Sigma_n X_n$ where $X_n\sim Exp(1)$, thus $E(X_i)=V(X_i)=1$ then re-write your sequence in the following way $$\frac{\Sigma_n X_n-n}{\sqrt{n}}\cdot \sqrt{\frac{n}{\Sigma_n X_n}}=A\times \sqrt{B}$$ Now, $A\xrightarrow{d}N(0;1)$ because it is exactly the defintion of CLT. Note also that $B=\frac{1}{\overline{X}_n}$ and thus, by Law of Large Numbers and Continuous mapping theorem, $\sqrt{B}\xrightarrow{\mathcal{P}}1$ Finally apply Slutsky to conclude your proof. * * * $\sqrt{n}$ is needed in the denominator...that was the aim of my question before: if you have not it...get it re-writing your sequence!
stackexchange-math
{ "answer_score": 1, "question_score": 1, "tags": "probability theory, probability distributions, weak convergence" }
How to update child I have a component that references a child component like this cc: TheChildComponent; @ViewChild('theChildComponent') set details(content: TheChildComponent) { this.cc = content; }; TheChildComponent is a complicated component with several dom elements and an array of data that gets updated async through a rest call. I would like to update my variable this.cc whenever I detect a change to the array of data in TheChildComponent. I dont know how to do it though or if it is possible.
The usual approach would be to emit the event in the child component whenever the child component changes its state. Given that you have no access to the child component implementation you have to look for more exotic solution. I'd implement `ngDoCheck` lifecycle with combination of `@ViewChild`. @ViewChild(TheChildComponent) child: TheChildComponent; ngDoCheck() { if (this.child && this.hasChanged(this.child.array)) this.cc = this.child.array; } } private hasChanged(arr: any[]): boolean { // check if the child changed its state } Please keep in mind that this lifecycle hook is called very often, so keep your logic as thin as possible. Check out Live demo.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 2, "tags": "angular, viewchild" }
How to add a command to launch a new tab in the browser with this code in JavaScript? (etc.) (with Terminal) I'm a noob. I have a code to simulate a terminal. This is it: < Command: var coreCmds = { "clear": clear }; Answer (clear the screen): function clear(argv, argc) { termBuffer = ""; return ""; } As mentioned in the title, how to add a command to launch a new tab in the browser (to google.com for example, or anywhere else)? Thank you.
## **window.open()** ; * * * The open() method opens a new browser window, or a new tab, depending on your browser settings and the parameter values. _Here's an example:_ window.open(" ## **Structure:** * * * window.open(URL, name, specs, replace) Since you want to open a new tab in browser, you should put `_blank` in name. However, this is the default. ## What would your code look like? * * * This is a rough outline, replace variable names and arguments as you like var var_name = { "new window": new_window }; function new_window(arguments) { termBuffer = ""; return window.open(arguments); } I hope this helps :D
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "javascript, html, css" }
Qual è il significato di "placarsi" in questo contesto? Nel libro _Non ora, non qui_ , di Erri De Luca, ho letto: > Le nuvole confondevano il vento, smembrandosi in corsa e il vento correva e ringhiava da cane pastore per tenerle unite in branco. Verso sera tutte le forme possibili **si placavano** in linee di rosso dove il sole scendeva e chiamava tutto il cielo a rompersi e a sparire. Ho cercato il verbo "placare" in parecchi dizionari. Tuttavia, non riesco a capirne il senso nel contesto del brano sopra citato. Me lo potreste spiegare?
Nel contesto da te citato significa che le nuvole, quasi fossero pecore di un gregge, si muovevano continuamente e alla sera si placavano, cioè si allineavano in gruppo come se stessero tornando all'ovile. Come correttamente fatto notare da @egreg è "come quando il mare agitato si placa e diventa liscio" > placarsi v. intr. pron. 1. [diventare calmo e tranquillo: _era arrabbiato ma ora si sta placando_ ] ≈ calmarsi, quietarsi,
stackexchange-italian
{ "answer_score": 4, "question_score": 1, "tags": "verbs, meaning" }
Confirm dialog with optional checkbox I am working on a web application where I need to display an alert. In this alert, clicking on **"No"** will hide the alert and clicking on **"Yes"** will remove the selected element (in example). I would like to add a checkbox like **"Remove all sibling elements"** of that particular selected element. Is it recommended UX to combine confirm choices and possible action through a checkbox? I have read this part of Material Design Guidelines, nothing about checkboxes.
I would suggest the following solution: !mockup download bmml source - Wireframes created with Balsamiq Mockups This way the user needs to make an immediate and explicit decision and there is no issue of forgetting to check or accidentally checking the checkbox. For smaller/portrait displays the dialog can present like this: !mockup download bmml source Remember, that on handheld devices the buttons are approached by the touch interface (from the bottom of the screen to the top), hence the most frequent button should be the lowest.
stackexchange-ux
{ "answer_score": 0, "question_score": 0, "tags": "material design, confirmation" }
¿"No Mejorás." significa "Don't make it worse."? Escuché que esta frase hablada con frecuencia como un comentario a una situación ya mala. ¿"No Mejorás". significa "Don't (try to) make it worse." en tal contexto?
By the provided context, it just means _you won't improve your situation_ (by doing what you're doing or intend to do). However, this does not imply that the situation will become worse if the listener decides to do it or keeps doing it anyway, so we need more context for a proper translation.
stackexchange-spanish
{ "answer_score": 3, "question_score": 0, "tags": "uso de palabras" }
MySQL Trigger: Prevent Insert by IF statement I try to write my first trigger for a MySQL Database. It should **prevent an insert** (and later also updates) on " **course_student** " in context of the current time and the given timestamps in " **capacity** ", but i'm still getting a syntax error. DELIMITER $$ CREATE TRIGGER checkSubscribeTimeCourse BEFORE INSERT ON course_student REFERENCING NEW AS new FOR EACH ROW BEGIN IF (SELECT COUNT(*) FROM capacity c, course_capacity cc WHERE c.cid = cc.cid AND cc.cid = new.cid AND (c.end >= CURRENT_TIMESTAMP OR c.end IS NULL) AND (c.start <= CURRENT_TIMESTAMP OR c.start IS NULL)<1) THEN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Error' END IF END DELIMITER ; _I translated all names; so maybe there are typing errors._
You have a few missing commas and some made up sql and a missing delimter at the end. DELIMITER $$ CREATE TRIGGER checkSubscribeTimeCourse BEFORE INSERT ON course_student FOR EACH ROW BEGIN IF (SELECT COUNT(*) FROM capacity c, course_capacity cc WHERE c.cid = cc.cid AND cc.cid = new.cid AND (c.end >= CURRENT_TIMESTAMP OR c.end IS NULL) AND (c.start <= CURRENT_TIMESTAMP OR c.start IS NULL)<1) THEN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Error'; END IF; END$$ DELIMITER ;
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "mysql, if statement, triggers, syntax error" }
Is there a way for protractor to execute Windows command in test cases? I am looking for a way to execute Windows commands in protractor test cases, like this: copy D:\xx\xx\xx.js d:\xxxx\xxxx Is it possible to do so? Or is there any other way to do this?
Actually I need to move a file to another location. I have successfully made it by nodeJS function fs.rename() like the following: var fs = require('fs'); var path = require('path'); var fileName = "coverflow-3.0.1.zip"; var sourceFile = path.join(__dirname, fileName); var destPath = path.join(__dirname, fileName); fs.rename(sourceFile, destPath, function (err) { if (err) throw err; fs.stat(destPath, function (err, stats) { if (err) throw err; console.log('stats: ' + JSON.stringify(stats)); }); });
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "windows, command, protractor, execute" }
Game Theory Question ## | ## | |Adv| ---------|N\A| ## Adv| 300,300 | 900,0 | ## N\A| 0,900 | 700,700 | Player 1= Pepsi Player 2= Coke A) Solve for the pure strategy Nash equilibrium B) Is this game a prisoner's Dilema? C) Is there a cooperative equilibrium? If so, what is it? D) Does coke have a dominant strategy? Does Pepsi? ## My Attempt * * * ## | |Adv| ---------|N\A| ## Adv| (300),(300) | (900),0 | ## N\A| 0,(900) | 700,700 | A) Nash Equilibrium: (Adv, Adv) B) Not sure how to answer this C) Yes. If they both got in contact and made the option to not advertise D) I would appreciate some help!
Here are a couple hints for the two that you haven't answered: The prisoner's dilemma is characterized by the inability to sustain the Pareto optimal payoff as a Nash Equilibrium due to the existence of a profitable deviation for both players. Each player has a dominant strategy to "Defect" and so the unique Nash Equilibrium is one where both players "Defect". Does that hold here? A (possibly mixed) strategy $a$ (weakly) dominates another strategy $b$ for a given player $i$ if player $i$ (weakly) prefers playing $a$ to $b$ for any strategy vector of the other players. In your case, there is just one other player, $j$, and so $i$ simply has to prefer $a$ to $b$ for any strategy played by player $j$. You just need to see if that holds for your two players.
stackexchange-economics
{ "answer_score": 2, "question_score": 0, "tags": "microeconomics, mathematical economics, game theory" }
How to hide a table row that has no unique id How to hide a table row that has no unique id, but row just contains TD with a specific text, note that I cannot adjust the classnames or add ID's there either. Its nested TR. eg. <tbody><tr> <table id="baskettable"><tbody> <tr class="SeparateRow "> <td class="SeparateColumn" colspan="2"> DO not hide this row</td> <td class="SeparateColumn"></td> <td class="SeparateColumn"></td> <td class="Money">100,39 </td> <td></td> </tr> <tr class="SeparateRow "> <td class="SeparateColumn" colspan="2"> yes hide this row</td> <td class="SeparateColumn"></td> <td class="SeparateColumn"></td> <td class="Money">100,39 </td> <td></td> </tr>
$("tr.SeparateRow:contains('something to find')").hide(); working example --> <
stackexchange-stackoverflow
{ "answer_score": 5, "question_score": 0, "tags": "jquery" }
Is there a way to compute $(A\otimes B)x$ quickly without forming the Kronecker product? Is there a way to compute $(A\otimes B)x$ quickly without forming the Kronecker product? Often, I'd like to compute the matrix-vector product of a Kronecker product, but I'm not sure of a good way to efficiently produce the product directly. In case it's any easier, I'm also interested in the computing $(A\otimes A)x$. Thanks for the help!
A basic property of Kronecker products is $$(A\otimes B)\,{\rm vec}(X) = {\rm vec}(BXA^T)$$ where the RHS does not contain any Kronecker products, although it does require a vectorization (and de-vectorization) operation. Similarly $$(A\otimes A)\,{\rm vec}(X) = {\rm vec}(AXA^T)$$
stackexchange-math
{ "answer_score": 5, "question_score": 1, "tags": "linear algebra, matrices, numerical linear algebra, kronecker product" }
How can I make value of a record to be title of field on the mysql? My query like this : SELECT a.number, a.description, b.attribute_code, b.attribute_value FROM items a JOIN attr_maps b ON b.number = a.number WHERE a.number = AB123 If the query executed, the result like this : ![enter image description here]( I want to make the result like this : ![enter image description here]( How can I do it?
You can use conditional aggregation: SELECT i.number, i.description, MAX(CASE WHEN am.attribute_code = 'brand' then am.attribute_value END) as brand, MAX(CASE WHEN am.attribute_code = 'model' then am.attribute_value END) as model, MAX(CASE WHEN am.attribute_code = 'category' then am.attribute_value END) as category, MAX(CASE WHEN am.attribute_code = 'subcategory' then am.attribute_value END) as subcategory FROM items i JOIN attr_maps am ON am.number = i.number WHERE i.number = AB123 GROUP BY i.number, i.description
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "mysql, sql, join" }
Adding an external script to Nuxt I have a script from a third party, that I need implemented on my Nuxt site in the Header. What would be the best way to insert a script such as this? <script id="sleeknoteScript" type="text/javascript"> (function (){ var sleeknoteScriptTag=document.createElement("script"); sleeknoteScriptTag.type="text/javascript"; sleeknoteScriptTag.charset="utf-8"; sleeknoteScriptTag.src=("//sleeknotecustomerscripts.sleeknote.com/00000.js"); var s=document.getElementById("sleeknoteScript"); s.parentNode.insertBefore(sleeknoteScriptTag, s); })(); </script> <!-- End of Sleeknote signup and lead generation tool - www.sleeknote.com --> Usually I would put scripts in Nuxt.config like this. script: [ { src: ' }, ] But this one I don't know.
You can do it in the same way, just place the script into a javascript file and use the path to that file as a script's `src` property value in the `nuxt.config.js`: script: [ { src: '/scripts/myScript.js' }, ] The `myScript.js` would be placed in `static/scripts/myScript.js` in this case
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 0, "tags": "javascript, nuxt.js" }
keep browser at bottom of page when using jquery to show a div Im using this code to show/hide a div: <a href="#" class="show_hide">Show/hide</a> <div class="slidingDiv"> My content...... <a href="#" class="show_hide">hide</a></div> <script src=" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $(".slidingDiv").hide(); $(".show_hide").show(); $('.show_hide').click(function(){ $(".slidingDiv").slideToggle(); }); }); </script> The problem is my div is at the bottom of the page. So when user clicks the link to show the div, the browser goes back to the top of the page and the user then has to scroll down to see the displayed div. What can i do to make to browser stay near bottom of page where the div is now showing?
The following should be what you are looking for: $('.show_hide').click(function(e){ e.preventDefault(); $(".slidingDiv").slideToggle(); return false; });
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "javascript, jquery, html" }
How do I delete local Docker images by repository? I have a bunch of docker images I want to get rid of and it would be convenient if I could remove them by specifying the repository name as it appears when I run `docker images`. For example if `docker images` returns: REPOSITORY TAG IMAGE ID CREATED SIZE ui_test 191127_manual 41a7ca9824d6 24 hours ago 1.42GB ui git-24fa8d1a cdd254eff918 24 hours ago 1.44GB ui git-31a4b052 9b4740060a62 25 hours ago 1.45GB ui_test 191122_manual ba9cb04ce2d8 6 days ago 1.39GB ui git-68110e426 f26ef80abc25 6 days ago 1.38GB what command would I use to remove all of the `ui_test` images?
You can pass image IDs you want to delete to `docker rmi`: docker rmi $(docker images -q 'ui_test') From the docs: > The `docker images` command takes an optional `[REPOSITORY[:TAG]]` argument that restricts the list to images that match the argument. If you specify `REPOSITORYbut` no `TAG`, the `docker images` command lists all images in the given repository.
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 3, "tags": "docker" }
ascii codec error is showing while running python3 code via apche wsgi **Objective** : Insert a Japanese text to a .ini file **Steps:** 1. Python version used 3.6 and used Flask framework 2. The library used for writing config file is Configparser **Issue:** When I try running the code via the "flask run" command, there are no issues. The Japanese text is inserted to ini file correctly But when I try running the same code via apache(wsgi) I am getting the following error 'ascii' codec can't encode characters in position 17-23: ordinal not in range(128)
**Never interact with text files without explicitly specifying the encoding.** Sadly, even Python's official documentation neglects to obey this simple rule. import configparser config_path = 'your_file.ini' config = configparser.ConfigParser() with open(config_path, encoding='utf8') as fp: config.read_file(fp) with open(config_path, 'w', encoding='utf8') as fp: config.write(fp) `utf8` is a reasonable choice for storing Unicode characters, pick a different encoding if you have a preference. Japanese characters consume up to five bytes per character in UTF-8, picking `utf16` (always two bytes per character) can result in smaller `ini` files, but there is no functional difference.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "python 3.x, apache, ascii, wsgi" }
NancyFX and adding another project as reference doesn't work I created a nancyfx iis host solution from the nancyfx templates. I was wanting to put my domain in a separate project but found that adding that project to the nancyfx project resulted in a the yellow exclamation point beside of the reference and at compile time I was getting errors about the reference to the namespace. I likely have overlooked something very simple but I can't figure out why this is happening. (I may be able to compile the domain project and add the dll reference but I prefer to just reference the project.)
This doesn't sound like a Nancy issue - are you sure both projects are targeting the same version of the .net framework?
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 1, "tags": "nancy" }
Facebook connect ifUserConnected() does not work - FB.Connect is undefined error I'm trying to integrate Facebook connect to my website. The login button appears and i'm able to login. The profile picture and the name is displayed properly. However when I try adding the code FB.Connect.ifUserConnected, I get a error message saying FB.Connect is not defined. This is what I'm doing <div id="fb-root"> </div> <script src=" <script type="text/javascript"> FB.init({ appId: 'my app id', status: true, cookie: true, xfbml: true }); </script> <fb:login-button onlogin="fb_login()"></fb:login-button> <script> function fb_login() { $("#SocialConnectButtons").hide(); $("#UserProfile").show(); FB.XFBML.Host.parseDomTree(); } //ALL UNTIL HERE WORKS AS EXPECTED, BUT THE FOLLOWING LINE FAILS FB.Connect.ifUserConnected(fb_login); </script> Thanks for the help
You are using the new Graph API (< The code you wrote will not work. Check the Graph API javascript SDK here: < and for the API itself: <
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "facebook" }
flutter add controller to an inputfield i have a inputfield in a a widget to get the user email, i need to add a controller to this, but if i add the controller: line then i get an error: child: new Column( children: <Widget>[ new InputField( ****controller: emailController,****** hintText: email, obscureText: false, textInputType: TextInputType.text, textStyle: loginFormTextStyle, textFieldColor: textFieldColor, icon: Icons.mail_outline, iconColor: Colors.blue, bottomMargin: 20.0, validateFunction: validations.validateEmail, onSaved: (String email) { user.email = email; }), how i can add the controller to this input without change the inputfield to a inputtextfield? thanks
There is no such kind of widget named InputField(). If you are expecting to take the user input's such as Username, password, mobile number etc. You need to use TextFormField, then you can get the controller parameter for your inputs. Check the below link < It is having the explanation of how to deal with input validation. Please let me know, once you try this! Happy coding
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "android, flutter, dart" }
usage of the words "unknown if not unknowable" Could you please explain the meaning of the words "unknown if not unknowable". I read online and found this sentence: > While proving to be a useful framework for rationalising illusions of brightness and the like, a problem with this framework is that the visual experience of individuals (with regard to surface reflectance and illumination) and that of their evolutionary ancestors is **unknown if not unknowable**.
It means what what they are trying to understand may be unknowable. There may be something that makes that information essentially unavailable. Even if the information could possibly become known, it is unknown at present.
stackexchange-ell
{ "answer_score": 1, "question_score": 0, "tags": "phrase meaning" }
404 page needs meta description (just to make Google happier)? I'm fixing some minor things on the 404 page for all my websites. My punctiliousness makes me unable to sleep well unless I get an answer to this question. :) **Does a 404 page need a meta description tag?** If yes filled with what, "page not found"? I would say no, if Google really cares more about contents and user frienly site rather than about what is on the page (moreover the 404 page snippet should never show up in Google cause server is sending real 404 code). But after reading all this stuff: * * < on how they suggest to fill up a 404 page (that I always thought should just be a simple 404 page) **I started to feel worried about meta description too**.
The most important thing for your 404 pages is the header's status code: it must be `404 not found`. It's maybe stupid to say that, but in dynamics applications, with an URI like this ` when `id=4` return nothing, many web developers returns a 404 message with a `200 OK` status code... An other thing: for example, if someone try ` whereas `id` only accept integer, it's not a `404`, but a `400 Bad Request` that you must return. It's easy to handle this, for example, with the header function in PHP or the HttpWebResponse.StatusCode Property in .Net
stackexchange-webmasters
{ "answer_score": 20, "question_score": 15, "tags": "seo, google, 404, meta description" }
Icon Background on IE6 I'm developing a website (using asp.net by the way) and I'm having a problem with IE6. When I use some icons near links, using background-image and padding-left on the links, the icons display nice on FF and Chrome but in IE6 they take a kind of "gray" background, and sometimes the flash strangely. Any ideas? is there some CSS hack to solve this? Thanks everyone!
Are they .png files? IE6 has issues with alpha transparency in .pngs. There is a javascript fix though. Edit, to clarify - If IE6 sees a .png with alpha transparency (which is different than the transparency in .gifs) it freaks out and renders that part the light gray I believe you are seeing. The javascript fix applies a filter to all the .pngs in the page. However, this does not work on .pngs that have been set as backgrounds via css.
stackexchange-stackoverflow
{ "answer_score": 8, "question_score": 3, "tags": "internet explorer 6, png, transparency" }
When to use explicit string or from a constant string In terms of strings I understand the need to have strings am going to reuse overname wrapped away somewhere in an XML file or configuration section for strings such as Company Name. The problem am having with this is where to draw the line on using configuratioh or locally expressed strings? What decides whether to have the string content wrapped away in a configuration file or to just have the string assigned there and then in a method? Where am corporate branding a site then yes any corporate aspect strings I will put in a configuration file. Other aspects such as file locations etc will also go in a configuration file. However, I have found myself discussing with others when I do this as oppose to having an explicit string defined within a method. Do you have certain criteria that define when to use strings from a configuration section as opposed to being explicitly defined in a method?
Use configuration when you need to be able to change functionality without redeploying/recompiling. If your string is reused within your application but the functionality involved is not something you want to be configurable, use a constant.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 2, "tags": "string, constants, configuration files" }
Internal link to a hyperlink heading In a document, I'd like to create an internal link. That works as expected on regular links. But when the heading is itself a hyperlink, that doesn't work. How _ought_ one accomplish this? Trying to link to [[Heading1]] and [[???]] * Heading1 These are some contents. * [[ These are some more contents.
Go to the second heading and do `C-c l` to store the link (assuming you have set up the key binding as suggested in the manual: if not, just say `M-x org-store-link RET`). Then go to the place where you want to insert the link and do `C-c C-l` (or `M-x org-insert-link RET`). Now try your new link: it worked fine for me. For the record, this is what the working result looks like: Trying to link to [[Heading1]] and [[*\[\[ * Heading1 These are some contents. * [[ These are some more contents.
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 2, "tags": "hyperlink, org mode, heading" }
using Linux instead of UNIX to compile c code for CS course A CS course I'm taking online suggests students compile their source code and run tools like valgrind on the OS UNIX. I'm completely new to UNIX, Linux, their tools, and coding in c. I've made some attempts at installing FreeBSD 8.1 on VMWare Player 3.1.3, and even managed to get VMWare Tools running. But the FreeBSD documentation has led me down many dead-ends in accomplishing common tasks i.e. mounting an NFS or USB device. It turns out that the packages I need to make this happen aren't installed or configured, and I don't see any straight answer on how to install them. So, if I'm using UNIX only as a tool to run gcc, g++, valgrind for this CS course, and these can be run on Linux instead, it seems like I can get the job done faster using Ubuntu Linux. Can Linux be used to compile and run c code identically on UNIX, if compiled on Linux? Or if not, what are the differences to look for? Thanks
For the novice-level C programmer such as OP, the difference of environment is negligible. Go ahead with Linux.
stackexchange-stackoverflow
{ "answer_score": 6, "question_score": 1, "tags": "c, linux, unix, gnu" }
Is protractor Angular's new scenario runner? I heard recently that, Angular is switching to Protractor as the new end to end testing tool, is my understanding correct? I cloned and looked at the sample. I am able to run jasmine-node to see all the tests run fine. I am able to follow the example code, but just curious, Is there any write up available on this? I did not find any good documentation on it. Thanks
In the AngularJS 1.2 and Beyond meetup last night they talked about Protractor and said that they are migrating all of their end to end tests to Protractor. It sounded like this is in the early stages but is the direction they are going. The slides are at: < and I assume the video will be available in a couple of days. Here's the link to the meetup: < btw, there was a ton of really interesting info in the meetup -- well worth the watch.
stackexchange-stackoverflow
{ "answer_score": 19, "question_score": 12, "tags": "angularjs, protractor" }
ParseInt() doesn't return ending zero I'm in a React project and I'm trying to convert a string to an Integer. pageSize: '30' But when I convert it with var convertNumber = parseInt(...this.props.actionData.pageSize, 10) The console log give me: 3 0 There's whitespace inside the number. How do I remove the space or solve the problem? Thanks
If pageSize is the string `"30"`, the action of `...` will be to split it to it's chars, so you actually get `["3", "0"]`. If you will run parseInt on each of these, you will get `3 0`. Why do you spread the string to it's chars instead of just use `parseInt` on that string?
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "javascript, string, reactjs, redux, parseint" }
Suppress `set -v` / `set -x` logging only for a single line in bash I'm writing a .sh script like the following: echo script started ./some_command > output_file echo script ended I'd like the output to be the following: script started ./some_command > output_file script ended I've tried `set -v`, `set +v` but it didn't work properly, is there anything similar to `@echo` in batch? Thanks
This does what you'd like : #!/bin/bash echo "script started" echo "./some_command > output_file" ./some_command > output_file echo "script ended"
stackexchange-stackoverflow
{ "answer_score": -3, "question_score": 4, "tags": "bash, echo" }
Is it bad to edit cron file manually? It is usually instructed to introduce new cron jobs through command lines; but I found it easier (with a better control of current cron tasks) to manually edit (in text editor) the user cron file like `/var/spool/cron/crontabs/root`. Is it dangerous to edit the file in text editor? The comments in the default file is confusing. The first line says # DO NOT EDIT THIS FILE - edit the master and reinstall. But the fourth line says # Edit this file to introduce tasks to be run by cron.
If you modify the user file under crontabs, it should work. However, there are two issues to take into consideration: 1. If you mistyped the cron entry in the file, you will not be warned as opposed to using `crontab -e` command. 2. You can not edit your user file under crontabs directly without login as root or using sudo. You will get permission denied error. **Edit** One more point to add. When you edit the file directly, you may be warned by the text editor if you opened the file twice (two users accessing the same file). However, the cron list will be overwritten when using `crontab -e` from two different shell sessions of the same user. This is another difference.
stackexchange-serverfault
{ "answer_score": 22, "question_score": 13, "tags": "linux, cron, scheduled task" }
How to detect when a day in a jsp Calendar is clicked (selected) and do some action? I was searching for a way to update some variable in the Stripes Action (say it selectedDate) when a user clicks a specific date(lets say 11/15/2011) I wanted selectedDate to be updated (may be by binding the field with the selected day) and the page to be refreshed or displayed again. I might consider using ajax (instead of refreshing the page) for this purpose in the future. If possible, I would like to create a method (that may return a Resoulution) in the ActionBean to display the page again. FYI: I couldn't decide between `<calendar:calendars>` and `<tags:calendarWidget>`. I will consider the simplest one for now. Give me your recommendation.
If your _selectedDate_ field is on an non Ajax HTML form, then the Stripes Action is only executed when you submit/post the form to the server. If you want this form submit to happen automatically when the _selectedDate_ field is changed, you need to add some Javascript code to your page. For example: <stripes:text name="selectedDate" onchange="this.form.submit()"/> In case you use JQuery you might want to checkout: How to convert onchange="this.form.submit()" to jquery
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 1, "tags": "java, javascript, jsp, calendar, stripes" }
Inkscape - how to draw a line with an arrow (as marker) in the middle with correct orientation I would like to draw a light ray which makes an angle with the horizontal axis in Inkscape. Using the freehand drawing, I drew the line horizontally first (placing a node in the middle for the arrow) and then rotated the whole thing to the desired angle. However, I failed to rotate the marker arrow correctly (as seen in the figure below). I want it to have the same orientation as the line itself. How can I do that? As a note: I'm sure that the line and the arrow are grouped together. ![enter image description here](
Draw a separate triangle or arrowhead on a plain line, make a group, rotate to the wanted direction. If needed, you can allways ungroup and even without ungrouping you can select the parts separately in the layers panel for ex. to stretch the line. ![enter image description here](
stackexchange-graphicdesign
{ "answer_score": 1, "question_score": 2, "tags": "vector, inkscape, arrow" }
How can I tell if this iPhone supports Game Center challenges? Game Center challenges were only made available in iOS 6, but Game Center itself was available much earlier (iOS 5?). If I want to show a Challenges button in my game, it needs to be hidden when played on older devices. Is it ok to just test the version string to be > 6, or is there a more reliable way?
Simply testing for the existence of `GKChallenge` worked for me: bool gameCenterAreChallengesAvailable() { return NSClassFromString(@"GKChallenge"); }
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 1, "tags": "ios, game center" }
Multiple category join I need to find all the businesses by category and by city I have 3 tables: **1\. Business:** !business table **2\. Category:** !category table **3.Business_con_Category:** !Business_con_Category table I get variables category and city form url: ` How can I find all the businesses by 2 variables ? Do I need to use Join ? thanks you.
You may try: SELECT * FROM Business b INNER JOIN Business_con_Category bc ON b.ID=bc.Business_ID WHERE bc.Category_ID=4 AND b.city=4;
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 2, "tags": "php, mysql" }
Setting multiple objects I am struggling to find a shorthand version of the code shown below. Basically I am saving Events into core data. Each event has up to 15 contacts. newEvent is from an Event class. The code below works great, but I don't want to have it duplicated 15 times for each contact. Is there an easier way? if ([[selectedContacts objectAtIndex:14] objectAtIndex:0] != (id)[NSNull null]) { newEvent.contact15 = [[selectedContacts objectAtIndex:14] objectAtIndex:0]; } else { newEvent.contact15 = @""; }
You can use this code -(void) Solve{ for (int i = 0 ; i < 15 ; i++){ Contact *con = [newEvent.contacts objectAtIndex:14 - i]; if ([[selectedContacts objectAtIndex:14 - i] objectAtIndex:0] != (id)[NSNull null]) { con = [[selectedContacts objectAtIndex:14 - i] objectAtIndex:0]; } else { con = @""; } } } just you should define `contact` in your `newEvent` class as `Array`
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 1, "tags": "iphone, objective c" }
Why there is very large difference between cross validation scores? I have a very simple regression model and I am doing the cross validation. When cv=10 the highest score i got is 60.3 and lowest is -9.7 which is useless. Average will be 30. No of row data set= 658 ![enter image description here](
Your $R^2$ scores indicate that a linear model does not describe your data well. On top of this, there seems to be a large variability in data. You could try the following: * If the linear model is supposed to describe the data, check for outliers. They might be responsible for the large variation across the CV folds. * Try reducing the number of features if there are many. The model might be fitting noise. * Introducing regularization (lasso or ridge regression) might make the model more robust. This should decrease the variability of the CV errors, but the $R^2$ scores will get even worse.
stackexchange-datascience
{ "answer_score": 2, "question_score": 1, "tags": "machine learning, regression, data, cross validation, score" }
AJAX: добиться эффекта require из PHP Как добиться эффекта, аналогичному require `content.php`; с помощью AJAX? Данная задача актуальна, например, при создании вкладок. В `content.php` находится, большей частью, html-код, ну может быть с небольшим добавлением php-кода. Конечно, можно весь HTML-код запихнуть в `echo` (во всех примерах AJAX, что я видел, так и делалось), но тогда теряется подцветка HTML-синтаксиса, что недопустимо.
Нашел решение. Метод `load()` библиотеки `jQuery` (а без неё использование AJAX довольно громоздкое) позволяет загрузить содержимое файла внутрь указанного тэга. $('#container').load('content/content.php'); Подробнее можно почитать здесь.
stackexchange-ru_stackoverflow
{ "answer_score": 0, "question_score": -2, "tags": "php, ajax" }
Merge Rows within Data Frame [some fields duplicate] I have 3 columns. name, review, part in a data.frame (set) name review part 1 abc this is good cap 2 abc this is not bad cap 3 abc this is also good cap I want the end result to look like this: name review part 1 abc this is good this cap is not bad this is also good
Assuming your columns are of class `character`, you could do something like this: df[sapply(df, duplicated)] <- "" > df # name review part #1 abc this is good cap #2 this is not bad #3 this is also good
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "r" }
Is it possible to 'Attach' a view to another and point at it, e.g. help guides Title mostly explains it all, i'm trying too google my way here but unsure what to search for, I want to for instance, attach an arrow pointing at a particular view at runtime? Should i perhaps find the x/y coords of the desired view and then find the middle of each view and position as required? a somewhat similar effect can be found here, < unfortunately i find it to look absolutely hideous and not work as well as i'd like!
Found exactly what i was looking for.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "android" }
Create slugs programmatically I'm updating programmatically posts in a WP 3.01 install, using custom made tools. Sometimes I do change programmatically `post_status` from DRAFT to PUBLISHED using custom `SELECT` queries, however this seems spoiling posts permalinks. When in a DRAFT state, posts have the following link structure Could there be some "trick" to force a change in the link structure, generating the proper permalink?
You need to programmatically set the slug as you do so. An SQL trigger could do the trick. Don't forget to mind duplicate slugs as you write it. Else, instead of publishing using the database, write a php script that calls the WP API.
stackexchange-wordpress
{ "answer_score": 3, "question_score": 2, "tags": "permalinks, draft" }