Ctrl's tech cafe

Discussion in 'Computers & Tech' started by Ctrl, Feb 2, 2013.

  1. DivineComedy

    DivineComedy Well-Known Member

    Joined:
    Apr 9, 2011
    Messages:
    7,629
    Likes Received:
    841
    Trophy Points:
    113
    Say you are sitting at a screen, and inside here goes stuff in C++:

    void stupiddraw::MainPage::MyCanvas_PointerPressed(Platform::Object^ sender, Windows::UI::Xaml::Input::pointerRoutedEventArgs^ e)
    {

    }

    Now if you right click on the “PointerRoutedEventArgs” and Go To Definition it takes us to a screen that says Object Browser:

    And there are these three wrenches that say Handled, KeyModifiers, and Pointer, and if I click on Pointer it the little window at the bottom displays:

    public : property Windows::UI::Xaml::Input::pointer^ Pointer { get; }
    Member of Windows::UI::Xaml::Input::pointerRoutedEventArgs

    Summary:
    Gets a reference to a pointer token.

    Return Values:
    A pointer token.


    And if say for instance in the tutorial on C# we have this code:


    void MyCanvas_PointerPressed(object sender, PointerRoutedEventArgs e)
    {
    var pointer = e.GetCurrentPoint(MyCanvas);
    if (!pointer.Properties.IsLeftButtonPressed)
    return;

    _Current = new Windows.UI.Xaml.Shapes.Path()
    {
    Stroke = new SolidColorBrush(Windows.UI.Colors.Blue),
    StrokeThickness = 4d,
    Data = new PathGeometry
    {
    Figures = {
    new PathFigure { StartPoint = pointer.Position,
    Segments = { new PolyLineSegment() } } }
    },

    };

    MyCanvas.Children.Add(_Current);
    }


    What I am trying to understand is how or where he gets the rest of it from. The xaml designer gives you the “PointerRoutedEventArgs^ e,” and if you right click on the GetCurrentPoint and go to definition:

    // Summary:
    // Retrieves a PointerPoint object that provides basic info on the pointer associated
    // with the event.
    //
    // Parameters:
    // relativeTo:
    // Any UIElement-derived object that is connected to the same object tree. To
    // specify the object relative to the overall coordinate system, use a relativeTo value
    // of null.
    //
    // Returns:
    // A PointerPoint value that represents the pointer point associated with this
    // event. If null was passed as relativeTo, the coordinates are in the frame
    // of reference of the overall window. If a relativeTo value other than null
    // was passed, the coordinates are relative to the object referenced by relativeTo.
    public PointerPoint GetCurrentPoint(UIElement relativeTo);

    The definition of IsLeftButtonPressed:
    //
    // Summary:
    // Gets a value that indicates whether the input is from the left button of
    // a mouse or other input method.
    //
    // Returns:
    // True if the left button is pressed; otherwise false.
    public bool IsLeftButtonPressed { get; }

    The definition of Stroke:

    //
    // Summary:
    // Gets or sets the Brush that specifies how the Shape outline is painted.
    //
    // Returns:
    // A Brush that specifies how the Shape outline is painted. The default is null.
    public Brush Stroke { get; set; }

    Definition of SolidColorBrush:
    //
    // Summary:
    // Initializes a new instance of the SolidColorBrush class with the specified
    // Color.
    //
    // Parameters:
    // color:
    // The color to apply to the brush.
    public SolidColorBrush(Color color);

    So the IDE gives all sorts of information. Good book?
     
  2. catalinacat

    catalinacat Well-Known Member Past Donor

    Joined:
    Mar 25, 2008
    Messages:
    6,922
    Likes Received:
    1,689
    Trophy Points:
    113
    Gender:
    Female
    Glad you started this thread Ctrl. I use Malwarebytes anti-malware to do a quick or full scan - if there is anything - it will tag it. I just use Microsoft security essentials for anti-virus program. I don't buy anti virus programs anymore.
     
  3. Hoosier8

    Hoosier8 Well-Known Member Past Donor

    Joined:
    Jan 16, 2012
    Messages:
    107,541
    Likes Received:
    34,488
    Trophy Points:
    113
  4. Mushroom

    Mushroom Well-Known Member

    Joined:
    Jul 13, 2009
    Messages:
    12,554
    Likes Received:
    2,454
    Trophy Points:
    113
    Gender:
    Male
    That is so true!

    I use Windows at home, my work computer is a Mac, and all of the thousands of computers I administer remotely from work every day are Ubuntu (Chrome and Chromium in some systems). And of all of those, our biggest nightmare is the Mac systems. But the CEO is a dedicated Machead, and refuses to allow us to use anything else in the shop.
     
  5. Kranes56

    Kranes56 Banned

    Joined:
    Feb 23, 2011
    Messages:
    29,311
    Likes Received:
    4,187
    Trophy Points:
    113
    Gender:
    Female
    This isn't so much a computer problem but coding. This is in Java. Say I have an object and I want to change an Array list in it, and swap it with another Object's Array list, would I need two seperate methods in order to do that?
     
  6. Toefoot

    Toefoot Well-Known Member Past Donor

    Joined:
    Jan 26, 2013
    Messages:
    6,058
    Likes Received:
    1,038
    Trophy Points:
    113
    Xmas gift x2, $299.00 Ipad mini 16 GB. Good for BS'ing?



    - - - Updated - - -

    Xmas gift x2, $299.00 Ipad mini 16 GB. Good for BS'ing?



     
  7. OverDrive

    OverDrive Well-Known Member Past Donor

    Joined:
    May 21, 2009
    Messages:
    11,990
    Likes Received:
    77
    Trophy Points:
    48
    Just passing on a little info about changing out your C: HDD

    My Dell laptop is 5 YO but have a lot of time/use on it and the mechanical HDD. Started to get "Boot Sector not found on Internal Hard Drive' error about 1/10 Boot up times and had to F2 out of it.

    Upgraded my RAM to 8 GB about 6 mos ago and so didnt want to buy a new laptop.

    And so I bought a $45 HDD off of Amazon and a $12 Caddy, temporarily swapped out my Opt DVD Drive with the caddy + new HDD installed and 'Cloned' my C: HDD using Macrium (Freeware Version). Then pulled out caddy and new HDD, installed old Opt DVD Drive and did a 'hot swap' with my new HDD and old c: HDD.

    Booted up, Win7 made a few changes and all worked fine: Firefox browser, etc. But the Windows programs gave me errors and wouldnt work: Win Live Mail, Windows Update, Windows Troubleshooter, and Windows Installer.

    What took me 1 1/2hrs to do clone/swap out, ended up taking me 5 more hours searching my probs until I discovered that my orig Win7 Hard Drive Controller wouldnt handle HDD's over 300 GB---old HDD was 220GB and I had installed a new 500 GB. Found an Intel download of the RAID (redundant array of independent disks) SATA AHCI Controller/Driver, downloaded, and all worked fine.

    This may save some others some heart burn and 5 more hours of effort!
     
  8. happy fun dude

    happy fun dude New Member

    Joined:
    Aug 7, 2010
    Messages:
    10,501
    Likes Received:
    68
    Trophy Points:
    0
    I have a question. Without me spending any money, do you know of a good registry repair/cleanup tool for Windows XP?
     
  9. Mushroom

    Mushroom Well-Known Member

    Joined:
    Jul 13, 2009
    Messages:
    12,554
    Likes Received:
    2,454
    Trophy Points:
    113
    Gender:
    Male
    I have actually never found any that really work worth a damn.

    The best is always just backing up your data and reinstalling a clean fresh copy.
     
  10. happy fun dude

    happy fun dude New Member

    Joined:
    Aug 7, 2010
    Messages:
    10,501
    Likes Received:
    68
    Trophy Points:
    0
    That is actually true.. Turns out, I am on a clean install. I just spent ages doing my backups, reformat, reinstallation, and now doing all the drivers, installs, updates, customizations etc... Have my computer perfect! For like a day.. Now Windows XP is tripping over itself again and I sure as hell don't want to reformat again. I want to be able to keep it clean and stable as she goes.

    I have the antivirus, I do my malware and virus scans, full updates, firewall, and just did a disk defragment.. Still the computer, with really decent specs, skyrockets to like 60-90% CPU usage all of a sudden and crashes up to the point that even ctrl-alt-del won't restart it.

    My last idea for a line of attack is the registry.
     
  11. Mushroom

    Mushroom Well-Known Member

    Joined:
    Jul 13, 2009
    Messages:
    12,554
    Likes Received:
    2,454
    Trophy Points:
    113
    Gender:
    Male
    I would also suggest just dumping XP, unless the computer is so old that it will not handle anything else.

    You are after all trying to work with a 13 year old operating system. Kind of like trying to use Windows 3.1 in 2005. It is possible yea, but who would want to? 4GB cap, single 32 bit processor only, almost 5 years since the OS was completely retired from support and updates. You really have taken this OS way beyond it's useful lifespan, and I would suggest it is time to give it up.

    And another thing occurs to me, have you checked the motherboard? If that is the era of your motherboard, this could likely be a physical issue as well. First look at the capacitors (little can looking things), and make sure none are bulging or leaking from the top. Then look for corrosion or contamination on the board. Next check the power supply with a tester (or simply replace it), an overvolting power supply can also cause issues like this.

    And also check the hard drive, bad sectors can also cause strange behavior as it tries to read the data from a sector that "barely passed" the checks during format and install.
     
  12. Nullity

    Nullity Active Member

    Joined:
    Sep 22, 2008
    Messages:
    2,761
    Likes Received:
    28
    Trophy Points:
    38
    CCleaner
     
  13. happy fun dude

    happy fun dude New Member

    Joined:
    Aug 7, 2010
    Messages:
    10,501
    Likes Received:
    68
    Trophy Points:
    0
    As I said, my specs are decent. The hardware's in fine shape as well; I only just put it together just now. It's 3.4 GHZ Pentium D dual, 3GB ram, and 1GB HD video.

    But you are right that Windows XP is quite the dinosaur. Although they still do updates, but the cuttoff where support end is April of this year. Speaking of Windows 3.1, I actually tried that, just for fun. Around the mid 00's I installed it to see how fast it would boot. Surprisingly, it wasn't as instant as I thought it would be. But it was fun just because the first time around, on our first computer which was a 386, it took about ten minutes to load!

    This os isn't by choice; I just can't afford another and might not be able to anytime soon. But the computer works now; thanks for your help.

    - - - Updated - - -

    I tried this; it's a lovely program!!! It found dozens of problems, fixed them, and now the computer runs like a charm! Thank you!
     
  14. Diuretic

    Diuretic Well-Known Member

    Joined:
    Jul 23, 2008
    Messages:
    11,481
    Likes Received:
    915
    Trophy Points:
    113
    Gender:
    Male
  15. Ctrl

    Ctrl Well-Known Member Past Donor

    Joined:
    Oct 11, 2008
    Messages:
    25,745
    Likes Received:
    1,944
    Trophy Points:
    113
    In a word... no. The registry is a hydra, and very little written for windows cleans itself up from the arterial spray it leaves all over... primarily because "doing it wrong" will break windows, so they just leave it alone save a few hooks. It is the aspect of windows I hate the most. The registry cleaners "fixers" out there do nothing useful or break stuff. That said, Ccleaner is a good tool. It doesn't really repair your registry, but is helpful in cutting down the clutter... but it is a bit like trying to use a broom to keep your feet dry in a stream. The registry is a digital hydra I tell you.

    What I do, is run windows inside of a virtual machine, tweak it how I like, and take a snapshot of it. The snapshot process takes seconds to create/load to, and you have a fresh install you are working from every time. This way I can run naked and fast through the internet, not really caring what gets infected because the entire OS is sandboxed on virtual hardware. A slightly more labor intensive way to do this would be to use Clonezilla, make an image of your drive after you have installed and tweaked it (about 25 min) and restore it when it starts getting yucky (about 15 min). Store data externally or on a different partition. I cannot recommend Clonezilla highly enough.

    CCleaner
    http://www.majorgeeks.com/files/details/ccleaner_standard.html
    Clonezilla
    http://www.majorgeeks.com/files/details/clonezilla.html

    Here is a little pic of me demonstrating why microsoft sucks just using their calculator. This is why you use rads with your floating points... otherwise you build an operating system that cannot do math. Oh... but the point is that that is XP running in a little virtual machine inside my linux desktop. You could also go nuts and build a bare metal hypervisor, but this exceeds your needs and should only be done for fun.

    [​IMG]

    Cheers.
     

Share This Page