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
1,079
This question has raised a debate within my organization with multiple points of view. Several Project Managers think that they are completely different things aiming for different results whereas other colleagues believe that both methodologies could be combined. I would be interested in understanding what makes P...
2011/03/15
[ "https://pm.stackexchange.com/questions/1079", "https://pm.stackexchange.com", "https://pm.stackexchange.com/users/643/" ]
Absolutely! Prince 2 is on project level, as Scrum can be done on 'managing product delivery' level within PRINCE2. > > The Scrum process is all about > delivery. Fast and effective delivery > is key. Within PRINCE2 the delivery process is a black box. PRINCE2 is all about managing the project’s process. > > > ...
Probably, but I think it leads to idea-fall and Scrum factories. Project idea's and requirements come from people with the least knowledge, but are committed to on a project road-map. The Scrum team here is just an iterative factory. Instead of giving teams high-level [objectives](http://leanperformance.com/en/okr/wha...
21,330,682
``` private void windowClosing(java.awt.event.WindowEvent evt) { int confirmed = JOptionPane.showConfirmDialog(null, "Exit Program?","EXIT",JOptionPane.YES_NO_OPTION); if(confirmed == JOptionPane.YES_OPTION) { disp...
2014/01/24
[ "https://Stackoverflow.com/questions/21330682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2126116/" ]
From what i understand you want something like this ``` addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { int confirmed = JOptionPane.showConfirmDialog(null, "Are you sure you want to exit the program?", "Exit Program Message Box", JOptionPane.YES_NO_OPTION); ...
```java JFrame frame = new JFrame(); // ... frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent evt) { int resp = JOptionPane.showConfirmDialog(frame, "Are you sure you want to exit?", "Exit?", JOptionPane.YES_NO_OPTION); if (resp == JOptionPane.YES_OPT...
1,279,604
**I've read a number of related questions that aren't quite my question...** * [Windows 10 Getting Windows Ready Message](https://superuser.com/questions/1189160/windows-10-getting-windows-ready-message) **Q:** ...how can I get computer to stop showing me this screen? **[ie. User simply does not want to wait 45mins fo...
2017/12/23
[ "https://superuser.com/questions/1279604", "https://superuser.com", "https://superuser.com/users/855680/" ]
Got it! From another 'licensed' Windows 10 PC... **Boot Windows 10 Installer from a USB:** * Download this tool: [Create Windows 10 installation media](https://www.microsoft.com/en-us/software-download/windows10?tduid=(cc5cbdef235355eda514ae4a295d7886)(259740)(2542549)(UUwpUdUnU50931YYw)(dwp)) * Install the tool to a...
Even though you wish to avoid reinstallation, that is probably the safest option, since it appears the refresh process was stuck or interrupted more than once. This ensures that *all* needed system files are in place. It may well be **faster** to do the full reinstallation than trying to refresh Windows from the active...
4,781,500
I am using Ubuntu. I install newer version of python. But all my installed libraries such as imdbPy, NumPy, Cython etc. can run in previous version of python whose version number is 2.6.6. When I import Cython in 2.6.6, tt works, but I try same thing in 2.7.0+ version of python ``` import cython ``` occurs an erro...
2011/01/24
[ "https://Stackoverflow.com/questions/4781500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/286714/" ]
Don't mess with your system installs - the package manager should be responsible for that. Make sure that when you install from source, you do it in a separate directory. I install things in my home directory. I like jhbuild so this is what I use to maintain different versions of python side by side: <https://thomas.a...
You need to reinstall all the libraries for the new version. I'd recommend that you first download pip and install it. After that you can install most packages with `/path/to/Python27/bin/pip install <packagename>`, for example ``` /opt/python27/bin/pip install Cython ```
28,429,071
My camera app preview is too dark in low light. If I open my google camera it will increase brightness inside the preview so that our face is visible to take photos. But my preview is completely dark. I have handled the brightness and lightsensor. My Lightsensor works when is some light. I need to make preview is visib...
2015/02/10
[ "https://Stackoverflow.com/questions/28429071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4239092/" ]
To solve the problem you have to **unlock autoExposureCompensation** and **set to the MAX value**: ``` Camera.Parameters params = mCamera.getParameters(); params.setExposureCompensation(params.getMaxExposureCompensation()); if(params.isAutoExposureLockSupported()) { params.setAutoExposureLock(false); } mCamera.set...
By reading the open source code of Android Camera app here: <https://android.googlesource.com/platform/packages/apps/Camera.git/+/lollipop-release> It initialize the camera this way: ``` // Reset preview frame rate to the maximum because it may be lowered by // video camera application. List<Integer> frameRates = p...
14,512,392
I am having trouble getting some text to be next to an image. I have it working on one site: <http://puckpros.edkatzman.com/> but not on another: <http://petra.edkatzman.com/> and I can't see the difference. Can another pair of eyes help? Here is the jsfiddle: <http://jsfiddle.net/tangobango/rK2mG/> HTML: ``` ...
2013/01/24
[ "https://Stackoverflow.com/questions/14512392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1873217/" ]
The reason you can't use `geom_tile()` (or the more appropriate `geom_raster()` is because these two `geoms` rely on your tiles being evenly spaced, which they are not. You will need to coerce your data to points, and resample these to an evenly spaced raster which you can then plot with `geom_raster()`. You will have ...
answer: data is plotted but is just very small. --- [From here:](http://svitsrv25.epfl.ch/R-doc/library/ggplot2/html/geom_tile.html) ``` "Tile plot as densely as possible, assuming that every tile is the same size. ``` Consider this plot ``` ggplot(data = testdf[1:2,], aes(x,y,fill = z)) + geom_tile() ``` ![en...
11,541,446
I am new to XML and I was hoping someone could point me in the right direction on this. So an order comes in from our partner company, B2B turns it into XML and gives it back to us. It would more then likely just end up in a folder somewhere on our server or maybe the mailbox. We need to render each individual XML into...
2012/07/18
[ "https://Stackoverflow.com/questions/11541446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1521975/" ]
The difference is that when you put it on the prototype, *all* instances of `Person` share the same code for `getName` -- you can change `getName` on *all* instances of `Person` by assigning something else: ``` Person.prototype.getName = function() { return 'Mr Jones' }; ``` Also, since they share the same code, it'...
In class-based words the difference between declaring a function via `prototype` and `this` would be something like this: **prototype:** the function of the instance would look like this: ``` somefunc = function(){super()/*call the function of the super-class*/}; ``` **this:** the function of the instance would l...
71,312,050
I have a ListBody which has a `Text` element and then a `String` which is returned by an API. Such as.. ``` Destination: $destination Destination: London ``` However, if it is longer is spills over as such ``` Destination: London Paddington Station ``` How is best to ensure that if the text is long enough to re...
2022/03/01
[ "https://Stackoverflow.com/questions/71312050", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15425619/" ]
`select distinct SupervisorENO from EMPLOYEE` will also return NULL, any any value when compared to NULL will not actually return True or False, it will return *unknown*, so to speak. You can read more about that [here for example](https://www.xaprb.com/blog/2006/05/18/why-null-never-compares-false-to-anything-in-sql/)...
You can simply query ``` select Ename from employee where SupervisorEno is not null; ``` which will return those who have a supervisor, ie. are not themselves a supervisor. ``` select Ename from employee where SupervisorEno is null; ``` Will return the supervisors. It is better to avoid sub-queries when not st...
177,558
Something like this is on my mind: I put one or a few strings in, and the algorithm shows me a matching regex. Is there an "*easy*" way to do this, or does something like this already exist? ***Edit 1***: Yes, I'm trying to find a way to generate regex. ***Edit 2***: Regulazy is not what I am looking for. The commo...
2008/10/07
[ "https://Stackoverflow.com/questions/177558", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25730/" ]
How about the following (matches every string)? .\*
Look at [txt2re](http://txt2re.com). This site holds a form that takes a sample string and generates a regex pattern that can match the given string. Then it generates the corresponding script for the following languages: Perl, PHP, Python, Java, Javascript, ColdFusion, C, C++ Ruby, VB, VBScript, J#.net, C#.net, C+...
52,458,939
I have a small Android app which uses AdMob. It has been working fine for a while. Recently, I tried to add some new features, and at the same time to upgrade all used libraries to most recent version. But I have a problem with AdMobs. I did put `implementation 'com.google.android.gms:play-services-ads:15.0.1'` into ...
2018/09/22
[ "https://Stackoverflow.com/questions/52458939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5316307/" ]
I think I've solved it. Somehow I figured it is ItelliJ Idea issue, so I've searched around, found some similar topics that have given me a clue. And it worked. There is a hidden folder below project folder called `.idea`. And `libraries` folder below. Full of .xml files gradle made through build process. And I dele...
If you use Android Studio. press shift key twice. then search "cache" and run "Invalidate Caches / Restart..."
7,016,937
After successfully installing the ruby-0ci8 gem and the oracle\_enhanced adapter gem I get the following error when I try to fire up my rails project server: ``` => Booting WEBrick => Rails 3.0.3 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server Exiting /...
2011/08/10
[ "https://Stackoverflow.com/questions/7016937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/222468/" ]
Run `sudo apt-get install libaio1`
This issue is noted on the gems list of [platform specific issues](http://ruby-oci8.rubyforge.org/en/PlatformSpecificIssue.html). Your most likely solution is to follow the guide provided on how to set up the [Oracle Instant Client](http://blog.rayapps.com/2009/09/06/how-to-setup-ruby-and-oracle-instant-client-on-snow-...
28,311,030
I have a script to trigger a job on Jenkins remotely using a token. Here is my script: ``` JENKINS_URL='http://jenkins.myserver.com/jenkins' JOB_NAME='job/utilities/job/my_job' JOB_TOKEN='my_token' curl "${JENKINS_URL}/${JOB_NAME}/buildWithParameters?token=${JOB_TOKEN}" ``` **After I run it, I get following respons...
2015/02/03
[ "https://Stackoverflow.com/questions/28311030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1881450/" ]
I solved this problem using polling of the Jenkins server. When a job is started remotely the return headers has the job queue URL. Using this one can make more API calls to get status. Steps: * start the job * parse return 'Location' header * poll the queue looking for job to start + job queue entry will have an 'e...
I had similar problem to get state with rest api only. this was my solution (it is a **weak and not stable** solution!): ```sh #Ex. http://jenkins.com/job/test JOB_URL="${JENKINS_URL}/job/${JOB_NAME}" #here you can ask for next build job number function getNextBuildNr(){ curl --silent ${JOB_URL}/api/json | grep...
2,321,118
I am using setInterval and the jQuery load function to periodically update an image tag. ``` var refresh_days = setInterval(function() { $('#box_name').load("dynamic.php");}, 1000 ); ``` This works, but there is a slight delay before the new image is fully loaded, during which nothing is shown. Is there a way ...
2010/02/23
[ "https://Stackoverflow.com/questions/2321118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84398/" ]
You could load the image into an invisible `<img>` tag, and use the "load" event to update the visible one. ``` $('#hiddenImage').attr('src', newImageUrl).load(function() { $('#realImage').attr('src', newImageUrl); }); ``` That way you know it's in the cache, so the update to the visible image should be pretty qui...
I'm thinking `.load` may be causing problems for you since you're actually reloading the entire HTML structure within that section of your HTML code. Instead of using `.load`, I'd try using the `jQuery.ajax()` method. Attach a method to the `success` option which takes the returned image and swaps it in over the old o...
72,868,708
Supposing i have 3 tables in the below picture that joined together. how can i access 'Email' field in 'Users' table in my query on 'UserReferralJoins' table ? can any one help me? ``` var referalId = await _dbContext.UserReferrals.Where(x => x.UserId == CurrentUserId).Select(x => x.UserReferralId).FirstOrDefaultAsyn...
2022/07/05
[ "https://Stackoverflow.com/questions/72868708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8315431/" ]
Replace any combination of spaces and commas with a single underscore: ``` sed -E 's/[, ]+/_/g' ``` See [live demo](https://ideone.com/0dbddF). --- To rename files using this regex on *any* \*nix OS (macos doesn't ship with `rename`): ``` for f in *.txt; do mv $f $(echo "$f" | sed -E 's/[, ]+/_/g'); done ``` If...
One line solution here: ```bash find *.txt | sed -E 'p;s/[, ]+/_/g' | tr '\n' '\0' | xargs -0 -n2 mv ``` This is a very useful command template for batch renaming files: ```bash find ... | sed 'p;s/...' | tr '\n' '\0' | xargs -0 -n2 mv ```
41,637,697
I'm using awscli (S3 Api) to operate some requests with my softlayer objectstorage. I can retrieve the buckets list, create or delete bucket. When i try to copy a sample file to a specific bucket, i'm getting an error : `aws --endpoint-url=https://s3-api.us-geo.objectstorage.softlayer.net s3 cp test.txt s3://my_test_bu...
2017/01/13
[ "https://Stackoverflow.com/questions/41637697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4904189/" ]
That's odd - you appear to be using the correct syntax. How are you passing your credentials? The easiest way would be in a `~/.aws/credentials` file that contains: ``` [default] aws_access_key_id = {Access Key ID} aws_secret_access_key = {Secret Access Key} ``` If you are getting the same error across different too...
The reason why you got the error may be the signature version is different. IBM Cloud Object Storage using signature version 2 but the default version is 4. <http://docs.aws.amazon.com/general/latest/gr/signature-version-2.html> I'm not sure how to set the signature version by curl and python. In SDK for Java, y...
1,027,938
One of the questions in my topology homework starts with: Suppose $G$ is a graph and $L \subset G$ is an embedded circle. I have looked around and found lots of definitions for an 'embedding' but am still a bit confused as to what embedded means. Going by what I have seen for definitions of embedding, does it mean t...
2014/11/18
[ "https://math.stackexchange.com/questions/1027938", "https://math.stackexchange.com", "https://math.stackexchange.com/users/136586/" ]
The course [Measure Theory](http://www.essex.ac.uk/maths/people/fremlin/mt.htm) by D.H.Fremlin includes TeX source. [Topology Course](http://at.yorku.ca/i/a/a/b/23.htm) by Aisling McCluskey and Brian McMaster in HTML. Diverse [lecture notes](http://www.maths.tcd.ie/~houghton/231/07-08/notes.php) by Conor Houghton. [...
Many of the courses in MIT's OCW have such notes: <http://ocw.mit.edu/courses/find-by-department/>
4,950,531
I'm creating a login form with Codeigniter, and I have a controller that collects the inputs from the form, then I want to check to make sure what the user entered is in the database, so I'm collecting those values in the post and want to send them to the model for the database connection. Then if the results are in th...
2011/02/09
[ "https://Stackoverflow.com/questions/4950531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348092/" ]
In any MVC form POST is sending to controller (in action property in form) and controller (as the name is decribed) controls what will happend, in your case should ask database for verification via model, get response, decide what to do, and use view to display results... so in your controller: ``` function do_login...
I would add 2 parameters to `check_login` and make it boolean: ``` function check_login($user, $password) { $sql = $this->db->query("SELECT * FROM members WHERE loin = '?' AND password = '?'", array($user, $password)); if (...) return TRUE; else return FALSE; } ``` Make it boolean lets ...
7,209,361
I am looking for a simple way to collaborate between a team of programmers developing with C# ASP.NET using Visual Studio 2010. I currently use TFS at my other job, and its easy enough so I can download the current files and check them out or check them in etc. Is there a free tool out there that provides the same func...
2011/08/26
[ "https://Stackoverflow.com/questions/7209361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/372519/" ]
I believe the closest to TFS, and the one I use at work is Subversion: <http://subversion.apache.org/> There is also a Windows Explorer plugin called TortoiseSVN: <http://tortoisesvn.tigris.org/> And a VS plugin, though last time I tried this it was nowhere near as usable as TortoiseSVN (though this was a few years...
[Collabnet](http://www.open.collab.net/) (makers of [Subversion](http://www.open.collab.net/products/subversion/)) have a neat plugin for Visual Studio called [AnkhSVN](http://ankhsvn.open.collab.net/), so it will feel similar to TFS. If you and your other developers want an integration environment that links with Sub...
31,612,406
I have a list of teasers looking like this: ``` <ul> <li> <a href="#"> <article> <h1>Title of Video</h1> <img src="thumbnail.jpg"> <p>Something about the video</p> </article> </a> </li> <li> <a href="#"> <article> <h1>Title of Video</h1> <img ...
2015/07/24
[ "https://Stackoverflow.com/questions/31612406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/388026/" ]
Here is the idea, to use special template class `map_unpacker`, it not suppose to be completed in any sense, just to show the idea: ``` #include <tuple> #include <string> #include <iostream> #include <unordered_map> #include <tuple> #include <algorithm> template<typename T1, typename T2> struct map_unpacker { typ...
You can change your for loop as follows: ``` for(const auto& ele: map) std::cout<< ele.first<<"->"<<ele.second<<"\n"; ``` **EDIT** ``` for(const auto& x : map) { std::tie(y,s)=x; std::cout << y << "->" << s << "\n"; } ```
65,864
I have a fragment shader, when I've carefully managed to remove most branching decisions, as I have found out through research here that they are bad. But I have one function that I just can't work out how to do it without them. The function takes in a HSV vector, and 'expands' it. By that I mean any Value (V of HSV)...
2013/11/14
[ "https://gamedev.stackexchange.com/questions/65864", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/39022/" ]
You can do it easily with a couple of saturates: ``` newValue = saturate(HSV.z * 2.0); //double value 0.0 to 0.5 => 0.0 to 1.0 newSaturation = (1.0 - (saturate(HSV.z - 0.5) * 2.0)) * HSV.y; ``` The first line is relatively simple to understand. Saturate will clamp the result to the 0-1 range so values bigger than 0....
**For PC and console GPUs, branches aren't bad; they can often improve performance.** Typically, for a simple branch like this, the hardware will just run both sides for each pixel and then pick the result. Unless your shader is ALU bound (most are texture-bound), you will see absolutely zero performance from removing ...
9,887,919
I'm going to upload my vimrc to githug. But some settings is not general(e.g. on slower machine I dont use cursorcolumn) So I don't want to put all my settings in one file. How to do this? Is there something like 'source' in bash?
2012/03/27
[ "https://Stackoverflow.com/questions/9887919", "https://Stackoverflow.com", "https://Stackoverflow.com/users/590083/" ]
I think the simpliest way is to exucute a `String.split(",")` and count the size of array. So the instruction willl look like this : ``` String s = "1234,56,789"; int numberofComma = s.split(",").length; ``` Regards, Éric
``` public class OccurenceOfChar { public static void main(String[] args) throws Exception { // TODO Auto-generated method stub BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter any word"); String s=br.readLine(); char ch[]=s.toCharArray(); Map ...
66,615,409
I am working on some rest apis which are being developed in spring boot and data jpa. The database which is an oracle backed is *supposed to be modified out side of the jpa*. The problem I am having is the change made to the database out side the jpa is not propagating to the entities. I tired doing below but none work...
2021/03/13
[ "https://Stackoverflow.com/questions/66615409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2450410/" ]
Variable `int a` is not a field but, as you said, variable and immediately after the constructor will finish it's not accessible anymore and definitely not by `obj.a` You should move it's definition outside the constructor (so basically create **field** `a`) if you wish to use it this way [What is the difference betw...
It'a just a member variables, which doesn't belong to obj, u should declare a as local variables: ```java public class Test{ public int a = 5; public Test() { } } ```
65,224,876
If I generate *n* random numbers in the interval [0,1] then the mean will be around 0.5 and they will be uniformly distributed. How could an algorithm/formula look like if I want to get *n* random numbers still in the interval [0,1], however, e.g. with a mean of 0.6. They should still be distributed as uniformly as pos...
2020/12/09
[ "https://Stackoverflow.com/questions/65224876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6522992/" ]
This is more of a statistics question: you don't want a uniform distribution, but rather a different distribution that is similar but different from the uniform. Just with your explanations, there are different distributions that could correspond to what you ask, for example you could make a density function with a smo...
You could do this by taking your sample first, then finding the number which, when the sample is raised to this power, gives it the desired mean. You can find this number using `optimize` and wrap it all in a handy function: ```r runif_skew <- function(n, mean) { y <- runif(n) o <- optimize(function(x) sapply(x, f...
50,993,321
We currently prepare a release for QA by merging from Dev as follows using GitHub and manually doing the following: * go to the repository * request a pull on the repo (click Pull Request) * set up merge of Dev into QA (select QA on the left, Dev on the right) * add a comment "Merging Dev into QA" and click Create Pul...
2018/06/22
[ "https://Stackoverflow.com/questions/50993321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1476792/" ]
If you want to do this with `hub` like you suggested, you can simply: * Make a file `pull_request_template.md` with content `Merging Dev into QA`. If you'd like, you can add more lines to the file, and the first line will act as the title, the rest will be the body. * `hub pull-request -F pull_request_template.md -b D...
I am not sure about "including the record of the pull request"(because it's a ul version of the merge) but I have my own script to release hope helps you: ``` git checkout dev ``` to switch dev branch ``` git fetch https://gitlab.com/xx/xx.git ``` fetch changes on upstream of the master branch ``` git commit -a...
41,118
In several 4th edition books, I have seen traps and diseases, such as Deathsong (Book of Vile Darkness p33) or a magic crossbow turret. Is there a way for a character to learn how to create and use them? Or is it only for the Dungeon Master's use?
2014/06/18
[ "https://rpg.stackexchange.com/questions/41118", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/4566/" ]
Unfortunately, "real" traps violate 4e's action economy. However, for your specific example, the crossbow turret, it is possible. The Artificer has the power: [Animate Arbalester](http://www.wizards.com/dndinsider/compendium/power.aspx?id=7664) which animates a crossbow she's holding so it can make attacks as a minor ...
**Technically, No** I don't think there's a way you can do this with only the rules-as-written, but that's because I can't find the required elements, not because there's anything in the rules to prevent it. **Added Content** That being said, I think you can add this into your game through creating new content witho...
15,112,458
I have never used Flash before but have been given an FLA file which I would like to convert to an AVI file and upload to Youtube. When the file is opened in Adobe Flash CS6, only 1 frame appears in the timeline. I have discovered that one of the layers on the timeline is a movieclip. If I go to library in the righ...
2013/02/27
[ "https://Stackoverflow.com/questions/15112458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1554699/" ]
You haven't initialized `carBootSaleList` in your code anywhere. You can either instantiate it in the method or with the declaration. ``` CarBootSaleList carBootSaleList = new CarBootSaleList(); ```
You have not initialized carBootSaleList. ``` CarBootSaleList carBootSaleList = new carBootSaleList(); ```
10,948,594
i'm trying to join a few tables together with following code ``` var result = (from n in db.tbl_NAWs join s in db.Status on n.Status equals s.StatusID join a in db.tbl_Afdelings on n.Afdeling equals a.ID_Afdeling join l in db.Locaties on n.Locatie equals l.LocatieID ...
2012/06/08
[ "https://Stackoverflow.com/questions/10948594", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1063968/" ]
**Problem 1 :** Different applications use different scales for HSV. For example gimp uses `H = 0-360, S = 0-100 and V = 0-100`. But OpenCV uses `H: 0-179, S: 0-255, V: 0-255`. Here i got a hue value of 22 in gimp. So I took half of it, 11, and defined range for that. ie `(5,50,50) - (15,255,255)`. **Problem 2:** And ...
Here's a simple HSV color thresholder script to determine the lower/upper color ranges using trackbars for any image on the disk. Simply change the image path in `cv2.imread()`. Example to isolate orange: [![enter image description here](https://i.stack.imgur.com/SKIkW.jpg)](https://i.stack.imgur.com/SKIkW.jpg) ``` i...
8,819,229
I'm converting af Crystal report to a MS report. My expression in the Crystal report was like this: ``` =IIF(Fields!foo.Value Is Nothing and Fields!bar.Value Is Nothing, 0, IIF(Fields!foo.Value Is Not Nothing and Fields!bar.Value Is Nothing, Fields!foo.Value, IIF(Fields!foo.Value Is Nothing and Fields!bar.Value Is Not...
2012/01/11
[ "https://Stackoverflow.com/questions/8819229", "https://Stackoverflow.com", "https://Stackoverflow.com/users/306028/" ]
You should be able to simplify your expression to: ``` IIF(Not Fields!foo.Value Is Nothing, Fields!foo.Value, IIF(Not Fields!bar.Value Is Nothing, Fields!bar.Value * -1, 0)) ``` EDIT: To return foo.Value - bar.Value when neither is null, try: ``` = IIF(Not Fields!foo.Value Is Nothing, Field...
Try this: ``` =IIF((Fields!foo.Value.Equals(System.DBNull.Value)), "YES", "NO") =IIF((Fields!foo.Value is System.DBNull.Value), "YES", "NO") ```
44,815,139
I am trying to push an app to Heroku using the CLI. When I enter the command `git add .` in the terminal, I keep getting this error: ``` /Users/me/.config/git/ignore': Permission denied '/Users/me/.config/git/attributes': Permission denied ``` Can anyone help?
2017/06/29
[ "https://Stackoverflow.com/questions/44815139", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8128359/" ]
Here's how I solved it: 1. In Terminal `cd` to the User director with `cd ~`. 2. Change the directory permissions with `sudo chmod 755 .config` 3. Enter your login password.
sudo chmod -R 777 /path/to/dir worked for me.
11,635,402
I've been stuck for a while now. I have searched a lot and I can't find the easiest way to test entity classes or JPA operations against a postgres database. I've found how to using Spring, Mockito and other things, but I can't find the simplest way using pure Java. I have the following JUnit test: ``` public class ...
2012/07/24
[ "https://Stackoverflow.com/questions/11635402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1238957/" ]
Quoting [Trouble With Crippled Java EE 6 APIs in Maven Repository And The Solution](http://www.adam-bien.com/roller/abien/entry/trouble_with_crippled_java_ee) by Adam Bien: > > Instead of using > > > ``` <dependency> <groupId>javax</groupId> <artifactId>javaee-web-api</artifactId> <version>6.0</version> ...
In my case under Run Configurations/ClassPath on the the project, click Edit and check "Only include exported entries" that did the trick.
2,458,621
Consider I have an array of elements out of which I want to create a new 'iterable' which on every *next* applies a custom 'transformation'. What's the proper way of doing it under python 2.x? For people familiar with Java, the equivalent is Iterables#transform from google's collections framework. Ok as for a dummy e...
2010/03/16
[ "https://Stackoverflow.com/questions/2458621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3887/" ]
A generator expression: ``` (foobar(x) for x in S) ```
Or by using `map()`: ``` def foo(x): return x**x for y in map(foo,S): bar(y) # for simple functions, lambda's are applicable as well for y in map(lambda x: x**x,S): bar(y) ```
73,067
When learning grammar in school, I was taught that any verb after the word "to" should be in present tense and no participles. i.e. To play instead of to playing, or to sleep instead of to sleeping etc. So, which sentence is correct? > > Looking forward to **see** you. > > > or > > Looking forward to **seein...
2015/11/11
[ "https://ell.stackexchange.com/questions/73067", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/26277/" ]
There's two different things going on here, both of which use the word *to*, which is probably what's confusing you. The rule your teacher taught you applies to infinitives, in the context of sentences where there are two verbs, like > > I like to run. > > > The verb following *to* is in the present tense, as is...
"to" belongs to two different word classes. It can be a preposition + noun/pronoun as in "to someone/to something". And it can be the infinitive particle as in "to be, to have, to do". So it is no good learning "to look forward to" because the learner does not know what follows, a noun or an infinitive. The proper ...
421,633
I have a project comprised of about 20 small `.sh` files. I name these "small" because generally, no file has more than 20 lines of code. I took a modular approach because thus I'm loyal to the [Unix philosophy](https://en.wikipedia.org/wiki/Unix_philosophy) and it's easier for me to maintain the project. **In the sta...
2018/02/03
[ "https://unix.stackexchange.com/questions/421633", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/273994/" ]
Even though your project may now be solely consisting of 50 Bash scripts, it will sooner or later start accumulating scripts written in other languages such as Perl or Python (for the benefits that these scripting languages have that Bash does not have). Without a proper `#!`-line in each script, it would be *extremel...
> > Is there a way to avoid this alleged redundancy of 20 or 50 or a much greater number of lines of script declarations by using some "global" script declaration, in some main file? > > > There is - it is called portability or POSIX compliance. Strive to always write scripts in portable, shell-neutral way, source...
42,204,375
I have 2 problems. Basic story: I have created a SIMPLE registration and login system. **Problem1:** If I try to register a new account then it says "user registration failed". At the moment it should say that because mysql can't get right information from forms. But problem is that I don't know why. Everything see...
2017/02/13
[ "https://Stackoverflow.com/questions/42204375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7099510/" ]
First of all in your login `PHP` code, you only started a `session` but you didn't tell the from where to direct to if login is successful. Add a `header` to the code. That is; ``` if ($count == 1){ $_SESSION['username'] = $username; header("Location: page.php"); //the page you want it to go to } ``` And you...
Your logic to set the $\_SESSION['username'] requires that the username and password combination exists once in your database. This might sound silly but can you confirm that this is the case (i.e. confirm that you have not created the same username and password combination). Altering the logic to be > 1 would also ge...
38,335,046
Now that CGRectMake , CGPointMake, CGSizeMake, etc. has been removed in Swift 3.0, is there any way to automatically update all initializations like from `CGRectMake(0,0,w,h) to CGRect(x:0,y:0,width:w,height:h)`. Manual process is.. quite a pain. Not sure why Apple don't auto convert this when I convert the code to Cu...
2016/07/12
[ "https://Stackoverflow.com/questions/38335046", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2105910/" ]
The simplest solution is probably just to redefine the functions Apple took away. Example: ``` func CGRectMake(_ x: CGFloat, _ y: CGFloat, _ width: CGFloat, _ height: CGFloat) -> CGRect { return CGRect(x: x, y: y, width: width, height: height) } ``` Put that in your module and all calls to `CGRectMake` will work...
Short answer: don't do it. Don't let Apple boss you around. I *hate* `CGRect(x:y:width:height:)`. I've filed a bug on it. I think the initializer should be `CGRect(_:_:_:_:)`, just like `CGRectMake`. I've defined an extension on CGRect that supplies it, and plop that extension into *every single project* the instant I ...
281
I've got an old SunBlade 100 workstation that I'm trying to install OpenBSD on. The first step in the process is to bring up the OpenFirmware prompt to select the boot medium, which you do by pressing `STOP`+`A`. The computer didn't have a keyboard when I bought it, but I found one that will work. However, it doesn't ...
2016/04/25
[ "https://retrocomputing.stackexchange.com/questions/281", "https://retrocomputing.stackexchange.com", "https://retrocomputing.stackexchange.com/users/4/" ]
I only know these a little from messing about with OpenFirmware, but I did run across [this reference that says](http://www.finnie.org/text/computers/sunblade100/): > > One glaring omission by Sun is that you cannot enter OBP from the OS > using a regular USB keyboard. You can enter OBP from the serial > console us...
If you need a custom USB keyboard, this ought to be possible with any microcontroller which implementes a full USB device, so long as you can find the relevant codes to generate - that would maybe be simpler than sourcing the right hardware.
2,474,739
I'm working on a program which uses the System.Diagnostics.Debugger.Break() method to allow the user to set a breakpoint from the command-line. This has worked fine for many weeks now. However, when I was working on fixing a unit test today, I tried to use the debug switch from the command-line, and it didn't work. He...
2010/03/19
[ "https://Stackoverflow.com/questions/2474739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1110905/" ]
I was using `Debugger.Launch()` method and it stopped working suddenly. Using ``` if (Debugger.IsAttached == false) Debugger.Launch(); ``` as suggested in [this answer](https://stackoverflow.com/a/2734204) also did not bring up the debugger. I tried resetting my Visual Studio settings and it worked!
Are you using VS 2008 SP1? I had a lot of problems around debugging in that release, and all of them were solved by this [Microsoft patch](http://support.microsoft.com/kb/957912). > > Breakpoints put in loops or in > recursive functions are not hit in all > processes at each iteration. > Frequently, some processes...
9,243,055
I am puzzling with Amdahl's Law to determine performance gains and the serial application part and fail to figure out this one. Known is the following: ``` S(N) = Speedup factor for (N) CPU's N = Number of CPU's f = The part of the program which is executed sequential S(N) = N / ( 1 + f * ( N - 1 ) ) ``` If I have...
2012/02/11
[ "https://Stackoverflow.com/questions/9243055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1204156/" ]
A classmate of mine gave the (so far working/right) answer for this. I made the following class: REMOVED TO COUNTERACT CONFUSION. This should solve it. EDIT: Ok, the previuos answer is wrong, but I found the solution. You first calculate The part that can be done parallel (it's on wikipedia but it took me a while...
I think you are thinking about it a little wrong if this is the equation you're supposed to be using, so let me try to explain. f is the percentage (aka, 0 <= f <= 1) of the time your program spent in the part of the code that you didn't parallelize in the single core implementation. For example, if you have a program...
38,893,697
I would like to write a function to return a string with html code to customize head title, description and keywords for multiple pages. I started with my `index.php` file and two auxiliary, `_head.php` and `_functions.php`. What do I have to do to implement this function? index.php: ---------- ``` <?php include "_fu...
2016/08/11
[ "https://Stackoverflow.com/questions/38893697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1195909/" ]
**\_functions.php:** ``` function make_head($title, $description, $keywords) { $head = include "_head.php"; return $head } ``` **\_head.php** ``` <head> ... <meta name="description" content="<?php echo $description; ?>" > <meta name="keywords" content="<?php echo $keywords; ?>" > <title><?php echo $title; ?...
You can use include. In your function `make_head`, you can do something like this: ``` function make_head(title, description, keywords) { $html = include "_head.php"; return $html; } ``` When you include something, it loads it to your current state. So if you use `$title` or `$description` or `$keywords` in...
34,828,198
I want to use a full width div, so added container-fluid class which leaves blank space on left and right. I solved it using negative margin left and right. But the problem is the negative margin afftects bootstrap responsive nature. When I resize the left side contents are hidden and there is a horizontal scrollbar on...
2016/01/16
[ "https://Stackoverflow.com/questions/34828198", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5662214/" ]
add `overflow:hidden` to your container.
Another way to mimic <http://www.ichangemycity.com/about-us> and using Bootstraps "content centered" layout. JSFiddle here: <https://jsfiddle.net/osserpse/9L3g1ezw/4/> 1. Keep `.container` to make the text content to center on the view 2. Add a new class, `my-full-width`to `<div class="col-md-10 my-full-width>` where...
26,380
I'm hitting the 4GB limit of FAT32 on USB drives more and more often. However, being able to unplug the device without unmounting it first is a must have for me. I've noticed exFAT recently, however I couldn't find any info on whether drives formatted with exFAT can be unplugged safely without unmounting. Can they?
2009/08/20
[ "https://superuser.com/questions/26380", "https://superuser.com", "https://superuser.com/users/7076/" ]
While it is not 100% safe to remove a FAT volume without unmounting, it is *safer* than NTFS. exFAT [has the following differences](http://www.tech-recipes.com/rx/2801/exfat_versus_fat32_versus_ntfs/) to FAT 32: * File size limit is now 16 exabytes. * Format size limits and files per directory limits are practically...
I'd heard somewhere that on \*nix style OSes, I/O caching is done in such a way that it is much less safe to unplug a disk then on Windows. In my own experience, I have corruption issues (requiring a good `fsck`ing) semifrequently when I unplug drives in OSX. I rarely, if ever, have those issues in Windows, under both...
17,380,317
I developed a java desktop application where the user can manually load a file and press a button to start a simulation process. I want to automate the above two steps so that an external program can iteratively call this desktop application multiple times and run the simulation process without any human intervention e...
2013/06/29
[ "https://Stackoverflow.com/questions/17380317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2429050/" ]
ES6 added a spread operator to JavaScript. ``` function choose(choice, ...availableChoices) { return availableChoices[choice]; } choose(2, "one", "two", "three", "four"); // returns "three" ```
The nearest equivalent is the [`arguments` pseudo-array](http://javascriptweblog.wordpress.com/2011/01/18/javascripts-arguments-object-and-beyond/).
21,402,168
IU am experienced in Java, but new to Objective C, so this might be very stupid. Nevertheless, I have been struggling for a while now, searching for the reason why I get an expected expression error from the following code. ``` CGAffineTransform move = CGAffineTransformMakeTranslation(middleX, middleY); [shapePath app...
2014/01/28
[ "https://Stackoverflow.com/questions/21402168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/835112/" ]
Edit ==== With the extra context that you were using this inside a `switch` statement I know what is wrong. You can't declare variables inside a switch statement without enclosing the cases in curly brackets. You can read about why this is in [this answer](https://stackoverflow.com/a/5163657/608157) (in short, they d...
This code was in a switch clause. When I declared the move variable outside it, it disappeared. Don't know why though. Now it works.
28,216,144
I hope someone can help me to solve the following, probably technical, problem. I use wampserver on my desktop with windows 7, with the documentroot in the OneDrive folder. That works perfectly. Through OneDrive, I synchronize the files in the documentroot with another computer. Now I want to do the same on my tablet...
2015/01/29
[ "https://Stackoverflow.com/questions/28216144", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2232379/" ]
Finally, I arrived at a somewhat unsatisfactory conclusion: it seems that, under Windows 8.1, folders in OneDrive cannot be used inside the WAMP root directory. My question above is an example of that. Another experiment I did was to set back the root directory to the default c:/wamp/www and the place OneDrive within t...
Try this: unckeck the `on demand` option on the `OneDrive` Settings and select directories to sync. wait some minutes.
71,386,334
This is my code: ``` const [focus1, setFocus1] = useState(false); <TextInput style={{ ...styles.input_container, borderColor: `${focus1 ? colors.darkPurple : "#b8b8b850"}`, borderWidth: `${focus1 ? 3 : 1}`, }} placeholder="Enter Username" placeholderTextColor={colors.lightGray} onFocus={() => setFocus1(tru...
2022/03/07
[ "https://Stackoverflow.com/questions/71386334", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11585967/" ]
The crash could be happening because you're giving the styles wrong. The backticks in the style are resulting in the specified values to be quoted twice. Border color would be resolved to this` ``` `"#b8b8b850"' ``` whereas it should be only quoted once. And borderwidth would be resolved into ``` `3` ``` whereas ...
`borderWidth` is supposed to be a number, see <https://reactnative.dev/docs/view-style-props#borderwidth> So you should write `borderWidth: focus1 ? 3 : 1`
15,224,826
I'm using Codeigniter transactions ``` $this->db->trans_start(); $this->db->query('AN SQL QUERY...'); $this->db->trans_complete(); ``` This works fine , the problem I have is that inside the `trans_start` and `trans_complete` I'm calling other functions and those functions deals with database so they contains insert...
2013/03/05
[ "https://Stackoverflow.com/questions/15224826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/503412/" ]
What I tried was more of a trick, but it worked for me. ``` $this->db->trans_begin(); $rst1= $this->utils->insert_function($data); $rst2 = $this->utils->update_function2($test); if($this->db->trans_status() === FALSE || !isset($rst1) || !isset($rst2)){ $this->db->trans_rollback(); }else{ $this->db->trans_c...
Try this procedure. It really work for me :) ``` $this->db->trans_start(); $this->utils->insert_function($data); $this->utils->update_function2($test); if($this->db->trans_status() === FALSE){ $this->db->trans_rollback(); }else{ $this->db->trans_complete(); } ```
26,545,307
I'am noob in sql and I have a question for you. I need to create a count in sql, I tried by no result. So I have a table: ``` Event Participant Participant count Test 123 3 Test 123 3 Test 456 ...
2014/10/24
[ "https://Stackoverflow.com/questions/26545307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3348229/" ]
Problem is in assinging fillRange variable: I have updated it, check and let me know: ``` Sub why_u_no_work() Dim b As Integer Dim lastrowincurrfund As Integer Dim fundslistsym(0 To 0) As String Dim SourceRange As Range Dim fillRange As Range lastrowincurrfund = 142 b = 0 fundslistsym...
I think I have found the solution. The Range.Autofill method does not work if the sheet in which the method is going to be used is not active. So to overcome the probelm one has to just add: `ThisWorkbook.Worksheets(fundslistsym(b)).Activete and that is all... I manged to make the code run, yet I do not under...
2,158,719
I've been asked to help with the following school problem on geometry. In the triangle $\Delta ABC$ one has $AB = 60$, $AC = 80$. Point $O$ is the centre of the circumscribed circle. Point $D$ belongs to the side $AC$. Additionally, one has $AO \perp BD$. One is asked to find $CD$. (just in case, the answer is $35$) ...
2017/02/24
[ "https://math.stackexchange.com/questions/2158719", "https://math.stackexchange.com", "https://math.stackexchange.com/users/340940/" ]
Draw the line $AO$ and let $E$ be the second point of intersection of $AO$ with the circumcircle of triangle $ABC$ (the first point of intersection being $A$). Then $AE$ is the diameter of the circumcircle and therefore triangle $ABE$ is a right triangle ( $\angle \, ABE = 90^{\circ}$ ). Let $H$ be the itnersection poi...
[![enter image description here](https://i.stack.imgur.com/xgjwz.png)](https://i.stack.imgur.com/xgjwz.png) Let $G$ be the point of intersection of $AO$ and $BD.$ $AGB$ is a right triangle. Drop altitudes $OE$ and $OF$ to sides $AB$ and $AC$ respectively Since $AOB$ and $AOC$ are isosceles, these altitudes bisect t...
68,591,567
there I'm new to C. I'm currently reading the K&R. There I got confused by a definition in it about the text streams "*A text stream is a sequence of characters divided into new lines;each line consists of 0 or more characters followed by a newline character*." And trying to knowing about this streams I was introduced ...
2021/07/30
[ "https://Stackoverflow.com/questions/68591567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14977752/" ]
You have three streams in C, `stdin`, `stdout`, and `stderr`, you can also think of files you have opened with `fopen` for example as a stream. `stdin` is generally the keyboard, `stdout` is generally your monitor, `stderr` is generally also your monitor. But they don't have to be, they are abstractions for the hardwar...
Two common abstractions of I/O devices are: Streams - transfers a variable number of bytes as the device becomes ready. Block - transfers fixed-size records. A buffer is just an area of memory which holds the data being transferred.
56,435,515
How do I sort an array by the value of a key and preserve the order if the value is equal. **Array:** ``` Array ( [0] => Array ( [id] => 65 [count] => 2 ) [1] => Array ( [id] => 67 [count] => 500 ) [2] => Array ( [id] => 61 [count] => 225 ) [3] => Array ( [id] => 58 [count] => 2 ) ) ``` **Desired output:** ``` Arr...
2019/06/03
[ "https://Stackoverflow.com/questions/56435515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2068016/" ]
**For Objective-C users** Just Use this code ``` [vc setModalPresentationStyle: UIModalPresentationFullScreen]; ``` Or if you want to add it particular in iOS 13.0 then use ``` if (@available(iOS 13.0, *)) { [vc setModalPresentationStyle: UIModalPresentationFullScreen]; } else { // Fallback on earlier...
If you have a UITabController with Screens with Embeded Navigation Controllers, you have to set the UITabController **Presentation** to FullScreen as shown in pic below [![enter image description here](https://i.stack.imgur.com/kjGa0.png)](https://i.stack.imgur.com/kjGa0.png)
16,775,115
I am trying to count total number of times that each individual column is greater than zero, grouped by the driver name. Right now I have; ``` SELECT drivername , COUNT(over_rpm) AS RPMViolations , COUNT(over_spd) AS SpdViolations , COUNT(brake_events) AS BrakeEvents FROM performxbydrive...
2013/05/27
[ "https://Stackoverflow.com/questions/16775115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2117858/" ]
Use NULLIF to change zero to NULL, count ignores NULL ``` SELECT drivername, COUNT(NULLIF(over_rpm,0)) AS RPMViolations, COUNT(NULLIF(over_spd,0)) AS SpdViolations, COUNT(NULLIF(brake_events,0)) AS BrakeEvents FROM performxbydriverdata GROUP BY drivername; ``` You can probably remove the WHERE clause ...
Putting filter predicate[s] inside of a Sum() function with a case statement is a useful trick anytime you need to count items based on some predicate condition. ``` Select DriverName, Sum(case When over_rpm > 0 Then 1 Else 0 End) OverRpm, Sum(case When over_spd > 0 Then 1 Else 0 End) OverSpeed, Sum(case ...
30,322,885
I am just looking on a chat application which is given in the <https://github.com/nwah/peerjs-audio-chat> Actually its quite intresting to chat with just two browsers. I have some doubts regarding this peer js. I got also my free Api key from there website I just started the application with the instructions given in...
2015/05/19
[ "https://Stackoverflow.com/questions/30322885", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3024251/" ]
You can write simply ``` for(int i = 0; i < VERTICES_NR; i++) ^^^ _vertices[i] += temp; ``` If you want to define the subscript operator then it can look like ``` Vector & operator []( int n ) { return _vertices[i]; } const Vector & operator []( int n ) const { return _vertices[i]...
The overloaded operator function can be called explicitly by its name, like this: ``` operator[](i) = operator[](i) + temp; ```
5,081,502
How do you store a object with size bigger than 1 MB in memcache? Is there a way to split it up, but have the data still be accessible with the same key?
2011/02/22
[ "https://Stackoverflow.com/questions/5081502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/575944/" ]
I use the following module ("blobcache") for storing values with sizes greater than 1Mb in GAE's memcache. ``` import pickle import random from google.appengine.api import memcache MEMCACHE_MAX_ITEM_SIZE = 900 * 1024 def delete(key): chunk_keys = memcache.get(key) if chunk_keys is None: return False chunk_...
A nice workaround is to use layer\_cache.py, a python class written and used at Khan Academy (open source). Basically it's a combination of in-memory cache (cachepy module) with memcache being used as a way of syncing the in-memory cache through instances. [find the source here](https://code.google.com/p/khanacademy/so...
54,813,803
The problem I have may be a fairly obvious one but im new to c# and coding in general. I have looked around online but I couldn't find anything that could help me. This is a demo code I prepared for the situation im in. ``` class Program { class Person //The class { public s...
2019/02/21
[ "https://Stackoverflow.com/questions/54813803", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11092295/" ]
there is no meaning of having class inside class (`Person` class in `Program` class) if you need to access `Bob` within same class check the code below ``` public class Person { public string jobTitle = "Cashier"; public void Greet() { Console.Write...
your problem is a matter of scope and context. It's common to have these problems at first starting with programming. Pointing out why you cannot access Bob in the second method: ``` class Program { class Person //The class { public string jobTitle = "Cashier"; ...
82,713
I often see extremely beautiful and sharp portraits like these: I was wondering what makes them so sharp and beautiful: Camera quality? Lighting? Post-processing? Luck? How would I go about if I want to take a photo like one of these? [![enter image description here](https://i.stack.imgur.com/bf7tS.jpg)](https://i....
2016/09/10
[ "https://photo.stackexchange.com/questions/82713", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/56577/" ]
Camera quality? No. Any recent DSLR like camera can do it, even MFT. Lighting? Yes, good light is key-essential in any photography, this is no exception. Post-processing? Yes/No, post-processing of RAW files yes, but it can be done in camera as jpeg files - but that's kind of a PP as well. Luck? Nope,skills more...
Here is one tip for sharpening without looking fake in post. Duplicate the layer in PS. Go to Filter > Other > High Pass. Set it to lightly show the edges only. Apply it and set that layer to Overlay, Use opacity to control how much you want to sharpen the image.
402,359
Can you simply delete the directory from your python installation, or are there any lingering files that you must delete?
2008/12/31
[ "https://Stackoverflow.com/questions/402359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16584/" ]
In ubuntu 12.04, I have found that the only place you need to look by default is under ``` /usr/local/lib/python2.7/ ``` And simply remove the associated folder and file, if there is one!
I just uninstalled a python package, and even though I'm not *certain* I did so perfectly, I'm reasonably confident. I started by getting a list of *all* python-related files, ordered by date, on the assumption that all of the files in my package will have more or less the same timestamp, and no other files will. Lu...
36,559,349
So i've read a handful of SO posts and some blogs, but still can't figure out why my code isn't working. My code: ``` function myFunct(d) { if (typeof d.parent.name == "undefined") { console.log("undefined") ;} else { console.log("defined") ;} } ``` `d` is an object that looks something like: ``` O...
2016/04/11
[ "https://Stackoverflow.com/questions/36559349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3469243/" ]
If you want an undefined-safe check all the way down your object tree, you can use: ``` if( typeof( ((d || {}).parent || {}).name ) === 'undefined') { } ``` If you have the luxury of having Lodash at your disposal: ``` var d = { parent: { name: "Joe" } }; if ( typeof (_.get(d, "parent.name"))...
I believe the error is the property identifier `parent`. Are you sure your object has the property? The identifier `d` may be invalid because `parent` doesn't exists.
2,513,165
I got nabbed by the following bug *again* and would like some clarification to exactly why it is a bug. I have a simple UITableView that loads some data: ``` // myclass.h @property (nonatomic, retain) NSArray *myData // myclass.m @synthesize myData; - (void) viewDidLoad { ... myData = someDataSource // note the...
2010/03/25
[ "https://Stackoverflow.com/questions/2513165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26849/" ]
Bazaar's biggest strength over all other system is its flexibility. For example, developers can work in either traditional centralized mode, or they can work in the newer-style, distributed mode. Oh, and they can do it simultaneously on the same repository. Oh, and they can switch back and forth as much as they like. ...
Bazzar work slow on large project with huge history (bzr log on file from Emacs sources take 1 minute!). And have inefficient http:// protocol (designed for local net connection, require ~5 MiB of traffic at least for any remote operation).
54,467,980
I'm working on a `RecyclerView` and I want to add a half line, picture & half line before it. However I have no idea of how to reproduce it. Can you please help me to get a similar shape? [![half line + pictogram + half line](https://i.stack.imgur.com/jaBCr.png)](https://i.stack.imgur.com/jaBCr.png)
2019/01/31
[ "https://Stackoverflow.com/questions/54467980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10088784/" ]
You didn't instantiate Workload. ``` w1 = Workload() ```
Yep, as Daniel said, you didn't instantiate Workload. Also in the **init** you are using self to initiate workload and totalchore, then, as you are not recieving it for parameter, those variables are going to nowhere.
22,950,254
I know how to count lines using grep which match certain parameters and does not match certain parameters separately. But how can we combine this functionality. For Example: ``` Name Date Value A 04-08-2014 1000 B 04-08-2014 2000 C 04-06-2014 3000 D 04...
2014/04/08
[ "https://Stackoverflow.com/questions/22950254", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1337072/" ]
Using `awk`: ``` $ awk '$2=="04-08-2014" && $3!="2000" {count++}END{print count}' file 2 ```
> > grep "04-08-2014" file | grep -vc "2000" > > >
58,805,196
I currently have a `ul` acting as the navbar. I want it to open with the click of a button by changing its width, but it's not working. When the button is clicked nothing happens, however it should change the width and make the `ul` appear. ```js function openNav() { document.getElementByClass("nav").styl...
2019/11/11
[ "https://Stackoverflow.com/questions/58805196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11780944/" ]
There is no such thing as `getElementByClass()`, you should use `getElementsByClassName()` instead, like in this code example: ``` function openNav() { document.getElementsByClassName("nav")[0].style.width = "250px"; } function closeNav() { document.getElementsByClassName("nav")[0].style.width = "0px"; } ```
You can make so ``` <button onclick="openNav()">Open Nav</button> <ul id='nav'> <li><a href="{% url 'sheets:list' %}" class="">Nav Element</a></li> </ul> </ul> <button onclick="openNav()">Open Nav</button> <ul id="nav"> <li><a href="{% url 'sheets:list' %}" class="">Nav Element</a></li>...
291,403
I'm trying to do a supervised classification in ArcGIS Pro that will allow me to find Tar and Gravel rooftops in Miami. I have Landsat data but just wondering if there is imagery out there with better spatial resolution that might work better?
2018/08/01
[ "https://gis.stackexchange.com/questions/291403", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/125976/" ]
If I change the size of the layer panel, the problem goes away. Same thing in a print layout, just change the size of the right side panel and it goes back to normal.
Resizing the panels, and the entire window, did the trick for me. A tad weird, but possibly the result of the version upgrade...important for me, as I have a 30" monitor, and I need to do big maps.
14,421,259
In this loop, I am iterating through an ArrayList of type `Entity`, which contains objects of type Entity as well as objects of type Projectile, which extends Entity. I want the below code to be executed if the object is an instance of Projectile. However, the `getVelocity()` method is only in the subclass Projectile, ...
2013/01/20
[ "https://Stackoverflow.com/questions/14421259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1562138/" ]
This seems to be a loop that updates your entities in some way every tick of your game engine. In my opinion, a cleaner solution would be: ``` class Entity { ... public void update() {} ... } class Projectile extends Entity { ... @Override public void update() { setX(velocity/rawFPS); } ... } ``...
Seriously, Guys? instance of sucks. Every guide on Java tells you that. There's something wrong here: you are looping through a set of entities and altering the internal state of a subset (the subclass instances) using another data item: FPS. If you don't have the FPS when the Projectile is constructed, having this ou...
30,125,781
I have seen that titanium support CoverFlowView in titanium but it works only on ios, Can anyone have idea to achieve CoverFlow in android with titanium Thanks in advance
2015/05/08
[ "https://Stackoverflow.com/questions/30125781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4537150/" ]
`e.originalEvent.clipboardData.getData('text/plain')` works for safari, chrome, firefox and safari and chrome on an Ipad. `window.clipboardData.getData('text')` works for Internet Explorer and Edge. Note: `e.originalEvent.clipboardData.getData('text')` works for desktop browsers but not for mobile browsers. So in th...
``` $("element").on('paste', function (e) { if (window.clipboardData) { pastedText = window.clipboardData.getData('Text') } else if (e.clipboardData || e.originalEvent.clipboardData != undefined) { pastedText = e.originalEvent.clipboardData.getData('text/plain') } } }); ```
60,969,216
I am using Azure Cosmos DB. I have created a simple trigger in Azure Portal as follows: [![enter image description here](https://i.stack.imgur.com/ybDl7.png)](https://i.stack.imgur.com/ybDl7.png) ``` var context = getContext(); var request = context.getRequest(); // item to be created in the current operation ...
2020/04/01
[ "https://Stackoverflow.com/questions/60969216", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2695990/" ]
Firing triggers automatically in relational databases makes sense since there is schema in the database, you kind of know what to handle in a trigger logic. In NoSQL database, since there is no schema, you may end up with a large script to handle all kind of exceptions. Large script in triggers means higher bills in C...
The only way according to the answers from @Guarav Mantri and @Hasan Savaran is to specify the trigger while creating the item through the API. I have managed to do it in Java Azure SDK like that: ``` RequestOptions options = new RequestOptions(); options.setPreTriggerInclude(Arrays.asList("pre")); documentClient.c...
639,328
I'm a physicist attempting electronics - so please bear with me. I feel I am missing something very very obvious. ![schematic](https://i.stack.imgur.com/0jOzB.png) [simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2f0jOzB.png) – Schematic created using [CircuitLab](https://www.circuitla...
2022/10/21
[ "https://electronics.stackexchange.com/questions/639328", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/272190/" ]
The assumption (simplification) that we make that negative feedback forces the op amp's inputs to be at the same voltage is an approximation we make that is very useful when we try to analyse op amp based circuits to understand their operation/behavior. In reality there will always be small difference voltage between ...
The infinite open loop gain part of the ideal model for an op-amp is not very useful. The discussions around the so called requirement that the input difference must be zero is a distraction. A finite gain leads to better understanding. The equation: $$V\_{\text{out}}=A\_{\text{VOL}}V\_{\text{D}}$$ has meaning only if...
49,447,134
I use SQLite with PHP. With all PHP files in same folder it works. But I want files in different folders: testCreate.php (1st folder): ``` <?php class mySqlite extends SQLite3{ function __construct(){ $this->open('test.db'); } } $db = new mySqlite(); $db->exec("CREATE TABLE IF NOT EXISTS `test` ( ...
2018/03/23
[ "https://Stackoverflow.com/questions/49447134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4450367/" ]
You are getting `NULL` values because you are filtering your sums on the column expression and not on your `WHERE`. The both `NULL` records are those where `is_internal` isn't 1, so both `CASE` won't match it's `WHEN` and return default of `NULL`, instead of calculating the `SUM()`. Try filtering your "not internal" r...
Try this: ``` case when m2.is_internal = 1 then case m1.is_internal when 1 then 'internal volume' when 0 then 'external volume in' end end [type], case when m2.is_internal = 1 then case m1.is_internal when 1 then SUM(CAST([size] AS BIGINT)) when 0 then SUM(...
16,848,931
I just want to find some fastest set bits count function in the php. For example, 0010101 => 3, 00011110 => 4 I saw there is good Algorithm that can be implemented in c++. [How to count the number of set bits in a 32-bit integer?](https://stackoverflow.com/questions/109023/how-to-count-the-number-of-set-bits-in-a-32-...
2013/05/31
[ "https://Stackoverflow.com/questions/16848931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1761178/" ]
You can try to apply a mask with a binary AND, and use shift to test bit one by one, using a loop that will iterate 32 times. ``` function getBitCount($value) { $count = 0; while($value) { $count += ($value & 1); $value = $value >> 1; } return $count; } ``` You can also easily p...
I could figure out a few ways to but not sure which one would be the fastest : * use substr\_count() * replace all none '1' characters by '' and then use strlen() * use preg\_match\_all() PS : if you start with a integer these examples would involve using decbin() first.
62,524,021
I want to ask you a quick question as a followup to my earlier question: [React - syntax confusion to clarify](https://stackoverflow.com/questions/62522496/react-syntax-confusion-to-clarify) code for TodoItem: ``` import React from 'react' export const TodoItem = (props) => { console.log(props) console.log(...
2020/06/22
[ "https://Stackoverflow.com/questions/62524021", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6943311/" ]
Hi you can write it like this ``` return ( <div className="todo-item"> <input type="checkbox" checked={props.todo.completed} /> <p>{props.todo.text} </p> <p>Completed: {props.todo.completed ? 'Yes' : 'No'}</p> </div> ) ```
Any javascript expression you want to evaluate in `JSX` have to be wrapped inside the curly braces`{}`. In your case, you want to evaluate a ternary expression so the whole expression has to wrapped inside the curly braces. For example, ```js <p>Completed: { props.todo.completed ? 'Yes' : 'No' }</p> ```
40,738,026
I'm trying to communicate from a web page to an extension and vice versa. To do so, I looked at the Mozilla documentation here : <https://developer.mozilla.org/fr/Add-ons/WebExtensions/Content_scripts#Communicating_with_the_web_page> And it has a simple example, but I can't make it work. On the web page script, I ha...
2016/11/22
[ "https://Stackoverflow.com/questions/40738026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/969881/" ]
The problem was in the manifest of my extension. I declared my content script as a background script. So, instead of writing this : ``` "background": { "scripts": ["myscript.js"], "persistent": true }, ``` You have to declare the script like this : ``` "content_scripts": [ { "matches": ["<...
I was experiencing similar issues and the problem for me is I was calling the ``` window.postMessage ``` function from within an iframe. After I changed this to ``` top.window.postMessage ``` it started working.
2,158,750
![enter image description here](https://i.stack.imgur.com/oNXwn.jpg) I've tried all the possible side splitter and angle bisector theorem stuff and I still can't come up with the correct answer. I even tried some law of cosine and sine stuff, but nothing. Any help would be gladly appreciated. Thanks.
2017/02/24
[ "https://math.stackexchange.com/questions/2158750", "https://math.stackexchange.com", "https://math.stackexchange.com/users/418637/" ]
Observe triangles $ADE$ and $ABC$ are similar. Since $BC || DE$ and $BF$ is an angle bisector of $\angle \, A$ $$\angle \,DBF = \angle \, CBF = \angle \, DFB$$ so triangles $BDF$ is isosceles with $BD = DF$. Analogously $CE=EF$. Hence the perimeter $P\_{ADE}$ of triangle $ADE$ is $$P\_{ADE} = AD+DF+AE+EF = AD+DB + AE+E...
You can do this with the [angle bisector theorem](https://en.wikipedia.org/wiki/Angle_bisector_theorem) used twice. First observe that $AF$ bisects $\angle BAC$, (because [angle bisectors are concurrent](https://www.algebra.com/algebra/homework/Triangles/Angle-bisectors-of-a-triangle-are-concurrent.lesson)) so continu...
54,499,686
I am trying to get the token value from the following URL `http://localhost:3000/users/reset/e3b40d3e3550b35bc916a361d8487aefa30147c8`. I have a get request that checks if the token is valid and redirects the user to a reset password screen. I also have a post request but when I console `req.params.token`, it outputs `...
2019/02/03
[ "https://Stackoverflow.com/questions/54499686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
In your form in your HTML, you have this: ``` <form action="/users/reset/:token" method="POST"> ``` That's going to make the actual URL that gets requested when the form is posted be: ``` /users/reset/:token ``` There's no code doing any substitution for the `:token` here. That's just getting sent directly to the...
To get a URL parameter's value ``` app.get('/reset/:token', function(req, res) { res.send("token is " + req.params.token); }); ``` To get a query parameter ?token=Adhgd5645 ``` app.get('/reset/?token=Adhgd5645', function(req, res) { res.send("token is " + req.query.token); }); ```
45,497,684
From C++11 standard (15.1.p4): > > The memory for the exception object is allocated in an unspecified > way, except as noted in 3.7.4.1 > > > What if allocation fails -- will it throw `std::bad_alloc` instead? Call `std::terminate`? Unspecified?
2017/08/04
[ "https://Stackoverflow.com/questions/45497684", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6427477/" ]
Current answer already describes what GCC does. I have checked MSVC behavior - it allocates exception on the stack, so allocation does not depend on the heap. This makes stack overflow is possible (exception object can be big), but stack overflow handling is not covered by standard C++. I used this short program to ex...
Actualy it is specified that if allocation for the exception object fails, `bad_alloc` should be thrown and implementation could also call the new handler. This is what is actualy specified in the c++ standard section (§3.7.4.1) you site [[basic.stc.dynamic.allocation]](http://eel.is/c++draft/basic.stc.dynamic.allocat...
5,389,200
Consider a Java String Field named `x`. What will be the initial value of `x` when an object is created for the class x; I know that for `int` variables, the default value is assigned as `0`, as the instances are being created. But what becomes of `String`?
2011/03/22
[ "https://Stackoverflow.com/questions/5389200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/569497/" ]
That depends. Is it just a variable (in a method)? Or a class-member? If it's just a variable you'll get an error that no value has been set when trying to read from it without first assinging it a value. If it's a class-member it will be initialized to null by the VM.
Any object if it is initailised , its defeault value is null, until unless we explicitly provide a default value.
15,652,653
I need to constantly read from my database every 1 second to get the latest values. Here is my code: ``` <?php // connect to the "tests" database $conn = new mysqli('localhost', 'root','','Test'); // check connection if (mysqli_connect_errno()) { exit('Connect failed: '. mysqli_connect_error(...
2013/03/27
[ "https://Stackoverflow.com/questions/15652653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/769870/" ]
I think you are looking for something to have the database "unclosed" when the script has ended. In mysqli you can prepend the hostname by adding p: to use a so called persistant database connection ``` // connect to the "tests" database $conn = new mysqli('p:localhost', 'root','','Test'); ``` Read more about pers...
You might try having it not start the next request until 1 second after the last one finishes by calling `setTimeout()` in the callback like so: ``` function getData() { $.get('test.php', function(data) { var output = data; document.getElementById("output").innerHTML = "Info: " + output; ...
1,223,566
I've got a single statement running on a ASP.NET page that takes a long time (by long I mean 100ms, which is too long if I want this page to be lightning fast) , and I don't care when it executes as long as executes. What is the best (and hopefully easiest) way to accomplish this?
2009/08/03
[ "https://Stackoverflow.com/questions/1223566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/337/" ]
If it's 100ms, then don't bother. Your users can't detect a 100ms delay. --- **Edit:** some explanations. If I remember correctly, 100 milliseconds (1/10 second) is near the minimum amount of time that a human can perceive. So, for the purpose of discussion, let me grant that this 100ms can be perceived by the users...
``` // This is the delegate to use to execute the process asynchronously public delegate void ExecuteBackgroundDelegate(); // [STAThread] static void Main(string[] args) { MyProcess proc = new MyProcess(); // create an instance of our execution delegate ExecuteBackgroundDelegate asynchExec...
5,049,171
``` string dialog_url = "http://www.facebook.com/dialog/oauth?client_id=" + app_id + "&redirect_uri=" + Server.UrlEncode(my_url) + "&scope=" + permission; ClientScript.RegisterClientScriptBlock(typeof(Page), "key", "window.open('"+dialog_url+"','_parent','');"); ``` I use this code for popup permission dialog. When us...
2011/02/19
[ "https://Stackoverflow.com/questions/5049171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/360094/" ]
Tell me if this is what you are looking for... Parent Window: ``` <html> <head> <script language="Javascript"> function showFBWindow(){ url = "allowfbchild.html" newwindow=window.open(url,'name','height=200,width=150'); if (window.focus) {newwindow.focus()} } ...
This is your parent window: ``` <script language="javascript"> function open_a_window() { var w = 200; var h = 200; var left = Number((screen.width/2)-(w/2)); var tops = Number((screen.height/2)-(h/2)); window.open("window_to_close.html", '', 'toolbar=no, location=no, directories...
3,904,486
Is there any way to copy data cells from excel and paste into jqgird or opensource grids so that is saves to database.
2010/10/11
[ "https://Stackoverflow.com/questions/3904486", "https://Stackoverflow.com", "https://Stackoverflow.com/users/274632/" ]
A complete working example using [*Nev Stokes*' given link](https://stackoverflow.com/questions/3904482/match-url-pattern-in-php-using-a-regular-expression/3904514#3904514): ``` public function clickableUrls($html){ return $result = preg_replace( '%\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:...
I looked around and didn't see any that were exactly what I needed. I found [this one](http://regexlib.com/REDetails.aspx?regexp_id=1121) that was close, so I modified it as follows: ``` ^((([hH][tT][tT][pP][sS]?)\:\/\/)?([\w\\-]+(\[\w\.\&%\$\-]+)*)?((([^\s\(\)\<\>\\\"\.\ [\]\,;:]+)(\.[^\s\(\)\<\>\\\"\.\[\]\,;:]+)*(...
13,148,429
I have the following `DataFrame` (`df`): ``` import numpy as np import pandas as pd df = pd.DataFrame(np.random.rand(10, 5)) ``` I add more column(s) by assignment: ``` df['mean'] = df.mean(1) ``` How can I move the column `mean` to the front, i.e. set it as first column leaving the order of the other columns un...
2012/10/30
[ "https://Stackoverflow.com/questions/13148429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1772165/" ]
I liked [Shoresh's answer](https://stackoverflow.com/a/46166838/9075180) to use set functionality to remove columns when you don't know the location, however this didn't work for my purpose as I need to keep the original column order (which has arbitrary column labels). I got this to work though by using [IndexedSet]...
Similar to the top answer, there is an alternative using deque() and its rotate() method. The rotate method takes the last element in the list and inserts it to the beginning: ``` from collections import deque columns = deque(df.columns.tolist()) columns.rotate() df = df[columns] ```
560,968
As the title asks (Windows 7). (How) can I change the time until the screensaver kicks in from the command line? Is it even possible? Normally I am happy with a 5 minute setting, but occasionally I want to make it longer. I would like the two lengths bound to hot-keys (I know how to do that). I guess I could record t...
2013/03/05
[ "https://superuser.com/questions/560968", "https://superuser.com", "https://superuser.com/users/36006/" ]
``` reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v ScreenSaveTimeOut /t REG_SZ /d 600 /f ``` The value 600 is in seconds, = 10minutes Interestingly, as pointed, this works only the first time. On next change, you need to make a new key like so : ``` reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Screen...
In fact, this approach (via registry) doesn't work *until reboot*. Only way to do that *without* PC reboot is to use an API: <https://www.pcreview.co.uk/threads/utility-to-temporarily-change-the-screensaver.2321339/#post-7442568> but APIs can't be used from a command line, i.e. VB script. Here is the reason: <http:/...
109,450
I am trying to deploy a contract using [Deterministic Deployment Proxy](https://github.com/Zoltu/deterministic-deployment-proxy) to a deterministic address. Since all the network has the deployer proxy deployed to it at address `0x7A0D94F55792C434d74a40883C6ed8545E406D12`. In order to deploy a `MY_CONTRACT` I want to c...
2021/09/06
[ "https://ethereum.stackexchange.com/questions/109450", "https://ethereum.stackexchange.com", "https://ethereum.stackexchange.com/users/58288/" ]
When the `block.timestamp` is called from a `view` function, it will return the best block timestamp (the timestamp of the block at the tip of the blockchain. Only when we call it with a non-view or non/pure function (when we call a function that will actually modify the state), then, the `block.timestamp` will refer ...
What happens when we assign the block.timestamp to variable?? Will it change over time
3,425,688
This is a fairly well-documented error and the fix is easy, but does anyone know why Hadoop datanode NamespaceIDs can get screwed up so easily or how Hadoop assigns the NamespaceIDs when it starts up the datanodes? Here's the error: ``` 2010-08-06 12:12:06,900 ERROR org.apache.hadoop.hdfs.server.datanode.DataNode: ja...
2010/08/06
[ "https://Stackoverflow.com/questions/3425688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/118843/" ]
Namenode generates new namespaceID every time you format HDFS. I think this is possibly to differentiate current version and previous version. You can always rollback to previous version if something is not proper which may not be possible if namespaceID is not unique for every formatted instance. NamespaceID also co...
I was getting this too, and then I tried putting my configuration in `hdfs-site.xml` instead of `core-site.xml`. Seems to stop and start without that error now. [EDIT, 2010-08-13] Actually this is still happening, and it is caused **by** formatting. If you watch the VERSION files when you do a format, you'll see (...
58,653,502
I would like to make the text WITHIN a table cell trigger an onclick function using JavaScript. I am able to make the cell itself trigger the onClick event but that is not what I want. ``` var table = document.getElementById(tableName); var row = table.insertRow(0); var cell1 = row.insertCell(0); cell1.innerHTML = "...
2019/11/01
[ "https://Stackoverflow.com/questions/58653502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9681559/" ]
The actual text within a table cell cannot be bound to an event listener as such. If the text within the table cell is in another tag ( such as a paragraph, span, div or whatever ) then you can use a slight trick to test for which element triggered the event by comparing the event `target` and the event `currentTarget`...
use onclick for onClick event ``` cell1.onclick = function () { console.log("onclick"); }; ``` ```js var table = document.getElementById("table"); var row = table.insertRow(0); var cell1 = row.insertCell(0); cell1.innerHTML = "some text" cell1.onclick = function () { console.log("onclick"); }; ``` ...
36,308,040
I am trying to get the bandwidth data for all the softlayer servers under my account. Thanks to `account_servers.rb` I am able to get the server id for all the servers. Now I would like to get the Bandwidth used by the servers for a particular time frame. The data that I am interested is > > <http://sldn.softlayer....
2016/03/30
[ "https://Stackoverflow.com/questions/36308040", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2004189/" ]
Please, try the following `Ruby` examples: ``` require 'rubygems' require 'softlayer_api' server_id = 11498369 # Your SoftLayer API username. SL_API_USERNAME = 'set me' # Your SoftLayer API key. SL_API_KEY = 'set me' softlayer_client = SoftLayer::Client.new(:username => SL_API_USERNAME, ...
Disclamer: I created my own Ruby SoftLayer client, you can check it at <http://github.com/zertico/softlayer> specially for situations like this one where you want to access some specific data (and I'm not SoftLayer staff ;) ) If you'd like to give it a try the code that solves your problem is ps: I'm considering you ...
33,284,509
The IBM MobileFirst Knowledge Center [states that](http://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.1.0/com.ibm.worklight.dev.doc/devref/t_setting_up_push_notification_iOS.html?lang=en) the following servers and port numbers have to be accessible for APNS push notifications to work: * `gateway.sandbox.push.apple...
2015/10/22
[ "https://Stackoverflow.com/questions/33284509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27641/" ]
I am not clear on what is it for, but unlike the Knowledge Center - the tutorial does mention that the MobileFirst Server instance requires that address to be available for it: <https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/foundation/notifications/push-notifications-overview/push-noti...
5223 is required only if the devices are connected over WiFi. "To reach the feedback service, you will need to allow inbound and outbound TCP packets over port 2196. Devices and computers connecting to the push service over Wi-Fi will need to allow inbound and outbound TCP packets over port 5223"
14,507
Other than Biggs telling the commanding officer that Luke the "best bush pilot in the outer rim", what other qualifications did he have to lead the fighter group that took out the Death Star? Both Biggs and Wedge had been in the rebel alliance longer and I'd assume seasoned pilots, at least more so than Luke. Was there...
2012/04/08
[ "https://scifi.stackexchange.com/questions/14507", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/4953/" ]
By the time the "shot heard round the Empire" occurred, Luke's entire squadron was shot down minus Biggs, who had retreated out to counter Vader's TIE squad. Luke was the only one left to take the shot. He didn't lead the squad at all, he just outlasted most of them.
Because Luke is incorporated into the rebel army with a high starting rank in recognition of his having rescued Princess Leia. Remember that Han is also offered a commission, although he refuses.
9,087,116
I have an old 2.1.1 Ruby on Rails application, with the system upgraded to use Ruby 1.8.7. It originally used 1.8.5 or so. I want to upgrade it to Ruby 1.9.x for performance reasons, and possibly to a newer Ruby on Rails as well. I cannot find any easy chart of compatibility between different Ruby versions and Ruby o...
2012/01/31
[ "https://Stackoverflow.com/questions/9087116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52751/" ]
This is an old question, but the fact that rails is tested against a version of ruby is a good indication that it should work on that version of ruby. Since 9th April 2019, stable branches of Rails use Buildkite for automated testing, and the list of tested ruby versions, by rails branch, is: Rails 6.1 * `>= 2.5.0` ...
The Rails Guide on Upgrading Ruby on Rails has a section on [Ruby versions](http://guides.rubyonrails.org/upgrading_ruby_on_rails.html#ruby-versions). This is probably the best source as it is controlled by the Rails core team. As of August, 2016, the Rails Guide reads: > > ### 1.3 Ruby Versions > > > Rails genera...
556,480
I have yearned to use 24-bit colors in the terminal for applications such as Vim. However, xterm is limited to no more than 256 colors, which I have currently been using. I just recently learned that the Konsole terminal actually supports this True Color, but unfortunately I cannot find the correct environment to use t...
2013/02/24
[ "https://superuser.com/questions/556480", "https://superuser.com", "https://superuser.com/users/162554/" ]
Konsole, gnome-terminal (and all vte-based GTK+ 3 terminals since vte 0.35.1), qterminal and st (from suckless) support true colors on Linux, and iTerm2 support it on Mac. Unfortunately there's no termcap/terminfo support for this feature at the moment, and hence there's no correct value for $TERM either. Nor do the s...
Got to Profile -> Environment and add: COLORTERM=truecolor This is what some application will check for. See e.g. <http://lists.jedsoft.org/lists/slang-users/2016/0000014.html>
48,961,825
I have an F5 bigip.conf text file in which I want to change the route domain from 701 to 703 for all lines showing "10.166.201." The route domain is represented by %701 ``` 10.166.201.10%701 10.166.201.15%701 10.166.201.117%701 ``` I am able to do this with bash but the problem is that the "else printf" command (I'v...
2018/02/24
[ "https://Stackoverflow.com/questions/48961825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1776732/" ]
Your iPhone does not have the same *device pixel ratio* as your PC. The canvas will not render at the same resolution as it is displayed, and then can appear blurry. You have to set a css size to your canvas, then, set this size times `window.devicePixelRatio` as the size of the canvas. Finally scale your canvas coor...
how about this? ```js var c=document.getElementById("canvas"); var ctx=c.getContext("2d"); ctx.strokeStyle = "red"; ctx.beginPath(); ctx.moveTo(50,50); ctx.lineWidth = 10; ctx.lineTo(50,100); ctx.closePath(); ctx.stroke(); ctx.beginPath(); ctx.arc(50, 50, 5, 0, 2 * Math.PI, false); ctx.fillStyle = "green"...
8,152,731
I have a program that renames files or folders to lower case names. I have written this code: ``` private void Replace(string FolderLocation, string lastText, string NewText) { if (lastText == "") { lastText = " "; } if (NewText == "") { NewText =...
2011/11/16
[ "https://Stackoverflow.com/questions/8152731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1003464/" ]
Although Windows Filesystems store names case-senstivie they behave case-insensitive on name comparison thus your renaming operation won't work... IF you really need/want to do that you will need to first rename temporarily the file/directory to something different and unique, then rename it "back" to the "lower case ...
Unfortunately this is a windows issue as it is case insensitive as Oded mentions in the comments. What you would have to do is to rename the folder twice. By moving the folder to a new temporary name then back to the lowercase of the original name.
69,526
How do you set the value of a file field when using the entity\_metadata\_wrapper? I've tried doing this in code: ``` $file = new stdClass(); $file->uid = 1; $file->uri = $file_path; $file->filename = basename($file_path); $file->filemime = file_get_mimetype($file_path); $file->filesize = filesize($file_path); $file-...
2013/04/10
[ "https://drupal.stackexchange.com/questions/69526", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/11807/" ]
Well I just found out a **simpler and less ugly looking way to set image**. ``` $image_file = A FILE OBJECT; //Lot of choices here : new stdClass(), file_load, etc $wrapper->FIELD_NAME->file->set($image_file); ``` Just as taxonomy or node/entity reference, the file field name point on a loaded object, thats how I fi...
You have two ways to do it: ``` // By loading the file object in any way $file_obj = file_load($fid); $w_containing_node->field_attachment_content->file->set( $file_obj ); // By passing an array with the fid $w_containing_node->field_attachment_content->set( array('fid' => $fid) ); ``` Here is the source of the inf...
1,468,912
I have 3 different types of data: images, videos, and audio clips. Each one has an associated GPS point, so I have a base class as such: ``` public abstract class Data { public Latitude { get; set; } public Longitude { get; set; } } ``` This is so I can plot everything on a map without worrying about what ki...
2009/09/23
[ "https://Stackoverflow.com/questions/1468912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/135318/" ]
Where did you read that? How would you build an object hierarchy if you were not allowed to derive from classes other than `System.Object`? (It goes without saying that `System.Object` will always be at the top of your class hierarchy in .NET)
While you can use inheritance, I'm not sure data of type Latitude, and Longitude are allowed in plain old CLR/C# objects.
25,390
Is there a way ,or some steps which ensure any custom module/code written in Magento is adhering to all standard/best practices, without it breaking Magento in any case i.e upgrades,extension conflicts etc.
2014/06/28
[ "https://magento.stackexchange.com/questions/25390", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/7909/" ]
You can see the error in browser (if that's what you want to do) by renaming errors/local.xml.sample to errors/local.xml . The exceptions with traces will be shown in browser then.
*it seems this is for a different version of Magento as I do not have var/report* Missing var/report indicates that something is wrong with the file permissions in the var/ directory tree. You will not be able to view the files or find the folder because Magento is being prevented from creating it in the first place a...
5,035,763
I am using `flowLayoutPanel` to have relative location controls. I would like to change the location of control inside the `flowLayoutPanel`. when I say location, I dont mean control1 before control2 or something like that - I mean that if I got 2 controls, lets say `label` and `comboBox` - the `comboBox`'s height is 2...
2011/02/17
[ "https://Stackoverflow.com/questions/5035763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/519002/" ]
You could also set the top margin of the label to (containerHeight-labelHeight)/2
The flow layout is not going to help: it just arranges all controls in a list, adjusting their position to fit in the panel. You can create subgroups by putting controls in a table within the flow layout, or just use a table for maximum control.
58,540,655
How can i convert the below string to JSON using python? ``` str1 = "{'a':'1', 'b':'2'}" ```
2019/10/24
[ "https://Stackoverflow.com/questions/58540655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11889950/" ]
The string in OP's question is not JSON because the keys and values are enclosed by single-quotes. The function `ast.literal_eval` can be used to parse this string into a Python dictionary. ``` import ast str1 = "{'a':'1', 'b':'2'}" d = ast.literal_eval(str1) d["a"] # output is "1" ``` Other answers like <https://s...
``` import json str1 = '{"a":"1", "b":"2"}' jsonData = json.loads(str1) print(jsonData["a"]) ``` Reference : [LINK](http://docs.python.org/3/library/json.html)
47,043,063
So, I have two lists: ``` x =[170 169 168 167 166 165 183 201 219 237 255 274 293 312 331 350] y =[201,168] ``` I want to write a conditional `if` statement that is true only if all the contents of `y` are in `x`. How do I do this? E.g. -- `assert(y[0] in x)` and `assert(y[a] in x)` both give `True`, but `assert(y...
2017/10/31
[ "https://Stackoverflow.com/questions/47043063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7250309/" ]
[Sets](https://docs.python.org/3.6/library/stdtypes.html#set-types-set-frozenset) are better for this: ``` set(y) <= set(x) ``` Note that this relies on your list contents being immutable, as mutable (or, more specifically, *unhashable*) objects cannot be members of sets. As in this case, lists of integers are fine.
If you insist on having them be lists, you can use the `all()` function: ``` all(item in x for item in y) ```
27,306,246
I have a program but I dont know specifically what my mistake is or how to fix it: The question is: Write a program that asks the user to enter a series of numbers separated by commas. The program should calculate and display the sum of all the numbers. For example, if I enter 4,5,6,7, the sum displayed should be 22. ...
2014/12/04
[ "https://Stackoverflow.com/questions/27306246", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Sum should be an int ``` int sum = 0; ``` Your for loop should be ``` for (int i = 0; i < tokens.length; i++) { sum += Integer.parseInt(tokens[i]); } ```
I know I am more than 2 years late but I started learning Java not too long ago and would like to share my solution. :) I used the StringTokenizer class. I hope this helps someone out there in 2017 and onward. ``` import java.util.Scanner; import java.util.StringTokenizer; public class SumOfNumbersInString { pu...
26,426
What's the practical difference between Google Drive and Dropbox? What features does one offer that the other doesn't? Specifically, how well does sharing and permissions work in Google Drive (Dropbox is fairly straightfoward)?
2012/05/04
[ "https://webapps.stackexchange.com/questions/26426", "https://webapps.stackexchange.com", "https://webapps.stackexchange.com/users/5784/" ]
One could sit and write all the features here, but you could also just google around as there are hundreds of post on this right now. [The one from The Verge](http://www.theverge.com/2012/4/24/2954960/google-drive-dropbox-skydrive-sugarsync-cloud-storage-competition) has a more elaborated answer.
I want to point out here that I wish Google Drive gave users the option to open files in Docs or via a native app like Pages. The lack of this option is why I use [Insync](http://Insynchq.com). Insync syncs all Google Docs as .DOC files so I can open them in Pages if necessary. It's rarely necessary, but it's nice to h...
1,688
I want to design a table to store friendship relationship in my web project It should satisfy at least the following 4 conditions: > > who send the add-friend request e.g.(if A TO B then this column will be A) > > > who receive the add-friend request e.g.(if A TO B then this column will be B) > > > current statu...
2011/03/11
[ "https://dba.stackexchange.com/questions/1688", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/1168/" ]
I'd create a table a lot like the one that you have. I'm using SQL Server data types and syntax, you may need to tweak depending on your platform. ``` CREATE TABLE FriendStatus (FriendStatusId BIGINT PRIMARY KEY IDENTITY(1,1), FromUserId BIGINT, ToUserId BIGINT, StatusId TINYINT, SentTime DATETIME2, ResponseTime DATET...
What makes you think your current design is bad? Here is a create table for Oracle: ``` CREATE TABLE IVR.FRIEND ( FRIENDID NUMBER(7) NOT NULL , FROMUSERID NUMBER(7) NOT NULL , TOUSERID NUMBER(7) NOT NULL , STATUSID NUMBER(2) NOT NULL , REQUESTED DATE NOT NULL , CONSTRAINT FRIEND_PK ...
36,560,589
A vampire number is defined here <https://en.wikipedia.org/wiki/Vampire_number>. A number V is a vampire number if: * It can be expressed as X\*Y such that X and Y have N/2 digits each where N is the number of digits in V * Both X & Y should not have trailing zeros * X & Y together should have the same digits as V I...
2016/04/11
[ "https://Stackoverflow.com/questions/36560589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2650894/" ]
In pseudocode: ``` if digitcount is odd return false if digitcount is 2 return false for A = each permutation of length digitcount/2 selected from all the digits, for B = each permutation of the remaining digits, if either A or B starts with a zero, continue if both A and B end in a zero, continue if A*B...
Here are some suggestions: 1. First a simple improvement: if the number of digits is < 4 or odd return false (or if v is negative too). 2. You don't need to sort `v`, it is enough to count how many times each digit occurs O(n). 3. You don't have to check each number, only the combinations that are possible with the di...