• Breaking News

    Sunday, April 8, 2018

    Correct term for a thin object which has been stripped of most data. Ask Programming

    Correct term for a thin object which has been stripped of most data. Ask Programming


    Correct term for a thin object which has been stripped of most data.

    Posted: 08 Apr 2018 05:20 PM PDT

    In web programming we need to present a list of list elements in the UI, and when the element is clicked, the corresponding record is downloaded in full from the server.

    Is there a term for a thin object that contains only the entity ID and other basic info. I just call them "xxxShell".

    Bonus: If you would care to comment on my system, here it is. The user has an array with normalized references to various fat entities. When the app is loaded, the we download a list of the "shells", which are generated by a database query that strips them. If one if created in the UI, it is immediately uploaded and a reference is made to the user (step 1) and is immediately loaded into the UI. How many software engineering/systems rules does this break? I am using no SQL -- should I just generate and store the shells on the server or is it cool to generate them every time the user launches the app for the first time?

    submitted by /u/squirrelofarabia
    [link] [comments]

    PyTesseract not recognizing single letter characters

    Posted: 08 Apr 2018 03:18 PM PDT

    I am trying to translate a few pngs into their character String representation. I've tried several configurations, but none seem to get the result I need. Does anyone have any suggestions?

    All my code and issue is here:

    Explanation

    submitted by /u/pablolikescats
    [link] [comments]

    Javascript web-scraper + display

    Posted: 08 Apr 2018 07:20 PM PDT

    My title says most of it but leaves out some details, can someone give me some rough pseudo-code on how this would work and the best way to output it in a 'dashboard' with 10 squares.

    submitted by /u/Veil1
    [link] [comments]

    SQL standards compliance matrix

    Posted: 08 Apr 2018 06:36 AM PDT

    Is there's something like caniuse.com, except for compliance of various RDBMSes with various standards, like type definitions from SQL:1999?

    submitted by /u/asdvnjkfaqweavjklajk
    [link] [comments]

    (Java) How to iterate through a bunch of sets to find the largest one?

    Posted: 08 Apr 2018 05:56 PM PDT

    I have a hash map: HashMap<String, Set<String>>.

    How can I iterate though all of the sets in the map to find the largest set?

    submitted by /u/PuppyLand95
    [link] [comments]

    Java EE learning curve

    Posted: 08 Apr 2018 10:19 AM PDT

    Hello, I learnt Sping Core, Spring MVC, Spring AOP, Hibernate, Servlet+JSP.

    I would like to start learning Java EE.. What technologies of JAVA EE should I learn? Java EE is soo huge, so I would like to focus on parts of Java EE that are really used in development.

    Thank you very much

    submitted by /u/Arthymoon
    [link] [comments]

    How to program a working reset button for a Tic Tac Toe Game?

    Posted: 08 Apr 2018 02:41 PM PDT

    Below you can see the code for the Tic Tac Toe game I must develop. However I have not yet figured out how to get a reset button working so that it doesn't just remove the X's and O's and gets rid of the actual values. If anyone could provide any help it would be greatly appreciated as this is college work that needs to be handed in.

    package colourgrid;

    import javax.swing.JOptionPane; import java.awt.Color; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton;

    public class ColourGrid extends javax.swing.JFrame implements ActionListener{

    private final int rows = 3; private final int cols = 3; private Cell[][] cells; private boolean player; public ColourGrid() { initComponents(); cells = new Cell[rows][cols]; player = true; this.jPanel1.setLayout(new GridLayout(rows, cols)); for(int i = 0; i < rows * cols; i++) { int row = i / rows; int col = i % cols; Cell btn = new Cell(row, col, Color.GRAY); btn.addActionListener(this); cells[row][col] = btn; this.jPanel1.add(btn); } } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { jPanel1 = new javax.swing.JPanel(); jButton1 = new javax.swing.JButton(); jTextField1 = new javax.swing.JTextField(); jTextField2 = new javax.swing.JTextField(); jButton2 = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setAlwaysOnTop(true); setBackground(new java.awt.Color(0, 0, 0)); setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); setForeground(new java.awt.Color(255, 153, 0)); jPanel1.setBackground(new java.awt.Color(244, 164, 66)); jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder(new java.awt.Color(102, 102, 102), new java.awt.Color(0, 0, 0))); jPanel1.setForeground(new java.awt.Color(255, 102, 0)); jPanel1.setDoubleBuffered(false); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 431, Short.MAX_VALUE) ); jButton1.setBackground(new java.awt.Color(255, 102, 0)); jButton1.setForeground(new java.awt.Color(255, 255, 255)); jButton1.setText("Reset Game"); jButton1.setBorder(null); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jTextField1.setBackground(new java.awt.Color(255, 102, 0)); jTextField1.setForeground(new java.awt.Color(255, 255, 255)); jTextField1.setText("player2"); jTextField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField1ActionPerformed(evt); } }); jTextField2.setBackground(new java.awt.Color(255, 102, 0)); jTextField2.setForeground(new java.awt.Color(255, 255, 255)); jTextField2.setText("player1"); jButton2.setBackground(new java.awt.Color(255, 102, 0)); jButton2.setForeground(new java.awt.Color(255, 255, 255)); jButton2.setText("Help"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jLabel1.setText("Please enter your names."); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(27, 27, 27) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(32, 32, 32) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(42, 42, 42) .addComponent(jLabel1))) .addGap(58, 58, 58) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 106, Short.MAX_VALUE) .addComponent(jButton2) .addGap(68, 68, 68)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton2)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(jLabel1) .addGap(12, 12, 12) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField2) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold> private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { for(int i = 0; i < rows * cols; i++) { int row = i / rows; int col = i % cols; cells[rows][cols].setText(null); /////////////////////////////////////////This is the reset section///////////////////////////////////////// } } private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) { } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { JOptionPane.showMessageDialog(null,"Click a tile to start the game!"); } public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ColourGrid().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel1; private javax.swing.JPanel jPanel1; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; // End of variables declaration @Override public void actionPerformed(ActionEvent e) { Cell clicked = (Cell) e.getSource(); String c; if(player) { c = "X"; } else { c = "O"; } clicked.onClick(c); if(foundRow(cells[0][0], cells[0][1], cells[0][2]) || foundRow(cells[1][0], cells[1][1], cells[1][2]) || foundRow(cells[2][0], cells[2][1], cells[2][2]) || foundRow(cells[0][0], cells[1][0], cells[2][0]) || foundRow(cells[0][1], cells[1][1], cells[2][1]) || foundRow(cells[0][2], cells[1][2], cells[2][2]) || foundRow(cells[0][0], cells[1][1], cells[2][2]) || foundRow(cells[0][2], cells[1][1], cells[2][0])) { String playerWin; if(player) { playerWin = jTextField1.getText(); } else { playerWin = jTextField2.getText(); } System.out.println(playerWin + " wins!"); } player = !player; } public boolean foundRow(Cell one, Cell two, Cell three) { if(!one.clicked && !two.clicked && !three.clicked) { return false; } if(one.getText() == two.getText() && two.getText() == three.getText()) { return true; } return false; } 

    }

    submitted by /u/TKK_TKK
    [link] [comments]

    I need a distraction from work!!

    Posted: 08 Apr 2018 01:57 PM PDT

    Work is really boring i have to do calls all day and maybe 1 or 2 people pick up, we do have managers and cameras so we really cannot browse the web. But i was thinking about using this, <div style="height:60px;width:1020px;border:1px solid #ccc;font:16px/26px Georgia, Garamond, Serif;overflow:auto;"> Here i would paste a whole book and read it through the day on the footer with inspect element </div> But the problem is the computers are so old and bad they sometimes lag and take minutes of freezing time "RED FLAG" for me because a manager could pass by . is there a way to use justpaste.it or any chrome extention that could work as a browser(since its small i think it would be not noticeable by the cameras if i use the browser on an extention.)

    Any tips, ideas could help if it only takes 2 to 3 lines of text. just to keep me busy so i dont go insane.

    submitted by /u/leunot
    [link] [comments]

    I need an API for bar code scanning UK products.

    Posted: 08 Apr 2018 05:16 AM PDT

    I found an app called Nutricheck, that scans bar-codes and gives you a detailed breakdown of what food you've ordered (supermarket its from, calories etc.... I would love to be able to use the same API they are to grab data from bar-codes but I couldn't see if they were using a public one or one they have built themselves.

    Can anybody help me out either with some links to similar API's or how I would go bout finding these API's OR even how to build API's as I have never done that before :)

    submitted by /u/benbenbenagain
    [link] [comments]

    Z80 ASM practice program?

    Posted: 07 Apr 2018 11:07 PM PDT

    I'm trying to learn the Z80 Assembly language and everything is going great except for one little problem; I have no way to practice what I'm learning and test programs. I'm wondering if there's some kind of emulator that I can write pure Z80 code for and see the current values of registers and particular memory locations. Any help would be greatly appreciated.

    TLDR; I need a virtual environment to test my Z80 code

    submitted by /u/Janderts
    [link] [comments]

    Any Go experts use dep for dependency management? How do you all get your projects to build without conflicting with dep's "no $GOPATH/src as dep root" rule?

    Posted: 08 Apr 2018 09:08 AM PDT

    My project looks like this:

    $GOPATH/src/ └── repo_name ├── constants //for project-wide constants, credentials, etc ├── Gopkg.lock // dep file ├── Gopkg.toml // dep file ├── main.go ├── app1_name // I have two "reusable" apps in this project ├── app2_name └── vendor // here's were `dep ensure` installs all the vendor app 
    • repo_name directory is necessary, because dep can't use $GOPATH/src as a root directory.
    • I can't run go build because it can't find the dependencies:

      main.go:18:5: cannot find package "github.com/lib/pq" in any of: /usr/local/go/src/github.com/lib/pq (from $GOROOT), /go/src/repo_name/src/github.com/lib/pq (from $GOPATH)

    • I can't rename the dependencies (eg vendor/github.com/lib/pq) because:

      main.go:18:5: must be imported as github.com/lib/pq

    What do proper Go engineers typically do to dep and build working cooperatively? If it makes a difference, I'm doing this within the official docker Golang image.

    submitted by /u/yorbit
    [link] [comments]

    Illogical pointer declaration in C?

    Posted: 08 Apr 2018 04:33 AM PDT

    int *p = &i;

    From what I understand, * is the dereferencing symbol and & is the referencing symbol. So p is pointing somewhere, and * assigns the location a value. But if we want to point p towards i, why are we assigning the address of i to the location p is pointing to? Isn't this how it should be done?

    int *p; p = &i;

    Please correct me if I'm wrong and thanks a lot!

    submitted by /u/NeuralCow
    [link] [comments]

    How can I peek into a process's memory on Windows?

    Posted: 07 Apr 2018 10:59 PM PDT

    I am currently editing a program for a video game that just recently get updated. The update breaks the program, and from debugging I trace the root of the problem back to a bunch of pointers to the memory's program. How can I take a peek into the program's memory to find out the correct pointer I should put into my program? Thanks

    submitted by /u/throwaway89195
    [link] [comments]

    (Think this would belong here or askprogramming) Question: how to bypass a Windows 7 user password?/Obtain user access again? (My own laptop)

    Posted: 08 Apr 2018 02:20 AM PDT

    Don't know where else to ask this, please help

    Posted: 07 Apr 2018 10:33 PM PDT

    How would I go about removing a live updating element from a website and moving it to another tab on another monitor.

    submitted by /u/Blakealan123
    [link] [comments]

    No comments:

    Post a Comment