Skip to main content

Ani Saraf

Ani Saraf's Public Library

10 Dec 08

Bjarne Stroustrup on Educating Software Developers

  • In addition to the classical and essential foundations of computer science, such as algorithms, data structures, and machine architecture, we include repeated exposure to practical topics and projects. Repetition is necessary because students forget and integration of theoretical and practical parts is needed to create a balanced view. I’m very keen to fuse the theoretical base with practical skills. I see computer science as ideally an applied (engineering) discipline and see too many people disregarding either the theoretical or the practical parts.
  • I think aesthetics can be taught to many. Mostly it is a case of repeatedly showing students good examples and explaining why those examples are good. This takes time, years. I would like for programmers to present portfolios of their work, much in the way artist (including architects) have to.

Bjarne Stroustrup on Educating Software Developers

  • in fact they had never been taught about programming style because the department “taught computer science; not programming.” That is, programming was seen as a lowly skill that students either did not need or could easily pick up on their own.


    I have seen the result of that attitude in new graduate students: It is rare that anyone thinks about the structure of their code or the implications for scaling and maintenance – those are not academic subjects. Students are taught good practical and essential topics, such as algorithms, data structures, machine architecture, programming languages, and “systems,” but only rarely do they “connect the dots” to see how it all fits together in a maintainable program.

  • Few students see code as anything but a disposable entity needed to complete the next project and get good grades. Much of the emphasis in teaching encourages that view.
  • 2 more annotations...
26 Nov 08

Parsing OneNote XML with LINQ to XML - Nguyen Huu Hoa's Blog

  • private List<Data.ONSection> SelectSections(XElement xml)
    {
    List<Data.ONSection> sections =
    (from section in xml.Elements()
    where
    (section.Name == oneNS + "SectionGroup") ||
    (section.Name == oneNS + "Section")
    // orderby section.Value
    select new Data.ONSection
    {
    Name = section.Attribute("name").Value,
    ID = section.Attribute("ID").Value,
    SubSections = SelectSections(section),
    Pages = SelectPages(section),
    }).ToList();
    return sections;
    }


    // Get page information out of XML

    private
    List<Data.ONPage> SelectPages(XElement xml)
    {
    List<Data.ONPage> pages =
    (from page in xml.Elements(oneNS + "Page")
    // orderby section.Value
    select new Data.ONPage
    {
    Name = page.Attribute("name").Value,
    ID = page.Attribute("ID").Value,
    }).ToList();
    return pages;
    }
24 Nov 08

Inodes

  • Every directory also contains the name "."
    (dot), a map to the directory itself, so the smallest link count of any Unix directory is
    2: one for the map in the parent directory that gives the directory its "name",
    and one for the dot map in the directory itself.
19 Nov 08

Building Ink Chat

  • Scrolling an InkOverlay in C#

Scrolling Ink in an InkOverlay - Tablet PC and Mobile PC Forums


  • <!-- Start Member Post -->
    <!-- google_ad_section_start -->

    I have made progress getting a RichTextBox to communicate the needed information to my InkOverlay object, but now I am having fits getting the InkOverlay to transform properly. I am using "Building Tablet PC Applications" as my only source of information on how to do this as I have found very little information on the web anywhere, including MSDN.
     

    I am getting the vertical offset of the RichTextBox contents in pixels, assuming that the top of the text is at position 0. I've tried all manner of ways of taking that pixel count and passing it to the Renderer, but nothing seems to cause the ink to display at the proper offset. It either scrolls too fast, doesn't scroll at all, scrolls too slow or, in same wild stabs at this, scrolls the wrong direction.

     

    Here is the current germane code, modified from "Building Tablet PC Applications" that handles the RichTextBox VScroll event:

     

    Dim g as Graphics = tp.CreateGraphics()         ' tp is a Panel that hosts the

                                                    ' InkOverlay called io

    dim ptNewPos as Point

    ptNewPos.X = 0                                  ' Interested in vertical move only

    ptNewPos.Y = rtb.GetScrollBarPos(rtb.Handle, 1) ' returns the current scroll bar

                                                    ' position in pixels

     

    ptNewPos.Y = ptPrevPos.Y - ptNewPos.Y           ' get the delta from last position

    io.Renderer.PixelToInkSpace(g, ptNewPos)        ' convert to HIMETRIC

    io.Renderer.Move(ptNewPos.X, ptNewPos.Y)        ' move the ink

    ptPrevPos = ptNewPos                            ' save the current location

    g.Dispose()

    tp.Invalidate()

     

    I've looked at this so much over the last five days, and modified the code so many times, that I can't even read it clearly any more. Anyone care to be a second set of eyes to see what obvious thing I am overlooking? All I want to do is scroll the ink up or down a fixed number of pixels.

     

    Thanks,
    Mark

     
    <script type="text/javascript"></script>

    <!-- google_ad_section_end -->
    <!-- End Member Post -->
18 Nov 08

Integration By Parts

  • some cool integration by parts technique - anirudh_22 on 2008-11-18
  • Integration by Parts
17 Nov 08

ASP.NET you can

  • try something like this:

    <input type="button" onclick="document.execCommand('SaveAs',null,'C:\\temp\\thePage.html');" value="Save The Page" />

    should do it
12 Nov 08

mathproofs: A Rigorous Proof of the Symmetric Difference Quotient

  • Then we don't even need to use derivatives (directly) or averages:
    limh→0 [ƒ(x+h)-ƒ(x-h)]/(2h) = limh→0 {[ƒ(x+h)-ƒ(x)]-[ƒ(x-h)-ƒ(x)]}/(2h)
                                     = ½limh→0 {[ƒ(x+h)-ƒ(x)]-[ƒ(x-h)-ƒ(x)]}/h
                                     = ½limh→0 {[ƒ(x+h)-ƒ(x)]/h - [ƒ(x-h)-ƒ(x)]/h}
                                     = ½limh→0 {[ƒ(x+h)-ƒ(x)]/h + [ƒ(x+(-h))-ƒ(x)]/(-h)}
                                     = ½{limh→0 [ƒ(x+h)-ƒ(x)]/h + limh→0 [ƒ(x+(-h))-ƒ(x)]/(-h)} since the first limit exists by assumption and it is easy to show (from the definition of a limit) that the second limit exists and is equal to the first.
                                     = ½{2limh→0 [ƒ(x+h)-ƒ(x)]/h}
                                     = limh→0 [ƒ(x+h)-ƒ(x)]/h
09 Nov 08

Hash table - Wikipedia, the free encyclopedia

  • he primary operation it supports efficiently is a lookup: given a key (e.g. a person's name), find the corresponding value (e.g. that person's telephone number). It works by transforming the key using a hash function into a hash, a number that is used as an index in an array to locate the desired location ("bucket") where the values should be.
08 Nov 08

Gap buffer - Wikipedia, the free encyclopedia

07 Nov 08

Gavin Gear's Tech Blog : Silverlight 1.1 Ink Demo by Mark Johnston of MSDN UK

  • Here's a 6 minute video showing how to get started with Ink support in Silverlight 1.1 by Mark Johnston from MSDN UK:
    http://www.microsoft.com/uk/msdn/nuggets/nugget/248/Silverlight-Using-Ink.aspx 


    His video will guide you through the process of integrating Ink support into your Silverlight 1.1 project. The concepts are basically the same as the Silverlight 1.0 code samples that I've shown you, but you develop your codebehind in C# rather than JavaScript.

Tagged union - Wikipedia, the free encyclopedia

  • In computer science, a tagged union, also called a variant, variant record, discriminated union, or disjoint union, is a data structure used to hold a value that could take on several different, but fixed types. Only one of the types can be in use at any one time, and a tag field explicitly indicates which one is in use. It can be thought of as a type which has several "cases," each of which should be handled correctly when that type is manipulated.
  • The primary advantage of a tagged union over a simple record containing a field for each type is that it saves storage by overlapping storage for all the types.
  • 1 more annotations...

Coco Chanel - Biography and Links

  • The two men also helped her
    find customers among women of society, and her simple hats became
    popular.


    Soon she was expanding to couture, working in jersey, a first in
    the French fashion world. By the 1920s, her fashion house had
    expanded considerably, and her chemise set a fashion trend with its
    "little boy" look. Her relaxed fashions, short skirts, and casual
    look were in sharp contrast to the corset fashions popular in the
    previous decades. Chanel herself dressed in mannish clothes, and
    adapted these more comfortable fashions which other women also found
    liberating.


    In 1922 Chanel introduced a perfume, Chanel No. 5, which became
    and remained popular, and remains a profitable product of Chanel's
    company. Pierre Wertheimer became her partner in the perfume
    business in 1924, and perhaps also her lover. Wertheimer owned 70%
    of the company; Coco Chanel received 10% and her friend Bader 20%.
    The Wertheimers continue to control the perfume company today.


    Coco Chanel introduced her signature cardigan jacket in 1925 and
    signature "little black dress" in 1926. Most of her fashions had a
    staying power, and didn't change much from year to year -- or even
    generation to generation.

05 Nov 08

Programming Interviews Exposed: Secrets to Landing Your Next Job, Second Edition - Books24x7

  • Make sure you understand the problem.
  • Once you understand the question, try an example
  • 10 more annotations...

Programming Interviews Exposed: Secrets to Landing Your Next Job, Second Edition - Books24x7

  • What the interviewer wants is to see your thought processes as you work through each stage of the programming problem.
1 - 20 of 47 Next › Last »
Showing 20 items per page

Diigo is about better ways to research, share and collaborate on information. Learn more »

Join Diigo