Search Results

Search found 4 results on 1 pages for 'nulll'.

Page 1/1 | 1 

  • How to prevent bad queries from breaking replication?

    - by nulll
    For my personal experience, mysql replication is fragile. I know that there area many things not to do beacuse they could break replication, but we are humans and the error could always occur. So I was thinking... is there a way to enforce mysql replication? Something that prevents queries that are dangerous for the replication to be runt? In other words I'm searching for something that saves replication even if I accidentally run evil queries.

    Read the article

  • jQuery .Ajax() function selector , store specific data in variable

    - by user279321
    I am new to jQuery and I have the following problem. My project has say 2 pages, 1.JSP and 2.html. Now I want to pick selected data from 2.html and use it on 1.JSP. Now this was achieved very easily using .load but I want the data to be present in a JavaScript variable rather than put it on the page (div tags, etc.), so that I can work upon that data (modify or add to database). I tried using .ajax and was able to write the following code: var value = (function () { var val = nulll; var filename = " 2.html"; $.ajax ({ 'async': false, 'global': false, 'url': filename, 'success' : function(data) { val = data; } }) return val; })() document.write(value) Where do I put the selector format (say div.id5) so that my variable have only relevant data rather than the full file data?

    Read the article

  • How can I update a Jtextarea once? (mysql side-?)

    - by user1294196
    Ok what I've been trying to do is figure out how to make it so when I press the search button on my program the code that is currently just being printed to the console will print to the text area I have. I can't figure out how to do this and I've searched google and still found no answer. And while I'm at it if anyone could help me figure out how to send this same line of information to a mysql database that would help greatly. package GTE; import java.awt.EventQueue; public class GTE { private JFrame frmGte; public String hashq = "..."; public String twtresults; public int refresh = 1; public static void main(String[] args) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { try { GTE window = new GTE(); window.frmGte.setVisible(true); } catch (Exception e) {} } }); } /** * Create the application. * @throws IOException * @throws FontFormatException */ public GTE(){ try { initialize(); } catch (FontFormatException e) {} catch (IOException e) {} } /** * Initialize the contents of the frame. * @throws IOException * @throws FontFormatException */ private void initialize() throws FontFormatException, IOException { frmGte = new JFrame(); frmGte.setResizable(false); frmGte.setTitle("GTE"); frmGte.setBounds(100, 100, 450, 390); frmGte.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); GridBagLayout gridBagLayout = new GridBagLayout(); gridBagLayout.columnWidths = new int[]{434, 0}; gridBagLayout.rowHeights = new int[]{21, 0, 0, 0, 0, 0, 0, 0, 0}; gridBagLayout.columnWeights = new double[]{0.0, Double.MIN_VALUE}; gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE}; frmGte.getContentPane().setLayout(gridBagLayout); JLabel GTETitle = new JLabel("Personal Tweet Extractor"); InputStream is = this.getClass().getResourceAsStream("ultraviolentbb_reg.ttf"); Font GTEFont = Font.createFont(Font.TRUETYPE_FONT,is); Font f = GTEFont.deriveFont(24f); GTETitle.setFont(f); GTETitle.setHorizontalAlignment(SwingConstants.CENTER); GridBagConstraints gbc_GTETitle = new GridBagConstraints(); gbc_GTETitle.insets = new Insets(0, 0, 5, 0); gbc_GTETitle.anchor = GridBagConstraints.NORTH; gbc_GTETitle.fill = GridBagConstraints.HORIZONTAL; gbc_GTETitle.gridx = 0; gbc_GTETitle.gridy = 0; frmGte.getContentPane().add(GTETitle, gbc_GTETitle); Label label_2 = new Label("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); GridBagConstraints gbc_label_2 = new GridBagConstraints(); gbc_label_2.insets = new Insets(0, 0, 5, 0); gbc_label_2.gridx = 0; gbc_label_2.gridy = 1; frmGte.getContentPane().add(label_2, gbc_label_2); JLabel SearchTweets = new JLabel("Search For Tweets With" + hashq + ":"); GridBagConstraints gbc_SearchTweets = new GridBagConstraints(); gbc_SearchTweets.insets = new Insets(0, 0, 5, 0); gbc_SearchTweets.gridx = 0; gbc_SearchTweets.gridy = 2; frmGte.getContentPane().add(SearchTweets, gbc_SearchTweets); JLabel label = new JLabel("#"); GridBagConstraints gbc_label = new GridBagConstraints(); gbc_label.insets = new Insets(0, 0, 5, 0); gbc_label.gridx = 0; gbc_label.gridy = 3; frmGte.getContentPane().add(label, gbc_label); JButton Search = new JButton("Start Search"); Search.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { TS(hashq); GTE.this.refresh = 0; try { nulll dialog = new nulll(); dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); dialog.setVisible(true); } catch (Exception e) {} } public void TS(String hashtag){ Twitter twitter = new TwitterFactory().getInstance(); try { System.out.println(hashtag); QueryResult result = twitter.search(new Query("#" + hashtag)); List<Tweet> tweets = result.getTweets(); for (Tweet tweet : tweets) { System.out.println("@" + tweet.getFromUser() + " : " + tweet.getText()); GTE.this.twtresults = ("@" + tweet.getFromUser() + " : " + tweet.getText()); } } catch (TwitterException te) { te.printStackTrace(); System.out.println("Failed to search tweets: " + te.getMessage()); System.exit(-1); } } }); TextField textField = new TextField(); textField.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { GTE.this.hashq = evt.getActionCommand(); } }); GridBagConstraints gbc_textField = new GridBagConstraints(); gbc_textField.ipadx = 99; gbc_textField.insets = new Insets(0, 0, 5, 0); gbc_textField.gridx = 0; gbc_textField.gridy = 4; frmGte.getContentPane().add(textField, gbc_textField); GridBagConstraints gbc_Search = new GridBagConstraints(); gbc_Search.insets = new Insets(0, 0, 5, 0); gbc_Search.gridx = 0; gbc_Search.gridy = 5; frmGte.getContentPane().add(Search, gbc_Search); Label label_1 = new Label("Search Results For Tweets With"); GridBagConstraints gbc_label_1 = new GridBagConstraints(); gbc_label_1.insets = new Insets(0, 0, 5, 0); gbc_label_1.gridx = 0; gbc_label_1.gridy = 6; frmGte.getContentPane().add(label_1, gbc_label_1); TextArea textArea = new TextArea(); textArea.setText(twtresults); textArea.setEditable(false); GridBagConstraints gbc_textArea = new GridBagConstraints(); gbc_textArea.gridx = 0; gbc_textArea.gridy = 7; frmGte.getContentPane().add(textArea, gbc_textArea); JMenuBar menuBar = new JMenuBar(); frmGte.setJMenuBar(menuBar); JMenu Filemenu = new JMenu("File"); menuBar.add(Filemenu); JMenuItem Exititem = new JMenuItem("Exit"); Exititem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { System.exit(0); } }); Filemenu.add(Exititem); JMenu Helpmenu = new JMenu("Help"); menuBar.add(Helpmenu); JMenuItem Aboutitem = new JMenuItem("About"); Helpmenu.add(Aboutitem); } }

    Read the article

  • How would you structure your entity model for storing arbitrary key/value data with different data t

    - by Nathan Ridley
    I keep coming across scenarios where it will be useful to store a set of arbitrary data in a table using a per-row key/value model, rather than a rigid column/field model. The problem is, I want to store the values with their correct data type rather than converting everything to a string. This means I have to choose either a single table with multiple nullable columns, one for each data type, or a set of value tables, one for each data type. I'm also unsure as to whether I should use full third normal form and separate the keys into a separate table, referencing them via a foreign key from the value table(s), or if it would be better to keep things simple and store the string keys in the value table(s) and accept the duplication of strings. Old/bad: This solution makes adding additional values a pain in a fluid environment because the table needs to be modified regularly. MyTable ============================ ID Key1 Key2 Key3 int int string date ---------------------------- 1 Value1 Value2 Value3 2 Value4 Value5 Value6 Single Table Solution This solution allows simplicity via a single table. The querying code still needs to check for nulls to determine which data type the field is storing. A check constraint is probably also required to ensure only one of the value fields contains non-nulll data. DataValues ============================================================= ID RecordID Key IntValue StringValue DateValue int int string int string date ------------------------------------------------------------- 1 1 Key1 Value1 NULL NULL 2 1 Key2 NULL Value2 NULL 3 1 Key3 NULL NULL Value3 4 2 Key1 Value4 NULL NULL 5 2 Key2 NULL Value5 NULL 6 2 Key3 NULL NULL Value6 Multiple-Table Solution This solution allows for more concise purposing of each table, though the code needs to know the data type in advance as it needs to query a different table for each data type. Indexing is probably simpler and more efficient because there are less columns that need indexing. IntegerValues =============================== ID RecordID Key Value int int string int ------------------------------- 1 1 Key1 Value1 2 2 Key1 Value4 StringValues =============================== ID RecordID Key Value int int string string ------------------------------- 1 1 Key2 Value2 2 2 Key2 Value5 DateValues =============================== ID RecordID Key Value int int string date ------------------------------- 1 1 Key3 Value3 2 2 Key3 Value6 How do you approach this problem? Which solution is better? Also, should the key column be separated into a separate table and referenced via a foreign key or be should it be kept in the value table and bulk updated if for some reason the key name changes?

    Read the article

1