Posts by Ericson Willians • 518 points
26 posts
-
0
votes1
answer52
viewsA: Javascript mask is breaking if I type the date quickly
I believe you should wear onKeyPress instead of onKeyUp: <DateInput name="date" placeholder="Data" value={this.props.data} dateFormat="DD/MM/YYYY" onChange={this.props.changeDataTarefa}…
-
2
votes1
answer28
viewsA: Question about class integration in React Javascript components
I created a little example: import React from "react"; import ReactDOM from "react-dom"; import "./styles.css"; class List { constructor() { this.data = []; } add(data) { this.data.push(data);…
-
1
votes1
answer174
viewsA: React, Redux, Mobx] What is the best way to manage status with paging?
"The best way" is the best way for your case. You can save in store the individual page that each component is "observing" in the list, so that each component would have its individual access to the…
-
0
votes2
answers520
viewsA: Function with React Native parameters
Since you are using an Arrow Function as a callback, it is not necessary to give a bind in the constructor. Remove the bind line and it will probably work.
-
0
votes1
answer59
viewsA: React: Appbar material-ui is not shown
Check the code to find out if the component is being rendered or not. Suggestions: Remove that "ghost div" that precedes the <AppBar> and let the <AppBar> as a root. Add a className for…
-
0
votes1
answer47
viewsA: How do I know whether or not to update a component?
You need to save in store that the profile data of the user in question have already been loaded. That is, in the componentDidMount, you check in the store if the hasUserDataLoaded (Linked to userid…
-
0
votes2
answers817
viewsA: Is it possible to pass parameters from one route to another without going through the url in reactjs?
You can use the Redux to save data on store the moment you change route (so that the data will be accessible on the other screens). Similarly, you can use the Connected-React-router, that already…
-
0
votes2
answers1035
viewsA: Listing files from a folder
The method getSelectedFiles of javax.swing.Jfilechooser returns a File[]. You can use it to return an array of File Objects, after enabling multiple selection with setMultiSelectionEnabled. If you…
javaanswered Ericson Willians 518 -
1
votes1
answer99
viewsA: Uncover partition
I thought of a "gambiarra" here :p. You could take the full path in which the application is using the method getCanonicalPath of java.io.File, and then filter the char of the partition using the…
-
3
votes2
answers2053
viewsA: Time comparison
You can compare times using methods after and before of java.util.Date. I made a small example in "pure Java" to illustrate how to make such a comparison: import java.text.ParseException; import…
-
1
votes1
answer165
viewsA: How to replace a string letter when it is masked?
It’s very simple using the method setCharAt of Stringbuilder. I created an example to illustrate (Can copy everything and run): import java.awt.Dimension; import java.awt.event.ActionEvent; import…
-
1
votes1
answer770
viewsA: Capture webcam image and save every 1 second?
I implemented a simple class called TimedWebcam using the webcam-capture of sarxes: Timedwebcam.java: import java.awt.Dimension; import java.io.File; import java.io.IOException; import…
-
3
votes1
answer93
viewsA: Problems with database connection
Make sure port 3306 is not busy on the server (Things unpredictable can block, such as Skype). Check that Mysql is configured to allow a string empty as password (I’ve been there. Try to exchange…
-
0
votes1
answer865
viewsA: print Qrcode directly Zebra printer by python
My son, you are trying to concatenate an image to a string, which makes no sense. Change the label to: label = """ ^XA ^FO10,15 ^A0,40,20 ^FD ^FS ^FO10,60 ^A0,40,20 ^FD Test Zebra ^FS ^FO10,105…
-
1
votes1
answer334
viewsA: Problems importing cx_oracle in python 3.4 64 bits
Try to install by Pip as reported in cx_Oracle page in Source Forge. pip install cx_Oracle Pip always checks the Python version when downloading the library. If your Python is 64 bits, it will look…
-
1
votes1
answer651
viewsA: How to copy the path of a selected file in Window Explorer?
You can use the module win32clipboard of Pywin32 (Most likely you already have it installed). The Getclipboarddata() function (which is usually used for text) accepts a format specification…
-
2
votes2
answers671
viewsA: In java, how to make only one Jframe window close when clicking on the x instead of all?
Just use the class constant Jframe, DISPOSE_ON_CLOSE, in the method setDefaultCloseOperation(int), instead of EXIT_ON_CLOSE. Here’s a little example I worked out: Window.java import…
-
1
votes1
answer1267
viewsA: Floating point format in java
It is possible to do this with a combination of Decimalformat and Double.parseDouble(). I created a custom Double called Formatteddouble that extends Decimalfloat to accomplish what you want. See…
javaanswered Ericson Willians 518 -
0
votes1
answer654
viewsA: Java Swing terminal emulator?
Gabriel, this is easy to do using a Jtextpane. I created a small example using a file just for you to test there. import java.awt.BorderLayout; import java.awt.EventQueue; import javax.swing.JFrame;…
-
3
votes1
answer672
viewsA: Delete information from a vector that is in another C++ class
The implementation is excellent, but this is a design problem. You have the option to use composition or inheritance. Using composition, the Student class could have Note objects. Therefore, to…
-
1
votes2
answers335
viewsA: Good graphical library for beginners?
Opengl and Direct3d are only required if you want to work with 3D. In C (just like C++), the most popular ones are SDL and Allegro (Which are in their new versions currently, with support for…
canswered Ericson Willians 518 -
0
votes1
answer51
viewsA: Allegro does not perform anything graphic
You have forgotten the parentheses in al_flip_display(). So the display will never be updated with each iteration (And you will never see the ship (Nothing)).
-
-2
votes2
answers1375
viewsA: What’s the difference between On heap and Off Heap in Java - JVM Memory
JVM has a heap / free store of defined size, and this size can be altered. In C++, to allocate memory in the heap, use the operator new (If you do not use the new operator, the memory is allocated…
-
0
votes1
answer46
viewsA: Make a loop for 2 cells by clicking
The only reason why you see the change from one text to the other, is the fact that it happens under the condition of occurrence of an event (which in the case of you click the mouse button). If you…
-
3
votes1
answer493
viewsA: How do I get an image of the computer inside a java application?
You must use a Jfilechooser with Filefilter. In the official tutorials of Oracle, there is an example of how to restrict it to files with image extension, only. See this part specifically: Filtering…
-
-1
votes1
answer744
viewsA: Vector class and random numbers in C++
Answering the last question asked in the comments (Since you already found the problem). #include <stdlib.h> #include <time.h> #include <iostream> #include <vector> int…