Posts

tsql - How to get DateTime formated -

in sql server how can current date time 12:00 am. getdate() current date , time.i need have datetime formated this: 2011-02-04 12:00 or 2011-02-04 00:01 thanks you first need know how time want. called "flooring" date time. see example: --floor datetime select '0 none', getdate() -- none 2008-09-17 12:56:53.430 union select '1 second',dateadd(second,datediff(second,'2000-01-01',getdate()),'2000-01-01') -- second: 2008-09-17 12:56:53.000 union select '2 minute',dateadd(minute,datediff(minute,0,getdate()),0) -- minute: 2008-09-17 12:56:00.000 union select '3 hour', dateadd(hour,datediff(hour,0,getdate()),0) -- hour: 2008-09-17 12:00:00.000 union select '4 day', dateadd(day,datediff(day,0,getdate()),0) -- day: 2008-09-17 00:00:00.000 union select ...

Will VS2010 work with Visual Source Safe 2005? -

until can convince others convert on team foundation server 2010 (tfs2010), i'm still going use visual source safe 2005 (vss2005). upgrade visual studio 2010 (vs2010) soon. need vs2010 work vss2005? understand there patch vss. here's the patch . i'm not sure if need make work or not.

php - where to store helper functions? -

i've got lot of functions create or copy web. i wonder if should store them in file include script or should store each function static method in class. eg. i've got getcurrentfolder() , isfilephp() function. should stored in file or each in class: folder::getcurrent() file::isphp(); how do? i know kinda "as u want" question great advices/best practices thanks. you're right, highly subjective matter use mix of 2 options. you have class (say helper) has __call() (and/or __callstatic() if you're using php 5.3+) magic methods , when non defined [static] method called it'll load respective helper file , execute helper function. keep in mind though including files decreases performance, believe benefit gain in terms of file organization far outweighs tiny performance hit. a simple example: class helper { function __callstatic($m, $args) { if (is_file('./helpers/' . $m . '.php')) { includ...

wpf - Why is button background defaulting to grey when IsPressed is true -

Image
i have simple problem. using ispressed trigger want able set background color of button other default grey. here button looks when not pressed and here looks when clicked here trigger button. know trigger firing correctly because of glow effect around edge of button when clicked. know brush correct because tried out background brush see looked like. <style.triggers> <trigger property="ismouseover" value="true"> <setter property="background" value="{dynamicresource buttonhoverbrush}"/> <setter property="bitmapeffect" value="{dynamicresource buttonhoverglow}"/> </trigger> <!-- trigger working background color wont change --> <trigger property="ispressed" value="true"> <setter property="bitmapeffect" value="{dynamicresource buttonhoverglow}"/> ...

listview - Custom filtering in Android using ArrayAdapter -

i'm trying filter listview populated arrayadapter: package me.alxandr.android.mymir.adapters; import java.util.arraylist; import java.util.collection; import java.util.collections; import java.util.hashmap; import java.util.iterator; import java.util.set; import me.alxandr.android.mymir.r; import me.alxandr.android.mymir.model.manga; import android.content.context; import android.util.log; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.arrayadapter; import android.widget.filter; import android.widget.sectionindexer; import android.widget.textview; public class mangalistadapter extends arrayadapter<manga> implements sectionindexer { public arraylist<manga> items; public arraylist<manga> filtered; private context context; private hashmap<string, integer> alphaindexer; private string[] sections = new string[0]; private filter filter; private boolean enablese...

java - Returning the value that for statement prints -

i return information output statement prints. for instance: public static int countnumbers(int x) { (int = 1; <= x; i++) { system.out.println(i); } return something; // should values statements prints. // example, countnumbers(5) returns 12345. } so when call method somewhere else, output. so: int output = countnumbers(3); //output = 123; how can done? use stringbuilder accumulate result. update: convert int using integer.parseint : public static int countnumbers(int i) { stringbuilder buf = new stringbuilder(); (int i=1; i<=5; i++) { buf.append(i); } return integer.parseint(buf.tostring()); } note works small values of i (up 9), otherwise integer overflow.

php - Problems in user - registration module in DRUPAL -

i have problem in drupal registration page. i want change whole user registration page. in registration module want add new field type. bcz want user can choose date date-time picker. have ready date-time picker have implement, don't know put code. i want add validation on new added text fields. means have added 1 text field phone no, want check if user had entered numbers.....in new user registration page. thanks in advance nitish if want alter way user registration works, can hook_form_alter on registration form. with date module, can insert form field has jquery popup date picker. the $form['#validate'] array of validation functions call, can add own list run own validation.