Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
B

benjamin yap

@benjamin yap
About
Posts
160
Topics
67
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • using string compare
    B benjamin yap

    is there other way beside using HTML Reader C++ Class Library?

    C / C++ / MFC html question

  • using string compare
    B benjamin yap

    hi, how do i use string compare to get this value <span class="streaming-datum" id="yfs_l10_^ixic">2,190.06</span> before that line of code,there are many other html codes before and after it. my friend suggested to me using string compare this string "<span class="streaming-datum" id="yfs_l10_^ixic">" and if the compare value is true, do a loop and loop through the remaining text till i get a '<' but how do i continue looking for the value after &lt;span class="streaming-datum" id="yfs_l10_^ixic"&gt;

    C / C++ / MFC html question

  • need some suggestion on a method to use
    B benjamin yap

    do i have to #include anything to use the innertext, outertext etc etc?

    C / C++ / MFC html com tutorial question

  • need some suggestion on a method to use
    B benjamin yap

    how do i extract 2,190.06 from here? <span class="streaming-datum" id="yfs_l10_^ixic">2,190.06</span> The ihtmldocument quite complicated to understand

    C / C++ / MFC html com tutorial question

  • need some suggestion on a method to use
    B benjamin yap

    Hi all, I got a txt file filled with HTML code extract from www.finance.yahoo.com this is the data from finance.yahoo.com Dow 10,212.73 +27.20 +0.27% Nasdaq 2,174.00 +2.80 +0.13% 10 Yr Bond(%) 3.6500% -0.0400 Oil 75.25 +0.82 +1.10% Gold 1,113.60 +10.10 +0.91 the 3 values i wanna extract from each stock is all the values above. all the values need to be read from the HTML text file of finance.yahoo.com. so, how should i create the method and what parameter should i pass in? should i create individual method for each stock? example double getDOW(param1, param2, param3, etc) or a generic method that can search any stock quote

    C / C++ / MFC html com tutorial question

  • extracting data from .TXT file
    B benjamin yap

    Hi Guys, I got a txt file which contains html codes in it. <td class="ticker_name"><a href="http://finance.yahoo.com/q;\_ylt=Al7he7j4xkWAM99.PPB7UVFO7sMF;\_ylu=X3oDMTE5cnE2OWVuBHBvcwMzBHNlYwNtYXJrZXRTdW1tYXJ5SW5kaWNlcwRzbGsDbmFzZGFx?s=^IXIC" >Nasdaq</a></td><td><span class="streaming-datum" id="yfs_l10_^ixic">2,147.35</span></td><td class="ticker_down"><span class="streaming-datum" id="yfs_c10_^ixic">-31.65</span></td><td class="right_cell ticker_down"><span class="streaming-datum" id="yfs_pp0_^ixic">-1.45%</span> how do i extract the value example 2,147.35 and -31.65 of NASDAQ

    C / C++ / MFC question html com tutorial

  • creating methods/functions in a seperate file
    B benjamin yap

    Hi all, i am very very new to c++ hope u guys can pardon me. I have a file called "newclass.h" which declares a few methods.

    //newclass.h, the specification file for the class NewClass

    #ifndef _NEWCLASS_H
    #define _NEWCLASS_H
    #include <string>

    using namespace std;

    class NewClass {
    public:

    string symbol; //variable to store the symbol (e.g.: Nasdaq)
    double lastTrade; //variable to store the last traded value
    double changeValue(); //variable to store the change in value
    double changePercentage(); //variable to store the change in percentage

    //function to get the respective values
    //the word const at the end of the member functions specify that these functions cannot modify the member variables of a variable
    void getDow(string symbol, double, double, double) const;
    void getNasdaq(string symbol, double, double, double) const;
    void getSP_500(string symbol, double, double, double) const;
    void getFTSE_100(string symbol, double, double, double) const;
    void getDAX(string symbol, double, double, double) const;
    void getNikkei_225(string symbol, double, double, double) const;
    void getHang_Seng(string symbol, double, double, double) const;
    void getStraits_Times_Index(string symbol, double, double, double) const;
    };
    #endif

    and the other file i have is "newclass.cpp"

    //newclass.cpp, the implementation file
    #include #include "newclass.h"

    using namespace std;

    how do i continue writing the main function of the method in newclass.cpp thanks

    C / C++ / MFC c++ question

  • selecting first 7 days from database
    B benjamin yap

    hi, i got a database table that have 4 column id,subject,contents,date the date column is varchar datatype and its the data is DateTime.Now.ToString() How do i select 7 days record from the table.. Select * from announcement WHERE ???? thanks

    Database question database announcement

  • c# form on focus
    B benjamin yap

    i have look thru many times.. Do not have the GotFocus event.. Well, i think i create a static method in Form1 and before Form2 closes, it will fire Form1 method instead of using the GotFocus

    C# csharp question

  • c# form on focus
    B benjamin yap

    somehow, my form dont have the GotFocus event

    C# csharp question

  • c# form on focus
    B benjamin yap

    Hi, I got 2 forms.. Form1 and Form2. When the program is executed, Form1 is called. There is a button that will open Form2. At this point of time, Form2 will be on top of Form1. After the user closes Form2, i want form1 to show something.. But i cant find the OnFocus event.. any idea?

    C# csharp question

  • threading, invoke
    B benjamin yap

    Hi, I got this chart object on my UI thread called 'm_ChartControl' I got a method called AddAnnotations that will be run on a new thread in my Form_Load method. Inside my AddAnnotation method there is a line of code that do this. Annotation a = m_ChartControl.Charts[0].AnnotationList.CreateAnnotation(); But m_ChartControl.Charts[0].AnnotationList.CreateAnnotation(); is in the UI thread. How do i create a delegate to put it here? I have tried this.

        private delegate Annotation AddAnnotation();
        AddAnnotation addNewAnnotation;
        private Annotation CreateAnnotation()
        {
            return m\_ChartControl.Charts\[0\].AnnotationList.CreateAnnotation(); 
        }
        void cAnnotation()
        {
            this.Invoke(addNewAnnotation);
        }
    

    I changed this to Annotation a = cAnnotation(); and i get this error Error 18 Cannot implicitly convert type 'void' to 'Manco.Chart.CF.Layout.Annotation'

    C# question design help

  • Control.Invoke must be used to interact with controls created on a seperate thread
    B benjamin yap

    i have create another Delegate

        private delegate void AddAnnotation();
        AddAnnotation addNewAnnotation;
    
        private void CreateAnnotation()
        {
            m\_ChartControl.Charts\[0\].AnnotationList.CreateAnnotation(); 
        }
        void cAnnotation()
        {
            this.Invoke(addNewAnnotation);
        }
    

    and under the AddAnnoations method i change it to

    anno[countA] = cAnnotation();

    and i get this error Error 4 Cannot implicitly convert type 'void' to 'Manco.Chart.CF.Layout.Annotation' i tried change all the void to Annotation but still get error

    modified on Friday, December 11, 2009 12:00 PM

    C# data-structures xml help

  • Control.Invoke must be used to interact with controls created on a seperate thread
    B benjamin yap

    hmm.. i still get the same error :( could this be the error? under the AddAnnotations method. anno[countA] = m_ChartControl.Charts[0].AnnotationList.CreateAnnotation();

    C# data-structures xml help

  • Control.Invoke must be used to interact with controls created on a seperate thread
    B benjamin yap

    Hi, I get this error despite create a delegate..

        private delegate void ResumeChart();
        ResumeChart ChartResume;
    
        private void ResumeChartLayout()
        {
            this.m\_ChartControl.ResumeChartLayout();
        }
    
        void ResetChart()
        {
            this.Invoke(ChartResume);
        }
    

    Inside my constructor I have this.

        public frmGraph(String stockQuote,String\[\] args)
        {
            InitializeComponent();
            newArgs = new String\[args.Length\];
            Array.Copy(args, newArgs, args.Length);
            token = newArgs\[0\];
            
            this.stockQuote = stockQuote;
            //this.stockQuote = "MGM";
            label1.Text = stockQuote;
            this.Text = stockQuote + " Graph";
            **ChartResume = ResumeChartLayout;**
        }
    

    Inside my form load, i create a new thread to call another function

        private void frmGraph\_Load(object sender, EventArgs e)
        {   
            FillDataTable();
    
            //SetFilter(DateTime.Now.AddDays(-9), DateTime.Now);
            m\_ChartControl.Charts\[0\].Data = this.GenareteDataForCandle();
            m\_ChartControl.SuspendChartLayout();
            m\_ChartControl.LoadTheme("Manco.Chart.CF.Theme.xml");
            m\_ChartControl.Charts\[0\].ChartType = ChartType.Line;
    
            m\_ChartControl.Charts\[0\].ValueAxisList\[0\].Min = this.m\_dStokMin;
            m\_ChartControl.Charts\[0\].ValueAxisList\[0\].Max = this.m\_dStokMax;
    
            **workerThread2 = new Thread(new ThreadStart(AddAnnotations));
            workerThread2.Start();**
    
            m\_ChartControl.ResumeChartLayout();
        }
    

    This is my AddAnnotation function that will invoke the ResetChart() method

        public void AddAnnotations()
        {
            string toa = "calls";
            Annotation\[\] anno = null;
            int countA = 0;
            int arrayIndex = 0;
            while (true)
            {
    
                XmlDocument xmlPlogs = getAllPlogs(toa);
                XmlNodeList plogs = xmlPlogs.SelectNodes("/PlogList/Plog");
    
                foreach (XmlNode plog in plogs)
                {
                    XmlNodeList receivers = plog.SelectNodes("PlogUnique/Message/Receiver");
                    
                    foreach (DateTime dt in dateArray)
                    {
                        DateTime newDT = Convert.ToDateTime(plog.SelectSingleNode("PlogCommon/T
    
    C# data-structures xml help

  • variable names
    B benjamin yap

    well.. basically this is wat i am foreaching

        public void AddAnnotations()
        {
            string toa = "calls";
            while (true)
            {
    
                XmlDocument xmlPlogs = getAllPlogs(toa);
                XmlNodeList plogs = xmlPlogs.SelectNodes("/PlogList/Plog");
    
                Annotation\[\] anno = null;
                int countA = 0;
                int arrayIndex = 0;
                foreach (XmlNode plog in plogs)
                {
                    XmlNodeList receivers = plog.SelectNodes("PlogUnique/Message/Receiver");
    
                    foreach (DateTime dt in dateArray)
                    {
                        DateTime newDT = Convert.ToDateTime(plog.SelectSingleNode("PlogCommon/TimeOfOccurrence").InnerText);
                        newDT = Convert.ToDateTime(newDT.ToString("dd MMM"));
                        String content = plog.SelectSingleNode("PlogUnique/Message/Content").InnerText;
                        if((content.Contains(stockQuote)) && (newDT.ToString() == dt.ToString()))
                        {
                            for (int i = 0; i < dateArray.Length; i++)
                            {
                                if (dateArray\[i\] == newDT)
                                {
                                    arrayIndex = i;
                                }
                            }
                            anno\[countA\] = m\_ChartControl.Charts\[0\].AnnotationList.CreateAnnotation();
                            anno\[countA\].Location.TypeX = LengthType.Bound;
                            anno\[countA\].Location.X = arrayIndex;
                            anno\[countA\].Location.TypeY = LengthType.Bound;
                            anno\[countA\].Location.Y = 0;
    
                            anno\[countA\].Data = "     ";
                            anno\[countA\].Font.Size = 4;
                            anno\[countA\].Font.Bold = false;
                            anno\[countA\].Color = Color.FromArgb(1, 1, 1);
    
                            modulePath = this.GetType().Module.FullyQualifiedName;
                            moduleDir = Path.GetDirectoryName(modulePath);
                            anno\[countA\].ImageFile = Path.Combine(moduleDir, "ArrUp.png");
                            countA++;
                        }
                        
                    }
                }
                Thread.Sleep(5 \* 60 \* 1000);
                ResetChart();
            }
    
    C# tutorial question

  • variable names
    B benjamin yap

    hmm now i get this error Error 21 'System.Collections.Generic.IEnumerable<Manco.Chart.CF.Layout.Annotation>' does not contain a definition for 'Add' and no extension method 'Add' accepting a first argument of type 'System.Collections.Generic.IEnumerable<Manco.Chart.CF.Layout.Annotation>' could be found (are you missing a using directive or an assembly reference?)

    C# tutorial question

  • variable names
    B benjamin yap

    hmm i get this error Error 21 Cannot implicitly convert type 'Manco.Chart.CF.Layout.Annotation' to 'System.Collections.IEnumerable'. An explicit conversion exists (are you missing a cast?) I tried doing this also cant work IEnumberable anno = m_ChartControl.Charts[0].AnnotationList.CreateAnnotation();

    C# tutorial question

  • variable names
    B benjamin yap

    could you give me a little sample of using IEnumerable in my above code? thanks

    C# tutorial question

  • variable names
    B benjamin yap

    actually this is the code i want to run inside the foreach loop

            // Add annotation to the line chart.
            Annotation aonnotation = m\_ChartControl.Charts\[0\].AnnotationList.CreateAnnotation();
    
            // Bind annotation to the first category in the last series (Volume).
            // X coordinate is category
            // Y coordinate is series
            aonnotation.Location.TypeX = LengthType.Bound;
            aonnotation.Location.X = 6;
            aonnotation.Location.TypeY = LengthType.Bound;
            aonnotation.Location.Y = 0;
    
            // Set annotation properties
            aonnotation.Data = "     ";
            aonnotation.Font.Size = 4;
            aonnotation.Font.Bold = false;
            aonnotation.Color = Color.FromArgb(1, 1, 1);
    
            modulePath = this.GetType().Module.FullyQualifiedName;
            moduleDir = Path.GetDirectoryName(modulePath);
            aonnotation.ImageFile = Path.Combine(moduleDir, "ArrUp.png");
    

    This code will be create in each loop, but i cannot use the same variable name aonnotation because i need different name to generate annotations onto my chart.

    C# tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups