Questions Tagged with #Mutt

Mutt is an open-source CLI email client. It is highly customizable and fast. Lots of sorting and filtering criteria allow for highly efficient mail handling.

How to change the sender's name or e-mail address in mutt?

How can I change the sender's name or e-mail address (From: header) used by mutt?..

How to retrieve the last autoincremented ID from a SQLite table?

I have a table Messages with columns ID (primary key, autoincrement) and Content (text). I have a table Users with columns username (primary key, text) and Hash. A message is sent by one Sender (user)..

Replace a character at a specific index in a string?

I'm trying to replace a character at a specific index in a string. What I'm doing is: String myName = "domanokz"; myName.charAt(4) = 'x'; This gives an error. Is there any method to do this?..

Getting Error 800a0e7a "Provider cannot be found. It may not be properly installed."

So I am going back to a project I created in College, so I can transfer it to PHP. I orginally coded it in ASP Classic. I am on Windows 8 and running Access 2013. I am currently getting the followi..

CSS: Fix row height

I'm having this markup: <style> table { border:1px solid black; width:400px; height:300px; border-collapse:collapse; } table tbody { ..

Setting public class variables

How do I set a public variable. Is this correct?: class Testclass { public $testvar = "default value"; function dosomething() { echo $this->testvar; } } $Testclass = new Testclass();..

Add x and y labels to a pandas plot

Suppose I have the following code that plots something very simple using pandas: import pandas as pd values = [[1, 2], [2, 5]] df2 = pd.DataFrame(values, columns=['Type A', 'Type B'], ..

Bootstrap visible and hidden classes not working properly

I tried to use the Bootstrap visible and hidden classes to create content only visible on mobile/desktop. I noticed the classes weren't working properly (and I have noticed a lot of people had this pr..

Pandas: sum DataFrame rows for given columns

I have the following DataFrame: In [1]: import pandas as pd df = pd.DataFrame({'a': [1,2,3], 'b': [2,3,4], 'c':['dd','ee','ff'], 'd':[5,9,1]}) df Out [1]: a b c d 0 1 2 dd 5 1 2 3 ee ..

Error Handler - Exit Sub vs. End Sub

Why would I want to get out of an Error Handler (after handling) with an Exit Sub instead of just letting it go to the End Sub? I'm sure it's simple. I just don't understand. Thanks for any help. ..

PowerShell says "execution of scripts is disabled on this system."

I am trying to run a cmd file that calls a PowerShell script from cmd.exe, but I am getting this error: Management_Install.ps1 cannot be loaded because the execution of scripts is disabled on this sy..

What is the use of the init() usage in JavaScript?

What is the meaning and usage of the init() function in JavaScript?..

What is the "right" way to iterate through an array in Ruby?

PHP, for all its warts, is pretty good on this count. There's no difference between an array and a hash (maybe I'm naive, but this seems obviously right to me), and to iterate through either you just ..

Is there a method that tells my program to quit?

For the "q" (quit) option in my program menu, I have the following code: elif choice == "q": print() That worked all right until I put it in an infinite loop, which kept printing blank lines. I..

Match at every second occurrence

Is there a way to specify a regular expression to match every 2nd occurrence of a pattern in a string? Examples searching for a against string abcdabcd should find one occurrence at position 5 sear..

Finding all possible combinations of numbers to reach a given sum

How would you go about testing all possible combinations of additions from a given set N of numbers so they add up to a given final number? A brief example: Set of numbers to add: N = {1,5,22,15,0,..

Remove all subviews?

When my app gets back to its root view controller, in the viewDidAppear: method I need to remove all subviews. How can I do this?..

Syntax for a for loop in ruby

How do I do this type of for loop in Ruby? for(int i=0; i<array.length; i++) { } ..

jQuery Validation using the class instead of the name value

I'd like to validate a form using the jquery validate plugin, but I'm unable to use the 'name' value within the html - as this is a field also used by the server app. Specifically, I need to limit the..

LINQ: Distinct values

I have the following item set from an XML: id category 5 1 5 3 5 4 5 3 5 3 I need a distinct list of these items: 5 1 5..

Eclipse CDT: no rule to make target all

My Eclipse CDT keeps complaining "make: *** no rule to make target all" when I am trying to compile the piece of code below: #include <iostream> using namespace std; int main() { cout <..

Django template how to look up a dictionary value with a variable

mydict = {"key1":"value1", "key2":"value2"} The regular way to lookup a dictionary value in a Django template is {{ mydict.key1 }}, {{ mydict.key2 }}. What if the key is a loop variable? ie: {% fo..

random number generator between 0 - 1000 in c#

I need help in writing a program that will generate 100 random numbers between 0 and 1000. The out put needs to be displayed in a windows message box. i'm stuck as to what code I have use to get the n..

Encoding as Base64 in Java

I need to encode some data in the Base64 encoding in Java. How do I do that? What is the name of the class that provides a Base64 encoder? I tried to use the sun.misc.BASE64Encoder class, without s..

Count number of iterations in a foreach loop

How to calculate how many items in a foreach? I want to count total rows. foreach ($Contents as $item) { $item[number];// if there are 15 $item[number] in this foreach, I want get the value : 15..

Oracle Insert via Select from multiple tables where one table may not have a row

I have a number of code value tables that contain a code and a description with a Long id. I now want to create an entry for an Account Type that references a number of codes, so I have something lik..

How can I horizontally align my divs?

For some reason my divs won't center horizontally in a containing div: _x000D_ _x000D_ .row {_x000D_ width: 100%;_x000D_ margin: 0 auto;_x000D_ }_x000D_ .block {_x000D_ width: 100px;_x000D_ f..

Android SDK folder taking a lot of disk space. Do we need to keep all of the System Images?

There are a lot of system images piling up on my disk in the android sdk folder. i hardly use the emulator. May be once in 6 months. Most of my development is directly on device. What i wanted to chec..

What is the difference between CSS and SCSS?

I know CSS very well, but am confused about Sass. How is SCSS different from CSS, and if I use SCSS instead of CSS will it work the same?..

How to split a String by space

I need to split my String by spaces. For this I tried: str = "Hello I'm your String"; String[] splited = str.split(" "); But it doesn't seem to work...

When to use Spring Security`s antMatcher()?

When do we use antMatcher() vs antMatchers()? For example: http .antMatcher("/high_level_url_A/**") .authorizeRequests() .antMatchers("/high_level_url_A/sub_level_1").hasRole('USER') ..

How I can check whether a page is loaded completely or not in web driver?

I am writing some Java Webdriver code to automate my application. How can I correctly check whether the page has been loaded or not? The application has some Ajax calls, too. I have declared an impli..

React Native add bold or italics to single words in <Text> field

How do I make a single word in a Text field bold or italics? Kind of like this: <Text>This is a sentence <b>with</b> one word in bold</Text> If I create a new text field for..

How to remove element from ArrayList by checking its value?

I have ArrayList, from which I want to remove an element which has particular value... for eg. ArrayList<String> a=new ArrayList<String>(); a.add("abcd"); a.add("acbd"); a.add("dbca"); ..

What is the format for the PostgreSQL connection string / URL?

What is the format for the PostgreSQL connection string (URL postgres://...) when the host is not the localhost?..

Mockito - NullpointerException when stubbing Method

So I started writing tests for our Java-Spring-project. What I use is JUnit and Mockito. It's said, that when I use the when()...thenReturn() option I can mock services, without simulating them or s..

What is the meaning of <> in mysql query?

I have a MySQL query that includes <> in it. I don't know the exact usage of it. SELECT * FROM table_laef WHERE id = ? AND genre_type <> 'LIVE' P.S.: Im sorry for this basic syntax, since ..

Inline for loop

I'm trying to learn neat pythonic ways of doing things, and was wondering why my for loop cannot be refactored this way: q = [1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5] vm = [-1, -1, -1, -1] for v in vm: ..

Setting a minimum/maximum character count for any character using a regular expression

I am trying to write a regular expression that will be used on a text box to validate its contents to see if it is between 1 and 35. The characters within the text box can be anything: numeric, alpha,..

Editing the git commit message in GitHub

Is there any way of online editing the commit message in GitHub.com, after submission? From the command line, one can do git commit --amend -m "New commit message" as correctly suggested in anothe..

Swift - encode URL

If I encode a string like this: var escapedString = originalString.stringByAddingPercentEscapesUsingEncoding(NSUTF8StringEncoding) it doesn't escape the slashes /. I've searched and found this O..

How do I keep a label centered in WinForms?

In WinForms I am using a Label to display different messages like success, failure, etc. I'd like to center that label in the center form. I want a solution that will keep it centered whether there's..

How to change port number for apache in WAMP

I am new to WAMP server and installed it on my system but after installing it when I check it by going to localhost url like this http://localhost/ in the browser it is not working. I am getting a 4..

How to search a Git repository by commit message?

I checked some source code into GIT with the commit message "Build 0051". However, I can't seem to find that source code any more - how do I extract this source from the GIT repository, using the com..

How to pull remote branch from somebody else's repo

I've got a project hosted on GitHub which somebody has forked. On their fork, they've created a new branch "foo" and made some changes. How do I pull their "foo" into a new branch also named "foo" in..

Intellisense and code suggestion not working in Visual Studio 2012 Ultimate RC

I have just downloaded and installed Visual Studio 2012 Ultimate RC, but I'm having an issue with the intellisense: it does not work until I press Ctrl+Space. Code suggestions are disabled also (metho..

Jquery .on('scroll') not firing the event while scrolling

Scroll event is not firing while scrolling the ul. I'm using jQuery version 1.10.2. As I'm loading the ul from an ajax page, I couldn't use $('ulId').on('scroll', function() {}); or other live methods..

What is causing ERROR: there is no unique constraint matching given keys for referenced table?

Below example table structure gives an ERROR: there is no unique constraint matching given keys for referenced table, and having stared at it for while now I can't figure out why this error arises in ..

Laravel orderBy on a relationship

I am looping over all comments posted by the Author of a particular post. foreach($post->user->comments as $comment) { echo "<li>" . $comment->title . " (" . $comment->p..

Serializing PHP object to JSON

So I was wandering around php.net for information about serializing PHP objects to JSON, when I stumbled across the new JsonSerializable Interface. It's only PHP >= 5.4 though, and I'm running in a 5...

Create, read, and erase cookies with jQuery

Somebody help me. How to create, read and erase some cookies with jQuery ? ..

How to check if a word is an English word with Python?

I want to check in a Python program if a word is in the English dictionary. I believe nltk wordnet interface might be the way to go but I have no clue how to use it for such a simple task. def is_en..

Node.js: get path from the request

I have a service called "localhost:3000/returnStat" that should take a file path as parameter. For example '/BackupFolder/toto/tata/titi/myfile.txt'. How can I test this service on my browser? How ca..

How do I change a PictureBox's image?

I have a program in C# with a PictureBox object inside a Form. How do I change its picture? The pictures to chose from are in bin/Pics; they are jpeg in format, if that matters....

How to get single value from this multi-dimensional PHP array

Example print_r($myarray) Array ( [0] => Array ( [id] => 6578765 [name] => John Smith [first_name] => John [last_name] => Smith [link] =..

Developing C# on Linux

I'd like to know if there are effective and open source tools to develop C# applications on Linux (Ubuntu). In particular, I have to develop Windows Forms applications. I know about the Mono project,..

How to set null value to int in c#?

int value=0; if (value == 0) { value = null; } How can I set value to null above? Any help will be appreciated...

Fixed digits after decimal with f-strings

Is there an easy way with Python f-strings to fix the number of digits after the decimal point? (Specifically f-strings, not other string formatting options like .format or %) For example, let's say ..

Markdown to create pages and table of contents?

I started to use markdown to take notes. I use marked to view my markdown notes and its beautiful. But as my notes get longer I find it difficult to find what I want. I know markdown can create tab..

Swift: print() vs println() vs NSLog()

What's the difference between print, NSLog and println and when should I use each? For example, in Python if I wanted to print a dictionary, I'd just print myDict, but now I have 2 other options. How..

Inserting string at position x of another string

I have two variables and need to insert string b into string a at the point represented by position. The result I'm looking for is "I want an apple". How can I do this with JavaScript? var a = 'I wan..

AJAX POST and Plus Sign ( + ) -- How to Encode?

I'm POSTing the contents of a form field via AJAX to a PHP script and using JavaScript to escape(field_contents). The problem is that any plus signs are being stripped out and replaced by spaces. Ho..

Arrays in unix shell?

How do I create an array in unix shell scripting?..

How to get data from Magento System Configuration

I just wandering on how I can get the configuration data for my custom module. The configuration can be set from the admin system->configuration and how to pull it in frontend?..

Java Look and Feel (L&F)

I am developing a desktop application with Java Swing for my personal use.I am in need of some beautiful Look and Feel for my application. How can I do it using Java or a 3rd party API?..

How to use confirm using sweet alert?

In this code form is submitted even i am clicking on no document.querySelector('#from1').onsubmit = function(){ swal({ title: "Are you sure?", text: "You will not be able to recover this im..

How do I revert an SVN commit?

I have found various examples of how to revert an SVN commit like svn merge -r [current_version]:[previous_version] [repository_url] or svn merge -c -[R] . But neither of them seems to work. I t..

Reactjs - Form input validation

My Contact page form is as follows, <form name="contactform" onSubmit={this.contactSubmit.bind(this)}> <div className="col-md-6"> <fieldset> <input ref="name" type="t..

WebSockets protocol vs HTTP

There are many blogs and discussions about WebSocket and HTTP, and many developers and sites strongly advocate WebSockets, but I still can not understand why. for example (arguments of WebSocket lover..

How to find the Git commit that introduced a string in any branch?

I want to be able to find a certain string which was introduced in any commit in any branch, how can I do that? I found something (that I modified for Win32), but git whatchanged doesn't seem to be lo..

How copy data from Excel to a table using Oracle SQL Developer

Is there any alternative way to copy the data from Excel sheet and paste it into a table using Oracle SQL Developer!? For now I am using (PL/SQL Developer) by writing (for update) at the end of the s..

Flutter Countdown Timer

How can I do to put the value passed in the construction, to make a timer that rounds to the first decimal and shows at the child text of my RaisedButton? I've tried but without luck. I manage to make..

Compare two Lists for differences

I would like some feedback on how we can best write a generic function that will enable two Lists to be compared. The Lists contain class objects and we would like to iterate through one list, looking..

How to configure slf4j-simple

api 1.7 and slf4j-simple as implementation. I just can't find how to configure the logging level with this combination. Can anyone help out?..

Effective way to find any file's Encoding

Yes is a most frequent question, and this matter is vague for me and since I don't know much about it. But i would like a very precise way to find a files Encoding. So precise as Notepad++ is...

Run a shell script with an html button

I want to launch a bash script when a button is pressed on a website. This is my first attempt: <button type="button" onclick="/path/to/name.sh">Click Me!</button> But no luck. Any sugg..

how to fetch array keys with jQuery?

Good afternoon. I have an array with some keys, and values in them. I then need to fetch the array keys and not the data in them. I want to do this with jQuery. I know for example that PHP has a funct..

Declare an empty two-dimensional array in Javascript?

I want to create a two dimensional array in Javascript where I'm going to store coordinates (x,y). I don't know yet how many pairs of coordinates I will have because they will be dynamically generated..

Regex to check if valid URL that ends in .jpg, .png, or .gif

I would like users to submit a URL that is valid but also is an image, ending with .jpg, .png, or .gif...

javascript clear field value input

I am making a simple form and i have this code to clear the initial value: Javascript: function clearField(input) { input.value = ""; }; html: <input name="name" id="name" type="text" valu..

Parse Json string in C#

I'm trying to read a Json string in C#, but I'm having trouble figuring out just how to parse the string into C#. Say I have the following Json string [ { "AppName": { "Descri..

In Eclipse, what can cause Package Explorer "red-x" error-icon when all Java sources compile without errors?

I'm using Eclipse for Java development. All my sources compile fine and the resulting application compiles fine. However, I keep getting an "red-x" error notification in the Package Explorer. All my ..

Determine path of the executing script

I have a script called foo.R that includes another script other.R, which is in the same directory: #!/usr/bin/env Rscript message("Hello") source("other.R") But I want R to find that other.R no mat..

How to get a web page's source code from Java

I just want to retrieve any web page's source code from Java. I found lots of solutions so far, but I couldn't find any code that works for all the links below: http://www.cumhuriyet.com.tr?hn=2987..

What is "android.R.layout.simple_list_item_1"?

I've started learning Android development and am following a todolist example from a book: // Create the array list of to do items final ArrayList<String> todoItems = new ArrayList<String>..

Postgresql SELECT if string contains

So I have a in my Postgresql: TAG_TABLE ========================== id tag_name -------------------------- 1 aaa 2 bbb 3 ccc To simplify my pro..

Spark SQL: apply aggregate functions to a list of columns

Is there a way to apply an aggregate function to all (or a list of) columns of a dataframe, when doing a groupBy? In other words, is there a way to avoid doing this for every column: df.groupBy("col1..

No provider for Router?

Im getting this error: EXCEPTION: Error in ./AppComponent class AppComponent - inline template:0:0 caused by: No provider for Router! This is my app component: import {Component} from '@angul..

Why call git branch --unset-upstream to fixup?

I'm more of a novice when it comes to advanced operations in git. I maintain my blog using the blogging framework Octopress. Though Octopress is not under any development since 2011, it serves my purp..

How do I convert the date from one format to another date object in another format without using any deprecated classes?

I'd like to convert a date in date1 format to a date object in date2 format. SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MMMM dd, yyyy"); SimpleDateFormat simpleDateFormat1 = ne..

How to install maven on redhat linux

Note: When originally posted I was trying to install maven2. Since the main answer is for maven3 I have updated the title. The rest of the question remains as it was originally posted. I'm trying to ..

Is it possible to use JavaScript to change the meta-tags of the page?

If I put a div in the head and display:none, than use JavaScript to display it, will this work? Edit: I have stuff loaded in AJAX. And as my AJAX changes the "main" portion of the site, I want to ch..

Is there a way to add/remove several classes in one single instruction with classList?

So far I have to do this: elem.classList.add("first"); elem.classList.add("second"); elem.classList.add("third"); While this is doable in jQuery, like this $(elem).addClass("first second third"); ..

Where to find the win32api module for Python?

I need to download it for Python 2.7, but can't seem to find it... ..

Convert Numeric value to Varchar

i m trying to fetch the record using append some alphabt in my numeric column. but i m getting error, i tried with cast and convert function. for exmaple select convert(varchar(10),StandardCost +'S'..

In what cases will HTTP_REFERER be empty

I know it's possible to get an empty HTTP_REFERER. Under what circumstances does this happen? If I get an empty one, does it always mean that the user changed it? Is getting an empty one the same as g..

How to start anonymous thread class

I have the following code snippet: public class A { public static void main(String[] arg) { new Thread() { public void run() { System.out.println("blah"); ..

Can you detect "dragging" in jQuery?

I have a throbber that is to appear when a user clicks a link. The problem is is that that same link can be clicked and dragged to be rearranged. In this case, I wouldn't need the throbber to appear...

How to make a 3D scatter plot in Python?

I am currently have a nx3 matrix array. I want plot the three columns as three axis's. How can I do that? I have googled and people suggested using Matlab, but I am really having a hard time with u..

How to import local packages without gopath

I've used GOPATH but for this current issue I'm facing it does not help. I want to be able to create packages that are specific to a project: myproject/ +-- binary1.go +-- binary2.go +-- package1.go ..

Set a Fixed div to 100% width of the parent container

I have a wrapper with some padding, I then have a floating relative div with a percentage width (40%). Inside the floating relative div I have a fixed div which I would like the same size as its par..

Removing newline after <h1> tags?

I am having a problem with removing linebreaks after the <h1> tag, as everytime it prints, it adds a line break straight after it, so something like <h1>Hello World!</h1> <h2>H..

Writing a Python list of lists to a csv file

I have a long list of lists of the following form --- a = [[1.2,'abc',3],[1.2,'werew',4],........,[1.4,'qew',2]] i.e. the values in the list are of different types -- float,int, strings.How do I wr..

How to get HTML 5 input type="date" working in Firefox and/or IE 10

I find it odd that input type="date" is still not supported in Firefox after all of this time. In fact, I don't think they added in much (if any) of the HTML 5 new types on an input element. Not s..

Copying files to a container with Docker Compose

I have a Dockerfile where I copy an existing directory (with content) to the container which works fine: Dockerfile FROM php:7.0-apache COPY Frontend/ /var/www/html/aw3somevideo/ COPY Frontend/ /var..

matplotlib: plot multiple columns of pandas data frame on the bar chart

I am using the following code to plot a bar-chart: import matplotlib.pyplot as pls my_df.plot(x='my_timestampe', y='col_A', kind='bar') plt.show() The plot works fine. However, I want to improve ..

Installing Oracle Instant Client

I can't seem to figure out how to install the Oracle client on Windows Server 2008. I downloaded x64 version (the first file on the list) here. There are installation instructions on the bottom of th..

How to get package name from anywhere?

I am aware of the availability of Context.getApplicationContext() and View.getContext(), through which I can actually call Context.getPackageName() to retrieve the package name of an application. The..

Easy way to build Android UI?

Is there a tool or a website that could help me create a UI for an Android application using drag-and-drop? I found this site but want to know if there is a more stable tool or website for this?..

PHP cURL not working - WAMP on Windows 7 64 bit

I got my WAMP installed on my windows 7 64bit. cURL is not working, but still I got it enabled from the WAMP tray. I have also uncommented extension=php_curl.dll in php.ini for both the PHP and Apach..

How can I align the columns of tables in Bash?

I'd like to output a table format text. What I tried to do was echo the elements of an array with '\t', but it was misaligned. My code for((i=0;i<array_size;i++)); do echo stringarray[$i] $'\t..

iOS - Calling App Delegate method from ViewController

What I am trying to do is click a button (that was created in code) and have it call up a different view controller then have it run a function in the new view controller. I know it could be done rel..

How do I set a conditional breakpoint in gdb, when char* x points to a string whose value equals "hello"?

Can I specify that I want gdb to break at line x when char* x points to a string whose value equals "hello"? If yes, how?..

Programmatically navigate using React router

With react-router I can use the Link element to create links which are natively handled by react router. I see internally it calls this.context.transitionTo(...). I want to do a navigation. Not fro..

Copy file(s) from one project to another using post build event...VS2010

I have a solution with 3 projects in it. I need to copy a view from one project to another. I'm able to copy the created DLL via post build events like so: So i want to copy the file in project one..

How to use a client certificate to authenticate and authorize in a Web API

I am trying to use a client certificate to authenticate and authorize devices using a Web API and developed a simple proof of concept to work through issues with the potential solution. I am running ..

How to limit file upload type file size in PHP?

I have an upload form and am checking the file size and file type to limit the uploaded file to 2 megabytes and either .pdf, .jpg, .gif or .png file types. My goal is to have an alert message display..

What is the reason for java.lang.IllegalArgumentException: No enum const class even though iterating through values() works just fine?

This question is basically an extension of my previous question . I asked the previous question to be sure that the Enum constants are populated when the class loads . Here's is my class again with th..

How do I unlock a SQLite database?

sqlite> DELETE FROM mails WHERE (`id` = 71); SQL error: database is locked How do I unlock the database so this will work?..

No operator matches the given name and argument type(s). You might need to add explicit type casts. -- Netbeans, Postgresql 8.4 and Glassfish

I am trying to edit a table in Postgresql using JPA in Glassfish using EclipseLink. When I insert an entity, it runs fine. But, when I try to edit or remove the same entity, it fails with the followin..

Git copy file preserving history

I have a somewhat confusing question in Git. Lets say, I have a file dir1/A.txt committed and git preserves a history of commits Now I need to copy the file into dir2/A.txt (not move, but copy). I kno..

How to Increase browser zoom level on page load?

How to increase browser zoom level on page load? here is my web link recently i got the task to increase its width just like if Firefox we press Ctrl + and browser zoom level is increases is there an..

Pointers, smart pointers or shared pointers?

I am programming with normal pointers, but I have heard about libraries like Boost that implement smart pointers. I have also seen that in Ogre3D rendering engine there is a deep use of shared pointer..

Is it possible to run selenium (Firefox) web driver without a GUI?

We are considering upgrading our production server from Ubuntu-desktop 10.04 to Ubuntu-server 12.04. We have various services running on our current desktop OS such as Selenium Web Driver. My questi..

PHP function use variable from outside

function parts($part) { $structure = 'http://' . $site_url . 'content/'; echo($tructure . $part . '.php'); } This function uses a variable $site_url that was defined at the top of this pa..

Can pm2 run an 'npm start' script

Is there a way for pm2 to run an npm start script or do you just have to run pm2 start app.js So in development npm start Then in production with pm2 you would run something like pm2 start 'npm start..

Open a Web Page in a Windows Batch FIle

I have a batch file that does a bunch of things and at the end needs to open up a web browser to a page. Is there a way to, in essence, call ShellExecute on a http to open the web page? Windows Comma..

How to set the font size in Emacs?

I also want to save the font size in my .emacs file...

Determine the data types of a data frame's columns

I'm using R and have loaded data into a dataframe using read.csv(). How do I determine the data type of each column in the data frame?..

Rerouting stdin and stdout from C

I want to reopen the stdin and stdout (and perhaps stderr while I'm at it) filehandles, so that future calls to printf() or putchar() or puts() will go to a file, and future calls to getc() and such w..

android set button background programmatically

I would like to know how to set the button color programatically? I have coded the following but fails: Button11.setBackgroundColor(R.color.red); Thanks!!..

Working with $scope.$emit and $scope.$on

How can I send my $scope object from one controller to another using .$emit and .$on methods? function firstCtrl($scope) { $scope.$emit('someEvent', [1,2,3]); } function secondCtrl($scope) { ..

How to change Oracle default data pump directory to import dumpfile?

I'm using impdp to import a backup. But I want change default directory dumpfile. $ impdp system/password@$ORACLE_SID schemas=USER_SCHEMA dumpfile=mydumpfile.dmp logfile=impdpmydumpfile.log Import: ..

How can I access the MySQL command line with XAMPP for Windows?

How can I access the MySQL command line with XAMPP for Windows?..

AngularJs - ng-model in a SELECT

JSfiddle Problem: I have a SELECT-element in my page, which is filled in with an ng-repeat. It also has a ng-model which has a default value. When I change the value, the ng-model adapts, that's ok..

UnicodeEncodeError: 'charmap' codec can't encode - character maps to <undefined>, print function

I am writing a Python (Python 3.3) program to send some data to a webpage using POST method. Mostly for debugging process I am getting the page result and displaying it on the screen using print() fu..

Client on Node.js: Uncaught ReferenceError: require is not defined

I am writing an application with the Node.js, Express.js, and Jade combination. I have file client.js, which is loaded on the client. In that file I have code that calls functions from other JavaScrip..

How to get the file name from a full path using JavaScript?

Is there a way that I can get the last value (based on the '\' symbol) from a full path? Example: C:\Documents and Settings\img\recycled log.jpg With this case, I just want to get recycled log.jpg ..

Use Device Login on Smart TV / Console

I have noticed that Facebook seems to support Device Login with a token / PIN Code instead of user/login to be used on devices like TV or console: https://www.facebook.com/device In the search of th..

How to do a GitHub pull request

How do I create and/or send a pull request to another repository hosted on GitHub?..

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..

Check string for nil & empty

Is there a way to check strings for nil and "" in Swift? In Rails, I can use blank() to check. I currently have this, but it seems overkill: if stringA? != nil { if !stringA!.isEmpty { ..

Good way of getting the user's location in Android

The problem: Getting the user's current location within a threshold ASAP and at the same time conserve battery. Why the problem is a problem: First off, android has two providers; network and GPS. ..

How to use SQL Select statement with IF EXISTS sub query?

How to select Boolean value from sub query with IF EXISTS statement (SQL Server)? It should be something like : SELECT TABEL1.Id, NewFiled = (IF EXISTS(SELECT Id FROM TABLE2 WHERE TABLE2.ID = ..

CMake error at CMakeLists.txt:30 (project): No CMAKE_C_COMPILER could be found

I'm trying make a Visual Studio solution with CMake to compile the latest version of aseprite and CMake keeps giving me the: No CMAKE_C_COMPILER could be found. No CMAKE_CXX_COMPILER could be found. ..

On Selenium WebDriver how to get Text from Span Tag

On Selenium Webdriver, how I can retrieve text from a span tag & print? I need to extract the text UPS Overnight - Free HTML code are as follow: div id="customSelect_3" class="select_wrapp..

How to undo a git merge with conflicts

I am on branch mybranch1. mybranch2 is forked from mybranch1 and changes were made in mybranch2. Then, while on mybranch1, I have done git merge --no-commit mybranch2 It shows there were conflicts w..

How to create a link to another PHP page

I just converted some of my HTML pages to PHP pages, and I'm not that familiar with PHP. In my HTML pages, assuming it's just a static web app, I can link to another page quite simply by playing the f..

How does the @property decorator work in Python?

I would like to understand how the built-in function property works. What confuses me is that property can also be used as a decorator, but it only takes arguments when used as a built-in function and..

Angular - Use pipes in services and components

In AngularJS, I am able to use filters (pipes) inside of services and controllers using syntax similar to this: $filter('date')(myDate, 'yyyy-MM-dd'); Is it possible to use pipes in services/compon..

How to load property file from classpath?

getResourceAsStream() is the method of java.lang.Class class. This method finds the resource with given name into the classpath. Actually this method delegates to this object's class loader. In this e..

How to replace NaNs by preceding values in pandas DataFrame?

Suppose I have a DataFrame with some NaNs: >>> import pandas as pd >>> df = pd.DataFrame([[1, 2, 3], [4, None, None], [None, None, 9]]) >>> df 0 1 2 0 1 2 3 1..

Angular: date filter adds timezone, how to output UTC?

I'm using the date filter to render a unix timestamp in a certain format. I've noticed the filter adds the local timezone to the output. Is there any way to simply output the exact timestamp, without..

Spring Hibernate - Could not obtain transaction-synchronized Session for current thread

I created an application with spring + hibernate, but I always get this error. This is my first application with hibernate, I read some guides but I can not solve this problem. Where am I doing wrong?..

How to assign the output of a command to a Makefile variable

I need to execute some make rules conditionally, only if the Python installed is greater than a certain version (say 2.5). I thought I could do something like executing: python -c 'import sys; print..

How to hide elements without having them take space on the page?

I'm using visibility:hidden to hide certain elements, but they still take up space on the page while hidden. How can I make them totally disappear visually, as though they are not in the DOM at all (..

Set proxy through windows command line including login parameters

I want to set a proxy throught the command line, first thing I found out is that you have to run command line with administrator rights - then the basic proxy set would be: netsh winhttp set proxy SE..

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..

How to increase the max connections in postgres?

I am using Postgres DB for my product. While doing the batch insert using slick 3, I am getting an error message: org.postgresql.util.PSQLException: FATAL: sorry, too many clients already. My ..

Java GUI frameworks. What to choose? Swing, SWT, AWT, SwingX, JGoodies, JavaFX, Apache Pivot?

There is quite a lot of gui frameworks out there for java, but what is recognized as today's framework of choice? The following is my understanding of the different frameworks, please correct me if i..

How to use jquery $.post() method to submit form values

I have 1 main page with a form and another page to process the form value here are source codes of the 2 pages Form Page: <meta charset="UTF-8"> <title>Form Page</title> <script..

jQuery Combobox/select autocomplete?

Does a jQuery plug-in exist for replacing select/combo box? I tried SexyCombo, and it is as close to what I want, but it doesn't complete if you are writing from middle, only from beginning. I have ..

Add JVM options in Tomcat

How can I add jvm(Java virtual machine) options in Apache Tomcat 6? Is there a administration console in tomcat? I tried http://localhost:8080/admin but I could not get anything out of it. I want to..

FailedPreconditionError: Attempting to use uninitialized in Tensorflow

I am working through the TensorFlow tutorial, which uses a "weird" format to upload the data. I would like to use the NumPy or pandas format for the data, so that I can compare it with scikit-learn re..

How to get memory available or used in C#

How can I get the available RAM or memory used by the application? ..

Add a background image to shape in XML Android

How do you add a background image to a shape? The code I tried below but no success: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" ..

Unrecognized SSL message, plaintext connection? Exception

I have a java complied package to speak with the https server on net. Running the compilation gives the following exception: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection..

Get the ID of a drawable in ImageView

I have one ImageView and set a drawable on it. Now I need to get the ID of the drawable on click event of ImageView dynamically. How can I get it? imgtopcolor = (ImageView) findViewById(R.id.topcolor..

Convert Java Object to JsonNode in Jackson

Is it possible to directly convert a Java Object to an JsonNode-Object? The only way I found to solve this is to convert the Java Object to String and then to JsonNode: ObjectMapper mapper = new Obj..

What is the difference between a token and a lexeme?

In Compiler Construction by Aho Ullman and Sethi, it is given that the input string of characters of the source program are divided into sequence of characters that have a logical meaning, and are kno..

Adding Jar files to IntellijIdea classpath

I have created a new Intellij project. But I can't use the third party jars in my project. I have the jars in a directory structure as follows: repository/commons-logging/commons-logging-1.0.4.jar rep..

HTML selected="selected" not working

Hi can somebody tell me what is the wrong in the below code? Selected="selected" not working for me. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <select id="tstselect..

How to gracefully handle the SIGKILL signal in Java

How do you handle clean up when the program receives a kill signal? For instance, there is an application I connect to that wants any third party app (my app) to send a finish command when logging o..

Correct way to delete cookies server-side

For my authentication process I create a unique token when a user logs in and put that into a cookie which is used for authentication. So I would send something like this from the server: Set-Cookie..

SimpleXML - I/O warning : failed to load external entity

I'm trying to create a small application that will simply read an RSS feed and then layout the info on the page. All the instructions I find make this seem simplistic but for some reason it just isn'..

How to parse JSON in Kotlin?

I'm receiving a quite deep JSON object string from a service which I must parse to a JSON object and then map it to classes. How can I transform a JSON string to object in Kotlin? After that the map..

JQuery - how to select dropdown item based on value

I want set a dropdown(select) to be change based on the value of the entries. I have <select id="mySelect"> <option value="ps">Please Select</option> <option value="ab">F..

Running Selenium Webdriver with a proxy in Python

I am trying to run a Selenium Webdriver script in Python to do some basic tasks. I can get the robot to function perfectly when running it through the Selenium IDE inteface (ie: when simply getting th..

How to find Google's IP address?

Google is blocked in some countries. However, there are many ways to access Google, like VPN, agent, and by changing the hosts file. If I want to change the hosts file to access Google, how can I fi..

What are the options for (keyup) in Angular2?

The following works great when the enter key is released. What other options are available for the keyup in addition to keyup.enter? <input #inputstring (keyup.enter)="doSomething(inputstring.valu..

What is Ad Hoc Query?

I'm reading a book about SQL. In that book there's the term Ad Hoc Query, which I don't understand. What exactly is an ad hoc query?..

How do I append text to a file?

What is the easiest way to append text to a file in Linux? I had a look at this question, but the accepted answer uses an additional program (sed) I'm sure there should be an easier way with echo or ..

How to sort in mongoose?

I find no doc for the sort modifier. The only insight is in the unit tests: spec.lib.query.js#L12 writer.limit(5).sort(['test', 1]).group('name') But it doesn't work for me: Post.find().sort(['upd..

android lollipop toolbar: how to hide/show the toolbar while scrolling?

I'm using the new toolbar widget introduced in the appcompat / support-v7. I would like to hide/show the toolbar depending on if the user is scrolling up/down the page, just like in the new Google's p..

Get HTML code using JavaScript with a URL

I am trying to get the source code of HTML by using an XMLHttpRequest with a URL. How can I do that? I am new to programming and I am not too sure how can I do it without jQuery...

How to find the default JMX port number?

I am running a Java application on Java 6 VM on a remote Windows XP, on which I can run jvisualvm.exe to connect to the running application automatically. Now I need to connect that application from ..

Press Enter to move to next control

I have a few TextBox on the WinForm. I would like the focus to move to the next control when Enter key is pressed? Whenever a textbox gains control, it will also select the text, so that any editing w..

Real time face detection OpenCV, Python

I am trying to make a basic program for a real time face detection. Here's my code (I am a newbie in OpenCV) : import numpy as np import cv2 cam = cv2.VideoCapture(0) name = 'detect' face_cascade = c..

Excel formula to get cell color

I would like to know if we can find out the Color of the CELL with the help of any inline formula (without using any macros) I'm using Home User Office package 2010...

How to fix Python indentation

I have some Python code that have inconsistent indentation. There is a lot of mixture of tabs and spaces to make the matter even worse, and even space indentation is not preserved. The code works as ..

Connecting to SQL Server using windows authentication

When I was trying to connect to SQL Server using the following code: SqlConnection con = new SqlConnection("Server=localhost,Authentication=Windows Authentication, Database=employeedetails"); con.Ope..

How to scroll to the bottom of a RecyclerView? scrollToPosition doesn't work

I'd like to scroll to the bottom of the RecyclerView list after loading the activity. GENERIC_MESSAGE_LIST = (ArrayList) intent.getExtras().getParcelableArrayList(ConversationsAdapter.EXTRA_MESSAGE);..

How can I match on an attribute that contains a certain string?

I am having a problem selecting nodes by attribute when the attributes contains more than one word. For example: <div class="atag btag" /> This is my xpath expression: //*[@class='atag'] ..

Set order of columns in pandas dataframe

Is there a way to reorder columns in pandas dataframe based on my personal preference (i.e. not alphabetically or numerically sorted, but more like following certain conventions)? Simple example: fr..

How to Round to the nearest whole number in C#

How can I round values to nearest integer? For example: 1.1 => 1 1.5 => 2 1.9 => 2 "Math.Ceiling()" is not helping me. Any ideas?..

jquery ajax get responsetext from http url

Neither: var response = $.ajax({ type: "GET", url: "http://www.google.de", async: false, success : function() { alert (this); } }); Nor: var response2 = $.get("ht..

Loop through a comma-separated shell variable

Suppose I have a Unix shell variable as below variable=abc,def,ghij I want to extract all the values (abc, def and ghij) using a for loop and pass each value into a procedure. The script should a..

Virtual/pure virtual explained

What exactly does it mean if a function is defined as virtual and is that the same as pure virtual?..

What does -1 mean in numpy reshape?

A numpy matrix can be reshaped into a vector using reshape function with parameter -1. But I don't know what -1 means here. For example: a = numpy.matrix([[1, 2, 3, 4], [5, 6, 7, 8]]) b = numpy.res..

Couldn't process file resx due to its being in the Internet or Restricted zone or having the mark of the web on the file

I am facing an issue while debugging c# API Coding in Visual studio 2017. Debugging not started and showing a error message like Any idea about this error message? ..

Apache Spark: The number of cores vs. the number of executors

I'm trying to understand the relationship of the number of cores and the number of executors when running a Spark job on YARN. The test environment is as follows: Number of data nodes: 3 Data node ..