qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
35,296,213
in Windows 10 app I try to read string from .txt file and set the text to RichEditBox: Code variant 1: ``` var read = await FileIO.ReadTextAsync(file, Windows.Storage.Streams.UnicodeEncoding.Utf8); txt.Document.SetText(Windows.UI.Text.TextSetOptions.None, read); ``` Code variant 2: ``` var stream = await file.Open...
2016/02/09
[ "https://Stackoverflow.com/questions/35296213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5235485/" ]
Solution: 1) I made a port of Mozilla Universal Charset Detector to UWP (added to [Nuget](https://www.nuget.org/packages/UDE.CSharp.UWP/)) ``` ICharsetDetector cdet = new CharsetDetector(); cdet.Feed(fileContent, 0, fileContent.Length); cdet.DataEnd(); ``` 2) Nuget library [Portable.Text.Encoding](https://www.nuget...
``` StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/FontFiles/" + fileName)); using (var inputStream = await file.OpenReadAsync()) using (var classicStream = inputStream.AsStreamForRead()) using (var streamReader = new StreamReader(classicSt...
2,508,327
**Introduction** We have an OpenID Provider which we created using the DotNetOpenAuth component. Everything works great when we run the provider on a single node, but when we move the provider to a load balanced cluster where multiple servers are handling requests for each session we get issue with the message signing...
2010/03/24
[ "https://Stackoverflow.com/questions/2508327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/295648/" ]
You must implement `IProviderApplicationStore` and pass an instance of this object to the `OpenIdProvider` instance you create, or set the store type in your web.config file. Your implementation of this interface must provide the access to a database that all servers in your web farm share.
When you create your OpenIdRelyingParty make sure you pass null in the constructor. This puts your web site into OpenID stateless or 'dumb' mode. It's slightly slower for users to log in (if you even notice) but you avoid having to write an IRelyingPartyApplicationStore to allow DotNetOpenAuth to work across your farm...
3,466,405
> > **Theorem.** If $x$ is a cycle of odd length then $x^2$ is also a cycle. > > > *This is the main idea behind the proof.* When you look at $(a\_1a\_2a\_3...a\_n)(a\_1a\_2a\_3...a\_n)$, you can see that $a\_1$ goes to $a\_3$, $a\_3$ to $a\_5$, etc... continuing to skip every other element, and because there's ...
2019/12/07
[ "https://math.stackexchange.com/questions/3466405", "https://math.stackexchange.com", "https://math.stackexchange.com/users/261956/" ]
Here's the most elementary way I can think of doing this. If the cycle $x$ has order $n$, then we may think of $x$ as the operation $k\mapsto k+1$ on $\mathbb Z/n\mathbb Z$ (we are considering a faithful, transitive action of the subgroup $\langle x\rangle \subset S\_m$, modelled as $\mathbb Z/n\mathbb Z$ acting on i...
Let $x$ be a cycle of odd length; say it is an element of $S\_N$ for some $N$, and let $X$ be the support of $x$; that is, $$ X = \mathrm{supp}(x) = \{i\mid 1\leq i\leq N\text{ and }x(i)\neq i\}$$ the elements of $\{1,\ldots,N\}$ that are "moved" by $x$. Let $G=\langle x\rangle$. Then $G$ is a group of order the leng...
133,165
In a cross-genre game, is there a spell/power that a mage can use to heal a vampire? I’ve looked through the mage spells in Death and Life but neither show how a vampire can be healed.
2018/10/08
[ "https://rpg.stackexchange.com/questions/133165", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/38724/" ]
**Temporal Summoning** At the page 190 of Mage the Awakened's second edition there is a spell called Temporal Summoning. The spell description reads > > Return the subject to an younger version of itself. Buildings can be restored and injuries healed. Once the spell ends any changed made revert back to normal. Any ...
Apart from the two rotes above you always have Creative Taumaturgy ------------------- > > Within the bounds of their power, mages can conjure nearly any effect they can imagine. (MtA2 p125) > > > The practice for healing is **Perfecting** > > Perfecting spells are the opposite of Fraying spells in many > way...
22,708,819
On <http://internet.org> there is an image of a world map showing internet access across the world. I like this image and want to get it. I cannot use take a screenshot because there is text in the way. I can't find any tags. How do I obtain the image?
2014/03/28
[ "https://Stackoverflow.com/questions/22708819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3324865/" ]
If you have developer tools on your browser, you can right click and then `inspect element`. It will come up with something like this (assuming you're using chrome). ![enter image description here](https://i.stack.imgur.com/WtMqY.png) Here is Firefox's dev tools: ![enter image description here](https://i.stack.imgu...
Maybe it's called in the CSS as a `background-image:url('?');` ? So look for `background-image` in the site's CSS.
50,494,714
Below is a code to merge multiple workbooks into a single workbook. However, the files that are being extracted from the local folder comes up incomplete once the process is done. My guess is the workbooks/files in that local folder far exceeds the range that's in the code. How do I extend the range, preferably "unlim...
2018/05/23
[ "https://Stackoverflow.com/questions/50494714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7704959/" ]
Mixing the code for your gradle plugin with the project code the plugin is supposed to help build is probably a bad idea. You should check out the gradle documentation on [organizing your build logic](https://docs.gradle.org/current/userguide/organizing_build_logic.html) and specifically I would have probably started...
It is an old question , but for the new visitors: you can build the plugin code while you build the code. there can be even a parent project that build all the plugins. please check [this answer](https://stackoverflow.com/questions/35302414/adding-local-plugin-to-a-gradle-project)
6,335,335
I currently have the following MySQL query, which executes fine without any errors: ``` SELECT topic_id, topic_title, topic_author, topic_type FROM forum_topics WHERE ( ( ( forum_id = '2' ) OR ( forum_id != '4' AND topic_type = 2 ) ) AND deleted = 0 ) ORDER...
2011/06/13
[ "https://Stackoverflow.com/questions/6335335", "https://Stackoverflow.com", "https://Stackoverflow.com/users/717768/" ]
To make it simpler for yourself, put the consistent part of your query (deleted=0) first: ``` SELECT topic_id, topic_title, topic_author, topic_type FROM forum_topics WHERE deleted = 0 AND ( ( forum_id = '2' ) OR ( forum_id != '4' ...
Try this: ``` SELECT topic_id, topic_title, topic_author, topic_type FROM forum_topics WHERE forum_id = 2 OR (forum_id != 4 AND topic_type = 2) AND deleted = 0 ORDER BY topic_id DESC ```
6,335,335
I currently have the following MySQL query, which executes fine without any errors: ``` SELECT topic_id, topic_title, topic_author, topic_type FROM forum_topics WHERE ( ( ( forum_id = '2' ) OR ( forum_id != '4' AND topic_type = 2 ) ) AND deleted = 0 ) ORDER...
2011/06/13
[ "https://Stackoverflow.com/questions/6335335", "https://Stackoverflow.com", "https://Stackoverflow.com/users/717768/" ]
I think your where clause would be something like this: ``` WHERE ( (forum_id = '2' AND deleted = 0) OR (forum_id != '4' AND topic_type = '2' AND deleted = 0) ) ```
To make it simpler for yourself, put the consistent part of your query (deleted=0) first: ``` SELECT topic_id, topic_title, topic_author, topic_type FROM forum_topics WHERE deleted = 0 AND ( ( forum_id = '2' ) OR ( forum_id != '4' ...
6,335,335
I currently have the following MySQL query, which executes fine without any errors: ``` SELECT topic_id, topic_title, topic_author, topic_type FROM forum_topics WHERE ( ( ( forum_id = '2' ) OR ( forum_id != '4' AND topic_type = 2 ) ) AND deleted = 0 ) ORDER...
2011/06/13
[ "https://Stackoverflow.com/questions/6335335", "https://Stackoverflow.com", "https://Stackoverflow.com/users/717768/" ]
I think your where clause would be something like this: ``` WHERE ( (forum_id = '2' AND deleted = 0) OR (forum_id != '4' AND topic_type = '2' AND deleted = 0) ) ```
Try this: ``` SELECT topic_id, topic_title, topic_author, topic_type FROM forum_topics WHERE forum_id = 2 OR (forum_id != 4 AND topic_type = 2) AND deleted = 0 ORDER BY topic_id DESC ```
3,087,992
How do you find the number of floors,in a tetraphobic numbering system like 1,2,3,5,6,7,..,12,13,15..,39,50. I am trying to find the pattern and the mathematical algorithm to solve for floor numbered n. for eg n = 3 : ans = 3 n = 8 : ans = 7 n = 22 : ans = 20 Note: This is not a HW problem , I read about it and tri...
2019/01/26
[ "https://math.stackexchange.com/questions/3087992", "https://math.stackexchange.com", "https://math.stackexchange.com/users/589436/" ]
Let $\pi$ be a uniformizer of $A$. Suppose $\phi(X\_{i}) = u/\pi^{m}$ for some $u \in A^{\times}$ and $m \ge 0$. Then $\pi^{m}X\_{i}-u$ is a unit of $A[[X\_{1},\dotsc,X\_{n}]]$ that gets mapped to $0$ in $K$, contradiction.
This is true. More generally, for any finite extension $K^\prime$ of $K$, any $A$-algebra map $A[[X\_1,\ldots,X\_n]]\to K^\prime$ has image in the valuation ring $A^\prime$ of $K^\prime$, and the induced map $A[[X\_1,\ldots,X\_n]]\to A^\prime$ is local (i.e., the $X\_i$ are sent to elements of the maximal ideal of $A^\...
68,515,268
I'm currently building a recommender system using Goodreads data. I want to change string user ids into integers. Current user ids are like this: `'0d688fe079530ee1fe6fa85eab10ec5c'` I want to change it into integers(e.g. `1`, `2`, `3`, ...), to have the same integer ids which share the same string ids. I've consider...
2021/07/25
[ "https://Stackoverflow.com/questions/68515268", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16473029/" ]
Use `pd.factorize` as suggested by @AsishM. Input data: ``` user_id book_id ratings 0 831a1e2505e44a2f81e670db82c9a3c0 1942 3 1 58d3869488a648aebef32b6c2ec4fb16 3116 5 2 f05ad4c0978c4d0eb3ca41921f7a80af 3558 4 3 511c8f47d75c427eae8bead7ff80307b 24...
The `groupby` option would be [`groupby ngroup`](https://pandas.pydata.org/docs/reference/api/pandas.core.groupby.GroupBy.ngroup.html#pandas-core-groupby-groupby-ngroup): ``` df['uid'] = df.groupby('user_id', sort=False).ngroup() ``` ``` user_id book_id ratings uid 0 831a1e2505e44a2f8...
55,223,983
My application becomes slow because I make too many calls to the API to retrieve information. I would like to create a large object with all the information shared with all the pages and get them from localStorage so that the application is more fluid. I work in Angular 7 with Ionic 4. thank you in advance.
2019/03/18
[ "https://Stackoverflow.com/questions/55223983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11208846/" ]
use **`@media`** rule to specify any style change for mobile windows or larger windows,here the **`max-width`** property is specifies the maximum width of your mobile window.use overflow-y to provide scroll across y-axis ``` @media screen and (max-width: 480px) { body{ overflow-y : scroll; } }...
Use media queries, specify on what size you want it to be scrollable and thats it!! You can get some help to use media queries from here: <https://www.w3schools.com/css/css3_mediaqueries_ex.asp>
48,864,639
I would like to merge date & time. I have used 'CONCAT' function & also '||' function. But both of functions taking more times and very slow for query. Can somebody tell me how i can reduce the query time? & What function can be used to merge the date & time? Thanks for any help. ``` where CONCAT (TO_CHAR (Date,...
2018/02/19
[ "https://Stackoverflow.com/questions/48864639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8422152/" ]
You do not need to convert your date to a string - just convert your static values to a date: ``` WHERE "Date" BETWEEN TO_DATE( '20180215130528', 'YYYYMMDDHH24MISS' ) AND TO_DATE( '20180215133003', 'YYYYMMDDHH24MISS' ) ``` If you want to use `CONCAT` then: ``` WHERE "Date" BETWEEN TO_DATE( CONCAT( ...
You want to have an index on Date to speed up the query. And better yet would be to have Date and Time combined into a single field Date, with type Date (and have index on Date). This would give you a simple performant query: ``` WHERE Date between to_date('20180215' || '130528', 'YYYYMMDDHH24MISS') and to_date('2...
13,604,290
I'm just curious as to to how to implement multi-threading without using a Windows API WaitFor\* function that stops the program until the thread has returned. What's the point of using threads if they stop the main application from being resized or moved etc.? Is there any form of windows messaging with threading, wh...
2012/11/28
[ "https://Stackoverflow.com/questions/13604290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1853098/" ]
You can use `MsgWaitForMultipleObjectsEx` to wait for the thread to finish and also process messages at the same time.
Have a look at std::thread, boost::thread, just::thread, for multithreading in general for c++. But about Windows messaging win32 and MFC, the MSDN states **explicitely** that **it is not multithread, it is monothread**. ( Undefined behaviour is to be expected if multithreading is used) For asynchronous message emite...
13,604,290
I'm just curious as to to how to implement multi-threading without using a Windows API WaitFor\* function that stops the program until the thread has returned. What's the point of using threads if they stop the main application from being resized or moved etc.? Is there any form of windows messaging with threading, wh...
2012/11/28
[ "https://Stackoverflow.com/questions/13604290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1853098/" ]
If you want your UI thread to know when a task thread has finished it's task then you could have your task thread post a (custom - WM\_USER and above) message to your main window (along with thread id plus the handle). And the window proc of the main window can know that a particular task thread has finished it's task....
Have a look at std::thread, boost::thread, just::thread, for multithreading in general for c++. But about Windows messaging win32 and MFC, the MSDN states **explicitely** that **it is not multithread, it is monothread**. ( Undefined behaviour is to be expected if multithreading is used) For asynchronous message emite...
13,604,290
I'm just curious as to to how to implement multi-threading without using a Windows API WaitFor\* function that stops the program until the thread has returned. What's the point of using threads if they stop the main application from being resized or moved etc.? Is there any form of windows messaging with threading, wh...
2012/11/28
[ "https://Stackoverflow.com/questions/13604290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1853098/" ]
You can use `MsgWaitForMultipleObjectsEx` to wait for the thread to finish and also process messages at the same time.
[`WaitForSingleObject`](http://msdn.microsoft.com/en-us/library/windows/desktop/ms687032%28v=vs.85%29.aspx) can be non-blocking, just pass zero timeout as second parameter: ``` // Check is thread has been finished if(::WaitForSingleObject(threadHandle, 0) == WAIT_OBJECT_0) { // Process results ... } ``` You wi...
13,604,290
I'm just curious as to to how to implement multi-threading without using a Windows API WaitFor\* function that stops the program until the thread has returned. What's the point of using threads if they stop the main application from being resized or moved etc.? Is there any form of windows messaging with threading, wh...
2012/11/28
[ "https://Stackoverflow.com/questions/13604290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1853098/" ]
If you want your UI thread to know when a task thread has finished it's task then you could have your task thread post a (custom - WM\_USER and above) message to your main window (along with thread id plus the handle). And the window proc of the main window can know that a particular task thread has finished it's task....
[`WaitForSingleObject`](http://msdn.microsoft.com/en-us/library/windows/desktop/ms687032%28v=vs.85%29.aspx) can be non-blocking, just pass zero timeout as second parameter: ``` // Check is thread has been finished if(::WaitForSingleObject(threadHandle, 0) == WAIT_OBJECT_0) { // Process results ... } ``` You wi...
32,075,273
I'm multiplexing 3 IMU-6050 using a MUX4051. This is the original code: ``` #include "Wire.h" const int MPU=0x68; // I2C address of the MPU-6050 int16_t AcX,AcY,AcZ,Tmp,GyX,GyY,GyZ; int Acc_ctrl_1 = 9; int Acc_ctrl_2 = 10; int Acc_ctrl_3 = 11; int chip_enable1 = 5; void setup() { Wire.begin(); //...
2015/08/18
[ "https://Stackoverflow.com/questions/32075273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5221887/" ]
Use the `passenger-status` command. For example, this shows me passenger is running the `production` environment (the first line under the `Application groups` heading): ``` (production-web) ubuntu@ip-10-0-3-146 ~% sudo passenger-status Version : 5.0.15 Dat...
Your environment is found on `Rails.env`. ``` Loading development environment (Rails 4.2.3) 2.1.2 :001 > Rails.env => "development" ``` You can also use the environment in a question format for conditionals: ``` 2.1.2 :002 > Rails.env.production? => false 2.1.2 :003 > Rails.env.pickle? => false 2.1.2 :004 > R...
13,938,930
I have two strings in PHP: ``` $Str1 = "/welcome/files/birthday.php?business_id=0"; $Str2 = "/welcome/index.php?page=birthday"; ``` I have to get word birthday from this two string with a single function. I need a function which returns birthday on both case. example ``` function getBaseWord($word){ ... r...
2012/12/18
[ "https://Stackoverflow.com/questions/13938930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/811621/" ]
So what you will need to do is get all of the actual GET variables extracted from the string: ``` //Seperate the URL and the GET Data list($url,$querystring) = explode('?', $string, 2); //Seperate the Variable name from its value list($GETName, $GETValue) = explode("=", $querystring); //Check to see if we have the r...
I have no idea what you are talking about but, you can cut the word "birthday" with str\_replace and replace with another word, or you can find the position with stripos, I have no idea what we are trying to do here, so those are the only things come to my mind
13,938,930
I have two strings in PHP: ``` $Str1 = "/welcome/files/birthday.php?business_id=0"; $Str2 = "/welcome/index.php?page=birthday"; ``` I have to get word birthday from this two string with a single function. I need a function which returns birthday on both case. example ``` function getBaseWord($word){ ... r...
2012/12/18
[ "https://Stackoverflow.com/questions/13938930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/811621/" ]
If I correctly understand what you are trying to do then this should do what you need: ``` function getWord(){ return $_GET['page']; } ``` or $\_GET['business\_id']; I think $\_GET is an associative array made from the GET request that was sent to the page. An associative array is one where you access somethin...
I have no idea what you are talking about but, you can cut the word "birthday" with str\_replace and replace with another word, or you can find the position with stripos, I have no idea what we are trying to do here, so those are the only things come to my mind
56,206,567
I have a page that is used by Doctors, where they can write the patient email select a bounce of documents, and via "mailto" create a formatted email. This doesn't work on Safari iOS. The problem I found is mailto does not work with Safari iOS if launched from home screen (as a web app). It works using onclick=window....
2019/05/19
[ "https://Stackoverflow.com/questions/56206567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11505368/" ]
There were a few issues with your code: * `a` was never defined. Give your link an ID and select id by using `document.getElementById()` * You cannot set the `href` attribute of the link and "break out" using double quotes in order to add the onclick attribute to the element. Instead: * add the `click` event using `.a...
Try embedding your actionable into a form. Like this: ``` <form action="mailto:me@any.com?subject=Docs&body=Hallo%20you%20and%20links" method="GET"> <button class="noHighlight" type="submit">Write and email</a> </form> ```
56,206,567
I have a page that is used by Doctors, where they can write the patient email select a bounce of documents, and via "mailto" create a formatted email. This doesn't work on Safari iOS. The problem I found is mailto does not work with Safari iOS if launched from home screen (as a web app). It works using onclick=window....
2019/05/19
[ "https://Stackoverflow.com/questions/56206567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11505368/" ]
In your `buildMailto` function, you didn't specify what is `a`. Instead of updating `onclick` attribute value when the anchor link is clicked, you should build a mailto URL and update `window.location.href`. Here is an example: ``` <a href="#" id="email-link" class="noHighlight">Write and email</a> ``` Event listene...
Try embedding your actionable into a form. Like this: ``` <form action="mailto:me@any.com?subject=Docs&body=Hallo%20you%20and%20links" method="GET"> <button class="noHighlight" type="submit">Write and email</a> </form> ```
38,103,295
I have this CSS: ``` div[data-role="page"]{ min-height: 100%; width: 100%; padding: 0px; margin: 0px; border: 0px; background-image:url('../img/blue_background.jpg');} ``` and this is my function: Note: on the variables initialized in the function, the val() is from a selectbox that when changed, is saved in local...
2016/06/29
[ "https://Stackoverflow.com/questions/38103295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6529031/" ]
The first thing that you need to do is georectify your data by your Country. What this does is match your Countries with a coordinate from a database or reference table. You will need a column that has ONE country for each row. You can also have Regions, Cities, Zip Codes, etc. The steps are lengthy to type, but Spotfi...
I was able to use the geocode my data but was still having issues due to my data being a multi-select. To simplify things for me, i made changes to the source (Made a different table, which would clean the data and have a single country in each column, this is then imported into Spotfire) and was able to make it work. ...
33,299
Ok so I want to change operating systems, I got a new PC recently that had no operating system so I installed Ubuntu on it. I now want to install Windows 7 but when I put in the install disk it says it needs my hard drive to be in the NTFS format. How can I change my hard rive to this format in Ubuntu?
2011/04/03
[ "https://askubuntu.com/questions/33299", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
A Kubuntu Mobile technology preview was part of the [10.10 release](http://www.kubuntu.org/news/10.10-release). I don't believe it is being shipped on any real hardware yet, but you can [download it](http://cdimage.ubuntu.com/kubuntu-mobile/releases/10.10/release/) to try out in a virtual machine. Builds for Natty are ...
The answer is no, Ubuntu was not designed for phones. There are some [hacks](http://www.phonesreview.co.uk/2010/03/10/video-htc-touch-pro2-runs-ubuntu/) to make it work on phones, but not in a usable way. PS. Looks like there was a project called [Ubuntu Mobile](http://en.wikipedia.org/wiki/Ubuntu_Mobile), but it's al...
2,897,717
I'd like to use some existing C++ code, [NvTriStrip](http://developer.nvidia.com/object/nvtristrip_library.html), in a Python tool. SWIG easily handles the functions with simple parameters, but the main function, `GenerateStrips`, is much more complicated. What do I need to put in the SWIG interface file to indicate ...
2010/05/24
[ "https://Stackoverflow.com/questions/2897717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/99377/" ]
Have you looked at the documentation of SWIG regarding their "cpointer.i" and "carray.i" libraries? They're found [here](http://www.swig.org/Doc1.3/Library.html#Library_nn4). That's how you have to manipulate things unless you want to create your own utility libraries to accompany the wrapped code. Here's the link to t...
I don't know how to do it with SWIG, but you might want to consider moving to a more modern binding system like [Pyrex](http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/) or [Cython](http://cython.org/). For example, Pyrex gives you access to C++ delete for cases like this. Here's an excerpt from the documenta...
2,897,717
I'd like to use some existing C++ code, [NvTriStrip](http://developer.nvidia.com/object/nvtristrip_library.html), in a Python tool. SWIG easily handles the functions with simple parameters, but the main function, `GenerateStrips`, is much more complicated. What do I need to put in the SWIG interface file to indicate ...
2010/05/24
[ "https://Stackoverflow.com/questions/2897717", "https://Stackoverflow.com", "https://Stackoverflow.com/users/99377/" ]
It's actually so easy to make python bindings for things directly that I don't know why people bother with confusing wrapper stuff like SWIG. Just use [Py\_BuildValue](http://docs.python.org/c-api/arg.html) once per element of the outer array, producing one tuple per row. Store those tuples in a C array. Then Call [Py...
I don't know how to do it with SWIG, but you might want to consider moving to a more modern binding system like [Pyrex](http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/) or [Cython](http://cython.org/). For example, Pyrex gives you access to C++ delete for cases like this. Here's an excerpt from the documenta...
2,010,957
[![Ring](https://i.stack.imgur.com/LIcaV.png)](https://i.stack.imgur.com/LIcaV.png) I think I must first prove that I(A) is a subring and then prove that A is in the ideal I(A) and I(A) is the largest sub-ring containing A. but I have problems to show that I(A) is a subring because let x and y in I(A), so $xa\in A$ an...
2016/11/12
[ "https://math.stackexchange.com/questions/2010957", "https://math.stackexchange.com", "https://math.stackexchange.com/users/386771/" ]
Let $x,y \in I(A)$. Then $xa, ya \in A$ for all $a \in A$. Now $(xy)a = x(ya) = xa'$ for $a' = ya \in A$. Thus $xa' \in A$ and therefore $xy \in I(A)$. That $x+y \in I(A)$ follows from $(x+y)a = xa + xy$ and since $A$ is an ideal. Now since $A$ is a right ideal of $R$ it is also a right ideal in $I(A) \subseteq R$. By ...
Let $R'$ be a subring of $R$ such that $A\subset R'$ is an ideal, take $x\in R'$ then $\forall a\in A$, $xa\in A$ since $A$ is an ideal in $R'$ so $x\in I(A)$. Take $x,y\in I(A)$ then $(x+y)a=xa+ya\in A$ for every $a\in A$, so $x+y\in I(A)$. Similarly $x\cdot y \in I(A)$. Also $0\_R,1\_R\in I(A)$ trivially. It is eas...
11,873,652
I have been tortured by this for quite a while. Because of table sorter pagination will completely remove the invisible rows from the table for faster sorting. I could not get the checkbox in each row to work as my desired. Here is my jsfiddle -> <http://jsfiddle.net/NcqfY/3/> *click the variable trigger to bring ...
2012/08/08
[ "https://Stackoverflow.com/questions/11873652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1413598/" ]
It's a [**positive lookahead**](http://www.regular-expressions.info/lookaround.html). In that particular expression, it is saying that your password must have at least two digits (`\d`). Also note that a lookahead doesn't *consume* input, it is merely an **assertion**. For example, in your regex, the lookahead part ...
It's a lookahead: A zero-width match that checks to see if the position is followed by the given expression. <http://www.regular-expressions.info/lookaround.html> In your scenario, you are looking for a string that: * begins with a string containing two digits (enforced by the lookahead) * begins with 8 word charact...
56,240,613
I want to display "n = (n)" over the whiskers of each of my boxplots. I have figured out how to put these labels over the top of each box (q75) using fivenum, but I can't get them working above the whisker. Above the whiskers is better because my plots are very cluttered. Here I've reproduced the plots using mtcars Ed...
2019/05/21
[ "https://Stackoverflow.com/questions/56240613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10576625/" ]
Here is a ggplot solution with dpylr: ``` ggplot(mtcars, aes(x=cyl, y=mpg, group=cyl)) + geom_boxplot() + geom_text(data=mtcars %>% group_by(cyl) %>% summarise(top = max(mpg), n=n()), aes(x=cyl, y=top, label= paste0("n = ", n)), nudge_y=1) ``` [![enter image description here](https://i.stack.imgur.com/CjwGd.pn...
Edit: see the comment below and my other answer! Okay I figured it out using the format of Alan's answer. It needed boxplot.stats to get the correct whisker calculation: ``` geom_text(data=mtcars %>% group_by(cyl) %>% summarise(n = n(), boxstats = boxplot.stats(mpg)[1], ...
56,240,613
I want to display "n = (n)" over the whiskers of each of my boxplots. I have figured out how to put these labels over the top of each box (q75) using fivenum, but I can't get them working above the whisker. Above the whiskers is better because my plots are very cluttered. Here I've reproduced the plots using mtcars Ed...
2019/05/21
[ "https://Stackoverflow.com/questions/56240613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10576625/" ]
Okay scratch that last attempt. I figured it out. boxplot.stats and geom\_boxplot calculate quartile stats differently, and that skews everything in small sample sizes. We can call the actual stats geom\_boxplot uses with ggplot\_build. This is how it's done, son. First, make your plot, like above, I called it p. Now ...
Here is a ggplot solution with dpylr: ``` ggplot(mtcars, aes(x=cyl, y=mpg, group=cyl)) + geom_boxplot() + geom_text(data=mtcars %>% group_by(cyl) %>% summarise(top = max(mpg), n=n()), aes(x=cyl, y=top, label= paste0("n = ", n)), nudge_y=1) ``` [![enter image description here](https://i.stack.imgur.com/CjwGd.pn...
56,240,613
I want to display "n = (n)" over the whiskers of each of my boxplots. I have figured out how to put these labels over the top of each box (q75) using fivenum, but I can't get them working above the whisker. Above the whiskers is better because my plots are very cluttered. Here I've reproduced the plots using mtcars Ed...
2019/05/21
[ "https://Stackoverflow.com/questions/56240613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10576625/" ]
Okay scratch that last attempt. I figured it out. boxplot.stats and geom\_boxplot calculate quartile stats differently, and that skews everything in small sample sizes. We can call the actual stats geom\_boxplot uses with ggplot\_build. This is how it's done, son. First, make your plot, like above, I called it p. Now ...
Edit: see the comment below and my other answer! Okay I figured it out using the format of Alan's answer. It needed boxplot.stats to get the correct whisker calculation: ``` geom_text(data=mtcars %>% group_by(cyl) %>% summarise(n = n(), boxstats = boxplot.stats(mpg)[1], ...
28,748,242
Dear friends I'reading a csv file that contains some file like this *1.086,12*. Now my problem is that I have to format it a way that allows my to create a BigDecimal, them my correct value should be 1086.12. But I could also have another value 99,11 and in this case I have to get 99.11. I write this snippet of code: ...
2015/02/26
[ "https://Stackoverflow.com/questions/28748242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2069976/" ]
You do not need a regex. You can/should use [DecimalFormat](http://docs.oracle.com/javase/7/docs/api/java/text/DecimalFormat.html) for that: ``` DecimalFormatSymbols dfs = new DecimalFormatSymbols(Locale.GERMAN); DecimalFormat df= new DecimalFormat(); df.setDecimalFormatSymbols(dfs); Double valCEWithUK...
You can use this Java code: ``` String[] arr = {"1.086,12", "99.11"}; for (String tok: arr) { if (tok.matches("[^.]*\\.[^,]+,.*")) tok= tok.replace(".", "").replace(",", "."); System.out.println( tok ); } ``` **output:** ``` 1086.12 99.11 ```
59,616,740
I'm troubleshooting liveness probe failures. I'm able to extract specific entries from k8s event using this approach ``` k get events --sort-by=.metadata.creationTimestamp | grep Liveness ``` I'd like to get only the pod(s) that causing the issue. I'm considering to pipe a cut, but I'm not sure which delimiter sh...
2020/01/06
[ "https://Stackoverflow.com/questions/59616740", "https://Stackoverflow.com", "https://Stackoverflow.com/users/539684/" ]
there is a feature in kubernetes called [jsonpath](https://kubernetes.io/docs/reference/kubectl/jsonpath/) validate if your jsonpath is correct with this online tool: <https://jsonpath.com/> easily go through json keys with this online tool, so you needn't manually type the key names any more): <http://jsonpathfinder...
Jsonpath is a little bit limited to be used with filter and conditions, maybe for your case `jq` will be more suitable. I did a test using `jq` to filter the Output of my probe: I've tested using the yaml from this [link](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-pro...
24,024
I need a little help navigating this ferrite core memory technology. My end goal is to use it in a calculator or something straightforward. I understand the writing process to each core but how is reading accomplished? Do you have to measure the voltage on the sense wire and flip each of the bits while collecting the ...
2022/03/04
[ "https://retrocomputing.stackexchange.com/questions/24024", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/24176/" ]
Reading a bit from core is a destructive process; essentially you try to write a '1' and monitor the sense line to see if there's a current spike when you do that. There's only a current spike if writing the core flipped the bit, i.e. if it was '0' to start with. I believe most core controllers would automatically writ...
CuriousMarc has some really interesting and educational content about core memory (and a lot of other stuff) in YouTube. Watch [Core Memory Explained and Demonstrated](https://youtu.be/AwsInQLmjXc) for details.
24,024
I need a little help navigating this ferrite core memory technology. My end goal is to use it in a calculator or something straightforward. I understand the writing process to each core but how is reading accomplished? Do you have to measure the voltage on the sense wire and flip each of the bits while collecting the ...
2022/03/04
[ "https://retrocomputing.stackexchange.com/questions/24024", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/24176/" ]
> > I understand the writing process to each core but how is reading accomplished? > > > By writing a zero and looking at the sense line: * If that bit was a **zero** nothing happenes * If that bit was a **one** a pulse can be sensed on the sense line. After that the stored content is zero, that's why it's calle...
CuriousMarc has some really interesting and educational content about core memory (and a lot of other stuff) in YouTube. Watch [Core Memory Explained and Demonstrated](https://youtu.be/AwsInQLmjXc) for details.
24,024
I need a little help navigating this ferrite core memory technology. My end goal is to use it in a calculator or something straightforward. I understand the writing process to each core but how is reading accomplished? Do you have to measure the voltage on the sense wire and flip each of the bits while collecting the ...
2022/03/04
[ "https://retrocomputing.stackexchange.com/questions/24024", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/24176/" ]
> > I understand the writing process to each core but how is reading accomplished? > > > By writing a zero and looking at the sense line: * If that bit was a **zero** nothing happenes * If that bit was a **one** a pulse can be sensed on the sense line. After that the stored content is zero, that's why it's calle...
Reading a bit from core is a destructive process; essentially you try to write a '1' and monitor the sense line to see if there's a current spike when you do that. There's only a current spike if writing the core flipped the bit, i.e. if it was '0' to start with. I believe most core controllers would automatically writ...
6,917,188
Trying some basic jQuery and JavaScript here. The `.width()` gives me an integer value. The `.css('min-width')` gives me a value ending in `px`. Therefore I can't do math on this as is. What is the recommended work around? ``` alert($('#<%=lstProcessName.ClientID%>').parent('.column4').width()); alert($('#<%=lstProc...
2011/08/02
[ "https://Stackoverflow.com/questions/6917188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/834505/" ]
Use `replace()`: ``` alert($('#<%=lstProcessName.ClientID%>').parent('.column4').css('min-width').replace('px', '')); ``` Alternatively, you could use the `parseInt` function: ``` alert(parseInt('1px')); //Result: 1 ```
``` alert($('#<%=lstProcessName.ClientID%>').parent('.column4').css('min-width').substring(0,indexOf('px')); ```
6,917,188
Trying some basic jQuery and JavaScript here. The `.width()` gives me an integer value. The `.css('min-width')` gives me a value ending in `px`. Therefore I can't do math on this as is. What is the recommended work around? ``` alert($('#<%=lstProcessName.ClientID%>').parent('.column4').width()); alert($('#<%=lstProc...
2011/08/02
[ "https://Stackoverflow.com/questions/6917188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/834505/" ]
Use `replace()`: ``` alert($('#<%=lstProcessName.ClientID%>').parent('.column4').css('min-width').replace('px', '')); ``` Alternatively, you could use the `parseInt` function: ``` alert(parseInt('1px')); //Result: 1 ```
Use substring to the value returning from the min-width to remove the px
6,917,188
Trying some basic jQuery and JavaScript here. The `.width()` gives me an integer value. The `.css('min-width')` gives me a value ending in `px`. Therefore I can't do math on this as is. What is the recommended work around? ``` alert($('#<%=lstProcessName.ClientID%>').parent('.column4').width()); alert($('#<%=lstProc...
2011/08/02
[ "https://Stackoverflow.com/questions/6917188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/834505/" ]
Some string manipulation to remove 'px' and then use `parseInt` to get it as a number: ``` var minWidth = parseInt($('#<%=lstProcessName.ClientID%>').parent('.column4').css('min-width').replace('px', ''), 10) ```
``` alert($('#<%=lstProcessName.ClientID%>').parent('.column4').css('min-width').substring(0,indexOf('px')); ```
6,917,188
Trying some basic jQuery and JavaScript here. The `.width()` gives me an integer value. The `.css('min-width')` gives me a value ending in `px`. Therefore I can't do math on this as is. What is the recommended work around? ``` alert($('#<%=lstProcessName.ClientID%>').parent('.column4').width()); alert($('#<%=lstProc...
2011/08/02
[ "https://Stackoverflow.com/questions/6917188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/834505/" ]
Use `replace()`: ``` alert($('#<%=lstProcessName.ClientID%>').parent('.column4').css('min-width').replace('px', '')); ``` Alternatively, you could use the `parseInt` function: ``` alert(parseInt('1px')); //Result: 1 ```
If you pass the return value from `.css('min-width')` to `parseInt` first, it will remove the "px" for you. ``` parseInt( $('#<%=lstProcessName.ClientID%>').parent('.column4').css('min-width'), 10 ); ``` (Don't forget the second parameter to `parseInt`.)
6,917,188
Trying some basic jQuery and JavaScript here. The `.width()` gives me an integer value. The `.css('min-width')` gives me a value ending in `px`. Therefore I can't do math on this as is. What is the recommended work around? ``` alert($('#<%=lstProcessName.ClientID%>').parent('.column4').width()); alert($('#<%=lstProc...
2011/08/02
[ "https://Stackoverflow.com/questions/6917188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/834505/" ]
The better way is to use `parseInt`. jQuery functions `.width()` and `.height()` work quite so. Also, it would be good to encapsulate fetching of this values in standalone functions: * `.minHeight()`, `.minHeight( size )`, `.minHeight( function() )` * `.maxHeight()`, `...` * `.minWidth()`, `...` * `.maxWidth()`, `......
Some string manipulation to remove 'px' and then use `parseInt` to get it as a number: ``` var minWidth = parseInt($('#<%=lstProcessName.ClientID%>').parent('.column4').css('min-width').replace('px', ''), 10) ```
6,917,188
Trying some basic jQuery and JavaScript here. The `.width()` gives me an integer value. The `.css('min-width')` gives me a value ending in `px`. Therefore I can't do math on this as is. What is the recommended work around? ``` alert($('#<%=lstProcessName.ClientID%>').parent('.column4').width()); alert($('#<%=lstProc...
2011/08/02
[ "https://Stackoverflow.com/questions/6917188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/834505/" ]
The better way is to use `parseInt`. jQuery functions `.width()` and `.height()` work quite so. Also, it would be good to encapsulate fetching of this values in standalone functions: * `.minHeight()`, `.minHeight( size )`, `.minHeight( function() )` * `.maxHeight()`, `...` * `.minWidth()`, `...` * `.maxWidth()`, `......
``` alert($('#<%=lstProcessName.ClientID%>').parent('.column4').css('min-width').substring(0,indexOf('px')); ```
6,917,188
Trying some basic jQuery and JavaScript here. The `.width()` gives me an integer value. The `.css('min-width')` gives me a value ending in `px`. Therefore I can't do math on this as is. What is the recommended work around? ``` alert($('#<%=lstProcessName.ClientID%>').parent('.column4').width()); alert($('#<%=lstProc...
2011/08/02
[ "https://Stackoverflow.com/questions/6917188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/834505/" ]
Use `replace()`: ``` alert($('#<%=lstProcessName.ClientID%>').parent('.column4').css('min-width').replace('px', '')); ``` Alternatively, you could use the `parseInt` function: ``` alert(parseInt('1px')); //Result: 1 ```
Some string manipulation to remove 'px' and then use `parseInt` to get it as a number: ``` var minWidth = parseInt($('#<%=lstProcessName.ClientID%>').parent('.column4').css('min-width').replace('px', ''), 10) ```
6,917,188
Trying some basic jQuery and JavaScript here. The `.width()` gives me an integer value. The `.css('min-width')` gives me a value ending in `px`. Therefore I can't do math on this as is. What is the recommended work around? ``` alert($('#<%=lstProcessName.ClientID%>').parent('.column4').width()); alert($('#<%=lstProc...
2011/08/02
[ "https://Stackoverflow.com/questions/6917188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/834505/" ]
Use `replace()`: ``` alert($('#<%=lstProcessName.ClientID%>').parent('.column4').css('min-width').replace('px', '')); ``` Alternatively, you could use the `parseInt` function: ``` alert(parseInt('1px')); //Result: 1 ```
The better way is to use `parseInt`. jQuery functions `.width()` and `.height()` work quite so. Also, it would be good to encapsulate fetching of this values in standalone functions: * `.minHeight()`, `.minHeight( size )`, `.minHeight( function() )` * `.maxHeight()`, `...` * `.minWidth()`, `...` * `.maxWidth()`, `......
6,917,188
Trying some basic jQuery and JavaScript here. The `.width()` gives me an integer value. The `.css('min-width')` gives me a value ending in `px`. Therefore I can't do math on this as is. What is the recommended work around? ``` alert($('#<%=lstProcessName.ClientID%>').parent('.column4').width()); alert($('#<%=lstProc...
2011/08/02
[ "https://Stackoverflow.com/questions/6917188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/834505/" ]
The better way is to use `parseInt`. jQuery functions `.width()` and `.height()` work quite so. Also, it would be good to encapsulate fetching of this values in standalone functions: * `.minHeight()`, `.minHeight( size )`, `.minHeight( function() )` * `.maxHeight()`, `...` * `.minWidth()`, `...` * `.maxWidth()`, `......
If you pass the return value from `.css('min-width')` to `parseInt` first, it will remove the "px" for you. ``` parseInt( $('#<%=lstProcessName.ClientID%>').parent('.column4').css('min-width'), 10 ); ``` (Don't forget the second parameter to `parseInt`.)
6,917,188
Trying some basic jQuery and JavaScript here. The `.width()` gives me an integer value. The `.css('min-width')` gives me a value ending in `px`. Therefore I can't do math on this as is. What is the recommended work around? ``` alert($('#<%=lstProcessName.ClientID%>').parent('.column4').width()); alert($('#<%=lstProc...
2011/08/02
[ "https://Stackoverflow.com/questions/6917188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/834505/" ]
The better way is to use `parseInt`. jQuery functions `.width()` and `.height()` work quite so. Also, it would be good to encapsulate fetching of this values in standalone functions: * `.minHeight()`, `.minHeight( size )`, `.minHeight( function() )` * `.maxHeight()`, `...` * `.minWidth()`, `...` * `.maxWidth()`, `......
Use substring to the value returning from the min-width to remove the px
48,809,433
I want to read pfm format images in python. I tried with imageio.read but it is throwing an error. Can I have any suggestion, please? `img = imageio.imread('image.pfm')`
2018/02/15
[ "https://Stackoverflow.com/questions/48809433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8036071/" ]
I am not at all familiar with Python, but here are a few suggestions on reading a `PFM` (**Portable Float Map**) file. --- **Option 1** The **ImageIO** documentation [here](http://imageio.readthedocs.io/en/latest/format_pfm-fi.html#pfm-fi) suggests there is a **FreeImage** reader you can download and use. --- **Op...
``` img = imageio.imread('image.pfm') ``` will just do it. For easy use it can be converted to numpy array. ``` img = numpy.asarray(img) ```
48,809,433
I want to read pfm format images in python. I tried with imageio.read but it is throwing an error. Can I have any suggestion, please? `img = imageio.imread('image.pfm')`
2018/02/15
[ "https://Stackoverflow.com/questions/48809433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8036071/" ]
The following Python 3 implementation will decode .pfm files. Download the example [memorial.pfm](http://www.pauldebevec.com/Research/HDR/memorial.pfm) from [Paul Devebec's page](http://www.pauldebevec.com/Research/HDR/PFM/). ``` from pathlib import Path import numpy as np import struct def read_pfm(filename): w...
I am not at all familiar with Python, but here are a few suggestions on reading a `PFM` (**Portable Float Map**) file. --- **Option 1** The **ImageIO** documentation [here](http://imageio.readthedocs.io/en/latest/format_pfm-fi.html#pfm-fi) suggests there is a **FreeImage** reader you can download and use. --- **Op...
48,809,433
I want to read pfm format images in python. I tried with imageio.read but it is throwing an error. Can I have any suggestion, please? `img = imageio.imread('image.pfm')`
2018/02/15
[ "https://Stackoverflow.com/questions/48809433", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8036071/" ]
The following Python 3 implementation will decode .pfm files. Download the example [memorial.pfm](http://www.pauldebevec.com/Research/HDR/memorial.pfm) from [Paul Devebec's page](http://www.pauldebevec.com/Research/HDR/PFM/). ``` from pathlib import Path import numpy as np import struct def read_pfm(filename): w...
``` img = imageio.imread('image.pfm') ``` will just do it. For easy use it can be converted to numpy array. ``` img = numpy.asarray(img) ```
71,082,202
I have a function in my component inside of `setup()`: ```js export default defineComponent({ setup() { const handleResume = async () => { msg.value = {} try { } catch (err) { } } return { handleResume } } }) ``` Now in my test, I want to create a spy function like this: ```j...
2022/02/11
[ "https://Stackoverflow.com/questions/71082202", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17970696/" ]
This requires Vue [3.2.31](https://github.com/vuejs/core/releases/tag/v3.2.31) (released yesterday), which adds [support for mocking `Proxy` methods](https://github.com/vuejs/core/pull/4216), enabling spies on the [`wrapper.vm` from `@vue/test-utils`](https://vue-test-utils.vuejs.org/api/wrapper/#vm). You can expose m...
you have to switch setup from object to function which return object. So your setup should looks like this: ```js setup() { const handleResume = async () => { msg.value = {} try { } catch (err) { } } return { handleResume } } ``` After this you have two options, you can u...
9,303,386
I was just wondering if it is possible to display a javascript message (either popup or something nice) which is triggered by something which isn't a mouse click, so for example: ``` <?php if(a == b) { Then auto pop up something } ``` I have had a look around and cant seem to find anything, also how do people ma...
2012/02/15
[ "https://Stackoverflow.com/questions/9303386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/404392/" ]
Just add a script block to open an alert or what ever you need to open ``` <?php if(a == b) { ?> <script> alert('hello'); // or window.open("http://wwwstackoverflow.com"); // or any type of script you want to run </script> <?php } ?> ```
For anyone coming here these days: `window.open()` called like that will be blocked by any modern browser. If you're okay with including [a third-party script](https://github.com/colorfulfool/rails-popup), you can do this instead: ``` <?php if(a == b) { ?> <script> Popup("<div>Hello</div>").show('up') </scrip...
152,796
On 12th of February in the later afternoon I would like to travel from Kamjanez-Podilsky to Lwiw as I need to catch a plane in the morning. I would like to go by train, but that's not an option. The arrival time is rather unsafe and I have to change the trains in the middle of the night. <http://ticket.bus.com.ua/ord...
2020/01/25
[ "https://travel.stackexchange.com/questions/152796", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/105125/" ]
There are some results [on Yandex Timetables](https://rasp.yandex.ru/search/?fromId=c23169&fromName=%D0%9A%D0%B0%D0%BC%D0%B5%D0%BD%D0%B5%D1%86-%D0%9F%D0%BE%D0%B4%D0%BE%D0%BB%D1%8C%D1%81%D0%BA%D0%B8%D0%B9&toId=c144&toName=%D0%9B%D1%8C%D0%B2%D0%BE%D0%B2&when=12%20%D1%84%D0%B5%D0%B2%D1%80%D0%B0%D0%BB%D1%8F). Not sure if ...
Apparently, no option seem to completely satisfy your criteria: trains require changing the train in the night, and buses depart in the morning and arrive on lunch time. 1. **Train.** [The timetable](https://www.uz.gov.ua/en/passengers/timetable/?station=22260&by_station=1) of Kamianets-Podilskyi train station shows t...
152,796
On 12th of February in the later afternoon I would like to travel from Kamjanez-Podilsky to Lwiw as I need to catch a plane in the morning. I would like to go by train, but that's not an option. The arrival time is rather unsafe and I have to change the trains in the middle of the night. <http://ticket.bus.com.ua/ord...
2020/01/25
[ "https://travel.stackexchange.com/questions/152796", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/105125/" ]
Here's the solution. I fear I have to confess it's more a question of an [XY-Problem](http://xyproblem.info/). I mainly needed to get to Katwice, but I really wanted to re-visit Lwiw. In the last days of my journey I found a solution and would like to share it with you. You have to understand I needed to be in Katowic...
There are some results [on Yandex Timetables](https://rasp.yandex.ru/search/?fromId=c23169&fromName=%D0%9A%D0%B0%D0%BC%D0%B5%D0%BD%D0%B5%D1%86-%D0%9F%D0%BE%D0%B4%D0%BE%D0%BB%D1%8C%D1%81%D0%BA%D0%B8%D0%B9&toId=c144&toName=%D0%9B%D1%8C%D0%B2%D0%BE%D0%B2&when=12%20%D1%84%D0%B5%D0%B2%D1%80%D0%B0%D0%BB%D1%8F). Not sure if ...
152,796
On 12th of February in the later afternoon I would like to travel from Kamjanez-Podilsky to Lwiw as I need to catch a plane in the morning. I would like to go by train, but that's not an option. The arrival time is rather unsafe and I have to change the trains in the middle of the night. <http://ticket.bus.com.ua/ord...
2020/01/25
[ "https://travel.stackexchange.com/questions/152796", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/105125/" ]
I didn't see any results after 9th Feb, which is 15 days from now, so I went digging into the site's terms and conditions, where I found [this relevant bit](http://ticket.bus.com.ua/rules): > > 3.2.5.4. The extreme date of operations is determined by server of bus terminal (bus station, transporter). Of course it is ...
Apparently, no option seem to completely satisfy your criteria: trains require changing the train in the night, and buses depart in the morning and arrive on lunch time. 1. **Train.** [The timetable](https://www.uz.gov.ua/en/passengers/timetable/?station=22260&by_station=1) of Kamianets-Podilskyi train station shows t...
152,796
On 12th of February in the later afternoon I would like to travel from Kamjanez-Podilsky to Lwiw as I need to catch a plane in the morning. I would like to go by train, but that's not an option. The arrival time is rather unsafe and I have to change the trains in the middle of the night. <http://ticket.bus.com.ua/ord...
2020/01/25
[ "https://travel.stackexchange.com/questions/152796", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/105125/" ]
Here's the solution. I fear I have to confess it's more a question of an [XY-Problem](http://xyproblem.info/). I mainly needed to get to Katwice, but I really wanted to re-visit Lwiw. In the last days of my journey I found a solution and would like to share it with you. You have to understand I needed to be in Katowic...
I didn't see any results after 9th Feb, which is 15 days from now, so I went digging into the site's terms and conditions, where I found [this relevant bit](http://ticket.bus.com.ua/rules): > > 3.2.5.4. The extreme date of operations is determined by server of bus terminal (bus station, transporter). Of course it is ...
152,796
On 12th of February in the later afternoon I would like to travel from Kamjanez-Podilsky to Lwiw as I need to catch a plane in the morning. I would like to go by train, but that's not an option. The arrival time is rather unsafe and I have to change the trains in the middle of the night. <http://ticket.bus.com.ua/ord...
2020/01/25
[ "https://travel.stackexchange.com/questions/152796", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/105125/" ]
Here's the solution. I fear I have to confess it's more a question of an [XY-Problem](http://xyproblem.info/). I mainly needed to get to Katwice, but I really wanted to re-visit Lwiw. In the last days of my journey I found a solution and would like to share it with you. You have to understand I needed to be in Katowic...
Apparently, no option seem to completely satisfy your criteria: trains require changing the train in the night, and buses depart in the morning and arrive on lunch time. 1. **Train.** [The timetable](https://www.uz.gov.ua/en/passengers/timetable/?station=22260&by_station=1) of Kamianets-Podilskyi train station shows t...
218,183
I would like to programatically populate a paragraph field with a default value for one of my content types. I came up with the following solution: ``` use \Drupal\Node\NodeInterface; use \Drupal\paragraphs\Entity\Paragraph; function my_site_node_create(NodeInterface $node) { switch ($node->getType()){ c...
2016/10/19
[ "https://drupal.stackexchange.com/questions/218183", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/68349/" ]
The standard solution is to use the [Services module](https://www.drupal.org/project/services), which provides hooks for you to define your own endpoints. There's also [Restful Web Services](https://www.drupal.org/project/restws) which has similar functionality but is geared more towards entity API integration. If yo...
You can try [services views](https://www.drupal.org/project/services_views), It can be used with views Module. > > Views support for the Services module version 3.x and later. > > > It has currently two features: > - Create view based resource creating Services display in a view > - Execute any view of the system...
59,834,659
I have a list of products with their name and time. I want to create a list that retrieved the most recent date for the kind of product. My initial plan is to create a sublist for each kind of product and the get the most recent of that sublist. I want to know if there is more efficient way of doing it since there coul...
2020/01/21
[ "https://Stackoverflow.com/questions/59834659", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9879869/" ]
Here is an option using `collections.defaultdict`: ```py from collections import defaultdict from pprint import pprint products = [ {'name': 'Veggie', 'time': '2020-01-06T07:53:29Z'}, {'name': 'Veggie', 'time': '2020-02-02T07:12:13Z'}, {'name': 'Fruit', 'time': '2020-01-06T07:53:29Z'}, {'name': 'Fruit...
You can order a list of dictionary by any key you want. In this example, products(or Veggies ) is passed to the built-in ​sorted() function, which accepts a keyword argument key. Itemgetter creates a callable that accepts a single item from the product(or Veggies) array and as input and returns a value that will be use...
59,834,659
I have a list of products with their name and time. I want to create a list that retrieved the most recent date for the kind of product. My initial plan is to create a sublist for each kind of product and the get the most recent of that sublist. I want to know if there is more efficient way of doing it since there coul...
2020/01/21
[ "https://Stackoverflow.com/questions/59834659", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9879869/" ]
Here is an option using `collections.defaultdict`: ```py from collections import defaultdict from pprint import pprint products = [ {'name': 'Veggie', 'time': '2020-01-06T07:53:29Z'}, {'name': 'Veggie', 'time': '2020-02-02T07:12:13Z'}, {'name': 'Fruit', 'time': '2020-01-06T07:53:29Z'}, {'name': 'Fruit...
I think you need to sort your data first then you can do reduce to eliminate duplicate record ```py from functools import reduce from operator import itemgetter products = [{'name': 'Veggie', 'time': '2020-01-06T07:53:29Z'}, {'name': 'Veggie', 'time': '2020-02-02T07:12:13Z'}, {'name': 'Fruit',...
2,530,104
Can someone tell me, what the href with the "#" means? ``` <a id="logoutLink" href="#">Logout</a> ```
2010/03/27
[ "https://Stackoverflow.com/questions/2530104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/198183/" ]
If points to an anchor on the page. In this case the anchor is just default. You could have multiple anchors on the page <a name="anchor1"></a> <a name="anchor2"></a> <a name="anchor3"></a> and link to them as <a href="#anchor1">link 1</a> <a href="#anchor2">link 2</a> <a href="#anchor3">link 3</a>
The hash symbol (i.e., `<a id="logoutLink" href="#">Logout</a>`) is a placeholder, so that you can preview the "Logout" link in a browser as you develop your page. Eventually, the hash symbol will be replaced with a real URL.
2,530,104
Can someone tell me, what the href with the "#" means? ``` <a id="logoutLink" href="#">Logout</a> ```
2010/03/27
[ "https://Stackoverflow.com/questions/2530104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/198183/" ]
It means nothing... ;) Normally we use `#something` to create anchor to some element. If your URL ends with `...#comments` then your browser will automatiacly jump (scroll the page) to element with `id="comments"`. `href="#"` is often used to create a link that leads to nowhere.
If points to an anchor on the page. In this case the anchor is just default. You could have multiple anchors on the page <a name="anchor1"></a> <a name="anchor2"></a> <a name="anchor3"></a> and link to them as <a href="#anchor1">link 1</a> <a href="#anchor2">link 2</a> <a href="#anchor3">link 3</a>
2,530,104
Can someone tell me, what the href with the "#" means? ``` <a id="logoutLink" href="#">Logout</a> ```
2010/03/27
[ "https://Stackoverflow.com/questions/2530104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/198183/" ]
It means nothing... ;) Normally we use `#something` to create anchor to some element. If your URL ends with `...#comments` then your browser will automatiacly jump (scroll the page) to element with `id="comments"`. `href="#"` is often used to create a link that leads to nowhere.
It means make this page an anchor and navigate to it - which is why you see '#' after your URL in the address line (which can have nasty side-effects). Its also why your page will scroll back up to the top if you click on the link (sidenote: you can avoid this by adding "return false;" at the end of your onclick handle...
2,530,104
Can someone tell me, what the href with the "#" means? ``` <a id="logoutLink" href="#">Logout</a> ```
2010/03/27
[ "https://Stackoverflow.com/questions/2530104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/198183/" ]
It is the shortest way to say "go nowhere" :) Often something else is bound to that link, a javascript event handler in most cases. But if an `<a>` doesn't have a `href`, most browsers don't render it with the same styling...so you need a short something to put there. If it had something following the hash, like `<a ...
The hash symbol (i.e., `<a id="logoutLink" href="#">Logout</a>`) is a placeholder, so that you can preview the "Logout" link in a browser as you develop your page. Eventually, the hash symbol will be replaced with a real URL.
2,530,104
Can someone tell me, what the href with the "#" means? ``` <a id="logoutLink" href="#">Logout</a> ```
2010/03/27
[ "https://Stackoverflow.com/questions/2530104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/198183/" ]
As others have pointed out, hash anchors (those beginning with the # sign) typically lead to a named anchor on the page. A table of contents on a page might be a good example of where you'd see this: ``` <ul> <li><a href="#history">Company History</a></li> <li><a href="#goals">Our Goals</a></li> <li><a href="#pr...
It means make this page an anchor and navigate to it - which is why you see '#' after your URL in the address line (which can have nasty side-effects). Its also why your page will scroll back up to the top if you click on the link (sidenote: you can avoid this by adding "return false;" at the end of your onclick handle...
2,530,104
Can someone tell me, what the href with the "#" means? ``` <a id="logoutLink" href="#">Logout</a> ```
2010/03/27
[ "https://Stackoverflow.com/questions/2530104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/198183/" ]
As others have pointed out, hash anchors (those beginning with the # sign) typically lead to a named anchor on the page. A table of contents on a page might be a good example of where you'd see this: ``` <ul> <li><a href="#history">Company History</a></li> <li><a href="#goals">Our Goals</a></li> <li><a href="#pr...
If points to an anchor on the page. In this case the anchor is just default. You could have multiple anchors on the page <a name="anchor1"></a> <a name="anchor2"></a> <a name="anchor3"></a> and link to them as <a href="#anchor1">link 1</a> <a href="#anchor2">link 2</a> <a href="#anchor3">link 3</a>
2,530,104
Can someone tell me, what the href with the "#" means? ``` <a id="logoutLink" href="#">Logout</a> ```
2010/03/27
[ "https://Stackoverflow.com/questions/2530104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/198183/" ]
It means nothing... ;) Normally we use `#something` to create anchor to some element. If your URL ends with `...#comments` then your browser will automatiacly jump (scroll the page) to element with `id="comments"`. `href="#"` is often used to create a link that leads to nowhere.
The hash symbol (i.e., `<a id="logoutLink" href="#">Logout</a>`) is a placeholder, so that you can preview the "Logout" link in a browser as you develop your page. Eventually, the hash symbol will be replaced with a real URL.
2,530,104
Can someone tell me, what the href with the "#" means? ``` <a id="logoutLink" href="#">Logout</a> ```
2010/03/27
[ "https://Stackoverflow.com/questions/2530104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/198183/" ]
It is the shortest way to say "go nowhere" :) Often something else is bound to that link, a javascript event handler in most cases. But if an `<a>` doesn't have a `href`, most browsers don't render it with the same styling...so you need a short something to put there. If it had something following the hash, like `<a ...
If points to an anchor on the page. In this case the anchor is just default. You could have multiple anchors on the page <a name="anchor1"></a> <a name="anchor2"></a> <a name="anchor3"></a> and link to them as <a href="#anchor1">link 1</a> <a href="#anchor2">link 2</a> <a href="#anchor3">link 3</a>
2,530,104
Can someone tell me, what the href with the "#" means? ``` <a id="logoutLink" href="#">Logout</a> ```
2010/03/27
[ "https://Stackoverflow.com/questions/2530104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/198183/" ]
As others have pointed out, hash anchors (those beginning with the # sign) typically lead to a named anchor on the page. A table of contents on a page might be a good example of where you'd see this: ``` <ul> <li><a href="#history">Company History</a></li> <li><a href="#goals">Our Goals</a></li> <li><a href="#pr...
It means nothing... ;) Normally we use `#something` to create anchor to some element. If your URL ends with `...#comments` then your browser will automatiacly jump (scroll the page) to element with `id="comments"`. `href="#"` is often used to create a link that leads to nowhere.
2,530,104
Can someone tell me, what the href with the "#" means? ``` <a id="logoutLink" href="#">Logout</a> ```
2010/03/27
[ "https://Stackoverflow.com/questions/2530104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/198183/" ]
It is the shortest way to say "go nowhere" :) Often something else is bound to that link, a javascript event handler in most cases. But if an `<a>` doesn't have a `href`, most browsers don't render it with the same styling...so you need a short something to put there. If it had something following the hash, like `<a ...
It means nothing... ;) Normally we use `#something` to create anchor to some element. If your URL ends with `...#comments` then your browser will automatiacly jump (scroll the page) to element with `id="comments"`. `href="#"` is often used to create a link that leads to nowhere.
5,193,743
**Prove by induction**.Every **partial order** on a **nonempty finite** set at least one **minimal** element. How can **I** solve that question ?
2011/03/04
[ "https://Stackoverflow.com/questions/5193743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
It is trivially true if there is only one element in the poset. Now suppose it is true for all sets of size < n. Compare the nth element to the minimal element of the (n-1) poset, which we know to exist. It will either be the new minimal or not or incomparable. It doesn't matter either way. (Why?)
If the partial order has size 1, it is obvious. Assume it is true for partial orders `<n`, and then take a partial order `(P,<)` has size `n`. Pick `x` in `P`. Let `P(<x) = { y in P : y<x }` If `P(<x)` is empty, then `x` is a minimal element. Otherwise, `P(<x)` is strictly smaller than `P`, since `x` is not in `P(<...
35,984,783
```js // Code goes here angular .module('imgapp', []) .controller('mainCtrl', mainCtrl); function mainCtrl() { var vm = this; vm.first = { title: 'Image 1', url: 'http://www.image-mapper.com/photos/original/missing.png' } vm.second = { title: 'Image 2', url: 'http://www.keent...
2016/03/14
[ "https://Stackoverflow.com/questions/35984783", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2598876/" ]
[Working demo](http://plnkr.co/edit/byJc95CyVaxNJYOxqblW?p=info) I have just created a directive which will call a function upon image load. ``` .directive('imageonload', function() { return { restrict: 'A', scope: { ngShow : '=' }, link: function(scope, element, attrs) {...
I believe you're looking for ng-cloak directive: <https://docs.angularjs.org/api/ng/directive/ngCloak> So your example can look like this: ``` <body ng-controller="mainCtrl as vm"> <button ng-click="vm.changeObject();">Change object</button> <div ng-cloak> <h1>{{vm.primary.title}}</h1> <img ng-src="{{vm.p...
35,984,783
```js // Code goes here angular .module('imgapp', []) .controller('mainCtrl', mainCtrl); function mainCtrl() { var vm = this; vm.first = { title: 'Image 1', url: 'http://www.image-mapper.com/photos/original/missing.png' } vm.second = { title: 'Image 2', url: 'http://www.keent...
2016/03/14
[ "https://Stackoverflow.com/questions/35984783", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2598876/" ]
[Working demo](http://plnkr.co/edit/byJc95CyVaxNJYOxqblW?p=info) I have just created a directive which will call a function upon image load. ``` .directive('imageonload', function() { return { restrict: 'A', scope: { ngShow : '=' }, link: function(scope, element, attrs) {...
This may help you: ``` var image = imageDomReferenceHere; var downloadingImage = new Image(); downloadingImage.onload = function(){ image.src = this.src; }; downloadingImage.src = "image path here"; ``` <http://blog.teamtreehouse.com/learn-asynchronous-image-loading-javascript>
35,984,783
```js // Code goes here angular .module('imgapp', []) .controller('mainCtrl', mainCtrl); function mainCtrl() { var vm = this; vm.first = { title: 'Image 1', url: 'http://www.image-mapper.com/photos/original/missing.png' } vm.second = { title: 'Image 2', url: 'http://www.keent...
2016/03/14
[ "https://Stackoverflow.com/questions/35984783", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2598876/" ]
[Working demo](http://plnkr.co/edit/byJc95CyVaxNJYOxqblW?p=info) I have just created a directive which will call a function upon image load. ``` .directive('imageonload', function() { return { restrict: 'A', scope: { ngShow : '=' }, link: function(scope, element, attrs) {...
You can do it with two steps. First add **ng-show** to hide or show element when it is loading. Second use **onLoad** event to know when it is done loading. I picked directive from this [answer](https://stackoverflow.com/questions/17884399/image-loaded-event-in-for-ng-src-in-angularjs) **html** ``` vm.notLoading = tr...
43,791,292
So I have two fields in s template page: ``` <?php echo get_post_field('post_content', 12345); ?> <?php the_field('advertisement_one', 12345); ?> ``` The first field renders as: ``` <p> <img src="test.jpg"> </p> ``` The second field renders as: ``` <p> <img src="test2.jpg"> </p> ``` Is there a way that I can ...
2017/05/04
[ "https://Stackoverflow.com/questions/43791292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7082108/" ]
Quoting the [Redux FAQ entry on dispatching multiple actions](http://redux.js.org/docs/faq/Actions.html#actions-multiple-actions): > > There's no specific rule for how you should structure your actions. Using an async middleware like Redux Thunk certainly enables scenarios such as dispatching multiple distinct but re...
I would say your first approach is better and that is the one I use commonly. Yes it may affect readability of your code when you multiple reducers are acting upon same action type but it helps keep code less verbose (which is my major complain with React ecosystem) and a bit of performance. Actions like login would no...
43,791,292
So I have two fields in s template page: ``` <?php echo get_post_field('post_content', 12345); ?> <?php the_field('advertisement_one', 12345); ?> ``` The first field renders as: ``` <p> <img src="test.jpg"> </p> ``` The second field renders as: ``` <p> <img src="test2.jpg"> </p> ``` Is there a way that I can ...
2017/05/04
[ "https://Stackoverflow.com/questions/43791292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7082108/" ]
I would say your first approach is better and that is the one I use commonly. Yes it may affect readability of your code when you multiple reducers are acting upon same action type but it helps keep code less verbose (which is my major complain with React ecosystem) and a bit of performance. Actions like login would no...
Do you really need to store the user icon in Redux? A better approach in this case is to have a selector that returns the icon based on the logged in user. That way you can keep the minimal amount of state in the store. You can use the [Reselect](https://github.com/reactjs/reselect) library to cache selectors.
43,791,292
So I have two fields in s template page: ``` <?php echo get_post_field('post_content', 12345); ?> <?php the_field('advertisement_one', 12345); ?> ``` The first field renders as: ``` <p> <img src="test.jpg"> </p> ``` The second field renders as: ``` <p> <img src="test2.jpg"> </p> ``` Is there a way that I can ...
2017/05/04
[ "https://Stackoverflow.com/questions/43791292", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7082108/" ]
Quoting the [Redux FAQ entry on dispatching multiple actions](http://redux.js.org/docs/faq/Actions.html#actions-multiple-actions): > > There's no specific rule for how you should structure your actions. Using an async middleware like Redux Thunk certainly enables scenarios such as dispatching multiple distinct but re...
Do you really need to store the user icon in Redux? A better approach in this case is to have a selector that returns the icon based on the logged in user. That way you can keep the minimal amount of state in the store. You can use the [Reselect](https://github.com/reactjs/reselect) library to cache selectors.
9,918,005
I'm working on a scavenger hunt app and I'm stuck. So I've set up the CRUD for the hunts and for the tasks associated with hunts. But I don't know how to set it up so that the user can associate a particular task with a particular hunt. I think I've got the models setup correctly, but I'm not really sure how to setup t...
2012/03/29
[ "https://Stackoverflow.com/questions/9918005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1144475/" ]
> > I'm guessing I need write a view that shows a hunt and then lists all the available tasks. Then I need a way to for the user to "pick" a task and add it to a hunt. It's this last part that has me stumped. > > > Above implies that there's a `has_and_belongs_to_many` (`*..*`) relationship between `Hunt` and `Tas...
Your `belongs_to` declaration in the `Task` class should be for `:hunt`, not `:hunts`. As far as the view goes, it's pretty simple. Just use `f.select` (assuming your form helper variable name is `f`) on `:hunt_id`, and update the `hunt_id` attribute inside `Task`. This will associate the `Hunt` with the `Task`. Be ...
9,918,005
I'm working on a scavenger hunt app and I'm stuck. So I've set up the CRUD for the hunts and for the tasks associated with hunts. But I don't know how to set it up so that the user can associate a particular task with a particular hunt. I think I've got the models setup correctly, but I'm not really sure how to setup t...
2012/03/29
[ "https://Stackoverflow.com/questions/9918005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1144475/" ]
Some good sources of information are: 1. [Ruby on Rails Guides: ActionView Helpers](http://guides.rubyonrails.org/form_helpers.html) - gives a good starting point and overview 2. [Blog on dealing with Categories](http://agilewarrior.wordpress.com/2011/10/22/rails-drop-downs/) - discusses using categories derived from ...
Your `belongs_to` declaration in the `Task` class should be for `:hunt`, not `:hunts`. As far as the view goes, it's pretty simple. Just use `f.select` (assuming your form helper variable name is `f`) on `:hunt_id`, and update the `hunt_id` attribute inside `Task`. This will associate the `Hunt` with the `Task`. Be ...
570,738
I created a Nagios check which checks our pacemaker using the `crm_mon` command. The check is configured in the same way on both Nagios server and client's `nrpe.cfg`: The command definition in `nrpe.cfg` looks like that: ``` [root@Nagios_clt plugins]# grep pacemaker /etc/nagios/nrpe.cfg command[check_pacemaker]=/usr...
2014/01/29
[ "https://serverfault.com/questions/570738", "https://serverfault.com", "https://serverfault.com/users/109833/" ]
Your issue is lack of clarity about who's running what with `sudo`. Your plugin calls crm\_mon with `sudo /usr/bin/crm_mon`, but instead of giving the `nagios` user sudo privileges to run the `crm_mon` binary, it only has privileges to run plugins (ie, anything in `/usr/lib64/nagios/plugins/`). **Either** add password...
When troubleshooting a command run as a regular user via nrpe, you can fully imitate the solution, sudo and all, with another user first. Stop testing it as root. You might find there is an issue with the sudoers set up, or there may be file access issues on secondary files such as those under /etc or /var used by the...
34,312,938
### Introduction I need to serialize a java object (`Fahrweg`) that contains nested objects (all implement the interface `FahrwegEreignis`) to json. My code to do this is as follows: ``` Fahrweg fahrweg = new Fahrweg(); ObjectMapper mapper = new ObjectMapper(); mapper.addMixIn(FahrwegEreignis.class, FahrwegEreignis...
2015/12/16
[ "https://Stackoverflow.com/questions/34312938", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2941551/" ]
I managed to solve the problem. By mistake my AndroidManifest.xml file did not include the Service.
In my case the problem was that I declared the Service in the androidTest Manifest file, which isn't working for any reason.
17,692,637
So I have a form, when the form is filled and submit is pressed, I want the form to be "hidden" away and for a few images to appear. However, I am currently stuck on "hiding" away the form because I need the form to appear again after the user presses a back button on the page(not on the browser) and I also need the ...
2013/07/17
[ "https://Stackoverflow.com/questions/17692637", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2527131/" ]
Your issue is just after validating the form values you are returning 'true'. so the form get submitted and page gets refreshed and then again your file comes to the initial state and form get visible
you could use jquery ui tabs <http://jqueryui.com/tabs/> or some kind of pagination like this plugin <http://archive.plugins.jquery.com/project/pagination>
17,692,637
So I have a form, when the form is filled and submit is pressed, I want the form to be "hidden" away and for a few images to appear. However, I am currently stuck on "hiding" away the form because I need the form to appear again after the user presses a back button on the page(not on the browser) and I also need the ...
2013/07/17
[ "https://Stackoverflow.com/questions/17692637", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2527131/" ]
Make sure you have included [jQuery](http://jquery.com/) to your html script as the [$(form).hide()](http://api.jquery.com/hide/) is not a pure js method, Check the working demo [here](http://jsfiddle.net/RBBte/1/). You can hide the form in javascript by ``` document.getElementById("your form id").style.display="none"...
you could use jquery ui tabs <http://jqueryui.com/tabs/> or some kind of pagination like this plugin <http://archive.plugins.jquery.com/project/pagination>
17,692,637
So I have a form, when the form is filled and submit is pressed, I want the form to be "hidden" away and for a few images to appear. However, I am currently stuck on "hiding" away the form because I need the form to appear again after the user presses a back button on the page(not on the browser) and I also need the ...
2013/07/17
[ "https://Stackoverflow.com/questions/17692637", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2527131/" ]
Your issue is just after validating the form values you are returning 'true'. so the form get submitted and page gets refreshed and then again your file comes to the initial state and form get visible
``` <form id="step1"> <p> Creator: <select name="creator" id = "creator"> <option></option> <option name = "abc" value = "nba">nba</option> <option name = "abc" value = "abc"> oiasfn</option> </select...
17,692,637
So I have a form, when the form is filled and submit is pressed, I want the form to be "hidden" away and for a few images to appear. However, I am currently stuck on "hiding" away the form because I need the form to appear again after the user presses a back button on the page(not on the browser) and I also need the ...
2013/07/17
[ "https://Stackoverflow.com/questions/17692637", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2527131/" ]
Make sure you have included [jQuery](http://jquery.com/) to your html script as the [$(form).hide()](http://api.jquery.com/hide/) is not a pure js method, Check the working demo [here](http://jsfiddle.net/RBBte/1/). You can hide the form in javascript by ``` document.getElementById("your form id").style.display="none"...
``` <form id="step1"> <p> Creator: <select name="creator" id = "creator"> <option></option> <option name = "abc" value = "nba">nba</option> <option name = "abc" value = "abc"> oiasfn</option> </select...
17,692,637
So I have a form, when the form is filled and submit is pressed, I want the form to be "hidden" away and for a few images to appear. However, I am currently stuck on "hiding" away the form because I need the form to appear again after the user presses a back button on the page(not on the browser) and I also need the ...
2013/07/17
[ "https://Stackoverflow.com/questions/17692637", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2527131/" ]
Make sure you have included [jQuery](http://jquery.com/) to your html script as the [$(form).hide()](http://api.jquery.com/hide/) is not a pure js method, Check the working demo [here](http://jsfiddle.net/RBBte/1/). You can hide the form in javascript by ``` document.getElementById("your form id").style.display="none"...
Your issue is just after validating the form values you are returning 'true'. so the form get submitted and page gets refreshed and then again your file comes to the initial state and form get visible
139,829
I know this could be a strange question. But was there any algorithm ever found to compute an NP-problem, whether it be hard or complete, in polynomial time. I know this dabbles into the "does P=NP" problem, but I was wondering whether there were any particular instances when people were close to it. I've also heard ab...
2021/05/03
[ "https://cs.stackexchange.com/questions/139829", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/136141/" ]
By definition, if you were to find a polynomial time algorithm for an NP-hard (or NP-complete) problem, then $P=NP$. So, short answer is - no. However, its possible to think instead of solving the problems fully, to [approximate a solution](https://en.wikipedia.org/wiki/Approximation_algorithm), or [to solve them rand...
Strictly speaking, as the other answers explain, no. A polynomial-time algorithm for an NP-hard problem is not known nor expected to exist. But I think your underlying question is whether or not there are examples of natural NP-hard problems that are, in some sense, easier to solve than some other NP-hard problems. Th...
139,829
I know this could be a strange question. But was there any algorithm ever found to compute an NP-problem, whether it be hard or complete, in polynomial time. I know this dabbles into the "does P=NP" problem, but I was wondering whether there were any particular instances when people were close to it. I've also heard ab...
2021/05/03
[ "https://cs.stackexchange.com/questions/139829", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/136141/" ]
By definition, if you were to find a polynomial time algorithm for an NP-hard (or NP-complete) problem, then $P=NP$. So, short answer is - no. However, its possible to think instead of solving the problems fully, to [approximate a solution](https://en.wikipedia.org/wiki/Approximation_algorithm), or [to solve them rand...
The other answers are correct, but f I may add an observation: it seems like you are conflating classes of problems and particular instances. There are a number of instances that can be solved in polynomial time in classes that are NP-hard in general. For instance, Boolean satisfiability is NP-hard in general, since it...
139,829
I know this could be a strange question. But was there any algorithm ever found to compute an NP-problem, whether it be hard or complete, in polynomial time. I know this dabbles into the "does P=NP" problem, but I was wondering whether there were any particular instances when people were close to it. I've also heard ab...
2021/05/03
[ "https://cs.stackexchange.com/questions/139829", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/136141/" ]
If the answer to the first question were to be yes, then $P=NP$, as stated in [nir shahar](https://cs.stackexchange.com/a/139832/61663)'s answer. This has not been done. ### "The easiest NP hard problem" However you next asked if any NP-hard problems have been solved in ***close*** to polynomial time, for which you m...
Strictly speaking, as the other answers explain, no. A polynomial-time algorithm for an NP-hard problem is not known nor expected to exist. But I think your underlying question is whether or not there are examples of natural NP-hard problems that are, in some sense, easier to solve than some other NP-hard problems. Th...
139,829
I know this could be a strange question. But was there any algorithm ever found to compute an NP-problem, whether it be hard or complete, in polynomial time. I know this dabbles into the "does P=NP" problem, but I was wondering whether there were any particular instances when people were close to it. I've also heard ab...
2021/05/03
[ "https://cs.stackexchange.com/questions/139829", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/136141/" ]
If the answer to the first question were to be yes, then $P=NP$, as stated in [nir shahar](https://cs.stackexchange.com/a/139832/61663)'s answer. This has not been done. ### "The easiest NP hard problem" However you next asked if any NP-hard problems have been solved in ***close*** to polynomial time, for which you m...
The other answers are correct, but f I may add an observation: it seems like you are conflating classes of problems and particular instances. There are a number of instances that can be solved in polynomial time in classes that are NP-hard in general. For instance, Boolean satisfiability is NP-hard in general, since it...
2,592,350
This is a sample from my build.xml ``` <mxmlc file="${SRC_DIR}/Main.mxml" output="${DEPLOY_DIR}/@{market}.air" locale="@{locale}" debug="false" optimize="true"> <arg value="+configname=air"/> <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml"/> <library-path dir="${F...
2010/04/07
[ "https://Stackoverflow.com/questions/2592350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63461/" ]
An example of how to do this is here: <http://blog.devsandbox.co.uk/wp-content/uploads/2009/09/example_air_build.xml>
You need to use the AIR compiler (amxmlc) : <http://livedocs.adobe.com/flex/3/html/help.html?content=CommandLineTools_2.html> Not sure if they also have an ANT task for this, but it's worth a try.
4,220,311
There is a ball drawer. Seven color balls will be drawn with the same probability ($1/7$). (black, blue, green, yellow, white, pink, orange) If Anson attempts $9$ times, what is the probability that he gets all $7$ different color balls? My work: I separate the answer to $3$ ways. 1. $7$ attempts -> done (...
2021/08/09
[ "https://math.stackexchange.com/questions/4220311", "https://math.stackexchange.com", "https://math.stackexchange.com/users/957014/" ]
The statement is equivalent to $$\DeclareMathOperator{\arccot}{arccot} \arccot7+\arccot8=\arccot3-\arccot18 $$ The right-hand side is positive because the arccotangent is decreasing, so it is in the interval $(0,\pi/2)$ and we have to ensure that the same holds for the left-hand side, but this is easy, because $7>1$ an...
I can't resist, even though your request for a critique makes this response somewhat off-topic. Let the 3 LHS angles be denoted as $a,b,c$, and use the formula $$\cot(a + b) = \frac{[\cot(a)\cot(b)] - 1}{\cot(a) + \cot(b)}.$$ This gives $\cot(a + b) = \frac{55}{15} = \frac{11}{3}.$ Therefore, $$\cot[(a+b) + c] = \fr...
4,220,311
There is a ball drawer. Seven color balls will be drawn with the same probability ($1/7$). (black, blue, green, yellow, white, pink, orange) If Anson attempts $9$ times, what is the probability that he gets all $7$ different color balls? My work: I separate the answer to $3$ ways. 1. $7$ attempts -> done (...
2021/08/09
[ "https://math.stackexchange.com/questions/4220311", "https://math.stackexchange.com", "https://math.stackexchange.com/users/957014/" ]
I can't resist, even though your request for a critique makes this response somewhat off-topic. Let the 3 LHS angles be denoted as $a,b,c$, and use the formula $$\cot(a + b) = \frac{[\cot(a)\cot(b)] - 1}{\cot(a) + \cot(b)}.$$ This gives $\cot(a + b) = \frac{55}{15} = \frac{11}{3}.$ Therefore, $$\cot[(a+b) + c] = \fr...
Obviously $\pi+\cot^{-1} 3 \neq \cot^{-1} 3$, since $\pi \neq 0$. Your second method is incorrect because $$\tan^{-1} a+\tan^{-1}b+\tan^{-1}c=\tan^{-1} \left(\frac {a+b+c-abc}{1-ab-bc-ac}\right)$$ is only true for $a,b,c>0$ if $ab+bc+ac<1$. It is better for you to combine the $\arctan$s two at a time. We have: $$\tan^...
4,220,311
There is a ball drawer. Seven color balls will be drawn with the same probability ($1/7$). (black, blue, green, yellow, white, pink, orange) If Anson attempts $9$ times, what is the probability that he gets all $7$ different color balls? My work: I separate the answer to $3$ ways. 1. $7$ attempts -> done (...
2021/08/09
[ "https://math.stackexchange.com/questions/4220311", "https://math.stackexchange.com", "https://math.stackexchange.com/users/957014/" ]
The statement is equivalent to $$\DeclareMathOperator{\arccot}{arccot} \arccot7+\arccot8=\arccot3-\arccot18 $$ The right-hand side is positive because the arccotangent is decreasing, so it is in the interval $(0,\pi/2)$ and we have to ensure that the same holds for the left-hand side, but this is easy, because $7>1$ an...
Obviously $\pi+\cot^{-1} 3 \neq \cot^{-1} 3$, since $\pi \neq 0$. Your second method is incorrect because $$\tan^{-1} a+\tan^{-1}b+\tan^{-1}c=\tan^{-1} \left(\frac {a+b+c-abc}{1-ab-bc-ac}\right)$$ is only true for $a,b,c>0$ if $ab+bc+ac<1$. It is better for you to combine the $\arctan$s two at a time. We have: $$\tan^...
4,220,311
There is a ball drawer. Seven color balls will be drawn with the same probability ($1/7$). (black, blue, green, yellow, white, pink, orange) If Anson attempts $9$ times, what is the probability that he gets all $7$ different color balls? My work: I separate the answer to $3$ ways. 1. $7$ attempts -> done (...
2021/08/09
[ "https://math.stackexchange.com/questions/4220311", "https://math.stackexchange.com", "https://math.stackexchange.com/users/957014/" ]
The statement is equivalent to $$\DeclareMathOperator{\arccot}{arccot} \arccot7+\arccot8=\arccot3-\arccot18 $$ The right-hand side is positive because the arccotangent is decreasing, so it is in the interval $(0,\pi/2)$ and we have to ensure that the same holds for the left-hand side, but this is easy, because $7>1$ an...
${tan^{-1}(1/7)+tan^{-1}(1/8)+tan^{-1}(1/18)}$ * ${tan^{-1} \left[ \frac{ (1/7)+(1/8) } { \left( 1 \right) - (1/7)(1/8) } \right] + tan^{-1}(1/18) }$ * = ${tan^{-1} \frac {3}{11} + tan^{-1} \frac{1}{18}}$ * =${tan^{-1} \left[ \frac {(3/11)+(1/18)} {\left (1 \right) - (3/11)(1/18)} \right] }$ * = ${tan^{-1} \frac{1}{3}...
4,220,311
There is a ball drawer. Seven color balls will be drawn with the same probability ($1/7$). (black, blue, green, yellow, white, pink, orange) If Anson attempts $9$ times, what is the probability that he gets all $7$ different color balls? My work: I separate the answer to $3$ ways. 1. $7$ attempts -> done (...
2021/08/09
[ "https://math.stackexchange.com/questions/4220311", "https://math.stackexchange.com", "https://math.stackexchange.com/users/957014/" ]
${tan^{-1}(1/7)+tan^{-1}(1/8)+tan^{-1}(1/18)}$ * ${tan^{-1} \left[ \frac{ (1/7)+(1/8) } { \left( 1 \right) - (1/7)(1/8) } \right] + tan^{-1}(1/18) }$ * = ${tan^{-1} \frac {3}{11} + tan^{-1} \frac{1}{18}}$ * =${tan^{-1} \left[ \frac {(3/11)+(1/18)} {\left (1 \right) - (3/11)(1/18)} \right] }$ * = ${tan^{-1} \frac{1}{3}...
Obviously $\pi+\cot^{-1} 3 \neq \cot^{-1} 3$, since $\pi \neq 0$. Your second method is incorrect because $$\tan^{-1} a+\tan^{-1}b+\tan^{-1}c=\tan^{-1} \left(\frac {a+b+c-abc}{1-ab-bc-ac}\right)$$ is only true for $a,b,c>0$ if $ab+bc+ac<1$. It is better for you to combine the $\arctan$s two at a time. We have: $$\tan^...
32,829,536
Im having trouble figuring out why my code doesnt work. First off, Im new to Java so bear with me. The task is: Write a program that reads a sequence of integer inputs and prints the cumulative totals. If the input is 1 7 2 9, the program should print 1 8 10 19. ``` package lektion05forb; import java.util.Scanner...
2015/09/28
[ "https://Stackoverflow.com/questions/32829536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5385869/" ]
You can do this with [parse\_url](http://php.net/manual/en/function.parse-url.php) ``` $url = 'www.google.be'; if (parse_url($url, PHP_URL_SCHEME) === null) $url = 'http://'.$url; ```
Just use [str\_replace](http://php.net/manual/en/function.str-replace.php): ``` <a href="http://<?php str_replace('http://', '', $model->www); ?>" Click me</a> ``` UPDATE: If you are also concerned about other protocols (see DarkBee's comment): ``` <a href="http://<?php str_replace(array('http://', 'https://', 'ftp...
25,277,775
I have a model in Rails that has an enum attribute "status". I want to have a concept of public and private statuses, like so: ``` class Something < ActiveRecord::Base @public_statuses = [:open, :closed, :current] @private_statuses = [:deleted] enum status: @public_statuses + @private_statuses end ``` So that...
2014/08/13
[ "https://Stackoverflow.com/questions/25277775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3011531/" ]
You can treat your variables like Class methods and define private the ones you don't want to be accessed (that's not absolutely true in Ruby). Like: ``` def self.public_statuses [:open, :closed, :current] end def self.private_statuses [:deleted] end private_class_method :private_...
What you've done is defined two instance variables not class variables so accessing them as `Foo.instance_variable` is not going to work. You need an instance of `Foo` to access them. So you'd replace your view each block with: ``` <% Something.new.public_statuses.each do |status| %> <option value="<%= status %>"><...
8,211,128
Is there any way to have multiple distinct HTML pages contained within a single HTML file? For example, suppose I have a website with two pages: ``` Page 1 : click here for page 2 ``` and ``` Page 2 : click here for page 1 ``` Can I create a single HTML file that embeds simple static HTML for both pages but only ...
2011/11/21
[ "https://Stackoverflow.com/questions/8211128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/674683/" ]
I used the following trick for the same problem. The good thing is it doesn't require any javascript. CSS: ``` .body { margin: 0em; } .page { width: 100vw; height: 100vh; position: fixed; top: 0; left: -100vw; overflow-y: auto; z-index: 0; background-color: hsl(0,0%,100%); } ....
```html <html> <head> <script> function show(shown, hidden) { document.getElementById(shown).style.display='block'; document.getElementById(hidden).style.display='none'; return false; } </script> </head> <body> <a href="#" onclick="return show('Page1','Page2');">Show page 1</a> <a href="#" onclick="return...
8,211,128
Is there any way to have multiple distinct HTML pages contained within a single HTML file? For example, suppose I have a website with two pages: ``` Page 1 : click here for page 2 ``` and ``` Page 2 : click here for page 1 ``` Can I create a single HTML file that embeds simple static HTML for both pages but only ...
2011/11/21
[ "https://Stackoverflow.com/questions/8211128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/674683/" ]
[Twine](https://twinery.org/) is an open-source tool for telling interactive, nonlinear stories. It generates a single html with multiples pages. Maybe it is not the right tool for you but it could be useful for someone else looking for something similar.
It is, in theory, possible using `data:` scheme URIs and frames, but that is rather a long way from practical. You can fake it by hiding some content with JS and then revealing it when something is clicked (in the style of [tabtastic](http://phrogz.net/js/tabtastic/index.html)).
8,211,128
Is there any way to have multiple distinct HTML pages contained within a single HTML file? For example, suppose I have a website with two pages: ``` Page 1 : click here for page 2 ``` and ``` Page 2 : click here for page 1 ``` Can I create a single HTML file that embeds simple static HTML for both pages but only ...
2011/11/21
[ "https://Stackoverflow.com/questions/8211128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/674683/" ]
Well, you *could*, but you probably just want to have two sets of content in the same page, and switch between them. Example: ```html <html> <head> <script> function show(shown, hidden) { document.getElementById(shown).style.display='block'; document.getElementById(hidden).style.display='none'; return false; } <...
I used the following trick for the same problem. The good thing is it doesn't require any javascript. CSS: ``` .body { margin: 0em; } .page { width: 100vw; height: 100vh; position: fixed; top: 0; left: -100vw; overflow-y: auto; z-index: 0; background-color: hsl(0,0%,100%); } ....