What is the difference between Date.current and Date.today?

What is the difference between Date.current and Date.today?

They both seem to do the same thing. I'm just worried that one uses timezones differently to the other. 1:See Rails code, line 40 here.# Returns Time.zone.today when Time.zone or config.time_zone are set, otherwise just returns Date.

Vertically aligning text next to a radio button

Vertically aligning text next to a radio button

This is a basic CSS question, I have a radio button with a small text label after it. I want the text to appear centered vertically but the text is always aligned with the button of the radio button in my case.A labelHere is a Jsfiddle:http

how to set only numeric value for EditTextPreference in android?

how to set only numeric value for EditTextPreference in android?

how to set only numeric value for EditTextPreference in android. I want a user to enter a port number not sure how can I put the limitation thereI am using this code, user can enter any string. Want to limit the user to atleast numbers only

Cancel a AngularJS $timeout on routeChange

Cancel a AngularJS $timeout on routeChange

On a specific page in my application I think of doing a server-call to update information on a set interval.I stumbled upon a problem though. I want to cancel my $timeout when a user navigates away from the page in question so that the appl

Returning an Eloquent model as JSON in Laravel 4

Returning an Eloquent model as JSON in Laravel 4

How do you return an Eloquent model to the browser as JSON? What is the difference between the two methods below? Both seems to work.#1:return Response::json($user->toArray());#2:return $user->toJson(); 1:The actual data sent is the same

C#: How do you send OK or Cancel return messages of dialogs when not using buttons?

C#: How do you send OK or Cancel return messages of dialogs when not using buttons?

C#: How do you send OK or Cancel return messages of dialogs when not using buttons?How would you return the OK message in the condition of a textbox that will proceed when the user presses Enter, and will send Cancel when the user presses C

How to use  inside an attribute of ?

How to use inside an attribute of ?

I have JSP code like: " path="email" cssClass="input required email" /> I want to set the title attribute with some tooltip text, supporting i18n. How would I do this?I am looking to do something like this: "/>" path="email" cssCl

SQL Server: IF EXISTS ; ELSE

SQL Server: IF EXISTS ; ELSE

I have a tableA:ID value 1 100 2 101 2 444 3 501Also TableB ID Code12Now I want to populate col = code of table B if there exists ID = 2 in tableA. for multiple values , get max value.else populate it with '123'. Now here is what I used

“Input line is too long” error in BAT File

“Input line is too long” error in BAT File

I am having a problem executing a bat file. After some time running I get the "input line is too long" error.The structure of the bat file is simple. There is a main bat file that calls 10 other bat files that are responsible for updating d

how to store grep command result in some variable in shell

how to store grep command result in some variable in shell

I want to find out number of directories and files in home directory and want to store count some variable in a shell script. I am using following set of commands.command="ls -l | grep -c \"rahul.*patle\""eval $commandi want to store this c

Get only unique elements from two lists python

Get only unique elements from two lists python

if i have two lists (may be with different len):x = [1,2,3,4]f = [1,11,22,33,44,3,4]result = [11,22,33,44]im doing:for element in f: if element in x: f.remove(element)im gettingresult = [11,22,33,44,4] 1:If you want the unique

Backwards compatible PageTransformer

Backwards compatible PageTransformer

I'm trying to animate items in a ViewPager and the PageTransformer fits the bill. I want it to be backwards compatible to Android 2.2 so am using the support v4 library. However... As property animation is only supported as of Android 3.0

PBEWithMD5AndDES Encryption in iOS

PBEWithMD5AndDES Encryption in iOS

I'm having an issue with PBEWithMD5AndDES encryption in iOS. I've got my strings encrypting and decrypting using this, https://gist.github.com/788840/24bc73ecd0ac3134cbd242892c74a06ac561d37b. The problem is I get different encrypted value

How can I change a specific RGB color into a specific CMYK color in a PDF file?

How can I change a specific RGB color into a specific CMYK color in a PDF file?

If I have a PDF file with objects (text, line-art) in a specific RGB color, and I want to convert those objects to have a specific CMYK color, what libraries are available that will let me do that?Note that I don't need the ability to "map"

Lemmatizer in R or python (am, are, is -> be?) [closed]

Lemmatizer in R or python (am, are, is -> be?) [closed]

I'm not a [computational] linguistic, so please excuse my supper dummy-ness in this topic.According to Wikipedia, lemmatisation is defined as: Lemmatisation (or lemmatization) in linguistics, is the process of grouping together the differe

Inno Setup WizardImageFile looks bad with font scaling on Windows 7

Inno Setup WizardImageFile looks bad with font scaling on Windows 7

Bitmap for Inno Setup WizardImageFile (and WizardSmallImageFile) looks terrible because when Windows 7 has the large system fonts enabled, the Wizard is bigger than usual, but the images are scaled terrible wrong.Is there a fix?There is no

JavaFX bidirectional binding not working with the control becoming not editable

JavaFX bidirectional binding not working with the control becoming not editable

Give a very elementary class (imports resolved into javafx packages): public class T07 extends Application implements Initializable{with some fields representing controls defined in an .fxml file:@FXML TextField text01;and a data model that

jQuery UI datepicker date range

jQuery UI datepicker date range

I am trying to setup two date pickers like this http://jqueryui.com/demos/datepicker/#date-range. But if you manually type in a date into that example you can break the code. e.g. select a from date, then the picker stops you from selecting

How to modify Expander button background only? WPF

How to modify Expander button background only? WPF

I have an Expander placed on a window with a blue background and I would like to make the button for the expander another color than the default (blue, which it is receiving from the window). When I modify the background property of the ex

PHP: upload file from one server to another server

PHP: upload file from one server to another server

I'm developing a website in a server and the storage is in another server and I have to deal with that somehow. I nerve experience this case and I found that the solution is to use curl.Kindly explain to me how to use Curl in detail from ze

How to implement a live search in Meteor without text input blurring after every letter?

How to implement a live search in Meteor without text input blurring after every letter?

I am trying to implement a basic live search bar so I have an event listening to any keyup:'keyup input.search-query': function (evt) { Session.set("search-query", evt.currentTarget.value);}, This seems to be working, except anytime I pr

Binding WPF ContextMenu MenuItem to UserControl Property vs ViewModel Property

Binding WPF ContextMenu MenuItem to UserControl Property vs ViewModel Property

I'm struggling to understand what is going on with the ContextMenu. I know it is rendered as a separate window, with a separate visual tree, so we can't use relative binding to bind a command exposed as a property of the user control. e.g.

Set div height to 100% of parent

Set div height to 100% of parent

I want the following layout for my web page:| header || navigation | details || | |Where the navigation pane (content dynamically generated) contains hundreds of elements. I want a vertical scroll bar to be

Character encoding problems with tomcat

Character encoding problems with tomcat

I'm having trouble with character encoding for a web application. There is a pop up that queryes the database with user input (search a person by name). The problem is that accented characters are being transformed into weird letters like ó

automatic installation of common magento extensions at project kickoff

automatic installation of common magento extensions at project kickoff

There are some Magento Connect extensions that I find myself installing every time I create a new project, such as Fontis_Recaptcha, Mass_Product_Relater, HM_DeveloperToolbar, ModuleCreator, Alanstormdotcom_Layoutviewer, etc. What's on you