Tuesday 23 December 2014

wxpython tutorial

Hello All,

I put wxPython code for various basic function.I hope,It will be very helpful for wxPython beginner.I put here code with comment (#,""") so you can check each and every portion of code.I request you to uncomment code portion according to your requirements.

You can download wxPython from below link

http://www.wxpython.org/download.php

You can also download "wxpython in action" book in pdf format

Click on below link

Download Now


You can run code with python filename.py on terminal.





#!/usr/bin/env python
import wx
class bucky(wx.Frame):

 def __init__(self,parent,id):
  wx.Frame.__init__(self,parent,id,"Window",size=(300,200))
  panel=wx.Panel(self)
#  button=wx.Button(panel,label="Exit",pos=(130,50),size=(60,60))
#  button1=wx.Button(panel,label="Start",pos=(70,50),size=(60,60))
#  self.Bind(wx.EVT_BUTTON,self.startbutton,button1)
#  self.Bind(wx.EVT_BUTTON,self.closebutton,button)
#  self.Bind(wx.EVT_CLOSE,self.closewindow)
  
  status=self.CreateStatusBar()
  menubar=wx.MenuBar()
  first=wx.Menu()
  second=wx.Menu()
  first.Append(wx.NewId(),"New Window","This is a new window")
  first.Append(wx.NewId(),"open..","This is a new window open")
  menubar.Append(first,"File") 
  menubar.Append(second,"Edit")
  self.SetMenuBar(menubar)
  
#For message dialog box
#  box=wx.MessageDialog(None,'Do i have best tuts?','Title',wx.YES_NO)  #wx.OK
#  answer=box.ShowModal()
#  box.Destroy() 

#  box=wx.TextEntryDialog(None,"What uy Name?","Name","Enter Name")
#  if box.ShowModal()==wx.ID_OK:
#   answer=box.GetValue()
#  box.Destroy()


#  box=wx.SingleChoiceDialog(None,'Favourite food?','Food',['Gujarati','Panjabi','south'])
#  if box.ShowModal==wx.ID_OK:
#   answer=box.GetStringSelection()
  
  '''choices = ["Alpha", "Baker", "Charlie", "Delta"]
  dialog = wx.SingleChoiceDialog(None, "Pick A Word", "Choices",choices)
  if dialog.ShowModal() == wx.ID_OK:
      print "You selected: %s\n" % dialog.GetStringSelection()
  dialog.Destroy()'''

  '''wx.StaticText(panel,-1,"This is static text",(10,10),(260,-1),wx.ALIGN_CENTER)
  
  custom=wx.StaticText(panel,-1,"This is custom",(10,30))
  custom.SetForegroundColour('blue')
  custom.SetBackgroundColour(wx.Colour(0,0,255))

  test=wx.TextEntryDialog(None,"What ur name?",'Title')
  if test.ShowModal()==wx.ID_OK :
   apples=test.GetValue()
  wx.StaticText(panel,-1,apples,(10,50))'''

  '''pic=wx.Image("/home/dhaval/Downloads/Be_Better.bmp",wx.BITMAP_TYPE_BMP).ConvertToBitmap()
  self.button=wx.BitmapButton(panel,-1,pic,pos=(10,10))
  self.Bind(wx.EVT_BUTTON,self.doMe,self.button)
  self.button.SetDefault()

 def doMe(self,event):
  self.Destroy()'''

  '''slider=wx.Slider(panel,-1,1,1,100,pos=(10,10),size=(250,-1),style=wx.SL_AUTOTICKS | wx.SL_LABELS)
  slider.SetTickFreq(5,1)'''

  
  '''spinner=wx.SpinCtrl(panel,-1,"",(40,40),(90,-1))
  spinner.SetRange(1,100)
  spinner.SetValue(10)'''

  
  '''wx.CheckBox(panel,-1,"Intel",(20,20),size=(160,-1))
  wx.CheckBox(panel,-1,"PowerPC",(20,40),size=(160,-1))
  wx.CheckBox(panel,-1,"ARM",(20,60),size=(160,-1))'''


  '''mylist=['Intel','PowerPC','ARM','Motorola']
  cnt=wx.ListBox(panel,-1,(20,20),(100,100),mylist,wx.LB_SINGLE)
  cnt.SetSelection(0)'''


  
  


 '''def startbutton(self,event):
  print "Hello Start"
 def closebutton(self,event):
  self.Close(True)
 def closewindow(self,event):
  self.Destroy()''' 

 
if __name__=='__main__':
 app=wx.PySimpleApp()
 frame=bucky(parent=None,id=-1)
 frame.Show()
 app.MainLoop()#!/usr/bin/env python
import wx
class bucky(wx.Frame):

 def __init__(self,parent,id):
  wx.Frame.__init__(self,parent,id,"Window",size=(300,200))
  panel=wx.Panel(self)
#  button=wx.Button(panel,label="Exit",pos=(130,50),size=(60,60))
#  button1=wx.Button(panel,label="Start",pos=(70,50),size=(60,60))
#  self.Bind(wx.EVT_BUTTON,self.startbutton,button1)
#  self.Bind(wx.EVT_BUTTON,self.closebutton,button)
#  self.Bind(wx.EVT_CLOSE,self.closewindow)
  
  status=self.CreateStatusBar()
  menubar=wx.MenuBar()
  first=wx.Menu()
  second=wx.Menu()
  first.Append(wx.NewId(),"New Window","This is a new window")
  first.Append(wx.NewId(),"open..","This is a new window open")
  menubar.Append(first,"File") 
  menubar.Append(second,"Edit")
  self.SetMenuBar(menubar)
  

#  box=wx.MessageDialog(None,'Do i have best tuts?','Title',wx.YES_NO)  #wx.OK
#  answer=box.ShowModal()
#  box.Destroy() 

#  box=wx.TextEntryDialog(None,"What uy Name?","Name","Enter Name")
#  if box.ShowModal()==wx.ID_OK:
#   answer=box.GetValue()
#  box.Destroy()


#  box=wx.SingleChoiceDialog(None,'Favourite food?','Food',['Gujarati','Panjabi','south'])
#  if box.ShowModal==wx.ID_OK:
#   answer=box.GetStringSelection()
  
  '''choices = ["Alpha", "Baker", "Charlie", "Delta"]
  dialog = wx.SingleChoiceDialog(None, "Pick A Word", "Choices",choices)
  if dialog.ShowModal() == wx.ID_OK:
      print "You selected: %s\n" % dialog.GetStringSelection()
  dialog.Destroy()'''

  '''wx.StaticText(panel,-1,"This is static text",(10,10),(260,-1),wx.ALIGN_CENTER)
  
  custom=wx.StaticText(panel,-1,"This is custom",(10,30))
  custom.SetForegroundColour('blue')
  custom.SetBackgroundColour(wx.Colour(0,0,255))

  test=wx.TextEntryDialog(None,"What ur name?",'Title')
  if test.ShowModal()==wx.ID_OK :
   apples=test.GetValue()
  wx.StaticText(panel,-1,apples,(10,50))'''

  '''pic=wx.Image("/home/dhaval/Downloads/Be_Better.bmp",wx.BITMAP_TYPE_BMP).ConvertToBitmap()
  self.button=wx.BitmapButton(panel,-1,pic,pos=(10,10))
  self.Bind(wx.EVT_BUTTON,self.doMe,self.button)
  self.button.SetDefault()

 def doMe(self,event):
  self.Destroy()'''

  '''slider=wx.Slider(panel,-1,1,1,100,pos=(10,10),size=(250,-1),style=wx.SL_AUTOTICKS | wx.SL_LABELS)
  slider.SetTickFreq(5,1)'''

  
  '''spinner=wx.SpinCtrl(panel,-1,"",(40,40),(90,-1))
  spinner.SetRange(1,100)
  spinner.SetValue(10)'''

  
  '''wx.CheckBox(panel,-1,"Intel",(20,20),size=(160,-1))
  wx.CheckBox(panel,-1,"PowerPC",(20,40),size=(160,-1))
  wx.CheckBox(panel,-1,"ARM",(20,60),size=(160,-1))'''


  '''mylist=['Intel','PowerPC','ARM','Motorola']
  cnt=wx.ListBox(panel,-1,(20,20),(100,100),mylist,wx.LB_SINGLE)
  cnt.SetSelection(0)'''


  
  


 '''def startbutton(self,event):
  print "Hello Start"
 def closebutton(self,event):
  self.Close(True)
 def closewindow(self,event):
  self.Destroy()''' 

 
if __name__=='__main__':
 app=wx.PySimpleApp()
 frame=bucky(parent=None,id=-1)
 frame.Show()
 app.MainLoop()

verilog code for D flip-flop async reset

Verilog code for D flip-flop async reset


module dff_async_reset (
data  , // Data Input
clk    , // Clock Input
reset , // Reset input 
q         // Q output
);
//-----------Input Ports---------------
input data, clk, reset ; 

//-----------Output Ports---------------
output q;

//------------Internal Variables--------
reg q;

//-------------Code Starts Here---------
always @ ( posedge clk or negedge reset)
if (~reset) begin
  q <= 1'b0;
end  else begin
  q <= data;
end

endmodule //End Of Module dff_async_reset




VERILOG CODE FOR D flip-flop sync reset

verilog code for D flip-flop sync reset

Verilog code For  D flip-flop sync reset


module dff_sync_reset (
data   , // Data Input
clk    , // Clock Input
reset  , // Reset input
q        // Q output
);
//-----------Input Ports---------------
input data, clk, reset ; 

//-----------Output Ports---------------
output q;

//------------Internal Variables--------
reg q;

//-------------Code Starts Here---------
always @ ( posedge clk)
if (~reset) begin
  q <= 1'b0;
end  else begin
  q <= data;
end

endmodule //End Of Module dff_sync_reset

Monday 15 December 2014

Are you smart enough to work at Google - answers pdf

One has to be very smart if he or she has to get into Google. It isn’t an easy task and the questions asked at the interview require extremely intelligent answers.
Summary of the Book
Do you want to get into Google or any of the other big organizations? This book will show you how you can achieve this and give them the kind of answers they expect in the interviews. If you have an interview with Google coming up, then you can be sure that you’re in soup if you don’t know more than you already know. The market today has place only for the best among the best. This book will reveal to the reader all the questions that are being asked in major interviews today. Big companies are going to great levels to make sure that they get only the best employees and nothing less. The author, William Poundstone, guides you through solutions for some of the most challenging questions and conundrums presented to you in interviews. It shows you the importance of creative thinking, how your Facebook page plays a role in your selection process, and what really goes on inside Google.
Are You Smart Enough to Work at Google?
Fiendish Puzzles and Impossible Interview Questions
from the World’s Top Companies

By- William Poundstone

Download Answers Which is asked in this Book

https://drive.google.com/file/d/0B-V3GbGzucNNeldPb2R4WUVhNzA/view?usp=sharing

Wednesday 10 December 2014

download Ubuntu 14.10

Introduction

These release notes for Ubuntu 14.10 (Utopic Unicorn) provide an overview of the release and document the known issues with Ubuntu 14.10 and its flavors.

Support lifespan

Ubuntu 14.10 will be supported for 9 months for Ubuntu Desktop, Ubuntu Server, Ubuntu Core, Kubuntu, Ubuntu Kylin along with all other flavours.

Official flavour release notes

Find the links to release notes for official flavors here.

Get Ubuntu 14.10

Download Ubuntu 14.10

Images can be downloaded from a location near you.
You can download ISOs from:

Upgrading from Ubuntu 14.04 LTS

To upgrade on a desktop system:
  • Open the "Software & Updates" Setting in Systemsettings.
  • Select the 3rd Tab called "Updates".
  • Set the "Notify me of a new Ubuntu version" dropdown menu to "For any new version".
  • Press Alt+F2 and type in "update-manager" (without the quotes) into the command box.
  • Update Manager should open up and tell you: New distribution release '14.10' is available.
  • Click Upgrade and follow the on-screen instructions.
To upgrade on a server system:
  • Install the update-manager-core package if it is not already installed.
  • Make sure the /etc/update-manager/release-upgrades is set to normal.
  • Launch the upgrade tool with the command sudo do-release-upgrade.
  • Follow the on-screen instructions.
Note that the server upgrade will use GNU screen and automatically re-attach in case of dropped connection problems.
There are no offline upgrade options for Ubuntu Desktop and Ubuntu Server. Please ensure you have network connectivity to one of the official mirrors or to a locally accessible mirror and follow the instructions above.

New features in 14.10

Please see the Utopic blueprint list for details.
Please test and report any bugs you find:

Updated Packages

As with every new release, packages--applications and software of all kinds--are being updated at a rapid pace. Many of these packages came from an automatic sync from Debian's unstable branch; others have been explicitly pulled in for Ubuntu 14.10.
For a list of all packages being accepted for Ubuntu 14.10, please subscribe to utopic-changes.

Linux kernel 3.16

The Ubuntu 14.10 release delivers a v3.16 based kernel. This brings a significant number of bug fixes and new hardware support including expanded architecture support for Power 8 and arm64 platforms. It also includes support for Intel Cherryview, Haswell, Broadwell and Merrifield systems, and initial support for Nvidia GK20A and GK110B GPU’s. There is improved graphics performance on many Nvidia, Intel and ATI Radeon devices and also audio improvements with support for the Radeon .264 video encoder. Expanded platform support is enabled via support for 64 bit EFI boot on 32 bit EFI BIOS. This release also brings performance improvements in suspend/resume times.
For developers we see significant improvements in tracing and debugging with new triggers for kernel trace points, and expansion of uprobe support. This release also brings a new experimental deadline CPU scheduler.
For servers we see better support for bursty workloads, improved resident set tracking, and a better NUMA migration strategy. Filesystem support is also improved with faster file allocations for database use and several filesystems show performance improvements including XFS and Btrfs. XFS now has stabilized its v5 format and sports expanded direct I/O support. Btrfs now supports per directory switchable compression modes. raid5 performance is also improved. This release also brings improvements to networking, including a new packet scheduler for high latency links, and efforts to bring IPv6 support in line with IPv4. We see performance improvements for openvswitch and VTI tunneling. As always, various new pieces of hardware are now supported including Intel AVX-512 and Intel MXP.
On cloud we see Hyper-V, XEN, and KVM networking performance improvements. Hyper-V now supports the hypervisor driven file copy and reference time services. For KVM we see improved support for passing through new x86 vector instructions.
On the security front we see full Kernel Address Space Layout Randomisation applied to the kernel and its modules, plus the closure of a number of information leaks in /proc. We also see additional support for cryptographic devices.

AppArmor

AppArmor added support for fine-grained mediation of unix(7) abstract and anonymous sockets and also added various policy updates and bug fixes. AppArmor policy has been adjusted for packages that ship it to work with these changes, but local policy may need to be adjusted unix rules. Seeman 5 apparmor.d for details.

Oxide

Oxide has been updated to use the latest Chromium Content API and includes numerous bug fixes and features to better support webbrowser-app, webapps and apps using UbuntuWebViews. Oxide is a webview based on Chromium to deliver web content. Oxide allows us to better support 3rd party developers and applications within the Ubuntu archive by providing a fast, secure and up to date webengine library for the duration of this release. While other web content libraries such as those based on webkit are available, their maintenance will be limited to new upstream minor version releases only, and application developers are encouraged to use Oxide instead.

Ubuntu Desktop

The general theme for 14.10 on the desktop is one of bug fixes and incremental quality improvements.

Unity

Unity has had many bugs fixed and features improved support for High-DPI displays.

General

Firefox is updated to version 33 and Chromium is updated to version 38.
Gtk updated to version 3.12. Qt updated to version 5.3.
Support for IPP Everywhere printers is added, and printers shared from Ubuntu can emulate IPP Everywhere printers. IPP printers require noconfiguration under Ubuntu. More information about IPP Everywhere is available here: http://www.pwg.org/ipp/everywhere.html

LibreOffice

LibreOffice 4.3 brings a lot of improvements including improved PDF support, new features in Writer, Calc and Impress (word processor, spreadsheet and presentations). Full details here: https://wiki.documentfoundation.org/ReleaseNotes/4.3

Ubuntu Developer Tools Centre

This new tool allows developers to quickly and easily setup a variety of development environments on their Ubuntu Desktop. More information here:http://blog.didrocks.fr/post/Ubuntu-loves-Developers

Xorg

With Xorg 1.16, we have better support for non-pci devices. Xephyr now supports DRI3. The mesa 10.3 update has support for AMD Hawaii GPU's,improved support for dri3 offloading, the freedreno open source driver, and preliminary support for using nouveau on maxwell devices.

Ubuntu Server

OpenStack 2014.1

Ubuntu 14.10 includes the OpenStack 2014.2 (Juno) release of the following projects in Ubuntu main:
  • OpenStack Compute - Nova
  • OpenStack Identity - Keystone
  • OpenStack Imaging - Glance
  • OpenStack Block Storage - Cinder
  • OpenStack Networking - Neutron
  • OpenStack Object Storage - Swift
  • OpenStack Telemetry - Ceilometer
  • OpenStack Orchestration - Heat
  • OpenStack Dashboard - Horizon
WARNING: Upgrading an OpenStack deployment is a non-trivial process and care should be taken to plan and test upgrade procedures which will be specific to each OpenStack deployment.
Make sure you read the OpenStack Charm Release Notes for more information.

Libvirt 1.2.8

Containers launched with libvirt-lxc can now be apparmor-protected.
Libvirt now provides cgmanager support allowing use of libvirt inside containers without cgroups mounted.
Migration of pc-1.0 VMs from a 12.04 host must be done first to a 14.04 host, to the pc-1.0-precise machine type. From there, they may be converted to a new machine type, such as pc-i440fx-trusty, and migrated to a 14.10 host.

Qemu 2.1

Kvm is now supported on the ppc64le architecture.

Cgmanager 0.32

Cgmanager now has a new compiled client tool, and supports new methods including Prune, ListTasksRecursive, and ListControllers. It now supports the features needed for systemd-shim to properly close sessions.

LXC 1.1

This includes container checkpoint and restart as a tech preview.

cloud-init 0.7.6

Cloud-init 0.7.6 brings several bug fixes along with support for booting ubuntu with systemd. Also featured is improvements when using vendor-data onOpenStack.

bcache

bcache support is now included as a technology preview, enabled in the kernel and via the userspace package bcache-tools, but without installer support. We highly recommend that you take full system backups before experimenting with it. It has been enabled with a focus on server use cases. Some desktop use cases should also work, but we have observed some issues when attempting to combine bcache use with LVM and md.

Juju

Juju, the service orchestration tool for Ubuntu, has been updated to the latest current stable release, 1.20.10. See the upstream release notes for full details of all new features and improvements in this release.

Docker

Docker 1.2 is released in Utopic. For the absolute latest upstream version of Docker, please follow the instructions herehttps://docs.docker.com/installation/ubuntulinux/ titled "If you'd like to try the latest version of Docker"

MAAS

MAAS has been updated to the latest current beta release, 1.7-beta8. Many new features have been added, and lots of bugfixes too. Full release noteswill be available shortly.

Known issues

As is to be expected, with any release, there are some significant known bugs that users may run into with this release of Ubuntu 14.10. The ones we know about at this point (and some of the workarounds), are documented here so you don't need to spend time reporting these bugs again:

Boot, installation and post-install



  • The amd64 (Intel x86 64bit) images specifically targeted at Apple hardware (amd64+mac) are no longer produced. Most Apple computers are now capable of booting the amd64 image directly using the EFI (not legacy) boot method so long as their firmware is up to date. If for some reason your hardware doesn't boot properly using the amd64 image, make sure you don't have a pending EFI update and if that still doesn't work, then patch the 64-bit ISO using the software in bug #1298894 (tested working on Macbook 2,1). Alternatively, simply use the i386 (32bit) image instead.
  • Due to changes in syslinux, it is not currently possible to use usb-creator from 14.04 and earlier releases to write USB images for 14.10; we believe that it is also not possible to use usb-creator from a 14.10 system to write USB images for earlier releases. For now the workaround is to use a matching release of Ubuntu to write the images, but we intend to issue updates soon to work around this incompatibility. 1325801
  • Machines with ATI/AMD video cards may be getting blank or entirely turned off screen at boot. The screen will switch on when the X server starts. If you need it to turn on prior to that, for example to unlock an encrypted harddisk hitting ESC twice should reset the video card to a working state.
  • An update to shim in 14.10 introduces a bug where, when booting on a UEFI system with SecureBoot disabled, the boot is delayed for two seconds and a message "Booting in insecure mode" is displayed on the screen. This message does not indicate a security problem with Ubuntu and does not interfere with the operation of the system except for introducing this boot delay. As a workaround to avoid this boot delay, users can enable SecureBoot if enabled on their hardware, or if they do not intend to use SecureBoot at all they can uninstall the shim-signed package and then rerun the grub-install command. 1384973

Reference:




Tuesday 2 December 2014

Introduction Of Xcode : Iphone App. Development Tool

Xcode is an integrated development environment (IDE) containing a suite of software development tools developed by Apple for developing software for OS X and iOS. First released in 2003, the latest stable release is version 6.1 and is available via the Mac App Store free of charge for Mac OS X LionOS X Mountain LionOS X Mavericks and OS X Yosemite users.Registered developers can download preview releases and previous versions of the suite through the Apple Developer website. However, Apple recently made a beta version of version 6.x of the software available to those of the public with Apple Developer accounts.

Major features

Previously Xcode supported distributing a product build process over multiple systems. One technology involved was called Shared Workgroup Build, which used theBonjour protocol to automatically discover systems providing compiler services, and a modified version of the free software product distcc to facilitate the distribution of workloads. Earlier versions of Xcode provided a system called Dedicated Network Builds. These features are absent in the supported versions of Xcode.

Thanks to the Mach-O executable format, which allows for “fat binaries," containing code for multiple architectures, Xcode can build universal binaries, which allow software to run on both PowerPC and Intel-based (x86) platforms and that can include both 32-bit and 64-bit code for both architectures. Using the iOS SDK, Xcode can also be used to compile and debug applications for iOS that run on the ARM processor.

Xcode also includes Apple's WebObjects tools and frameworks for building Java web applications and web services (previously sold as a separate product). As of Xcode 3.0, Apple dropped WebObjects development inside Xcode; WOLips should be used instead. Xcode 3 still includes the WebObjects frameworks.

Xcode includes the GUI tool Instruments, which runs atop DTrace, a dynamic tracing framework created by Sun Microsystems and released as part of OpenSolaris.

Composition

The main application of the suite is the integrated development environment (IDE), also named Xcode. The Xcode suite also includes most of Apple's developer documentation, and built-in Interface Builder, an application used to construct graphical user interfaces.
Up to Xcode 4.1, the Xcode suite included a modified version of the GNU Compiler Collection. In Xcode 3.1 up to Xcode 4.6.3, it included the llvm-gcc compiler, with front ends from the GNU Compiler Collection and a code generator based on LLVM (which originally stood for Low Level Virtual Machine - see the LLVM article for clarification on this). In Xcode 3.2 and later, it included a code generator based on Apple's LLVM Compiler, and the Clang Static Analyzer. Starting with Xcode 4.2, the Apple LLVM Compiler became the default compiler, Starting with Xcode 5.0, LLVM was the only compiler provided.
Up to Xcode 4.6.3, the Xcode suite used the GNU Debugger (GDB) as the back-end for the IDE's debugger. Starting with Xcode 4.3, the LLDB debugger was also provided; starting with Xcode 4.5 LLDB replaced GDB as the default back-end for the IDE's debugger. Starting with Xcode 5.0, GDB was no longer supplied.
Xcode supports CC++Objective-CObjective-C++JavaAppleScriptPythonRubyRez, and Swift source code with a variety of programming models, including but not limited to CocoaCarbon, and Java. 

You can download PPT of Xcode from Bellow link.

http://www.slideshare.net/DhavalKaneria/introduction-of-xcode