Search Results

Search found 198 results on 8 pages for 'saaza khan'.

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

  • What am I missing with log4net - No log file created

    - by Saif Khan
    I am trying to use log4net in a VB.NET app for some unknown reason it's not creating the log file. Here is my app.config <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> </configSections> <log4net> <appender name="FileAppender" type="log4net.Appender.FileAppender"> <file value="c:\log-file.txt" /> <appendToFile value="true" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" /> </layout> </appender> <root> <level value="ALL" /> <appender-ref ref="FileAppender" /> </root> </log4net> </configuration> Here is the app code Imports log4net Public Class Form1 Dim log As ILog Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click log.Error("test") End Sub Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load log4net.Config.XmlConfigurator.Configure() log = log4net.LogManager.GetLogger("TestThings") End Sub End Class "TestThings" is the name of the VS project. What am I missing?

    Read the article

  • Android Textview Italic and wrap_contents

    - by Faisal khan
    I am using 3 italic textviews with different colors <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:id="@+id/submittedBy" android:paddingTop="10dip"> <ImageView android:id="@+id/subByImg" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left" android:layout_gravity="bottom" android:src="@drawable/submitted_by_arrow"/> <TextView android:id="@+id/submitLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left" android:text="Submitted by" android:textStyle="italic" android:textSize="12sp" android:textColor="@color/gray" android:paddingLeft="5dip"/> <TextView android:id="@+id/submitName" android:textStyle="italic" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="12sp" android:textColor="@color/maroon_dark" android:paddingLeft="10dip"/> <TextView android:id="@+id/submitByDate" android:textStyle="italic" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left" android:textSize="12sp" android:textColor="@color/gray" android:paddingLeft="10dip"/> </LinearLayout> I wonder every last character is not displaying properly specially name displayed in the middle is "Dan Buckland" and it it is missing last character looks like "Dan Bucklano" Also tell me pls how can have textview italic and bold both..

    Read the article

  • Passing Parameters to Child Tasks from a Parent Task in Rake

    - by Haseeb Khan
    I am new to the world of Rake and currently writing a Rake Script which consists of various tasks depending on the arguments passed to it on runtime. From some Tutorials over the web, I figured out how to pass parameters to the Script as well how to make a task which is dependent on other subtasks. For reference, I have mentioned a sample below: task :parent, [:parent_argument1, :parent_argument2, :parent_argument3] => [:child1, :child2] do # Perform Parent Task Functionalities end task :child1, [:child1_argument1, :child1_argument2] do |t, args| # Perform Child1 Task Functionalities end task :child2, [:child2_argument1, :child2_argument2] do |t, args| # Perform Child2 Task Functionalities end Following is what I want to achieve: I want to pass the arguments passed to the parent task to the child tasks. Is it allowed? Is there a way I can make the child tasks as private so they can't be called independently? Thanks in advance.

    Read the article

  • android circulate gallery iteration with 10 items.

    - by Faisal khan
    I am using the following customize gallery. I am having static 10 images, i want circulatery gallery which should circlate always should never ends after last item it should auto start by 1 or after first it should auto start from end. public class SizingGallery extends Gallery{ public SizingGallery(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected boolean getChildStaticTransformation(View child, Transformation t) { t.clear(); ImageView selectedChild = (ImageView)getSelectedView(); ImageView iv =(ImageView)child; BrowseMapCategoryRow cr = (BrowseMapCategoryRow)iv.getTag(); if (iv == selectedChild) { selectedChild.setImageResource(cr.getSelectedImgSrc()); }else{ iv.setImageResource(cr.getUnSelectedImgSrc()); } return true; } @Override protected int getChildDrawingOrder(int childCount, int i) { return super.getChildDrawingOrder(childCount, i); } }

    Read the article

  • Custom Application Page does not recognize tagPrefix defined in custom web.config

    - by Hasan Khan
    I have a custom application page integrated in Centeral Administration. My application pages are placed in a subfolder in Template\Admin folder. I placed my own web.config in my subfolder and added tagPrefixes in the control section. However when I open my application page ASP.NET throws the exception that the tag SharePoint:InputFormTextBox was not recognized. What am I doing wrong? Or it doesn't work this way? What can i do to achieve this?

    Read the article

  • Performance problem with System.Net.Mail

    - by Saif Khan
    I have this unusual problem with mailing from my app. At first it wasn't working (getting unable to relay error crap) anyways I added the proper authentication and it works. My problem now is, if I try to send around 300 emails (each with a 500k attachment) the app starts hanging around 95% thru the process. Here is some of my code which is called for each mail to be sent Using mail As New MailMessage() With mail .From = New MailAddress(My.Resources.EmailFrom) For Each contact As Contact In Contacts .To.Add(contact.Email) Next .Subject = "Accounting" .Body = My.Resources.EmailBody 'Back the stream up to the beginning orelse the attachment 'will be sent as a zero (0) byte file. attachment.Seek(0, SeekOrigin.Begin) .Attachments.Add(New Attachment(attachment, String.Concat(Item.Year, Item.AttachmentType.Extension))) End With Dim smtp As New SmtpClient("192.168.1.2") With smtp .DeliveryMethod = SmtpDeliveryMethod.Network .UseDefaultCredentials = False .Credentials = New NetworkCredential("username", "password") .Send(mail) End With End Using With item .SentStatus = True .DateSent = DateTime.Now.Date .Save() End With Return I was thinking, can I just prepare all the mails and add them to a collection then open one SMTP conenction and just iterate the collection, calling the send like this Using mail As New MailMessage() ... MailCollection.Add(mail) End Using ... Dim smtp As New SmtpClient("192.168.1.2") With smtp .DeliveryMethod = SmtpDeliveryMethod.Network .UseDefaultCredentials = False .Credentials = New NetworkCredential("username", "password") For Each mail in MainCollection .Send(mail) Next End With

    Read the article

  • Android how to get gps location

    - by Faisal khan
    I want to detect location from gps listener and also from network my code is as follows For network location listen locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, WLConstants.DELAY_HOUR, 500.0f, nsl); // where nsl is listener implements LocationListener and for the gps location listen locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, WLConstants.DELAY_HOUR, gpsListener .getMinDistance(), gpsListener);// where gps listener implements LocationListener Can we have one listener to listen both rather then launching two different listeners to listen from network and gps???

    Read the article

  • Lambda Expressions

    - by Asad Khan
    Can somebody explain me lambda expressions & what they can be used for. I have googled for it & have a rough idea. most of the examples give c# code. How about lambda expressions in plain old C...?

    Read the article

  • connect to web API from ..NET

    - by Saif Khan
    How can I access and consume a web API from .NET? The API is not a .NET API. Here is sample code I have in Ruby require 'uri' require 'net/http' url = URI.parse("http://account.codebasehq.com/widgets/tickets") req = Net::HTTP::Post.new(url.path) req.basic_auth('dave', '6b2579a03c2e8825a5fd0a9b4390d15571f3674d') req.add_field('Content-type', 'application/xml') req.add_field('Accept', 'application/xml') xml = "<ticket><summary>My Example Ticket</summary><status-id>1234</status-id><priority-id>1234</priority-id><ticket-type>bug</ticket-type></ticket>" res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req, xml)} case res when Net::HTTPCreated puts "Record was created successfully." else puts "An error occurred while adding this record" end Where can I find information on consuming API like this from .NET? I am aware how to use .NET webservices.

    Read the article

  • Sent Item code in java

    - by Farhan Khan
    I need urgent help, if any one can resolve my issue it will be very highly appriciated. I have create a SMS composer on jAVA netbians its on urdu language. the probelm is its not saving sent sms on Sent items.. i have tried my best to make the code but failed. Tomorrow is my last day to present the code on university please help me please below is the code that i have made till now. Please any one.... /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package newSms; import javax.microedition.io.Connector; import javax.microedition.midlet.*; import javax.microedition.lcdui.*; import javax.wireless.messaging.MessageConnection; import javax.wireless.messaging.TextMessage; import org.netbeans.microedition.util.SimpleCancellableTask; /** * @author AHTISHAM */ public class composeurdu extends MIDlet implements CommandListener, ItemCommandListener, ItemStateListener { private boolean midletPaused = false; private boolean isUrdu; String numb=" "; Alert alert; //<editor-fold defaultstate="collapsed" desc=" Generated Fields ">//GEN-BEGIN:|fields|0| private Form form; private TextField number; private TextField textUrdu; private StringItem stringItem; private StringItem send; private Command exit; private Command sendMesg; private Command add; private Command urdu; private Command select; private SimpleCancellableTask task; //</editor-fold>//GEN-END:|fields|0| MessageConnection clientConn; private Display display; public composeurdu() { display = Display.getDisplay(this); } private void showMessage(){ display=Display.getDisplay(this); //numb=number.getString(); if(number.getString().length()==0 || textUrdu.getString().length()==0){ Alert alert=new Alert("error "); alert.setString(" Enter phone number"); alert.setTimeout(5000); display.setCurrent(alert); } else if(number.getString().length()>11){ Alert alert=new Alert("error "); alert.setString("invalid number"); alert.setTimeout(5000); display.setCurrent(alert); } else{ Alert alert=new Alert("error "); alert.setString("success"); alert.setTimeout(5000); display.setCurrent(alert); } } void showMessage(String message, Displayable displayable) { Alert alert = new Alert(""); alert.setTitle("Error"); alert.setString(message); alert.setType(AlertType.ERROR); alert.setTimeout(5000); display.setCurrent(alert, displayable); } //<editor-fold defaultstate="collapsed" desc=" Generated Methods ">//GEN-BEGIN:|methods|0| //</editor-fold>//GEN-END:|methods|0| //<editor-fold defaultstate="collapsed" desc=" Generated Method: initialize ">//GEN-BEGIN:|0-initialize|0|0-preInitialize /** * Initializes the application. It is called only once when the MIDlet is * started. The method is called before the * <code>startMIDlet</code> method. */ private void initialize() {//GEN-END:|0-initialize|0|0-preInitialize // write pre-initialize user code here //GEN-LINE:|0-initialize|1|0-postInitialize // write post-initialize user code here }//GEN-BEGIN:|0-initialize|2| //</editor-fold>//GEN-END:|0-initialize|2| //<editor-fold defaultstate="collapsed" desc=" Generated Method: startMIDlet ">//GEN-BEGIN:|3-startMIDlet|0|3-preAction /** * Performs an action assigned to the Mobile Device - MIDlet Started point. */ public void startMIDlet() {//GEN-END:|3-startMIDlet|0|3-preAction // write pre-action user code here switchDisplayable(null, getForm());//GEN-LINE:|3-startMIDlet|1|3-postAction // write post-action user code here form.setCommandListener(this); form.setItemStateListener(this); }//GEN-BEGIN:|3-startMIDlet|2| //</editor-fold>//GEN-END:|3-startMIDlet|2| //<editor-fold defaultstate="collapsed" desc=" Generated Method: resumeMIDlet ">//GEN-BEGIN:|4-resumeMIDlet|0|4-preAction /** * Performs an action assigned to the Mobile Device - MIDlet Resumed point. */ public void resumeMIDlet() {//GEN-END:|4-resumeMIDlet|0|4-preAction // write pre-action user code here //GEN-LINE:|4-resumeMIDlet|1|4-postAction // write post-action user code here }//GEN-BEGIN:|4-resumeMIDlet|2| //</editor-fold>//GEN-END:|4-resumeMIDlet|2| //<editor-fold defaultstate="collapsed" desc=" Generated Method: switchDisplayable ">//GEN-BEGIN:|5-switchDisplayable|0|5-preSwitch /** * Switches a current displayable in a display. The * <code>display</code> instance is taken from * <code>getDisplay</code> method. This method is used by all actions in the * design for switching displayable. * * @param alert the Alert which is temporarily set to the display; if * <code>null</code>, then * <code>nextDisplayable</code> is set immediately * @param nextDisplayable the Displayable to be set */ public void switchDisplayable(Alert alert, Displayable nextDisplayable) {//GEN-END:|5-switchDisplayable|0|5-preSwitch // write pre-switch user code here Display display = getDisplay();//GEN-BEGIN:|5-switchDisplayable|1|5-postSwitch if (alert == null) { display.setCurrent(nextDisplayable); } else { display.setCurrent(alert, nextDisplayable); }//GEN-END:|5-switchDisplayable|1|5-postSwitch // write post-switch user code here }//GEN-BEGIN:|5-switchDisplayable|2| //</editor-fold>//GEN-END:|5-switchDisplayable|2| //<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Displayables ">//GEN-BEGIN:|7-commandAction|0|7-preCommandAction /** * Called by a system to indicated that a command has been invoked on a * particular displayable. * * @param command the Command that was invoked * @param displayable the Displayable where the command was invoked */ public void commandAction(Command command, Displayable displayable) {//GEN-END:|7-commandAction|0|7-preCommandAction // write pre-action user code here if (displayable == form) {//GEN-BEGIN:|7-commandAction|1|16-preAction if (command == exit) {//GEN-END:|7-commandAction|1|16-preAction // write pre-action user code here exitMIDlet();//GEN-LINE:|7-commandAction|2|16-postAction // write post-action user code here } else if (command == sendMesg) {//GEN-LINE:|7-commandAction|3|18-preAction // write pre-action user code here String mno=number.getString(); String msg=textUrdu.getString(); if(mno.equals("")) { alert = new Alert("Alert"); alert.setString("Enter Mobile Number!!!"); alert.setTimeout(2000); display.setCurrent(alert); } else { try { clientConn=(MessageConnection)Connector.open("sms://"+mno); } catch(Exception e) { alert = new Alert("Alert"); alert.setString("Unable to connect to Station because of network problem"); alert.setTimeout(2000); display.setCurrent(alert); } try { TextMessage textmessage = (TextMessage) clientConn.newMessage(MessageConnection.TEXT_MESSAGE); textmessage.setAddress("sms://"+mno); textmessage.setPayloadText(msg); clientConn.send(textmessage); } catch(Exception e) { Alert alert=new Alert("Alert","",null,AlertType.INFO); alert.setTimeout(Alert.FOREVER); alert.setString("Unable to send"); display.setCurrent(alert); } } //GEN-LINE:|7-commandAction|4|18-postAction // write post-action user code here }//GEN-BEGIN:|7-commandAction|5|7-postCommandAction }//GEN-END:|7-commandAction|5|7-postCommandAction // write post-action user code here }//GEN-BEGIN:|7-commandAction|6| //</editor-fold>//GEN-END:|7-commandAction|6| //<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Items ">//GEN-BEGIN:|8-itemCommandAction|0|8-preItemCommandAction /** * Called by a system to indicated that a command has been invoked on a * particular item. * * @param command the Command that was invoked * @param displayable the Item where the command was invoked */ public void commandAction(Command command, Item item) {//GEN-END:|8-itemCommandAction|0|8-preItemCommandAction // write pre-action user code here if (item == number) {//GEN-BEGIN:|8-itemCommandAction|1|21-preAction if (command == add) {//GEN-END:|8-itemCommandAction|1|21-preAction // write pre-action user code here //GEN-LINE:|8-itemCommandAction|2|21-postAction // write post-action user code here }//GEN-BEGIN:|8-itemCommandAction|3|28-preAction } else if (item == send) { if (command == select) {//GEN-END:|8-itemCommandAction|3|28-preAction // write pre-action user code here //GEN-LINE:|8-itemCommandAction|4|28-postAction // write post-action user code here }//GEN-BEGIN:|8-itemCommandAction|5|24-preAction } else if (item == textUrdu) { if (command == urdu) {//GEN-END:|8-itemCommandAction|5|24-preAction // write pre-action user code here if (isUrdu) isUrdu = false; else { isUrdu = true; TextField tf = (TextField)item; } //GEN-LINE:|8-itemCommandAction|6|24-postAction // write post-action user code here }//GEN-BEGIN:|8-itemCommandAction|7|8-postItemCommandAction }//GEN-END:|8-itemCommandAction|7|8-postItemCommandAction // write post-action user code here }//GEN-BEGIN:|8-itemCommandAction|8| //</editor-fold>//GEN-END:|8-itemCommandAction|8| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: form ">//GEN-BEGIN:|14-getter|0|14-preInit /** * Returns an initialized instance of form component. * * @return the initialized component instance */ public Form getForm() { if (form == null) {//GEN-END:|14-getter|0|14-preInit // write pre-init user code here form = new Form("form", new Item[]{getNumber(), getTextUrdu(), getStringItem(), getSend()});//GEN-BEGIN:|14-getter|1|14-postInit form.addCommand(getExit()); form.addCommand(getSendMesg()); form.setCommandListener(this);//GEN-END:|14-getter|1|14-postInit // write post-init user code here form.setItemStateListener(this); // form.setCommandListener(this); }//GEN-BEGIN:|14-getter|2| return form; } //</editor-fold>//GEN-END:|14-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: number ">//GEN-BEGIN:|19-getter|0|19-preInit /** * Returns an initialized instance of number component. * * @return the initialized component instance */ public TextField getNumber() { if (number == null) {//GEN-END:|19-getter|0|19-preInit // write pre-init user code here number = new TextField("Number ", null, 11, TextField.PHONENUMBER);//GEN-BEGIN:|19-getter|1|19-postInit number.addCommand(getAdd()); number.setItemCommandListener(this); number.setDefaultCommand(getAdd());//GEN-END:|19-getter|1|19-postInit // write post-init user code here }//GEN-BEGIN:|19-getter|2| return number; } //</editor-fold>//GEN-END:|19-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: textUrdu ">//GEN-BEGIN:|22-getter|0|22-preInit /** * Returns an initialized instance of textUrdu component. * * @return the initialized component instance */ public TextField getTextUrdu() { if (textUrdu == null) {//GEN-END:|22-getter|0|22-preInit // write pre-init user code here textUrdu = new TextField("Message", null, 2000, TextField.ANY);//GEN-BEGIN:|22-getter|1|22-postInit textUrdu.addCommand(getUrdu()); textUrdu.setItemCommandListener(this);//GEN-END:|22-getter|1|22-postInit // write post-init user code here }//GEN-BEGIN:|22-getter|2| return textUrdu; } //</editor-fold>//GEN-END:|22-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: exit ">//GEN-BEGIN:|15-getter|0|15-preInit /** * Returns an initialized instance of exit component. * * @return the initialized component instance */ public Command getExit() { if (exit == null) {//GEN-END:|15-getter|0|15-preInit // write pre-init user code here exit = new Command("Exit", Command.EXIT, 0);//GEN-LINE:|15-getter|1|15-postInit // write post-init user code here }//GEN-BEGIN:|15-getter|2| return exit; } //</editor-fold>//GEN-END:|15-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: sendMesg ">//GEN-BEGIN:|17-getter|0|17-preInit /** * Returns an initialized instance of sendMesg component. * * @return the initialized component instance */ public Command getSendMesg() { if (sendMesg == null) {//GEN-END:|17-getter|0|17-preInit // write pre-init user code here sendMesg = new Command("send", Command.OK, 0);//GEN-LINE:|17-getter|1|17-postInit // write post-init user code here }//GEN-BEGIN:|17-getter|2| return sendMesg; } //</editor-fold>//GEN-END:|17-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: add ">//GEN-BEGIN:|20-getter|0|20-preInit /** * Returns an initialized instance of add component. * * @return the initialized component instance */ public Command getAdd() { if (add == null) {//GEN-END:|20-getter|0|20-preInit // write pre-init user code here add = new Command("add", Command.OK, 0);//GEN-LINE:|20-getter|1|20-postInit // write post-init user code here }//GEN-BEGIN:|20-getter|2| return add; } //</editor-fold>//GEN-END:|20-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: urdu ">//GEN-BEGIN:|23-getter|0|23-preInit /** * Returns an initialized instance of urdu component. * * @return the initialized component instance */ public Command getUrdu() { if (urdu == null) {//GEN-END:|23-getter|0|23-preInit // write pre-init user code here urdu = new Command("urdu", Command.OK, 0);//GEN-LINE:|23-getter|1|23-postInit // write post-init user code here }//GEN-BEGIN:|23-getter|2| return urdu; } //</editor-fold>//GEN-END:|23-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: stringItem ">//GEN-BEGIN:|25-getter|0|25-preInit /** * Returns an initialized instance of stringItem component. * * @return the initialized component instance */ public StringItem getStringItem() { if (stringItem == null) {//GEN-END:|25-getter|0|25-preInit // write pre-init user code here stringItem = new StringItem("string", null);//GEN-LINE:|25-getter|1|25-postInit // write post-init user code here }//GEN-BEGIN:|25-getter|2| return stringItem; } //</editor-fold>//GEN-END:|25-getter|2| //</editor-fold> //<editor-fold defaultstate="collapsed" desc=" Generated Getter: send ">//GEN-BEGIN:|26-getter|0|26-preInit /** * Returns an initialized instance of send component. * * @return the initialized component instance */ public StringItem getSend() { if (send == null) {//GEN-END:|26-getter|0|26-preInit // write pre-init user code here send = new StringItem("", "send", Item.BUTTON);//GEN-BEGIN:|26-getter|1|26-postInit send.addCommand(getSelect()); send.setItemCommandListener(this); send.setDefaultCommand(getSelect());//GEN-END:|26-getter|1|26-postInit // write post-init user code here }//GEN-BEGIN:|26-getter|2| return send; } //</editor-fold>//GEN-END:|26-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: select ">//GEN-BEGIN:|27-getter|0|27-preInit /** * Returns an initialized instance of select component. * * @return the initialized component instance */ public Command getSelect() { if (select == null) {//GEN-END:|27-getter|0|27-preInit // write pre-init user code here select = new Command("select", Command.OK, 0);//GEN-LINE:|27-getter|1|27-postInit // write post-init user code here }//GEN-BEGIN:|27-getter|2| return select; } //</editor-fold>//GEN-END:|27-getter|2| //<editor-fold defaultstate="collapsed" desc=" Generated Getter: task ">//GEN-BEGIN:|40-getter|0|40-preInit /** * Returns an initialized instance of task component. * * @return the initialized component instance */ public SimpleCancellableTask getTask() { if (task == null) {//GEN-END:|40-getter|0|40-preInit // write pre-init user code here task = new SimpleCancellableTask();//GEN-BEGIN:|40-getter|1|40-execute task.setExecutable(new org.netbeans.microedition.util.Executable() { public void execute() throws Exception {//GEN-END:|40-getter|1|40-execute // write task-execution user code here }//GEN-BEGIN:|40-getter|2|40-postInit });//GEN-END:|40-getter|2|40-postInit // write post-init user code here }//GEN-BEGIN:|40-getter|3| return task; } //</editor-fold>//GEN-END:|40-getter|3| /** * Returns a display instance. * @return the display instance. */ public Display getDisplay () { return Display.getDisplay(this); } /** * Exits MIDlet. */ public void exitMIDlet() { switchDisplayable (null, null); destroyApp(true); notifyDestroyed(); } /** * Called when MIDlet is started. * Checks whether the MIDlet have been already started and initialize/starts or resumes the MIDlet. */ public void startApp() { startMIDlet(); display.setCurrent(form); } /** * Called when MIDlet is paused. */ public void pauseApp() { midletPaused = true; } /** * Called to signal the MIDlet to terminate. * @param unconditional if true, then the MIDlet has to be unconditionally terminated and all resources has to be released. */ public void destroyApp(boolean unconditional) { } public void itemStateChanged(Item item) { if (item == textUrdu) { if (isUrdu) { stringItem.setText("urdu"); TextField tf = (TextField)item; String s = tf.getString(); char ch = s.charAt(s.length() - 1); s = s.substring(0, s.length() - 1); ch = Urdu.ToUrdu(ch); s = s + String.valueOf(ch); tf.setString(""); tf.setString(s); }//end if throw new UnsupportedOperationException("Not supported yet."); } } }

    Read the article

  • DataTable.WriteXml on background thread

    - by Sheraz KHan
    I am trying to serealize DataTables in a background thread and it's failing. Any idea [Test] public void Async_Writing_DataTables() { string path = @"C:\Temp\SerialzeData"; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } Assert.IsTrue(Directory.Exists(path)); Thread thread1 = new Thread(new ThreadStart(delegate { object lockObject = new object(); for (int index = 0; index < 10; index++) { lock (lockObject) { DataTable table = new DataTable("test"); table.WriteXml(Path.Combine(path, table.TableName + index + ".xml")); } } })); thread1.Start(); }

    Read the article

  • Calendar Table - Week number of month

    - by Saif Khan
    I have a calendar table with data from year 2000 to 2012 (2012 wasn't intentional!). I just realize that I don't have the week number of month (e.g In January 1,2,3,4 February 1,2,3,4) How do I go about calculating the week numbers in a month to fill this table? Here is the table schema CREATE TABLE [TCalendar] ( [TimeKey] [int] NOT NULL , [FullDateAlternateKey] [datetime] NOT NULL , [HolidayKey] [tinyint] NULL , [IsWeekDay] [tinyint] NULL , [DayNumberOfWeek] [tinyint] NULL , [EnglishDayNameOfWeek] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [SpanishDayNameOfWeek] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [FrenchDayNameOfWeek] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [DayNumberOfMonth] [tinyint] NULL , [DayNumberOfYear] [smallint] NULL , [WeekNumberOfYear] [tinyint] NULL , [EnglishMonthName] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [SpanishMonthName] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [FrenchMonthName] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [MonthNumberOfYear] [tinyint] NULL , [CalendarQuarter] [tinyint] NULL , [CalendarYear] [char] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [CalendarSemester] [tinyint] NULL , [FiscalQuarter] [tinyint] NULL , [FiscalYear] [char] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [FiscalSemester] [tinyint] NULL , [IsLastDayInMonth] [tinyint] NULL , CONSTRAINT [PK_TCalendar] PRIMARY KEY CLUSTERED ( [TimeKey] ) ON [PRIMARY] ) ON [PRIMARY] GO

    Read the article

  • Tilecache standalone server with nginx in production environment

    - by farhan khan
    Hi, I am really new to tilecache. I would like to know how good is the tilecache http server that comes with the tilecache installation. Is it practical to deploy it behind nginx in production environment? (i.e. nohup tilecache_http_server.py -p 8000 & and then editting the nginx.conf). The VPS we are using has nginx installed already so I thought that would be the easiest for me. However, how practical/efficient is it?

    Read the article

  • Single Page Navigation w/ Javascript and Back Button

    - by Khan
    Ok, so I have a "navigation" div and "content" div. When something on the navigation is clicked, I fade in the content div with the new data. Now, I would like to have the old data returned when the user hits the "back" button on his/her browser, but I'm having a hard time doing this. I know I can set the content to be a named anchor, so they stay on the same page with a breadcrumb trail. However, that's as far as I get. Can I listen for a back button click? Can I set content to display when a certain anchor name is reached? Thanks in advance for your help, SO.

    Read the article

  • How to load a binary file(.bin) of size 6 MB in a varbinary(MAX) column of SQL Server 2005 database

    - by Feroz Khan
    How to load a binary file(.bin) of size 6 MB in a varbinary(MAX) column of SQL Server 2005 database using ADO in vc++ application. This is the code I am using to load the file which I used to load a .bmp file BOOL CSaveView::PutECGInDB(CString strFilePath, FieldPtr pFileData) { //Open File CFile fileImage; CFileStatus fileStatus; fileImage.Open(strFilePath,CFile::modeRead); fileImage.GetStatus(fileStatus); //Alocating memory for data ULONG nBytes = (ULONG)fileStatus.m_size; HGLOBAL hGlobal = GlobalAlloc(GPTR,nBytes); LPVOID lpData = GlobalLock(hGlobal); //Putting data into file fileImage.Read(lpData,nBytes); HRESULT hr; _variant_t varChunk; long lngOffset = 0; UCHAR chData; SAFEARRAY FAR *psa = NULL; SAFEARRAYBOUND rgsabound[1]; try { //Create a safe array to store the BYTES rgsabound[0].lLbound = 0; rgsabound[0].cElements = nBytes; psa = SafeArrayCreate(VT_UI1,1,rgsabound); while(lngOffset<(long)nBytes) { chData = ((UCHAR*)lpData)[lngOffset]; hr = SafeArrayPutElement(psa,&lngOffset,&chData); if(hr != S_OK) { return false; } lngOffset++; } lngOffset = 0; //Assign the safe array to a varient varChunk.vt = VT_ARRAY|VT_UI1; varChunk.parray = psa; hr = pFileData-AppendChunk(varChunk); if(hr != S_OK) { return false; } } catch(_com_error &e) { //get info from _com_error _bstr_t bstrSource(e.Source()); _bstr_t bstrDescription(e.Description()); _bstr_t bstrErrorMessage(e.ErrorMessage()); _bstr_t bstrErrorCode(e.Error()); TRACE("Exception thrown for classes generated by #import"); TRACE("\tCode= %08lx\n",(LPCSTR)bstrErrorCode); TRACE("\tCode Meaning = %s\n",(LPCSTR)bstrErrorMessage); TRACE("\tSource = %s\n",(LPCSTR)bstrSource); TRACE("\tDescription = %s\n",(LPCSTR)bstrDescription); } catch(...) { TRACE("Unhandle Exception"); } //Free Memory GlobalUnlock(lpData); return true; } But when I read the same file using Getchunk funcion it gives me all 0,s but the size of the file I get is same as the one uploaded. Your help will be highly appreciated. Thanks in advance.

    Read the article

  • Externalize Javascript in YAP

    - by Haseeb Khan
    I am working on a Yahoo! App which requires certain external Javascript Frameworks to be loaded and used. Also in the Yahoo! App Best Practices Guide, it is also mentioned that the sources should be externalized, however, externalization isn't working for me. I am using the standard procedure to load the external JS file like the following: <script src="http://www.google.com/js/nxsl.1.js"></script> But the above statement is giving me an error that external sources are not allowed. Is there any way to use external JS files as I don't want to include all of my JS Login inline, it doesn't make sense to me and majorly my code won't be re-usable. Any thoughts ?

    Read the article

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