Friday, September 30, 2016

Mac Apple Logo HD Wallpapers for Desktop

To save the image, first click to enlarge the image, then right-click on it and click on Save Image As.. or simply right-click on the thumbnail and click on Save Link AS..
Note: all are high resolution images greater than 1024 x 728 px.




Set-1 Set-2 Set -3

Shiny Mac HD WallpaperMac Logo Wallpaper With Black and White Shades


Scary Mac Logo Wallpaper
Sexy orange Mac Apple Wallpaper for DesktopMac Logo Wallpaper


Mac Hd Wallpaper With tiger Background
3D Mac Apple Logo WallpaperShaggy Mac Logo Desktop Wallpaper


Mac and Leopard Wallpaper
Cute Apple WallpaperAnother Mac Apple Logo Wallpaper

Set-1 Set-2 Set -3
Read More..

IT Laws and Patents notes for BSc IT Mumbai University

I got request for notes of IT Laws and Patents from many of the visitors. So i searched a lot on google and found out these articles. We can refer these articles as notes for IT Laws and Patents.
If anyone have a better notes than this, please feel free to share. It will benefit most of us.

Here are the download links for the files:
ITLAP-1
ITLAP-2
ITLAP-3
ITLAP-4

Friends, I have got lots of complaint that the links above are not working.
But its working for me, dont know whats the problem.
If same problem happens with you then, please comment below with your email id, ill forward it to you.
Read More..

PC Unique Lenovo IdeaCentre A600

images PC Unique Lenovo IdeaCentre A600

Who says a desktop PC to appear dull. Lenovo Idea Center A600 makes this view no longer valid. Lenovo IdeaCentre A600 does have a different view from most PCs. Brief even more similar to an LCD TV.

This is considering the screen size of this product has. Lenovo IdeaCentre A600 has a 21.5-inch LCD display. Dimensions are still fairly thin, also making it more similar to most LCD TVs. Was added with a wide screen display with 16:9 ratio.

He is equipped with a Blu-ray drives, digital TV tuner to watch and record live TV. Diguanakan operating system is Microsoft Vista Media Center, making it easier to support the ability mulitmedianya. His ability to display high definition mulitmedia file with Full HD resolution of 1920 x 1080, plus a complete audio system with subwoofer and Dolby Home Theater certification.

Was added with multifunction remote control, can act as a VoIP handset, wireless mouse and of course the remote control to control multimedia functions from a distance. With a choice of Intel Core 2 Duo processor, graphics card from ATI Radeon Lenovo IdeaCentre A600 an ideal choice for connoisseurs multimedai functions of a PC, which reportedly will be available starting in April 2009. For the price offered about $ 999.

you are interested to read this: Desktop All-In-One Dell Vostro and What about you : PC Unique Lenovo IdeaCentre A600
Read More..

Thursday, September 29, 2016

New Orkut Scripts – Scrap All Friends with Single Click! Send Images Flash Audio Video More!

This is latest scrapall script for new Orkut! And like feature packed new Orkut this script has some great features…



First and most important you can send HTML in scraps! This means you can scrap any image, flash, audio, video, etc to all your friends with one-click!


It has NO time interval field. Means this script will adjust with your Internet connection speed automatically!


It loads surprisingly very fast!


Here is a screenshot (if you have never seen a magic like this)



Installation:
Download Firefox! (Required)


Install GreaseMonkey Addon! (Click here within firefox only)


Click here to install script!


Go to: orkut.com/sa and you will see a page like shown in screenshot above
Read More..

Sawasdeee ka Voice Search




Typing on mobile devices can be difficult, especially when youre on the go. Google Voice Search gives you a fast, easy, and natural way to search by speaking your queries instead of typing them. In Thailand, Voice Search has been one of the most requested services, so we’re excited to now offer users there the ability to speak queries in Thai, adding to over 75 languages and accents in which you can talk to Google.

To power Voice Search, we teach computers to understand the sounds and words that build spoken language. We trained our speech recognizer to understand Thai by collecting speech samples from hundreds of volunteers in Bangkok, which enabled us to build this recognizer in just a fraction of the time it took to build other models. Our helpers are asked to read popular queries in their native tongue, in a variety of acoustic conditions such as in restaurants, out on busy streets, and inside cars.

Each new language for voice recognition often requires our research team to tackle new challenges, including Thai.
  • Segmentation is a major challenge in Thai, as the Thai script has no spaces between words, so it is harder to know when a word begins and ends. Therefore, we created a Thai segmenter to help our system recognize words better. For example: ????? can be segmented to ??? ?? or ?? ???. We collected a large corpus of text and asked Thai speakers to manually annotate plausible segmentations. We then trained a sequence segmenter on this data allowing it to generalize beyond the annotated data.
  • Numbers are an important part of any language: the string “87” appears on a web page and we need to know how people would say that. As with over 40 other languages, we included a number grammar for Thai, that tells you that “87” would be read as ??????????.
  • Thai users often mix English words with Thai, such as brand or artist names, in both spoken and written Thai which adds complexity to our acoustic models, lexicon models, and segmentation models. We addressed this by introducing ‘code switching’, which allows Voice Search to recognize when different languages are being spoken interchangeably and adjust phonetic transliteration accordingly.
  • Many Thai users frequently leave out accents and tone markers when they search (eg ??????? instead of ???????? OR ??????? instead of ????????) so we had to create a special algorithm to ensure accents and tones were restored in search results provided and our Thai users would see properly formatted text in the majority of cases.

We’re particularly excited that Voice Search can help people find locally relevant information, ranging from travel directions to the nearest restaurant, without having to type long phrases in Thai.

Voice Search is available for Android devices running Jelly Bean and above. It will be available for older Android releases and iOS users soon.


Read More..

CyberLink PowerDirector 12 Tutorials By PowerDirector University



Tutorials & demos of CyberLink PowerDirector 12 Ultimate.


SHARE BY GK
Computer Knowledge
Read More..

Wednesday, September 28, 2016

Space Wallpapers for your Desktop Set 1

To save the image, first click to enlarge the image, then right-click on it and click on Save Image As.. or simply right-click on the thumbnail and click on Save Link AS..
Note: all are high resolution images greater than 1024 x 728 px.

3D_Earth_Surface.jpg3D_Earth_over_Moon3D_Sunset

3d_space_1

cosmogony

3D_Earth_2

MOON

decollages

3D_Earth
Read More..

Pro Windows Phone App Development By Falafel Software Ebook

The Windows Phone 8 platform provides a remarkable opportunity for Windows developers to create state-of-the-art mobile applications using their existing skills and a familiar toolset. Pro Windows Phone App Development, Third Edition, helps you unlock the potential of this platform and create dazzling, visually rich, and highly functional applications for the Windows Phone Store and bring you up to speed on the new features the Windows Phone 8 API provides.

For developers new to the Windows Phone platform—whether with .NET, iOS, or Android experience—this book starts by introducing the requirements, specifications, and basics of Windows Phone development, and then leads you through the complete application development process, using an array of complementary technologies and Microsoft’s modern-style app design.
  • Use Microsoft technologies like XAML, .NET, Visual Studio 2012, and Expression Blend effectively to develop modern-style Windows Phone apps
  • Take advantage of the devices sensors with the location service, accelerometer, and touch
  • Make your apps location-aware using GPS data
  • Develop rich media applications that harness the graphics capabilities of Windows Phone models
  • Design and develop Windows Phone applications using the Model-View-ViewModel architecture
  • Publish and sell your application through the Windows Phone Store
Table of Contents
  • Introduction 
  • Getting Started
  • WinRT and XAML
  • Phone Controls
  • Navigation
  • Application Life Cycling
  • Gestures
  • Device Support
  • Mapping
  • Live Tiles & Notifications
  • Data Sources
  • Using Data in the Cloud
  • Designing in Expression Blend
  • Marketing Your Applications

Pro Windows Phone App Development Ebook




SHARE BY GK
Computer Knowledge
Read More..

The VES Handbook of Visual Effects Industry Standard VFX Practices and Procedures Ebook

Wisdom from the best and the brightest in the industry, this visual effects bible belongs on the shelf of anyone working in or aspiring to work in VFX. The book covers techniques and solutions all VFX artists, producers, and supervisors need to know, from preproduction, to digital character creation and compositing of both live-action and CG elements.

In-depth lessons on stereoscopic moviemaking, color management and digital intermediates are included, as well as chapters on interactive games and full animation authored by artists from EA and Dreamworks respectively. Written by 88 top leading visual effects practitioners and covering everything about visual effects from pre-production, production, and post-production.

Simply a must-have book for anyone working in or wanting to work in the VFX industry.


The VES Handbook of Visual Effects: Industry Standard VFX Practices and Procedures.




SHARE BY GK
Computer Knowledge
Read More..

Tuesday, September 27, 2016

Reverse the mouse buttons

1) No context menu

What will you see when you right click on the desktop? You will see a context menu which says arrange icons, refresh,..and so on. Are you angry at your friend for not wishing you for you Bday? Do you wanna play a trick on a newbie in your family who is new to computers? This is a cool trick to play. By this tweak, you will be able to disable the right click on the desktop or any icons/files/folders/applications... But right click will work on taskbar of the start button and registry. So, dont worry!!!
Open your registry and you will see all unknown files like HKEY_CLASSES_ROOT....... and so on. Dont panic. Follow this path. HKEY_CURRENT_USER>SOFTWARE>MICROSOFT>WINDOWS>CURRENT VERSION>POLICIES>EXPLORER. On the right side of the registry, you will see two files(in general) named default and NoDriveTypeAutoRun. Right click on the empty space in the registry and goto New>DWORD VALUE and name it as "NoViewContextMenu". Remember, no spaces and N,V,C,M should be capitals. Right click on this and click modify. The default value will be 0. Change it to 1. Note: DONOT CHANGE THE HEXADECIMAL TO DECIMAL. Click OK. Close your registry and logout. Bingo!!! Once you login again, right click wont work. Your friend will be perplexed and the next thing he/she does is call the system administrator not knowing that not all system administrators will be knowing about registry. Now, to enable it again. follow the same path and set the value to 0. Logout and then login to see the effect.

2) Reverse the mouse buttons
This is a cool trick to play on newbies. Actually, there are two ways to do this. One is changing the settings in the Control panel and the other is through editing registry. You can do it either way. But I prefer the second way, which is challenging.
(i) Through Control Panel - goto Start> Control Panel> Printers and other hardware> Mouse. In Button configuration, enable the switch primary and secondary buttons option and click OK. But remember, you have just swapped the mouse buttons. So, for OK, you have to click the right mouse button. The newbie will be perplexed. Well, this trick is good for left handers.
(ii) Editing the registry - By default the left mouse button is the primary and the right is secondary. Open your registry and follow this path:
HLEY_CURRENT_USER>Control Panel>Mouse and on the right side of the registry, create this String value(REG_SZ): SwapMouseButtons and set its value to 1. Bingo!!! You are done. Log out/Restart the computer.

You can try this: Combine tricks 1 and 2. That means, this will result in swapping of the mouse buttons and disabling the left click(once the buttons are swapped). User is ready to call system administrator cuz he feels that the system is behaving wildly.
Read More..

PowerShell v3 Get IP from HostName

This is a topic lots of folks have covered. I just revisited it and thought I would jot it down for posteritys sake. Note, I took the basic C# from this link:
Get IP Address from DNS Hostname in C#
Specifically, I just needed to know what the IPv4 address was, so, I used this approach:
([System.Net.Dns]::GetHostAddresses(www.bing.com)[0]).IPAddressToString;
Since there may be more than one IP Address, you need to deal with it as is appropriate in your case. Here, I just needed 1 address I could use for testing a public internet IP address. If you want to back up a step and look at the broader result set from the query, here is what you will get:
[System.Net.Dns]::GetHostAddresses(www.bing.com)

Address           : 601988312
AddressFamily     : InterNetwork
ScopeId           :
IsIPv6Multicast   : False
IsIPv6LinkLocal   : False
IsIPv6SiteLocal   : False
IsIPv6Teredo      : False
IPAddressToString : 216.156.225.35

Address           : 551656664
AddressFamily     : InterNetwork
ScopeId           :
IsIPv6Multicast   : False
IsIPv6LinkLocal   : False
IsIPv6SiteLocal   : False
IsIPv6Teredo      : False
IPAddressToString : 216.156.225.32
In this case, I simply took the lowest IP address (array index 0) and grabbed the IPAddressToString property.  The method, .GetHostAddresses, has the following definition:
[System.Net.Dns].GetMethod(GetHostAddresses)


Name                       : GetHostAddresses
DeclaringType              : System.Net.Dns
ReflectedType              : System.Net.Dns
MemberType                 : Method
MetadataToken              : 100671134
Module                     : System.dll
IsSecurityCritical         : True
IsSecuritySafeCritical     : True
IsSecurityTransparent      : False
MethodHandle               : System.RuntimeMethodHandle
Attributes                 : PrivateScope, Public, Static, HideBySig
CallingConvention          : Standard
ReturnType                 : System.Net.IPAddress[]
ReturnTypeCustomAttributes : System.Net.IPAddress[]
ReturnParameter            : System.Net.IPAddress[]
IsGenericMethod            : False
IsGenericMethodDefinition  : False
ContainsGenericParameters  : False
IsPublic                   : True
IsPrivate                  : False
IsFamily                   : False
IsAssembly                 : False
IsFamilyAndAssembly        : False
IsFamilyOrAssembly         : False
IsStatic                   : True
IsFinal                    : False
IsVirtual                  : False
IsHideBySig                : True
IsAbstract                 : False
IsSpecialName              : False
IsConstructor              : False
And, accepts the following parameters:
[System.Net.Dns].GetMethod(GetHostAddresses).GetParameters()


ParameterType   : System.String
Name            : hostNameOrAddress
DefaultValue    :
RawDefaultValue :
MetadataToken   : 134226623
Position        : 0
Attributes      : None
Member          : System.Net.IPAddress[] GetHostAddresses(System.String)
IsIn            : False
IsOut           : False
IsLcid          : False
IsRetval        : False
IsOptional      : False
This quick approach allows you to drop this one line call into scripts and get IP addresses you can use quickly and easily. 
Read More..

Could you fly a fighter jet with your mind

Jan Sheuermann can and she is quadriplegic, owing to a neurodegenerative disease. As part of Darpas Revolutionizing Prosthetics research track Jan was first trained to control a robotic arm with her mind alone and has recently been flying a F-35 Joint Strike Fighter (the US militarys next-generation attack jet) using a flight simulator. You can read more about this in a Wired article theres also a video.

from The Universal Machine http://universal-machine.blogspot.com/

IFTTT

Put the internet to work for you.

Delete or edit this Recipe

Read More..

Zuckerberg pledges 44 5 billion to charity

Facebook became more popular yesterday as its founder Mark Zuckerberg and his wife Priscilla Chan pledged 99% of their shares in Facebook to charity to mark the birth of their first child. These shares are currently valued at around $45 billion. This will leave the Zuckerberg family with a mere half billion dollars to scrape by on. Actually Im not being facetious, I commend Zuckerberg for his actions, nobody needs such a vast fortune and in the hands of well-run charities such huge sums of money can make a real difference. I hope more billionaires follow suit. When you use Facebook now you can know that you are helping make the world a better place.

from The Universal Machine http://universal-machine.blogspot.com/

IFTTT

Put the internet to work for you.

Turn off or edit this Recipe

Read More..

Windows 7 Hidden Theme

Computer Tips
 computer theme

windows 7- as soon as the user knows that windows 7- This is the default theme that already.Under the theme of Windows 7 - the custom wallpaper, sounds, icons, task-bar, etc. are arranged. A certain number of the theme you want to use any of the themes that are downloaded from the Internet. But you know your being aware of the location of the five theme categories are concealing your Windows PC! Yes, absolutely the truth. Now just a little  pain in my Windows 7 PC in 5minutes time. From the start  in the search bar: Windows Globalization MCT write.Now press  Enter. Then open a new window.“ll see five folders in a new window.Now that MCT-AU folder into the folder Theme - waited in AU. Theme-click Windows 7 - The theme will be installed in Australia. Similarly, one by one, MCT-CA, MCT-GB, MCT-US, MCT
-ZA folders respectively entered into the Theme folder CA. theme, GB. Theme, US. Theme and ZA.Theme folders click will install the remaining four themes on your PC. This theme is the theme of four in Canada, the United Kingdom, the United States and South Africa.
 
Read More..

NORAD tracks santa

Every Christmas eve the US air defence system (NORAD) swings into action to track Santas progress around the world delivering gifts to children. You can follow Santas progress on the official NORAD Santa Tracker website. The site also features information about Christmas holiday traditions, music, movies, a shop and games you can play, plus information about how and why NORAD tracks Santa - recommended.
Read More..

Monday, September 26, 2016

Averaging Congress Correctly

Today I saw another interesting article from the Huffington post that averaged the faces of all the members of congress together. You can find it here.

Unfortunately, its not a good averaging for many reasons Ill state below. So, I created my own, shown here:

I noticed a couple things about the Huffington Post image. It was a really cool idea, but it was extremely blurry so I investigated. It seems the website the creator got the images from has over 800 images for members of the house (Ill let you figure out what is wrong with that). It turns out it had a bunch of copies and black and white images mixed in. Also none of them were aligned. When averaging images, especially facial ones, it is always important to align them.

So I wrote a quick crawler in bash just to get the images from the wikipedia page for congress. Then I wrote some C++ code using OpenCV and my own modification of flandmark[1] to align the facial images. Once aligned, I then averaged them.

You can find the crawler code, the original and aligned images, and the alignment and averaging code on my Github at https://github.com/StevenHickson/AverageFaces. I used CMake, OpenCV, and Boost if you want to test it.

Feel free to use this image as long as you cite this page.

Update:
I was asked who was the closest and furthest away from the mean. The results are as follows:
Closest to the mean (left being the closest):

Stephen Fincher
John Shimkus
Xavier Becerra












....
Furthest from the mean (left being the furthest):

Terri A. Sewell
Corrine Brown
Betty McCollum

Consider donating to further my tinkering.

Places you can find me

[1] M. Uricar, V. Franc and V. Hlavac, Detector of Facial Landmarks Learned by the Structured Output SVM, VISAPP 12: Proceedings of the 7th International Conference on Computer Vision Theory and Applications, 2012.

Read More..

Introduction to Expression Web 4 Tutorials By Joshua Kywn



In this series you will learn to use Microsoft Expression Web to create a clean and professional looking website ideal for a small business or personal project or for an individual looking to learn the basics of web design.

If you are interested in getting the training materials used in our videos and our template collection, you can find out how at: www.timothywebtemplates.net These are optional, you can type in the code as we go and use your own resources to complete the project.

To receive our web designers discount from Godaddy on domains and webhosting, please visit:http://timothywebtemplates.net/godaddy/godaddy.html


SHARE BY GK
Computer Knowledge
Read More..

PowerShell v3 in a Year Day 10 about Data Sections

Data sections are a PowerShell technique, included since version 2.0, which provides script writers with a powerful technique to separate out code from data. This approach to distinguishing between the two has a long history in other languages, but, in the PowerShell world, falls into a few specific niches. In practice, there are also a few ways to pull it off, yet, aside from some on-the-box Microsoft scripts, there is not a lot of discussion about their usage. After having experimented with data sections a little, I felt some of the gotchas and caveats I ran into may be worth sharing so others dont try to reinvent the same wheel I hacked on.

Data sections, as outlined in the v3 help, are read-only, text strings separated from script logic. Data sections can be stored both in the same file as a script and in a separate file with a .psd1 extension. One compelling reason to separate out data from code is to allow for messages in various languages and/or updatable context-specific data. A specific scenario in which data sections proves useful is code signing. If you have a script for which the logic is complete, but, you need to update the message, you would not need to modify the script which would prompt a script resigning. Instead, you could simply update the .psd1 files strings and the modification would be taken care of.

The general syntax for using a data section is to begin a section with the required DATA keyword., followed by two items:
  1. -SupportedCommand
  2. Script block containing permitted content
Note that the keyword, DATA, is not case sensitive, so, you can use any of data, Data, or, DATA. Within the block one may use two specific elements:
  1. Any/all PowerShell operators except -match
  2. Flow control statements: if, else and elseif
  3. The following automatic variables:
    1. $PsCulture
    2. $PsUICulture
    3. $True
    4. $False
    5. $Null
  4. Comments
  5. Pipelines
  6. Statements separated by semicolons
  7. litearls
  8. Cmdlets permitted in the data section (default is ConvertFrom-StringData)
  9. Cmdlets explicitly indicated by -SupportedCommand parameter
The one outstanding, default cmdlet, ConvertFrom-StringData, allows the use of single and double-quoted strings in key/value pairs as well as here strings, also, available in both single and double-quoted string formats. 

To demonstrate how these work, here are some examples. In this first example, we will look at a sample data section contained in the same script in which the data is referenced. This is the "all in one" approach.
$TextMsgs = DATA {
    ConvertFrom-StringData-stringdata @
      Text001 = Windows 7
      Text002 = Windows Server 2008 R2
@
}

$TextMsgs.Text001
When I execute this command Powershell converts the key/value pairs in the here string to properties on my $TextMsgs object so I can call the key. In this case, I call the .Text001 property and PowerShell prints out Windows 7.

In our second example, we use a simple DATA section with strings (but no keys). In this case, you need to reference the strings using zero-based, array notation, as shown below:
$strings = DATA {
    "Thank you for using my Windows PowerShell Organize.pst script."
    "It is provided free of charge to the community."
    "I appreciate your comments and feedback."
}

$strings[0]
which prints out  Thank you for using my Windows PowerShell Organize.pst script. when executed. In essence, you are looking at either dealing with arrays (as in the previous example) or hashtables (the first example). In either case, these are effective ways to get data and code broken out into separate segments.

The second type of use for data sections is with psd1 file (PowerShell data files I presume the acronym to be). To get an idea of where this really fits in, we need to glance briefly at another concept: script internationalization. For enterprise packages, that is PowerShell solutions provided to multiple languages, the code/logic of scripts works the same regardless of the language in which the script is run. What changes, however, are the messages to the end user. While I was originally researching this topic I was looking for ways to handle large text blocks simply and easily. One of the concepts I stumbled upon was the use of locations, otherwise known as code pages, to associate .psd1 file content with scripts.

In my example, I created two files:
  1. test.ps1
  2. test.psd1
The first file performs a few, quick steps:
  1. Clear the host
  2. Call the Import-LocalizedData cmdlet with two parameters: -FileName (referencing a file in the same directory called test.psd1) and -BindingVariable (with a value of Test).
  3. Outputs $Test.Values
The second file, test.psd1, is our "data" file. This is the second approach, where data and code are separated into two distinct files, one, the .ps1 file, containing script code, and, the other, the .psd1 file, containing the raw data. In this model, where the data section is in its own file, the key/value pair is stored as shown below:
ConvertFrom-StringData @
    name=A long string
@
When I execute the .ps1 script I see the following in the console:
 A long string
Heres whats going on:
  1. The host runs the test.ps1 files first command: Clear-Host. This wipes the host clean.
  2. Line 2 calls the Import-LocalizedData cmdlet. This references the test.psd1 denoted by the -FileName argument and converts the string into a key/value pair associated with the variable $Test specified as the -BindingVariable argument.
  3. Control is passed back to the test.ps1 script and Write-Output prints the value of $Test.name, A long string
While my test scenario proves helpful as a proof of concept the real application of this idea comes into play only when you start employing various cultures. For instance, if you are writing scripts for multiple cultures, PowerShell references the code page of your machine, and, utilizes that code pages .psd1 file. This is how the dynamic aspects of the language really take advantage of the concept. 

One thing I saw that looked interesting, but, which I didnt take time to test, is the creation of custom cmdlets. For instance, in the help, there is a hypothetical custom cmdlet, Format-Xml, that is referenced in the -SupportedCommand parameter, to utilize a set of strings indicated in the data section of a separate here string. A custom function is more likely a use case I could envision myself taking advantage of, but, even then, I dont have a solid example to illustrate the proper use of -SupportedCommand with the data section concept. 

If you want some sample .psd1 files to check out, below is a list of directories which contain CL_LocalizationData.psd1 files on my default Windows 7 Enterprise installation. Most any Windows 7 machine should have similar instances of these files for you to explore:
  • C:WindowsdiagnosticssystemPrinteren-US
  • C:WindowsdiagnosticssystemSearchen-US
  • C:WindowsdiagnosticssystemWindowsMediaPlayerConfigurationen-US
  • C:WindowsdiagnosticssystemWindowsMediaPlayerMediaLibraryen-US
  • C:WindowsdiagnosticssystemWindowsUpdateen-US
There are plenty of other directories with similar .psd1 files. For instance, tehre are some RS_* file you can check out that have similar sets of single-quoted here strings in the secondary, date files. In both cases, you just need to look around at a few of them. Unfortunately, for script writers, most of these files reference compiled assemblies instead of scripts or script modules. In short, you wont see a lot of on-the-box references to give you sample code for reference materials in the way of .ps1 files. 

One thing that is interesting to see is the use of format place holders. The idea here is that you can leave one (or more) placeholders to be dynamically evaluated at run time. If you have a piece of data to be parsed by the script, you simply indicate the place holder with standard format string specifier, "{0}", within a double-quoted here string (to ensure evaluation) and voila, self-updating data sections. Here is an example using a single-page approach (where the data section is defined in the same code as it is used.
$data = ConvertFrom-StringData @"
    HostName=The hostname of this machine is: {0}.
"@

$data.HostName -f $env:COMPUTERNAME 
When this is run, I get the following output:
 The hostname of this machine is: MYLAPTOP.
Again, the mechanics here are:
  1. The $data object is populated with a key/value pair generated by the ConvertFrom-StringData cmdlet.
  2. $data.HostName uses the -f (format operator) to pass the evaluated value of $env:COMPUTERNAME to the {0} placeholder.
  3. {0} is replaced with MYLAPTOP and the entire string is output to the host. 
In the end, the use of data sections can provide a powerful, easy to use separation of code and data. If you find that your scripts remain stable while, perhaps, your messages change frequently, or, you need to consider branding with your PowerShell scripts, data sections may be worth taking a look at to see how you can take advantage of the idea.
Read More..

XP Animations

You can turn off window animation ("exploding" windows), displayed when you play around with minimizing/maximizing open windows. This makes navigating Windows 95/98/ME/NT4/2000/XP a lot quicker, especially if you dont have a fast video controller, or if you got tired of seeing it all the time (like I did). smile.gif To do this,
run Regedit (or Regedt32) and go to: HKEY_CURRENT_USER Control Panel Desktop WindowMetrics or if you are the only user of your Windows computer
go to: HKEY_USERS .Default Control Panel Desktop WindowMetrics Right-click on an empty spot in the right hand pane.
Select New -> String [REG_SZ] Value. Name it MinAnimate. Click OK. Double-click on "MinAnimate" and type 0 to turn OFF window animation or 1 to turn it ON. Click OK. Close the Registry Editor and restart Windows. Done.
Read More..

Streaming Other HD Video Sites on the Raspberry PI



For those that are interested, this will allow you to stream internet shows like The Daily Show on your Raspberry Pi in HD with no lag.

A week or so ago I posted a hack which allowed people to stream youtube videos in the browser here. Unfortunately, this same method didnt work out of the box for some other video sites. They would stream a couple seconds then just end (I found this to happen with the daily show).



I now have a fix for that and have a script called youtube-safe, which can stream (high-quality with no lag on a decent internet connection) any video site that works with youtube-dl.

If you already have the Youtube scripts in my PiAUISuite installed, you can just update, otherwise you have to go through the install script and select which parts you want (this one being under youtube).

Install Instructions


sudo apt-get install git-core
git clone git://github.com/StevenHickson/PiAUISuite.git
cd PiAUISuite/Install/
./InstallAUISuite.sh

**NOTE, this will ask you if you want to install a lot of different scripts because it is a SUITE. You only have to pick the ones you want to use. If you only want to use the youtube scripts, press n on any other question except for the dependencies and youtube.

Update Instructions 

cd PiAUISuite
git pull
cd Install
sudo ./UpdateAUISuite.sh



Once that is done, you can watch the daily show in 1080p like so:
youtube-safe "http://www.thedailyshow.com/full-episodes/"

Even better, if you have voicecommand installed on your system, add the following line to the bottom of your config file for it to play the newest daily show with your voice:
~Daily Show==youtube-safe "http://www.thedailyshow.com/full-episodes/"

Ill work on making a browser plugin for this as well.

Consider donating to further my tinkering


Places you can find me
Read More..

PowerShell v2 Generate Files from Single Doc Based on Header

This one is hard to title accurately. We have raw reports in a single file that are broken up by "headers". This can mean different things to different people, but, in my case, it was something I could test for.  So, in my initial design of the script I started looking for a regular expression.  Yet, after putting something on the forums, Justin Rich helped me come up with a simple way to handle the scenario.
$txtpath = C:PowershellProjectsCreateReports eport.txt
Get-Content $txtpath |
ForEach-Object {
      if($_ -match DEFAULT)
      {
            $filepath = Join-Path -Path (Split-Path $txtpath) -ChildPath (($_ -split )[3] + .dat)
            $_ | Out-File -FilePath $filepath -Encoding ASCII -Force
      }
      else
      {
            $_ | Out-File -FilePath $filepath -Encoding ASCII -Append -Force
      }
}
The break down of this script is as follows:

  1. line 1: $txtpath indicates the path to the file I want to parse.
  2. line 2: Get-Content from file at $txtpath and pass to the pipeline.
  3. line 3: Since Get-Content will return an array of strings I use Foreach-Object to parse each one
  4. line 4: Test to see if the current line matches DEFAULT. This is my page break.
  5. line 6: Set the filepath based on the original files directory path and a substrings value in the current line.
  6. line 7: Write the current line to the file. Using -Force overwrites existing files. In my case, this was fine.
  7. line 11: Write all other lines to the same file with -Append so as to not keep overwriting with a single line at a time. Again, -Force is used to ensure previous files are overwritten.
Read More..

PowerShell v3 in a Year Day 12 Get Random

Get-Random was one of those cmdlets I knew about, but, had never really looked at. This is precisely why I wanted to do this "in a Year" exercise...it forces me to learn about things I thought I knew but had never really examined. At any rate, Get-Random, as the help outlines, performs two distinct and deterministic functions: 1) gets a random number or 2) selects objects randomly from a collection. In the end, you will end up with a single item: a number or an collection member. Digging a little deeper than this, however, there are lots of ways to use Get-Random. I will explore a few of them, along with some interesting examples from the help.

As further noted in the help, "The Get-Random cmdlet gets a randomly selected number. If you submit a collection of objects to Get-Random, it gets one or more randomly selected objects from the collection.Without parameters or input, a Get-Random command returns a randomly selected 32-bit unsigned integer between 0 (zero) and Int32.MaxValue (0x7FFFFFFF, 2,147,483,647)."

There are two parameter sets for Get-Random:

  • Get-Random [[-Maximum] <Object>] [-Minimum <Object>] [-SetSeed <Int32>] [<CommonParameters>]
  • Get-Random [-InputObject] <Object[]> [-Count <Int32>] [-SetSeed <Int32>] [<CommonParameters>]

Looking at the parameters one by one we have the following for the first parameter set. The first parameter set is the one which focuses on usage with numbers.
  • Maximum: indicates a random maximum value for the randomized selection. There are a lot of little subrules.
    • On a 32-bit computer, the default maximum is a 32-bit integer.
    • On a 64-bit computer, you can also enter a 64-bit integer.
    • The max must be greater than the min.
    • If the value of Maximum or Minimum is a floating-point number, Get-Random returns a randomly selected floating-point number. 
    • If the value of Minimum is a double (a floating-point number), the default value of Maximum is Double.MaxValue. Otherwise, the default value is Int32.MaxValue.
    • On a 64-bit computer, if the value of Minimum is a 32-bit integer, the  default value of Maximum is Int32.MaxValue. 
    • If the value of Minimum is a double (a floating-point number), the default value of Maximum is Double.MaxValue. Otherwise, the default value is Int64.MaxValue.
  • Minimum: as with the maximum value, there are a few things to keep in mind:
    • Enter a 32-bit integer or a double-precision floating-point number, or an object that can be converted to an integer or double, such as a numeric string ("100"). 
    • On a 64-bit computer, you can enter a 64-bit integer. 
    • The default value is 0 (zero).
    • The value of Minimum must be less than (not equal to) the value of Maximum. 
    • If the value of Maximum or Minimum is a floating-point number, Get-Random returns a randomly selected floating-point number.
  • SetSeed: Specifies a seed value for the random number generator. 
    • This seed value is used for the current command and for all subsequent Get-Random commands in the current session until you use SetSeed again or close the session. 
    • You cannot reset the seed to its default, clock-based value.
    • The SetSeed parameter is not required. 
    • By default, Get-Random uses the system clock to generate a seed value.
    • Because SetSeed results in non-random behavior, it is typically used only when trying to reproduce behavior, such as when debugging or analyzing a script that includes Get-Random commands.
The second parameter set focuses on collections. It allows you to randomly select an item at random. Below are the parameters for this second parameter set:

  • InputObject: Specifies a collection of objects. 
    • Get-Random gets randomly selected objects in random order from the collection.
    • Enter the objects, a variable that contains the objects, or a command or expression that gets the objects. 
    • You can also pipe a collection of objects to Get-Random.
  • Count: Determines how many objects are returned. 
    • The default is 1. 
    • If the value of Count exceeds the number of objects in the collection, Get-Random returns all of the objects in random order.
  • SetSeed: Specifies a seed value for the random number generator. 
    • This seed value is used for the current command and for all subsequent Get-Random commands in the current session until you use SetSeed again or close the session. 
    • You cannot reset the seed to its default, clock-based value.
    • The SetSeed parameter is not required. 
    • By default, Get-Random uses the system clock to generate a seed value.
    • Because SetSeed results in non-random behavior, it is typically used only when trying to reproduce behavior, such as when debugging or analyzing a script that includes Get-Random commands.
These two parameter sets allow you to work with the pair of options you need to take advantage of the cmdlet. Lets look at some examples:
  1. Get-Random, by itself, returns a number: 808892034.
  2. With -Maximum it returns a number between 0 and the number one less than the value of your maximum: Get-Random -Maximum 10 returns 4.
  3. When using -Maximum and -Minimum parameters, you get a number within the range specified by these values. Get-Random -Maximum 10 -Minimum 7 returns 8.
  4. Using floating-point numbers instead of integers causes the cmdlet to return a floating-point number. Calling Get-Random -Maximum 9.99 -Minimum 1.0 returns 5.80022345944784.
  5. If you want to select a random number from a collection you can:
    1. Pipe a collection to Get-Random: 1, 3, 5 | Get-Random returns 3.
    2. Pipe a collection to Get-Random: 1, 3, 5 | Get-Random -Count 2 returns 1, 5.
    3. Pipe a set of files to Get-Random to get files: dir C:windows | Get-Random -Count 10
  6. Use SetSeed to indicate a fixed value per session: Get-Random -SetSeed 10. This will return the same value so long as you keep the same session open.
While I dont personally have a need for randomized values often, I did learn a good bit about this cmdlet by reading through the help. Being able to pipe a collection to Get-Random is a useful way to run a PowerShell User Group book lottery. Not that anyone I know had done anything like that...no, never (http://import-powershell.blogspot.com/2012/03/prize-drawing.html).
Read More..
 
Copyright 2009 Information Blog
Powered By Blogger