on-internet

Eclipse&Maven - The import org.hibernate.boot.cannot be resolved

I am building an Maven&Spring&Hibernate&JSF project on Eclipse.While compiling the program I have StandardServiceRegistryBuilder cannot be resolved to a type The import org.hibernate.boot.cannot be resolved errors. Main class is as follows: package com.test; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.Configuration; import com.hibernate.data.Person; public class Main { public static void main(String [] args){ Configuration configuration = new Conf

Join the discussion →

MVC (Razor) Filter DropDownList

I'm new to MVC and JavaScript and I have a question about DropDownList. I Build a program of "Car Renting" and I have a View that allow adding new Car to the inventory. The view include 2 dropdownlists (see below): <div class="editor-field"> @Html.DropDownList("ManufacturerId", string.Empty) @Html.ValidationMessageFor(model => model.ManufacturerId) </div> <div class="editor-label"> @Html.LabelFor(model => model.ModelId) </div> <div class="editor-field"> @Html.DropDownList("ModelId", string.Empty) @Html.ValidationMessageFor(model => model.ModelId) </div> I want that when user select a manufactu

Join the discussion →

Remove CRLF from large text file

I have a 1Gig file with couple of million lines. Trying to remove CRLF at the end of each line. Have tried EmEdit, GVIM, Notepad++, UltraEdit. Only EMEdit will load file, but it is unbelievably slow on the replace. Maybe 10 lines a second. Don;t have enough years left in my life to wait for this to complete. I am not a programmer so I am strictly using the UI dialog boxes. Don't really know what else to do. Thanks

Join the discussion →

MYSQL Error 1060 - Duplicate Column

How can i avoid getting error 1060? CREATE VIEW `new-query` AS SELECT L1.Inv_Num, L1.Line_Num, P1.Prod_SKU, P1.Prod_Descript, L2.Line_Num, P2.Prod_SKU, P2.Prod_Descript, P1.Brand_ID FROM LGLINE L1, LGLINE L2, LGPRODUCT P1, LGPRODUCT P2 WHERE P1.Prod_Category IN ('SEALER') AND P2.Prod_Category IN ('TOP COAT');

Join the discussion →

get the current location fast and once in android

I have an android application that need device current location (latitude and longitude). I've tried some tutorial on the net and specially some solutions from stack overflow, but they doesn't work well for me. My requirement is so simple: First I need it to be fast and need the location once when I the fragment starts. Second I need it to be as precise as possible, I mean it should use GPS first if GPS is not available then use Network provider. For example, I've tried this solution but it return null after 30 second, but I know there is some all the things is ok because google map and other

Join the discussion →

Using Principal Component Analysis (PCA) for feature reduction (HOG-PCA)

Using Histogram of Ordered Gradients (HoG) I have computed features of 15 sample images. The feature vectors generated by these samples are very large (i.e., take up a lot of memory). To reduce these feature vectors, I am using principal component analysis (PCA). Here is the OpenCV code I am using: PCA pca(imageT, Mat(), CV_PCA_DATA_AS_ROW, 300); pca.project(imageT, imageT1); In imageT Matrix, number of rows = number of samples Number of columns = number of features Suppose for 15 images Number of rows of imageT is 15 and number of columns is 57,400. I want 300 features after applying PCA; it

Join the discussion →

Adding with carry on PIC16 (or similar)

There is no "add with carry" instruction on PIC 16. But what if I had to add larger data quantity than just a byte? All the Web resources and Microchip application notes I've found suggest something like: MOVF LSB_A, w ADDWF LSB_B MOVF MSB_A, w BTFSC STATUS, C INCFSZ MSB_A, w ADDWF MSB_B but the code above will just not work. I mean the 16-bit result will be correct, but the carry won't be set properly, so you can't just expand the computational range by repeating the second part of the code above. Am I right so far? Below is my implementation of addition with carry: MOVF BYTE1, w BTFSC STATUS

Join the discussion →

How to save an image with the Python Image Library

I am a beginner in Python, so this question might be stupid but unfortunately I can't figure it out on my own. With the following script I want to create a black image and save it under the following path: C:/Users/User/Desktop/black.png def create_file(x=1000,y=10): img = Image.new('RGB', (x,y), "black") #creates a new black image img.save('C://Users/User/Desktop/black.png')` The point is now that I want to pretend the path, the filename and the filetype with the function is like that: create_image(x=1000,y=10,path=C://Users/bsimon/Desktop/,filename=black,filetype=png)` And there the struggle

Join the discussion →

Which element is the 'middle' in a B-Tree of even order?

If I have a B-Tree of order 4 with the following data in it... To add 2 to the tree, which variant is correct? Do I add the 2 to the node (making it invalid, as it now has 4 keys), then split the node, taking the value 2 as the middle value and propagating it up? Or do I not add the 2, take 3 as the middle value, propagate 3 up, then add 2 into the correct node? Excuse the poor diagram.

Join the discussion →

Cakephp 3.0 Login

I'm facing trouble with my login system. I managed to register my user in my database but whenever I try to log in, it keeps prompting "Invalid email or password, try again". This is my model: <?php namespace App\Model\Table; use Cake\ORM\Table; use Cake\Validation\Validator; class UsersTable extends Table { public function validationDefault(Validator $validator) { return $validator ->notEmpty('email', 'A email is required') ->add('email', 'valid' , ['rule'=> 'email']) ->add('email', [ 'unique' => ['rule' => 'validateUnique', 'provider' => 'table'] ]) ->requirePresence('email','create') ->notE

Join the discussion →

Killing a QProcess in Qt

I would like to know how to kill a QProcess in Qt, Linux. I start an external application say like an app that displays image (full screen), with no title bar, so no close button. Now I need to close this application say after 5 secs. How do I do that in Qt? void MainWindow::Dialog() { ...... ...... connect(pbLaunchImage,SIGNAL(released()),this, SLOT(launchImage())); //I am guessing a connect here to kill the started process } void MainWindow::launchImage() { qWarning("Launching Image..."); p->execute("/usr/bin/fancyImage"); } EDIT: I still haven't figured it out but I found a workaround since

Join the discussion →

install APK from my server in secure way

I wants to install application(APK) from my server. what is the best approach for it. I wants to not to stolen my apk in any way by anyone. except root device.Just for now i am downloading apk from server to SDCard and install it then remove it from SDCard. User can stole it from SDCard.

Join the discussion →

Select2 upon click(not selected), show loading spinner javascript

Ok my code is quite simple. I am using sample data but in my real code, upon clicking the select2 dropdown, the data takes a long time to load and to counter that i want to include a loading spinner that shows when the dropdown is clicked and hides after the data has finished loading. So far, i cant get it work. It works when select2 is changed or selected but not when it is clicked. Any suggestions <div class="col-sm-3 loader"> <%= select_tag 'clone-application-id', options_from_collection_for_select(@applications, :id, :case_code), prompt: "Please Select", class: "form-horizontal single-sele

Join the discussion →

How can I automatically confirm subscription to SNS Notifications

I regularly spin up and spin down elastic beanstalk environments which have my team's email set as the notification address. Is there a way I can automatically confirm subscription to all of the SNS topics that are created instead of having to manually click a link in an email every time (and miss a few)?

Join the discussion →

How to add any event in fullcalendar on click of button?

I have added ('+') button on each day/ cells. var add_button = '<input type="button" value="+" />'; $(".fc-day-number").prepend(add_button); How to add event after clicking on this ('+') button, able to do the same on click of any day by writing this: dayClick: function(date) { addEvent(date); }, function addEvent(date) { var newEvent = { title: timeSlot, start: date.format() }; }

Join the discussion →

How to view query that was used to create a table?

I create about 15 tables and create relationships and constraints among them using Wizard in SQL Server 2012 express Now i want to see the query that is used to create those tables including relationships and constraints. Can u provide help? Thank you.

Join the discussion →

Make table column dragable (sort) in bootstrap

I designed a table in bootstrap and a list of column name. I want when I drag any column name in list or table column it will drag both.(table column and list li) Check this link table column is dragable. When you drag table column it runs. Go to your mouse table column name and drag. $(document).ready(function() { $('.table').dragtable(); $('.list').dragtable(); }); (function($) { $.widget("akottr.dragtable", { options: { revert: false, // smooth revert dragHandle: '.table-handle', // handle for moving cols, if not exists the whole 'th' is the handle maxMovingRows: 40, // 1 -> only header. 40

Join the discussion →

Automate input to brute-force a program running in cli with Python

I'm currently trying to complete all levels on Over the Wire's Bandit 'wargame'. One of the levels (level 24), requires that I connect to a port, on which a daemon is running. This daemon asks to input a password and a 4-digit pin. The password is already known (it is provided at the end of the previous level), the pin is unknown. The indication is that it's necessary to 'brute-force' it. Entering a wrong pin results in this message: "Wrong! Please enter the correct pincode. Try again.". I decided to write a python script that automates the process. The script would: 1) Connect to the port via

Join the discussion →

Windows Batch script to get filename as input and search the file in a folder location

I want to create a windows batch file which includes 3 tasks mainly: 1.It will ask for the user input like: Please Enter file name to search: where you have to give a file name and depending on the file name it will search in some specified location. 2.If the file is found ,again it will search for some pattern(e.g-"Error") in that file. 3.Copy 10 lines from the line where the pattern was found and paste the contents into another file. Example: You have entered file name as: DemoFile 1.It will search for DemoFile.log in specified location. 2.If above file is found then it will search for some

Join the discussion →

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-e7AmlG/django-filter

Im trying to run a pip install on a pip_requirements.txt (readthedocs local install) file in Cygwin within a virtualenv and am running into some issues. Python version:Python 2.7.8 pip version: pip 6.0.8 virtualenv: 12.0.7 Here is the console output. Whats odd is that it cannot find the directory and never creates the temp directory. This install works fine on linux, I am just running into issues on the windows box. Any help would be greatly appreciated!

Join the discussion →

Where are the fix() and edit() functions in RStudio Server?

I followed the official guide to install RStudio Server. Everything works fine, but the functions, fix and edit, are not available. For instance, I have a data.frame called "data" as follows. 1,2,3 4,5,6 7,8,9 The command "View(data)" works fine. But when I execute the command "edit(data)" or "fix(data)", it comes some error messages. The error messages of "fix(data)" : Error in .External2(C_dataentry, datalist, modes) : unable to start data editor In addition: Warning message: In edit.data.frame(get(subx, envir = parent), title = subx, ...) : unable to open display The error message of "edit(

Join the discussion →

Playing with video.js ustream m3u8 file streaming

I have tried to play in a web page a m3u8 file streaming with video.js, But I could not do it, I do not know where the mistake is <!DOCTYPE html> <html> <head> <meta charset=utf-8 /> <title>Video</title> <link href="http://vjs.zencdn.net/4.12/video-js.css" rel="stylesheet"> <script src="http://vjs.zencdn.net/4.12/video.js"></script> <script src="https://github.com/videojs/videojs-contrib-media-sources/releases/download/v0.1.0/videojs-media-sources.js"></script> <script src="https://github.com/videojs/videojs-contrib-hls/releases/download/v0.11.2/videojs.hls.min.js"></script> </head> <body> <h1

Join the discussion →

What would the periodic table of a 4-Dimensional universe look like?

In this question, I asked about a universe with (amongst other things) 4 large spatial dimensions. In 3 dimensions, we have the familiar periodic table with its familiar arrangement of atoms in the S, P, D, F and the predicted G & H blocks. However, in four dimensions (with the assumption that electrons, neutrons and protons exist), what would the periodic table look like, given that there is another dimension in which to put electrons? Also, since in four dimensions, objects can have two axes of spin, would electrons have four possible spin states rather than two as in 3-dimensions, resulting

Join the discussion →

Pointer-to-array overlapping end of array

Is this code correct? int arr[2]; int (*ptr)[2] = (int (*)[2]) &arr[1]; ptr[0][0] = 0; Obviously ptr[0][1] would be invalid by accessing out of bounds of arr. Note: There's no doubt that ptr[0][0] designates the same memory location as arr[1]; the question is whether we are allowed to access that memory location via ptr. Here are some more examples of when an expression does designate the same memory location but it is not permitted to access the memory location that way. Note 2: Also consider **ptr = 0; . As pointed out by Marc van Leeuwen, ptr[0] is equivalent to *(ptr + 0), however ptr + 0

Join the discussion →

Why does PCA give a vector as output for a 294*40 matrix in matlab?

I am new to stats and matlab too. I have to do feature selection in my project so I used principle component analysis(pca). I referred tutorial to use pca in matlab My code is given below, pcaInput = rand(294,40); disp(size(pcaInput)) % output is 294 40 pcaOutput=pca(pcaInput); disp(size(pcaOutput)) % output is 40 1 , Unacceptable as per tutorial %that's it As per the tutorial , if the input matrix of pca() function has p variables , then the output is pp matrix.So the function should give me a matrix of 4040 but it is giving me a matrix of 40*1. where I am going wrong ? As per the tutorial ,

Join the discussion →

What do I need to know about traveling to Dubai during Ramadan?

I bought tickets to Dubai for the summer for a small vacation (first week of July). Unfortunately, I did not realize it was during Ramadan. I have been told by a few acquaintances that the laws in Dubai are especially strict during Ramadan and you can even receive citations for drinking water (given that it's almost the hottest month of the year, this seems miserable). Additionally, I have heard that many places are closed (such as bars/clubs) and there is far less to do in the city. I will be traveling with my girlfriend. We were told by one of her friends in Dubai that she does not feel comf

Join the discussion →

Notepad++ syntax highlighting : conflict in rules

I have customized a new language in Notepad++. My problem is that I have two keywords: LAYER and LAYER_ENCODING. In the menu Languages > Define Your language > Select your defined language, LAYER is mentioned in the first tab Syntax folding whereas LAYER_ENCODING is mentioned in the second tab Keywords lists. Here is the syntax coloration I get for LAYER_ENCODING: I seems that LAYER_ENCODING keyword is not recognized because LAYER already exists. Any idea on how I could solve this problem? EDIT: Here are my custom rules: <NotepadPlus> <UserLang name="Mapfile" ext="map" udlVersion="2.1"> <Setti

Join the discussion →

Lottery Program Problems

I'm currently in progress of creating my second main C program. I've only just started to learn C and I've had a few problems, as well confusion on what to do next with this program. The idea is to basically allow the user to enter in a desired amount of years, then the program simulates the lottery games played every week, depending on how many years they enter. Then inside the program, I want the two arrays to compare to each other and check for any numbers they both have at the same time. The lottery ticket on the user's end stays the same, which is set inside the array and of course, the r

Join the discussion →
Older stories