Posts

ruby - Devise: Is it possible to NOT send a confirmation email in specific cases ? (even when confirmable is active) -

here situation, use devise allow users create account on site , manage authentication. during registration process allow customers change options, leading different account being created still based on same core user resource. choose not send confirmation email of account types. don't care if account not confirmed , user cannot log in, that's ok, no pb that. how go doing ? thanks, alex actually it's quite easy once dig little deeper. override 1 method in user model (or whatever using): # callback overwrite if confirmation required or not. def confirmation_required? !confirmed? end put conditions , job's done ! alex

java - non-static method encode(byte[]) cannot be referenced from a static context -

package com.cordys.report; import java.io.fileinputstream; import org.apache.commons.codec.binary.base64; public class encode { public static string encodefilestream(string filepath) //file path ex : c:\program files\cordys\web\reports\i0001180.pdf { try { fileinputstream fin = new fileinputstream("e:/css document/test.pdf"); stringbuffer sb=new stringbuffer(); int linelength = 72; byte[] buf = new byte[linelength/4*3]; while (true) { int len = fin.read(buf); if (len <= 0) { break; } sb.append(base64.encode(buf)); return sb.tostring(); } } catch(exception e) { return e.getmessage(); } } } as seen @ http://commons.apache.org/codec/apidocs/org/apache/commons/codec/binary/base64.html try base64.encodebase64() instead.

c# - How to get Telerik's RadEditor's Spell checker to start automatically when incorrect word is typed? -

currently have click spell check button on radeditor's toolbar see word suggestions. there way that? did find way run spell checker on submit button click how want? have gone through forums in vain. need please. telerik people have not replied. it's been 3 days asking here. familiar telerik controls please me out. edit: in here familiar telerik controls please me out. i don't think there way spellchecker check each word right after type - have click spell tool (or can assign keyboard shortcut it). way - modern browsers except ie offer built-in spellcheck support available inside radeditor - can try opening radeditor page firefox, chrome, etc. - radeditor demo . start typing , incorrect words marked.

python - Delete newline / return carriage in file output -

i have wordlist contains returns separate each new letter. there way programatically delete each of these returns using file i/o in python? edit: know how manipulate strings delete returns. want physically edit file returns deleted. i'm looking this: wfile = open("wordlist.txt", "r+") line in wfile: if len(line) == 0: # note, following not real... i'm aiming achieve. wfile.delete(line) >>> string = "testing\n" >>> string 'testing\n' >>> string = string[:-1] >>> string 'testing' this says "chop off last thing in string" : "slice" operator. idea read on how works very useful. edit i read updated question. think understand now. have file, this: aqua:test$ cat wordlist.txt testing wordlist returns between lines and want rid of empty lines. instead of modifying file while you're reading it, create new file c...

How to resize or remove one object from canvas using Javascript? -

is there change remove or resize selected object canvas without changing other design. for example:- drawn circles (just circle1, circle2, circle3) . circle1 bottom of other 2 circles. want remove circle2 or re-size. should not effect other circles. and there change without using clear canavas method. it should work powerpoint design draw , resize , delete. i not think possible, canvas bitmap object far know , draw on updates image. if use circle object should svg citation: "once rectangle drawn, fact drawn forgotten system. if position changed, entire scene need redrawn, including objects might have been covered rectangle."

google api - Geocoder is not working in android -

i working on program takes address input user , navigates google map particular location,i have used getfromlocationname() method of geocoder not getting output, little afraid because not able understand meaning of below phrase given in android site "the geocoder class requires backend service not included in core android framework. geocoder query methods return empty list if there no backend service in platform. use ispresent() method determine" if end service not present how it.. but when try use ispresent() method giving me compilation error, plz suggest me, response appreciated

java - how to run selenium rc test case in Internet Explorer -

my selenium rc java code running on firefox. can tell me how run same test case on internet explorer? change browser start command string pass defaultselenium factory. *iehta or *iexplore depending on selenium version. new defaultselenium("localhost", 4444, "*iexplore", "http://www.google.com/"); check out docs more info. --sai