Search Results

Search found 157 results on 7 pages for 'aamir adnan'.

Page 5/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • work with rescue in Rails

    - by Adnan
    Hi, I am working with the following piece; def index @user = User.find(params[:id]) rescue flash[:notice] = "ERROR" redirect_to(:action => 'index') else flash[:notice] = "OK" redirect_to(:action => 'index') end Now I either case whether I have a correct ID or not, I am always getting "OK" in my view, what am I doing wrong? I need that when I have no ID in the DB to show "ERROR". I have also tried to use rescue ActiveRecord::RecordNotFound but same happens. All help is appreciated.

    Read the article

  • Flash AS3 - Scroll dynamic textfield to a specific part just like HTML anchor

    - by Aamir Mahmood
    Hi, We are building a flash website with cms at the back end, and we are allowing admin to put anchors inside a content. Later we created a smaller version of the whole content to display just a small part and then [read more] button. Which add a new layer on top of every thing acting like a popup and it is populated with complete content. Now we would like to scroll that text inside popup to that portion which [read more] button was clicked. The most common example inside HTMl is go to top link in footer on most of the sites which move the whole document to top. Happy codding.

    Read the article

  • namespace extension.. galaxy file system toolkit...gmail shell drive like utility...

    - by Muhammad Adnan
    i was looking for some namespace extention to extend using c# (.net) but didn't find much help online except Galaxy Filesystem tooklkit. which are vc++ based but comes with c# and java wrapper classes... which helps me alot to start and i did. i have extended that enough now and made installer to install. it get installed successfully but don't know why, when i open it, system get stuck... :( i thought my modified version might have some problem so i tried to run Galaxy filesystem toolkit's author original version and it responded in same way as mine do :D :( now feeling bit helpless as even author is not responding my queries regarding my queries for some reason... any help would be really appreciated.... FYI: i need to have Gmail drive like stuff...

    Read the article

  • Conversion from string to type 'Double' is not valid.

    - by Adnan Badar
    Hi, I am getting the following error while running a select statement (using OleDbCommand). My query is SELECT CME FROM Personnel WHERE CME = '11349D' If objOleDbCom.ExecuteScalar() 0 Then When i execute the above statement i got this error Conversion from string "11349D" to type 'Double' is not valid. My field CME data type is Text My database is Access 2007 I tried by running my query directly inside database and it is running fine. Please suggest. Thanks.

    Read the article

  • is this a secure approach in ActiveRecords in Rails?

    - by Adnan
    Hello, I am using the following for my customers to unsubscribe from my mailing list; def index @user = User.find_by_salt(params[:subscribe_code]) if @user.nil? flash[:notice] = "the link is not valid...." render :action => 'index' else Notification.delete_all(:user_id => @user.id) flash[:notice] = "you have been unsubscribed....." redirect_to :controller => 'home' end end my link looks like; http://site.com/unsubscribe/32hj5h2j33j3h333 so the above compares the random string to a field in my user table and accordingly deletes data from the notification table. My question; is this approach secure? is there a better/more efficient way for doing this? All suggestions are welcome.

    Read the article

  • replace values in a String from a Hashtable in Java

    - by Adnan
    My string looks like; String values = "I am from UK, and you are from FR"; and my hashtable; Hashtable countries = new Hashtable(); countries.put("United Kingdom", new String("UK")); countries.put("France", new String("FR")); What would be the most effective way to change the values in my string with the values from the hashtable accordingly. These are just 2 values to change, but in my case I will have 100+

    Read the article

  • EXPLAIN PLAN FOR in ORACLE

    - by Adnan
    I am making a test. I have all tests in rows, so my rows looks like this; ID | TEST ---------------------------------- 1 | 'select sysdate from dual' 2 | 'select sysdatesss from dual' Now I read it row by row and I need to test it with EXPLAIN PLAN FOR so the for the first row it would be EXPLAIN PLAN FOR select sysdate from dual but I have problem converting the TEST field. Right now I use; EXPLAIN PLAN FOR testing.TEST but it does not work. Any ideas?

    Read the article

  • Read from params[] in Rails

    - by Adnan
    Hi, I use: <%= select( "payment", "id", { "Visa" => "1", "Mastercard" => "2"}) %> and I get this in HTML <select id="payment_id" name="payment[id]"><option value="2">Mastercard</option> <option value="1">Visa</option></select> now how can I read the payment[id] with params[], if I use params[payment[id]] I get an error.

    Read the article

  • Ruby - model.rb:20: syntax error, unexpected keyword_end, expecting $end

    - by Yasir Adnan
    I don't understand what's wrong with my code. model.rb require 'Gemfile' DataMapper.setup(:default, 'mysql://root:password@localhost/rengine') Class User include DataMapper::Resource property :id, Serial # An auto-increment integer key property :email, String, format: :email_address property :username, String, required: true property :password, String , length: 10..255, required: true property :created_at, DateTime property :updated_at, DateTime #User can have mutiple posts has n, :posts end Class Post include DataMapper::Resource property :id, Serial # An auto-increment integer key property :title, String, required: true property :body, Text, required: true property :created_at, DateTime property :updated_at, DateTime #Posts belongs to a USer belongs_to :user end DataMapper.auto_upgrade! I didn't able to figure out. What's problem is here??

    Read the article

  • Multiple REPLACE function in Oracle

    - by Adnan
    I am using the REPLACE function in oracle to replace values in my string like; SELECT REPLACE('THE NEW VALUE IS #VAL1#','#VAL1#','55') from dual So this is OK to replace one value, but what about 20+, should I use 20+ REPLACE function or is there a more practical solution. All ideas are welcome.

    Read the article

  • project plan scheduling...

    - by Muhammad Adnan
    I am looking for some algorithm/library to get functionality like microsoft project caters for scheduling tasks dates as if we change any task date then its parent, predecessors and successors dates get effected. is there any help i can get... in any way.. Thanks,

    Read the article

  • windows form applications' cut copy paste functionality

    - by Muhammad Adnan
    I have windows forms application with multiple forms and controls in them. I want if user has selected some text in any control of any form of my application and click on cut/copy/paste button on toolbar operation get performed accordingly. i m using C#.net's sendkeys.send("^c") on click of copy button but it doesn't work... OR any 1 can tell if is there any way to get selected text (despite of knowing, which form/control of my application). Thanks in advance...

    Read the article

  • Multiple values in a column

    - by Adnan
    Hi I need some advice regarding multiple records. I have a table with fields username,*message* and message_to. the scenario could be of sending same message to multiple users in a go. What do you suggest? will it be efficient to save all recipients in a single column with comma separated values or I add multiple entries ? Thanks /A

    Read the article

  • read files from directory and filter files from Java

    - by Adnan
    The following codes goes through all directories and sub-directories and outputs just .java files; import java.io.File; public class DirectoryReader { private static String extension = "none"; private static String fileName; public static void main(String[] args ){ String dir = "C:/tmp"; File aFile = new File(dir); ReadDirectory(aFile); } private static void ReadDirectory(File aFile) { File[] listOfFiles = aFile.listFiles(); if (aFile.isDirectory()) { listOfFiles = aFile.listFiles(); if(listOfFiles!=null) { for(int i=0; i < listOfFiles.length; i++ ) { if (listOfFiles[i].isFile()) { fileName = listOfFiles[i].toString(); int dotPos = fileName.lastIndexOf("."); if (dotPos > 0) { extension = fileName.substring(dotPos); } if (extension.equals(".java")) { System.out.println("FILE:" + listOfFiles[i] ); } } if(listOfFiles[i].isDirectory()) { ReadDirectory(listOfFiles[i]); } } } } } } Is this efficient? What could be done to increase the speed? All ideas are welcome.

    Read the article

  • How to write configurable Embedded C code which can run on multihardware platform

    - by Adnan
    Hello all , What are the techniques used to write an embedded C software which has multi features. Features can be configurable for multi-hardware platform. I have developed a firmware based on a RTOS for ARM7. Now i want to make it a baseline firmware which can be used with similar, more or less features (configurable) on different microcontrollers, like MSP, or AVR etc. Being more specific, if i want to change different features of firmware for one hardware and others for the second. What technique should i adopt and is there any study material available. Regards

    Read the article

  • check if a line is valid or not in Java

    - by Adnan
    I would like to perform checking on the following: VALID LINES; /**/ some code */ some code /** dsfsdkf sd**/ NOT VALID LINES; /**/ //some code */ /***/ //somecode So basically if there is a line of code outside a comment it is valid, otherwise not. What would be the best way to tackle this kind of validation? Note: For */ I assume that the /* has been opened some lines before.

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >