Search Results

Search found 618 results on 25 pages for 'rahul gupta'.

Page 16/25 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Can I pop up alert in javascript using php.

    - by Shantanu Gupta
    I want to trigger javascript alert using PHP. Is it possible I want to use it in head section, for displaying it at load time. <head> <?php $valid="valid"; if(!isset($valid)) echo "<script type=\"text/javascript\"> alert('Hi');</script>"; ?> </head> EDIT i want to display javascript alert() at load time after checking existance of session

    Read the article

  • what is the problem with my javascript code, it is not working.

    - by Shantanu Gupta
    I am trying to call my function named isUrgencyTypeValid from my javascript code but it is not working. Please check what is the problem in my code. My javascript function is not being called. HTML Code <td colspan="2" align="center"><input id="btnSubmit" type="submit" value="submit" runat="server"/></td></tr> jQuery Call function $("#btnSubmit").bind("click",function(){ isUrgencyTypeValid(); }); javascript implemented function function isUrgencyTypeValid() { alert("asd"); var i=0; for(i=0;i<$("radio[name='urgencyType']").length;i++) { if($("radio[name='urgencyType']")[i].checked) { alert($("radio[name='urgencyType']")[i].value); return true; } return false; }

    Read the article

  • protobuf-net NOT faster than binary serialization?

    - by Ashish Gupta
    I wrote a program to serialize a 'Person' class using XMLSerializer, BinaryFormatter and ProtoBuf. I thought protobuf-net should be faster than the other two. Protobuf serialization was faster than XMLSerialization but much slower than the binary serialization. Is my understanding incorrect? Please make me understand this. Thank you for the help. Following is the output:- Person got created using protocol buffer in 347 milliseconds Person got created using XML in 1462 milliseconds Person got created using binary in 2 milliseconds Code below using System; using System.Collections.Generic; using System.Linq; using System.Text; using ProtoBuf; using System.IO; using System.Diagnostics; using System.Runtime.Serialization.Formatters.Binary; namespace ProtocolBuffers { class Program { static void Main(string[] args) { string XMLSerializedFileName = "PersonXMLSerialized.xml"; string ProtocolBufferFileName = "PersonProtocalBuffer.bin"; string BinarySerializedFileName = "PersonBinary.bin"; var person = new Person { Id = 12345, Name = "Fred", Address = new Address { Line1 = "Flat 1", Line2 = "The Meadows" } }; Stopwatch watch = Stopwatch.StartNew(); watch.Start(); using (var file = File.Create(ProtocolBufferFileName)) { Serializer.Serialize(file, person); } watch.Stop(); Console.WriteLine(watch.ElapsedMilliseconds.ToString()); Console.WriteLine("Person got created using protocol buffer in " + watch.ElapsedMilliseconds.ToString() + " milliseconds " ); watch.Reset(); watch.Start(); System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(person.GetType()); using (TextWriter w = new StreamWriter(XMLSerializedFileName)) { x.Serialize(w, person); } watch.Stop(); Console.WriteLine(watch.ElapsedMilliseconds.ToString()); Console.WriteLine("Person got created using XML in " + watch.ElapsedMilliseconds.ToString() + " milliseconds"); watch.Reset(); watch.Start(); using (Stream stream = File.Open(BinarySerializedFileName, FileMode.Create)) { BinaryFormatter bformatter = new BinaryFormatter(); //Console.WriteLine("Writing Employee Information"); bformatter.Serialize(stream, person); } watch.Stop(); Console.WriteLine(watch.ElapsedMilliseconds.ToString()); Console.WriteLine("Person got created using binary in " + watch.ElapsedMilliseconds.ToString() + " milliseconds"); Console.ReadLine(); } } [ProtoContract] [Serializable] public class Person { [ProtoMember(1)] public int Id {get;set;} [ProtoMember(2)] public string Name { get; set; } [ProtoMember(3)] public Address Address {get;set;} } [ProtoContract] [Serializable] public class Address { [ProtoMember(1)] public string Line1 {get;set;} [ProtoMember(2)] public string Line2 {get;set;} } }

    Read the article

  • DataGridView's SelectionChange event firing more than once on DataBinding

    - by Shantanu Gupta
    This Code triggers selection change event twice. how can I prevent it ? Currently i m using a flag or focused property to prevent this. But what is the actual way ? I am using it on winfoms EDIT Mistake in writing Question, here is the correct code that i wanted to ask private void frmGuestInfo_Load(object sender, EventArgs e) { this.dgvGuestInfo.SelectionChanged -= new System.EventHandler(this.dgvGuestInfo_SelectionChanged); dgvGuestInfo.DataSource=dsFillControls.Tables["tblName"]; this.dgvGuestInfo.SelectionChanged += new System.EventHandler(this.dgvGuestInfo_SelectionChanged); } private void dgvGuestInfo_SelectionChanged(object sender, EventArgs e) { }

    Read the article

  • caching images that are retrieved

    - by Rahul Varma
    Hi, I am retrieving a list of images and text from a web service. The images are getting displayed in the list view. But the problem is, when i scroll down the list the entire images are getting loaded once again. When i scroll twice or thrice there is a OutofMemory occuring... Can anyone tell me how to cache the images and also to avoid the loading of the images that are already loaded when i scroll down. I have tried to increase inSampleSize but it didnt work... Here's the code.... public static Bitmap loadImageFromUrl(String url) { InputStream inputStream; Bitmap b; try { inputStream = (InputStream) new URL(url).getContent(); BitmapFactory.Options bpo= new BitmapFactory.Options(); b=BitmapFactory.decodeStream(inputStream, null,bpo ); b.recycle(); bpo.inSampleSize=2; return b; } catch (IOException e) { throw new RuntimeException(e); } // return null; }

    Read the article

  • I want to set the AutoCompleteMode property in ApplyCellStyleToEditingControl subroutine

    - by Ranjan Gupta
    Hi, I am creating a DataGridView Column. and it is working well. now I want to customise this column with AutoCompleteMode, and AutoCompleteSource properties to show the customised data. I made the properties for this columns, and these are also working well. but these properties are not working in the "ApplyCellStyleToEditingControl" subroutine. Please help me to use these column properties in the "ApplyCellStyleToEditingControl" subroutine. Public Class DataGridViewDataValueColumn Inherits DataGridViewColumn Dim m_AutoCompleteMode As AutoCompleteMode, _ m_AutoCompleteSource As AutoCompleteSource, _ m_AutoCompleteStringCollection As AutoCompleteStringCollection Public Sub New() MyBase.New(New DataValueCell()) End Sub Public Overrides Property CellTemplate() As DataGridViewCell Get Return MyBase.CellTemplate End Get Set(ByVal value As DataGridViewCell) ' Ensure that the cell used for the template is a DataValueCell. If (value IsNot Nothing) AndAlso _ Not value.GetType().IsAssignableFrom(GetType(DataValueCell)) _ Then Throw New InvalidCastException("Must be a DataValueCell") End If MyBase.CellTemplate = value End Set End Property Region "User Defined Properties" '&*--------------------------------------*&' <Description("Indicates the text completion behaviour of the combo box."), DefaultValue(AutoCompleteMode.None)> _ Public Property AutoCompleteMode() As AutoCompleteMode Get Return m_AutoCompleteMode End Get Set(ByVal value As AutoCompleteMode) m_AutoCompleteMode = value End Set End Property <Description("The source of complete strings used to automatic completion."), DefaultValue(AutoCompleteSource.None)> _ Public Property AutoCompleteSource() As AutoCompleteSource Get Return m_AutoCompleteSource End Get Set(ByVal value As AutoCompleteSource) m_AutoCompleteSource = value End Set End Property <Description("The autocomplete custom source.")> _ Public Property AutoCompleteCustomSource() As AutoCompleteStringCollection Get Return m_AutoCompleteStringCollection End Get Set(ByVal value As AutoCompleteStringCollection) m_AutoCompleteStringCollection = value End Set End Property End Region End Class '&*--------------------------------------*&' Class DataValueCell Inherits DataGridViewTextBoxCell Public Sub New() ' End Sub Public Overrides ReadOnly Property EditType As Type Get Return GetType(PCLDataGridViewTextBoxEditingControl) End Get End Property End Class '&*--------------------------------------*&' '&* Edit DataGridView Columns *&' '&*--------------------------------------*&' Class PCLDataGridViewTextBoxEditingControl Inherits DataGridViewTextBoxEditingControl Public Overrides Function EditingControlWantsInputKey(ByVal keyData As Keys, ByVal dataGridViewWantsInputKey As Boolean) As Boolean Select Case ((keyData And Keys.KeyCode)) Case Keys.Prior, Keys.Next, Keys.End, Keys.Home, Keys.Left, Keys.Up, Keys.Right, Keys.Down, Keys.Delete Return True End Select Return MyBase.EditingControlWantsInputKey(keyData, dataGridViewWantsInputKey) End Function Public Overrides Sub ApplyCellStyleToEditingControl(ByVal dataGridViewCellStyle As DataGridViewCellStyle) With DirectCast(Me, TextBox) '.AutoCompleteMode = DataGridViewDataValueColumn.AutoCompleteMode_Value '.AutoCompleteSource = DataGridViewDataValueColumn.AutoCompleteSource_Value '.AutoCompleteCustomSource = MyBase.AutoCompleteCustomSource End With End Sub End Class

    Read the article

  • Does the <script> tag position in HTML affects performance of the webpage?

    - by Rahul Joshi
    If the script tag is above or below the body in a HTML page, does it matter for the performance of a website? And what if used in between like this: <body> ..blah..blah.. <script language="JavaScript" src="JS_File_100_KiloBytes"> function f1() { .. some logic reqd. for manipulating contents in a webpage } </script> ... some text here too ... </body> Or is this better?: <script language="JavaScript" src="JS_File_100_KiloBytes"> function f1() { .. some logic reqd. for manipulating contents in a webpage } </script> <body> ..blah..blah.. ..call above functions on some events like onclick,onfocus,etc.. </body> Or this one?: <body> ..blah..blah.. ..call above functions on some events like onclick,onfocus,etc.. <script language="JavaScript" src="JS_File_100_KiloBytes"> function f1() { .. some logic reqd. for manipulating contents in a webpage } </script> </body> Need not tell everything is again in the <html> tag!! How does it affect performance of webpage while loading? Does it really? Which one is the best, either out of these 3 or some other which you know? And one more thing, I googled a bit on this, from which I went here: Best Practices for Speeding Up Your Web Site and it suggests put scripts at the bottom, but traditionally many people put it in <head> tag which is above the <body> tag. I know it's NOT a rule but many prefer it that way. If you don't believe it, just view source of this page! And tell me what's the better style for best performance.

    Read the article

  • List view and list adapters for displaying json

    - by Rahul Varma
    Hi, I am trying to display the text from json in a list view. I got help for retrieving the json text from the following... http://www.josecgomez.com/2010/04/30/android-accessing-restfull-web-services-using-json/comment-page-1/#comment-498.... But my problem is that i cant figure out how to display them in list view. I also want to get only some of the text from url(for example, alerttext and date). Can anyone help me in declaring the list adapter and list view in order to display the data in the way i want... Plzzzz...

    Read the article

  • How to store date into Mysql database with play framework in scala?

    - by Rahul Kulhari
    I am working with play framework with scala and what am i doing : login page to login into web app sign up page to register into web app after login i want to store all databases values to user what i want to do: when user register for web app then i want to store user values into database with current time and date but my form is giving error. error: List(FormError(dates,error.required,List())),None) controllers/Application.scala object Application extends Controller { val ta:Form[Keyword] = Form( mapping( "id" -> ignored(NotAssigned:Pk[Long]), "word" -> nonEmptyText, "blog" -> nonEmptyText, "cat" -> nonEmptyText, "score"-> of[Long], "summaryId"-> nonEmptyText, "dates" -> date("yyyy-MM-dd HH:mm:ss") )(Keyword.apply)(Keyword.unapply) ) def index = Action { Ok(html.index(ta)); } def newTask= Action { implicit request => ta.bindFromRequest.fold( errors => {println(errors) BadRequest(html.index(errors))}, keywo => { Keyword.create(keywo) Ok(views.html.data(Keyword.all())) } ) } models/keyword.scala case class Keyword(id: Pk[Long],word: String,blog: String,cat: String,score: Long, summaryId: String,dates: Date ) object Keyword { val keyw = { get[Pk[Long]]("keyword.id") ~ get[String]("keyword.word")~ get[String]("keyword.blog")~ get[String]("keyword.cat")~ get[Long]("keyword.score") ~ get[String]("keyword.summaryId")~ get[Date]("keyword.dates") map { case id~blog~cat~word~score~summaryId~dates => Keyword(id,word,blog,cat,score, summaryId,dates) } } def all(): List[Keyword] = DB.withConnection { implicit c => SQL("select * from keyword").as(Keyword.keyw *) } def create(key: Keyword){DB.withConnection{implicit c=> SQL("insert into keyword values({word},{blog}, {cat}, {score},{summaryId},{dates})").on('word-> key.word,'blog->key.blog, 'cat -> key.cat, 'score-> key.score, 'summaryId -> key.summaryId, 'dates->new Date()).executeUpdate } } views/index.scala.html @(taskForm: Form[Keyword]) @import helper._ @main("Todo list") { @form(routes.Application.newTask) { @inputText(taskForm("word")) @inputText(taskForm("blog")) @inputText(taskForm("cat")) @inputText(taskForm("score")) @inputText(taskForm("summaryId")) <input type="submit"> <a href="">Go Back</a> } } please give me some idea to store date into mysql databse and date is not a field of form

    Read the article

  • Mathematics for AI/Machine learning ?

    - by Ankur Gupta
    I intend to build a simple recommendation systems for fun. I read a little on the net and figured being good at math would enable on to build a good recommendation system. My math skills are not good. I am willing to put considerable efforts and time in learning maths. Can you please tell me what mathematics topics should I cover? Also if any of you folks can point me to some online material to learn from it would be great. I am aware of MIT OCW, book like collective intelligence. Math Topics to cover and from where to read would really help.

    Read the article

  • Weird output of Throwable getMessage()

    - by Ravi Gupta
    Hi I have below pseudo code with throws an exception like this throw new MyException("Bad thing happened","com.stuff.errorCode"); where MyException extends Exception class. So the problem is when I try to get the message from MyException class by calling myEx.getMessage() it returns ???en_US.Bad thing happened??? instead of my original message i.e. Bad thing happened I have checked that MyException class doesn't overrides Throwable class's getMessage() behavior. Below is the how the call passes from MyException.getMessage() to Throwable.getMessage() public MyException(String msg, String sErrorCode){ super(msg); this.sErrorCode = sErrorCode; this.iSeverity = 0; } which then calls public Exception(String message) { super(message); } and finally public Throwable(String message) { fillInStackTrace(); detailMessage = message; } when I do a getMessage on myexception it calls Throwable's getMessage as below public String getMessage() { return detailMessage; } So ideally it should return the original message as I set when throwing the exception. What's the ???en_US thing ?

    Read the article

  • Single Query returning me 4 tables, How to get all of them back into dataset ?

    - by Shantanu Gupta
    How to fill multiple tables in a dataset. I m using a query that returns me four tables. At the frontend I am trying to fill all the four resultant table into dataset. Here is my Query. Query is not complete. But it is just a refrence for my Ques Select * from tblxyz compute sum(col1) suppose this query returns more than one table, I want to fill all the tables into my dataset I am filling result like this con.open(); adp.fill(dset); con.close(); Now when i checks this dataset. It shows me that it has four tables but only first table data is being displayed into it. rest 3 dont even have schema also. What i need to do to get desired output

    Read the article

  • how to start with php code sniffer

    - by Rahul Mehta
    Hi, I have all written code and i want to this code standarise by php code sniffer. I would like to know what is the best way to start with it . I had installed it but when i run the command phpcs /path/to/code/myfile.php in the command line i got the last one hundered line error from 310 to 410 . but if i want to see the starting errors of any line error how can i see that . Mostly errors are 322 | ERROR | Spaces must be used to indent lines; tabs are not allowed 322 | ERROR | Line indented incorrectly; expected at least 8 spaces, found 2 How can i solve these things easily and in future it don't repeat , what it saying that i should not use tab , and use space , by using space it will take time . and how can i start with basic standard ,because don't want to utilise more time in this right now. Thanks

    Read the article

  • Export to csv in jQuery

    - by Rahul Joshi
    I am dynamically generating a div which is like : <div id='PrintDiv'> <table id="mainTable"> <tr> <td> Col1 </td> <td> Col2 </td> <td> Col3 </td> </tr> <tr> <td> Val1 </td> <td> Val2 </td> <td> Val3 </td> </tr> <tr> <td> Val11 </td> <td> Val22 </td> <td> Val33 </td> </tr> <tr> <td> Val111 </td> <td> Val222 </td> <td> Val333 </td> </tr> </table> </div> And there are lot more elements on the page as well. Now, how can i get a csv file like this : Col1,Col2,Col3 Val1,Val2,Val3 Val11,Val22,Val33 Val111,Val222,Val333 using jQuery ? need a file save dailog box too,like this : Thanks.

    Read the article

  • Vim: different key mapping for different window

    - by rahul
    My .vimrc file has filetype mappings for different filetypes such as : autocmd FileType sh map gf ... autocmd FileType ruby map gf ... While rewriting a program from one language to another, I have 2 splits, one with a shell script and one with ruby. I would assume that "gf" would take on its mapping based on filetype. However, it can only hold one mapping at a time. Is there any way to declare a mapping only for the existing file/window. I tried ":windo" and ":bufdo" but they work for all windows or buffers.

    Read the article

  • want to make better content display

    - by Rahul Mehta
    Hi, We are developing a social networking project, in this project we are adding content , e.g. images , video,audio,link(html). Currently we are using shadowbox.js to show it.But for better and effectiveness we want to use some other better plugin, or want to make own window for showing images and link. Please help , what is the best solution for this project. I want to know this is the white board quesion means programmer.stackexchange question or stackoverflow quesion? Thanks

    Read the article

  • how to run vibrate continuously in iphone?

    - by aman-gupta
    Hi, In my application I m using following coding pattern to vibrate my iPhone device Header File:- AudioServices.h AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); //////////////////////////////////////////////////////////////// My problem is that when I run my application it gets vibrate but only for second but I want that it will vibrate continuously until I will stop it. How it could be possible .Please help me out its urgent Thanks in Advance

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >