Search Results

Search found 39772 results on 1591 pages for 'add ons'.

Page 7/1591 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • I can''t figure out how to use the comboBox to remove radiobuttons

    - by user3576336
    import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import javax.swing.ButtonGroup; import javax.swing.JLabel; import javax.swing.JDesktopPane; import javax.swing.JRadioButton; import javax.swing.JComboBox; import java.awt.GridBagLayout; import java.awt.GridBagConstraints; import java.awt.Insets; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @SuppressWarnings("serial") public class Calendar1 extends JFrame implements ActionListener { private JPanel contentPane; String[] Months = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; JDesktopPane desktopPane; ButtonGroup bG = new ButtonGroup(); JRadioButton radioButton, rdbtnNewRadioButton, radioButton_1, radioButton_2, radioButton_3, radioButton_4, radioButton_5, radioButton_6, radioButton_7, radioButton_8, radioButton_9, radioButton_10, radioButton_11, radioButton_12, radioButton_13, radioButton_14, radioButton_15, radioButton_16, radioButton_17, radioButton_18, radioButton_19, radioButton_20, radioButton_21, radioButton_22, radioButton_23, radioButton_24, radioButton_25, radioButton_26, radioButton_27, radioButton_28, radioButton_29; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { Calendar1 frame = new Calendar1(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the frame. */ @SuppressWarnings("unchecked") public Calendar1() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 521, 300); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JComboBox comboBox = new JComboBox(Months); comboBox.setBounds(28, 16, 132, 27); contentPane.add(comboBox); comboBox.setSelectedIndex(0); comboBox.addActionListener(this); JLabel label = new JLabel("2014"); label.setBounds(350, 20, 61, 16); contentPane.add(label); desktopPane = new JDesktopPane(); desktopPane.setBackground(new Color(30, 144, 255)); desktopPane.setBounds(0, 63, 495, 188); contentPane.add(desktopPane); GridBagLayout gbl_desktopPane = new GridBagLayout(); gbl_desktopPane.columnWidths = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; gbl_desktopPane.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }; gbl_desktopPane.columnWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE }; gbl_desktopPane.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE }; desktopPane.setLayout(gbl_desktopPane); // JLabel lblSun = new JLabel("Sun"); // lblSun.setForeground(Color.RED); // // GridBagConstraints gbc_lblSun = new GridBagConstraints(); // gbc_lblSun.insets = new Insets(0, 0, 5, 5); // gbc_lblSun.gridx = 2; // gbc_lblSun.gridy = 0; // desktopPane.add(lblSun, gbc_lblSun); // // JLabel lblMon = new JLabel("Mon"); // GridBagConstraints gbc_lblMon = new GridBagConstraints(); // gbc_lblMon.insets = new Insets(0, 0, 5, 5); // gbc_lblMon.gridx = 4; // gbc_lblMon.gridy = 0; // desktopPane.add(lblMon, gbc_lblMon); // // JLabel lblTues = new JLabel("Tues"); // GridBagConstraints gbc_lblTues = new GridBagConstraints(); // gbc_lblTues.insets = new Insets(0, 0, 5, 5); // gbc_lblTues.gridx = 6; // gbc_lblTues.gridy = 0; // desktopPane.add(lblTues, gbc_lblTues); // // JLabel lblWed = new JLabel("Wed"); // GridBagConstraints gbc_lblWed = new GridBagConstraints(); // gbc_lblWed.insets = new Insets(0, 0, 5, 5); // gbc_lblWed.gridx = 8; // gbc_lblWed.gridy = 0; // desktopPane.add(lblWed, gbc_lblWed); // // JLabel lblThurs = new JLabel("Thurs"); // GridBagConstraints gbc_lblThurs = new GridBagConstraints(); // gbc_lblThurs.insets = new Insets(0, 0, 5, 5); // gbc_lblThurs.gridx = 10; // gbc_lblThurs.gridy = 0; // desktopPane.add(lblThurs, gbc_lblThurs); // // JLabel lblFri = new JLabel("Friday"); // GridBagConstraints gbc_lblFri = new GridBagConstraints(); // gbc_lblFri.insets = new Insets(0, 0, 5, 5); // gbc_lblFri.gridx = 12; // gbc_lblFri.gridy = 0; // desktopPane.add(lblFri, gbc_lblFri); // // JLabel lblSat = new JLabel("Sat"); // lblSat.setForeground(Color.RED); // GridBagConstraints gbc_lblSat = new GridBagConstraints(); // gbc_lblSat.insets = new Insets(0, 0, 5, 5); // gbc_lblSat.gridx = 14; // gbc_lblSat.gridy = 0; // desktopPane.add(lblSat, gbc_lblSat); radioButton = new JRadioButton("1"); GridBagConstraints gbc_radioButton = new GridBagConstraints(); gbc_radioButton.insets = new Insets(0, 0, 5, 5); gbc_radioButton.gridx = 8; gbc_radioButton.gridy = 1; desktopPane.add(radioButton, gbc_radioButton); bG.add(radioButton); rdbtnNewRadioButton = new JRadioButton("2"); GridBagConstraints gbc_rdbtnNewRadioButton = new GridBagConstraints(); gbc_rdbtnNewRadioButton.insets = new Insets(0, 0, 5, 5); gbc_rdbtnNewRadioButton.gridx = 10; gbc_rdbtnNewRadioButton.gridy = 1; desktopPane.add(rdbtnNewRadioButton, gbc_rdbtnNewRadioButton); bG.add(rdbtnNewRadioButton); radioButton_1 = new JRadioButton("3"); GridBagConstraints gbc_radioButton_1 = new GridBagConstraints(); gbc_radioButton_1.insets = new Insets(0, 0, 5, 5); gbc_radioButton_1.gridx = 12; gbc_radioButton_1.gridy = 1; desktopPane.add(radioButton_1, gbc_radioButton_1); bG.add(radioButton_1); radioButton_2 = new JRadioButton("4"); GridBagConstraints gbc_radioButton_2 = new GridBagConstraints(); gbc_radioButton_2.insets = new Insets(0, 0, 5, 5); gbc_radioButton_2.gridx = 14; gbc_radioButton_2.gridy = 1; desktopPane.add(radioButton_2, gbc_radioButton_2); bG.add(radioButton_2); radioButton_3 = new JRadioButton("5"); GridBagConstraints gbc_radioButton_3 = new GridBagConstraints(); gbc_radioButton_3.insets = new Insets(0, 0, 5, 5); gbc_radioButton_3.gridx = 2; gbc_radioButton_3.gridy = 2; desktopPane.add(radioButton_3, gbc_radioButton_3); bG.add(radioButton_3); radioButton_4 = new JRadioButton("6"); GridBagConstraints gbc_radioButton_4 = new GridBagConstraints(); gbc_radioButton_4.insets = new Insets(0, 0, 5, 5); gbc_radioButton_4.gridx = 4; gbc_radioButton_4.gridy = 2; desktopPane.add(radioButton_4, gbc_radioButton_4); bG.add(radioButton_4); radioButton_5 = new JRadioButton("7"); GridBagConstraints gbc_radioButton_5 = new GridBagConstraints(); gbc_radioButton_5.insets = new Insets(0, 0, 5, 5); gbc_radioButton_5.gridx = 6; gbc_radioButton_5.gridy = 2; desktopPane.add(radioButton_5, gbc_radioButton_5); bG.add(radioButton_5); radioButton_6 = new JRadioButton("8"); GridBagConstraints gbc_radioButton_6 = new GridBagConstraints(); gbc_radioButton_6.insets = new Insets(0, 0, 5, 5); gbc_radioButton_6.gridx = 8; gbc_radioButton_6.gridy = 2; desktopPane.add(radioButton_6, gbc_radioButton_6); bG.add(radioButton_6); radioButton_7 = new JRadioButton("9"); GridBagConstraints gbc_radioButton_7 = new GridBagConstraints(); gbc_radioButton_7.insets = new Insets(0, 0, 5, 5); gbc_radioButton_7.gridx = 10; gbc_radioButton_7.gridy = 2; desktopPane.add(radioButton_7, gbc_radioButton_7); bG.add(radioButton_7); radioButton_8 = new JRadioButton("10"); GridBagConstraints gbc_radioButton_8 = new GridBagConstraints(); gbc_radioButton_8.insets = new Insets(0, 0, 5, 5); gbc_radioButton_8.gridx = 12; gbc_radioButton_8.gridy = 2; desktopPane.add(radioButton_8, gbc_radioButton_8); bG.add(radioButton_8); radioButton_9 = new JRadioButton("11"); GridBagConstraints gbc_radioButton_9 = new GridBagConstraints(); gbc_radioButton_9.insets = new Insets(0, 0, 5, 5); gbc_radioButton_9.gridx = 14; gbc_radioButton_9.gridy = 2; desktopPane.add(radioButton_9, gbc_radioButton_9); bG.add(radioButton_9); radioButton_10 = new JRadioButton("12"); GridBagConstraints gbc_radioButton_10 = new GridBagConstraints(); gbc_radioButton_10.insets = new Insets(0, 0, 5, 5); gbc_radioButton_10.gridx = 2; gbc_radioButton_10.gridy = 3; desktopPane.add(radioButton_10, gbc_radioButton_10); bG.add(radioButton_10); radioButton_11 = new JRadioButton("13"); GridBagConstraints gbc_radioButton_11 = new GridBagConstraints(); gbc_radioButton_11.insets = new Insets(0, 0, 5, 5); gbc_radioButton_11.gridx = 4; gbc_radioButton_11.gridy = 3; desktopPane.add(radioButton_11, gbc_radioButton_11); bG.add(radioButton_11); radioButton_12 = new JRadioButton("14"); GridBagConstraints gbc_radioButton_12 = new GridBagConstraints(); gbc_radioButton_12.insets = new Insets(0, 0, 5, 5); gbc_radioButton_12.gridx = 6; gbc_radioButton_12.gridy = 3; desktopPane.add(radioButton_12, gbc_radioButton_12); bG.add(radioButton_12); radioButton_13 = new JRadioButton("15"); GridBagConstraints gbc_radioButton_13 = new GridBagConstraints(); gbc_radioButton_13.insets = new Insets(0, 0, 5, 5); gbc_radioButton_13.gridx = 8; gbc_radioButton_13.gridy = 3; desktopPane.add(radioButton_13, gbc_radioButton_13); bG.add(radioButton_13); radioButton_14 = new JRadioButton("16"); GridBagConstraints gbc_radioButton_14 = new GridBagConstraints(); gbc_radioButton_14.insets = new Insets(0, 0, 5, 5); gbc_radioButton_14.gridx = 10; gbc_radioButton_14.gridy = 3; desktopPane.add(radioButton_14, gbc_radioButton_14); bG.add(radioButton_14); radioButton_15 = new JRadioButton("17"); GridBagConstraints gbc_radioButton_15 = new GridBagConstraints(); gbc_radioButton_15.insets = new Insets(0, 0, 5, 5); gbc_radioButton_15.gridx = 12; gbc_radioButton_15.gridy = 3; desktopPane.add(radioButton_15, gbc_radioButton_15); bG.add(radioButton_15); radioButton_16 = new JRadioButton("18"); GridBagConstraints gbc_radioButton_16 = new GridBagConstraints(); gbc_radioButton_16.insets = new Insets(0, 0, 5, 5); gbc_radioButton_16.gridx = 14; gbc_radioButton_16.gridy = 3; desktopPane.add(radioButton_16, gbc_radioButton_16); bG.add(radioButton_16); radioButton_17 = new JRadioButton("19"); GridBagConstraints gbc_radioButton_17 = new GridBagConstraints(); gbc_radioButton_17.insets = new Insets(0, 0, 5, 5); gbc_radioButton_17.gridx = 2; gbc_radioButton_17.gridy = 4; desktopPane.add(radioButton_17, gbc_radioButton_17); bG.add(radioButton_17); radioButton_18 = new JRadioButton("20"); GridBagConstraints gbc_radioButton_18 = new GridBagConstraints(); gbc_radioButton_18.insets = new Insets(0, 0, 5, 5); gbc_radioButton_18.gridx = 4; gbc_radioButton_18.gridy = 4; desktopPane.add(radioButton_18, gbc_radioButton_18); bG.add(radioButton_18); radioButton_19 = new JRadioButton("21"); GridBagConstraints gbc_radioButton_19 = new GridBagConstraints(); gbc_radioButton_19.insets = new Insets(0, 0, 5, 5); gbc_radioButton_19.gridx = 6; gbc_radioButton_19.gridy = 4; desktopPane.add(radioButton_19, gbc_radioButton_19); bG.add(radioButton_19); radioButton_20 = new JRadioButton("22"); GridBagConstraints gbc_radioButton_20 = new GridBagConstraints(); gbc_radioButton_20.insets = new Insets(0, 0, 5, 5); gbc_radioButton_20.gridx = 8; gbc_radioButton_20.gridy = 4; desktopPane.add(radioButton_20, gbc_radioButton_20); bG.add(radioButton_20); radioButton_21 = new JRadioButton("23"); GridBagConstraints gbc_radioButton_21 = new GridBagConstraints(); gbc_radioButton_21.insets = new Insets(0, 0, 5, 5); gbc_radioButton_21.gridx = 10; gbc_radioButton_21.gridy = 4; desktopPane.add(radioButton_21, gbc_radioButton_21); bG.add(radioButton_21); radioButton_22 = new JRadioButton("24"); GridBagConstraints gbc_radioButton_22 = new GridBagConstraints(); gbc_radioButton_22.insets = new Insets(0, 0, 5, 5); gbc_radioButton_22.gridx = 12; gbc_radioButton_22.gridy = 4; desktopPane.add(radioButton_22, gbc_radioButton_22); bG.add(radioButton_22); radioButton_23 = new JRadioButton("25"); GridBagConstraints gbc_radioButton_23 = new GridBagConstraints(); gbc_radioButton_23.insets = new Insets(0, 0, 5, 5); gbc_radioButton_23.gridx = 14; gbc_radioButton_23.gridy = 4; desktopPane.add(radioButton_23, gbc_radioButton_23); bG.add(radioButton_23); radioButton_24 = new JRadioButton("26"); GridBagConstraints gbc_radioButton_24 = new GridBagConstraints(); gbc_radioButton_24.insets = new Insets(0, 0, 5, 5); gbc_radioButton_24.gridx = 2; gbc_radioButton_24.gridy = 5; desktopPane.add(radioButton_24, gbc_radioButton_24); bG.add(radioButton_24); radioButton_25 = new JRadioButton("27"); GridBagConstraints gbc_radioButton_25 = new GridBagConstraints(); gbc_radioButton_25.insets = new Insets(0, 0, 5, 5); gbc_radioButton_25.gridx = 4; gbc_radioButton_25.gridy = 5; desktopPane.add(radioButton_25, gbc_radioButton_25); bG.add(radioButton_25); radioButton_26 = new JRadioButton("28"); GridBagConstraints gbc_radioButton_26 = new GridBagConstraints(); gbc_radioButton_26.insets = new Insets(0, 0, 5, 5); gbc_radioButton_26.gridx = 6; gbc_radioButton_26.gridy = 5; desktopPane.add(radioButton_26, gbc_radioButton_26); bG.add(radioButton_26); radioButton_27 = new JRadioButton("29"); GridBagConstraints gbc_radioButton_27 = new GridBagConstraints(); gbc_radioButton_27.insets = new Insets(0, 0, 5, 5); gbc_radioButton_27.gridx = 8; gbc_radioButton_27.gridy = 5; desktopPane.add(radioButton_27, gbc_radioButton_27); bG.add(radioButton_27); radioButton_28 = new JRadioButton("30"); GridBagConstraints gbc_radioButton_28 = new GridBagConstraints(); gbc_radioButton_28.insets = new Insets(0, 0, 5, 5); gbc_radioButton_28.gridx = 10; gbc_radioButton_28.gridy = 5; desktopPane.add(radioButton_28, gbc_radioButton_28); bG.add(radioButton_28); radioButton_29 = new JRadioButton("31"); GridBagConstraints gbc_radioButton_29 = new GridBagConstraints(); gbc_radioButton_29.insets = new Insets(0, 0, 5, 5); gbc_radioButton_29.gridx = 12; gbc_radioButton_29.gridy = 5; desktopPane.add(radioButton_29, gbc_radioButton_29); bG.add(radioButton_29); } @Override public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox) e.getSource(); String months = (String) cb.getSelectedItem(); if (months.equals("February")) { desktopPane.remove(radioButton_28); desktopPane.revalidate(); } } } I'm trying to use the combobox to remove radiobuttons in the actionperformed, but when I run the program, nothing happens, nor can I enable new buttons in the actionperformed. Thank you so much in advance for helping me out.

    Read the article

  • When developing a Microsoft Office Add-In (for Word), is it possible to store hidden metadata inform

    - by leftend
    I am trying to store metadata (basically a unique id) along with each cell of a table in a Word document. Currently, for the add-in I'm developing, I am querying the database, and building a table inside the Word document using the data that is retrieved. I want to be able to save any of the user's edits to the document, and persist it back to the database. My initial thought was to store a unique id along with each cell in the table so that I would be able to tell which records to update. I would also like to store some sort of "isChanged" flag within each cell so that I could tell which cells were changed. I found that I could add the needed information into the "ID" property of the cell - however, that information was not retained if the user saved the document, closed it, and re-opened it. I then tried storing the data by adding a data to the "Fields" collection - but that did not work and threw a runtime error. Here is the code that I tried: object t1 = Word.WdFieldType.wdFieldEmpty; object val = "myValue: " + counter; object preserveFormatting = true; tbl.Cell(i, j).Range.Fields.Add(tbl.Cell(i, j).Range, ref t1, ref val, ref preserveFormatting); This compiles fine, but throws this runtime error "This command is not available". So, is this possible at all? Or am I headed in the wrong direction? Thanks in advance.

    Read the article

  • Which technology should I use to pop up a simple form in my add-in DLL?

    - by Decker
    I'm building an assembly that runs as an "add-on" to a vendor's Outlook add-in. When it is time for me to execute my "action", I have to put up a simple window with a few simple controls. The vendor's add-in provides me with the parent window's integer handle. I am able to put up a form pretty easily with WinForms by adding are reference to System.Windows.Forms from my assembly and with the following code: FrmHistoryDisplay frm = new FrmHistoryDisplay(); frm.ShowDialog(new ParentWindowWrapper(_parentWindowHandle)); where ParentWindowWrapper is a shim class around the window handle I'm given private class ParentWindowWrapper : IWin32Window { private int _parentWindowHandle; public ParentWindowWrapper(int parentWindowHandle) { _parentWindowHandle = parentWindowHandle; } public IntPtr Handle { get { return new IntPtr(_parentWindowHandle); } } } The Form's ShowDialog method takes an IWin32Window implementor to wrap the parent's window handle. This all works and seems simple enough. I was just wondering whether something similar can be done with a WPF window rather than a WinForm Form? Should I care?

    Read the article

  • Using javascript to add form fields, but what will the new name be?

    - by user1322844
    After reading this post: using javascript to add form fields.. but below, not to the side? I've made the button work! But I don't know how to receive the output. This is what I entered. var counter = 0; function addNew() { // Get the main Div in which all the other divs will be added var mainContainer = document.getElementById('mainContainer'); // Create a new div for holding text and button input elements var newDiv = document.createElement('div'); // Create a new text input var newText = document.createElement('input'); newText.type = "input"; newText.maxlength = "50"; newText.maxlimit = "50"; newText.size = "60"; newText.value = counter; // Create a new button input var newDelButton = document.createElement('input'); newDelButton.type = "button"; newDelButton.value = "Delete"; // Append new text input to the newDiv newDiv.appendChild(newText); // Append new button input to the newDiv newDiv.appendChild(newDelButton); // Append newDiv input to the mainContainer div mainContainer.appendChild(newDiv); counter++; // Add a handler to button for deleting the newDiv from the mainContainer newDelButton.onclick = function() { mainContainer.removeChild(newDiv); } } </script> With this in the form: <input type="button" size="3" cols="30" value="Add" onClick="addNew()"> So, what will the new field names be? I don't understand enough of the coding to figure out what I'm telling it to. Good thing there are other smart folks out there for me to lean on! Thanks for any answers.

    Read the article

  • Add Your Gmail Account to Outlook 2010 using POP

    - by Matthew Guay
    Are you excited about the latest version of Outlook, and want to get it setup with your Gmail accounts?  Here’s how you can easily add your Gmail account using POP to Outlook 2010. Getting Started Log into your Gmail account an go to your settings page. Under the Forwarding and POP/IMAP tab make sure POP is enabled.  You can choose to enable POP access for all new mail that arrives from now on, or for all mail in your Gmail account.  On the second option, we suggest you chose keep Gmail’s copy in the Inbox so you can still access your emails on the Gmail server.   Add Your Account to Outlook 2010 If you haven’t run Outlook 2010 yet, click Next to start setup and add your email account. Select Yes to add an email account to Outlook.  Now you’re ready to start entering your settings to access your email. Or, if you’ve already been using Outlook and want to add a new POP account, click File and then select Add Account under Account Information.   Outlook 2010 can often automatically find and configure your account with just your email address and password, so enter these and click Next to let Outlook try to set it up automatically. Outlook will now scan for the settings for your email account. If Outlook was able to find settings and configure your account automatically, you’ll see this success screen.  Depending on your setup, Gmail is automatically setup, but sometimes it fails to find the settings.  If this is the case, we’ll go back and manually configure it. Manually Configure Outlook for Gmail Back at the account setup screen, select Manually configure server settings or additional server types and click Next. Select Internet E-mail and then click Next. Enter your username, email address, and log in information. Under Server information enter in the following: Account Type: POP3 Incoming mail server: pop.gmail.com Outgoing mail server: smtp.gmail.com Make sure to check Remember password so you don’t have to enter it every time. After that data is entered in, click on the More Settings button. Select the Outgoing Server tab, and check My outgoing server (SMTP) requires authentication.  Verify Use same settings as my incoming mail server is marked as well. Next select the Advanced tab and enter the following information: Incoming Server (POP3): 995 Outgoing server (SMTP): 587 Check This server requires an encrypted connection (SSL) Set Use the following type of encrypted connection to TLS You also might want to uncheck the box to Remove messages from the server after a number of days.  This way your messages will still be accessible from Gmail online. Click OK to close the window, and then click Next to finish setting up the account.  Outlook will test your account settings to make sure everything will work; click Close when this is finished. Provided everything was entered in correctly, you’ll be greeted with a successful setup message…click Finish.   Gmail will be all ready to sync with Outlook 2010.  Enjoy your Gmail account in Outlook, complete with fast indexed searching, conversation view, and more! Conclusion Adding Gmail using the POP setting to Outlook 2010 is usually easy and only takes a few steps.  Even if you have to enter your settings manually, it is still a fairly simple process. You can add multiple email accounts using POP3 if you wish, and if you’d like to sync IMAP accounts, check out our tutorial on setting up Gmail using IMAP in Outlook 2010. Similar Articles Productive Geek Tips Add Your Gmail To Windows Live MailAdd Your Gmail Account to Outlook 2007Use Gmail IMAP in Microsoft Outlook 2007Figure out which Online accounts are selling your email to spammersAdd Your Gmail Account to Outlook 2010 Using IMAP TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips VMware Workstation 7 Acronis Online Backup DVDFab 6 Revo Uninstaller Pro Bypass Waiting Time On Customer Service Calls With Lucyphone MELTUP – "The Beginning Of US Currency Crisis And Hyperinflation" Enable or Disable the Task Manager Using TaskMgrED Explorer++ is a Worthy Windows Explorer Alternative Error Goblin Explains Windows Error Codes Twelve must-have Google Chrome plugins

    Read the article

  • I can't add PPA repository behind the proxy (with @ in the username)

    - by kenorb
    I'm trying to add the ppa repository (as a root) with the following command: export HTTP_PROXY="http://[email protected]:[email protected]:8080" add-apt-repository ppa:nilarimogard/webupd8 Traceback (most recent call last): File "/usr/bin/add-apt-repository", line 125, in <module> ppa_info = get_ppa_info_from_lp(user, ppa_name) File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 84, in get_ppa_info_from_lp curl.perform() pycurl.error: (56, 'Received HTTP code 407 from proxy after CONNECT') Unfortunately it doesn't work. Looks like curl is connecting to the proxy, but the proxy says that Authentication is Required. I've tried with .curlrc, http_proxy env instead, but it doesn't work. strace -e network,write -s1000 add-apt-repository ppa:nilarimogard/webupd8 socket(PF_INET6, SOCK_DGRAM, IPPROTO_IP) = 4 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 4 connect(4, {sa_family=AF_INET, sin_port=htons(8080), sin_addr=inet_addr("165.x.x.232")}, 16) = -1 EINPROGRESS (Operation now in progress) getsockopt(4, SOL_SOCKET, SO_ERROR, [0], [4]) = 0 getpeername(4, {sa_family=AF_INET, sin_port=htons(8080), sin_addr=inet_addr("165.x.x.232")}, [16]) = 0 getsockname(4, {sa_family=AF_INET, sin_port=htons(46025), sin_addr=inet_addr("161.20.75.220")}, [16]) = 0 sendto(4, "CONNECT launchpad.net:443 HTTP/1.1\r\nHost: launchpad.net:443\r\nUser-Agent: PycURL/7.22.0\r\nProxy-Connection: Keep-Alive\r\nAccept: application/json\r\n\r\n", 146, MSG_NOSIGNAL, NULL, 0) = 146 recvfrom(4, "HTTP/1.1 407 Proxy Authentication Required\r\nProxy-Authenticate: BASIC realm=\"proxy\"\r\nCache-Control: no-cache\r\nPragma: no-cache\r\nContent-Type: text/html; charset=utf-8\r\nProxy-Connection: close\r\nSet-Cookie: BCSI-CS-91b9906520151dad=2; Path=/\r\nConnection: close\ Maybe it's because there is @ sign in the username? Wget works with proxy fine. Related: How do I add a repository from behind a proxy? Environment Ubuntu 12.04 curl 7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3 curl Features: GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP

    Read the article

  • Quickly Add Watermark To Multiple PDF Files Using “Batch PDF Watermark”

    - by Kavitha
    Want to add watermark to your PDF files with a single click? You can use the freeware Batch PDF Watermark. Batch PDF Watermark is super cool application that lets you add image or text watermarks to multiple files at a time. Office 2010 style ribbon user interface of the application is very easy to use and provides many options to configure watermark properties like – font styles, positioning, transparency levels, rotation of watermark image, scaling of watermark image and etc. Before running the watermark process, you can even preview it. To select multiple PDF files to watermark you can use “Add Files” option to hand pick required files or “Add Folder” option to choose all the PDF files available in the folder. Download Batch PDF Watermark [via liferocks] This article titled,Quickly Add Watermark To Multiple PDF Files Using “Batch PDF Watermark”, was originally published at Tech Dreams. Grab our rss feed or fan us on Facebook to get updates from us.

    Read the article

  • SQL SERVER – How to an Add Identity Column to Table in SQL Server

    - by Pinal Dave
    Here is the question I received on SQLAuthority Fan Page. “How do I add an identity column to Table in SQL Server? “ Sometime the questions are very very simple but the answer is not easy to find. Scenario 1: If you are table does not have identity column, you can simply add the identity column by executing following script: ALTER TABLE MyTable ADD ID INT IDENTITY(1,1) NOT NULL Scenario 2: If your table already has a column which you want to convert to identity column, you can’t do that directly. There is a workaround for the same which I have discussed in depth over the article Add or Remove Identity Property on Column. Scenario 3: If your table has already identity column and you can want to add another identity column for any reason – that is not possible. A table can have only one identity column. If you try to have multiple identity column your table, it will give following error. Msg 2744, Level 16, State 2, Line 2 Multiple identity columns specified for table ‘MyTable‘. Only one identity column per table is allowed. Leave a comment if you have any suggestion. Reference : Pinal Dave (http://blog.SQLAuthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL Tagged: Identity

    Read the article

  • Add an Easy to View Notification Badge to Tabs in Firefox

    - by Asian Angel
    Are you tired of manually switching between tabs to see if you have new e-mails, messages, or items in your RSS feeds? Then say goodbye to the hassle! Tab Badge adds an awesome counter badge to your tabs and lets you see the number of new items with just a glance. Tab Badge displays equally well whether you have a tab set at full size or pinned as an app tab. As you can see above the badge really stands out and the text is easy to read. Installing the add-on does not require a browser restart, so just click and go to start enjoying that tab notification goodness! Note: Works with Firefox 4.0b7 – 4.0.* Add Tab Badge to Firefox (Mozilla Add-ons) [via DownloadSquad] Latest Features How-To Geek ETC How To Make Hundreds of Complex Photo Edits in Seconds With Photoshop Actions How to Enable User-Specific Wireless Networks in Windows 7 How to Use Google Chrome as Your Default PDF Reader (the Easy Way) How To Remove People and Objects From Photographs In Photoshop Ask How-To Geek: How Can I Monitor My Bandwidth Usage? Internet Explorer 9 RC Now Available: Here’s the Most Interesting New Stuff Never Call Me at Work [Humorous Star Wars Video] Add an Image Properties Listing to the Context Menu in Chrome and Iron Add an Easy to View Notification Badge to Tabs in Firefox SpellBook Parks Bookmarklets in Chrome’s Context Menu Drag2Up Brings Multi-Source Drag and Drop Uploading to Firefox Enchanted Swing in the Forest Wallpaper

    Read the article

  • How to add user to other filesystem

    - by chris varnz
    I'm trying to work out how to add a user to a separate filesystem, as described here, specifically point 5: Add a local user and password for the user, then add the user to the adm and sudo groups. I've read around chroot, but I don't believe this will work as the default command to run is /bin/bash, which would require the target fs to be binary compatible. In this case, the target fs is armel so isn't compatible.

    Read the article

  • The right way to add images to Monogame/Windows

    - by ashes999
    I'm starting out with MonoGame. For now, I'm only targeting Windows (desktop -- not Windows 8 specifically). I've used a couple of XNA products in the past (raw XNA, FlatRedBall, SilverSprite), so I may have a misunderstanding about how I should add images to my content. How do I add images to my project? Currently, I created a new Monogame project, added a folder called "Content," and added images under there; the only caveat is that I need to set the Copy to Output Directory action to one of the Copy ones. It seems strange, because my "raw" XNA project just last week had a Content project in it (XNA Framework Content Pipeline, according to VS2010), which compiled my images to XNB (I think). It seems like Monogame doesn't use the same content pipeline, but I'm not sure. Edit: My question is not about "how do I get the XNA content pipeline to work with Monogame." My question is "why would I want to use the XNA content pipeline in Monogame?" Because there are (at least) two solutions (that I see today): Add the images to the Monogame project and set the Copy to Output Directory options to copy. Add a XNA content pipeline project and add my images to that instead; reference it from my MOnogame project. Which solution should I use, and why? I currently have a working version with the first option.

    Read the article

  • PyGTK/Quickly Add string to ListStore

    - by AllRadioisDead
    I'm trying to build an application that will prompt the user for a string, and then add that string to a Scrolling Listview object using quickly and PyGTK. I've been following this tutorial: http://developer.ubuntu.com/resources/app-developer-cookbook/multimedia/creating-a-simple-media-player/ When I hit the add button, the prompt comes up properly and I'm able to enter the string. The column appears correctly but the list ends up being blank. What am I doing wrong? import gettext from gettext import gettext as _ gettext.textdomain('spiderweb') from gi.repository import Gtk # pylint: disable=E0611 import logging logger = logging.getLogger('spiderweb') from spiderweb_lib import Window from spiderweb.AboutSpiderwebDialog import AboutSpiderwebDialog from spiderweb.PreferencesSpiderwebDialog import PreferencesSpiderwebDialog from quickly import prompts from quickly.widgets.dictionary_grid import DictionaryGrid import os # See spiderweb_lib.Window.py for more details about how this class works class SpiderwebWindow(Window): __gtype_name__ = "SpiderwebWindow" def finish_initializing(self, builder): # pylint: disable=E1002 """Set up the main window""" super(SpiderwebWindow, self).finish_initializing(builder) self.AboutDialog = AboutSpiderwebDialog self.PreferencesDialog = PreferencesSpiderwebDialog # Code for other initialization actions should be added here. self.supported_web_formats = [".net",".html", ".com"] def on_addbutton_clicked(self, widget, data=None): #let the user choose a path with the directory chooser response, string = prompts.string("Enter a string", "Please enter string:", "Sample Text") #make certain the user said ok before working if response == Gtk.ResponseType.OK: #make a list of the supported media files media_files = Gtk.ListStore(str) #add a dictionary to the list of media files media_files.append({"String":string}) #remove any children in scrolled window for c in self.ui.scrolledwindow1.get_children(): self.ui.scrolledwindow1.remove(c) #create the grid with list of dictionaries #only show the File column media_grid = DictionaryGrid(media_files, keys=["File"]) #show the grid, and add it to the scrolled window media_grid.show_all() self.ui.scrolledwindow1.add(media_grid)

    Read the article

  • How to add a command permanently to grub2

    - by tomodachi
    I have a fairly special setup, using Linux on a MacBook Laptop. to switch off my secondary graphics card in it I'm required to add these lines to my grub outb 0x728 1 outb 0x710 2 outb 0x740 2 outb 0x750 0 I do this by pressing 'e' for my selected grub menu option and adding the lines one by one . then finally booting . But as we know it's not permanent. I cant really figure out where i need to add it for grub to always append it to my Linux boot options. It's doesn't seem to belong in /etc/default/grub since here i can add stuff to the kernel boot line Honestly i'm afraid to fiddle to much with grub on my computer since getting it to triple boot Linux/Mac/Windows was a very delicate and timely matter. Does anyone have any idea of where to add it?

    Read the article

  • Part 1 - 12c Database and WLS - Overview

    - by Steve Felts
    The download of Oracle 12c database became available on June 25, 2013.  There are some big new features in 12c database and WebLogic Server will take advantage of them. Immediately, we will support using 12c database and drivers with WLS 10.3.6 and 12.1.1.  When the next version of WLS ships, additional functionality will be supported (those rows in the table below with all "No" values will get a "Yes).  The following table maps the Oracle 12c Database features supported with various combinations of currently available WLS releases, 11g and 12c Drivers, and 11g and 12c Databases. Feature WebLogic Server 10.3.6/12.1.1 with 11g drivers and 11gR2 DB WebLogic Server 10.3.6/12.1.1 with 11g drivers and 12c DB WebLogic Server 10.3.6/12.1.1 with 12c drivers and 11gR2 DB WebLogic Server 10.3.6/12.1.1 with 12c drivers and 12c DB JDBC replay No No No Yes (Active GridLink only in 10.3.6, add generic in 12.1.1) Multi Tenant Database No Yes (except set container) No Yes (except set container) Dynamic switching between Tenants No No No No Database Resident Connection pooling (DRCP) No No No No Oracle Notification Service (ONS) auto configuration No No No No Global Database Services (GDS) No Yes (Active GridLink only) No Yes (Active GridLink only) JDBC 4.1 (using ojdbc7.jar files & JDK 7) No No Yes Yes  The My Oracle Support (MOS) document covering this is "WebLogic Server 12.1.1 and 10.3.6 Support for Oracle 12c Database [ID 1564509.1]" at the link https://support.oracle.com/epmos/faces/DocumentDisplay?id=1564509.1. The following documents are also key references:12c Oracle Database Developer Guide http://docs.oracle.com/cd/E16655_01/appdev.121/e17620/toc.htm 12c Oracle Database Administrator's Guide http://docs.oracle.com/cd/E16655_01/server.121/e17636/toc.htm . I plan to write some related blog articles not to duplicate existing product documentation but to introduce the features, provide some examples, and tie together some information to make it easier to understand. How do you get started with 12c?  The easiest way is to point your data source at a 12c database.  The only change on the WLS side is to update the URL in your data source (assuming that you are not just upgrading your database).  You can continue to use the 11.2.0.3 driver jar files that shipped with WLS 10.3.6 or 12.1.1.  You shouldn't see any changes in your application.  You can take advantage of enhancements on the database side that don't affect the mid-tier.  On the WLS side, you can take advantage of using Global Data Service or connecting to a tenant in a multi-tenant database transparently. If you want to use the 12c client jar files, it's a bit of work because they aren't shipped with WLS and you can't just drop in ojdbc6.jar as in the old days.  You need to use a matched set of jar files and they need to come before existing jar files in the CLASSPATH.  The MOS article is written from the standpoint that you need to get the jar files directly - download almost 1G and install over 600M footprint to get 15 jar files.  Assuming that you have the database installed and you can get access to the installation (or ask the DBA), you need to copy the 15 jar files to each machine with a WLS installation and get them in your CLASSPATH.  You can play with setting the PRE_CLASSPATH but the more practical approach may be to just update WL_HOME/common/bin/commEnv.sh directly.  There's a change in the transaction completion behavior (read the MOS) so if you think you might run into that, you will want to set -Doracle.jdbc.autoCommitSpecCompliant=false.  Also if you are running with Active GridLink, you must set -Doracle.ucp.PreWLS1212Compatible=true (how's that for telling you that this is fixed in WLS 12.1.2).  Once you get the configuration out of the way, you can start using the new ojdbc7.jar in place of the ojdbc6.jar to get the new JDBC 4.1 API's.  You can also start using Application Continuity.  This feature is also known as JDBC Replay because when a connection fails you get a new one with all JDBC operations up to the failure point automatically replayed.  As you might expect, there are some limitations but it's an interesting feature.  Obviously I'm going to focus on the 12c database features that we can leverage in WLS data source.  You will need to read other sources or the product documentation to get all of the new features.

    Read the article

  • What add-in/workbench framework is the best .NET alternative to Eclipse RCP?

    - by Winston Fassett
    I'm looking for a plugin-based application framework that is comparable to the Eclipse Plugin Framework, which to my simple mind consists of: a core plugin management framework (Equinox / OSGI), which provides the ability to declare extension endpoints and then discover and load plugins that service those endpoints. (this is different than Dependency Injection, but admittedly the difference is subtle - configuration is highly de-centralized, there are versioning concerns, it might involve an online plugin repository, and most importantly to me, it should be easy for the user to add plugins without needing to know anything about the underlying architecture / config files) many layers of plugins that provide a basic workbench shell with concurrency support, commands, preference sheets, menus, toolbars, key bindings, etc. That is just scratching the surface of the RCP, which itself is meant to serve as the foundation of your application, which you build by writing / assembling even more plugins. Here's what I've gleaned from the internet in the past couple of days... As far as I can tell, there is nothing in the .NET world that remotely approaches the robustness and maturity of the Eclipse RCP for Java but there are several contenders that do either #1 or #2 pretty well. (I should also mention that I have not made a final decision on WinForms vs WPF, so I'm also trying to understand the level of UI coupling in any candidate framework. I'm also wondering about platform coupling and source code licensing) I must say that the open-source stuff is generally less-documented but easier to understand, while the MS stuff typically has more documentation but is less accessible, so that with many of the MS technologies, I'm left wondering what they actually do, in a practical sense. These are the libraries I have found: SharpDevelop The first thing I looked at was SharpDevelop, which does both #1 and also #2 in a basic way (no insult to SharpDevelop, which is admirable - I just mean more basic than Eclipse RCP). However, SharpDevelop is an application more than a framework, and there are basic assumptions and limitations there (i.e. being somewhat coupled to WinForms). Still, there are some articles on CodeProject explaining how to use it as the foundation for an application. System.Addins It appears that System.Addins is meant to provide a robust add-in loading framework, with some sophisticated options for loading assemblies with varying levels of trusts and even running the out of process. It appears to be primarily code-based, and pretty code-heavy, with lots of assemblies that serve to insulate against versioning issues., using Guidance Automation to generate a good deal of code. So far I haven't found many System.AddIns articles that illustrate how it could be used to build something like an Eclipse RCP, and many people seem to be wringing their hands about its complexity. Mono.Addins It appears that Mono.Addins was influenced by System.Addins, SharpDevelop, and MonoDevelop. It seems to provide the basics from System.Addins, with less sophisticated options for plugin loading, but more simplicity, with attribute-based registration, XML manifests, and the infrastructure for online plugin repositories. It has a pretty good FAQ and documentation, as well as a fairly robust set of examples that really help paint a picture of how to develop an architecture like that of SharpDevelop or Eclipse. The examples use GTK for UI, but the framework itself is not coupled to GTK. So it appears to do #1 (add-in loading) pretty well and points the way to #2 (workbench framework). It appears that Mono.Addins was derived from MonoDevelop, but I haven't actually looked at whether MonoDevelop provides a good core workbench framework. Managed Extensibility Framework This is what everyone's talking about at the moment, and it's slowly getting clearer what it does, but I'm still pretty fuzzy, even after reading several posts on SO. The official word is that it "can live side-by-side" with System.Addins. However, it doesn't reference it and it appears to reproduce some of its functionality. It seems to me, then, that it is a simpler, more accessible alternative to System.Addins. It appears to be more like Mono.Addins in that it provides attribute-based wiring. It provides "catalogs" that can be attribute-based or directory-based. It does not seem to provide any XML or manifest-based wiring. So far I haven't found much documentation and the examples seem to be kind of "magical" and more reminiscent of attribute-based DI, despite the clarifications that MEF is not a DI container. Its license just got opened up, but it does reference WindowsBase -- not sure if that means it's coupled to Windows. Acropolis I'm not sure what this is. Is it MEF, or something that is still coming? Composite Application Blocks There are WPF and Winforms Composite Application blocks that seem to provide much more of a workbench framework. I have very little experience with these but they appear to rely on Guidance Automation quite a bit are obviously coupled with the UI layers. There are a few examples of combining MEF with these application blocks. I've done the best I could to answer my own question here, but I'm really only scratching the surface, and I don't have experience with any of these frameworks. Hopefully some of you can add more detail about the frameworks you have experience with. It would be great if we could end up with some sort of comparison matrix.

    Read the article

  • Any way to make a generic List where I can add a type AND a subtype?

    - by user383178
    I understand why I cannot do the following: private class Parent { }; private class Child extends Parent { }; private class GrandChild extends Child { }; public void wontCompile(List<? extends Parent> genericList, Child itemToAdd) { genericList.add(itemToAdd); } My question is there ANY practical way to have a typesafe List where you can call add(E) where E is known to be only a Parent or a Child? I vaguely remember some use of the "|" operator as used for wildcard bounds, but I cannot find it in the spec... Thanks!

    Read the article

  • Minecraft Style Chunk building problem

    - by David Torrey
    I'm having some problems with speed in my chunk engine. I timed it out, and in its current state it takes a total ~5 seconds per chunk to fill each face's list. I have a check to see if each face of a block is visible and if it is not visible, it skips it and moves on. I'm using a dictionary (unordered map) because it makes sense memorywise to just not have an entry if there is no block. I've tracked my problem down to testing if there is an entry, and accessing an entry if it does exist. If I remove the tests to see if there is an entry in the dictionary for an adjacent block, or if the block type itself is seethrough, it runs within about 2-4 milliseconds. so here's my question: Is there a faster way to check for an entry in a dictionary than .ContainsKey()? As an aside, I tried TryGetValue() and it doesn't really help with the speed that much. If I remove the ContainsKey() and keep the test where it does the IsSeeThrough for each block, it halves the time, but it's still about 2-3 seconds. It only drops to 2-4ms if I remove BOTH checks. Here is my code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Runtime.InteropServices; using OpenTK; using OpenTK.Graphics.OpenGL; using System.Drawing; namespace Anabelle_Lee { public enum BlockEnum { air = 0, dirt = 1, } [StructLayout(LayoutKind.Sequential,Pack=1)] public struct Coordinates<T1> { public T1 x; public T1 y; public T1 z; public override string ToString() { return "(" + x + "," + y + "," + z + ") : " + typeof(T1); } } public struct Sides<T1> { public T1 left; public T1 right; public T1 top; public T1 bottom; public T1 front; public T1 back; } public class Block { public int blockType; public bool SeeThrough() { switch (blockType) { case 0: return true; } return false ; } public override string ToString() { return ((BlockEnum)(blockType)).ToString(); } } class Chunk { private Dictionary<Coordinates<byte>, Block> mChunkData; //stores the block data private Sides<List<Coordinates<byte>>> mVBOVertexBuffer; private Sides<int> mVBOHandle; //private bool mIsChanged; private const byte mCHUNKSIZE = 16; public Chunk() { } public void InitializeChunk() { //create VBO references #if DEBUG Console.WriteLine ("Initializing Chunk"); #endif mChunkData = new Dictionary<Coordinates<byte> , Block>(); //mIsChanged = true; GL.GenBuffers(1, out mVBOHandle.left); GL.GenBuffers(1, out mVBOHandle.right); GL.GenBuffers(1, out mVBOHandle.top); GL.GenBuffers(1, out mVBOHandle.bottom); GL.GenBuffers(1, out mVBOHandle.front); GL.GenBuffers(1, out mVBOHandle.back); //make new list of vertexes for each face mVBOVertexBuffer.top = new List<Coordinates<byte>>(); mVBOVertexBuffer.bottom = new List<Coordinates<byte>>(); mVBOVertexBuffer.left = new List<Coordinates<byte>>(); mVBOVertexBuffer.right = new List<Coordinates<byte>>(); mVBOVertexBuffer.front = new List<Coordinates<byte>>(); mVBOVertexBuffer.back = new List<Coordinates<byte>>(); #if DEBUG Console.WriteLine("Chunk Initialized"); #endif } public void GenerateChunk() { #if DEBUG Console.WriteLine("Generating Chunk"); #endif for (byte i = 0; i < mCHUNKSIZE; i++) { for (byte j = 0; j < mCHUNKSIZE; j++) { for (byte k = 0; k < mCHUNKSIZE; k++) { Random blockLoc = new Random(); Coordinates<byte> randChunk = new Coordinates<byte> { x = i, y = j, z = k }; mChunkData.Add(randChunk, new Block()); mChunkData[randChunk].blockType = blockLoc.Next(0, 1); } } } #if DEBUG Console.WriteLine("Chunk Generated"); #endif } public void DeleteChunk() { //delete VBO references #if DEBUG Console.WriteLine("Deleting Chunk"); #endif GL.DeleteBuffers(1, ref mVBOHandle.left); GL.DeleteBuffers(1, ref mVBOHandle.right); GL.DeleteBuffers(1, ref mVBOHandle.top); GL.DeleteBuffers(1, ref mVBOHandle.bottom); GL.DeleteBuffers(1, ref mVBOHandle.front); GL.DeleteBuffers(1, ref mVBOHandle.back); //clear all vertex buffers ClearPolyLists(); #if DEBUG Console.WriteLine("Chunk Deleted"); #endif } public void UpdateChunk() { #if DEBUG Console.WriteLine("Updating Chunk"); #endif ClearPolyLists(); //prepare buffers //for every entry in mChunkData map foreach(KeyValuePair<Coordinates<byte>,Block> feBlockData in mChunkData) { Coordinates<byte> checkBlock = new Coordinates<byte> { x = feBlockData.Key.x, y = feBlockData.Key.y, z = feBlockData.Key.z }; //check for polygonson the left side of the cube if (checkBlock.x > 0) { //check to see if there is a key for current x - 1. if not, add the vector if (!IsVisible(checkBlock.x - 1, checkBlock.y, checkBlock.z)) { //add polygon AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.left); } } else { //polygon is far left and should be added AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.left); } //check for polygons on the right side of the cube if (checkBlock.x < mCHUNKSIZE - 1) { if (!IsVisible(checkBlock.x + 1, checkBlock.y, checkBlock.z)) { //add poly AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.right); } } else { //poly for right add AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.right); } if (checkBlock.y > 0) { //check to see if there is a key for current x - 1. if not, add the vector if (!IsVisible(checkBlock.x, checkBlock.y - 1, checkBlock.z)) { //add polygon AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.bottom); } } else { //polygon is far left and should be added AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.bottom); } //check for polygons on the right side of the cube if (checkBlock.y < mCHUNKSIZE - 1) { if (!IsVisible(checkBlock.x, checkBlock.y + 1, checkBlock.z)) { //add poly AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.top); } } else { //poly for right add AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.top); } if (checkBlock.z > 0) { //check to see if there is a key for current x - 1. if not, add the vector if (!IsVisible(checkBlock.x, checkBlock.y, checkBlock.z - 1)) { //add polygon AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.back); } } else { //polygon is far left and should be added AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.back); } //check for polygons on the right side of the cube if (checkBlock.z < mCHUNKSIZE - 1) { if (!IsVisible(checkBlock.x, checkBlock.y, checkBlock.z + 1)) { //add poly AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.front); } } else { //poly for right add AddPoly(checkBlock.x, checkBlock.y, checkBlock.z, mVBOHandle.front); } } BuildBuffers(); #if DEBUG Console.WriteLine("Chunk Updated"); #endif } public void RenderChunk() { } public void LoadChunk() { #if DEBUG Console.WriteLine("Loading Chunk"); #endif #if DEBUG Console.WriteLine("Chunk Deleted"); #endif } public void SaveChunk() { #if DEBUG Console.WriteLine("Saving Chunk"); #endif #if DEBUG Console.WriteLine("Chunk Saved"); #endif } private bool IsVisible(int pX,int pY,int pZ) { Block testBlock; Coordinates<byte> checkBlock = new Coordinates<byte> { x = Convert.ToByte(pX), y = Convert.ToByte(pY), z = Convert.ToByte(pZ) }; if (mChunkData.TryGetValue(checkBlock,out testBlock )) //if data exists { if (testBlock.SeeThrough() == true) //if existing data is not seethrough { return true; } } return true; } private void AddPoly(byte pX, byte pY, byte pZ, int BufferSide) { //create temp array GL.BindBuffer(BufferTarget.ArrayBuffer, BufferSide); if (BufferSide == mVBOHandle.front) { //front face mVBOVertexBuffer.front.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY + 1), z = (byte)(pZ + 1) }); mVBOVertexBuffer.front.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY) , z = (byte)(pZ + 1) }); mVBOVertexBuffer.front.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY) , z = (byte)(pZ + 1) }); mVBOVertexBuffer.front.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY) , z = (byte)(pZ + 1) }); mVBOVertexBuffer.front.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY + 1), z = (byte)(pZ + 1) }); mVBOVertexBuffer.front.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY + 1), z = (byte)(pZ + 1) }); } else if (BufferSide == mVBOHandle.right) { //back face mVBOVertexBuffer.back.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY + 1), z = (byte)(pZ) }); mVBOVertexBuffer.back.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY) , z = (byte)(pZ) }); mVBOVertexBuffer.back.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY) , z = (byte)(pZ) }); mVBOVertexBuffer.back.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY) , z = (byte)(pZ) }); mVBOVertexBuffer.back.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY + 1), z = (byte)(pZ) }); mVBOVertexBuffer.back.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY + 1), z = (byte)(pZ) }); } else if (BufferSide == mVBOHandle.top) { //left face mVBOVertexBuffer.left.Add(new Coordinates<byte> { x = (byte)(pX), y = (byte)(pY + 1), z = (byte)(pZ) }); mVBOVertexBuffer.left.Add(new Coordinates<byte> { x = (byte)(pX), y = (byte)(pY) , z = (byte)(pZ) }); mVBOVertexBuffer.left.Add(new Coordinates<byte> { x = (byte)(pX), y = (byte)(pY) , z = (byte)(pZ + 1) }); mVBOVertexBuffer.left.Add(new Coordinates<byte> { x = (byte)(pX), y = (byte)(pY) , z = (byte)(pZ + 1) }); mVBOVertexBuffer.left.Add(new Coordinates<byte> { x = (byte)(pX), y = (byte)(pY + 1), z = (byte)(pZ + 1) }); mVBOVertexBuffer.left.Add(new Coordinates<byte> { x = (byte)(pX), y = (byte)(pY + 1), z = (byte)(pZ) }); } else if (BufferSide == mVBOHandle.bottom) { //right face mVBOVertexBuffer.right.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY + 1), z = (byte)(pZ + 1) }); mVBOVertexBuffer.right.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY) , z = (byte)(pZ + 1) }); mVBOVertexBuffer.right.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY) , z = (byte)(pZ) }); mVBOVertexBuffer.right.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY) , z = (byte)(pZ) }); mVBOVertexBuffer.right.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY + 1), z = (byte)(pZ) }); mVBOVertexBuffer.right.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY + 1), z = (byte)(pZ + 1) }); } else if (BufferSide == mVBOHandle.front) { //top face mVBOVertexBuffer.top.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY + 1), z = (byte)(pZ) }); mVBOVertexBuffer.top.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY + 1), z = (byte)(pZ + 1) }); mVBOVertexBuffer.top.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY + 1), z = (byte)(pZ + 1) }); mVBOVertexBuffer.top.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY + 1), z = (byte)(pZ + 1) }); mVBOVertexBuffer.top.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY + 1), z = (byte)(pZ) }); mVBOVertexBuffer.top.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY + 1), z = (byte)(pZ) }); } else if (BufferSide == mVBOHandle.back) { //bottom face mVBOVertexBuffer.bottom.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY), z = (byte)(pZ + 1) }); mVBOVertexBuffer.bottom.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY), z = (byte)(pZ) }); mVBOVertexBuffer.bottom.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY), z = (byte)(pZ) }); mVBOVertexBuffer.bottom.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY), z = (byte)(pZ) }); mVBOVertexBuffer.bottom.Add(new Coordinates<byte> { x = (byte)(pX + 1), y = (byte)(pY), z = (byte)(pZ + 1) }); mVBOVertexBuffer.bottom.Add(new Coordinates<byte> { x = (byte)(pX) , y = (byte)(pY), z = (byte)(pZ + 1) }); } } private void BuildBuffers() { #if DEBUG Console.WriteLine("Building Chunk Buffers"); #endif GL.BindBuffer(BufferTarget.ArrayBuffer, mVBOHandle.front); GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(Marshal.SizeOf(new Coordinates<byte>()) * mVBOVertexBuffer.front.Count), mVBOVertexBuffer.front.ToArray(), BufferUsageHint.StaticDraw); GL.BindBuffer(BufferTarget.ArrayBuffer, mVBOHandle.back); GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(Marshal.SizeOf(new Coordinates<byte>()) * mVBOVertexBuffer.back.Count), mVBOVertexBuffer.back.ToArray(), BufferUsageHint.StaticDraw); GL.BindBuffer(BufferTarget.ArrayBuffer, mVBOHandle.left); GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(Marshal.SizeOf(new Coordinates<byte>()) * mVBOVertexBuffer.left.Count), mVBOVertexBuffer.left.ToArray(), BufferUsageHint.StaticDraw); GL.BindBuffer(BufferTarget.ArrayBuffer, mVBOHandle.right); GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(Marshal.SizeOf(new Coordinates<byte>()) * mVBOVertexBuffer.right.Count), mVBOVertexBuffer.right.ToArray(), BufferUsageHint.StaticDraw); GL.BindBuffer(BufferTarget.ArrayBuffer, mVBOHandle.top); GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(Marshal.SizeOf(new Coordinates<byte>()) * mVBOVertexBuffer.top.Count), mVBOVertexBuffer.top.ToArray(), BufferUsageHint.StaticDraw); GL.BindBuffer(BufferTarget.ArrayBuffer, mVBOHandle.bottom); GL.BufferData(BufferTarget.ArrayBuffer, (IntPtr)(Marshal.SizeOf(new Coordinates<byte>()) * mVBOVertexBuffer.bottom.Count), mVBOVertexBuffer.bottom.ToArray(), BufferUsageHint.StaticDraw); GL.BindBuffer(BufferTarget.ArrayBuffer,0); #if DEBUG Console.WriteLine("Chunk Buffers Built"); #endif } private void ClearPolyLists() { #if DEBUG Console.WriteLine("Clearing Polygon Lists"); #endif mVBOVertexBuffer.top.Clear(); mVBOVertexBuffer.bottom.Clear(); mVBOVertexBuffer.left.Clear(); mVBOVertexBuffer.right.Clear(); mVBOVertexBuffer.front.Clear(); mVBOVertexBuffer.back.Clear(); #if DEBUG Console.WriteLine("Polygon Lists Cleared"); #endif } }//END CLASS }//END NAMESPACE

    Read the article

  • Help with java GUI- has error in main thread

    - by jan
    Hello guys, Basically im trying to do a Insurance Application form in java. And it uses multiple JPanels in a JFrame. -adding of JPanel into main program frame was done like this: //jpCenterArea to hold jp1-jp7 jpCenterArea.add(jp1); jpCenterArea.add(jp2); jpCenterArea.add(jp3); jpCenterArea.add(jp4); ...etc ********Add Jpanels to JFrame*****/ add(jpTitle, BorderLayout.NORTH); add(jpCenterArea, BorderLayout.CENTER); add(jpBottom, BorderLayout.SOUTH); However, even though program can compile, it cannot be run. error as mentioned below: Exception in thread "main" java.lang.NullPointerException at java.awt.Container.addImpl<Container.java:1045> at java.awt.Container.add<Container.java:365> at TravelInsuranceApplication.<init>TravelInsuranceApplication.java:120> at TravelInsuranceApplication.main<TravelInsuranceApplication.java:154> 1 import javax.swing.*; 2 import java.awt.*; 3 public class TravelInsuranceApplication extends JFrame 4 { 5 //declare private variables 6 private JLabel jlblTitle, jlblName, jlblNRIC, jlblAdd, jlblPostal, jlblContact, jlblDOB, 7 jlblEmail, jlblPeriod; 8 private JLabel jlblDeparture, jlblDays, jlblZone, jlblPlan; 9 private JTextField jtfName, jtfIC, jtfAdd, jtfPostal, jtfContact, jtfEmail, jtfZone; 10 private JRadioButton jrbResident, jrbOffice, jrbDeluxe, jrbClassic, jrbAsia, jrbWorldwide; 11 private ButtonGroup bgContact, bgZone, bgPlan; 12 private JComboBox jcDay, jcMonth, jcYear; 13 private JButton jbtnSubmit, jbtnCalculate, jbtnClear; 14 private JPanel jpTitle,jp1, jp2, jp3, jp4, jp5, jp6, jp7, jpBottom, jpCenterArea; 15 String[] day = {"1", "2", "3"}; 16 String[] month = {"january", "february"}; 17 String[] year = {"1981", "1985", "1990", "1995"}; 18 19 //constructor and GUI development 20 public TravelInsuranceApplication() 21 { 22 setSize(500,200); 23 setTitle("Travel Insurance Application"); 24 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 25 setLayout(new BorderLayout()); 26 27 //create ALL component objects/ 28 jlblTitle = new JLabel("Travel Insurance Application: "); 29 jlblName = new JLabel("Name of Insured: "); 30 jlblNRIC = new JLabel("NRIC: "); 31 jlblAdd = new JLabel("Address: "); 32 jlblPostal = new JLabel("Postal Code: "); 33 jlblContact = new JLabel("Telephone: "); 34 jlblDOB = new JLabel("Date Of Birth: "); 35 jlblEmail = new JLabel("Email Address: "); 36 jlblPeriod = new JLabel("Period Of Insurance "); 37 jlblDeparture = new JLabel("Departure Date "); 38 jlblDays = new JLabel("How Many Days To Insure "); 39 jlblZone = new JLabel("Zone: "); 40 jlblPlan = new JLabel("Plan: "); 41 42 jtfName = new JTextField(50); 43 jtfIC = new JTextField(15); 44 jtfAdd = new JTextField(50); 45 jtfPostal = new JTextField(15); 46 jtfContact = new JTextField(15); 47 jtfEmail = new JTextField(50); 48 jtfZone = new JTextField(100); 49 50 jrbResident = new JRadioButton("Rseident/Pgr"); 51 jrbOffice = new JRadioButton("Office/HP"); 52 jrbAsia = new JRadioButton("Asia"); 53 jrbAsia = new JRadioButton("Worldwide"); 54 jrbDeluxe = new JRadioButton("Deluxe"); 55 jrbClassic = new JRadioButton("Classic"); 56 57 jcDay = new JComboBox(day); 58 jcMonth = new JComboBox(month); 59 jcYear = new JComboBox(year); 60 61 jbtnSubmit = new JButton("Submit"); 62 jbtnCalculate = new JButton("Calculate"); 63 jbtnClear = new JButton("Clear"); 64 65 /****create JPanels - jpTitle, JpCenterArea & jp2-jp8 , jpBottom + setLayout 66 for ALL JPanels******/ 67 jpTitle = new JPanel(new FlowLayout(FlowLayout.CENTER)); 68 jpCenterArea = new JPanel(new FlowLayout()); 69 jp1 = new JPanel(new FlowLayout()); 70 jp2 = new JPanel(new FlowLayout(FlowLayout.CENTER)); 71 jp3 = new JPanel(new FlowLayout()); 72 jp4 = new JPanel(new FlowLayout()); 73 jp5 = new JPanel(new FlowLayout()); 74 jp6 = new JPanel(new FlowLayout(FlowLayout.CENTER)); 75 jp7 = new JPanel(new FlowLayout(FlowLayout.CENTER)); 76 jpBottom = new JPanel(new FlowLayout(FlowLayout.CENTER)); 77 78 79 80 81 //add components to JPanels 82 jpTitle.add(jlblTitle); 83 84 //jp1 85 jp1.add(jlblName); 86 jp1.add(jtfName); 87 jp1.add(jlblNRIC); 88 jp1.add(jtfIC); 89 90 //jp2 91 jp2.add(jlblAdd); 92 jp2.add(jtfAdd); 93 jp2.add(jlblPostal); 94 jp2.add(jtfPostal); 95 96 //jp3 97 jp3.add(jlblContact); 98 jp3.add(jtfContact); 99 jp3.add(jrbResident); 100 jp3.add(jrbOffice); 101 jp3.add(jlblDOB); 102 jp3.add(jcDay); 103 jp3.add(jcMonth); 104 jp3.add(jcYear); 105 106 //jp4 107 jp4.add(jlblEmail); 108 jp4.add(jtfEmail); 109 110 //jp5 111 jp5.add(jlblPeriod); 112 jp5.add(jlblDeparture); 113 jp5.add(jcDay); 114 jp5.add(jcMonth); 115 jp5.add(jcYear); 116 jp5.add(jlblDays); 117 jp5.add(jcDay); 118 119 //jp6 120 jp6.add(jlblZone); 121 jp6.add(jrbAsia); 122 jp6.add(jrbWorldwide); 123 jp6.add(jlblPlan); 124 jp6.add(jrbDeluxe); 125 jp6.add(jrbClassic); 126 127 //jp7 128 jp7.add(jtfZone); 129 130 //jpCenterArea to hold jp1-jp7 131 jpCenterArea.add(jp1); 132 jpCenterArea.add(jp2); 133 jpCenterArea.add(jp3); 134 jpCenterArea.add(jp4); 135 jpCenterArea.add(jp5); 136 jpCenterArea.add(jp6); 137 jpCenterArea.add(jp7); 138 139 //jpBottom 140 jpBottom.add(jbtnSubmit); 141 jpBottom.add(jbtnCalculate); 142 jpBottom.add(jbtnClear); 143 144 /********Add Jpanels to JFrame*****/ 145 add(jpTitle, BorderLayout.NORTH); 146 add(jpCenterArea, BorderLayout.CENTER); 147 add(jpBottom, BorderLayout.SOUTH); 148 149 setVisible(true); 150 151 152 153 }//end null constructor 154 public static void main(String[] args) 155 { 156 TravelInsuranceApplication travel = new TravelInsuranceApplication(); 157 158 }//end main 159 160 }//end class

    Read the article

  • SQLAuthority News – Guest Post – Performance Counters Gathering using Powershell

    - by pinaldave
    Laerte Junior Laerte Junior has previously helped me personally to resolve the issue with Powershell installation on my computer. He did awesome job to help. He has send this another wonderful article regarding performance counter for readers of this blog. I really liked it and I expect all of you who are Powershell geeks, you will like the same as well. As a good DBA, you know that our social life is restricted to a few movies over the year and, when possible, a pizza in a restaurant next to your company’s place, of course. So what we have to do is to create methods through which we can facilitate our daily processes to go home early, and eventually have a nice time with our family (and not sleeping on the couch). As a consultant or fixed employee, one of our daily tasks is to monitor performance counters using Perfmom. To be honest, IDE is getting more complicated. To deal with this, I thought a solution using Powershell. Yes, with some lines of Powershell, you can configure which counters to use. And with one more line, you can already start collecting data. Let’s see one scenario: You are a consultant who has several clients and has just closed another project in troubleshooting an SQL Server environment. You are to use Perfmom to collect data from the server and you already have its XML configuration files made with the counters that you will be using- a file for memory bottleneck f, one for CPU, etc. With one Powershell command line for each XML file, you start collecting. The output of such a TXT file collection is set to up in an SQL Server. With two lines of command for each XML, you make the whole process of data collection. Creating an XML configuration File to Memory Counters: Get-PerfCounterCategory -CategoryName "Memory" | Get-PerfCounterInstance  | Get-PerfCounterCounters |Save-ConfigPerfCounter -PathConfigFile "c:\temp\ConfigfileMemory.xml" -newfile Creating an XML Configuration File to Buffer Manager, counters Page lookups/sec, Page reads/sec, Page writes/sec, Page life expectancy: Get-PerfCounterCategory -CategoryName "SQLServer:Buffer Manager" | Get-PerfCounterInstance | Get-PerfCounterCounters -CounterName "Page*" | Save-ConfigPerfCounter -PathConfigFile "c:\temp\BufferManager.xml" –NewFile Then you start the collection: Set-CollectPerfCounter -DateTimeStart "05/24/2010 08:00:00" -DateTimeEnd "05/24/2010 22:00:00" -Interval 10 -PathConfigFile c:\temp\ConfigfileMemory.xml -PathOutputFile c:\temp\ConfigfileMemory.txt To let the Buffer Manager collect, you need one more counters, including the Buffer cache hit ratio. Just add a new counter to BufferManager.xml, omitting the new file parameter Get-PerfCounterCategory -CategoryName "SQLServer:Buffer Manager" | Get-PerfCounterInstance | Get-PerfCounterCounters -CounterName "Buffer cache hit ratio" | Save-ConfigPerfCounter -PathConfigFile "c:\temp\BufferManager.xml" And start the collection: Set-CollectPerfCounter -DateTimeStart "05/24/2010 08:00:00" -DateTimeEnd "05/24/2010 22:00:00" -Interval 10 -PathConfigFile c:\temp\BufferManager.xml -PathOutputFile c:\temp\BufferManager.txt You do not know which counters are in the Category Buffer Manager? Simple! Get-PerfCounterCategory -CategoryName "SQLServer:Buffer Manager" | Get-PerfCounterInstance | Get-PerfCounterCounters Let’s see one output file as shown below. It is ready to bulk insert into the SQL Server. As you can see, Powershell makes this process incredibly easy and fast. Do you want to see more examples? Visit my blog at Shell Your Experience You can find more about Laerte Junior over here: www.laertejuniordba.spaces.live.com www.simple-talk.com/author/laerte-junior www.twitter.com/laertejuniordba SQL Server Powershell Extension Team: http://sqlpsx.codeplex.com/ Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: SQL, SQL Add-On, SQL Authority, SQL Performance, SQL Query, SQL Server, SQL Tips and Tricks, SQL Utility, T SQL, Technology Tagged: Powershell

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >