Search Results

Search found 693 results on 28 pages for 'muhammad ali rajput'.

Page 21/28 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Disable table in javascript

    - by Muhammad Akhtar
    Hi, I have many controls in table and I want to disable all the controls using JavaScript upon clicking of some checkbox. I have google and found that we can't disable table instead all controls through loop. Please suggest me, what is better idea Thanks

    Read the article

  • How to prevent client from accessing JSP page

    - by Ali Bassam
    In my web application, I use the .load() function in JQuery, to load some JSP pages inside a DIV. $("#myDiv").load("chat.jsp"); In chat.jsp, no Java codes is executed unless this client has Logged in, means, I check the session. String sessionId = session.getAttribute("SessionId"); if(sessionId.equals("100")){ //execute codes }else{ //redirect to log in page } Those java codes that will be executed, they will out.println(); some HTML elements. I don't want the client to write /chat.jsp in the browser to access this page, as it will look bad, and the other stuff in the main page won't be there, and this could do a harm to the web app security. How can I restrict someone from accessing chat.jsp directly, but yet keep it accessible via .load() ? UPDATE: JavaDB is a class that I made, it connects me to the Database. This is chat.jsp <body> <% String userId = session.getAttribute("SessionId").toString(); if (userId != null) { String roomId = request.getParameter("roomId"); String lastMessageId = request.getParameter("lastMessageId"); JavaDB myJavaDB = new JavaDB(); myJavaDB.Connect("Chat", "chat", "chat"); Connection conn = myJavaDB.getMyConnection(); Statement stmt = conn.createStatement(); String lastId = ""; int fi = 0; ResultSet rset = stmt.executeQuery("select message,message_id,first_name,last_name from users u,messages m where u.user_id=m.user_id and m.message_id>" + lastMessageId + " and room_id=" + roomId + " order by m.message_id asc"); while (rset.next()) { fi = 1; lastId = rset.getString(2); %> <div class="message"> <div class="messageSender"> <%=rset.getString(3) + " " + rset.getString(4)%> </div> <div class="messageContents"> <%=rset.getString(1)%> </div> </div> <% } %> <div class="lastId"> <% if (fi == 1) {%> <%=lastId%> <% } else {%> <%=lastMessageId%> <% }%></div> <% if (fi == 1) {%> <div class="messages"> </div> <% } } else { response.sendRedirect("index.jsp"); }%> </body> Guys I don't know what Filter means. UPDATE If I decided to send a parameter that tells me that this request came from Jquery. .load("chat.jsp",{ jquery : "yes" }); And then check it in chat.jsp String yesOrNo = request.getParameter("jquery"); Then they can simply hack this by using this URL. /chat.jsp?jquer=yes or something like that.. UPDATE I tried Maksim's advice, I got this when I tried to access chat.jsp. Is this the desired effect?

    Read the article

  • The best way to assign an immutable instance to a Collection in Java

    - by Ali
    Today I was reading through some Hibernate code and I encounter something interesting. There is a class called CollectionHelper that defines the following constant varibale: public final class CollectionHelper { public static final List EMPTY_LIST = Collections.unmodifiableList( new ArrayList(0 ) ; public static final Collection EMPTY_COLLECTION = Collections.unmodifiableCollection(new ArrayList(0) ); public static final Map EMPTY_MAP = Collections.unmodifiableMap( new HashMap(0) ); They have used these constants to initialize collections with immutable instances. Why they didn't simply use the Collections.EMPTY_LIST for initializing lists? Is there a benefit in using the following method?

    Read the article

  • Remove and Replace multiple chars ( spaces, hyphen, brackets, period) from string in sql

    - by Muhammad Kashif Nadeem
    +39 235 6595750 19874624611 +44 (0)181 446 5697 +431 6078115-2730 +1 617 358 5128 +48.40.23755432 +44 1691 872 410 07825 893217 0138 988 1649 (415) 706 2001 00 44 (0) 20 7660 4650 (765) 959-1504 07731 508 486 please reply by email dont have one +447769146971 Please see the above given phone numbers. I need to replace all spaces, hyphen, period, brackets and leading 0 etc from these numbers. I need this format +447469186974 If number has leading plus sign then don't replace it otherwise I have to concatenate + sign with it. E.G +39 235 6595750 in this number I just need to remove spaces. +44 (0)181 446 5697 in this i need to removes spaces and brackets and 0 in between brackets i.e (0) 07825 893217 in this I need to replace leading 0 with + sign and remove spaces (415) 706 2001 in this replace '(' with + sign and remove ')' and spaces. 'please reply by email' This is the entry in phone number field and I just need to ignore this. +48.40.23755432 Remove period in phone number (765) 959-1504 Remove brackets and spaces and hyphen and add + sign in front of number. 7798724250 just need to add + sign in front of number 00 44 (0) 20 7660-4650 Need to remove leading 0 I.E '00' remove spaces and brackets and 0 in between brackets and hyphen and add + sign in front of number Only leading '0' will be replaced not anyother occourence of '0' The desired result is +447769146971 Should I use nested REPLACE, CHARINDES, PATINDES for each char I want to replace? Thanks.

    Read the article

  • Images do not load at first time in my swf but the second time they are shown when the bowser refres

    - by Muhammad Irfan
    i have written classes in as3... my swf works fine locally but at live link, images do not load or shown first time but when you refresh the browser again they are loaded and shown.. i know they comes in cache but what is happening first time.. you can clear your browser cache and check the problem happens each time when it is not in cache... all images are less than 1 mb.. here is the link http://web.s4spk.com/irfan/loadtest1/project.html

    Read the article

  • How to use iterator in nested arraylist

    - by Muhammad Abrar
    I am trying to build an NFA with a special purpose of searching, which is totally different from regex. The State has following format class State implements List{ //GLOBAL DATA static int depth; //STATE VALUES String stateName; ArrayList<String> label = new ArrayList<>(); //Label for states //LINKS TO OTHER STATES boolean finalState; ArrayList<State> nextState ; // Link with multiple next states State preState; // previous state public State() { stateName = ""; finalState = true; nextState = new ArrayList<>(); } public void addlabel(String lbl) { if(!this.label.contains(lbl)) this.label.add(lbl); } public State(String state, String lbl) { this.stateName = state; if(!this.label.contains(lbl)) this.label.add(lbl); depth++; } public State(String state, String lbl, boolean fstate) { this.stateName = state; this.label.add(lbl); this.finalState = fstate; this.nextState = new ArrayList<>(); } void displayState() { System.out.print(this.stateName+" --> "); for(Iterator<String> it = label.iterator(); it.hasNext();) { System.out.print(it.next()+" , "); } System.out.println("\nNo of States : "+State.depth); } Next, the NFA class is public class NFA { static final String[] STATES= {"A","B","C","D","E","F","G","H","I","J","K","L","M" ,"N","O","P","Q","R","S","T","U","V","W","X","Y","Z"}; State startState; State currentState; static int level; public NFA() { startState = new State(); startState = null; currentState = new State(); currentState = null; startState = currentState; } /** * * @param st */ NFA(State startstate) { startState = new State(); startState = startstate; currentState = new State(); currentState = null; currentState = startState ; // To show that their is only one element in NFA } boolean insertState(State newState) { newState.nextState = new ArrayList<>(); if(currentState == null && startState == null ) //if empty NFA { newState.preState = null; startState = newState; currentState = newState; State.depth = 0; return true; } else { if(!Exist(newState.stateName))//Exist is used to check for duplicates { newState.preState = currentState ; currentState.nextState.add(newState); currentState = newState; State.depth++; return true; } } return false; } boolean insertState(State newState, String label) { newState.label.add(label); newState.nextState = null; newState.preState = null; if(currentState == null && startState == null) { startState = newState; currentState = newState; State.depth = 0; return true; } else { if(!Exist(newState.stateName)) { newState.preState = currentState; currentState.nextState.add(newState); currentState = newState; State.depth++; return true; } else { ///code goes here } } return false; } void markFinal(State s) { s.finalState = true; } void unmarkFinal(State s) { s.finalState = false; } boolean Exist(String s) { State temp = startState; if(startState.stateName.equals(s)) return true; Iterator<State> it = temp.nextState.iterator(); while(it.hasNext()) { Iterator<State> i = it ;//startState.nextState.iterator(); { while(i.hasNext()) { if(i.next().stateName.equals(s)) return true; } } //else // return false; } return false; } void displayNfa() { State st = startState; if(startState == null && currentState == null) { System.out.println("The NFA is empty"); } else { while(st != null) { if(!st.nextState.isEmpty()) { Iterator<State> it = st.nextState.iterator(); do { st.displayState(); st = it.next(); }while(it.hasNext()); } else { st = null; } } } System.out.println(); } /** * @param args the command line arguments */ /** * * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here NFA l = new NFA(); State s = new State("A11", "a",false); NFA ll = new NFA(s); s = new State("A111", "a",false); ll.insertState(s); ll.insertState(new State("A1","0")); ll.insertState(new State("A1111","0")); ll.displayNfa(); int j = 1; for(int i = 0 ; i < 2 ; i++) { int rand = (int) (Math.random()* 10); State st = new State(STATES[rand],String.valueOf(i), false); if(l.insertState(st)) { System.out.println(j+" : " + STATES[rand]+" and "+String.valueOf(i)+ " inserted"); j++; } } l.displayNfa(); System.out.println("No of states inserted : "+ j--); } I want to do the following This program always skip to display the last state i.e. if there are 10 states inserted, it will display only 9. In exist() method , i used two iterator but i do not know why it is working I have no idea how to perform searching for the existing class name, when dealing with iterators. How should i keep track of current State, properly iterate through the nextState List, Label List in a depth first order. How to insert unique States i.e. if State "A" is inserted once, it should not insert it again (The exist method is not working) Best Regards

    Read the article

  • MySql - Select from - Don't Show Duplicate Words - maybe "on duplicate key"?

    - by ali
    hi, how can I insert "on duplicate key" in this Code to remove duplicate words? or is there a better method that you know? thank you!! this is my code: function sm_list_recent_searches($before = '', $after = '', $count = 20) { // List the most recent successful searches. global $wpdb, $table_prefix; $count = intval($count); $results = $wpdb->get_results( "SELECT `terms`, `datetime` FROM `{$table_prefix}searchmeter_recent` WHERE 3 < `hits` AND CHAR_LENGTH(`terms`) > 4 ORDER BY `datetime` DESC LIMIT $count"); if (count($results)) { foreach ($results as $result) { echo '<a href="'. get_settings('home') . '/search/' . urlencode($result->terms) . '">'. htmlspecialchars($result->terms) .'</a>'.", "; } } }

    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

  • Flash player debugger plugin crashes on Mac OS [tried many version of the plugin and browsers, all o

    - by Ali
    Dear All, I recently started using Mac OS X for a flex/actionscript project and having a problem with flash player debugger plugin for the browsers: OSX: 10.6.3 Browsers I tried: firefox, safari and chrome Flashplayer debug "Flash Player 10 Plugin content debugger (Intel-based Macs) Whenever I open a page containing a flash content, my browser crashes due to flash player plugin's crash. I checked the version of my flash player debug plugin with http://kb2.adobe.com/cps/155/tn_15507.html and as the version checker is written in flash, my browser crashes a few seconds later. I am using version 10,0,42,2 (debug edition: yes) This is what I see in the crash log: Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x000000001887e3e4 Any ideas how can I track this issue ? Cheers, -A

    Read the article

  • Find records IN BETWEEN Date Range

    - by Muhammad Kashif Nadeem
    Please see attached image I have a table which have FromDate and ToDate. FromDate is start of some event and ToDate is end of taht event. I need to find a record if search criteria is in between range of dates. e.g. If a record has FromDate 2010/15/5 and ToDate 2010/15/25 and my criteria is FromDate 2010/5/18 and ToDate is 2010/5/21 then this record should be in search results becasue this is in the range of 15 to 25. Following is my search query (chunk of) SELECT m.EventId FROM MajorEvents WHERE ( (m.LocationID = @locationID OR @locationID IS NULL) OR M.LocationID IS NULL) AND ( CONVERT(VARCHAR(10),M.EventDateFrom,23) BETWEEN CONVERT(VARCHAR(10),@DateTimeFrom,23) AND CONVERT(VARCHAR(10),@DateTimeTo,23) OR CONVERT(VARCHAR(10),M.EventDateTo,23) BETWEEN CONVERT(VARCHAR(10),@DateTimeFrom,23) AND CONVERT(VARCHAR(10),@DateTimeTo,23) ) If Search Criteria is equal to FromDate or ToDate then results are ok e.g. If search criterai is DateFrom = 2010/5/15 AND DateTo = 2010/5/18 then this record will return becasue Date From is exactly what is DateFrom in db. OR If search criterai is DateFrom = 2010/5/22 AND DateTo = 2010/5/25 then this record will return becasue Date To is exactly what is DateTo in db But if anything in between this range it does not work Thanks for the help.

    Read the article

  • Setting value in html control in code behind without making server control

    - by Muhammad Akhtar
    Setting value in html control in code behind without making server control <input type="text" name="txt" /> <%--Pleas note I don't want put runat=server here to get the control in code behind--%> <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /> Code behind protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { //If I want to initlize some value in input, how can I set here } } protected void Button1_Click(object sender, EventArgs e) { Request["txt"] // Here I am getting the value of input } Thanks

    Read the article

  • An AccordionItem is inside another one.

    - by Ali
    In Silverlight an AccordionItem is inside another one . When the inner one is selected, it can not expand its parent more which is already expanded to show its own content. I tried to get around it by templating but I was unlucky. Does any one has a solution for it [prefer a solution without code]?

    Read the article

  • SQL Server 2008 to SQL Server 2005

    - by Sakhawat Ali
    I have an MDF and LDF file of SQL Server 2005. i attached it with SQL Server 2008 and did some change in data. now when i attached it back to sql server 2005 Express Edition it gives version error. The database 'E:\DB\JOBPERS.MDF' cannot be opened because it is version 655. This server supports version 612 and earlier. A downgrade path is not supported. Could not open new database 'E:\DB\JOBPERS.MDF'. CREATE DATABASE is aborted. An attempt to attach an auto-named database for file E:\DB\Jobpers.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

    Read the article

  • Can't retrieve more than 2 gmail messages using Zend framework imap access - server dies - doens't r

    - by Ali
    Hi guys I'm working on a google apps application. Basically I've set it up so users can add multiple gmail addresses and check on their inboxes in the application. It works fine with a google apps email address however when I add a gmail address it just dies out. I'm using this code here: $mail = new Zend_Mail_Storage_Imap($mail_options); $all_messages = array(); $page = isset($_GET['page'])?$_GET['page']:1; $limit = isset($_GET['limit'])?$_GET['limit']:20; $offset = (($page-1)*$limit)+1; $end = ($page*$limit)>$c?$c:($page*$limit); for ($i=$offset;$i<=$end;$i++){ $h2t = new html2text(); $h2t->set_allowed_tags('<a>'); if(!$mail[$i]) break; else{ $one_message = $mail->getMessage($i); $one_message->id = $i; $one_message->UID = $mail->getUniqueId($i); $one_message->parts = array(); $one_message->body = ''; $count = 1; foreach (new RecursiveIteratorIterator($mail->getMessage($i)) as $ii=>$part) { try { $tpart = $part; //$tpart->_content = ''; $one_message->parts[$count] = $tpart; $count++; // check for html body if (strtok($part->contentType, ';') == 'text/html') { $b = $part->getContent(); if($part->contentTransferEncoding == 'quoted-printable') $b = quoted_printable_decode($b); $one_message->html_body = $b; $h2t->set_html($b); $one_message->body = $h2t->get_text(); } //check for text body if (strtok($part->contentType, ';') == 'text/plain') { $b = $part->getContent(); if($part->contentTransferEncoding == 'quoted-printable') $b = quoted_printable_decode($b); $one_message->text_body = $b; $one_message->body = $b;//$part->getContent(); } } catch (Zend_Mail_Exception $e) { // ignore } } $all_messages[] = $one_message; } } No matter what the emails it dies out on retrieving just 2 emails... whats going on here?

    Read the article

  • Replying to mail with attachments using Zend framework..

    - by Ali
    Hi guys I'm integrating basic email capabilities in my application and I would like to be able to incorporate a decent reply / forward email facility. I have it covered with sending my own uploaded attachments but what about in situations where I recieve a message in my inbox with attachments and wish to forward that same message along with the attachments already attached to it as well as be able to choose which of the attachments to include and which not to.

    Read the article

  • Nhibernate - getting single column from other table

    - by Muhammad Akhtar
    I have following tables Employee: ID,CompanyID,Name //CompanyID is foriegn key of Company Table Company: CompanyID, Name I want to map this to the following class: public class Employee { public virtual Int ID { get; set; } public virtual Int CompanyID { get; set; } public virtual string Name { get; set; } public virtual string CompanyName { get; set; } protected Employee() { } } here is my xml class <class name="Employee" table="Employee" lazy="true"> <id name="Id" type="Int32" column="Id"> <generator class="native" /> </id> <property name="CompanyID" column="CompanyID" type="Int32" not-null="false"/> <property name="Name" column="Name" type="String" length="100" not-null="false"/> What I need to add in xml class to map CompanyName in my result? here is my code... public ArrayList getTest() { ISession session = NHibernateHelper.GetCurrentSession(); string query = "select Employee.*,(Company.Name)CompanyName from Employee inner join Employee on Employee.CompanyID = Company.CompanyID"; ArrayList document = (ArrayList)session.CreateSQLQuery(query, "Employee", typeof(Document)).List(); return document; } but in the returned result, I am getting CompanyName is null is result set and other columns are fine. Note:In DB, tables don't physical relation Please suggest my solution ------ Thanks

    Read the article

  • deactivate ' pin to start ' on Application List page when pinning an app via code using C#?

    - by Ahmed Ali
    i'm creating a windows phone app ,where i've put a button to pin the app to start screen , but when press and hold the app icon on application list screen i find that the pin to start option can be used ShellTile TileToFind = ShellTile.ActiveTiles.FirstOrDefault(x => x.NavigationUri.ToString().Contains("MainPage.xaml")); // Create the Tile if we didn't find that it already exists. if (TileToFind == null) { // Create the Tile object and set some initial properties for the Tile. // The Count value of 12 shows the number 12 on the front of the Tile. Valid values are 1-99. // A Count value of 0 indicates that the Count should not be displayed. StandardTileData NewTileData = new StandardTileData { BackgroundImage = new Uri("300.png", UriKind.Relative), Title = "apptitle", BackTitle = "title", BackContent = "testing ", BackBackgroundImage = null }; // Create the Tile and pin it to Start. This will cause a navigation to Start and a deactivation of our app. ShellTile.Create(new Uri("/MainPage.xaml", UriKind.Relative), NewTileData); } else { MessageBox.Show("Already Pinned"); } how can i disable the user from pinning the application again from application list screen

    Read the article

  • Suppressing a function's command window output in Matlab

    - by Ali
    A function I'm using has "display()" in it (or other things that display messages on command window), so it outputs a lot of things (x 1200) on command line when I run my code, which makes things hard to track and observe. Is there a way to suppress the output of this specific function? Ending the statement with semicolon obviously doesn't help.

    Read the article

  • Php script running as scheduled task hangs - help!

    - by Ali
    Hi guys, I've built a php script that runs from the command line. It opens a connection into a pop3 email account and downloads all the emails and writes them to a database, and deletes them once downloaded. I have this script being called from the commandline by a bat file. in turn I have created a scheduled task which invokes the bat file every 5 minutes. The thing is that I have set the time out to zero for the fact that at times there could be emails with large attachments and the script actually downloads the attachments and stores them as raw files offline and the no timeout is so that the script doesnt die out during downloading. I've found that the program hangs sometimes and its a bit annoying at that - it always hangs are one point i.e. when negotiating the connection and getting connected to the mail server. And because the timeout is set to zero it seems to stay stuck up in taht position. And because of that the task is not run as its technically hung up. I want that the program should not timeout when downloading emails - however at the points where it is negotiating a connection or trying to connect to the mailserver there should be a timeout only at that point itself and not the rest of the program execution. How do I do this :(

    Read the article

  • Nhibernate - Getting Exception when run a simple join query

    - by Muhammad Akhtar
    hi, I am getting issue when I run sql Query having inner join, here is what I am doing very simple ISession session = NHibernateHelper.GetCurrentSession(); string query = string.Format("select Documents.TypeId from Documents inner join DocumentTrackingItems on Documents.Id = DocumentTrackingItems.DocumentId WHERE DocumentTrackingItems.ItemStepId = {0} order by Documents.TypeId asc", 13); System.Collections.ArrayList document = (System.Collections.ArrayList)session.CreateSQLQuery(query, "document", typeof(Document)).List(); I am getting this exception Exception Details: System.IndexOutOfRangeException: Id what's wrong in my query? --- thanks

    Read the article

  • How to get <select> options either (value or text) using jQuery

    - by Muhammad Sajid
    Hello, i have a code for <select id='list'> <option value='1'>Option A</option> <option value='2'>Option B</option> <option value='3'>Option C</option> </select> and i want that how ever i select any option, it will show in an alert message. i have try <script type='text/javascript'> //var value = $("#list option[value=2]").text(); //var value = $("#list option:selected").text(); //var value = $('#list').val(); var value = $(this).val(); alert(value); </script> but fail.

    Read the article

  • Data Access from single table in sql server 2005 is too slow

    - by Muhammad Kashif Nadeem
    Following is the script of table. Accessing data from this table is too slow. SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Emails]( [id] [int] IDENTITY(1,1) NOT NULL, [datecreated] [datetime] NULL CONSTRAINT [DF_Emails_datecreated] DEFAULT (getdate()), [UID] [nvarchar](250) COLLATE Latin1_General_CI_AS NULL, [From] [nvarchar](100) COLLATE Latin1_General_CI_AS NULL, [To] [nvarchar](100) COLLATE Latin1_General_CI_AS NULL, [Subject] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL, [Body] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL, [HTML] [nvarchar](max) COLLATE Latin1_General_CI_AS NULL, [AttachmentCount] [int] NULL, [Dated] [datetime] NULL ) ON [PRIMARY] Following query takes 50 seconds to fetch data. select id, datecreated, UID, [From], [To], Subject, AttachmentCount, Dated from emails If I include Body and Html in select then time is event worse. indexes are on: id unique clustered From Non unique non clustered To Non unique non clustered Tabls has currently 180000+ records. There might be 100,000 records each month so this will become more slow as time will pass. Does splitting data into two table will solve the problem? What other indexes should be there?

    Read the article

  • Python timed file upload

    - by Ali
    I have a python script that accepts a file from the user and saves it. Is it possible to not upload the file immediately but to que it up and when the server has less load to upload it then. Can this be done by transferring the file to the browsers storage area or taking the file from the Harddrive and transferring to the User's RAM?

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >