qid
int64
10
74.7M
question
stringlengths
15
26.2k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
27
28.1k
response_k
stringlengths
23
26.8k
13,140,481
Pandoc, when it parses a document, includes a metadata block. The Title part of the metadata block is of type [Inline], a markup data type specific to Pandoc. I am trying to find a way to convert that to Html so that I can embed that text directly into the Header element of an outgoing Html document. What function, or...
2012/10/30
[ "https://Stackoverflow.com/questions/13140481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/575152/" ]
There are only a few helper functions that I've found that come along Pandoc ([Data.Text.Pandoc.Shared](http://hackage.haskell.org/packages/archive/pandoc/1.9.1.2/doc/html/Text-Pandoc-Shared.html#g:4) and by your example the `stringify` function would be all you need (this functions do note that it removes any formatti...
What you want is this: ``` inlinesToHtml :: [Inline] -> Html inlinesToHtml = writeHtml defaultWriterOptions . Plain ```
10,234,227
We have a (Numeric 3 float) vector class that I would love to align to 16-bytes in order to allow SIMD oerations. Using declspec to 16-byte align it causes a slew of C2719 errors (parameter': formal parameter with \_\_declspec(align('#')) won't be aligned). If I can't pass around a vector aligned, what's the point? Eve...
2012/04/19
[ "https://Stackoverflow.com/questions/10234227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/527574/" ]
> > If I can't pass around a vector aligned, what's the point? > > > `__declspec(align(#))` does seem rather useless. C++11 has support for what you want; `alignas` appears to work in all the ways that `__declspec(align(#))` is broken. For example, using `alignas` to declare your type will cause parameters of that...
There is a \_\_declspec(passinreg) that's supported on Xbox360, but not in Visual Studio for Windows at the moment. You can vote for the request to support the feature here: <http://connect.microsoft.com/VisualStudio/feedback/details/381542/supporting-declspec-passinreg-in-windows> For vector arguments in our engine ...
22,993,949
I create a table into a php file with 2 rows and a button on each last `<td>`: ``` <table id="filterTableMsg" border="1" class="TF"> <tbody><tr><th>Message Title</th><th>Message</th><th>Schedule Date</th><th>share</th> </tr> <tr class="row_hover"> <td>hello</td> <td>hello message</td> <td>2014-04-09 00:11:51</td> <...
2014/04/10
[ "https://Stackoverflow.com/questions/22993949", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3520356/" ]
Add at the top of your code ``` session_start(); ``` Replace ``` if ($count==1) { header( "refresh:0;url=backoffice.php" ); ``` } with ``` if ($count==1) { header( "refresh:0;url=backoffice.php" ); $_SESSION['logged']="true"; } ``` Then, in backoffice.php, put at the top ``` <?php session_start(); if(...
``` <html> <script> function val() { var x=document.getElementById("a1").value; if((x==" ")||(x=="")) { document.getElementById("nameerror").innerHTML="name field can't be empty"; return false; } } </script> <style> .error {color:red;} </style> <body> <form onsubmit="retu...
938,049
I tried to display the url using all sorts of methods of HttpRequest, I tried VirtualPathUtility object as well, but I never was able to display the hidden portion "default.aspx" of the default... what is the method or property that retrieves this segment of the url? reason being, I am so close to creating a 404 on ap...
2009/06/02
[ "https://Stackoverflow.com/questions/938049", "https://Stackoverflow.com", "https://Stackoverflow.com/users/63202/" ]
I don't think this is at all possible, so I relied on IIS7.0 rewrite feature to force the default.aspx to appear at all times..
I'm not sure what you mean by "hidden portion" but have you tried ... ``` Request.Url.ToString() ```
41,422,790
I m newbee in laravel. I am sending such type of response through Postman. and in Laravel controller I m getting this response in $request. ``` [{ "id": 40, "cname": "Ramesh", "constraint_value": "", "r_id": "6", "rtype_id": null, "deleted_at": null, "created_at": null, "updated_at": n...
2017/01/02
[ "https://Stackoverflow.com/questions/41422790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6845316/" ]
Probably late, but may help someone in the future. First of all. You need to iterate over the array of objects like so ``` foreach($request->all() as $key => $value){ $model = new Model(); $model->attribute1 = $value['attribute1']; $model->attribute2 = $value['attribute1']; $model->attributeN = $value[...
I got the solution. I was making mistake in sending the data from angularjs.I was directly sending the POST request without creating its object like `var data = { 'data':my_request}` .That is why request was reeving with instance in laravel. But, as I start sending data by creating its object its working. This was the ...
52,215,264
in python you could do something like this ``` def divide(numerator, denominator): if numerator == denominator: raise(ZeroDivisionError) ``` what would the equivalent by in c# be?
2018/09/07
[ "https://Stackoverflow.com/questions/52215264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9742648/" ]
> > What is the syntax to raise an error in c#? > > > What you are *generally asking about* is [Creating and Throwing Exceptions (C# Programming Guide)](https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/exceptions/creating-and-throwing-exceptions). Excerpt: > > Exceptions are used to indicate th...
``` public int Divide(int numerator, int denominator) { try { return numerator / denominator; } catch (DivideByZeroException divideByZeroException) { Logger.Error("Divide by zero exception", divideByZeroException); } catch (Exception exception) { Logger.Error(exce...
4,467,011
I think, now is the time I should move on to do different area of mathematics. I have done real analysis and topology from Baby Rudin and James Munkres, respectively. I’m thinking to do linear algebra. I’m looking for “standard text” in linear algebra. By standard text, I mean standard text in real analysis is Baby Rud...
2022/06/06
[ "https://math.stackexchange.com/questions/4467011", "https://math.stackexchange.com", "https://math.stackexchange.com/users/861687/" ]
Note that $a\_\pm =\sqrt{\frac{1\pm i\sqrt3}{2}}=\frac{\sqrt3\pm i}2$ and \begin{align} I=&\ \frac 12 \int\_0^\infty \frac{\arctan x\ln(1+x^2)}{x(x^4+x^2+1)} dx\\ =& \ \frac{1}{2\sqrt 3 i} \int\_0^\infty \frac{\arctan x\ln(1+x^2)}{x(x^2+a\_-^2)}-\frac{\arctan x\ln(1+x^2)}{(x^2+a\_+^2)}\ dx\\ = & \ \frac\pi{4\sqrt3 i}\...
Note that $$\Im\left(-\frac{2}{\sqrt{3}\left(x^2+\frac{1}{2}+\frac{i\sqrt{3}}{2}\right)} \right) = \frac{1}{x^4+x^2+1}$$ Hence $$ I=\frac 12 \int\_0^\infty \frac{\arctan (x) \ln(1+x^2)}{x(x^4+x^2+1)} \mathrm dx = \Im \left( -\frac{1}{\sqrt{3}} \int\_0^\infty \frac{\arctan (x) \ln(1+x^2)}{x\left(x^2+\frac{1}{2}+\frac...
15,984,623
I have a String and an int, lets say: `String str = "12345";` and `int num = 12345;`. What is the fastest way of seeing if they are the same, `str.equals("" + num)` or `num == Integer.parseInt(str)` (Or is there a faster way?)? This is the source code for [Integer.parseInt](http://grepcode.com/file/repository.grepcode...
2013/04/13
[ "https://Stackoverflow.com/questions/15984623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1896169/" ]
`num == Integer.parseInt(str)` is going to faster than `str.equals("" + num)` `str.equals("" + num)` will first convert num to string which is O(n) where n being the number of digits in the number. Then it will do a string concatenation again O(n) and then finally do the string comparison. String comparison in this ca...
I think `num == Integer.parseInt(str)` is a better way of doing comparison. Because `str.equals("" + num)` this is not the ideal way how you should compare integer values and also it will create unnecessary String constant objects in the String pool (which hampers performance).
33,304,889
I used alphahull package to delineate dots on a map. I plot the contours with a geom\_segment. My question is : how to fill the delineation given by the segment with a color ? Here is a reproducible example : ``` set.seed(2) dat <- data.frame(x = rnorm(20, 10, 5), y = rnorm(20, 20, 5), z = c(rep(1, 6), rep(2, 4))) ...
2015/10/23
[ "https://Stackoverflow.com/questions/33304889", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5445495/" ]
This is because the `ashape` function only returns segments, not in any order. The only way I found to reconstruct the order was by using the node information to form a graph and then find the shortest path along that graph. A detailed example is here: <https://rpubs.com/geospacedman/alphasimple> - the code needs wr...
Based on Spacedman's answer, I ordered separately the two sets of points and came up with this solution. It could be optimized with a function that does it for each group automatically. ``` set.seed(2) dat <- data.frame(x = rnorm(20, 10, 5), y = rnorm(20, 20, 5), z = c(rep(1, 6), rep(2, 4))) library(ggplot2) library(...
4,077
In 2 Kings 19 king Hezekiah faces a great threat to Jerusalem from the Assyrian king. He delivers a message to Isiah with the following words: > > This day is a day of distress and rebuke and disgrace, as when > children come to the moment of birth and there is no strength to > deliver them... > > > (2 Kings 1...
2013/02/01
[ "https://hermeneutics.stackexchange.com/questions/4077", "https://hermeneutics.stackexchange.com", "https://hermeneutics.stackexchange.com/users/552/" ]
Interesting answers... Looking at the Hebrew (and some other translations), I would hazard that another accurate translation would be something like: > > Thus says Hizqiyyahu: This day is a day of distress, and of reproach, and of disgrace. For the children have come to the moment of breaking, but there is not enough...
When we are helpless, God is helpful. They felt hopeless against their enemies. But God had already planned to fight for them.
282,452
How to upgrade Magento 2.3.1 to Magento 2.3.2 ?
2019/07/18
[ "https://magento.stackexchange.com/questions/282452", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/52888/" ]
As far as I know, there are two main ways: * If using command line composer, you can follow this guide: <https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html> * <https://devdocs.magento.com/guides/v2.3/comp-mgr/upgrader/upgrade-start.html> (I haven't tried yet with Admin) With the command line and ...
Please use below commands to upgrade from **2.3.1 to 2.3.2** > > (it is wise to keep backup of source code and database before upgrade) > > > ``` php bin/magento maintenance:enable composer require magento/product-community-edition 2.3.2 --no-update composer update rm -rf var/cache/ rm -rf generated/ chmod +x bi...
137,933
We are writing a complex rich desktop application and need to offer flexibility in reporting formats so we thought we would just expose our object model to a scripting langauge. Time was when that meant VBA (which is still an option), but the managed code derivative VSTA (I think) seems to have withered on the vine. W...
2008/09/26
[ "https://Stackoverflow.com/questions/137933", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9731/" ]
[IronPython](https://ironpython.net/). Here's a guide on [how to embed it](https://www.codeproject.com/Articles/53611/Embedding-IronPython-in-a-C-Application).
Try [Ela](http://elalang.net/). This is a functional language similar to Haskell and can be [embedded](http://elalang.net/docs/Article.aspx?p=embedding.htm) into any .Net application. Even it has simple but usable IDE.
41,587,811
I generate table using itextsharp and I would like to retreive the rectangle coordinate of a specific cell in the table. I can't find a way to acheive this. Let say I have a table with 3 columns and 3 rows. I would like to retreive the rectangle coordinate of the middle cell on second row. The table is added using c...
2017/01/11
[ "https://Stackoverflow.com/questions/41587811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2155911/" ]
Since this question is still getting alot of attention and none of the soulotions yet provide the full answer that I was trying to achieve, I'll give an example how I solved it some years ago. > > First to make the animation go left to right, like many other questions have showed: > > > ```css #pot { bottom: 15...
The accepted answer has the flaw that the element is completely pushed out of the viewport during the animation. This might be desired for some use cases, but I wanted to share a cleaner solution that leverages the CSS `transform: translate` property. ```css #pot { bottom: 15%; display: block; position: absol...
2,396,238
When I using the following code to read file: ``` lines=file("data.txt").read().split("\n") ``` I have the following error ``` MemoryError ``` the file size is ``` ls -l -rw-r--r-- 1 charlie charlie 1258467201 Sep 26 12:57 data.txt ```
2010/03/07
[ "https://Stackoverflow.com/questions/2396238", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130272/" ]
Obviously the file is too large to be read into memory all at once. Why not just use: ``` with open("data.txt") as myfile: for line in myfile: do_something(line.rstrip("\n")) ``` or, if you're not on Python 2.6 and higher: ``` myfile = open("data.txt") for line in myfile: do_something(line.rstrip("...
use this code to read file line by line: ``` for line in open('data.txt'): # work with line ```
34,986,655
How do programmers code proper loading screens? This is how I envision the code behind a loading screen, but I was wondering if there is a better way than just a bunch of conditional statements: ``` loading = 0 def load(percent): while percent <= 100: if percent == 0: foo.loadthing() # Just an...
2016/01/25
[ "https://Stackoverflow.com/questions/34986655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5721459/" ]
I think you got it backward. I wouldn't code a loading screen based from a loading screen. Not sure about your language i hope you'll understand my c# prototype ``` //Gui thread var screen = LoadingScreen.Show(); await doWork(); //<- c# way to make doWork happen on 2nd thread and continue after the thread has been f...
This should work ``` import time import replit from random import randint percent = 0 for i in range(100): replit.clear() percent +=1 print(""" LOADING SCREEN Status: loading %"""+ str(percent) ) time.sleep(randint(1,2)) print("Loading complete!\n") print("Now...") time.sleep(2) print("What ...
12,314,734
I'm wondering what is the right way to store the following data inside an MySQL DB. Let's say an object for example a video. and I want to store the the rating which was give to it by other user, so on option is create a column and store the ID of the users and their rating in a complex way, like that: ``` | ID | vid...
2012/09/07
[ "https://Stackoverflow.com/questions/12314734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1192761/" ]
Create a second table, `ratings`: ``` +----------+---------+--------+ | video_id | user_id | rating | +----------+---------+--------+ | 5 | 158 | 4 | | 5 | 5875 | 1 | | 5 | 585 | 5 | +----------+---------+--------+ ``` You can then *group* and/or [join](http://www.codi...
The normal way is an entity relationship diagram. Then you have ratings \* --- 1 video That is, you have a table "video" ``` ID | Name 5 | cool video ``` And a table "ratings" ``` ID | value | USERID | video_ID 1 | 4 | 158 | 5 2 | 1 | 5875 | 5 3 | 5 | 585 | 5 ```
2,246,099
Suppose there is a polynomial: $$P(z) = a\_0 + a\_1z +a\_2z^2 +\dots +a\_nz^n,\quad (a\_n \ne 0)$$ Let $$w = \frac{a\_0}{z^n} + \frac{a\_1}{z^{n-1}} + \frac{a\_2}{z^{n-2}} + \dots + \frac{a\_{n-1}}{z},$$ Why is it that for a sufficiently large positive number $R$, the modulus of each of the quotients in the expression ...
2017/04/22
[ "https://math.stackexchange.com/questions/2246099", "https://math.stackexchange.com", "https://math.stackexchange.com/users/339070/" ]
Since, $a\_n\not=0$ we have $|a\_n|\not=0$. Now, we have to find a positive real number $R\_0$ such that for any complex number $z$ with $|z|> R\_0$ we have $$\left |\frac{a\_0}{z^n}\right|=\frac{|a\_0|}{|z^n|}=\frac{|a\_0|}{|z|^n}<\frac{|a\_n|}{2n},$$$$\left |\frac{a\_1}{z^{n-1}}\right|=\frac{|a\_1|}{|z^{n-1}|}=\frac{...
Take the inequality ||> as true. Both are scalars and real, then according to the theorem the reals are ordered: 1/||<1/. Since the potential is preserving the order for all positive integer n: 1/z^n<^/^n. Consider the numbers from 1 to n then this inequality is true for all these numbers. Now =()/z^n. We know not ...
788,348
I installed XAMPP 1.6.8 and for some reason it didn't work. Later realized port 80 is not free or not listening. How can I release it or make it free? Thanks a lot!
2009/04/25
[ "https://Stackoverflow.com/questions/788348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
use **netstat -bano** in an elevated command prompt to see what apps are listening on which ports. But Usually following applications uses port 80 in windows. 1. IIS 2. World Wide Web Publishing service 3. IIS Admin Service 4. SQL Server Reporting services 5. Web Deployment Agent Service Stop above applications if r...
Identify the real process programmatically ------------------------------------------ ### (when the process ID is shown as 4) The answers here, as usual, expect a level of interactivity. The problem is when something is listening through HTTP.sys; then, the PID is always 4 and, as most people find, you need some too...
65,262,340
**C:\Android\sdk\bin>sdkmanager** Error: Could not determine SDK root. Error: Either specify it explicitly with --sdk\_root= or move this package into its expected location: \cmdline-tools\latest\ it shows like this, even after specifying the root in env variables. ANDROID\_SDK\_ROOT C:\Android\sdk I am using windows...
2020/12/12
[ "https://Stackoverflow.com/questions/65262340", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11004696/" ]
You can create a folder `latest` inside your `cmdline-tools` and move all it's contents inside this folder. So, your full path will be `C:\Android\cmdline-tools\latest\bin`. Using this config there is no need to define a `ANDROID_SDK_ROOT` environment variable or a `--sdk_root=` option. It'll assume that your SDK folde...
Try the below command it will work perfectly: ``` sdkmanager --sdk_root=path-to-where-cmdline-tools-is "platform-tools" "platforms;android-29" ```
193,315
Is there a noun form of the verb "to decline"? That is, is there a word that follows this pattern: ``` to accept -> acceptance to decline -> ? ``` I am aware of the word declination which is the closest I've found, but that seems to reflect the meaning of "decline" as related to "incline" and "recline" rather than...
2014/08/26
[ "https://english.stackexchange.com/questions/193315", "https://english.stackexchange.com", "https://english.stackexchange.com/users/66815/" ]
I think you may use; [Denial](http://www.thefreedictionary.com/Denial): > > * a refusal to agree or comply with a statement; > > > [Refusal](http://www.thefreedictionary.com/refusal): > > * the act or an instance of refusing > > > Source: www.thefreedictionary.com
> > I'm disinclined to acquiesce to your request. Means "no". > > > *Captain Barbossa, Pirates of the Caribbean: The Curse of the Black Pearl* Perhaps "disinclination" suits your description? 1. the absence of inclination; reluctance; unwillingness.
8,152,814
Is it possible to do a javascript action after play button is pushed? I know I will need to use onStateChange function form Youtube's API. But I really don't know where to start? Any help? Thank you. -- I have also found something here: <http://apiblog.youtube.com/2011/01/introducing-javascript-player-api-for.html>
2011/11/16
[ "https://Stackoverflow.com/questions/8152814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/872981/" ]
Here's a solution that you should be able to extend easily: <http://jsbin.com/evagof>
``` <script src="http://www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript"> google.load("swfobject", "2.1"); </script> <script type="text/javascript"> // Update a particular HTML element with a new value function updateHTML(elmId, value) { ...
5,648,771
When checking if a integer is the same or above a current number.. so I type ``` if (5 => 6) { //Bla } ``` but it shows this as a error. Why? Isn't it exactly the same as ``` if (5 >= 6) { //Bla } ```
2011/04/13
[ "https://Stackoverflow.com/questions/5648771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1656790/" ]
The confusion here is that you're assuming >= is two operators smooshed together. In fact, it's only one operator with two characters, much the same as tons of other operators (+=, \*=, -=, etc).
Because it is called greater or equal to. Not equal or greater than. Simple uh?
167,060
I have the posts which have many custom defined meta fields. On posts I am calling them on requirement using `get_post_meta`. Means for 10 meta fields I am using it 10 times. Am I doing it right? Means, is there any performance issue with the above method and if yes then how to reduce the number of calls. I am aware...
2014/10/31
[ "https://wordpress.stackexchange.com/questions/167060", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/31989/" ]
To answer this, I have gone and done some tests on this, and the results was actually mind blowing. Here is my test =============== *To this yourself, set yourself up with a test page. Just simply copy page.php, rename it and delete the loop. Now just create a new page in the back end. Before you start, first test yo...
You can use `get_post_meta` to fetch all meta field values at once. ``` $meta = get_post_meta( get_the_ID() ); ``` This will fetch all meta values of the given post. Use that array instead of fetching individually.
43,575,366
I'm trying to calculate how long one person stays in a homeless shelter using R. The homeless shelter has two different types of check-ins, one for overnight and another for a long-term. I would like to shape the data to get an EntryDate and ExitDate for every stay which does not have at least a one day break. Here a...
2017/04/23
[ "https://Stackoverflow.com/questions/43575366", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2108441/" ]
Usually the `100vh` height will account for the adjusted height, with is why you'll sometimes see mobile pages go funky when the browser's address bar slides down. For browsers that don't account for the sliding bar within the `vh` unit: The height for the address bars will not be constant across the browsers, so I'd ...
Use `height: 100%` which gives you the height after reducing the menu bar's height. You can test the difference between `100vh` and `100%` by using `document.getElementsByTagName('html')[0].scrollHeight` on mobile browser. For me (Chrome on Andriod), `100vh` returns a higher value than `100%`, which always giving me...
349,927
Is there a way to play music through Headphone connector (HI-FI system) and Bluetooth (Wireless speaker in different place) **simultaneously** ? It seems that I can only choose one or the other, but it seems so simple there might be a way to do so. Thanks
2019/01/28
[ "https://apple.stackexchange.com/questions/349927", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/319076/" ]
Its no posible (whitout jailbreack). The cheapest form to do that is: buy two "airport express" (off second hand because Apple dont sales any more), and use airplay. In that way, connect the plug off audio to airport, &, in your iphone can see the two devices (or the cuantity thath you showld buy) to send music at all ...
Unfortunately this is not possible with the native OS. This is possible though of you have 2 speakers and both compatible with AirPlay 2. Whilst not giving the exact same effect it is similar in some ways to what you want. Any device with this logo on the packaging should work with AirPlay 2. [![logo](https://i.st...
7,684,473
I'd like to do this simply without saving the starting value of the select in an object. if i have (when i load the dom): ``` <select> <option value='1' selected>one</option> <option value='2' >Two</option> ``` and than i later change the selection so that another option is selected, is there some kind of prope...
2011/10/07
[ "https://Stackoverflow.com/questions/7684473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/397861/" ]
You should use the defaultSelected property of the options object to test if it was selected by default. <http://www.javascriptkit.com/jsref/select.shtml>
use this ``` $('select').find('option[selected]').val(); ``` **[DEMO](http://jsfiddle.net/zu5af/)**
13,036,490
I am trying to run a simple hello world example in python that runs against mongodb. I've set up mongo, bottle and pymong and have the following script inside `C:\Python27\Scripts`: ``` import bottle import pymongo @bottle.route('/') def index() from pymongo import Connection connection = Connection('localhos...
2012/10/23
[ "https://Stackoverflow.com/questions/13036490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/865939/" ]
Change this: ``` public function __construct($Host, $User, $Pass, $Name){ $dbHost = $Host; $dbUser = $User; $dbPass = $Pass; $dbName = $Name; $this->dbConnect(); } ``` to this: ``` public function __construct($Host, $User, $Pass, $Name){ $this->dbHost = $Host; ...
How about using **this->** ``` public function __construct($Host, $User, $Pass, $Name){ $this->dbHost = $Host; $this->dbUser = $User; $this->dbPass = $Pass; $this->dbName = $Name; $this->dbConnect(); } ```
49,374,192
I have large datasets from 2 sources, one is a huge csv file and the other coming from a database query. I am writing a validation script to compare the data from both sources and log/print the differences. One thing I think is worth mentioning is that the data from the two sources is not in the exact same format or th...
2018/03/19
[ "https://Stackoverflow.com/questions/49374192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7483951/" ]
You were in the right path. What do you want is to quickly match the 2 tables. Pandas is probably overkill. You probably want to iterate through you first table and create a dictionary. What you **don't** want to do, is interact the two lists for each elements. Even little lists will demand a large searches. The [Re...
You can using `pivot` convert the df , the using `drop_duplicates` after `concat` ``` df2=df2.applymap(lambda x : pd.to_numeric(x,errors='ignore') pd.concat([df.pivot(*df.columns).reset_index(),df2)],keys=['db','csv']).\ drop_duplicates(keep=False).\ reset_index(level=0).\ rename(columns={'level_0':'sour...
69,506,468
In data table component footer , there is select option that i need to change its numbers How can I do it ? [![enter image description here](https://i.stack.imgur.com/I5HCA.png)](https://i.stack.imgur.com/I5HCA.png)
2021/10/09
[ "https://Stackoverflow.com/questions/69506468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14952975/" ]
``` def fingersUp(self): fingers = [] if len(self.lmList): if self.lmList[self.tipIds[0]][1] > self.lmList[self.tipIds[0]-1][1]: fingers.append(1) else: fingers.append(0) for id in range(1,5): if self.lmList[self.tipIds[id]][2]< self.lmList[self.tipI...
[enter image description here](https://i.stack.imgur.com/3iwD4.png) 1.Indentation 2. Missing "\_ "
40,732
When I go to the "Likes" section of the YouTube video manager under my account I can only see 2 pages of the likes list and the last video in the list is for sure far not the first video I've ever liked. I am actively using YouTube for years, clicking "like" to be able to revisit the video, but now I can only see a sma...
2013/02/21
[ "https://webapps.stackexchange.com/questions/40732", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/6386/" ]
The problem is that YouTube is limiting every playlist to 200 entries. A solution I came across is to create a new playlist, put the 200 displayed entries from your liked list inside, and delete them from the liked list. The liked list is then not empty, but contains 200 previously liked videos. Proceed until you have ...
Here is how I view all my liked videos on YouTube: Go to your "Liked Videos" section and click **play** on one of the videos. Next to the video playing is a playlist of your liked videos (in black color). To the top of this playlist is the title **Liked Videos** Just click that and that's it. At the bottom of the new ...
36,329,001
Today,I am looking into send Email, but when I add ``` <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>4.2.5.RELEASE</version> </dependency> <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>7.0</vers...
2016/03/31
[ "https://Stackoverflow.com/questions/36329001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6138670/" ]
In my case, I moved to Hibernate 7.x but had an old explicit dependency on: ``` <dependency> <artifactId>validation-api</artifactId> <groupId>javax.validation</groupId> <version>2.0.1.Final</version> </dependency> ``` Once I removed this dependency, and allowed Hibernate to transitively pull in the dependency ...
I made it work downgrading the dependency of hibernate-validator from version `7.0.2.Final` to `6.0.13.Final`. This is how my dependencies look like: ``` <dependency> <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> <version>2.0.1.Final</version> </dependency...
4,928,135
A character `char` maybe of size one byte but when it comes to four bytes value e.g `int` , how does the cpu differ it from an integer instead of four characters per byte?
2011/02/07
[ "https://Stackoverflow.com/questions/4928135", "https://Stackoverflow.com", "https://Stackoverflow.com/users/607339/" ]
The CPU executes code which you made. This code tells the CPU how to **treat** the few bytes at a certain memory, like "take the four bytes at address 0x87367, treat them as an integer and add one to the value". See, it's you who decide how to treat the memory.
Are you asking a question about CPU design? Each CPU machine instruction is encoded so that the CPU knows how many bits to operate on. The C++ compiler knows to emit 8-bit instructions for `char` and 32-bit instructions for `int`.
44,613,748
I'm trying to set a round image at the top of a page (like a profile page). The image is rectangular and about 300x200. I've tried these ways: 1) Using the Ion-Avatar Tag 2) Using Ion-Image tag, setting the border radius in the scss None of these methods worked. The image just kept showing squared (and eventually sh...
2017/06/18
[ "https://Stackoverflow.com/questions/44613748", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4116960/" ]
you can try with css ```css .image { height: 5vw; width: 5vw; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 5px gray; display: inline-block; margin-left: auto; margin-right: auto; } .circle-pic{ width:50px; height:50px; -webkit-border-radius: ...
In ionic 3, you can do this... ``` <ion-avatar> <img src=""> </ion-avatar> ``` That simple In some cases, you may need to set the img height and width to the same value manually. But this is the standard ionic 3 method. <https://ionicframework.com/docs/components/#avatar-list>
1,893,221
**Theorem :** Given any sequence either there will exist a subsequence which is increasing or there will exist a subsequence which is decreasing (and possibly both) **Partial Proof:** Given a sequence $x\_1 , x\_2, x\_3, ...$ let the set $C$ of positive integers be given by $C = \{N \in Naturals :$ if $m > N$ then $x\...
2016/08/15
[ "https://math.stackexchange.com/questions/1893221", "https://math.stackexchange.com", "https://math.stackexchange.com/users/95532/" ]
Set $C$ consists of the indices of all the elements that are greater than all the later elements. You should read the definition carefully to understand this. If the sequence is $1,10,2,8,3,7,6,5,4,4,4,4,4,4,4,\ldots$ then $C=\{2,4,6,7,8\}$ because the $10, 8, 7 ,6,5$ are greater than anything that follows and everythi...
call the sequence $S=\{x\_n\}$ if any value $a$ is repeated an infinite number of times then we can derive a weakly increasing sequence consisting of the $x\_n$ satisfying $x\_n=a$ if the sequence is unbounded then a monotonic subsequence can be selected using the set $C$ defined in the question. so we need only con...
5,957,039
I read this code on [HTMLCodeTutorial.com](http://www.htmlcodetutorial.com/forms/_INPUT_onClick.html): ``` <FORM> <TABLE BORDER CELLPADDING=3> <TR> <TD><NOBR>radius: <INPUT NAME="Circle_radius" SIZE=4></NOBR></TD> <TD><INPUT TYPE=BUTTON OnClick="Circle_calc(this.form);" VALUE="calculate"></TD> <TD ALIGN=RIGHT BGCOLOR=...
2011/05/10
[ "https://Stackoverflow.com/questions/5957039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/578462/" ]
It's not built-in. If you look at the source code, it's defined as: ``` <SCRIPT TYPE="text/javascript"> <!-- function Circle_calc(GeoForm) { var CircleRadius = GeoForm.Circle_radius.value; if (CircleRadius >= 0) { GeoForm.Circle_circumference.value = 2 * Math.PI * CircleRadius ; GeoForm.Circle_area.value = ...
They have been quite naughty methinks, If you do a view page source on that page, and look at the way THEY'VE done the form, then you'll see this: ``` <SCRIPT TYPE="text/javascript"> <!-- function Circle_calc(GeoForm) { var CircleRadius = GeoForm.Circle_radius.value; if (CircleRadius >= 0) { GeoForm.Circle...
16,271,972
I have a div that should be shown only when the user clicks the show button ``` $("div.toshow").show(); ``` I have written in the body ``` <body> <div class="toshow"> </div> </body> ``` so by default when the page is displayed all this content is seen the user. Is there a way that I can hide it bydefault?
2013/04/29
[ "https://Stackoverflow.com/questions/16271972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1530845/" ]
Yes you can use `style` like this: ``` <div class="toshow" style="display:none"></div> ```
You can use CSS `display`: ``` .toshow { display: none; } ```
51,799,359
i'm a beginner in C , so i'm a little confused if `char* ft_name(args)` is equivalent to `char *ft_name(args)` in function prototype . can anybody help me please
2018/08/11
[ "https://Stackoverflow.com/questions/51799359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10017223/" ]
C compiler ignores the white space between the tokens and both declrations from the compiler point of view look like ``` char*ft_name(args); ``` so they are exactly the same. the only place where compiler does not ignore the white space are string literals like `"Hello world"` The program: ``` int main(int argc, ...
**Yes**. ``` char* ft_name(args) ``` and ``` char *ft_name(args) ``` are equivalent.
17,566,249
Can anyone help me to set a `KeyPress` action on a currently opened `jInternalFrame`? I have a `jDesktopPane` inside a `jframe`, and I have multiple `jInternalFrame` inside the `DesktopPane`. I am using Netbeans to create this application. On the `jDesktopPane` I have 3 buttons to open 3 `jInternalFrame`, and I creat...
2013/07/10
[ "https://Stackoverflow.com/questions/17566249", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2469754/" ]
For Swing, typically use key bindings over the AWT based, lower level, `KeyListener`. See [How to Use Key Bindings](http://docs.oracle.com/javase/tutorial/uiswing/misc/keybinding.html) for details on how to use them.
In the event keypress click right in the Jframe de netbeans mas naki.. ``` private void formKeyPressed(java.awt.event.KeyEvent evt) { // TODO add your handling code here: if(evt.getKeyCode()==KeyEvent.VK_F4){ dispose(); } ```
6,397,250
I have an IF / ELSE statement, although I would like to know how to tell the "else" part to do nothing if it is true. e.g.: ``` if(x == x) //run calc.exe else //DoNothing ``` Or I am write in saying that if I just remove the else statement, it will continue anyway if the if condition is not matched?
2011/06/18
[ "https://Stackoverflow.com/questions/6397250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/804522/" ]
Yes. An non existant `else` statement is the same as an empty one. This is common to all C-like languages.
If you don't put an else part and the if condition is not met the program will continue executing its flow: ``` if (SomeCondition) { // Do something if the condition is not met } // continue executing ```
43,068,424
I am trying to replace my old ID with new one but this function is not working. How can I resolve this error? ```js $("#addfield").click(function(){ alert($(this).data('id')+1); $(this).data('id', + $('#addfield').data('id')+1); console.log($(this).data('id')); }) ``` ```html <script src="https://ajax...
2017/03/28
[ "https://Stackoverflow.com/questions/43068424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6921231/" ]
The problem is that you increase value after setting `newValue`. In this line: `var newvalue = currentvalue++`; it is happening two things: **1)** var newvalue=currentvalue; **2)** currentvalue=currentvalue+1 ```js $(".addfield").click(function() { $(this).attr('data-id', +$(this).attr('data-id')+1); }) ``` ``...
Please check below code, this working with numeric Id. ```js $(".addfield").click(function(){ var currentvalue = $(this).attr('id');alert("Old Id="+currentvalue); var newvalue = currentvalue++; $('.addfield').attr('id', newvalue); alert("New Id="+currentvalue++); }); ``` ```html <scri...
39,785
I have this configuration in **/etc/network/interfaces**: ``` auto lo iface lo inet loopback allow-hotplug wlan0 iface wlan0 inet manual wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf allow-hotplug wlan1 iface wlan1 inet manual wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf allow-hotplug wlan0 #iface wl...
2015/12/20
[ "https://raspberrypi.stackexchange.com/questions/39785", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/38523/" ]
The priority has to do with your init or systemd configuration. With regards to dhcp: if you have s statically or manually configured interface, and dhcp starts requesting an address afterwards, it will override what you already have. On Debian, dhcp is started for interfaces for which you specify dhcp, and not just ma...
First, get the `/etc/network/interfaces` file back to its original version... ``` # interfaces(5) file used by ifup(8) and ifdown(8) # Please note that this file is written to be used with dhcpcd # For static IP, consult `/etc/dhcpcd.conf` and `man dhcpcd.conf` # Include files from `/etc/network/interfaces.d`: source...
11,431,905
I have a class MyDataCollection that contains MyMetaData and MyData. In my application i have two usercontrolls that display input fields to the user. One for the MyMetaData and the other for MyData. Both usercontrols are included in the MainPage. My Question is: How should i get the data from the usercontrols then th...
2012/07/11
[ "https://Stackoverflow.com/questions/11431905", "https://Stackoverflow.com", "https://Stackoverflow.com/users/639367/" ]
why not doing mvvm the easy way?(viewmodel first). you say you have a mainpage - this means you also have a mainpageviewmodel. your mainpageviewmodel handles at least the save command. now you want to show MyMetaData and MyData on your mainpage. so the easy way would be to create one MyMetaData instance and one MyData ...
You should use Two-way bindings to automatically update the value in your controller. Take a look at [this article](http://msdn.microsoft.com/en-us/library/cc278072%28v=vs.95%29.aspx). Here's an example: ``` <TextBox Text="{Binding MyMetaData, Mode=TwoWay }" /> <TextBox Text="{Binding MyData, Mode=TwoWay }" /> ```
50,719,380
I'm designing a parallel algorithm where, in theory, I want to update an `std::list<...>` per thread. So say I have `m*n` threads, each of these will index a specific `std::list`, after the parallel algorithm has been executed all the list will be merged together. There other approach I was thinking was to use a singl...
2018/06/06
[ "https://Stackoverflow.com/questions/50719380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4792660/" ]
So I resolved this error by uncommenting and setting `# calico_ipip_enabled: true` to false. After that though I got another error because of my loopback ip: ``` fatal: [127.0.0.1] => A loopback IP is used in your DNS server configuration. For more details, see https://ibm.biz/dns-fails. ``` But there is an fix/wor...
IBM Cloud private suppoted OS is ubuntu 16.04 .Please check the below url <https://www.ibm.com/support/knowledgecenter/SSBS6K_2.1.0.3/supported_system_config/supported_os.html> Please check the system requirement.. I am also trying to install the setup.. I didnt face this issue.
1,952,404
Does exist in linux bash something similar to the following code in PHP: ``` list($var1, $var2, $var3) = function_that_returns_a_three_element_array() ; ``` i.e. you assign in one sentence a corresponding value to 3 different variables. Let's say I have the bash function `myBashFuntion` that writes to stdout the st...
2009/12/23
[ "https://Stackoverflow.com/questions/1952404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25700/" ]
First thing that comes into my mind: ``` read -r a b c <<<$(echo 1 2 3) ; echo "$a|$b|$c" ``` output is, unsurprisingly ``` 1|2|3 ```
let var1=var2=var3=0 or var1=var2=var3="Default value"
18,667
1. I just want to ask how recommended is the book on quantum mechanics by J.J. Sakurai. Is it any good as an introductory text? 2. And are there better suggestions (substitutes)?
2011/12/23
[ "https://physics.stackexchange.com/questions/18667", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/6824/" ]
IMHO it is an excellent book, particularly the first chapters. It goes immediately to the point and forces you to get used right away to bra's and ket's and so on. Many years have passed since I used the book (and now there is even a new edition which I have not looked at) but back when I was an undergraduate student i...
I remember finding it totally dense and confusing and unreadable as a young undergrad. When I reread it a few years later, I found it totally clear, and I could not (and still cannot) figure out why I had found it confusing before. It's strange! Regardless, I suggest reading Griffiths, then reading it again and again,...
22,771,994
I have the following model attributes: ``` [{ "id": 1, "details": { "name": "Sun Tzu", "height": "180", }, "lists": [ [{ "coworkers": "company cool", "friends": "School", }], [{ "coworkers": "company nice", "friends...
2014/03/31
[ "https://Stackoverflow.com/questions/22771994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1664286/" ]
``` var friends = _.chain(data) .findWhere({ id: 1 }) .result('lists') .flatten(false) .pluck('friends') .value(); ```
You can chain functions to get the output you are looking for ``` console.log(_.chain(data) .find(function(currentObject) { return currentObject.id === 1; }) .pick("lists") .flatten(false) .pluck("friends") .value()); ``` **Output** ``` [ 'School', 'Childhood' ] ```
16,957,270
I want to push the data from server to web client. Now i have used the j2ee technology, i am using javascript and give a ajax call to server some intervel times then the data is showed to webclient. This process works fine. But i feel its overhead to server.I want to get the data from server when the new data comes to ...
2013/06/06
[ "https://Stackoverflow.com/questions/16957270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1793377/" ]
Solution with usage of [Enumerable#inject](http://ruby-doc.org/core-2.0/Enumerable.html#method-i-inject): ``` def sum(array) array.inject(0){|sum, el| sum + el} end ``` Or, as suggested, shorter and more elegant form: ``` def sum(array) array.inject(0, :+) end ```
This will do: ``` def sum(array) array.reduce(0, :+) end ```
1,531,903
What do you call your functions when names that contain a saxon genitive like "Verify Task's Priority" and "Change Argument's Priority" or "Increase Action's Delay"? Do you drop the apostrophe? `verifyTasksPriority(), changeArgumentsPriority(), increaseActionsDelay()` Do you drop both the apostrophe and the "s"? `ver...
2009/10/07
[ "https://Stackoverflow.com/questions/1531903", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I use the second. It sounds good to me. Think of "Task Priority" as a compound word like "vacuum cleaner".
If you need to make your function names several words long to distinguish them from each other, you are probably failing in the [single responsibility principle](https://en.wikipedia.org/wiki/Single_responsibility_principle) so none of your suggested options will help. I write OO code, mainly in OO languages, so to ve...
2,583,756
I want to show that $4^{3x+1} + 2^{3x+1} + 1$ is divisible by 7, I am trying to show this with modular arithmetic. If I break up each part of the equation, I can see that $4^{3x+1} = 4$ x $2^{6x}$ which implies that $4^{3x+1}mod(7) = 4$ I can't quite find a nice factorization of $2^{3x+1}$ Any help specifically...
2017/12/29
[ "https://math.stackexchange.com/questions/2583756", "https://math.stackexchange.com", "https://math.stackexchange.com/users/431530/" ]
**Hint:** $$2^{3x+1} = 8^x\times 2$$ $$8 \equiv 1\pmod{7} \implies 8^x \equiv 1 \pmod{7}\implies 8^x \times 2\equiv 2\pmod{7}.$$
$X:=2^{3x+1}=2\cdot (7+1)^x \equiv 2\pmod{7}$. Hence $$ X^2+X+1 \equiv 2^2+2+1 \equiv 0\pmod{7}. $$
17,795,346
I am having an issue implementing this calculator on my website which i created. I think i have used the wrong javascript to create the simple calculation which is the following math calculation: **((list price - rrp) / list price) \* 100** **PLEASE NOTE, i am aware of the values not being numbers, please replace them...
2013/07/22
[ "https://Stackoverflow.com/questions/17795346", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2244383/" ]
It works fine if you call your function after it exists: <http://jsfiddle.net/xwzhY/2/> Just make sure that the function is declared earlier in the code than you use it. Or declare it using a function statement rather than a function expression assigned to a variable: ``` function discountFinal(firstly, secondly){ ....
Trying put "" around your perl variable, you need to pass the value
63,203,144
I'm setting up laradock (Setup for Multiple Projects) following the official documentation from the Laradock in my local machine. After installation I installed the laravel through workspace container bash. I did configured the config file for the app in `nginx/sites/` directory and in `/etc/hosts` file. While visiti...
2020/08/01
[ "https://Stackoverflow.com/questions/63203144", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13904860/" ]
This worked for me: ``` chown -R www-data:www-data "project foldername" ```
You need to run the following command. It works for me: **step 1:** > > sudo chmod -R +rwX . > > > **step 2:** > > sudo chown -R $(whoami) . > > >
74,526,866
[enter image description here](https://i.stack.imgur.com/0rj83.png) [enter image description here](https://i.stack.imgur.com/sFKiK.png) I think is same array type, but, Javascript doesn't import data to second type 'proj\_name'. I use axios to fetching data This is my axios request tsx file ``` import axios,{ AxiosR...
2022/11/22
[ "https://Stackoverflow.com/questions/74526866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20032012/" ]
Using your wide dataframe, you can set `stat = "identity"` inside `geom_boxplot()` and manually set the boxplot parameters: ``` library(ggplot2) ggplot(df_wide) + geom_boxplot( aes( y = spp, xmin = lrr1, xlower = lrr1, xupper = lrr2, xmax = lrr2, xmiddle = (lrr1 + lrr2)/2 ), s...
Something like this, using `geom_crossbar` ? ``` library(dplyr) library(ggplot2) library(scales) df1 %>% group_by(spp) %>% mutate(upper = max(lrr), lower = min(lrr)) %>% ungroup() %>% ggplot(aes(spp, lrr)) + geom_crossbar(aes(ymin = lower, ymax = upper), ...
63,870,821
I have a simple `component` named `rectangle` with a simple `css`. Now I need to show a element example a `div` or another `component` inside that component. How would I achieve this? --- I tried doing: ```html <app-rectangle> <div> ... </div> </app-rectangle> ``` and nothing showed up as the output.
2020/09/13
[ "https://Stackoverflow.com/questions/63870821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9129854/" ]
What you are trying to achieve is called Content Projection. In the template of the `<app-rectangle>` component add the following: `<ng-content></ng-content>` Your div should automatically appear within those tags. See more here: <https://angular.io/guide/lifecycle-hooks#responding-to-projected-content-changes>
You can achieve this using `<ng-content></ng-content>` I believe you are looking for something similar that was asked [here](https://stackoverflow.com/questions/39292195/angular2-html-inside-a-component).
205,515
### Introduction A double-castle number™ is a positive integer number that has a pattern of $$\underbrace{a\cdots a}\_{m\text{ }a\text{s}}b\underbrace{a\cdots a}\_{m\text{ }a\text{s}}b\underbrace{a\cdots a}\_{m\text{ }a\text{s}}\underbrace{a\cdots a}\_{n\text{ }a\text{s}}b\underbrace{a\cdots a}\_{n\text{ }a\text{s}}b\...
2020/06/02
[ "https://codegolf.stackexchange.com/questions/205515", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/71546/" ]
[K (ngn/k)](https://bitbucket.org/ngn/k), 26 bytes ================================================== ``` {z/,/(2+3*x)#'(x#'y),'y-1} ``` Explanation ``` {z/,/(2+3*x)#'(x#'y),'y-1} / using x=2 1; y=1; z=2 as an example (x#'y) / (m;n) copies of a; ex: (1 1;1) ,'y-1 / appen...
JavaScript, 75 bytes ==================== There may be rounding errors due to JavaScript's integer limit. ```javascript (m,n,a,B)=>B**(3*(m+n)+4)/~-B*a-B**(n-~n)-B**(m+3*n+2)-B**(2*m-3*~n)-B**n-1 ``` [Try it online!](https://tio.run/##XY3NDsIgEITP@hQcgYKFXX7KQQ99k8ao0RRqrOnRV6/UEk1cyATmm8zeuqkbj4/r/SmnZj7vZxpFEp1o2...
24,220,030
I have a hover element in which when user hover over it will get text from a hidden element and when it hovers out it will reassign in its previous value. My html is sort of like this. ``` <div id="product-name">Hover Here</div> <br> <div id="result-content">Lorem ipsum dolor sit amet.</div> <div class="hidden"> ...
2014/06/14
[ "https://Stackoverflow.com/questions/24220030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3736019/" ]
I think, in this case must save somewhere previous state, like: ``` var object = document.getElementById("product-name"), previous_state = document.getElementById("result-content").innerHTML; ``` Might not be the best approach, but without major changes in code should look like this: [jsfiddle](http://jsfiddle.n...
try this one for mouse out ``` object.onmouseout=function(){ document.getElementById("result-content").innerHTML ='Lorem ipsum dolor sit amet.'; }; ```
148,884
I have ubuntu 12.04 installed on windows 7. When I use the `Fn` alongside the key to reduce brightness, or even using the system settings, I am not being able to reduce the screen brightness. What is the problem?
2012/06/10
[ "https://askubuntu.com/questions/148884", "https://askubuntu.com", "https://askubuntu.com/users/-1/" ]
Here's how i fixed mine : LCD Brightness Control Once you have installed the proprietary Nvidia drivers as suggested above, you may notice that your brightness control keys do not work properly. This is fixable by editing one's xorg.conf file. Open a terminal window and type the following: ``` sudo nano /etc/X11/xo...
There is an app for it...**Brightness And Lock** ![enter image description here](https://i.stack.imgur.com/Ji1PA.png) ![enter image description here](https://i.stack.imgur.com/X2zp7.png)
14,320,149
Who can help me convert GPS latitude-longtitude to x-y coordinates for the Amersfoort RD New (epsg:28992) projected system. My startpoint (data from the GPS device) is something like this: "$GPGGA,071132.784, 5157.3883,N,00434.4648,E,1,03,4.5,-5.1,M,47.1,M,,0000\*73" Or 51°57'23,1600"N;004°34'27,5760"E In another GI...
2013/01/14
[ "https://Stackoverflow.com/questions/14320149", "https://Stackoverflow.com", "https://Stackoverflow.com/users/812011/" ]
The best answer would be to use a third party library to do the conversion for you. Such as [ArcGIS's GeometryService.Project web method](http://resources.arcgis.com/en/help/rest/apiref/project.html) or [PROJ.4's API](http://trac.osgeo.org/proj/wiki/ProjAPI). If you want to do the math yourself, you'll have to look at...
If you use the `PROJ.4` Api you can get the Proj4 Transformation definition string from this link: <http://spatialreference.org/ref/epsg/28992/proj4/> If you want to implement that transfomration for yourself: Its an `Oblique Stereographic projection`, exact paramters to use: [epsg/28992](http://spatialreference.org...
3,904,894
I have a structure like: ``` src -|com -|company -|Core --> JAVA class -|rules --> text files ``` Inside Core is a Java Class that uses: ``` BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(fileName))); ``` But I cannot figure out what relative path ...
2010/10/11
[ "https://Stackoverflow.com/questions/3904894", "https://Stackoverflow.com", "https://Stackoverflow.com/users/465734/" ]
It doesn't work that way. Relative paths are relative to the *working directory* of the current application, **not** the directory of the class. If you want to find out what your current working directory is, use `System.getProperty("user.dir")`. A better way is to add the rules directory to the classpath and then use...
The current directory when executing has nothing to do with what package the current class is in. It doesn't change. If your file is distributed with the application, use Class.getResourceAsStream().
43,599,318
I have the following target: I need to compare two date columns in the same table and create a 3rd column based on the result of the comparison. I do not know how to compare dates in a np.where statement. This is my current code: ``` now = datetime.datetime.now() #set the date to compare delta = datetime.timedelta(da...
2017/04/24
[ "https://Stackoverflow.com/questions/43599318", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3818716/" ]
I use `sass --watch stylesheet.scss:stylesheet.css`. When saving your `.scss` file, it'll automatically update the `.css` file. You might also consider `sass --watch stylesheet.scss:stylesheet.css --style expanded --sourcemap=none` to keep the `.css` file readable. I'd recommend the [Sass Workflow class on Udemy](htt...
Try out Grunt or Gulp with Sass: A great tutorial: <https://www.taniarascia.com/getting-started-with-grunt-and-sass/>
64,964,363
I create an app in react. I am trying to use fetch with a post to a different port of localhost. I received the req on the server, but my body is empty. Why my body is empty? I don't understand. Code in React function: ``` export default function Sending() { async function handleSubmit(e) { e.preventDef...
2020/11/23
[ "https://Stackoverflow.com/questions/64964363", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8134930/" ]
Consider installing cors and add it to your code such as shown bellow ```js const cors = require('cors') app.use(cors()) ``` Then with the help of morgan `const morgan = require('morgan');` Consider reading a previous similar case as shown here [Express JS is receiving an empty req.body from ReactJS](https://stac...
From the first glacne; you are sending over a string with the stringify. Node body-parser trys to parse the json. Try removing the stringify and just sending the object over.
15,826,120
i have a table and i have also declared its style as grouped table style in view did load but i also have a button on click of which i want to change the style of the same table. initially i was setting this in view did load method: ``` tableObj= [[UITableView alloc]initWithFrame:CGRectMake(5,50,310,300)style:UITable...
2013/04/05
[ "https://Stackoverflow.com/questions/15826120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2239093/" ]
According to the docs, UITableView's `style` property is declared thus: ``` @property(nonatomic, readonly) UITableViewStyle style ``` That `readonly` keyword means that you can get the value of the property, but you can't set it. You can only set the style when you create the table using `-initWithFrame:style:`. Thi...
``` tblView.style; ``` It is a read-only property you cannot set any value to while you can only read it which is set.. You can check whether the property is changable or, not by writing your code as below ``` [tblView setStyle:]; ``` But you will find that you can't do that, so you can't set. Better you get 2 ta...
38,234,911
I new in Xamarin form. On Android, I used ViewPager to load images and the user swipe around the pages. Since Android has adapter, all the views are not initialized at once. Now I want to move to Xamarin form and seeing there is Carousel Page. Does it behave the same as ViewPager only load pages as needed?
2016/07/06
[ "https://Stackoverflow.com/questions/38234911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/186820/" ]
`Xamarin.Forms` `CarouselPage` does not support UI virtualization (recycling). Initialization performance and memory usage can be a problem depending upon the number of pages/children. The **new** preferred `VisualElement` to use is the `CarouselView` that is basically superseding `CarouselPage` and it has been optim...
If you prevent the call to InitializeComponent in the constructor of the page you might have an effect on the load time. ``` public interface CarouselChildPage { void childAppearing(); void childDissapearing(); } public partial class MainPage : CarouselPage { CarouselPageChild previousPage; protected...
6,162,600
I have some random string, for example: `Hello, my name is john.`. I want that string split into an array like this: `Hello, ,, , my, name, is, john, .,`. I tried `str.split(/[^\w\s]|_/g)`, but it does not seem to work. Any ideas?
2011/05/28
[ "https://Stackoverflow.com/questions/6162600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/407756/" ]
Try: ``` str.split(/([_\W])/) ``` This will split by any non-alphanumeric character (`\W`) and any underscore. It uses capturing parentheses to include the item that was split by in the final result.
This solution caused a challenge with spaces for me (still needed them), then I gave `str.split(/\b/)` a shot and all is well. Spaces are output in the array, which won't be hard to ignore, and the ones left after punctuation can be trimmed out.
37,126,522
I need to figure out how to write a for loop in Python that returns NOT print the sum of odd integers given an input. I can't use the sum function or make a list. So far all I have is this: ``` def sumofoddints (n): n >= 1 total = 0 for num in range (1, n): if num % 2 == 1: total +...
2016/05/09
[ "https://Stackoverflow.com/questions/37126522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6312575/" ]
There is a much simpler way using math. **EDIT:** sorry my bad. Here is the corrected formula ``` def sumOdd(n): return ((n+1)/2)**2 ``` n=1 => 1 = 1 n=3 => 1+3 = 2\*\*2=4 n=5 => 1+3+5 = 3\*\*2=9 n=7 => 1+3+5+7 = 4\*\*2=16
It is simply n\*\*2. Read here: <https://www.quora.com/What-is-the-formula-for-the-sum-of-n-odd-numbers> ``` def sumofoddints (n): return n**2 ```
4,943,849
I have a web site which uses cookies using ASP.NET, however everytime I publish a new site and upload all or some of the new .dlls it invalidates all the existing cookies. The cookies are used to track simple logins, but I want to maintain the cookies that were created before a publish so they are still usable after...
2011/02/09
[ "https://Stackoverflow.com/questions/4943849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/61529/" ]
**Update:** Based on the revised question - 1. Why don't you set AppendDataBoundItems on the dropdownlist? The property would allow the dropdownlist to append items to the existing ones. ``` <asp:DropDownList ID='DropDownList1' runat='server' AutoPostBack='true' EnableViewState='true' AppendDataBoundItems='true'> ...
I don't know if anyone else had the same Issue as I did but it just so happened that my values were the same for each item in the drop down list and it would never fire the event until I changed the values.
10,579,046
I have searched the web but couldn't find any detailed idea about Native OS development I need to know about Native OS development in detail eg. what is a Native OS what kind of feature it gives.. etc etc..
2012/05/14
[ "https://Stackoverflow.com/questions/10579046", "https://Stackoverflow.com", "https://Stackoverflow.com/users/940347/" ]
"Native OS" is not a product. It is a phrase that describes the operating system that the device comes with, and applications written specifically for that OS (as opposed to Java apps, which are cross-platform). So for example, "Native OS" of iPhone is iOS; and "Native OS iPhone application" will be written in Objecti...
If you prefer native OS you should specify what exactly it is, like Windows, Linux... etc. :)
3,786,653
Since Objective-C exists and is supported even in MinGW, by passing `-x objective-c`, is there a hack to achieve this with Android SDK? I've did a rudimentary test on a colleague's machine where it appears that language `objective-c`is not supported. I am not interested in getting UIKit or AppKit, or even Foundation, ...
2010/09/24
[ "https://Stackoverflow.com/questions/3786653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39974/" ]
The [Apportable platform](http://www.apportable.com/) includes a Clang compiler integration with the Android NDK. It also includes a bunch of other useful features if you want to go beyond basic Objective-C language and runtime support.
There is this Google Code project: <http://code.google.com/p/android-gcc-objc2-0/> however I have not tested it yet. Also, I have inquired on the Cocotron mailing list whether or not this compiler is usable with Cocotron's Foundation and CoreFoundation; one person responded that it is not, and that he has worked on t...
5,287,636
Hi stack overflow people i am writing an iphone app thats connects to a web service, through REST with JSON. I would like to generate my model classes in objective c from a json schema provided by my web service, a bit like i d do with wsdl2objc with asoap, xml and wsdl combination. It looks like there s not much out...
2011/03/13
[ "https://Stackoverflow.com/questions/5287636", "https://Stackoverflow.com", "https://Stackoverflow.com/users/657242/" ]
It's not free, but perhaps [Objectify](http://tigerbears.com/objectify/) would do what you want? It seems very slick.
Pre-writing model code is not the most flexible solution. You can have clever models, which try to convert your incoming JSON to your defined properties. Have a look at the JSONModel Obj-C framework. It has tons of demos and tests included and it's very easy to write models with it: <https://github.com/icanzilb/JSON...
6,557,355
I need to split up some strings, but the number of characters and position will change, This is quite easy in PHP but seems more complicated in C#. These are greyhound results in the UK. I have these strings in an array, **I need to extract almost everything from each string**, So I need a quick and simple solution...
2011/07/02
[ "https://Stackoverflow.com/questions/6557355", "https://Stackoverflow.com", "https://Stackoverflow.com/users/711308/" ]
I'd suggest using [String.Split](http://msdn.microsoft.com/en-us/library/system.string.split%28v=VS.100%29.aspx), [String.[Last]IndexOf](http://msdn.microsoft.com/en-us/library/k8b1470s.aspx), [String.Substring](http://msdn.microsoft.com/en-us/library/hxthx5h6.aspx), and LINQ extensions (simple ones, e.g. `.Last()`, ju...
It's not entirely clear what your requirements are, but if you are splitting up strings, my first thought would be to use Regex: <http://msdn.microsoft.com/en-us/library/30wbz966(v=vs.71).aspx> Would that work for you? Hope this helps, John
9,464,705
I have general architecture level question on below scenarios. I have lots of sub systems like components in my product. is it good to keep each subsystem as a separate process ? or is it good to keep all subsystems in separate threads in a single process ? All my subsystems will be interacting each other for givin...
2012/02/27
[ "https://Stackoverflow.com/questions/9464705", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1041290/" ]
It seems what you are doing it not correct. It is actualy not rendering the TextBox as you have not given items source. Or what you can do is something like ``` <ItemsControl.Items> <TestTextBoxFet:TestTextBox Text="xaml text"/> </ItemsControl.Items> ```
I agree with gaurawerma. The precedence of value set in constructor is higher than that set in Data Template. Hence you see the result as different in both the cases. <http://social.msdn.microsoft.com/Forums/en/wpf/thread/a4e7ed36-9a8a-48ce-a5d5-00a49376669b>
17,057,147
``` import csv with open ('data.txt', 'r') as f: col_one = [row[0] for row in csv.reader(f, delimiter= '\t')] plots = col_one[1:] ``` The data in column one are floats, but above code makes list of strings. How can I make the list of floats correcting above codes?
2013/06/12
[ "https://Stackoverflow.com/questions/17057147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2473267/" ]
To get the relative feature importances, read the [relevant section of the documentation](http://scikit-learn.org/stable/modules/ensemble.html#feature-importance-evaluation) along with the code of the linked examples in that same section. The trees themselves are stored in the `estimators_` attribute of the random for...
Here is how I visualize the tree: First make the model after you have done all of the preprocessing, splitting, etc: ``` # max number of trees = 100 from sklearn.ensemble import RandomForestClassifier classifier = RandomForestClassifier(n_estimators = 100, criterion = 'entropy', random_state = 0) classifier.fit(X_tra...
11,102,518
I have a file which looks like this: ```none 80,1p21 81,19q13 82,6p12.3 83,Xp11.22 84,3pter-q21 86,3q26.33 87,14q24.1-q24.2|14q24|14q22-q24 88,1q42-q43 89,11q13.1 90,2q23-q24 91,12q13 92,2q22.3 93,3p22 94,12q11-q14 95,3p21.1 97,14q24.3 98,2p16.2 ``` And I want to sort them based on the second column. And the first c...
2012/06/19
[ "https://Stackoverflow.com/questions/11102518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1203044/" ]
If you read [the documentation for sort](http://perldoc.perl.org/functions/sort.html), you'll see that you don't need to do a numeric sort in Perl. You can do string comparisons too. ``` @sorted = sort { $a cmp $b } @unsorted; ``` But that still leaves you with a problem as, for example, 19q will sort before 6p. So ...
``` #!/usr/bin/env perl use strict; use warnings; my @datas = map { /^(\d+),(\d*)(.*)$/; [$1, $2, $3]; } <DATA>; my @res = sort {$a->[1] <=> $b->[1] or $a->[2] cmp $b->[2]} @datas; foreach my $data (@res) { my ($x, $y, $z) = @{$data}; print "$x,$y$z\n"; } __DATA__ 80,1p21 81,19q13 82,6p12.3 83,Xp11.22 ...
6,966
I recently did a job for a large organization. The job was not a long-term one, so the terms were that I would complete the work and then submit my invoice after completion of work. I was fine with this. The contract I was asked to sign by the client included a clause that states: > > An invoice must be submitted wit...
2017/07/07
[ "https://freelancing.stackexchange.com/questions/6966", "https://freelancing.stackexchange.com", "https://freelancing.stackexchange.com/users/17648/" ]
To answer your question, yes, it is possible to challenge the time limit. You will need a lawyer for that, and will likely win, in my amateur opinion. You sent on day 29, so you are entitled to full payment. That they play games by ignoring it is something that reflects badly on them, and any judge should see right th...
If legally possible, the contract needs to be re-negotiated, as you are performing actual repairs and not typical maintenance. While it is the client's right to attempt to become independant of you, you on the other hand should be able to expect to be the sole provider of maintenance - which should not include mopping...
39,857,510
I tried to delete a value from my session using : ``` Session::forget('value') ``` but it didn't delete! However, when i tried using `save` method like so : ``` Session::forget('value') Session::save() ``` it worked! (I.e. the value was deleted from the session.) Please - what am I doing wrong? I don't see th...
2016/10/04
[ "https://Stackoverflow.com/questions/39857510", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5746074/" ]
The save() method will actaully perform the write to the file. It seems that your application doesn't call Session::save() before it outputs content to the user on all requests. If this method isn't called, the Session file will not get updated with the new values, and they will still be there on the next visit. It'...
i use `Session::save()` method its work fine to save session data. But when i flush session using `Session::flush()` it does not clear all the data that is stored in Laravel session. `Session::forget('value')` works fine to clear session specific value.
10,208
It might just be subjective, but to me the nights seem to be longer than the days. Barely have I gone outside to collect some sand to make glass, or see if I can find that promising looking cave again when night falls. Even with the watch to show me when it's nearly dawn there doesn't seem to be enough time. Are ther...
2010/11/03
[ "https://gaming.stackexchange.com/questions/10208", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/13/" ]
I have just tested it on my world using a timer and it shows that the **safe time lasts about 10 mins 30 seconds** between day and sunset, whereas **mobs spawn and are active for 9 mins 30 seconds** between night and sunrise. However, it takes 20 seconds for the mobs to burn after the day starts. This is set on Difficu...
No.The usual Minecraft day and night consists of 33 minutes. The day time takes up 20 minutes of that time. Therefore, nighttime only consists of 13 minutes. Which means that the Minecraft day is longer than the Minecraft night.
22,929,819
I a newbie to java so please don't rate down if this sounds absolute dumb to you ok how do I enter this using a single scanner object > > 5 > > > hello how do you do > > > welcome to my world > > > 6 7 > > > for those of you who suggest ``` scannerobj.nextInt->nextLine->nextLine->nextInt->nextInt,,, ```...
2014/04/08
[ "https://Stackoverflow.com/questions/22929819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3247500/" ]
``` public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.printf("Please specify how many lines you want to enter: "); String[] input = new String[in.nextInt()]; in.nextLine(); //consuming the <enter> from input above for (int i = 0; i < input.length;...
You can try only with lambda too: ``` public static void main(String[] args) { Scanner scanner = new Scanner(System.in); scanner.forEachRemaining(input -> System.out.println(input)); } ```
25,162,598
I am working on AngularJS application.In the application one of the DIV is displaying grid data. What I want is, when the grid is loading data, system should show the loading image on top of the div & when the data is loaded, it should remove that image. If I follow the classic way, when data load event is triggered,...
2014/08/06
[ "https://Stackoverflow.com/questions/25162598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1350476/" ]
Yes you can automate this process and leave it to AngularJS using data bindings. ``` <i class=loading-icon ng-if=!ctrl.data.length></i> app.controller("ctrl", function ($http) { var ctrl = this; ctrl.data = []; $http.get(url).success(function (data) { ctrl.data = data; }); }); ```
In the HTML add `data-ng-if="isLoading"` to the loading div, then in the js where you load the data set `scope.isLoading` as true at the before making the request and on load complete set it to false.
30,441
This is a follow-on question from: [How alien can a language be - grammar?](https://worldbuilding.stackexchange.com/questions/30371/how-alien-can-a-language-be-grammar) Leaving the grammar behind we can look at how the actual words or concepts are transmitted. Almost all human languages are based around stringing toge...
2015/11/25
[ "https://worldbuilding.stackexchange.com/questions/30441", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/49/" ]
One potential that actually occurs in ant species: *Open, bloody warfare.* Well, not quite, but the interactions of a hive's contributing parts can fundamentally affect the way that a hive behaves. In common ants the emergence of a long-running threat changes the worker/soldier dynamic in the nest. In the instance of...
There is no end to what form an alien language could take - any kind of signal, sound, light or any electromagnetic wave, touch, smell, gravity waves, thoughts, gestures.. The only condition would be that the parts of the signal are somehow related to each other. Also, the composition of the signal can seem like totall...
114,017
How to remove **Price filter** from layered navigation? I set Layered Navigation in Manage Attribute section size as 0 but still the Size filter is showing in left side under Shop by section. Can anyone assist me resolving this issue?
2016/05/05
[ "https://magento.stackexchange.com/questions/114017", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/39424/" ]
Find this file in out layout folder of your theme. ``` /app/design/frontend/diakart/default/layout/catalog.xml ``` there find the layout file written for layered navigation. check code like this line, For size also you will get same line. ``` <block type="catalog/layer_view" name="catalog.leftnav" after="currency"...
First confirm what you want to remove **Price** filter or **Size** filter. Any attribute you want to remove from layered navigation then just go to Catalog -> Attributes -> Manage Attributes -> Edit that attribute [![enter image description here](https://i.stack.imgur.com/esoMh.png)](https://i.stack.imgur.com/esoMh....
57,002,494
In my LINQ query below I want to select the 'product' rows and add the 'sale' rows data into it but the opposite is happening, it's selecting the 'sale' rows and adding the 'product' rows ``` var query = (from product in SampleProductTable from sale in SampleSalesTable where (sale.ProductId == product.Id) select new {...
2019/07/12
[ "https://Stackoverflow.com/questions/57002494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6701210/" ]
In general LINQ terms the query shape you are looking for is called [grouped join](https://learn.microsoft.com/en-us/dotnet/csharp/linq/perform-grouped-joins): > > The group join is useful for producing hierarchical data structures. It pairs each element from the first collection with a set of correlated elements fro...
In query syntax, Slava's solution should return with the result you're looking for i.e. ``` var querySyntax = (from product in SampleProductTable join sale in SampleSalesTable on product.Id equals sale.ProductId into sales from subSales in sales.DefaultIfEmpty() group subSales by new { product.Id, product....
131,848
Rather than replace a dead ballast in a fluorescent fixture, I've decided to simply bypass and move to LEDs. However, I think I may have grabbed the wrong kind of replacement tubes the other day in Home Depot. They are in the Philips "InstantFit" range, and are specifically intended to be used without having to remove ...
2018/01/27
[ "https://diy.stackexchange.com/questions/131848", "https://diy.stackexchange.com", "https://diy.stackexchange.com/users/70997/" ]
Interesting thing about being human is the brain is wired to see what it expects to see. It's hard to turn that off, even if you're a [ship spotter](https://en.wikipedia.org/wiki/MV_Yulius_Fuchik#In_popular_culture) or [pilot](https://www.youtube.com/watch?v=b26NcJCLZl4). There **is** such a thing as LED bars which w...
LED stands for light emitting diode, so not an AC device. The light is emitted when forward biased, so a rectifier is needed to avoid high current in the case of reverse bias and then current limiting to provide the correct operating current. Does not need a ballast but might work with one.
44,869,885
* When I try logging in to wp-admin (or even wp-admin/index.php) I simply get redirected to my site's homepage. (after authenticating successfully - i.e. It DOES accept my login credentials (so its not an account, password or blacklisting issue), but simply wont go to the admin dashboard page after login) (I suspect it...
2017/07/02
[ "https://Stackoverflow.com/questions/44869885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8243818/" ]
Warren, First of all, delete the codes you inserted in your wp-config.php. Instead, put it before your the require\_once(ABSPATH . ‘wp-settings.php’): ``` define( 'WP_HOME','http://warrenmaginn.com' ); define( 'WP_SITEURL','http://warrenmaginn.com' ); define( 'TEMPLATEPATH','/home/MYUSER/public_html/wp-content/themes...
For those facing this, you might add a new icognito page and visit again, sometimes its due to caching. if its still not working, might be your htaccess file issue.
7,397,050
I want to hide the keyboard after typing the content into the UITextView but i can not do this by default like UITextField. Is there any way to hide the keyboard, Rightnow i put the button which can help me out.If any default way to hide it then please tell me.
2011/09/13
[ "https://Stackoverflow.com/questions/7397050", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1407280/" ]
`CalculateBinary(InputNum)` does NOT modify the value of `InputNum`, so its value would be always the same (300000000) and the while loop never end.
Looks like you are expecting the last number in the file to be less than 0 to terminate your program. Instead it's better to detect the end of the file. Try uncommenting your file code and using the while condition instead: ``` while (fin.good()) ```
16,043,819
I have a java class full of void methods, and I want to make some unit test to get maximal code coverage. For example I have this method : ``` protected static void checkifValidElements(int arg1, int arg2) { method1(arg1); method2(arg1); method3(arg1, arg2); method4(arg1, arg2); method5(arg1); ...
2013/04/16
[ "https://Stackoverflow.com/questions/16043819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1352575/" ]
You can still unit test a void method by asserting that it had the appropriate side effect. In your `method1` example, your unit test might look something like: ``` public void checkIfValidElementsWithDollarSign() { checkIfValidElement("$",19); assert ErrorFile.errorMessages.contains("There is a dollar sign in...
I think you should avoid writing side-effecting method. Return true or false from your method and you can check these methods in unit tests.
12,743
Due to the nature of DnD core its tropes and builds, weapon types rarely count. Enchantments, especially at higher levels, are what count. Your weapon damage die and type rarely count, and the game does not really favor wielding different types of weapons. Personally, I dislike that. Holding a greatsword, a greatclub,...
2012/02/29
[ "https://rpg.stackexchange.com/questions/12743", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/2895/" ]
I do not think you can do this without house rules, but I will say that reality supports you. In historical combat, well off warriors often carried multiple weapons for different uses. During the Heian period in Japan, Samurai often brought both a yari (like a spear) and a katana to battle, and would use the yari when...
or.... you could just accept that DnD isn't the kind of game where weapon types matter much. After all, you have players with ever-increasing hit points that bear no resemblance to real-world damage. Armour that has little to do with the type of combat you're facing. The original (or 2nd ed) DnD justified this by sayin...
12,067,625
I am using eclipse 3.7 indigo , the issue that I am facing is when I start my eclipse my machine gets too slow even the eclipse get hang some times in between , the settings of my eclipse.ini file is below.. ``` -startup plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar --launcher.library plugins/org.eclipse.eq...
2012/08/22
[ "https://Stackoverflow.com/questions/12067625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1614879/" ]
Perhaps this will help? I mean, I don't know the specs of the machine you're on, but this is nice on less powerful machines. [What are the best JVM settings for Eclipse?](https://stackoverflow.com/questions/142357/what-are-the-best-jvm-settings-for-eclipse)
Check with the eclipse.ini file and add the following java parameters and values. ``` -vmargs -Dosgi.requiredJavaVersion=1.6 -Xmn128m -Xms1024m -Xmx1024m -Xss2m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+UseParallelGC ``` This worked for me. Might help.
4,181,442
I know this is a dumb question but... Is $x ≠ 1,3,5$ the same as $x$ does not belong to {$1,3,5$}, for example ? --- Sorry for the formatting. Btw, anyone has a link with mathjax's commands I guess? --- Thanks in advance.
2021/06/24
[ "https://math.stackexchange.com/questions/4181442", "https://math.stackexchange.com", "https://math.stackexchange.com/users/942203/" ]
$x \neq 1, 3, 5$ isn't super standard notation, but if someone wrote it out at random I'd assume they meant $x \neq 1$ and $x \neq 3$ and $x \neq 5,$ or $x \not\in \{1, 3, 5\}$ for short.
$x\notin (1,3,5)$ means that $x$ is not a member of a set. The set is defined as elements, which could be letters, intervals or anything else. $x\ne 1$, etc. means that equality is defined which is no necessarily true, unless equality is defined by identity. Simple example $1+2=3$, but for set membership $\{1+2\}$ is ...
168,710
I just stumbled into something that is both bizarre and confusing, and I'm not entirely sure what to make of it. I'm an IT technician. I sat down on employee Alex\*'s desk, after hours, responding to a request for support from Alex's manager (Charlie\*) about that computer's performance. All people mentioned were not ...
2021/01/18
[ "https://workplace.stackexchange.com/questions/168710", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/37033/" ]
Log it -> Tell A & B assuming both knew -> Let them correct you if not ---------------------------------------------------------------------- You should first log what you've seen. A left themselves logged in, security risk, with B's emails open, security risk, and payslip open, personal information risk. Assume that...
Other answers deal with the direct question of what to do with the information now that you have it. One option to avoid similar dilemmas in the future (assuming Windows-based PC) would be NEVER look at the screen before hitting ctrl-alt-delete - focusing on the keyboard and not the screen as you approach. Then all pr...
88,659
The CloudFlare free tier service offers unlimited bandwith while other CDNs charge starting at about $.10/gb. > > CloudFlare does not have bandwidth limits. As long as the domains > being added comply with our Terms of Service, CloudFlare does not > impose any limits. > > > There's very little said on their web...
2016/01/09
[ "https://webmasters.stackexchange.com/questions/88659", "https://webmasters.stackexchange.com", "https://webmasters.stackexchange.com/users/7249/" ]
Five reasons we offer a free version of the service and always will: 1. Data: we see a much broader range of attacks than we would if we only had our paid users. This allows us to offer better protection to our paid users. 2. Customer Referrals: some of our most powerful advocates are free customers who then "take Clo...
There's another aspect that should be mentioned here: > > [**Freemium**](https://en.wikipedia.org/wiki/Freemium) is a pricing strategy by which a product or service (typically a digital offering or application such as software, media, games or web services) is provided free of charge, but money (premium) is charged f...
24,912,067
This is what I see when I try to install my app on my device (I'm using Android Studio 0.8.2): ``` Waiting for device. Target device: samsung-gt_s7500-cf994b04 Uploading file local path: C:\Users\Administrator\AndroidStudioProjects\Testaqua\app\build\outputs\apk\app-debug.apk remote path: /data/local/tmp/com.example.a...
2014/07/23
[ "https://Stackoverflow.com/questions/24912067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1459065/" ]
I get similar error message, I fixed it by passing the absolute path instead of filename, e.g. inside `adb shell`, this command will shows: ``` shell@example:/sdcard $ pm install -r -d app-release.apk pkg: app-release.apk Failure [INSTALL_FAILED_INVALID_URI] ``` Change it to absolute path fixed that error me...
symptoms: ` ``` $ adb install xyz.apk [100%] /data/local/tmp/xyz.apk pkg: cat ver: /data/local/tmp/xyz.apk Failure [INSTALL_FAILED_INVALID_URI] ``` solution: check if u have allow installation from unknown sources enabled :) [![enter image description here](https://i.stack.imgur.com/1Hoi1.jpg)](https://i....
8,739,252
I have tried to serialize data using `XmlSerializer`. I have found very a useful post: [XML Serializable Generic Dictionary](http://weblogs.asp.net/pwelter34/archive/2006/05/03/444961.aspx). But in fact I need to put the result of serialization not in file but in a string variable, how can I do this?
2012/01/05
[ "https://Stackoverflow.com/questions/8739252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/879992/" ]
Instead of using some `StreamWriter` which points to file you can use `StringWriter` class. ``` using (StringWriter writer = new StringWriter()) { XmlSerializer serializer = new XmlSerializer(typeof (YourType)); serializer.Serialize(writer, yourObject); } ```
XmlWriter.Create() function has one overload which takes StringBuilder, try using it.
9,676,006
Say I am running IRB and I type this into the console: ``` def full_name(first, last) puts "Your full name is: #{first, ' ', last}" end ``` Say, that I wanted to edit that to include the parameter `middle`, how would I just bring back up that same method and edit the parameter list and edit the `puts` statement w...
2012/03/12
[ "https://Stackoverflow.com/questions/9676006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91970/" ]
I don't think you have a lot of options here. What I usually do is to place the code I'm playing with in a file and use `load '/path/to/file.rb'` to reload it whenever I change something. You can also try the [`interactive_editor`](https://github.com/jberkel/interactive_editor) gem which allows you to use a full-blown...
Check out the [pry](https://github.com/pry/pry) gem - a great replacement for IRB. This features might be helpful: * `hist` - replaying history of commands * `amend-line` - changing a line in a mulit-line entry They are well documented on the [pry wiki](https://github.com/pry/pry/wiki/User-Input)
41,872,508
I am new in windbg and memory analize in windows. I try analize memory dump (crash dump) it's x64 system. After loading all symbols (my and microsoft) I type `!analyze -v` This is a part of output: ``` ...... FAULTING_SOURCE_CODE: <some code here> SYMBOL_STACK_INDEX: 6 SYMBOL_NAME: rtplogic!CSRTPStack::Finalize...
2017/01/26
[ "https://Stackoverflow.com/questions/41872508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1864033/" ]
I forgot to specify timezone ``` Instant instant = Instant.from( DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm") .withZone(ZoneId.of("UTC")) .parse("2015-05-08T22:57")); ``` works fine. **UPDATE:** Also I had another problem I used `hh` instead of `HH`.
A more flexible way: ``` var instant = ISO_LOCAL_DATE_TIME.parse("2015-05-08T22:57", LocalDateTime::from) .toInstant(UTC); ```
7,914,243
I save jpeg image using the following C# [EmguCV](http://www.emgu.com/) code: ``` Emgu.CV.Image<Gray, byte> image ... image.Save("imageName.jpg"); ``` But image is stored in extremally low quality (1 color square per 8x8 pixels). When I save bmp all are ok: ``` Emgu.CV.Image<Gray, byte> image ... image.Save("imag...
2011/10/27
[ "https://Stackoverflow.com/questions/7914243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13441/" ]
Building on Chris's answer if anyone is interested here is a simple extention; ``` using System; using System.Linq; using System.Drawing.Imaging; using Emgu.CV.Structure; public static class EmguImageSave { /// <summary> /// Save a jpeg image with a specified quality /// </summary> /// <param name="pa...
Here's how I did with Emgu CV: ``` CvInvoke.Imwrite(path, cvImage, new KeyValuePair<ImwriteFlags, int> (ImwriteFlags.JpegQuality, quality)); ```
66,286,938
Not sure What I am doing wrong here. I am trying to get my bot to only send this message if the user starts typing in the defined channel. I don't get errors the bot just doesn't send a message. Help Please! ``` bot.on("typingStart", (channel, user) => { const bot_channel = "812180709401247658" if (channel.id = bot...
2021/02/20
[ "https://Stackoverflow.com/questions/66286938", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15232183/" ]
A single equals sign `=` is assignment. To perform comparison in JavaScript, use either the double equals sign or the triple equals sign. For most cases of comparison, you *should* use `===`. Your code should look like this then: ```js bot.on("typingStart", (channel, user) => { const bot_channel = "8121807094012476...
Use this ``` bot.on("typingStart", (message, channel) => { const channel = "812180709401247658" if (message.channel.id != channel) { return message.channel.send('You can only use this command in <#' + channel + '>'); } }); ``` if it still does not work use this ``` bot.on("message", (message) => { ...
8,822,885
I've a stored procedure that does something like this: ``` SELECT Id INTO #temp FROM table WHERE ... DELETE FROM #temp INNER JOIN table2 ON a=b WHERE ... ``` But it's running slowly. When I try to view the Execution Plan I can't since the SQL Server Management Studio says "Msg 208, Level 16, State 0, Line 31 Invali...
2012/01/11
[ "https://Stackoverflow.com/questions/8822885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/72350/" ]
It should let you see the estimated execution plan for the first statement fine. For the second statement you will need to create and populate the `#temp` table first (population is important so that it shows you the plan that will be used for the correct number of rows). (Or you can of course just turn on the "Inclu...
I simply selected the "select into" clause first and executed it by pressing F5. This created the tmp table. Then I selected rest of the queries and clicked "Display Plan" (or press Ctrl+L).
696,671
> > Prove that if $d$ is a common divisor of $a$ & $b$, then $d=\gcd(a,b)$ if and only if $\gcd(\frac{a}{d},\frac{b}{d})=1$ > > > I know I already posted this question, but I want to know if my proof is valid: So for my preliminary definition work I have: $\frac{a}{d}=k, a=\frac{dk b}{d}=l,b=ld $ so then I wrot...
2014/03/02
[ "https://math.stackexchange.com/questions/696671", "https://math.stackexchange.com", "https://math.stackexchange.com/users/124877/" ]
An example for Hasse-Minkowski might be worth studying it, i.e., the binary quadratic form $5x^2 + 7y^2 − 13z^2$ has a non-trivial rational root since it has a $p$-adic one for every prime, and obviously also a real root. Another example is the $3$-square theorem of Gauss: A positive integer $n$ is the sum of three ...
While this may not be novel with respect to the $p$-adic numbers, one can show that $x^2-2=0$ has no solution in $\mathbb{Q}\_5$, and therefore it follows that $\sqrt{2}$ is not rational. There are of course many other examples of this nature, perhaps one can find some more interesting ones.
17,774,547
The code below would be fine for updating a row field: ``` t = TheForm.objects.get(id=1) t.value = 1 t.save() ``` But what if I need to update 5-6 fields at once? Is there any direct way? Like update `(value=1,value2=2)` **EDIT** I already know that I can do: ``` t.value1 = 1 t.value2 = 1 t.value3 = 1 ``` Bu...
2013/07/21
[ "https://Stackoverflow.com/questions/17774547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Sure! ``` t.value1 = 1 t.value2 = 2 t.save() ``` Alternatively, ``` TheForm.objects.filter(id=1).update(value=1, value2=2) ``` (And you could use `**kwargs` here)
You can change as many fields as you want before you save. ``` t = TheForm.objects.get(id=1) t.value1 = 1 t.value2 = 2 t.save() ``` You can also use the `update` method: ``` t = TheForm.objects.filter(id=1).update(value1=1,value2=2) ``` Note that using `update` is subtlety different. There wont be an error if t...
86,820
A few months ago I bought a Nikon D5500, now I want to buy a 50 mm lens, but I just discovered the meaning of DX on my camera. So on the lens reviews I read that if I buy a 50mm to my D5500 it would act like a 75 mm lens and the recommendations is to buy a 35mm. My question is: If I buy the 50mm what would be the dif...
2017/02/03
[ "https://photo.stackexchange.com/questions/86820", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/60509/" ]
Since your kit lens covers 18-55mm, you can get a very good idea of the difference by taking a set of photos at 35mm and another set at 50mm. The main things you'll be gaining by adding a prime to your kit will be sharpness (although probably not much - the kit lens isn't bad) and the wider aperture. On the assumption ...
A thing that you may consider on choosing between these two lenses is that the nikon 35 mm is a dx lens. So I consider investing in 50mm is better, in case that you want to upgrade your camera later. Another opinion from me: If you want to buy secondhand, it is easier to get 50mm than 35mm, and later if you want to se...
73,960
Developing iOS or OSX based applications typically requires knowledge of Objective C, since XCode is highly tailored to this language. Android, on the other hand, has chosen Java as it's preferred language for app development. Now, I know other programming languages can be used to develop applications on either platf...
2011/05/05
[ "https://softwareengineering.stackexchange.com/questions/73960", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/24399/" ]
Man, nobody among the big players cares about programmers and their strange notions or fairness and efficiency. Every one of them has been building a walled garden and has done a lot of tricks to make programmers stick to their and only their platform. But as a purely theoretical discussion, yes, it would have benefit...
I concur with the general thought of "Don't learn a language, learn to program. Language is just a tool." I'd also contend that having a wider, more diversified ecosystem makes for better programming environments, tools toys and end products in general. It forces all parties to create, adapt and innovate on multiple l...