Questions Tagged with #Git

Git is an open-source distributed version control system (DVCS). Use this tag for questions related to Git usage and workflows. Do not use this tag for general programming questions that happen to involve a Git repository.

How to merge remote changes at GitHub?

I'm getting following error, whn trying first Github push: [rejected] master -> master (non-fast forward) error: failed to push some refs to '[email protected]:me/me.git' To prevent you from losing h..

Git error: src refspec master does not match any error: failed to push some refs

I am trying to add a file to my repository on BitBucket and I am having trouble. I am using GIT and this is what I type in $ cd lis4368/assignments $ git remote $ git remote -v $ git remote rm orig..

How to apply a patch generated with git format-patch?

I have 2 git local repositories both pointing to the same remote repository. In one git repository, if I do git format-patch 1, how can I apply that patch to the other repository?..

Git reset --hard and push to remote repository

I had a repository that had some bad commits on it (D, E and F for this example). A-B-C-D-E-F master and origin/master I've modified the local repository specifically with a git reset --hard. I..

Git: Installing Git in PATH with GitHub client for Windows

How do I install Git in my PATH when using the GitHub client for Windows? I'm running into errors because apparently Git is not installed in PATH. For example, using Atom, trying to install the Linte..

Viewing unpushed Git commits

How can I view any local commits I've made, that haven't yet been pushed to the remote repository? Occasionally, git status will print out that my branch is X commits ahead of origin/master, but not a..

Git: How to update/checkout a single file from remote origin master?

The scenario: I make some changes in a single file locally and run git add, git commit and git push The file is pushed to the remote origin master repository I have another local repository that is ..

Resolving a Git conflict with binary files

I've been using Git on Windows (msysgit) to track changes for some design work I've been doing. Today I've been working on a different PC (with remote repo brian) and I'm now trying to merge the edit..

Set up git to pull and push all branches

I'd like to push and pull all the branches by default, including the newly created ones. Is there a setting that I can define for it? Otherwise, when I add a new branch, locally and I want to pull i..

How to recover Git objects damaged by hard disk failure?

I have had a hard disk failure which resulted in some files of a Git repository getting damaged. When running git fsck --full I get the following output: error: .git/objects/pack/pack-6863e0a0e4b4ded..

How to close off a Git Branch?

I'm starting out using Git + GitHub. In our distributed team, each member is creating their own branch for each issue/requirement they are allocated. git branch Issue#1 <-- create this branch ..

Found a swap file by the name

When I try to merge my branch with a remote branch: git merge feature/remote_branch I got this message: E325: ATTENTION Found a swap file by the name ".git/.MERGE_MSG.swp" owned by: xxxx..

How to configure Git post commit hook

How to trigger a build remotely from Jenkins? How to configure Git post commit hook? My requirement is whenever changes are made in the Git repository for a particular project it will automatically s..

Resync git repo with new .gitignore file

Is it possible to "refresh" a git repository after updating the gitignore file? I just added more ignorations(?) to my gitignore and would like to remove stuff already in the repo matching the new fi..

Git update submodules recursively

My project struture ProjectA -FrameworkA (submodule) --Twig (submodule of FrameworkA) How I can update submodules recursively? I already tried some git commands (on ProjectA root) git submodule fo..

What is "git remote add ..." and "git push origin master"?

Quite often, Git and Rails looks like magic... such as in the first chapter of Rails 3 Tutorial book, it talks about Git: git remote add origin [email protected]:peter/first_app.git git push origin mast..

Force add despite the .gitignore file

Is there a way to force git to add a file despite the .gitignore file?..

Python Git Module experiences?

What are people's experiences with any of the Git modules for Python? (I know of GitPython, PyGit, and Dulwich - feel free to mention others if you know of them.) I am writing a program which will h..

git clone error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054

I'm having trouble cloning a repo on git. I've been trying for to days and have tried quite a few solutions (in most the problem was slightly different but seemed to apply) but nothing has done anythi..

How can I add an empty directory to a Git repository?

How can I add an empty directory (that contains no files) to a Git repository?..

Is it possible to do a sparse checkout without checking out the whole repository first?

I'm working with a repository with a very large number of files that takes hours to checkout. I'm looking into the possibility of whether Git would work well with this kind of repository now that it s..

Why do I need to do `--set-upstream` all the time?

I create a new branch in Git: git branch my_branch Push it: git push origin my_branch Now say someone made some changes on the server and I want to pull from origin/my_branch. I do: git pull ..

Git adding files to repo

I followed basic Git tutorial and added README file, which worked. Then I copied my project files to the same folder and tried to add them to repository by running git add --all git ci 'test' (my ali..

Using Git, show all commits that are in one branch, but not the other(s)

I have an old branch, which I would like to delete. However, before doing so, I want to check that all commits made to this branch were at some point merged into some other branch. Thus, I'd like to s..

(Mac) -bash: __git_ps1: command not found

I'm trying to change my command promt in terminal. I keep getting the error: -bash: __git_ps1: command not found I've tried it just by typing it into the terminal as is: __git_ps1. I've also tried i..

Git: cannot checkout branch - error: pathspec '...' did not match any file(s) known to git

I'm not sure why I'm unable to checkout a branch that I had worked on earlier. See the commands below (note: co is an alias for checkout): ramon@ramon-desktop:~/source/unstilted$ git branch -a * deve..

In git, what is the difference between merge --squash and rebase?

I'm new to git and I'm trying to understand the difference between a squash and a rebase. As I understand it you perform a squash when doing a rebase...

Automatic prune with Git fetch or pull

If someone deleted a remote branch because the work is over and I don't know, I won't do a git fetch --prune and eventually I will push back the deleted branch. Is there a viable solution for forcing..

Changing the Git remote 'push to' default

I want to change the Git default remote branch destination so I could just git push Instead of: git push upstream Currently this is set to the origin remote and I want to set it to a different r..

Remove last commit from remote git repository

Possible Duplicate: Rolling back local and remote git repository by 1 commit How can I remove the last commit from a remote GIT repository such as I don't see it any more in the log? If fo..

How to push changes to github after jenkins build completes?

I have a jenkins job that clones the repository from github, then runs the powershell script that increments the version number in the file. I'm now trying to publish that update file back to the orig..

Why do I have to "git push --set-upstream origin <branch>"?

I created a local branch for testing Solaris and Sun Studio. I then pushed the branch upstream. After committing a change and attempting to push the changes: $ git commit blake2.cpp -m "Add workaroun..

How can I remove all files in my git repo and update/push from my local git repo?

Is it possible to remove all files in a repository and update it with only the files I have in my local machine? The reason is that, there are certain files that is not necessary in my github and so I..

How to upgrade Git on Windows to the latest version?

I just upgraded to Git for Windows, from my previous version 1.7.9.mysysgit.0. I downloaded the new version from the Git site and installed through the normal Git installer EXE. That said, wh..

Change old commit message on Git

I was trying to edit an old commit message as explained here. The thing is that now, when I try to run rebase -i HEAD~5 it says interactive rebase already started. So then I try: git rebase --conti..

What's the difference between HEAD^ and HEAD~ in Git?

When I specify an ancestor commit object in Git, I'm confused between HEAD^ and HEAD~. Both have a "numbered" version like HEAD^3 and HEAD~2. They seem very similar or the same to me, but are there ..

rebase in progress. Cannot commit. How to proceed or stop (abort)?

When I run: git status I see this: rebase in progress; onto 9c168a5 You are currently rebasing branch 'master' on '9c168a5'. (all conflicts fixed: run "git rebase --continue") nothing to commit,..

Difference between git pull and git pull --rebase

I started using git sometime back and do not fully understand the intricacies. My basic question here is to find out the difference between a git pull and git pull --rebase , since adding the --rebase..

git remote add with other SSH port

In Git, how can I add a remote origin server when my host uses a different SSH port? git remote add origin ssh://user@host/srv/git/example ..

Why am I getting the message, "fatal: This operation must be run in a work tree?"

Just installed git on Windows. I set the GIT_DIR variable to be c:\git\ and verified that this environment variable is maintained by cygwin (i.e. echo $GIT_DIR is what it should be). I went to the fo..

Git: copy all files in a directory from another branch

How do I copy all files in a directory from another branch? I can list all of the files in that directory by doing git ls-tree master:dirname I can then copy all of the files individually by doing..

Should composer.lock be committed to version control?

I'm a little confused with composer.lock used in an application with a repository. I saw many people saying that we should not .gitignore composer.lock from the repository. If I update my libraries ..

Merging 2 branches together in GIT

I've only just started to use GIT and think its wonderful, however I'm a little confused over what the merge command does. Let us say we have a working project in the branch "A". I go home and make ..

ssh: Could not resolve hostname Name or service not known; fatal: The remote end hung up unexpectedly

The process of setting up a GitHub account works just fine but it doesn't work when I try pushing my repository to GitHub. The error message it shows is as follows: ssh: Could not resolve hostname gi..

Git: How to find a deleted file in the project commit history?

Once upon a time, there was a file in my project that I would now like to be able to get. The problem is: I have no idea of when have I deleted it and on which path it was. How can I locate the comm..

How do I view 'git diff' output with my preferred diff tool/ viewer?

When I type git diff, I want to view the output with my visual diff tool of choice (SourceGear "diffmerge" on Windows). How do I configure git to do this?..

git: 'credential-cache' is not a git command

I followed these instructions to the letter, including the part about password caching. It seems like the instructions are wrong, because every time I git push origin master I get this error: git: 'c..

Delete commits from a branch in Git

I would like to know how to delete a commit. By delete, I mean it is as if I didn't make that commit, and when I do a push in the future, my changes will not push to the remote branch. I read git he..

Git resolve conflict using --ours/--theirs for all files

Is there a way to resolve conflict for all files using checkout --ours and --theirs? I know that you can do it for individual files but couldn't find a way to do it for all...

git ahead/behind info between master and branch?

I have created a branch for testing in my local repo (test-branch) which I pushed to Github. If I go to my Github account and select this test-branch it shows the info: This branch is 1 commit ahead..

How can I reset or revert a file to a specific revision?

I have made some changes to a file which has been committed a few times as part of a group of files, but now want to reset/revert the changes on it back to a previous version. I have done a git log ..

How do I set GIT_SSL_NO_VERIFY for specific repos only?

I have to use a git server without proper certificates, but I don't want to have to do env GIT_SSL_NO_VERIFY=true git command every single time I do a git operation. But I would also like to leave ..

Does the target directory for a git clone have to match the repo name?

In other words, I have a repo up on Github called st3_packages ( I want to do a git clone and have it create a directory on my local computer called "Pack..

How do you rename a Git tag?

Today I was looking through the logs for a project and realized that I fat fingered a tag name some time ago. Is there some way to rename the tag? Google hasn't turned up anything useful. I realize I..

Remove specific commit

I was working with a friend on a project, and he edited a bunch of files that shouldn't have been edited. Somehow I merged his work into mine, either when I pulled it, or when I tried to just pick the..

Should I check in folder "node_modules" to Git when creating a Node.js app on Heroku?

I followed the basic getting started instructions for Node.js on Heroku here: These instruction don't tell you to create a .gitignore node_modules, and t..

How is a tag different from a branch in Git? Which should I use, here?

I am having some difficulty understanding how to use tags versus branches in git. I just moved the current version of our code from cvs to git, and now I'm going to be working on a subset of that cod..

How to show first commit by 'git log'?

I have a project which has long history. I want to show the first commit on git. How do I do this?..

How to recover stashed uncommitted changes

I had some uncommitted changes in my development branch and I stashed them using git stash, but there were some changes which were very important among those stashed ones. Is there any way to get back..

Handling file renames in git

I'd read that when renaming files in git, you should commit any changes, perform your rename and then stage your renamed file. Git will recognise the file from the contents, rather than seeing it as a..

How do I fetch only one branch of a remote Git repository?

I'd like to grab a single branch (not all of them) of a remote repository and create a local tracking branch that can track further updates to that remote branch. The other branches in the remote rep..

Git workflow and rebase vs merge questions

I've been using Git now for a couple of months on a project with one other developer. I have several years of experience with SVN, so I guess I bring a lot of baggage to the relationship. I have hear..

Why is Github asking for username/password when following the instructions on screen and pushing a new repo?

I'm the owner of an organization on github and just created a repo and tried pushing but I'm running into an issue where it's asking me for my username even though I can SSH just fine: $ ssh -T git@g..

Commit empty folder structure (with git)

I have data directory in project's root. It has images directory and some files. Here is example: data +-- images ¦ +-- image1.jpg ¦ +-- image2.jpg ¦ +-- image3.jpg +-- results.csv +-- r.tx..

Bitbucket git credentials if signed up with Google

I have an account on that I created by signing up with my Google account. Now everytime I log in I just click "Log in with Google" and that's fine. How can I access my repos from git co..

Where is git.exe located?

I have PyCharm and I am looking around trying to find git.exe to set it up with my repo. What is the PATH to git.exe?..

Git Push Error: insufficient permission for adding an object to repository database

When I try to push to a shared git remote, I get the following error: insufficient permission for adding an object to repository database Then I read about a fix here: Fix This worked for the next p..

How Can I Resolve:"can not open 'git-upload-pack' " error in eclipse?

I am building an android app with the facebook api and I need to import the facebook android sdk. When I want to import this file from github it throws the .."can not list the available branches..'can..

How can I delete all of my Git stashes at once?

How can I delete all of my Git stashes at once? Specifically I mean, with typing in one command...

failed to push some refs to [email protected]

I am getting this error when I am trying push my files into heroku rep. Ive set autocrlf = false already in gitconfig but this problem is still there. i have also tried this solution here but no gain..

Git command to display HEAD commit id?

What command can I use to print out the commit id of HEAD? This is what I'm doing by hand: $ cat .git/HEAD ref: refs/heads/v3.3 $ cat .git/refs/heads/v3.3 6050732e725c68b83c35c873ff8808dff1c406e1 ..

Git ignore local file changes

I've tried both git update-index --assume-unchanged config/myconfig and editing .git/info/exclude and adding config/myconfig however when I do git pull I always get: Updating 0156abc..1cfd6a..

How to merge remote master to local branch

I have a local branch of a project ("configUpdate") that I've forked from somebody else's project and I've done a load of changes on it and would like to merge the changes they've made in to my local ..

Is there a git-merge --dry-run option?

I'm merging in a remote branch that may have a lot of conflicts. How can I tell if it will have conflicts or not? I don't see anything like a --dry-run on git-merge. ..

How to keep a git branch in sync with master

At the moment git is doing my head in, I cannot come up with the best solution for the following. There are two branches, one called master and one called mobiledevicesupport. I want to keep mobilede..

Overwriting my local branch with remote branch

I have completely fubar'd my local branch, and would like to start over. The version on the server is correct. I don't want to start over, I would like to use my local history to fix my huge screwup..

How to view file history in Git?

With Subversion I could use TortoiseSVN to view the history/log of a file. How can I do this with Git? Just looking for history record for a particular file, and then the ability to compare the dif..

Your branch is ahead of 'origin/master' by 3 commits

I am getting the following when running git status Your branch is ahead of 'origin/master' by 3 commits. I have read on some other post the way to fix this is run git pull --rebase but what exactly..

How to Run Terminal as Administrator on Mac Pro

I am using a Mac for the first time and need to run Terminal as an admin. I have installed NodeJs and Git and want to download Phone Gap/Corova but when I try to install Cordova, it comes back with an..

What's the best practice for putting multiple projects in a git repository?

As some reason, I only have one repository to use. But I have multiple projects including java projects, php scripts and Android apps projects. Now my problem is, I have to put them to different su..

How to update a git clone --mirror?

I have created a git repository to mirror a live site (which is a non-bare git repository): git clone --mirror ssh://[email protected]/path/to/repo Now, to keep this mirror clone updated with all ch..

In a Git repository, how to properly rename a directory?

I think it should work to copy the directory to be renamed to a new directory with desired name, and delete the old directory, and git add, git commit and push everything. But is this the best way?..

Detach (move) subdirectory into separate Git repository

I have a Git repository which contains a number of subdirectories. Now I have found that one of the subdirectories is unrelated to the other and should be detached to a separate repository. How can I..

Find out which remote branch a local branch is tracking

See also: How can I see which Git branches are tracking which remote / upstream branch? How can I find out which remote branch a local branch is tracking? Do I need to parse git config outp..

Git on Mac OS X v10.7 (Lion)

I just upgraded my Mac to Mac OS X v10.7 (Lion), and now Git is gone: $ git -bash: git: command not found How can I get Git back?..

Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch

I am using Git. I did a pull from a remote repo and got an error message: Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a..

How do I force "git pull" to overwrite local files?

How do I force an overwrite of local files on a git pull? The scenario is the following: A team member is modifying the templates for a website we are working on They are adding some images to the ..

How to get commit history for just one branch?

Let's say I created a new branch my_experiment from master and made several commits to my_experiment. If I do a git log when on my_experiment, I see the commits made to this branch, but also the comm..

How to undo a git pull?

I would like to undo my git pull on account of unwanted commits on the remote origin, but I don't know to which revision I have to reset back to. How can I just go back to the state before I did the ..

How to count total lines changed by a specific author in a Git repository?

Is there a command I can invoke which will count the lines changed by a specific author in a Git repository? I know that there must be ways to count the number of commits as Github does this for their..

How to rollback everything to previous commit

Recently in a project with multiple people, a commit was made as seen in the image below. Marked in red you can see a commit with the description/comment of 'Merge?'. This commit added numerous files..

Remove a folder from git tracking

I need to exclude a folder (name uploads) from tracking. I tried to run git rm -r --cached wordpress/wp-content/uploads and after that I added the path to .gitignore /wordpress/wp-content/uploads ..

How do I commit case-sensitive only filename changes in Git?

I have changed a few files name by de-capitalize the first letter, as in Name.jpg to name.jpg. Git does not recognize this changes and I had to delete the files and upload them again. Is there a way ..

git am error: "patch does not apply"

I am trying to move several commits from one project to the second, similar one, using git. So I created a patch, containing 5 commits: git format-patch 4af51 --stdout > changes.patch Then mo..

Getting Git to work with a proxy server - fails with "Request timed out"

How do I get Git to use a proxy server? I need to check out code from a Git server, but it shows "Request timed out" every time. How do I get around this? Alternatively, how can I set a proxy serve..

Git: Remove committed file after push

Is there a possibility to revert a committed file in Git? I've pushed a commit to GitHub and then I realized that there's a file which I didn't want to be pushed (I haven't finished the changes)...

Deploy a project using Git push

Is it possible to deploy a website using git push? I have a hunch it has something to do with using git hooks to perform a git reset --hard on the server side, but how would I go about accomplishing t..

How do I remove the old history from a git repository?

I'm afraid I couldn't find anything quite like this particular scenario. I have a git repository with a lot of history: 500+ branches, 500+ tags, going back to mid-2007. It contains ~19,500 commits. ..

How to amend older Git commit?

I have made 3 git commits, but have not been pushed. How can I amend the older one (ddc6859af44) and (47175e84c) which is not the most recent one? $git log commit f4074f289b8a49250b15a4f25ca4b4601745..

Staging Deleted files

Say I have a file in my git repository called foo. Suppose it has been deleted with rm (not git rm). Then git status will show: Changes not staged for commit: deleted: foo How do I stage this i..

How to exclude particular class name in CSS selector?

I'm trying to apply background-color when a user mouse hover the element whose class name is "reMode_hover". But I do not want to change color if the element also has "reMode_selected" Note: I can ..

How to extract public key using OpenSSL?

The following command generates a file which contains both public and private key: openssl genrsa -des3 -out privkey.pem 2048 Source: here With OpenSSL, the private key contains the public key inf..

Proper way to make HTML nested list?

The W3 docs have a nested list example prefixed by DEPRECATED EXAMPLE:, but they never corrected it with a non-deprecated example, nor explained exactly what is wrong with the example. So which of th..

How to resolve conflicts in EGit

I am using EGit on Eclipse v4.3 (Kepler). I want to commit and push my changes. I do a pull first and one file is conflicting. After manually resolving the conflict (local and remote are the same..

How to parse a query string into a NameValueCollection in .NET

I would like to parse a string such as p1=6&p2=7&p3=8 into a NameValueCollection. What is the most elegant way of doing this when you don't have access to the Page.Request object?..

storing user input in array

I need to do the following (I'm a beginner in programming so please excuse me for my ignorance): I have to ask the user for three different pieces of information on three different text boxes on a for..

How to make a phone call using intent in Android?

I'm using the following code to make a call in Android but it is giving me security exception please help. posted_by = "111-333-222-4"; String uri = "tel:" + posted_by.trim() ; Intent intent = ne..

Upgrading React version and it's dependencies by reading package.json

I have an existing project, which has react@15 and all it's dependencies according to that. But now I have to upgrade to react@16 along with it's dependencies. Now, the problem is - there are a lot of..

CSS to stop text wrapping under image

I have the following markup: <li id="CN2787"> <img class="fav_star" src="images/fav.png"> <span>Text, text and more text</span> </li> I want it so that if the text..

How to change Hash values?

I'd like to replace each value in a hash with value.some_method. For example, for given a simple hash: {"a" => "b", "c" => "d"}` every value should be .upcased, so it looks like: {"a" =>..

How to take the first N items from a generator or list?

With linq I would var top5 = array.Take(5); How to do this with Python?..

How do I group Windows Form radio buttons?

How can I group the radio buttons in Windows Form application (a lot like ASP.NET's radiobuttonlist!)? So I can switch between each case chosen from the options...

How to get JQuery.trigger('click'); to initiate a mouse click

I'm having a hard time understand how to simulate a mouse click using JQuery. Can someone please inform me as to what i'm doing wrong. HTML: <a id="bar" href="" target="_b..

How to know which is running in Jupyter notebook?

I use Jupyter notebook in a browser for Python programming, I have installed Anaconda (Python 3.5). But I'm quite sure that Jupyter in running my python commands with the native python interpreter and..

How can I run Android emulator for Intel x86 Atom without hardware acceleration on Windows 8 for API 21 and 19?

I have not enabled Hyper V or hardware acceleration and don't want to either. Is there any way that I can start android emulator for Intel x86 Atom Without hardware acceleration on Windows 8 I have..

Java Logging - where is my log file?

I'm having trouble finding my log files. I'm using Java Logging - java.util.logging - in Eclipse 3.7.1 on Windows XP. The relevant lines of my file are: handlers= java.util.loggi..

Lombok is not generating getter and setter

I just tried to send a Maven-based project to another computer and HORROR, red markers everywhere!! However, mvn clean install is building just fine. Quickly, I noticed that Lombok is not generating..

iOS Detection of Screenshot?

The app Snapchat, on the App Store, is an app that lets you share pictures with a self-destruct on them. You can only view the pics for X seconds. If you attempt to take a screenshot while the picture..

Python constructor and default value

Somehow, in the Node class below, the wordList and adjacencyList variable is shared between all instances of Node. >>> class Node: ... def __init__(self, wordList = [], adjacencyList = [..

How to write a file with C in Linux?

I want to rewrite the "cp" command of Linux. So this program will work like #./a.out originalfile copiedfile. I can open the file, create new file but can't write the new file. Nothing is written. Wha..

how to always round up to the next integer

i am trying to find total pages in building a pager on a website (so i want the result to be an integer. i get a list of records and i want to split into 10 per page (the page count) when i do this:..

Typescript empty object for a typed variable

Say I have: type User = { ... } I want to create a new user but set it to be an empty object: const user: User = {}; // This fails saying property XX is missing const user: User = {} as any; // Th..

How can I convert this one line of ActionScript to C#?

I would like to convert this one line of code to C# code within a void: param1:Function=null I am aware that in the void, it would be like "thing here" param1, but I dont know what "thing here" wou..

Python regex to match dates

What regular expression in Python do I use to match dates like this: "11/12/98"?..

from unix timestamp to datetime

I have something like /Date(1370001284000+0200)/ as timestamp. I guess it is a unix date, isn't it? How can I convert this to a date like this: 31.05.2013 13:54:44 I tried THIS converter for 13700012..

How to measure height, width and distance of object using camera?

I referred lot many links but still I am not able to get any point from that I can start my development. I want to measure my image height, width and distance using camera. I found this app . I want t..

Uncaught ReferenceError: jQuery is not defined

I have implemented some JavaScript on my site but I keep getting the following error messages: Uncaught ReferenceError: jQuery is not defined and Uncaught SyntaxError: Unexpected token &l..

How to convert Json array to list of objects in c#

I have Json string like below { "JsonValues":{ "id": "MyID", "values": { "value1":{ "id": "100", "diaplayName": "MyValue1" ..

How to delete $_POST variable upon pressing 'Refresh' button on browser with PHP?

When I press the 'refresh' button on my browser, it seems that $_POST variable is preserved across the refresh. If I want to delete the contents of $_POST what should I do? Using unset for the fields..

Python class input argument

I am new to OOP. My idea was to implement the following class: class name(object, name): def __init__(self, name): print name Then the idea was to create two instances of that class: p..

Get and Set Screen Resolution

How can I collect and change screen resolution using Visual C#?..

How to select and change value of table cell with jQuery?

How do I change the content of the cell containing the 'c' letter in the HTML sample using jQuery? <table id="table_header"> <tr> <td>a</td> <td>b</td> &l..

HTML iframe - disable scroll

I have following iframe in my site: <iframe src="<<URL>>" height="800" width="800" sandbox="allow-same-origin allow-scripts allow-forms" scrolling="no" style="overflow: hidden"><..

@POST in RESTful web service

I have been trying to understand @POST in RESTful web service using Jersey. I have gone through for the same and was able to get some information abou..

iOS - Dismiss keyboard when touching outside of UITextField

I'm wondering how to make the keyboard disappear when the user touches outside of a UITextField...

Converting unix timestamp string to readable date

I have a string representing a unix timestamp (i.e. "1284101485") in Python, and I'd like to convert it to a readable date. When I use time.strftime, I get a TypeError: >>>import ti..

Origin <origin> is not allowed by Access-Control-Allow-Origin

XMLHttpRequest cannot load http://localhost:8080/api/test. Origin http://localhost:3000 is not allowed by Access-Control-Allow-Origin. I read about cross domain ajax requests, and understand the un..

How to POST using HTTPclient content type = application/x-www-form-urlencoded

I am currently developing a wp8.1 application C#, i have managed to perform a POST method in json to my api by creating a json object (bm) from textbox.texts. here is my code below. How do i take the ..

Script for rebuilding and reindexing the fragmented index?

Can anyone provide the script for rebuilding and re-indexing the fragmented index when 'avg_fragmentation_in_percent' exceeds certain limits (better if cursor is not used)?..

Removing MySQL 5.7 Completely

I am trying to uninstall mysql from my ubuntu 12.04 completely. But not able to. I tried a lot of commands. But nothing is working. Can anyone help out here! sudo apt-get remove mysql-server mysql-c..

How do I get the application exit code from a Windows command line?

I am running a program and want to see what its return code is (since it returns different codes based on different errors). I know in Bash I can do this by running echo $? What do I do when us..

How to format column to number format in Excel sheet?

Below is the VBA code. Sheet2 contains all of the values in general format. After running the code, values in column 'C' of Sheet3 contain exponential values for numbers which are 13 or more digits...

Print PHP Call Stack

I'm looking for a way to print the call stack in PHP. Bonus points if the function flushes the IO buffer...

".addEventListener is not a function" why does this error occur?

I’m getting an ".addEventListener is not a function" error. I am stuck on this: var comment = document.getElementsByClassName("button"); function showComment() { var place = document.getElementBy..

What's a clean way to stop mongod on Mac OS X?

i'm running mongo 1.8.2 and trying to see how to cleanly shut it down on Mac. on our ubuntu servers i can shutdown mongo cleanly from the mongo shell with: > use admin > db.shutdownServer() ..

How to find text in a column and saving the row number where it is first found - Excel VBA

I have the following column (column A) named project (rows column is just displaying the row number): rows project 1 14 2 15 3 16 4 17 5 18 6 19 7 ProjTem..

How to repeat last command in python interpreter shell?

How do I repeat the last command? The usual keys: Up, Ctrl+Up, Alt-p don't work. They produce nonsensical characters. (ve)[kakarukeys@localhost ve]$ python Python 2.6.6 (r266:84292, Nov 15 2010, 21:4..

How do I put an already-running process under nohup?

I have a process that is already running for a long time and don't want to end it. How do I put it under nohup (that is, how do I cause it to continue running even if I close the terminal?)..

CardView Corner Radius

Is there a way to make CardView only have corner radius at the top? < xmlns:android="" xmlns:tools="http://schem..

Passing parameters to a JQuery function

I'm creating HTML with a loop that has a column for Action. That column is a Hyperlink that when the user clicks calls a JavaScript function and passes the parameters... example: <a href="#" OnCl..

java.lang.OutOfMemoryError: Java heap space

I am getting the following error on execution of a multi-threading program java.lang.OutOfMemoryError: Java heap space The above error occured in one of the threads. Upto my knowledge, Heap space..

The name 'ConfigurationManager' does not exist in the current context

I am trying to access connectionStrings from the config file. The code is ASP.NET + C#. I have added System.Configuration to reference and also mentioned with using. But still it wouldn't accept the a..

How to Convert UTC Date To Local time Zone in MySql Select Query

I am using this Where Condition in One Of my query with MySql Database.My Problem is that i have one displaytime column in my table but that table column shows the data in UTC Time.and i want to con..

Could not find 3.2.25 4.0.30 4.1.32 4.2.40 4.2.42 4.3.23 4.4.52 5.0.77 5.0.89 5.2.08 6.1.11 6.1.71 6.5.87

referencing the play-services via gradle stopped working for me - boiled it down - even the sample I used as a reference in the first place stopped working:

How to prevent Browser cache on Angular 2 site?

We're currently working on a new project with regular updates that's being used daily by one of our clients. This project is being developed using angular 2 and we're facing cache issues, that is our ..

Deploying Java webapp to Tomcat 8 running in Docker container

I am pretty new to Tomcat and Docker - so I am probably missing a Tomcat fundamental somewhere in this question. What I am trying to do is build a Docker container that runs a SpringBoot Restful web ..

Printing image with PrintDocument. how to adjust the image to fit paper size

In C#, I am trying to print an image using PrintDocument class with the below code. The image is of size 1200 px width and 1800 px height. I am trying to print this image in a 4*6 paper using a small ..

How can I get the max (or min) value in a vector?

How can I get the max (or min) value in a vector in C++? I have seen a few solutions for this on Google but none of them made sense to me :( Can someone explain in an easy straightforward noob way ..

Difference between readFile() and readFileSync()

The following code outputs the content of the index.html (it just contains the text hello world) to the browser. However, when I replace readFile() with readFileSync(), the request times out. What am ..

How to insert newline in string literal?

In .NET I can provide both \r or \n string literals, but there is a way to insert something like "new line" special character like Environment.NewLine static property?..

How to get a list of images on docker registry v2

I'm using docker registry v1 and I'm interested in migrating to the newer version, v2. But I need some way to get a list of images present on registry; for example with registry v1 I can execute a GET..

pip issue installing almost any library

I have a difficult time using pip to install almost anything. I'm new to coding, so I thought maybe this is something I've been doing wrong and have opted out to easy_install to get most of what I nee..

python encoding utf-8

I am doing some scripts in python. I create a string that I save in a file. This string got lot of data, coming from the arborescence and filenames of a directory. According to convmv, all my arboresc..

.mp4 file not playing in chrome

I want to show a video on my website. I have created a .mp4 file and using the HTML5 video tag to add it to the html. The problem is that it is not being displayed in chrome. I would also like to kn..

What is DOM Event delegation?

Can anyone please explain event delegation in JavaScript and how is it useful?..

Simple Digit Recognition OCR in OpenCV-Python

I am trying to implement a "Digit Recognition OCR" in OpenCV-Python (cv2). It is just for learning purposes. I would like to learn both KNearest and SVM features in OpenCV. I have 100 samples (i.e. ..

AttributeError: 'dict' object has no attribute 'predictors'

I am new to python and couldn't find the answer to this. Referring to the code at the end of the message, can I know what does the part "for item, total in totals.items()" in the line below mean? ran..

How to import large sql file in phpmyadmin

I want to import a sql file of approx 12 mb. But its causing problem while loading. Is there any way to upload it without splitting the sql file ?..

How to set editor theme in IntelliJ Idea

I'm trying to change the editor color schemes in IntelliJ Idea 13.1.3 community edition to a darker theme. I downloaded a theme from a website [Editor's note: the website has since been replaced with ..

How to unpublish an app in Google Play Developer Console

I've seen other posts asking the same question with answers that all refer to a giant button that says "Unpublish" on it, which is no longer there (at least as of 2016). How do you really un..

Getting "NoSuchMethodError: org.hamcrest.Matcher.describeMismatch" when running test in IntelliJ 10.5

I'm using JUnit-dep 4.10 and Hamcrest 1.3.RC2. I've created a custom matcher that looks like the following: public static class MyMatcher extends TypeSafeMatcher<String> { @Override pr..

CSS vertical-align: text-bottom;

Hi there I'm trying to position text to the bottom of the <div>. Neither vertical-align:text-bottom; or vertical-align:bottom; The trouble is below it is my navigation buttons and if I push it ..

How to do SVN Update on my project using the command line

How do I SVN Update my project using the command line? Then I will manage to call these command lines from C#. I'm a .NET developer, and I'm using TortoiseSVN...

Build the full path filename in Python

I need to pass a file path name to a module. How do I build the file path from a directory name, base filename, and a file format string? The directory may or may not exist at the time of call. For..

How to drop a unique constraint from table column?

I have a table 'users' with 'login' column defined as: [login] VARCHAR(50) UNIQUE NOT NULL Now I want to remove this unique constraint/index using SQL script. I found its name UQ_users_7D78A4E7 in ..

How to select only date from a DATETIME field in MySQL?

I have a table in the MySQL database that is set up with DATETIME. I need to SELECT in this table only by DATE and excluding the time. How do I SELECT in this table by only date and bypassing the time..

jquery find element by specific class when element has multiple classes

So I am working on something that wasn't well thought out in the build from the backend team. That leaves me with a document full of divs. What I am doing is rolling back from the element I need to ..

Set line spacing

How can I set line spacing with CSS, like we can set it in MS Word?..

How to control font sizes in pgf/tikz graphics in latex?

I'm creating graphs in pgf/tikz. When I use these in my document they are scaled, several are in minipage/subfig like environments. When this happens the font sizes are scaled with the graphics making..

What's the difference between ISO 8601 and RFC 3339 Date Formats?

ISO 8601 and RFC 3339 seem to be two formats that are common the web. Should I use one over the other? Is one just an extension? Do I really need to care that bad?..

Chrome Fullscreen API

According to this article Google Chrome 15 has a fullscreen JavaScript API. I have tried to make it work but failed. I have also searched for official documentation in vain. What does the fullscreen..

how to find my angular version in my project?

I have setup the angular code on my local machine. I need to know the version of the angular that I am using in the project. how can I easily find it in cmd prompt?..

Extract a page from a pdf as a jpeg

In python code, how to efficiently save a certain page in a pdf as a jpeg file? (Use case: I've a python flask web server where pdf-s will be uploaded and jpeg-s corresponding to each page is stores.)..

Are iframes considered 'bad practice'?

Somewhere along the line I picked up the notion that using iframes is 'bad practice'. Is this true? What are the pros/cons of using them?..

How to start jenkins on different port rather than 8080 using command prompt in Windows?

I have jenkins.war and I started it from command prompt in Windows as: java -jar jenkins.war It was started well and easily browsed as http://localhost:8080 I want to start on 9090 port. How can I..

How to read appSettings section in the web.config file?

My XML looks like this and the filename is web.config <?xml version="1.0"?> <configuration> <appSettings> <add key="configFile" value="IIS.config"/> <add key="..

How to create a HTTP server in Android?

I would like to create a simple HTTP server in Android for serving some content to a client. Any advice on how to build the server or use any existing library? ..

How to locate the php.ini file (xampp)

I am using xamppserver for PHP development and want to edit the php.ini file; where can I locate it?..

How do I center this form in css?

I have tried everything. I cannot get this centered on the screen. I am using ie 9 but it does the same in chrome. It just sits on the left of the webpage. Thank you for any help. <style type=..

Persistent invalid graphics state error when using ggplot2

I believe my dataframe is okay and my code is okay. In fact, I have eliminated parts of the dataframe and most of the graphing code to make things as basic as possible. But still, I get: Error in ...

http to https through .htaccess

I've had a look through existing questions, but I haven't really come across anything which works for me. I'm currently running a site with a Secure SSL certificate. It can be accessed at https://www..

how to change any data type into a string in python

How can I change any data type into a string in Python?..

VBA Count cells in column containing specified value

I need to write a macro that searches a specified column and counts all the cells that contain a specified string, such as "19/12/11" or "Green" then associate this number with a variable, Does anyon..

Problems with installation of Google App Engine SDK for php in OS X

I'm trying to create Google App Engine environment in my Mac OS X Mountain Lion. Downloaded the Googleapplauncher.dmg file. While I tried to unzip the file it shows "the following disk images couldn't..

MySQL Install: ERROR: Failed to build gem native extension

I'm trying to get MySQL installed to the latest version due to some installation going wrong somewhere along the line. I run the command gem install mysql and I receive the following: Building na..

How to get Chrome to allow mixed content?

Chrome browser by default is blocking mixed content. How do I adjust my settings/configuration to allow mixed content without making any adjustments on the UI every time? I have found two solutions b..

Get value of a merged cell of an excel from its cell address in vba

How to get the value of a merged cell of an excel having range address like "$B$4:$B$11" in vba..

Cache busting via params

We want to cache bust on production deploys, but not waste a bunch of time off the bat figuring out a system for doing so. My thought was to apply a param to the end of css and js files with the curr..

"break;" out of "if" statement?

Can you break out of an if statement or is it going to cause crashes? I'm starting to acquaint myself with C, but this seems controversial. The first image is from a book on C ("Head First C") and the..

How to add a primary key to a MySQL table?

This is what I tried but it fails: alter table goods add column `id` int(10) unsigned primary AUTO_INCREMENT; Does anyone have a tip?..

How to get .pem file from .key and .crt files?

How can I create a PEM file from an SSL certificate? These are the files that I have available: .crt server.csr server.key ..

Check if array is empty or null

I would like to know how to check if an array is empty or null in jQuery. I tried array.length === 0 but it didn't work. It did not throw any error either. This is the code: var album_text = new Arr..

IE and Edge fix for object-fit: cover;

I'm using object-fit: cover; in my CSS for images on a specific page, because they need to stick on the same height. It works great in most browsers. But when scaling my browser in IE or Edge, the i..

How do you reset the stored credentials in 'git credential-osxkeychain'?

I've followed the GitHub instructions for setting up my account, and I'm able to clone, but I'm unable to push remotely. When I do a "git push" I get the 403 error. It has the correct URL. I tried a ..

jQuery - Disable Form Fields

I have 2 fields: 1 input, 1 select box. Is it possible to make the browser disable one of the fields when the user uses the other? For example, if the user is entering data into the input, the selec..

Trimming text strings in SQL Server 2008

I have a table in a SQL Server 2008 database. This table has a nvarchar(256) column called 'Name'. Unfortunately, the values in this field have extra spaces included. For instance the name 'Bill' is a..

How to obtain the query string from the current URL with JavaScript?

I have URL like this: http://localhost/PMApp/temp.htm?ProjectID=462 What I need to do is to get the details after the ? sign (query string) - that is ProjectID=462. How can I get that using JavaScr..

Get original URL referer with PHP?

I am using $_SERVER['HTTP_REFERER']; to get the referer Url. It works as expected until the user clicks another page and the referer changes to the last page. How do I store the original referring Ur..

Better way to sort array in descending order

I have a array of int which I have to sort by descending. Since I did not find any method to sort the array in descending order.Currently I am sorting the array in descending order as below int[] a..

How do I execute external program within C code in linux with arguments?

I want to execute another program within C code. For example, I want to execute a command ./foo 1 2 3 foo is the program which exists in the same folder, and 1 2 3 are arguments. foo program create..

Setting user agent of a java URLConnection

I'm trying to parse a webpage using Java with URLConnection. I try to set up the user-agent like this: c = url.openConnection(); c.setRequestProperty("User-Agent", "Mozilla/5.0..

.NET / C# - Convert char[] to string

What is the proper way to turn a char[] into a string? The ToString() method from an array of characters doesn't do the trick...

How to specify the bottom border of a <tr>?

I tried : .bb { border-bottom:1px; } <tr class="bb"> But no effect at all...

'cout' was not declared in this scope

I have a C++ program: test.cpp #include<iostream> int main() { char t = 'f'; char *t1; char **t2; cout<<t; //this causes an error, cout was not declared in this scope..

Ruby, remove last N characters from a string?

What is the preferred way of removing the last n characters from a string?..

Running code after Spring Boot starts

I want to run code after my spring-boot app starts to monitor a directory for changes. I have tried running a new thread but the @Autowired services have not been set at that point. I have been ab..

How to delete a localStorage item when the browser window/tab is closed?

My Case: localStorage with key + value that should be deleted when browser is closed and not single tab. Please see my code if its proper and what can be improved: //create localStorage key + value ..

Extracting substrings in Go

I'm trying to read an entire line from the console (including whitespace), then process it. Using bufio.ReadString, the newline character is read together with the input, so I came up with the followi..

How to do a case sensitive search in WHERE clause (I'm using SQL Server)?

I want to do a case sensitive search in my SQL query. But by default, SQL Server does not consider the case of the strings. Any idea on how to do a case sensitive search in SQL query?..

Assets file project.assets.json not found. Run a NuGet package restore

I'm trying to use nopCommerce(Which is written in .NET Core) but when I want to run the project I face 52 Errors telling me Run a nuget package restore Assets file ~\obj\project.assets.json' not ..

How do you split and unsplit a window/view in Eclipse IDE?

How do you split a window/view in Eclipse IDE? I want to edit code while viewing the different code in the same file. If there is a trick to open the same file twice, this might do, but I would rathe..

store and retrieve a class object in shared preference

In Android can we store an object of a class in shared preference and retrieve the object later? If it is possible how to do it? If it is not possible what are the other possibilities of doing it? ..

How to use the onClick event for Hyperlink using C# code?

I am trying to add a condition for a hyperlink that I have in my page. Instead of just using a particular link like: <a href="help/Tutorial.html">Tutorial</a> I want to display different..

Disable Button in Angular 2

I want if the input 'Contract type' is empty, the button 'Save' is not clickable Save button: <div class="col-md-4"> <cic-textbox [control]="formGroup.get('contractType')"></..

Android: Is it possible to display video thumbnails?

I created a video recording application with library dialog. The library dialog displays the list of recorded videos where each item consists of icon, video title, tags and location information the fo..

Github Push Error: RPC failed; result=22, HTTP code = 413

stupid issue with Github going on right now. I have a decent amount of changes (~120MB in size), when I attempt to push, this is what happens: error: RPC failed; result=22, HTTP code = 413 fatal: The..

How can I make Java print quotes, like "Hello"?

How can I make Java print "Hello"? When I type System.out.print("Hello"); the output will be Hello. What I am looking for is "Hello" with the quotes("")...

Clear form fields with jQuery

I want to clear all input and textarea fields in a form. It works like the following when using an input button with the reset class: $(".reset").bind("click", function() { $("input[type=text], tex..

How do I create a pause/wait function using Qt?

I'm playing around with Qt, and I want to create a simple pause between two commands. However it won't seem to let me use Sleep(int mili);, and I can't find any obvious wait functions. I am basically..

How to print / echo environment variables?

How do I print the environment variable just being set? NAME=sam echo "$NAME" # empty You can see here using eval it works. Is this the way? NAME=sam eval 'echo $NAME' # => sam ..

Java parsing XML document gives "Content not allowed in prolog." error

I am writing a program in Java that takes a custom XML file and parses it. I'm using the XML file for storage. I am getting the following error in Eclipse. [Fatal Error] :1:1: Content is not allowed ..

Python, print all floats to 2 decimal places in output

I need to output 4 different floats to two decimal places. This is what I have: print '%.2f' % var1,'kg =','%.2f' % var2,'lb =','%.2f' % var3,'gal =','%.2f' % var4,'l' Which is very unclean, and l..

What does "SyntaxError: Missing parentheses in call to 'print'" mean in Python?

When I try to use a print statement in Python, it gives me this error: >>> print "Hello, World!" File "<stdin>", line 1 print "Hello, World!" ^ SyntaxErro..

Find what 2 numbers add to something and multiply to something

Hey so I'm making a factoring program and I'm wondering if anyone can give me any ideas on an efficient way to find what two numbers multiple to a specified number, and also add to a specified number...

How do you Sort a DataTable given column and direction?

I need to resort, in memory, a DataTable based on a column and direction that are coming from a GridView. The function needs to look like this: public static DataTable resort(DataTable dt, string col..

How do I keep two side-by-side divs the same height?

I have two divs side by side. I'd like the height of them to be the same, and stay the same if one of them resizes. I can't figure this one out though. Ideas? To clarify my confusing question, I'd li..

mysqldump with create database line

I'm in the process of moving my files onto another computer, and one thing I would like to do is to transfer the data in my MySQL database. I want to dump the databases into .sql files, but also have ..

What is the best way to create a string array in python?

I'm relatively new to Python and it's libraries and I was wondering how I might create a string array with a preset size. It's easy in java but I was wondering how I might do this in python. So far ..

Get Client Machine Name in PHP

This program only returns the client machine name in localhost only echo gethostbyaddr($_SERVER['REMOTE_ADDR']); If it is run from an online server, then computer name is not shown and some other in..

Why is this inline-block element pushed downward?

Following is my code and I want to understand that why #firstDiv is being pushed downward by all browsers. I really want to understand the inner workings of the fact that why its being pushed downward..

Wait until ActiveWorkbook.RefreshAll finishes - VBA

I have a sub that calls on ActiveWorkbook.RefreshAll to bring new data in from an XML source, and then performs multiple modifications to it. The problem is that not enough time is given for the Refre..

How to change already compiled .class file without decompile?

I want to change .class file's method. I installed JD Eclipse Decompiler and opened the .class file. I added some codes and save .class file. But, .class file is not changing. I don't know how to us..

Java: how do I get a class literal from a generic type?

Typically, I've seen people use the class literal like this: Class<Foo> cls = Foo.class; But what if the type is generic, e.g. List? This works fine, but has a warning since List should be pa..

What is the best open source help ticket system?

I know of osTicket, are there any other more compelling help ticket systems? My company wants to use one and I am researching them now. I forgot to mention, I will need to install it on our servers....

How to get AM/PM from a datetime in PHP

I have a date time in a variable. My format is 08/04/2010 22:15:00. I want to display this like 10.15 PM. How to do this in PHP?..

How do I check which version of NumPy I'm using?

How can I check which version of NumPy I'm using? (FYI this question has been edited because both the question and answer are not platform specific.)..

Connect Device to Mac localhost Server?

How do I allow any device, e.g., iPhone, to connect over a WLAN to my Mac's localhost server? On my Mac, I'm running a "Hello World" HTTP Node.js server that serves a page, which Safari opens success..

AWS EFS vs EBS vs S3 (differences & when to use?)

As per the title of this question, what are the practical differences between AWS EFS, EBS and S3? My understanding of each: S3 is a storage facility accessible any where EBS is a device you can mo..

Allow user to select camera or gallery for image

What I'm trying to do seems very simple, but after a few days of searching I can't quite figure it out. I have an application that allows the user to select multiple(up to 5) images. I'm using an Im..

What's the difference between ASCII and Unicode?

What's the exact difference between Unicode and ASCII? ASCII has a total of 128 characters (256 in the extended set). Is there any size specification for Unicode characters?..

What does the "no version information available" error from linux dynamic linker mean?

In our product we ship some linux binaries that dynamically link to system libraries like "libpam". On some customer systems we get the following error on stderr when the program runs: ./authpam: /l..

How do I create a Python function with optional arguments?

I have a Python function which takes several arguments. Some of these arguments could be omitted in some scenarios. def some_function (self, a, b, c, d = None, e = None, f = None, g = None, h = None)..

Angular JS: What is the need of the directive’s link function when we already had directive’s controller with scope?

I need to perform some operations on scope and the template. It seems that I can do that in either the link function or the controller function (since both have access to the scope). When is it the c..

download file using an ajax request

I want to send an "ajax download request" when I click on a button, so I tried in this way: javascript: var xhr = new XMLHttpRequest();"GET", "download.php"); xhr.send(); download.php: ..

Oracle DB : java.sql.SQLException: Closed Connection

Reasons for java.sql.SQLException: Closed Connection from Oracle?? java.sql.SQLException: Closed Connection at oracle.jdbc.driver.DatabaseError.throwSqlException( ..

Convert array of strings into a string in Java

I want the Java code for converting an array of strings into an string...

How to refresh Android listview?

How to refresh an Android ListView after adding/deleting dynamic data?..

Batch program to to check if process exists

I want a batch program, which will check if the process notepad.exe exists. if notepad.exe exists, it will end the process, else the batch program will close itself. Here is what I've done: @echo..

Pull new updates from original GitHub repository into forked GitHub repository

I forked someone's repository on GitHub and would like to update my version with commits and updates made in the original repository. These were made after I forked my copy. How can I pull in the cha..

Angular (4, 5, 6, 7) - Simple example of slide in out animation on ngIf

What is the bare minimum and Angular4's native way to slide in and slide out a container element? e.g. <div ngIf="show"> <!-- Content --> </div> Slide In Content (from top to..

How do I vertically center text with CSS?

I have a <div> element which contains text and I want to align the contents of this <div> vertically center. Here is my <div> style: _x000D_ _x000D_ #box { height: 170px; width: ..

Doctrine 2: Update query with query builder

Hi I've got the following query but it doesn't seem to work. $q = $this->em->createQueryBuilder() ->update('models\User', 'u') ->set('u.username', $username) ->set('

Does Java support structs?

Does Java have an analog of a C++ struct: struct Member { string FirstName; string LastName; int BirthYear; }; I need to use my own data type...

SQL Server - Return value after INSERT

I'm trying to get a the key-value back after an INSERT-statement. Example: I've got a table with the attributes name and id. id is a generated value. INSERT INTO table (name) VALUES('bob'); N..

Alter a MySQL column to be AUTO_INCREMENT

I’m trying to modify a table to make its primary key column AUTO_INCREMENT after the fact. I have tried the following SQL, but got a syntax error notification. ALTER TABLE document ALTER COLUMN do..

how to activate a textbox if I select an other option in drop down box

suppose I've a 3 options in a drop down box say red , blue, others. If a user select option as an others then below a text box should be visible to wrtie his own favourite color. I can populat..

How to export JSON from MongoDB using Robomongo

So I do not know much about MongoDB. I have RoboMongo using which I connect to a MongoDB. What I need to do is this - there is a collection in that MongoDB. I want to export the data from that collect..

jQuery: How to get the HTTP status code from within the $.ajax.error method?

I'm using jQuery to make an AJAX request. I want to perform different actions whether or not the HTTP status code is a 400 error or a 500 error. How can I achieve this? $.ajax({ type: 'POST', ..

finding multiples of a number in Python

I'm trying to write a code that lets me find the first few multiples of a number. This is one of my attempts: def printMultiples(n, m): for m in (n,m): print(n, end = ' ') I figured out that, b..

Java: convert seconds to minutes, hours and days

"The output should look like this (it is a good idea to echo back the input): You entered 500,000 seconds, which is 5 days, 18 hours, 53 minutes and 20 seconds. (5 days 18:53:20 hours) So can you guy..

Clear text field value in JQuery

I understand this is an easy question but for some reason this just isn't working for me. I have a function that is triggered everytime a drop down menu is changed. Here is the relevant code that is..

HTML5 Email input pattern attribute

I’m trying to make a html5 form that contains one email input, one check box input, and one submit input. I'm trying to use the pattern attribute for the email input but I don't know what to place i..

How can I select random files from a directory in bash?

I have a directory with about 2000 files. How can I select a random sample of N files through using either a bash script or a list of piped commands?..

Is there a developers api for

I am building an application and would like to automatically post to craigslist with a click of a button. Is there any way to do this? I have an account and will pay for each post...

"Python version 2.7 required, which was not found in the registry" error when attempting to install netCDF4 on Windows 8

I use Anaconda 1.7, 32 bit. I downloaded the correct version of the netCDF4 installer from here. I attempted to copy the HKEY_LOCAL_MACHINE\SOFTWARE\Python folder into HKEY_LOCAL_MACHINE\SOFTWARE\Wow..

Failed to open/create the internal network Vagrant on Windows10

I upgraded my Windows 10 to the last update yesterday and now, when I launch vagrant up command, I get this error : ==> default: Booting VM... ==> default: Waiting for machine to boot. This ma..

Visual Studio 2010 shortcut to find classes and methods?

Is there any shortcut in Visual studio 2010 to find classes/interfaces? I was using Resharper few years back to do that. Here now, I don't have the Resharper and looking something similar in Visual s..

What is Parse/parsing?

In Java, What exactly is Parsing? Why are they used? For example: Integer.parseInt(...), and parsing a string?..

How to change mysql to mysqli?

Based on this code below I use for regular mysql, how could I convert it to use mysqli? Is it as simple as changing mysql_query($sql); to mysqli_query($sql);? <?PHP //in my header file that is i..

How can I fix the form size in a C# Windows Forms application and not to let user change its size?

How can I fix the form size in a C# Windows Forms application and not to let user change its size?..

"The following SDK components were not installed: sys-img-x86-addon-google_apis-google-22 and addon-google_apis-google-22"

I'm Windows 7 64-bit user and I got Android Studio problem after I update the latest version of Android Studio and SDK components.. The following SDK components were not installed: sys-img-x86-addon-..

Warning about SSL connection when connecting to MySQL database

With the two classes below, I've tried connect to a MySQL database. However, I always get this error: Wed Dec 09 22:46:52 CET 2015 WARN: Establishing SSL connection without server's identity verific..

How do you make websites with Java?

This might be a really trivial question, but I've been writing Java programs at my school and I just found out that I can create websites with Java as well. How can I do that? Any good books/tutori..

What is the best way to modify a list in a 'foreach' loop?

A new feature in C# / .NET 4.0 is that you can change your enumerable in a foreach without getting the exception. See Paul Jackson's blog entry An Interesting Side-Effect of Concurrency: Removing Item..

Alternative for <blink>

The <blink> tag was never an official standard, and is now completely abandoned by all browsers. Is there a standards compliant way of making text blink?..

LINQ's Distinct() on a particular property

I am playing with LINQ to learn about it, but I can't figure out how to use Distinct when I do not have a simple list (a simple list of integers is pretty easy to do, this is not the question). What I..

Make: how to continue after a command fails?

The command $ make all gives errors such as rm: cannot remove '.lambda': No such file or directory so it stops. I want it to ignore the rm-not-found-errors. How can I force-make? Makefile all: ..

How to change heatmap.2 color range in R?

I'm using gplot to produce a heatmap showing log2-fold changes of a treatment groups versus paired controls. With the following code: heatmap.2(as.matrix(SeqCountTable), col=redgreen(75), ..

How to pass the -D System properties while testing on Eclipse?

I am developing on Eclipse on Windows and Code gets deployed on Unix. I am fetching the system property values using System.getProperty("key") ... How do I pass this in Eclipse so that I do not have t..

Execute a SQL Stored Procedure and process the results

In VB.NET, how do I do the following? Execute a Stored Procedure Read through the DataTable returned ..

What is a web service endpoint?

Let's say my web service is located at http://localhost:8080/foo/mywebservice and my WSDL is at http://localhost:8080/foo/mywebservice?wsdl. Is http://localhost:8080/foo/mywebservice an endpoint, i.e..

Javascript, Time and Date: Getting the current minute, hour, day, week, month, year of a given millisecond time

I'm still wrapping my head around this library, but I'm out of time so I'll just skip to the spoiler section and ask. With a given, arbitrary millisecond time value (like the kind you'd gave from .ge..

How do I get specific properties with Get-AdUser

I have the following PS script written: Get-ADUser -Filter * -SearchBase 'OU=Users & Computers, DC=aaaaaaa, DC=com' -Properties DisplayName | Export-CSV "ADUsers.csv" From what I can tell it s..

What are the differences between Deferred, Promise and Future in JavaScript?

What are the differences between Deferreds, Promises and Futures? Is there a generally approved theory behind all these three?..

Input type number "only numeric value" validation

How can I validate an input of type="number" to only be valid if the value is numeric or null using only Reactive Forms (no directives)? Only numbers [0-9] and . are allowed, no "e" or any other chara..

What does the 'standalone' directive mean in XML?

What does the 'standalone' directive mean in an XML document?..

How to delete large data of table in SQL without log?

I have a large data table. There are 10 million records in this table. What is the best way for this query Delete LargeTable where readTime < dateadd(MONTH,-7,GETDATE()) ..

Set Text property of asp:label in Javascript PROPER way

I have a series of textboxes on a form. When the user inserts numbers into these textboxes, calculations are made and <asp:Label> controls are updated via JavaScript to reflect these calculatio..

Questions every good Java/Java EE Developer should be able to answer?

I was going through Questions every good .Net developer should be able to answer and was highly impressed with the content and approach of this question, and so in the same spirit, I am asking this qu..