browse by category or date

Website Description

Originally was hosted within Share Investor/Listed Company hosting service, but it is now self hosted. The website displays a stock ticker using an iframe in which the source is located at Listed Company’s server.

<iframe width="600" scrolling="no" height="28"
        frameborder="0" id="home_ticker" 
	style="background-color: transparent;" 
	src="http://xxx_company_name_xxx.listedcompany.com/includes/stock_ticker.html">
 </iframe>

 

Symptom

In Internet Explorer, the ticker is not running.
stock_ticker_err

But it runs properly on Chrome, Firefox (yet to test it in Opera and Safari).
stock_ticker

 

Cause

Upon debugging in IE’s Developer Tools, we found out that jQuery was throwing SCRIPT5: Access is denied.
ie_devtool

Further investigation shown that this is caused by cross-domain restriction in IE, as discussed in here and here.

 

Solution

Since this is a cross-domain problem, we need to create a simple proxy that will fetch the content from Listed Company’s server.

  1. Create a proxy folder in the website’s root folder.
  2. Download http://xxx_company_name_xxx.listedcompany.com/includes/stock_ticker_script.js and save it as stock_ticker.js in folder created in the first step. (Don’t worry, the script file is under dual licensed under the MIT and GPL).
  3. Create proxy.aspx inside the folder above.
    <%@ Page Language="C#" %>
    <%@ Import Namespace="System.IO" %>
    <%@ Import Namespace="System.Net" %>
    <%@ Import Namespace="System.Net.Cache" %>
    
    <script runat="server">
        public void Page_Load(object sender, System.EventArgs e)
        {
            Response.Clear();
    		DirectoryInfo dir = new DirectoryInfo(Server.MapPath("/proxy"));
            FileInfo cache = new FileInfo(dir.FullName + "\\_stock_ticker.html");
            if (cache.Exists && cache.LastAccessTime >= DateTime.Now.AddMinutes(-10))
            { 
                //if the cache file is updated in the last 10 minutes, return the cache file instead
                Response.WriteFile(cache.FullName);
            }
            else
            {            
                try
                {
                    HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(
                                         "http://xxx_company_name_xxx.listedcompany.com/includes/stock_ticker.html");
                    //don't cache
    	        req.CachePolicy = new RequestCachePolicy(RequestCacheLevel.NoCacheNoStore);
                    StreamReader reader = new StreamReader(req.GetResponse().GetResponseStream());
                    String content = reader.ReadToEnd();
                    reader.Close();
                    //replace the js file the our local copy
                    content = content.Replace("/includes/stock_ticker_script.js", "stock_ticker.js");
                    StreamWriter writer = new StreamWriter(cache.OpenWrite());
                    writer.Write(content);
                    writer.Close();
                    Response.WriteFile(cache.FullName);
                }
                catch (Exception ex)
                {
                    if (cache.Exists)
                        Response.WriteFile(cache.FullName);
                    else
                        Response.Write(ex.ToString());
                }
            }      
        }
    </script>
    
  4. Replace the iframe’s src
    <iframe width="600" scrolling="no" height="28"
            frameborder="0" id="home_ticker" 
    	style="background-color: transparent;" 
    	src="/proxy/proxy.aspx">
     </iframe>
    
  5. That’s all folks! I hope it helps. Cheers!

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant:

  1. Start a freelance practice.
  2. Raise your rates.
  3. As you work for clients, keep a sharp eye for opportunities to build “specialty practices”. If you get to work on a project involving Mongodb, spend some extra time and effort to get Mongodb under your belt. If you get a project for a law firm, spend some extra time thinking about how to develop applications that deal with contracts or boilerplates or PDF generation or document management.
  4. Raise your rates.
  5. Start refusing hourly-rate projects. Your new minimum billable increment is a day.
  6. Take end-to-end responsibility for the business objectives of whatever you build. This sounds fuzzy, like, “be able to talk in a board room”, but it isn’t! It’s mechanically simple and you can do it immediately: Stop counting hours and days. Stop pushing back when your client changes scope. Your remedy for clients who abuse your flexibility with regards to scope is “stop working with that client”. Some of your best clients will be abusive and you won’t have that remedy. Oh well! Note: you are now a consultant.
  7. Hire one person at a reasonable salary. You are now responsible for their payroll and benefits. If you don’t book enough work to pay both your take-home and their salary, you don’t eat. In return: they don’t get an automatic percentage of all the revenue of the company, nor does their salary automatically scale with your bill rate.
  8. You are now “senior” or “principal”. Raise your rates.
  9. Generalize out from your specialties: Mongodb -> NoSQL -> highly scalable backends. Document management -> secure contract management.
  10. Raise your rates.
  11. You are now a top-tier consulting group compared to most of the market. Market yourself as such. Also: your rates are too low by probably about 40-60%.

Try to get it through your head: people who can simultaneously

  1. crank out code (or arrange to have code cranked out) and
  2. take responsibility for the business outcome of the problems that code is supposed to solve — people who can speak both tech and biz — are exceptionally rare.

They shouldn’t be; the language of business is mostly just elementary customer service, of the kind taught to entry level clerks at Nordstrom’s. But they are, so if you can do that, raise your rates.

Taken from Hacker News

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant:

How do we charge our customers? Let them use our product for free and pray that someday they will upgrade? Des Traynor has the answers. He formulated four pricing strategies that could/already working for him.

  1. Charge earlier than you’re comfortable with. Don’t wait until you have X-features before thinking about pricing. Once you have the main functionality of the product/service, start charging.
  2. Charge more than you’re comfortable with. Charge based on how much you worth to the company, not how small the number of developers in your team.
  3. Justify (or Kill) your lowest plan. Instead of freemium, use limited time trial.
  4. Plan on Changing Prices. As you add more and more values to the product, the price should go up, not go down.

About Hardono

Howdy! I'm Hardono. I am working as a Software Developer. I am working mostly in Windows, dealing with .NET, conversing in C#. But I know a bit of Linux, mainly because I need to keep this blog operational. I've been working in Logistics/Transport industry for more than 11 years.

Possibly relevant: