This is weird, could you show us the console please?

Yes, it was, used this method with ant to build my jar file and it worked well.

Hi guys,

I've made an application in JavaFX and I do want to export it into a runnable jar.
When I run it from Eclipse or Netbeans, it works well.
But when I run it from windows as an executable jar I get this error for my layout.

Exception in Application start method
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(
Caused by: java.lang.RuntimeException: Exception in Application start method
        at com.sun.javafx.application.LauncherImpl.launchApplication1(
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$152(
        at com.sun.javafx.application.LauncherImpl$$Lambda$2/ Source)
Caused by: java.lang.IllegalStateException: Location is not set.
        at javafx.fxml.FXMLLoader.loadImpl(
        at javafx.fxml.FXMLLoader.load(
        at application.MainApp.initRootLayout(
        at application.MainApp.start(
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$159(
        at com.sun.javafx.application.LauncherImpl$$Lambda$52/ Source)
        at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$172(
        at com.sun.javafx.application.PlatformImpl$$Lambda$48/ Source)
        at com.sun.javafx.application.PlatformImpl.lambda$null$170(
        at com.sun.javafx.application.PlatformImpl$$Lambda$50/ Source)
        at Method)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(
        at com.sun.javafx.application.PlatformImpl$$Lambda$49/ Source)
        at Method)
        at$$Lambda$38/ Source)
        ... 1 more

My code looks like this on the 47'th line loader.setLocation(getClass().getResource("../application/view/RootLayout.fxml"));

private void initRootLayout() {
    try {
        // Load root layout from fxml file.
        FXMLLoader loader = new FXMLLoader();
        rootLayout = (BorderPane) loader.load();
        // Show the scene containing the root layout
        Scene scene = new Scene(rootLayout);

    } catch(IOException e) {

Got the problem, I've changed the layout from RelativeLayout to LinearLayout and it is all working fine.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=""

        android:minWidth="200dp" />

        android:layout_alignParentStart="true" />

        android:smoothScrollbar="true" />

Sorry, here it is :)

My Model:

public class ImagesModel {
    private int sapCode;
    private String imagePath;
    private int icon;

    public ImagesModel(int sapCode, String imagePath, int icon) {
        this.sapCode = sapCode;
        this.imagePath = imagePath;
        this.icon = icon;

    public int getSapCode() {
        return sapCode;

    public String getImagePath() {
        return imagePath;

    public int getIcon() {
        return icon;

And My Activity

import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.squareup.picasso.Picasso;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;


 * Created by Szabi.Zsoldos on 28/04/2015.
public class ImagesListView extends Activity {

    private List<ImagesModel> myImages = new ArrayList<ImagesModel>();
    long totalSize = 0;

    protected void onCreate(Bundle savedInstanceState) {


    private void populateImageList() {
        new GetReportFromAPI().execute();

    private void populateListView() {
        ArrayAdapter<ImagesModel> adapter = new MyListAdapter();
        ListView list = (ListView) findViewById(;

    private class MyListAdapter extends ArrayAdapter<ImagesModel> {

        public MyListAdapter() {
            super(ImagesListView.this, R.layout.item_view, myImages);

        public View getView(int position, View convertView, ViewGroup parent) {
            // Make sure we have a view to work with
            View itemView = convertView;
            if(itemView == null) {
                itemView = getLayoutInflater().inflate(R.layout.item_view, parent, false);

            // find the image to work with
            ImagesModel currentImage = myImages.get(position);

            // fill the view

            ImageView imageView = (ImageView) itemView.findViewById(;
            try {
            } catch(Exception e) {

            TextView sapCode = (TextView) itemView.findViewById(;
            sapCode.setText("" + currentImage.getSapCode());

            TextView imagePath = (TextView) itemView.findViewById(;
            imagePath.setText(currentImage.getImagePath()); ...

Hi guys,

I'm having a weird problem regarding the simple ListView.
On my emulator everything is allright and the data is loaded correctly from JSON API, the data also loads on my device.
The problem is that on my emulator, the listview is populated but on my real device, not, why ?

1.jpg 2.jpg

This might help you alot: Click Here

I would do it like this, create an invisible isPosted value and check if on the index.php it's set with isset($_POST['isPosted'])

    <form method="post" action="index.php" enctype="multipart/form-data">
    First name:<br>
    <input type="text" name="First_Name">
    Last name:<br>
    <input type="text" name="Sur_Name">
    <input type="text" name="Cus_Address">
    <input type="text" name="Cus_Email">
    <input type="text" name="Phone_Num">
    <input type="submit" value="Submit">
    <input type="hidden" name="isPosted" value="1" />

Try the below code as the insert query and see the output

if(isset($_POST['isPosted']) && $_POST['isPosted'] == 1) {
    $insertedData = mysql_query($serverConnection,"INSERT INTO customertable(CustomerId,FirstName, SurName, Address, PhoneNum, Email, ProductPurchase) VALUES( 'NULL', '$_POST[First_Name]', '$_POST[Sur_Name]', '$_POST[Cus_Address]', '$_POST[Phone_Num]', '$_POST[Cus_Email]', '3')" ) or die(mysql_error());
} else {
    die('No POST data found.');

It would be much easier to use the PDO class for MySQL queries.
Also, try to make a rule for your case typing on your Variables.

Try this, first create your PDO server connection as $connection

$customer_id = $_POST[Customer_ID];
$first_post = $_POST[First_Post];
$sur_name = $_POST[Sur_Name];
$cus_address = $_POST[Cus_Address];
$phone_num = $_POST[Phone_Num];
$cus_email = $_POST[Cus_Email];
$product_purchase = $_POST[Product_Purchase];

$sql = 'INSERT INTO customertable( `CustomerID`, `FirstName`, `SurName`, `Address`, `PhoneNum`, `Email`, `PurchaseProduct`) VALUES(:customer_id, :first_post, :sur_name, :cus_address, :phone_num, :cus_email, :product_purchase)';

$query = $connection->prepare($sql);
    ':customer_id'      =>  $customer_id,
    ':first_post'       =>  $first_post,
    ':sur_name'         =>  $sur_name,
    ':cus_address'      =>  $cus_address,
    ':phone_num'        =>  $phone_num,
    ':cus_email'        =>  $cus_email,
    ':product_purchase' =>  $product_purchase,
broj1 commented: This i the way to go +11
//Try this

    <select name='price' id='price'>
        <option <?=((isset($_POST['price']) && $_POST['price'] == '')?'SELECTED="SELECTED"':'')?> value='' >Select....</option>
        <option <?=((isset($_POST['price']) && $_POST['price'] == '0-50,000')?'SELECTED="SELECTED"':'')?> value='0-50,000'>0-50,000</option>
        <option <?=((isset($_POST['price']) && $_POST['price'] == '50,000-100,000')?'SELECTED="SELECTED"':'')?> value='50,000-100,000'>50,000-100,000</option>
        <option <?=((isset($_POST['price']) && $_POST['price'] == '100,000-150,000')?'SELECTED="SELECTED"':'')?> value='100,000-150,000'>100,000-150,000</option>
        <option <?=((isset($_POST['price']) && $_POST['price'] == '150,000-200,000')?'SELECTED="SELECTED"':'')?> value='150,000-200,000'>150,000-200,000</option>
        <option <?=((isset($_POST['price']) && $_POST['price'] == '200,000 and above')?'SELECTED="SELECTED"':'')?> value='200,000 and above'>200,000 and above</option>
        <option <?=((isset($_POST['price']) && $_POST['price'] == 'see all')?'SELECTED="SELECTED"':'')?> value='see all'>See All</option>

I am using mpdf for example and it works just great.
My aproach is that every time a customer request a document it's get generated on the fly and it's pushed to download via a header function.

Thanks pritaeas for the heads up, it was a great start :)
This is my final implementation and it works great.

        echo '<table width="600" cellpadding="0" cellspacing="0" border="0" class="table table-condensed">';    
        echo '<tbody>';        
        $previous = '';
        foreach($promotii as $promotie) {            
            if ($previous != $promotie->Marca) {
                if (!empty($previous)) {
                } else {
                    $previous = $promotie->Marca;

                echo '<tr>';
                    echo '<td>';
                        echo $promotie->Marca;
                    echo '</td>';
                echo '</tr>';                  

            echo '<tr>'; // start product stuff
            echo '</tr>'; // end of product stuff

            $previous = $promotie->Marca;
        echo '</tbody>';
        echo '</table>';

Mine is PHPEd from NuSphere, amazing product, it's not free but it's worth the money.

Code suggestion is not case sensitive, great syntax highlighting, framework support, etc.

diafol commented: Looks interesting +15

Hi guys,

I have one simple logical question that I seem not to figure it out, sadly...

We have a list of objects and I loop trough them, list of products.
We need to create anchor maps for each category, so I did a comparison with temp variables to check the previous and current element value.

How can I display only the first occurence of a series of values for each category ?

Desired result:

Category 1

  • product 1
  • product 2
  • product 3
    Category 2
  • product 1
  • product 2
  • product 3

    $previous = '';
    if(!empty($promotii)) {
        foreach($promotii as $promotie) {
            $previous = $promotie->Marca;
        $previous = $promotie->Marca;

Thank you Taywin, you solution was the good one, I've splitted the output in PHP and transformed it in array and counted the same occurences and it worked well!

Because recent modified files do not have year number display in the list. You may try ls -la --full-time and will have to update some of your display.

year=$(date +"%Y")
if [ $# -gt 0 ] ; then
echo $year
list=$(ls -la --full-time | awk -v pattern="$year" '$6 ~ pattern { printf ("%s %s ", $6, $9) }')
echo $list

The above is a quick & dirty test of how to capture all files that were modified at a given year (or the current year if no argument is passed). Column 6 in the list is now yyyy-mm-dd instead of spelling out month name.

Hey guys,

I have this script that does count one year of files, 2014, but when it comes to this year, everything messes up.
How could I count properly for each year in the same script ?

In the attached screenshot it's obvious that I would only need 2014 - all of the months and from 2015 only January, but .... how ?

Thanks in advance!

ls -la |
awk -v year="$(date "+%Y")" 'BEGIN {
        split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec", month, " ")
        for (i=1; i<=12; i++){ 
$8 ~ /:/{$8=year} {
  dat=$8 sprintf("%02d",mdigit[$6]) sprintf("%02d",$7)
END{for(i in a){print i, a[i]|"sort"}}'

Hello, this is what I should do, i know, I will loose some SEO ranking because of this :(

Hi guys,

I have this weird .htaccess rule that is used for a dropdown search engine

RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+) index.php?bla1=$1&bla2=$2... and so on [L]

If I want to maintain the above rule, it is allright.
The problem is that I want to creat a new rule with 3 variables, but the above rule is overwriting everything and it does not let me, what should I do?
If I rewrite the above rule, I will loose some important SEO ranking points.

Thanks in advance,
Szabi Zsoldos

Got my solution.

  MAX(IF(t.AttributeClassValueId = '1', t.AttributeClassValue, NULL)) AS Atribute1,
  MAX(IF(t.AttributeClassValueId = '2', t.AttributeClassValue, NULL)) AS Atribute2,
  MAX(IF(t.AttributeClassValueId = '3', t.AttributeClassValue, NULL)) AS Atribute3,
  MAX(IF(t.AttributeClassValueId = '4', t.AttributeClassValue, NULL)) AS Atribute4,
  MAX(IF(t.AttributeClassValueId = '5', t.AttributeClassValue, NULL)) AS Atribute5
FROM CatSys_products p
    LEFT JOIN CatSys_productAttributeClassValuesFromProducts t ON = t.ProductId
    LEFT JOIN CatSys_productAttributeClassValues a ON t.AttributeClassValueId =
GROUP BY p.SKU, p.productName

Hi guys,

Trying to develop a custom facet like search in Mysql.
I have 3 tables for this:

1.Attribute class
2.Attribute class Name
3.Attribute class Value
    - attributeClassName Id
    - productId

Each product has one attribute class
Each attribute class has many values

Each value is contained in a sepparate row in the AttributeClassValue table, how can i Filter by values in that table ?
Group Concat is not the best solution....

Thank you Dani, good job on finding the problem.

My bad ...

This is the link, int, int)

for the Substring.

Tha application does not stop, it is built upon Spring and this is a file processor that reads all the lines.

As you can see on the first printscreen, the characters are there, but the method exits.

LE: with the standard value.substring() method, it works...

Hello people :)

Having some difficulties regarding a simple substring.
Then length of my line is 52 and I iterate it without any problems.

When I use this untill the 22nd character it is working

final String articleNumber = StringUtils.trimToEmpty(StringUtils.substring(lineValue, 0, 22));

If I want to pass over the 22nd character, everything stops, empty.
Take a look at the StackTrace screenshot...can you figure it out why it is not working ?


        final String articleNumber = StringUtils.trimToEmpty(StringUtils.substring(lineValue, 0, 22));
        final String articleManufacturer = StringUtils.trimToEmpty(StringUtils.substring(lineValue, 22, 4));
        final String descriptionNumber = StringUtils.trimToEmpty(StringUtils.substring(lineValue, 26, 9));

Thank you!

Hey guys,

Just tried to log in on Mozilla Firefox 30.0 and it does not give me an alert toast/message.
My credentials are good because it worked on IE11 and Google Chrome.

I've tried searching something on this topic, but haven't found anything.

Have a great day everybody!

Got it solved with &&

if i use each part separately, it works ...

Hey guys,

Having some difficulties understanding why my OR || operator is not working...
First part is BOOLEAN and it is working
Second part is STRING and it is working, it returns the desired value

What could it be ?

<?php if(($oferte->isOrdered($oferte->CleanSapStyleNumbers($oferta->VBELN)) == false) || ($oferte->OfertaValida($oferte->CleanSapStyleNumbers($oferta->VBELN))->valabilitate == "VALABILA")): ?>
some stuff
<?php endif; ?>

can you post the code from the upload from your script ?

As far it seems, you did not give permission to the Java to load properly.

Forgot to add after the url parameter the data: data, parameter so you can send your values to extract exactly what you need.