Search Results

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

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

  • 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

  • effective counter for unique number of visits in PHP & MySQL

    - by Adnan
    Hello, I am creating a counter for unique number of visits on a post, so what I have until now is a table for storing data like this; cvp_post_id | cvp_ip | cvp_user_id In cases a registered user visits a post, for the first time a record is inserted with cpv_post_id and cvp_user_id, so for his next visit I query the table and if the record is available I do not count him as a new visitor. In cases of an anonymous user the same happens but now the cvp_ip and cpv_post_id are used. My concerns is that I do a query every time anyone visits a post for checking if there has been a visit, what would be a more effective way for doing this?

    Read the article

  • How do I extract Info associated with any OpenID provider?

    - by Adnan
    OpenID providers like GOogle,Yahoo etc also stroes user info like Name,email etc. Is it possible to retrieve it by using OpenID Selector(http://code.google.com/p/openid-selector/)? If yes then how do I fetch it? is the OpenID URL same every time when a user logs in? if yes ten may I store that handler in DB? I am using PHP.

    Read the article

  • computed column calculate a value based on different table

    - by adnan
    i've a table c_const code | nvalue -------------- 1 | 10000 2 | 20000 and i've another table t_anytable rec_id | s_id | n_code --------------------- 2 | x | 1 now i want to calculate the x value with computed column, based on rec_id*(select nvalue from c_const where code=ncode) but i get error "Subqueries are not allowed in this context. Only scalar expressions are allowed." how can i calculate the value in this computed column ? thanks.

    Read the article

  • Group by with ActiveRecord in Rails

    - by Adnan
    Hello, I have a the following table with rows: ================================================================ id | name | group1 | group2 | group3 | group4 | ================================================================ 1 | Bob | 1 | 0 | 0 | 1| ================================================================ 2 | Eric| 0 | 1 | 0 | 1| ================================================================ 3 | Muris | 1 | 0 | 1 | 1| ================================================================ 4 | Angela | 0 | 0 | 0 | 1| ================================================================ What would be the most efficient way to get the list with ActiveRecords ordered by groups and show their count like this: group1 (2) group2 (1) group3 (1) group4 (4) All help is appreciated.

    Read the article

  • group by country with ActiveRecords in Rails

    - by Adnan
    Hello, I have a table with users: name | country | .. | UK | .. | US | .. | US | .. | UK | .. | FR | .. | FR | .. | UK | .. | UK | .. | DE | .. | DE | .. | UK | .. | CA | . . What is the most efficient way with ActiveRecords to get the list of countries in my view and for each country how many users are from, so: US 123 UK 54 DE 33 . . .

    Read the article

  • how to enter text into uitextfield

    - by adnan
    I have implemented the delegates for UITextField and also method for these text field. Below are the methods: - (void)textFieldDidBeginEditing:(UITextField *)textField { [textField resignFirstResponder]; } - (BOOL)textFieldShouldReturn:(UITextField *)aTextField { [aTextField resignFirstResponder]; return YES; } My problem is that when I want to enter text into UITextField its delegate does not allow me to enter the text into textfields. Kindly tell me how i can enter the data into textfields

    Read the article

  • retrieving data from memcache

    - by Adnan
    Hello, I am starting to learn the benefits of memcache, and would like to implement it on my project. I have understood most of it, such as how data can be retrieved by a key and so on. Now I get it that I can put a post with all of its details in memcache and call the key POST:123, that is OK, and I can do it for each post. But how to deal with the case when I query the table posts to get the list of all posts with their titles. Can this be done with memcache, or should this always be queried from the table?

    Read the article

  • Validate a statment from string in JAVA

    - by Adnan
    I have a string; String allIn = "(50 > 100) AND (85< 100)"; Now I need to evaluate if the conditions inside are TRUE or FALSE, how can I do it? In real the string will be a value from a field in my DB, where I will substitute different values and they will form a string as shown above.

    Read the article

  • PHP Code Problem...

    - by aamir Fayyaz
    function check_login($array_val) { $strQury = "Select * from tblsignup where usr_email ='".$array_val[0]."' and usr_password = '".$array_val[1]."'" ; $result = mysql_query($strQury); $row_user = mysql_fetch_array($result); if(mysql_num_rows($result)>0) { $msg = "true"; } else { $msg = "false"; } return $msg ; } The return value is Object id #1true???? what is object id#1?

    Read the article

  • simple search in rails

    - by Adnan
    Hi, I'm making a simple search form in rails. In my search view I have two select boxes with fixed values like: SELECT BOX 1 SELECT BOX 2 ALL, ALL, FR, FR, US, US, DE DE And I have 2 fields in my DB with country_from and country_to. So for making a simple search like from FR to US I use: @search_result = Load.find(:all, :conditions => "country_from='#{params[:country_from]}' AND country_to='#{params[:country_to]}'" ) that is fine, but I need to implement the ALL option as well, so when I make a search like from DE to ALL I get a list with all countries in country_to I image I can do it with ifs...but what would be the most efficient way to do it?

    Read the article

  • remove duplicate from string in PHP

    - by Adnan
    Hello, I am looking for the fastest way to remove duplicate values in a string separated by commas. So my string looks like this; $str = 'one,two,one,five,seven,bag,tea'; I can do it be exploding the string to values and then compare, but I think it will be slow. what about preg_replace() will it be faster? Any one did it using this function?

    Read the article

  • Browsed Time Problem.

    - by aamir Fayyaz
    I want to display the browsed time of a user, But when i refresh it, it will be again start from 0:0:0. How can it handle? <?php $total_mints=($live_match['match_name']) * (60); ?> <script language="javascript"> display_c(<?=$total_mints?>,'ct'); </script> <script type="text/javascript"> function display_c(start,div){ window.start = parseFloat(start); var end = 0 // change this to stop the counter at a higher value var refresh=1000; // Refresh rate in milli seconds if(window.start >= end ){ mytime=setTimeout("display_ct('"+div+"')",refresh) } else {alert("Time Over ");} </script>

    Read the article

  • alternative of microsoft project along API :)

    - by adnan
    Dear, I am looking for well known Microsoft Project alike applications which somehow i get to know through this http://stackoverflow.com/questions/729926/alternatives-to-microsoft-project but I also need to know their API/Library through which I can pro grammatically read their files using .NET Hope m not asking for much :)

    Read the article

  • list all files from directories and subdirectories in Java

    - by Adnan
    What would be the fastest way to list the names of files from 1000+ directories and sub-directories? EDIT; The current code I use is: import java.io.File; public class DirectoryReader { static int spc_count=-1; static void Process(File aFile) { spc_count++; String spcs = ""; for (int i = 0; i < spc_count; i++) spcs += " "; if(aFile.isFile()) System.out.println(spcs + "[FILE] " + aFile.getName()); else if (aFile.isDirectory()) { System.out.println(spcs + "[DIR] " + aFile.getName()); File[] listOfFiles = aFile.listFiles(); if(listOfFiles!=null) { for (int i = 0; i < listOfFiles.length; i++) Process(listOfFiles[i]); } else { System.out.println(spcs + " [ACCESS DENIED]"); } } spc_count--; } public static void main(String[] args) { String nam = "D:/"; File aFile = new File(nam); Process(aFile); } }

    Read the article

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