Posts

Showing posts from September 9, 2018

What is the difference betwee Yaafe and PyAudioAnalysis?

Image
Clash Royale CLAN TAG #URR8PPP What is the difference betwee Yaafe and PyAudioAnalysis? I'm new to audio feature extraction. It seems like Yaafe (and its Meyda Javascript clone) and PyAudioAnalysis are the two biggest libraries, but I can't find a comparison of them anywhere. Can anyone tell me if either one has more features, or is better suited to a different type of task? I'm aiming to generate graphical scores automatically based on features extracted from mp3s. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Retrieve primary key ID before persisting using sessionfactory in hibernate

Image
Clash Royale CLAN TAG #URR8PPP Retrieve primary key ID before persisting using sessionfactory in hibernate I have used below code to get primary key in hibernate before persisting Object. But its inserting duplicate rows in DB. The issue here I am facing is: 1. I am getting two values for primary key. One when I invoke the flushPerson() method to get 'id' before persisting Person Object. 2. Other when I invoke save method, to save Person object. In this method also 'Id' is getting incremented. PersonController.java public Person createNewPerson(String .....) Person per = new Person(); personManager.flushPerson(per); RandomNumberGenerator rng = new RandomNumberGenerator(); String randomStrng = rng.generateRandomNumber(); String cientCode = per.getId()+randomStrng; per.setPersonClientCode(cientCode); per.setPersonClient(); per.setPersonField(); personManager.save(per); PersonHibernateDao.java @Override public void flushPerson(Person per) sessionFactory.getC

Varaible in If statement in ActionListener

Image
Clash Royale CLAN TAG #URR8PPP Varaible in If statement in ActionListener I'm making an app, with multiple classes, and in one class i have some code to assign a random number from 1 - 6 to a variable. In another class i have a JLabel showing this variable. And in another class i have a JButton, with a ActionListener, within this is an IF Statement, with the variable with the random number in. The variable is in Class1. package Dice; public class DiceRoll public int DICEONE; public int DICETWO; private int max = 6; private int min = 1; public void DiceRollMethod() DICEONE = (int) (Math.floor(Math.random() * (max - min + 1)) + min); DICETWO = (int) (Math.floor(Math.random() * (max - min + 1)) + min); System.out.println(DICEONE); System.out.println(DICETWO); The variable is 'DICEONE' The JLabel is in Class2 (which rolls the dice). package Dice; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JLab

How can one fetch user input from EditText from list of fragmens?

Image
Clash Royale CLAN TAG #URR8PPP How can one fetch user input from EditText from list of fragmens? My code is structured such that the "drawer activity" calls upon one of several fragment drawers that each contains a list of fragment items that utilize ItemAdapter to create a fragment list. ItemAdapter My main problem is that i have been trying to retrieve EditText with afterTextChanged() in item adapter but always get a NullPointerException and I want to be able to retrive the value that the user has just put in. EditText afterTextChanged() NullPointerException Any and all suggestions in a civil manner are much appreciated. Drawer activity public class Drawers extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener public static boolean isSealBroken; public static int DrawerChosen; @Override protected void onCreate(Bundle savedInstanceState) super.onCreate(savedInstanceState); System.out.println(savedInstanceState); setContentView(R.la

how can i convert two forms to components and adding components to view in angular 5

Image
Clash Royale CLAN TAG #URR8PPP how can i convert two forms to components and adding components to view in angular 5 I have two forms that are currently running fine on same component. as show in InfoAndQualificationComponent.ts import Component, OnInit from '@angular/core'; import FormGroup, FormControl from "@angular/forms"; @Component( selector: 'app-info-and-qualification', template: `<form class="form-horizontal" [formGroup]="form" (ngSubmit)="form.value"> <div class="form-group"> <input type="text" class="form-control" placeholder="firstname" formControlName="firstname"> </div> <div class="form-group"> <input type="text" class="form-control" placeholder="lastname" formControlName="lastname"> </div> <div class="form-group"style="margin-top:50px"> <

Neural net with duplicated inputs - Keras

Image
Clash Royale CLAN TAG #URR8PPP Neural net with duplicated inputs - Keras I have a dataset of N videos each video is characterized by some metrics (that will be inputs for a neural net) my goal is to predict the score that a person will give when he or she watches the video. The problem is that in my dataset each video was watched more than once by different subjects, so I was forced to duplicate the same metrics (inputs) the number of time the video was watched to keep all the scores given by the subjects. I built an MLP model to predictet the scores. But when I calculate the RMSE it's always higher than 0.7. I want to know if having a dataset like that would affect the performance of my model ? And how can I deal with it ? Here is how the dataset looks like: The first 5 columns are the inputs and the last one is the score of subjects. Note that all of them are normalized. Here is my Model: def mlp_model(): # create model model = Sequential() model.add(Dense(100,input_

I want to create Audio calling App in android studio with FCM is it possible

Image
Clash Royale CLAN TAG #URR8PPP I want to create Audio calling App in android studio with FCM is it possible I am trying to build a simple chat application, but it requires Voice calls functionality to other users. I would be using Firebase for messaging. Does Firebase have Voice calls support? 3 Answers 3 You can use WebRTC for Audio call and use FCM for signaling. But Firebase as a service does not provide any support for Audio/Video calls. You can also use third party SDKs like Twilio. no firebase does not support voice call support. It is support service like push notification using FCM. Please doc. of firebase – Sourabh Patil Aug 10 at 11:43 @SourabhPatil, documentation contains only what it does support , no what it does not . – Vladyslav Matviienko Aug 10 at 12:10 yes exactly right @VladyslavMatviienko – amit Aug 10 at 12:15 @amit thnx for help – Sourabh Patil Aug 16 at 10:22 FCM is for push notifications. Previously there was GCM, but it is d

req.body always return as undefined

Image
Clash Royale CLAN TAG #URR8PPP req.body always return as undefined i try to create register api but got some problem with req.body thats always return as undefined when i console.log it here my controller.js const users: User = require('../models/index'); const config = require('../config/config'); const jwt = require('jsonwebtoken') const jwtSignUser = (user) => const ONE_WEEK = 60 * 60 * 24 * 7 return jwt.sign(user, config.authentication.jwtSecret, expiresIn: ONE_WEEK ) module.exports = async register (req, res) try const user = await User.create(req.body) const userJson = user.toJSON() res.send( user: userJson, token : jwtSignUser(userJson) ) catch (err) res.status(400).send( error:err ) , here my body parser declaration app.use(bodyParser.urlencoded( extended: false )); app.use(bodyParser.json()); anyone can notice whats wrong with it? Please share what you are posting to your api along with the headers – Guruparan Giritharan

Multi otsu(multi-thresholding) with openCV

Image
Clash Royale CLAN TAG #URR8PPP Multi otsu(multi-thresholding) with openCV I am trying to carry out multi-thresholding with otsu. The method I am using currently is actually via maximising the between class variance, I have managed to get the same threshold value given as that by the OpenCV library. However, that is just via running otsu method once. Documentation on how to do multi-level thresholding or rather recursive thresholding is rather limited. Where do I do after obtaining the original otsu's value? Would appreciate some hints, I been playing around with the code, adding one external for loop, but the next value calculated is always 254 for any given image:( My code if need be: //compute histogram first cv::Mat imageh; //image edited to grayscale for histogram purpose //imageh=image; //to delete and uncomment below; cv::cvtColor(image, imageh, CV_BGR2GRAY); int histSize[1] = 256; // number of bins float hranges[2] = 0.0, 256.0; // min andax pixel value const float* rang

C# sqlite entity framework - map string type

Image
Clash Royale CLAN TAG #URR8PPP C# sqlite entity framework - map string type In SQLite in table I have column: Title and type of this column is string. Now I want to map this table to Entity Framework in C#. And problem is with type string of that column because I cannot map it to string type in C#. It works when I change in SQLite string to VARCHAR. But how to resolve this problem without changing column type? 1 Answer 1 Most SQL database engines (every SQL database engine other than SQLite, as far as we know) uses static, rigid typing. With static typing, the datatype of a value is determined by its container - the particular column in which the value is stored. SQLite uses a more general dynamic type system. In SQLite, the datatype of a value is associated with the value itself, not with its container. The dynamic type system of SQLite is backwards compatible with the more common static type systems of other database engines in the sense that SQL statements that work o

Automate actions using chrome extension

Image
Clash Royale CLAN TAG #URR8PPP Automate actions using chrome extension I am developing chrome extension to automate actions using javascript. some actions require mouse drag simulation and for that I want to use robot js. can anyone please help me with using robot js methods in content.js of chrome extension files.I am not able to use function from another javascript file having robot js methods into content.js file. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Avoid Index Out Of Range error in swift

Image
Clash Royale CLAN TAG #URR8PPP Avoid Index Out Of Range error in swift In my UICollectionView I'm trying to return 1 item, if there's no data (in order to set an empty cell then). Here is the code: var movies = [Movies]() func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int if movies.count == 0 return 1 else return movies.count I'm getting Fatal Error: Index Out Of Range. I know, that this way I'm trying to access an element under index[1] and that's impossible, because that element doesn't exist, that's the reason of this error. But how can I avoid it in this case? In this function you are saying... If I have no items... tell the collection view that I have 1 item. If you just return movies.count here your problem will go away. Also... your crash is not here... it is somewhere else. – Fogmeister Aug 10 at 11:36 movies.count 1 Answer 1 As of you are returning 1 count in numberOfItemsI

Can events fired from an iframe be handled by elements in its parent?

Image
Clash Royale CLAN TAG #URR8PPP Can events fired from an iframe be handled by elements in its parent? Suppose I have a page located at www.example.com/foo , and it contains an <iframe> with src="http://www.example.com/bar" . I want to be able to fire an event from /bar and have it be heard by /foo . Using the Prototype library, I've tried doing the following without success: www.example.com/foo <iframe> src="http://www.example.com/bar" /bar /foo Element.fire(parent, 'ns:frob'); When I do this, in Firefox 3.5, I get the following error: Node cannot be used in a document other than the one in which it was created" code: "4 Line 0 Not sure if that's related to my problem. Is there some security mechanism that's preventing scripts in /bar from kicking off events in /foo ? /bar /foo Are foo and bar in the same domain? – Annie Jan 12 '10 at 4:34 @Annie the scheme and domain portions of the URL's are the